@midas-ds/components 14.0.0 → 15.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 (334) hide show
  1. package/AccordionItem-DTbu3lqx.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-B6lxIKPk.js → Button-BbfVT9Yl.js} +122 -116
  8. package/{Button-CRIYvCRM.js → Button-DdXFHfXw.js} +1 -1
  9. package/CHANGELOG.md +49 -0
  10. package/{Card-CfosvMF5.js → Card-CdqGFff2.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-CtJJqk_q.js} +7 -7
  17. package/{CheckboxGroup-f9Oa1MhQ.cjs → CheckboxGroup-thvsvOqD.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-Ckna0otR.cjs} +1 -1
  21. package/{ColorSchemeSwitch-ChFSNntp.js → ColorSchemeSwitch-aF2UxI20.js} +2 -2
  22. package/{ComboBox-D7eKe-M5.js → ComboBox-BDX4BYWJ.js} +244 -229
  23. package/ComboBox-DFPrJUoV.cjs +1 -0
  24. package/{DateField-BszKZodr.cjs → DateField-B92Cqf9K.cjs} +1 -1
  25. package/{DateField-xyhyDy7u.js → DateField-BPRWrVcu.js} +4 -4
  26. package/DateInputDivider-CCrXjsUB.cjs +1 -0
  27. package/{DateInputDivider-2Wf2hlXA.js → DateInputDivider-DOHpVaNE.js} +191 -188
  28. package/DateRangePicker-COSTCOt8.cjs +6 -0
  29. package/{DateRangePicker-YwKi0ukr.js → DateRangePicker-Cmt9NC35.js} +119 -115
  30. package/Dialog-CPuJA2fm.js +256 -0
  31. package/{Dialog-DOyFzvUa.js → Dialog-D4Py85wi.js} +712 -694
  32. package/Dialog-DtOf0vWx.cjs +1 -0
  33. package/Dialog-DycTLpdr.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-uC9wc8vd.js → Dropdown-B4lwe0Hn.js} +2 -2
  37. package/{Dropdown-5rmvcHD_.cjs → Dropdown-_g9l5k07.cjs} +1 -1
  38. package/{FieldError-C4kD4yJZ.js → FieldError-CIxlNQCM.js} +13 -13
  39. package/{FieldError-C4WBoCRc.cjs → FieldError-JWxR_EqN.cjs} +1 -1
  40. package/{FileUpload-CTbh7Gic.cjs → FileUpload-C0TjNkuh.cjs} +2 -2
  41. package/{FileUpload-01wGpykv.js → FileUpload-DLBP3VPp.js} +260 -534
  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-D7Ta-7PI.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-CkIRTC0_.cjs → Label-DpY2SZdQ.cjs} +1 -1
  51. package/{Label-CV9p0K2n.js → Label-FfEnd4ai.js} +4 -4
  52. package/Layout-BrEuHajQ.cjs +16 -0
  53. package/{Layout-IeVrHpT0.js → Layout-Hd1e_MEA.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-2eEa1l0M.js → ListBox-5GK4ZRj1.js} +189 -178
  61. package/ListBox-FD30iELk.cjs +1 -0
  62. package/{ListBoxSection-dksiACMZ.js → ListBox-LJ3VgZMr.js} +230 -266
  63. package/ListBox-u6ZXp5Yi.cjs +1 -0
  64. package/{ListBoxLoadMoreItem-IcGb_XwN.js → ListBoxLoadMoreItem-B4GFbdYf.js} +3 -3
  65. package/ListBoxLoadMoreItem-DMUOzVtt.cjs +1 -0
  66. package/ListBoxSection-CBlpg0AG.cjs +1 -0
  67. package/ListBoxSection-DjGs1ndn.js +51 -0
  68. package/ListKeyboardDelegate-8zuIfwQ7.cjs +1 -0
  69. package/{ListKeyboardDelegate-Dyu4eFtP.js → ListKeyboardDelegate-BBmpJ-2O.js} +36 -40
  70. package/{OverlayArrow-Bh_G2tJ3.js → OverlayArrow-CjGslX2c.js} +2 -2
  71. package/{OverlayArrow-DJ4nNscD.cjs → OverlayArrow-bcrb_syE.cjs} +1 -1
  72. package/Popover-CS8Yyfrq.js +39 -0
  73. package/Popover-DpB0XDBp.cjs +1 -0
  74. package/{PressResponder-DUhG97jJ.js → PressResponder-BMj6Zvbn.js} +3 -3
  75. package/{PressResponder-AXK2I_yx.cjs → PressResponder-ChvCuOue.cjs} +1 -1
  76. package/{ProgressBar-B-TOuoAC.cjs → ProgressBar-BZqAQTV3.cjs} +1 -1
  77. package/{ProgressBar-B0WEQkyq.js → ProgressBar-BpsvPCKk.js} +12 -12
  78. package/{RSPContexts-BW2SEIqe.js → RSPContexts-B0lEq7qq.js} +5 -3
  79. package/RSPContexts-XUvspq3j.cjs +1 -0
  80. package/Radio-B3FBTn4F.cjs +1 -0
  81. package/Radio-LevFYAg4.js +340 -0
  82. package/{RangeCalendar-B6zKSDju.cjs → RangeCalendar-CH0CyBui.cjs} +2 -2
  83. package/{RangeCalendar-D5TMu8GI.js → RangeCalendar-DT_KVd80.js} +58 -58
  84. package/{SearchField-DnBBlPT7.cjs → SearchField-BX7P7BgV.cjs} +1 -1
  85. package/{SearchField-wojUSY2S.js → SearchField-C-TFzcJF.js} +3 -3
  86. package/Select-C-ykeY_T.js +773 -0
  87. package/Select-CiCng7ZP.js +678 -0
  88. package/Select-D4wi-0Jw.cjs +1 -0
  89. package/Select-JIDW2mN8.cjs +1 -0
  90. package/{FocusScope-8ILtcq9W.js → SelectionIndicator-C2E23-zO.js} +270 -174
  91. package/SelectionIndicator-ClG0GpJu.cjs +1 -0
  92. package/SelectionManager-CNJmHeCF.cjs +1 -0
  93. package/SelectionManager-DoNLJm8c.js +1063 -0
  94. package/{Separator-COlhRmJF.js → Separator-CQfDz_zr.js} +10 -10
  95. package/{Separator-DcbM84B8.cjs → Separator-CSyYDGNE.cjs} +1 -1
  96. package/{Separator-BQkxEZC9.cjs → Separator-DCi4bnBr.cjs} +1 -1
  97. package/{Separator--4b7vckr.js → Separator-DLr4kUJD.js} +2 -2
  98. package/Spinner-D6Fcu_Dp.js +54 -0
  99. package/Spinner-DIapnvIz.cjs +6 -0
  100. package/TabList-BBmBumm6.js +394 -0
  101. package/TabList-DVzXuGXA.cjs +1 -0
  102. package/Table-B1nxmW14.cjs +16 -0
  103. package/{Table-cCSOrPkK.js → Table-DxqKDp7N.js} +707 -703
  104. package/Tag-BL-_PONN.cjs +1 -0
  105. package/Tag-DX1X_NZE.js +774 -0
  106. package/{Text-CkhG15SU.cjs → Text-0wXj3J8E.cjs} +1 -1
  107. package/{Text-BQe1I4-r.js → Text-BBFWBNAH.js} +1 -1
  108. package/{Text-CkhZTTV5.cjs → Text-D5OSv6Uv.cjs} +1 -1
  109. package/{Text-BpERRete.js → Text-bqP9NeVg.js} +1 -1
  110. package/{TextArea-B5TsyJxa.cjs → TextArea-Bjf8CBp0.cjs} +1 -1
  111. package/{TextArea-Cado2arG.js → TextArea-CJPBvogq.js} +8 -8
  112. package/TextField-DtD9-arA.cjs +1 -0
  113. package/{TextField-5AI6T1ol.js → TextField-DyR61bjZ.js} +10 -10
  114. package/{Toast-CgXRE33Y.js → Toast-B99bLWnh.js} +12 -12
  115. package/{Toast-Cs-Uvf1p.cjs → Toast-DUZ5jfG1.cjs} +1 -1
  116. package/{ToggleButtonGroup-SKGgfFs4.js → ToggleButtonGroup-CFRutAZ4.js} +82 -78
  117. package/ToggleButtonGroup-dnvnzkaD.cjs +1 -0
  118. package/{Tooltip-txk48Qof.js → Tooltip-CUdmOznK.js} +4 -4
  119. package/{Tooltip-BrupFzaI.cjs → Tooltip-D-ATlbIM.cjs} +1 -1
  120. package/{VisuallyHidden-Awup6QxT.cjs → VisuallyHidden-BMelU6B0.cjs} +1 -1
  121. package/{VisuallyHidden-D2ZXHTJs.js → VisuallyHidden-DuW70K-5.js} +1 -1
  122. package/accordion/index.cjs +1 -1
  123. package/accordion/index.js +1 -1
  124. package/assets/AccordionItem.css +1 -1
  125. package/assets/FieldError.css +1 -1
  126. package/assets/ListBox.css +1 -0
  127. package/assets/Popover.css +1 -1
  128. package/assets/RangeCalendar.css +1 -1
  129. package/assets/Select.css +1 -1
  130. package/assets/Select2.css +1 -0
  131. package/assets/Spinner.css +1 -1
  132. package/assets/TabList.css +1 -1
  133. package/assets/Tag.css +1 -1
  134. package/assets/default.css +1 -1
  135. package/breadcrumbs/index.cjs +1 -1
  136. package/breadcrumbs/index.js +1 -1
  137. package/button/index.cjs +1 -1
  138. package/button/index.js +1 -1
  139. package/calendar/index.cjs +1 -1
  140. package/calendar/index.js +1 -1
  141. package/card/index.cjs +1 -1
  142. package/card/index.js +1 -1
  143. package/character-counter/index.cjs +1 -1
  144. package/character-counter/index.js +1 -1
  145. package/checkbox/index.cjs +1 -1
  146. package/checkbox/index.js +2 -2
  147. package/color-scheme-switch/index.cjs +1 -1
  148. package/color-scheme-switch/index.js +1 -1
  149. package/combobox/index.cjs +1 -1
  150. package/combobox/index.js +1 -1
  151. package/date-field/index.cjs +1 -1
  152. package/date-field/index.js +2 -2
  153. package/date-picker/index.cjs +1 -1
  154. package/date-picker/index.js +1 -1
  155. package/dropdown/index.cjs +1 -1
  156. package/dropdown/index.js +1 -1
  157. package/field-error/index.cjs +1 -1
  158. package/field-error/index.js +1 -1
  159. package/file-upload/index.cjs +1 -1
  160. package/file-upload/index.js +1 -1
  161. package/{getScrollParent-Ru2U2LlM.js → getScrollParent-DFCzfqHG.js} +1 -1
  162. package/{getScrollParent-DuKmPmUa.cjs → getScrollParent-DjULaF_q.cjs} +1 -1
  163. package/heading/index.cjs +1 -1
  164. package/heading/index.js +1 -1
  165. package/index.cjs +1 -1
  166. package/index.d.ts +1 -0
  167. package/index.js +99 -95
  168. package/info-banner/index.cjs +1 -1
  169. package/info-banner/index.js +1 -1
  170. package/intlStrings-Cd44R5hT.js +278 -0
  171. package/intlStrings-ClBuC6xN.cjs +1 -0
  172. package/label/index.cjs +1 -1
  173. package/label/index.js +1 -1
  174. package/layout/index.cjs +1 -1
  175. package/layout/index.js +1 -1
  176. package/legacy-select/Select.d.ts +8 -0
  177. package/legacy-select/SelectTrigger.d.ts +10 -0
  178. package/legacy-select/index.cjs +1 -0
  179. package/legacy-select/index.d.ts +2 -0
  180. package/legacy-select/index.js +4 -0
  181. package/legacy-select/intl/translations.json.d.ts +17 -0
  182. package/{select → legacy-select}/types.d.ts +2 -2
  183. package/legacy-select/useMultiSelect.d.ts +5 -0
  184. package/link/index.cjs +1 -1
  185. package/link/index.js +2 -2
  186. package/link-button/index.cjs +1 -1
  187. package/link-button/index.js +2 -2
  188. package/list-box/ListBox.d.ts +1 -2
  189. package/list-box/ListBoxHeader.d.ts +3 -0
  190. package/list-box/ListBoxItem.d.ts +9 -3
  191. package/list-box/ListBoxSection.d.ts +1 -1
  192. package/list-box/index.cjs +1 -1
  193. package/list-box/index.d.ts +1 -0
  194. package/list-box/index.js +9 -7
  195. package/menu/index.cjs +1 -1
  196. package/menu/index.js +2 -2
  197. package/modal/index.cjs +1 -1
  198. package/modal/index.js +2 -2
  199. package/package.json +4 -4
  200. package/popover/Popover.d.ts +2 -1
  201. package/popover/index.cjs +1 -1
  202. package/popover/index.js +1 -1
  203. package/progress-bar/index.cjs +1 -1
  204. package/progress-bar/index.js +1 -1
  205. package/radio/index.cjs +1 -1
  206. package/radio/index.js +1 -1
  207. package/scrollIntoView-BVI21Y4-.js +65 -0
  208. package/scrollIntoView-BueMOyGp.cjs +1 -0
  209. package/search-field/index.cjs +1 -1
  210. package/search-field/index.js +1 -1
  211. package/select/Select.d.ts +33 -4
  212. package/select/SelectAll.d.ts +1 -0
  213. package/select/SelectTags.d.ts +4 -0
  214. package/select/SelectTrigger.d.ts +4 -8
  215. package/select/SelectValueTag.d.ts +5 -0
  216. package/select/index.cjs +1 -1
  217. package/select/index.d.ts +1 -2
  218. package/select/index.js +1 -1
  219. package/select/intl/translations.json.d.ts +2 -2
  220. package/spinner/Spinner.d.ts +5 -1
  221. package/spinner/index.cjs +1 -1
  222. package/spinner/index.js +1 -1
  223. package/table/index.cjs +1 -1
  224. package/table/index.js +1 -1
  225. package/tabs/Tabs.d.ts +2 -9
  226. package/tabs/index.cjs +1 -1
  227. package/tabs/index.d.ts +0 -1
  228. package/tabs/index.js +1 -1
  229. package/tag/index.cjs +1 -1
  230. package/tag/index.js +1 -1
  231. package/text/index.cjs +1 -1
  232. package/text/index.js +1 -1
  233. package/textfield/TextArea.d.ts +3 -2
  234. package/textfield/TextField.d.ts +3 -2
  235. package/textfield/index.cjs +1 -1
  236. package/textfield/index.js +1 -1
  237. package/toast/index.cjs +1 -1
  238. package/toast/index.js +1 -1
  239. package/toggle-button/index.cjs +1 -1
  240. package/toggle-button/index.js +1 -1
  241. package/tooltip/index.cjs +1 -1
  242. package/tooltip/index.js +1 -1
  243. package/{useButton-Bh3duhYL.cjs → useButton-C0r5nrqs.cjs} +1 -1
  244. package/{useButton-A-VOfwuT.js → useButton-CRgN6aZf.js} +2 -2
  245. package/useDateFormatter-BrrFo4nY.cjs +1 -0
  246. package/{useDateFormatter-CxlJTAki.js → useDateFormatter-Bs5A6Xtu.js} +353 -322
  247. package/{useField-sSWPm-He.js → useField-Bx76iuoW.js} +1 -1
  248. package/{useField-CY4OYE5a.cjs → useField-DvszkIMx.cjs} +1 -1
  249. package/{useFilter-DHcouDzv.js → useFilter-Dn4vTT3G.js} +1 -1
  250. package/{useFilter-DlZLqsJD.cjs → useFilter-eOgdlVLd.cjs} +1 -1
  251. package/{useFocusRing-Cig5Y0l-.cjs → useFocusRing-C-XVcAE5.cjs} +1 -1
  252. package/{useFocusRing-Copf_tx8.js → useFocusRing-CcxI7nbg.js} +2 -2
  253. package/{useFocusWithin-BKopz9sr.js → useFocusWithin-DhXBuB2O.js} +1 -1
  254. package/{useFocusWithin-TryC2Kkw.cjs → useFocusWithin-GBjoTL5o.cjs} +1 -1
  255. package/{useFocusable-CCh54GIw.js → useFocusable-BJj-Bkig.js} +3 -3
  256. package/{useFocusable-DhdAtEw8.cjs → useFocusable-M4se1KJt.cjs} +1 -1
  257. package/{useFormValidation-DdIIVZ5j.js → useFormValidation-By7G-T7y.js} +1 -1
  258. package/{useFormValidation-BJNizNDf.cjs → useFormValidation-DV2Ioblb.cjs} +1 -1
  259. package/useHasTabbableChild-BJ_VejL5.cjs +1 -0
  260. package/{useHasTabbableChild-BbgOpdGQ.js → useHasTabbableChild-DpISgPsS.js} +1 -1
  261. package/{useHighlightSelectionDescription-D6F-YO6b.cjs → useHighlightSelectionDescription-CBZfyrhy.cjs} +1 -1
  262. package/{useHighlightSelectionDescription-BL_02EKv.js → useHighlightSelectionDescription-Zvo5KTxM.js} +2 -2
  263. package/{useHover-eU40luVI.cjs → useHover-DULSfLuK.cjs} +1 -1
  264. package/{useHover-zCCNtF6g.js → useHover-DkC5FyNd.js} +4 -4
  265. package/{useListState-D2yPZrFZ.js → useListState-CP7AKhOX.js} +1 -1
  266. package/{useListState-BdC308Sq.cjs → useListState-DZFWpD-x.cjs} +1 -1
  267. package/{usePress-4yZ5a87p.js → usePress-BqQIhkNY.js} +43 -43
  268. package/usePress-DmU79HEg.cjs +7 -0
  269. package/{useSingleSelectListState-lyai-bC_.js → useSingleSelectListState-GSY0f4qW.js} +1 -1
  270. package/{useSingleSelectListState-b_SPhYG4.cjs → useSingleSelectListState-JCvbhUVI.cjs} +1 -1
  271. package/{useTextField-DUEQl6sr.cjs → useTextField-CiWV3eeD.cjs} +1 -1
  272. package/{useTextField-DjxrmW7d.js → useTextField-I3QVGvyX.js} +4 -4
  273. package/utils/types.d.ts +5 -0
  274. package/utils-CtICjCYt.cjs +1 -0
  275. package/{utils-BMBoiyL7.js → utils-D2iKpxcZ.js} +43 -39
  276. package/utils-DRIRjPUS.cjs +1 -0
  277. package/{utils-CrT5PVBA.js → utils-Dxh86KaB.js} +19 -17
  278. package/AccordionItem-BJw5IKe0.js +0 -334
  279. package/AccordionItem-DhMimhYo.cjs +0 -1
  280. package/Button-BTX5G3le.cjs +0 -1
  281. package/Checkbox-D-CFY6QF.cjs +0 -1
  282. package/Collection-DaZzboRu.cjs +0 -1
  283. package/ComboBox-C4NybZ32.cjs +0 -1
  284. package/DateInputDivider-BgXKFwB0.cjs +0 -1
  285. package/DateRangePicker-DTPkr3hX.cjs +0 -6
  286. package/Dialog-DLnopN3Z.js +0 -237
  287. package/Dialog-DNu42oLH.cjs +0 -1
  288. package/Dialog-w6EBWT__.cjs +0 -1
  289. package/FocusScope-Dv0F-mG2.cjs +0 -1
  290. package/Group-C2hEIsGV.js +0 -45
  291. package/Group-cuyk9Hsy.cjs +0 -1
  292. package/Layout-CVnlO10z.cjs +0 -16
  293. package/ListBox-Bx9M5vqb.cjs +0 -1
  294. package/ListBoxLoadMoreItem-BBE3OF4J.cjs +0 -1
  295. package/ListBoxSection-kujY2gUl.cjs +0 -1
  296. package/ListKeyboardDelegate-DJDPir-w.cjs +0 -1
  297. package/Popover-BI2Koco0.cjs +0 -1
  298. package/Popover-D7_IfJ3o.js +0 -38
  299. package/RSPContexts-D8hmBfGm.cjs +0 -1
  300. package/Radio-D6KNkSA2.js +0 -333
  301. package/Radio-DsVsutMH.cjs +0 -1
  302. package/Select-D9h_RQ2k.cjs +0 -1
  303. package/Select-Dc6y8gPR.js +0 -654
  304. package/SelectionManager-D-4ThfPZ.js +0 -1043
  305. package/SelectionManager-FYrDfe5v.cjs +0 -1
  306. package/Spinner-CTha503N.js +0 -47
  307. package/Spinner-DKQ9_SQB.cjs +0 -6
  308. package/TabList-BhC96APe.cjs +0 -1
  309. package/TabList-P5HnizZt.js +0 -393
  310. package/Table-BB8Ag5_3.cjs +0 -16
  311. package/Tag-D2vh0KRD.js +0 -765
  312. package/Tag-D32MGLjS.cjs +0 -1
  313. package/TextField-4xfAzdBI.cjs +0 -1
  314. package/ToggleButtonGroup-CiX2eXB8.cjs +0 -1
  315. package/assets/ListBoxSection.css +0 -1
  316. package/scrollIntoView-ClEACHUk.js +0 -57
  317. package/scrollIntoView-DRSoJp89.cjs +0 -1
  318. package/select/useMultiSelect.d.ts +0 -4
  319. package/useDateFormatter-D0bVjgIb.cjs +0 -1
  320. package/useHasTabbableChild-wH3RCjTd.cjs +0 -1
  321. package/useObserveElement-BdI4zgd7.js +0 -27
  322. package/useObserveElement-BzEr5D32.cjs +0 -1
  323. package/usePress-Dj3t18Pf.cjs +0 -7
  324. package/utils-I-LGXGYH.cjs +0 -1
  325. package/utils-cBvgilDa.cjs +0 -1
  326. package/variables-B3KEYyhW.cjs +0 -1
  327. package/variables-DzXcMW2k.js +0 -5
  328. /package/{select → legacy-select}/HiddenMultiSelect.d.ts +0 -0
  329. /package/{select → legacy-select}/MultiSelectValueTag.d.ts +0 -0
  330. /package/{select → legacy-select}/SelectFieldError.d.ts +0 -0
  331. /package/{select → legacy-select}/SelectListBox.d.ts +0 -0
  332. /package/{select → legacy-select}/useMultiSelectListState.d.ts +0 -0
  333. /package/{select → legacy-select}/useMultiSelectState.d.ts +0 -0
  334. /package/{select → legacy-select}/utils.d.ts +0 -0
