@midas-ds/components 10.1.1 → 10.2.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.
- package/AccordionItem-DZT76sWu.js +320 -0
- package/AccordionItem-Z_c9MpAM.cjs +1 -0
- package/BadgeContainer-D3RtqcPF.js +37 -0
- package/BadgeContainer-DeUgqGqb.cjs +1 -0
- package/Breadcrumbs-CmZXtTiS.js +250 -0
- package/Breadcrumbs-Cx09jwZZ.cjs +1 -0
- package/Button-CbFRzRrF.js +38 -0
- package/Button-DnhqHU01.cjs +1 -0
- package/Button-ZOQy9Ivu.js +78 -0
- package/Button-iSiWjocA.cjs +1 -0
- package/Button.module-CMMhIrkn.js +14 -0
- package/Button.module-DO5s9hOk.cjs +1 -0
- package/ButtonGroup-DUqW5dzM.cjs +1 -0
- package/ButtonGroup-DvVvear6.js +22 -0
- package/CHANGELOG.md +48 -0
- package/Card-C0BFW3wJ.cjs +1 -0
- package/Card-CaKKKv9k.js +131 -0
- package/CharacterCounter-CPGdboVJ.js +22 -0
- package/CharacterCounter-CrY8QRuY.cjs +1 -0
- package/Checkbox-CvFsn_FL.js +380 -0
- package/Checkbox-DSxGAJX2.cjs +1 -0
- package/CheckboxGroup-Bk9DPq4I.cjs +1 -0
- package/CheckboxGroup-Dij9zKlF.js +54 -0
- package/Collection-C5ONNBqd.js +576 -0
- package/Collection-Csx3L9gh.cjs +1 -0
- package/ColorSchemeSwitch-CbAWIJCg.js +106 -0
- package/ColorSchemeSwitch-JRrCyYVv.cjs +16 -0
- package/ComboBox-BCaqPEIH.js +1375 -0
- package/ComboBox-gveQKHU3.cjs +1 -0
- package/DateField-CAQlzuDD.js +46 -0
- package/DateField-deVVFwKA.cjs +1 -0
- package/DateInputDivider-DnUxETEC.cjs +1 -0
- package/DateInputDivider-Dx8n1Lxp.js +2908 -0
- package/DateRangePicker-BmBvwqo6.js +881 -0
- package/DateRangePicker-BzfitoK0.cjs +6 -0
- package/Dialog-Bd5hK360.cjs +1 -0
- package/Dialog-Bxx8cBEq.js +208 -0
- package/Dialog-CYxThuMl.js +1609 -0
- package/Dialog-CwTEAujZ.cjs +1 -0
- package/DragAndDrop-CSwmPhxC.js +60 -0
- package/DragAndDrop-HvycSrKY.cjs +1 -0
- package/Dropdown-CaGon9OR.cjs +6 -0
- package/Dropdown-nkjzsVYX.js +84 -0
- package/FieldError-BZw8UzBk.cjs +1 -0
- package/FieldError-CZikNDxX.js +28 -0
- package/FieldError-DqdfJ3fs.cjs +1 -0
- package/FieldError-Dv3bBEjh.js +23 -0
- package/FileUpload-DYRZ0M9F.cjs +2 -0
- package/FileUpload-ULwcYDxs.js +2372 -0
- package/FocusScope-DwIqdYpQ.js +625 -0
- package/FocusScope-NaPbvuuS.cjs +1 -0
- package/Form-BuOomA4T.cjs +1 -0
- package/Form-CXcEMuBf.js +5 -0
- package/Grid--OhtgCo6.js +27 -0
- package/Grid-DVQtOcu9.cjs +1 -0
- package/GridItem-DlbSdRmB.js +246 -0
- package/GridItem-XgHmZWXY.cjs +1 -0
- package/Group-CeSsSQVC.js +44 -0
- package/Group-CgiqQHH1.cjs +1 -0
- package/Heading-BY5-QN4S.js +46 -0
- package/Heading-DoJAtYZf.cjs +1 -0
- package/Hidden-B5ir3Lei.js +34 -0
- package/Hidden-BxRZGdEW.cjs +1 -0
- package/InfoBanner-BS-dAfzO.cjs +1 -0
- package/InfoBanner-CVIBFSWx.js +82 -0
- package/Input-D8Ku_FQz.js +41 -0
- package/Input-DKSAYvsw.cjs +1 -0
- package/Label-C9ivwkAd.js +21 -0
- package/Label-CUV21CAv.cjs +1 -0
- package/Label-DkDOsmUF.js +16 -0
- package/Label-IMWAyoKb.cjs +1 -0
- package/Layout-BWeHHnqU.cjs +16 -0
- package/Layout-CCt_2L1k.js +468 -0
- package/Link-B-nus-FT.js +71 -0
- package/Link-DsnCtNeI.cjs +6 -0
- package/Link-SHMbeyIP.cjs +1 -0
- package/Link-uFowN4qv.js +59 -0
- package/LinkButton-CuBilDML.js +69 -0
- package/LinkButton-CymMrcGL.cjs +6 -0
- package/ListBox-CDOsQChA.cjs +1 -0
- package/ListBox-DOi_y_Lt.js +530 -0
- package/ListBoxButton-CFeNhJhr.cjs +1 -0
- package/ListBoxButton-O6zN3P4W.js +15 -0
- package/ListBoxSection-C1aLKL9p.js +1058 -0
- package/ListBoxSection-DGCP6xpf.cjs +1 -0
- package/ListKeyboardDelegate-BqMETvPv.cjs +1 -0
- package/ListKeyboardDelegate-DNOzQ8nc.js +158 -0
- package/LiveAnnouncer-B6177m92.js +51 -0
- package/LiveAnnouncer-CwEWPU8b.cjs +1 -0
- package/LocalizedStringFormatter-C0C54hjf.cjs +1 -0
- package/LocalizedStringFormatter-D-4Qyql0.js +77 -0
- package/Logo-BIrOEINM.js +133 -0
- package/Logo-DT2_2O43.cjs +1 -0
- package/NumberFormatter-DewVDY5w.cjs +1 -0
- package/NumberFormatter-DgOUVrge.js +119 -0
- package/OverlayArrow-D75k-EMl.cjs +1 -0
- package/OverlayArrow-DorA4Rbr.js +506 -0
- package/PressResponder-C06O3Z5P.cjs +1 -0
- package/PressResponder-CVEg5kND.js +33 -0
- package/ProgressBar-Bkw9zavs.cjs +1 -0
- package/ProgressBar-CEX2WNoW.js +77 -0
- package/ProgressBar-Dqh3ftSP.cjs +1 -0
- package/ProgressBar-gmAzSsrz.js +53 -0
- package/RSPContexts-BW2SEIqe.js +11 -0
- package/RSPContexts-D8hmBfGm.cjs +1 -0
- package/Radio-CDKrvQe4.cjs +1 -0
- package/Radio-_ukSkxPT.js +311 -0
- package/RangeCalendar-cbCKBPZv.cjs +11 -0
- package/RangeCalendar-uXwoBL-O.js +1685 -0
- package/SearchField-6yBGiojX.cjs +6 -0
- package/SearchField-DYl2uo7o.js +362 -0
- package/Select-CpHjd1tp.cjs +1 -0
- package/Select-PvCqY7Lp.js +646 -0
- package/SelectionManager-6H88Cv6B.js +1033 -0
- package/SelectionManager-C5NGBzvz.cjs +1 -0
- package/Separator-LYnFqh4L.js +60 -0
- package/Separator-nPra6kD-.cjs +1 -0
- package/Skeleton-BAwbfKBW.cjs +1 -0
- package/Skeleton-BePDRmrO.js +40 -0
- package/Spinner-D31SXm-U.js +41 -0
- package/Spinner-DAJtfxqJ.cjs +6 -0
- package/Table-B_N7wUmA.js +2451 -0
- package/Table-D9vNc_y-.cjs +16 -0
- package/Tabs-Ct6D83aR.js +404 -0
- package/Tabs-Dtcl2oK2.cjs +1 -0
- package/Tag-CVFkzg3s.cjs +1 -0
- package/Tag-g6HN-YCv.js +748 -0
- package/Text-3MNwRMpI.cjs +1 -0
- package/Text-B2K-BJKQ.cjs +1 -0
- package/Text-BN-g1iWi.js +32 -0
- package/Text-B_H68Tvq.js +15 -0
- package/TextArea-DSiQ578a.js +206 -0
- package/TextArea-cVyGBRbL.cjs +1 -0
- package/TextField-B70CL2qz.cjs +1 -0
- package/TextField-DBaRuNj7.js +119 -0
- package/TextField.module-BcpPBWnD.js +13 -0
- package/TextField.module-Dw5Rtn9y.cjs +1 -0
- package/Toast-CjpldAI8.js +988 -0
- package/Toast-DrkOGy4d.cjs +1 -0
- package/ToggleButtonGroup-BuU_6dYe.cjs +1 -0
- package/ToggleButtonGroup-Ceh9_yBM.js +210 -0
- package/Tooltip-BAIjaYax.js +283 -0
- package/Tooltip-CiWg4zIC.cjs +1 -0
- package/VisuallyHidden-CtXvK_Tw.cjs +1 -0
- package/VisuallyHidden-D-4z1VgU.js +40 -0
- package/accordion/index.cjs +1 -0
- package/accordion/index.js +5 -0
- package/arrow-right-Cw48o2oW.cjs +6 -0
- package/arrow-right-Dg8sttFO.js +14 -0
- package/assets/AccordionItem.css +1 -0
- package/assets/BadgeContainer.css +1 -0
- package/assets/Breadcrumbs.css +1 -0
- package/assets/Button.css +1 -0
- package/assets/ButtonGroup.css +1 -0
- package/assets/Card.css +1 -0
- package/assets/CharacterCounter.css +1 -0
- package/assets/Checkbox.css +1 -0
- package/assets/ColorSchemeSwitch.css +1 -0
- package/assets/ComboBox.css +1 -0
- package/assets/DateField.css +1 -0
- package/assets/DateInputDivider.css +1 -0
- package/assets/DateRangePicker.css +1 -0
- package/assets/Dialog.css +1 -0
- package/assets/Dropdown.css +1 -0
- package/assets/FieldError.css +1 -0
- package/assets/FileUpload.css +1 -0
- package/assets/GridItem.css +1 -0
- package/assets/Heading.css +1 -0
- package/assets/InfoBanner.css +1 -0
- package/assets/Label.css +1 -0
- package/assets/Layout.css +1 -0
- package/assets/Link.css +1 -0
- package/assets/LinkButton.css +1 -0
- package/assets/ListBoxSection.css +1 -0
- package/assets/Logo.css +1 -0
- package/assets/ProgressBar.css +1 -0
- package/assets/Radio.css +1 -0
- package/assets/RangeCalendar.css +1 -0
- package/assets/SearchField.css +1 -0
- package/assets/Select.css +1 -0
- package/assets/Skeleton.css +1 -0
- package/assets/Spinner.css +1 -0
- package/assets/Table.css +1 -0
- package/assets/Tabs.css +1 -0
- package/assets/Tag.css +1 -0
- package/assets/Text.css +1 -0
- package/assets/TextField.css +1 -0
- package/assets/Toast.css +1 -0
- package/assets/ToggleButtonGroup.css +1 -0
- package/assets/Tooltip.css +1 -0
- package/badge/index.cjs +1 -0
- package/badge/index.js +5 -0
- package/breadcrumbs/index.cjs +1 -0
- package/breadcrumbs/index.js +4 -0
- package/button/index.cjs +1 -0
- package/button/index.js +6 -0
- package/calendar/CalendarHeader.d.ts +2 -1
- package/calendar/index.cjs +1 -0
- package/calendar/index.js +5 -0
- package/card/index.cjs +1 -0
- package/card/index.js +10 -0
- package/character-counter/index.cjs +1 -0
- package/character-counter/index.js +4 -0
- package/check-CLF6Yxza.js +11 -0
- package/check-Dw9c62O4.cjs +6 -0
- package/checkbox/index.cjs +1 -0
- package/checkbox/index.js +6 -0
- package/chevron-down-C2E7aZ3N.cjs +6 -0
- package/chevron-down-Cd1bkzXT.js +13 -0
- package/clsx-C11secjj.cjs +1 -0
- package/clsx-OuTLNxxd.js +16 -0
- package/color-scheme-switch/index.cjs +1 -0
- package/color-scheme-switch/index.js +4 -0
- package/combobox/index.cjs +1 -0
- package/combobox/index.js +7 -0
- package/common/types.d.ts +2 -0
- package/context-B8cn10po.js +80 -0
- package/context-DjwhtgxQ.cjs +1 -0
- package/createLucideIcon-DAY4oS-S.cjs +21 -0
- package/createLucideIcon-DeWljiyi.js +79 -0
- package/date-field/index.cjs +1 -0
- package/date-field/index.js +8 -0
- package/date-picker/index.cjs +1 -0
- package/date-picker/index.js +5 -0
- package/dropdown/index.cjs +1 -0
- package/dropdown/index.js +5 -0
- package/field-error/FieldError.d.ts +4 -1
- package/field-error/index.cjs +1 -0
- package/field-error/index.js +4 -0
- package/file-upload/index.cjs +1 -0
- package/file-upload/index.js +4 -0
- package/filterDOMProps-BS2lrgFA.cjs +1 -0
- package/filterDOMProps-D6KHYVBX.js +24 -0
- package/focusSafely-Bqfo_DH7.cjs +1 -0
- package/focusSafely-C48ucRUz.js +56 -0
- package/getScrollParent-DuKmPmUa.cjs +1 -0
- package/getScrollParent-Ru2U2LlM.js +9 -0
- package/grid/Grid.d.ts +15 -4
- package/grid/GridItem.d.ts +31 -2
- package/grid/index.cjs +1 -0
- package/grid/index.d.ts +2 -2
- package/grid/index.js +8 -0
- package/heading/index.cjs +1 -0
- package/heading/index.js +4 -0
- package/index-BSMrH_Du.js +120 -0
- package/index-D97L3EBk.cjs +17 -0
- package/index.cjs +1 -169
- package/index.d.ts +0 -1
- package/index.js +127 -29979
- package/inertValue-B7loUihk.js +8 -0
- package/inertValue-BWmZ1afe.cjs +1 -0
- package/info-DkzVqB8I.js +38 -0
- package/info-DlzSeKbc.cjs +16 -0
- package/info-banner/index.cjs +1 -0
- package/info-banner/index.js +4 -0
- package/label/index.cjs +1 -0
- package/label/index.js +4 -0
- package/layout/index.cjs +1 -0
- package/layout/index.js +8 -0
- package/link/index.cjs +1 -0
- package/link/index.js +6 -0
- package/link-button/index.cjs +1 -0
- package/link-button/index.js +6 -0
- package/list-box/index.cjs +1 -0
- package/list-box/index.js +9 -0
- package/logo/index.cjs +1 -0
- package/logo/index.js +4 -0
- package/modal/index.cjs +1 -0
- package/modal/index.js +6 -0
- package/number-BE8InLgI.js +6 -0
- package/number-E0x3H9cL.cjs +1 -0
- package/package.json +4 -4
- package/progress-bar/index.cjs +1 -0
- package/progress-bar/index.js +4 -0
- package/radio/index.cjs +1 -0
- package/radio/index.js +5 -0
- package/scrollIntoView-ClEACHUk.js +57 -0
- package/scrollIntoView-DRSoJp89.cjs +1 -0
- package/search-field/index.cjs +1 -0
- package/search-field/index.js +4 -0
- package/select/index.cjs +1 -0
- package/select/index.js +4 -0
- package/skeleton/Skeleton.d.ts +5 -0
- package/skeleton/index.cjs +1 -0
- package/skeleton/index.js +4 -0
- package/spinner/index.cjs +1 -0
- package/spinner/index.js +4 -0
- package/square-arrow-out-up-right-BCAO2eJs.cjs +6 -0
- package/square-arrow-out-up-right-BkyqV2PN.js +15 -0
- package/table/Table.d.ts +7 -1
- package/table/index.cjs +1 -0
- package/table/index.js +9 -0
- package/tabs/index.cjs +1 -0
- package/tabs/index.js +4 -0
- package/tag/index.cjs +1 -0
- package/tag/index.js +5 -0
- package/text/index.cjs +1 -0
- package/text/index.js +4 -0
- package/textfield/index.cjs +1 -0
- package/textfield/index.js +7 -0
- package/theme/index.cjs +1 -0
- package/theme/index.d.ts +4 -0
- package/{theme.js → theme/index.js} +2 -2
- package/theme/tokens.d.ts +10 -0
- package/toast/index.cjs +1 -0
- package/toast/index.js +9 -0
- package/toggle-button/index.cjs +1 -0
- package/toggle-button/index.js +5 -0
- package/tokens-p6pg1Cea.cjs +1 -0
- package/{tokens-C0U7hdoO.js → tokens-xp-7KMK7.js} +18 -8
- package/tooltip/index.cjs +1 -0
- package/tooltip/index.js +5 -0
- package/triangle-alert-C0lvfCYH.cjs +6 -0
- package/triangle-alert-wxyxspAl.js +21 -0
- package/useButton-B1Fa-6qE.cjs +1 -0
- package/useButton-C-Lq7CNY.js +47 -0
- package/useCollator-C_ozeWLo.cjs +1 -0
- package/useCollator-CgZcHC8N.js +11 -0
- package/useControlledState-D0L6S_5r.cjs +1 -0
- package/useControlledState-u436Wbp1.js +30 -0
- package/useDateFormatter-C53Uxdli.js +1571 -0
- package/useDateFormatter-g2maMTGH.cjs +1 -0
- package/useDescription-CVKhFa3c.js +32 -0
- package/useDescription-DmQYSEES.cjs +1 -0
- package/useEvent-CjkbBniY.cjs +1 -0
- package/useEvent-Cyd2ZL0c.js +21 -0
- package/useField-B1RU0GKs.cjs +1 -0
- package/useField-BPMAlIbU.js +35 -0
- package/useFilter-ChIbnALW.js +35 -0
- package/useFilter-CtIwF2qW.cjs +1 -0
- package/useFocusRing-BDGH3lpn.js +82 -0
- package/useFocusRing-CbImDrwF.cjs +1 -0
- package/useFocusable-CaedRTpB.js +74 -0
- package/useFocusable-CuPQ7Cm5.cjs +1 -0
- package/useFormValidation-ClximP89.cjs +1 -0
- package/useFormValidation-R8hQIjWP.js +215 -0
- package/useHasTabbableChild-DgphNvnk.cjs +1 -0
- package/useHasTabbableChild-DsD9AJwE.js +34 -0
- package/useHighlightSelectionDescription-BizKjvPU.cjs +1 -0
- package/useHighlightSelectionDescription-DFfcgbUj.js +567 -0
- package/useHover-_mv5J4_q.cjs +1 -0
- package/useHover-qRAon4nS.js +490 -0
- package/useLabel-DDdAJ1JO.js +23 -0
- package/useLabel-m_S5xkHy.cjs +1 -0
- package/useLabels-BLOfc6Y-.cjs +1 -0
- package/useLabels-BZjoZA1Z.js +17 -0
- package/useListState-Ca2-uZMO.cjs +1 -0
- package/useListState-DFQ9d-uE.js +132 -0
- package/useLocalizedStringFormatter-D07YB2e1.js +22 -0
- package/useLocalizedStringFormatter-u9SJaOwk.cjs +1 -0
- package/useObserveElement-BdI4zgd7.js +27 -0
- package/useObserveElement-BzEr5D32.cjs +1 -0
- package/usePress-BFa6cT9o.cjs +7 -0
- package/usePress-CUJ3pMOw.js +542 -0
- package/useSingleSelectListState-C-nB8cug.js +34 -0
- package/useSingleSelectListState-MGNxUTum.cjs +1 -0
- package/useTextField-5OZQPyOW.js +86 -0
- package/useTextField-CtUDWsUl.cjs +1 -0
- package/useToggleState-Bz5rAf4C.js +18 -0
- package/useToggleState-DoIkSQdj.cjs +1 -0
- package/useUpdateEffect-CCDx8D4X.js +13 -0
- package/useUpdateEffect-sk3kiVGz.cjs +1 -0
- package/utils-BNtZbAib.cjs +1 -0
- package/utils-HNTsIwux.js +308 -0
- package/x-CvxiAZTW.cjs +6 -0
- package/x-JK7i-TQC.js +14 -0
- package/flex/Flex.d.ts +0 -17
- package/flex/FlexItem.d.ts +0 -15
- package/flex/index.d.ts +0 -2
- package/index.css +0 -1
- package/theme.cjs +0 -1
- package/tokens-COoF1t17.cjs +0 -1
- /package/{global.css → assets/global.css} +0 -0
|
@@ -0,0 +1,380 @@
|
|
|
1
|
+
import { jsx as p, jsxs as J, Fragment as K } from "react/jsx-runtime";
|
|
2
|
+
import { c as Q } from "./clsx-OuTLNxxd.js";
|
|
3
|
+
import { a as U } from "./RSPContexts-BW2SEIqe.js";
|
|
4
|
+
import { d as x, a as M, h as E, e as X, m as Y, j as C, b as w, i as Z, k as ee } from "./utils-HNTsIwux.js";
|
|
5
|
+
import { $ as ae } from "./FieldError-CZikNDxX.js";
|
|
6
|
+
import { $ as F } from "./Form-CXcEMuBf.js";
|
|
7
|
+
import { $ as ie } from "./Label-DkDOsmUF.js";
|
|
8
|
+
import { a as de } from "./Text-B_H68Tvq.js";
|
|
9
|
+
import { $ as _ } from "./filterDOMProps-D6KHYVBX.js";
|
|
10
|
+
import R, { useEffect as N, useRef as W, forwardRef as G, useContext as le, createContext as j, useMemo as ne } from "react";
|
|
11
|
+
import { a as te, $ as B, b as re, c as L, d as se, e as oe } from "./useFormValidation-R8hQIjWP.js";
|
|
12
|
+
import { b as D } from "./usePress-CUJ3pMOw.js";
|
|
13
|
+
import { $ as ce } from "./useFocusable-CaedRTpB.js";
|
|
14
|
+
import { $ as H } from "./useToggleState-Bz5rAf4C.js";
|
|
15
|
+
import { $ as fe } from "./useField-BPMAlIbU.js";
|
|
16
|
+
import { a as ue, $ as be } from "./useFocusRing-BDGH3lpn.js";
|
|
17
|
+
import { $ as ve } from "./useHover-qRAon4nS.js";
|
|
18
|
+
import { $ as $e } from "./VisuallyHidden-D-4z1VgU.js";
|
|
19
|
+
import { $ as me } from "./useControlledState-u436Wbp1.js";
|
|
20
|
+
import './assets/Checkbox.css';function he(a, e, d) {
|
|
21
|
+
let { isDisabled: t = !1, isReadOnly: s = !1, value: o, name: c, children: l, "aria-label": f, "aria-labelledby": i, validationState: n = "valid", isInvalid: r } = a, v = (h) => {
|
|
22
|
+
h.stopPropagation(), e.setSelected(h.target.checked);
|
|
23
|
+
}, $ = l != null, u = f != null || i != null;
|
|
24
|
+
!$ && !u && process.env.NODE_ENV !== "production" && console.warn("If you do not provide children, you must specify an aria-label for accessibility");
|
|
25
|
+
let { pressProps: b, isPressed: m } = D({
|
|
26
|
+
isDisabled: t
|
|
27
|
+
}), { pressProps: P, isPressed: y } = D({
|
|
28
|
+
onPress() {
|
|
29
|
+
var h;
|
|
30
|
+
e.toggle(), (h = d.current) === null || h === void 0 || h.focus();
|
|
31
|
+
},
|
|
32
|
+
isDisabled: t || s
|
|
33
|
+
}), { focusableProps: I } = ce(a, d), g = x(b, I), V = _(a, {
|
|
34
|
+
labelable: !0
|
|
35
|
+
});
|
|
36
|
+
return te(d, e.isSelected, e.setSelected), {
|
|
37
|
+
labelProps: x(P, {
|
|
38
|
+
onClick: (h) => h.preventDefault()
|
|
39
|
+
}),
|
|
40
|
+
inputProps: x(V, {
|
|
41
|
+
"aria-invalid": r || n === "invalid" || void 0,
|
|
42
|
+
"aria-errormessage": a["aria-errormessage"],
|
|
43
|
+
"aria-controls": a["aria-controls"],
|
|
44
|
+
"aria-readonly": s || void 0,
|
|
45
|
+
onChange: v,
|
|
46
|
+
disabled: t,
|
|
47
|
+
...o == null ? {} : {
|
|
48
|
+
value: o
|
|
49
|
+
},
|
|
50
|
+
name: c,
|
|
51
|
+
type: "checkbox",
|
|
52
|
+
...g
|
|
53
|
+
}),
|
|
54
|
+
isSelected: e.isSelected,
|
|
55
|
+
isPressed: m || y,
|
|
56
|
+
isDisabled: t,
|
|
57
|
+
isReadOnly: s,
|
|
58
|
+
isInvalid: r || n === "invalid"
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
function T(a, e, d) {
|
|
62
|
+
let t = B({
|
|
63
|
+
...a,
|
|
64
|
+
value: e.isSelected
|
|
65
|
+
}), { isInvalid: s, validationErrors: o, validationDetails: c } = t.displayValidation, { labelProps: l, inputProps: f, isSelected: i, isPressed: n, isDisabled: r, isReadOnly: v } = he({
|
|
66
|
+
...a,
|
|
67
|
+
isInvalid: s
|
|
68
|
+
}, e, d);
|
|
69
|
+
re(a, t, d);
|
|
70
|
+
let { isIndeterminate: $, isRequired: u, validationBehavior: b = "aria" } = a;
|
|
71
|
+
N(() => {
|
|
72
|
+
d.current && (d.current.indeterminate = !!$);
|
|
73
|
+
});
|
|
74
|
+
let { pressProps: m } = D({
|
|
75
|
+
isDisabled: r || v,
|
|
76
|
+
onPress() {
|
|
77
|
+
let { [L]: P } = a, { commitValidation: y } = P || t;
|
|
78
|
+
y();
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
return {
|
|
82
|
+
labelProps: x(l, m),
|
|
83
|
+
inputProps: {
|
|
84
|
+
...f,
|
|
85
|
+
checked: i,
|
|
86
|
+
"aria-required": u && b === "aria" || void 0,
|
|
87
|
+
required: u && b === "native"
|
|
88
|
+
},
|
|
89
|
+
isSelected: i,
|
|
90
|
+
isPressed: n,
|
|
91
|
+
isDisabled: r,
|
|
92
|
+
isReadOnly: v,
|
|
93
|
+
isInvalid: s,
|
|
94
|
+
validationErrors: o,
|
|
95
|
+
validationDetails: c
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
const A = /* @__PURE__ */ new WeakMap();
|
|
99
|
+
function Pe(a, e) {
|
|
100
|
+
let { isDisabled: d, name: t, validationBehavior: s = "aria" } = a, { isInvalid: o, validationErrors: c, validationDetails: l } = e.displayValidation, { labelProps: f, fieldProps: i, descriptionProps: n, errorMessageProps: r } = fe({
|
|
101
|
+
...a,
|
|
102
|
+
// Checkbox group is not an HTML input element so it
|
|
103
|
+
// shouldn't be labeled by a <label> element.
|
|
104
|
+
labelElementType: "span",
|
|
105
|
+
isInvalid: o,
|
|
106
|
+
errorMessage: a.errorMessage || c
|
|
107
|
+
});
|
|
108
|
+
A.set(e, {
|
|
109
|
+
name: t,
|
|
110
|
+
descriptionId: n.id,
|
|
111
|
+
errorMessageId: r.id,
|
|
112
|
+
validationBehavior: s
|
|
113
|
+
});
|
|
114
|
+
let v = _(a, {
|
|
115
|
+
labelable: !0
|
|
116
|
+
}), { focusWithinProps: $ } = ue({
|
|
117
|
+
onBlurWithin: a.onBlur,
|
|
118
|
+
onFocusWithin: a.onFocus,
|
|
119
|
+
onFocusWithinChange: a.onFocusChange
|
|
120
|
+
});
|
|
121
|
+
return {
|
|
122
|
+
groupProps: x(v, {
|
|
123
|
+
role: "group",
|
|
124
|
+
"aria-disabled": d || void 0,
|
|
125
|
+
...i,
|
|
126
|
+
...$
|
|
127
|
+
}),
|
|
128
|
+
labelProps: f,
|
|
129
|
+
descriptionProps: n,
|
|
130
|
+
errorMessageProps: r,
|
|
131
|
+
isInvalid: o,
|
|
132
|
+
validationErrors: c,
|
|
133
|
+
validationDetails: l
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
function xe(a, e, d) {
|
|
137
|
+
const t = H({
|
|
138
|
+
isReadOnly: a.isReadOnly || e.isReadOnly,
|
|
139
|
+
isSelected: e.isSelected(a.value),
|
|
140
|
+
onChange(m) {
|
|
141
|
+
m ? e.addValue(a.value) : e.removeValue(a.value), a.onChange && a.onChange(m);
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
let { name: s, descriptionId: o, errorMessageId: c, validationBehavior: l } = A.get(e);
|
|
145
|
+
var f;
|
|
146
|
+
l = (f = a.validationBehavior) !== null && f !== void 0 ? f : l;
|
|
147
|
+
let { realtimeValidation: i } = B({
|
|
148
|
+
...a,
|
|
149
|
+
value: t.isSelected,
|
|
150
|
+
// Server validation is handled at the group level.
|
|
151
|
+
name: void 0,
|
|
152
|
+
validationBehavior: "aria"
|
|
153
|
+
}), n = W(se), r = () => {
|
|
154
|
+
e.setInvalid(a.value, i.isInvalid ? i : n.current);
|
|
155
|
+
};
|
|
156
|
+
N(r);
|
|
157
|
+
let v = e.realtimeValidation.isInvalid ? e.realtimeValidation : i, $ = l === "native" ? e.displayValidation : v;
|
|
158
|
+
var u;
|
|
159
|
+
let b = T({
|
|
160
|
+
...a,
|
|
161
|
+
isReadOnly: a.isReadOnly || e.isReadOnly,
|
|
162
|
+
isDisabled: a.isDisabled || e.isDisabled,
|
|
163
|
+
name: a.name || s,
|
|
164
|
+
isRequired: (u = a.isRequired) !== null && u !== void 0 ? u : e.isRequired,
|
|
165
|
+
validationBehavior: l,
|
|
166
|
+
[L]: {
|
|
167
|
+
realtimeValidation: v,
|
|
168
|
+
displayValidation: $,
|
|
169
|
+
resetValidation: e.resetValidation,
|
|
170
|
+
commitValidation: e.commitValidation,
|
|
171
|
+
updateValidation(m) {
|
|
172
|
+
n.current = m, r();
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
}, t, d);
|
|
176
|
+
return {
|
|
177
|
+
...b,
|
|
178
|
+
inputProps: {
|
|
179
|
+
...b.inputProps,
|
|
180
|
+
"aria-describedby": [
|
|
181
|
+
a["aria-describedby"],
|
|
182
|
+
e.isInvalid ? c : null,
|
|
183
|
+
o
|
|
184
|
+
].filter(Boolean).join(" ") || void 0
|
|
185
|
+
}
|
|
186
|
+
};
|
|
187
|
+
}
|
|
188
|
+
function ye(a = {}) {
|
|
189
|
+
let [e, d] = me(a.value, a.defaultValue || [], a.onChange), t = !!a.isRequired && e.length === 0, s = W(/* @__PURE__ */ new Map()), o = B({
|
|
190
|
+
...a,
|
|
191
|
+
value: e
|
|
192
|
+
}), c = o.displayValidation.isInvalid;
|
|
193
|
+
var l;
|
|
194
|
+
return {
|
|
195
|
+
...o,
|
|
196
|
+
value: e,
|
|
197
|
+
setValue(i) {
|
|
198
|
+
a.isReadOnly || a.isDisabled || d(i);
|
|
199
|
+
},
|
|
200
|
+
isDisabled: a.isDisabled || !1,
|
|
201
|
+
isReadOnly: a.isReadOnly || !1,
|
|
202
|
+
isSelected(i) {
|
|
203
|
+
return e.includes(i);
|
|
204
|
+
},
|
|
205
|
+
addValue(i) {
|
|
206
|
+
a.isReadOnly || a.isDisabled || e.includes(i) || d(e.concat(i));
|
|
207
|
+
},
|
|
208
|
+
removeValue(i) {
|
|
209
|
+
a.isReadOnly || a.isDisabled || e.includes(i) && d(e.filter((n) => n !== i));
|
|
210
|
+
},
|
|
211
|
+
toggleValue(i) {
|
|
212
|
+
a.isReadOnly || a.isDisabled || (e.includes(i) ? d(e.filter((n) => n !== i)) : d(e.concat(i)));
|
|
213
|
+
},
|
|
214
|
+
setInvalid(i, n) {
|
|
215
|
+
let r = new Map(s.current);
|
|
216
|
+
n.isInvalid ? r.set(i, n) : r.delete(i), s.current = r, o.updateValidation(oe(...r.values()));
|
|
217
|
+
},
|
|
218
|
+
validationState: (l = a.validationState) !== null && l !== void 0 ? l : c ? "invalid" : null,
|
|
219
|
+
isInvalid: c,
|
|
220
|
+
isRequired: t
|
|
221
|
+
};
|
|
222
|
+
}
|
|
223
|
+
const pe = /* @__PURE__ */ j(null), z = /* @__PURE__ */ j(null), ze = /* @__PURE__ */ G(function(e, d) {
|
|
224
|
+
[e, d] = M(e, d, pe);
|
|
225
|
+
let { validationBehavior: t } = E(F) || {};
|
|
226
|
+
var s, o;
|
|
227
|
+
let c = (o = (s = e.validationBehavior) !== null && s !== void 0 ? s : t) !== null && o !== void 0 ? o : "native", l = ye({
|
|
228
|
+
...e,
|
|
229
|
+
validationBehavior: c
|
|
230
|
+
}), [f, i] = Z(!e["aria-label"] && !e["aria-labelledby"]), { groupProps: n, labelProps: r, descriptionProps: v, errorMessageProps: $, ...u } = Pe({
|
|
231
|
+
...e,
|
|
232
|
+
label: i,
|
|
233
|
+
validationBehavior: c
|
|
234
|
+
}, l), b = w({
|
|
235
|
+
...e,
|
|
236
|
+
values: {
|
|
237
|
+
isDisabled: l.isDisabled,
|
|
238
|
+
isReadOnly: l.isReadOnly,
|
|
239
|
+
isRequired: e.isRequired || !1,
|
|
240
|
+
isInvalid: l.isInvalid,
|
|
241
|
+
state: l
|
|
242
|
+
},
|
|
243
|
+
defaultClassName: "react-aria-CheckboxGroup"
|
|
244
|
+
});
|
|
245
|
+
return /* @__PURE__ */ R.createElement("div", {
|
|
246
|
+
...n,
|
|
247
|
+
...b,
|
|
248
|
+
ref: d,
|
|
249
|
+
slot: e.slot || void 0,
|
|
250
|
+
"data-readonly": l.isReadOnly || void 0,
|
|
251
|
+
"data-required": e.isRequired || void 0,
|
|
252
|
+
"data-invalid": l.isInvalid || void 0,
|
|
253
|
+
"data-disabled": e.isDisabled || void 0
|
|
254
|
+
}, /* @__PURE__ */ R.createElement(ee, {
|
|
255
|
+
values: [
|
|
256
|
+
[
|
|
257
|
+
z,
|
|
258
|
+
l
|
|
259
|
+
],
|
|
260
|
+
[
|
|
261
|
+
ie,
|
|
262
|
+
{
|
|
263
|
+
...r,
|
|
264
|
+
ref: f,
|
|
265
|
+
elementType: "span"
|
|
266
|
+
}
|
|
267
|
+
],
|
|
268
|
+
[
|
|
269
|
+
de,
|
|
270
|
+
{
|
|
271
|
+
slots: {
|
|
272
|
+
description: v,
|
|
273
|
+
errorMessage: $
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
],
|
|
277
|
+
[
|
|
278
|
+
ae,
|
|
279
|
+
u
|
|
280
|
+
]
|
|
281
|
+
]
|
|
282
|
+
}, b.children));
|
|
283
|
+
}), Re = /* @__PURE__ */ G(function(e, d) {
|
|
284
|
+
let { inputRef: t = null, ...s } = e;
|
|
285
|
+
[e, d] = M(s, d, U);
|
|
286
|
+
let { validationBehavior: o } = E(F) || {};
|
|
287
|
+
var c, l;
|
|
288
|
+
let f = (l = (c = e.validationBehavior) !== null && c !== void 0 ? c : o) !== null && l !== void 0 ? l : "native", i = le(z), n = X(ne(() => Y(t, e.inputRef !== void 0 ? e.inputRef : null), [
|
|
289
|
+
t,
|
|
290
|
+
e.inputRef
|
|
291
|
+
])), { labelProps: r, inputProps: v, isSelected: $, isDisabled: u, isReadOnly: b, isPressed: m, isInvalid: P } = i ? xe({
|
|
292
|
+
...C(e),
|
|
293
|
+
// Value is optional for standalone checkboxes, but required for CheckboxGroup items;
|
|
294
|
+
// it's passed explicitly here to avoid typescript error (requires ignore).
|
|
295
|
+
// @ts-ignore
|
|
296
|
+
value: e.value,
|
|
297
|
+
// ReactNode type doesn't allow function children.
|
|
298
|
+
children: typeof e.children == "function" ? !0 : e.children
|
|
299
|
+
}, i, n) : T({
|
|
300
|
+
...C(e),
|
|
301
|
+
children: typeof e.children == "function" ? !0 : e.children,
|
|
302
|
+
validationBehavior: f
|
|
303
|
+
}, H(e), n), { isFocused: y, isFocusVisible: I, focusProps: g } = be(), V = u || b, { hoverProps: h, isHovered: O } = ve({
|
|
304
|
+
...e,
|
|
305
|
+
isDisabled: V
|
|
306
|
+
}), S = w({
|
|
307
|
+
...e,
|
|
308
|
+
defaultClassName: "react-aria-Checkbox",
|
|
309
|
+
values: {
|
|
310
|
+
isSelected: $,
|
|
311
|
+
isIndeterminate: e.isIndeterminate || !1,
|
|
312
|
+
isPressed: m,
|
|
313
|
+
isHovered: O,
|
|
314
|
+
isFocused: y,
|
|
315
|
+
isFocusVisible: I,
|
|
316
|
+
isDisabled: u,
|
|
317
|
+
isReadOnly: b,
|
|
318
|
+
isInvalid: P,
|
|
319
|
+
isRequired: e.isRequired || !1
|
|
320
|
+
}
|
|
321
|
+
}), k = _(e);
|
|
322
|
+
return delete k.id, /* @__PURE__ */ R.createElement("label", {
|
|
323
|
+
...x(k, r, h, S),
|
|
324
|
+
ref: d,
|
|
325
|
+
slot: e.slot || void 0,
|
|
326
|
+
"data-selected": $ || void 0,
|
|
327
|
+
"data-indeterminate": e.isIndeterminate || void 0,
|
|
328
|
+
"data-pressed": m || void 0,
|
|
329
|
+
"data-hovered": O || void 0,
|
|
330
|
+
"data-focused": y || void 0,
|
|
331
|
+
"data-focus-visible": I || void 0,
|
|
332
|
+
"data-disabled": u || void 0,
|
|
333
|
+
"data-readonly": b || void 0,
|
|
334
|
+
"data-invalid": P || void 0,
|
|
335
|
+
"data-required": e.isRequired || void 0
|
|
336
|
+
}, /* @__PURE__ */ R.createElement($e, {
|
|
337
|
+
elementType: "span"
|
|
338
|
+
}, /* @__PURE__ */ R.createElement("input", {
|
|
339
|
+
...x(v, g),
|
|
340
|
+
ref: n
|
|
341
|
+
})), S.children);
|
|
342
|
+
}), Ie = "_wrap_lpri7_4", ge = "_checkboxInner_lpri7_11", Ve = "_checkbox_lpri7_11", De = "_checkboxGroup_lpri7_127", q = {
|
|
343
|
+
wrap: Ie,
|
|
344
|
+
checkboxInner: ge,
|
|
345
|
+
checkbox: Ve,
|
|
346
|
+
checkboxGroup: De
|
|
347
|
+
}, Je = ({ children: a, ...e }) => /* @__PURE__ */ p(
|
|
348
|
+
Re,
|
|
349
|
+
{
|
|
350
|
+
className: Q(q.checkbox, e.className),
|
|
351
|
+
...e,
|
|
352
|
+
children: ({ isIndeterminate: d }) => /* @__PURE__ */ J(K, { children: [
|
|
353
|
+
/* @__PURE__ */ p("div", { className: q.checkboxInner, children: /* @__PURE__ */ p(
|
|
354
|
+
"svg",
|
|
355
|
+
{
|
|
356
|
+
width: 16,
|
|
357
|
+
height: 16,
|
|
358
|
+
viewBox: "0 0 18 18",
|
|
359
|
+
"aria-hidden": "true",
|
|
360
|
+
children: d ? /* @__PURE__ */ p(
|
|
361
|
+
"rect",
|
|
362
|
+
{
|
|
363
|
+
x: 4,
|
|
364
|
+
y: 8,
|
|
365
|
+
width: 10,
|
|
366
|
+
height: 2
|
|
367
|
+
}
|
|
368
|
+
) : /* @__PURE__ */ p("polyline", { points: "3,9 7,13 15,4" })
|
|
369
|
+
}
|
|
370
|
+
) }),
|
|
371
|
+
a
|
|
372
|
+
] })
|
|
373
|
+
}
|
|
374
|
+
);
|
|
375
|
+
export {
|
|
376
|
+
ze as $,
|
|
377
|
+
Je as C,
|
|
378
|
+
z as a,
|
|
379
|
+
q as s
|
|
380
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";require('./assets/Checkbox.css');const p=require("react/jsx-runtime"),N=require("./clsx-C11secjj.cjs"),W=require("./RSPContexts-D8hmBfGm.cjs"),c=require("./utils-BNtZbAib.cjs"),G=require("./FieldError-DqdfJ3fs.cjs"),E=require("./Form-BuOomA4T.cjs"),H=require("./Label-CUV21CAv.cjs"),L=require("./Text-B2K-BJKQ.cjs"),S=require("./filterDOMProps-BS2lrgFA.cjs"),u=require("react"),y=require("./useFormValidation-ClximP89.cjs"),D=require("./usePress-BFa6cT9o.cjs"),T=require("./useFocusable-CuPQ7Cm5.cjs"),F=require("./useToggleState-DoIkSQdj.cjs"),A=require("./useField-B1RU0GKs.cjs"),M=require("./useFocusRing-CbImDrwF.cjs"),z=require("./useHover-_mv5J4_q.cjs"),J=require("./VisuallyHidden-CtXvK_Tw.cjs"),K=require("./useControlledState-D0L6S_5r.cjs");function Q(i,e,d){let{isDisabled:n=!1,isReadOnly:s=!1,value:o,name:f,children:l,"aria-label":b,"aria-labelledby":a,validationState:t="valid",isInvalid:r}=i,x=m=>{m.stopPropagation(),e.setSelected(m.target.checked)},h=l!=null,$=b!=null||a!=null;!h&&!$&&process.env.NODE_ENV!=="production"&&console.warn("If you do not provide children, you must specify an aria-label for accessibility");let{pressProps:v,isPressed:P}=D.$f6c31cce2adf654f$export$45712eceda6fad21({isDisabled:n}),{pressProps:R,isPressed:g}=D.$f6c31cce2adf654f$export$45712eceda6fad21({onPress(){var m;e.toggle(),(m=d.current)===null||m===void 0||m.focus()},isDisabled:n||s}),{focusableProps:I}=T.$f645667febf57a63$export$4c014de7c8940b4c(i,d),V=c.$3ef42575df84b30b$export$9d1611c77c2fe928(v,I),q=S.$65484d02dcb7eb3e$export$457c3d6518dd4c6f(i,{labelable:!0});return y.$99facab73266f662$export$5add1d006293d136(d,e.isSelected,e.setSelected),{labelProps:c.$3ef42575df84b30b$export$9d1611c77c2fe928(R,{onClick:m=>m.preventDefault()}),inputProps:c.$3ef42575df84b30b$export$9d1611c77c2fe928(q,{"aria-invalid":r||t==="invalid"||void 0,"aria-errormessage":i["aria-errormessage"],"aria-controls":i["aria-controls"],"aria-readonly":s||void 0,onChange:x,disabled:n,...o==null?{}:{value:o},name:f,type:"checkbox",...V}),isSelected:e.isSelected,isPressed:P||g,isDisabled:n,isReadOnly:s,isInvalid:r||t==="invalid"}}function w(i,e,d){let n=y.$e5be200c675c3b3a$export$fc1a364ae1f3ff10({...i,value:e.isSelected}),{isInvalid:s,validationErrors:o,validationDetails:f}=n.displayValidation,{labelProps:l,inputProps:b,isSelected:a,isPressed:t,isDisabled:r,isReadOnly:x}=Q({...i,isInvalid:s},e,d);y.$e93e671b31057976$export$b8473d3665f3a75a(i,n,d);let{isIndeterminate:h,isRequired:$,validationBehavior:v="aria"}=i;u.useEffect(()=>{d.current&&(d.current.indeterminate=!!h)});let{pressProps:P}=D.$f6c31cce2adf654f$export$45712eceda6fad21({isDisabled:r||x,onPress(){let{[y.$e5be200c675c3b3a$export$a763b9476acd3eb]:R}=i,{commitValidation:g}=R||n;g()}});return{labelProps:c.$3ef42575df84b30b$export$9d1611c77c2fe928(l,P),inputProps:{...b,checked:a,"aria-required":$&&v==="aria"||void 0,required:$&&v==="native"},isSelected:a,isPressed:t,isDisabled:r,isReadOnly:x,isInvalid:s,validationErrors:o,validationDetails:f}}const j=new WeakMap;function U(i,e){let{isDisabled:d,name:n,validationBehavior:s="aria"}=i,{isInvalid:o,validationErrors:f,validationDetails:l}=e.displayValidation,{labelProps:b,fieldProps:a,descriptionProps:t,errorMessageProps:r}=A.$2baaea4c71418dea$export$294aa081a6c6f55d({...i,labelElementType:"span",isInvalid:o,errorMessage:i.errorMessage||f});j.set(e,{name:n,descriptionId:t.id,errorMessageId:r.id,validationBehavior:s});let x=S.$65484d02dcb7eb3e$export$457c3d6518dd4c6f(i,{labelable:!0}),{focusWithinProps:h}=M.$9ab94262bd0047c7$export$420e68273165f4ec({onBlurWithin:i.onBlur,onFocusWithin:i.onFocus,onFocusWithinChange:i.onFocusChange});return{groupProps:c.$3ef42575df84b30b$export$9d1611c77c2fe928(x,{role:"group","aria-disabled":d||void 0,...a,...h}),labelProps:b,descriptionProps:t,errorMessageProps:r,isInvalid:o,validationErrors:f,validationDetails:l}}function X(i,e,d){const n=F.$3017fa7ffdddec74$export$8042c6c013fd5226({isReadOnly:i.isReadOnly||e.isReadOnly,isSelected:e.isSelected(i.value),onChange(P){P?e.addValue(i.value):e.removeValue(i.value),i.onChange&&i.onChange(P)}});let{name:s,descriptionId:o,errorMessageId:f,validationBehavior:l}=j.get(e);var b;l=(b=i.validationBehavior)!==null&&b!==void 0?b:l;let{realtimeValidation:a}=y.$e5be200c675c3b3a$export$fc1a364ae1f3ff10({...i,value:n.isSelected,name:void 0,validationBehavior:"aria"}),t=u.useRef(y.$e5be200c675c3b3a$export$dad6ae84456c676a),r=()=>{e.setInvalid(i.value,a.isInvalid?a:t.current)};u.useEffect(r);let x=e.realtimeValidation.isInvalid?e.realtimeValidation:a,h=l==="native"?e.displayValidation:x;var $;let v=w({...i,isReadOnly:i.isReadOnly||e.isReadOnly,isDisabled:i.isDisabled||e.isDisabled,name:i.name||s,isRequired:($=i.isRequired)!==null&&$!==void 0?$:e.isRequired,validationBehavior:l,[y.$e5be200c675c3b3a$export$a763b9476acd3eb]:{realtimeValidation:x,displayValidation:h,resetValidation:e.resetValidation,commitValidation:e.commitValidation,updateValidation(P){t.current=P,r()}}},n,d);return{...v,inputProps:{...v.inputProps,"aria-describedby":[i["aria-describedby"],e.isInvalid?f:null,o].filter(Boolean).join(" ")||void 0}}}function Y(i={}){let[e,d]=K.$458b0a5536c1a7cf$export$40bfa8c7b0832715(i.value,i.defaultValue||[],i.onChange),n=!!i.isRequired&&e.length===0,s=u.useRef(new Map),o=y.$e5be200c675c3b3a$export$fc1a364ae1f3ff10({...i,value:e}),f=o.displayValidation.isInvalid;var l;return{...o,value:e,setValue(a){i.isReadOnly||i.isDisabled||d(a)},isDisabled:i.isDisabled||!1,isReadOnly:i.isReadOnly||!1,isSelected(a){return e.includes(a)},addValue(a){i.isReadOnly||i.isDisabled||e.includes(a)||d(e.concat(a))},removeValue(a){i.isReadOnly||i.isDisabled||e.includes(a)&&d(e.filter(t=>t!==a))},toggleValue(a){i.isReadOnly||i.isDisabled||(e.includes(a)?d(e.filter(t=>t!==a)):d(e.concat(a)))},setInvalid(a,t){let r=new Map(s.current);t.isInvalid?r.set(a,t):r.delete(a),s.current=r,o.updateValidation(y.$e5be200c675c3b3a$export$75ee7c75d68f5b0e(...r.values()))},validationState:(l=i.validationState)!==null&&l!==void 0?l:f?"invalid":null,isInvalid:f,isRequired:n}}const Z=u.createContext(null),O=u.createContext(null),ee=u.forwardRef(function(e,d){[e,d]=c.$64fa3d84918910a7$export$29f1550f4b0d4415(e,d,Z);let{validationBehavior:n}=c.$64fa3d84918910a7$export$fabf2dc03a41866e(E.$d3e0e05bdfcf66bd$export$c24727297075ec6a)||{};var s,o;let f=(o=(s=e.validationBehavior)!==null&&s!==void 0?s:n)!==null&&o!==void 0?o:"native",l=Y({...e,validationBehavior:f}),[b,a]=c.$64fa3d84918910a7$export$9d4c57ee4c6ffdd8(!e["aria-label"]&&!e["aria-labelledby"]),{groupProps:t,labelProps:r,descriptionProps:x,errorMessageProps:h,...$}=U({...e,label:a,validationBehavior:f},l),v=c.$64fa3d84918910a7$export$4d86445c2cf5e3({...e,values:{isDisabled:l.isDisabled,isReadOnly:l.isReadOnly,isRequired:e.isRequired||!1,isInvalid:l.isInvalid,state:l},defaultClassName:"react-aria-CheckboxGroup"});return u.createElement("div",{...t,...v,ref:d,slot:e.slot||void 0,"data-readonly":l.isReadOnly||void 0,"data-required":e.isRequired||void 0,"data-invalid":l.isInvalid||void 0,"data-disabled":e.isDisabled||void 0},u.createElement(c.$64fa3d84918910a7$export$2881499e37b75b9a,{values:[[O,l],[H.$01b77f81d0f07f68$export$75b6ee27786ba447,{...r,ref:b,elementType:"span"}],[L.$514c0188e459b4c0$export$9afb8bc826b033ea,{slots:{description:x,errorMessage:h}}],[G.$ee014567cb39d3f0$export$ff05c3ac10437e03,$]]},v.children))}),ie=u.forwardRef(function(e,d){let{inputRef:n=null,...s}=e;[e,d]=c.$64fa3d84918910a7$export$29f1550f4b0d4415(s,d,W.$4e85f108e88277b8$export$b085522c77523c51);let{validationBehavior:o}=c.$64fa3d84918910a7$export$fabf2dc03a41866e(E.$d3e0e05bdfcf66bd$export$c24727297075ec6a)||{};var f,l;let b=(l=(f=e.validationBehavior)!==null&&f!==void 0?f:o)!==null&&l!==void 0?l:"native",a=u.useContext(O),t=c.$df56164dff5785e2$export$4338b53315abf666(u.useMemo(()=>c.$5dc95899b306f630$export$c9058316764c140e(n,e.inputRef!==void 0?e.inputRef:null),[n,e.inputRef])),{labelProps:r,inputProps:x,isSelected:h,isDisabled:$,isReadOnly:v,isPressed:P,isInvalid:R}=a?X({...c.$64fa3d84918910a7$export$ef03459518577ad4(e),value:e.value,children:typeof e.children=="function"?!0:e.children},a,t):w({...c.$64fa3d84918910a7$export$ef03459518577ad4(e),children:typeof e.children=="function"?!0:e.children,validationBehavior:b},F.$3017fa7ffdddec74$export$8042c6c013fd5226(e),t),{isFocused:g,isFocusVisible:I,focusProps:V}=M.$f7dceffc5ad7768b$export$4e328f61c538687f(),q=$||v,{hoverProps:m,isHovered:_}=z.$6179b936705e76d3$export$ae780daf29e6d456({...e,isDisabled:q}),C=c.$64fa3d84918910a7$export$4d86445c2cf5e3({...e,defaultClassName:"react-aria-Checkbox",values:{isSelected:h,isIndeterminate:e.isIndeterminate||!1,isPressed:P,isHovered:_,isFocused:g,isFocusVisible:I,isDisabled:$,isReadOnly:v,isInvalid:R,isRequired:e.isRequired||!1}}),k=S.$65484d02dcb7eb3e$export$457c3d6518dd4c6f(e);return delete k.id,u.createElement("label",{...c.$3ef42575df84b30b$export$9d1611c77c2fe928(k,r,m,C),ref:d,slot:e.slot||void 0,"data-selected":h||void 0,"data-indeterminate":e.isIndeterminate||void 0,"data-pressed":P||void 0,"data-hovered":_||void 0,"data-focused":g||void 0,"data-focus-visible":I||void 0,"data-disabled":$||void 0,"data-readonly":v||void 0,"data-invalid":R||void 0,"data-required":e.isRequired||void 0},u.createElement(J.$5c3e21d68f1c4674$export$439d29a4e110a164,{elementType:"span"},u.createElement("input",{...c.$3ef42575df84b30b$export$9d1611c77c2fe928(x,V),ref:t})),C.children)}),ae="_wrap_lpri7_4",de="_checkboxInner_lpri7_11",le="_checkbox_lpri7_11",te="_checkboxGroup_lpri7_127",B={wrap:ae,checkboxInner:de,checkbox:le,checkboxGroup:te},ne=({children:i,...e})=>p.jsx(ie,{className:N.clsx(B.checkbox,e.className),...e,children:({isIndeterminate:d})=>p.jsxs(p.Fragment,{children:[p.jsx("div",{className:B.checkboxInner,children:p.jsx("svg",{width:16,height:16,viewBox:"0 0 18 18","aria-hidden":"true",children:d?p.jsx("rect",{x:4,y:8,width:10,height:2}):p.jsx("polyline",{points:"3,9 7,13 15,4"})})}),i]})});exports.$bc237834342dbd75$export$139c5b8563afc1fc=O;exports.$bc237834342dbd75$export$4aa08d5625cb8ead=ee;exports.Checkbox=ne;exports.styles=B;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const l=require("react/jsx-runtime"),n=require("react"),c=require("./Checkbox-DSxGAJX2.cjs"),C=require("./Group-CgiqQHH1.cjs"),q=require("./Label-IMWAyoKb.cjs"),V=require("./Text-3MNwRMpI.cjs"),g=require("./FieldError-BZw8UzBk.cjs"),v=({label:f,description:i,errorMessage:d,showSelectAll:m,children:a,errorPosition:x="top",...p})=>{const[u,o]=n.useState(),A=()=>{const e=n.useContext(c.$bc237834342dbd75$export$139c5b8563afc1fc),t=n.Children.toArray(a).filter(n.isValidElement).map(s=>s.props.value),$=()=>u!=="all"?(o("all"),e==null?void 0:e.setValue(["toggleAll",...t])):(o("none"),e==null?void 0:e.setValue([]));return n.useEffect(()=>{var b,h;const s=t.length,j=t.length+1,r=((b=e==null?void 0:e.value)==null?void 0:b.length)||0;r===0&&o("none"),r>0&&r<s&&o("some"),r!==j&&(e==null||e.removeValue("toggleAll")),r===s&&!((h=e==null?void 0:e.value)!=null&&h.includes("toggleAll"))&&(e==null||e.addValue("toggleAll"),o("all"))},[t.length,e==null?void 0:e.value]),l.jsx(c.Checkbox,{value:"toggleAll",isSelected:u==="all",isIndeterminate:u==="some",onChange:()=>$(),children:"Välj alla"})};return l.jsxs(c.$bc237834342dbd75$export$4aa08d5625cb8ead,{className:c.styles.checkboxGroup,...p,children:[l.jsx(q.Label,{children:f}),i&&l.jsx(V.Text,{slot:"description",children:i}),x==="top"&&l.jsx(g.FieldError,{children:d}),l.jsxs(C.$a049562f99e7db0e$export$eb2fcfdbd7ba97d4,{className:c.styles.wrap,children:[m&&l.jsx(A,{}),a]}),x==="bottom"&&l.jsx(g.FieldError,{children:d})]})};exports.CheckboxGroup=v;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { jsxs as p, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import n from "react";
|
|
3
|
+
import { $ as v, s as g, a as S, C as j } from "./Checkbox-CvFsn_FL.js";
|
|
4
|
+
import { $ as k } from "./Group-CeSsSQVC.js";
|
|
5
|
+
import { L as E } from "./Label-C9ivwkAd.js";
|
|
6
|
+
import { T } from "./Text-BN-g1iWi.js";
|
|
7
|
+
import { F as h } from "./FieldError-Dv3bBEjh.js";
|
|
8
|
+
const w = ({
|
|
9
|
+
label: b,
|
|
10
|
+
description: d,
|
|
11
|
+
errorMessage: s,
|
|
12
|
+
showSelectAll: $,
|
|
13
|
+
children: i,
|
|
14
|
+
errorPosition: m = "top",
|
|
15
|
+
...A
|
|
16
|
+
}) => {
|
|
17
|
+
const [c, o] = n.useState(), x = () => {
|
|
18
|
+
const l = n.useContext(S), t = n.Children.toArray(i).filter(n.isValidElement).map((a) => a.props.value), C = () => c !== "all" ? (o("all"), l == null ? void 0 : l.setValue(["toggleAll", ...t])) : (o("none"), l == null ? void 0 : l.setValue([]));
|
|
19
|
+
return n.useEffect(() => {
|
|
20
|
+
var u, f;
|
|
21
|
+
const a = t.length, V = t.length + 1, r = ((u = l == null ? void 0 : l.value) == null ? void 0 : u.length) || 0;
|
|
22
|
+
r === 0 && o("none"), r > 0 && r < a && o("some"), r !== V && (l == null || l.removeValue("toggleAll")), r === a && !((f = l == null ? void 0 : l.value) != null && f.includes("toggleAll")) && (l == null || l.addValue("toggleAll"), o("all"));
|
|
23
|
+
}, [t.length, l == null ? void 0 : l.value]), /* @__PURE__ */ e(
|
|
24
|
+
j,
|
|
25
|
+
{
|
|
26
|
+
value: "toggleAll",
|
|
27
|
+
isSelected: c === "all",
|
|
28
|
+
isIndeterminate: c === "some",
|
|
29
|
+
onChange: () => C(),
|
|
30
|
+
children: "Välj alla"
|
|
31
|
+
}
|
|
32
|
+
);
|
|
33
|
+
};
|
|
34
|
+
return /* @__PURE__ */ p(
|
|
35
|
+
v,
|
|
36
|
+
{
|
|
37
|
+
className: g.checkboxGroup,
|
|
38
|
+
...A,
|
|
39
|
+
children: [
|
|
40
|
+
/* @__PURE__ */ e(E, { children: b }),
|
|
41
|
+
d && /* @__PURE__ */ e(T, { slot: "description", children: d }),
|
|
42
|
+
m === "top" && /* @__PURE__ */ e(h, { children: s }),
|
|
43
|
+
/* @__PURE__ */ p(k, { className: g.wrap, children: [
|
|
44
|
+
$ && /* @__PURE__ */ e(x, {}),
|
|
45
|
+
i
|
|
46
|
+
] }),
|
|
47
|
+
m === "bottom" && /* @__PURE__ */ e(h, { children: s })
|
|
48
|
+
]
|
|
49
|
+
}
|
|
50
|
+
);
|
|
51
|
+
};
|
|
52
|
+
export {
|
|
53
|
+
w as C
|
|
54
|
+
};
|