@vjdesigns/vjdesigns-ui 3.4.0 → 3.5.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 (503) hide show
  1. package/CHANGELOG.md +169 -0
  2. package/README.md +854 -873
  3. package/dist/components/data-display/Accordion/Accordion.mjs +97 -166
  4. package/dist/components/data-display/Chat/Chat.d.ts +13 -2
  5. package/dist/components/data-display/Collapsible/Collapsible.d.ts +70 -0
  6. package/dist/components/data-display/Collapsible/Collapsible.mjs +102 -0
  7. package/dist/components/data-display/Collapsible/Collapsible.module.css.mjs +8 -0
  8. package/dist/components/data-display/Collapsible/index.d.ts +1 -0
  9. package/dist/components/feedback/Progress/Progress.d.ts +32 -2
  10. package/dist/components/feedback/Progress/Progress.mjs +78 -74
  11. package/dist/components/feedback/Progress/Progress.module.css.mjs +1 -1
  12. package/dist/components/forms/Radio/Radio.mjs +12 -10
  13. package/dist/components/forms/ToggleGroup/ToggleGroup.mjs +133 -131
  14. package/dist/components/navigation/Toolbar/Toolbar.mjs +106 -0
  15. package/dist/components/navigation/Toolbar/Toolbar.module.css.mjs +11 -0
  16. package/dist/components/navigation/Toolbar/ToolbarContext.mjs +4 -0
  17. package/dist/components/navigation/Toolbar/index.d.ts +1 -0
  18. package/dist/components/primitives/CopyButton/CopyButton.d.ts +39 -0
  19. package/dist/components/primitives/CopyButton/CopyButton.mjs +49 -0
  20. package/dist/components/primitives/CopyButton/index.d.ts +1 -0
  21. package/dist/hooks/useCollapsePresence.mjs +83 -0
  22. package/dist/i18n/en.mjs +5 -0
  23. package/dist/index.mjs +104 -101
  24. package/dist/locales/ar.mjs +5 -0
  25. package/dist/locales/bn.mjs +5 -0
  26. package/dist/locales/cs.mjs +5 -0
  27. package/dist/locales/da.mjs +5 -0
  28. package/dist/locales/de.mjs +5 -0
  29. package/dist/locales/el.mjs +5 -0
  30. package/dist/locales/es.mjs +5 -0
  31. package/dist/locales/fa.mjs +5 -0
  32. package/dist/locales/fi.mjs +5 -0
  33. package/dist/locales/fr.mjs +5 -0
  34. package/dist/locales/he.mjs +5 -0
  35. package/dist/locales/hi.mjs +5 -0
  36. package/dist/locales/hu.mjs +5 -0
  37. package/dist/locales/id.mjs +5 -0
  38. package/dist/locales/it.mjs +5 -0
  39. package/dist/locales/ja.mjs +5 -0
  40. package/dist/locales/ko.mjs +5 -0
  41. package/dist/locales/nb.mjs +5 -0
  42. package/dist/locales/nl.mjs +5 -0
  43. package/dist/locales/pl.mjs +5 -0
  44. package/dist/locales/pt-BR.mjs +5 -0
  45. package/dist/locales/ro.mjs +5 -0
  46. package/dist/locales/ru.mjs +5 -0
  47. package/dist/locales/sv.mjs +5 -0
  48. package/dist/locales/th.mjs +5 -0
  49. package/dist/locales/tr.mjs +5 -0
  50. package/dist/locales/uk.mjs +5 -0
  51. package/dist/locales/ur.mjs +5 -0
  52. package/dist/locales/vi.mjs +5 -0
  53. package/dist/locales/zh-Hans.mjs +5 -0
  54. package/dist/locales/zh-Hant.mjs +5 -0
  55. package/dist/vjdesigns-ui.css +1 -1
  56. package/package.json +7 -5
  57. package/dist/ai/llms-full.txt +0 -8500
  58. package/dist/ai/llms.txt +0 -198
  59. package/dist/ai/mcp-server.mjs +0 -212
  60. package/dist/ai/registry.json +0 -21058
  61. package/dist/components/data-display/Accordion/Accordion.cjs.js +0 -1
  62. package/dist/components/data-display/Accordion/Accordion.module.css.cjs.js +0 -1
  63. package/dist/components/data-display/Avatar/Avatar.cjs.js +0 -1
  64. package/dist/components/data-display/Avatar/Avatar.module.css.cjs.js +0 -1
  65. package/dist/components/data-display/Badge/Badge.cjs.js +0 -1
  66. package/dist/components/data-display/Badge/Badge.module.css.cjs.js +0 -1
  67. package/dist/components/data-display/Card/Card.cjs.js +0 -1
  68. package/dist/components/data-display/Card/Card.module.css.cjs.js +0 -1
  69. package/dist/components/data-display/Carousel/Carousel.cjs.js +0 -1
  70. package/dist/components/data-display/Carousel/Carousel.module.css.cjs.js +0 -1
  71. package/dist/components/data-display/Chat/Chat.cjs.js +0 -1
  72. package/dist/components/data-display/Chat/Chat.module.css.cjs.js +0 -1
  73. package/dist/components/data-display/Chat/streams.cjs.js +0 -4
  74. package/dist/components/data-display/Chip/Chip.cjs.js +0 -1
  75. package/dist/components/data-display/Chip/Chip.module.css.cjs.js +0 -1
  76. package/dist/components/data-display/CodeBlock/CodeBlock.cjs.js +0 -6
  77. package/dist/components/data-display/CodeBlock/CodeBlock.module.css.cjs.js +0 -1
  78. package/dist/components/data-display/CodeBlock/tokenize.cjs.js +0 -13
  79. package/dist/components/data-display/CodeBlock/tokenize.d.ts +0 -26
  80. package/dist/components/data-display/Countdown/Countdown.cjs.js +0 -1
  81. package/dist/components/data-display/Countdown/Countdown.module.css.cjs.js +0 -1
  82. package/dist/components/data-display/DataGrid/DataGrid.cjs.js +0 -1
  83. package/dist/components/data-display/DataGrid/DataGrid.module.css.cjs.js +0 -1
  84. package/dist/components/data-display/DataGrid/dataGridUtils.cjs.js +0 -1
  85. package/dist/components/data-display/DataGrid/dataGridUtils.d.ts +0 -46
  86. package/dist/components/data-display/EmptyState/EmptyState.cjs.js +0 -1
  87. package/dist/components/data-display/EmptyState/EmptyState.module.css.cjs.js +0 -1
  88. package/dist/components/data-display/Image/Image.cjs.js +0 -1
  89. package/dist/components/data-display/Image/Image.module.css.cjs.js +0 -1
  90. package/dist/components/data-display/List/List.cjs.js +0 -1
  91. package/dist/components/data-display/List/List.module.css.cjs.js +0 -1
  92. package/dist/components/data-display/Stat/Stat.cjs.js +0 -1
  93. package/dist/components/data-display/Stat/Stat.module.css.cjs.js +0 -1
  94. package/dist/components/data-display/Table/Table.cjs.js +0 -1
  95. package/dist/components/data-display/Table/Table.module.css.cjs.js +0 -1
  96. package/dist/components/data-display/Table/useTable.cjs.js +0 -1
  97. package/dist/components/data-display/Table/useTable.d.ts +0 -118
  98. package/dist/components/data-display/Timeline/Timeline.cjs.js +0 -1
  99. package/dist/components/data-display/Timeline/Timeline.module.css.cjs.js +0 -1
  100. package/dist/components/data-display/TreeView/TreeView.cjs.js +0 -1
  101. package/dist/components/data-display/TreeView/TreeView.module.css.cjs.js +0 -1
  102. package/dist/components/data-display/TreeView/treeUtils.cjs.js +0 -1
  103. package/dist/components/data-display/TreeView/treeUtils.d.ts +0 -82
  104. package/dist/components/data-display/VirtualList/VirtualList.cjs.js +0 -1
  105. package/dist/components/data-display/VirtualList/VirtualList.module.css.cjs.js +0 -1
  106. package/dist/components/feedback/Alert/Alert.cjs.js +0 -1
  107. package/dist/components/feedback/Alert/Alert.module.css.cjs.js +0 -1
  108. package/dist/components/feedback/Banner/Banner.cjs.js +0 -1
  109. package/dist/components/feedback/Banner/Banner.module.css.cjs.js +0 -1
  110. package/dist/components/feedback/ErrorSummary/ErrorSummary.cjs.js +0 -1
  111. package/dist/components/feedback/ErrorSummary/ErrorSummary.module.css.cjs.js +0 -1
  112. package/dist/components/feedback/Progress/Progress.cjs.js +0 -1
  113. package/dist/components/feedback/Progress/Progress.module.css.cjs.js +0 -1
  114. package/dist/components/feedback/Skeleton/Skeleton.cjs.js +0 -1
  115. package/dist/components/feedback/Skeleton/Skeleton.module.css.cjs.js +0 -1
  116. package/dist/components/feedback/Spinner/Spinner.cjs.js +0 -1
  117. package/dist/components/feedback/Spinner/Spinner.module.css.cjs.js +0 -1
  118. package/dist/components/feedback/Toast/Toast.cjs.js +0 -1
  119. package/dist/components/feedback/Toast/Toast.module.css.cjs.js +0 -1
  120. package/dist/components/feedback/Toast/Toast.storyHelpers.d.ts +0 -21
  121. package/dist/components/feedback/Toast/ToastItem.cjs.js +0 -1
  122. package/dist/components/feedback/Toast/ToastItem.d.ts +0 -18
  123. package/dist/components/feedback/Toast/ToastProvider.cjs.js +0 -1
  124. package/dist/components/feedback/Toast/ToastViewport.cjs.js +0 -1
  125. package/dist/components/feedback/Toast/ToastViewport.d.ts +0 -25
  126. package/dist/components/feedback/Toast/toastStore.cjs.js +0 -1
  127. package/dist/components/feedback/Toast/toastTiming.cjs.js +0 -1
  128. package/dist/components/feedback/Toast/toastTypes.d.ts +0 -136
  129. package/dist/components/feedback/Toast/useToast.cjs.js +0 -1
  130. package/dist/components/feedback/Toast/useToastAnnouncer.cjs.js +0 -1
  131. package/dist/components/feedback/Toast/useToastAnnouncer.d.ts +0 -15
  132. package/dist/components/forms/CheckBox/CheckBox.cjs.js +0 -1
  133. package/dist/components/forms/CheckBox/CheckBox.d.ts +0 -87
  134. package/dist/components/forms/CheckBox/CheckBox.module.css.cjs.js +0 -1
  135. package/dist/components/forms/ColorPicker/ColorInput.cjs.js +0 -1
  136. package/dist/components/forms/ColorPicker/ColorInput.d.ts +0 -38
  137. package/dist/components/forms/ColorPicker/ColorPicker.cjs.js +0 -1
  138. package/dist/components/forms/ColorPicker/ColorPicker.d.ts +0 -129
  139. package/dist/components/forms/ColorPicker/ColorPicker.module.css.cjs.js +0 -1
  140. package/dist/components/forms/ColorPicker/colorUtils.cjs.js +0 -1
  141. package/dist/components/forms/ColorPicker/colorUtils.d.ts +0 -86
  142. package/dist/components/forms/Combobox/Combobox.cjs.js +0 -1
  143. package/dist/components/forms/Combobox/Combobox.d.ts +0 -172
  144. package/dist/components/forms/Combobox/Combobox.module.css.cjs.js +0 -1
  145. package/dist/components/forms/Combobox/ComboboxPopup.cjs.js +0 -1
  146. package/dist/components/forms/Combobox/ComboboxPopup.d.ts +0 -40
  147. package/dist/components/forms/Combobox/comboboxUtils.cjs.js +0 -1
  148. package/dist/components/forms/Combobox/comboboxUtils.d.ts +0 -73
  149. package/dist/components/forms/DatePicker/Calendar.cjs.js +0 -1
  150. package/dist/components/forms/DatePicker/Calendar.d.ts +0 -98
  151. package/dist/components/forms/DatePicker/Calendar.module.css.cjs.js +0 -1
  152. package/dist/components/forms/DatePicker/DatePicker.cjs.js +0 -1
  153. package/dist/components/forms/DatePicker/DatePicker.d.ts +0 -100
  154. package/dist/components/forms/DatePicker/DatePicker.module.css.cjs.js +0 -1
  155. package/dist/components/forms/DatePicker/DateRangePicker.cjs.js +0 -1
  156. package/dist/components/forms/DatePicker/DateRangePicker.d.ts +0 -124
  157. package/dist/components/forms/DatePicker/DateRangePicker.module.css.cjs.js +0 -1
  158. package/dist/components/forms/DatePicker/dateUtils.cjs.js +0 -1
  159. package/dist/components/forms/DatePicker/dateUtils.d.ts +0 -88
  160. package/dist/components/forms/DateTimePicker/DateTimePicker.cjs.js +0 -1
  161. package/dist/components/forms/DateTimePicker/DateTimePicker.d.ts +0 -101
  162. package/dist/components/forms/DateTimePicker/DateTimePicker.module.css.cjs.js +0 -1
  163. package/dist/components/forms/Field/Field.cjs.js +0 -1
  164. package/dist/components/forms/Field/Field.d.ts +0 -171
  165. package/dist/components/forms/Field/Field.module.css.cjs.js +0 -1
  166. package/dist/components/forms/Field/FieldContext.cjs.js +0 -1
  167. package/dist/components/forms/Field/FieldContext.d.ts +0 -74
  168. package/dist/components/forms/FileUpload/FileUpload.cjs.js +0 -1
  169. package/dist/components/forms/FileUpload/FileUpload.d.ts +0 -153
  170. package/dist/components/forms/FileUpload/FileUpload.module.css.cjs.js +0 -1
  171. package/dist/components/forms/Input/Input.cjs.js +0 -1
  172. package/dist/components/forms/Input/Input.d.ts +0 -98
  173. package/dist/components/forms/Input/Input.module.css.cjs.js +0 -1
  174. package/dist/components/forms/NumberInput/NumberInput.cjs.js +0 -1
  175. package/dist/components/forms/NumberInput/NumberInput.d.ts +0 -87
  176. package/dist/components/forms/NumberInput/NumberInput.module.css.cjs.js +0 -1
  177. package/dist/components/forms/PasswordInput/PasswordInput.cjs.js +0 -1
  178. package/dist/components/forms/PasswordInput/PasswordInput.d.ts +0 -117
  179. package/dist/components/forms/PasswordInput/PasswordInput.module.css.cjs.js +0 -1
  180. package/dist/components/forms/PinInput/PinInput.cjs.js +0 -1
  181. package/dist/components/forms/PinInput/PinInput.d.ts +0 -92
  182. package/dist/components/forms/PinInput/PinInput.module.css.cjs.js +0 -1
  183. package/dist/components/forms/Radio/Radio.cjs.js +0 -1
  184. package/dist/components/forms/Radio/Radio.d.ts +0 -119
  185. package/dist/components/forms/Radio/Radio.module.css.cjs.js +0 -1
  186. package/dist/components/forms/Rating/Rating.cjs.js +0 -1
  187. package/dist/components/forms/Rating/Rating.d.ts +0 -128
  188. package/dist/components/forms/Rating/Rating.module.css.cjs.js +0 -1
  189. package/dist/components/forms/SearchInput/SearchInput.cjs.js +0 -1
  190. package/dist/components/forms/SearchInput/SearchInput.d.ts +0 -124
  191. package/dist/components/forms/SearchInput/SearchInput.module.css.cjs.js +0 -1
  192. package/dist/components/forms/SegmentedControl/SegmentedControl.cjs.js +0 -1
  193. package/dist/components/forms/SegmentedControl/SegmentedControl.d.ts +0 -120
  194. package/dist/components/forms/SegmentedControl/SegmentedControl.module.css.cjs.js +0 -1
  195. package/dist/components/forms/Select/Select.cjs.js +0 -1
  196. package/dist/components/forms/Select/Select.d.ts +0 -86
  197. package/dist/components/forms/Select/Select.module.css.cjs.js +0 -1
  198. package/dist/components/forms/Slider/Slider.cjs.js +0 -1
  199. package/dist/components/forms/Slider/Slider.d.ts +0 -84
  200. package/dist/components/forms/Slider/Slider.module.css.cjs.js +0 -1
  201. package/dist/components/forms/Switch/Switch.cjs.js +0 -1
  202. package/dist/components/forms/Switch/Switch.d.ts +0 -62
  203. package/dist/components/forms/Switch/Switch.module.css.cjs.js +0 -1
  204. package/dist/components/forms/TagInput/TagInput.cjs.js +0 -1
  205. package/dist/components/forms/TagInput/TagInput.d.ts +0 -144
  206. package/dist/components/forms/TagInput/TagInput.module.css.cjs.js +0 -1
  207. package/dist/components/forms/Textarea/Textarea.cjs.js +0 -1
  208. package/dist/components/forms/Textarea/Textarea.d.ts +0 -62
  209. package/dist/components/forms/Textarea/Textarea.module.css.cjs.js +0 -1
  210. package/dist/components/forms/TimePicker/TimePicker.cjs.js +0 -1
  211. package/dist/components/forms/TimePicker/TimePicker.d.ts +0 -116
  212. package/dist/components/forms/TimePicker/TimePicker.module.css.cjs.js +0 -1
  213. package/dist/components/forms/TimePicker/timeUtils.cjs.js +0 -1
  214. package/dist/components/forms/TimePicker/timeUtils.d.ts +0 -26
  215. package/dist/components/forms/ToggleGroup/ToggleGroup.cjs.js +0 -1
  216. package/dist/components/forms/ToggleGroup/ToggleGroup.d.ts +0 -153
  217. package/dist/components/forms/ToggleGroup/ToggleGroup.module.css.cjs.js +0 -1
  218. package/dist/components/layout/Box/Box.cjs.js +0 -1
  219. package/dist/components/layout/Box/Box.module.css.cjs.js +0 -1
  220. package/dist/components/layout/Container/Container.cjs.js +0 -1
  221. package/dist/components/layout/Container/Container.module.css.cjs.js +0 -1
  222. package/dist/components/layout/Divider/Divider.cjs.js +0 -1
  223. package/dist/components/layout/Divider/Divider.module.css.cjs.js +0 -1
  224. package/dist/components/layout/Flex/Flex.cjs.js +0 -1
  225. package/dist/components/layout/Flex/Flex.module.css.cjs.js +0 -1
  226. package/dist/components/layout/Grid/Grid.cjs.js +0 -1
  227. package/dist/components/layout/Grid/Grid.module.css.cjs.js +0 -1
  228. package/dist/components/layout/ResizablePanels/ResizablePanels.cjs.js +0 -1
  229. package/dist/components/layout/ResizablePanels/ResizablePanels.module.css.cjs.js +0 -1
  230. package/dist/components/layout/ScrollArea/ScrollArea.cjs.js +0 -1
  231. package/dist/components/layout/ScrollArea/ScrollArea.module.css.cjs.js +0 -1
  232. package/dist/components/layout/Stack/Stack.cjs.js +0 -1
  233. package/dist/components/layout/Stack/Stack.module.css.cjs.js +0 -1
  234. package/dist/components/navigation/Breadcrumbs/Breadcrumbs.cjs.js +0 -1
  235. package/dist/components/navigation/Breadcrumbs/Breadcrumbs.module.css.cjs.js +0 -1
  236. package/dist/components/navigation/ContextMenu/ContextMenu.cjs.js +0 -1
  237. package/dist/components/navigation/ContextMenu/ContextMenu.module.css.cjs.js +0 -1
  238. package/dist/components/navigation/Link/Link.cjs.js +0 -1
  239. package/dist/components/navigation/Link/Link.module.css.cjs.js +0 -1
  240. package/dist/components/navigation/Menu/Menu.cjs.js +0 -1
  241. package/dist/components/navigation/Menu/Menu.module.css.cjs.js +0 -1
  242. package/dist/components/navigation/Menu/MenuContent.cjs.js +0 -1
  243. package/dist/components/navigation/Menu/MenuContent.d.ts +0 -46
  244. package/dist/components/navigation/Menu/MenuContext.cjs.js +0 -1
  245. package/dist/components/navigation/Menu/MenuContext.d.ts +0 -84
  246. package/dist/components/navigation/Menu/MenuItem.cjs.js +0 -1
  247. package/dist/components/navigation/Menu/MenuItem.d.ts +0 -133
  248. package/dist/components/navigation/Menu/MenuSub.cjs.js +0 -1
  249. package/dist/components/navigation/Menu/MenuSub.d.ts +0 -28
  250. package/dist/components/navigation/Menu/useMenuRoot.cjs.js +0 -1
  251. package/dist/components/navigation/Menu/useMenuRoot.d.ts +0 -14
  252. package/dist/components/navigation/Navbar/Navbar.cjs.js +0 -1
  253. package/dist/components/navigation/Navbar/Navbar.module.css.cjs.js +0 -1
  254. package/dist/components/navigation/Pagination/Pagination.cjs.js +0 -1
  255. package/dist/components/navigation/Pagination/Pagination.d.ts +0 -97
  256. package/dist/components/navigation/Pagination/Pagination.module.css.cjs.js +0 -1
  257. package/dist/components/navigation/Sidebar/Sidebar.cjs.js +0 -1
  258. package/dist/components/navigation/Sidebar/Sidebar.module.css.cjs.js +0 -1
  259. package/dist/components/navigation/Sidebar/Sidebar.storyHelpers.d.ts +0 -27
  260. package/dist/components/navigation/Sidebar/SidebarContext.cjs.js +0 -1
  261. package/dist/components/navigation/Sidebar/SidebarContext.d.ts +0 -45
  262. package/dist/components/navigation/Sidebar/SidebarParts.cjs.js +0 -1
  263. package/dist/components/navigation/Sidebar/SidebarParts.d.ts +0 -179
  264. package/dist/components/navigation/SkipLink/SkipLink.cjs.js +0 -1
  265. package/dist/components/navigation/SkipLink/SkipLink.d.ts +0 -41
  266. package/dist/components/navigation/SkipLink/SkipLink.module.css.cjs.js +0 -1
  267. package/dist/components/navigation/Stepper/Stepper.cjs.js +0 -1
  268. package/dist/components/navigation/Stepper/Stepper.module.css.cjs.js +0 -1
  269. package/dist/components/navigation/Tabs/Tabs.cjs.js +0 -1
  270. package/dist/components/navigation/Tabs/Tabs.d.ts +0 -132
  271. package/dist/components/navigation/Tabs/Tabs.module.css.cjs.js +0 -1
  272. package/dist/components/overlays/CommandPalette/CommandPalette.cjs.js +0 -1
  273. package/dist/components/overlays/CommandPalette/CommandPalette.module.css.cjs.js +0 -1
  274. package/dist/components/overlays/CommandPalette/CommandPaletteContext.cjs.js +0 -1
  275. package/dist/components/overlays/CommandPalette/CommandPaletteContext.d.ts +0 -96
  276. package/dist/components/overlays/CommandPalette/CommandPaletteParts.cjs.js +0 -1
  277. package/dist/components/overlays/CommandPalette/CommandPaletteParts.d.ts +0 -115
  278. package/dist/components/overlays/CommandPalette/commandPaletteUtils.cjs.js +0 -1
  279. package/dist/components/overlays/CommandPalette/commandPaletteUtils.d.ts +0 -50
  280. package/dist/components/overlays/Drawer/Drawer.cjs.js +0 -1
  281. package/dist/components/overlays/Drawer/Drawer.module.css.cjs.js +0 -1
  282. package/dist/components/overlays/Drawer/Drawer.storyHelpers.d.ts +0 -16
  283. package/dist/components/overlays/Drawer/DrawerContent.cjs.js +0 -1
  284. package/dist/components/overlays/Drawer/DrawerContent.d.ts +0 -27
  285. package/dist/components/overlays/Drawer/DrawerContext.cjs.js +0 -1
  286. package/dist/components/overlays/Drawer/DrawerContext.d.ts +0 -39
  287. package/dist/components/overlays/Drawer/DrawerParts.cjs.js +0 -1
  288. package/dist/components/overlays/Drawer/DrawerParts.d.ts +0 -65
  289. package/dist/components/overlays/Drawer/internal.cjs.js +0 -1
  290. package/dist/components/overlays/Drawer/internal.d.ts +0 -1
  291. package/dist/components/overlays/Drawer/useDragToClose.cjs.js +0 -1
  292. package/dist/components/overlays/Drawer/useDragToClose.d.ts +0 -28
  293. package/dist/components/overlays/HoverCard/HoverCard.cjs.js +0 -1
  294. package/dist/components/overlays/HoverCard/HoverCard.module.css.cjs.js +0 -1
  295. package/dist/components/overlays/Modal/ConfirmModal.cjs.js +0 -1
  296. package/dist/components/overlays/Modal/Modal.cjs.js +0 -1
  297. package/dist/components/overlays/Modal/Modal.module.css.cjs.js +0 -1
  298. package/dist/components/overlays/Modal/ModalContent.cjs.js +0 -1
  299. package/dist/components/overlays/Modal/ModalContent.d.ts +0 -12
  300. package/dist/components/overlays/Modal/ModalContext.cjs.js +0 -1
  301. package/dist/components/overlays/Modal/ModalContext.d.ts +0 -56
  302. package/dist/components/overlays/Modal/useScrollRegion.cjs.js +0 -1
  303. package/dist/components/overlays/Modal/useScrollRegion.d.ts +0 -7
  304. package/dist/components/overlays/Popover/Popover.cjs.js +0 -1
  305. package/dist/components/overlays/Popover/Popover.module.css.cjs.js +0 -1
  306. package/dist/components/overlays/Popover/PopoverContent.cjs.js +0 -1
  307. package/dist/components/overlays/Popover/PopoverContent.d.ts +0 -41
  308. package/dist/components/overlays/Popover/PopoverContext.cjs.js +0 -1
  309. package/dist/components/overlays/Popover/PopoverContext.d.ts +0 -38
  310. package/dist/components/overlays/Tooltip/Tooltip.cjs.js +0 -1
  311. package/dist/components/overlays/Tooltip/Tooltip.module.css.cjs.js +0 -1
  312. package/dist/components/primitives/Button/Button.cjs.js +0 -1
  313. package/dist/components/primitives/Button/Button.module.css.cjs.js +0 -1
  314. package/dist/components/primitives/Icon/Icon.cjs.js +0 -1
  315. package/dist/components/primitives/Icon/Icon.module.css.cjs.js +0 -1
  316. package/dist/components/primitives/Icon/IconSvg.cjs.js +0 -1
  317. package/dist/components/primitives/Icon/IconSvg.d.ts +0 -31
  318. package/dist/components/primitives/Icon/icons.cjs.js +0 -1
  319. package/dist/components/primitives/Kbd/Kbd.cjs.js +0 -1
  320. package/dist/components/primitives/Kbd/Kbd.module.css.cjs.js +0 -1
  321. package/dist/components/primitives/Typography/Typography.cjs.js +0 -1
  322. package/dist/components/primitives/Typography/Typography.module.css.cjs.js +0 -1
  323. package/dist/components/utilities/LocaleProvider/LocaleProvider.cjs.js +0 -1
  324. package/dist/components/utilities/LocaleProvider/LocaleProvider.module.css.cjs.js +0 -1
  325. package/dist/components/utilities/Portal/Portal.cjs.js +0 -1
  326. package/dist/components/utilities/Theme/Theme.cjs.js +0 -1
  327. package/dist/components/utilities/Theme/Theme.module.css.cjs.js +0 -1
  328. package/dist/components/utilities/VisuallyHidden/VisuallyHidden.cjs.js +0 -1
  329. package/dist/components/utilities/VisuallyHidden/VisuallyHidden.module.css.cjs.js +0 -1
  330. package/dist/hooks/elementSource.cjs.js +0 -1
  331. package/dist/hooks/elementSource.d.ts +0 -16
  332. package/dist/hooks/index.d.ts +0 -21
  333. package/dist/hooks/useClipboard.cjs.js +0 -1
  334. package/dist/hooks/useClipboard.d.ts +0 -24
  335. package/dist/hooks/useControllableState.cjs.js +0 -1
  336. package/dist/hooks/useControllableState.d.ts +0 -15
  337. package/dist/hooks/useDisclosure.cjs.js +0 -1
  338. package/dist/hooks/useDisclosure.d.ts +0 -35
  339. package/dist/hooks/useDismiss.cjs.js +0 -1
  340. package/dist/hooks/useDismiss.d.ts +0 -33
  341. package/dist/hooks/useElementObservers.cjs.js +0 -1
  342. package/dist/hooks/useElementObservers.d.ts +0 -70
  343. package/dist/hooks/useEnvironment.cjs.js +0 -1
  344. package/dist/hooks/useEnvironment.d.ts +0 -42
  345. package/dist/hooks/useFloatingPosition.cjs.js +0 -1
  346. package/dist/hooks/useFloatingPosition.d.ts +0 -55
  347. package/dist/hooks/useFocusTrap.cjs.js +0 -1
  348. package/dist/hooks/useFocusTrap.d.ts +0 -52
  349. package/dist/hooks/useFormReset.cjs.js +0 -1
  350. package/dist/hooks/useFormReset.d.ts +0 -17
  351. package/dist/hooks/useFormValidation.cjs.js +0 -1
  352. package/dist/hooks/useFormValidation.d.ts +0 -101
  353. package/dist/hooks/useHotkeys.cjs.js +0 -1
  354. package/dist/hooks/useHotkeys.d.ts +0 -50
  355. package/dist/hooks/useInertOutside.cjs.js +0 -1
  356. package/dist/hooks/useInertOutside.d.ts +0 -23
  357. package/dist/hooks/useMediaQuery.cjs.js +0 -1
  358. package/dist/hooks/useMediaQuery.d.ts +0 -11
  359. package/dist/hooks/useMergedRef.cjs.js +0 -1
  360. package/dist/hooks/useMergedRef.d.ts +0 -7
  361. package/dist/hooks/useOverlayLayer.cjs.js +0 -1
  362. package/dist/hooks/useOverlayLayer.d.ts +0 -92
  363. package/dist/hooks/useResponsiveValue.cjs.js +0 -1
  364. package/dist/hooks/useResponsiveValue.d.ts +0 -10
  365. package/dist/hooks/useScrollLock.cjs.js +0 -1
  366. package/dist/hooks/useScrollLock.d.ts +0 -4
  367. package/dist/hooks/useStorage.cjs.js +0 -1
  368. package/dist/hooks/useStorage.d.ts +0 -21
  369. package/dist/hooks/useTiming.cjs.js +0 -1
  370. package/dist/hooks/useTiming.d.ts +0 -78
  371. package/dist/hooks/useVirtualizer.cjs.js +0 -1
  372. package/dist/hooks/useVirtualizer.d.ts +0 -90
  373. package/dist/i18n/en.cjs.js +0 -1
  374. package/dist/i18n/en.d.ts +0 -3
  375. package/dist/i18n/index.d.ts +0 -4
  376. package/dist/i18n/locales/ar.d.ts +0 -3
  377. package/dist/i18n/locales/bn.d.ts +0 -3
  378. package/dist/i18n/locales/cs.d.ts +0 -3
  379. package/dist/i18n/locales/da.d.ts +0 -3
  380. package/dist/i18n/locales/de.d.ts +0 -3
  381. package/dist/i18n/locales/el.d.ts +0 -3
  382. package/dist/i18n/locales/es.d.ts +0 -3
  383. package/dist/i18n/locales/fa.d.ts +0 -3
  384. package/dist/i18n/locales/fi.d.ts +0 -3
  385. package/dist/i18n/locales/fr.d.ts +0 -3
  386. package/dist/i18n/locales/he.d.ts +0 -3
  387. package/dist/i18n/locales/hi.d.ts +0 -3
  388. package/dist/i18n/locales/hu.d.ts +0 -3
  389. package/dist/i18n/locales/id.d.ts +0 -3
  390. package/dist/i18n/locales/it.d.ts +0 -3
  391. package/dist/i18n/locales/ja.d.ts +0 -3
  392. package/dist/i18n/locales/ko.d.ts +0 -3
  393. package/dist/i18n/locales/nb.d.ts +0 -3
  394. package/dist/i18n/locales/nl.d.ts +0 -3
  395. package/dist/i18n/locales/pl.d.ts +0 -3
  396. package/dist/i18n/locales/pt-BR.d.ts +0 -3
  397. package/dist/i18n/locales/ro.d.ts +0 -3
  398. package/dist/i18n/locales/ru.d.ts +0 -3
  399. package/dist/i18n/locales/sv.d.ts +0 -3
  400. package/dist/i18n/locales/th.d.ts +0 -3
  401. package/dist/i18n/locales/tr.d.ts +0 -3
  402. package/dist/i18n/locales/uk.d.ts +0 -3
  403. package/dist/i18n/locales/ur.d.ts +0 -3
  404. package/dist/i18n/locales/vi.d.ts +0 -3
  405. package/dist/i18n/locales/zh-Hans.d.ts +0 -3
  406. package/dist/i18n/locales/zh-Hant.d.ts +0 -3
  407. package/dist/i18n/merge.cjs.js +0 -1
  408. package/dist/i18n/merge.d.ts +0 -6
  409. package/dist/i18n/plural.cjs.js +0 -1
  410. package/dist/i18n/plural.d.ts +0 -45
  411. package/dist/i18n/types.d.ts +0 -1160
  412. package/dist/index.cjs.js +0 -1
  413. package/dist/index.d.ts +0 -83
  414. package/dist/locales/ar.cjs.js +0 -1
  415. package/dist/locales/ar.d.ts +0 -6
  416. package/dist/locales/bn.cjs.js +0 -1
  417. package/dist/locales/bn.d.ts +0 -6
  418. package/dist/locales/cs.cjs.js +0 -1
  419. package/dist/locales/cs.d.ts +0 -6
  420. package/dist/locales/da.cjs.js +0 -1
  421. package/dist/locales/da.d.ts +0 -6
  422. package/dist/locales/de.cjs.js +0 -1
  423. package/dist/locales/de.d.ts +0 -6
  424. package/dist/locales/el.cjs.js +0 -1
  425. package/dist/locales/el.d.ts +0 -6
  426. package/dist/locales/es.cjs.js +0 -1
  427. package/dist/locales/es.d.ts +0 -6
  428. package/dist/locales/fa.cjs.js +0 -1
  429. package/dist/locales/fa.d.ts +0 -6
  430. package/dist/locales/fi.cjs.js +0 -1
  431. package/dist/locales/fi.d.ts +0 -6
  432. package/dist/locales/fr.cjs.js +0 -1
  433. package/dist/locales/fr.d.ts +0 -6
  434. package/dist/locales/he.cjs.js +0 -1
  435. package/dist/locales/he.d.ts +0 -6
  436. package/dist/locales/hi.cjs.js +0 -1
  437. package/dist/locales/hi.d.ts +0 -6
  438. package/dist/locales/hu.cjs.js +0 -1
  439. package/dist/locales/hu.d.ts +0 -6
  440. package/dist/locales/id.cjs.js +0 -1
  441. package/dist/locales/id.d.ts +0 -6
  442. package/dist/locales/it.cjs.js +0 -1
  443. package/dist/locales/it.d.ts +0 -6
  444. package/dist/locales/ja.cjs.js +0 -1
  445. package/dist/locales/ja.d.ts +0 -6
  446. package/dist/locales/ko.cjs.js +0 -1
  447. package/dist/locales/ko.d.ts +0 -6
  448. package/dist/locales/nb.cjs.js +0 -1
  449. package/dist/locales/nb.d.ts +0 -6
  450. package/dist/locales/nl.cjs.js +0 -1
  451. package/dist/locales/nl.d.ts +0 -6
  452. package/dist/locales/pl.cjs.js +0 -1
  453. package/dist/locales/pl.d.ts +0 -6
  454. package/dist/locales/pt-BR.cjs.js +0 -1
  455. package/dist/locales/pt-BR.d.ts +0 -6
  456. package/dist/locales/ro.cjs.js +0 -1
  457. package/dist/locales/ro.d.ts +0 -6
  458. package/dist/locales/ru.cjs.js +0 -1
  459. package/dist/locales/ru.d.ts +0 -6
  460. package/dist/locales/sv.cjs.js +0 -1
  461. package/dist/locales/sv.d.ts +0 -6
  462. package/dist/locales/th.cjs.js +0 -1
  463. package/dist/locales/th.d.ts +0 -6
  464. package/dist/locales/tr.cjs.js +0 -1
  465. package/dist/locales/tr.d.ts +0 -6
  466. package/dist/locales/uk.cjs.js +0 -1
  467. package/dist/locales/uk.d.ts +0 -6
  468. package/dist/locales/ur.cjs.js +0 -1
  469. package/dist/locales/ur.d.ts +0 -6
  470. package/dist/locales/vi.cjs.js +0 -1
  471. package/dist/locales/vi.d.ts +0 -6
  472. package/dist/locales/zh-Hans.cjs.js +0 -1
  473. package/dist/locales/zh-Hans.d.ts +0 -6
  474. package/dist/locales/zh-Hant.cjs.js +0 -1
  475. package/dist/locales/zh-Hant.d.ts +0 -6
  476. package/dist/types/common.cjs.js +0 -1
  477. package/dist/types/common.d.ts +0 -31
  478. package/dist/types/style.d.ts +0 -7
  479. package/dist/utils/announce.cjs.js +0 -1
  480. package/dist/utils/announce.d.ts +0 -1
  481. package/dist/utils/brandPalette.cjs.js +0 -3
  482. package/dist/utils/brandPalette.d.ts +0 -146
  483. package/dist/utils/clipboard.cjs.js +0 -1
  484. package/dist/utils/clipboard.d.ts +0 -6
  485. package/dist/utils/cx.cjs.js +0 -1
  486. package/dist/utils/cx.d.ts +0 -2
  487. package/dist/utils/fillSlot.cjs.js +0 -1
  488. package/dist/utils/fillSlot.d.ts +0 -9
  489. package/dist/utils/flattenChildren.cjs.js +0 -1
  490. package/dist/utils/flattenChildren.d.ts +0 -8
  491. package/dist/utils/hotkeys.cjs.js +0 -1
  492. package/dist/utils/hotkeys.d.ts +0 -27
  493. package/dist/utils/index.d.ts +0 -11
  494. package/dist/utils/intl.cjs.js +0 -1
  495. package/dist/utils/intl.d.ts +0 -10
  496. package/dist/utils/refs.cjs.js +0 -1
  497. package/dist/utils/refs.d.ts +0 -15
  498. package/dist/utils/responsive.cjs.js +0 -1
  499. package/dist/utils/responsive.d.ts +0 -43
  500. package/dist/utils/slot.cjs.js +0 -1
  501. package/dist/utils/slot.d.ts +0 -11
  502. package/dist/utils/validators.cjs.js +0 -1
  503. package/dist/utils/validators.d.ts +0 -72
