@vjdesigns/vjdesigns-ui 2.4.0 → 3.0.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 (453) hide show
  1. package/LICENSE +15 -0
  2. package/README.md +45 -1
  3. package/dist/ai/llms-full.txt +141 -76
  4. package/dist/ai/registry.json +125 -61
  5. package/dist/components/data-display/Accordion/Accordion.cjs.js +1 -1
  6. package/dist/components/data-display/Accordion/Accordion.mjs +22 -22
  7. package/dist/components/data-display/Accordion/Accordion.module.css.mjs +1 -2
  8. package/dist/components/data-display/Avatar/Avatar.cjs.js +1 -1
  9. package/dist/components/data-display/Avatar/Avatar.mjs +92 -92
  10. package/dist/components/data-display/Avatar/Avatar.module.css.mjs +1 -2
  11. package/dist/components/data-display/Badge/Badge.cjs.js +1 -1
  12. package/dist/components/data-display/Badge/Badge.mjs +2 -2
  13. package/dist/components/data-display/Badge/Badge.module.css.mjs +1 -2
  14. package/dist/components/data-display/Card/Card.cjs.js +1 -1
  15. package/dist/components/data-display/Card/Card.mjs +2 -2
  16. package/dist/components/data-display/Card/Card.module.css.mjs +1 -2
  17. package/dist/components/data-display/Carousel/Carousel.cjs.js +1 -1
  18. package/dist/components/data-display/Carousel/Carousel.mjs +42 -42
  19. package/dist/components/data-display/Carousel/Carousel.module.css.mjs +1 -2
  20. package/dist/components/data-display/Chat/Chat.cjs.js +1 -1
  21. package/dist/components/data-display/Chat/Chat.mjs +114 -118
  22. package/dist/components/data-display/Chat/Chat.module.css.mjs +1 -2
  23. package/dist/components/data-display/Chat/streams.mjs +1 -2
  24. package/dist/components/data-display/Chip/Chip.cjs.js +1 -1
  25. package/dist/components/data-display/Chip/Chip.mjs +50 -54
  26. package/dist/components/data-display/Chip/Chip.module.css.mjs +1 -2
  27. package/dist/components/data-display/CodeBlock/CodeBlock.cjs.js +4 -4
  28. package/dist/components/data-display/CodeBlock/CodeBlock.mjs +113 -113
  29. package/dist/components/data-display/CodeBlock/CodeBlock.module.css.mjs +1 -2
  30. package/dist/components/data-display/CodeBlock/tokenize.mjs +1 -2
  31. package/dist/components/data-display/DataGrid/DataGrid.cjs.js +1 -1
  32. package/dist/components/data-display/DataGrid/DataGrid.d.ts +59 -3
  33. package/dist/components/data-display/DataGrid/DataGrid.mjs +382 -272
  34. package/dist/components/data-display/DataGrid/DataGrid.module.css.cjs.js +1 -1
  35. package/dist/components/data-display/DataGrid/DataGrid.module.css.mjs +29 -26
  36. package/dist/components/data-display/DataGrid/dataGridUtils.cjs.js +1 -1
  37. package/dist/components/data-display/DataGrid/dataGridUtils.d.ts +18 -0
  38. package/dist/components/data-display/DataGrid/dataGridUtils.mjs +100 -32
  39. package/dist/components/data-display/EmptyState/EmptyState.cjs.js +1 -1
  40. package/dist/components/data-display/EmptyState/EmptyState.mjs +53 -53
  41. package/dist/components/data-display/EmptyState/EmptyState.module.css.mjs +1 -2
  42. package/dist/components/data-display/Image/Image.cjs.js +1 -1
  43. package/dist/components/data-display/Image/Image.mjs +6 -6
  44. package/dist/components/data-display/Image/Image.module.css.mjs +1 -2
  45. package/dist/components/data-display/List/List.cjs.js +1 -1
  46. package/dist/components/data-display/List/List.mjs +68 -68
  47. package/dist/components/data-display/List/List.module.css.mjs +1 -2
  48. package/dist/components/data-display/Stat/Stat.cjs.js +1 -1
  49. package/dist/components/data-display/Stat/Stat.mjs +112 -112
  50. package/dist/components/data-display/Stat/Stat.module.css.mjs +1 -2
  51. package/dist/components/data-display/Table/Table.cjs.js +1 -1
  52. package/dist/components/data-display/Table/Table.mjs +187 -183
  53. package/dist/components/data-display/Table/Table.module.css.mjs +1 -2
  54. package/dist/components/data-display/Table/useTable.cjs.js +1 -1
  55. package/dist/components/data-display/Table/useTable.mjs +2 -2
  56. package/dist/components/data-display/Timeline/Timeline.cjs.js +1 -1
  57. package/dist/components/data-display/Timeline/Timeline.mjs +64 -64
  58. package/dist/components/data-display/Timeline/Timeline.module.css.mjs +1 -2
  59. package/dist/components/data-display/TreeView/TreeView.cjs.js +1 -1
  60. package/dist/components/data-display/TreeView/TreeView.mjs +107 -119
  61. package/dist/components/data-display/TreeView/TreeView.module.css.mjs +1 -2
  62. package/dist/components/data-display/TreeView/treeUtils.mjs +1 -2
  63. package/dist/components/data-display/VirtualList/VirtualList.cjs.js +1 -1
  64. package/dist/components/data-display/VirtualList/VirtualList.mjs +2 -2
  65. package/dist/components/data-display/VirtualList/VirtualList.module.css.mjs +1 -2
  66. package/dist/components/feedback/Alert/Alert.cjs.js +1 -1
  67. package/dist/components/feedback/Alert/Alert.mjs +56 -56
  68. package/dist/components/feedback/Alert/Alert.module.css.mjs +1 -2
  69. package/dist/components/feedback/Banner/Banner.cjs.js +1 -1
  70. package/dist/components/feedback/Banner/Banner.mjs +48 -48
  71. package/dist/components/feedback/Banner/Banner.module.css.mjs +1 -2
  72. package/dist/components/feedback/ErrorSummary/ErrorSummary.cjs.js +1 -1
  73. package/dist/components/feedback/ErrorSummary/ErrorSummary.mjs +10 -10
  74. package/dist/components/feedback/ErrorSummary/ErrorSummary.module.css.mjs +1 -2
  75. package/dist/components/feedback/Progress/Progress.cjs.js +1 -1
  76. package/dist/components/feedback/Progress/Progress.mjs +2 -2
  77. package/dist/components/feedback/Progress/Progress.module.css.mjs +1 -2
  78. package/dist/components/feedback/Skeleton/Skeleton.cjs.js +1 -1
  79. package/dist/components/feedback/Skeleton/Skeleton.mjs +73 -73
  80. package/dist/components/feedback/Skeleton/Skeleton.module.css.mjs +1 -2
  81. package/dist/components/feedback/Spinner/Spinner.cjs.js +1 -1
  82. package/dist/components/feedback/Spinner/Spinner.mjs +29 -29
  83. package/dist/components/feedback/Spinner/Spinner.module.css.mjs +1 -2
  84. package/dist/components/feedback/Toast/Toast.cjs.js +1 -1
  85. package/dist/components/feedback/Toast/Toast.mjs +42 -42
  86. package/dist/components/feedback/Toast/Toast.module.css.mjs +1 -2
  87. package/dist/components/feedback/Toast/ToastItem.cjs.js +1 -1
  88. package/dist/components/feedback/Toast/ToastItem.mjs +10 -10
  89. package/dist/components/feedback/Toast/ToastProvider.cjs.js +1 -1
  90. package/dist/components/feedback/Toast/ToastProvider.mjs +11 -11
  91. package/dist/components/feedback/Toast/ToastViewport.cjs.js +1 -1
  92. package/dist/components/feedback/Toast/ToastViewport.mjs +30 -30
  93. package/dist/components/feedback/Toast/toastStore.mjs +1 -2
  94. package/dist/components/feedback/Toast/toastTiming.cjs.js +1 -1
  95. package/dist/components/feedback/Toast/toastTiming.mjs +2 -2
  96. package/dist/components/feedback/Toast/useToast.cjs.js +1 -1
  97. package/dist/components/feedback/Toast/useToast.mjs +2 -2
  98. package/dist/components/feedback/Toast/useToastAnnouncer.cjs.js +1 -1
  99. package/dist/components/feedback/Toast/useToastAnnouncer.mjs +2 -2
  100. package/dist/components/forms/CheckBox/CheckBox.cjs.js +1 -1
  101. package/dist/components/forms/CheckBox/CheckBox.mjs +2 -2
  102. package/dist/components/forms/CheckBox/CheckBox.module.css.mjs +1 -2
  103. package/dist/components/forms/ColorPicker/ColorInput.cjs.js +1 -1
  104. package/dist/components/forms/ColorPicker/ColorInput.mjs +43 -43
  105. package/dist/components/forms/ColorPicker/ColorPicker.cjs.js +1 -1
  106. package/dist/components/forms/ColorPicker/ColorPicker.mjs +153 -153
  107. package/dist/components/forms/ColorPicker/ColorPicker.module.css.mjs +1 -2
  108. package/dist/components/forms/ColorPicker/colorUtils.mjs +1 -2
  109. package/dist/components/forms/Combobox/Combobox.cjs.js +1 -1
  110. package/dist/components/forms/Combobox/Combobox.mjs +200 -213
  111. package/dist/components/forms/Combobox/Combobox.module.css.mjs +1 -2
  112. package/dist/components/forms/Combobox/ComboboxPopup.cjs.js +1 -1
  113. package/dist/components/forms/Combobox/ComboboxPopup.mjs +164 -121
  114. package/dist/components/forms/Combobox/comboboxUtils.cjs.js +1 -1
  115. package/dist/components/forms/Combobox/comboboxUtils.d.ts +4 -1
  116. package/dist/components/forms/Combobox/comboboxUtils.mjs +21 -20
  117. package/dist/components/forms/DatePicker/Calendar.cjs.js +1 -1
  118. package/dist/components/forms/DatePicker/Calendar.mjs +60 -66
  119. package/dist/components/forms/DatePicker/Calendar.module.css.mjs +1 -2
  120. package/dist/components/forms/DatePicker/DatePicker.cjs.js +1 -1
  121. package/dist/components/forms/DatePicker/DatePicker.mjs +72 -74
  122. package/dist/components/forms/DatePicker/DatePicker.module.css.mjs +1 -2
  123. package/dist/components/forms/DatePicker/DateRangePicker.cjs.js +1 -1
  124. package/dist/components/forms/DatePicker/DateRangePicker.mjs +117 -117
  125. package/dist/components/forms/DatePicker/DateRangePicker.module.css.mjs +1 -2
  126. package/dist/components/forms/DatePicker/dateUtils.mjs +1 -2
  127. package/dist/components/forms/DatePicker/index.d.ts +1 -1
  128. package/dist/components/forms/DateTimePicker/DateTimePicker.cjs.js +1 -1
  129. package/dist/components/forms/DateTimePicker/DateTimePicker.mjs +19 -19
  130. package/dist/components/forms/DateTimePicker/DateTimePicker.module.css.mjs +1 -2
  131. package/dist/components/forms/Field/Field.cjs.js +1 -1
  132. package/dist/components/forms/Field/Field.mjs +14 -14
  133. package/dist/components/forms/Field/Field.module.css.mjs +1 -2
  134. package/dist/components/forms/Field/FieldContext.cjs.js +1 -1
  135. package/dist/components/forms/Field/FieldContext.mjs +2 -2
  136. package/dist/components/forms/FileUpload/FileUpload.cjs.js +1 -1
  137. package/dist/components/forms/FileUpload/FileUpload.mjs +250 -255
  138. package/dist/components/forms/FileUpload/FileUpload.module.css.mjs +1 -2
  139. package/dist/components/forms/Input/Input.cjs.js +1 -1
  140. package/dist/components/forms/Input/Input.mjs +35 -35
  141. package/dist/components/forms/Input/Input.module.css.mjs +1 -2
  142. package/dist/components/forms/NumberInput/NumberInput.cjs.js +1 -1
  143. package/dist/components/forms/NumberInput/NumberInput.mjs +137 -142
  144. package/dist/components/forms/NumberInput/NumberInput.module.css.mjs +1 -2
  145. package/dist/components/forms/PasswordInput/PasswordInput.cjs.js +1 -1
  146. package/dist/components/forms/PasswordInput/PasswordInput.mjs +142 -142
  147. package/dist/components/forms/PasswordInput/PasswordInput.module.css.mjs +1 -2
  148. package/dist/components/forms/PinInput/PinInput.cjs.js +1 -1
  149. package/dist/components/forms/PinInput/PinInput.mjs +12 -12
  150. package/dist/components/forms/PinInput/PinInput.module.css.mjs +1 -2
  151. package/dist/components/forms/Radio/Radio.cjs.js +1 -1
  152. package/dist/components/forms/Radio/Radio.mjs +2 -2
  153. package/dist/components/forms/Radio/Radio.module.css.mjs +1 -2
  154. package/dist/components/forms/Rating/Rating.cjs.js +1 -1
  155. package/dist/components/forms/Rating/Rating.mjs +110 -109
  156. package/dist/components/forms/Rating/Rating.module.css.mjs +1 -2
  157. package/dist/components/forms/SearchInput/SearchInput.cjs.js +1 -1
  158. package/dist/components/forms/SearchInput/SearchInput.mjs +118 -126
  159. package/dist/components/forms/SearchInput/SearchInput.module.css.mjs +1 -2
  160. package/dist/components/forms/SegmentedControl/SegmentedControl.cjs.js +1 -1
  161. package/dist/components/forms/SegmentedControl/SegmentedControl.mjs +46 -43
  162. package/dist/components/forms/SegmentedControl/SegmentedControl.module.css.cjs.js +1 -1
  163. package/dist/components/forms/SegmentedControl/SegmentedControl.module.css.mjs +2 -3
  164. package/dist/components/forms/Select/Select.cjs.js +1 -1
  165. package/dist/components/forms/Select/Select.mjs +2 -2
  166. package/dist/components/forms/Select/Select.module.css.mjs +1 -2
  167. package/dist/components/forms/Slider/Slider.cjs.js +1 -1
  168. package/dist/components/forms/Slider/Slider.mjs +2 -2
  169. package/dist/components/forms/Slider/Slider.module.css.mjs +1 -2
  170. package/dist/components/forms/Switch/Switch.cjs.js +1 -1
  171. package/dist/components/forms/Switch/Switch.mjs +39 -39
  172. package/dist/components/forms/Switch/Switch.module.css.mjs +1 -2
  173. package/dist/components/forms/TagInput/TagInput.cjs.js +1 -1
  174. package/dist/components/forms/TagInput/TagInput.mjs +197 -203
  175. package/dist/components/forms/TagInput/TagInput.module.css.mjs +1 -2
  176. package/dist/components/forms/Textarea/Textarea.cjs.js +1 -1
  177. package/dist/components/forms/Textarea/Textarea.mjs +59 -59
  178. package/dist/components/forms/Textarea/Textarea.module.css.mjs +1 -2
  179. package/dist/components/forms/TimePicker/TimePicker.cjs.js +1 -1
  180. package/dist/components/forms/TimePicker/TimePicker.mjs +65 -67
  181. package/dist/components/forms/TimePicker/TimePicker.module.css.mjs +1 -2
  182. package/dist/components/forms/TimePicker/index.d.ts +1 -0
  183. package/dist/components/forms/TimePicker/timeUtils.cjs.js +1 -1
  184. package/dist/components/forms/TimePicker/timeUtils.d.ts +4 -1
  185. package/dist/components/forms/TimePicker/timeUtils.mjs +43 -38
  186. package/dist/components/forms/ToggleGroup/ToggleGroup.cjs.js +1 -1
  187. package/dist/components/forms/ToggleGroup/ToggleGroup.mjs +10 -10
  188. package/dist/components/forms/ToggleGroup/ToggleGroup.module.css.mjs +1 -2
  189. package/dist/components/layout/Box/Box.mjs +1 -2
  190. package/dist/components/layout/Box/Box.module.css.mjs +1 -2
  191. package/dist/components/layout/Container/Container.mjs +1 -2
  192. package/dist/components/layout/Container/Container.module.css.mjs +1 -2
  193. package/dist/components/layout/Divider/Divider.mjs +1 -2
  194. package/dist/components/layout/Divider/Divider.module.css.mjs +1 -2
  195. package/dist/components/layout/Flex/Flex.cjs.js +1 -1
  196. package/dist/components/layout/Flex/Flex.mjs +12 -13
  197. package/dist/components/layout/Flex/Flex.module.css.mjs +1 -2
  198. package/dist/components/layout/Grid/Grid.cjs.js +1 -1
  199. package/dist/components/layout/Grid/Grid.mjs +20 -21
  200. package/dist/components/layout/Grid/Grid.module.css.mjs +1 -2
  201. package/dist/components/layout/ResizablePanels/ResizablePanels.cjs.js +1 -1
  202. package/dist/components/layout/ResizablePanels/ResizablePanels.mjs +17 -17
  203. package/dist/components/layout/ResizablePanels/ResizablePanels.module.css.mjs +1 -2
  204. package/dist/components/layout/ScrollArea/ScrollArea.cjs.js +1 -1
  205. package/dist/components/layout/ScrollArea/ScrollArea.mjs +2 -2
  206. package/dist/components/layout/ScrollArea/ScrollArea.module.css.mjs +1 -2
  207. package/dist/components/layout/Stack/Stack.cjs.js +1 -1
  208. package/dist/components/layout/Stack/Stack.mjs +8 -9
  209. package/dist/components/layout/Stack/Stack.module.css.mjs +1 -2
  210. package/dist/components/navigation/Breadcrumbs/Breadcrumbs.cjs.js +1 -1
  211. package/dist/components/navigation/Breadcrumbs/Breadcrumbs.mjs +41 -41
  212. package/dist/components/navigation/Breadcrumbs/Breadcrumbs.module.css.mjs +1 -2
  213. package/dist/components/navigation/ContextMenu/ContextMenu.cjs.js +1 -1
  214. package/dist/components/navigation/ContextMenu/ContextMenu.mjs +48 -48
  215. package/dist/components/navigation/ContextMenu/ContextMenu.module.css.mjs +1 -2
  216. package/dist/components/navigation/Link/Link.cjs.js +1 -1
  217. package/dist/components/navigation/Link/Link.mjs +6 -7
  218. package/dist/components/navigation/Link/Link.module.css.mjs +1 -2
  219. package/dist/components/navigation/Menu/Menu.cjs.js +1 -1
  220. package/dist/components/navigation/Menu/Menu.mjs +11 -11
  221. package/dist/components/navigation/Menu/Menu.module.css.mjs +1 -2
  222. package/dist/components/navigation/Menu/MenuContent.cjs.js +1 -1
  223. package/dist/components/navigation/Menu/MenuContent.mjs +46 -46
  224. package/dist/components/navigation/Menu/MenuContext.cjs.js +1 -1
  225. package/dist/components/navigation/Menu/MenuContext.mjs +2 -2
  226. package/dist/components/navigation/Menu/MenuItem.cjs.js +1 -1
  227. package/dist/components/navigation/Menu/MenuItem.mjs +35 -39
  228. package/dist/components/navigation/Menu/MenuSub.cjs.js +1 -1
  229. package/dist/components/navigation/Menu/MenuSub.mjs +16 -20
  230. package/dist/components/navigation/Menu/useMenuRoot.cjs.js +1 -1
  231. package/dist/components/navigation/Menu/useMenuRoot.mjs +2 -2
  232. package/dist/components/navigation/Navbar/Navbar.cjs.js +1 -1
  233. package/dist/components/navigation/Navbar/Navbar.mjs +111 -111
  234. package/dist/components/navigation/Navbar/Navbar.module.css.mjs +1 -2
  235. package/dist/components/navigation/Pagination/Pagination.cjs.js +1 -1
  236. package/dist/components/navigation/Pagination/Pagination.mjs +31 -35
  237. package/dist/components/navigation/Pagination/Pagination.module.css.mjs +1 -2
  238. package/dist/components/navigation/Sidebar/Sidebar.cjs.js +1 -1
  239. package/dist/components/navigation/Sidebar/Sidebar.mjs +52 -52
  240. package/dist/components/navigation/Sidebar/Sidebar.module.css.mjs +1 -2
  241. package/dist/components/navigation/Sidebar/SidebarContext.cjs.js +1 -1
  242. package/dist/components/navigation/Sidebar/SidebarContext.mjs +2 -2
  243. package/dist/components/navigation/Sidebar/SidebarParts.cjs.js +1 -1
  244. package/dist/components/navigation/Sidebar/SidebarParts.mjs +76 -80
  245. package/dist/components/navigation/SkipLink/SkipLink.cjs.js +1 -1
  246. package/dist/components/navigation/SkipLink/SkipLink.mjs +12 -12
  247. package/dist/components/navigation/SkipLink/SkipLink.module.css.mjs +1 -2
  248. package/dist/components/navigation/Stepper/Stepper.cjs.js +1 -1
  249. package/dist/components/navigation/Stepper/Stepper.mjs +46 -46
  250. package/dist/components/navigation/Stepper/Stepper.module.css.mjs +1 -2
  251. package/dist/components/navigation/Tabs/Tabs.cjs.js +1 -1
  252. package/dist/components/navigation/Tabs/Tabs.mjs +2 -2
  253. package/dist/components/navigation/Tabs/Tabs.module.css.mjs +1 -2
  254. package/dist/components/overlays/CommandPalette/CommandPalette.cjs.js +1 -1
  255. package/dist/components/overlays/CommandPalette/CommandPalette.mjs +206 -206
  256. package/dist/components/overlays/CommandPalette/CommandPalette.module.css.mjs +1 -2
  257. package/dist/components/overlays/CommandPalette/CommandPaletteContext.cjs.js +1 -1
  258. package/dist/components/overlays/CommandPalette/CommandPaletteContext.mjs +2 -2
  259. package/dist/components/overlays/CommandPalette/CommandPaletteParts.cjs.js +1 -1
  260. package/dist/components/overlays/CommandPalette/CommandPaletteParts.mjs +104 -104
  261. package/dist/components/overlays/CommandPalette/commandPaletteUtils.cjs.js +1 -1
  262. package/dist/components/overlays/CommandPalette/commandPaletteUtils.mjs +62 -60
  263. package/dist/components/overlays/Drawer/Drawer.cjs.js +1 -1
  264. package/dist/components/overlays/Drawer/Drawer.mjs +31 -31
  265. package/dist/components/overlays/Drawer/Drawer.module.css.mjs +1 -2
  266. package/dist/components/overlays/Drawer/DrawerContent.cjs.js +1 -1
  267. package/dist/components/overlays/Drawer/DrawerContent.mjs +99 -99
  268. package/dist/components/overlays/Drawer/DrawerContext.cjs.js +1 -1
  269. package/dist/components/overlays/Drawer/DrawerContext.mjs +2 -2
  270. package/dist/components/overlays/Drawer/DrawerParts.cjs.js +1 -1
  271. package/dist/components/overlays/Drawer/DrawerParts.mjs +18 -18
  272. package/dist/components/overlays/Drawer/internal.mjs +1 -2
  273. package/dist/components/overlays/Drawer/useDragToClose.cjs.js +1 -1
  274. package/dist/components/overlays/Drawer/useDragToClose.mjs +2 -2
  275. package/dist/components/overlays/HoverCard/HoverCard.cjs.js +1 -1
  276. package/dist/components/overlays/HoverCard/HoverCard.mjs +31 -31
  277. package/dist/components/overlays/HoverCard/HoverCard.module.css.mjs +1 -2
  278. package/dist/components/overlays/Modal/ConfirmModal.cjs.js +1 -1
  279. package/dist/components/overlays/Modal/ConfirmModal.mjs +21 -23
  280. package/dist/components/overlays/Modal/Modal.cjs.js +1 -1
  281. package/dist/components/overlays/Modal/Modal.mjs +47 -47
  282. package/dist/components/overlays/Modal/Modal.module.css.mjs +1 -2
  283. package/dist/components/overlays/Modal/ModalContent.cjs.js +1 -1
  284. package/dist/components/overlays/Modal/ModalContent.mjs +24 -24
  285. package/dist/components/overlays/Modal/ModalContext.cjs.js +1 -1
  286. package/dist/components/overlays/Modal/ModalContext.mjs +2 -2
  287. package/dist/components/overlays/Modal/useScrollRegion.cjs.js +1 -1
  288. package/dist/components/overlays/Modal/useScrollRegion.mjs +2 -2
  289. package/dist/components/overlays/Popover/Popover.cjs.js +1 -1
  290. package/dist/components/overlays/Popover/Popover.mjs +40 -40
  291. package/dist/components/overlays/Popover/Popover.module.css.mjs +1 -2
  292. package/dist/components/overlays/Popover/PopoverContent.cjs.js +1 -1
  293. package/dist/components/overlays/Popover/PopoverContent.mjs +39 -39
  294. package/dist/components/overlays/Popover/PopoverContext.cjs.js +1 -1
  295. package/dist/components/overlays/Popover/PopoverContext.mjs +2 -2
  296. package/dist/components/overlays/Tooltip/Tooltip.cjs.js +1 -1
  297. package/dist/components/overlays/Tooltip/Tooltip.mjs +100 -95
  298. package/dist/components/overlays/Tooltip/Tooltip.module.css.mjs +1 -2
  299. package/dist/components/primitives/Button/Button.cjs.js +1 -1
  300. package/dist/components/primitives/Button/Button.mjs +59 -63
  301. package/dist/components/primitives/Button/Button.module.css.mjs +1 -2
  302. package/dist/components/primitives/Icon/Icon.cjs.js +1 -1
  303. package/dist/components/primitives/Icon/Icon.mjs +5 -6
  304. package/dist/components/primitives/Icon/Icon.module.css.mjs +1 -2
  305. package/dist/components/primitives/Icon/IconSvg.mjs +1 -2
  306. package/dist/components/primitives/Icon/icons.mjs +1 -2
  307. package/dist/components/primitives/Kbd/Kbd.cjs.js +1 -1
  308. package/dist/components/primitives/Kbd/Kbd.mjs +30 -30
  309. package/dist/components/primitives/Kbd/Kbd.module.css.mjs +1 -2
  310. package/dist/components/primitives/Typography/Typography.mjs +1 -2
  311. package/dist/components/primitives/Typography/Typography.module.css.mjs +1 -2
  312. package/dist/components/utilities/LocaleProvider/LocaleProvider.cjs.js +1 -1
  313. package/dist/components/utilities/LocaleProvider/LocaleProvider.mjs +11 -11
  314. package/dist/components/utilities/LocaleProvider/LocaleProvider.module.css.mjs +1 -2
  315. package/dist/components/utilities/Portal/Portal.cjs.js +1 -1
  316. package/dist/components/utilities/Portal/Portal.mjs +2 -2
  317. package/dist/components/utilities/Theme/Theme.cjs.js +1 -1
  318. package/dist/components/utilities/Theme/Theme.mjs +13 -13
  319. package/dist/components/utilities/Theme/Theme.module.css.mjs +1 -2
  320. package/dist/components/utilities/VisuallyHidden/VisuallyHidden.mjs +1 -2
  321. package/dist/components/utilities/VisuallyHidden/VisuallyHidden.module.css.mjs +1 -2
  322. package/dist/hooks/elementSource.cjs.js +1 -1
  323. package/dist/hooks/elementSource.mjs +4 -3
  324. package/dist/hooks/useClipboard.cjs.js +1 -1
  325. package/dist/hooks/useClipboard.mjs +2 -2
  326. package/dist/hooks/useControllableState.cjs.js +1 -1
  327. package/dist/hooks/useControllableState.mjs +2 -2
  328. package/dist/hooks/useDisclosure.cjs.js +1 -1
  329. package/dist/hooks/useDisclosure.mjs +2 -2
  330. package/dist/hooks/useDismiss.cjs.js +1 -1
  331. package/dist/hooks/useDismiss.mjs +2 -2
  332. package/dist/hooks/useElementObservers.cjs.js +1 -1
  333. package/dist/hooks/useElementObservers.mjs +2 -2
  334. package/dist/hooks/useEnvironment.cjs.js +1 -1
  335. package/dist/hooks/useEnvironment.mjs +2 -2
  336. package/dist/hooks/useFloatingPosition.cjs.js +1 -1
  337. package/dist/hooks/useFloatingPosition.mjs +2 -2
  338. package/dist/hooks/useFocusTrap.cjs.js +1 -1
  339. package/dist/hooks/useFocusTrap.mjs +4 -15
  340. package/dist/hooks/useFormReset.cjs.js +1 -1
  341. package/dist/hooks/useFormReset.mjs +2 -2
  342. package/dist/hooks/useFormValidation.cjs.js +1 -1
  343. package/dist/hooks/useFormValidation.mjs +2 -2
  344. package/dist/hooks/useHotkeys.cjs.js +1 -1
  345. package/dist/hooks/useHotkeys.mjs +2 -2
  346. package/dist/hooks/useInertOutside.cjs.js +1 -1
  347. package/dist/hooks/useInertOutside.mjs +5 -9
  348. package/dist/hooks/useMediaQuery.cjs.js +1 -1
  349. package/dist/hooks/useMediaQuery.mjs +2 -2
  350. package/dist/hooks/useMergedRef.cjs.js +1 -1
  351. package/dist/hooks/useMergedRef.mjs +2 -2
  352. package/dist/hooks/useOverlayLayer.cjs.js +1 -1
  353. package/dist/hooks/useOverlayLayer.mjs +3 -3
  354. package/dist/hooks/useResponsiveValue.cjs.js +1 -1
  355. package/dist/hooks/useResponsiveValue.mjs +2 -2
  356. package/dist/hooks/useScrollLock.cjs.js +1 -1
  357. package/dist/hooks/useScrollLock.mjs +2 -2
  358. package/dist/hooks/useStorage.cjs.js +1 -1
  359. package/dist/hooks/useStorage.mjs +2 -2
  360. package/dist/hooks/useTiming.cjs.js +1 -1
  361. package/dist/hooks/useTiming.mjs +10 -15
  362. package/dist/hooks/useVirtualizer.cjs.js +1 -1
  363. package/dist/hooks/useVirtualizer.d.ts +13 -0
  364. package/dist/hooks/useVirtualizer.mjs +93 -54
  365. package/dist/i18n/en.cjs.js +1 -1
  366. package/dist/i18n/en.mjs +194 -4
  367. package/dist/i18n/merge.mjs +1 -2
  368. package/dist/i18n/plural.mjs +1 -2
  369. package/dist/i18n/types.d.ts +240 -0
  370. package/dist/index.cjs.js +1 -1
  371. package/dist/index.mjs +114 -114
  372. package/dist/locales/ar.cjs.js +1 -1
  373. package/dist/locales/ar.mjs +230 -4
  374. package/dist/locales/bn.cjs.js +1 -1
  375. package/dist/locales/bn.mjs +167 -4
  376. package/dist/locales/cs.cjs.js +1 -1
  377. package/dist/locales/cs.mjs +212 -4
  378. package/dist/locales/da.cjs.js +1 -1
  379. package/dist/locales/da.mjs +194 -4
  380. package/dist/locales/de.cjs.js +1 -1
  381. package/dist/locales/de.mjs +194 -4
  382. package/dist/locales/el.cjs.js +1 -1
  383. package/dist/locales/el.mjs +194 -4
  384. package/dist/locales/es.cjs.js +1 -1
  385. package/dist/locales/es.mjs +194 -4
  386. package/dist/locales/fa.cjs.js +1 -1
  387. package/dist/locales/fa.mjs +167 -4
  388. package/dist/locales/fi.cjs.js +1 -1
  389. package/dist/locales/fi.mjs +194 -4
  390. package/dist/locales/fr.cjs.js +1 -1
  391. package/dist/locales/fr.mjs +194 -4
  392. package/dist/locales/he.cjs.js +1 -1
  393. package/dist/locales/he.mjs +203 -4
  394. package/dist/locales/hi.cjs.js +1 -1
  395. package/dist/locales/hi.mjs +194 -4
  396. package/dist/locales/hu.cjs.js +1 -1
  397. package/dist/locales/hu.mjs +167 -4
  398. package/dist/locales/id.cjs.js +1 -1
  399. package/dist/locales/id.mjs +167 -4
  400. package/dist/locales/it.cjs.js +1 -1
  401. package/dist/locales/it.mjs +194 -4
  402. package/dist/locales/ja.cjs.js +1 -1
  403. package/dist/locales/ja.mjs +167 -4
  404. package/dist/locales/ko.cjs.js +1 -1
  405. package/dist/locales/ko.mjs +167 -4
  406. package/dist/locales/nb.cjs.js +1 -1
  407. package/dist/locales/nb.mjs +194 -4
  408. package/dist/locales/nl.cjs.js +1 -1
  409. package/dist/locales/nl.mjs +194 -4
  410. package/dist/locales/pl.cjs.js +1 -1
  411. package/dist/locales/pl.mjs +212 -4
  412. package/dist/locales/pt-BR.cjs.js +1 -1
  413. package/dist/locales/pt-BR.mjs +194 -4
  414. package/dist/locales/ro.cjs.js +1 -1
  415. package/dist/locales/ro.mjs +203 -4
  416. package/dist/locales/ru.cjs.js +1 -1
  417. package/dist/locales/ru.mjs +212 -4
  418. package/dist/locales/sv.cjs.js +1 -1
  419. package/dist/locales/sv.mjs +194 -4
  420. package/dist/locales/th.cjs.js +1 -1
  421. package/dist/locales/th.mjs +167 -4
  422. package/dist/locales/tr.cjs.js +1 -1
  423. package/dist/locales/tr.mjs +167 -4
  424. package/dist/locales/uk.cjs.js +1 -1
  425. package/dist/locales/uk.mjs +212 -4
  426. package/dist/locales/ur.cjs.js +1 -1
  427. package/dist/locales/ur.mjs +194 -4
  428. package/dist/locales/vi.cjs.js +1 -1
  429. package/dist/locales/vi.mjs +167 -4
  430. package/dist/locales/zh-Hans.cjs.js +1 -1
  431. package/dist/locales/zh-Hans.mjs +167 -4
  432. package/dist/locales/zh-Hant.cjs.js +1 -1
  433. package/dist/locales/zh-Hant.mjs +167 -4
  434. package/dist/types/common.mjs +1 -2
  435. package/dist/utils/announce.cjs.js +1 -1
  436. package/dist/utils/announce.mjs +3 -4
  437. package/dist/utils/brandPalette.mjs +1 -2
  438. package/dist/utils/clipboard.mjs +1 -2
  439. package/dist/utils/cx.mjs +1 -2
  440. package/dist/utils/fillSlot.cjs.js +1 -1
  441. package/dist/utils/fillSlot.mjs +2 -2
  442. package/dist/utils/flattenChildren.mjs +1 -2
  443. package/dist/utils/hotkeys.mjs +1 -2
  444. package/dist/utils/intl.cjs.js +1 -0
  445. package/dist/utils/intl.d.ts +10 -0
  446. package/dist/utils/intl.mjs +15 -0
  447. package/dist/utils/refs.mjs +1 -2
  448. package/dist/utils/responsive.mjs +1 -2
  449. package/dist/utils/slot.mjs +1 -2
  450. package/dist/utils/validators.mjs +1 -2
  451. package/dist/vjdesigns-ui.css +1 -1
  452. package/dist/vjdesigns-ui.css.d.ts +2 -0
  453. package/package.json +103 -90
