@midas-ds/components 14.0.0 → 14.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (290) hide show
  1. package/AccordionItem-CAi-XFOc.js +343 -0
  2. package/AccordionItem-tWS22wDv.cjs +1 -0
  3. package/{Breadcrumbs-DpUPChG9.cjs → Breadcrumbs-BBDGxc68.cjs} +1 -1
  4. package/{Breadcrumbs-CV3rVTjR.js → Breadcrumbs-BenPNv8Z.js} +4 -4
  5. package/Button-1sEX8jKn.cjs +1 -0
  6. package/{Button-xc8A29pm.cjs → Button-BEWKXjlP.cjs} +1 -1
  7. package/{Button-CRIYvCRM.js → Button-CF97piBl.js} +1 -1
  8. package/{Button-B6lxIKPk.js → Button-CGe3Nyos.js} +121 -115
  9. package/CHANGELOG.md +26 -0
  10. package/{Card-CfosvMF5.js → Card-DJ8E5Rzd.js} +3 -3
  11. package/{Card-D2E3gviQ.cjs → Card-Db9xdzJ0.cjs} +1 -1
  12. package/{CharacterCounter-C-PFKoGg.cjs → CharacterCounter-CTpQ12f7.cjs} +1 -1
  13. package/{CharacterCounter-DpFONstE.js → CharacterCounter-gbDGfize.js} +2 -2
  14. package/Checkbox-BgrLxY6P.cjs +1 -0
  15. package/{Checkbox-Cr3MmHPE.js → Checkbox-CdN1D5pD.js} +94 -90
  16. package/{CheckboxGroup-DEY3JDEL.js → CheckboxGroup-B1b-6bKq.js} +7 -7
  17. package/{CheckboxGroup-f9Oa1MhQ.cjs → CheckboxGroup-BfZyy5yU.cjs} +1 -1
  18. package/{Collection-j_iWeuZo.js → Collection-BkxwF21i.js} +205 -213
  19. package/Collection-vGO6v3_U.cjs +1 -0
  20. package/{ColorSchemeSwitch-Cur7zN5_.cjs → ColorSchemeSwitch-BOooU0iy.cjs} +1 -1
  21. package/{ColorSchemeSwitch-ChFSNntp.js → ColorSchemeSwitch-KjnsdbDr.js} +2 -2
  22. package/{ComboBox-D7eKe-M5.js → ComboBox-D1ZSZ6m-.js} +254 -246
  23. package/ComboBox-Dztk_jtC.cjs +1 -0
  24. package/{DateField-BszKZodr.cjs → DateField-BogEOseq.cjs} +1 -1
  25. package/{DateField-xyhyDy7u.js → DateField-lsr_1fw4.js} +4 -4
  26. package/{DateInputDivider-2Wf2hlXA.js → DateInputDivider-CRv3YuXd.js} +191 -188
  27. package/DateInputDivider-CYqm6PZP.cjs +1 -0
  28. package/{DateRangePicker-YwKi0ukr.js → DateRangePicker-5k1swaEt.js} +119 -115
  29. package/DateRangePicker-CgNXWOT6.cjs +6 -0
  30. package/Dialog-B1N4Ndyx.js +256 -0
  31. package/{Dialog-DOyFzvUa.js → Dialog-BUAp30Wc.js} +712 -694
  32. package/Dialog-BgSxz1JW.cjs +1 -0
  33. package/Dialog-PrnV8KTh.cjs +6 -0
  34. package/{DragAndDrop-DQ_6tl6K.cjs → DragAndDrop-Cs-V-9ak.cjs} +1 -1
  35. package/{DragAndDrop-DPRU3Y0Y.js → DragAndDrop-DF0VoPJw.js} +1 -1
  36. package/{Dropdown-5rmvcHD_.cjs → Dropdown-DBFLb8Tl.cjs} +1 -1
  37. package/{Dropdown-uC9wc8vd.js → Dropdown-DaARa89l.js} +2 -2
  38. package/{FieldError-C4WBoCRc.cjs → FieldError-Cimgm8qD.cjs} +1 -1
  39. package/{FieldError-C4kD4yJZ.js → FieldError-l3xULRa0.js} +3 -3
  40. package/{FileUpload-01wGpykv.js → FileUpload-CN0HNJ_Y.js} +9 -9
  41. package/{FileUpload-CTbh7Gic.cjs → FileUpload-DHmsupSe.cjs} +1 -1
  42. package/Group-B0Wj9pI8.cjs +1 -0
  43. package/Group-BAd7alBM.js +46 -0
  44. package/{Heading-CEx2LJyM.js → Heading-CCoGfKQ8.js} +9 -9
  45. package/{Heading-CUShN98j.cjs → Heading-x7y3xadc.cjs} +1 -1
  46. package/{InfoBanner-CRSz8DK2.js → InfoBanner-BW3vy9mc.js} +1 -1
  47. package/{InfoBanner-D_pNj1J2.cjs → InfoBanner-_M_rGQiu.cjs} +1 -1
  48. package/{Input-CCuE9Sc5.cjs → Input-Bda0PCu5.cjs} +1 -1
  49. package/{Input-CkTOajNJ.js → Input-CQzv-D9g.js} +3 -3
  50. package/{Label-CV9p0K2n.js → Label-BGMXsSFb.js} +4 -4
  51. package/{Label-CkIRTC0_.cjs → Label-CNTODOFg.cjs} +1 -1
  52. package/Layout-BrEuHajQ.cjs +16 -0
  53. package/{Layout-IeVrHpT0.js → Layout-JL9l-y7w.js} +62 -63
  54. package/{Link-BFvUN5Sq.js → Link-BudFjYrw.js} +1 -1
  55. package/{Link-D2K7bDd3.cjs → Link-BvUSTIip.cjs} +1 -1
  56. package/{Link-a3Ymcnoa.cjs → Link-DRU6Qzia.cjs} +1 -1
  57. package/{Link-B9CQXWzE.js → Link-l-nMP-Zd.js} +5 -5
  58. package/{LinkButton-BCn5gR10.cjs → LinkButton-DGdnbTgR.cjs} +1 -1
  59. package/{LinkButton-DN3J1Agu.js → LinkButton-DP9W-E32.js} +1 -1
  60. package/ListBox-TGCxrXIJ.cjs +1 -0
  61. package/{ListBox-2eEa1l0M.js → ListBox-mOCZvKD4.js} +187 -176
  62. package/{ListBoxLoadMoreItem-IcGb_XwN.js → ListBoxLoadMoreItem-CLdTe6-z.js} +3 -3
  63. package/{ListBoxLoadMoreItem-BBE3OF4J.cjs → ListBoxLoadMoreItem-UX0jFQN4.cjs} +1 -1
  64. package/ListBoxSection-BNBHosou.cjs +1 -0
  65. package/{ListBoxSection-dksiACMZ.js → ListBoxSection-D_kTkvgG.js} +139 -140
  66. package/{ListKeyboardDelegate-Dyu4eFtP.js → ListKeyboardDelegate-BHnZMUhW.js} +36 -40
  67. package/ListKeyboardDelegate-CLRlDto7.cjs +1 -0
  68. package/{OverlayArrow-Bh_G2tJ3.js → OverlayArrow-CjGslX2c.js} +2 -2
  69. package/{OverlayArrow-DJ4nNscD.cjs → OverlayArrow-bcrb_syE.cjs} +1 -1
  70. package/{Popover-D7_IfJ3o.js → Popover-CZFi2YGz.js} +2 -2
  71. package/{Popover-BI2Koco0.cjs → Popover-uYTWBGHa.cjs} +1 -1
  72. package/{PressResponder-DUhG97jJ.js → PressResponder-BMj6Zvbn.js} +3 -3
  73. package/{PressResponder-AXK2I_yx.cjs → PressResponder-ChvCuOue.cjs} +1 -1
  74. package/{ProgressBar-B-TOuoAC.cjs → ProgressBar-BGemuJIq.cjs} +1 -1
  75. package/{ProgressBar-B0WEQkyq.js → ProgressBar-DhRmckYM.js} +2 -2
  76. package/{RSPContexts-BW2SEIqe.js → RSPContexts-B0lEq7qq.js} +5 -3
  77. package/RSPContexts-XUvspq3j.cjs +1 -0
  78. package/Radio-Bp_31Z59.js +340 -0
  79. package/Radio-D3RGVrEd.cjs +1 -0
  80. package/{RangeCalendar-D5TMu8GI.js → RangeCalendar-9C96gMvy.js} +58 -58
  81. package/{RangeCalendar-B6zKSDju.cjs → RangeCalendar-ChfmP_ql.cjs} +2 -2
  82. package/{SearchField-wojUSY2S.js → SearchField-DrEdzWAy.js} +3 -3
  83. package/{SearchField-DnBBlPT7.cjs → SearchField-JaDXLq5W.cjs} +1 -1
  84. package/Select-BCUH-Z7q.cjs +1 -0
  85. package/Select-CpPE78Ke.js +676 -0
  86. package/SelectionIndicator-BiSN1toV.cjs +1 -0
  87. package/{FocusScope-8ILtcq9W.js → SelectionIndicator-ant6jeC1.js} +256 -165
  88. package/SelectionManager-C469yQeD.js +1063 -0
  89. package/SelectionManager-uFYC4wpu.cjs +1 -0
  90. package/{Separator--4b7vckr.js → Separator-B6l5qSpR.js} +2 -2
  91. package/{Separator-COlhRmJF.js → Separator-BWAnBMVN.js} +4 -4
  92. package/{Separator-DcbM84B8.cjs → Separator-DbhmtwDa.cjs} +1 -1
  93. package/{Separator-BQkxEZC9.cjs → Separator-J0pLW4BN.cjs} +1 -1
  94. package/Spinner-D6Fcu_Dp.js +54 -0
  95. package/Spinner-DIapnvIz.cjs +6 -0
  96. package/TabList-C0tRVI6Q.cjs +1 -0
  97. package/TabList-DmkxO7MM.js +394 -0
  98. package/Table-BLqjyYKk.cjs +16 -0
  99. package/{Table-cCSOrPkK.js → Table-CyWZO9uf.js} +707 -703
  100. package/Tag-DJqYiBLR.js +774 -0
  101. package/Tag-FDHGu_WP.cjs +1 -0
  102. package/{Text-CkhG15SU.cjs → Text-0wXj3J8E.cjs} +1 -1
  103. package/{Text-BQe1I4-r.js → Text-BBFWBNAH.js} +1 -1
  104. package/{Text-CkhZTTV5.cjs → Text-D5OSv6Uv.cjs} +1 -1
  105. package/{Text-BpERRete.js → Text-bqP9NeVg.js} +1 -1
  106. package/{TextArea-B5TsyJxa.cjs → TextArea-CZxwvBcS.cjs} +1 -1
  107. package/{TextArea-Cado2arG.js → TextArea-CrY7P18c.js} +8 -8
  108. package/{TextField-5AI6T1ol.js → TextField-BWea-IT-.js} +10 -10
  109. package/TextField-DsN-kBfh.cjs +1 -0
  110. package/{Toast-Cs-Uvf1p.cjs → Toast-DUZ5jfG1.cjs} +1 -1
  111. package/{Toast-CgXRE33Y.js → Toast-Di3h8A14.js} +12 -12
  112. package/{ToggleButtonGroup-SKGgfFs4.js → ToggleButtonGroup-Bh4hP6Lk.js} +82 -78
  113. package/ToggleButtonGroup-D7r34GCt.cjs +1 -0
  114. package/{Tooltip-txk48Qof.js → Tooltip-CUdmOznK.js} +4 -4
  115. package/{Tooltip-BrupFzaI.cjs → Tooltip-D-ATlbIM.cjs} +1 -1
  116. package/{VisuallyHidden-Awup6QxT.cjs → VisuallyHidden-BMelU6B0.cjs} +1 -1
  117. package/{VisuallyHidden-D2ZXHTJs.js → VisuallyHidden-DuW70K-5.js} +1 -1
  118. package/accordion/index.cjs +1 -1
  119. package/accordion/index.js +1 -1
  120. package/assets/AccordionItem.css +1 -1
  121. package/assets/RangeCalendar.css +1 -1
  122. package/assets/Spinner.css +1 -1
  123. package/assets/TabList.css +1 -1
  124. package/assets/default.css +1 -1
  125. package/breadcrumbs/index.cjs +1 -1
  126. package/breadcrumbs/index.js +1 -1
  127. package/button/index.cjs +1 -1
  128. package/button/index.js +1 -1
  129. package/calendar/index.cjs +1 -1
  130. package/calendar/index.js +1 -1
  131. package/card/index.cjs +1 -1
  132. package/card/index.js +1 -1
  133. package/character-counter/index.cjs +1 -1
  134. package/character-counter/index.js +1 -1
  135. package/checkbox/index.cjs +1 -1
  136. package/checkbox/index.js +2 -2
  137. package/color-scheme-switch/index.cjs +1 -1
  138. package/color-scheme-switch/index.js +1 -1
  139. package/combobox/index.cjs +1 -1
  140. package/combobox/index.js +1 -1
  141. package/date-field/index.cjs +1 -1
  142. package/date-field/index.js +2 -2
  143. package/date-picker/index.cjs +1 -1
  144. package/date-picker/index.js +1 -1
  145. package/dropdown/index.cjs +1 -1
  146. package/dropdown/index.js +1 -1
  147. package/field-error/index.cjs +1 -1
  148. package/field-error/index.js +1 -1
  149. package/file-upload/index.cjs +1 -1
  150. package/file-upload/index.js +1 -1
  151. package/{getScrollParent-Ru2U2LlM.js → getScrollParent-DFCzfqHG.js} +1 -1
  152. package/{getScrollParent-DuKmPmUa.cjs → getScrollParent-DjULaF_q.cjs} +1 -1
  153. package/heading/index.cjs +1 -1
  154. package/heading/index.js +1 -1
  155. package/index.cjs +1 -1
  156. package/index.js +42 -42
  157. package/info-banner/index.cjs +1 -1
  158. package/info-banner/index.js +1 -1
  159. package/label/index.cjs +1 -1
  160. package/label/index.js +1 -1
  161. package/layout/index.cjs +1 -1
  162. package/layout/index.js +1 -1
  163. package/link/index.cjs +1 -1
  164. package/link/index.js +2 -2
  165. package/link-button/index.cjs +1 -1
  166. package/link-button/index.js +2 -2
  167. package/list-box/index.cjs +1 -1
  168. package/list-box/index.js +2 -2
  169. package/menu/index.cjs +1 -1
  170. package/menu/index.js +2 -2
  171. package/modal/index.cjs +1 -1
  172. package/modal/index.js +2 -2
  173. package/package.json +4 -4
  174. package/popover/index.cjs +1 -1
  175. package/popover/index.js +1 -1
  176. package/progress-bar/index.cjs +1 -1
  177. package/progress-bar/index.js +1 -1
  178. package/radio/index.cjs +1 -1
  179. package/radio/index.js +1 -1
  180. package/scrollIntoView-BVI21Y4-.js +65 -0
  181. package/scrollIntoView-BueMOyGp.cjs +1 -0
  182. package/search-field/index.cjs +1 -1
  183. package/search-field/index.js +1 -1
  184. package/select/index.cjs +1 -1
  185. package/select/index.js +1 -1
  186. package/select/types.d.ts +1 -1
  187. package/select/useMultiSelect.d.ts +2 -2
  188. package/spinner/Spinner.d.ts +5 -1
  189. package/spinner/index.cjs +1 -1
  190. package/spinner/index.js +1 -1
  191. package/table/index.cjs +1 -1
  192. package/table/index.js +1 -1
  193. package/tabs/Tabs.d.ts +2 -9
  194. package/tabs/index.cjs +1 -1
  195. package/tabs/index.d.ts +0 -1
  196. package/tabs/index.js +1 -1
  197. package/tag/index.cjs +1 -1
  198. package/tag/index.js +1 -1
  199. package/text/index.cjs +1 -1
  200. package/text/index.js +1 -1
  201. package/textfield/TextArea.d.ts +3 -2
  202. package/textfield/TextField.d.ts +3 -2
  203. package/textfield/index.cjs +1 -1
  204. package/textfield/index.js +1 -1
  205. package/toast/index.cjs +1 -1
  206. package/toast/index.js +1 -1
  207. package/toggle-button/index.cjs +1 -1
  208. package/toggle-button/index.js +1 -1
  209. package/tooltip/index.cjs +1 -1
  210. package/tooltip/index.js +1 -1
  211. package/{useButton-Bh3duhYL.cjs → useButton-C0r5nrqs.cjs} +1 -1
  212. package/{useButton-A-VOfwuT.js → useButton-CRgN6aZf.js} +2 -2
  213. package/useDateFormatter-BrrFo4nY.cjs +1 -0
  214. package/{useDateFormatter-CxlJTAki.js → useDateFormatter-Bs5A6Xtu.js} +353 -322
  215. package/{useField-sSWPm-He.js → useField-BhJ9dM2g.js} +1 -1
  216. package/{useField-CY4OYE5a.cjs → useField-DvszkIMx.cjs} +1 -1
  217. package/{useFilter-DHcouDzv.js → useFilter-BdUU-HQZ.js} +1 -1
  218. package/{useFilter-DlZLqsJD.cjs → useFilter-R2IPvbS8.cjs} +1 -1
  219. package/{useFocusRing-Cig5Y0l-.cjs → useFocusRing-C-XVcAE5.cjs} +1 -1
  220. package/{useFocusRing-Copf_tx8.js → useFocusRing-CcxI7nbg.js} +2 -2
  221. package/{useFocusWithin-BKopz9sr.js → useFocusWithin-DhXBuB2O.js} +1 -1
  222. package/{useFocusWithin-TryC2Kkw.cjs → useFocusWithin-GBjoTL5o.cjs} +1 -1
  223. package/{useFocusable-CCh54GIw.js → useFocusable-BJj-Bkig.js} +3 -3
  224. package/{useFocusable-DhdAtEw8.cjs → useFocusable-M4se1KJt.cjs} +1 -1
  225. package/{useFormValidation-DdIIVZ5j.js → useFormValidation-By7G-T7y.js} +1 -1
  226. package/{useFormValidation-BJNizNDf.cjs → useFormValidation-DV2Ioblb.cjs} +1 -1
  227. package/useHasTabbableChild-CIZGg_iG.cjs +1 -0
  228. package/{useHasTabbableChild-BbgOpdGQ.js → useHasTabbableChild-CnpSoDuJ.js} +1 -1
  229. package/{useHighlightSelectionDescription-D6F-YO6b.cjs → useHighlightSelectionDescription-CBZfyrhy.cjs} +1 -1
  230. package/{useHighlightSelectionDescription-BL_02EKv.js → useHighlightSelectionDescription-DPiqOr_Z.js} +2 -2
  231. package/{useHover-eU40luVI.cjs → useHover-DULSfLuK.cjs} +1 -1
  232. package/{useHover-zCCNtF6g.js → useHover-DkC5FyNd.js} +4 -4
  233. package/{useListState-BdC308Sq.cjs → useListState-DBawAMhF.cjs} +1 -1
  234. package/{useListState-D2yPZrFZ.js → useListState-PZF3ahpk.js} +1 -1
  235. package/{usePress-4yZ5a87p.js → usePress-BqQIhkNY.js} +43 -43
  236. package/usePress-DmU79HEg.cjs +7 -0
  237. package/{useSingleSelectListState-lyai-bC_.js → useSingleSelectListState-BLRBEJC7.js} +1 -1
  238. package/{useSingleSelectListState-b_SPhYG4.cjs → useSingleSelectListState-CNETmoj5.cjs} +1 -1
  239. package/{useTextField-DjxrmW7d.js → useTextField-B8pM0p6X.js} +4 -4
  240. package/{useTextField-DUEQl6sr.cjs → useTextField-CiWV3eeD.cjs} +1 -1
  241. package/utils/types.d.ts +5 -0
  242. package/utils-CtICjCYt.cjs +1 -0
  243. package/{utils-BMBoiyL7.js → utils-D2iKpxcZ.js} +43 -39
  244. package/utils-DRIRjPUS.cjs +1 -0
  245. package/{utils-CrT5PVBA.js → utils-Dxh86KaB.js} +19 -17
  246. package/AccordionItem-BJw5IKe0.js +0 -334
  247. package/AccordionItem-DhMimhYo.cjs +0 -1
  248. package/Button-BTX5G3le.cjs +0 -1
  249. package/Checkbox-D-CFY6QF.cjs +0 -1
  250. package/Collection-DaZzboRu.cjs +0 -1
  251. package/ComboBox-C4NybZ32.cjs +0 -1
  252. package/DateInputDivider-BgXKFwB0.cjs +0 -1
  253. package/DateRangePicker-DTPkr3hX.cjs +0 -6
  254. package/Dialog-DLnopN3Z.js +0 -237
  255. package/Dialog-DNu42oLH.cjs +0 -1
  256. package/Dialog-w6EBWT__.cjs +0 -1
  257. package/FocusScope-Dv0F-mG2.cjs +0 -1
  258. package/Group-C2hEIsGV.js +0 -45
  259. package/Group-cuyk9Hsy.cjs +0 -1
  260. package/Layout-CVnlO10z.cjs +0 -16
  261. package/ListBox-Bx9M5vqb.cjs +0 -1
  262. package/ListBoxSection-kujY2gUl.cjs +0 -1
  263. package/ListKeyboardDelegate-DJDPir-w.cjs +0 -1
  264. package/RSPContexts-D8hmBfGm.cjs +0 -1
  265. package/Radio-D6KNkSA2.js +0 -333
  266. package/Radio-DsVsutMH.cjs +0 -1
  267. package/Select-D9h_RQ2k.cjs +0 -1
  268. package/Select-Dc6y8gPR.js +0 -654
  269. package/SelectionManager-D-4ThfPZ.js +0 -1043
  270. package/SelectionManager-FYrDfe5v.cjs +0 -1
  271. package/Spinner-CTha503N.js +0 -47
  272. package/Spinner-DKQ9_SQB.cjs +0 -6
  273. package/TabList-BhC96APe.cjs +0 -1
  274. package/TabList-P5HnizZt.js +0 -393
  275. package/Table-BB8Ag5_3.cjs +0 -16
  276. package/Tag-D2vh0KRD.js +0 -765
  277. package/Tag-D32MGLjS.cjs +0 -1
  278. package/TextField-4xfAzdBI.cjs +0 -1
  279. package/ToggleButtonGroup-CiX2eXB8.cjs +0 -1
  280. package/scrollIntoView-ClEACHUk.js +0 -57
  281. package/scrollIntoView-DRSoJp89.cjs +0 -1
  282. package/useDateFormatter-D0bVjgIb.cjs +0 -1
  283. package/useHasTabbableChild-wH3RCjTd.cjs +0 -1
  284. package/useObserveElement-BdI4zgd7.js +0 -27
  285. package/useObserveElement-BzEr5D32.cjs +0 -1
  286. package/usePress-Dj3t18Pf.cjs +0 -7
  287. package/utils-I-LGXGYH.cjs +0 -1
  288. package/utils-cBvgilDa.cjs +0 -1
  289. package/variables-B3KEYyhW.cjs +0 -1
  290. package/variables-DzXcMW2k.js +0 -5
