@midas-ds/components 10.1.1 → 10.3.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 (383) hide show
  1. package/AccordionItem-BGWiWjxA.cjs +1 -0
  2. package/AccordionItem-ChHpW8EW.js +320 -0
  3. package/BadgeContainer-DM8TdyMT.js +37 -0
  4. package/BadgeContainer-I1XA3OCl.cjs +1 -0
  5. package/Breadcrumbs-CwDUNIqF.js +250 -0
  6. package/Breadcrumbs-DtjJ1UmU.cjs +1 -0
  7. package/Button-BoJl6JGM.cjs +1 -0
  8. package/Button-Csih3v23.js +38 -0
  9. package/Button-DjBChs7s.js +340 -0
  10. package/Button-htW9qIsS.cjs +1 -0
  11. package/Button.module-DEQtBYe5.cjs +1 -0
  12. package/Button.module-tti8HGxs.js +14 -0
  13. package/ButtonGroup-DUqW5dzM.cjs +1 -0
  14. package/ButtonGroup-DvVvear6.js +22 -0
  15. package/CHANGELOG.md +68 -0
  16. package/Card-0G0mj9q5.cjs +1 -0
  17. package/Card-yrtGzt70.js +131 -0
  18. package/CharacterCounter-BL_nZHya.js +22 -0
  19. package/CharacterCounter-CHcTDHO-.cjs +1 -0
  20. package/Checkbox-5HINZdGu.js +263 -0
  21. package/Checkbox-DqcPg5hz.cjs +1 -0
  22. package/CheckboxGroup-BBrSMuDY.cjs +1 -0
  23. package/CheckboxGroup-CLgixk2p.js +243 -0
  24. package/Collection-BIDsXNhi.cjs +1 -0
  25. package/Collection-Brgjpkne.js +576 -0
  26. package/ColorSchemeSwitch-BpzQ7g0b.js +106 -0
  27. package/ColorSchemeSwitch-C-qWuqkU.cjs +16 -0
  28. package/ComboBox-CVDyp2a-.js +1379 -0
  29. package/ComboBox-CWJUg9Xx.cjs +1 -0
  30. package/DateField-DeDhiYnW.cjs +1 -0
  31. package/DateField-DhU3q-rG.js +47 -0
  32. package/DateInputDivider-ADvOavHw.cjs +1 -0
  33. package/DateInputDivider-CF4xWsMT.js +2904 -0
  34. package/DateRangePicker-BsAHhy99.cjs +6 -0
  35. package/DateRangePicker-ziD1_k1W.js +881 -0
  36. package/Dialog-B8GTYbvu.cjs +1 -0
  37. package/Dialog-BOrYdX50.cjs +1 -0
  38. package/Dialog-CXNu48AC.js +208 -0
  39. package/Dialog-D14MbJ7o.js +1633 -0
  40. package/DragAndDrop-DNth776R.cjs +1 -0
  41. package/DragAndDrop-o3ruz_SR.js +60 -0
  42. package/Dropdown-CJ6My6EI.cjs +6 -0
  43. package/Dropdown-Df58j43I.js +84 -0
  44. package/FieldError-CAcjosk_.js +46 -0
  45. package/FieldError-CKBb2-mp.cjs +1 -0
  46. package/FileUpload-CxCOtyB9.cjs +2 -0
  47. package/FileUpload-D6qoEAjn.js +2373 -0
  48. package/FocusScope-5c9SVBcR.cjs +1 -0
  49. package/FocusScope-CxkURfoc.js +625 -0
  50. package/Form-BuOomA4T.cjs +1 -0
  51. package/Form-CXcEMuBf.js +5 -0
  52. package/Grid--OhtgCo6.js +27 -0
  53. package/Grid-DVQtOcu9.cjs +1 -0
  54. package/GridItem-DlbSdRmB.js +246 -0
  55. package/GridItem-XgHmZWXY.cjs +1 -0
  56. package/Group-B6EslsHZ.js +44 -0
  57. package/Group-CgiqQHH1.cjs +1 -0
  58. package/Heading-BFtiin0g.js +46 -0
  59. package/Heading-mHhCbGjY.cjs +1 -0
  60. package/Hidden-BxRZGdEW.cjs +1 -0
  61. package/Hidden-C9KWUR7b.js +34 -0
  62. package/InfoBanner-BLM-TJJ6.js +83 -0
  63. package/InfoBanner-C2kTIsrB.cjs +1 -0
  64. package/Input-BTzwcf72.js +41 -0
  65. package/Input-DKSAYvsw.cjs +1 -0
  66. package/Label-7Ybb99CE.cjs +1 -0
  67. package/Label-BwJrdqEE.js +70 -0
  68. package/Layout-1g6bMH62.cjs +16 -0
  69. package/Layout-Ey8flY7E.js +468 -0
  70. package/Link-B88l_oaE.cjs +6 -0
  71. package/Link-BQhauBuw.cjs +1 -0
  72. package/Link-DX5BbBnn.js +59 -0
  73. package/Link-yNO2-sqx.js +71 -0
  74. package/LinkButton-CBpGLETx.cjs +6 -0
  75. package/LinkButton-o6uS1XsR.js +69 -0
  76. package/ListBox-DP9M4H6R.cjs +1 -0
  77. package/ListBox-GnVK_Pdq.js +529 -0
  78. package/ListBoxButton-DPBrtXyv.cjs +1 -0
  79. package/ListBoxButton-D_J3jlP0.js +15 -0
  80. package/ListBoxSection-BGaigBnG.cjs +1 -0
  81. package/ListBoxSection-C0BGnpB4.js +1058 -0
  82. package/ListKeyboardDelegate-DNI8GQtX.js +167 -0
  83. package/ListKeyboardDelegate-DTg9h4v6.cjs +1 -0
  84. package/Logo-BIrOEINM.js +133 -0
  85. package/Logo-DT2_2O43.cjs +1 -0
  86. package/OverlayArrow-CDLXPTew.js +506 -0
  87. package/OverlayArrow-D75k-EMl.cjs +1 -0
  88. package/Popover-BGGXeD54.js +38 -0
  89. package/Popover-CqNWzPf-.cjs +1 -0
  90. package/ProgressBar-DMSg-Prr.js +53 -0
  91. package/ProgressBar-Jbg28j2a.cjs +1 -0
  92. package/RSPContexts-BW2SEIqe.js +11 -0
  93. package/RSPContexts-D8hmBfGm.cjs +1 -0
  94. package/Radio-BwqrdhQE.cjs +1 -0
  95. package/Radio-Cz29wPXd.js +311 -0
  96. package/RangeCalendar-BehUaydF.cjs +11 -0
  97. package/RangeCalendar-RAlAHlNL.js +1683 -0
  98. package/SearchField-CxMwDeUM.cjs +6 -0
  99. package/SearchField-IlvZ3Kh6.js +362 -0
  100. package/Select-2q1iSzAX.cjs +1 -0
  101. package/Select-BVQZtoi9.js +646 -0
  102. package/SelectionManager-B4ORduja.js +1032 -0
  103. package/SelectionManager-CwYux2h3.cjs +1 -0
  104. package/Separator-Cu9fYKUM.js +59 -0
  105. package/Separator-DECIYLtZ.cjs +1 -0
  106. package/Skeleton-BAwbfKBW.cjs +1 -0
  107. package/Skeleton-BePDRmrO.js +40 -0
  108. package/Spinner-D31SXm-U.js +41 -0
  109. package/Spinner-P35rvvsl.cjs +6 -0
  110. package/Table-B40CGLT-.cjs +16 -0
  111. package/Table-F4oYBtUM.js +2447 -0
  112. package/Tabs-B4oZJkZG.js +404 -0
  113. package/Tabs-DA2qXhzb.cjs +1 -0
  114. package/Tag-DPAGmcMK.cjs +1 -0
  115. package/Tag-Du7GvSv2.js +745 -0
  116. package/Text-3MNwRMpI.cjs +1 -0
  117. package/Text-B2K-BJKQ.cjs +1 -0
  118. package/Text-BoXuUVVH.js +15 -0
  119. package/Text-jWWg0B20.js +32 -0
  120. package/TextArea-C7JZ_pQd.cjs +1 -0
  121. package/TextArea-XeBCSyzl.js +191 -0
  122. package/TextField-BgNdhZi_.cjs +1 -0
  123. package/TextField-C-hTPukq.js +119 -0
  124. package/TextField.module-BcpPBWnD.js +13 -0
  125. package/TextField.module-Dw5Rtn9y.cjs +1 -0
  126. package/Toast-AbDA1BOs.cjs +1 -0
  127. package/Toast-Btg21Xge.js +989 -0
  128. package/ToggleButtonGroup-B5yz1tm2.js +210 -0
  129. package/ToggleButtonGroup-BFDoj0P6.cjs +1 -0
  130. package/Tooltip-CMLs7WMw.js +283 -0
  131. package/Tooltip-DeBuBKhS.cjs +1 -0
  132. package/VisuallyHidden-CLWHbz2n.cjs +1 -0
  133. package/VisuallyHidden-ZCYf65q4.js +40 -0
  134. package/accordion/index.cjs +1 -0
  135. package/accordion/index.js +5 -0
  136. package/arrow-right-Dg8sttFO.js +14 -0
  137. package/arrow-right-QJ2gXPKQ.cjs +6 -0
  138. package/assets/AccordionItem.css +1 -0
  139. package/assets/BadgeContainer.css +1 -0
  140. package/assets/Breadcrumbs.css +1 -0
  141. package/assets/Button.css +1 -0
  142. package/assets/ButtonGroup.css +1 -0
  143. package/assets/Card.css +1 -0
  144. package/assets/CharacterCounter.css +1 -0
  145. package/assets/Checkbox.css +1 -0
  146. package/assets/ColorSchemeSwitch.css +1 -0
  147. package/assets/ComboBox.css +1 -0
  148. package/assets/DateField.css +1 -0
  149. package/assets/DateInputDivider.css +1 -0
  150. package/assets/DateRangePicker.css +1 -0
  151. package/assets/Dialog.css +1 -0
  152. package/assets/Dropdown.css +1 -0
  153. package/assets/FieldError.css +1 -0
  154. package/assets/FileUpload.css +1 -0
  155. package/assets/GridItem.css +1 -0
  156. package/assets/Heading.css +1 -0
  157. package/assets/InfoBanner.css +1 -0
  158. package/assets/Label.css +1 -0
  159. package/assets/Layout.css +1 -0
  160. package/assets/Link.css +1 -0
  161. package/assets/LinkButton.css +1 -0
  162. package/assets/ListBoxSection.css +1 -0
  163. package/assets/Logo.css +1 -0
  164. package/assets/Popover.css +1 -0
  165. package/assets/ProgressBar.css +1 -0
  166. package/assets/Radio.css +1 -0
  167. package/assets/RangeCalendar.css +1 -0
  168. package/assets/SearchField.css +1 -0
  169. package/assets/Select.css +1 -0
  170. package/assets/Skeleton.css +1 -0
  171. package/assets/Spinner.css +1 -0
  172. package/assets/Table.css +1 -0
  173. package/assets/Tabs.css +1 -0
  174. package/assets/Tag.css +1 -0
  175. package/assets/Text.css +1 -0
  176. package/assets/TextField.css +1 -0
  177. package/assets/Toast.css +1 -0
  178. package/assets/ToggleButtonGroup.css +1 -0
  179. package/assets/Tooltip.css +1 -0
  180. package/badge/index.cjs +1 -0
  181. package/badge/index.js +5 -0
  182. package/breadcrumbs/index.cjs +1 -0
  183. package/breadcrumbs/index.js +4 -0
  184. package/button/index.cjs +1 -0
  185. package/button/index.js +6 -0
  186. package/calendar/CalendarHeader.d.ts +2 -1
  187. package/calendar/index.cjs +1 -0
  188. package/calendar/index.js +5 -0
  189. package/card/index.cjs +1 -0
  190. package/card/index.js +10 -0
  191. package/character-counter/index.cjs +1 -0
  192. package/character-counter/index.js +4 -0
  193. package/check-CLF6Yxza.js +11 -0
  194. package/check-D_KoootC.cjs +6 -0
  195. package/checkbox/Checkbox.d.ts +2 -2
  196. package/checkbox/CheckboxGroup.d.ts +8 -8
  197. package/checkbox/CheckboxGroupFieldError.d.ts +8 -0
  198. package/checkbox/CheckboxGroupItem.d.ts +3 -0
  199. package/checkbox/CheckboxInner.d.ts +2 -0
  200. package/checkbox/SingleCheckbox.d.ts +3 -0
  201. package/checkbox/context.d.ts +3 -0
  202. package/checkbox/index.cjs +1 -0
  203. package/checkbox/index.d.ts +2 -1
  204. package/checkbox/index.js +6 -0
  205. package/checkbox/intl/translations.json.d.ts +35 -0
  206. package/checkbox/types.d.ts +14 -0
  207. package/checkbox/useSelectAll.d.ts +7 -0
  208. package/chevron-down-Cd1bkzXT.js +13 -0
  209. package/chevron-down-jl83cllc.cjs +6 -0
  210. package/circle-check-B9HYcH7Z.js +26 -0
  211. package/circle-check-BGo8gML8.cjs +11 -0
  212. package/clsx-C11secjj.cjs +1 -0
  213. package/clsx-OuTLNxxd.js +16 -0
  214. package/color-scheme-switch/index.cjs +1 -0
  215. package/color-scheme-switch/index.js +4 -0
  216. package/combobox/ComboBox.d.ts +3 -1
  217. package/combobox/index.cjs +1 -0
  218. package/combobox/index.js +7 -0
  219. package/common/types.d.ts +2 -0
  220. package/context-C81gPYvC.js +80 -0
  221. package/context-DjwhtgxQ.cjs +1 -0
  222. package/createLucideIcon-Cg_wkoIA.cjs +21 -0
  223. package/createLucideIcon-DeWljiyi.js +79 -0
  224. package/date-field/DateField.d.ts +3 -0
  225. package/date-field/index.cjs +1 -0
  226. package/date-field/index.js +8 -0
  227. package/date-picker/DatePicker.d.ts +3 -0
  228. package/date-picker/DateRangePicker.d.ts +3 -0
  229. package/date-picker/index.cjs +1 -0
  230. package/date-picker/index.js +5 -0
  231. package/dropdown/index.cjs +1 -0
  232. package/dropdown/index.js +5 -0
  233. package/field-error/FieldError.d.ts +4 -1
  234. package/field-error/index.cjs +1 -0
  235. package/field-error/index.js +4 -0
  236. package/file-upload/FileUpload.d.ts +3 -0
  237. package/file-upload/index.cjs +1 -0
  238. package/file-upload/index.js +4 -0
  239. package/filterDOMProps-BS2lrgFA.cjs +1 -0
  240. package/filterDOMProps-D6KHYVBX.js +24 -0
  241. package/getScrollParent-BhFcYrwL.js +9 -0
  242. package/getScrollParent-DDJu9WHU.cjs +1 -0
  243. package/grid/Grid.d.ts +15 -4
  244. package/grid/GridItem.d.ts +31 -2
  245. package/grid/index.cjs +1 -0
  246. package/grid/index.d.ts +2 -2
  247. package/grid/index.js +8 -0
  248. package/heading/index.cjs +1 -0
  249. package/heading/index.js +4 -0
  250. package/index-CGRFP4CC.js +120 -0
  251. package/index-Dsz3aiWt.cjs +17 -0
  252. package/index.cjs +1 -169
  253. package/index.d.ts +1 -1
  254. package/index.js +129 -29979
  255. package/inertValue-B3AFhVG4.cjs +1 -0
  256. package/inertValue-B7loUihk.js +8 -0
  257. package/info-BZwphdye.js +15 -0
  258. package/info-CIEIENo6.cjs +6 -0
  259. package/info-banner/index.cjs +1 -0
  260. package/info-banner/index.js +4 -0
  261. package/label/InfoPopover.d.ts +9 -0
  262. package/label/LabelWrapper.d.ts +11 -0
  263. package/label/index.cjs +1 -0
  264. package/label/index.d.ts +1 -0
  265. package/label/index.js +4 -0
  266. package/layout/index.cjs +1 -0
  267. package/layout/index.js +8 -0
  268. package/link/index.cjs +1 -0
  269. package/link/index.js +6 -0
  270. package/link-button/index.cjs +1 -0
  271. package/link-button/index.js +6 -0
  272. package/list-box/index.cjs +1 -0
  273. package/list-box/index.js +9 -0
  274. package/logo/index.cjs +1 -0
  275. package/logo/index.js +4 -0
  276. package/modal/index.cjs +1 -0
  277. package/modal/index.js +6 -0
  278. package/number-BE8InLgI.js +6 -0
  279. package/number-E0x3H9cL.cjs +1 -0
  280. package/package.json +4 -4
  281. package/popover/Popover.d.ts +7 -0
  282. package/popover/index.cjs +1 -0
  283. package/popover/index.d.ts +1 -0
  284. package/popover/index.js +4 -0
  285. package/progress-bar/index.cjs +1 -0
  286. package/progress-bar/index.js +4 -0
  287. package/radio/Radio.d.ts +3 -0
  288. package/radio/index.cjs +1 -0
  289. package/radio/index.js +5 -0
  290. package/scrollIntoView-C8doLzDd.cjs +1 -0
  291. package/scrollIntoView-Hwb_aaNf.js +87 -0
  292. package/search-field/index.cjs +1 -0
  293. package/search-field/index.js +4 -0
  294. package/select/index.cjs +1 -0
  295. package/select/index.js +4 -0
  296. package/skeleton/Skeleton.d.ts +5 -0
  297. package/skeleton/index.cjs +1 -0
  298. package/skeleton/index.js +4 -0
  299. package/spinner/index.cjs +1 -0
  300. package/spinner/index.js +4 -0
  301. package/square-arrow-out-up-right-BkyqV2PN.js +15 -0
  302. package/square-arrow-out-up-right-V4Gd08uI.cjs +6 -0
  303. package/table/Table.d.ts +7 -1
  304. package/table/index.cjs +1 -0
  305. package/table/index.js +9 -0
  306. package/tabs/index.cjs +1 -0
  307. package/tabs/index.js +4 -0
  308. package/tag/index.cjs +1 -0
  309. package/tag/index.js +5 -0
  310. package/text/index.cjs +1 -0
  311. package/text/index.js +4 -0
  312. package/textfield/TextFieldBase.d.ts +2 -0
  313. package/textfield/index.cjs +1 -0
  314. package/textfield/index.js +7 -0
  315. package/theme/index.cjs +1 -0
  316. package/theme/index.d.ts +4 -0
  317. package/{theme.js → theme/index.js} +2 -2
  318. package/theme/tokens.d.ts +10 -0
  319. package/toast/index.cjs +1 -0
  320. package/toast/index.js +9 -0
  321. package/toggle-button/index.cjs +1 -0
  322. package/toggle-button/index.js +5 -0
  323. package/tokens-p6pg1Cea.cjs +1 -0
  324. package/{tokens-C0U7hdoO.js → tokens-xp-7KMK7.js} +18 -8
  325. package/tooltip/index.cjs +1 -0
  326. package/tooltip/index.js +5 -0
  327. package/triangle-alert-DJW8U7jL.cjs +6 -0
  328. package/triangle-alert-wxyxspAl.js +21 -0
  329. package/useButton-B8dB9sot.js +47 -0
  330. package/useButton-cpNi-fY4.cjs +1 -0
  331. package/useControlledState-D0L6S_5r.cjs +1 -0
  332. package/useControlledState-u436Wbp1.js +30 -0
  333. package/useDateFormatter-CnxoJ4jF.cjs +1 -0
  334. package/useDateFormatter-EHm4auIg.js +1571 -0
  335. package/useEvent-DxBxMX2V.cjs +1 -0
  336. package/useEvent-IsD2Awnh.js +21 -0
  337. package/useField-CXKYU74k.cjs +1 -0
  338. package/useField-DvpGZkw_.js +35 -0
  339. package/useFilter-BTgDWHVx.cjs +1 -0
  340. package/useFilter-CUq74PQ2.js +35 -0
  341. package/useFocusRing-CbImDrwF.cjs +1 -0
  342. package/useFocusRing-XnR3cZjO.js +82 -0
  343. package/useFocusable-C8uh8K4g.js +125 -0
  344. package/useFocusable-NUVSFcRC.cjs +1 -0
  345. package/useFormValidation-BIGzfO9h.js +215 -0
  346. package/useFormValidation-ClximP89.cjs +1 -0
  347. package/useHasTabbableChild-C-1mZUQe.js +34 -0
  348. package/useHasTabbableChild-DCBTulUQ.cjs +1 -0
  349. package/useHighlightSelectionDescription-CnBDT86u.js +567 -0
  350. package/useHighlightSelectionDescription-CzYucm61.cjs +1 -0
  351. package/useHover-DjIHtjGN.js +490 -0
  352. package/useHover-_mv5J4_q.cjs +1 -0
  353. package/useLabels-BDwkBYbE.js +17 -0
  354. package/useLabels-BLOfc6Y-.cjs +1 -0
  355. package/useListState-Bx8u4IFG.cjs +1 -0
  356. package/useListState-CrZFZffI.js +132 -0
  357. package/useLocalizedStringFormatter-BKoxGZf1.js +96 -0
  358. package/useLocalizedStringFormatter-BsxLt89S.cjs +1 -0
  359. package/useLocalizedStringFormatter-D3JQyjb4.js +21 -0
  360. package/useLocalizedStringFormatter-ioacM-Yt.cjs +1 -0
  361. package/useObserveElement-BdI4zgd7.js +27 -0
  362. package/useObserveElement-MhzEsCkX.cjs +1 -0
  363. package/usePress-0AjDbW9R.cjs +7 -0
  364. package/usePress-CNjmDzap.js +542 -0
  365. package/useSingleSelectListState-0AGHxvy3.js +34 -0
  366. package/useSingleSelectListState-Cl3KV5E1.cjs +1 -0
  367. package/useTextField--czJtyNd.cjs +1 -0
  368. package/useTextField-Cw-33OP_.js +86 -0
  369. package/useToggleState-Bz5rAf4C.js +18 -0
  370. package/useToggleState-DoIkSQdj.cjs +1 -0
  371. package/useUpdateEffect-C5YQs_1w.cjs +1 -0
  372. package/useUpdateEffect-CCDx8D4X.js +13 -0
  373. package/utils-BNtZbAib.cjs +1 -0
  374. package/utils-DIMfEPAt.js +308 -0
  375. package/x-H8Zrx8-x.cjs +6 -0
  376. package/x-JK7i-TQC.js +14 -0
  377. package/flex/Flex.d.ts +0 -17
  378. package/flex/FlexItem.d.ts +0 -15
  379. package/flex/index.d.ts +0 -2
  380. package/index.css +0 -1
  381. package/theme.cjs +0 -1
  382. package/tokens-COoF1t17.cjs +0 -1
  383. /package/{global.css → assets/global.css} +0 -0