@@ -1,149 +1,153 @@
1
1
  import { jsxs as F, jsx as c } from "react/jsx-runtime";
2
2
  import * as R from "react";
3
- import H, { useEffect as C, useRef as W } from "react";
4
- import { a as z } from "./RSPContexts-BW2SEIqe.js";
5
- import { $ as J, c as K } from "./utils-BMBoiyL7.js";
6
- import { $ as Q } from "./Form-CXcEMuBf.js";
3
+ import H, { useEffect as C, useMemo as W, useRef as z } from "react";
4
+ import { c as J } from "./RSPContexts-B0lEq7qq.js";
5
+ import { $ as K, c as Q } from "./utils-D2iKpxcZ.js";
6
+ import { $ as T } from "./Form-CXcEMuBf.js";
7
7
  import { c as S } from "./clsx-OuTLNxxd.js";
8
8
  import { a as y } from "./mergeProps-Ct8m5-xW.js";
9
- import { $ as T } from "./VisuallyHidden-D2ZXHTJs.js";
10
- import { a as X, $ as D, b as Y, d as _, e as Z } from "./useFormValidation-DdIIVZ5j.js";
11
- import { b as g } from "./usePress-4yZ5a87p.js";
12
- import { $ as ee } from "./filterDOMProps-wsa9OcNI.js";
13
- import { a as ae } from "./useFocusable-CCh54GIw.js";
9
+ import { $ as X } from "./VisuallyHidden-DuW70K-5.js";
10
+ import { a as Y, $ as D, b as Z, d as _, e as ee } from "./useFormValidation-By7G-T7y.js";
11
+ import { b as g } from "./usePress-BqQIhkNY.js";
12
+ import { $ as ae } from "./filterDOMProps-wsa9OcNI.js";
13
+ import { a as ie } from "./useFocusable-BJj-Bkig.js";
14
14
  import { $ as B } from "./useToggleState-BVOqL4hI.js";
