merge text-xs override
This commit is contained in:
@@ -118,14 +118,14 @@ var atHeaderSortIconCls = map[AutoTableHeaderColor]string{
|
||||
var HEADER_PADDING_CLS = map[AutoTableSize]string{
|
||||
AUTOTABLE_SIZE_DEFAULT: "p-4 text-sm",
|
||||
AUTOTABLE_SIZE_COMPACT: "py-1.5 px-2 text-sm",
|
||||
AUTOTABLE_SIZE_SUPERCOMPACT: "py-1 px-2 text-xs",
|
||||
AUTOTABLE_SIZE_SUPERCOMPACT: "py-1 px-2 text-ss",
|
||||
}
|
||||
|
||||
// BODY_PADDING_CLS is the body cell padding per table size (applied via [&_td]:).
|
||||
var BODY_PADDING_CLS = map[AutoTableSize]string{
|
||||
AUTOTABLE_SIZE_DEFAULT: "text-sm [&_td]:p-4",
|
||||
AUTOTABLE_SIZE_COMPACT: "text-sm [&_td]:py-1 [&_td]:px-2",
|
||||
AUTOTABLE_SIZE_SUPERCOMPACT: "text-xs [&_td]:py-0.5 [&_td]:px-2",
|
||||
AUTOTABLE_SIZE_SUPERCOMPACT: "text-ss [&_td]:py-0.5 [&_td]:px-2",
|
||||
}
|
||||
|
||||
// atPaginationPaddingCls is the pagination bar padding per table size.
|
||||
@@ -2184,7 +2184,7 @@ const (
|
||||
AUTOTABLE_SEARCH_FIELD = "flex flex-col gap-1 min-w-0 grow sm:grow-0 sm:w-48"
|
||||
AUTOTABLE_SEARCH_SELECT = "w-full rounded-default border border-line-strong bg-surface px-3 py-2 text-sm"
|
||||
AUTOTABLE_FILTERS_TOGGLE = "sm:hidden inline-flex items-center gap-2 rounded-default border border-line-strong px-3 py-2 text-sm"
|
||||
AUTOTABLE_FILTERS_BADGE = "ml-1 inline-flex h-5 min-w-5 items-center justify-center rounded-full bg-sky-600 px-1.5 text-xs font-semibold text-white"
|
||||
AUTOTABLE_FILTERS_BADGE = "ml-1 inline-flex h-5 min-w-5 items-center justify-center rounded-full bg-sky-600 px-1.5 text-ss font-semibold text-white"
|
||||
AUTOTABLE_TOOLBAR = "flex flex-wrap items-end justify-between gap-3 pb-3"
|
||||
AUTOTABLE_ASIDE = "w-full sm:w-64 shrink-0 rounded-default border border-line-strong bg-surface p-3"
|
||||
AUTOTABLE_ACCORDION_CELL = "w-10 text-center"
|
||||
@@ -3141,7 +3141,7 @@ const (
|
||||
|
||||
formulaPlaceholder = `<span class="text-ink-faint">e.g. [Revenue] / SUM({Revenue}) * 100</span>`
|
||||
|
||||
calcMenuTrigger = "inline-flex items-center gap-1 rounded-default border border-line-strong bg-surface-muted px-2 py-1 text-xs leading-none text-ink-soft cursor-pointer hover:bg-surface-raised"
|
||||
calcMenuTrigger = "inline-flex items-center gap-1 rounded-default border border-line-strong bg-surface-muted px-2 py-1 text-ss leading-none text-ink-soft cursor-pointer hover:bg-surface-raised"
|
||||
calcChooserItem = "w-full text-left px-2 py-2 rounded-default hover:bg-surface-raised cursor-pointer border-0 bg-transparent flex items-start gap-2.5"
|
||||
)
|
||||
|
||||
@@ -3630,7 +3630,7 @@ func calcChooserButton(icon, title, subtitle string, onClick func()) *vdom.VNode
|
||||
Icon(icon, 16, "mt-0.5 text-ink-muted"),
|
||||
vdom.Span(vdom.Attr("class", "flex flex-col"),
|
||||
vdom.Span(vdom.Attr("class", "text-sm font-medium text-ink"), vdom.Text(title)),
|
||||
vdom.Span(vdom.Attr("class", "text-xs text-ink-muted"), vdom.Text(subtitle)),
|
||||
vdom.Span(vdom.Attr("class", "text-ss text-ink-muted"), vdom.Text(subtitle)),
|
||||
),
|
||||
)
|
||||
}
|
||||
@@ -3639,7 +3639,7 @@ func calcListRow(title, subtitle string, onEdit, onDelete func()) *vdom.VNode {
|
||||
return vdom.Div(vdom.Attr("class", "flex items-center gap-2 rounded-default px-2 py-1 hover:bg-surface-muted"),
|
||||
vdom.Div(vdom.Attr("class", "min-w-0 grow"),
|
||||
vdom.Div(vdom.Attr("class", "truncate text-sm font-medium text-ink"), vdom.Text(title)),
|
||||
vdom.Div(vdom.Attr("class", "truncate font-mono text-xs text-ink-muted"), vdom.Text(subtitle)),
|
||||
vdom.Div(vdom.Attr("class", "truncate font-mono text-ss text-ink-muted"), vdom.Text(subtitle)),
|
||||
),
|
||||
Button(ButtonProps{Color: ButtonLightNeutral, Small: true, Icon: "pencil", Title: "Edit", OnClick: onEdit}),
|
||||
Button(ButtonProps{Color: ButtonLightNeutral, Small: true, Icon: "trash", Title: "Delete", OnClick: onDelete}),
|
||||
@@ -3793,7 +3793,7 @@ func (s *AutoTableState) calcForm(e *calcEditor, summary bool) *vdom.VNode {
|
||||
}
|
||||
|
||||
if msg := e.errorMsg.Get(); msg != "" {
|
||||
fields = append(fields, vdom.P(vdom.Attr("class", "text-xs text-red-600 dark:text-red-400"), vdom.Text(msg)))
|
||||
fields = append(fields, vdom.P(vdom.Attr("class", "text-ss text-red-600 dark:text-red-400"), vdom.Text(msg)))
|
||||
}
|
||||
|
||||
saveLabel := "Add"
|
||||
@@ -3897,7 +3897,7 @@ func (s *AutoTableState) calcBasicEditor(e *calcEditor, summary bool) *vdom.VNod
|
||||
})))
|
||||
}
|
||||
|
||||
children = append(children, vdom.P(vdom.Attr("class", "text-xs text-ink-muted"),
|
||||
children = append(children, vdom.P(vdom.Attr("class", "text-ss text-ink-muted"),
|
||||
vdom.Text(calcBasicHint(e, summary))))
|
||||
|
||||
return vdom.Div(kids([]vdom.Mod{vdom.Attr("class", "flex flex-col gap-2")}, children)...)
|
||||
@@ -3929,11 +3929,11 @@ func (s *AutoTableState) calcAdvancedEditor(e *calcEditor, summary bool) *vdom.V
|
||||
colItems = append(colItems,
|
||||
e.colMenu.Item(MenuItemProps{OnClick: func() { e.insertAtCaret("[" + label + "]") }},
|
||||
vdom.Span(vdom.Attr("class", "font-mono text-sky-600 dark:text-sky-400"), vdom.Text("["+label+"]")),
|
||||
vdom.Span(vdom.Attr("class", "ml-2 text-xs text-ink-muted"), vdom.Text("this row")),
|
||||
vdom.Span(vdom.Attr("class", "ml-2 text-ss text-ink-muted"), vdom.Text("this row")),
|
||||
),
|
||||
e.colMenu.Item(MenuItemProps{OnClick: func() { e.insertAtCaret("{" + label + "}") }},
|
||||
vdom.Span(vdom.Attr("class", "font-mono text-violet-600 dark:text-violet-400"), vdom.Text("{"+label+"}")),
|
||||
vdom.Span(vdom.Attr("class", "ml-2 text-xs text-ink-muted"), vdom.Text("whole column")),
|
||||
vdom.Span(vdom.Attr("class", "ml-2 text-ss text-ink-muted"), vdom.Text("whole column")),
|
||||
),
|
||||
)
|
||||
}
|
||||
@@ -3945,7 +3945,7 @@ func (s *AutoTableState) calcAdvancedEditor(e *calcEditor, summary bool) *vdom.V
|
||||
groups := filterFormulaGroups(e.fnSearch.Get())
|
||||
if len(groups) == 0 {
|
||||
fnItems = append(fnItems, vdom.Div(
|
||||
vdom.Attr("class", "px-2 py-3 text-center text-xs text-ink-muted"),
|
||||
vdom.Attr("class", "px-2 py-3 text-center text-ss text-ink-muted"),
|
||||
vdom.Text("No functions match"),
|
||||
))
|
||||
}
|
||||
@@ -3959,8 +3959,8 @@ func (s *AutoTableState) calcAdvancedEditor(e *calcEditor, summary bool) *vdom.V
|
||||
vdom.Div(vdom.Attr("class", "flex flex-col items-start gap-0.5 min-w-0"),
|
||||
// The signature is syntax-highlighted with the same highlighter the
|
||||
// formula box uses, so the menu and the editor speak one language.
|
||||
vdom.Span(vdom.Attr("class", "font-mono text-xs"), vdom.Raw(HighlightFormula(f.Sig))),
|
||||
vdom.Span(vdom.Attr("class", "text-xs text-ink-muted"), vdom.Text(f.Desc)),
|
||||
vdom.Span(vdom.Attr("class", "font-mono text-ss"), vdom.Raw(HighlightFormula(f.Sig))),
|
||||
vdom.Span(vdom.Attr("class", "text-ss text-ink-muted"), vdom.Text(f.Desc)),
|
||||
),
|
||||
))
|
||||
}
|
||||
@@ -3973,8 +3973,8 @@ func (s *AutoTableState) calcAdvancedEditor(e *calcEditor, summary bool) *vdom.V
|
||||
OnClick: func() { e.insertAtCaret(cc.Name) },
|
||||
},
|
||||
vdom.Div(vdom.Attr("class", "flex flex-col items-start gap-0.5"),
|
||||
vdom.Span(vdom.Attr("class", "font-mono text-xs text-amber-600 dark:text-amber-400"), vdom.Text(cc.Name)),
|
||||
vdom.Span(vdom.Attr("class", "text-xs text-ink-muted"), vdom.Text(cc.Desc)),
|
||||
vdom.Span(vdom.Attr("class", "font-mono text-ss text-amber-600 dark:text-amber-400"), vdom.Text(cc.Name)),
|
||||
vdom.Span(vdom.Attr("class", "text-ss text-ink-muted"), vdom.Text(cc.Desc)),
|
||||
),
|
||||
))
|
||||
}
|
||||
@@ -4028,7 +4028,7 @@ func (s *AutoTableState) calcAdvancedEditor(e *calcEditor, summary bool) *vdom.V
|
||||
),
|
||||
)
|
||||
|
||||
help := vdom.P(vdom.Attr("class", "text-xs text-ink-muted"),
|
||||
help := vdom.P(vdom.Attr("class", "text-ss text-ink-muted"),
|
||||
vdom.Text("[Column] is this row's cell · {Column} is the whole column · {Column:1:ROW()} is a running total."))
|
||||
|
||||
children := []*vdom.VNode{menus, editor, help}
|
||||
@@ -4048,7 +4048,7 @@ func (e *calcEditor) fnSearchBox() *vdom.VNode {
|
||||
vdom.Input(
|
||||
vdom.WithRef(e.fnSearchRef),
|
||||
vdom.Attr("type", "text"),
|
||||
vdom.Attr("class", "w-full rounded-default border border-line-strong p-1 text-xs focus:outline-2 focus:outline-sky-500"),
|
||||
vdom.Attr("class", "w-full rounded-default border border-line-strong p-1 text-ss focus:outline-2 focus:outline-sky-500"),
|
||||
vdom.Attr("placeholder", "Search functions…"),
|
||||
vdom.Attr("spellcheck", "false"),
|
||||
vdom.Prop("value", e.fnSearch.Get()),
|
||||
@@ -4089,12 +4089,12 @@ func (s *AutoTableState) calcPreview(e *calcEditor, src string, summary bool) *v
|
||||
return nil
|
||||
}
|
||||
if _, err := CompileFormula(src); err != nil {
|
||||
return vdom.P(vdom.Attr("class", "text-xs text-red-600 dark:text-red-400"), vdom.Text(err.Error()))
|
||||
return vdom.P(vdom.Attr("class", "text-ss text-red-600 dark:text-red-400"), vdom.Text(err.Error()))
|
||||
}
|
||||
|
||||
rows := s.FilteredRows()
|
||||
if len(rows) == 0 {
|
||||
return vdom.P(vdom.Attr("class", "text-xs text-ink-muted"), vdom.Text("Formula is valid."))
|
||||
return vdom.P(vdom.Attr("class", "text-ss text-ink-muted"), vdom.Text("Formula is valid."))
|
||||
}
|
||||
ctx := NewCalcContext(rows, s.cols, s.Calculated(), s.read)
|
||||
|
||||
@@ -4107,10 +4107,10 @@ func (s *AutoTableState) calcPreview(e *calcEditor, src string, summary bool) *v
|
||||
|
||||
n, err := EvalFormula(src, target)
|
||||
if err != nil {
|
||||
return vdom.P(vdom.Attr("class", "text-xs text-red-600 dark:text-red-400"), vdom.Text(err.Error()))
|
||||
return vdom.P(vdom.Attr("class", "text-ss text-red-600 dark:text-red-400"), vdom.Text(err.Error()))
|
||||
}
|
||||
out := FormatCalcResult(n, CalculatedDataType(e.dataType.Get()), calcPrecisionOf(e.precision.Get()), "", "", "")
|
||||
return vdom.P(vdom.Attr("class", "text-xs text-ink-muted"), vdom.Text(prefix+out))
|
||||
return vdom.P(vdom.Attr("class", "text-ss text-ink-muted"), vdom.Text(prefix+out))
|
||||
}
|
||||
|
||||
// insertAtCaret drops text where the cursor is, rather than at the end — which is
|
||||
@@ -4141,7 +4141,7 @@ func (e *calcEditor) insertAtCaretOffset(text string, back int) {
|
||||
|
||||
func calcField(label string, children ...*vdom.VNode) *vdom.VNode {
|
||||
nodes := []*vdom.VNode{
|
||||
vdom.Span(vdom.Attr("class", "text-xs font-medium text-ink-soft"), vdom.Text(label)),
|
||||
vdom.Span(vdom.Attr("class", "text-ss font-medium text-ink-soft"), vdom.Text(label)),
|
||||
}
|
||||
nodes = append(nodes, children...)
|
||||
return vdom.Div(kids([]vdom.Mod{vdom.Attr("class", "flex flex-col gap-1")}, nodes)...)
|
||||
|
||||
@@ -13,7 +13,7 @@ const (
|
||||
BadgeMuted = "muted"
|
||||
)
|
||||
|
||||
const badgeBase = "inline-flex items-center gap-1 text-xs font-semibold py-0.5 px-2 rounded-default whitespace-nowrap"
|
||||
const badgeBase = "inline-flex items-center gap-1 text-ss font-semibold py-0.5 px-2 rounded-default whitespace-nowrap"
|
||||
|
||||
var badgeColors = map[string]string{
|
||||
"green": "text-white bg-green-700",
|
||||
|
||||
@@ -171,7 +171,7 @@ type SegmentedButtonOption struct {
|
||||
func SegmentedButtons(options []SegmentedButtonOption, value string, onChange func(string), small bool, class string) *vdom.VNode {
|
||||
sizeCls := "py-1 px-3 text-sm"
|
||||
if small {
|
||||
sizeCls = "py-0.5 px-2 text-xs"
|
||||
sizeCls = "py-0.5 px-2 text-ss"
|
||||
}
|
||||
const baseCls = "inline-flex items-center justify-center gap-1.5 flex-1 cursor-pointer font-medium transition-colors whitespace-nowrap disabled:opacity-50 disabled:cursor-not-allowed"
|
||||
const activeCls = "bg-surface text-text-heading shadow-sm"
|
||||
|
||||
@@ -38,14 +38,14 @@ const calMyMonth = "text-lg font-heading mx-4 flex-1 text-center font-semibold t
|
||||
|
||||
const calWeekdaysPicker = "grid grid-cols-7 gap-[2px] mb-1"
|
||||
const calWeekdaysMonth = "grid grid-cols-7 border-b border-line"
|
||||
const calWeekdayPicker = "text-center text-xs font-semibold text-text-muted p-1"
|
||||
const calWeekdayMonth = "text-center text-xs font-semibold text-text-muted p-2 uppercase tracking-wider"
|
||||
const calWeekdayPicker = "text-center text-ss font-semibold text-text-muted p-1"
|
||||
const calWeekdayMonth = "text-center text-ss font-semibold text-text-muted p-2 uppercase tracking-wider"
|
||||
|
||||
const calDaysPicker = "grid grid-cols-7 gap-[2px]"
|
||||
const calDaysMonth = "grid grid-cols-7"
|
||||
|
||||
const calDayPickerBase = "aspect-square flex items-center justify-center text-sm bg-transparent border-0 rounded-sm cursor-pointer text-text-body p-0"
|
||||
const calDayMonthBase = "min-h-[6.5rem] flex flex-col items-stretch justify-start p-1.5 border-r border-b border-line text-left gap-1 text-xs bg-transparent cursor-pointer"
|
||||
const calDayMonthBase = "min-h-[6.5rem] flex flex-col items-stretch justify-start p-1.5 border-r border-b border-line text-left gap-1 text-ss bg-transparent cursor-pointer"
|
||||
|
||||
const calSelect = "flex-1 py-1 px-2 text-sm font-semibold border border-line rounded-sm bg-surface text-text-heading cursor-pointer focus:outline-hidden focus:border-primary"
|
||||
|
||||
|
||||
@@ -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-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"
|
||||
const GridHeaderCls = "border-b border-r border-line-strong bg-surface-muted px-1.5 py-1.5 text-left text-ss 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+)?`)
|
||||
@@ -467,7 +467,7 @@ func CellGrid(p CellGridProps) *vdom.VNode {
|
||||
|
||||
tableCls := "min-w-full w-max border-collapse text-sm"
|
||||
if p.Dense {
|
||||
tableCls = "min-w-full w-max border-collapse text-xs"
|
||||
tableCls = "min-w-full w-max border-collapse text-ss"
|
||||
}
|
||||
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),
|
||||
|
||||
@@ -308,7 +308,7 @@ func (c *Chart) positionTip(left, top float64, transform string) {
|
||||
// pass so its ref stays valid; onMove positions it imperatively. When there is no hover it
|
||||
// is present but hidden — the same slot each render keeps the reconciler's diff stable.
|
||||
func (c *Chart) tooltipNode(p ChartProps, hv int) *vdom.VNode {
|
||||
base := "pointer-events-none absolute z-10 max-w-64 rounded-default border border-line bg-surface px-3 py-2 text-xs shadow-lg"
|
||||
base := "pointer-events-none absolute z-10 max-w-64 rounded-default border border-line bg-surface px-3 py-2 text-ss shadow-lg"
|
||||
if p.NoTooltip || hv < 0 || hv >= chartN(p) {
|
||||
return vdom.Div(vdom.WithRef(c.tipRef), vdom.Attr("class", cx(base, "hidden")))
|
||||
}
|
||||
@@ -1086,10 +1086,10 @@ func (c *Chart) legend(p ChartProps) *vdom.VNode {
|
||||
it := it // capture per iteration for the click closure
|
||||
off := !chartShown(p, it.i)
|
||||
swatchStyle := "background-color:" + chartColor(p, it.i)
|
||||
labelClass := "text-xs text-ink-soft"
|
||||
labelClass := "text-ss text-ink-soft"
|
||||
if off {
|
||||
swatchStyle += ";opacity:0.35"
|
||||
labelClass = "text-xs text-ink-faint line-through"
|
||||
labelClass = "text-ss text-ink-faint line-through"
|
||||
}
|
||||
nodes = append(nodes, vdom.El("button",
|
||||
vdom.Attr("type", "button"),
|
||||
|
||||
@@ -52,7 +52,7 @@ const crmTabRow = "flex w-full overflow-x-auto text-sm"
|
||||
const crmTabBase = "flex items-center gap-1.5 cursor-pointer p-4 font-medium border-line-strong transition-colors"
|
||||
const crmTabInactive = "border-b text-ink-muted hover:text-ink"
|
||||
const crmTabActive = "border-x border-t-2 border-t-sky-700 text-accent"
|
||||
const crmTabBadge = "inline-flex items-center justify-center min-w-5 h-5 px-1 text-xs font-semibold bg-primary text-white rounded-full"
|
||||
const crmTabBadge = "inline-flex items-center justify-center min-w-5 h-5 px-1 text-ss font-semibold bg-primary text-white rounded-full"
|
||||
|
||||
// CrmTabGroup renders boxed tabs with a sky-blue top accent; content sits flat
|
||||
// beneath the row (no body panel), with a trailing filler extending the baseline.
|
||||
@@ -95,7 +95,7 @@ const crmSubTabBase = "flex items-center gap-1.5 py-1 px-3 cursor-pointer font-m
|
||||
const crmSubTabDivider = "border-l border-line-strong"
|
||||
const crmSubTabActive = "bg-neutral-500 text-white"
|
||||
const crmSubTabInactive = "bg-surface text-ink-soft hover:bg-surface-raised hover:text-ink"
|
||||
const crmSubTabBadge = "inline-flex items-center justify-center min-w-5 h-5 px-1 text-xs font-semibold bg-black/10 text-current rounded-full"
|
||||
const crmSubTabBadge = "inline-flex items-center justify-center min-w-5 h-5 px-1 text-ss font-semibold bg-black/10 text-current rounded-full"
|
||||
|
||||
// CrmSubTabGroup renders a left-aligned segmented control (interlocking
|
||||
// segments) with a full-width baseline separating the bar from the content.
|
||||
|
||||
@@ -26,8 +26,8 @@ import (
|
||||
const formInputBase = "bg-surface block w-full border rounded-default shadow-xs text-sm focus:outline-2 focus:outline-offset-1 disabled:bg-surface-raised disabled:cursor-not-allowed"
|
||||
const formInputBaseDark = "bg-dark text-text-on-dark placeholder:text-text-on-dark-faint block w-full border rounded-default shadow-xs text-sm focus:outline-2 focus:outline-offset-1 disabled:opacity-50 disabled:cursor-not-allowed"
|
||||
|
||||
const formErrorCls = "block text-red-600 dark:text-red-400 text-xs mt-1"
|
||||
const formSuccessCls = "block text-green-600 text-xs mt-1"
|
||||
const formErrorCls = "block text-red-600 dark:text-red-400 text-ss mt-1"
|
||||
const formSuccessCls = "block text-green-600 text-ss mt-1"
|
||||
const formInputGroupCls = "flex flex-row items-stretch w-full text-sm"
|
||||
|
||||
const formTriggerBase = "bg-surface border border-line-strong rounded-default shadow-xs text-sm w-full text-left flex items-center justify-between gap-2 cursor-pointer disabled:bg-surface-raised disabled:cursor-not-allowed"
|
||||
@@ -1312,7 +1312,7 @@ func (m *MultiSelect) triggerFace(p FormMultiSelectProps, selected []FormSelectO
|
||||
|
||||
pillCls := formMultiSelectTag
|
||||
if p.Small {
|
||||
pillCls = cx(pillCls, "px-1.5 text-xs")
|
||||
pillCls = cx(pillCls, "px-1.5 text-ss")
|
||||
} else {
|
||||
pillCls = cx(pillCls, "px-2 text-sm")
|
||||
}
|
||||
|
||||
@@ -275,7 +275,7 @@ func fuzzyScoreBadge(show bool, score int) *vdom.VNode {
|
||||
if !show {
|
||||
return nil
|
||||
}
|
||||
return vdom.Span(vdom.Attr("class", "ml-3 shrink-0 text-xs text-ink-faint"), vdom.Text(strconv.Itoa(score)))
|
||||
return vdom.Span(vdom.Attr("class", "ml-3 shrink-0 text-ss text-ink-faint"), vdom.Text(strconv.Itoa(score)))
|
||||
}
|
||||
|
||||
// fuzzyListView renders the inline "list" display. Before the user types, all
|
||||
|
||||
@@ -15,7 +15,7 @@ func Divider() *vdom.VNode { return vdom.Hr(vdom.Attr("class", "text-line mt-1 m
|
||||
|
||||
// CodeBox renders a dark monospace code block.
|
||||
func CodeBox(code, class string) *vdom.VNode {
|
||||
return vdom.Div(vdom.Attr("class", cx("text-xs p-3 bg-neutral-800 text-neutral-100 border border-neutral-700 rounded-default", class)),
|
||||
return vdom.Div(vdom.Attr("class", cx("text-ss p-3 bg-neutral-800 text-neutral-100 border border-neutral-700 rounded-default", class)),
|
||||
vdom.Pre(vdom.Code(vdom.Text(code))),
|
||||
)
|
||||
}
|
||||
@@ -58,7 +58,7 @@ type BreadcrumbItem struct {
|
||||
// Breadcrumbs renders a chevron-separated crumb trail; the last item is bold and
|
||||
// not linked.
|
||||
func Breadcrumbs(items []BreadcrumbItem) *vdom.VNode {
|
||||
mods := []vdom.Mod{vdom.Attr("class", "flex flex-row items-center text-ink-faint text-xs")}
|
||||
mods := []vdom.Mod{vdom.Attr("class", "flex flex-row items-center text-ink-faint text-ss")}
|
||||
for i, crumb := range items {
|
||||
if i != len(items)-1 {
|
||||
mods = append(mods, vdom.Span(vdom.Attr("class", "flex items-center"),
|
||||
|
||||
@@ -109,7 +109,7 @@ var modalSizes = map[ModalSize]string{
|
||||
Modal2XLarge: "max-w-5xl",
|
||||
Modal3XLarge: "max-w-6xl",
|
||||
Modal4XLarge: "max-w-7xl",
|
||||
Modal5XLarge: "max-w-[90rem]",
|
||||
Modal5XLarge: "max-w-8xl",
|
||||
ModalFull: "max-w-none",
|
||||
}
|
||||
|
||||
@@ -137,12 +137,12 @@ var modalConfirmOkVariants = map[string]string{
|
||||
const modalWizardHeader = "flex flex-col items-center gap-2 flex-1"
|
||||
const modalWizardTitleRow = "flex items-center justify-between w-full"
|
||||
const modalWizardTitle = "text-xl"
|
||||
const modalWizardStepName = "text-xs font-semibold text-ink-soft uppercase tracking-wider"
|
||||
const modalWizardStepName = "text-ss font-semibold text-ink-soft uppercase tracking-wider"
|
||||
const modalWizardSteps = "flex items-center justify-between relative w-full max-w-64"
|
||||
const modalWizardTrack = "absolute top-1/2 left-0 right-0 h-0.5 bg-surface-strong -translate-y-1/2"
|
||||
const modalWizardTrackFill = "h-full bg-primary transition-[width] duration-300 ease-in-out"
|
||||
const modalWizardStepWrap = "relative z-[1]"
|
||||
const modalStepIndicatorBase = "w-7 h-7 rounded-full flex items-center justify-center text-xs font-semibold border-2 shrink-0 transition-all duration-300 ease-in-out"
|
||||
const modalStepIndicatorBase = "w-7 h-7 rounded-full flex items-center justify-center text-ss font-semibold border-2 shrink-0 transition-all duration-300 ease-in-out"
|
||||
const modalStepIndicatorPending = "border-line-strong text-ink-faint bg-surface"
|
||||
const modalStepIndicatorActive = "bg-primary text-white border-primary"
|
||||
const modalStepIndicatorCompleted = "bg-primary text-white border-primary"
|
||||
|
||||
@@ -80,13 +80,13 @@ var ptRowHoverCls = map[PrettyTableHeaderColor]string{
|
||||
var ptHeaderPaddingCls = map[PrettyTableSize]string{
|
||||
PrettyTableSizeDefault: "p-4 text-sm",
|
||||
PrettyTableSizeCompact: "py-1.5 px-2 text-sm",
|
||||
PrettyTableSizeSuperCompact: "py-1 px-2 text-xs",
|
||||
PrettyTableSizeSuperCompact: "py-1 px-2 text-ss",
|
||||
}
|
||||
|
||||
var ptBodyPaddingCls = map[PrettyTableSize]string{
|
||||
PrettyTableSizeDefault: "text-sm [&_td]:p-4",
|
||||
PrettyTableSizeCompact: "text-sm [&_td]:py-1 [&_td]:px-2",
|
||||
PrettyTableSizeSuperCompact: "text-xs [&_td]:py-0.5 [&_td]:px-2",
|
||||
PrettyTableSizeSuperCompact: "text-ss [&_td]:py-0.5 [&_td]:px-2",
|
||||
}
|
||||
|
||||
var ptPosCls = map[PrettyTableColumnPosition]string{
|
||||
|
||||
@@ -7,7 +7,7 @@ import "kjol/wasmruntime/vdom"
|
||||
const sidebarNavRoot = "bg-surface rounded-default shadow-sm border border-line py-2"
|
||||
const sidebarNavList = "list-none m-0 p-0"
|
||||
const sidebarNavBtn = "w-full text-left py-2 pr-3 pl-4 text-sm cursor-pointer bg-transparent text-ink-soft border-0 hover:text-ink hover:bg-surface-muted"
|
||||
const sidebarNavSubBtn = "w-full text-left py-1.5 pr-3 pl-8 text-xs cursor-pointer bg-transparent text-ink-muted border-0 hover:text-ink hover:bg-surface-muted"
|
||||
const sidebarNavSubBtn = "w-full text-left py-1.5 pr-3 pl-8 text-ss cursor-pointer bg-transparent text-ink-muted border-0 hover:text-ink hover:bg-surface-muted"
|
||||
const sidebarNavIcon = "mr-2"
|
||||
|
||||
const sidebarLayoutRoot = "grid grid-cols-1 gap-8 min-h-screen items-start lg:grid-cols-12"
|
||||
|
||||
@@ -135,7 +135,7 @@ func (s *SignaturePad) Render(p SignaturePadProps) *vdom.VNode {
|
||||
}
|
||||
clear := []vdom.Mod{
|
||||
vdom.Attr("type", "button"),
|
||||
vdom.Attr("class", "text-xs text-ink-muted hover:text-ink disabled:opacity-50"),
|
||||
vdom.Attr("class", "text-ss text-ink-muted hover:text-ink disabled:opacity-50"),
|
||||
vdom.Text(pick(p.ClearText, "Clear")),
|
||||
}
|
||||
if p.Disabled || s.IsEmpty() {
|
||||
@@ -145,7 +145,7 @@ func (s *SignaturePad) Render(p SignaturePadProps) *vdom.VNode {
|
||||
}
|
||||
kids = append(kids, vdom.Div(
|
||||
vdom.Attr("class", "flex items-center justify-between border-t border-line bg-surface-muted px-2 py-1"),
|
||||
vdom.Span(vdom.Attr("class", "text-xs italic text-ink-faint"), vdom.Text(hint)),
|
||||
vdom.Span(vdom.Attr("class", "text-ss italic text-ink-faint"), vdom.Text(hint)),
|
||||
vdom.Button(clear...),
|
||||
))
|
||||
}
|
||||
|
||||
@@ -113,7 +113,7 @@ func TabGroup(p TabGroupProps) *vdom.VNode {
|
||||
vdom.Text(item.Title),
|
||||
}
|
||||
if item.Badge > 0 {
|
||||
btn = append(btn, vdom.Span(vdom.Attr("class", "inline-flex items-center justify-center min-w-5 h-5 px-1 text-xs font-semibold bg-primary text-white rounded-full"),
|
||||
btn = append(btn, vdom.Span(vdom.Attr("class", "inline-flex items-center justify-center min-w-5 h-5 px-1 text-ss font-semibold bg-primary text-white rounded-full"),
|
||||
vdom.Text(strconv.Itoa(item.Badge))))
|
||||
}
|
||||
header = append(header, vdom.Button(btn...))
|
||||
|
||||
@@ -56,7 +56,7 @@ func ToggleSwitch(checked bool, onChange func(bool), label, description string,
|
||||
vdom.Text(label)))
|
||||
}
|
||||
if description != "" {
|
||||
text = append(text, vdom.Span(vdom.Attr("class", "text-xs text-ink-muted"), vdom.Text(description)))
|
||||
text = append(text, vdom.Span(vdom.Attr("class", "text-ss text-ink-muted"), vdom.Text(description)))
|
||||
}
|
||||
mods = append(mods, vdom.Div(text...))
|
||||
}
|
||||
|
||||
@@ -704,7 +704,7 @@ func (t *Tutorial) content(step *TutorialStep, idx, total int) *vdom.VNode {
|
||||
headerLeft = append(headerLeft, vdom.Span(vdom.Attr("class", "font-medium text-ink"),
|
||||
vdom.Text(step.Title)))
|
||||
}
|
||||
headerLeft = append(headerLeft, vdom.Span(vdom.Attr("class", "text-xs text-ink-muted"),
|
||||
headerLeft = append(headerLeft, vdom.Span(vdom.Attr("class", "text-ss text-ink-muted"),
|
||||
vdom.Text(strconv.Itoa(idx+1)+" of "+strconv.Itoa(total))))
|
||||
|
||||
header := vdom.Div(vdom.Attr("class", "flex items-center justify-between p-4 pb-2"),
|
||||
|
||||
@@ -221,7 +221,7 @@ func (c *USHeatmap) onMove(e vdom.Event) {
|
||||
// tooltipNode is the HTML tooltip (absolute, pointer-events-none), rendered every pass so
|
||||
// its ref stays valid; onMove positions it imperatively. Hidden when nothing is hovered.
|
||||
func (c *USHeatmap) tooltipNode(p USHeatmapProps, hv usHover, mn, mx float64, steps int) *vdom.VNode {
|
||||
base := "pointer-events-none absolute z-10 min-w-28 max-w-64 rounded-default border border-line bg-surface px-3 py-2 text-xs shadow-lg"
|
||||
base := "pointer-events-none absolute z-10 min-w-28 max-w-64 rounded-default border border-line bg-surface px-3 py-2 text-ss shadow-lg"
|
||||
if p.NoTooltip || hv.kind == "" {
|
||||
return vdom.Div(vdom.WithRef(c.tipRef), vdom.Attr("class", cx(base, "hidden")))
|
||||
}
|
||||
@@ -387,7 +387,7 @@ func choroplethLegend(mn, mx float64, steps int, fmt func(float64) string) *vdom
|
||||
vdom.Attr("style", "background-color:var(--color-choropleth-"+strconv.Itoa(k)+")")))
|
||||
}
|
||||
ramp := vdom.Div(kids([]vdom.Mod{vdom.Attr("class", "flex overflow-hidden rounded-xs")}, swatches)...)
|
||||
return vdom.Div(vdom.Attr("class", "mt-3 flex items-center gap-2 text-xs text-ink-muted"),
|
||||
return vdom.Div(vdom.Attr("class", "mt-3 flex items-center gap-2 text-ss text-ink-muted"),
|
||||
vdom.Span(vdom.Attr("style", "font-variant-numeric:tabular-nums"), vdom.Text(fmt(mn))),
|
||||
ramp,
|
||||
vdom.Span(vdom.Attr("style", "font-variant-numeric:tabular-nums"), vdom.Text(fmt(mx))),
|
||||
|
||||
Reference in New Issue
Block a user