@gears-frontx/ui-kit 0.4.0-alpha.4 → 0.4.0-alpha.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (246) hide show
  1. package/README.md +1 -1
  2. package/dist/accordion.js +7 -7
  3. package/dist/alert-dialog.js +21 -21
  4. package/dist/alert.js +19 -19
  5. package/dist/attachment.js +11 -11
  6. package/dist/avatar.js +33 -33
  7. package/dist/badge.js +48 -25
  8. package/dist/badge.js.map +1 -1
  9. package/dist/bubble.js +38 -38
  10. package/dist/button-group.js +8 -8
  11. package/dist/button.js +40 -34
  12. package/dist/button.js.map +1 -1
  13. package/dist/calendar.js +30 -30
  14. package/dist/card.js +56 -33
  15. package/dist/card.js.map +1 -1
  16. package/dist/chart.js +183 -115
  17. package/dist/chart.js.map +1 -1
  18. package/dist/checkbox.js +12 -12
  19. package/dist/checkbox.js.map +1 -1
  20. package/dist/chunks/accordion.CXlSdkrc.css +1 -0
  21. package/dist/chunks/alert-dialog.C4aLtUC8.css +1 -0
  22. package/dist/chunks/alert.DsgRIXLn.css +1 -0
  23. package/dist/chunks/attachment.CZuZdlXC.css +1 -0
  24. package/dist/chunks/avatar.BMm-Z9l5.css +1 -0
  25. package/dist/chunks/badge.BCreEn3O.css +1 -0
  26. package/dist/chunks/bubble.Ccu0e3lY.css +1 -0
  27. package/dist/chunks/button-group.BB-_2uav.css +1 -0
  28. package/dist/chunks/button.DgUTlW0_.css +1 -0
  29. package/dist/chunks/calendar.Dtndav4F.css +1 -0
  30. package/dist/chunks/card.DdBl-usf.css +1 -0
  31. package/dist/chunks/checkbox.CrdIZhi1.css +1 -0
  32. package/dist/chunks/collapsible.BkLeBug_.css +1 -0
  33. package/dist/chunks/combobox.DZZ3tHP_.css +1 -0
  34. package/dist/chunks/command.BBW1Cy-M.css +1 -0
  35. package/dist/chunks/context-menu.D_HuTgqL.css +1 -0
  36. package/dist/chunks/data-table.DJJaM7bh.css +1 -0
  37. package/dist/chunks/dialog.Cpo8vChK.css +1 -0
  38. package/dist/chunks/drawer.D8l6-G8t.css +1 -0
  39. package/dist/chunks/dropdown-menu.TU3FHXbJ.css +1 -0
  40. package/dist/chunks/empty.DnAKlw2g.css +1 -0
  41. package/dist/chunks/field.CDoJmJUe.css +1 -0
  42. package/dist/chunks/hover-card.D00tbys5.css +1 -0
  43. package/dist/chunks/input-group.C7XgalVn.css +1 -0
  44. package/dist/chunks/input-otp.Dvxlngb4.css +1 -0
  45. package/dist/chunks/input.DORly3Cx.css +1 -0
  46. package/dist/chunks/{label.jrB9zD_G.css → label.s0Wrm1i-.css} +1 -1
  47. package/dist/chunks/{menubar.CxRNI9o4.css → menubar.CJcVQhPq.css} +1 -1
  48. package/dist/chunks/message.B9Rexp_f.css +1 -0
  49. package/dist/chunks/native-select.BosBdRAx.css +1 -0
  50. package/dist/chunks/navigation-menu.CuXMCPRN.css +1 -0
  51. package/dist/chunks/pagination.bFb5us_w.css +1 -0
  52. package/dist/chunks/popover.BYhwNKnZ.css +1 -0
  53. package/dist/chunks/progress.DjSEXfxh.css +1 -0
  54. package/dist/chunks/questionnaire.C-YTRjPE.css +1 -0
  55. package/dist/chunks/radio-group.CisvBT6g.css +1 -0
  56. package/dist/chunks/scroll-area.B0OVmDRX.css +1 -0
  57. package/dist/chunks/select.BFwI5rhI.css +1 -0
  58. package/dist/chunks/sheet.BWvXXyXk.css +1 -0
  59. package/dist/chunks/sidebar.DdEvMURX.css +1 -0
  60. package/dist/chunks/slider.inyNxx4y.css +1 -0
  61. package/dist/chunks/spinner.sH6x_1Uf.css +1 -0
  62. package/dist/chunks/status-dot.DWa2qGKe.css +1 -0
  63. package/dist/chunks/switch.D3_ZyuVP.css +1 -0
  64. package/dist/chunks/table.DR2nFT0x.css +1 -0
  65. package/dist/chunks/tabs.DFa0OYMo.css +1 -0
  66. package/dist/chunks/{textarea.ORRSI69B.css → textarea.DMphp0qh.css} +1 -1
  67. package/dist/chunks/toast.Dw-jW4YY.css +1 -0
  68. package/dist/chunks/toggle-group.BpWF6enM.css +1 -0
  69. package/dist/chunks/toggle.B82Id2zR.css +1 -0
  70. package/dist/chunks/tooltip.CFJyyz-O.css +1 -0
  71. package/dist/collapsible.js +7 -7
  72. package/dist/combobox.js +87 -87
  73. package/dist/command.js +28 -28
  74. package/dist/components/badge/badge.d.ts +5 -2
  75. package/dist/components/badge/badge.d.ts.map +1 -1
  76. package/dist/components/button/button.d.ts +1 -1
  77. package/dist/components/button/button.d.ts.map +1 -1
  78. package/dist/components/card/card.d.ts +10 -4
  79. package/dist/components/card/card.d.ts.map +1 -1
  80. package/dist/components/chart/chart.d.ts +7 -6
  81. package/dist/components/chart/chart.d.ts.map +1 -1
  82. package/dist/components/checkbox/checkbox.d.ts.map +1 -1
  83. package/dist/components/dropdown-menu/dropdown-menu.d.ts +9 -1
  84. package/dist/components/dropdown-menu/dropdown-menu.d.ts.map +1 -1
  85. package/dist/components/empty/empty.d.ts +11 -0
  86. package/dist/components/empty/empty.d.ts.map +1 -1
  87. package/dist/components/empty/public.d.ts +1 -1
  88. package/dist/components/empty/public.d.ts.map +1 -1
  89. package/dist/components/input-group/input-group.d.ts +5 -2
  90. package/dist/components/input-group/input-group.d.ts.map +1 -1
  91. package/dist/components/navigation-menu/navigation-menu.d.ts +7 -2
  92. package/dist/components/navigation-menu/navigation-menu.d.ts.map +1 -1
  93. package/dist/components/pagination/pagination.d.ts +4 -6
  94. package/dist/components/pagination/pagination.d.ts.map +1 -1
  95. package/dist/components/popover/popover.d.ts +2 -2
  96. package/dist/components/popover/popover.d.ts.map +1 -1
  97. package/dist/components/select/select.d.ts +2 -2
  98. package/dist/components/select/select.d.ts.map +1 -1
  99. package/dist/components/spinner/spinner.d.ts +19 -3
  100. package/dist/components/spinner/spinner.d.ts.map +1 -1
  101. package/dist/components/status-dot/public.d.ts +2 -0
  102. package/dist/components/status-dot/public.d.ts.map +1 -0
  103. package/dist/components/status-dot/status-dot.d.ts +25 -0
  104. package/dist/components/status-dot/status-dot.d.ts.map +1 -0
  105. package/dist/components/table/table.d.ts +31 -5
  106. package/dist/components/table/table.d.ts.map +1 -1
  107. package/dist/components/tabs/tabs.d.ts +10 -2
  108. package/dist/components/tabs/tabs.d.ts.map +1 -1
  109. package/dist/components/toggle/toggle.d.ts +12 -2
  110. package/dist/components/toggle/toggle.d.ts.map +1 -1
  111. package/dist/components/toggle-group/toggle-group.d.ts +33 -4
  112. package/dist/components/toggle-group/toggle-group.d.ts.map +1 -1
  113. package/dist/components/tooltip/tooltip.d.ts +5 -8
  114. package/dist/components/tooltip/tooltip.d.ts.map +1 -1
  115. package/dist/context-menu.js +54 -54
  116. package/dist/data-table.js +41 -41
  117. package/dist/dialog.js +39 -39
  118. package/dist/docs/alert-dialog.md +1 -1
  119. package/dist/docs/avatar.md +3 -1
  120. package/dist/docs/badge.md +42 -14
  121. package/dist/docs/button.md +3 -2
  122. package/dist/docs/card.md +6 -0
  123. package/dist/docs/chart.md +20 -14
  124. package/dist/docs/checkbox.md +6 -0
  125. package/dist/docs/command.md +4 -0
  126. package/dist/docs/data-table.md +12 -7
  127. package/dist/docs/dialog.md +3 -2
  128. package/dist/docs/dropdown-menu.md +6 -0
  129. package/dist/docs/empty.md +44 -9
  130. package/dist/docs/input-group.md +23 -3
  131. package/dist/docs/navigation-menu.md +14 -5
  132. package/dist/docs/pagination.md +18 -15
  133. package/dist/docs/popover.md +6 -0
  134. package/dist/docs/progress.md +6 -0
  135. package/dist/docs/questionnaire.md +4 -2
  136. package/dist/docs/select.md +8 -4
  137. package/dist/docs/sheet.md +8 -7
  138. package/dist/docs/spinner.md +35 -5
  139. package/dist/docs/status-dot.md +77 -0
  140. package/dist/docs/table.md +69 -25
  141. package/dist/docs/tabs.md +22 -7
  142. package/dist/docs/toggle-group.md +68 -9
  143. package/dist/docs/toggle.md +7 -1
  144. package/dist/docs/tooltip.md +5 -9
  145. package/dist/drawer.js +53 -53
  146. package/dist/dropdown-menu.js +102 -89
  147. package/dist/dropdown-menu.js.map +1 -1
  148. package/dist/empty.js +31 -21
  149. package/dist/empty.js.map +1 -1
  150. package/dist/field.js +24 -24
  151. package/dist/hover-card.js +14 -14
  152. package/dist/index.d.ts +1 -0
  153. package/dist/index.d.ts.map +1 -1
  154. package/dist/index.js +266 -261
  155. package/dist/index.js.map +1 -1
  156. package/dist/input-group.js +73 -50
  157. package/dist/input-group.js.map +1 -1
  158. package/dist/input-otp.js +3 -3
  159. package/dist/input.js +19 -19
  160. package/dist/label.js +1 -1
  161. package/dist/menubar.js +18 -18
  162. package/dist/message.js +11 -11
  163. package/dist/native-select.js +20 -20
  164. package/dist/navigation-menu.js +83 -64
  165. package/dist/navigation-menu.js.map +1 -1
  166. package/dist/pagination.js +39 -52
  167. package/dist/pagination.js.map +1 -1
  168. package/dist/popover.js +33 -31
  169. package/dist/popover.js.map +1 -1
  170. package/dist/progress.js +15 -15
  171. package/dist/questionnaire.js +72 -72
  172. package/dist/radio-group.js +7 -7
  173. package/dist/scroll-area.js +8 -8
  174. package/dist/select.js +82 -80
  175. package/dist/select.js.map +1 -1
  176. package/dist/sheet.js +46 -46
  177. package/dist/sidebar.js +130 -130
  178. package/dist/slider.js +14 -14
  179. package/dist/spinner.js +45 -13
  180. package/dist/spinner.js.map +1 -1
  181. package/dist/status-dot.d.ts +1 -0
  182. package/dist/status-dot.js +76 -0
  183. package/dist/status-dot.js.map +1 -0
  184. package/dist/switch.js +14 -14
  185. package/dist/table.js +221 -43
  186. package/dist/table.js.map +1 -1
  187. package/dist/tabs.js +44 -26
  188. package/dist/tabs.js.map +1 -1
  189. package/dist/textarea.js +5 -5
  190. package/dist/theme.css +222 -135
  191. package/dist/toast.js +26 -26
  192. package/dist/toggle-group.js +40 -25
  193. package/dist/toggle-group.js.map +1 -1
  194. package/dist/toggle.js +21 -11
  195. package/dist/toggle.js.map +1 -1
  196. package/dist/tooltip.js +37 -34
  197. package/dist/tooltip.js.map +1 -1
  198. package/llms.txt +26 -10
  199. package/package.json +1 -1
  200. package/dist/chunks/accordion.X_AK08Iv.css +0 -1
  201. package/dist/chunks/alert-dialog.B50f-Gsz.css +0 -1
  202. package/dist/chunks/alert.C5BedF7l.css +0 -1
  203. package/dist/chunks/attachment.GAZbWSyB.css +0 -1
  204. package/dist/chunks/avatar.DZUXl1ev.css +0 -1
  205. package/dist/chunks/badge.Bi22h20j.css +0 -1
  206. package/dist/chunks/bubble.DvN6QyQ1.css +0 -1
  207. package/dist/chunks/button-group.D0Ir-jbL.css +0 -1
  208. package/dist/chunks/button.DvAxXxKj.css +0 -1
  209. package/dist/chunks/calendar.Cnbv4EzY.css +0 -1
  210. package/dist/chunks/card.D3Ct_dza.css +0 -1
  211. package/dist/chunks/checkbox.CZfE_PkU.css +0 -1
  212. package/dist/chunks/collapsible.BQ-sU5sQ.css +0 -1
  213. package/dist/chunks/combobox.CtYpZAKB.css +0 -1
  214. package/dist/chunks/command.Km60IuqD.css +0 -1
  215. package/dist/chunks/context-menu.DwGCD0vN.css +0 -1
  216. package/dist/chunks/data-table.CtZdVSAU.css +0 -1
  217. package/dist/chunks/dialog.BxcZ12Gb.css +0 -1
  218. package/dist/chunks/drawer.BkS_qEHj.css +0 -1
  219. package/dist/chunks/dropdown-menu.C5TLD9JO.css +0 -1
  220. package/dist/chunks/empty.BlhsHrOz.css +0 -1
  221. package/dist/chunks/field.Ccqt897k.css +0 -1
  222. package/dist/chunks/hover-card.DmwvigMp.css +0 -1
  223. package/dist/chunks/input-group.CFIUP-Oh.css +0 -1
  224. package/dist/chunks/input-otp.XSpqyVij.css +0 -1
  225. package/dist/chunks/input.DvA_mTq8.css +0 -1
  226. package/dist/chunks/message.BhD5JDJK.css +0 -1
  227. package/dist/chunks/native-select.DF1QrNz4.css +0 -1
  228. package/dist/chunks/navigation-menu.C2JGHAKD.css +0 -1
  229. package/dist/chunks/pagination.DUiQuWla.css +0 -1
  230. package/dist/chunks/popover.fOvPrnsr.css +0 -1
  231. package/dist/chunks/progress.Bp13t8iw.css +0 -1
  232. package/dist/chunks/questionnaire.D-u_K3Co.css +0 -1
  233. package/dist/chunks/radio-group.CV3MBCsI.css +0 -1
  234. package/dist/chunks/scroll-area.C4kWMAsU.css +0 -1
  235. package/dist/chunks/select.iEwV-sfJ.css +0 -1
  236. package/dist/chunks/sheet.DALPg9vf.css +0 -1
  237. package/dist/chunks/sidebar.CGTQhfWG.css +0 -1
  238. package/dist/chunks/slider.B5nouD7J.css +0 -1
  239. package/dist/chunks/spinner.UKK4f1tu.css +0 -1
  240. package/dist/chunks/switch.CIW9Jr1x.css +0 -1
  241. package/dist/chunks/table.BpnQ6j85.css +0 -1
  242. package/dist/chunks/tabs.4MEFBvw-.css +0 -1
  243. package/dist/chunks/toast.uUtCEAiv.css +0 -1
  244. package/dist/chunks/toggle-group.Bd0cCCnV.css +0 -1
  245. package/dist/chunks/toggle.B9tvfl1n.css +0 -1
  246. package/dist/chunks/tooltip.apA3VWHJ.css +0 -1
