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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (245) 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 +89 -83
  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.map +1 -1
  81. package/dist/components/checkbox/checkbox.d.ts.map +1 -1
  82. package/dist/components/dropdown-menu/dropdown-menu.d.ts +9 -1
  83. package/dist/components/dropdown-menu/dropdown-menu.d.ts.map +1 -1
  84. package/dist/components/empty/empty.d.ts +11 -0
  85. package/dist/components/empty/empty.d.ts.map +1 -1
  86. package/dist/components/empty/public.d.ts +1 -1
  87. package/dist/components/empty/public.d.ts.map +1 -1
  88. package/dist/components/input-group/input-group.d.ts +5 -2
  89. package/dist/components/input-group/input-group.d.ts.map +1 -1
  90. package/dist/components/navigation-menu/navigation-menu.d.ts +7 -2
  91. package/dist/components/navigation-menu/navigation-menu.d.ts.map +1 -1
  92. package/dist/components/pagination/pagination.d.ts +4 -6
  93. package/dist/components/pagination/pagination.d.ts.map +1 -1
  94. package/dist/components/popover/popover.d.ts +2 -2
  95. package/dist/components/popover/popover.d.ts.map +1 -1
  96. package/dist/components/select/select.d.ts +2 -2
  97. package/dist/components/select/select.d.ts.map +1 -1
  98. package/dist/components/spinner/spinner.d.ts +19 -3
  99. package/dist/components/spinner/spinner.d.ts.map +1 -1
  100. package/dist/components/status-dot/public.d.ts +2 -0
  101. package/dist/components/status-dot/public.d.ts.map +1 -0
  102. package/dist/components/status-dot/status-dot.d.ts +25 -0
  103. package/dist/components/status-dot/status-dot.d.ts.map +1 -0
  104. package/dist/components/table/table.d.ts +31 -5
  105. package/dist/components/table/table.d.ts.map +1 -1
  106. package/dist/components/tabs/tabs.d.ts +10 -2
  107. package/dist/components/tabs/tabs.d.ts.map +1 -1
  108. package/dist/components/toggle/toggle.d.ts +12 -2
  109. package/dist/components/toggle/toggle.d.ts.map +1 -1
  110. package/dist/components/toggle-group/toggle-group.d.ts +33 -4
  111. package/dist/components/toggle-group/toggle-group.d.ts.map +1 -1
  112. package/dist/components/tooltip/tooltip.d.ts +5 -8
  113. package/dist/components/tooltip/tooltip.d.ts.map +1 -1
  114. package/dist/context-menu.js +54 -54
  115. package/dist/data-table.js +41 -41
  116. package/dist/dialog.js +39 -39
  117. package/dist/docs/alert-dialog.md +1 -1
  118. package/dist/docs/avatar.md +3 -1
  119. package/dist/docs/badge.md +42 -14
  120. package/dist/docs/button.md +3 -2
  121. package/dist/docs/card.md +6 -0
  122. package/dist/docs/chart.md +20 -14
  123. package/dist/docs/checkbox.md +6 -0
  124. package/dist/docs/command.md +4 -0
  125. package/dist/docs/data-table.md +12 -7
  126. package/dist/docs/dialog.md +3 -2
  127. package/dist/docs/dropdown-menu.md +6 -0
  128. package/dist/docs/empty.md +44 -9
  129. package/dist/docs/input-group.md +23 -3
  130. package/dist/docs/navigation-menu.md +14 -5
  131. package/dist/docs/pagination.md +18 -15
  132. package/dist/docs/popover.md +6 -0
  133. package/dist/docs/progress.md +6 -0
  134. package/dist/docs/questionnaire.md +4 -2
  135. package/dist/docs/select.md +8 -4
  136. package/dist/docs/sheet.md +8 -7
  137. package/dist/docs/spinner.md +35 -5
  138. package/dist/docs/status-dot.md +77 -0
  139. package/dist/docs/table.md +69 -25
  140. package/dist/docs/tabs.md +22 -7
  141. package/dist/docs/toggle-group.md +68 -9
  142. package/dist/docs/toggle.md +7 -1
  143. package/dist/docs/tooltip.md +5 -9
  144. package/dist/drawer.js +53 -53
  145. package/dist/dropdown-menu.js +102 -89
  146. package/dist/dropdown-menu.js.map +1 -1
  147. package/dist/empty.js +31 -21
  148. package/dist/empty.js.map +1 -1
  149. package/dist/field.js +24 -24
  150. package/dist/hover-card.js +14 -14
  151. package/dist/index.d.ts +1 -0
  152. package/dist/index.d.ts.map +1 -1
  153. package/dist/index.js +266 -261
  154. package/dist/index.js.map +1 -1
  155. package/dist/input-group.js +73 -50
  156. package/dist/input-group.js.map +1 -1
  157. package/dist/input-otp.js +3 -3
  158. package/dist/input.js +19 -19
  159. package/dist/label.js +1 -1
  160. package/dist/menubar.js +18 -18
  161. package/dist/message.js +11 -11
  162. package/dist/native-select.js +20 -20
  163. package/dist/navigation-menu.js +83 -64
  164. package/dist/navigation-menu.js.map +1 -1
  165. package/dist/pagination.js +39 -52
  166. package/dist/pagination.js.map +1 -1
  167. package/dist/popover.js +33 -31
  168. package/dist/popover.js.map +1 -1
  169. package/dist/progress.js +15 -15
  170. package/dist/questionnaire.js +72 -72
  171. package/dist/radio-group.js +7 -7
  172. package/dist/scroll-area.js +8 -8
  173. package/dist/select.js +82 -80
  174. package/dist/select.js.map +1 -1
  175. package/dist/sheet.js +46 -46
  176. package/dist/sidebar.js +130 -130
  177. package/dist/slider.js +14 -14
  178. package/dist/spinner.js +45 -13
  179. package/dist/spinner.js.map +1 -1
  180. package/dist/status-dot.d.ts +1 -0
  181. package/dist/status-dot.js +76 -0
  182. package/dist/status-dot.js.map +1 -0
  183. package/dist/switch.js +14 -14
  184. package/dist/table.js +221 -43
  185. package/dist/table.js.map +1 -1
  186. package/dist/tabs.js +44 -26
  187. package/dist/tabs.js.map +1 -1
  188. package/dist/textarea.js +5 -5
  189. package/dist/theme.css +222 -135
  190. package/dist/toast.js +26 -26
  191. package/dist/toggle-group.js +40 -25
  192. package/dist/toggle-group.js.map +1 -1
  193. package/dist/toggle.js +21 -11
  194. package/dist/toggle.js.map +1 -1
  195. package/dist/tooltip.js +37 -34
  196. package/dist/tooltip.js.map +1 -1
  197. package/llms.txt +26 -10
  198. package/package.json +1 -1
  199. package/dist/chunks/accordion.X_AK08Iv.css +0 -1
  200. package/dist/chunks/alert-dialog.B50f-Gsz.css +0 -1
  201. package/dist/chunks/alert.C5BedF7l.css +0 -1
  202. package/dist/chunks/attachment.GAZbWSyB.css +0 -1
  203. package/dist/chunks/avatar.DZUXl1ev.css +0 -1
  204. package/dist/chunks/badge.Bi22h20j.css +0 -1
  205. package/dist/chunks/bubble.DvN6QyQ1.css +0 -1
  206. package/dist/chunks/button-group.D0Ir-jbL.css +0 -1
  207. package/dist/chunks/button.DvAxXxKj.css +0 -1
  208. package/dist/chunks/calendar.Cnbv4EzY.css +0 -1
  209. package/dist/chunks/card.D3Ct_dza.css +0 -1
  210. package/dist/chunks/checkbox.CZfE_PkU.css +0 -1
  211. package/dist/chunks/collapsible.BQ-sU5sQ.css +0 -1
  212. package/dist/chunks/combobox.CtYpZAKB.css +0 -1
  213. package/dist/chunks/command.Km60IuqD.css +0 -1
  214. package/dist/chunks/context-menu.DwGCD0vN.css +0 -1
  215. package/dist/chunks/data-table.CtZdVSAU.css +0 -1
  216. package/dist/chunks/dialog.BxcZ12Gb.css +0 -1
  217. package/dist/chunks/drawer.BkS_qEHj.css +0 -1
  218. package/dist/chunks/dropdown-menu.C5TLD9JO.css +0 -1
  219. package/dist/chunks/empty.BlhsHrOz.css +0 -1
  220. package/dist/chunks/field.Ccqt897k.css +0 -1
  221. package/dist/chunks/hover-card.DmwvigMp.css +0 -1
  222. package/dist/chunks/input-group.CFIUP-Oh.css +0 -1
  223. package/dist/chunks/input-otp.XSpqyVij.css +0 -1
  224. package/dist/chunks/input.DvA_mTq8.css +0 -1
  225. package/dist/chunks/message.BhD5JDJK.css +0 -1
  226. package/dist/chunks/native-select.DF1QrNz4.css +0 -1
  227. package/dist/chunks/navigation-menu.C2JGHAKD.css +0 -1
  228. package/dist/chunks/pagination.DUiQuWla.css +0 -1
  229. package/dist/chunks/popover.fOvPrnsr.css +0 -1
  230. package/dist/chunks/progress.Bp13t8iw.css +0 -1
  231. package/dist/chunks/questionnaire.D-u_K3Co.css +0 -1
  232. package/dist/chunks/radio-group.CV3MBCsI.css +0 -1
  233. package/dist/chunks/scroll-area.C4kWMAsU.css +0 -1
  234. package/dist/chunks/select.iEwV-sfJ.css +0 -1
  235. package/dist/chunks/sheet.DALPg9vf.css +0 -1
  236. package/dist/chunks/sidebar.CGTQhfWG.css +0 -1
  237. package/dist/chunks/slider.B5nouD7J.css +0 -1
  238. package/dist/chunks/spinner.UKK4f1tu.css +0 -1
  239. package/dist/chunks/switch.CIW9Jr1x.css +0 -1
  240. package/dist/chunks/table.BpnQ6j85.css +0 -1
  241. package/dist/chunks/tabs.4MEFBvw-.css +0 -1
  242. package/dist/chunks/toast.uUtCEAiv.css +0 -1
  243. package/dist/chunks/toggle-group.Bd0cCCnV.css +0 -1
  244. package/dist/chunks/toggle.B9tvfl1n.css +0 -1
  245. package/dist/chunks/tooltip.apA3VWHJ.css +0 -1
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
  };
