@godxjp/ui 19.6.0 → 20.1.0

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 (326) hide show
  1. package/README.md +8 -2
  2. package/dist/app/theme-axes.d.ts +2 -0
  3. package/dist/app/theme-axes.js +45 -0
  4. package/dist/components/charts/chart-cartesian.d.ts +2 -1
  5. package/dist/components/charts/chart-cartesian.js +52 -3
  6. package/dist/components/charts/chart-category-axis.d.ts +55 -0
  7. package/dist/components/charts/chart-category-axis.js +93 -0
  8. package/dist/components/charts/chart-frame.d.ts +10 -1
  9. package/dist/components/charts/chart-frame.js +19 -3
  10. package/dist/components/charts/compact-bar-trend.d.ts +1 -1
  11. package/dist/components/charts/compact-bar-trend.js +2 -0
  12. package/dist/components/charts/pie-chart.d.ts +1 -1
  13. package/dist/components/charts/pie-chart.js +12 -1
  14. package/dist/components/charts/recharts-peer.d.ts +49 -0
  15. package/dist/components/charts/recharts-peer.js +45 -0
  16. package/dist/components/data-display/card.d.ts +14 -3
  17. package/dist/components/data-display/card.js +22 -4
  18. package/dist/components/data-display/code-block.js +6 -2
  19. package/dist/components/data-display/collapsible.d.ts +23 -4
  20. package/dist/components/data-display/collapsible.js +119 -4
  21. package/dist/components/data-display/data-table.d.ts +39 -4
  22. package/dist/components/data-display/data-table.js +802 -270
  23. package/dist/components/data-display/descriptions.d.ts +27 -6
  24. package/dist/components/data-display/descriptions.js +58 -17
  25. package/dist/components/data-display/index.d.ts +5 -1
  26. package/dist/components/data-display/index.js +4 -0
  27. package/dist/components/data-display/legend.d.ts +15 -0
  28. package/dist/components/data-display/legend.js +11 -0
  29. package/dist/components/data-display/list-row.d.ts +10 -1
  30. package/dist/components/data-display/list-row.js +8 -2
  31. package/dist/components/data-display/popover.d.ts +60 -7
  32. package/dist/components/data-display/popover.js +268 -39
  33. package/dist/components/data-display/progress.d.ts +50 -2
  34. package/dist/components/data-display/progress.js +57 -9
  35. package/dist/components/data-display/range-timeline.d.ts +38 -0
  36. package/dist/components/data-display/range-timeline.js +161 -0
  37. package/dist/components/data-display/scroll-area.js +13 -2
  38. package/dist/components/data-display/service-launcher-card.js +10 -10
  39. package/dist/components/data-display/table.d.ts +11 -3
  40. package/dist/components/data-display/table.js +48 -18
  41. package/dist/components/data-display/tree-list.js +4 -9
  42. package/dist/components/data-entry/calendar.d.ts +2 -2
  43. package/dist/components/data-entry/calendar.js +79 -33
  44. package/dist/components/data-entry/cascader.d.ts +1 -1
  45. package/dist/components/data-entry/cascader.js +188 -24
  46. package/dist/components/data-entry/checkbox.d.ts +19 -6
  47. package/dist/components/data-entry/checkbox.js +55 -16
  48. package/dist/components/data-entry/choice-option.d.ts +1 -1
  49. package/dist/components/data-entry/color-picker.d.ts +1 -1
  50. package/dist/components/data-entry/color-picker.js +17 -5
  51. package/dist/components/data-entry/control-appearance.d.ts +64 -0
  52. package/dist/components/data-entry/control-appearance.js +39 -0
  53. package/dist/components/data-entry/control-surface.d.ts +61 -0
  54. package/dist/components/data-entry/control-surface.js +39 -0
  55. package/dist/components/data-entry/date-picker.d.ts +1 -1
  56. package/dist/components/data-entry/date-picker.js +344 -113
  57. package/dist/components/data-entry/date-range-picker.d.ts +2 -2
  58. package/dist/components/data-entry/date-range-picker.js +278 -140
  59. package/dist/components/data-entry/field.js +0 -1
  60. package/dist/components/data-entry/form-field.d.ts +1 -1
  61. package/dist/components/data-entry/form-field.js +39 -4
  62. package/dist/components/data-entry/form.d.ts +4 -0
  63. package/dist/components/data-entry/form.js +5 -3
  64. package/dist/components/data-entry/index.d.ts +7 -3
  65. package/dist/components/data-entry/index.js +10 -1
  66. package/dist/components/data-entry/input-otp.d.ts +1 -1
  67. package/dist/components/data-entry/input.d.ts +12 -34
  68. package/dist/components/data-entry/input.js +92 -24
  69. package/dist/components/data-entry/label.d.ts +3 -2
  70. package/dist/components/data-entry/label.js +23 -10
  71. package/dist/components/data-entry/month-picker.d.ts +2 -2
  72. package/dist/components/data-entry/month-picker.js +47 -10
  73. package/dist/components/data-entry/month-range-picker.d.ts +2 -2
  74. package/dist/components/data-entry/month-range-picker.js +51 -11
  75. package/dist/components/data-entry/number-input.d.ts +7 -0
  76. package/dist/components/data-entry/number-input.js +147 -98
  77. package/dist/components/data-entry/password-input.d.ts +1 -1
  78. package/dist/components/data-entry/radio.d.ts +1 -1
  79. package/dist/components/data-entry/radio.js +61 -13
  80. package/dist/components/data-entry/search-input.d.ts +1 -1
  81. package/dist/components/data-entry/search-input.js +16 -2
  82. package/dist/components/data-entry/search-select.d.ts +2 -2
  83. package/dist/components/data-entry/search-select.js +209 -78
  84. package/dist/components/data-entry/select.d.ts +22 -4
  85. package/dist/components/data-entry/select.js +215 -163
  86. package/dist/components/data-entry/slider.d.ts +9 -1
  87. package/dist/components/data-entry/slider.js +87 -9
  88. package/dist/components/data-entry/switch.d.ts +3 -0
  89. package/dist/components/data-entry/switch.js +29 -3
  90. package/dist/components/data-entry/textarea.d.ts +14 -56
  91. package/dist/components/data-entry/textarea.js +80 -33
  92. package/dist/components/data-entry/time-picker.d.ts +2 -2
  93. package/dist/components/data-entry/time-picker.js +333 -109
  94. package/dist/components/data-entry/time-range-picker.d.ts +5 -0
  95. package/dist/components/data-entry/time-range-picker.js +89 -0
  96. package/dist/components/data-entry/transfer.d.ts +1 -1
  97. package/dist/components/data-entry/transfer.js +99 -31
  98. package/dist/components/data-entry/tree-select-strategy.d.ts +1 -1
  99. package/dist/components/data-entry/tree-select.d.ts +1 -1
  100. package/dist/components/data-entry/tree-select.js +197 -92
  101. package/dist/components/data-entry/tree-utils.d.ts +1 -1
  102. package/dist/components/data-entry/tree-utils.js +7 -14
  103. package/dist/components/data-entry/upload-files.d.ts +2 -0
  104. package/dist/components/data-entry/upload-files.js +31 -0
  105. package/dist/components/data-entry/upload-request.d.ts +4 -0
  106. package/dist/components/data-entry/upload-request.js +53 -0
  107. package/dist/components/data-entry/upload-types.d.ts +28 -0
  108. package/dist/components/data-entry/upload-types.js +2 -0
  109. package/dist/components/data-entry/upload.d.ts +2 -2
  110. package/dist/components/data-entry/upload.js +482 -117
  111. package/dist/components/feedback/dialog.d.ts +105 -38
  112. package/dist/components/feedback/dialog.js +268 -193
  113. package/dist/components/feedback/overlay-close-focus.d.ts +31 -0
  114. package/dist/components/feedback/overlay-close-focus.js +31 -0
  115. package/dist/components/feedback/overlay-header-tone.d.ts +1 -1
  116. package/dist/components/feedback/sheet.d.ts +53 -11
  117. package/dist/components/feedback/sheet.js +150 -81
  118. package/dist/components/feedback/tooltip.d.ts +51 -7
  119. package/dist/components/feedback/tooltip.js +107 -25
  120. package/dist/components/general/button.d.ts +1 -1
  121. package/dist/components/general/button.js +7 -3
  122. package/dist/components/general/index.d.ts +1 -0
  123. package/dist/components/general/index.js +2 -0
  124. package/dist/components/general/logo.d.ts +17 -0
  125. package/dist/components/general/logo.js +22 -16
  126. package/dist/components/general/typography.d.ts +3 -0
  127. package/dist/components/general/typography.js +15 -1
  128. package/dist/components/general/visually-hidden.d.ts +3 -0
  129. package/dist/components/general/visually-hidden.js +9 -0
  130. package/dist/components/layout/app-launcher.d.ts +34 -0
  131. package/dist/components/layout/app-launcher.js +228 -0
  132. package/dist/components/layout/app-shell.d.ts +3 -1
  133. package/dist/components/layout/app-shell.js +69 -12
  134. package/dist/components/layout/aspect-ratio.js +0 -1
  135. package/dist/components/layout/auth-divider.js +0 -1
  136. package/dist/components/layout/breadcrumb.d.ts +14 -2
  137. package/dist/components/layout/breadcrumb.js +46 -4
  138. package/dist/components/layout/flex.d.ts +1 -1
  139. package/dist/components/layout/flex.js +41 -3
  140. package/dist/components/layout/index.d.ts +3 -0
  141. package/dist/components/layout/index.js +5 -1
  142. package/dist/components/layout/nav-surface.d.ts +26 -0
  143. package/dist/components/layout/nav-surface.js +17 -0
  144. package/dist/components/layout/org-switcher.d.ts +5 -1
  145. package/dist/components/layout/org-switcher.js +25 -4
  146. package/dist/components/layout/page-container.d.ts +1 -1
  147. package/dist/components/layout/page-container.js +5 -3
  148. package/dist/components/layout/responsive-grid.d.ts +16 -2
  149. package/dist/components/layout/responsive-grid.js +29 -2
  150. package/dist/components/layout/separator.js +0 -1
  151. package/dist/components/layout/sidebar.js +4 -1
  152. package/dist/components/layout/split-pane.d.ts +14 -1
  153. package/dist/components/layout/split-pane.js +26 -13
  154. package/dist/components/layout/topbar-item.d.ts +3 -0
  155. package/dist/components/layout/topbar-item.js +19 -5
  156. package/dist/components/layout/topbar.d.ts +1 -1
  157. package/dist/components/layout/topbar.js +27 -6
  158. package/dist/components/navigation/app-setting-picker.js +21 -2
  159. package/dist/components/navigation/app-setting-toggle.d.ts +16 -0
  160. package/dist/components/navigation/app-setting-toggle.js +96 -0
  161. package/dist/components/navigation/dropdown-menu.d.ts +227 -18
  162. package/dist/components/navigation/dropdown-menu.js +402 -118
  163. package/dist/components/navigation/index.d.ts +2 -0
  164. package/dist/components/navigation/index.js +2 -0
  165. package/dist/components/navigation/pagination-utils.d.ts +2 -1
  166. package/dist/components/navigation/pagination.d.ts +2 -2
  167. package/dist/components/navigation/pagination.js +155 -83
  168. package/dist/components/navigation/steps.d.ts +2 -2
  169. package/dist/components/navigation/steps.js +29 -4
  170. package/dist/components/navigation/tabs.d.ts +29 -16
  171. package/dist/components/navigation/tabs.js +374 -144
  172. package/dist/components/ui/accordion.d.ts +50 -5
  173. package/dist/components/ui/accordion.js +239 -33
  174. package/dist/components/ui/aspect-ratio.d.ts +23 -2
  175. package/dist/components/ui/aspect-ratio.js +15 -13
  176. package/dist/components/ui/avatar.d.ts +29 -4
  177. package/dist/components/ui/avatar.js +111 -25
  178. package/dist/components/ui/hover-card.d.ts +42 -4
  179. package/dist/components/ui/hover-card.js +183 -27
  180. package/dist/components/ui/input-otp.d.ts +26 -28
  181. package/dist/components/ui/input-otp.js +50 -7
  182. package/dist/components/ui/label.js +0 -1
  183. package/dist/components/ui/password-input.d.ts +36 -2
  184. package/dist/components/ui/password-input.js +27 -7
  185. package/dist/components/ui/rating.d.ts +25 -0
  186. package/dist/components/ui/rating.js +67 -27
  187. package/dist/components/ui/segmented.d.ts +12 -3
  188. package/dist/components/ui/segmented.js +17 -2
  189. package/dist/components/ui/separator.d.ts +12 -2
  190. package/dist/components/ui/separator.js +30 -9
  191. package/dist/components/ui/tag-input.d.ts +45 -0
  192. package/dist/components/ui/tag-input.js +109 -27
  193. package/dist/components/ui/toggle-group.d.ts +50 -5
  194. package/dist/components/ui/toggle-group.js +79 -20
  195. package/dist/components/ui/toggle.d.ts +31 -5
  196. package/dist/components/ui/toggle.js +42 -3
  197. package/dist/form/form-context.d.ts +29 -0
  198. package/dist/form/form-context.js +44 -4
  199. package/dist/form/form-field-array.d.ts +22 -0
  200. package/dist/form/form-field-array.js +50 -0
  201. package/dist/form/form-field-control.d.ts +2 -1
  202. package/dist/form/form-field-control.js +116 -40
  203. package/dist/form/form-root.d.ts +2 -1
  204. package/dist/form/form-root.js +142 -23
  205. package/dist/form/index.d.ts +3 -1
  206. package/dist/form/index.js +12 -1
  207. package/dist/i18n/messages/en.json +64 -5
  208. package/dist/i18n/messages/ja.json +64 -5
  209. package/dist/i18n/messages/vi.json +64 -5
  210. package/dist/inertia/index.d.ts +20 -0
  211. package/dist/inertia/index.js +60 -1
  212. package/dist/lib/control-styles.d.ts +25 -3
  213. package/dist/lib/control-styles.js +9 -3
  214. package/dist/lib/datetime/picker-format.d.ts +8 -0
  215. package/dist/lib/datetime/picker-format.js +54 -0
  216. package/dist/lib/slot.d.ts +32 -0
  217. package/dist/lib/slot.js +22 -0
  218. package/dist/lib/variants.d.ts +22 -3
  219. package/dist/lib/variants.js +56 -1
  220. package/dist/props/components/app.prop.d.ts +25 -1
  221. package/dist/props/components/charts.prop.d.ts +21 -0
  222. package/dist/props/components/data-display.prop.d.ts +72 -4
  223. package/dist/props/components/data-entry.prop.d.ts +718 -46
  224. package/dist/props/components/form.prop.d.ts +142 -4
  225. package/dist/props/components/general.prop.d.ts +17 -1
  226. package/dist/props/components/index.d.ts +3 -3
  227. package/dist/props/components/layout.prop.d.ts +281 -11
  228. package/dist/props/components/navigation.prop.d.ts +114 -4
  229. package/dist/props/registry.d.ts +397 -11
  230. package/dist/props/registry.js +526 -11
  231. package/dist/props/vocabulary/content.prop.d.ts +1 -1
  232. package/dist/props/vocabulary/data.prop.d.ts +179 -1
  233. package/dist/props/vocabulary/index.d.ts +5 -5
  234. package/dist/props/vocabulary/interaction.prop.d.ts +68 -3
  235. package/dist/props/vocabulary/layout.prop.d.ts +57 -1
  236. package/dist/props/vocabulary/navigation.prop.d.ts +40 -0
  237. package/dist/props/vocabulary/shared.prop.d.ts +33 -0
  238. package/dist/styles/badge-layout.css +2 -1
  239. package/dist/styles/card-layout.css +26 -4
  240. package/dist/styles/chart-layout.css +15 -0
  241. package/dist/styles/control.css +657 -15
  242. package/dist/styles/core.css +5 -2
  243. package/dist/styles/data-display-layout.css +313 -6
  244. package/dist/styles/data-entry-layout.css +13 -0
  245. package/dist/styles/focus-ring.css +4 -0
  246. package/dist/styles/index.css +5 -2
  247. package/dist/styles/layout.css +327 -4
  248. package/dist/styles/navigation-layout.css +227 -0
  249. package/dist/styles/shell-layout.css +369 -13
  250. package/dist/styles/table-layout.css +95 -6
  251. package/dist/styles/text-layout.css +10 -4
  252. package/dist/tokens/base.css +2 -1
  253. package/dist/tokens/components/badge.css +1 -0
  254. package/dist/tokens/components/chart.css +6 -0
  255. package/dist/tokens/components/control.css +79 -2
  256. package/dist/tokens/components/data-display.css +20 -0
  257. package/dist/tokens/components/descriptions.css +11 -0
  258. package/dist/tokens/components/flex.css +8 -0
  259. package/dist/tokens/components/navigation.css +55 -0
  260. package/dist/tokens/components/shell.css +53 -3
  261. package/dist/tokens/components/table.css +14 -0
  262. package/dist/tokens/foundation.css +2 -0
  263. package/dist/tokens/semantic/layout.css +9 -0
  264. package/docs/COMPONENTS.md +9 -3
  265. package/docs/CONSUMER-RULES.md +13 -0
  266. package/docs/DESIGN-AUTHORITY.md +145 -83
  267. package/docs/DEVELOPMENT.md +4 -3
  268. package/docs/FORMS.md +151 -6
  269. package/docs/FRAME-COVERAGE-REPORT.md +32 -17
  270. package/docs/README.md +15 -15
  271. package/docs/STANDARDS-vocabulary-tokens.md +1 -1
  272. package/docs/TESTING.md +15 -6
  273. package/docs/WHAT-BELONGS-HERE.md +179 -0
  274. package/docs/charts/cjk-category-axis.tsx +81 -0
  275. package/docs/data-display/card/index.tsx +22 -0
  276. package/docs/data-display/data-table/examples/antd-parity.tsx +257 -0
  277. package/docs/data-display/data-table/index.tsx +23 -0
  278. package/docs/data-display/descriptions.tsx +41 -0
  279. package/docs/data-display/legend.tsx +145 -0
  280. package/docs/data-display/progress.tsx +32 -0
  281. package/docs/data-display/scroll-area.tsx +31 -25
  282. package/docs/data-display/table.tsx +104 -45
  283. package/docs/data-display/timeline.tsx +41 -0
  284. package/docs/data-entry/date-picker.tsx +85 -0
  285. package/docs/data-entry/date-range-picker.tsx +26 -0
  286. package/docs/data-entry/form-dynamic-fields.tsx +199 -0
  287. package/docs/data-entry/form.tsx +74 -4
  288. package/docs/data-entry/input-otp.tsx +24 -0
  289. package/docs/data-entry/input.tsx +46 -1
  290. package/docs/data-entry/month-range-picker.tsx +1 -1
  291. package/docs/data-entry/segmented.tsx +1 -1
  292. package/docs/data-entry/select.tsx +29 -2
  293. package/docs/data-entry/switch.tsx +41 -0
  294. package/docs/data-entry/textarea.tsx +38 -0
  295. package/docs/data-entry/time-picker.tsx +85 -1
  296. package/docs/data-entry/time-range-picker.tsx +55 -0
  297. package/docs/data-entry/transfer.tsx +17 -0
  298. package/docs/data-entry/upload.tsx +56 -12
  299. package/docs/feedback/sheet.tsx +1 -1
  300. package/docs/feedback/tooltip.tsx +1 -1
  301. package/docs/general/activity.tsx +2 -2
  302. package/docs/general/button/index.tsx +14 -1
  303. package/docs/general/typography.tsx +14 -1
  304. package/docs/layout/app-launcher.tsx +151 -0
  305. package/docs/layout/app-shell-arrangements.tsx +225 -0
  306. package/docs/layout/app-shell.tsx +11 -0
  307. package/docs/layout/aspect-ratio.tsx +1 -1
  308. package/docs/layout/flex.tsx +50 -0
  309. package/docs/layout/responsive-grid.tsx +21 -1
  310. package/docs/layout/topbar.tsx +5 -9
  311. package/docs/navigation/app-setting-picker.tsx +37 -1
  312. package/docs/navigation/app-setting-toggle.tsx +111 -0
  313. package/docs/navigation/breadcrumb.tsx +48 -0
  314. package/docs/navigation/dropdown-menu.tsx +21 -0
  315. package/docs/navigation/pagination.tsx +52 -0
  316. package/docs/navigation/steps.tsx +37 -0
  317. package/docs/navigation/tabs.tsx +97 -1
  318. package/docs/query/button-refetch.tsx +1 -0
  319. package/package.json +28 -8
  320. package/scripts/_agent-setup.mjs +182 -3
  321. package/scripts/consumer-rule.md +98 -0
  322. package/scripts/guinea-pig-skill.md +322 -0
  323. package/scripts/init-guinea-pig.mjs +84 -0
  324. package/scripts/postinstall.mjs +13 -2
  325. package/scripts/ui-audit.mjs +351 -37
  326. /package/dist/tokens/{antd.generated.css → derived.css} +0 -0