@@ -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. This matches the
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
- wrap your own `div` with `overflow-y` and a `max-height` around `<Table>` —
54
- it composes cleanly, since your wrapper scrolls the vertical axis and
55
- Table's own wrapper scrolls the horizontal one (see Examples).
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 no
65
- props of its own — it isn't a separate export, so there's no `max-height`
66
- you can pass it; for that, put your own `div` around `<Table>` (as above).
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
- Two kit-specific props on `Table`: `label` (`string`) names the focusable
201
- scroll wrapper with `role="region"` + `aria-label` (see above), and
202
- `density` (`default` | `compact`) tightens cell padding for operational
203
- views — purely cell metrics, not a data-table feature. Every other prop
204
- is the matching native element's own (`ComponentProps<'table'>`,
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, composed around `Table`'s own horizontal one (see
278
- "The scroll wrapper" above):
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
- <div style={{ maxHeight: '20rem', overflowY: 'auto' }}>
284
- <Table>
285
- <TableBody>
286
- <TableRow>
287
- <TableCell>Row 1</TableCell>
288
- </TableRow>
289
- </TableBody>
290
- </Table>
291
- </div>;
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
package/dist/docs/tabs.md CHANGED
@@ -12,6 +12,11 @@ Composition: `Tabs` (root, holds the selected value) → `TabsList` (→ one
12
12
  `TabsTrigger` per tab) → one `TabsContent` per tab, matched to its trigger
