@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,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-BGMXsSFb.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-l3xULRa0.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-BhJ9dM2g.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-CNTODOFg.cjs"),C=require("./Text-D5OSv6Uv.cjs"),$=require("react"),h=require("./Checkbox-BgrLxY6P.cjs"),g=require("./FieldError-Cimgm8qD.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=_;