@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.
Files changed (167) hide show
  1. package/README.md +10 -6
  2. package/dist/alert.js +35 -24
  3. package/dist/alert.js.map +1 -1
  4. package/dist/attachment.js +117 -76
  5. package/dist/attachment.js.map +1 -1
  6. package/dist/avatar.js +43 -43
  7. package/dist/badge.js +14 -14
  8. package/dist/card.js +81 -44
  9. package/dist/card.js.map +1 -1
  10. package/dist/chart.js +50 -50
  11. package/dist/chunks/alert.Csv2-ccF.css +1 -0
  12. package/dist/chunks/attachment.BRyIQq3F.css +1 -0
  13. package/dist/chunks/avatar.7EUG65-M.css +1 -0
  14. package/dist/chunks/badge.BwUxa9PB.css +1 -0
  15. package/dist/chunks/card.DSiUMxGK.css +1 -0
  16. package/dist/chunks/chart.B9cGEno8.css +1 -0
  17. package/dist/chunks/code-block.r7Cm0ncj.css +1 -0
  18. package/dist/chunks/description-list.Cx-vFGJL.css +1 -0
  19. package/dist/chunks/dialog.CIR9bQoU.css +1 -0
  20. package/dist/chunks/dropdown-menu.DT1_JLqL.css +1 -0
  21. package/dist/chunks/empty.DWqLrSfF.css +1 -0
  22. package/dist/chunks/heading.DQxQs5po.css +1 -0
  23. package/dist/chunks/item.BQ70Khqj.css +1 -0
  24. package/dist/chunks/link.BOE4f-aB.css +1 -0
  25. package/dist/chunks/message-scroller.CBjPcz8Y.css +1 -0
  26. package/dist/chunks/pagination.BAAl9D_S.css +1 -0
  27. package/dist/chunks/{select.BFwI5rhI.css → select.C3sLDoZI.css} +1 -1
  28. package/dist/chunks/sheet.BkZyzAbA.css +1 -0
  29. package/dist/chunks/sidebar.Dw_e0Jqw.css +1 -0
  30. package/dist/chunks/slider.DY1XDCPw.css +1 -0
  31. package/dist/chunks/status-dot.39NKkKQF.css +1 -0
  32. package/dist/chunks/tabs.BqhiMRUP.css +1 -0
  33. package/dist/chunks/text.7frjnkUr.css +1 -0
  34. package/dist/chunks/visually-hidden.Bd2oAR5D.css +1 -0
  35. package/dist/code-block.d.ts +1 -0
  36. package/dist/code-block.js +152 -0
  37. package/dist/code-block.js.map +1 -0
  38. package/dist/command.js +63 -48
  39. package/dist/command.js.map +1 -1
  40. package/dist/components/alert/alert.d.ts +3 -2
  41. package/dist/components/alert/alert.d.ts.map +1 -1
  42. package/dist/components/attachment/attachment.d.ts +10 -3
  43. package/dist/components/attachment/attachment.d.ts.map +1 -1
  44. package/dist/components/card/card.d.ts +6 -4
  45. package/dist/components/card/card.d.ts.map +1 -1
  46. package/dist/components/code-block/code-block.d.ts +57 -0
  47. package/dist/components/code-block/code-block.d.ts.map +1 -0
  48. package/dist/components/code-block/public.d.ts +2 -0
  49. package/dist/components/code-block/public.d.ts.map +1 -0
  50. package/dist/components/command/command.d.ts +1 -1
  51. package/dist/components/command/command.d.ts.map +1 -1
  52. package/dist/components/description-list/description-list.d.ts +21 -0
  53. package/dist/components/description-list/description-list.d.ts.map +1 -0
  54. package/dist/components/description-list/public.d.ts +2 -0
  55. package/dist/components/description-list/public.d.ts.map +1 -0
  56. package/dist/components/empty/empty.d.ts +3 -2
  57. package/dist/components/empty/empty.d.ts.map +1 -1
  58. package/dist/components/heading/heading.d.ts +10 -0
  59. package/dist/components/heading/heading.d.ts.map +1 -0
  60. package/dist/components/heading/public.d.ts +2 -0
  61. package/dist/components/heading/public.d.ts.map +1 -0
  62. package/dist/components/input-otp/input-otp.d.ts +1 -1
  63. package/dist/components/input-otp/input-otp.d.ts.map +1 -1
  64. package/dist/components/item/item.d.ts +15 -6
  65. package/dist/components/item/item.d.ts.map +1 -1
  66. package/dist/components/link/link.d.ts +18 -0
  67. package/dist/components/link/link.d.ts.map +1 -0
  68. package/dist/components/link/public.d.ts +2 -0
  69. package/dist/components/link/public.d.ts.map +1 -0
  70. package/dist/components/sidebar/sidebar.d.ts +13 -3
  71. package/dist/components/sidebar/sidebar.d.ts.map +1 -1
  72. package/dist/components/slider/slider.d.ts +1 -1
  73. package/dist/components/slider/slider.d.ts.map +1 -1
  74. package/dist/components/table/table.d.ts.map +1 -1
  75. package/dist/components/text/public.d.ts +2 -0
  76. package/dist/components/text/public.d.ts.map +1 -0
  77. package/dist/components/text/text.d.ts +11 -0
  78. package/dist/components/text/text.d.ts.map +1 -0
  79. package/dist/components/visually-hidden/public.d.ts +2 -0
  80. package/dist/components/visually-hidden/public.d.ts.map +1 -0
  81. package/dist/components/visually-hidden/visually-hidden.d.ts +4 -0
  82. package/dist/components/visually-hidden/visually-hidden.d.ts.map +1 -0
  83. package/dist/data-grid/pagination.js +35 -35
  84. package/dist/description-list.d.ts +1 -0
  85. package/dist/description-list.js +78 -0
  86. package/dist/description-list.js.map +1 -0
  87. package/dist/dialog.js +38 -38
  88. package/dist/docs/alert.md +8 -2
  89. package/dist/docs/attachment.md +20 -8
  90. package/dist/docs/avatar.md +8 -2
  91. package/dist/docs/badge.md +12 -11
  92. package/dist/docs/button.md +16 -4
  93. package/dist/docs/calendar.md +6 -0
  94. package/dist/docs/card.md +38 -6
  95. package/dist/docs/carousel.md +4 -2
  96. package/dist/docs/chart.md +23 -0
  97. package/dist/docs/code-block.md +114 -0
  98. package/dist/docs/data-grid.md +2 -0
  99. package/dist/docs/description-list.md +53 -0
  100. package/dist/docs/drawer.md +1 -1
  101. package/dist/docs/empty.md +9 -3
  102. package/dist/docs/heading.md +60 -0
  103. package/dist/docs/item.md +70 -3
  104. package/dist/docs/link.md +48 -0
  105. package/dist/docs/message-scroller.md +5 -0
  106. package/dist/docs/questionnaire.md +1 -1
  107. package/dist/docs/sheet.md +20 -3
  108. package/dist/docs/sidebar.md +27 -0
  109. package/dist/docs/status-dot.md +2 -2
  110. package/dist/docs/switch.md +10 -4
  111. package/dist/docs/text.md +51 -0
  112. package/dist/docs/visually-hidden.md +44 -0
  113. package/dist/dropdown-menu.js +56 -56
  114. package/dist/empty.js +47 -36
  115. package/dist/empty.js.map +1 -1
  116. package/dist/heading.d.ts +1 -0
  117. package/dist/heading.js +36 -0
  118. package/dist/heading.js.map +1 -0
  119. package/dist/index.d.ts +6 -0
  120. package/dist/index.d.ts.map +1 -1
  121. package/dist/index.js +427 -401
  122. package/dist/index.js.map +1 -1
  123. package/dist/input-otp.js +34 -20
  124. package/dist/input-otp.js.map +1 -1
  125. package/dist/item.js +119 -71
  126. package/dist/item.js.map +1 -1
  127. package/dist/link.d.ts +1 -0
  128. package/dist/link.js +55 -0
  129. package/dist/link.js.map +1 -0
  130. package/dist/message-scroller.js +24 -24
  131. package/dist/select.js +45 -45
  132. package/dist/sheet.js +41 -41
  133. package/dist/sidebar.js +207 -193
  134. package/dist/sidebar.js.map +1 -1
  135. package/dist/slider.js +34 -21
  136. package/dist/slider.js.map +1 -1
  137. package/dist/status-dot.js +25 -25
  138. package/dist/table.js +172 -157
  139. package/dist/table.js.map +1 -1
  140. package/dist/tabs.js +14 -14
  141. package/dist/text.d.ts +1 -0
  142. package/dist/text.js +53 -0
  143. package/dist/text.js.map +1 -0
  144. package/dist/theme.css +29 -6
  145. package/dist/utilities.css +25 -2
  146. package/dist/visually-hidden.d.ts +1 -0
  147. package/dist/visually-hidden.js +18 -0
  148. package/dist/visually-hidden.js.map +1 -0
  149. package/llms.txt +72 -15
  150. package/package.json +1 -4
  151. package/dist/chunks/alert.DsgRIXLn.css +0 -1
  152. package/dist/chunks/attachment.CZuZdlXC.css +0 -1
  153. package/dist/chunks/avatar.BMm-Z9l5.css +0 -1
  154. package/dist/chunks/badge.BCreEn3O.css +0 -1
  155. package/dist/chunks/card.DdBl-usf.css +0 -1
  156. package/dist/chunks/chart.CeyctrXQ.css +0 -1
  157. package/dist/chunks/dialog.Cpo8vChK.css +0 -1
  158. package/dist/chunks/dropdown-menu.TU3FHXbJ.css +0 -1
  159. package/dist/chunks/empty.DnAKlw2g.css +0 -1
  160. package/dist/chunks/item.BkcgydVc.css +0 -1
  161. package/dist/chunks/message-scroller.CbLooS7Q.css +0 -1
  162. package/dist/chunks/pagination.Cn8tIWMX.css +0 -1
  163. package/dist/chunks/sheet.BWvXXyXk.css +0 -1
  164. package/dist/chunks/sidebar.DdEvMURX.css +0 -1
  165. package/dist/chunks/slider.inyNxx4y.css +0 -1
  166. package/dist/chunks/status-dot.DWa2qGKe.css +0 -1
  167. package/dist/chunks/tabs.DFa0OYMo.css +0 -1