@@ -0,0 +1,646 @@
1
+ import { jsx as a, jsxs as b, Fragment as T } from "react/jsx-runtime";
2
+ import * as k from "react";
3
+ import v, { useMemo as F, useState as D, useCallback as E, useEffect as L, useRef as O } from "react";
4
+ import { c as P } from "./clsx-OuTLNxxd.js";
5
+ import { c as K, e as A, n as q, l as z } from "./utils-DIMfEPAt.js";
6
+ import { a as R, $ as j, T as G } from "./Tag-Du7GvSv2.js";
7
+ import { $ as W } from "./TextField-C-hTPukq.js";
8
+ import { c as H } from "./Collection-Brgjpkne.js";
9
+ import { C as B } from "./Checkbox-5HINZdGu.js";
10
+ import { L as U, c as X, a as J, b as Q } from "./ListBoxSection-C0BGnpB4.js";
11
+ import { C as Y } from "./check-CLF6Yxza.js";
12
+ import { s as Z } from "./useHover-DjIHtjGN.js";
13
+ import { o as ee, p as te } from "./Dialog-D14MbJ7o.js";
14
+ import { $ as le, a as oe } from "./ListKeyboardDelegate-DNI8GQtX.js";
15
+ import { g as ae } from "./SelectionManager-B4ORduja.js";
16
+ import { $ as ne } from "./filterDOMProps-D6KHYVBX.js";
17
+ import { $ as ie } from "./useField-DvpGZkw_.js";
18
+ import { $ as re, a as ce, b as se } from "./useFormValidation-BIGzfO9h.js";
19
+ import { $ as de } from "./useListState-CrZFZffI.js";
20
+ import { u as ue } from "./useObserveElement-BdI4zgd7.js";
21
+ import { a as fe } from "./VisuallyHidden-ZCYf65q4.js";
22
+ import { a as me, L as pe } from "./Label-BwJrdqEE.js";
23
+ import { T as be } from "./Text-jWWg0B20.js";
24
+ import { L as he } from "./ListBoxButton-D_J3jlP0.js";
25
+ import { X as ge } from "./x-JK7i-TQC.js";
26
+ import { $ as ye } from "./useButton-B8dB9sot.js";
27
+ import { C as $e } from "./chevron-down-Cd1bkzXT.js";
28
+ import { $ as xe, F as ve } from "./FieldError-CAcjosk_.js";
29
+ import './assets/Select.css';function V(e) {
30
+ return null;
31
+ }
32
+ V.getCollectionNode = function* (t, n) {
33
+ let { childItems: r, title: o, children: i } = t, l = t.title || t.children, d = t.textValue || (typeof l == "string" ? l : "") || t["aria-label"] || "";
34
+ !d && !(n != null && n.suppressTextValueWarning) && process.env.NODE_ENV !== "production" && console.warn("<Item> with non-plain text contents is unsupported by type to select for accessibility. Please add a `textValue` prop."), yield {
35
+ type: "item",
36
+ props: t,
37
+ rendered: l,
38
+ textValue: d,
39
+ "aria-label": t["aria-label"],
40
+ hasChildNodes: Se(t),
41
+ *childNodes() {
42
+ if (r) for (let c of r) yield {
43
+ type: "item",
44
+ value: c
45
+ };
46
+ else if (o) {
47
+ let c = [];
48
+ v.Children.forEach(i, (u) => {
49
+ c.push({
50
+ type: "item",
51
+ element: u
52
+ });
53
+ }), yield* c;
54
+ }
55
+ }
56
+ };
57
+ };
58
+ function Se(e) {
59
+ return e.hasChildItems != null ? e.hasChildItems : !!(e.childItems || e.title && v.Children.count(e.children) > 0);
60
+ }
61
+ let _ = V;
62
+ function I(e) {
63
+ return null;
64
+ }
65
+ I.getCollectionNode = function* (t) {
66
+ let { children: n, title: r, items: o } = t;
67
+ yield {
68
+ type: "section",
69
+ props: t,
70
+ hasChildNodes: !0,
71
+ rendered: r,
72
+ "aria-label": t["aria-label"],
73
+ *childNodes() {
74
+ if (typeof n == "function") {
75
+ if (!o) throw new Error("props.children was a function but props.items is missing");
76
+ for (let i of o) yield {
77
+ type: "item",
78
+ value: i,
79
+ renderer: n
80
+ };
81
+ } else {
82
+ let i = [];
83
+ v.Children.forEach(n, (l) => {
84
+ i.push({
85
+ type: "item",
86
+ element: l
87
+ });
88
+ }), yield* i;
89
+ }
90
+ }
91
+ };
92
+ };
93
+ let Ce = I;
94
+ const Ke = "_wrapper_1rlqo_10", _e = "_trigger_1rlqo_21", we = "_medium_1rlqo_35", ke = "_icon_1rlqo_71", Pe = "_tagGroup_1rlqo_77", Be = "_listBoxItemCheckmark_1rlqo_93", Ve = "_triggerContainer_1rlqo_98", Ie = "_selectValueTag_1rlqo_104", Ne = "_clearButton_1rlqo_120", Me = "_truncate_1rlqo_132", Te = "_checkboxContainer_1rlqo_169", p = {
95
+ wrapper: Ke,
96
+ trigger: _e,
97
+ medium: we,
98
+ icon: ke,
99
+ tagGroup: Pe,
100
+ listBoxItemCheckmark: Be,
101
+ triggerContainer: Ve,
102
+ selectValueTag: Ie,
103
+ clearButton: Ne,
104
+ truncate: Me,
105
+ checkboxContainer: Te
106
+ }, N = ({ item: e }) => /* @__PURE__ */ a(
107
+ J,
108
+ {
109
+ ...e.value,
110
+ textValue: e.textValue,
111
+ children: ({ isDisabled: t, isSelected: n, selectionMode: r }) => /* @__PURE__ */ b(T, { children: [
112
+ r === "multiple" ? /* @__PURE__ */ a("div", { className: p.checkboxContainer, children: /* @__PURE__ */ a(
113
+ B,
114
+ {
115
+ isDisabled: t,
116
+ isSelected: n,
117
+ isReadOnly: !0,
118
+ excludeFromTabOrder: !0,
119
+ "aria-label": e.textValue
120
+ }
121
+ ) }) : null,
122
+ e.rendered,
123
+ n && r === "single" ? /* @__PURE__ */ a(
124
+ Y,
125
+ {
126
+ size: 20,
127
+ className: p.listBoxItemCheckmark
128
+ }
129
+ ) : null
130
+ ] })
131
+ }
132
+ ), Fe = ({ section: e, state: t }) => /* @__PURE__ */ a(X, { ...e.value, children: t.collection.getChildren ? /* @__PURE__ */ a(H, { items: t.collection.getChildren(e.key), children: (n) => /* @__PURE__ */ a(N, { item: n }) }) : null }), De = ({
133
+ state: e,
134
+ ...t
135
+ }) => /* @__PURE__ */ a(
136
+ U,
137
+ {
138
+ ...t,
139
+ ...e,
140
+ escapeKeyBehavior: "none",
141
+ onSelectionChange: e.setSelectedKeys,
142
+ items: e.collection,
143
+ children: (n) => n.type === "section" ? /* @__PURE__ */ a(
144
+ Fe,
145
+ {
146
+ state: e,
147
+ section: n
148
+ }
149
+ ) : /* @__PURE__ */ a(N, { item: n })
150
+ }
151
+ );
152
+ function Ee(e, t, n) {
153
+ const { disallowEmptySelection: r, isDisabled: o } = e, i = le({ usage: "search", sensitivity: "base" }), l = F(
154
+ () => new oe(
155
+ t.collection,
156
+ t.disabledKeys,
157
+ null,
158
+ i
159
+ ),
160
+ [t.collection, t.disabledKeys, i]
161
+ ), { menuTriggerProps: d, menuProps: c } = ee(
162
+ {
163
+ isDisabled: o,
164
+ type: "listbox"
165
+ },
166
+ t,
167
+ n
168
+ ), u = (f) => {
169
+ const { selectedKeys: x, selectionMode: M } = t, C = x.values().next().value;
170
+ if (M === "single")
171
+ switch (f.key) {
172
+ case "ArrowLeft": {
173
+ f.preventDefault();
174
+ const y = x.size > 0 ? l.getKeyAbove(C) : l.getFirstKey();
175
+ y && t.setSelectedKeys([y]);
176
+ break;
177
+ }
178
+ case "ArrowRight": {
179
+ f.preventDefault();
180
+ const y = x.size > 0 ? l.getKeyBelow(C) : l.getFirstKey();
181
+ y && t.setSelectedKeys([y]);
182
+ break;
183
+ }
184
+ }
185
+ }, { typeSelectProps: s } = ae({
186
+ keyboardDelegate: l,
187
+ selectionManager: t.selectionManager,
188
+ onTypeSelect(f) {
189
+ t.setSelectedKeys([f]);
190
+ }
191
+ }), { labelProps: g, fieldProps: m } = ie({
192
+ ...e,
193
+ labelElementType: "span"
194
+ });
195
+ s.onKeyDown = s.onKeyDownCapture, delete s.onKeyDownCapture;
196
+ const $ = ne(e, { labelable: !0 }), h = K(s, d, m), S = A();
197
+ return {
198
+ labelProps: {
199
+ ...g,
200
+ onClick: () => {
201
+ var f;
202
+ e.isDisabled || ((f = n.current) == null || f.focus(), Z("keyboard"));
203
+ }
204
+ },
205
+ triggerProps: K($, {
206
+ ...h,
207
+ onKeyDown: q(
208
+ h.onKeyDown,
209
+ u,
210
+ e.onKeyDown
211
+ ),
212
+ onKeyUp: e.onKeyUp,
213
+ "aria-labelledby": [
214
+ h["aria-labelledby"],
215
+ h["aria-label"] && !h["aria-labelledby"] ? h.id : null,
216
+ S
217
+ ].filter(Boolean).join(" "),
218
+ onFocus(f) {
219
+ t.isFocused || (e.onFocus && e.onFocus(f), t.setFocused(!0));
220
+ },
221
+ onBlur(f) {
222
+ t.isOpen || (e.onBlur && e.onBlur(f), t.setFocused(!1));
223
+ }
224
+ }),
225
+ valueProps: {
226
+ id: S
227
+ },
228
+ menuProps: {
229
+ ...c,
230
+ disallowEmptySelection: r,
231
+ autoFocus: t.focusStrategy || !0,
232
+ shouldSelectOnPressUp: !0,
233
+ shouldFocusOnHover: !0,
234
+ onBlur: (f) => {
235
+ f.currentTarget.contains(f.relatedTarget) || (e.onBlur && e.onBlur(f), t.setFocused(!1));
236
+ },
237
+ "aria-labelledby": [
238
+ m["aria-labelledby"],
239
+ h["aria-label"] && !m["aria-labelledby"] ? h.id : null
240
+ ].filter(Boolean).join(" ")
241
+ }
242
+ };
243
+ }
244
+ function Le(e) {
245
+ const {
246
+ collection: t,
247
+ disabledKeys: n,
248
+ selectionManager: r,
249
+ selectionManager: { setSelectedKeys: o, selectedKeys: i, selectionMode: l }
250
+ } = de(e), d = [], c = i.size !== 0 ? Array.from(i).map((u) => {
251
+ const s = t.getItem(u);
252
+ return s || d.push(u), s;
253
+ }).filter(Boolean) : null;
254
+ return d.length && console.warn(
255
+ `Select: Keys "${d.join(
256
+ ", "
257
+ )}" passed to "selectedKeys" are not present in the collection.`
258
+ ), {
259
+ collection: t,
260
+ disabledKeys: n,
261
+ selectionManager: r,
262
+ selectionMode: l,
263
+ selectedKeys: i,
264
+ setSelectedKeys: o.bind(r),
265
+ selectedItems: c
266
+ };
267
+ }
268
+ function Oe(e) {
269
+ const [t, n] = D(!1), r = te(e), o = e.selectionMode === "single", i = Le({
270
+ ...e,
271
+ onSelectionChange: (s) => {
272
+ e.onSelectionChange && e.onSelectionChange(s), o && r.close();
273
+ }
274
+ }), l = re({
275
+ ...e,
276
+ validationBehavior: "native",
277
+ value: i.selectedKeys
278
+ }), d = i.collection.size === 0, c = !!i.selectedKeys.size, u = E(() => {
279
+ l.resetValidation(), l.commitValidation();
280
+ }, [l]);
281
+ return L(() => {
282
+ o && c && u();
283
+ }, [c, o, u]), {
284
+ ...i,
285
+ ...r,
286
+ close() {
287
+ r.close(), c && u();
288
+ },
289
+ open() {
290
+ d || r.open();
291
+ },
292
+ toggle(s) {
293
+ d || r.toggle(s);
294
+ },
295
+ isFocused: t,
296
+ setFocused: n,
297
+ ...l
298
+ };
299
+ }
300
+ function Ae({
301
+ autoComplete: e,
302
+ name: t,
303
+ isDisabled: n,
304
+ isRequired: r,
305
+ selectRef: o
306
+ }, i, l) {
307
+ const { visuallyHiddenProps: d } = fe();
308
+ return ce(o, i.selectedKeys, i.setSelectedKeys), se(
309
+ {
310
+ validationBehavior: "native",
311
+ focus: () => {
312
+ var c;
313
+ return (c = l.current) == null ? void 0 : c.focus();
314
+ }
315
+ },
316
+ i,
317
+ o
318
+ ), {
319
+ containerProps: {
320
+ ...d,
321
+ "aria-hidden": !0,
322
+ // @ts-expect-error - data-a11y-ignore is not a standard attribute
323
+ "data-react-aria-prevent-focus": !0,
324
+ "data-a11y-ignore": "aria-hidden-focus"
325
+ },
326
+ inputProps: {
327
+ style: { display: "none" }
328
+ },
329
+ selectProps: {
330
+ tabIndex: -1,
331
+ autoComplete: e,
332
+ disabled: n,
333
+ required: r,
334
+ name: t,
335
+ value: Array.from(i.selectedKeys).map((c) => c.toString()),
336
+ onChange: (c) => i.setSelectedKeys(c.target.value),
337
+ multiple: !0
338
+ }
339
+ };
340
+ }
341
+ function qe(e) {
342
+ const { state: t, triggerRef: n, name: r, isDisabled: o } = e, i = `${e.label}-hidden`, l = O(null), { containerProps: d, selectProps: c } = Ae(
343
+ { ...e, selectRef: l },
344
+ t,
345
+ n
346
+ );
347
+ return t.collection.size <= 300 ? /* @__PURE__ */ a(
348
+ "div",
349
+ {
350
+ ...d,
351
+ "data-testid": "hidden-select-container",
352
+ children: /* @__PURE__ */ b("label", { children: [
353
+ i,
354
+ /* @__PURE__ */ b(
355
+ "select",
356
+ {
357
+ ...c,
358
+ ref: l,
359
+ children: [
360
+ /* @__PURE__ */ a("option", {}),
361
+ [...t.collection.getKeys()].map((u) => {
362
+ const s = t.collection.getItem(u);
363
+ return s && s.type === "item" ? /* @__PURE__ */ a(
364
+ "option",
365
+ {
366
+ value: s.key,
367
+ children: s.textValue
368
+ },
369
+ s.key
370
+ ) : null;
371
+ })
372
+ ]
373
+ }
374
+ )
375
+ ] })
376
+ }
377
+ ) : r ? /* @__PURE__ */ a(
378
+ "input",
379
+ {
380
+ type: "hidden",
381
+ autoComplete: c.autoComplete,
382
+ name: r,
383
+ disabled: o,
384
+ value: Array.from(t.selectedKeys).map((u) => u.toString()) ?? [""]
385
+ }
386
+ ) : null;
387
+ }
388
+ const ze = ({
389
+ state: { selectedItems: e },
390
+ isDisabled: t,
391
+ parentWidth: n,
392
+ onClear: r,
393
+ triggerRef: o,
394
+ isClearable: i
395
+ }) => /* @__PURE__ */ b(
396
+ "div",
397
+ {
398
+ className: p.selectValueTag,
399
+ "data-disabled": t || void 0,
400
+ children: [
401
+ /* @__PURE__ */ a(
402
+ "span",
403
+ {
404
+ className: p.truncate,
405
+ style: { maxWidth: n - 92 },
406
+ children: e != null && e.length && e.length > 1 ? `${e.length} valda` : e == null ? void 0 : e[0].textValue
407
+ }
408
+ ),
409
+ i && /* @__PURE__ */ a(
410
+ "button",
411
+ {
412
+ disabled: t,
413
+ "aria-label": "Rensa alla",
414
+ className: p.clearButton,
415
+ onClick: () => {
416
+ var l;
417
+ r(), (l = o == null ? void 0 : o.current) == null || l.focus();
418
+ },
419
+ children: /* @__PURE__ */ a(
420
+ ge,
421
+ {
422
+ width: 20,
423
+ height: 20
424
+ }
425
+ )
426
+ }
427
+ )
428
+ ]
429
+ }
430
+ ), Re = ({
431
+ autoFocus: e,
432
+ excludeFromTabOrder: t,
433
+ isDisabled: n,
434
+ size: r = "large",
435
+ isOpen: o,
436
+ isInvalid: i,
437
+ selectionMode: l,
438
+ state: { selectedItems: d },
439
+ placeholder: c,
440
+ children: u,
441
+ triggerRef: s,
442
+ ...g
443
+ }) => {
444
+ const { buttonProps: m } = ye(
445
+ { autoFocus: e, excludeFromTabOrder: t, isDisabled: n, ...g },
446
+ s
447
+ ), $ = l === "multiple";
448
+ return /* @__PURE__ */ b(
449
+ "div",
450
+ {
451
+ className: p.triggerContainer,
452
+ "data-disabled": n || void 0,
453
+ children: [
454
+ /* @__PURE__ */ b(
455
+ "button",
456
+ {
457
+ ...m,
458
+ autoFocus: e,
459
+ className: P(p.trigger, {
460
+ [p.medium]: r === "medium"
461
+ }),
462
+ "data-disabled": n || void 0,
463
+ "data-invalid": i || void 0,
464
+ "data-open": o || void 0,
465
+ ref: s,
466
+ type: "button",
467
+ children: [
468
+ $ && !d ? /* @__PURE__ */ a("span", { children: c }) : null,
469
+ $ ? null : /* @__PURE__ */ a("span", { children: d ? d[0].textValue : c }),
470
+ /* @__PURE__ */ a(
471
+ "div",
472
+ {
473
+ className: p.icon,
474
+ "aria-hidden": "true",
475
+ children: /* @__PURE__ */ a($e, { size: 20 })
476
+ }
477
+ )
478
+ ]
479
+ }
480
+ ),
481
+ u
482
+ ]
483
+ }
484
+ );
485
+ }, w = ({
486
+ state: e,
487
+ errorMessage: t
488
+ }) => /* @__PURE__ */ a(xe.Provider, { value: { ...e.displayValidation }, children: /* @__PURE__ */ a(ve, { children: t }) }), je = k.forwardRef(
489
+ ({ isClearable: e = !0, popover: t, ...n }, r) => {
490
+ const o = {
491
+ selectionMode: "single",
492
+ errorPosition: "top",
493
+ disallowEmptySelection: !e,
494
+ isClearable: e,
495
+ size: "large",
496
+ popover: t,
497
+ ...n
498
+ }, i = z(r), l = Oe(o), { labelProps: d, triggerProps: c, valueProps: u, menuProps: s } = Ee(
499
+ o,
500
+ l,
501
+ i
502
+ ), { width: g } = ue(i.current, {
503
+ includePadding: !0
504
+ });
505
+ return /* @__PURE__ */ b(
506
+ W,
507
+ {
508
+ ...o,
509
+ className: P(p.wrapper, o.className),
510
+ children: [
511
+ /* @__PURE__ */ a(
512
+ qe,
513
+ {
514
+ ...o,
515
+ state: l,
516
+ triggerRef: i
517
+ }
518
+ ),
519
+ /* @__PURE__ */ a(me, { popover: t, children: o.label && /* @__PURE__ */ a(
520
+ pe,
521
+ {
522
+ ...d,
523
+ "data-disabled": o.isDisabled || void 0,
524
+ children: o.label
525
+ }
526
+ ) }),
527
+ o.description && /* @__PURE__ */ a(be, { slot: "description", children: o.description }),
528
+ o.errorPosition === "top" && /* @__PURE__ */ a(
529
+ w,
530
+ {
531
+ ...o,
532
+ state: l
533
+ }
534
+ ),
535
+ /* @__PURE__ */ a(
536
+ Re,
537
+ {
538
+ ...o,
539
+ ...c,
540
+ isInvalid: l.displayValidation.isInvalid,
541
+ triggerRef: i,
542
+ state: l,
543
+ children: o.selectionMode === "multiple" && l.selectedItems ? /* @__PURE__ */ a("span", { ...u, children: /* @__PURE__ */ a(
544
+ ze,
545
+ {
546
+ ...o,
547
+ state: l,
548
+ parentWidth: g,
549
+ onClear: () => l.selectionManager.clearSelection(),
550
+ triggerRef: i
551
+ }
552
+ ) }) : null
553
+ }
554
+ ),
555
+ o.errorPosition === "bottom" && /* @__PURE__ */ a(
556
+ w,
557
+ {
558
+ ...o,
559
+ state: l
560
+ }
561
+ ),
562
+ /* @__PURE__ */ b(
563
+ Q,
564
+ {
565
+ isOpen: l.isOpen,
566
+ onOpenChange: (m) => {
567
+ m || l.close();
568
+ },
569
+ triggerRef: i,
570
+ style: { width: g },
571
+ children: [
572
+ o.isSelectableAll && /* @__PURE__ */ b(
573
+ he,
574
+ {
575
+ onClick: () => l.selectionManager.toggleSelectAll(),
576
+ children: [
577
+ /* @__PURE__ */ a("div", { className: p.checkboxContainer, children: /* @__PURE__ */ a(
578
+ B,
579
+ {
580
+ isSelected: l.selectionManager.isSelectAll,
581
+ isIndeterminate: !l.selectionManager.isSelectAll && !l.selectionManager.isEmpty,
582
+ isReadOnly: !0,
583
+ excludeFromTabOrder: !0
584
+ }
585
+ ) }),
586
+ /* @__PURE__ */ a("span", { children: "Select All" })
587
+ ]
588
+ }
589
+ ),
590
+ /* @__PURE__ */ a(
591
+ De,
592
+ {
593
+ ...s,
594
+ state: l
595
+ }
596
+ )
597
+ ]
598
+ }
599
+ ),
600
+ o.showTags && !!l.selectedItems && /* @__PURE__ */ a(
601
+ R,
602
+ {
603
+ "aria-label": "Selected Items",
604
+ selectionBehavior: "toggle",
605
+ onRemove: (m) => l.selectionManager.toggleSelection(Array.from(m)[0]),
606
+ className: p.tagGroup,
607
+ children: /* @__PURE__ */ a(j, { items: l.selectedItems, children: (m) => /* @__PURE__ */ a(
608
+ G,
609
+ {
610
+ textValue: m.textValue,
611
+ id: m.key,
612
+ dismissable: !0,
613
+ isDisabled: o.isDisabled,
614
+ children: m.textValue
615
+ },
616
+ m.key
617
+ ) })
618
+ }
619
+ )
620
+ ]
621
+ }
622
+ );
623
+ }
624
+ ), Ge = k.forwardRef(
625
+ ({ options: e, ...t }, n) => /* @__PURE__ */ a(
626
+ je,
627
+ {
628
+ ...t,
629
+ items: e,
630
+ ref: n,
631
+ children: (r) => r.children ? /* @__PURE__ */ a(
632
+ Ce,
633
+ {
634
+ items: r.children,
635
+ title: r.name,
636
+ children: (o) => /* @__PURE__ */ a(_, { textValue: o.textValue, children: o.name })
637
+ },
638
+ r.name
639
+ ) : /* @__PURE__ */ a(_, { textValue: r.textValue, children: r.name })
640
+ }
641
+ )
642
+ );
643
+ Ge.displayName = "Select";
644
+ export {
645
+ Ge as S
646
+ };