@gears-frontx/ui-kit 0.4.0-alpha.4 → 0.4.0-alpha.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/accordion.js +7 -7
- package/dist/alert-dialog.js +21 -21
- package/dist/alert.js +19 -19
- package/dist/attachment.js +11 -11
- package/dist/avatar.js +33 -33
- package/dist/badge.js +48 -25
- package/dist/badge.js.map +1 -1
- package/dist/bubble.js +38 -38
- package/dist/button-group.js +8 -8
- package/dist/button.js +40 -34
- package/dist/button.js.map +1 -1
- package/dist/calendar.js +30 -30
- package/dist/card.js +56 -33
- package/dist/card.js.map +1 -1
- package/dist/chart.js +183 -115
- package/dist/chart.js.map +1 -1
- package/dist/checkbox.js +12 -12
- package/dist/checkbox.js.map +1 -1
- package/dist/chunks/accordion.CXlSdkrc.css +1 -0
- package/dist/chunks/alert-dialog.C4aLtUC8.css +1 -0
- package/dist/chunks/alert.DsgRIXLn.css +1 -0
- package/dist/chunks/attachment.CZuZdlXC.css +1 -0
- package/dist/chunks/avatar.BMm-Z9l5.css +1 -0
- package/dist/chunks/badge.BCreEn3O.css +1 -0
- package/dist/chunks/bubble.Ccu0e3lY.css +1 -0
- package/dist/chunks/button-group.BB-_2uav.css +1 -0
- package/dist/chunks/button.DgUTlW0_.css +1 -0
- package/dist/chunks/calendar.Dtndav4F.css +1 -0
- package/dist/chunks/card.DdBl-usf.css +1 -0
- package/dist/chunks/checkbox.CrdIZhi1.css +1 -0
- package/dist/chunks/collapsible.BkLeBug_.css +1 -0
- package/dist/chunks/combobox.DZZ3tHP_.css +1 -0
- package/dist/chunks/command.BBW1Cy-M.css +1 -0
- package/dist/chunks/context-menu.D_HuTgqL.css +1 -0
- package/dist/chunks/data-table.DJJaM7bh.css +1 -0
- package/dist/chunks/dialog.Cpo8vChK.css +1 -0
- package/dist/chunks/drawer.D8l6-G8t.css +1 -0
- package/dist/chunks/dropdown-menu.TU3FHXbJ.css +1 -0
- package/dist/chunks/empty.DnAKlw2g.css +1 -0
- package/dist/chunks/field.CDoJmJUe.css +1 -0
- package/dist/chunks/hover-card.D00tbys5.css +1 -0
- package/dist/chunks/input-group.C7XgalVn.css +1 -0
- package/dist/chunks/input-otp.Dvxlngb4.css +1 -0
- package/dist/chunks/input.DORly3Cx.css +1 -0
- package/dist/chunks/{label.jrB9zD_G.css → label.s0Wrm1i-.css} +1 -1
- package/dist/chunks/{menubar.CxRNI9o4.css → menubar.CJcVQhPq.css} +1 -1
- package/dist/chunks/message.B9Rexp_f.css +1 -0
- package/dist/chunks/native-select.BosBdRAx.css +1 -0
- package/dist/chunks/navigation-menu.CuXMCPRN.css +1 -0
- package/dist/chunks/pagination.bFb5us_w.css +1 -0
- package/dist/chunks/popover.BYhwNKnZ.css +1 -0
- package/dist/chunks/progress.DjSEXfxh.css +1 -0
- package/dist/chunks/questionnaire.C-YTRjPE.css +1 -0
- package/dist/chunks/radio-group.CisvBT6g.css +1 -0
- package/dist/chunks/scroll-area.B0OVmDRX.css +1 -0
- package/dist/chunks/select.BFwI5rhI.css +1 -0
- package/dist/chunks/sheet.BWvXXyXk.css +1 -0
- package/dist/chunks/sidebar.DdEvMURX.css +1 -0
- package/dist/chunks/slider.inyNxx4y.css +1 -0
- package/dist/chunks/spinner.sH6x_1Uf.css +1 -0
- package/dist/chunks/status-dot.DWa2qGKe.css +1 -0
- package/dist/chunks/switch.D3_ZyuVP.css +1 -0
- package/dist/chunks/table.DR2nFT0x.css +1 -0
- package/dist/chunks/tabs.DFa0OYMo.css +1 -0
- package/dist/chunks/{textarea.ORRSI69B.css → textarea.DMphp0qh.css} +1 -1
- package/dist/chunks/toast.Dw-jW4YY.css +1 -0
- package/dist/chunks/toggle-group.BpWF6enM.css +1 -0
- package/dist/chunks/toggle.B82Id2zR.css +1 -0
- package/dist/chunks/tooltip.CFJyyz-O.css +1 -0
- package/dist/collapsible.js +7 -7
- package/dist/combobox.js +87 -87
- package/dist/command.js +28 -28
- package/dist/components/badge/badge.d.ts +5 -2
- package/dist/components/badge/badge.d.ts.map +1 -1
- package/dist/components/button/button.d.ts +1 -1
- package/dist/components/button/button.d.ts.map +1 -1
- package/dist/components/card/card.d.ts +10 -4
- package/dist/components/card/card.d.ts.map +1 -1
- package/dist/components/chart/chart.d.ts +7 -6
- package/dist/components/chart/chart.d.ts.map +1 -1
- package/dist/components/checkbox/checkbox.d.ts.map +1 -1
- package/dist/components/dropdown-menu/dropdown-menu.d.ts +9 -1
- package/dist/components/dropdown-menu/dropdown-menu.d.ts.map +1 -1
- package/dist/components/empty/empty.d.ts +11 -0
- package/dist/components/empty/empty.d.ts.map +1 -1
- package/dist/components/empty/public.d.ts +1 -1
- package/dist/components/empty/public.d.ts.map +1 -1
- package/dist/components/input-group/input-group.d.ts +5 -2
- package/dist/components/input-group/input-group.d.ts.map +1 -1
- package/dist/components/navigation-menu/navigation-menu.d.ts +7 -2
- package/dist/components/navigation-menu/navigation-menu.d.ts.map +1 -1
- package/dist/components/pagination/pagination.d.ts +4 -6
- package/dist/components/pagination/pagination.d.ts.map +1 -1
- package/dist/components/popover/popover.d.ts +2 -2
- package/dist/components/popover/popover.d.ts.map +1 -1
- package/dist/components/select/select.d.ts +2 -2
- package/dist/components/select/select.d.ts.map +1 -1
- package/dist/components/spinner/spinner.d.ts +19 -3
- package/dist/components/spinner/spinner.d.ts.map +1 -1
- package/dist/components/status-dot/public.d.ts +2 -0
- package/dist/components/status-dot/public.d.ts.map +1 -0
- package/dist/components/status-dot/status-dot.d.ts +25 -0
- package/dist/components/status-dot/status-dot.d.ts.map +1 -0
- package/dist/components/table/table.d.ts +31 -5
- package/dist/components/table/table.d.ts.map +1 -1
- package/dist/components/tabs/tabs.d.ts +10 -2
- package/dist/components/tabs/tabs.d.ts.map +1 -1
- package/dist/components/toggle/toggle.d.ts +12 -2
- package/dist/components/toggle/toggle.d.ts.map +1 -1
- package/dist/components/toggle-group/toggle-group.d.ts +33 -4
- package/dist/components/toggle-group/toggle-group.d.ts.map +1 -1
- package/dist/components/tooltip/tooltip.d.ts +5 -8
- package/dist/components/tooltip/tooltip.d.ts.map +1 -1
- package/dist/context-menu.js +54 -54
- package/dist/data-table.js +41 -41
- package/dist/dialog.js +39 -39
- package/dist/docs/alert-dialog.md +1 -1
- package/dist/docs/avatar.md +3 -1
- package/dist/docs/badge.md +42 -14
- package/dist/docs/button.md +3 -2
- package/dist/docs/card.md +6 -0
- package/dist/docs/chart.md +20 -14
- package/dist/docs/checkbox.md +6 -0
- package/dist/docs/command.md +4 -0
- package/dist/docs/data-table.md +12 -7
- package/dist/docs/dialog.md +3 -2
- package/dist/docs/dropdown-menu.md +6 -0
- package/dist/docs/empty.md +44 -9
- package/dist/docs/input-group.md +23 -3
- package/dist/docs/navigation-menu.md +14 -5
- package/dist/docs/pagination.md +18 -15
- package/dist/docs/popover.md +6 -0
- package/dist/docs/progress.md +6 -0
- package/dist/docs/questionnaire.md +4 -2
- package/dist/docs/select.md +8 -4
- package/dist/docs/sheet.md +8 -7
- package/dist/docs/spinner.md +35 -5
- package/dist/docs/status-dot.md +77 -0
- package/dist/docs/table.md +69 -25
- package/dist/docs/tabs.md +22 -7
- package/dist/docs/toggle-group.md +68 -9
- package/dist/docs/toggle.md +7 -1
- package/dist/docs/tooltip.md +5 -9
- package/dist/drawer.js +53 -53
- package/dist/dropdown-menu.js +102 -89
- package/dist/dropdown-menu.js.map +1 -1
- package/dist/empty.js +31 -21
- package/dist/empty.js.map +1 -1
- package/dist/field.js +24 -24
- package/dist/hover-card.js +14 -14
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +266 -261
- package/dist/index.js.map +1 -1
- package/dist/input-group.js +73 -50
- package/dist/input-group.js.map +1 -1
- package/dist/input-otp.js +3 -3
- package/dist/input.js +19 -19
- package/dist/label.js +1 -1
- package/dist/menubar.js +18 -18
- package/dist/message.js +11 -11
- package/dist/native-select.js +20 -20
- package/dist/navigation-menu.js +83 -64
- package/dist/navigation-menu.js.map +1 -1
- package/dist/pagination.js +39 -52
- package/dist/pagination.js.map +1 -1
- package/dist/popover.js +33 -31
- package/dist/popover.js.map +1 -1
- package/dist/progress.js +15 -15
- package/dist/questionnaire.js +72 -72
- package/dist/radio-group.js +7 -7
- package/dist/scroll-area.js +8 -8
- package/dist/select.js +82 -80
- package/dist/select.js.map +1 -1
- package/dist/sheet.js +46 -46
- package/dist/sidebar.js +130 -130
- package/dist/slider.js +14 -14
- package/dist/spinner.js +45 -13
- package/dist/spinner.js.map +1 -1
- package/dist/status-dot.d.ts +1 -0
- package/dist/status-dot.js +76 -0
- package/dist/status-dot.js.map +1 -0
- package/dist/switch.js +14 -14
- package/dist/table.js +221 -43
- package/dist/table.js.map +1 -1
- package/dist/tabs.js +44 -26
- package/dist/tabs.js.map +1 -1
- package/dist/textarea.js +5 -5
- package/dist/theme.css +222 -135
- package/dist/toast.js +26 -26
- package/dist/toggle-group.js +40 -25
- package/dist/toggle-group.js.map +1 -1
- package/dist/toggle.js +21 -11
- package/dist/toggle.js.map +1 -1
- package/dist/tooltip.js +37 -34
- package/dist/tooltip.js.map +1 -1
- package/llms.txt +26 -10
- package/package.json +1 -1
- package/dist/chunks/accordion.X_AK08Iv.css +0 -1
- package/dist/chunks/alert-dialog.B50f-Gsz.css +0 -1
- package/dist/chunks/alert.C5BedF7l.css +0 -1
- package/dist/chunks/attachment.GAZbWSyB.css +0 -1
- package/dist/chunks/avatar.DZUXl1ev.css +0 -1
- package/dist/chunks/badge.Bi22h20j.css +0 -1
- package/dist/chunks/bubble.DvN6QyQ1.css +0 -1
- package/dist/chunks/button-group.D0Ir-jbL.css +0 -1
- package/dist/chunks/button.DvAxXxKj.css +0 -1
- package/dist/chunks/calendar.Cnbv4EzY.css +0 -1
- package/dist/chunks/card.D3Ct_dza.css +0 -1
- package/dist/chunks/checkbox.CZfE_PkU.css +0 -1
- package/dist/chunks/collapsible.BQ-sU5sQ.css +0 -1
- package/dist/chunks/combobox.CtYpZAKB.css +0 -1
- package/dist/chunks/command.Km60IuqD.css +0 -1
- package/dist/chunks/context-menu.DwGCD0vN.css +0 -1
- package/dist/chunks/data-table.CtZdVSAU.css +0 -1
- package/dist/chunks/dialog.BxcZ12Gb.css +0 -1
- package/dist/chunks/drawer.BkS_qEHj.css +0 -1
- package/dist/chunks/dropdown-menu.C5TLD9JO.css +0 -1
- package/dist/chunks/empty.BlhsHrOz.css +0 -1
- package/dist/chunks/field.Ccqt897k.css +0 -1
- package/dist/chunks/hover-card.DmwvigMp.css +0 -1
- package/dist/chunks/input-group.CFIUP-Oh.css +0 -1
- package/dist/chunks/input-otp.XSpqyVij.css +0 -1
- package/dist/chunks/input.DvA_mTq8.css +0 -1
- package/dist/chunks/message.BhD5JDJK.css +0 -1
- package/dist/chunks/native-select.DF1QrNz4.css +0 -1
- package/dist/chunks/navigation-menu.C2JGHAKD.css +0 -1
- package/dist/chunks/pagination.DUiQuWla.css +0 -1
- package/dist/chunks/popover.fOvPrnsr.css +0 -1
- package/dist/chunks/progress.Bp13t8iw.css +0 -1
- package/dist/chunks/questionnaire.D-u_K3Co.css +0 -1
- package/dist/chunks/radio-group.CV3MBCsI.css +0 -1
- package/dist/chunks/scroll-area.C4kWMAsU.css +0 -1
- package/dist/chunks/select.iEwV-sfJ.css +0 -1
- package/dist/chunks/sheet.DALPg9vf.css +0 -1
- package/dist/chunks/sidebar.CGTQhfWG.css +0 -1
- package/dist/chunks/slider.B5nouD7J.css +0 -1
- package/dist/chunks/spinner.UKK4f1tu.css +0 -1
- package/dist/chunks/switch.CIW9Jr1x.css +0 -1
- package/dist/chunks/table.BpnQ6j85.css +0 -1
- package/dist/chunks/tabs.4MEFBvw-.css +0 -1
- package/dist/chunks/toast.uUtCEAiv.css +0 -1
- package/dist/chunks/toggle-group.Bd0cCCnV.css +0 -1
- package/dist/chunks/toggle.B9tvfl1n.css +0 -1
- package/dist/chunks/tooltip.apA3VWHJ.css +0 -1
package/dist/docs/chart.md
CHANGED
|
@@ -34,7 +34,7 @@ layout, spacing, text roles) or supplied per-instance by the consumer's own
|
|
|
34
34
|
`content` prop for themed rendering, or omit `content` for Recharts'
|
|
35
35
|
own default.
|
|
36
36
|
|
|
37
|
-
## Series colors: `ChartConfig`,
|
|
37
|
+
## Series colors: `ChartConfig`, with the `--chart-*` palette behind it
|
|
38
38
|
|
|
39
39
|
```ts
|
|
40
40
|
type ChartConfig = Record<
|
|
@@ -60,16 +60,21 @@ const chartConfig = {
|
|
|
60
60
|
} satisfies ChartConfig;
|
|
61
61
|
```
|
|
62
62
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
63
|
+
The kit publishes a five-step series palette, `--chart-1` through
|
|
64
|
+
`--chart-5`, with its own light and dark value per step, plus four
|
|
65
|
+
categorical hues (`--chart-category-blue|purple|brown|teal`) that carry one
|
|
66
|
+
value in both themes. A `ChartConfig` entry that names neither `color` nor
|
|
67
|
+
`theme` falls back to the palette step at its own position in the config,
|
|
68
|
+
wrapping to `--chart-1` after the fifth entry, so a chart is legible before
|
|
69
|
+
anyone brands it. An explicit `color` or `theme` always wins, and it wins
|
|
70
|
+
without shifting the fallback for the entries around it: each entry's step
|
|
71
|
+
follows its own index, not its position among the uncoloured ones.
|
|
72
|
+
|
|
73
|
+
A consumer can still reference any other kit token (`var(--primary)`,
|
|
74
|
+
`var(--info)`, ...), a literal colour, or their own palette.
|
|
75
|
+
`--color-<key>` is unchanged: it is the per-instance custom property
|
|
76
|
+
`ChartStyle` writes for each series, which the palette steps are one
|
|
77
|
+
possible value for.
|
|
73
78
|
|
|
74
79
|
### Dark mode
|
|
75
80
|
|
|
@@ -177,6 +182,7 @@ const data = [
|
|
|
177
182
|
- Do not hardcode a series color inline on the Recharts element and skip
|
|
178
183
|
`ChartConfig` — the config is also what the tooltip/legend read back to
|
|
179
184
|
resolve each series' label and (for the legend's fallback swatch) color.
|
|
180
|
-
- Do not
|
|
181
|
-
|
|
182
|
-
|
|
185
|
+
- Do not paint a series in `--muted-foreground`: it is the chart's own
|
|
186
|
+
chrome colour (grid, axis, legend), so a series wearing it disappears
|
|
187
|
+
into the chart's furniture. The published palette deliberately excludes
|
|
188
|
+
it (see "Series colors" above).
|
package/dist/docs/checkbox.md
CHANGED
|
@@ -4,6 +4,12 @@ An on/off tick box. Wraps the Base UI Checkbox primitive: renders a
|
|
|
4
4
|
`role="checkbox"` button with a hidden native input for forms, toggles via
|
|
5
5
|
mouse and keyboard, exposes state through `data-checked`/`data-unchecked`.
|
|
6
6
|
|
|
7
|
+
One drawn control box, 16 px on a 4 px corner, carrying a 14 px mark. There
|
|
8
|
+
is no size axis. The hit area is larger than the box on both axes: 12 px
|
|
9
|
+
past each inline edge and 8 px past each block edge, which is the drawn
|
|
10
|
+
32 px interaction row, so a checkbox in a dense row is no harder to hit
|
|
11
|
+
than one in a form.
|
|
12
|
+
|
|
7
13
|
## When to use
|
|
8
14
|
|
|
9
15
|
- Opting in/out of independent options (multiple can be on at once).
|
package/dist/docs/command.md
CHANGED
|
@@ -64,6 +64,10 @@ prop](https://github.com/pacocoursey/cmdk#command) (`label`, `filter`,
|
|
|
64
64
|
| `showCloseButton` | `boolean` — see below | `false` |
|
|
65
65
|
| `className` | `string` — merged onto the popup | — |
|
|
66
66
|
|
|
67
|
+
`CommandDialog` caps the popup at `40rem` (640px, the drawn search surface)
|
|
68
|
+
from the 640px breakpoint up, rather than `DialogContent`'s own cap. Its
|
|
69
|
+
height stays with the content.
|
|
70
|
+
|
|
67
71
|
`showCloseButton` defaults to `false` here (unlike `DialogContent`, which
|
|
68
72
|
defaults it to `true`) — a command palette already dismisses on Escape or
|
|
69
73
|
an outside click, the palette's one-line header has no spare room for an
|
package/dist/docs/data-table.md
CHANGED
|
@@ -37,7 +37,7 @@ shipped as reusable exports instead:
|
|
|
37
37
|
|
|
38
38
|
`Table` stays primitive markup with no chrome of its own; `DataTable` is
|
|
39
39
|
where the Studio Data Table frame's card lives. One element wraps the whole
|
|
40
|
-
widget: a 1px `--border` on `--surface` at `--radius-
|
|
40
|
+
widget: a 1px `--border` on `--surface` at `--radius-xl`, with the table's
|
|
41
41
|
rows above and the pagination bar **inside** it — the frame draws that bar
|
|
42
42
|
within the same bordered container, separated from the last row by the same
|
|
43
43
|
rule that separates any two rows, not floating below the card as the
|
|
@@ -57,12 +57,17 @@ beats ordinary inheritance.
|
|
|
57
57
|
|
|
58
58
|
Scope is deliberately narrower than the full guide: **column defs,
|
|
59
59
|
sorting, row selection, and pagination** only — no column filtering, no
|
|
60
|
-
column-visibility toggling, no row actions dropdown, no virtualization
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
60
|
+
column-visibility toggling, no row actions dropdown, no virtualization.
|
|
61
|
+
Each of those is itself a whole guide section the upstream doc treats as
|
|
62
|
+
separable; nothing here stops a consumer building any of them directly
|
|
63
|
+
against the `table` instance TanStack Table itself exposes (this component
|
|
64
|
+
doesn't hide it, see "Escape hatch" below), but `DataTable` doesn't wire
|
|
65
|
+
them up automatically.
|
|
66
|
+
|
|
67
|
+
Column resizing is the one that is no longer out of scope: the `table`
|
|
68
|
+
primitive resizes a column by pointer and by keyboard (`TableHead`'s
|
|
69
|
+
`resizable`, see table.md), and `DataTable` composes that primitive, so a
|
|
70
|
+
consumer passing `resizable` through their own header cell gets it.
|
|
66
71
|
|
|
67
72
|
**TanStack Table v9 API note:** the pinned `@tanstack/react-table@9.1.2` is
|
|
68
73
|
a from-scratch rewrite of v8's `useReactTable` — tree-shakeable features
|
package/dist/docs/dialog.md
CHANGED
|
@@ -41,8 +41,9 @@ default; `false`; `'trap-focus'`) — see Base UI Dialog.Root.
|
|
|
41
41
|
|
|
42
42
|
| Prop | Type | Default |
|
|
43
43
|
|------|------|---------|
|
|
44
|
+
| `size` | `'default' \| 'lg'` - the omitted size caps the popup at `24rem` (384px, the drawn modal width) from the 640px breakpoint up; `lg` widens that to `36rem` (576px) for content that needs more room | `'default'` |
|
|
44
45
|
| `showCloseButton` | `boolean` — renders a top-right close (X) button | `true` |
|
|
45
|
-
| `showBackdrop` | `boolean`
|
|
46
|
+
| `showBackdrop` | `boolean` - renders the dimming backdrop (`--overlay-modal`, the same dark scrim in both themes); set `false` together with `modal={false}` on the root for a genuinely non-modal dialog | `true` |
|
|
46
47
|
| `closeLabel` | `string` — accessible name for that button, the popup's only kit-authored text; same contract as `Toaster`'s `closeLabel` | `'Close'` |
|
|
47
48
|
| `container` | DOM node to portal the popup into | `<body>` |
|
|
48
49
|
| `initialFocus` / `finalFocus` | `boolean \| RefObject \| function` — see Base UI Dialog.Popup | default focus behavior |
|
|
@@ -99,7 +100,7 @@ import {
|
|
|
99
100
|
## Wide content
|
|
100
101
|
|
|
101
102
|
`DialogContent` lays its children out as a single-column grid capped at
|
|
102
|
-
`
|
|
103
|
+
`35rem` (`calc(100% - 2rem)` below 640px), and the column's minimum width
|
|
103
104
|
is floored at zero — so content wider than the popup overflows *inside*
|
|
104
105
|
it rather than stretching the dialog past its cap.
|
|
105
106
|
|
|
@@ -68,6 +68,12 @@ selection).
|
|
|
68
68
|
item — both leave `closeOnClick` at Base UI's default of `false` so the
|
|
69
69
|
menu stays open after a toggle.
|
|
70
70
|
|
|
71
|
+
`DropdownMenuRadioItem`:
|
|
72
|
+
|
|
73
|
+
| Prop | Type | Default |
|
|
74
|
+
|------|------|---------|
|
|
75
|
+
| `indicatorSide` | `'end'` \| `'start'` - start reserves a 32 px leading slot and fills the checked row | `'end'` |
|
|
76
|
+
|
|
71
77
|
`DropdownMenuTrigger` is an unstyled pass-through (native `<button>`
|
|
72
78
|
semantics) — compose it with `Button` via its `render` prop for a
|
|
73
79
|
styled trigger, same as `DialogTrigger`.
|
package/dist/docs/empty.md
CHANGED
|
@@ -6,7 +6,8 @@ primitive: every part is a plain styled `div` with no interactive or
|
|
|
6
6
|
ARIA behavior of its own.
|
|
7
7
|
|
|
8
8
|
Composition: `Empty` (root) → `EmptyHeader` (→ `EmptyMedia`, `EmptyTitle`,
|
|
9
|
-
`EmptyDescription`) → `EmptyContent` (
|
|
9
|
+
`EmptyDescription`, `EmptyDetail`) → `EmptyContent` (arbitrary content) and
|
|
10
|
+
`EmptyActions` (a row of buttons).
|
|
10
11
|
|
|
11
12
|
## When to use
|
|
12
13
|
|
|
@@ -30,11 +31,11 @@ Composition: `Empty` (root) → `EmptyHeader` (→ `EmptyMedia`, `EmptyTitle`,
|
|
|
30
31
|
| `variant` | `'default' \| 'icon'` — `icon` draws a muted rounded square behind the icon; `default` stays transparent | `'default'` |
|
|
31
32
|
| `className` | `string` — merged after the variant class | — |
|
|
32
33
|
|
|
33
|
-
`Empty`, `EmptyHeader`, `EmptyTitle`, `EmptyDescription`,
|
|
34
|
-
`EmptyContent` take no kit-specific props
|
|
35
|
-
native element's props (`EmptyDescription` renders a `<div>`,
|
|
36
|
-
upstream, despite its own props type naming `<p>`
|
|
37
|
-
forwarded as-is.
|
|
34
|
+
`Empty`, `EmptyHeader`, `EmptyTitle`, `EmptyDescription`, `EmptyDetail`,
|
|
35
|
+
`EmptyActions` and `EmptyContent` take no kit-specific props - every prop is
|
|
36
|
+
the underlying native element's props (`EmptyDescription` renders a `<div>`,
|
|
37
|
+
matching upstream, despite its own props type naming `<p>` - see
|
|
38
|
+
`empty.tsx`), forwarded as-is.
|
|
38
39
|
|
|
39
40
|
## Examples
|
|
40
41
|
|
|
@@ -42,8 +43,10 @@ forwarded as-is.
|
|
|
42
43
|
import {
|
|
43
44
|
Button,
|
|
44
45
|
Empty,
|
|
46
|
+
EmptyActions,
|
|
45
47
|
EmptyContent,
|
|
46
48
|
EmptyDescription,
|
|
49
|
+
EmptyDetail,
|
|
47
50
|
EmptyHeader,
|
|
48
51
|
EmptyMedia,
|
|
49
52
|
EmptyTitle,
|
|
@@ -56,10 +59,12 @@ import {
|
|
|
56
59
|
</EmptyMedia>
|
|
57
60
|
<EmptyTitle>No results</EmptyTitle>
|
|
58
61
|
<EmptyDescription>Try a different search term or clear your filters.</EmptyDescription>
|
|
62
|
+
<EmptyDetail>3 filters applied</EmptyDetail>
|
|
59
63
|
</EmptyHeader>
|
|
60
|
-
<
|
|
64
|
+
<EmptyActions>
|
|
65
|
+
<Button onClick={createFirst}>New project</Button>
|
|
61
66
|
<Button variant="outline" onClick={clearFilters}>Clear filters</Button>
|
|
62
|
-
</
|
|
67
|
+
</EmptyActions>
|
|
63
68
|
</Empty>
|
|
64
69
|
|
|
65
70
|
// A bare illustration, no icon chrome
|
|
@@ -71,10 +76,40 @@ import {
|
|
|
71
76
|
</Empty>
|
|
72
77
|
```
|
|
73
78
|
|
|
79
|
+
## Parts and their spacing
|
|
80
|
+
|
|
81
|
+
The root card is the drawn 512 wide, padded by the drawn 32, with a 24px
|
|
82
|
+
gap between its own children - so a placeholder set inside a wider
|
|
83
|
+
container caps out instead of stretching edge to edge. The title is the
|
|
84
|
+
drawn 18/24 (medium weight); the description is 14/20, the kit's own Body
|
|
85
|
+
role exactly.
|
|
86
|
+
|
|
87
|
+
`EmptyDetail` is a secondary line under the description - a count, a hint,
|
|
88
|
+
the query that came back empty. It goes last inside `EmptyHeader`: the
|
|
89
|
+
drawn 16 above it is the header's own 8 gap plus the part's own 8, so the
|
|
90
|
+
margin is scoped to that placement and a detail put elsewhere takes its
|
|
91
|
+
parent's spacing instead.
|
|
92
|
+
|
|
93
|
+
`EmptyActions` is the button row at the foot: 8 between buttons, centred,
|
|
94
|
+
wrapping. It carries no top margin of its own, because the root is already
|
|
95
|
+
a gap-spaced column at 24 - the drawn distance above the actions. Reach for
|
|
96
|
+
`EmptyContent` instead when the foot holds arbitrary content (a search
|
|
97
|
+
field, a form) rather than a strip of buttons; the two can also nest, with
|
|
98
|
+
the actions row last inside the content column.
|
|
99
|
+
|
|
100
|
+
The icon plate (`EmptyMedia variant="icon"`) is the drawn 48x48 square,
|
|
101
|
+
filled with `--secondary`, the role this kit paints a held or chosen
|
|
102
|
+
surface with, not `--muted`. The two carry the same value in dark, so the
|
|
103
|
+
difference shows in light today. In dark the plate also shares the card's
|
|
104
|
+
own colour - that is the drawn palette's own collapse, not a kit gap - so
|
|
105
|
+
the plate reads there by its icon alone.
|
|
106
|
+
|
|
74
107
|
## Anti-patterns
|
|
75
108
|
|
|
76
109
|
- Do not use `variant="icon"` for a full illustration/image — the muted
|
|
77
|
-
|
|
110
|
+
48x48 plate is sized for a small glyph; drop to `variant="default"` (the
|
|
78
111
|
default) for anything larger, or omit `EmptyMedia` entirely.
|
|
79
112
|
- Do not put form controls needing `Field`'s label/error wiring inside
|
|
80
113
|
`EmptyContent` — it's for actions (buttons, links), not inputs.
|
|
114
|
+
- Do not add a top margin to `EmptyActions` to reach the drawn 24 - the
|
|
115
|
+
root's own gap is already that distance, and a margin would stack on it.
|
package/dist/docs/input-group.md
CHANGED
|
@@ -6,9 +6,9 @@ and error border; the wrapped control draws none of its own. No Base UI
|
|
|
6
6
|
primitive backs it — pure styling composition over `Input`/`Textarea`/
|
|
7
7
|
`Button`.
|
|
8
8
|
|
|
9
|
-
The group
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
The group has three heights (see `size` below). A `block-start`/
|
|
10
|
+
`block-end` addon or a wrapped `Textarea` grows it past whichever floor is
|
|
11
|
+
active.
|
|
12
12
|
|
|
13
13
|
## When to use
|
|
14
14
|
|
|
@@ -36,6 +36,18 @@ so a group and a plain field line up in the same form. A `block-start`/
|
|
|
36
36
|
|
|
37
37
|
## Props (kit level)
|
|
38
38
|
|
|
39
|
+
`InputGroup`:
|
|
40
|
+
|
|
41
|
+
| Prop | Type | Default |
|
|
42
|
+
|------|------|---------|
|
|
43
|
+
| `size` | `sm` \| `default` \| `lg` - field height 28 / 32 / 36 with a 16 / 16 / 20 addon icon | `'default'` |
|
|
44
|
+
|
|
45
|
+
Each step also sets the inset an inline addon keeps from the group edge
|
|
46
|
+
(8 / 8 / 12) and the gap between that addon and the field text
|
|
47
|
+
(4 / 4 / 8). `default` is both the CVA default and what an omitted `size`
|
|
48
|
+
renders, the same code path either way. Only the 32px step is drawn; the
|
|
49
|
+
28 and 36 steps are the kit's own, one control-ladder step on each side.
|
|
50
|
+
|
|
39
51
|
`InputGroupAddon`:
|
|
40
52
|
|
|
41
53
|
| Prop | Type | Default |
|
|
@@ -110,6 +122,14 @@ import {
|
|
|
110
122
|
<InputGroupInput type="number" placeholder="0.00" aria-label="Amount" />
|
|
111
123
|
</InputGroup>
|
|
112
124
|
|
|
125
|
+
// Compact search field (size="sm") in a toolbar row
|
|
126
|
+
<InputGroup size="sm">
|
|
127
|
+
<InputGroupAddon>
|
|
128
|
+
<SearchIcon />
|
|
129
|
+
</InputGroupAddon>
|
|
130
|
+
<InputGroupInput type="search" placeholder="Search" aria-label="Search" />
|
|
131
|
+
</InputGroup>
|
|
132
|
+
|
|
113
133
|
// Search field with a leading icon and a trailing shortcut hint
|
|
114
134
|
<InputGroup>
|
|
115
135
|
<InputGroupAddon>
|
|
@@ -56,15 +56,24 @@ DropdownMenu/Select sit here instead:
|
|
|
56
56
|
| `collisionBoundary` / `collisionPadding` | see Base UI NavigationMenu.Positioner | viewport / `5` |
|
|
57
57
|
| `className` | `string` — merged after the kit class | — |
|
|
58
58
|
|
|
59
|
-
`NavigationMenuTrigger` / `NavigationMenuContent` / `
|
|
60
|
-
`
|
|
61
|
-
|
|
62
|
-
|
|
59
|
+
`NavigationMenuTrigger` / `NavigationMenuContent` / `NavigationMenuList` /
|
|
60
|
+
`NavigationMenuItem` / `NavigationMenuViewport`: thin styled
|
|
61
|
+
pass-throughs, no extra props beyond Base UI's own (see each part's
|
|
62
|
+
`.d.ts` under `node_modules/@base-ui/react/navigation-menu/`).
|
|
63
63
|
|
|
64
64
|
`NavigationMenuLink`: `active` (marks the current page, styles via
|
|
65
65
|
`[data-active]` and sets `aria-current="page"`), `closeOnClick` (`false`
|
|
66
66
|
by default — a plain in-content link does not auto-close the menu unless
|
|
67
|
-
asked to)
|
|
67
|
+
asked to), plus:
|
|
68
|
+
|
|
69
|
+
| Prop | Type | Default |
|
|
70
|
+
|------|------|---------|
|
|
71
|
+
| `size` | `default` \| `compact` - 36 or 28 px link height | `default` |
|
|
72
|
+
|
|
73
|
+
Both steps share the corner, the 12 px inline inset, the 14/20 label and
|
|
74
|
+
the 16 px icon; a link carrying a description grows past its step rather
|
|
75
|
+
than clipping. Hovering fills the row with `--muted`; the current link
|
|
76
|
+
takes `--secondary` with a 1 px `--border` hairline.
|
|
68
77
|
|
|
69
78
|
`navigationMenuTriggerStyle()` — a `cva()` className recipe (no variants
|
|
70
79
|
yet) that makes a plain `NavigationMenuLink` look identical to a
|
package/dist/docs/pagination.md
CHANGED
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
# Pagination
|
|
2
2
|
|
|
3
|
-
Page-number navigation built from real anchors
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
Page-number navigation built from real anchors. No Base UI primitive backs
|
|
4
|
+
it: pure styling over semantic markup (`nav` > `ul` > `li`), the same shape
|
|
5
|
+
as `Table`/`Breadcrumb`.
|
|
6
|
+
|
|
7
|
+
An item is a 28px square at a 6px radius, transparent, with a centred 12/16
|
|
8
|
+
label in `--muted-foreground` and a 4px gap between items. The active page
|
|
9
|
+
inverts: the page's own `--background` becomes the chip fill, under a
|
|
10
|
+
`--primary` label. `PaginationPrevious`/`PaginationNext` take the same 28px
|
|
11
|
+
height with horizontal padding instead of a fixed square, because they carry
|
|
12
|
+
an icon and a label side by side.
|
|
8
13
|
|
|
9
14
|
## When to use
|
|
10
15
|
|
|
@@ -35,20 +40,18 @@ semantic markup (`nav` > `ul` > `li`), the same shape as `Table`/
|
|
|
35
40
|
|
|
36
41
|
| Prop | Type | Default |
|
|
37
42
|
|------|------|---------|
|
|
38
|
-
| `isActive` | `boolean`
|
|
39
|
-
| `
|
|
40
|
-
| `square` | `boolean` — square, icon-sized footprint | `true` |
|
|
43
|
+
| `isActive` | `boolean` - inverts the item's paint and sets `aria-current="page"` | `false` |
|
|
44
|
+
| `square` | `boolean` - a 28px square footprint instead of a padded one | `true` |
|
|
41
45
|
|
|
42
|
-
`PaginationPrevious`/`PaginationNext` accept the same props minus `
|
|
43
|
-
|
|
46
|
+
`PaginationPrevious`/`PaginationNext` accept the same props minus `square`
|
|
47
|
+
(fixed to `false`), plus `text` to relabel the link.
|
|
44
48
|
|
|
45
49
|
## Implementation note
|
|
46
50
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
primitive, so pagination items are real, crawlable, cmd-clickable links.
|
|
51
|
+
Pagination carries its own geometry rather than a `Button` size: the drawn
|
|
52
|
+
item is 28px with a paint inversion on the active page that no Button
|
|
53
|
+
variant renders. The parts are real `<a>` elements, so pagination items stay
|
|
54
|
+
crawlable and cmd-clickable.
|
|
52
55
|
|
|
53
56
|
## Examples
|
|
54
57
|
|
package/dist/docs/popover.md
CHANGED
|
@@ -10,6 +10,11 @@ Composition: `Popover` (root, holds open state) → `PopoverTrigger` →
|
|
|
10
10
|
`PopoverContent` (portals and positions `PopoverHeader` / `PopoverTitle` /
|
|
11
11
|
`PopoverDescription` / consumer content against the trigger).
|
|
12
12
|
|
|
13
|
+
The panel is `18rem` wide with a `--radius-lg` (10px) corner, a 10px inset
|
|
14
|
+
around its content and the same 10px between its stacked regions, plus the
|
|
15
|
+
shared popover chrome (`--popover-border` hairline and `--popover-shadow`).
|
|
16
|
+
It fades and scales from 95 per cent over 100ms on open and on close.
|
|
17
|
+
|
|
13
18
|
## When to use
|
|
14
19
|
|
|
15
20
|
- A focused piece of UI anchored to a control — a filter panel, a settings
|
|
@@ -45,6 +50,7 @@ on hover, e.g. an info icon whose only job is revealing more text), `delay`
|
|
|
45
50
|
| `align` | `start` \| `center` \| `end` | `center` |
|
|
46
51
|
| `sideOffset` / `alignOffset` | `number` | `4` / `0` |
|
|
47
52
|
| `container` | DOM node to portal the popup into | `<body>` |
|
|
53
|
+
| `anchor` | the element or virtual element the popup positions against | the trigger |
|
|
48
54
|
| `positionMethod` | `absolute` \| `fixed` — pass `fixed` when the trigger sits inside a `transform`/`filter` container | `absolute` |
|
|
49
55
|
| `collisionBoundary` / `collisionPadding` | see Base UI Popover.Positioner — bound and pad the flip/shift collision logic | viewport / `5` |
|
|
50
56
|
| `className` | `string` — merged after the kit class | — |
|
package/dist/docs/progress.md
CHANGED
|
@@ -30,6 +30,12 @@ also exported standalone for composing a custom layout (e.g. a label row
|
|
|
30
30
|
above the bar) instead of the `Progress` convenience wrapper's default
|
|
31
31
|
Track+Indicator. All forward Base UI's own props for that part.
|
|
32
32
|
|
|
33
|
+
The track is 6 px tall and fully round, filled with `--muted` under a
|
|
34
|
+
`--primary` indicator; the parts sit 12 px apart. Label and readout are
|
|
35
|
+
both 14 px, the label at 500 in `--foreground` and the readout at 400 in
|
|
36
|
+
`--muted-foreground`, pushed to the end of the row with tabular figures so
|
|
37
|
+
a counting percentage does not shift the label beside it.
|
|
38
|
+
|
|
33
39
|
## Examples
|
|
34
40
|
|
|
35
41
|
```tsx
|
|
@@ -181,8 +181,10 @@ Every part carries data attributes you can key CSS off:
|
|
|
181
181
|
upstream's `gap-2.5`/`py-2.5` inside a choice row land on `--space-2`
|
|
182
182
|
(8px) here; the shortcut cap uses the kit's `--text-mono-size`, which
|
|
183
183
|
the Studio blue rebrand moved to 10px — the same size upstream draws.
|
|
184
|
-
Every other measurement (44px row,
|
|
185
|
-
|
|
184
|
+
Every other measurement (44px row, 16px indicator slot, 20px cap, 8px
|
|
185
|
+
choice gap, 16px item and root gaps) matches upstream exactly. The choice
|
|
186
|
+
row's own radius and its check glyph follow the design spec instead of
|
|
187
|
+
upstream: a 6px corner and a 12px glyph inside the unchanged 16px slot.
|
|
186
188
|
- **Focus is the kit's field ring.** Upstream draws a 3px translucent halo
|
|
187
189
|
outside the row; the kit's field idiom (`input.module.css`) is a
|
|
188
190
|
recolored border plus an inset ring, so the choice row wears that
|
package/dist/docs/select.md
CHANGED
|
@@ -33,14 +33,18 @@ raw value instead of the label until the popup has been opened once.
|
|
|
33
33
|
|
|
34
34
|
| Prop | Type | Default |
|
|
35
35
|
|------|------|---------|
|
|
36
|
-
| `size` | `default` \| `sm` | `default` |
|
|
36
|
+
| `size` | `default` \| `sm` - a 32 or a 28 px trigger; the drawn 32 one is the omitted size, and both inset their label edge by 10 and their chevron edge by 8 | `default` |
|
|
37
37
|
| `variant` | `default` \| `filter` — `filter` is the compact toolbar filter chip: 36px tall and the label stays `--muted-foreground` even with a value chosen (in a filter the message is "this narrows the list", not the picked value). Compose the visible label yourself, e.g. `Filter · {count}` | `default` |
|
|
38
38
|
| `className` | `string` — merged after the kit class | — |
|
|
39
39
|
|
|
40
|
+
`SelectContent`:
|
|
41
|
+
|
|
42
|
+
| Prop | Type | Default |
|
|
43
|
+
|------|------|---------|
|
|
44
|
+
| `alignItemWithTrigger` | `boolean` - positions the selected item over the trigger and suppresses the open animation, which is the drawn behaviour; `false` opens the list on `side` instead | `true` |
|
|
45
|
+
|
|
40
46
|
`SelectValue`: renders the selected item's label. Pass `placeholder`
|
|
41
|
-
directly to `SelectValue` (see example).
|
|
42
|
-
list on its `side` (below the trigger by default) — it never overlays the
|
|
43
|
-
trigger the way a native `<select>` does. With no value selected the list
|
|
47
|
+
directly to `SelectValue` (see example). With no value selected the list
|
|
44
48
|
starts scrolled to the top; when the selected option is beyond the fold,
|
|
45
49
|
it is scrolled into view on open. `SelectContent` accepts positioning
|
|
46
50
|
props (`side`, `sideOffset`, `align`, `alignOffset`, plus the escape
|
package/dist/docs/sheet.md
CHANGED
|
@@ -47,7 +47,7 @@ default; `false`; `'trap-focus'`) — see Base UI Dialog.Root.
|
|
|
47
47
|
|------|------|---------|
|
|
48
48
|
| `side` | `'top' \| 'right' \| 'bottom' \| 'left'` — which viewport edge the panel is anchored to | `'right'` |
|
|
49
49
|
| `showCloseButton` | `boolean` — renders a top-right close (X) button | `true` |
|
|
50
|
-
| `showBackdrop` | `boolean`
|
|
50
|
+
| `showBackdrop` | `boolean` - renders the backdrop, which is the drawn side-panel veil (`--overlay-panel`, a 10 per cent tint plus a 4px blur) rather than the modal scrim that dims; set `false` together with `modal={false}` on the root for a genuinely non-modal sheet | `true` |
|
|
51
51
|
| `closeLabel` | `string` — accessible name for that button, the panel's only kit-authored text; same contract as `Dialog`'s `closeLabel` | `'Close'` |
|
|
52
52
|
| `container` | DOM node to portal the panel into | `<body>` |
|
|
53
53
|
| `initialFocus` / `finalFocus` | `boolean \| RefObject \| function` — see Base UI Dialog.Popup | default focus behavior |
|
|
@@ -74,16 +74,17 @@ direction:
|
|
|
74
74
|
|
|
75
75
|
- `top` — full width, height sized to content (capped and scrollable past
|
|
76
76
|
the viewport), slides down from above.
|
|
77
|
-
- `right` (default)
|
|
78
|
-
640px breakpoint up, slides in from the right.
|
|
77
|
+
- `right` (default) - full height, 75% width capped at `24rem` (384px) from
|
|
78
|
+
the 640px breakpoint up, slides in from the right.
|
|
79
79
|
- `bottom` — full width, height sized to content (capped and scrollable
|
|
80
80
|
past the viewport), slides up from below.
|
|
81
|
-
- `left`
|
|
81
|
+
- `left` - full height, 75% width capped at `24rem` (384px) from the 640px
|
|
82
82
|
breakpoint up, slides in from the left.
|
|
83
83
|
|
|
84
|
-
Every
|
|
85
|
-
|
|
86
|
-
|
|
84
|
+
Every side is square on all four corners: the drawn panel carries no
|
|
85
|
+
radius, and a surface pinned to an edge of the viewport has no corner that
|
|
86
|
+
reads as inner. The header and footer inset their content by 16px and size
|
|
87
|
+
to their own content; the rest of the panel keeps the 24px inset.
|
|
87
88
|
|
|
88
89
|
## Examples
|
|
89
90
|
|
package/dist/docs/spinner.md
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
# Spinner
|
|
2
2
|
|
|
3
3
|
A spinning loading indicator — lucide's `loader-circle` icon rotating
|
|
4
|
-
continuously via CSS. No Base UI primitive and no variant axis
|
|
5
|
-
|
|
4
|
+
continuously via CSS. No Base UI primitive and no variant axis.
|
|
5
|
+
|
|
6
|
+
Two shapes. Bare, it is that icon and nothing else, at the kit's small icon
|
|
7
|
+
step. Given a `label` or a `description`, it becomes the drawn loading
|
|
8
|
+
block: the glyph centred in a 36 indicator box with its text beneath it.
|
|
6
9
|
|
|
7
10
|
## When to use
|
|
8
11
|
|
|
@@ -21,15 +24,33 @@ visual, sized like the kit's other small icons.
|
|
|
21
24
|
|
|
22
25
|
## Props (kit level)
|
|
23
26
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
+
| Prop | Type | Default |
|
|
28
|
+
|------|------|---------|
|
|
29
|
+
| `label` | `ReactNode` - the state, written under the indicator in the drawn monospace micro type; its presence is what composes the block | - |
|
|
30
|
+
| `description` | `ReactNode` - a second line under the label: what is being waited on, or how long it usually takes | - |
|
|
31
|
+
| `compact` | `boolean` - the drawn tighter block, a 28 indicator around a 14 glyph instead of 36 around 18; on a bare spinner it takes the glyph to that same 14 | `false` |
|
|
32
|
+
|
|
33
|
+
Every other prop is the indicator `<svg>`'s, `className` included, at both
|
|
34
|
+
shapes - the layout block the kit adds around it is the kit's own, not a
|
|
35
|
+
second element to configure. Wrap the component yourself to place the
|
|
36
|
+
whole block.
|
|
37
|
+
|
|
38
|
+
Two attributes carry a default that a consumer can still override by
|
|
39
|
+
passing their own, on the bare shape:
|
|
27
40
|
|
|
28
41
|
| Attribute | Default | Override for |
|
|
29
42
|
|-----------|---------|--------------|
|
|
30
43
|
| `role` | `status` | A different live-region role, if the surrounding markup already announces the loading state. |
|
|
31
44
|
| `aria-label` | `Loading` (upstream's own hardcoded string) | A localized or more specific label ("Saving changes"). |
|
|
32
45
|
|
|
46
|
+
With a `label` or a `description`, those two move: the block becomes the
|
|
47
|
+
live region (`role="status"`) and the glyph turns decorative
|
|
48
|
+
(`aria-hidden`), so the announcement is the text a reader can also see
|
|
49
|
+
rather than a second hardcoded "Loading". A `role` (and `aria-live` /
|
|
50
|
+
`aria-atomic`) a consumer passes lands on the block there too, so a
|
|
51
|
+
labelled Spinner nested in another live region can pass `role={undefined}`
|
|
52
|
+
or `role="presentation"` to opt out of a duplicate announcement.
|
|
53
|
+
|
|
33
54
|
## Examples
|
|
34
55
|
|
|
35
56
|
```tsx
|
|
@@ -43,6 +64,12 @@ import { Spinner } from '@gears-frontx/ui-kit';
|
|
|
43
64
|
<Spinner aria-label="Saving changes" />
|
|
44
65
|
Saving changes...
|
|
45
66
|
</p>
|
|
67
|
+
|
|
68
|
+
// The composed block: label, and a second line under it
|
|
69
|
+
<Spinner label="Saving" description="This can take a minute" />
|
|
70
|
+
|
|
71
|
+
// Compact, for a panel that cannot give up 36px
|
|
72
|
+
<Spinner compact label="Loading" />
|
|
46
73
|
```
|
|
47
74
|
|
|
48
75
|
## Anti-patterns
|
|
@@ -53,3 +80,6 @@ import { Spinner } from '@gears-frontx/ui-kit';
|
|
|
53
80
|
- Do not drop the `aria-label` via an empty override (`aria-label=""`) —
|
|
54
81
|
a spinner with no accessible name announces nothing to assistive tech;
|
|
55
82
|
either keep the default or supply a real label.
|
|
83
|
+
- Do not pass both a `label` and an `aria-label` expecting the second to
|
|
84
|
+
win - with a label the glyph is decorative and the visible text is the
|
|
85
|
+
announcement, which is the point of composing the block at all.
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
# StatusDot
|
|
2
|
+
|
|
3
|
+
An inline status indicator: a 6px round dot plus an optional 12/16 label,
|
|
4
|
+
both painted in the tone's own colour. No Base UI primitive and no
|
|
5
|
+
interactive behaviour - a pure styling translation over native spans, like
|
|
6
|
+
`Skeleton` and `Spinner`.
|
|
7
|
+
|
|
8
|
+
## When to use
|
|
9
|
+
|
|
10
|
+
- Reporting the state of a thing that is not an action: a job that is
|
|
11
|
+
running, a connection that is live, a record that failed.
|
|
12
|
+
- Dense rows and table cells, where a `Badge`'s pill would be too much
|
|
13
|
+
chrome for a one-word state.
|
|
14
|
+
|
|
15
|
+
## When not to use
|
|
16
|
+
|
|
17
|
+
- Use `Badge` with its own `dot` prop when the status needs a filled chip
|
|
18
|
+
(its own background, its own box) or when it sits alone as a column's
|
|
19
|
+
whole content; use `Marker` when the row is a full-width note with an
|
|
20
|
+
icon, a border or a divider, not a single state word. StatusDot is the
|
|
21
|
+
smallest of the three: text plus a dot, no box at all.
|
|
22
|
+
- A loading state that has no settled value yet - use `Spinner`.
|
|
23
|
+
- The only signal of a state. Colour alone is not an accessible
|
|
24
|
+
distinction, which is why the label sits beside the dot; keep it, or
|
|
25
|
+
name the dot with `aria-label`.
|
|
26
|
+
|
|
27
|
+
## Props (kit level)
|
|
28
|
+
|
|
29
|
+
| Prop | Type | Default |
|
|
30
|
+
|------|------|---------|
|
|
31
|
+
| `tone` | `'neutral' \| 'success' \| 'warning' \| 'danger' \| 'info'` - paints the dot and the label alike (`--muted-foreground` for neutral, `--success` / `--warning` / `--danger` / `--info` for the rest); the root also carries `data-tone` | `'neutral'` |
|
|
32
|
+
| `label` | `ReactNode` - the text beside the dot; omitted renders the dot on its own | - |
|
|
33
|
+
| `live` | `boolean` - the dot breathes on a 2s opacity cycle and the root carries `data-live`; off under `prefers-reduced-motion` | `false` |
|
|
34
|
+
| `render` | `ReactElement` - replaces the root `span`, e.g. with an `<li>` inside a status list | - |
|
|
35
|
+
| `className` | `string` - merged after the tone class | - |
|
|
36
|
+
|
|
37
|
+
All other props are native `<span>` props (or the target element's props
|
|
38
|
+
when using `render`) and are forwarded as-is. `children` is not accepted:
|
|
39
|
+
the text goes in `label`, so the component can tell a named status from a
|
|
40
|
+
bare dot.
|
|
41
|
+
|
|
42
|
+
## Accessibility
|
|
43
|
+
|
|
44
|
+
- With a `label`, the label is the announcement and nothing is added.
|
|
45
|
+
- Without one, the dot is hidden from assistive tech (`aria-hidden`) -
|
|
46
|
+
a coloured shape announces nothing useful.
|
|
47
|
+
- Without one but with an `aria-label`/`aria-labelledby`, the root takes
|
|
48
|
+
`role="img"` so that name actually reaches the accessibility tree (a
|
|
49
|
+
bare `<span>` with an `aria-label` is ignored by most screen readers).
|
|
50
|
+
|
|
51
|
+
## Examples
|
|
52
|
+
|
|
53
|
+
```tsx
|
|
54
|
+
import { StatusDot } from '@gears-frontx/ui-kit';
|
|
55
|
+
|
|
56
|
+
<StatusDot tone="success" label="Running" />
|
|
57
|
+
<StatusDot tone="danger" label="Failed" />
|
|
58
|
+
<StatusDot tone="info" live label="Streaming" />
|
|
59
|
+
|
|
60
|
+
// Dot only, inside a cell whose column header already says "Status"
|
|
61
|
+
<StatusDot tone="warning" aria-label="Degraded" />
|
|
62
|
+
|
|
63
|
+
// As a list item inside a status list
|
|
64
|
+
<StatusDot tone="success" label="Running" render={<li />} />
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## Anti-patterns
|
|
68
|
+
|
|
69
|
+
- Do not wrap it in a button or a link - a status is not an action.
|
|
70
|
+
`render` is for the wrapping element only (an `<li>` in a list, for
|
|
71
|
+
instance); reach for `Button` with an icon, or `Marker`'s `render` prop,
|
|
72
|
+
when the row has to be clickable.
|
|
73
|
+
- Do not set a colour on it from outside: the tone owns both the dot and
|
|
74
|
+
the label, and overriding `color` splits them from the token they are
|
|
75
|
+
supposed to follow in both themes.
|
|
76
|
+
- Do not use `live` for a status that has settled - a dot that keeps
|
|
77
|
+
moving next to "Completed" reads as unfinished work.
|