@gears-frontx/ui-kit 0.4.0-alpha.4 → 0.4.0-alpha.5
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 +89 -83
- 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.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/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.
|
package/dist/docs/table.md
CHANGED
|
@@ -32,7 +32,8 @@ no kit-specific props of its own.
|
|
|
32
32
|
## The scroll wrapper
|
|
33
33
|
|
|
34
34
|
`Table` renders two elements: a wrapper `div` around the `<table>`, scrolling
|
|
35
|
-
horizontally when the table is wider than its container
|
|
35
|
+
horizontally when the table is wider than its container, and vertically
|
|
36
|
+
once you give it a height. This matches the
|
|
36
37
|
upstream source exactly, which takes the same view — a table that can
|
|
37
38
|
overflow needs *something* to scroll, and it's simpler for that to be
|
|
38
39
|
Table's own responsibility than to ask every consumer to remember to add a
|
|
@@ -50,9 +51,13 @@ kind of runtime behavior is exactly what this "primitive markup" component
|
|
|
50
51
|
intentionally does not have.
|
|
51
52
|
|
|
52
53
|
If you need a *vertical* scroll region too (capping a long table's height),
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
Table
|
|
54
|
+
give the wrapper itself a `max-height` through `containerClassName` or
|
|
55
|
+
`containerStyle` (see Examples). Do not put a `div` of your own with
|
|
56
|
+
`overflow-y` around `<Table>` instead: a sticky header sticks to its nearest
|
|
57
|
+
scrolling ancestor, which is Table's own wrapper since it already scrolls
|
|
58
|
+
horizontally. Your outer div would scroll while the wrapper, with no height
|
|
59
|
+
of its own, never does, so the collection view's header would scroll away
|
|
60
|
+
with the rows.
|
|
56
61
|
|
|
57
62
|
A focus stop should announce something: pass `label` to name the wrapper
|
|
58
63
|
(`role="region"` + `aria-label` — a bare `div`'s `aria-label` is ignored
|
|
@@ -61,9 +66,9 @@ labelling your own outer `div` doesn't work: the name lands on a
|
|
|
61
66
|
non-focusable element while the focusable wrapper stays nameless).
|
|
62
67
|
Without `label` the wrapper is roleless and nameless as before. Prefer
|
|
63
68
|
passing it whenever the surrounding page doesn't make the table's purpose
|
|
64
|
-
obvious the moment focus lands. Beyond `label`, the wrapper takes
|
|
65
|
-
|
|
66
|
-
|
|
69
|
+
obvious the moment focus lands. Beyond `label`, the wrapper takes
|
|
70
|
+
`containerClassName` and `containerStyle`, merged after its kit class; it
|
|
71
|
+
isn't a separate export.
|
|
67
72
|
|
|
68
73
|
## Semantics and accessibility
|
|
69
74
|
|
|
@@ -197,11 +202,46 @@ its separator, since the body is then no longer the last section.
|
|
|
197
202
|
|
|
198
203
|
## Props (kit level)
|
|
199
204
|
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
+
`Table`:
|
|
206
|
+
|
|
207
|
+
| Prop | Type | Default |
|
|
208
|
+
|------|------|---------|
|
|
209
|
+
| `label` | `string` - names the focusable scroll wrapper with `role="region"` + `aria-label` (see above) | - |
|
|
210
|
+
| `density` | `'default'` \| `'compact'` - tightens cell padding for operational views; purely cell metrics, not a data-table feature | `'default'` |
|
|
211
|
+
| `variant` | `'default'` \| `'collection'` - collection is the fixed-layout view with a sticky 40 px header and 64 px rows | `'default'` |
|
|
212
|
+
| `containerClassName` | `string` - className for the scroll wrapper; give it a `max-height` to scroll the rows under a sticky header | - |
|
|
213
|
+
| `containerStyle` | `CSSProperties` - inline style for the same wrapper, e.g. `{ maxHeight: 320 }` | - |
|
|
214
|
+
|
|
215
|
+
`TableHead`:
|
|
216
|
+
|
|
217
|
+
| Prop | Type | Default |
|
|
218
|
+
|------|------|---------|
|
|
219
|
+
| `resizable` | `boolean` - draggable and keyboard-resizable trailing edge | `false` |
|
|
220
|
+
| `resizeMinWidth` | `number` - px floor for this column, overriding the 72 / 32 defaults | - |
|
|
221
|
+
|
|
222
|
+
The two axes on `Table` are orthogonal: `collection` sets the layout, the
|
|
223
|
+
header and the row height, and `density` still tightens the cells inside
|
|
224
|
+
it.
|
|
225
|
+
|
|
226
|
+
A resizable column trades width with its trailing neighbour, so the table's
|
|
227
|
+
own width never changes as an inner boundary moves; the first drag freezes
|
|
228
|
+
every column at what it currently renders, switches the table to a fixed
|
|
229
|
+
layout and pins the table's width to the sum of its columns. The last
|
|
230
|
+
column has no neighbour, so dragging it changes the table's width instead:
|
|
231
|
+
the table can end up narrower than its container, or wider (the wrapper
|
|
232
|
+
then scrolls). It still stops at the table's own `min-width` (the collection
|
|
233
|
+
view's 960 px), so what the handle announces is always the width on
|
|
234
|
+
screen. The handle is an 8 px grab area straddling the trailing edge, drawn
|
|
235
|
+
as a 1 px `--border` hairline that thickens to 2 px `--primary` while
|
|
236
|
+
hovered, focused or dragged. It is focusable, carries `role="separator"`,
|
|
237
|
+
and its accessible name reports the column's current pixel width live;
|
|
238
|
+
arrow keys move the boundary 12 px per press.
|
|
239
|
+
|
|
240
|
+
In the collection view a row carrying `data-pending` fills with `--muted`
|
|
241
|
+
and shows a progress cursor, and a row the caller makes focusable (a
|
|
242
|
+
`tabIndex`) takes a pointer cursor and a focus ring.
|
|
243
|
+
|
|
244
|
+
Every other prop is the matching native element's own (`ComponentProps<'table'>`,
|
|
205
245
|
`<'thead'>`, `<'tbody'>`, `<'tfoot'>`, `<'tr'>`, `<'th'>`, `<'td'>`,
|
|
206
246
|
`<'caption'>`), plus `className`, merged after the kit class on every
|
|
207
247
|
part.
|
|
@@ -274,21 +314,25 @@ import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from '@
|
|
|
274
314
|
</Table>;
|
|
275
315
|
```
|
|
276
316
|
|
|
277
|
-
A vertical scroll region
|
|
278
|
-
"The scroll wrapper"
|
|
317
|
+
A vertical scroll region on `Table`'s own wrapper, with the collection
|
|
318
|
+
view's header staying in place over the rows (see "The scroll wrapper"
|
|
319
|
+
above):
|
|
279
320
|
|
|
280
321
|
```tsx
|
|
281
|
-
import { Table, TableBody, TableCell, TableRow } from '@gears-frontx/ui-kit';
|
|
282
|
-
|
|
283
|
-
<
|
|
284
|
-
<
|
|
285
|
-
<
|
|
286
|
-
<
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
</
|
|
322
|
+
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from '@gears-frontx/ui-kit';
|
|
323
|
+
|
|
324
|
+
<Table variant="collection" containerStyle={{ maxHeight: '20rem' }}>
|
|
325
|
+
<TableHeader>
|
|
326
|
+
<TableRow>
|
|
327
|
+
<TableHead>Name</TableHead>
|
|
328
|
+
</TableRow>
|
|
329
|
+
</TableHeader>
|
|
330
|
+
<TableBody>
|
|
331
|
+
<TableRow>
|
|
332
|
+
<TableCell>Row 1</TableCell>
|
|
333
|
+
</TableRow>
|
|
334
|
+
</TableBody>
|
|
335
|
+
</Table>;
|
|
292
336
|
```
|
|
293
337
|
|
|
294
338
|
A row with a leading checkbox column, sized flush against the cell edge by
|