@@ -18,6 +18,15 @@ export type SegmentedProp = {
18
18
  /** Uncontrolled initial selection. */
19
19
  defaultValue?: string;
20
20
  onValueChange?: (value: string) => void;
21
+ /**
22
+ * antd `block` — stretch the bar to its container and share the width EQUALLY between the
23
+ * choices, so the selected pill does not resize as the label changes length.
24
+ */
25
+ block?: boolean;
26
+ /** antd `vertical` — stack the choices in a column. Arrow keys follow the axis. */
27
+ vertical?: boolean;
28
+ /** Control height tier: `md` (default), `sm` or `lg` — the same tiers as every other control. */
29
+ size?: "sm" | "md" | "lg";
21
30
  /** Disable the whole group. */
22
31
  disabled?: boolean;
23
32
  /** Form field name — submits the selected value with the form. */
@@ -30,8 +39,8 @@ export type SegmentedProp = {
30
39
  };
31
40
  export type SegmentedProps = SegmentedProp;
32
41
  /**
33
- * Segmented — one-of-N from a small, closed, always-visible set. antd's `Segmented`
34
- * (docs/DESIGN-AUTHORITY.md names Ant Design the taxonomy authority) drawn on Radix's RadioGroup,
42
+ * Segmented — one-of-N from a small, closed, always-visible set. The established enterprise
43
+ * `Segmented` control (docs/DESIGN-AUTHORITY.md) drawn on Radix's RadioGroup,
35
44
  * which is this repo's authority for behaviour primitives.
36
45
  *
37
46
  * WHY NOT `ToggleGroup`. A ToggleGroup is a row of PRESSED buttons: `aria-pressed`, independently
@@ -42,7 +51,7 @@ export type SegmentedProps = SegmentedProp;
42
51
  * distinction and it is not a skin.
43
52
  *
44
53
  * The primitive gives roving tabindex, arrow-key traversal (RTL-aware), the radiogroup/radio roles
45
- * and the hidden input a native form submit needs. This file adds the antd geometry and nothing
54
+ * and the hidden input a native form submit needs. This file adds that geometry and nothing
46
55
  * else — the focus mark comes from `ui-focus-ring`, the ONE source in styles/focus-ring.css.
47
56
  */
48
57
  export declare const Segmented: React.ForwardRefExoticComponent<SegmentedProp & React.RefAttributes<HTMLDivElement>>;
@@ -3,15 +3,30 @@ import { jsx, jsxs } from "react/jsx-runtime";
3
3
  import * as React from "react";
4
4
  import * as RadioGroupPrimitive from "@radix-ui/react-radio-group";
5
5
  import { cn } from "../../lib/utils.js";
6
- const Segmented = React.forwardRef(function Segmented2({ options, value, defaultValue, onValueChange, disabled, name, id, className, ...props }, ref) {
6
+ const Segmented = React.forwardRef(function Segmented2({
7
+ options,
8
+ value,
9
+ defaultValue,
10
+ onValueChange,
11
+ disabled,
12
+ block = false,
13
+ vertical = false,
14
+ size,
15
+ name,
16
+ id,
17
+ className,
18
+ ...props
19
+ }, ref) {
7
20
  return /* @__PURE__ */ jsx(
8
21
  RadioGroupPrimitive.Root,
9
22
  {
10
23
  ref,
11
24
  id,
12
25
  "data-slot": "segmented",
26
+ "data-block": block ? "true" : void 0,
27
+ "data-size": size,
13
28
  className: cn("ui-segmented", className),
14
- orientation: "horizontal",
29
+ orientation: vertical ? "vertical" : "horizontal",
15
30
  value,
16
31
  defaultValue,
17
32
  onValueChange,
@@ -2,10 +2,20 @@ import * as React from "react";
2
2
  export type { SeparatorProp, SeparatorProp as SeparatorProps, } from "../../props/components/layout.prop.js";
3
3
  /**
4
4
  * ACCESSIBILITY — the whole point of the labelled form is that the label is ANNOUNCED, exactly
5
- * ONCE. Without a label the rule stays `decorative` (Radix emits `role="none"`), which is right: a
6
- * section rule carries no information.
5
+ * ONCE. Without a label the rule stays `decorative` (`role="none"`), which is right: a section
6
+ * rule carries no information.
7
+ *
8
+ * SUBSTRATE — React Aria Components. Its `Separator` has no `decorative` prop: `useSeparator`
9
+ * emits `role="separator"` unconditionally (and `aria-orientation="vertical"` on the vertical
10
+ * rule), and it drops `children` entirely. Both are handled in the `render` override below, which
11
+ * is RAC's supported escape hatch for owning the element: it hands us the computed DOM props and
12
+ * the ref, and we decide what element carries them.
7
13
  */
8
14
  export declare const Separator: React.ForwardRefExoticComponent<Omit<React.HTMLAttributes<HTMLDivElement>, "children"> & {
15
+ labelSize?: "2xs" | "xs" | "sm" | "md";
16
+ space?: import("../../props/index.js").GapProp;
17
+ hideBelow?: import("../../props/index.js").BreakpointProp;
18
+ hideFrom?: import("../../props/index.js").BreakpointProp;
9
19
  orientation?: import("../../props/index.js").OrientationProp;
10
20
  label?: string;
11
21
  labelAlign?: import("../../props/index.js").TextAlignProp;
@@ -1,11 +1,16 @@
1
- "use client";
2
1
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
3
2
  import * as React from "react";
4
- import * as SeparatorPrimitive from "@radix-ui/react-separator";
3
+ import { Separator as AriaSeparator } from "react-aria-components";
4
+ import { padStepToken } from "../../lib/variants.js";
5
5
  import { cn } from "../../lib/utils.js";
6
6
  const Separator = React.forwardRef(
7
7
  ({
8
8
  className,
9
+ labelSize,
10
+ space,
11
+ hideBelow,
12
+ hideFrom,
13
+ style,
9
14
  orientation = "horizontal",
10
15
  decorative,
11
16
  label,
@@ -24,24 +29,40 @@ const Separator = React.forwardRef(
24
29
  }
25
30
  const isDecorative = decorative ?? !labelled;
26
31
  return /* @__PURE__ */ jsx(
27
- SeparatorPrimitive.Root,
32
+ AriaSeparator,
28
33
  {
29
34
  ref,
35
+ elementType: "div",
30
36
  "data-slot": "separator",
37
+ "data-label-size": labelSize,
38
+ "data-hide-below": hideBelow,
39
+ "data-hide-from": hideFrom,
40
+ style: {
41
+ ...style,
42
+ ...space === void 0 ? void 0 : { marginBlock: padStepToken(space) }
43
+ },
31
44
  "data-orientation": orientation,
32
45
  "data-tone": tone,
33
46
  "data-labelled": labelled ? "" : void 0,
34
47
  "data-label-align": labelled ? labelAlign : void 0,
35
48
  orientation,
36
- decorative: isDecorative,
37
49
  "aria-label": labelled && !isDecorative ? label : void 0,
38
50
  className: cn("ui-separator", className),
39
51
  ...props,
40
- children: labelled ? /* @__PURE__ */ jsxs(Fragment, { children: [
41
- /* @__PURE__ */ jsx("span", { className: "ui-separator-rule", "aria-hidden": "true" }),
42
- /* @__PURE__ */ jsx("span", { className: "ui-separator-label", "aria-hidden": isDecorative ? void 0 : true, children: label }),
43
- /* @__PURE__ */ jsx("span", { className: "ui-separator-rule", "aria-hidden": "true" })
44
- ] }) : null
52
+ render: ({ role, "aria-orientation": ariaOrientation, ...domProps }) => /* @__PURE__ */ jsx(
53
+ "div",
54
+ {
55
+ role: isDecorative ? "none" : role,
56
+ "aria-orientation": isDecorative ? void 0 : ariaOrientation,
57
+ ...props,
58
+ ...domProps,
59
+ children: labelled ? /* @__PURE__ */ jsxs(Fragment, { children: [
60
+ /* @__PURE__ */ jsx("span", { className: "ui-separator-rule", "aria-hidden": "true" }),
61
+ /* @__PURE__ */ jsx("span", { className: "ui-separator-label", "aria-hidden": isDecorative ? void 0 : true, children: label }),
62
+ /* @__PURE__ */ jsx("span", { className: "ui-separator-rule", "aria-hidden": "true" })
63
+ ] }) : null
64
+ }
65
+ )
45
66
  }
46
67
  );
47
68
  }
@@ -1,13 +1,58 @@
1
1
  import * as React from "react";
2
+ import type { AllowClearProp, ControlStatusProp, ControlVariantProp, MaxTagCountProp, MaxTagPlaceholderProp, SizeProp } from "../../props/vocabulary/index.js";
3
+ /**
4
+ * TagInput is this library's answer to antd's `Select mode="tags"` — a free-text token field — so
5
+ * it takes the same token-level props antd puts on that mode.
6
+ */
2
7
  export type TagInputProps = {
3
8
  value?: string[];
4
9
  defaultValue?: string[];
5
10
  onValueChange?: (tags: string[]) => void;
6
11
  placeholder?: string;
7
12
  disabled?: boolean;
13
+ /**
14
+ * Read-only: the tags stay visible, selectable and submitted, but nothing can be added or
15
+ * removed — the draft field is read-only, the chip removers and the clear ✕ are withdrawn, and
16
+ * the container reports `aria-readonly`. Mirrors Select's readOnly contract (still focusable and
17
+ * still in the tab order, unlike `disabled`).
18
+ */
19
+ readOnly?: boolean;
8
20
  name?: string;
9
21
  className?: string;
10
22
  id?: string;
11
23
  "aria-label"?: string;
24
+ /** Control height tier (antd `size`) — the shared `--control-height` ladder. */
25
+ size?: SizeProp;
26
+ /** Validation status (antd `status`). `error` also sets `aria-invalid`; `warning` recolours only. */
27
+ status?: ControlStatusProp;
28
+ /** Control surface (antd `variant`). Default `outlined`. */
29
+ variant?: ControlVariantProp;
30
+ /** Hard ceiling on how many tags may be held (antd `maxCount`). Further input is refused. */
31
+ maxCount?: number;
32
+ /**
33
+ * antd `allowClear` — a single ✕ that drops EVERY tag at once. Off by default (antd's own
34
+ * default for a tags field). The object form replaces the icon and/or the accessible label.
35
+ */
36
+ allowClear?: AllowClearProp;
37
+ /** Fired after every tag is dropped through the ✕ (antd `onClear`). */
38
+ onClear?: () => void;
39
+ /** How many chips render before the rest collapse into the overflow node (antd `maxTagCount`). */
40
+ maxTagCount?: MaxTagCountProp;
41
+ /** The node standing in for what `maxTagCount` hid (antd `maxTagPlaceholder`). */
42
+ maxTagPlaceholder?: MaxTagPlaceholderProp;
43
+ /** Render one chip yourself (antd `tagRender`) — receives the value and an `onClose` remover. */
44
+ tagRender?: (props: {
45
+ value: string;
46
+ label: React.ReactNode;
47
+ onClose: () => void;
48
+ index: number;
49
+ disabled: boolean;
50
+ }) => React.ReactNode;
51
+ /**
52
+ * Characters that commit the draft into a tag (antd `tokenSeparators`). Default `[","]`; Enter
53
+ * always commits and is not a separator. Pasting a run containing a separator splits it into
54
+ * several tags, which is antd's behaviour and the reason the prop exists.
55
+ */
56
+ tokenSeparators?: string[];
12
57
  };
13
58
  export declare const TagInput: React.ForwardRefExoticComponent<TagInputProps & React.RefAttributes<HTMLInputElement>>;
@@ -1,9 +1,17 @@
1
1
  "use client";
2
- import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
3
3
  import * as React from "react";
4
4
  import { X } from "lucide-react";
5
5
  import { useTranslation } from "../../i18n/use-translation.js";
6
6
  import { cn } from "../../lib/utils.js";
7
+ import {
8
+ applyMaxTagCount,
9
+ controlSurfaceAttrs,
10
+ resolveAllowClear
11
+ } from "../data-entry/control-surface.js";
12
+ function escapeForCharClass(character) {
13
+ return character.replace(/[\\\]^-]/g, "\\$&");
14
+ }
7
15
  const TagInput = React.forwardRef(
8
16
  ({
9
17
  value,
@@ -11,10 +19,21 @@ const TagInput = React.forwardRef(
11
19
  onValueChange,
12
20
  placeholder,
13
21
  disabled,
22
+ readOnly,
14
23
  name,
15
24
  className,
16
25
  id,
17
- "aria-label": ariaLabel
26
+ "aria-label": ariaLabel,
27
+ size,
28
+ status,
29
+ variant,
30
+ maxCount,
31
+ allowClear,
32
+ onClear,
33
+ maxTagCount,
34
+ maxTagPlaceholder,
35
+ tagRender,
36
+ tokenSeparators = [","]
18
37
  }, ref) => {
19
38
  const { t } = useTranslation();
20
39
  const [internal, setInternal] = React.useState(defaultValue);
@@ -27,11 +46,25 @@ const TagInput = React.forwardRef(
27
46
  const add = (raw) => {
28
47
  const tag = raw.trim();
29
48
  if (!tag || tags.includes(tag)) return;
49
+ if (maxCount !== void 0 && tags.length >= maxCount) return;
30
50
  commit([...tags, tag]);
31
51
  };
52
+ const addAll = (raw) => {
53
+ let next = [...tags];
54
+ const pieces = tokenSeparators.length ? raw.split(new RegExp(`[${tokenSeparators.map(escapeForCharClass).join("")}]`)) : [raw];
55
+ for (const piece of pieces) {
56
+ const tag = piece.trim();
57
+ if (!tag || next.includes(tag)) continue;
58
+ if (maxCount !== void 0 && next.length >= maxCount) break;
59
+ next = [...next, tag];
60
+ }
61
+ if (next.length !== tags.length) commit(next);
62
+ };
32
63
  const removeAt = (i) => commit(tags.filter((_, idx) => idx !== i));
33
64
  const onKeyDown = (e) => {
34
- if (e.key === "Enter" || e.key === ",") {
65
+ if (readOnly) return;
66
+ if (e.nativeEvent.isComposing) return;
67
+ if (e.key === "Enter" || tokenSeparators.includes(e.key)) {
35
68
  e.preventDefault();
36
69
  add(draft);
37
70
  setDraft("");
@@ -39,35 +72,63 @@ const TagInput = React.forwardRef(
39
72
  removeAt(tags.length - 1);
40
73
  }
41
74
  };
75
+ const clearControl = resolveAllowClear(allowClear, false, t("common.clear"));
76
+ const showClear = clearControl.enabled && tags.length > 0 && !disabled && !readOnly;
77
+ const clearAll = () => {
78
+ commit([]);
79
+ onClear?.();
80
+ };
81
+ const chips = tags.map((tag, index) => ({ value: tag, label: tag, index }));
82
+ const {
83
+ visible: visibleChips,
84
+ omitted: omittedChips,
85
+ overflow
86
+ } = applyMaxTagCount(chips, maxTagCount, maxTagPlaceholder);
42
87
  return /* @__PURE__ */ jsxs(
43
88
  "div",
44
89
  {
45
90
  "data-slot": "tag-input",
46
91
  "aria-disabled": disabled || void 0,
47
- className: cn("ui-tag-input", disabled && "ui-tag-input-disabled", className),
92
+ "aria-readonly": readOnly || void 0,
93
+ ...controlSurfaceAttrs({ variant, status, size }),
94
+ "aria-invalid": status === "error" ? true : void 0,
95
+ className: cn(
96
+ "ui-tag-input ui-control-surface",
97
+ disabled && "ui-tag-input-disabled",
98
+ className
99
+ ),
48
100
  children: [
49
- tags.length > 0 ? /* @__PURE__ */ jsx("ul", { role: "list", className: "ui-tag-input-list", "data-slot": "tag-input-list", children: tags.map((tag, i) => /* @__PURE__ */ jsxs(
50
- "li",
51
- {
52
- role: "listitem",
53
- className: "ui-tag-input-chip",
54
- "data-slot": "tag-input-chip",
55
- children: [
56
- tag,
57
- !disabled ? /* @__PURE__ */ jsx(
58
- "button",
59
- {
60
- type: "button",
61
- className: "ui-tag-input-remove",
62
- "aria-label": t("ui.tagInput.removeTag", { tag }),
63
- onClick: () => removeAt(i),
64
- children: /* @__PURE__ */ jsx(X, { "aria-hidden": "true" })
65
- }
66
- ) : null
67
- ]
68
- },
69
- tag
70
- )) }) : null,
101
+ tags.length > 0 ? /* @__PURE__ */ jsxs("ul", { role: "list", className: "ui-tag-input-list", "data-slot": "tag-input-list", children: [
102
+ visibleChips.map((chip) => /* @__PURE__ */ jsx(
103
+ "li",
104
+ {
105
+ role: "listitem",
106
+ className: "ui-tag-input-chip",
107
+ "data-slot": "tag-input-chip",
108
+ children: tagRender ? tagRender({
109
+ value: chip.value,
110
+ label: chip.label,
111
+ index: chip.index,
112
+ disabled: Boolean(disabled) || Boolean(readOnly),
113
+ onClose: () => removeAt(chip.index)
114
+ }) : /* @__PURE__ */ jsxs(Fragment, { children: [
115
+ chip.value,
116
+ !disabled && !readOnly ? /* @__PURE__ */ jsx(
117
+ "button",
118
+ {
119
+ type: "button",
120
+ className: "ui-tag-input-remove",
121
+ "aria-label": t("ui.tagInput.removeTag", { tag: chip.value }),
122
+ onClick: () => removeAt(chip.index),
123
+ children: /* @__PURE__ */ jsx(X, { "aria-hidden": "true" })
124
+ }
125
+ ) : null
126
+ ] })
127
+ },
128
+ chip.value
129
+ )),
130
+ omittedChips.length > 0 ? /* @__PURE__ */ jsx("li", { role: "listitem", className: "ui-tag-input-chip", "data-slot": "tag-input-overflow", children: overflow ?? t("dataEntry.selection.overflow", { count: omittedChips.length }) }) : null
131
+ ] }) : null,
71
132
  /* @__PURE__ */ jsx(
72
133
  "input",
73
134
  {
@@ -76,12 +137,21 @@ const TagInput = React.forwardRef(
76
137
  type: "text",
77
138
  className: "ui-tag-input-field",
78
139
  value: draft,
79
- placeholder: tags.length === 0 ? placeholder : void 0,
140
+ placeholder: tags.length === 0 && !readOnly ? placeholder : void 0,
80
141
  disabled,
142
+ readOnly,
81
143
  "aria-label": ariaLabel ?? t("ui.tagInput.inputLabel"),
82
144
  onChange: (e) => setDraft(e.target.value),
83
145
  onKeyDown,
146
+ onPaste: (e) => {
147
+ const text = e.clipboardData.getData("text");
148
+ if (!tokenSeparators.some((separator) => text.includes(separator))) return;
149
+ e.preventDefault();
150
+ addAll(text);
151
+ setDraft("");
152
+ },
84
153
  onBlur: () => {
154
+ if (readOnly) return;
85
155
  if (draft.trim()) {
86
156
  add(draft);
87
157
  setDraft("");
@@ -89,6 +159,18 @@ const TagInput = React.forwardRef(
89
159
  }
90
160
  }
91
161
  ),
162
+ showClear ? /* @__PURE__ */ jsx(
163
+ "button",
164
+ {
165
+ type: "button",
166
+ tabIndex: -1,
167
+ "aria-label": clearControl.label,
168
+ "data-slot": "tag-input-clear",
169
+ className: "ui-control-inline-affix-action ui-tag-input-clear",
170
+ onClick: clearAll,
171
+ children: clearControl.clearIcon ?? /* @__PURE__ */ jsx(X, { className: "ui-control-inline-affix-icon", "aria-hidden": "true" })
172
+ }
173
+ ) : null,
92
174
  /* @__PURE__ */ jsx("span", { "aria-live": "polite", className: "sr-only", "data-slot": "tag-input-status", children: t("ui.tagInput.tagCount", { count: tags.length }) }),
93
175
  name ? /* @__PURE__ */ jsx("input", { type: "hidden", name, value: tags.join(",") }) : null
94
176
  ]
@@ -1,19 +1,64 @@
1
1
  import * as React from "react";
2
- import * as ToggleGroupPrimitive from "@radix-ui/react-toggle-group";
3
2
  import { type ToggleCountFields, type ToggleProp } from "./toggle.js";
4
3
  type ToggleGroupVariant = ToggleProp["variant"];
5
4
  type ToggleGroupSize = ToggleProp["size"];
6
- export declare const ToggleGroup: React.ForwardRefExoticComponent<((Omit<ToggleGroupPrimitive.ToggleGroupMultipleProps & React.RefAttributes<HTMLDivElement>, "ref"> | Omit<ToggleGroupPrimitive.ToggleGroupSingleProps & React.RefAttributes<HTMLDivElement>, "ref">) & {
5
+ type ToggleGroupBaseProp = Omit<React.ComponentPropsWithoutRef<"div">, "defaultValue" | "dir"> & {
7
6
  variant?: ToggleGroupVariant;
8
7
  size?: ToggleGroupSize;
9
- }) & React.RefAttributes<HTMLDivElement>>;
8
+ /** Disable every item at once — RAC `isDisabled`. */
9
+ disabled?: boolean;
10
+ /** Which way the arrow keys walk the group. */
11
+ orientation?: "horizontal" | "vertical";
12
+ /**
13
+ * Writing direction. It still lands on the DOM node, but React Aria reads the direction it
14
+ * navigates by from the ambient locale (`I18nProvider`), NOT from this attribute — where Radix
15
+ * read this prop directly. An RTL app must set the locale, not just `dir`.
16
+ */
17
+ dir?: "ltr" | "rtl";
18
+ /**
19
+ * Accepted for source compatibility with the Radix era, where it wrapped arrow-key focus around
20
+ * the ends. React Aria's toolbar navigation stops at the ends and has no equivalent switch, so
21
+ * this prop no longer changes anything.
22
+ */
23
+ loop?: boolean;
24
+ };
25
+ /**
26
+ * `type` is the discriminant, exactly as it was under Radix: `"single"` reports the one selected
27
+ * value as a string (`""` once it is deselected), `"multiple"` reports an array. React Aria models
28
+ * both as `selectionMode` + a `Set` of keys — that Set is built and unpacked here so the public
29
+ * shape stays a string / an array of strings.
30
+ */
31
+ type ToggleGroupSingleProp = ToggleGroupBaseProp & {
32
+ type: "single";
33
+ value?: string;
34
+ defaultValue?: string;
35
+ onValueChange?: (value: string) => void;
36
+ };
37
+ type ToggleGroupMultipleProp = ToggleGroupBaseProp & {
38
+ type: "multiple";
39
+ value?: string[];
40
+ defaultValue?: string[];
41
+ onValueChange?: (value: string[]) => void;
42
+ };
43
+ type ToggleGroupProp = ToggleGroupSingleProp | ToggleGroupMultipleProp;
44
+ export declare const ToggleGroup: React.ForwardRefExoticComponent<ToggleGroupProp & React.RefAttributes<HTMLDivElement>>;
10
45
  /** Same vocabulary as `Toggle` and `Button` — one counter pill for the whole library. */
11
- export type ToggleGroupItemProp = React.ComponentPropsWithoutRef<typeof ToggleGroupPrimitive.Item> & ToggleCountFields & {
46
+ export type ToggleGroupItemProp = Omit<React.ComponentPropsWithoutRef<"button">, "value"> & ToggleCountFields & {
47
+ /**
48
+ * This item's key in the group's value. React Aria calls it `id` (the key it stores in
49
+ * `selectedKeys`); the public spelling stays `value`, as it was under Radix.
50
+ */
51
+ value: string;
12
52
  variant?: ToggleGroupVariant;
13
53
  size?: ToggleGroupSize;
14
54
  };
15
55
  export type ToggleGroupItemProps = ToggleGroupItemProp;
16
- export declare const ToggleGroupItem: React.ForwardRefExoticComponent<Omit<ToggleGroupPrimitive.ToggleGroupItemProps & React.RefAttributes<HTMLButtonElement>, "ref"> & ToggleCountFields & {
56
+ export declare const ToggleGroupItem: React.ForwardRefExoticComponent<Omit<Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref">, "value"> & ToggleCountFields & {
57
+ /**
58
+ * This item's key in the group's value. React Aria calls it `id` (the key it stores in
59
+ * `selectedKeys`); the public spelling stays `value`, as it was under Radix.
60
+ */
61
+ value: string;
17
62
  variant?: ToggleGroupVariant;
18
63
  size?: ToggleGroupSize;
19
64
  } & React.RefAttributes<HTMLButtonElement>>;
@@ -1,26 +1,77 @@
1
1
  "use client";
2
2
  import { jsx, jsxs } from "react/jsx-runtime";
3
3
  import * as React from "react";
4
- import * as ToggleGroupPrimitive from "@radix-ui/react-toggle-group";
4
+ import {
5
+ ToggleButton,
6
+ ToggleButtonGroup,
7
+ ToggleGroupStateContext
8
+ } from "react-aria-components";
5
9
  import { cn } from "../../lib/utils.js";
6
- import { toggleVariants, useCounterPill } from "./toggle.js";
10
+ import {
11
+ restoreDomProps,
12
+ toggleVariants,
13
+ useCounterPill
14
+ } from "./toggle.js";
7
15
  const ToggleGroupContext = React.createContext({});
8
- const ToggleGroup = React.forwardRef(({ className, variant, size, children, ...props }, ref) => {
9
- const context = React.useMemo(() => ({ variant, size }), [variant, size]);
10
- return /* @__PURE__ */ jsx(
11
- ToggleGroupPrimitive.Root,
12
- {
13
- ref,
14
- "data-slot": "toggle-group",
15
- "data-variant": variant,
16
- "data-size": size,
17
- className: cn("ui-toggle-group", className),
18
- ...props,
19
- children: /* @__PURE__ */ jsx(ToggleGroupContext.Provider, { value: context, children })
20
- }
21
- );
22
- });
23
- ToggleGroup.displayName = ToggleGroupPrimitive.Root.displayName;
16
+ function toSelectedKeys(value) {
17
+ if (value == null) {
18
+ return void 0;
19
+ }
20
+ if (Array.isArray(value)) {
21
+ return new Set(value);
22
+ }
23
+ return new Set(value === "" ? [] : [value]);
24
+ }
25
+ const ToggleGroup = React.forwardRef(
26
+ // No destructuring defaults: an unset prop must stay `undefined` so the emitted attribute is
27
+ // either absent or a declared union member.
28
+ // is NOT in the `sm | md | lg` size union — the group advertised an invalid value for its own
29
+ // type.) The real default lives in `toggleVariants`, applied per item.
30
+ ({
31
+ className,
32
+ variant,
33
+ size,
34
+ children,
35
+ type,
36
+ value,
37
+ defaultValue,
38
+ onValueChange,
39
+ disabled,
40
+ loop: _loop,
41
+ ...props
42
+ }, ref) => {
43
+ const context = React.useMemo(() => ({ variant, size }), [variant, size]);
44
+ const selectedKeys = React.useMemo(() => toSelectedKeys(value), [value]);
45
+ const defaultSelectedKeys = React.useMemo(() => toSelectedKeys(defaultValue), [defaultValue]);
46
+ const handleSelectionChange = (keys) => {
47
+ const next = [...keys].map(String);
48
+ if (type === "single") {
49
+ onValueChange?.(next[0] ?? "");
50
+ } else {
51
+ onValueChange?.(next);
52
+ }
53
+ };
54
+ return /* @__PURE__ */ jsx(
55
+ ToggleButtonGroup,
56
+ {
57
+ ref,
58
+ "data-slot": "toggle-group",
59
+ "data-variant": variant,
60
+ "data-size": size,
61
+ className: cn("ui-toggle-group", className),
62
+ ...props,
63
+ selectionMode: type,
64
+ selectedKeys,
65
+ defaultSelectedKeys,
66
+ onSelectionChange: handleSelectionChange,
67
+ isDisabled: disabled,
68
+ render: (domProps) => /* @__PURE__ */ jsx("div", { ...props, ...domProps, tabIndex: props.tabIndex ?? domProps.tabIndex }),
69
+ children: /* @__PURE__ */ jsx(ToggleGroupContext.Provider, { value: context, children })
70
+ }
71
+ );
72
+ }
73
+ );
74
+ ToggleGroup.displayName = "ToggleGroup";
24
75
  const ToggleGroupItem = React.forwardRef(
25
76
  ({
26
77
  className,
@@ -32,6 +83,8 @@ const ToggleGroupItem = React.forwardRef(
32
83
  countLabel,
33
84
  children,
34
85
  "aria-label": ariaLabel,
86
+ value,
87
+ disabled,
35
88
  ...props
36
89
  }, ref) => {
37
90
  const context = React.useContext(ToggleGroupContext);
@@ -44,16 +97,22 @@ const ToggleGroupItem = React.forwardRef(
44
97
  countLabel,
45
98
  ariaLabel
46
99
  });
100
+ const groupState = React.useContext(ToggleGroupStateContext);
101
+ const isPressed = groupState?.selectedKeys.has(value) ?? false;
47
102
  return /* @__PURE__ */ jsxs(
48
- ToggleGroupPrimitive.Item,
103
+ ToggleButton,
49
104
  {
50
105
  ref,
51
106
  "data-slot": "toggle-group-item",
107
+ "data-state": isPressed ? "on" : "off",
52
108
  "data-variant": resolvedVariant,
53
109
  "data-size": resolvedSize,
54
110
  "aria-label": resolvedAriaLabel,
55
111
  className: cn(toggleVariants({ variant: resolvedVariant, size: resolvedSize }), className),
56
112
  ...props,
113
+ id: value,
114
+ isDisabled: disabled,
115
+ render: (domProps) => restoreDomProps(props, domProps),
57
116
  children: [
58
117
  children,
59
118
  pill
@@ -62,7 +121,7 @@ const ToggleGroupItem = React.forwardRef(
62
121
  );
63
122
  }
64
123
  );
65
- ToggleGroupItem.displayName = ToggleGroupPrimitive.Item.displayName;
124
+ ToggleGroupItem.displayName = "ToggleGroupItem";
66
125
  export {
67
126
  ToggleGroup,
68
127
  ToggleGroupItem