13
13
  by `value`.
14
14
 
15
+ `TabsList` renders the indicator itself: one bar per list that travels to
16
+ the active tab over 240 ms, positioned from the geometry Base UI measures
17
+ at runtime. There is no indicator part to place, because every list has
18
+ exactly one.
19
+
15
20
  ## When to use
16
21
 
17
22
  - Grouping related views that don't need to be compared side by side —
@@ -43,7 +48,8 @@ by `value`.
43
48
 
44
49
  | Prop | Type | Default |
45
50
  |------|------|---------|
46
- | `variant` | `default` \| `line` — `default` is a trackless list where the active tab gets its own raised background (`--surface-elevated`); `line` is a flat row where the active tab is marked by an underline instead. A bordered segmented-control look is NOT a Tabs variant — that styling belongs to the planned `toggle-group` component | `default` |
51
+ | `variant` | `default` \| `line` - `line` is a trackless row with one 3px `--primary` bar travelling under the active tab. `default` is the filled track: a `--muted` strip at a 10px corner insetting its triggers by 3, whose active tab takes `--secondary` with a 1px `--border` hairline and no bar. A bordered segmented-control look is not a Tabs variant; that styling belongs to `toggle-group` | `default` |
52
+ | `size` | `sm` \| `default` - a 12/16 or a 14/20 label; nothing else moves between the two | `default` |
47
53
  | `className` | `string` — merged after the kit class | — |