@@ -1,92 +0,0 @@
1
- import { ComponentPropsWithRef, ReactNode, Ref } from 'react';
2
- import { Radius, Size } from '../../../types/common';
3
- /** Which characters a cell accepts. */
4
- export type PinInputType = "numeric" | "alphanumeric";
5
- /**
6
- * Visual style of the cells, matching `Input`.
7
- * - `outline`: surface background with a visible border (default).
8
- * - `filled`: sunken background with a visible border.
9
- */
10
- export type PinInputVariant = "outline" | "filled";
11
- export interface PinInputProps extends Omit<ComponentPropsWithRef<"input">, "size" | "type" | "value" | "defaultValue" | "children" | "placeholder"> {
12
- /** Number of cells (characters in the code). @default 6 */
13
- length?: number;
14
- /** Controlled value (the whole code as one string). */
15
- value?: string;
16
- /** Initial value when uncontrolled. @default "" */
17
- defaultValue?: string;
18
- /** Called with the new code on every change (typing, deleting, pasting, autofill). */
19
- onValueChange?: (value: string) => void;
20
- /**
21
- * Called with the code when the user fills the last empty cell. Use it to
22
- * verify or auto-submit. Not called for programmatic `value` changes.
23
- */
24
- onComplete?: (value: string) => void;
25
- /**
26
- * Accepted characters. `numeric` sets `inputMode="numeric"` and
27
- * `pattern="[0-9]*"` (numeric keypad on phones); `alphanumeric` accepts
28
- * A-Z, a-z, and 0-9. Other characters (spaces, dashes, ...) are stripped.
29
- * @default "numeric"
30
- */
31
- type?: PinInputType;
32
- /**
33
- * Shows a dot in filled cells instead of the character, for PINs. The input
34
- * becomes `type="password"` so screen readers don't speak the digits.
35
- * @default false
36
- */
37
- mask?: boolean;
38
- /** Character shown in empty cells, such as `"○"` or `"·"`. Decorative. */
39
- placeholder?: string;
40
- /** Cell size and digit size. Inherits from a surrounding `Field`. @default "md" */
41
- size?: Size;
42
- /** Visual style, matching `Input`. @default "outline" */
43
- variant?: PinInputVariant;
44
- /** Cell corner rounding. When omitted, uses `--field-radius`. */
45
- radius?: Radius;
46
- /**
47
- * Marks the code as invalid: sets `aria-invalid` and a danger border on
48
- * every cell. Pair it with a visible error message (a `Field` does this).
49
- * Inherits from a surrounding `Field`. @default false
50
- */
51
- invalid?: boolean;
52
- /**
53
- * Draws a separator between groups of cells. A number splits into groups of
54
- * that size (`3` on a 6-cell code gives 3-3); an array lists the cell counts
55
- * after which a separator appears (`[2, 4]` gives 2-2-2).
56
- */
57
- separator?: number | number[];
58
- /** Content of each separator. Decorative (hidden from assistive technology). @default "–" */
59
- separatorContent?: ReactNode;
60
- /** Class name for the hidden `<input>` element. `className` goes to the wrapper. */
61
- inputClassName?: string;
62
- /** Ref to the `<input>` element that holds the code. */
63
- ref?: Ref<HTMLInputElement>;
64
- }
65
- /**
66
- * A one-time-code or PIN entry shown as a row of cells.
67
- *
68
- * **Built on one real `<input>`.** The whole code lives in a single native
69
- * input that spans the cells with transparent text; the cells only mirror its
70
- * value and caret. That keeps everything the platform does for code fields:
71
- * native paste, `autoComplete="one-time-code"` SMS and email suggestions on
72
- * iOS and Android, password managers, form submission with `name`, and one
73
- * control with one accessible name for assistive technology (instead of six
74
- * "Digit N of 6" fields). The cells are `aria-hidden`.
75
- *
76
- * Typing fills the active cell and moves on; Backspace deletes; Arrow
77
- * Left/Right, Home, and End move between cells; clicking a cell selects it
78
- * so the next key replaces it. Pasting or autofilling a full code fills every
79
- * cell (spaces and dashes are stripped). Paste and autofill are never blocked
80
- * (SC 3.3.8), and there is no timeout (SC 2.2.1).
81
- *
82
- * Give it an accessible name: wrap it in a `Field` (recommended, which also
83
- * wires hint, error, invalid, disabled, and read-only), or pass `aria-label`
84
- * / `aria-labelledby`.
85
- *
86
- * ```tsx
87
- * <Field label="Verification code" hint="We sent a 6-digit code to your email.">
88
- * <PinInput onComplete={verify} />
89
- * </Field>
90
- * ```
91
- */
92
- export declare const PinInput: ({ length, value: valueProp, defaultValue, onValueChange, onComplete, type, mask, placeholder, size, variant, radius, invalid, separator, separatorContent, className, inputClassName, style, ref, id, disabled, required, readOnly, autoComplete, "aria-describedby": ariaDescribedBy, onChange, onFocus, onBlur, onKeyDown, onPaste, onSelect, onClick, ...rest }: PinInputProps) => import("react").JSX.Element;
@@ -1 +0,0 @@
1
- var e=`_root_1be1e_15`,t=`_sm_1be1e_49`,n=`_md_1be1e_63`,r=`_lg_1be1e_77`,i=`_radiusDefault_1be1e_93`,a=`_radiusNone_1be1e_99`,o=`_radiusXs_1be1e_105`,s=`_radiusSm_1be1e_111`,c=`_radiusMd_1be1e_117`,l=`_radiusLg_1be1e_123`,u=`_radiusXl_1be1e_129`,d=`_radius2xl_1be1e_135`,f=`_radiusPill_1be1e_141`,p=`_outline_1be1e_151`,m=`_filled_1be1e_161`,h=`_readOnly_1be1e_173`,g=`_disabled_1be1e_175`,_=`_cells_1be1e_203`,v=`_cell_1be1e_203`,y=`_invalid_1be1e_277`,b=`_focused_1be1e_277`,x=`_char_1be1e_331`,S=`_charFilled_1be1e_343`,C=`_placeholder_1be1e_373`,w=`_caret_1be1e_393`,T=`_separator_1be1e_435`,E=`_input_1be1e_471`,D={root:e,sm:t,md:n,lg:r,radiusDefault:i,radiusNone:a,radiusXs:o,radiusSm:s,radiusMd:c,radiusLg:l,radiusXl:u,radius2xl:d,radiusPill:f,outline:p,filled:m,readOnly:h,disabled:g,cells:_,cell:v,invalid:y,focused:b,char:x,charFilled:S,"pin-pop":`_pin-pop_1be1e_1`,placeholder:C,caret:w,"pin-blink":`_pin-blink_1be1e_1`,separator:T,input:E};exports.caret=w,exports.cell=v,exports.cells=_,exports.char=x,exports.charFilled=S,exports.default=D,exports.disabled=g,exports.filled=m,exports.focused=b,exports.input=E,exports.invalid=y,exports.lg=r,exports.md=n,exports.outline=p,exports.placeholder=C,exports.radius2xl=d,exports.radiusDefault=i,exports.radiusLg=l,exports.radiusMd=c,exports.radiusNone=a,exports.radiusPill=f,exports.radiusSm=s,exports.radiusXl=u,exports.radiusXs=o,exports.readOnly=h,exports.root=e,exports.separator=T,exports.sm=t;
@@ -1 +0,0 @@
1
- "use client";const e=require("../../../hooks/useControllableState.cjs.js"),t=require("../../../hooks/useFormReset.cjs.js"),n=require("../../../utils/cx.cjs.js"),r=require("../../primitives/Icon/Icon.cjs.js"),i=require("../Field/FieldContext.cjs.js"),a=require("./Radio.module.css.cjs.js");let o=require("react"),s=require("react/jsx-runtime");var c={sm:a.default.sm,md:a.default.md,lg:a.default.lg},l={neutral:a.default.toneNeutral,primary:a.default.tonePrimary,accent:a.default.toneAccent,success:a.default.toneSuccess,warning:a.default.toneWarning,danger:a.default.toneDanger,info:a.default.toneInfo},u={vertical:a.default.vertical,horizontal:a.default.horizontal},d=(0,o.createContext)(null);function f(){return(0,o.useContext)(d)}var p=(...e)=>e.filter(Boolean).join(` `)||void 0;function m({value:r,defaultValue:l,onValueChange:f,name:m,orientation:h=`vertical`,size:g,tone:_=`primary`,disabled:v,invalid:y,required:b,label:x,description:S,className:C,children:w,id:T,"aria-describedby":E,"aria-labelledby":D,...O}){let k=i.useFieldContext(),A=(0,o.useId)(),j=`${A}-label`,M=`${A}-description`,N=k!==null,P=!N&&x!=null,F=S!=null,I=i.useFieldControl({id:T,invalid:y,required:b,disabled:v,size:g,"aria-describedby":p(F&&M,E)}),[L,R]=e.useControllableState({value:r,defaultValue:l,onChange:f});t.useFormReset(()=>I.id?document.getElementById(I.id):null,()=>R(l),r===void 0);let z=I.size??`md`,B={name:m??`radio-${A}`,value:L,setValue:R,size:z,tone:_,disabled:I.disabled,invalid:I.invalid,required:I.required,inFieldset:!1},V=k?.isGroup===!0&&D===void 0;B.inFieldset=V,B.itemDescribedBy=V?p(F&&M,E):void 0;let H=D??(N?k.labelId:P?j:void 0),U=V?{"aria-describedby":p(F&&M,E)}:{role:`radiogroup`,"aria-labelledby":H,...I.ariaProps,"aria-disabled":I.disabled||void 0,"aria-required":I.required||void 0};return(0,s.jsx)(d.Provider,{value:B,children:(0,s.jsxs)(`div`,{id:I.id,...U,...O,"data-disabled":I.disabled||void 0,"data-invalid":I.invalid||void 0,className:n.cx(a.default.group,c[z],C),children:[(P||F)&&(0,s.jsxs)(`div`,{className:a.default.groupHeader,children:[P&&(0,s.jsxs)(`span`,{id:j,className:a.default.groupLabel,children:[x,I.required&&(0,s.jsxs)(`span`,{className:a.default.requiredMark,"aria-hidden":`true`,children:[` `,`*`]})]}),F&&(0,s.jsx)(`span`,{id:M,className:a.default.groupDescription,children:S})]}),(0,s.jsx)(`div`,{className:n.cx(a.default.items,u[h]),children:w})]})})}function h(e,t){let n=f(),{onChange:r,invalid:i,disabled:a,name:o,checked:s,required:c,...l}=t,u=!!(a||n?.disabled),d=i??n?.invalid??!1;return{inputProps:{...l,type:`radio`,value:e,name:o??n?.name,disabled:u,required:c??n?.required,"aria-invalid":l[`aria-invalid`]??(d&&(!n||n.inFieldset)?!0:void 0),"aria-describedby":p(l[`aria-describedby`],n?.itemDescribedBy),checked:n?n.value===e:s,onChange:t=>{r?.(t),!t.defaultPrevented&&t.target.checked&&n?.setValue(e)}},disabled:u,invalid:d,group:n}}function g({value:e,label:t,description:r,size:i,tone:u,className:d,style:f,id:m,"aria-describedby":g,..._}){let v=(0,o.useId)(),y=m??v,b=`${y}-description`,x=r!=null,{inputProps:S,disabled:C,invalid:w,group:T}=h(e,{..._,"aria-describedby":p(x&&b,g)}),E=i??T?.size??`md`,D=u??T?.tone??`primary`;return(0,s.jsxs)(`label`,{htmlFor:y,style:f,"data-disabled":C||void 0,"data-invalid":w||void 0,className:n.cx(a.default.radio,c[E],l[D],d),children:[(0,s.jsxs)(`span`,{className:a.default.controlWrap,children:[(0,s.jsx)(`input`,{id:y,className:a.default.input,...S}),(0,s.jsx)(`span`,{className:a.default.control,"aria-hidden":`true`,children:(0,s.jsx)(`span`,{className:a.default.dot})})]}),(t!==void 0||x)&&(0,s.jsxs)(`span`,{className:a.default.text,children:[t!==void 0&&(0,s.jsx)(`span`,{className:a.default.label,children:t}),x&&(0,s.jsx)(`span`,{id:b,className:a.default.description,children:r})]})]})}function _({value:e,title:t,description:i,icon:c,media:u,meta:d,children:f,tone:m,className:g,style:_,id:v,"aria-describedby":y,"aria-labelledby":b,...x}){let S=(0,o.useId)(),C=v??S,w=`${C}-title`,T=`${C}-description`,E=`${C}-meta`,D=i!=null,O=d!=null,{inputProps:k,disabled:A,invalid:j,group:M}=h(e,{...x,"aria-labelledby":b??w,"aria-describedby":p(D&&T,O&&E,y)}),N=m??M?.tone??`primary`;return(0,s.jsxs)(`label`,{htmlFor:C,style:_,"data-disabled":A||void 0,"data-invalid":j||void 0,className:n.cx(a.default.card,l[N],g),children:[u!=null&&(0,s.jsx)(`span`,{className:a.default.cardMedia,children:u}),(0,s.jsxs)(`span`,{className:a.default.cardHeader,children:[c!=null&&(0,s.jsx)(`span`,{className:a.default.cardIcon,"aria-hidden":`true`,children:c}),(0,s.jsxs)(`span`,{className:a.default.cardHeading,children:[(0,s.jsx)(`span`,{id:w,className:a.default.cardTitle,children:t}),D&&(0,s.jsx)(`span`,{id:T,className:a.default.cardDescription,children:i})]}),(0,s.jsxs)(`span`,{className:a.default.cardIndicator,children:[(0,s.jsx)(`input`,{id:C,className:a.default.input,...k}),(0,s.jsx)(`span`,{className:a.default.cardControl,"aria-hidden":`true`,children:(0,s.jsx)(r.Icon,{name:`check`,size:`sm`,strokeWidth:3,className:a.default.cardCheck})})]})]}),O&&(0,s.jsx)(`span`,{id:E,className:a.default.cardMeta,children:d}),f!=null&&(0,s.jsx)(`span`,{className:a.default.cardBody,children:f})]})}exports.Radio=g,exports.RadioCard=_,exports.RadioGroup=m,exports.useRadioGroupContext=f;
@@ -1,119 +0,0 @@
1
- import { ComponentPropsWithRef, ReactNode } from 'react';
2
- import { Orientation, Size, Tone } from '../../../types/common';
3
- interface RadioGroupContextValue {
4
- name: string;
5
- value: string | undefined;
6
- setValue: (value: string) => void;
7
- size: Size;
8
- tone: Tone;
9
- disabled: boolean;
10
- invalid: boolean;
11
- required: boolean;
12
- /**
13
- * Inside a Fieldset the group has no role, so each radio carries the
14
- * group's invalid state and own description instead.
15
- */
16
- inFieldset: boolean;
17
- itemDescribedBy?: string;
18
- }
19
- /** Returns the surrounding RadioGroup's state, or null outside a group. */
20
- export declare function useRadioGroupContext(): RadioGroupContextValue | null;
21
- export interface RadioGroupProps extends Omit<ComponentPropsWithRef<"div">, "defaultValue" | "onChange" | "dir"> {
22
- /** Selected value (controlled). Use with `onValueChange`. */
23
- value?: string;
24
- /** Initially selected value (uncontrolled). Leave unset for no initial selection. */
25
- defaultValue?: string;
26
- /** Called with the newly selected option's `value`. */
27
- onValueChange?: (value: string) => void;
28
- /** Shared `name` for the native radios (used in form submission). Generated with `useId` when omitted. */
29
- name?: string;
30
- /** Layout of the options. Horizontal options wrap onto new lines when space runs out. @default "vertical" */
31
- orientation?: Orientation;
32
- /** Size of every option. Falls back to a surrounding Field's size. @default "md" */
33
- size?: Size;
34
- /** Color of the checked ring and dot. @default "primary" */
35
- tone?: Tone;
36
- /** Disables every option. Falls back to a surrounding Field's state. */
37
- disabled?: boolean;
38
- /** Marks the group invalid: danger borders and `aria-invalid`. Falls back to a surrounding Field's state. */
39
- invalid?: boolean;
40
- /** A selection is required: sets native `required` on the radios and `aria-required` on the group. */
41
- required?: boolean;
42
- /**
43
- * Visible group label, used when the group stands alone. Ignored inside a
44
- * group `Field`/`Fieldset`, whose legend already names the group.
45
- * Without a label, pass `aria-label` or `aria-labelledby`.
46
- */
47
- label?: ReactNode;
48
- /** Help text below the group label, linked with `aria-describedby`. */
49
- description?: ReactNode;
50
- /** `Radio` or `RadioCard` options. May be wrapped in layout (e.g. a Grid of RadioCards). */
51
- children?: ReactNode;
52
- }
53
- /**
54
- * A set of mutually exclusive options. Renders `role="radiogroup"` around
55
- * real native `<input type="radio">` elements that share a `name`, so Tab
56
- * lands on the checked (or first) option, arrow keys move and select, and
57
- * the value submits with a form. Works standalone (with `label`) or inside a
58
- * `Fieldset`/group `Field`, where it picks up the legend, hint, error,
59
- * invalid, required, and disabled state.
60
- */
61
- export declare function RadioGroup({ value: valueProp, defaultValue, onValueChange, name, orientation, size: sizeProp, tone, disabled: disabledProp, invalid: invalidProp, required: requiredProp, label, description, className, children, id: idProp, "aria-describedby": ariaDescribedBy, "aria-labelledby": ariaLabelledBy, ...rest }: RadioGroupProps): import("react").JSX.Element;
62
- type NativeRadioProps = Omit<ComponentPropsWithRef<"input">, "type" | "size" | "value" | "children" | "title">;
63
- export interface RadioProps extends NativeRadioProps {
64
- /** Value submitted with the form and reported by `RadioGroup`'s `onValueChange`. */
65
- value: string;
66
- /** Visible label. The whole label is clickable. Without one, pass `aria-label`. */
67
- label?: ReactNode;
68
- /** Supporting text under the label, linked with `aria-describedby`. */
69
- description?: ReactNode;
70
- /** Disables this option (the group's `disabled` also applies). */
71
- disabled?: boolean;
72
- /** Size. Inherits the group's size. @default "md" */
73
- size?: Size;
74
- /** Checked color. Inherits the group's tone. @default "primary" */
75
- tone?: Tone;
76
- /** Invalid styling. Inherits the group's state. */
77
- invalid?: boolean;
78
- /** Class for the outer label element. The `ref` and other native props go to the input. */
79
- className?: string;
80
- }
81
- /**
82
- * A single option in a `RadioGroup`: a native radio (visually hidden but
83
- * focusable) with a custom ring-and-dot indicator and a clickable label.
84
- * `ref` points at the `<input>`. Outside a group it behaves like a plain
85
- * native radio (`name`, `checked`/`defaultChecked`).
86
- */
87
- export declare function Radio({ value, label, description, size: sizeProp, tone: toneProp, className, style, id: idProp, "aria-describedby": ariaDescribedBy, ...props }: RadioProps): import("react").JSX.Element;
88
- export interface RadioCardProps extends NativeRadioProps {
89
- /** Value submitted with the form and reported by `RadioGroup`'s `onValueChange`. */
90
- value: string;
91
- /** Card title, in the display font. Becomes the radio's accessible name. */
92
- title: ReactNode;
93
- /** Supporting text under the title, linked with `aria-describedby`. */
94
- description?: ReactNode;
95
- /** Decorative icon shown in a tinted tile at the start of the header (e.g. `<Icon name="star" />`). */
96
- icon?: ReactNode;
97
- /** Media (e.g. an `<img>`) shown full-bleed at the top of the card. Give images empty `alt` if decorative. */
98
- media?: ReactNode;
99
- /** Price or meta slot, shown prominently under the description (e.g. `"$29 / mo"`). Linked with `aria-describedby`. */
100
- meta?: ReactNode;
101
- /** Extra content at the bottom of the card (e.g. a feature list). Not part of the accessible name. */
102
- children?: ReactNode;
103
- /** Disables this option (the group's `disabled` also applies). */
104
- disabled?: boolean;
105
- /** Selected ring and indicator color. Inherits the group's tone. @default "primary" */
106
- tone?: Tone;
107
- /** Invalid styling. Inherits the group's state. */
108
- invalid?: boolean;
109
- /** Class for the card (label) element. The `ref` and other native props go to the input. */
110
- className?: string;
111
- }
112
- /**
113
- * A large, card-style radio option. The whole card is the `<label>`, with a
114
- * native radio underneath, so keyboard, form, and screen reader behavior
115
- * match `Radio`. When checked, the card shows a ring and the indicator turns
116
- * into a filled check (shape, not color alone).
117
- */
118
- export declare function RadioCard({ value, title, description, icon, media, meta, children, tone: toneProp, className, style, id: idProp, "aria-describedby": ariaDescribedBy, "aria-labelledby": ariaLabelledBy, ...props }: RadioCardProps): import("react").JSX.Element;
119
- export {};
@@ -1 +0,0 @@
1
- var e=`_sm_1oena_33`,t=`_md_1oena_43`,n=`_lg_1oena_53`,r=`_tonePrimary_1oena_69`,i=`_toneNeutral_1oena_75`,a=`_toneAccent_1oena_81`,o=`_toneSuccess_1oena_87`,s=`_toneWarning_1oena_93`,c=`_toneDanger_1oena_99`,l=`_toneInfo_1oena_105`,u=`_group_1oena_121`,d=`_groupHeader_1oena_137`,f=`_groupLabel_1oena_149`,p=`_requiredMark_1oena_165`,m=`_groupDescription_1oena_173`,h=`_items_1oena_195`,g=`_vertical_1oena_205`,_=`_horizontal_1oena_215`,v=`_input_1oena_239`,y=`_radio_1oena_271`,b=`_controlWrap_1oena_297`,x=`_control_1oena_297`,S=`_dot_1oena_343`,C=`_text_1oena_361`,w=`_label_1oena_379`,T=`_description_1oena_391`,E=`_card_1oena_505`,D=`_cardIndicator_1oena_551`,O=`_cardMedia_1oena_591`,k=`_cardHeader_1oena_621`,A=`_cardIcon_1oena_633`,j=`_cardHeading_1oena_655`,M=`_cardTitle_1oena_671`,N=`_cardDescription_1oena_689`,P=`_cardMeta_1oena_701`,F=`_cardBody_1oena_721`,I=`_cardControl_1oena_737`,L=`_cardCheck_1oena_767`,R={sm:e,md:t,lg:n,tonePrimary:r,toneNeutral:i,toneAccent:a,toneSuccess:o,toneWarning:s,toneDanger:c,toneInfo:l,group:u,groupHeader:d,groupLabel:f,requiredMark:p,groupDescription:m,items:h,vertical:g,horizontal:_,input:v,radio:y,controlWrap:b,control:x,dot:S,text:C,label:w,description:T,card:E,cardIndicator:D,cardMedia:O,cardHeader:k,cardIcon:A,cardHeading:j,cardTitle:M,cardDescription:N,cardMeta:P,cardBody:F,cardControl:I,cardCheck:L};exports.card=E,exports.cardBody=F,exports.cardCheck=L,exports.cardControl=I,exports.cardDescription=N,exports.cardHeader=k,exports.cardHeading=j,exports.cardIcon=A,exports.cardIndicator=D,exports.cardMedia=O,exports.cardMeta=P,exports.cardTitle=M,exports.control=x,exports.controlWrap=b,exports.default=R,exports.description=T,exports.dot=S,exports.group=u,exports.groupDescription=m,exports.groupHeader=d,exports.groupLabel=f,exports.horizontal=_,exports.input=v,exports.items=h,exports.label=w,exports.lg=n,exports.md=t,exports.radio=y,exports.requiredMark=p,exports.sm=e,exports.text=C,exports.toneAccent=a,exports.toneDanger=c,exports.toneInfo=l,exports.toneNeutral=i,exports.tonePrimary=r,exports.toneSuccess=o,exports.toneWarning=s,exports.vertical=g;
@@ -1 +0,0 @@
1
- "use client";const e=require("../../../hooks/useControllableState.cjs.js"),t=require("../../../hooks/useFormReset.cjs.js"),n=require("../../../utils/cx.cjs.js"),r=require("../../../utils/intl.cjs.js"),i=require("../../primitives/Icon/icons.cjs.js"),ee=require("../../utilities/VisuallyHidden/VisuallyHidden.cjs.js"),a=require("../Field/FieldContext.cjs.js"),o=require("./Rating.module.css.cjs.js"),s=require("../../utilities/LocaleProvider/LocaleProvider.cjs.js"),c=require("../../../i18n/en.cjs.js");let l=require("react"),u=require("react/jsx-runtime");var d={sm:o.default.sm,md:o.default.md,lg:o.default.lg},f={sm:o.default.displaySm,md:o.default.displayMd,lg:o.default.displayLg},te={neutral:o.default.toneNeutral,primary:o.default.tonePrimary,accent:o.default.toneAccent,success:o.default.toneSuccess,warning:o.default.toneWarning,danger:o.default.toneDanger,info:o.default.toneInfo},p=(...e)=>e.filter(Boolean).join(` `)||void 0,m=(e,t,n)=>Math.min(n,Math.max(t,e));function h(e,t){let n=Math.round(e*10)/10,i=+!Number.isInteger(n);return r.getNumberFormat(t,{minimumFractionDigits:i,maximumFractionDigits:i}).format(n)}var g=(e,t)=>c.en.rating.option(h(e,`en`),t),_=(e,t)=>c.en.rating.display(h(e,`en`),t),v=e=>c.en.rating.count(e);function y({fill:e,icon:t,emptyIcon:n}){let r=`${Math.round(m(e,0,1)*1e3)/10}%`;return(0,u.jsxs)(`span`,{className:o.default.icon,"aria-hidden":`true`,"data-fill":e>=1?`full`:e>0?`partial`:`empty`,style:{"--rating-fill":r},children:[(0,u.jsx)(`span`,{className:o.default.empty,children:n}),(0,u.jsx)(`span`,{className:o.default.filled,children:t})]})}var b=(0,u.jsx)(i.StarFilledIcon,{}),x=(0,u.jsx)(i.StarIcon,{});function S({value:e,max:t=5,size:r,tone:i=`warning`,icon:ee=b,emptyIcon:c=x,showValue:l=!1,count:d,formatCount:p,getLabel:g,className:_,"aria-label":v,...S}){let{messages:C,locale:w}=s.useLocale(),T=p??C.rating.count,E=g??((e,t)=>C.rating.display(h(e,w),t)),D=a.useFieldContext(),O=r??D?.size??`md`,k=Math.max(1,Math.round(t)),A=m(Number.isFinite(e)?e:0,0,k);return(0,u.jsxs)(`span`,{...S,className:n.cx(o.default.display,f[O],te[i],_),children:[(0,u.jsx)(`span`,{role:`img`,"aria-label":v??E(A,k),className:o.default.icons,children:Array.from({length:k},(e,t)=>(0,u.jsx)(`span`,{className:o.default.displayCell,children:(0,u.jsx)(y,{fill:A-t,icon:ee,emptyIcon:c})},t))}),l&&(0,u.jsxs)(`span`,{className:o.default.valueText,"aria-hidden":`true`,children:[h(A,w),` / `,k]}),d!==void 0&&(0,u.jsx)(`span`,{className:o.default.count,children:T(d)})]})}function C({value:r,defaultValue:i=null,onValueChange:c,max:f=5,precision:g=1,allowZero:_=!1,allowClear:v=!1,clearHint:C,hoverPreview:w=!0,size:T,tone:E=`warning`,icon:D=b,emptyIcon:O=x,showValue:k=!1,disabled:A,readOnly:ne,invalid:re,required:ie,name:j,getLabel:ae,getReadOnlyLabel:oe,unratedLabel:se,label:ce,description:le,className:ue,id:de,onKeyDown:fe,onPointerLeave:pe,"aria-describedby":M,"aria-labelledby":N,...me}){let{messages:P,locale:F}=s.useLocale(),he=C??P.rating.clearHint,ge=ae??((e,t)=>P.rating.option(h(e,F),t)),_e=oe??((e,t)=>P.rating.display(h(e,F),t)),ve=se??P.rating.unrated,I=a.useFieldContext(),L=(0,l.useId)(),R=`${L}-label`,z=`${L}-description`,B=`${L}-clear`,ye=I!==null,V=!ye&&ce!=null,H=le!=null,U=a.useFieldControl({id:de,invalid:re,required:ie,disabled:A,readOnly:ne,size:T,"aria-describedby":p(H&&z,M)}),[W,G]=e.useControllableState({value:r,defaultValue:i,onChange:c});t.useFormReset(()=>U.id?document.getElementById(U.id):null,()=>G(i??null),r===void 0);let[K,be]=(0,l.useState)(null),xe=U.size??`md`,q=Math.max(1,Math.round(f)),J=g===.5?.5:1,Se=j??`rating-${L}`,Ce=!U.disabled&&!U.readOnly,Y=v&&Ce,X=W===null||!Number.isFinite(W)?null:W<J/2?_?0:null:m(Math.round(W/J)*J,J,q),Z=w&&Ce&&K!==null,we=Z?K:X??0,Q=I?.isGroup===!0&&N===void 0,Te=N??(ye?I.labelId:V?R:void 0),Ee=U.readOnly?`group`:`radiogroup`,De=Q?{"aria-describedby":p(H&&z,M)}:{role:Ee,"aria-labelledby":Te,...U.ariaProps,"aria-disabled":U.disabled||void 0,"aria-required":U.required&&!U.readOnly||void 0},Oe=e=>{fe?.(e),!e.defaultPrevented&&Y&&(e.key===`Delete`||e.key===`Backspace`)&&e.target instanceof HTMLInputElement&&(e.preventDefault(),G(null))},ke=e=>{pe?.(e),be(null)},Ae=[];for(let e=J;e<=q+1e-9;e+=J)Ae.push(Math.round(e*10)/10);let $=(e,t)=>{let r=X===e;return(0,u.jsxs)(`span`,{className:n.cx(o.default.hit,o.default[t]),children:[(0,u.jsx)(`input`,{type:`radio`,className:o.default.input,name:Se,value:String(e),checked:r,disabled:U.disabled,required:U.required,"aria-label":ge(e,q),"aria-describedby":Y?B:void 0,"aria-invalid":Q&&U.invalid?!0:void 0,onChange:t=>{t.target.checked&&G(e)},onClick:e=>{Y&&r&&G(null)},onPointerEnter:t=>{w&&t.pointerType!==`touch`&&be(e)}}),(0,u.jsx)(`span`,{className:o.default.focusBox,"aria-hidden":`true`})]},e)},je=Z&&K!==null?Math.ceil(K)-1:-1;return(0,u.jsxs)(`div`,{id:U.id,...De,...me,"data-disabled":U.disabled||void 0,"data-invalid":U.invalid||void 0,"data-readonly":U.readOnly||void 0,"data-precision":J===.5?`half`:`whole`,"data-previewing":Z||void 0,className:n.cx(o.default.rating,d[xe],te[E],ue),onKeyDown:Oe,onPointerLeave:ke,children:[(V||H)&&(0,u.jsxs)(`div`,{className:o.default.header,children:[V&&(0,u.jsxs)(`span`,{id:R,className:o.default.label,children:[ce,U.required&&!U.readOnly&&(0,u.jsxs)(`span`,{className:o.default.requiredMark,"aria-hidden":`true`,children:[` `,`*`]})]}),H&&(0,u.jsx)(`span`,{id:z,className:o.default.description,children:le})]}),(0,u.jsxs)(`div`,{className:o.default.row,children:[U.readOnly?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(S,{value:X??0,max:q,size:xe,tone:E,icon:D,emptyIcon:O,getLabel:_e,"aria-label":X===null?ve:void 0}),j!==void 0&&X!==null&&(0,u.jsx)(`input`,{type:`hidden`,name:j,value:String(X)})]}):(0,u.jsxs)(`div`,{className:o.default.icons,children:[_&&(0,u.jsxs)(`span`,{className:n.cx(o.default.cell,o.default.zeroCell),"data-hovered":Z&&K===0?!0:void 0,children:[(0,u.jsx)(`span`,{className:o.default.zeroMark,"aria-hidden":`true`,children:`0`}),$(0,`whole`)]}),Array.from({length:q},(e,t)=>(0,u.jsxs)(`span`,{className:o.default.cell,"data-hovered":t===je||void 0,children:[(0,u.jsx)(y,{fill:we-t,icon:D,emptyIcon:O}),J===.5?[$(t+.5,`start`),$(t+1,`end`)]:$(t+1,`whole`)]},t))]}),k&&(0,u.jsxs)(`span`,{className:o.default.valueText,"aria-hidden":`true`,children:[X===null?`–`:h(X,F),` / `,q]})]}),Y&&(0,u.jsx)(ee.VisuallyHidden,{id:B,children:he})]})}exports.Rating=C,exports.RatingDisplay=S,exports.defaultRatingCountText=v,exports.defaultRatingDisplayLabel=_,exports.defaultRatingOptionLabel=g,exports.formatRatingValue=h;
@@ -1,128 +0,0 @@
1
- import { ComponentPropsWithRef, ReactNode } from 'react';
2
- import { Size, Tone } from '../../../types/common';
3
- /** Step between selectable values: whole icons, or halves. */
4
- export type RatingPrecision = 1 | 0.5;
5
- /** Formats a rating for display and labels: whole numbers as-is, otherwise one decimal. */
6
- export declare function formatRatingValue(value: number, locale?: string): string;
7
- /** Default accessible name for each option of an interactive `Rating`: "3 out of 5". */
8
- export declare const defaultRatingOptionLabel: (value: number, max: number) => string;
9
- /** Default accessible name for `RatingDisplay`: "Rated 4.5 out of 5". */
10
- export declare const defaultRatingDisplayLabel: (value: number, max: number) => string;
11
- /** Default review count text: "(128 reviews)", "(1 review)". */
12
- export declare const defaultRatingCountText: (count: number) => string;
13
- interface RatingVisualProps {
14
- /** Number of icons (the highest value). @default 5 */
15
- max?: number;
16
- /**
17
- * Icon size. `Rating`: sm 20px, md 24px, lg 32px icons (every hit target
18
- * is still at least 24x24px). `RatingDisplay`: sm 16px, md 20px, lg 24px.
19
- * Falls back to a surrounding Field's size. @default "md"
20
- */
21
- size?: Size;
22
- /**
23
- * Color of the filled icons. Uses each tone's verified `--color-{tone}-border`
24
- * (3:1 on bg, surface, and raised surfaces in both themes). Empty icons are
25
- * outlines in `--color-border-strong`, so filled vs empty differs by shape too.
26
- * @default "warning"
27
- */
28
- tone?: Tone;
29
- /**
30
- * Filled icon (a filled shape, e.g. `<StarFilledIcon />`). It is sized to the
31
- * icon box. Keep it visibly different in *shape* from `emptyIcon`
32
- * (filled vs outline), not only in color. @default <StarFilledIcon />
33
- */
34
- icon?: ReactNode;
35
- /** Empty icon (an outline of the same shape, e.g. `<StarIcon />`). @default <StarIcon /> */
36
- emptyIcon?: ReactNode;
37
- /** Show the numeric value next to the icons, e.g. "4.5 / 5". */
38
- showValue?: boolean;
39
- }
40
- export interface RatingDisplayProps extends RatingVisualProps, Omit<ComponentPropsWithRef<"span">, "children"> {
41
- /** The rating to show. Fractions are drawn exactly: 3.7 fills 70% of the 4th icon. Clamped to 0..`max`. */
42
- value: number;
43
- /** Number of reviews, shown after the icons as "(128 reviews)". */
44
- count?: number;
45
- /** Customizes (or localizes) the review count text. @default "(128 reviews)" */
46
- formatCount?: (count: number) => ReactNode;
47
- /**
48
- * Accessible name of the icon row (`role="img"`). Localize it here.
49
- * An explicit `aria-label` prop wins. @default "Rated 4.5 out of 5"
50
- */
51
- getLabel?: (value: number, max: number) => string;
52
- }
53
- /**
54
- * A read-only rating: a row of icons with fractional fill, exposed to
55
- * assistive tech as a single `role="img"` named "Rated 4.5 out of 5",
56
- * optionally followed by the value ("4.5 / 5") and a review count.
57
- * Not focusable. For an editable rating use `Rating`.
58
- */
59
- export declare function RatingDisplay({ value, max, size: sizeProp, tone, icon, emptyIcon, showValue, count, formatCount: formatCountProp, getLabel: getLabelProp, className, "aria-label": ariaLabel, ...rest }: RatingDisplayProps): import("react").JSX.Element;
60
- export interface RatingProps extends RatingVisualProps, Omit<ComponentPropsWithRef<"div">, "defaultValue" | "onChange" | "children"> {
61
- /** Selected rating (controlled). `null` means no rating. Use with `onValueChange`. */
62
- value?: number | null;
63
- /** Initial rating (uncontrolled). @default null */
64
- defaultValue?: number | null;
65
- /** Called with the new rating, or `null` when cleared. */
66
- onValueChange?: (value: number | null) => void;
67
- /**
68
- * Step between values. `0.5` renders two radios per icon (left and right
69
- * halves). Each half hit area is kept at least 24px wide, so half-precision
70
- * icons sit in 48px-wide cells at every size. @default 1
71
- */
72
- precision?: RatingPrecision;
73
- /**
74
- * Adds a "0" option before the first icon, so zero is a real rating
75
- * ("0 out of 5"), distinct from no rating (`null`). It is the first radio,
76
- * so ArrowLeft from the lowest icon reaches it. @default false
77
- */
78
- allowZero?: boolean;
79
- /**
80
- * Let the user remove their rating: clicking (or pressing Space on) the
81
- * selected value again, or pressing Delete / Backspace, resets it to `null`.
82
- */
83
- allowClear?: boolean;
84
- /**
85
- * Instructions announced with each option when `allowClear` is on. Localize it here.
86
- * @default "Press Space on the selected rating, or Delete, to clear it."
87
- */
88
- clearHint?: string;
89
- /** Highlight icons up to the one under the mouse, with a springy pop. @default true */
90
- hoverPreview?: boolean;
91
- /** Disables every option. Falls back to a surrounding Field's state. */
92
- disabled?: boolean;
93
- /**
94
- * Show the value without allowing changes. Renders the `RatingDisplay`
95
- * look (a single `role="img"`, not focusable) plus a hidden input so the
96
- * value still submits with a form when `name` is set.
97
- */
98
- readOnly?: boolean;
99
- /** Marks the rating invalid: danger outlines and `aria-invalid`. Falls back to a surrounding Field's state. */
100
- invalid?: boolean;
101
- /** A rating is required: sets native `required` on the radios. Falls back to a surrounding Field's state. */
102
- required?: boolean;
103
- /** Shared `name` for the native radios (used in form submission). Generated with `useId` when omitted. */
104
- name?: string;
105
- /** Accessible name of each option. Localize it here. @default "3 out of 5" */
106
- getLabel?: (value: number, max: number) => string;
107
- /** Read-only: accessible name of the rating. Localize it here. @default "Rated 4.5 out of 5" */
108
- getReadOnlyLabel?: (value: number, max: number) => string;
109
- /** Read-only with no value: accessible name, so "unrated" isn't announced as zero. @default "Not rated" */
110
- unratedLabel?: string;
111
- /**
112
- * Visible label, used when the rating stands alone. Ignored inside a
113
- * `Field`/`Fieldset`, whose label or legend names it. Without a label,
114
- * pass `aria-label` or `aria-labelledby`.
115
- */
116
- label?: ReactNode;
117
- /** Help text under the label, linked with `aria-describedby`. */
118
- description?: ReactNode;
119
- }
120
- /**
121
- * An editable star (or custom icon) rating, built on real native radios
122
- * (visually hidden but focusable, sharing one `name`) inside
123
- * `role="radiogroup"`. Tab lands on the selected value (or the first option),
124
- * arrow keys move and select, and the value submits with a form. Supports
125
- * half values, clearing, hover preview, and Field/Fieldset wiring.
126
- */
127
- export declare function Rating({ value: valueProp, defaultValue, onValueChange, max, precision, allowZero, allowClear, clearHint: clearHintProp, hoverPreview, size: sizeProp, tone, icon, emptyIcon, showValue, disabled: disabledProp, readOnly: readOnlyProp, invalid: invalidProp, required: requiredProp, name, getLabel: getLabelProp, getReadOnlyLabel: getReadOnlyLabelProp, unratedLabel: unratedLabelProp, label, description, className, id: idProp, onKeyDown, onPointerLeave, "aria-describedby": ariaDescribedBy, "aria-labelledby": ariaLabelledBy, ...rest }: RatingProps): import("react").JSX.Element;
128
- export {};
@@ -1 +0,0 @@
1
- var e=`_sm_ot4i7_19`,t=`_md_ot4i7_23`,n=`_lg_ot4i7_27`,r=`_displaySm_ot4i7_33`,i=`_displayMd_ot4i7_37`,a=`_displayLg_ot4i7_41`,o=`_toneNeutral_ot4i7_47`,s=`_tonePrimary_ot4i7_50`,c=`_toneAccent_ot4i7_53`,l=`_toneSuccess_ot4i7_56`,u=`_toneWarning_ot4i7_59`,d=`_toneDanger_ot4i7_62`,f=`_toneInfo_ot4i7_65`,p=`_icon_ot4i7_73`,m=`_empty_ot4i7_82`,h=`_filled_ot4i7_83`,g=`_display_ot4i7_33`,_=`_icons_ot4i7_126`,v=`_displayCell_ot4i7_135`,y=`_valueText_ot4i7_139`,b=`_count_ot4i7_149`,x=`_rating_ot4i7_159`,S=`_header_ot4i7_173`,C=`_label_ot4i7_179`,w=`_requiredMark_ot4i7_187`,T=`_description_ot4i7_191`,E=`_row_ot4i7_197`,D=`_cell_ot4i7_207`,O=`_zeroCell_ot4i7_223`,k=`_zeroMark_ot4i7_228`,A=`_input_ot4i7_244`,j=`_pop_ot4i7_1`,M=`_hit_ot4i7_265`,N=`_whole_ot4i7_270`,P=`_start_ot4i7_273`,F=`_end_ot4i7_277`,I=`_focusBox_ot4i7_294`,L={sm:e,md:t,lg:n,displaySm:r,displayMd:i,displayLg:a,toneNeutral:o,tonePrimary:s,toneAccent:c,toneSuccess:l,toneWarning:u,toneDanger:d,toneInfo:f,icon:p,empty:m,filled:h,display:g,icons:_,displayCell:v,valueText:y,count:b,rating:x,header:S,label:C,requiredMark:w,description:T,row:E,cell:D,zeroCell:O,zeroMark:k,input:A,pop:j,hit:M,whole:N,start:P,end:F,focusBox:I};exports.cell=D,exports.count=b,exports.default=L,exports.description=T,exports.display=g,exports.displayCell=v,exports.displayLg=a,exports.displayMd=i,exports.displaySm=r,exports.empty=m,exports.end=F,exports.filled=h,exports.focusBox=I,exports.header=S,exports.hit=M,exports.icon=p,exports.icons=_,exports.input=A,exports.label=C,exports.lg=n,exports.md=t,exports.pop=j,exports.rating=x,exports.requiredMark=w,exports.row=E,exports.sm=e,exports.start=P,exports.toneAccent=c,exports.toneDanger=d,exports.toneInfo=f,exports.toneNeutral=o,exports.tonePrimary=s,exports.toneSuccess=l,exports.toneWarning=u,exports.valueText=y,exports.whole=N,exports.zeroCell=O,exports.zeroMark=k;
@@ -1 +0,0 @@
1
- "use client";const e=require("../../../hooks/useControllableState.cjs.js"),t=require("../../../hooks/useFormReset.cjs.js"),n=require("../../../utils/cx.cjs.js"),r=require("../../../utils/refs.cjs.js"),i=require("../../primitives/Icon/icons.cjs.js"),a=require("../../primitives/Kbd/Kbd.cjs.js"),o=require("../../utilities/VisuallyHidden/VisuallyHidden.cjs.js"),s=require("../Field/FieldContext.cjs.js"),c=require("../Input/Input.cjs.js"),l=require("./SearchInput.module.css.cjs.js"),ee=require("../../utilities/LocaleProvider/LocaleProvider.cjs.js"),u=require("../../../i18n/en.cjs.js");let d=require("react"),f=require("react/jsx-runtime");function te(e,t){let n=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,`value`)?.set;n?n.call(e,t):e.value=t,e.dispatchEvent(new Event(`input`,{bubbles:!0}))}var p=new Set([`checkbox`,`radio`,`button`,`submit`,`reset`,`range`,`color`,`file`,`image`]);function ne(e){return e instanceof HTMLElement?e.isContentEditable||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement?!0:e instanceof HTMLInputElement&&!p.has(e.type):!1}function m(e,t){let n={meta:!1,ctrl:!1,alt:!1,shift:!1,key:``};for(let r of e){let e=r.toLowerCase();e===`mod`?t===`mac`?n.meta=!0:n.ctrl=!0:e===`cmd`||e===`meta`?n.meta=!0:e===`ctrl`?n.ctrl=!0:e===`alt`||e===`option`?n.alt=!0:e===`shift`?n.shift=!0:n.key=e===`esc`?`escape`:e===`space`?` `:e}return n.key?n:null}function re(e,t){if(e.metaKey!==t.meta||e.ctrlKey!==t.ctrl||e.altKey!==t.alt)return!1;let n=/^[a-z]$/.test(t.key);return(t.shift||n)&&e.shiftKey!==t.shift?!1:e.key.toLowerCase()===t.key?!0:n?e.code===`Key${t.key.toUpperCase()}`:/^[0-9]$/.test(t.key)?e.code===`Digit${t.key}`:!1}function ie(e){let t=[];e.ctrl&&t.push(`Control`),e.meta&&t.push(`Meta`),e.alt&&t.push(`Alt`),e.shift&&t.push(`Shift`);let n=e.key===` `?`Space`:e.key===`escape`?`Escape`:e.key;return t.push(n.length===1?n.toUpperCase():n[0].toUpperCase()+n.slice(1)),t.join(`+`)}function h(e){return u.en.searchInput.results(e)}var g=(0,d.createContext)(null),_=({value:u,defaultValue:p=``,onValueChange:h,onSearch:_,debounce:v,minLength:ae=0,onClear:y,clearable:oe=!0,clearLabel:se,blurOnEscape:ce=!0,shortcut:b,shortcutEnabled:le=!0,shortcutPlatform:ue,resultsCount:x,resultsLabel:de,announceDelay:S=700,radius:fe=`pill`,size:C,loading:w=!1,startIcon:T,endIcon:E,endElement:pe,inputClassName:me,autoComplete:he=`off`,enterKeyHint:ge=`search`,disabled:D,readOnly:O,ref:k,onChange:_e,onKeyDown:ve,onFocus:ye,onBlur:be,"aria-label":A,"aria-labelledby":j,"aria-keyshortcuts":xe,...Se})=>{let M=ee.useMessages(),Ce=se??M.searchInput.clear,N=de??M.searchInput.results,[P,F]=e.useControllableState({value:u,defaultValue:p,onChange:h});t.useFormReset(()=>z.current,()=>F(p??``),u===void 0);let I=s.useFieldContext(),L=(0,d.useContext)(g),R=a.useKbdPlatform(ue),z=(0,d.useRef)(null),we=(0,d.useCallback)(e=>{z.current=e,r.assignRef(k,e)},[k]),Te=D??I?.disabled??!1,Ee=O??I?.readOnly??!1,De=C??I?.size??`md`,B=(0,d.useRef)(_);B.current=_;let V=(0,d.useRef)(null),H=(0,d.useRef)(u??p),[U,W]=(0,d.useState)(0),G=()=>{V.current!=null&&clearTimeout(V.current),V.current=null};(0,d.useEffect)(()=>G,[]);let K=e=>{G(),H.current=e,W(e=>e+1),B.current?.(e)},Oe=e=>{v!=null&&(G(),e!==H.current&&(e===``?K(``):e.trim().length<ae||(V.current=setTimeout(()=>{V.current=null,e!==H.current&&K(e)},v))))},q=(0,d.useRef)(P);q.current=P;let J=(0,d.useRef)(K);J.current=K,(0,d.useEffect)(()=>{if(!L)return;let e={search:()=>(J.current(q.current),q.current)};return L.current=e,()=>{L.current===e&&(L.current=null)}},[L]);let Y=(0,d.useRef)(!1),ke=e=>{_e?.(e);let t=e.target.value;F(t),W(e=>e+1),Y.current||Oe(t)},Ae=()=>{let e=z.current;if(e){Y.current=!0;try{te(e,``)}finally{Y.current=!1}G(),v!=null&&H.current!==``&&K(``),y?.()}},je=()=>{G(),y?.()},Me=e=>{if(ve?.(e),!(e.defaultPrevented||e.nativeEvent.isComposing)){if(e.key===`Enter`){let t=e.currentTarget.form;L&&t?(e.preventDefault(),typeof t.requestSubmit==`function`?t.requestSubmit():K(P)):(t&&_&&e.preventDefault(),K(P))}else e.key===`Escape`&&(P!==``&&!Ee?(e.preventDefault(),e.stopPropagation(),Ae()):ce&&e.currentTarget.blur())}},[Ne,X]=(0,d.useState)(!1),Pe=e=>{X(!0),ye?.(e)},Fe=e=>{X(!1),be?.(e)},Ie=b?.join(`+`)??``,Z=b?m(b,R):null,Q=Z!=null&&le&&!Te;(0,d.useEffect)(()=>{if(!Q||!b)return;let e=m(b,R);if(!e)return;let t=t=>{if(t.defaultPrevented||t.isComposing)return;let n=z.current;n&&!n.disabled&&(t.target!==n&&ne(t.target)||re(t,e)&&n.getClientRects().length!==0&&(t.preventDefault(),n.focus(),n.select()))};return document.addEventListener(`keydown`,t),()=>document.removeEventListener(`keydown`,t)},[Q,Ie,R]);let[Le,Re]=(0,d.useState)(!1);(0,d.useEffect)(()=>{let e=(z.current?.labels?.length??0)>0;Re(t=>t===e?t:e)});let ze=!A&&!j&&!I&&!Le,[Be,Ve]=(0,d.useState)(``),He=(0,d.useRef)(N);He.current=N,(0,d.useEffect)(()=>{if(x==null||w||U===0)return;Ve(``);let e=setTimeout(()=>Ve(He.current(x)),S);return()=>clearTimeout(e)},[x,w,U,S]);let $=Q&&!Ne&&P===``&&!w&&b!=null?(0,f.jsx)(a.KbdShortcut,{keys:b,size:De===`lg`?`md`:`sm`,platform:R,className:l.default.hint}):null,Ue=$||E!=null?(0,f.jsxs)(f.Fragment,{children:[$,E]}):void 0;return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(c.Input,{...Se,ref:we,type:`search`,value:P,size:C,radius:fe,loading:w,disabled:D,readOnly:O,autoComplete:he,enterKeyHint:ge,"aria-label":A??(ze?M.searchInput.search:void 0),"aria-labelledby":j,"aria-keyshortcuts":xe??(Q&&Z?ie(Z):void 0),startIcon:T===void 0?(0,f.jsx)(i.SearchIcon,{}):T,endIcon:Ue,endElement:pe,clearable:oe,clearLabel:Ce,onClear:je,inputClassName:n.cx(l.default.input,me),onChange:ke,onKeyDown:Me,onFocus:Pe,onBlur:Fe}),(0,f.jsx)(o.VisuallyHidden,{role:`status`,"aria-live":`polite`,"aria-atomic":`true`,children:Be})]})};function v({onSearch:e,onSubmit:t,className:r,children:i,noValidate:a=!0,...o}){let s=(0,d.useRef)(null),c=n=>{t?.(n),n.preventDefault();let r;r=s.current?s.current.search():n.currentTarget.querySelector(`input[type="search"]`)?.value??``,e?.(r,n)};return(0,f.jsx)(g.Provider,{value:s,children:(0,f.jsx)(`form`,{...o,role:`search`,noValidate:a,className:n.cx(l.default.form,r),onSubmit:c,children:i})})}exports.SearchForm=v,exports.SearchInput=_,exports.defaultResultsLabel=h;
@@ -1,124 +0,0 @@
1
- import { ComponentPropsWithRef, ReactNode, Ref } from 'react';
2
- import { KbdKeyToken, KbdPlatform } from '../../primitives/Kbd';
3
- import { InputProps } from '../Input';
4
- /** A key in a `shortcut` chord: a platform token (`"mod"`, `"shift"`, ...) or a literal key (`"k"`, `"/"`). */
5
- export type SearchShortcutKey = KbdKeyToken | (string & {});
6
- export interface SearchInputProps extends Omit<InputProps, "type" | "value" | "defaultValue" | "onValueChange" | "minLength"> {
7
- /** Controlled query. Pair with `onValueChange`. */
8
- value?: string;
9
- /** Initial query when uncontrolled. @default "" */
10
- defaultValue?: string;
11
- /** Called with the new query on every edit (typing, pasting, clearing). Fires immediately, never debounced. */
12
- onValueChange?: (value: string) => void;
13
- /**
14
- * Called with the query when a search should run:
15
- * - on Enter (always, even for an empty or short query; inside a plain
16
- * `<form>` this replaces the native submit, so use `SearchForm` to submit),
17
- * - when `debounce` is set, after typing pauses for that many ms,
18
- * - on submit of a surrounding `SearchForm`.
19
- */
20
- onSearch?: (query: string) => void;
21
- /**
22
- * Milliseconds of idle typing before `onSearch` fires automatically. Leave
23
- * unset to search only on Enter. When set, emptying the field fires
24
- * `onSearch("")` immediately so results can reset, and a query identical to
25
- * the last debounced one is not re-sent.
26
- */
27
- debounce?: number;
28
- /**
29
- * Minimum trimmed length before a *debounced* search fires. Enter always
30
- * searches. Not forwarded as the native `minlength` attribute. @default 0
31
- */
32
- minLength?: number;
33
- /** Called after the user clears the field with the clear button or Escape. */
34
- onClear?: () => void;
35
- /** Shows a clear button while the field has a value. @default true */
36
- clearable?: boolean;
37
- /** Accessible name of the clear button. @default "Clear search" */
38
- clearLabel?: string;
39
- /**
40
- * When Escape is pressed in an already-empty field, blur it. The Escape
41
- * event always bubbles in that case (so a surrounding dialog can close);
42
- * when the field has a value, Escape only clears it and stops there.
43
- * @default true
44
- */
45
- blurOnEscape?: boolean;
46
- /**
47
- * A global keyboard chord that focuses the field, e.g. `["mod", "k"]`
48
- * (Cmd+K on Mac, Ctrl+K elsewhere) or `["/"]`. Shows a key hint at the end
49
- * while the field is empty and unfocused, and sets `aria-keyshortcuts`.
50
- * Ignored while the user is typing in another text field.
51
- */
52
- shortcut?: SearchShortcutKey[];
53
- /** Turns the global `shortcut` listener (and hint) on or off. @default true */
54
- shortcutEnabled?: boolean;
55
- /** Force the platform used for the shortcut hint and `mod` matching. Detected by default. */
56
- shortcutPlatform?: KbdPlatform;
57
- /**
58
- * Number of results for the current query. When set, a polite live region
59
- * announces `resultsLabel(resultsCount)` after the user searches or edits,
60
- * once the count has been stable for `announceDelay` ms and `loading` is
61
- * false. Nothing is announced before the first edit or search.
62
- */
63
- resultsCount?: number;
64
- /** Builds the results announcement. @default "No results" / "1 result" / "N results" */
65
- resultsLabel?: (count: number) => string;
66
- /** Quiet period (ms) before announcing `resultsCount`, to avoid chatter while typing. @default 700 */
67
- announceDelay?: number;
68
- /** Corner rounding. @default "pill" */
69
- radius?: InputProps["radius"];
70
- /** Ref to the `<input>` element. */
71
- ref?: Ref<HTMLInputElement>;
72
- }
73
- /** Default results announcement. */
74
- export declare function defaultResultsLabel(count: number): string;
75
- /** The submit event React passes to a form's `onSubmit`. */
76
- export type FormSubmitEvent = Parameters<NonNullable<ComponentPropsWithRef<"form">["onSubmit"]>>[0];
77
- /**
78
- * A search field built on `Input`: `type="search"`, a search icon, a clear
79
- * button, and pill rounding by default. Fires `onSearch` on Enter and,
80
- * optionally, after a typing pause (`debounce`). Escape clears the field.
81
- * An optional global `shortcut` (e.g. Cmd/Ctrl+K) focuses it, and
82
- * `resultsCount` announces result counts politely.
83
- *
84
- * **Accessible name:** label it with a `Field`, a `<label htmlFor>`,
85
- * `aria-label`, or `aria-labelledby`. If none of these is present,
86
- * `aria-label="Search"` is applied as a fallback. The placeholder is never
87
- * used as the name.
88
- *
89
- * **Landmark:** wrap it in `SearchForm` to get a `<form role="search">`
90
- * landmark; Enter then submits the form, which calls both callbacks.
91
- *
92
- * ```tsx
93
- * <SearchInput aria-label="Search players" debounce={300} onSearch={runSearch} shortcut={["mod", "k"]} />
94
- * ```
95
- */
96
- export declare const SearchInput: ({ value: valueProp, defaultValue, onValueChange, onSearch, debounce, minLength, onClear, clearable, clearLabel: clearLabelProp, blurOnEscape, shortcut, shortcutEnabled, shortcutPlatform, resultsCount, resultsLabel: resultsLabelProp, announceDelay, radius, size, loading, startIcon, endIcon, endElement, inputClassName, autoComplete, enterKeyHint, disabled, readOnly, ref, onChange, onKeyDown, onFocus, onBlur, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-keyshortcuts": ariaKeyShortcuts, ...rest }: SearchInputProps) => import("react").JSX.Element;
97
- type SearchFormName = {
98
- /** Accessible name of the search landmark, e.g. "Site search". */
99
- "aria-label": string;
100
- "aria-labelledby"?: string;
101
- } | {
102
- "aria-label"?: string;
103
- /** id of a visible heading or label naming the landmark. */
104
- "aria-labelledby": string;
105
- };
106
- /** Props for `SearchForm`. One of `aria-label` or `aria-labelledby` is required. */
107
- export type SearchFormProps = Omit<ComponentPropsWithRef<"form">, "role" | "aria-label" | "aria-labelledby"> & SearchFormName & {
108
- /**
109
- * Called on submit (Enter in the SearchInput, or a submit button) with
110
- * the SearchInput's query. The native submit is always prevented.
111
- */
112
- onSearch?: (query: string, event: FormSubmitEvent) => void;
113
- /** The SearchInput plus any filters or a submit button. */
114
- children?: ReactNode;
115
- };
116
- /**
117
- * A `<form role="search">` landmark around a `SearchInput`, so screen reader
118
- * users can jump straight to search. Give it an accessible name, especially
119
- * when a page has more than one search landmark. Submitting prevents the
120
- * page navigation and calls both the form's `onSearch` and the input's
121
- * `onSearch` with the current query. Use one SearchInput per SearchForm.
122
- */
123
- export declare function SearchForm({ onSearch, onSubmit, className, children, noValidate, ...rest }: SearchFormProps): import("react").JSX.Element;
124
- export {};
@@ -1 +0,0 @@
1
- var e=`_input_1v7cb_15`,t=`_hint_1v7cb_27`,n=`_form_1v7cb_39`,r={input:e,hint:t,form:n};exports.default=r,exports.form=n,exports.hint=t,exports.input=e;
@@ -1 +0,0 @@
1
- "use client";const e=require("../../../hooks/useControllableState.cjs.js"),t=require("../../../hooks/useFormReset.cjs.js"),n=require("../../../utils/cx.cjs.js"),r=require("../Field/FieldContext.cjs.js"),i=require("./SegmentedControl.module.css.cjs.js");let a=require("react"),o=require("react/jsx-runtime");var s={sm:i.default.sm,md:i.default.md,lg:i.default.lg},c={neutral:i.default.toneNeutral,primary:i.default.tonePrimary},l={none:i.default.radiusNone,xs:i.default.radiusXs,sm:i.default.radiusSm,md:i.default.radiusMd,lg:i.default.radiusLg,xl:i.default.radiusXl,"2xl":i.default.radius2xl,pill:i.default.radiusPill},u={horizontal:i.default.horizontal,vertical:i.default.vertical},d=(0,a.createContext)(null);function f({value:e,icon:t,disabled:r,className:s,style:c,children:l,onChange:u,required:f,id:p,...m}){let h=(0,a.useContext)(d),g=(0,a.useId)(),_=p??g,v=!!(r||h?.disabled),y=h?h.value===e:!1,b=l!=null,x=t!=null;return(0,o.jsxs)(`label`,{htmlFor:_,style:c,"data-segment":``,"data-checked":y||void 0,"data-disabled":v||void 0,className:n.cx(i.default.segment,!b&&i.default.iconOnly,s),children:[(0,o.jsx)(`input`,{...m,id:_,type:`radio`,className:i.default.input,name:h?.name,value:e,checked:y,disabled:v,required:f??h?.required,"aria-invalid":m[`aria-invalid`]??(h?.itemInvalid?!0:void 0),"aria-describedby":[m[`aria-describedby`],h?.itemDescribedBy].filter(Boolean).join(` `)||void 0,onChange:t=>{u?.(t),!t.defaultPrevented&&t.target.checked&&h?.setValue(e)}}),(0,o.jsxs)(`span`,{className:i.default.content,children:[x&&(0,o.jsx)(`span`,{className:i.default.icon,"aria-hidden":`true`,children:t}),b&&(0,o.jsxs)(`span`,{className:i.default.labelStack,children:[(0,o.jsx)(`span`,{className:i.default.labelText,children:l}),(0,o.jsx)(`span`,{className:i.default.labelSizer,"aria-hidden":`true`,children:l})]})]})]})}function p({options:p,children:m,value:h,defaultValue:g,onValueChange:_,name:v,size:y,tone:b=`neutral`,radius:x=`pill`,fullWidth:S=!1,orientation:C=`horizontal`,disabled:w,invalid:T,required:E,label:D,className:O,id:k,"aria-describedby":A,"aria-labelledby":j,...M}){let N=r.useFieldContext(),P=(0,a.useId)(),F=`${P}-label`,I=N!==null,L=!I&&D!=null,R=r.useFieldControl({id:k,invalid:T,required:E,disabled:w,size:y,"aria-describedby":A}),[z,B]=e.useControllableState({value:h,defaultValue:g,onChange:_});t.useFormReset(()=>R.id?document.getElementById(R.id):null,()=>B(g),h===void 0);let V=R.size??`md`,H=(0,a.useRef)(null),U=(0,a.useRef)(null),W=(0,a.useRef)(!1),G=(0,a.useRef)(``),K=(0,a.useCallback)(e=>{let t=H.current,n=U.current;if(!t||!n)return;let r=t.querySelector(`:scope > [data-segment][data-checked]`);if(!r){n.dataset.hidden=``,W.current=!1;return}let i=`${r.offsetLeft}|${r.offsetTop}|${r.offsetWidth}|${r.offsetHeight}`;if(i===G.current&&W.current&&n.dataset.hidden===void 0)return;G.current=i;let a=e||!W.current||n.dataset.hidden!==void 0;a&&(n.dataset.instant=``),n.style.setProperty(`--sc-thumb-x`,`${r.offsetLeft}px`),n.style.setProperty(`--sc-thumb-y`,`${r.offsetTop}px`),n.style.setProperty(`--sc-thumb-w`,`${r.offsetWidth}px`),n.style.setProperty(`--sc-thumb-h`,`${r.offsetHeight}px`),delete n.dataset.hidden,a&&(n.offsetWidth,delete n.dataset.instant),W.current=!0},[]);(0,a.useLayoutEffect)(()=>{K(!1)});let q=(0,a.useRef)(null),J=(0,a.useRef)(new WeakSet);(0,a.useEffect)(()=>{if(typeof ResizeObserver>`u`)return;let e=new ResizeObserver(()=>K(!0));return q.current=e,()=>{e.disconnect(),q.current=null,J.current=new WeakSet}},[K]),(0,a.useEffect)(()=>{let e=q.current,t=H.current;if(e&&t)for(let n of[t,...t.querySelectorAll(`:scope > [data-segment]`)])J.current.has(n)||(J.current.add(n),e.observe(n))});let Y={name:v??`segmented-${P}`,value:z,setValue:B,disabled:R.disabled,required:R.required},X=N?.isGroup===!0&&j===void 0;X&&(Y.itemInvalid=R.invalid,Y.itemDescribedBy=A);let Z=j??(I?N.labelId:L?F:void 0),Q=X?{"aria-describedby":A}:{role:`radiogroup`,"aria-labelledby":Z,...R.ariaProps,"aria-disabled":R.disabled||void 0,"aria-required":R.required||void 0},$=p?p.map(({value:e,label:t,icon:n,disabled:r,"aria-label":i})=>t===void 0?(0,o.jsx)(f,{value:e,icon:n,disabled:r,"aria-label":i},e):(0,o.jsx)(f,{value:e,icon:n,disabled:r,"aria-label":i,children:t},e)):m;return(0,o.jsx)(d.Provider,{value:Y,children:(0,o.jsxs)(`div`,{id:R.id,...Q,...M,"data-disabled":R.disabled||void 0,"data-invalid":R.invalid||void 0,className:n.cx(i.default.root,s[V],c[b],l[x],u[C],S&&i.default.fullWidth,O),children:[L&&(0,o.jsxs)(`span`,{id:F,className:i.default.groupLabel,children:[D,R.required&&(0,o.jsxs)(`span`,{className:i.default.requiredMark,"aria-hidden":`true`,children:[` `,`*`]})]}),(0,o.jsxs)(`div`,{ref:H,className:i.default.track,children:[(0,o.jsx)(`span`,{ref:U,className:i.default.thumb,"data-hidden":``,"data-instant":``,"aria-hidden":`true`}),$]})]})})}var m=Object.assign(p,{Item:f});exports.SegmentedControl=m,exports.SegmentedControlItem=f;