@gears-frontx/ui-kit 0.4.2 → 0.4.4
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 +10 -6
- package/dist/alert.js +35 -24
- package/dist/alert.js.map +1 -1
- package/dist/attachment.js +117 -76
- package/dist/attachment.js.map +1 -1
- package/dist/avatar.js +43 -43
- package/dist/badge.js +14 -14
- package/dist/card.js +81 -44
- package/dist/card.js.map +1 -1
- package/dist/chart.js +50 -50
- package/dist/chunks/alert.Csv2-ccF.css +1 -0
- package/dist/chunks/attachment.BRyIQq3F.css +1 -0
- package/dist/chunks/avatar.7EUG65-M.css +1 -0
- package/dist/chunks/badge.BwUxa9PB.css +1 -0
- package/dist/chunks/card.DSiUMxGK.css +1 -0
- package/dist/chunks/chart.B9cGEno8.css +1 -0
- package/dist/chunks/code-block.r7Cm0ncj.css +1 -0
- package/dist/chunks/description-list.Cx-vFGJL.css +1 -0
- package/dist/chunks/dialog.CIR9bQoU.css +1 -0
- package/dist/chunks/dropdown-menu.DT1_JLqL.css +1 -0
- package/dist/chunks/empty.DWqLrSfF.css +1 -0
- package/dist/chunks/heading.DQxQs5po.css +1 -0
- package/dist/chunks/item.BQ70Khqj.css +1 -0
- package/dist/chunks/link.BOE4f-aB.css +1 -0
- package/dist/chunks/message-scroller.CBjPcz8Y.css +1 -0
- package/dist/chunks/pagination.BAAl9D_S.css +1 -0
- package/dist/chunks/{select.BFwI5rhI.css → select.C3sLDoZI.css} +1 -1
- package/dist/chunks/sheet.BkZyzAbA.css +1 -0
- package/dist/chunks/sidebar.Dw_e0Jqw.css +1 -0
- package/dist/chunks/slider.DY1XDCPw.css +1 -0
- package/dist/chunks/status-dot.39NKkKQF.css +1 -0
- package/dist/chunks/tabs.BqhiMRUP.css +1 -0
- package/dist/chunks/text.7frjnkUr.css +1 -0
- package/dist/chunks/visually-hidden.Bd2oAR5D.css +1 -0
- package/dist/code-block.d.ts +1 -0
- package/dist/code-block.js +152 -0
- package/dist/code-block.js.map +1 -0
- package/dist/command.js +63 -48
- package/dist/command.js.map +1 -1
- package/dist/components/alert/alert.d.ts +3 -2
- package/dist/components/alert/alert.d.ts.map +1 -1
- package/dist/components/attachment/attachment.d.ts +10 -3
- package/dist/components/attachment/attachment.d.ts.map +1 -1
- package/dist/components/card/card.d.ts +6 -4
- package/dist/components/card/card.d.ts.map +1 -1
- package/dist/components/code-block/code-block.d.ts +57 -0
- package/dist/components/code-block/code-block.d.ts.map +1 -0
- package/dist/components/code-block/public.d.ts +2 -0
- package/dist/components/code-block/public.d.ts.map +1 -0
- package/dist/components/command/command.d.ts +1 -1
- package/dist/components/command/command.d.ts.map +1 -1
- package/dist/components/description-list/description-list.d.ts +21 -0
- package/dist/components/description-list/description-list.d.ts.map +1 -0
- package/dist/components/description-list/public.d.ts +2 -0
- package/dist/components/description-list/public.d.ts.map +1 -0
- package/dist/components/empty/empty.d.ts +3 -2
- package/dist/components/empty/empty.d.ts.map +1 -1
- package/dist/components/heading/heading.d.ts +10 -0
- package/dist/components/heading/heading.d.ts.map +1 -0
- package/dist/components/heading/public.d.ts +2 -0
- package/dist/components/heading/public.d.ts.map +1 -0
- package/dist/components/input-otp/input-otp.d.ts +1 -1
- package/dist/components/input-otp/input-otp.d.ts.map +1 -1
- package/dist/components/item/item.d.ts +15 -6
- package/dist/components/item/item.d.ts.map +1 -1
- package/dist/components/link/link.d.ts +18 -0
- package/dist/components/link/link.d.ts.map +1 -0
- package/dist/components/link/public.d.ts +2 -0
- package/dist/components/link/public.d.ts.map +1 -0
- package/dist/components/sidebar/sidebar.d.ts +13 -3
- package/dist/components/sidebar/sidebar.d.ts.map +1 -1
- package/dist/components/slider/slider.d.ts +1 -1
- package/dist/components/slider/slider.d.ts.map +1 -1
- package/dist/components/table/table.d.ts.map +1 -1
- package/dist/components/text/public.d.ts +2 -0
- package/dist/components/text/public.d.ts.map +1 -0
- package/dist/components/text/text.d.ts +11 -0
- package/dist/components/text/text.d.ts.map +1 -0
- package/dist/components/visually-hidden/public.d.ts +2 -0
- package/dist/components/visually-hidden/public.d.ts.map +1 -0
- package/dist/components/visually-hidden/visually-hidden.d.ts +4 -0
- package/dist/components/visually-hidden/visually-hidden.d.ts.map +1 -0
- package/dist/data-grid/pagination.js +35 -35
- package/dist/description-list.d.ts +1 -0
- package/dist/description-list.js +78 -0
- package/dist/description-list.js.map +1 -0
- package/dist/dialog.js +38 -38
- package/dist/docs/alert.md +8 -2
- package/dist/docs/attachment.md +20 -8
- package/dist/docs/avatar.md +8 -2
- package/dist/docs/badge.md +12 -11
- package/dist/docs/button.md +16 -4
- package/dist/docs/calendar.md +6 -0
- package/dist/docs/card.md +38 -6
- package/dist/docs/carousel.md +4 -2
- package/dist/docs/chart.md +23 -0
- package/dist/docs/code-block.md +114 -0
- package/dist/docs/data-grid.md +2 -0
- package/dist/docs/description-list.md +53 -0
- package/dist/docs/drawer.md +1 -1
- package/dist/docs/empty.md +9 -3
- package/dist/docs/heading.md +60 -0
- package/dist/docs/item.md +70 -3
- package/dist/docs/link.md +48 -0
- package/dist/docs/message-scroller.md +5 -0
- package/dist/docs/questionnaire.md +1 -1
- package/dist/docs/sheet.md +20 -3
- package/dist/docs/sidebar.md +27 -0
- package/dist/docs/status-dot.md +2 -2
- package/dist/docs/switch.md +10 -4
- package/dist/docs/text.md +51 -0
- package/dist/docs/visually-hidden.md +44 -0
- package/dist/dropdown-menu.js +56 -56
- package/dist/empty.js +47 -36
- package/dist/empty.js.map +1 -1
- package/dist/heading.d.ts +1 -0
- package/dist/heading.js +36 -0
- package/dist/heading.js.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +427 -401
- package/dist/index.js.map +1 -1
- package/dist/input-otp.js +34 -20
- package/dist/input-otp.js.map +1 -1
- package/dist/item.js +119 -71
- package/dist/item.js.map +1 -1
- package/dist/link.d.ts +1 -0
- package/dist/link.js +55 -0
- package/dist/link.js.map +1 -0
- package/dist/message-scroller.js +24 -24
- package/dist/select.js +45 -45
- package/dist/sheet.js +41 -41
- package/dist/sidebar.js +207 -193
- package/dist/sidebar.js.map +1 -1
- package/dist/slider.js +34 -21
- package/dist/slider.js.map +1 -1
- package/dist/status-dot.js +25 -25
- package/dist/table.js +172 -157
- package/dist/table.js.map +1 -1
- package/dist/tabs.js +14 -14
- package/dist/text.d.ts +1 -0
- package/dist/text.js +53 -0
- package/dist/text.js.map +1 -0
- package/dist/theme.css +29 -6
- package/dist/utilities.css +25 -2
- package/dist/visually-hidden.d.ts +1 -0
- package/dist/visually-hidden.js +18 -0
- package/dist/visually-hidden.js.map +1 -0
- package/llms.txt +72 -15
- package/package.json +1 -4
- package/dist/chunks/alert.DsgRIXLn.css +0 -1
- package/dist/chunks/attachment.CZuZdlXC.css +0 -1
- package/dist/chunks/avatar.BMm-Z9l5.css +0 -1
- package/dist/chunks/badge.BCreEn3O.css +0 -1
- package/dist/chunks/card.DdBl-usf.css +0 -1
- package/dist/chunks/chart.CeyctrXQ.css +0 -1
- package/dist/chunks/dialog.Cpo8vChK.css +0 -1
- package/dist/chunks/dropdown-menu.TU3FHXbJ.css +0 -1
- package/dist/chunks/empty.DnAKlw2g.css +0 -1
- package/dist/chunks/item.BkcgydVc.css +0 -1
- package/dist/chunks/message-scroller.CbLooS7Q.css +0 -1
- package/dist/chunks/pagination.Cn8tIWMX.css +0 -1
- package/dist/chunks/sheet.BWvXXyXk.css +0 -1
- package/dist/chunks/sidebar.DdEvMURX.css +0 -1
- package/dist/chunks/slider.inyNxx4y.css +0 -1
- package/dist/chunks/status-dot.DWa2qGKe.css +0 -1
- package/dist/chunks/tabs.DFa0OYMo.css +0 -1
package/dist/dialog.js
CHANGED
|
@@ -1,69 +1,69 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
1
|
+
import { jsx as e, jsxs as s } from "react/jsx-runtime";
|
|
2
2
|
import { Dialog as r } from "@base-ui/react/dialog";
|
|
3
|
-
import { cx as
|
|
4
|
-
import { XIcon as
|
|
3
|
+
import { cx as n } from "class-variance-authority";
|
|
4
|
+
import { XIcon as _ } from "lucide-react";
|
|
5
5
|
import { Button as g } from "./button.js";
|
|
6
|
-
import './chunks/dialog.
|
|
6
|
+
import './chunks/dialog.CIR9bQoU.css';const m = "_backdrop_audd_6", f = "_popup_audd_22", D = "_closeButton_audd_164", N = "_header_audd_152", h = "_footer_audd_152", v = "_title_audd_273", B = "_description_audd_281", b = "_svgIcon_audd_288", a = {
|
|
7
7
|
backdrop: m,
|
|
8
8
|
popup: f,
|
|
9
9
|
closeButton: D,
|
|
10
|
-
header:
|
|
11
|
-
footer:
|
|
12
|
-
title:
|
|
13
|
-
description:
|
|
14
|
-
svgIcon:
|
|
15
|
-
},
|
|
16
|
-
function
|
|
10
|
+
header: N,
|
|
11
|
+
footer: h,
|
|
12
|
+
title: v,
|
|
13
|
+
description: B,
|
|
14
|
+
svgIcon: b
|
|
15
|
+
}, j = r.Root;
|
|
16
|
+
function P({ className: o, ...t }) {
|
|
17
17
|
return /* @__PURE__ */ e(r.Trigger, { className: o, ...t });
|
|
18
18
|
}
|
|
19
|
-
function
|
|
19
|
+
function y({ className: o, ...t }) {
|
|
20
20
|
return /* @__PURE__ */ e(r.Close, { className: o, ...t });
|
|
21
21
|
}
|
|
22
|
-
function
|
|
22
|
+
function z({
|
|
23
23
|
className: o,
|
|
24
24
|
children: t,
|
|
25
|
-
container:
|
|
26
|
-
showCloseButton:
|
|
25
|
+
container: i,
|
|
26
|
+
showCloseButton: c = !0,
|
|
27
27
|
showBackdrop: l = !0,
|
|
28
|
-
closeLabel:
|
|
28
|
+
closeLabel: d = "Close",
|
|
29
29
|
size: u = "default",
|
|
30
|
-
...
|
|
30
|
+
...p
|
|
31
31
|
}) {
|
|
32
|
-
return /* @__PURE__ */
|
|
33
|
-
l && /* @__PURE__ */ e(r.Backdrop, { className:
|
|
34
|
-
/* @__PURE__ */
|
|
32
|
+
return /* @__PURE__ */ s(r.Portal, { container: i, children: [
|
|
33
|
+
l && /* @__PURE__ */ e(r.Backdrop, { className: a.backdrop }),
|
|
34
|
+
/* @__PURE__ */ s(r.Popup, { "data-size": u, className: n(a.popup, o), ...p, children: [
|
|
35
35
|
t,
|
|
36
|
-
|
|
36
|
+
c && /* @__PURE__ */ e(
|
|
37
37
|
r.Close,
|
|
38
38
|
{
|
|
39
|
-
"aria-label":
|
|
40
|
-
className:
|
|
41
|
-
render: /* @__PURE__ */ e(g, { variant: "ghost", icon: /* @__PURE__ */ e(
|
|
39
|
+
"aria-label": d,
|
|
40
|
+
className: a.closeButton,
|
|
41
|
+
render: /* @__PURE__ */ e(g, { variant: "ghost", icon: /* @__PURE__ */ e(_, { className: a.svgIcon }) })
|
|
42
42
|
}
|
|
43
43
|
)
|
|
44
44
|
] })
|
|
45
45
|
] });
|
|
46
46
|
}
|
|
47
|
-
function z({ className: o, ...t }) {
|
|
48
|
-
return /* @__PURE__ */ e("div", { className: s(n.header, o), ...t });
|
|
49
|
-
}
|
|
50
47
|
function F({ className: o, ...t }) {
|
|
51
|
-
return /* @__PURE__ */ e("div", { className:
|
|
48
|
+
return /* @__PURE__ */ e("div", { className: n(a.header, o), ...t });
|
|
52
49
|
}
|
|
53
50
|
function H({ className: o, ...t }) {
|
|
54
|
-
return /* @__PURE__ */ e(
|
|
51
|
+
return /* @__PURE__ */ e("div", { className: n(a.footer, o), ...t });
|
|
55
52
|
}
|
|
56
53
|
function R({ className: o, ...t }) {
|
|
57
|
-
return /* @__PURE__ */ e(r.
|
|
54
|
+
return /* @__PURE__ */ e(r.Title, { className: n(a.title, o), ...t });
|
|
55
|
+
}
|
|
56
|
+
function X({ className: o, ...t }) {
|
|
57
|
+
return /* @__PURE__ */ e(r.Description, { className: n(a.description, o), ...t });
|
|
58
58
|
}
|
|
59
59
|
export {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
60
|
+
j as Dialog,
|
|
61
|
+
y as DialogClose,
|
|
62
|
+
z as DialogContent,
|
|
63
|
+
X as DialogDescription,
|
|
64
|
+
H as DialogFooter,
|
|
65
|
+
F as DialogHeader,
|
|
66
|
+
R as DialogTitle,
|
|
67
|
+
P as DialogTrigger
|
|
68
68
|
};
|
|
69
69
|
//# sourceMappingURL=dialog.js.map
|
package/dist/docs/alert.md
CHANGED
|
@@ -36,8 +36,14 @@ structurally, no prop to set.
|
|
|
36
36
|
| `variant` | `'default' \| 'destructive'` | `'default'` |
|
|
37
37
|
| `className` | `string` — merged after the variant class | — |
|
|
38
38
|
|
|
39
|
-
`AlertTitle
|
|
40
|
-
|
|
39
|
+
`AlertTitle`:
|
|
40
|
+
|
|
41
|
+
| Prop | Type | Default |
|
|
42
|
+
|------|------|---------|
|
|
43
|
+
| `render` | `ReactElement` or callback - the element, such as `<h3 />` for a real heading; the title keeps its look | `div` |
|
|
44
|
+
|
|
45
|
+
`AlertDescription` and `AlertAction` take no kit-specific props - every
|
|
46
|
+
prop is the underlying `<div>`'s props, forwarded as they are.
|
|
41
47
|
|
|
42
48
|
## Examples
|
|
43
49
|
|
package/dist/docs/attachment.md
CHANGED
|
@@ -139,8 +139,14 @@ visual result is a slightly larger action button (32px) than upstream's
|
|
|
139
139
|
|
|
140
140
|
### AttachmentGroup
|
|
141
141
|
|
|
142
|
-
|
|
143
|
-
|
|
142
|
+
| Prop | Type | Default | Description |
|
|
143
|
+
| ------- | -------- | ------- | ----------- |
|
|
144
|
+
| `label` | `string` | - | Accessible name for the row: `role="group"` plus `aria-label`. Without it the group has no role. |
|
|
145
|
+
|
|
146
|
+
Plus `className` (merged after the layout class, alongside the
|
|
147
|
+
`scroll-fade-x`/`no-scrollbar` utility classes) and native `<div>` props.
|
|
148
|
+
While its content overflows, the group is a tab stop (`tabIndex={0}`); a
|
|
149
|
+
row that fits has none. A `tabIndex` you pass always wins.
|
|
144
150
|
|
|
145
151
|
`attachmentVariants`/`attachmentMediaVariants` (the underlying `cva`
|
|
146
152
|
recipes) are also exported.
|
|
@@ -205,7 +211,7 @@ import {
|
|
|
205
211
|
### Group
|
|
206
212
|
|
|
207
213
|
```tsx
|
|
208
|
-
<AttachmentGroup>
|
|
214
|
+
<AttachmentGroup label="Attached files">
|
|
209
215
|
<Attachment size="sm">{/* … */}</Attachment>
|
|
210
216
|
<Attachment size="sm">{/* … */}</Attachment>
|
|
211
217
|
</AttachmentGroup>
|
|
@@ -235,11 +241,17 @@ real `<button>` (or your element via `render`).
|
|
|
235
241
|
sits behind the actions in the stacking order, so an `AttachmentAction`
|
|
236
242
|
and the `AttachmentTrigger` never trap each other — both remain
|
|
237
243
|
separately focusable and clickable.
|
|
238
|
-
- **Keyboard scrolling.** `AttachmentGroup` scrolls horizontally
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
244
|
+
- **Keyboard scrolling.** `AttachmentGroup` scrolls horizontally with a
|
|
245
|
+
hidden scrollbar. While its attachments overflow the row, the group puts
|
|
246
|
+
itself in the tab order, so a keyboard user can focus it and scroll with
|
|
247
|
+
the arrow keys, also for a row of presentational attachments with no
|
|
248
|
+
trigger or actions; the focus ring shows on keyboard focus, in forced
|
|
249
|
+
colors too. A row that fits gets no tab stop, so the usual one or two
|
|
250
|
+
composer attachments add none. Overflow is re-measured as the row or its
|
|
251
|
+
attachments resize and as attachments come or go; a focused row keeps its
|
|
252
|
+
stop until it loses focus. Pass `label` so the
|
|
253
|
+
focused row announces what it holds (`role="group"`, not a landmark, so
|
|
254
|
+
a thread with many rows does not flood landmark navigation).
|
|
243
255
|
- **Meaning beyond color.** The `error` state uses a destructive color —
|
|
244
256
|
keep the failure reason in `AttachmentDescription` so the state is not
|
|
245
257
|
conveyed by color alone.
|
package/dist/docs/avatar.md
CHANGED
|
@@ -50,8 +50,14 @@ then.
|
|
|
50
50
|
| `className` | `string` — merged after the kit class | — |
|
|
51
51
|
|
|
52
52
|
`tone` × `variant` is the fill matrix: `solid` paints the tone at full
|
|
53
|
-
strength
|
|
54
|
-
on its soft surface
|
|
53
|
+
strength for `neutral`, `accent` and `info`, `soft` puts the tone's own label color
|
|
54
|
+
on its soft surface (for `success`, `warning` and `danger` the tone's text
|
|
55
|
+
token, `--success-foreground` and so on, which clears 4.5:1 where the fill
|
|
56
|
+
tone does not). Solid `success`, `warning` and `danger` look exactly like their soft
|
|
57
|
+
treatment: the drawn fill tones take no ink at 4.5:1 in light, so they use
|
|
58
|
+
the theme's status text pair (`--success-foreground` on `--success-soft`
|
|
59
|
+
and so on, 5.00:1, 6.59:1 and 5.72:1 in light; `tokens.test.ts` checks
|
|
60
|
+
both themes). The `neutral`/`soft` default is the plain
|
|
55
61
|
muted-on-muted fill, so a fallback given neither prop looks exactly as it
|
|
56
62
|
did before these axes existed.
|
|
57
63
|
|
package/dist/docs/badge.md
CHANGED
|
@@ -16,18 +16,19 @@ The `variant` axis carries two groups on one axis:
|
|
|
16
16
|
- **Upstream paint** — `default`, `secondary`, `destructive`, `outline`,
|
|
17
17
|
`ghost`, `link`: the same six names and the same meaning as
|
|
18
18
|
[Button](button.md)'s. `destructive` is a tint of `--destructive` under
|
|
19
|
-
a `--
|
|
19
|
+
a label in the danger text token (`--danger-foreground`), so it reads at
|
|
20
|
+
4.5:1 where Button's `--destructive` label would not.
|
|
20
21
|
- **Category** - `category`: a 1px ring and label in `--primary` over a
|
|
21
22
|
tint of the same blue, the drawn chip for a category tag.
|
|
22
23
|
- **Tone** — `success`, `warning`, `danger`, `info`, `accent`: a soft
|
|
23
|
-
tinted fill with the tone's
|
|
24
|
+
tinted fill with the tone's color as the label, matching the Studio
|
|
24
25
|
design's Badge row. Its sixth specimen, Neutral, is `secondary` — that
|
|
25
26
|
variant already paints the drawn pair exactly, so there is no separate
|
|
26
27
|
`neutral` name.
|
|
27
28
|
|
|
28
29
|
Note that `destructive` and `danger` are both present on purpose: a tint
|
|
29
|
-
of `--destructive`
|
|
30
|
-
|
|
30
|
+
of `--destructive` and a `--danger-soft` fill, both labelled in the danger
|
|
31
|
+
text token. Two names for one red, one per role.
|
|
31
32
|
|
|
32
33
|
A tone is still paint, not state: it colors a label, it does not track
|
|
33
34
|
one. Badge's five tones (`success`, `warning`, `danger`, `info`, `accent`)
|
|
@@ -36,13 +37,13 @@ status, but keep the label text itself explicit; color alone is not a
|
|
|
36
37
|
substitute for a state machine.
|
|
37
38
|
|
|
38
39
|
> **Accessibility of tones.** At Badge's label size WCAG 1.4.3 asks
|
|
39
|
-
> 4.5:1
|
|
40
|
-
>
|
|
41
|
-
>
|
|
42
|
-
>
|
|
43
|
-
>
|
|
44
|
-
>
|
|
45
|
-
>
|
|
40
|
+
> 4.5:1. The `success`, `warning` and `danger` labels are written in the
|
|
41
|
+
> tone's text token (`--success-foreground` and so on), not the fill
|
|
42
|
+
> tone, and clear it in both themes (`tokens.test.ts` checks them); the
|
|
43
|
+
> `destructive` label uses the danger text token too. The `category` chip
|
|
44
|
+
> in the dark theme is still under the floor, with no drawn alternative.
|
|
45
|
+
> Color is not a substitute for text either way: keep the label itself
|
|
46
|
+
> explicit.
|
|
46
47
|
|
|
47
48
|
## When to use
|
|
48
49
|
|
package/dist/docs/button.md
CHANGED
|
@@ -15,9 +15,15 @@ polymorphism, correct disabled/focus behavior, `type="button"` by default
|
|
|
15
15
|
|
|
16
16
|
## When not to use
|
|
17
17
|
|
|
18
|
-
- Plain in-text navigation
|
|
19
|
-
`variant="link"`; that variant exists for actions
|
|
20
|
-
links
|
|
18
|
+
- Plain in-text navigation: use `Link` (it takes the app's router link
|
|
19
|
+
through `render`), not `variant="link"`; that variant exists for actions
|
|
20
|
+
that visually read as links, and it carries a control's height and
|
|
21
|
+
padding into the line.
|
|
22
|
+
- Navigation that looks like a button (a "Get started" link, a call to
|
|
23
|
+
action): use the consumer app's link component with
|
|
24
|
+
`buttonVariants({ variant, size })` as its class, so the element keeps
|
|
25
|
+
the link role. `render={<a />}` on `Button` keeps the button role, so a
|
|
26
|
+
screen reader announces the link as a button.
|
|
21
27
|
- Toggling on/off state — use `switch` or `checkbox` instead.
|
|
22
28
|
|
|
23
29
|
## Props (kit level)
|
|
@@ -99,7 +105,7 @@ through `onClick`, not a manual listener, if you need it to respect
|
|
|
99
105
|
## Examples
|
|
100
106
|
|
|
101
107
|
```tsx
|
|
102
|
-
import { Button } from '@gears-frontx/ui-kit';
|
|
108
|
+
import { Button, buttonVariants } from '@gears-frontx/ui-kit';
|
|
103
109
|
|
|
104
110
|
// Primary action
|
|
105
111
|
<Button onClick={save}>Save</Button>
|
|
@@ -128,6 +134,12 @@ import { Button } from '@gears-frontx/ui-kit';
|
|
|
128
134
|
Open reports
|
|
129
135
|
</Button>
|
|
130
136
|
|
|
137
|
+
// Navigation drawn as a button: the app's link component (here a plain
|
|
138
|
+
// anchor) wears the button classes and keeps the link role
|
|
139
|
+
<a href="/docs" className={buttonVariants({ size: 'lg' })}>
|
|
140
|
+
Get started
|
|
141
|
+
</a>
|
|
142
|
+
|
|
131
143
|
// Form submit (explicit type)
|
|
132
144
|
<Button type="submit">Create account</Button>
|
|
133
145
|
```
|
package/dist/docs/calendar.md
CHANGED
|
@@ -28,6 +28,12 @@ The kit only fixes defaults and re-authors the styling surface:
|
|
|
28
28
|
| `className` | `string` — merged onto the root | — |
|
|
29
29
|
| `classNames` | `Partial<ClassNames>` — merged over the kit's own per-slot classes, keyed by react-day-picker's own slot names (`root`, `months`, `day`, `range_start`, ...) | — |
|
|
30
30
|
|
|
31
|
+
Name each calendar's month navigation when a page shows more than one:
|
|
32
|
+
react-day-picker names it "Navigation bar" for every instance, so two
|
|
33
|
+
calendars give two identical navigation landmarks (axe `landmark-unique`).
|
|
34
|
+
Pass its `labels` prop, for example
|
|
35
|
+
`labels={{ labelNav: () => 'Start date, month navigation' }}`.
|
|
36
|
+
|
|
31
37
|
`captionLayout`'s four values split into two visually distinct renders,
|
|
32
38
|
both covered by calendar.module.css:
|
|
33
39
|
|
package/dist/docs/card.md
CHANGED
|
@@ -35,6 +35,7 @@ Every part except `Card` itself is a passthrough over
|
|
|
35
35
|
|
|
36
36
|
| Prop | Type | Default |
|
|
37
37
|
|------|------|---------|
|
|
38
|
+
| `variant` | `'default' \| 'panel'` - `panel` is the lifted frame a workbench sits in: a 16px corner (`--radius-2xl`), the `--panel-shadow`, and no padding or gap of its own, so its panes lay themselves out edge to edge | `'default'` |
|
|
38
39
|
| `size` | `'default' \| 'sm'` — scales the card's internal padding and gap, and `CardTitle`'s font size | `'default'` |
|
|
39
40
|
| `className` | `string` — merged after the kit class | — |
|
|
40
41
|
|
|
@@ -54,12 +55,43 @@ padding when the image is the first child, and the image's own corners
|
|
|
54
55
|
are rounded to match the card (first child rounds the top corners, last
|
|
55
56
|
child the bottom ones) — useful for a media card with a full-bleed image.
|
|
56
57
|
|
|
57
|
-
`CardTitle` renders a plain `div
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
58
|
+
`CardTitle` renders a plain `div` by default. When a card is a real page
|
|
59
|
+
section rather than a decorative grouping, give the title its heading
|
|
60
|
+
element with `render={<h3 />}` (any level): the element changes, the
|
|
61
|
+
title keeps its look, and the page keeps a document outline. Where the
|
|
62
|
+
element cannot change, `role="heading"` with `aria-level` is the
|
|
63
|
+
fallback.
|
|
64
|
+
|
|
65
|
+
A panel frames a workbench, such as a contained `Sidebar` beside a
|
|
66
|
+
document pane:
|
|
67
|
+
|
|
68
|
+
```tsx
|
|
69
|
+
<Card variant="panel">
|
|
70
|
+
<SidebarProvider contained>
|
|
71
|
+
<Sidebar collapsible="none">{/* file list */}</Sidebar>
|
|
72
|
+
<SidebarInset render={<div />}>{/* the file */}</SidebarInset>
|
|
73
|
+
</SidebarProvider>
|
|
74
|
+
</Card>
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
`Card` takes `render` too. `render={<a href="..." />}` (or a router link)
|
|
78
|
+
makes the whole card one link: no underline, the page's font, a `--ring`
|
|
79
|
+
border on hover and the kit's focus ring on keyboard focus. Such a card
|
|
80
|
+
must hold no other link or button, since HTML allows no interactive
|
|
81
|
+
content inside a link; for a row with its own actions use `Item`, or keep
|
|
82
|
+
the card a `div` and make its title the link. A `button` root is not
|
|
83
|
+
offered: a button allows only phrasing content, and a card's header and
|
|
84
|
+
title are blocks. Another element (`<article>`, `<section>`) gains no
|
|
85
|
+
hover, pointer or focus styling.
|
|
86
|
+
|
|
87
|
+
```tsx
|
|
88
|
+
<Card render={<a href="/guides/setup" />}>
|
|
89
|
+
<CardHeader>
|
|
90
|
+
<CardTitle render={<h3 />}>Setup guide</CardTitle>
|
|
91
|
+
<CardDescription>From install to the first screen.</CardDescription>
|
|
92
|
+
</CardHeader>
|
|
93
|
+
</Card>
|
|
94
|
+
```
|
|
63
95
|
|
|
64
96
|
`CardFooter` is a plain flex row and contributes **no gap of its own** —
|
|
65
97
|
two buttons dropped straight into it render flush against each other.
|
package/dist/docs/carousel.md
CHANGED
|
@@ -91,8 +91,10 @@ import {
|
|
|
91
91
|
CarouselPrevious,
|
|
92
92
|
} from '@gears-frontx/ui-kit';
|
|
93
93
|
|
|
94
|
-
// Horizontal (default), with nav buttons
|
|
95
|
-
|
|
94
|
+
// Horizontal (default), with nav buttons. The root is a region landmark:
|
|
95
|
+
// give each carousel its own aria-label, so two on one page can be told
|
|
96
|
+
// apart (axe landmark-unique)
|
|
97
|
+
<Carousel aria-label="Featured templates">
|
|
96
98
|
<CarouselContent>
|
|
97
99
|
<CarouselItem>Slide 1</CarouselItem>
|
|
98
100
|
<CarouselItem>Slide 2</CarouselItem>
|
package/dist/docs/chart.md
CHANGED
|
@@ -34,6 +34,29 @@ 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
|
+
## Sizing
|
|
38
|
+
|
|
39
|
+
`ChartContainer` keeps a 16:9 aspect ratio by default, so a standalone
|
|
40
|
+
chart takes its height from its width. In a slot that gives the chart its
|
|
41
|
+
height (a dashboard card, a grid row, a split pane), set
|
|
42
|
+
`--chart-aspect-ratio: auto` on the container or any ancestor, together
|
|
43
|
+
with a height or a stretching parent:
|
|
44
|
+
|
|
45
|
+
```tsx
|
|
46
|
+
<ChartContainer config={chartConfig} style={{ '--chart-aspect-ratio': 'auto', height: '100%' } as React.CSSProperties}>
|
|
47
|
+
…
|
|
48
|
+
</ChartContainer>
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Set the custom property rather than overriding `aspect-ratio` from a
|
|
52
|
+
class: a class has the same weight as the kit's rule, so it wins only when
|
|
53
|
+
its stylesheet happens to load after the kit's. Any other ratio works the
|
|
54
|
+
same way (`--chart-aspect-ratio: 4 / 3`). Two things to know: the property
|
|
55
|
+
inherits, so set on a dashboard wrapper it reaches every chart inside,
|
|
56
|
+
including one with no height of its own; and a value that is not a ratio
|
|
57
|
+
(`16:9`) makes `aspect-ratio` fall back to `auto`, not to 16:9, so a chart
|
|
58
|
+
with no height then collapses to nothing.
|
|
59
|
+
|
|
37
60
|
## Series colors: `ChartConfig`, with the `--chart-*` palette behind it
|
|
38
61
|
|
|
39
62
|
```ts
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
# CodeBlock
|
|
2
|
+
|
|
3
|
+
Code, terminal output, logs and diffs, with an optional header (title and
|
|
4
|
+
actions), line numbers, wrapping, diff and highlighted lines, and a small
|
|
5
|
+
size. A port of [shadcn/ui's base CodeBlock](https://ui.shadcn.com/docs/components/base/code-block)
|
|
6
|
+
to CSS Modules; no Base UI primitive.
|
|
7
|
+
|
|
8
|
+
Composition: `CodeBlock` (→ `CodeBlockHeader` (→ `CodeBlockTitle`,
|
|
9
|
+
`CodeBlockActions` (→ `CodeBlockCopyButton`)), `CodeBlockActions` (floating,
|
|
10
|
+
when there is no header), `CodeBlockContent` (→ `CodeBlockLine`),
|
|
11
|
+
`CodeBlockFooter`).
|
|
12
|
+
|
|
13
|
+
Syntax highlighting is not ported. Upstream keeps it in a separate hook
|
|
14
|
+
(`useHighlightedCode`, on Shiki), which would add a highlighter to every
|
|
15
|
+
consumer; a consumer that highlights renders the tokens inside
|
|
16
|
+
`CodeBlockLine` children.
|
|
17
|
+
|
|
18
|
+
## When to use
|
|
19
|
+
|
|
20
|
+
- An install or start command with a copy button.
|
|
21
|
+
- A file excerpt in a guide, terminal output, a log or a diff.
|
|
22
|
+
|
|
23
|
+
## When not to use
|
|
24
|
+
|
|
25
|
+
- A key or a shortcut: use `Kbd`.
|
|
26
|
+
- Code inside rendered Markdown or HTML: use the kit's `typeset.css`.
|
|
27
|
+
- A single path or name inside a line of text: use `Text` with
|
|
28
|
+
`typography="mono"`.
|
|
29
|
+
|
|
30
|
+
## Props (kit level)
|
|
31
|
+
|
|
32
|
+
| Part | Prop | Type | Default |
|
|
33
|
+
|------|------|------|---------|
|
|
34
|
+
| `CodeBlock` | `variant` | `'default' \| 'destructive'` - `destructive` for error output, on `--destructive` | `'default'` |
|
|
35
|
+
| | `size` | `'default' \| 'sm'` - the body or the meta size, tighter insets at `sm` | `'default'` |
|
|
36
|
+
| `CodeBlockContent` | `wrap` | `boolean` - wrap long lines instead of scrolling sideways | `false` |
|
|
37
|
+
| | `lineNumbers` | `boolean` - number the lines; a string child is split into lines | `false` |
|
|
38
|
+
| | `startLine` | `number` - the first line's number | `1` |
|
|
39
|
+
| `CodeBlockLine` | `variant` | `'default' \| 'added' \| 'removed' \| 'highlighted'` - `added` and `removed` add a + or − marker | `'default'` |
|
|
40
|
+
| `CodeBlockCopyButton` | `value` | `string` - the text written to the clipboard | required |
|
|
41
|
+
| | `copyLabel`, `copiedLabel` | `string` - the button's name before and after a copy, and the announcement | `'Copy'`, `'Copied'` |
|
|
42
|
+
|
|
43
|
+
`CodeBlockCopyButton` is a kit `Button` (`variant="ghost"`, `size="sm"`,
|
|
44
|
+
icon-only) and takes the other Button props except `icon`, `end`,
|
|
45
|
+
`children`, `render`, `nativeButton` and `aria-label`: it draws its own
|
|
46
|
+
glyph and names itself from `copyLabel` and `copiedLabel`. `CodeBlockHeader`,
|
|
47
|
+
`CodeBlockTitle`, `CodeBlockActions` and `CodeBlockFooter` take their
|
|
48
|
+
element's props. The family ships `'use client'` (the copy button holds
|
|
49
|
+
state).
|
|
50
|
+
|
|
51
|
+
The edge fade of a scrolling block is the `scroll-fade-x` (or, wrapped,
|
|
52
|
+
`scroll-fade-y`) class from `utilities.css`: without that import the code
|
|
53
|
+
scrolls with no fade.
|
|
54
|
+
|
|
55
|
+
## Behavior
|
|
56
|
+
|
|
57
|
+
- `CodeBlockContent` is a `pre` that is always a tab stop, so a keyboard
|
|
58
|
+
user can scroll a long line; keyboard focus marks the whole block with
|
|
59
|
+
the kit's focus ring. It is always left to right; the header follows
|
|
60
|
+
the page direction. Name it with `aria-label` when a page holds several
|
|
61
|
+
blocks.
|
|
62
|
+
- A string child renders as one text node, so a block stays cheap while
|
|
63
|
+
output streams. With `lineNumbers`, a string is split into lines; the
|
|
64
|
+
numbers come from a CSS counter and stay out of a copied selection, and
|
|
65
|
+
an empty line keeps a newline so blank lines survive the copy.
|
|
66
|
+
- A long `CodeBlockTitle` is cut with an ellipsis; to link the title to a
|
|
67
|
+
file, wrap it in an anchor.
|
|
68
|
+
- `CodeBlockActions` placed straight in `CodeBlock` (no header) float over
|
|
69
|
+
the top end of the block and show on hover or focus, and always on a
|
|
70
|
+
touch screen.
|
|
71
|
+
- The copy button writes `value`, switches to a check glyph and
|
|
72
|
+
`copiedLabel` for two seconds (a second copy restarts the two seconds)
|
|
73
|
+
and says `copiedLabel` once in a polite live region. A refused write, or
|
|
74
|
+
a page with no clipboard (an insecure context), changes nothing.
|
|
75
|
+
- Cap a long block's height with a `max-height` on `CodeBlockContent`; it
|
|
76
|
+
scrolls inside the block.
|
|
77
|
+
|
|
78
|
+
## Examples
|
|
79
|
+
|
|
80
|
+
```tsx
|
|
81
|
+
import {
|
|
82
|
+
CodeBlock,
|
|
83
|
+
CodeBlockActions,
|
|
84
|
+
CodeBlockContent,
|
|
85
|
+
CodeBlockCopyButton,
|
|
86
|
+
CodeBlockHeader,
|
|
87
|
+
CodeBlockLine,
|
|
88
|
+
CodeBlockTitle,
|
|
89
|
+
} from '@gears-frontx/ui-kit';
|
|
90
|
+
|
|
91
|
+
<CodeBlock>
|
|
92
|
+
<CodeBlockHeader>
|
|
93
|
+
<CodeBlockTitle>Terminal</CodeBlockTitle>
|
|
94
|
+
<CodeBlockActions>
|
|
95
|
+
<CodeBlockCopyButton value={command} />
|
|
96
|
+
</CodeBlockActions>
|
|
97
|
+
</CodeBlockHeader>
|
|
98
|
+
<CodeBlockContent>{command}</CodeBlockContent>
|
|
99
|
+
</CodeBlock>
|
|
100
|
+
|
|
101
|
+
<CodeBlock size="sm">
|
|
102
|
+
<CodeBlockContent lineNumbers>
|
|
103
|
+
<CodeBlockLine variant="removed">return <p>Hello</p></CodeBlockLine>
|
|
104
|
+
<CodeBlockLine variant="added">return <p>Hello, {'{name}'}</p></CodeBlockLine>
|
|
105
|
+
</CodeBlockContent>
|
|
106
|
+
</CodeBlock>
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
## Anti-patterns
|
|
110
|
+
|
|
111
|
+
- Do not put a highlighter's HTML string into `CodeBlockContent`: render
|
|
112
|
+
the tokens as elements inside `CodeBlockLine`.
|
|
113
|
+
- Do not wrap the whole block in a link or a button: it holds a focusable
|
|
114
|
+
scroll region and its own actions.
|
package/dist/docs/data-grid.md
CHANGED
|
@@ -351,6 +351,8 @@ Draws a pager in the `bottom` slot and fills `DataGridLoadContext.pagination`.
|
|
|
351
351
|
A page change updates the page, stores it and reloads. A limit change goes back to
|
|
352
352
|
page 1, stores the limit and reloads. A refresh resets the page to 1. The page
|
|
353
353
|
count comes from `total`. The loading treatment is the grid's, not the pager's.
|
|
354
|
+
In a container too narrow for one row, the page buttons wrap to a centred line
|
|
355
|
+
under the page-size selector and the page text.
|
|
354
356
|
|
|
355
357
|
### `DataGridTextSearchPlugin`
|
|
356
358
|
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# DescriptionList
|
|
2
|
+
|
|
3
|
+
Name and value pairs on real `dl`/`dt`/`dd`, so assistive technology keeps each term with its value. `DescriptionListItem` is the `div` grouping HTML allows inside `dl`.
|
|
4
|
+
|
|
5
|
+
## When to use
|
|
6
|
+
|
|
7
|
+
- The facts of a record in a detail panel.
|
|
8
|
+
- A short aside of requirements and values.
|
|
9
|
+
|
|
10
|
+
## When not to use
|
|
11
|
+
|
|
12
|
+
- A form row with an input: use `Field`.
|
|
13
|
+
- Rows the user acts on or navigates: use `Item`.
|
|
14
|
+
- Data compared across many records: use `Table`.
|
|
15
|
+
|
|
16
|
+
## Props (kit level)
|
|
17
|
+
|
|
18
|
+
| Part | Prop | Type | Default |
|
|
19
|
+
|------|------|------|---------|
|
|
20
|
+
| `DescriptionList` | `orientation` | `'vertical' \| 'horizontal'` - term above value, or a two-column grid whose term column takes the widest term | `'vertical'` |
|
|
21
|
+
| | `size` | `'default' \| 'sm'` - row gap and the value's role (body or meta) | `'default'` |
|
|
22
|
+
| `DescriptionListDetails` | `typography` | `'body' \| 'mono'` - the value's ramp role; `mono` sets `--font-mono` | `'body'` |
|
|
23
|
+
|
|
24
|
+
No part takes `render`: the elements are the point of the component. Terms use the label role on `--muted-foreground`.
|
|
25
|
+
|
|
26
|
+
## Accessibility
|
|
27
|
+
|
|
28
|
+
- Real description list semantics; horizontal items sit on a subgrid, so every term lines up in one column.
|
|
29
|
+
|
|
30
|
+
## Layout
|
|
31
|
+
|
|
32
|
+
The horizontal term column is as wide as the longest term and does not shrink, so it suits short terms (Owner, Path, Updated). In a panel narrower than the longest term, use the vertical orientation.
|
|
33
|
+
|
|
34
|
+
## Examples
|
|
35
|
+
|
|
36
|
+
```tsx
|
|
37
|
+
import { DescriptionListDetails, DescriptionListItem, DescriptionList, DescriptionListTerm } from '@gears-frontx/ui-kit';
|
|
38
|
+
|
|
39
|
+
<DescriptionList orientation="horizontal">
|
|
40
|
+
<DescriptionListItem>
|
|
41
|
+
<DescriptionListTerm>Owner</DescriptionListTerm>
|
|
42
|
+
<DescriptionListDetails>Platform team</DescriptionListDetails>
|
|
43
|
+
</DescriptionListItem>
|
|
44
|
+
<DescriptionListItem>
|
|
45
|
+
<DescriptionListTerm>Path</DescriptionListTerm>
|
|
46
|
+
<DescriptionListDetails typography="mono">src/app/main.tsx</DescriptionListDetails>
|
|
47
|
+
</DescriptionListItem>
|
|
48
|
+
</DescriptionList>
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Anti-patterns
|
|
52
|
+
|
|
53
|
+
- Do not build the pairs from `div`s and `span`s.
|
package/dist/docs/drawer.md
CHANGED
|
@@ -92,7 +92,7 @@ exemption list, which is what keeps them out of that file's
|
|
|
92
92
|
The enter/exit slide itself is a plain CSS transition between the
|
|
93
93
|
`[data-starting-style]`/`[data-ending-style]` transform (`--closed-transform`,
|
|
94
94
|
the panel parked one full panel-length past its own edge) and the resting
|
|
95
|
-
transform on `.popup`. Measured
|
|
95
|
+
transform on `.popup`. Measured in a browser at a 900x513 viewport, a bottom
|
|
96
96
|
drawer travels `y: 515 → 308` on open and `308 → 515` on close, a right one
|
|
97
97
|
`x: 902 → 516` and back — monotonic, with the backdrop's opacity crossing
|
|
98
98
|
`0 → 1` on the same curve. Nominal duration is upstream's own
|
package/dist/docs/empty.md
CHANGED
|
@@ -31,9 +31,15 @@ Composition: `Empty` (root) → `EmptyHeader` (→ `EmptyMedia`, `EmptyTitle`,
|
|
|
31
31
|
| `variant` | `'default' \| 'icon'` — `icon` draws a muted rounded square behind the icon; `default` stays transparent | `'default'` |
|
|
32
32
|
| `className` | `string` — merged after the variant class | — |
|
|
33
33
|
|
|
34
|
-
`
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
`EmptyTitle`:
|
|
35
|
+
|
|
36
|
+
| Prop | Type | Default |
|
|
37
|
+
|------|------|---------|
|
|
38
|
+
| `render` | `ReactElement` or callback - the element, such as `<h2 />` to put the headline in the page outline; the title keeps its look | `div` |
|
|
39
|
+
|
|
40
|
+
`Empty`, `EmptyHeader`, `EmptyDescription`, `EmptyDetail`, `EmptyActions`
|
|
41
|
+
and `EmptyContent` take no kit-specific props - every prop is the
|
|
42
|
+
underlying native element's props (`EmptyDescription` renders a `<div>`,
|
|
37
43
|
matching upstream, despite its own props type naming `<p>` - see
|
|
38
44
|
`empty.tsx`), forwarded as-is.
|
|
39
45
|
|