48
54
 
49
55
  `TabsTrigger`: `value` (required, matches a `TabsContent`), `disabled`;
@@ -53,6 +59,15 @@ other props follow Base UI `Tabs.Tab`. Renders a native `<button>`.
53
59
  (keep the panel in the DOM while inactive instead of unmounting it —
54
60
  `false` by default); other props follow Base UI `Tabs.Panel`.
55
61
 
62
+ | Prop | Type | Default |
63
+ |------|------|---------|
64
+ | `animate` | `boolean` - replay the enter animation each time this panel becomes the active one: a fade up over 4px, on the list's own 240 ms step. Under `prefers-reduced-motion` the panel still fades but does not travel | `true` |
65
+
66
+ Switching tabs therefore moves two things together: the indicator travels
67
+ to the new trigger while its panel arrives. Opt out per panel with
68
+ `animate={false}` where the content animates itself, or must not move at
69
+ all.
70
+
56
71
  Set `orientation="vertical"` on `Tabs` for a sidebar-style layout (list on
57
72
  the side, panel beside it instead of below it) — every part reads its own
58
73
  `data-orientation`, so no other prop changes.
@@ -110,15 +125,15 @@ import { Tabs, TabsContent, TabsList, TabsTrigger } from '@gears-frontx/ui-kit';
110
125
  position, uncommitted form input) unless you pass `keepMounted` — by