@@ -1,152 +1,165 @@
1
1
  "use client";
2
- import { jsxs as d, jsx as e } from "react/jsx-runtime";
3
- import { Menu as n } from "@base-ui/react/menu";
4
- import { cx as c, cva as h } from "class-variance-authority";
5
- import { CheckIcon as _, ChevronRightIcon as D } from "lucide-react";
6
- import { useContext as M, createContext as N } from "react";
7
- import './chunks/dropdown-menu.C5TLD9JO.css';const w = "_positioner_1pddr_14", x = "_popup_1pddr_6", C = "_subPopup_1pddr_33", T = "_label_1pddr_124", k = "_item_1pddr_121", P = "_variantDefault_1pddr_166", R = "_variantDestructive_1pddr_191", S = "_checkboxItem_1pddr_121", G = "_radioItem_1pddr_121", j = "_itemIndicator_1pddr_233", L = "_separator_1pddr_244", V = "_shortcut_1pddr_251", y = "_subTrigger_1pddr_122", q = "_subTriggerIcon_1pddr_309", z = "_svgIcon_1pddr_316", o = {
8
- positioner: w,
9
- popup: x,
10
- subPopup: C,
11
- label: T,
12
- item: k,
13
- variantDefault: P,
14
- variantDestructive: R,
15
- checkboxItem: S,
16
- radioItem: G,
17
- itemIndicator: j,
18
- separator: L,
19
- shortcut: V,
20
- subTrigger: y,
21
- subTriggerIcon: q,
22
- svgIcon: z
23
- }, m = N(void 0), O = n.Root;
24
- function Q({ className: t, ...r }) {
25
- return /* @__PURE__ */ e(n.Trigger, { className: t, ...r });
2
+ import { jsxs as p, jsx as n } from "react/jsx-runtime";
3
+ import { Menu as r } from "@base-ui/react/menu";
4
+ import { cx as i, cva as f } from "class-variance-authority";
5
+ import { CheckIcon as _, ChevronRightIcon as h } from "lucide-react";
6
+ import { useContext as D, createContext as j } from "react";
7
+ import './chunks/dropdown-menu.TU3FHXbJ.css';const M = "_positioner_1w0pj_14", S = "_popup_1w0pj_6", N = "_subPopup_1w0pj_33", x = "_label_1w0pj_124", C = "_item_1w0pj_121", T = "_variantDefault_1w0pj_166", k = "_variantDestructive_1w0pj_193", P = "_checkboxItem_1w0pj_121", R = "_radioItem_1w0pj_121", G = "_itemIndicator_1w0pj_235", L = "_indicatorSideStart_1w0pj_254", V = "_separator_1w0pj_272", y = "_shortcut_1w0pj_279", q = "_subTrigger_1w0pj_122", z = "_subTriggerIcon_1w0pj_337", A = "_svgIcon_1w0pj_344", e = {
8
+ positioner: M,
9
+ popup: S,
10
+ subPopup: N,
11
+ label: x,
12
+ item: C,
13
+ variantDefault: T,
14
+ variantDestructive: k,
15
+ checkboxItem: P,
16
+ radioItem: R,
17
+ itemIndicator: G,
18
+ indicatorSideStart: L,
19
+ separator: V,
20
+ shortcut: y,
21
+ subTrigger: q,
22
+ subTriggerIcon: z,
23
+ svgIcon: A
24
+ }, m = j(void 0), Q = r.Root;
25
+ function U({ className: t, ...o }) {
26
+ return /* @__PURE__ */ n(r.Trigger, { className: t, ...o });
26
27
  }
27
- function A({
28
+ function B({
28
29
  className: t,
29
- children: r,
30
+ children: o,
30
31
  container: a,
31
- side: i = "bottom",
32
+ side: c = "bottom",
32
33
  sideOffset: s = 4,
33
34
  align: u = "start",
34
35
  alignOffset: l = 0,
35
36
  positionMethod: I,
36
37
  collisionBoundary: g,
37
38
  collisionPadding: b,
38
- ...v
39
+ ...w
39
40
  }) {
40
- const f = M(m), p = a ?? f;
41
- return /* @__PURE__ */ e(m.Provider, { value: p, children: /* @__PURE__ */ e(n.Portal, { container: p, children: /* @__PURE__ */ e(
42
- n.Positioner,
41
+ const v = D(m), d = a ?? v;
42
+ return /* @__PURE__ */ n(m.Provider, { value: d, children: /* @__PURE__ */ n(r.Portal, { container: d, children: /* @__PURE__ */ n(
43
+ r.Positioner,
43
44
  {
44
- side: i,
45
+ side: c,
45
46
  sideOffset: s,
46
47
  align: u,
47
48
  alignOffset: l,
48
49
  positionMethod: I,
49
50
  collisionBoundary: g,
50
51
  collisionPadding: b,
51
- className: o.positioner,
52
- children: /* @__PURE__ */ e(n.Popup, { className: c(o.popup, t), ...v, children: r })
52
+ className: e.positioner,
53
+ children: /* @__PURE__ */ n(r.Popup, { className: i(e.popup, t), ...w, children: o })
53
54
  }
54
55
  ) }) });
55
56
  }
56
- function U({ className: t, ...r }) {
57
- return /* @__PURE__ */ e(n.Group, { className: t, ...r });
57
+ function W({ className: t, ...o }) {
58
+ return /* @__PURE__ */ n(r.Group, { className: t, ...o });
58
59
  }
59
- function W({ className: t, ...r }) {
60
- return /* @__PURE__ */ e(n.GroupLabel, { className: c(o.label, t), ...r });
60
+ function X({ className: t, ...o }) {
61
+ return /* @__PURE__ */ n(r.GroupLabel, { className: i(e.label, t), ...o });
61
62
  }
62
- const B = h(o.item, {
63
+ const E = f(e.item, {
63
64
  variants: {
64
65
  variant: {
65
- default: o.variantDefault,
66
- destructive: o.variantDestructive
66
+ default: e.variantDefault,
67
+ destructive: e.variantDestructive
67
68
  }
68
69
  },
69
70
  defaultVariants: {
70
71
  variant: "default"
71
72
  }
72
73
  });
73
- function X({ className: t, variant: r, ...a }) {
74
- return /* @__PURE__ */ e(n.Item, { className: B({ variant: r, className: t }), ...a });
74
+ function Y({ className: t, variant: o, ...a }) {
75
+ return /* @__PURE__ */ n(r.Item, { className: E({ variant: o, className: t }), ...a });
75
76
  }
76
- function Y({
77
+ function Z({
77
78
  className: t,
78
- children: r,
79
+ children: o,
79
80
  ...a
80
81
  }) {
81
- return /* @__PURE__ */ d(n.CheckboxItem, { className: c(o.checkboxItem, t), ...a, children: [
82
- r,
83
- /* @__PURE__ */ e(n.CheckboxItemIndicator, { className: o.itemIndicator, children: /* @__PURE__ */ e(_, { className: o.svgIcon }) })
82
+ return /* @__PURE__ */ p(r.CheckboxItem, { className: i(e.checkboxItem, t), ...a, children: [
83
+ o,
84
+ /* @__PURE__ */ n(r.CheckboxItemIndicator, { className: e.itemIndicator, children: /* @__PURE__ */ n(_, { className: e.svgIcon }) })
84
85
  ] });
85
86
  }
86
- function Z({ className: t, ...r }) {
87
- return /* @__PURE__ */ e(n.RadioGroup, { className: t, ...r });
87
+ function $({ className: t, ...o }) {
88
+ return /* @__PURE__ */ n(r.RadioGroup, { className: t, ...o });
88
89
  }
89
- function $({
90
+ function tt({
90
91
  className: t,
91
- children: r,
92
- ...a
92
+ children: o,
93
+ indicatorSide: a = "end",
94
+ ...c
93
95
  }) {
94
- return /* @__PURE__ */ d(n.RadioItem, { className: c(o.radioItem, t), ...a, children: [
95
- r,
96
- /* @__PURE__ */ e(n.RadioItemIndicator, { className: o.itemIndicator, children: /* @__PURE__ */ e(_, { className: o.svgIcon }) })
97
- ] });
96
+ return /* @__PURE__ */ p(
97
+ r.RadioItem,
98
+ {
99
+ className: i(
100
+ e.radioItem,
101
+ a === "start" && e.indicatorSideStart,
102
+ t
103
+ ),
104
+ ...c,
105
+ children: [
106
+ o,
107
+ /* @__PURE__ */ n(r.RadioItemIndicator, { className: e.itemIndicator, children: /* @__PURE__ */ n(_, { className: e.svgIcon }) })
108
+ ]
109
+ }
110
+ );
98
111
  }
99
- function tt({ className: t, ...r }) {
100
- return /* @__PURE__ */ e(n.Separator, { className: c(o.separator, t), ...r });
112
+ function ot({ className: t, ...o }) {
113
+ return /* @__PURE__ */ n(r.Separator, { className: i(e.separator, t), ...o });
101
114
  }
102
- function rt({ className: t, ...r }) {
103
- return /* @__PURE__ */ e("span", { className: c(o.shortcut, t), ...r });
115
+ function et({ className: t, ...o }) {
116
+ return /* @__PURE__ */ n("span", { className: i(e.shortcut, t), ...o });
104
117
  }
105
- const ot = n.SubmenuRoot;
106
- function et({
118
+ const nt = r.SubmenuRoot;
119
+ function rt({
107
120
  className: t,
108
- children: r,
121
+ children: o,
109
122
  ...a
110
123
  }) {
111
- return /* @__PURE__ */ d(n.SubmenuTrigger, { className: c(o.subTrigger, t), ...a, children: [
112
- r,
113
- /* @__PURE__ */ e(D, { className: c(o.svgIcon, o.subTriggerIcon) })
124
+ return /* @__PURE__ */ p(r.SubmenuTrigger, { className: i(e.subTrigger, t), ...a, children: [
125
+ o,
126
+ /* @__PURE__ */ n(h, { className: i(e.svgIcon, e.subTriggerIcon) })
114
127
  ] });
115
128
  }
116
- function nt({
129
+ function at({
117
130
  className: t,
118
- side: r = "right",
131
+ side: o = "right",
119
132
  align: a = "start",
120
- sideOffset: i = 0,
133
+ sideOffset: c = 0,
121
134
  alignOffset: s = -3,
122
135
  ...u
123
136
  }) {
124
- return /* @__PURE__ */ e(
125
- A,
137
+ return /* @__PURE__ */ n(
138
+ B,
126
139
  {
127
- className: c(o.subPopup, t),
128
- side: r,
140
+ className: i(e.subPopup, t),
141
+ side: o,
129
142
  align: a,
130
- sideOffset: i,
143
+ sideOffset: c,
131
144
  alignOffset: s,
132
145
  ...u
133
146
  }
134
147
  );
135
148
  }
136
149
  export {
137
- O as DropdownMenu,
138
- Y as DropdownMenuCheckboxItem,
139
- A as DropdownMenuContent,
140
- U as DropdownMenuGroup,
141
- X as DropdownMenuItem,
142
- W as DropdownMenuLabel,
143
- Z as DropdownMenuRadioGroup,
144
- $ as DropdownMenuRadioItem,
145
- tt as DropdownMenuSeparator,
146
- rt as DropdownMenuShortcut,
147
- ot as DropdownMenuSub,
148
- nt as DropdownMenuSubContent,
149
- et as DropdownMenuSubTrigger,
150
- Q as DropdownMenuTrigger
150
+ Q as DropdownMenu,
151
+ Z as DropdownMenuCheckboxItem,
152
+ B as DropdownMenuContent,
153
+ W as DropdownMenuGroup,
154
+ Y as DropdownMenuItem,
155
+ X as DropdownMenuLabel,
156
+ $ as DropdownMenuRadioGroup,
157
+ tt as DropdownMenuRadioItem,
158
+ ot as DropdownMenuSeparator,
159
+ et as DropdownMenuShortcut,
160
+ nt as DropdownMenuSub,
161
+ at as DropdownMenuSubContent,
162
+ rt as DropdownMenuSubTrigger,
163
+ U as DropdownMenuTrigger
151
164
  };
152
165
  //# sourceMappingURL=dropdown-menu.js.map