15
- import { $ as ie } from "./useHover-zCCNtF6g.js";
16
- import { $ as de } from "./useFocusRing-Copf_tx8.js";
17
- import './assets/Checkbox.css';function ne(e, a, i) {
18
- let { isDisabled: d = !1, isReadOnly: n = !1, value: o, name: s, form: t, children: l, "aria-label": b, "aria-labelledby": $, validationState: v = "valid", isInvalid: m, onPressStart: h, onPressEnd: P, onPressChange: f, onPress: u, onPressUp: r, onClick: I } = e, E = (x) => {
15
+ import { $ as de } from "./useHover-DkC5FyNd.js";
16
+ import { $ as ne } from "./useFocusRing-CcxI7nbg.js";
17
+ import './assets/Checkbox.css';function oe(e, a, i) {
18
+ let { isDisabled: d = !1, isReadOnly: n = !1, value: s, name: t, form: r, children: o, "aria-label": v, "aria-labelledby": $, validationState: b = "valid", isInvalid: m, onPressStart: h, onPressEnd: P, onPressChange: f, onPress: u, onPressUp: l, onClick: I } = e, q = (x) => {
19
19
  x.stopPropagation(), a.setSelected(x.target.checked);
20
- }, p = l != null, w = b != null || $ != null;
21
- !p && !w && process.env.NODE_ENV !== "production" && console.warn("If you do not provide children, you must specify an aria-label for accessibility");
22
- let { pressProps: G, isPressed: N } = g({
20
+ }, w = o != null, E = v != null || $ != null;
21
+ !w && !E && process.env.NODE_ENV !== "production" && console.warn("If you do not provide children, you must specify an aria-label for accessibility");
22
+ let { pressProps: G, isPressed: M } = g({
23
23
  onPressStart: h,
24
24
  onPressEnd: P,
25
25
  onPressChange: f,
26
26
  onPress: u,
27
- onPressUp: r,
27
+ onPressUp: l,
28
28
  onClick: I,
29
29
  isDisabled: d
30
- }), { pressProps: L, isPressed: U } = g({
30
+ }), { pressProps: N, isPressed: L } = g({
31
31
  onPressStart: h,
32
32
  onPressEnd: P,
33
33
  onPressChange: f,
34
- onPressUp: r,
34
+ onPressUp: l,
35
35
  onClick: I,
36
36
  onPress(x) {
37
37
  var k;
38
38
  u == null || u(x), a.toggle(), (k = i.current) === null || k === void 0 || k.focus();
39
39
  },
40
40
  isDisabled: d || n
41
- }), { focusableProps: j } = ae(e, i), A = y(G, j), M = ee(e, {
41
+ }), { focusableProps: U } = ie(e, i), j = y(G, U), A = ae(e, {
42
42
  labelable: !0
43
43
  });
44
- return X(i, a.defaultSelected, a.setSelected), {
45
- labelProps: y(L, {
44
+ return Y(i, a.defaultSelected, a.setSelected), {
45
+ labelProps: y(N, {
46
46
  onClick: (x) => x.preventDefault()
47
47
  }),
48
- inputProps: y(M, {
49
- "aria-invalid": m || v === "invalid" || void 0,
48
+ inputProps: y(A, {
49
+ "aria-invalid": m || b === "invalid" || void 0,
50
50
  "aria-errormessage": e["aria-errormessage"],
51
51
  "aria-controls": e["aria-controls"],
52
52
  "aria-readonly": n || void 0,
53
- onChange: E,
53
+ onChange: q,
54
54
  disabled: d,
55
- ...o == null ? {} : {
56
- value: o
55
+ ...s == null ? {} : {
56
+ value: s
57
57
  },
58
- name: s,
59
- form: t,
58
+ name: t,
59
+ form: r,
60
60
  type: "checkbox",
61
- ...A
61
+ ...j
62
62
  }),
63
63
  isSelected: a.isSelected,
64
- isPressed: N || U,
64
+ isPressed: M || L,
65
65
  isDisabled: d,
66
66
  isReadOnly: n,
67
- isInvalid: m || v === "invalid"
67
+ isInvalid: m || b === "invalid"
68
68
  };
69
69
  }
70
70
  function O(e, a, i) {
71
71
  let d = D({
72
72
  ...e,
73
73
  value: a.isSelected
74
- }), { isInvalid: n, validationErrors: o, validationDetails: s } = d.displayValidation, { labelProps: t, inputProps: l, isSelected: b, isPressed: $, isDisabled: v, isReadOnly: m } = ne({
74
+ }), { isInvalid: n, validationErrors: s, validationDetails: t } = d.displayValidation, { labelProps: r, inputProps: o, isSelected: v, isPressed: $, isDisabled: b, isReadOnly: m } = oe({
75
75
  ...e,
76
76
  isInvalid: n
77
77
  }, a, i);
78
- Y(e, d, i);
78
+ Z(e, d, i);
79
79
  let { isIndeterminate: h, isRequired: P, validationBehavior: f = "aria" } = e;
80
80
  C(() => {
81
81
  i.current && (i.current.indeterminate = !!h);
82
82
  });
83
83
  let { pressProps: u } = g({
84
- isDisabled: v || m,
84
+ isDisabled: b || m,
85
85
  onPress() {
86
- let { [_]: r } = e, { commitValidation: I } = r || d;
86
+ let { [_]: l } = e, { commitValidation: I } = l || d;
87
87
  I();
88
88
  }
89
89
  });
90
90
  return {
91
- labelProps: y(t, u),
91
+ labelProps: y(r, u, W(() => ({
92
+ // Prevent label from being focused when mouse down on it.
93
+ // Note, this does not prevent the input from being focused in the `click` event.
94
+ onMouseDown: (l) => l.preventDefault()
95
+ }), [])),
92
96
  inputProps: {
93
- ...l,
94
- checked: b,
97
+ ...o,
98
+ checked: v,
95
99
  "aria-required": P && f === "aria" || void 0,
96
100
  required: P && f === "native"
97
101
  },
98
- isSelected: b,
102
+ isSelected: v,
99
103
  isPressed: $,
100
- isDisabled: v,
104
+ isDisabled: b,
101
105
  isReadOnly: m,
102
106
  isInvalid: n,
103
- validationErrors: o,
104
- validationDetails: s
107
+ validationErrors: s,
108
+ validationDetails: t
105
109
  };
106
110
  }
107
111
  const le = /* @__PURE__ */ new WeakMap();
108
- function oe(e, a, i) {
112
+ function se(e, a, i) {
109
113
  const d = B({
110
114
  isReadOnly: e.isReadOnly || a.isReadOnly,
111
115
  isSelected: a.isSelected(e.value),
112
116
  defaultSelected: a.defaultValue.includes(e.value),
113
- onChange(r) {
114
- r ? a.addValue(e.value) : a.removeValue(e.value), e.onChange && e.onChange(r);
117
+ onChange(l) {
118
+ l ? a.addValue(e.value) : a.removeValue(e.value), e.onChange && e.onChange(l);
115
119
  }
116
120
  });
117
- let { name: n, form: o, descriptionId: s, errorMessageId: t, validationBehavior: l } = le.get(a);
118
- var b;
119
- l = (b = e.validationBehavior) !== null && b !== void 0 ? b : l;
121
+ let { name: n, form: s, descriptionId: t, errorMessageId: r, validationBehavior: o } = le.get(a);
122
+ var v;
123
+ o = (v = e.validationBehavior) !== null && v !== void 0 ? v : o;
120
124
  let { realtimeValidation: $ } = D({
121
125
  ...e,
122
126
  value: d.isSelected,
123
127
  // Server validation is handled at the group level.
124
128
  name: void 0,
125
129
  validationBehavior: "aria"
126
- }), v = W(Z), m = () => {
127
- a.setInvalid(e.value, $.isInvalid ? $ : v.current);
130
+ }), b = z(ee), m = () => {
131
+ a.setInvalid(e.value, $.isInvalid ? $ : b.current);
128
132
  };
129
133
  C(m);
130
- let h = a.realtimeValidation.isInvalid ? a.realtimeValidation : $, P = l === "native" ? a.displayValidation : h;
134
+ let h = a.realtimeValidation.isInvalid ? a.realtimeValidation : $, P = o === "native" ? a.displayValidation : h;
131
135
  var f;
132
136
  let u = O({
133
137
  ...e,
134
138
  isReadOnly: e.isReadOnly || a.isReadOnly,
135
139
  isDisabled: e.isDisabled || a.isDisabled,
136
140
  name: e.name || n,
137
- form: e.form || o,
141
+ form: e.form || s,
138
142
  isRequired: (f = e.isRequired) !== null && f !== void 0 ? f : a.isRequired,
139
- validationBehavior: l,
143
+ validationBehavior: o,
140
144
  [_]: {
141
145
  realtimeValidation: h,
142
146
  displayValidation: P,
143
147
  resetValidation: a.resetValidation,
144
148
  commitValidation: a.commitValidation,
145
- updateValidation(r) {
146
- v.current = r, m();
149
+ updateValidation(l) {
150
+ b.current = l, m();
147
151
  }
148
152
  }
149
153
  }, d, i);
@@ -153,18 +157,18 @@ function oe(e, a, i) {
153
157
  ...u.inputProps,
154
158
  "aria-describedby": [
155
159
  e["aria-describedby"],
156
- a.isInvalid ? t : null,
157
- s
160
+ a.isInvalid ? r : null,
161
+ t
158
162
  ].filter(Boolean).join(" ") || void 0
159
163
  }
160
164
  };
161
165
  }
162
- const se = H.createContext(null), te = "_checkboxInner_164xy_1", re = "_checkbox_164xy_1", ce = "_checkboxGroup_164xy_142", V = {
163
- checkboxInner: te,
164
- checkbox: re,
165
- checkboxGroup: ce
166
- }, q = R.forwardRef((e, a) => {
167
- const { hoverProps: i, isHovered: d } = e.hoverResult, { pressProps: n, isPressed: o } = e.pressResult, { isFocused: s, isFocusVisible: t, focusProps: l } = e.focusRingAria;
166
+ const te = H.createContext(null), re = "_checkboxInner_164xy_1", ce = "_checkbox_164xy_1", fe = "_checkboxGroup_164xy_142", V = {
167
+ checkboxInner: re,
168
+ checkbox: ce,
169
+ checkboxGroup: fe
170
+ }, p = R.forwardRef((e, a) => {
171
+ const { hoverProps: i, isHovered: d } = e.hoverResult, { pressProps: n, isPressed: s } = e.pressResult, { isFocused: t, isFocusVisible: r, focusProps: o } = e.focusRingAria;
168
172
  return /* @__PURE__ */ F(
169
173
  "label",
170
174
  {
@@ -175,12 +179,12 @@ const se = H.createContext(null), te = "_checkboxInner_164xy_1", re = "_checkbox
175
179
  "data-hovered": d || void 0,
176
180
  "data-selected": e.isSelected || void 0,
177
181
  "data-indeterminate": e.isIndeterminate || void 0,
178
- "data-pressed": o || void 0,
182
+ "data-pressed": s || void 0,
179
183
  "data-disabled": e.isDisabled || void 0,
180
184
  "data-readonly": e.isReadOnly || void 0,
181
185
  "data-invalid": e.isInvalid || void 0,
182
- "data-focused": s || void 0,
183
- "data-focus-visible": t || void 0,
186
+ "data-focused": t || void 0,
187
+ "data-focus-visible": r || void 0,
184
188
  "data-required": e.isRequired || void 0,
185
189
  children: [
186
190
  /* @__PURE__ */ c("div", { className: S(V.checkboxInner), children: /* @__PURE__ */ c(
@@ -201,10 +205,10 @@ const se = H.createContext(null), te = "_checkboxInner_164xy_1", re = "_checkbox
201
205
  ) : /* @__PURE__ */ c("polyline", { points: "3,9 7,13 15,4" })
202
206
  }
203
207
  ) }),
204
- /* @__PURE__ */ c(T, { children: /* @__PURE__ */ c(
208
+ /* @__PURE__ */ c(X, { children: /* @__PURE__ */ c(
205
209
  "input",
206
210
  {
207
- ...y(e.inputProps, l),
211
+ ...y(e.inputProps, o),
208
212
  ref: e.inputRef
209
213
  }
210
214
  ) }),
@@ -212,8 +216,8 @@ const se = H.createContext(null), te = "_checkboxInner_164xy_1", re = "_checkbox
212
216
  ]
213
217
  }
214
218
  );
215
- }), fe = R.forwardRef((e, a) => {
216
- const i = oe(
219
+ }), ue = R.forwardRef((e, a) => {
220
+ const i = se(
217
221
  {
218
222
  ...e,
219
223
  value: e.value || ""
@@ -222,49 +226,49 @@ const se = H.createContext(null), te = "_checkboxInner_164xy_1", re = "_checkbox
222
226
  e.inputRef
223
227
  );
224
228
  return /* @__PURE__ */ c(
225
- q,
229
+ p,
226
230
  {
227
231
  ...e,
228
232
  ...i,
229
233
  ref: a
230
234
  }
231
235
  );
232
- }), ue = R.forwardRef((e, a) => {
236
+ }), ve = R.forwardRef((e, a) => {
233
237
  const i = O(e, B(e), e.inputRef);
234
238
  return /* @__PURE__ */ c(
235
- q,
239
+ p,
236
240
  {
237
241
  ...e,
238
242
  ...i,
239
243
  ref: a
240
244
  }
241
245
  );
242
- }), De = R.forwardRef(
246
+ }), _e = R.forwardRef(
243
247
  (e, a) => {
244
- [e, a] = J(e, a, z);
245
- const i = K(Q), d = e.validationBehavior ?? (i == null ? void 0 : i.validationBehavior) ?? "native", n = R.useContext(se), o = R.useRef(null), s = ie(e), t = g({
248
+ [e, a] = K(e, a, J);
249
+ const i = Q(T), d = e.validationBehavior ?? (i == null ? void 0 : i.validationBehavior) ?? "native", n = R.useContext(te), s = R.useRef(null), t = de(e), r = g({
246
250
  ref: a,
247
251
  isDisabled: e.isDisabled
248
- }), l = de();
252
+ }), o = ne();
249
253
  return n ? /* @__PURE__ */ c(
250
- fe,
254
+ ue,
251
255
  {
252
256
  ...e,
253
257
  state: n,
254
- inputRef: o,
255
- hoverResult: s,
256
- pressResult: t,
257
- focusRingAria: l,
258
+ inputRef: s,
259
+ hoverResult: t,
260
+ pressResult: r,
261
+ focusRingAria: o,
258
262
  validationBehavior: d
259
263
  }
260
264
  ) : /* @__PURE__ */ c(
261
- ue,
265
+ ve,
262
266
  {
263
267
  ...e,
264
- inputRef: o,
265
- hoverResult: s,
266
- pressResult: t,
267
- focusRingAria: l,
268
+ inputRef: s,
269
+ hoverResult: t,
270
+ pressResult: r,
271
+ focusRingAria: o,
268
272
  validationBehavior: d
269
273
  }
270
274
  );
@@ -272,7 +276,7 @@ const se = H.createContext(null), te = "_checkboxInner_164xy_1", re = "_checkbox
272
276
  );
273
277
  export {
274
278
  le as $,
275
- De as C,
276
- se as a,
279
+ _e as C,
280
+ te as a,
277
281
  V as s
278
282
  };
@@ -1,16 +1,16 @@
1
1
  import { jsx as s, jsxs as g } from "react/jsx-runtime";
2
- import { a as P, L as V } from "./Label-CV9p0K2n.js";
3
- import { T as S } from "./Text-BQe1I4-r.js";
2
+ import { a as P, L as V } from "./Label-FfEnd4ai.js";
3
+ import { T as S } from "./Text-BBFWBNAH.js";
4
4
  import * as m from "react";
5
5
  import { useState as C, useRef as y } from "react";
6
- import { $ as p, C as v, s as D, a as I } from "./Checkbox-Cr3MmHPE.js";
7
- import { $ as R, F as k } from "./FieldError-C4kD4yJZ.js";
8
- import { $ as F, c as A } from "./useFormValidation-DdIIVZ5j.js";
6
+ import { $ as p, C as v, s as D, a as I } from "./Checkbox-CdN1D5pD.js";
7
+ import { $ as R, F as k } from "./FieldError-CIxlNQCM.js";
8
+ import { $ as F, c as A } from "./useFormValidation-By7G-T7y.js";
9
9
  import { $ as E } from "./useControlledState-u436Wbp1.js";
10
10
  import { a as M } from "./mergeProps-Ct8m5-xW.js";
11
11
  import { $ as O } from "./filterDOMProps-wsa9OcNI.js";
12
- import { $ as W } from "./useField-sSWPm-He.js";
13
- import { $ as B } from "./useFocusWithin-BKopz9sr.js";
12
+ import { $ as W } from "./useField-Bx76iuoW.js";
13
+ import { $ as B } from "./useFocusWithin-DhXBuB2O.js";
14
14
  import { u as L } from "./useLocalizedStringFormatter-aOhh7wdl.js";
15
15
  function G(e, a) {
16
16
  let { isDisabled: t, name: c, form: f, validationBehavior: n = "aria" } = e, { isInvalid: r, validationErrors: d, validationDetails: l } = a.displayValidation, { labelProps: u, fieldProps: $, descriptionProps: i, errorMessageProps: o } = W({
@@ -1 +1 @@
1
- "use strict";const s=require("react/jsx-runtime"),m=require("./Label-CkIRTC0_.cjs"),C=require("./Text-CkhZTTV5.cjs"),$=require("react"),h=require("./Checkbox-D-CFY6QF.cjs"),g=require("./FieldError-C4WBoCRc.cjs"),P=require("./useFormValidation-BJNizNDf.cjs"),y=require("./useControlledState-D0L6S_5r.cjs"),j=require("./mergeProps-Du5A8xi8.cjs"),q=require("./filterDOMProps-RRlKPKX0.cjs"),k=require("./useField-CY4OYE5a.cjs"),D=require("./useFocusWithin-TryC2Kkw.cjs"),F=require("./useLocalizedStringFormatter-BSac43NO.cjs");function O(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const a in e)if(a!=="default"){const n=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(t,a,n.get?n:{enumerable:!0,get:()=>e[a]})}}return t.default=e,Object.freeze(t)}const v=O($);function R(e,t){let{isDisabled:a,name:n,form:u,validationBehavior:c="aria"}=e,{isInvalid:r,validationErrors:d,validationDetails:l}=t.displayValidation,{labelProps:f,fieldProps:x,descriptionProps:i,errorMessageProps:o}=k.$2baaea4c71418dea$export$294aa081a6c6f55d({...e,labelElementType:"span",isInvalid:r,errorMessage:e.errorMessage||d});h.$1ae600c947479353$export$ec98120685d4f57d.set(t,{name:n,form:u,descriptionId:i.id,errorMessageId:o.id,validationBehavior:c});let b=q.$65484d02dcb7eb3e$export$457c3d6518dd4c6f(e,{labelable:!0}),{focusWithinProps:S}=D.$9ab94262bd0047c7$export$420e68273165f4ec({onBlurWithin:e.onBlur,onFocusWithin:e.onFocus,onFocusWithinChange:e.onFocusChange});return{groupProps:j.$3ef42575df84b30b$export$9d1611c77c2fe928(b,{role:"group","aria-disabled":a||void 0,...x,...S}),labelProps:f,descriptionProps:i,errorMessageProps:o,isInvalid:r,validationErrors:d,validationDetails:l}}function I(e={}){let[t,a]=y.$458b0a5536c1a7cf$export$40bfa8c7b0832715(e.value,e.defaultValue||[],e.onChange),[n]=$.useState(t),u=!!e.isRequired&&t.length===0,c=$.useRef(new Map),r=P.$e5be200c675c3b3a$export$fc1a364ae1f3ff10({...e,value:t}),d=r.displayValidation.isInvalid;var l,f;return{...r,value:t,defaultValue:(l=e.defaultValue)!==null&&l!==void 0?l:n,setValue(i){e.isReadOnly||e.isDisabled||a(i)},isDisabled:e.isDisabled||!1,isReadOnly:e.isReadOnly||!1,isSelected(i){return t.includes(i)},addValue(i){e.isReadOnly||e.isDisabled||t.includes(i)||(t=t.concat(i),a(t))},removeValue(i){e.isReadOnly||e.isDisabled||t.includes(i)&&a(t.filter(o=>o!==i))},toggleValue(i){e.isReadOnly||e.isDisabled||(t.includes(i)?a(t.filter(o=>o!==i)):a(t.concat(i)))},setInvalid(i,o){let b=new Map(c.current);o.isInvalid?b.set(i,o):b.delete(i),c.current=b,r.updateValidation(P.$e5be200c675c3b3a$export$75ee7c75d68f5b0e(...b.values()))},validationState:(f=e.validationState)!==null&&f!==void 0?f:d?"invalid":null,isInvalid:d,isRequired:u}}const M=(e,{value:t})=>{const a=v.Children.toArray(e).filter(l=>v.isValidElement(l)&&l.type===h.Checkbox),n=v.Children.count(a),u=v.Children.toArray(e).filter(l=>v.isValidElement(l)).filter(l=>!!l&&l.type===h.Checkbox).map(l=>l.props.value),c=t.length===0,r=t.length===n;return{allSelected:r,someSelected:!c&&!r,checkboxValues:u}},V=({state:e,errorMessage:t})=>s.jsx(g.$ee014567cb39d3f0$export$ff05c3ac10437e03.Provider,{value:e.displayValidation,children:s.jsx(g.FieldError,{children:t})}),E={selectAll:"Select all"},A={selectAll:"Välj alla"},W={en:E,sv:A};function _(e){const t=I(e),a=F.useLocalizedStringFormatter(W),{groupProps:n,labelProps:u,descriptionProps:c}=R(e,t),{allSelected:r,someSelected:d,checkboxValues:l}=M(e.children,t),f=x=>{t.setValue(x?l:[])};return s.jsxs("div",{...n,className:h.styles.checkboxGroup,children:[s.jsx(m.LabelWrapper,{popover:e.popover,children:e.label&&s.jsx(m.Label,{...u,children:e.label})}),e.description&&s.jsx(C.Text,{slot:"description",...c,children:e.description}),e.errorPosition==="top"&&s.jsx(V,{...e,state:t}),e.showSelectAll&&s.jsx(h.Checkbox,{isSelected:r,isIndeterminate:d,onChange:f,children:e.selectAllLabel||a.format("selectAll")}),s.jsx(h.CheckboxGroupContext.Provider,{value:t,children:e.children}),e.errorPosition==="bottom"&&s.jsx(V,{...e,state:t})]})}exports.CheckboxGroup=_;
1
+ "use strict";const s=require("react/jsx-runtime"),m=require("./Label-DpY2SZdQ.cjs"),C=require("./Text-D5OSv6Uv.cjs"),$=require("react"),h=require("./Checkbox-BgrLxY6P.cjs"),g=require("./FieldError-JWxR_EqN.cjs"),P=require("./useFormValidation-DV2Ioblb.cjs"),y=require("./useControlledState-D0L6S_5r.cjs"),j=require("./mergeProps-Du5A8xi8.cjs"),q=require("./filterDOMProps-RRlKPKX0.cjs"),k=require("./useField-DvszkIMx.cjs"),D=require("./useFocusWithin-GBjoTL5o.cjs"),F=require("./useLocalizedStringFormatter-BSac43NO.cjs");function O(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const a in e)if(a!=="default"){const n=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(t,a,n.get?n:{enumerable:!0,get:()=>e[a]})}}return t.default=e,Object.freeze(t)}const v=O($);function R(e,t){let{isDisabled:a,name:n,form:u,validationBehavior:c="aria"}=e,{isInvalid:r,validationErrors:d,validationDetails:l}=t.displayValidation,{labelProps:f,fieldProps:x,descriptionProps:i,errorMessageProps:o}=k.$2baaea4c71418dea$export$294aa081a6c6f55d({...e,labelElementType:"span",isInvalid:r,errorMessage:e.errorMessage||d});h.$1ae600c947479353$export$ec98120685d4f57d.set(t,{name:n,form:u,descriptionId:i.id,errorMessageId:o.id,validationBehavior:c});let b=q.$65484d02dcb7eb3e$export$457c3d6518dd4c6f(e,{labelable:!0}),{focusWithinProps:S}=D.$9ab94262bd0047c7$export$420e68273165f4ec({onBlurWithin:e.onBlur,onFocusWithin:e.onFocus,onFocusWithinChange:e.onFocusChange});return{groupProps:j.$3ef42575df84b30b$export$9d1611c77c2fe928(b,{role:"group","aria-disabled":a||void 0,...x,...S}),labelProps:f,descriptionProps:i,errorMessageProps:o,isInvalid:r,validationErrors:d,validationDetails:l}}function I(e={}){let[t,a]=y.$458b0a5536c1a7cf$export$40bfa8c7b0832715(e.value,e.defaultValue||[],e.onChange),[n]=$.useState(t),u=!!e.isRequired&&t.length===0,c=$.useRef(new Map),r=P.$e5be200c675c3b3a$export$fc1a364ae1f3ff10({...e,value:t}),d=r.displayValidation.isInvalid;var l,f;return{...r,value:t,defaultValue:(l=e.defaultValue)!==null&&l!==void 0?l:n,setValue(i){e.isReadOnly||e.isDisabled||a(i)},isDisabled:e.isDisabled||!1,isReadOnly:e.isReadOnly||!1,isSelected(i){return t.includes(i)},addValue(i){e.isReadOnly||e.isDisabled||t.includes(i)||(t=t.concat(i),a(t))},removeValue(i){e.isReadOnly||e.isDisabled||t.includes(i)&&a(t.filter(o=>o!==i))},toggleValue(i){e.isReadOnly||e.isDisabled||(t.includes(i)?a(t.filter(o=>o!==i)):a(t.concat(i)))},setInvalid(i,o){let b=new Map(c.current);o.isInvalid?b.set(i,o):b.delete(i),c.current=b,r.updateValidation(P.$e5be200c675c3b3a$export$75ee7c75d68f5b0e(...b.values()))},validationState:(f=e.validationState)!==null&&f!==void 0?f:d?"invalid":null,isInvalid:d,isRequired:u}}const M=(e,{value:t})=>{const a=v.Children.toArray(e).filter(l=>v.isValidElement(l)&&l.type===h.Checkbox),n=v.Children.count(a),u=v.Children.toArray(e).filter(l=>v.isValidElement(l)).filter(l=>!!l&&l.type===h.Checkbox).map(l=>l.props.value),c=t.length===0,r=t.length===n;return{allSelected:r,someSelected:!c&&!r,checkboxValues:u}},V=({state:e,errorMessage:t})=>s.jsx(g.$ee014567cb39d3f0$export$ff05c3ac10437e03.Provider,{value:e.displayValidation,children:s.jsx(g.FieldError,{children:t})}),E={selectAll:"Select all"},A={selectAll:"Välj alla"},W={en:E,sv:A};function _(e){const t=I(e),a=F.useLocalizedStringFormatter(W),{groupProps:n,labelProps:u,descriptionProps:c}=R(e,t),{allSelected:r,someSelected:d,checkboxValues:l}=M(e.children,t),f=x=>{t.setValue(x?l:[])};return s.jsxs("div",{...n,className:h.styles.checkboxGroup,children:[s.jsx(m.LabelWrapper,{popover:e.popover,children:e.label&&s.jsx(m.Label,{...u,children:e.label})}),e.description&&s.jsx(C.Text,{slot:"description",...c,children:e.description}),e.errorPosition==="top"&&s.jsx(V,{...e,state:t}),e.showSelectAll&&s.jsx(h.Checkbox,{isSelected:r,isIndeterminate:d,onChange:f,children:e.selectAllLabel||a.format("selectAll")}),s.jsx(h.CheckboxGroupContext.Provider,{value:t,children:e.children}),e.errorPosition==="bottom"&&s.jsx(V,{...e,state:t})]})}exports.CheckboxGroup=_;