@@ -1 +1 @@
1
- const e=require("../../../i18n/en.cjs.js"),t=require("../../../hooks/useControllableState.cjs.js"),n=require("../../../hooks/useFormReset.cjs.js"),r=require("../../utilities/LocaleProvider/LocaleProvider.cjs.js"),i=require("../../../utils/cx.cjs.js"),a=require("../../utilities/VisuallyHidden/VisuallyHidden.cjs.js"),o=require("../../primitives/Icon/icons.cjs.js"),s=require("../Field/FieldContext.cjs.js"),c=require("./Rating.module.css.cjs.js");let l=require("react"),u=require("react/jsx-runtime");var d={sm:c.default.sm,md:c.default.md,lg:c.default.lg},f={sm:c.default.displaySm,md:c.default.displayMd,lg:c.default.displayLg},ee={neutral:c.default.toneNeutral,primary:c.default.tonePrimary,accent:c.default.toneAccent,success:c.default.toneSuccess,warning:c.default.toneWarning,danger:c.default.toneDanger,info:c.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,r=+!Number.isInteger(n);return new Intl.NumberFormat(t,{minimumFractionDigits:r,maximumFractionDigits:r}).format(n)}var g=(t,n)=>e.en.rating.option(h(t,`en`),n),_=(t,n)=>e.en.rating.display(h(t,`en`),n),v=t=>e.en.rating.count(t);function y({fill:e,icon:t,emptyIcon:n}){let r=`${Math.round(m(e,0,1)*1e3)/10}%`;return(0,u.jsxs)(`span`,{className:c.default.icon,"aria-hidden":`true`,"data-fill":e>=1?`full`:e>0?`partial`:`empty`,style:{"--rating-fill":r},children:[(0,u.jsx)(`span`,{className:c.default.empty,children:n}),(0,u.jsx)(`span`,{className:c.default.filled,children:t})]})}var te=(0,u.jsx)(o.StarFilledIcon,{}),ne=(0,u.jsx)(o.StarIcon,{});function b({value:e,max:t=5,size:n,tone:a=`warning`,icon:o=te,emptyIcon:l=ne,showValue:d=!1,count:p,formatCount:g,getLabel:_,className:v,"aria-label":b,...x}){let{messages:S,locale:C}=r.useLocale(),w=g??S.rating.count,T=_??((e,t)=>S.rating.display(h(e,C),t)),E=s.useFieldContext(),D=n??E?.size??`md`,O=Math.max(1,Math.round(t)),k=m(Number.isFinite(e)?e:0,0,O);return(0,u.jsxs)(`span`,{...x,className:i.cx(c.default.display,f[D],ee[a],v),children:[(0,u.jsx)(`span`,{role:`img`,"aria-label":b??T(k,O),className:c.default.icons,children:Array.from({length:O},(e,t)=>(0,u.jsx)(`span`,{className:c.default.displayCell,children:(0,u.jsx)(y,{fill:k-t,icon:o,emptyIcon:l})},t))}),d&&(0,u.jsxs)(`span`,{className:c.default.valueText,"aria-hidden":`true`,children:[h(k,C),` / `,O]}),p!==void 0&&(0,u.jsx)(`span`,{className:c.default.count,children:w(p)})]})}function x({value:e,defaultValue:o=null,onValueChange:f,max:g=5,precision:_=1,allowZero:v=!1,allowClear:x=!1,clearHint:S,hoverPreview:C=!0,size:w,tone:T=`warning`,icon:E=te,emptyIcon:D=ne,showValue:O=!1,disabled:k,readOnly:re,invalid:ie,required:ae,name:A,getLabel:oe,getReadOnlyLabel:se,unratedLabel:ce,label:le,description:j,className:ue,id:de,onKeyDown:fe,onPointerLeave:pe,"aria-describedby":M,"aria-labelledby":N,...me}){let{messages:P,locale:F}=r.useLocale(),he=S??P.rating.clearHint,ge=oe??((e,t)=>P.rating.option(h(e,F),t)),_e=se??((e,t)=>P.rating.display(h(e,F),t)),ve=ce??P.rating.unrated,I=s.useFieldContext(),L=(0,l.useId)(),ye=`${L}-label`,R=`${L}-description`,be=`${L}-clear`,z=I!==null,B=!z&&le!=null,V=j!=null,H=s.useFieldControl({id:de,invalid:ie,required:ae,disabled:k,readOnly:re,size:w,"aria-describedby":p(V&&R,M)}),[U,W]=t.useControllableState({value:e,defaultValue:o,onChange:f});n.useFormReset(()=>H.id?document.getElementById(H.id):null,()=>W(o??null),e===void 0);let[G,K]=(0,l.useState)(null),q=H.size??`md`,J=Math.max(1,Math.round(g)),Y=_===.5?.5:1,xe=A??`rating-${L}`,Se=!H.disabled&&!H.readOnly,X=x&&Se,Z=U===null||!Number.isFinite(U)?null:U<Y/2?v?0:null:m(Math.round(U/Y)*Y,Y,J),Q=C&&Se&&G!==null,Ce=Q?G:Z??0,we=I?.isGroup===!0&&N===void 0,Te=N??(z?I.labelId:B?ye:void 0),Ee=H.readOnly?`group`:`radiogroup`,De=we?{"aria-describedby":p(V&&R,M)}:{role:Ee,"aria-labelledby":Te,...H.ariaProps,"aria-disabled":H.disabled||void 0,"aria-required":H.required&&!H.readOnly||void 0},Oe=e=>{fe?.(e),!e.defaultPrevented&&X&&(e.key===`Delete`||e.key===`Backspace`)&&e.target instanceof HTMLInputElement&&(e.preventDefault(),W(null))},ke=e=>{pe?.(e),K(null)},Ae=[];for(let e=Y;e<=J+1e-9;e+=Y)Ae.push(Math.round(e*10)/10);let $=(e,t)=>{let n=Z===e;return(0,u.jsxs)(`span`,{className:i.cx(c.default.hit,c.default[t]),children:[(0,u.jsx)(`input`,{type:`radio`,className:c.default.input,name:xe,value:String(e),checked:n,disabled:H.disabled,required:H.required,"aria-label":ge(e,J),"aria-describedby":X?be:void 0,"aria-invalid":we&&H.invalid?!0:void 0,onChange:t=>{t.target.checked&&W(e)},onClick:e=>{X&&n&&W(null)},onPointerEnter:t=>{C&&t.pointerType!==`touch`&&K(e)}}),(0,u.jsx)(`span`,{className:c.default.focusBox,"aria-hidden":`true`})]},e)},je=Q&&G!==null?Math.ceil(G)-1:-1;return(0,u.jsxs)(`div`,{id:H.id,...De,...me,"data-disabled":H.disabled||void 0,"data-invalid":H.invalid||void 0,"data-readonly":H.readOnly||void 0,"data-precision":Y===.5?`half`:`whole`,"data-previewing":Q||void 0,className:i.cx(c.default.rating,d[q],ee[T],ue),onKeyDown:Oe,onPointerLeave:ke,children:[(B||V)&&(0,u.jsxs)(`div`,{className:c.default.header,children:[B&&(0,u.jsxs)(`span`,{id:ye,className:c.default.label,children:[le,H.required&&!H.readOnly&&(0,u.jsxs)(`span`,{className:c.default.requiredMark,"aria-hidden":`true`,children:[` `,`*`]})]}),V&&(0,u.jsx)(`span`,{id:R,className:c.default.description,children:j})]}),(0,u.jsxs)(`div`,{className:c.default.row,children:[H.readOnly?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(b,{value:Z??0,max:J,size:q,tone:T,icon:E,emptyIcon:D,getLabel:_e,"aria-label":Z===null?ve:void 0}),A!==void 0&&Z!==null&&(0,u.jsx)(`input`,{type:`hidden`,name:A,value:String(Z)})]}):(0,u.jsxs)(`div`,{className:c.default.icons,children:[v&&(0,u.jsxs)(`span`,{className:i.cx(c.default.cell,c.default.zeroCell),"data-hovered":Q&&G===0?!0:void 0,children:[(0,u.jsx)(`span`,{className:c.default.zeroMark,"aria-hidden":`true`,children:`0`}),$(0,`whole`)]}),Array.from({length:J},(e,t)=>(0,u.jsxs)(`span`,{className:c.default.cell,"data-hovered":t===je||void 0,children:[(0,u.jsx)(y,{fill:Ce-t,icon:E,emptyIcon:D}),Y===.5?[$(t+.5,`start`),$(t+1,`end`)]:$(t+1,`whole`)]},t))]}),O&&(0,u.jsxs)(`span`,{className:c.default.valueText,"aria-hidden":`true`,children:[Z===null?`–`:h(Z,F),` / `,J]})]}),X&&(0,u.jsx)(a.VisuallyHidden,{id:be,children:he})]})}exports.Rating=x,exports.RatingDisplay=b,exports.defaultRatingCountText=v,exports.defaultRatingDisplayLabel=_,exports.defaultRatingOptionLabel=g,exports.formatRatingValue=h;
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,108 +1,110 @@
1
- import { en as e } from "../../../i18n/en.mjs";
2
- import { useControllableState as t } from "../../../hooks/useControllableState.mjs";
3
- import { useFormReset as n } from "../../../hooks/useFormReset.mjs";
4
- import { useLocale as r } from "../../utilities/LocaleProvider/LocaleProvider.mjs";
5
- import { cx as i } from "../../../utils/cx.mjs";
6
- import { VisuallyHidden as a } from "../../utilities/VisuallyHidden/VisuallyHidden.mjs";
7
- import { StarFilledIcon as o, StarIcon as s } from "../../primitives/Icon/icons.mjs";
8
- import { useFieldContext as ee, useFieldControl as c } from "../Field/FieldContext.mjs";
9
- import l from "./Rating.module.css.mjs";
10
- import { useId as u, useState as te } from "react";
11
- import { Fragment as ne, jsx as d, jsxs as f } from "react/jsx-runtime";
12
- //#region src/components/forms/Rating/Rating.tsx
13
- var p = {
14
- sm: l.sm,
15
- md: l.md,
16
- lg: l.lg
1
+ "use client";
2
+ import { useControllableState as e } from "../../../hooks/useControllableState.mjs";
3
+ import { useFormReset as t } from "../../../hooks/useFormReset.mjs";
4
+ import { cx as n } from "../../../utils/cx.mjs";
5
+ import { getNumberFormat as r } from "../../../utils/intl.mjs";
6
+ import { StarFilledIcon as i, StarIcon as a } from "../../primitives/Icon/icons.mjs";
7
+ import { VisuallyHidden as ee } from "../../utilities/VisuallyHidden/VisuallyHidden.mjs";
8
+ import { useFieldContext as o, useFieldControl as s } from "../Field/FieldContext.mjs";
9
+ import c from "./Rating.module.css.mjs";
10
+ import { useLocale as l } from "../../utilities/LocaleProvider/LocaleProvider.mjs";
11
+ import { en as u } from "../../../i18n/en.mjs";
12
+ import { useId as d, useState as f } from "react";
13
+ import { Fragment as p, jsx as m, jsxs as h } from "react/jsx-runtime";
14
+ // src/components/forms/Rating/Rating.tsx
15
+ var te = {
16
+ sm: c.sm,
17
+ md: c.md,
18
+ lg: c.lg
19
+ }, ne = {
20
+ sm: c.displaySm,
21
+ md: c.displayMd,
22
+ lg: c.displayLg
17
23
  }, re = {
18
- sm: l.displaySm,
19
- md: l.displayMd,
20
- lg: l.displayLg
21
- }, ie = {
22
- neutral: l.toneNeutral,
23
- primary: l.tonePrimary,
24
- accent: l.toneAccent,
25
- success: l.toneSuccess,
26
- warning: l.toneWarning,
27
- danger: l.toneDanger,
28
- info: l.toneInfo
29
- }, m = (...e) => e.filter(Boolean).join(" ") || void 0, h = (e, t, n) => Math.min(n, Math.max(t, e));
30
- function g(e, t) {
31
- let n = Math.round(e * 10) / 10, r = +!Number.isInteger(n);
32
- return new Intl.NumberFormat(t, {
33
- minimumFractionDigits: r,
34
- maximumFractionDigits: r
24
+ neutral: c.toneNeutral,
25
+ primary: c.tonePrimary,
26
+ accent: c.toneAccent,
27
+ success: c.toneSuccess,
28
+ warning: c.toneWarning,
29
+ danger: c.toneDanger,
30
+ info: c.toneInfo
31
+ }, g = (...e) => e.filter(Boolean).join(" ") || void 0, _ = (e, t, n) => Math.min(n, Math.max(t, e));
32
+ function v(e, t) {
33
+ let n = Math.round(e * 10) / 10, i = +!Number.isInteger(n);
34
+ return r(t, {
35
+ minimumFractionDigits: i,
36
+ maximumFractionDigits: i
35
37
  }).format(n);
36
38
  }
37
- var _ = (t, n) => e.rating.option(g(t, "en"), n), v = (t, n) => e.rating.display(g(t, "en"), n), y = (t) => e.rating.count(t);
38
- function b({ fill: e, icon: t, emptyIcon: n }) {
39
- let r = `${Math.round(h(e, 0, 1) * 1e3) / 10}%`;
40
- return /* @__PURE__ */ f("span", {
41
- className: l.icon,
39
+ var y = (e, t) => u.rating.option(v(e, "en"), t), b = (e, t) => u.rating.display(v(e, "en"), t), x = (e) => u.rating.count(e);
40
+ function S({ fill: e, icon: t, emptyIcon: n }) {
41
+ let r = `${Math.round(_(e, 0, 1) * 1e3) / 10}%`;
42
+ return /* @__PURE__ */ h("span", {
43
+ className: c.icon,
42
44
  "aria-hidden": "true",
43
45
  "data-fill": e >= 1 ? "full" : e > 0 ? "partial" : "empty",
44
46
  style: { "--rating-fill": r },
45
- children: [/* @__PURE__ */ d("span", {
46
- className: l.empty,
47
+ children: [/* @__PURE__ */ m("span", {
48
+ className: c.empty,
47
49
  children: n
48
- }), /* @__PURE__ */ d("span", {
49
- className: l.filled,
50
+ }), /* @__PURE__ */ m("span", {
51
+ className: c.filled,
50
52
  children: t
51
53
  })]
52
54
  });
53
55
  }
54
- var x = /* @__PURE__ */ d(o, {}), S = /* @__PURE__ */ d(s, {});
55
- function C({ value: e, max: t = 5, size: n, tone: a = "warning", icon: o = x, emptyIcon: s = S, showValue: c = !1, count: u, formatCount: te, getLabel: ne, className: p, "aria-label": m, ..._ }) {
56
- let { messages: v, locale: y } = r(), C = te ?? v.rating.count, w = ne ?? ((e, t) => v.rating.display(g(e, y), t)), T = ee(), ae = n ?? T?.size ?? "md", E = Math.max(1, Math.round(t)), D = h(Number.isFinite(e) ? e : 0, 0, E);
57
- return /* @__PURE__ */ f("span", {
58
- ..._,
59
- className: i(l.display, re[ae], ie[a], p),
56
+ var C = /* @__PURE__ */ m(i, {}), ie = /* @__PURE__ */ m(a, {});
57
+ function w({ value: e, max: t = 5, size: r, tone: i = "warning", icon: a = C, emptyIcon: ee = ie, showValue: s = !1, count: u, formatCount: d, getLabel: f, className: p, "aria-label": te, ...g }) {
58
+ let { messages: y, locale: b } = l(), x = d ?? y.rating.count, w = f ?? ((e, t) => y.rating.display(v(e, b), t)), T = o(), ae = r ?? T?.size ?? "md", E = Math.max(1, Math.round(t)), D = _(Number.isFinite(e) ? e : 0, 0, E);
59
+ return /* @__PURE__ */ h("span", {
60
+ ...g,
61
+ className: n(c.display, ne[ae], re[i], p),
60
62
  children: [
61
- /* @__PURE__ */ d("span", {
63
+ /* @__PURE__ */ m("span", {
62
64
  role: "img",
63
- "aria-label": m ?? w(D, E),
64
- className: l.icons,
65
- children: Array.from({ length: E }, (e, t) => /* @__PURE__ */ d("span", {
66
- className: l.displayCell,
67
- children: /* @__PURE__ */ d(b, {
65
+ "aria-label": te ?? w(D, E),
66
+ className: c.icons,
67
+ children: Array.from({ length: E }, (e, t) => /* @__PURE__ */ m("span", {
68
+ className: c.displayCell,
69
+ children: /* @__PURE__ */ m(S, {
68
70
  fill: D - t,
69
- icon: o,
70
- emptyIcon: s
71
+ icon: a,
72
+ emptyIcon: ee
71
73
  })
72
74
  }, t))
73
75
  }),
74
- c && /* @__PURE__ */ f("span", {
75
- className: l.valueText,
76
+ s && /* @__PURE__ */ h("span", {
77
+ className: c.valueText,
76
78
  "aria-hidden": "true",
77
79
  children: [
78
- g(D, y),
80
+ v(D, b),
79
81
  " / ",
80
82
  E
81
83
  ]
82
84
  }),
83
- u !== void 0 && /* @__PURE__ */ d("span", {
84
- className: l.count,
85
- children: C(u)
85
+ u !== void 0 && /* @__PURE__ */ m("span", {
86
+ className: c.count,
87
+ children: x(u)
86
88
  })
87
89
  ]
88
90
  });
89
91
  }
90
- function w({ value: e, defaultValue: o = null, onValueChange: s, max: re = 5, precision: _ = 1, allowZero: v = !1, allowClear: y = !1, clearHint: w, hoverPreview: T = !0, size: ae, tone: E = "warning", icon: D = x, emptyIcon: oe = S, showValue: se = !1, disabled: ce, readOnly: le, invalid: ue, required: de, name: O, getLabel: fe, getReadOnlyLabel: pe, unratedLabel: me, label: k, description: A, className: he, id: ge, onKeyDown: _e, onPointerLeave: ve, "aria-describedby": j, "aria-labelledby": M, ...ye }) {
91
- let { messages: N, locale: P } = r(), be = w ?? N.rating.clearHint, xe = fe ?? ((e, t) => N.rating.option(g(e, P), t)), Se = pe ?? ((e, t) => N.rating.display(g(e, P), t)), Ce = me ?? N.rating.unrated, F = ee(), I = u(), L = `${I}-label`, R = `${I}-description`, z = `${I}-clear`, B = F !== null, V = !B && k != null, H = A != null, U = c({
92
+ function T({ value: r, defaultValue: i = null, onValueChange: a, max: u = 5, precision: ne = 1, allowZero: y = !1, allowClear: b = !1, clearHint: x, hoverPreview: T = !0, size: ae, tone: E = "warning", icon: D = C, emptyIcon: oe = ie, showValue: se = !1, disabled: ce, readOnly: le, invalid: ue, required: de, name: O, getLabel: fe, getReadOnlyLabel: pe, unratedLabel: me, label: k, description: A, className: he, id: ge, onKeyDown: _e, onPointerLeave: ve, "aria-describedby": j, "aria-labelledby": M, ...ye }) {
93
+ let { messages: N, locale: P } = l(), be = x ?? N.rating.clearHint, xe = fe ?? ((e, t) => N.rating.option(v(e, P), t)), Se = pe ?? ((e, t) => N.rating.display(v(e, P), t)), Ce = me ?? N.rating.unrated, F = o(), I = d(), L = `${I}-label`, R = `${I}-description`, z = `${I}-clear`, B = F !== null, V = !B && k != null, H = A != null, U = s({
92
94
  id: ge,
93
95
  invalid: ue,
94
96
  required: de,
95
97
  disabled: ce,
96
98
  readOnly: le,
97
99
  size: ae,
98
- "aria-describedby": m(H && R, j)
99
- }), [W, G] = t({
100
- value: e,
101
- defaultValue: o,
102
- onChange: s
100
+ "aria-describedby": g(H && R, j)
101
+ }), [W, G] = e({
102
+ value: r,
103
+ defaultValue: i,
104
+ onChange: a
103
105
  });
104
- n(() => U.id ? document.getElementById(U.id) : null, () => G(o ?? null), e === void 0);
105
- let [K, we] = te(null), Te = U.size ?? "md", q = Math.max(1, Math.round(re)), J = _ === .5 ? .5 : 1, Ee = O ?? `rating-${I}`, De = !U.disabled && !U.readOnly, Y = y && De, X = W === null || !Number.isFinite(W) ? null : W < J / 2 ? v ? 0 : null : h(Math.round(W / J) * J, J, q), Z = T && De && K !== null, Oe = Z ? K : X ?? 0, Q = F?.isGroup === !0 && M === void 0, ke = M ?? (B ? F.labelId : V ? L : void 0), Ae = U.readOnly ? "group" : "radiogroup", je = Q ? { "aria-describedby": m(H && R, j) } : {
106
+ t(() => U.id ? document.getElementById(U.id) : null, () => G(i ?? null), r === void 0);
107
+ let [K, we] = f(null), Te = U.size ?? "md", q = Math.max(1, Math.round(u)), J = ne === .5 ? .5 : 1, Ee = O ?? `rating-${I}`, De = !U.disabled && !U.readOnly, Y = b && De, X = W === null || !Number.isFinite(W) ? null : W < J / 2 ? y ? 0 : null : _(Math.round(W / J) * J, J, q), Z = T && De && K !== null, Oe = Z ? K : X ?? 0, Q = F?.isGroup === !0 && M === void 0, ke = M ?? (B ? F.labelId : V ? L : void 0), Ae = U.readOnly ? "group" : "radiogroup", je = Q ? { "aria-describedby": g(H && R, j) } : {
106
108
  role: Ae,
107
109
  "aria-labelledby": ke,
108
110
  ...U.ariaProps,
@@ -115,15 +117,15 @@ function w({ value: e, defaultValue: o = null, onValueChange: s, max: re = 5, pr
115
117
  }, Pe = [];
116
118
  for (let e = J; e <= q + 1e-9; e += J) Pe.push(Math.round(e * 10) / 10);
117
119
  let $ = (e, t) => {
118
- let n = X === e;
119
- return /* @__PURE__ */ f("span", {
120
- className: i(l.hit, l[t]),
121
- children: [/* @__PURE__ */ d("input", {
120
+ let r = X === e;
121
+ return /* @__PURE__ */ h("span", {
122
+ className: n(c.hit, c[t]),
123
+ children: [/* @__PURE__ */ m("input", {
122
124
  type: "radio",
123
- className: l.input,
125
+ className: c.input,
124
126
  name: Ee,
125
127
  value: String(e),
126
- checked: n,
128
+ checked: r,
127
129
  disabled: U.disabled,
128
130
  required: U.required,
129
131
  "aria-label": xe(e, q),
@@ -133,18 +135,18 @@ function w({ value: e, defaultValue: o = null, onValueChange: s, max: re = 5, pr
133
135
  t.target.checked && G(e);
134
136
  },
135
137
  onClick: (e) => {
136
- Y && n && G(null);
138
+ Y && r && G(null);
137
139
  },
138
140
  onPointerEnter: (t) => {
139
141
  T && t.pointerType !== "touch" && we(e);
140
142
  }
141
- }), /* @__PURE__ */ d("span", {
142
- className: l.focusBox,
143
+ }), /* @__PURE__ */ m("span", {
144
+ className: c.focusBox,
143
145
  "aria-hidden": "true"
144
146
  })]
145
147
  }, e);
146
148
  }, Fe = Z && K !== null ? Math.ceil(K) - 1 : -1;
147
- return /* @__PURE__ */ f("div", {
149
+ return /* @__PURE__ */ h("div", {
148
150
  id: U.id,
149
151
  ...je,
150
152
  ...ye,
@@ -153,29 +155,29 @@ function w({ value: e, defaultValue: o = null, onValueChange: s, max: re = 5, pr
153
155
  "data-readonly": U.readOnly || void 0,
154
156
  "data-precision": J === .5 ? "half" : "whole",
155
157
  "data-previewing": Z || void 0,
156
- className: i(l.rating, p[Te], ie[E], he),
158
+ className: n(c.rating, te[Te], re[E], he),
157
159
  onKeyDown: Me,
158
160
  onPointerLeave: Ne,
159
161
  children: [
160
- (V || H) && /* @__PURE__ */ f("div", {
161
- className: l.header,
162
- children: [V && /* @__PURE__ */ f("span", {
162
+ (V || H) && /* @__PURE__ */ h("div", {
163
+ className: c.header,
164
+ children: [V && /* @__PURE__ */ h("span", {
163
165
  id: L,
164
- className: l.label,
165
- children: [k, U.required && !U.readOnly && /* @__PURE__ */ f("span", {
166
- className: l.requiredMark,
166
+ className: c.label,
167
+ children: [k, U.required && !U.readOnly && /* @__PURE__ */ h("span", {
168
+ className: c.requiredMark,
167
169
  "aria-hidden": "true",
168
170
  children: [" ", "*"]
169
171
  })]
170
- }), H && /* @__PURE__ */ d("span", {
172
+ }), H && /* @__PURE__ */ m("span", {
171
173
  id: R,
172
- className: l.description,
174
+ className: c.description,
173
175
  children: A
174
176
  })]
175
177
  }),
176
- /* @__PURE__ */ f("div", {
177
- className: l.row,
178
- children: [U.readOnly ? /* @__PURE__ */ f(ne, { children: [/* @__PURE__ */ d(C, {
178
+ /* @__PURE__ */ h("div", {
179
+ className: c.row,
180
+ children: [U.readOnly ? /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m(w, {
179
181
  value: X ?? 0,
180
182
  max: q,
181
183
  size: Te,
@@ -184,45 +186,44 @@ function w({ value: e, defaultValue: o = null, onValueChange: s, max: re = 5, pr
184
186
  emptyIcon: oe,
185
187
  getLabel: Se,
186
188
  "aria-label": X === null ? Ce : void 0
187
- }), O !== void 0 && X !== null && /* @__PURE__ */ d("input", {
189
+ }), O !== void 0 && X !== null && /* @__PURE__ */ m("input", {
188
190
  type: "hidden",
189
191
  name: O,
190
192
  value: String(X)
191
- })] }) : /* @__PURE__ */ f("div", {
192
- className: l.icons,
193
- children: [v && /* @__PURE__ */ f("span", {
194
- className: i(l.cell, l.zeroCell),
193
+ })] }) : /* @__PURE__ */ h("div", {
194
+ className: c.icons,
195
+ children: [y && /* @__PURE__ */ h("span", {
196
+ className: n(c.cell, c.zeroCell),
195
197
  "data-hovered": Z && K === 0 ? !0 : void 0,
196
- children: [/* @__PURE__ */ d("span", {
197
- className: l.zeroMark,
198
+ children: [/* @__PURE__ */ m("span", {
199
+ className: c.zeroMark,
198
200
  "aria-hidden": "true",
199
201
  children: "0"
200
202
  }), $(0, "whole")]
201
- }), Array.from({ length: q }, (e, t) => /* @__PURE__ */ f("span", {
202
- className: l.cell,
203
+ }), Array.from({ length: q }, (e, t) => /* @__PURE__ */ h("span", {
204
+ className: c.cell,
203
205
  "data-hovered": t === Fe || void 0,
204
- children: [/* @__PURE__ */ d(b, {
206
+ children: [/* @__PURE__ */ m(S, {
205
207
  fill: Oe - t,
206
208
  icon: D,
207
209
  emptyIcon: oe
208
210
  }), J === .5 ? [$(t + .5, "start"), $(t + 1, "end")] : $(t + 1, "whole")]
209
211
  }, t))]
210
- }), se && /* @__PURE__ */ f("span", {
211
- className: l.valueText,
212
+ }), se && /* @__PURE__ */ h("span", {
213
+ className: c.valueText,
212
214
  "aria-hidden": "true",
213
215
  children: [
214
- X === null ? "–" : g(X, P),
216
+ X === null ? "–" : v(X, P),
215
217
  " / ",
216
218
  q
217
219
  ]
218
220
  })]
219
221
  }),
220
- Y && /* @__PURE__ */ d(a, {
222
+ Y && /* @__PURE__ */ m(ee, {
221
223
  id: z,
222
224
  children: be
223
225
  })
224
226
  ]
225
227
  });
226
228
  }
227
- //#endregion
228
- export { w as Rating, C as RatingDisplay, y as defaultRatingCountText, v as defaultRatingDisplayLabel, _ as defaultRatingOptionLabel, g as formatRatingValue };
229
+ export { T as Rating, w as RatingDisplay, x as defaultRatingCountText, b as defaultRatingDisplayLabel, y as defaultRatingOptionLabel, v as formatRatingValue };
@@ -1,4 +1,4 @@
1
- //#region src/components/forms/Rating/Rating.module.css
1
+ // src/components/forms/Rating/Rating.module.css
2
2
  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 = {
3
3
  sm: e,
4
4
  md: t,
@@ -38,5 +38,4 @@ var e = "_sm_ot4i7_19", t = "_md_ot4i7_23", n = "_lg_ot4i7_27", r = "_displaySm_
38
38
  end: F,
39
39
  focusBox: I
40
40
  };
41
- //#endregion
42
41
  export { D as cell, b as count, L as default, T as description, g as display, v as displayCell, a as displayLg, i as displayMd, r as displaySm, m as empty, F as end, h as filled, I as focusBox, S as header, M as hit, p as icon, _ as icons, A as input, C as label, n as lg, t as md, j as pop, x as rating, w as requiredMark, E as row, e as sm, P as start, c as toneAccent, d as toneDanger, f as toneInfo, o as toneNeutral, s as tonePrimary, l as toneSuccess, u as toneWarning, y as valueText, N as whole, O as zeroCell, k as zeroMark };
@@ -1 +1 @@
1
- const e=require("../../../i18n/en.cjs.js"),t=require("../../../hooks/useControllableState.cjs.js"),n=require("../../../hooks/useFormReset.cjs.js"),r=require("../../utilities/LocaleProvider/LocaleProvider.cjs.js"),i=require("../../../utils/refs.cjs.js"),a=require("../../../utils/cx.cjs.js"),o=require("../../utilities/VisuallyHidden/VisuallyHidden.cjs.js"),s=require("../../primitives/Icon/icons.cjs.js"),c=require("../../primitives/Kbd/Kbd.cjs.js"),ee=require("../Field/FieldContext.cjs.js"),te=require("../Input/Input.cjs.js"),l=require("./SearchInput.module.css.cjs.js");let u=require("react"),d=require("react/jsx-runtime");function ne(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 f=new Set([`checkbox`,`radio`,`button`,`submit`,`reset`,`range`,`color`,`file`,`image`]);function re(e){return e instanceof HTMLElement?e.isContentEditable||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement?!0:e instanceof HTMLInputElement&&!f.has(e.type):!1}function p(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 ie(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 ae(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 m(t){return e.en.searchInput.results(t)}var h=(0,u.createContext)(null),g=({value:e,defaultValue:f=``,onValueChange:m,onSearch:g,debounce:_,minLength:oe=0,onClear:v,clearable:se=!0,clearLabel:ce,blurOnEscape:le=!0,shortcut:y,shortcutEnabled:ue=!0,shortcutPlatform:de,resultsCount:b,resultsLabel:fe,announceDelay:x=700,radius:pe=`pill`,size:S,loading:C=!1,startIcon:w,endIcon:T,endElement:me,inputClassName:he,autoComplete:ge=`off`,enterKeyHint:_e=`search`,disabled:E,readOnly:D,ref:O,onChange:ve,onKeyDown:ye,onFocus:be,onBlur:xe,"aria-label":k,"aria-labelledby":A,"aria-keyshortcuts":Se,...Ce})=>{let j=r.useMessages(),we=ce??j.searchInput.clear,M=fe??j.searchInput.results,[N,P]=t.useControllableState({value:e,defaultValue:f,onChange:m});n.useFormReset(()=>R.current,()=>P(f??``),e===void 0);let F=ee.useFieldContext(),I=(0,u.useContext)(h),L=c.useKbdPlatform(de),R=(0,u.useRef)(null),Te=(0,u.useCallback)(e=>{R.current=e,i.assignRef(O,e)},[O]),Ee=E??F?.disabled??!1,De=D??F?.readOnly??!1,Oe=S??F?.size??`md`,z=(0,u.useRef)(g);z.current=g;let B=(0,u.useRef)(null),V=(0,u.useRef)(e??f),[H,U]=(0,u.useState)(0),W=()=>{B.current!=null&&clearTimeout(B.current),B.current=null};(0,u.useEffect)(()=>W,[]);let G=e=>{W(),V.current=e,U(e=>e+1),z.current?.(e)},ke=e=>{if(_!=null&&(W(),e!==V.current)){if(e===``){G(``);return}e.trim().length<oe||(B.current=setTimeout(()=>{B.current=null,e!==V.current&&G(e)},_))}},K=(0,u.useRef)(N);K.current=N;let q=(0,u.useRef)(G);q.current=G,(0,u.useEffect)(()=>{if(!I)return;let e={search:()=>(q.current(K.current),K.current)};return I.current=e,()=>{I.current===e&&(I.current=null)}},[I]);let J=(0,u.useRef)(!1),Ae=e=>{ve?.(e);let t=e.target.value;P(t),U(e=>e+1),J.current||ke(t)},je=()=>{let e=R.current;if(e){J.current=!0;try{ne(e,``)}finally{J.current=!1}W(),_!=null&&V.current!==``&&G(``),v?.()}},Me=()=>{W(),v?.()},Ne=e=>{if(ye?.(e),!(e.defaultPrevented||e.nativeEvent.isComposing)){if(e.key===`Enter`){let t=e.currentTarget.form;I&&t?(e.preventDefault(),typeof t.requestSubmit==`function`?t.requestSubmit():G(N)):(t&&g&&e.preventDefault(),G(N));return}e.key===`Escape`&&(N!==``&&!De?(e.preventDefault(),e.stopPropagation(),je()):le&&e.currentTarget.blur())}},[Pe,Y]=(0,u.useState)(!1),Fe=e=>{Y(!0),be?.(e)},Ie=e=>{Y(!1),xe?.(e)},Le=y?.join(`+`)??``,X=y?p(y,L):null,Z=X!=null&&ue&&!Ee;(0,u.useEffect)(()=>{if(!Z||!y)return;let e=p(y,L);if(!e)return;let t=t=>{if(t.defaultPrevented||t.isComposing)return;let n=R.current;n&&!n.disabled&&(t.target!==n&&re(t.target)||ie(t,e)&&n.getClientRects().length!==0&&(t.preventDefault(),n.focus(),n.select()))};return document.addEventListener(`keydown`,t),()=>document.removeEventListener(`keydown`,t)},[Z,Le,L]);let[Re,ze]=(0,u.useState)(!1);(0,u.useEffect)(()=>{let e=(R.current?.labels?.length??0)>0;ze(t=>t===e?t:e)});let Be=!k&&!A&&!F&&!Re,[Ve,Q]=(0,u.useState)(``),He=(0,u.useRef)(M);He.current=M,(0,u.useEffect)(()=>{if(b==null||C||H===0)return;Q(``);let e=setTimeout(()=>Q(He.current(b)),x);return()=>clearTimeout(e)},[b,C,H,x]);let $=Z&&!Pe&&N===``&&!C&&y!=null?(0,d.jsx)(c.KbdShortcut,{keys:y,size:Oe===`lg`?`md`:`sm`,platform:L,className:l.default.hint}):null,Ue=$||T!=null?(0,d.jsxs)(d.Fragment,{children:[$,T]}):void 0;return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(te.Input,{...Ce,ref:Te,type:`search`,value:N,size:S,radius:pe,loading:C,disabled:E,readOnly:D,autoComplete:ge,enterKeyHint:_e,"aria-label":k??(Be?j.searchInput.search:void 0),"aria-labelledby":A,"aria-keyshortcuts":Se??(Z&&X?ae(X):void 0),startIcon:w===void 0?(0,d.jsx)(s.SearchIcon,{}):w,endIcon:Ue,endElement:me,clearable:se,clearLabel:we,onClear:Me,inputClassName:a.cx(l.default.input,he),onChange:Ae,onKeyDown:Ne,onFocus:Fe,onBlur:Ie}),(0,d.jsx)(o.VisuallyHidden,{role:`status`,"aria-live":`polite`,"aria-atomic":`true`,children:Ve})]})};function _({onSearch:e,onSubmit:t,className:n,children:r,noValidate:i=!0,...o}){let s=(0,u.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,d.jsx)(h.Provider,{value:s,children:(0,d.jsx)(`form`,{...o,role:`search`,noValidate:i,className:a.cx(l.default.form,n),onSubmit:c,children:r})})}exports.SearchForm=_,exports.SearchInput=g,exports.defaultResultsLabel=m;
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;