package/dist/dialog.js CHANGED
@@ -1,69 +1,69 @@
1
- import { jsx as e, jsxs as i } from "react/jsx-runtime";
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 s } from "class-variance-authority";
4
- import { XIcon as d } from "lucide-react";
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.Cpo8vChK.css';const m = "_backdrop_135ow_6", f = "_popup_135ow_22", D = "_closeButton_135ow_164", w = "_header_135ow_152", N = "_footer_135ow_152", h = "_title_135ow_274", v = "_description_135ow_282", B = "_svgIcon_135ow_289", n = {
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: w,
11
- footer: N,
12
- title: h,
13
- description: v,
14
- svgIcon: B
15
- }, T = r.Root;
16
- function j({ className: o, ...t }) {
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 P({ className: o, ...t }) {
19
+ function y({ className: o, ...t }) {
20
20
  return /* @__PURE__ */ e(r.Close, { className: o, ...t });
21
21
  }
22
- function y({
22
+ function z({
23
23
  className: o,
24
24
  children: t,
25
- container: c,
26
- showCloseButton: a = !0,
25
+ container: i,
26
+ showCloseButton: c = !0,
27
27
  showBackdrop: l = !0,
28
- closeLabel: p = "Close",
28
+ closeLabel: d = "Close",
29
29
  size: u = "default",
30
- ..._
30
+ ...p
31
31
  }) {
32
- return /* @__PURE__ */ i(r.Portal, { container: c, children: [
33
- l && /* @__PURE__ */ e(r.Backdrop, { className: n.backdrop }),
34
- /* @__PURE__ */ i(r.Popup, { "data-size": u, className: s(n.popup, o), ..._, children: [
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
- a && /* @__PURE__ */ e(
36
+ c && /* @__PURE__ */ e(
37
37
  r.Close,
38
38
  {
39
- "aria-label": p,
40
- className: n.closeButton,
41
- render: /* @__PURE__ */ e(g, { variant: "ghost", icon: /* @__PURE__ */ e(d, { className: n.svgIcon }) })
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: s(n.footer, o), ...t });
48
+ return /* @__PURE__ */ e("div", { className: n(a.header, o), ...t });
52
49
  }
53
50
  function H({ className: o, ...t }) {
54
- return /* @__PURE__ */ e(r.Title, { className: s(n.title, o), ...t });
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.Description, { className: s(n.description, o), ...t });
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
- T as Dialog,
61
- P as DialogClose,
62
- y as DialogContent,
63
- R as DialogDescription,
64
- F as DialogFooter,
65
- z as DialogHeader,
66
- H as DialogTitle,
67
- j as DialogTrigger
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
@@ -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`, `AlertDescription`, and `AlertAction` take no kit-specific
40
- props — every prop is the underlying `<div>`'s props, forwarded as-is.
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
 
@@ -139,8 +139,14 @@ visual result is a slightly larger action button (32px) than upstream's
139
139
 
140
140
  ### AttachmentGroup
141
141
 
142
- Accepts only `className` (merged after the layout class, alongside the
143
- `scroll-fade-x`/`no-scrollbar` utility classes) plus native `<div>` props.
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. When its
239
- attachments are interactive (a trigger or actions), keyboard users reach
240
- off-screen items by tabbing to them. For a row of presentational
241
- attachments, make the group itself focusable and scrollable by adding
242
- `tabIndex={0}`, `role="group"`, and an `aria-label`.
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.
@@ -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 with an on-primary label, `soft` puts the tone's own label color
54
- on its soft surface. The `neutral`/`soft` default is the plain
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
 
@@ -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 `--destructive` label, the identical recipe Button carries.
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 own color as the label, matching the Studio
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` under a `--destructive` label, and a `--danger-soft`
30
- fill under a `--danger` label. Two names for one red, one per role.
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, and on the drawn status values three pairs do not reach it: light
40
- > `success` (3.43:1), light `warning` (2.00:1) and dark `danger` (3.63:1),
41
- > with light `danger` at 4.28:1. The kit ships the drawn values; the
42
- > finding belongs with the designer, and `tokens.test.ts` pins the hexes so
43
- > a correction has to happen in the design first. Where that matters,
44
- > `secondary`, `info` and `accent` clear the floor in both themes. Color is
45
- > not a substitute for text either way: keep the label itself explicit.
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
 
@@ -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 — use the consumer app's link component, not
19
- `variant="link"`; that variant exists for actions that visually read as
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
  ```
@@ -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`, not a heading element — like every
58
- other part, it has no `render` prop to swap it (Card has no Base UI
59
- primitive to supply one). When a card is a real page landmark rather
60
- than a decorative grouping, supply your own heading (e.g. wrap the text
61
- in an `h2`/`h3`) so the page keeps a document outline; `CardTitle` alone
62
- contributes nothing to it.
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.
@@ -91,8 +91,10 @@ import {
91
91
  CarouselPrevious,
92
92
  } from '@gears-frontx/ui-kit';
93
93
 
94
- // Horizontal (default), with nav buttons
95
- <Carousel>
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>
@@ -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 &lt;p&gt;Hello&lt;/p&gt;</CodeBlockLine>
104
+ <CodeBlockLine variant="added">return &lt;p&gt;Hello, {'{name}'}&lt;/p&gt;</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.
@@ -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.
@@ -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 on the demo at a 900x513 viewport, a bottom
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
@@ -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
- `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>`,
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