111
126
  default an inactive panel unmounts, and remounts from scratch when
112
127
  reselected.
113
- - Do not reach for `variant="line"` expecting an animated highlight that
114
- slides between tabs — the underline is a per-tab crossfade, not a
115
- single element in motion.
116
128
  - Do not omit `defaultValue`/`value` and leave the first `TabsTrigger`
117
129
  disabled — Base UI falls back to the next enabled tab client-side, but
118
130
  it can't do that during server-side rendering (it doesn't yet know
119
131
  which tabs are disabled while pre-rendering), so the server- and
120
132
  client-rendered output disagree. Set `defaultValue`/`value` explicitly
121
133
  to an enabled tab's value whenever the first one might be disabled.
122
- - Do not expect an icon placed inside a `TabsTrigger` to be auto-sized —
123
- unlike some shadcn components, this kit has no `data-icon`/generic
124
- `svg` sizing convention yet; size your own icon via `className`.
134
+ - Do not size an icon inside a `TabsTrigger` yourself: the trigger draws
135
+ every direct `svg` child at the drawn 16px box.
136
+ - Do not add a wrapper keyed on the active value to replay an enter
137
+ animation - `TabsContent` already animates on becoming active, and a
138
+ keyed wrapper on top of it remounts the content twice as often as the
139
+ panel does.
@@ -28,11 +28,13 @@ navigation between items, state via `data-pressed` on each item.
28
28
  | `disabled` | disables every item in the group | `false` |
29
29
  | `variant` | `default` \| `outline` — applied to every item unless an item overrides it | `default` |
30
30
  | `size` | `default` \| `sm` \| `lg` — applied to every item unless an item overrides it | `default` |
31
+ | `spacing` | `number` - gap between items, in pixels; `0` also switches to the segmented look (see "Segmented geometry") | `undefined` |
32
+ | `iconOnly` | `boolean` - every item holds a glyph and nothing else: each squares up to the group's size step (32 at `sm`) and draws its glyph at 18; an item's own `iconOnly` applies where the group leaves it unset | `undefined` |
31
33
  | `className` | `string` — merged after the kit class | — |
32
34
 
33
35
  `ToggleGroupItem`: `value` (required — identifies the item), `variant`,