@@ -1,654 +0,0 @@
1
- import { jsx as o, jsxs as g, Fragment as F } from "react/jsx-runtime";
2
- import * as V from "react";
3
- import x, { useMemo as D, useState as E, useCallback as L, useEffect as O, useRef as z } from "react";
4
- import { c as P } from "./clsx-jbLnTBqA.js";
5
- import { b as j } from "./utils-BMBoiyL7.js";
6
- import { a as R, $ as G, T as W } from "./Tag-D2vh0KRD.js";
7
- import { $ as H } from "./TextField-5AI6T1ol.js";
8
- import { c as U } from "./Collection-j_iWeuZo.js";
9
- import { C as k } from "./Checkbox-Cr3MmHPE.js";
10
- import { L as q, c as X, a as J, b as Q } from "./ListBoxSection-dksiACMZ.js";
11
- import { C as Y } from "./check-B5h1DvDs.js";
12
- import { g as Z } from "./useHover-zCCNtF6g.js";
13
- import { p as ee, q as te } from "./Dialog-DOyFzvUa.js";
14
- import { $ as le, c as ae } from "./ListKeyboardDelegate-Dyu4eFtP.js";
15
- import { g as oe } from "./SelectionManager-D-4ThfPZ.js";
16
- import { a as w, c as ne, e as re } from "./mergeProps-Ct8m5-xW.js";
17
- import { $ as ie } from "./filterDOMProps-wsa9OcNI.js";
18
- import { $ as ce } from "./useField-sSWPm-He.js";
19
- import { $ as se, a as de, b as ue } from "./useFormValidation-DdIIVZ5j.js";
20
- import { $ as fe } from "./useListState-D2yPZrFZ.js";
21
- import { u as me } from "./useObserveElement-BdI4zgd7.js";
22
- import { a as be } from "./VisuallyHidden-D2ZXHTJs.js";
23
- import { a as pe, L as he } from "./Label-CV9p0K2n.js";
24
- import { T as ge } from "./Text-BQe1I4-r.js";
25
- import { X as ye } from "./x-C2xUHAEl.js";
26
- import { u as B } from "./useLocalizedStringFormatter-aOhh7wdl.js";
27
- import { $ as $e } from "./useButton-A-VOfwuT.js";
28
- import { C as ve } from "./chevron-down-DmZMdOiC.js";
29
- import { $ as xe, F as Se } from "./FieldError-C4kD4yJZ.js";
30
- import './assets/Select.css';function I(e) {
31
- return null;
32
- }
33
- I.getCollectionNode = function* (t, n) {
34
- let { childItems: i, title: a, children: r } = t, l = t.title || t.children, s = t.textValue || (typeof l == "string" ? l : "") || t["aria-label"] || "";
35
- !s && !(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 {
36
- type: "item",
37
- props: t,
38
- rendered: l,
39
- textValue: s,
40
- "aria-label": t["aria-label"],
41
- hasChildNodes: Ce(t),
42
- *childNodes() {
43
- if (i) for (let c of i) yield {
44
- type: "item",
45
- value: c
46
- };
47
- else if (a) {
48
- let c = [];
49
- x.Children.forEach(r, (u) => {
50
- c.push({
51
- type: "item",
52
- element: u
53
- });
54
- }), yield* c;
55
- }
56
- }
57
- };
58
- };
59
- function Ce(e) {
60
- return e.hasChildItems != null ? e.hasChildItems : !!(e.childItems || e.title && x.Children.count(e.children) > 0);
61
- }
62
- let _ = I;
63
- function N(e) {
64
- return null;
65
- }
66
- N.getCollectionNode = function* (t) {
67
- let { children: n, title: i, items: a } = t;
68
- yield {
69
- type: "section",
70
- props: t,
71
- hasChildNodes: !0,
72
- rendered: i,
73
- "aria-label": t["aria-label"],
74
- *childNodes() {
75
- if (typeof n == "function") {
76
- if (!a) throw new Error("props.children was a function but props.items is missing");
77
- for (let r of a) yield {
78
- type: "item",
79
- value: r,
80
- renderer: n
81
- };
82
- } else {
83
- let r = [];
84
- x.Children.forEach(n, (l) => {
85
- r.push({
86
- type: "item",
87
- element: l
88
- });
89
- }), yield* r;
90
- }
91
- }
92
- };
93
- };
94
- let we = N;
95
- const _e = "_wrapper_1rw0v_7", Ke = "_trigger_1rw0v_18", Ve = "_medium_1rw0v_32", Pe = "_icon_1rw0v_68", ke = "_tagGroup_1rw0v_74", Be = "_listBoxItemCheckmark_1rw0v_90", Ie = "_triggerContainer_1rw0v_95", Ne = "_selectValueTag_1rw0v_101", Ae = "_clearButton_1rw0v_117", Me = "_truncate_1rw0v_129", Te = "_checkboxContainer_1rw0v_166", Fe = "_selectAll_1rw0v_172", b = {
96
- wrapper: _e,
97
- trigger: Ke,
98
- medium: Ve,
99
- icon: Pe,
100
- tagGroup: ke,
101
- listBoxItemCheckmark: Be,
102
- triggerContainer: Ie,
103
- selectValueTag: Ne,
104
- clearButton: Ae,
105
- truncate: Me,
106
- checkboxContainer: Te,
107
- selectAll: Fe
108
- }, A = ({ item: e }) => /* @__PURE__ */ o(
109
- J,
110
- {
111
- ...e.value,
112
- textValue: e.textValue,
113
- "aria-label": e.textValue,
114
- children: ({ isDisabled: t, isSelected: n, selectionMode: i }) => /* @__PURE__ */ g(F, { children: [
115
- i === "multiple" ? /* @__PURE__ */ o(
116
- "div",
117
- {
118
- className: b.checkboxContainer,
119
- "aria-hidden": !0,
120
- children: /* @__PURE__ */ o(
121
- k,
122
- {
123
- isDisabled: t,
124
- isSelected: n,
125
- isReadOnly: !0,
126
- excludeFromTabOrder: !0,
127
- "aria-label": e.textValue
128
- }
129
- )
130
- }
131
- ) : null,
132
- e.rendered,
133
- n && i === "single" ? /* @__PURE__ */ o(
134
- Y,
135
- {
136
- size: 20,
137
- className: b.listBoxItemCheckmark
138
- }
139
- ) : null
140
- ] })
141
- }
142
- ), De = ({ section: e, state: t }) => /* @__PURE__ */ o(X, { ...e.value, children: t.collection.getChildren ? /* @__PURE__ */ o(U, { items: t.collection.getChildren(e.key), children: (n) => /* @__PURE__ */ o(A, { item: n }) }) : null }), Ee = ({
143
- state: e,
144
- ...t
145
- }) => /* @__PURE__ */ o(
146
- q,
147
- {
148
- ...t,
149
- ...e,
150
- escapeKeyBehavior: "none",
151
- onSelectionChange: e.setSelectedKeys,
152
- items: e.collection,
153
- children: (n) => n.type === "section" ? /* @__PURE__ */ o(
154
- De,
155
- {
156
- state: e,
157
- section: n
158
- }
159
- ) : /* @__PURE__ */ o(A, { item: n })
160
- }
161
- );
162
- function Le(e, t, n) {
163
- const { disallowEmptySelection: i, isDisabled: a } = e, r = le({ usage: "search", sensitivity: "base" }), l = D(
164
- () => new ae(
165
- t.collection,
166
- t.disabledKeys,
167
- null,
168
- r
169
- ),
170
- [t.collection, t.disabledKeys, r]
171
- ), { menuTriggerProps: s, menuProps: c } = ee(
172
- {
173
- isDisabled: a,
174
- type: "listbox"
175
- },
176
- t,
177
- n
178
- ), u = (f) => {
179
- const { selectedKeys: v, selectionMode: T } = t, C = v.values().next().value;
180
- if (T === "single")
181
- switch (f.key) {
182
- case "ArrowLeft": {
183
- f.preventDefault();
184
- const $ = v.size > 0 ? l.getKeyAbove(C) : l.getFirstKey();
185
- $ && t.setSelectedKeys([$]);
186
- break;
187
- }
188
- case "ArrowRight": {
189
- f.preventDefault();
190
- const $ = v.size > 0 ? l.getKeyBelow(C) : l.getFirstKey();
191
- $ && t.setSelectedKeys([$]);
192
- break;
193
- }
194
- }
195
- }, { typeSelectProps: d } = oe({
196
- keyboardDelegate: l,
197
- selectionManager: t.selectionManager,
198
- onTypeSelect(f) {
199
- t.setSelectedKeys([f]);
200
- }
201
- }), { labelProps: y, fieldProps: p } = ce({
202
- ...e,
203
- labelElementType: "span"
204
- });
205
- d.onKeyDown = d.onKeyDownCapture, delete d.onKeyDownCapture;
206
- const m = ie(e, { labelable: !0 }), h = w(d, s, p), S = ne();
207
- return {
208
- labelProps: {
209
- ...y,
210
- onClick: () => {
211
- var f;
212
- e.isDisabled || ((f = n.current) == null || f.focus(), Z("keyboard"));
213
- }
214
- },
215
- triggerProps: w(m, {
216
- ...h,
217
- onKeyDown: re(
218
- h.onKeyDown,
219
- u,
220
- e.onKeyDown
221
- ),
222
- onKeyUp: e.onKeyUp,
223
- "aria-labelledby": [
224
- h["aria-labelledby"],
225
- h["aria-label"] && !h["aria-labelledby"] ? h.id : null,
226
- S
227
- ].filter(Boolean).join(" "),
228
- onFocus(f) {
229
- t.isFocused || (e.onFocus && e.onFocus(f), t.setFocused(!0));
230
- },
231
- onBlur(f) {
232
- t.isOpen || (e.onBlur && e.onBlur(f), t.setFocused(!1));
233
- }
234
- }),
235
- valueProps: {
236
- id: S
237
- },
238
- menuProps: {
239
- ...c,
240
- disallowEmptySelection: i,
241
- autoFocus: t.focusStrategy || !0,
242
- shouldSelectOnPressUp: !0,
243
- shouldFocusOnHover: !0,
244
- onBlur: (f) => {
245
- f.currentTarget.contains(f.relatedTarget) || (e.onBlur && e.onBlur(f), t.setFocused(!1));
246
- },
247
- "aria-labelledby": [
248
- p["aria-labelledby"],
249
- h["aria-label"] && !p["aria-labelledby"] ? h.id : null
250
- ].filter(Boolean).join(" ")
251
- }
252
- };
253
- }
254
- function Oe(e) {
255
- const {
256
- collection: t,
257
- disabledKeys: n,
258
- selectionManager: i,
259
- selectionManager: { setSelectedKeys: a, selectedKeys: r, selectionMode: l }
260
- } = fe(e), s = [], c = r.size !== 0 ? Array.from(r).map((u) => {
261
- const d = t.getItem(u);
262
- return d || s.push(u), d;
263
- }).filter(Boolean) : null;
264
- return s.length && console.warn(
265
- `Select: Keys "${s.join(
266
- ", "
267
- )}" passed to "selectedKeys" are not present in the collection.`
268
- ), {
269
- collection: t,
270
- disabledKeys: n,
271
- selectionManager: i,
272
- selectionMode: l,
273
- selectedKeys: r,
274
- setSelectedKeys: a.bind(i),
275
- selectedItems: c
276
- };
277
- }
278
- function ze(e) {
279
- const [t, n] = E(!1), i = te(e), a = e.selectionMode === "single", r = Oe({
280
- ...e,
281
- onSelectionChange: (d) => {
282
- e.onSelectionChange && e.onSelectionChange(d), a && i.close();
283
- }
284
- }), l = se({
285
- ...e,
286
- validationBehavior: "native",
287
- value: r.selectedKeys
288
- }), s = r.collection.size === 0, c = !!r.selectedKeys.size, u = L(() => {
289
- l.resetValidation(), l.commitValidation();
290
- }, [l]);
291
- return O(() => {
292
- a && c && u();
293
- }, [c, a, u]), {
294
- ...r,
295
- ...i,
296
- close() {
297
- i.close(), c && u();
298
- },
299
- open() {
300
- s || i.open();
301
- },
302
- toggle(d) {
303
- s || i.toggle(d);
304
- },
305
- isFocused: t,
306
- setFocused: n,
307
- ...l
308
- };
309
- }
310
- function je({
311
- autoComplete: e,
312
- name: t,
313
- isDisabled: n,
314
- isRequired: i,
315
- selectRef: a
316
- }, r, l) {
317
- const { visuallyHiddenProps: s } = be();
318
- return de(a, r.selectedKeys, r.setSelectedKeys), ue(
319
- {
320
- validationBehavior: "native",
321
- focus: () => {
322
- var c;
323
- return (c = l.current) == null ? void 0 : c.focus();
324
- }
325
- },
326
- r,
327
- a
328
- ), {
329
- containerProps: {
330
- ...s,
331
- "aria-hidden": !0,
332
- // @ts-expect-error - data-a11y-ignore is not a standard attribute
333
- "data-react-aria-prevent-focus": !0,
334
- "data-a11y-ignore": "aria-hidden-focus"
335
- },
336
- inputProps: {
337
- style: { display: "none" }
338
- },
339
- selectProps: {
340
- tabIndex: -1,
341
- autoComplete: e,
342
- disabled: n,
343
- required: i,
344
- name: t,
345
- value: Array.from(r.selectedKeys).map((c) => c.toString()),
346
- onChange: (c) => r.setSelectedKeys(c.target.value),
347
- multiple: !0
348
- }
349
- };
350
- }
351
- function Re(e) {
352
- const { state: t, triggerRef: n, name: i, isDisabled: a } = e, r = `${e.label}-hidden`, l = z(null), { containerProps: s, selectProps: c } = je(
353
- { ...e, selectRef: l },
354
- t,
355
- n
356
- );
357
- return t.collection.size <= 300 ? /* @__PURE__ */ o(
358
- "div",
359
- {
360
- ...s,
361
- "data-testid": "hidden-select-container",
362
- children: /* @__PURE__ */ g("label", { children: [
363
- r,
364
- /* @__PURE__ */ g(
365
- "select",
366
- {
367
- ...c,
368
- ref: l,
369
- children: [
370
- /* @__PURE__ */ o("option", {}),
371
- [...t.collection.getKeys()].map((u) => {
372
- const d = t.collection.getItem(u);
373
- return d && d.type === "item" ? /* @__PURE__ */ o(
374
- "option",
375
- {
376
- value: d.key,
377
- children: d.textValue
378
- },
379
- d.key
380
- ) : null;
381
- })
382
- ]
383
- }
384
- )
385
- ] })
386
- }
387
- ) : i ? /* @__PURE__ */ o(
388
- "input",
389
- {
390
- type: "hidden",
391
- autoComplete: c.autoComplete,
392
- name: i,
393
- disabled: a,
394
- value: Array.from(t.selectedKeys).map((u) => u.toString()) ?? [""]
395
- }
396
- ) : null;
397
- }
398
- const Ge = { clearAll: "Clear all", selectAll: "Select all", selectedItems: "Selected items", chosen: "chosen" }, We = { clearAll: "Rensa alla", selectAll: "Välj alla", selectedItems: "Valda objekt", chosen: "valda" }, M = {
399
- en: Ge,
400
- sv: We
401
- }, He = ({
402
- state: { selectedItems: e },
403
- isDisabled: t,
404
- parentWidth: n,
405
- onClear: i,
406
- triggerRef: a,
407
- isClearable: r
408
- }) => {
409
- const l = B(M);
410
- return /* @__PURE__ */ g(
411
- "div",
412
- {
413
- className: b.selectValueTag,
414
- "data-disabled": t || void 0,
415
- children: [
416
- /* @__PURE__ */ o(
417
- "span",
418
- {
419
- className: b.truncate,
420
- style: { maxWidth: n - 92 },
421
- children: e != null && e.length && e.length > 1 ? `${e.length} ${l.format("chosen")}` : e == null ? void 0 : e[0].textValue
422
- }
423
- ),
424
- r && /* @__PURE__ */ o(
425
- "button",
426
- {
427
- disabled: t,
428
- "aria-label": l.format("clearAll"),
429
- className: b.clearButton,
430
- onClick: () => {
431
- var s;
432
- i(), (s = a == null ? void 0 : a.current) == null || s.focus();
433
- },
434
- children: /* @__PURE__ */ o(
435
- ye,
436
- {
437
- width: 20,
438
- height: 20
439
- }
440
- )
441
- }
442
- )
443
- ]
444
- }
445
- );
446
- }, Ue = ({
447
- autoFocus: e,
448
- excludeFromTabOrder: t,
449
- isDisabled: n,
450
- size: i = "large",
451
- isOpen: a,
452
- isInvalid: r,
453
- selectionMode: l,
454
- state: { selectedItems: s },
455
- placeholder: c,
456
- children: u,
457
- triggerRef: d,
458
- ...y
459
- }) => {
460
- const { buttonProps: p } = $e(
461
- { autoFocus: e, excludeFromTabOrder: t, isDisabled: n, ...y },
462
- d
463
- ), m = l === "multiple";
464
- return /* @__PURE__ */ g(
465
- "div",
466
- {
467
- className: b.triggerContainer,
468
- "data-disabled": n || void 0,
469
- children: [
470
- /* @__PURE__ */ g(
471
- "button",
472
- {
473
- ...p,
474
- autoFocus: e,
475
- className: P(b.trigger, {
476
- [b.medium]: i === "medium"
477
- }),
478
- "data-disabled": n || void 0,
479
- "data-invalid": r || void 0,
480
- "data-open": a || void 0,
481
- ref: d,
482
- type: "button",
483
- children: [
484
- m && !s ? /* @__PURE__ */ o("span", { children: c }) : null,
485
- m ? null : /* @__PURE__ */ o("span", { children: s ? s[0].textValue : c }),
486
- /* @__PURE__ */ o(
487
- "div",
488
- {
489
- className: b.icon,
490
- "aria-hidden": "true",
491
- children: /* @__PURE__ */ o(ve, { size: 20 })
492
- }
493
- )
494
- ]
495
- }
496
- ),
497
- u
498
- ]
499
- }
500
- );
501
- }, K = ({
502
- state: e,
503
- errorMessage: t
504
- }) => /* @__PURE__ */ o(xe.Provider, { value: { ...e.displayValidation }, children: /* @__PURE__ */ o(Se, { children: t }) }), qe = V.forwardRef(
505
- ({ isClearable: e = !0, popover: t, ...n }, i) => {
506
- const a = {
507
- selectionMode: "single",
508
- errorPosition: "top",
509
- disallowEmptySelection: !e,
510
- isClearable: e,
511
- size: "large",
512
- popover: t,
513
- ...n
514
- }, r = j(i), l = ze(a), s = B(M), { labelProps: c, triggerProps: u, valueProps: d, menuProps: y } = Le(
515
- a,
516
- l,
517
- r
518
- ), { width: p } = me(r.current, {
519
- includePadding: !0
520
- });
521
- return /* @__PURE__ */ g(
522
- H,
523
- {
524
- ...a,
525
- className: P(b.wrapper, a.className),
526
- children: [
527
- /* @__PURE__ */ o(
528
- Re,
529
- {
530
- ...a,
531
- state: l,
532
- triggerRef: r
533
- }
534
- ),
535
- /* @__PURE__ */ o(pe, { popover: t, children: a.label && /* @__PURE__ */ o(
536
- he,
537
- {
538
- ...c,
539
- "data-disabled": a.isDisabled || void 0,
540
- children: a.label
541
- }
542
- ) }),
543
- a.description && /* @__PURE__ */ o(ge, { slot: "description", children: a.description }),
544
- a.errorPosition === "top" && /* @__PURE__ */ o(
545
- K,
546
- {
547
- ...a,
548
- state: l
549
- }
550
- ),
551
- /* @__PURE__ */ o(
552
- Ue,
553
- {
554
- ...a,
555
- ...u,
556
- isInvalid: l.displayValidation.isInvalid,
557
- triggerRef: r,
558
- state: l,
559
- children: a.selectionMode === "multiple" && l.selectedItems ? /* @__PURE__ */ o("span", { ...d, children: /* @__PURE__ */ o(
560
- He,
561
- {
562
- ...a,
563
- state: l,
564
- parentWidth: p,
565
- onClear: () => l.selectionManager.clearSelection(),
566
- triggerRef: r
567
- }
568
- ) }) : null
569
- }
570
- ),
571
- a.errorPosition === "bottom" && /* @__PURE__ */ o(
572
- K,
573
- {
574
- ...a,
575
- state: l
576
- }
577
- ),
578
- /* @__PURE__ */ g(
579
- Q,
580
- {
581
- isOpen: l.isOpen,
582
- onOpenChange: (m) => {
583
- m || l.close();
584
- },
585
- triggerRef: r,
586
- style: { width: p },
587
- children: [
588
- a.isSelectableAll && /* @__PURE__ */ o(
589
- k,
590
- {
591
- isSelected: l.selectionManager.isSelectAll,
592
- isIndeterminate: !l.selectionManager.isSelectAll && !l.selectionManager.isEmpty,
593
- className: b.selectAll,
594
- onChange: () => l.selectionManager.toggleSelectAll(),
595
- children: s.format("selectAll")
596
- }
597
- ),
598
- /* @__PURE__ */ o(
599
- Ee,
600
- {
601
- ...y,
602
- state: l
603
- }
604
- )
605
- ]
606
- }
607
- ),
608
- a.showTags && !!l.selectedItems && /* @__PURE__ */ o(
609
- R,
610
- {
611
- "aria-label": s.format("selectedItems"),
612
- selectionBehavior: "toggle",
613
- onRemove: (m) => l.selectionManager.toggleSelection(Array.from(m)[0]),
614
- className: b.tagGroup,
615
- children: /* @__PURE__ */ o(G, { items: l.selectedItems, children: (m) => /* @__PURE__ */ o(
616
- W,
617
- {
618
- textValue: m.textValue,
619
- id: m.key,
620
- dismissable: !0,
621
- isDisabled: a.isDisabled,
622
- children: m.textValue
623
- },
624
- m.key
625
- ) })
626
- }
627
- )
628
- ]
629
- }
630
- );
631
- }
632
- ), Xe = V.forwardRef(
633
- ({ options: e, ...t }, n) => /* @__PURE__ */ o(
634
- qe,
635
- {
636
- ...t,
637
- items: e,
638
- ref: n,
639
- children: (i) => i.children ? /* @__PURE__ */ o(
640
- we,
641
- {
642
- items: i.children,
643
- title: i.name,
644
- children: (a) => /* @__PURE__ */ o(_, { textValue: a.textValue, children: a.name })
645
- },
646
- i.name
647
- ) : /* @__PURE__ */ o(_, { textValue: i.textValue, children: i.name })
648
- }
649
- )
650
- );
651
- Xe.displayName = "Select";
652
- export {
653
- Xe as S
654
- };