Add landing page for kjol, documentation
This commit is contained in:
@@ -35,7 +35,7 @@ import (
|
||||
|
||||
// GridHeaderCls is the base <th> class for CellGrid headers (exported, matching
|
||||
// the TSX GRID_HEADER_CLS).
|
||||
const GridHeaderCls = "border-b border-r border-neutral-300 bg-neutral-50 px-1.5 py-1.5 text-left text-xs font-bold uppercase text-black whitespace-nowrap last:border-r-0"
|
||||
const GridHeaderCls = "border-b border-r border-line-strong bg-surface-muted px-1.5 py-1.5 text-left text-xs font-bold uppercase text-ink whitespace-nowrap last:border-r-0"
|
||||
|
||||
var cgLeadingDigits = regexp.MustCompile(`^\d+`)
|
||||
var cgLeadingFloat = regexp.MustCompile(`^[+-]?(?:\d+\.?\d*|\.\d+)(?:[eE][+-]?\d+)?`)
|
||||
@@ -185,7 +185,7 @@ type SortableHeaderProps struct {
|
||||
// column and calls OnSort(SortKey) on click.
|
||||
func SortableHeader(p SortableHeaderProps) *vdom.VNode {
|
||||
isActive := p.SortKey != "" && p.Current == p.SortKey
|
||||
cls := GridHeaderCls + " cursor-pointer select-none hover:bg-neutral-200"
|
||||
cls := GridHeaderCls + " cursor-pointer select-none hover:bg-surface-strong"
|
||||
if sz := cellGridColumnSize(p.Width, p.MinWidth); sz != "" {
|
||||
cls += " " + sz
|
||||
}
|
||||
@@ -311,9 +311,9 @@ func CellGrid(p CellGridProps) *vdom.VNode {
|
||||
if p.Dense {
|
||||
rowHCls = "h-6"
|
||||
}
|
||||
readonlyTdCls := "border-b border-r border-neutral-300 bg-black/5 px-2 text-neutral-700 align-middle " + rowHCls
|
||||
const editableTdCls = "border-b border-r border-neutral-300 p-0 relative align-middle"
|
||||
const inputCls = "absolute inset-0 w-full border-none outline-none bg-transparent px-2 placeholder:text-neutral-400 focus:bg-red-50 focus:shadow-[inset_0_0_0_2px_var(--color-red-500)]"
|
||||
readonlyTdCls := "border-b border-r border-line-strong bg-black/5 px-2 text-ink-soft align-middle " + rowHCls
|
||||
const editableTdCls = "border-b border-r border-line-strong p-0 relative align-middle"
|
||||
const inputCls = "absolute inset-0 w-full border-none outline-none bg-transparent px-2 placeholder:text-ink-faint focus:bg-red-50 dark:bg-red-950 focus:shadow-[inset_0_0_0_2px_var(--color-red-500)]"
|
||||
|
||||
conflicts := cellGridConflictSets(p)
|
||||
isConflict := func(field string, value any) bool {
|
||||
@@ -417,7 +417,7 @@ func CellGrid(p CellGridProps) *vdom.VNode {
|
||||
if inList {
|
||||
tdCls += " relative"
|
||||
if hasConflict {
|
||||
tdCls += " bg-amber-100"
|
||||
tdCls += " bg-amber-100 dark:bg-amber-900"
|
||||
}
|
||||
}
|
||||
im := col.InputMode
|
||||
@@ -441,7 +441,7 @@ func CellGrid(p CellGridProps) *vdom.VNode {
|
||||
)
|
||||
mods := []vdom.Mod{vdom.Attr("class", tdCls), input}
|
||||
if inList && hasConflict {
|
||||
mods = append(mods, vdom.Span(vdom.Attr("class", "pointer-events-none absolute right-0.5 top-1/2 -translate-y-1/2 text-amber-600"),
|
||||
mods = append(mods, vdom.Span(vdom.Attr("class", "pointer-events-none absolute right-0.5 top-1/2 -translate-y-1/2 text-amber-600 dark:text-amber-400"),
|
||||
vdom.Attr("title", "Duplicate value"),
|
||||
Icon("triangle-exclamation", 12, ""),
|
||||
))
|
||||
@@ -461,7 +461,7 @@ func CellGrid(p CellGridProps) *vdom.VNode {
|
||||
for _, col := range p.Columns {
|
||||
cells = append(cells, renderCell(row, col))
|
||||
}
|
||||
bodyRows = append(bodyRows, vdom.Tr(kids([]vdom.Mod{vdom.Attr("class", "odd:bg-white even:bg-neutral-100")}, cells)...))
|
||||
bodyRows = append(bodyRows, vdom.Tr(kids([]vdom.Mod{vdom.Attr("class", "odd:bg-surface even:bg-surface-raised")}, cells)...))
|
||||
}
|
||||
tbody := vdom.Tbody(kids(nil, bodyRows)...)
|
||||
|
||||
@@ -469,7 +469,7 @@ func CellGrid(p CellGridProps) *vdom.VNode {
|
||||
if p.Dense {
|
||||
tableCls = "min-w-full w-max border-collapse text-xs"
|
||||
}
|
||||
return vdom.Div(vdom.Attr("class", "relative max-w-full overflow-x-auto border border-neutral-300 rounded-default bg-white tabular-nums"),
|
||||
return vdom.Div(vdom.Attr("class", "relative max-w-full overflow-x-auto border border-line-strong rounded-default bg-surface tabular-nums"),
|
||||
vdom.Table(vdom.Attr("class", tableCls), thead, tbody),
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user