34
- `size` (fall back to the group's when the group sets one), `className`;
35
- other props follow Base UI Toggle (`disabled`, ...).
36
+ `size`, `iconOnly` (fall back to the group's when the group sets one),
37
+ `className`; other props follow Base UI Toggle (`disabled`, ...).
36
38
 
37
39
  ## Examples
38
40
 
@@ -57,6 +59,14 @@ import { ToggleGroup, ToggleGroupItem } from '@gears-frontx/ui-kit';
57
59
  <ToggleGroupItem value="list" aria-label="List view"><ListIcon /></ToggleGroupItem>
58
60
  <ToggleGroupItem value="grid" aria-label="Grid view"><GridIcon /></ToggleGroupItem>
59
61
  </ToggleGroup>
62
+
63
+ // Segmented (spacing={0}) - a single bordered strip instead of
64
+ // independently bordered items; pair with variant="outline" for the
65
+ // border to actually show.
66
+ <ToggleGroup spacing={0} variant="outline" aria-label="View mode">
67
+ <ToggleGroupItem value="list" aria-label="List view"><ListIcon /></ToggleGroupItem>
68
+ <ToggleGroupItem value="grid" aria-label="Grid view"><GridIcon /></ToggleGroupItem>
69
+ </ToggleGroup>
60
70
  ```
61
71
 
62
72
  ## Anti-patterns
@@ -67,11 +77,60 @@ import { ToggleGroup, ToggleGroupItem } from '@gears-frontx/ui-kit';
67
77
  - Do not omit `aria-label`/`aria-labelledby` on the group — it groups
68
78
  buttons, but the group itself still needs a name for assistive tech.
69
79
 
70
- ## Deviation from upstream
80
+ ## Icon view switch
81
+
82
+ The drawn single-choice icon switch: one square 32 box per option, glyphs
83
+ at 18, no gap between them, a hairline strip around the whole thing, and
84
+ exactly one option chosen at a time. Every part of it is already a prop -
85
+ `spacing={0}` collapses the gap and joins the borders, `variant="outline"`
86
+ draws the hairline, `iconOnly` squares the items, and single selection is
87
+ what the group does unless `multiple` is set.
88
+
89
+ Each option carries its own accessible name: the label is not drawn, so it
90
+ lives in `aria-label` rather than in hidden text. The group needs a name of
91
+ its own too.
92
+
93
+ ```tsx
94
+ import { ToggleGroup, ToggleGroupItem } from '@gears-frontx/ui-kit';
95
+ import { LayoutGridIcon, ListIcon, TableIcon } from 'lucide-react';
96
+
97
+ const [view, setView] = useState('list');
98
+
99
+ <ToggleGroup
100
+ size="sm"
101
+ spacing={0}
102
+ variant="outline"
103
+ iconOnly
104
+ value={[view]}
105
+ onValueChange={([next]) => next && setView(next)}
106
+ aria-label="View"
107
+ >
108
+ <ToggleGroupItem value="list" aria-label="List"><ListIcon /></ToggleGroupItem>
109
+ <ToggleGroupItem value="grid" aria-label="Grid"><LayoutGridIcon /></ToggleGroupItem>
110
+ <ToggleGroupItem value="table" aria-label="Table"><TableIcon /></ToggleGroupItem>
111
+ </ToggleGroup>;
112
+ ```
71
113
 
72
- Upstream's `spacing` prop (`0` collapses the group into a bordered
73
- "segment" look with adjoining items sharing borders, via Tailwind
74
- arbitrary sibling selectors) is not ported — it's a Tailwind-specific
75
- mechanic with no direct CSS Modules equivalent, and it is opt-in even
76
- upstream (the shipped default is a small gap between independently
77
- bordered items, which is what this component always renders).
114
+ `onValueChange` hands back an array even in single selection, and that
115
+ array is empty when the chosen option is pressed again. Guarding on
116
+ `next` is what keeps a view switch from ending up with nothing chosen; drop
117
+ the guard where deselecting is a real state.
118
+
119
+ ## Segmented geometry
120
+
121
+ The drawn group at `spacing={0}` has no height, no padding, no border and
122
+ no fill of its own: the items carry everything. Adjoining items drop the
123
+ border they share, the group's own outer corners are the only rounded ones
124
+ (10px, or 8px when the group itself is sized `sm`), each item insets its
125
+ label by 8, and the selected one takes the `--secondary` fill `Toggle`
126
+ already paints for its pressed state.
127
+
128
+ Every `spacing={0}` group reaches that look, vertical ones on the block
129
+ axis instead of the inline one. Upstream reaches it
130
+ through arbitrary sibling selectors with no direct CSS Modules equivalent;
131
+ this port reaches the same geometry through plain structural selectors keyed
132
+ on `data-spacing`, the same idiom `ButtonGroup` already uses for its own
133
+ bordered strip (see button-group.module.css).
134
+
135
+ Leaving `spacing` unset renders exactly what this component always has - a
136
+ fixed `--space-1` gap between independently bordered items.
@@ -21,8 +21,9 @@ an item inside `ToggleGroup`.
21
21
  |------|------|---------|
22
22
  | `pressed` / `defaultPressed` | controlled / uncontrolled pressed state | `false` |
23
23
  | `onPressedChange` | `(pressed: boolean, eventDetails) => void` | — |
24
- | `variant` | `default` \| `outline` | `default` |
24
+ | `variant` | `default` \| `outline` \| `steel` - `steel` is a hairline in `--border` over nothing, filling with `--muted` on hover and holding `--secondary` while pressed | `default` |
25
25
  | `size` | `default` \| `sm` \| `lg` | `default` |
26
+ | `iconOnly` | `boolean` - the toggle holds a glyph and nothing else: it squares up to its own size step (32 at `sm`) and draws the glyph at 18 | `false` |
26
27
  | `value` | identifies this toggle inside a `ToggleGroup` | — |
27
28
  | `className` | `string` — merged after variant/size classes | — |
28
29
 
@@ -47,6 +48,11 @@ import { Toggle } from '@gears-frontx/ui-kit';
47
48
  <Toggle variant="outline" size="lg" aria-label="Italic">
48
49
  <ItalicIcon />
49
50
  </Toggle>
51
+
52
+ // Icon-only: square at its size step, glyph at 18
53
+ <Toggle iconOnly variant="outline" size="sm" aria-label="Grid view">
54
+ <GridIcon />
55
+ </Toggle>
50
56
  ```
51
57
 
52
58
  ## Anti-patterns
@@ -80,15 +80,11 @@ to share open/close delay and grouping: once one tooltip in the group
80
80
  opens, adjacent ones open instantly while hovering within `timeout`
81
81
  (default `400`ms) of each other. It renders no DOM element itself.
82
82
 
83
- By itself, mounting it does **not** change the open delay — Base UI's
84
- per-trigger default (`600`ms) still applies to the first tooltip opened
85
- in the group. (This is a deliberate divergence from base-vega's own
86
- wrapper, which defaults the Provider's `delay` to `0`: that default only
87
- makes sense in a model where the Provider is mounted once, globally, at
88
- the app root — here, where it's optional, defaulting to instant-open
89
- would mean identical trigger markup opens at 600ms or 0ms depending on
90
- an invisible ancestor.) Pass `delay` explicitly on `TooltipProvider` (or
91
- on individual `TooltipTrigger`s) to open faster.
83
+ Inside a provider, `delay` is the drawn `0`: the first tooltip opens on
84
+ hover with no wait, and the rest of the group follows it. Outside one,
85
+ Base UI's per-trigger default (`600`ms) applies. Pass `delay` explicitly
86
+ on `TooltipProvider` (or on individual `TooltipTrigger`s) to slow it back
87
+ down.
92
88
 
93
89
  A lone `Tooltip` works standalone without a `TooltipProvider` — grouping
94
90
  is the only thing wrapping one adds.
package/dist/drawer.js CHANGED
@@ -1,29 +1,29 @@
1
1
  "use client";
2
- import { jsx as r, jsxs as u } from "react/jsx-runtime";
2
+ import { jsx as o, jsxs as u } from "react/jsx-runtime";
3
3
  import { Drawer as n } from "@base-ui/react/drawer";
4
- import { cx as i, cva as f } from "class-variance-authority";
4
+ import { cx as s, cva as f } from "class-variance-authority";
5
5
  import { createContext as m, useContext as D } from "react";
6
- import './chunks/drawer.BkS_qEHj.css';const h = "_backdrop_py518_31", y = "_viewport_py518_83", v = "_popup_py518_113", g = "_sideTop_py518_369", x = "_sideBottom_py518_373", N = "_sideLeft_py518_377", T = "_sideRight_py518_381", b = "_content_py518_394", C = "_swipeHandle_py518_435", P = "_header_py518_478", H = "_footer_py518_495", S = "_title_py518_504", k = "_description_py518_512", o = {
6
+ import './chunks/drawer.D8l6-G8t.css';const h = "_backdrop_10ocs_29", v = "_viewport_10ocs_89", g = "_popup_10ocs_119", x = "_sideTop_10ocs_375", N = "_sideBottom_10ocs_379", T = "_sideLeft_10ocs_383", b = "_sideRight_10ocs_387", C = "_content_10ocs_400", P = "_swipeHandle_10ocs_441", H = "_header_10ocs_484", S = "_footer_10ocs_501", k = "_title_10ocs_510", B = "_description_10ocs_518", r = {
7
7
  backdrop: h,
8
- viewport: y,
9
- popup: v,
10
- sideTop: g,
11
- sideBottom: x,
12
- sideLeft: N,
13
- sideRight: T,
14
- content: b,
15
- swipeHandle: C,
16
- header: P,
17
- footer: H,
18
- title: S,
19
- description: k
20
- }, B = {
8
+ viewport: v,
9
+ popup: g,
10
+ sideTop: x,
11
+ sideBottom: N,
12
+ sideLeft: T,
13
+ sideRight: b,
14
+ content: C,
15
+ swipeHandle: P,
16
+ header: H,
17
+ footer: S,
18
+ title: k,
19
+ description: B
20
+ }, R = {
21
21
  top: "up",
22
22
  right: "right",
23
23
  bottom: "down",
24
24
  left: "left"
25
25
  }, _ = m(null);
26
- function R() {
26
+ function E() {
27
27
  const t = D(_);
28
28
  if (!t)
29
29
  throw new Error("Drawer parts (DrawerContent, DrawerPortal, ...) must be rendered inside a Drawer.");
@@ -32,88 +32,88 @@ function R() {
32
32
  function W({
33
33
  modal: t = !0,
34
34
  side: e = "bottom",
35
- showSwipeHandle: c = !1,
36
- snapPoints: s,
35
+ showSwipeHandle: d = !1,
36
+ snapPoints: i,
37
37
  ...a
38
38
  }) {
39
- const l = { hasSnapPoints: s != null && s.length > 0, modal: t, showSwipeHandle: c, side: e };
40
- return /* @__PURE__ */ r(_.Provider, { value: l, children: /* @__PURE__ */ r(
39
+ const l = { hasSnapPoints: i != null && i.length > 0, modal: t, showSwipeHandle: d, side: e };
40
+ return /* @__PURE__ */ o(_.Provider, { value: l, children: /* @__PURE__ */ o(
41
41
  n.Root,
42
42
  {
43
43
  modal: t,
44
- snapPoints: s,
45
- swipeDirection: B[e],
44
+ snapPoints: i,
45
+ swipeDirection: R[e],
46
46
  ...a
47
47
  }
48
48
  ) });
49
49
  }
50
50
  function $({ className: t, ...e }) {
51
- return /* @__PURE__ */ r(n.Trigger, { className: t, ...e });
51
+ return /* @__PURE__ */ o(n.Trigger, { className: t, ...e });
52
52
  }
53
- function E(t) {
54
- return /* @__PURE__ */ r(n.Portal, { ...t });
53
+ function I(t) {
54
+ return /* @__PURE__ */ o(n.Portal, { ...t });
55
55
  }
56
56
  function q({ className: t, ...e }) {
57
- return /* @__PURE__ */ r(n.Close, { className: t, ...e });
58
- }
59
- function I({ className: t, ...e }) {
60
- return /* @__PURE__ */ r("div", { "aria-hidden": "true", className: i(o.swipeHandle, t), ...e });
57
+ return /* @__PURE__ */ o(n.Close, { className: t, ...e });
61
58
  }
62
59
  function L({ className: t, ...e }) {
63
- return /* @__PURE__ */ r(n.Backdrop, { className: i(o.backdrop, t), ...e });
60
+ return /* @__PURE__ */ o("div", { "aria-hidden": "true", className: s(r.swipeHandle, t), ...e });
61
+ }
62
+ function V({ className: t, ...e }) {
63
+ return /* @__PURE__ */ o(n.Backdrop, { className: s(r.backdrop, t), ...e });
64
64
  }
65
- const V = f(o.popup, {
65
+ const j = f(r.popup, {
66
66
  variants: {
67
67
  side: {
68
- top: o.sideTop,
69
- right: o.sideRight,
70
- bottom: o.sideBottom,
71
- left: o.sideLeft
68
+ top: r.sideTop,
69
+ right: r.sideRight,
70
+ bottom: r.sideBottom,
71
+ left: r.sideLeft
72
72
  }
73
73
  }
74
74
  });
75
- function z({ className: t, children: e, container: c, ...s }) {
76
- const { hasSnapPoints: a, modal: d, showSwipeHandle: l, side: p } = R(), w = p === "top" || p === "bottom" ? "y" : "x";
77
- return /* @__PURE__ */ u(E, { container: c, children: [
78
- d === !0 && /* @__PURE__ */ r(L, { "data-snap-points": a ? "" : void 0 }),
79
- /* @__PURE__ */ r(n.Viewport, { "data-modal": d, className: o.viewport, children: /* @__PURE__ */ u(
75
+ function z({ className: t, children: e, container: d, ...i }) {
76
+ const { hasSnapPoints: a, modal: p, showSwipeHandle: l, side: c } = E(), w = c === "top" || c === "bottom" ? "y" : "x";
77
+ return /* @__PURE__ */ u(I, { container: d, children: [
78
+ p === !0 && /* @__PURE__ */ o(V, { "data-snap-points": a ? "" : void 0 }),
79
+ /* @__PURE__ */ o(n.Viewport, { "data-modal": p, className: r.viewport, children: /* @__PURE__ */ u(
80
80
  n.Popup,
81
81
  {
82
82
  "data-swipe-axis": w,
83
83
  "data-snap-points": a ? "" : void 0,
84
- "data-side": p,
85
- className: V({ side: p, className: t }),
86
- ...s,
84
+ "data-side": c,
85
+ className: j({ side: c, className: t }),
86
+ ...i,
87
87
  children: [
88
- l && /* @__PURE__ */ r(I, {}),
89
- /* @__PURE__ */ r(n.Content, { className: o.content, children: e })
88
+ l && /* @__PURE__ */ o(L, {}),
89
+ /* @__PURE__ */ o(n.Content, { className: r.content, children: e })
90
90
  ]
91
91
  }
92
92
  ) })
93
93
  ] });
94
94
  }
95
95
  function G({ className: t, ...e }) {
96
- return /* @__PURE__ */ r("div", { className: i(o.header, t), ...e });
96
+ return /* @__PURE__ */ o("div", { className: s(r.header, t), ...e });
97
97
  }
98
98
  function J({ className: t, ...e }) {
99
- return /* @__PURE__ */ r("div", { className: i(o.footer, t), ...e });
99
+ return /* @__PURE__ */ o("div", { className: s(r.footer, t), ...e });
100
100
  }
101
101
  function K({ className: t, ...e }) {
102
- return /* @__PURE__ */ r(n.Title, { className: i(o.title, t), ...e });
102
+ return /* @__PURE__ */ o(n.Title, { className: s(r.title, t), ...e });
103
103
  }
104
104
  function M({ className: t, ...e }) {
105
- return /* @__PURE__ */ r(n.Description, { className: i(o.description, t), ...e });
105
+ return /* @__PURE__ */ o(n.Description, { className: s(r.description, t), ...e });
106
106
  }
107
107
  export {
108
108
  W as Drawer,
109
- L as DrawerBackdrop,
109
+ V as DrawerBackdrop,
110
110
  q as DrawerClose,
111
111
  z as DrawerContent,
112
112
  M as DrawerDescription,
113
113
  J as DrawerFooter,
114
114
  G as DrawerHeader,
115
- E as DrawerPortal,
116
- I as DrawerSwipeHandle,
115
+ I as DrawerPortal,
116
+ L as DrawerSwipeHandle,
117
117
  K as DrawerTitle,
118
118
  $ as DrawerTrigger
119
119
  };