@simplybusiness/mobius 10.1.2 → 10.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +25 -0
- package/dist/cjs/components/AddressLookup/AddressLookup.js +223 -162
- package/dist/cjs/components/AddressLookup/AddressLookup.js.map +4 -4
- package/dist/cjs/components/AddressLookup/index.js +223 -162
- package/dist/cjs/components/AddressLookup/index.js.map +4 -4
- package/dist/cjs/components/Alert/Alert.js +10 -7
- package/dist/cjs/components/Alert/Alert.js.map +2 -2
- package/dist/cjs/components/Alert/index.js +10 -7
- package/dist/cjs/components/Alert/index.js.map +2 -2
- package/dist/cjs/components/Box/Box.js +18 -3
- package/dist/cjs/components/Box/Box.js.map +3 -3
- package/dist/cjs/components/Box/index.js +18 -3
- package/dist/cjs/components/Box/index.js.map +3 -3
- package/dist/cjs/components/Breadcrumbs/BreadcrumbItem.js +18 -3
- package/dist/cjs/components/Breadcrumbs/BreadcrumbItem.js.map +3 -3
- package/dist/cjs/components/Breadcrumbs/Breadcrumbs.js.map +1 -1
- package/dist/cjs/components/Breadcrumbs/index.js +18 -3
- package/dist/cjs/components/Breadcrumbs/index.js.map +3 -3
- package/dist/cjs/components/Checkbox/Checkbox.js +190 -129
- package/dist/cjs/components/Checkbox/Checkbox.js.map +4 -4
- package/dist/cjs/components/Checkbox/CheckboxGroup.js +195 -134
- package/dist/cjs/components/Checkbox/CheckboxGroup.js.map +4 -4
- package/dist/cjs/components/Checkbox/index.js +203 -142
- package/dist/cjs/components/Checkbox/index.js.map +4 -4
- package/dist/cjs/components/Combobox/Combobox.js +218 -157
- package/dist/cjs/components/Combobox/Combobox.js.map +4 -4
- package/dist/cjs/components/Combobox/index.js +218 -157
- package/dist/cjs/components/Combobox/index.js.map +4 -4
- package/dist/cjs/components/DateField/DateField.js +191 -130
- package/dist/cjs/components/DateField/DateField.js.map +4 -4
- package/dist/cjs/components/DateField/index.js +191 -130
- package/dist/cjs/components/DateField/index.js.map +4 -4
- package/dist/cjs/components/ErrorMessage/ErrorMessage.js +182 -121
- package/dist/cjs/components/ErrorMessage/ErrorMessage.js.map +4 -4
- package/dist/cjs/components/ErrorMessage/index.js +182 -121
- package/dist/cjs/components/ErrorMessage/index.js.map +4 -4
- package/dist/cjs/components/ExpandableText/ExpandableText.js +182 -121
- package/dist/cjs/components/ExpandableText/ExpandableText.js.map +4 -4
- package/dist/cjs/components/ExpandableText/index.js +182 -121
- package/dist/cjs/components/ExpandableText/index.js.map +4 -4
- package/dist/cjs/components/Grid/Grid.js +2 -2
- package/dist/cjs/components/Grid/Grid.js.map +2 -2
- package/dist/cjs/components/Grid/Item.js +3 -3
- package/dist/cjs/components/Grid/Item.js.map +2 -2
- package/dist/cjs/components/Grid/index.js +5 -5
- package/dist/cjs/components/Grid/index.js.map +2 -2
- package/dist/cjs/components/List/List.js +15 -7
- package/dist/cjs/components/List/List.js.map +2 -2
- package/dist/cjs/components/List/index.js +15 -7
- package/dist/cjs/components/List/index.js.map +2 -2
- package/dist/cjs/components/Logo/Logo.js.map +2 -2
- package/dist/cjs/components/Logo/index.js.map +2 -2
- package/dist/cjs/components/MaskedField/MaskedField.js +185 -124
- package/dist/cjs/components/MaskedField/MaskedField.js.map +4 -4
- package/dist/cjs/components/MaskedField/index.js +185 -124
- package/dist/cjs/components/MaskedField/index.js.map +4 -4
- package/dist/cjs/components/Modal/Header.js +38 -21
- package/dist/cjs/components/Modal/Header.js.map +3 -3
- package/dist/cjs/components/Modal/Modal.js +13 -3
- package/dist/cjs/components/Modal/Modal.js.map +2 -2
- package/dist/cjs/components/Modal/ModalContext.js +4 -1
- package/dist/cjs/components/Modal/ModalContext.js.map +2 -2
- package/dist/cjs/components/Modal/index.js +63 -39
- package/dist/cjs/components/Modal/index.js.map +3 -3
- package/dist/cjs/components/Modal/types.js.map +1 -1
- package/dist/cjs/components/Modal/useModal.js +6 -3
- package/dist/cjs/components/Modal/useModal.js.map +2 -2
- package/dist/cjs/components/NumberField/NumberField.js +185 -124
- package/dist/cjs/components/NumberField/NumberField.js.map +4 -4
- package/dist/cjs/components/NumberField/index.js +185 -124
- package/dist/cjs/components/NumberField/index.js.map +4 -4
- package/dist/cjs/components/PasswordField/PasswordField.js +185 -124
- package/dist/cjs/components/PasswordField/PasswordField.js.map +4 -4
- package/dist/cjs/components/PasswordField/ShowHideButton.js +182 -121
- package/dist/cjs/components/PasswordField/ShowHideButton.js.map +4 -4
- package/dist/cjs/components/PasswordField/index.js +185 -124
- package/dist/cjs/components/PasswordField/index.js.map +4 -4
- package/dist/cjs/components/Radio/Radio.js +182 -121
- package/dist/cjs/components/Radio/Radio.js.map +4 -4
- package/dist/cjs/components/Radio/RadioGroup.js +182 -121
- package/dist/cjs/components/Radio/RadioGroup.js.map +4 -4
- package/dist/cjs/components/Radio/index.js +182 -121
- package/dist/cjs/components/Radio/index.js.map +4 -4
- package/dist/cjs/components/SVG/SVG.js.map +2 -2
- package/dist/cjs/components/SVG/index.js.map +2 -2
- package/dist/cjs/components/Segment/Segment.js +2 -2
- package/dist/cjs/components/Segment/Segment.js.map +2 -2
- package/dist/cjs/components/Segment/index.js +2 -2
- package/dist/cjs/components/Segment/index.js.map +2 -2
- package/dist/cjs/components/Select/Select.js +182 -121
- package/dist/cjs/components/Select/Select.js.map +4 -4
- package/dist/cjs/components/Select/index.js +182 -121
- package/dist/cjs/components/Select/index.js.map +4 -4
- package/dist/cjs/components/Table/HeaderCell.js +2 -2
- package/dist/cjs/components/Table/HeaderCell.js.map +2 -2
- package/dist/cjs/components/Table/index.js +2 -2
- package/dist/cjs/components/Table/index.js.map +2 -2
- package/dist/cjs/components/Text/Text.js +10 -7
- package/dist/cjs/components/Text/Text.js.map +2 -2
- package/dist/cjs/components/Text/index.js +10 -7
- package/dist/cjs/components/Text/index.js.map +2 -2
- package/dist/cjs/components/TextArea/TextArea.js +182 -121
- package/dist/cjs/components/TextArea/TextArea.js.map +4 -4
- package/dist/cjs/components/TextArea/index.js +182 -121
- package/dist/cjs/components/TextArea/index.js.map +4 -4
- package/dist/cjs/components/TextField/TextField.js +185 -124
- package/dist/cjs/components/TextField/TextField.js.map +4 -4
- package/dist/cjs/components/TextField/index.js +185 -124
- package/dist/cjs/components/TextField/index.js.map +4 -4
- package/dist/cjs/components/TextOrHTML/TextOrHTML.js +10 -7
- package/dist/cjs/components/TextOrHTML/TextOrHTML.js.map +2 -2
- package/dist/cjs/components/TextOrHTML/index.js +10 -7
- package/dist/cjs/components/TextOrHTML/index.js.map +2 -2
- package/dist/cjs/components/index.js +209 -148
- package/dist/cjs/components/index.js.map +4 -4
- package/dist/cjs/index.js +209 -148
- package/dist/cjs/index.js.map +4 -4
- package/dist/cjs/meta.json +876 -571
- package/dist/cjs/utils/filterUnsetValues.js +36 -0
- package/dist/cjs/utils/filterUnsetValues.js.map +7 -0
- package/dist/cjs/utils/index.js +13 -0
- package/dist/cjs/utils/index.js.map +3 -3
- package/dist/esm/{chunk-NYFCN7EA.js → chunk-6GGDGE7D.js} +4 -4
- package/dist/esm/{chunk-OUKMP3DO.js → chunk-7JT4DKQA.js} +2 -2
- package/dist/esm/chunk-CZWEMAKZ.js +16 -0
- package/dist/esm/chunk-CZWEMAKZ.js.map +7 -0
- package/dist/esm/{chunk-Q5YY6HPF.js → chunk-DZVBN6ZI.js} +5 -5
- package/dist/esm/{chunk-OC6ULO4M.js → chunk-EJLNC5X5.js} +2 -2
- package/dist/esm/{chunk-LVZ2T6AY.js → chunk-EZ4S7XVZ.js} +16 -8
- package/dist/esm/chunk-EZ4S7XVZ.js.map +7 -0
- package/dist/esm/chunk-FIAL4HTE.js +1 -0
- package/dist/esm/{chunk-YLL2DKVF.js → chunk-FQ6P6JB5.js} +3 -3
- package/dist/esm/chunk-FQ6P6JB5.js.map +7 -0
- package/dist/esm/{chunk-OZ2IUZIJ.js → chunk-HP2NRM7T.js} +2 -2
- package/dist/esm/{chunk-PB2OICEB.js → chunk-I6EUIFUJ.js} +15 -11
- package/dist/esm/chunk-I6EUIFUJ.js.map +7 -0
- package/dist/esm/{chunk-3IMYDZRT.js → chunk-JFDDW3IV.js} +1 -1
- package/dist/esm/chunk-JFDDW3IV.js.map +7 -0
- package/dist/esm/{chunk-4IB5ROL6.js → chunk-KXLTGNKF.js} +12 -5
- package/dist/esm/chunk-KXLTGNKF.js.map +7 -0
- package/dist/esm/{chunk-TL4OCKNP.js → chunk-LWRY3VIB.js} +2 -2
- package/dist/esm/chunk-MPB5F6QL.js +53 -0
- package/dist/esm/chunk-MPB5F6QL.js.map +7 -0
- package/dist/esm/{chunk-DNMS6KEY.js → chunk-PARKMZYZ.js} +4 -4
- package/dist/esm/{chunk-DNMS6KEY.js.map → chunk-PARKMZYZ.js.map} +2 -2
- package/dist/esm/chunk-Q5MIALGZ.js +15 -0
- package/dist/esm/{chunk-ZHX7Z5IU.js.map → chunk-Q5MIALGZ.js.map} +2 -2
- package/dist/esm/{chunk-N5WGQAHM.js → chunk-QWD72EVP.js} +4 -4
- package/dist/esm/{chunk-KLXMVFIR.js → chunk-TBKQA5ZF.js} +5 -2
- package/dist/esm/{chunk-KLXMVFIR.js.map → chunk-TBKQA5ZF.js.map} +2 -2
- package/dist/esm/{chunk-B243ELKZ.js → chunk-TJCUKTFX.js} +10 -4
- package/dist/esm/chunk-TJCUKTFX.js.map +7 -0
- package/dist/esm/{chunk-P5ZPHAQT.js → chunk-UCNWPF7R.js} +3 -3
- package/dist/esm/chunk-UCNWPF7R.js.map +7 -0
- package/dist/esm/{chunk-S37ULE57.js → chunk-VASDBM4Z.js} +1 -1
- package/dist/esm/{chunk-S37ULE57.js.map → chunk-VASDBM4Z.js.map} +2 -2
- package/dist/esm/{chunk-QRHDVVRK.js → chunk-VIDKIVA6.js} +2 -2
- package/dist/esm/{chunk-SDGIWQ3R.js → chunk-WP5OEMNG.js} +3 -3
- package/dist/esm/{chunk-SDGIWQ3R.js.map → chunk-WP5OEMNG.js.map} +2 -2
- package/dist/esm/{chunk-MLN5ELQR.js → chunk-WXRQIMMM.js} +1 -1
- package/dist/esm/chunk-WXRQIMMM.js.map +7 -0
- package/dist/esm/{chunk-O47IW7HD.js → chunk-YCE2KOB2.js} +5 -5
- package/dist/esm/{chunk-SNRPWCHL.js → chunk-ZS5MFZHD.js} +11 -8
- package/dist/esm/chunk-ZS5MFZHD.js.map +7 -0
- package/dist/esm/components/Accordion/Accordion.js +7 -6
- package/dist/esm/components/Accordion/AccordionLink.js +6 -5
- package/dist/esm/components/Accordion/AccordionList.js +8 -7
- package/dist/esm/components/Accordion/index.js +8 -7
- package/dist/esm/components/AddressLookup/AddressLookup.js +41 -40
- package/dist/esm/components/AddressLookup/__mocks__/LoqateAddressLookupService.js +2 -1
- package/dist/esm/components/AddressLookup/__mocks__/LoqateAddressLookupService.js.map +1 -1
- package/dist/esm/components/AddressLookup/index.js +41 -40
- package/dist/esm/components/Alert/Alert.js +4 -4
- package/dist/esm/components/Alert/index.js +4 -4
- package/dist/esm/components/Box/Box.js +3 -2
- package/dist/esm/components/Box/index.js +3 -2
- package/dist/esm/components/Breadcrumbs/BreadcrumbItem.js +4 -3
- package/dist/esm/components/Breadcrumbs/Breadcrumbs.js +1 -1
- package/dist/esm/components/Breadcrumbs/index.js +7 -6
- package/dist/esm/components/Checkbox/Checkbox.js +41 -40
- package/dist/esm/components/Checkbox/CheckboxGroup.js +41 -40
- package/dist/esm/components/Checkbox/index.js +41 -40
- package/dist/esm/components/Combobox/Combobox.js +41 -40
- package/dist/esm/components/Combobox/index.js +41 -40
- package/dist/esm/components/Container/Container.js +2 -1
- package/dist/esm/components/Container/index.js +2 -1
- package/dist/esm/components/DateField/DateField.js +41 -40
- package/dist/esm/components/DateField/index.js +41 -40
- package/dist/esm/components/Drawer/Drawer.js +4 -3
- package/dist/esm/components/Drawer/index.js +4 -3
- package/dist/esm/components/ErrorMessage/ErrorMessage.js +41 -40
- package/dist/esm/components/ErrorMessage/index.js +41 -40
- package/dist/esm/components/ExpandableText/ExpandableText.js +41 -40
- package/dist/esm/components/ExpandableText/index.js +41 -40
- package/dist/esm/components/Fieldset/Fieldset.js +2 -1
- package/dist/esm/components/Fieldset/index.js +2 -1
- package/dist/esm/components/Flex/Flex.js +2 -1
- package/dist/esm/components/Flex/index.js +2 -1
- package/dist/esm/components/Flex/propUtils.js +2 -1
- package/dist/esm/components/Grid/Grid.js +3 -2
- package/dist/esm/components/Grid/Item.js +5 -4
- package/dist/esm/components/Grid/index.js +7 -6
- package/dist/esm/components/List/List.js +1 -1
- package/dist/esm/components/List/index.js +1 -1
- package/dist/esm/components/Logo/Logo.js +1 -1
- package/dist/esm/components/Logo/index.js +1 -1
- package/dist/esm/components/MaskedField/MaskedField.js +41 -40
- package/dist/esm/components/MaskedField/MaskedField.js.map +1 -1
- package/dist/esm/components/MaskedField/index.js +41 -40
- package/dist/esm/components/Modal/Header.js +3 -3
- package/dist/esm/components/Modal/Modal.js +6 -5
- package/dist/esm/components/Modal/ModalContext.js +1 -1
- package/dist/esm/components/Modal/index.js +10 -9
- package/dist/esm/components/Modal/useModal.js +2 -2
- package/dist/esm/components/NumberField/NumberField.js +41 -40
- package/dist/esm/components/NumberField/index.js +41 -40
- package/dist/esm/components/PasswordField/PasswordField.js +41 -40
- package/dist/esm/components/PasswordField/ShowHideButton.js +41 -40
- package/dist/esm/components/PasswordField/index.js +41 -40
- package/dist/esm/components/Radio/Radio.js +41 -40
- package/dist/esm/components/Radio/RadioGroup.js +41 -40
- package/dist/esm/components/Radio/index.js +41 -40
- package/dist/esm/components/SVG/SVG.js +1 -1
- package/dist/esm/components/SVG/index.js +1 -1
- package/dist/esm/components/Segment/Segment.js +1 -1
- package/dist/esm/components/Segment/index.js +1 -1
- package/dist/esm/components/Select/Select.js +41 -40
- package/dist/esm/components/Select/index.js +41 -40
- package/dist/esm/components/Slider/Slider.js +4 -3
- package/dist/esm/components/Slider/index.js +4 -3
- package/dist/esm/components/Table/HeaderCell.js +1 -1
- package/dist/esm/components/Table/index.js +2 -2
- package/dist/esm/components/Text/Text.js +1 -1
- package/dist/esm/components/Text/index.js +1 -1
- package/dist/esm/components/TextArea/TextArea.js +41 -40
- package/dist/esm/components/TextArea/index.js +41 -40
- package/dist/esm/components/TextField/TextField.js +41 -40
- package/dist/esm/components/TextField/index.js +41 -40
- package/dist/esm/components/TextOrHTML/TextOrHTML.js +2 -2
- package/dist/esm/components/TextOrHTML/index.js +2 -2
- package/dist/esm/components/Title/Title.js +2 -1
- package/dist/esm/components/Title/index.js +2 -1
- package/dist/esm/components/Toast/index.js +3 -3
- package/dist/esm/components/Trust/Trust.js +2 -1
- package/dist/esm/components/Trust/index.js +2 -1
- package/dist/esm/components/index.js +54 -53
- package/dist/esm/hooks/index.js +6 -5
- package/dist/esm/hooks/useDialog/index.js +2 -1
- package/dist/esm/hooks/useDialog/useDialog.js +2 -1
- package/dist/esm/hooks/useDialogPolyfill/index.js +2 -1
- package/dist/esm/hooks/useDialogPolyfill/useDialogPolyfill.js +2 -1
- package/dist/esm/index.js +56 -55
- package/dist/esm/meta.json +5694 -5363
- package/dist/esm/utils/filterUnsetValues.js +8 -0
- package/dist/esm/utils/filterUnsetValues.js.map +7 -0
- package/dist/esm/utils/index.js +5 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/types/components/Breadcrumbs/Breadcrumbs.d.ts +1 -1
- package/dist/types/components/Grid/Grid.d.ts +1 -1
- package/dist/types/components/Grid/Item.d.ts +1 -1
- package/dist/types/components/List/List.d.ts +1 -1
- package/dist/types/components/Logo/Logo.d.ts +8 -0
- package/dist/types/components/Modal/types.d.ts +2 -0
- package/dist/types/components/Modal/useModal.d.ts +2 -0
- package/dist/types/components/SVG/SVG.d.ts +4 -0
- package/dist/types/components/Segment/Segment.d.ts +4 -3
- package/dist/types/components/Table/HeaderCell.d.ts +2 -1
- package/dist/types/components/Text/Text.d.ts +1 -1
- package/dist/types/utils/filterUnsetValues.d.ts +6 -0
- package/dist/types/utils/index.d.ts +1 -0
- package/package.json +4 -4
- package/src/components/Accordion/Accordion.test.tsx +7 -0
- package/src/components/AddressLookup/AddressLookup.test.tsx +76 -0
- package/src/components/AddressLookup/AddressLookup.tsx +9 -0
- package/src/components/Box/Box.test.tsx +24 -0
- package/src/components/Box/Box.tsx +11 -3
- package/src/components/Breadcrumbs/Breadcrumbs.test.tsx +130 -0
- package/src/components/Breadcrumbs/Breadcrumbs.tsx +1 -1
- package/src/components/Button/Button.test.tsx +77 -0
- package/src/components/Container/Container.test.tsx +19 -0
- package/src/components/Divider/Divider.test.tsx +18 -0
- package/src/components/Drawer/Drawer.css +24 -3
- package/src/components/Flex/Flex.test.tsx +7 -0
- package/src/components/Grid/Grid.test.tsx +30 -0
- package/src/components/Grid/Grid.tsx +2 -2
- package/src/components/Grid/Item.tsx +3 -3
- package/src/components/Icon/Icon.test.tsx +33 -0
- package/src/components/Image/Image.test.tsx +7 -0
- package/src/components/Label/Label.test.tsx +7 -0
- package/src/components/Link/Link.test.tsx +44 -0
- package/src/components/List/List.test.tsx +11 -0
- package/src/components/List/List.tsx +6 -2
- package/src/components/Logo/Logo.test.tsx +36 -0
- package/src/components/Logo/Logo.tsx +8 -0
- package/src/components/Modal/Header.tsx +13 -2
- package/src/components/Modal/Modal.css +42 -3
- package/src/components/Modal/Modal.test.tsx +19 -1
- package/src/components/Modal/Modal.tsx +11 -2
- package/src/components/Modal/ModalContext.tsx +2 -0
- package/src/components/Modal/types.ts +2 -0
- package/src/components/Modal/useModal.ts +2 -2
- package/src/components/Option/Option.test.tsx +67 -0
- package/src/components/Progress/Progress.test.tsx +7 -0
- package/src/components/SVG/SVG.test.tsx +40 -0
- package/src/components/SVG/SVG.tsx +4 -0
- package/src/components/Segment/Segment.test.tsx +72 -0
- package/src/components/Segment/Segment.tsx +7 -4
- package/src/components/Stack/Stack.test.tsx +41 -1
- package/src/components/Table/HeaderCell.tsx +3 -2
- package/src/components/Table/Table.test.tsx +180 -0
- package/src/components/Text/Text.test.tsx +80 -0
- package/src/components/Text/Text.tsx +13 -8
- package/src/components/TextAreaInput/TextAreaInput.test.tsx +51 -0
- package/src/components/Trust/Trust.test.tsx +52 -1
- package/src/components/VisuallyHidden/VisuallyHidden.test.tsx +66 -0
- package/src/utils/filterUndefinedProps.test.ts +11 -0
- package/src/utils/filterUnsetValues.test.ts +16 -0
- package/src/utils/filterUnsetValues.ts +17 -0
- package/src/utils/index.ts +1 -0
- package/dist/esm/chunk-3IMYDZRT.js.map +0 -7
- package/dist/esm/chunk-4IB5ROL6.js.map +0 -7
- package/dist/esm/chunk-B243ELKZ.js.map +0 -7
- package/dist/esm/chunk-DSYPZETD.js +0 -1
- package/dist/esm/chunk-LVZ2T6AY.js.map +0 -7
- package/dist/esm/chunk-MLN5ELQR.js.map +0 -7
- package/dist/esm/chunk-P5ZPHAQT.js.map +0 -7
- package/dist/esm/chunk-PB2OICEB.js.map +0 -7
- package/dist/esm/chunk-SNRPWCHL.js.map +0 -7
- package/dist/esm/chunk-XNVA7FCA.js +0 -39
- package/dist/esm/chunk-XNVA7FCA.js.map +0 -7
- package/dist/esm/chunk-YLL2DKVF.js.map +0 -7
- package/dist/esm/chunk-ZHX7Z5IU.js +0 -15
- /package/dist/esm/{chunk-NYFCN7EA.js.map → chunk-6GGDGE7D.js.map} +0 -0
- /package/dist/esm/{chunk-OUKMP3DO.js.map → chunk-7JT4DKQA.js.map} +0 -0
- /package/dist/esm/{chunk-Q5YY6HPF.js.map → chunk-DZVBN6ZI.js.map} +0 -0
- /package/dist/esm/{chunk-OC6ULO4M.js.map → chunk-EJLNC5X5.js.map} +0 -0
- /package/dist/esm/{chunk-DSYPZETD.js.map → chunk-FIAL4HTE.js.map} +0 -0
- /package/dist/esm/{chunk-OZ2IUZIJ.js.map → chunk-HP2NRM7T.js.map} +0 -0
- /package/dist/esm/{chunk-TL4OCKNP.js.map → chunk-LWRY3VIB.js.map} +0 -0
- /package/dist/esm/{chunk-N5WGQAHM.js.map → chunk-QWD72EVP.js.map} +0 -0
- /package/dist/esm/{chunk-QRHDVVRK.js.map → chunk-VIDKIVA6.js.map} +0 -0
- /package/dist/esm/{chunk-O47IW7HD.js.map → chunk-YCE2KOB2.js.map} +0 -0
|
@@ -219,6 +219,24 @@ var init_filterUndefinedProps = __esm({
|
|
|
219
219
|
}
|
|
220
220
|
});
|
|
221
221
|
|
|
222
|
+
// src/utils/filterUnsetValues.ts
|
|
223
|
+
var filterUnsetValues;
|
|
224
|
+
var init_filterUnsetValues = __esm({
|
|
225
|
+
"src/utils/filterUnsetValues.ts"() {
|
|
226
|
+
"use strict";
|
|
227
|
+
filterUnsetValues = (props) => {
|
|
228
|
+
const filtered = {};
|
|
229
|
+
Object.keys(props).forEach((key) => {
|
|
230
|
+
const value = props[key];
|
|
231
|
+
if (value !== void 0 && value !== null && value !== "") {
|
|
232
|
+
filtered[key] = value;
|
|
233
|
+
}
|
|
234
|
+
});
|
|
235
|
+
return filtered;
|
|
236
|
+
};
|
|
237
|
+
}
|
|
238
|
+
});
|
|
239
|
+
|
|
222
240
|
// src/utils/getSpacingValue.ts
|
|
223
241
|
var getSpacingValue;
|
|
224
242
|
var init_getSpacingValue = __esm({
|
|
@@ -310,6 +328,7 @@ var init_utils = __esm({
|
|
|
310
328
|
init_delay();
|
|
311
329
|
init_excludeControls();
|
|
312
330
|
init_filterUndefinedProps();
|
|
331
|
+
init_filterUnsetValues();
|
|
313
332
|
init_getSpacingValue();
|
|
314
333
|
init_mergeRefs();
|
|
315
334
|
init_polyfill_tests();
|
|
@@ -1204,6 +1223,10 @@ var init_AddressLookup = __esm({
|
|
|
1204
1223
|
);
|
|
1205
1224
|
const handleSelected = (selected) => {
|
|
1206
1225
|
setError(null);
|
|
1226
|
+
const isEmpty = typeof selected === "string" ? selected === "" : !selected.id && !selected.value;
|
|
1227
|
+
if (isEmpty) {
|
|
1228
|
+
return Promise.resolve();
|
|
1229
|
+
}
|
|
1207
1230
|
if (typeof selected === "string" || !selected.id) {
|
|
1208
1231
|
setError(new Error("Selected option missing id"));
|
|
1209
1232
|
return Promise.resolve();
|
|
@@ -1260,15 +1283,18 @@ var init_Text = __esm({
|
|
|
1260
1283
|
import_Text = require("@simplybusiness/mobius/src/components/Text/Text.css");
|
|
1261
1284
|
import_jsx_runtime8 = require("react/jsx-runtime");
|
|
1262
1285
|
getElementType = (variant, elementType) => {
|
|
1263
|
-
if (
|
|
1264
|
-
return
|
|
1286
|
+
if (elementType) {
|
|
1287
|
+
return elementType;
|
|
1265
1288
|
}
|
|
1266
|
-
|
|
1289
|
+
if (variant && ["h1", "h2", "h3", "h4"].includes(variant)) {
|
|
1290
|
+
return variant;
|
|
1291
|
+
}
|
|
1292
|
+
return "p";
|
|
1267
1293
|
};
|
|
1268
|
-
Text = ({ ref, elementType
|
|
1294
|
+
Text = ({ ref, elementType, ...props }) => {
|
|
1269
1295
|
const { variant, className, spacing, ...otherProps } = props;
|
|
1270
|
-
const
|
|
1271
|
-
const variantType = variant ||
|
|
1296
|
+
const Element = getElementType(variant, elementType);
|
|
1297
|
+
const variantType = variant || Element;
|
|
1272
1298
|
const classes = (0, import_dedupe7.default)(
|
|
1273
1299
|
"mobius",
|
|
1274
1300
|
"mobius-text",
|
|
@@ -1276,7 +1302,7 @@ var init_Text = __esm({
|
|
|
1276
1302
|
{ [`--has-line-height-${spacing}`]: spacing },
|
|
1277
1303
|
className
|
|
1278
1304
|
);
|
|
1279
|
-
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1305
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Element, { ref, ...otherProps, className: classes });
|
|
1280
1306
|
};
|
|
1281
1307
|
Text.displayName = "Text";
|
|
1282
1308
|
}
|
|
@@ -1440,7 +1466,7 @@ var init_Box = __esm({
|
|
|
1440
1466
|
...otherProps
|
|
1441
1467
|
} = props;
|
|
1442
1468
|
const classes = (0, import_dedupe9.default)("mobius", "mobius-box", otherProps.className);
|
|
1443
|
-
const
|
|
1469
|
+
const fromProps = filterUndefinedProps({
|
|
1444
1470
|
padding: getSpacingValue(padding),
|
|
1445
1471
|
paddingInline: getSpacingValue(paddingInline || paddingX),
|
|
1446
1472
|
paddingBlock: getSpacingValue(paddingBlock || paddingY),
|
|
@@ -1453,8 +1479,11 @@ var init_Box = __esm({
|
|
|
1453
1479
|
maxWidth,
|
|
1454
1480
|
maxHeight,
|
|
1455
1481
|
width,
|
|
1456
|
-
height
|
|
1457
|
-
|
|
1482
|
+
height
|
|
1483
|
+
});
|
|
1484
|
+
const styleProps = filterUndefinedProps({
|
|
1485
|
+
...fromProps,
|
|
1486
|
+
...style ? filterUnsetValues(style) : {}
|
|
1458
1487
|
});
|
|
1459
1488
|
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Element, { ref, style: styleProps, ...otherProps, className: classes });
|
|
1460
1489
|
};
|
|
@@ -2558,7 +2587,7 @@ var init_Grid = __esm({
|
|
|
2558
2587
|
import_dedupe23 = __toESM(require("classnames/dedupe"));
|
|
2559
2588
|
init_utils();
|
|
2560
2589
|
import_jsx_runtime30 = require("react/jsx-runtime");
|
|
2561
|
-
Grid = ({ ref
|
|
2590
|
+
Grid = ({ ref, ...props }) => {
|
|
2562
2591
|
const {
|
|
2563
2592
|
columns = 12,
|
|
2564
2593
|
gap,
|
|
@@ -2586,7 +2615,7 @@ var init_Grid = __esm({
|
|
|
2586
2615
|
justifyItems,
|
|
2587
2616
|
...style
|
|
2588
2617
|
});
|
|
2589
|
-
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { style: styles, className: classes, ...rest });
|
|
2618
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { ref, style: styles, className: classes, ...rest });
|
|
2590
2619
|
};
|
|
2591
2620
|
Grid.displayName = "Grid";
|
|
2592
2621
|
}
|
|
@@ -2611,7 +2640,7 @@ var init_Item2 = __esm({
|
|
|
2611
2640
|
{}
|
|
2612
2641
|
);
|
|
2613
2642
|
DEFAULT_SPAN = 12;
|
|
2614
|
-
GridItem = ({ ref
|
|
2643
|
+
GridItem = ({ ref, ...props }) => {
|
|
2615
2644
|
const {
|
|
2616
2645
|
breakpoint: { size: breakpointSize }
|
|
2617
2646
|
} = useBreakpoint();
|
|
@@ -2637,7 +2666,7 @@ var init_Item2 = __esm({
|
|
|
2637
2666
|
xxl
|
|
2638
2667
|
});
|
|
2639
2668
|
const [responsiveSpan, setResponsiveSpan] = (0, import_react22.useState)();
|
|
2640
|
-
const classes = (0, import_dedupe24.default)("mobius-grid__item", className);
|
|
2669
|
+
const classes = (0, import_dedupe24.default)("mobius", "mobius-grid__item", className);
|
|
2641
2670
|
(0, import_react22.useEffect)(() => {
|
|
2642
2671
|
setResponsiveSpan(breakpointMap[breakpointSize]);
|
|
2643
2672
|
}, [breakpointSize, breakpointMap]);
|
|
@@ -2646,7 +2675,7 @@ var init_Item2 = __esm({
|
|
|
2646
2675
|
alignSelf,
|
|
2647
2676
|
justifySelf
|
|
2648
2677
|
};
|
|
2649
|
-
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { style: { ...styles }, className: classes, ...rest });
|
|
2678
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { ref, style: { ...styles }, className: classes, ...rest });
|
|
2650
2679
|
};
|
|
2651
2680
|
GridItem.displayName = "GridItem";
|
|
2652
2681
|
}
|
|
@@ -2792,14 +2821,22 @@ var init_List = __esm({
|
|
|
2792
2821
|
},
|
|
2793
2822
|
otherProps.className
|
|
2794
2823
|
);
|
|
2795
|
-
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
2796
|
-
|
|
2797
|
-
|
|
2798
|
-
|
|
2799
|
-
|
|
2824
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
2825
|
+
Component,
|
|
2826
|
+
{
|
|
2827
|
+
ref,
|
|
2828
|
+
...mappedProps,
|
|
2829
|
+
className: classes,
|
|
2830
|
+
children: import_react23.Children.map(children, (child) => {
|
|
2831
|
+
if ((0, import_react23.isValidElement)(child)) {
|
|
2832
|
+
return (0, import_react23.cloneElement)(child, {
|
|
2833
|
+
parentIcon: icon
|
|
2834
|
+
});
|
|
2835
|
+
}
|
|
2836
|
+
return child;
|
|
2837
|
+
})
|
|
2800
2838
|
}
|
|
2801
|
-
|
|
2802
|
-
}) });
|
|
2839
|
+
);
|
|
2803
2840
|
};
|
|
2804
2841
|
List.displayName = "List";
|
|
2805
2842
|
}
|
|
@@ -2970,7 +3007,10 @@ var init_ModalContext = __esm({
|
|
|
2970
3007
|
ModalContext = (0, import_react24.createContext)({
|
|
2971
3008
|
onClose: () => {
|
|
2972
3009
|
},
|
|
2973
|
-
closeLabel: void 0
|
|
3010
|
+
closeLabel: void 0,
|
|
3011
|
+
titleId: void 0,
|
|
3012
|
+
setTitleId: () => {
|
|
3013
|
+
}
|
|
2974
3014
|
});
|
|
2975
3015
|
}
|
|
2976
3016
|
});
|
|
@@ -2983,54 +3023,68 @@ var init_useModal = __esm({
|
|
|
2983
3023
|
import_react25 = require("react");
|
|
2984
3024
|
init_ModalContext();
|
|
2985
3025
|
useModal = () => {
|
|
2986
|
-
const { onClose, closeLabel } = (0, import_react25.useContext)(ModalContext);
|
|
2987
|
-
return { onClose, closeLabel };
|
|
3026
|
+
const { onClose, closeLabel, titleId, setTitleId } = (0, import_react25.useContext)(ModalContext);
|
|
3027
|
+
return { onClose, closeLabel, titleId, setTitleId };
|
|
2988
3028
|
};
|
|
2989
3029
|
}
|
|
2990
3030
|
});
|
|
2991
3031
|
|
|
2992
3032
|
// src/components/Modal/Header.tsx
|
|
2993
|
-
var import_icons9, import_jsx_runtime40, Header2;
|
|
3033
|
+
var import_react26, import_icons9, import_jsx_runtime40, Header2;
|
|
2994
3034
|
var init_Header2 = __esm({
|
|
2995
3035
|
"src/components/Modal/Header.tsx"() {
|
|
2996
3036
|
"use strict";
|
|
3037
|
+
import_react26 = require("react");
|
|
2997
3038
|
import_icons9 = require("@simplybusiness/icons");
|
|
2998
3039
|
init_Button2();
|
|
2999
3040
|
init_Icon2();
|
|
3000
3041
|
init_useModal();
|
|
3001
3042
|
import_jsx_runtime40 = require("react/jsx-runtime");
|
|
3002
3043
|
Header2 = ({ ref, children, ...otherProps }) => {
|
|
3003
|
-
const { onClose, closeLabel } = useModal();
|
|
3004
|
-
|
|
3005
|
-
|
|
3006
|
-
|
|
3007
|
-
|
|
3008
|
-
|
|
3009
|
-
|
|
3010
|
-
|
|
3011
|
-
|
|
3012
|
-
|
|
3013
|
-
|
|
3014
|
-
|
|
3015
|
-
|
|
3016
|
-
|
|
3017
|
-
|
|
3018
|
-
|
|
3019
|
-
|
|
3020
|
-
|
|
3044
|
+
const { onClose, closeLabel, setTitleId } = useModal();
|
|
3045
|
+
const titleId = (0, import_react26.useId)();
|
|
3046
|
+
(0, import_react26.useEffect)(() => {
|
|
3047
|
+
setTitleId(titleId);
|
|
3048
|
+
}, [titleId, setTitleId]);
|
|
3049
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
3050
|
+
"header",
|
|
3051
|
+
{
|
|
3052
|
+
ref,
|
|
3053
|
+
...otherProps,
|
|
3054
|
+
className: "mobius-modal__header",
|
|
3055
|
+
id: titleId,
|
|
3056
|
+
children: [
|
|
3057
|
+
children,
|
|
3058
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
3059
|
+
Button,
|
|
3060
|
+
{
|
|
3061
|
+
"aria-label": "Close",
|
|
3062
|
+
variant: "basic",
|
|
3063
|
+
onPress: onClose,
|
|
3064
|
+
className: "mobius-modal__close",
|
|
3065
|
+
children: [
|
|
3066
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Icon, { icon: import_icons9.cross }),
|
|
3067
|
+
" ",
|
|
3068
|
+
closeLabel
|
|
3069
|
+
]
|
|
3070
|
+
}
|
|
3071
|
+
)
|
|
3072
|
+
]
|
|
3073
|
+
}
|
|
3074
|
+
);
|
|
3021
3075
|
};
|
|
3022
3076
|
Header2.displayName = "Header";
|
|
3023
3077
|
}
|
|
3024
3078
|
});
|
|
3025
3079
|
|
|
3026
3080
|
// src/components/Modal/Modal.tsx
|
|
3027
|
-
var import_dedupe32,
|
|
3081
|
+
var import_dedupe32, import_react27, import_Modal, import_jsx_runtime41, TRANSITION_CSS_VARIABLE2, Modal;
|
|
3028
3082
|
var init_Modal = __esm({
|
|
3029
3083
|
"src/components/Modal/Modal.tsx"() {
|
|
3030
3084
|
"use strict";
|
|
3031
3085
|
"use client";
|
|
3032
3086
|
import_dedupe32 = __toESM(require("classnames/dedupe"));
|
|
3033
|
-
|
|
3087
|
+
import_react27 = require("react");
|
|
3034
3088
|
init_hooks();
|
|
3035
3089
|
init_utils();
|
|
3036
3090
|
init_polyfill_tests();
|
|
@@ -3050,11 +3104,11 @@ var init_Modal = __esm({
|
|
|
3050
3104
|
animation,
|
|
3051
3105
|
...rest
|
|
3052
3106
|
} = props;
|
|
3053
|
-
const [shouldTransition, setShouldTransition] = (0,
|
|
3054
|
-
(0,
|
|
3107
|
+
const [shouldTransition, setShouldTransition] = (0, import_react27.useState)(false);
|
|
3108
|
+
(0, import_react27.useEffect)(() => {
|
|
3055
3109
|
setShouldTransition(supportsDialog());
|
|
3056
3110
|
}, []);
|
|
3057
|
-
const dialogRef = (0,
|
|
3111
|
+
const dialogRef = (0, import_react27.useRef)(null);
|
|
3058
3112
|
const { close } = useDialog({
|
|
3059
3113
|
ref: dialogRef,
|
|
3060
3114
|
isOpen,
|
|
@@ -3078,12 +3132,18 @@ var init_Modal = __esm({
|
|
|
3078
3132
|
},
|
|
3079
3133
|
className
|
|
3080
3134
|
);
|
|
3081
|
-
const
|
|
3135
|
+
const [titleId, setTitleId] = (0, import_react27.useState)(void 0);
|
|
3136
|
+
const handleSetTitleId = (0, import_react27.useCallback)((id) => {
|
|
3137
|
+
setTitleId(id);
|
|
3138
|
+
}, []);
|
|
3139
|
+
const contextValue = (0, import_react27.useMemo)(
|
|
3082
3140
|
() => ({
|
|
3083
3141
|
onClose: close,
|
|
3084
|
-
closeLabel
|
|
3142
|
+
closeLabel,
|
|
3143
|
+
titleId,
|
|
3144
|
+
setTitleId: handleSetTitleId
|
|
3085
3145
|
}),
|
|
3086
|
-
[close, closeLabel]
|
|
3146
|
+
[close, closeLabel, titleId, handleSetTitleId]
|
|
3087
3147
|
);
|
|
3088
3148
|
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
3089
3149
|
"dialog",
|
|
@@ -3091,6 +3151,7 @@ var init_Modal = __esm({
|
|
|
3091
3151
|
ref: mergeRefs([dialogRef, ref]),
|
|
3092
3152
|
onCancel: close,
|
|
3093
3153
|
className: modalClasses,
|
|
3154
|
+
"aria-labelledby": titleId,
|
|
3094
3155
|
...rest,
|
|
3095
3156
|
children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(ModalContext.Provider, { value: contextValue, children })
|
|
3096
3157
|
}
|
|
@@ -3117,13 +3178,13 @@ var init_Modal2 = __esm({
|
|
|
3117
3178
|
});
|
|
3118
3179
|
|
|
3119
3180
|
// src/components/NumberField/NumberField.tsx
|
|
3120
|
-
var import_dedupe33,
|
|
3181
|
+
var import_dedupe33, import_react28, import_NumberField, import_jsx_runtime42, NumberField;
|
|
3121
3182
|
var init_NumberField = __esm({
|
|
3122
3183
|
"src/components/NumberField/NumberField.tsx"() {
|
|
3123
3184
|
"use strict";
|
|
3124
3185
|
"use client";
|
|
3125
3186
|
import_dedupe33 = __toESM(require("classnames/dedupe"));
|
|
3126
|
-
|
|
3187
|
+
import_react28 = require("react");
|
|
3127
3188
|
init_TextField2();
|
|
3128
3189
|
import_NumberField = require("@simplybusiness/mobius/src/components/NumberField/NumberField.css");
|
|
3129
3190
|
import_jsx_runtime42 = require("react/jsx-runtime");
|
|
@@ -3142,9 +3203,9 @@ var init_NumberField = __esm({
|
|
|
3142
3203
|
onBlur: customOnBlur,
|
|
3143
3204
|
...rest
|
|
3144
3205
|
} = otherProps;
|
|
3145
|
-
const focusedInputRef = (0,
|
|
3146
|
-
const wheelHandler = (0,
|
|
3147
|
-
(0,
|
|
3206
|
+
const focusedInputRef = (0, import_react28.useRef)(null);
|
|
3207
|
+
const wheelHandler = (0, import_react28.useCallback)((ev) => ev.preventDefault(), []);
|
|
3208
|
+
(0, import_react28.useEffect)(() => {
|
|
3148
3209
|
return () => {
|
|
3149
3210
|
focusedInputRef.current?.removeEventListener("wheel", wheelHandler);
|
|
3150
3211
|
focusedInputRef.current = null;
|
|
@@ -3276,13 +3337,13 @@ var init_ShowHideButton = __esm({
|
|
|
3276
3337
|
});
|
|
3277
3338
|
|
|
3278
3339
|
// src/components/PasswordField/PasswordField.tsx
|
|
3279
|
-
var import_dedupe34,
|
|
3340
|
+
var import_dedupe34, import_react29, import_PasswordField, import_jsx_runtime45, PasswordField;
|
|
3280
3341
|
var init_PasswordField = __esm({
|
|
3281
3342
|
"src/components/PasswordField/PasswordField.tsx"() {
|
|
3282
3343
|
"use strict";
|
|
3283
3344
|
"use client";
|
|
3284
3345
|
import_dedupe34 = __toESM(require("classnames/dedupe"));
|
|
3285
|
-
|
|
3346
|
+
import_react29 = require("react");
|
|
3286
3347
|
init_mergeRefs();
|
|
3287
3348
|
init_TextField2();
|
|
3288
3349
|
init_ShowHideButton();
|
|
@@ -3294,10 +3355,10 @@ var init_PasswordField = __esm({
|
|
|
3294
3355
|
autoComplete = "current-password",
|
|
3295
3356
|
...props
|
|
3296
3357
|
}) => {
|
|
3297
|
-
const [show, setShow] = (0,
|
|
3358
|
+
const [show, setShow] = (0, import_react29.useState)(false);
|
|
3298
3359
|
const type = show ? "text" : "password";
|
|
3299
3360
|
const classes = (0, import_dedupe34.default)("mobius-password-field", className);
|
|
3300
|
-
const localRef = (0,
|
|
3361
|
+
const localRef = (0, import_react29.useRef)(null);
|
|
3301
3362
|
const handleShowHideButtonClick = () => {
|
|
3302
3363
|
const selectionStart = localRef.current?.selectionStart;
|
|
3303
3364
|
const selectionEnd = localRef.current?.selectionEnd;
|
|
@@ -3334,14 +3395,14 @@ var init_PasswordField2 = __esm({
|
|
|
3334
3395
|
});
|
|
3335
3396
|
|
|
3336
3397
|
// src/components/Popover/Popover.tsx
|
|
3337
|
-
var
|
|
3398
|
+
var import_react30, import_icons11, import_dedupe35, import_react31, import_mobius_hooks4, import_Popover, import_jsx_runtime46;
|
|
3338
3399
|
var init_Popover = __esm({
|
|
3339
3400
|
"src/components/Popover/Popover.tsx"() {
|
|
3340
3401
|
"use strict";
|
|
3341
|
-
|
|
3402
|
+
import_react30 = require("@floating-ui/react");
|
|
3342
3403
|
import_icons11 = require("@simplybusiness/icons");
|
|
3343
3404
|
import_dedupe35 = __toESM(require("classnames/dedupe"));
|
|
3344
|
-
|
|
3405
|
+
import_react31 = require("react");
|
|
3345
3406
|
import_mobius_hooks4 = require("@simplybusiness/mobius-hooks");
|
|
3346
3407
|
import_Popover = require("@simplybusiness/mobius/src/components/Popover/Popover.css");
|
|
3347
3408
|
import_jsx_runtime46 = require("react/jsx-runtime");
|
|
@@ -3368,13 +3429,13 @@ function warnAboutInvalidValues(value, minValue, maxValue) {
|
|
|
3368
3429
|
console.warn("Progress value is greater than maxValue");
|
|
3369
3430
|
}
|
|
3370
3431
|
}
|
|
3371
|
-
var import_dedupe36,
|
|
3432
|
+
var import_dedupe36, import_react32, import_Progress, import_jsx_runtime47, sanitizedValue, getLabelComponent, DEFAULT_VALUE, DEFAULT_MIN_VALUE, DEFAULT_MAX_VALUE, Progress;
|
|
3372
3433
|
var init_Progress = __esm({
|
|
3373
3434
|
"src/components/Progress/Progress.tsx"() {
|
|
3374
3435
|
"use strict";
|
|
3375
3436
|
"use client";
|
|
3376
3437
|
import_dedupe36 = __toESM(require("classnames/dedupe"));
|
|
3377
|
-
|
|
3438
|
+
import_react32 = require("react");
|
|
3378
3439
|
init_Label2();
|
|
3379
3440
|
init_VisuallyHidden2();
|
|
3380
3441
|
import_Progress = require("@simplybusiness/mobius/src/components/Progress/Progress.css");
|
|
@@ -3411,8 +3472,8 @@ var init_Progress = __esm({
|
|
|
3411
3472
|
DEFAULT_MIN_VALUE = 0;
|
|
3412
3473
|
DEFAULT_MAX_VALUE = 100;
|
|
3413
3474
|
Progress = ({ ref, ...props }) => {
|
|
3414
|
-
const progressId = (0,
|
|
3415
|
-
const progressLabelId = (0,
|
|
3475
|
+
const progressId = (0, import_react32.useId)();
|
|
3476
|
+
const progressLabelId = (0, import_react32.useId)();
|
|
3416
3477
|
const {
|
|
3417
3478
|
id,
|
|
3418
3479
|
label,
|
|
@@ -3477,13 +3538,13 @@ var init_Progress2 = __esm({
|
|
|
3477
3538
|
});
|
|
3478
3539
|
|
|
3479
3540
|
// src/components/Radio/Radio.tsx
|
|
3480
|
-
var import_dedupe37,
|
|
3541
|
+
var import_dedupe37, import_react33, import_Radio, import_jsx_runtime48, Radio;
|
|
3481
3542
|
var init_Radio = __esm({
|
|
3482
3543
|
"src/components/Radio/Radio.tsx"() {
|
|
3483
3544
|
"use strict";
|
|
3484
3545
|
"use client";
|
|
3485
3546
|
import_dedupe37 = __toESM(require("classnames/dedupe"));
|
|
3486
|
-
|
|
3547
|
+
import_react33 = require("react");
|
|
3487
3548
|
init_ErrorMessage2();
|
|
3488
3549
|
init_Label2();
|
|
3489
3550
|
import_Radio = require("@simplybusiness/mobius/src/components/Radio/Radio.css");
|
|
@@ -3511,19 +3572,19 @@ var init_Radio = __esm({
|
|
|
3511
3572
|
const isMultiline = label && children;
|
|
3512
3573
|
const isControlled = selected !== void 0;
|
|
3513
3574
|
const isChecked = isControlled ? selected === value : defaultChecked;
|
|
3514
|
-
const contentRef = (0,
|
|
3515
|
-
const prevOverflowRef = (0,
|
|
3575
|
+
const contentRef = (0, import_react33.useRef)(null);
|
|
3576
|
+
const prevOverflowRef = (0, import_react33.useRef)({
|
|
3516
3577
|
vertical: false,
|
|
3517
3578
|
horizontal: false
|
|
3518
3579
|
});
|
|
3519
|
-
const hasIconFirst = (0,
|
|
3520
|
-
if (!children ||
|
|
3521
|
-
const firstChild =
|
|
3522
|
-
if (!(0,
|
|
3580
|
+
const hasIconFirst = (0, import_react33.useMemo)(() => {
|
|
3581
|
+
if (!children || import_react33.Children.count(children) === 0) return false;
|
|
3582
|
+
const firstChild = import_react33.Children.toArray(children)[0];
|
|
3583
|
+
if (!(0, import_react33.isValidElement)(firstChild)) return false;
|
|
3523
3584
|
const props2 = firstChild.props;
|
|
3524
3585
|
return "icon" in props2 && props2.icon !== void 0;
|
|
3525
3586
|
}, [children]);
|
|
3526
|
-
(0,
|
|
3587
|
+
(0, import_react33.useLayoutEffect)(() => {
|
|
3527
3588
|
if (!contentRef.current || !onOverflow) return;
|
|
3528
3589
|
if (orientation === "vertical") {
|
|
3529
3590
|
return;
|
|
@@ -3604,13 +3665,13 @@ var init_Radio = __esm({
|
|
|
3604
3665
|
});
|
|
3605
3666
|
|
|
3606
3667
|
// src/components/Radio/RadioGroup.tsx
|
|
3607
|
-
var import_dedupe38,
|
|
3668
|
+
var import_dedupe38, import_react34, import_jsx_runtime49, getDefaultVal, RadioGroup;
|
|
3608
3669
|
var init_RadioGroup = __esm({
|
|
3609
3670
|
"src/components/Radio/RadioGroup.tsx"() {
|
|
3610
3671
|
"use strict";
|
|
3611
3672
|
"use client";
|
|
3612
3673
|
import_dedupe38 = __toESM(require("classnames/dedupe"));
|
|
3613
|
-
|
|
3674
|
+
import_react34 = require("react");
|
|
3614
3675
|
init_hooks();
|
|
3615
3676
|
init_spaceDelimitedList();
|
|
3616
3677
|
init_ErrorMessage2();
|
|
@@ -3644,15 +3705,15 @@ var init_RadioGroup = __esm({
|
|
|
3644
3705
|
...rest
|
|
3645
3706
|
} = props;
|
|
3646
3707
|
const defaultSelected = getDefaultVal(children, value || defaultValue);
|
|
3647
|
-
const [selected, setSelected] = (0,
|
|
3648
|
-
const overflowsRef = (0,
|
|
3649
|
-
const [hasOverflow, setHasOverflow] = (0,
|
|
3650
|
-
(0,
|
|
3708
|
+
const [selected, setSelected] = (0, import_react34.useState)(defaultSelected);
|
|
3709
|
+
const overflowsRef = (0, import_react34.useRef)({});
|
|
3710
|
+
const [hasOverflow, setHasOverflow] = (0, import_react34.useState)(false);
|
|
3711
|
+
(0, import_react34.useEffect)(() => {
|
|
3651
3712
|
if (value !== void 0) {
|
|
3652
3713
|
setSelected(value);
|
|
3653
3714
|
}
|
|
3654
3715
|
}, [value]);
|
|
3655
|
-
const handleOverflow = (0,
|
|
3716
|
+
const handleOverflow = (0, import_react34.useCallback)(
|
|
3656
3717
|
(radioValue, overflow) => {
|
|
3657
3718
|
overflowsRef.current = {
|
|
3658
3719
|
...overflowsRef.current,
|
|
@@ -3686,15 +3747,15 @@ var init_RadioGroup = __esm({
|
|
|
3686
3747
|
[`--is-${effectiveOrientation}`]: true
|
|
3687
3748
|
});
|
|
3688
3749
|
const labelClasses = (0, import_dedupe38.default)(radioClasses, validationClasses);
|
|
3689
|
-
const errorMessageId = (0,
|
|
3690
|
-
const defaultNameAttrId = (0,
|
|
3750
|
+
const errorMessageId = (0, import_react34.useId)();
|
|
3751
|
+
const defaultNameAttrId = (0, import_react34.useId)();
|
|
3691
3752
|
const nameAttribute = name || defaultNameAttrId;
|
|
3692
3753
|
const shouldErrorMessageShow = errorMessage ? errorMessageId : void 0;
|
|
3693
3754
|
const describedBy = spaceDelimitedList([
|
|
3694
3755
|
shouldErrorMessageShow,
|
|
3695
3756
|
props["aria-describedby"]
|
|
3696
3757
|
]);
|
|
3697
|
-
const labelId = (0,
|
|
3758
|
+
const labelId = (0, import_react34.useId)();
|
|
3698
3759
|
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
3699
3760
|
"div",
|
|
3700
3761
|
{
|
|
@@ -3713,10 +3774,10 @@ var init_RadioGroup = __esm({
|
|
|
3713
3774
|
role: "radiogroup",
|
|
3714
3775
|
children: /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(Stack, { gap: "xs", children: [
|
|
3715
3776
|
label && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Label, { htmlFor: name, id: labelId, className: labelClasses, children: label }),
|
|
3716
|
-
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { className: radioWrapperClasses, children:
|
|
3717
|
-
if ((0,
|
|
3777
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { className: radioWrapperClasses, children: import_react34.Children.map(children, (child) => {
|
|
3778
|
+
if ((0, import_react34.isValidElement)(child)) {
|
|
3718
3779
|
const childValue = child.props.value;
|
|
3719
|
-
return (0,
|
|
3780
|
+
return (0, import_react34.cloneElement)(
|
|
3720
3781
|
child,
|
|
3721
3782
|
{
|
|
3722
3783
|
orientation: effectiveOrientation,
|
|
@@ -3783,7 +3844,7 @@ var init_Segment = __esm({
|
|
|
3783
3844
|
import_dedupe40 = __toESM(require("classnames/dedupe"));
|
|
3784
3845
|
import_Segment = require("@simplybusiness/mobius/src/components/Segment/Segment.css");
|
|
3785
3846
|
import_jsx_runtime51 = require("react/jsx-runtime");
|
|
3786
|
-
Segment = (props) => {
|
|
3847
|
+
Segment = ({ ref, ...props }) => {
|
|
3787
3848
|
const { heading, children, colour, inverted, className, ...rest } = props;
|
|
3788
3849
|
const classes = (0, import_dedupe40.default)(
|
|
3789
3850
|
"mobius",
|
|
@@ -3792,7 +3853,7 @@ var init_Segment = __esm({
|
|
|
3792
3853
|
{ inverted },
|
|
3793
3854
|
className
|
|
3794
3855
|
);
|
|
3795
|
-
return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: classes, ...rest, children: [
|
|
3856
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { ref, className: classes, ...rest, children: [
|
|
3796
3857
|
heading && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "mobius-segment__heading", children: heading }),
|
|
3797
3858
|
children
|
|
3798
3859
|
] });
|
|
@@ -3811,14 +3872,14 @@ var init_Segment2 = __esm({
|
|
|
3811
3872
|
});
|
|
3812
3873
|
|
|
3813
3874
|
// src/components/Select/Select.tsx
|
|
3814
|
-
var import_icons12, import_dedupe41,
|
|
3875
|
+
var import_icons12, import_dedupe41, import_react35, import_Select, import_jsx_runtime52, Select;
|
|
3815
3876
|
var init_Select = __esm({
|
|
3816
3877
|
"src/components/Select/Select.tsx"() {
|
|
3817
3878
|
"use strict";
|
|
3818
3879
|
"use client";
|
|
3819
3880
|
import_icons12 = require("@simplybusiness/icons");
|
|
3820
3881
|
import_dedupe41 = __toESM(require("classnames/dedupe"));
|
|
3821
|
-
|
|
3882
|
+
import_react35 = require("react");
|
|
3822
3883
|
init_hooks();
|
|
3823
3884
|
init_useLabel2();
|
|
3824
3885
|
init_spaceDelimitedList();
|
|
@@ -3865,7 +3926,7 @@ var init_Select = __esm({
|
|
|
3865
3926
|
otherProps.className
|
|
3866
3927
|
);
|
|
3867
3928
|
const iconClasses = (0, import_dedupe41.default)("mobius-select__icon", sharedClasses);
|
|
3868
|
-
const errorMessageId = (0,
|
|
3929
|
+
const errorMessageId = (0, import_react35.useId)();
|
|
3869
3930
|
const shouldErrorMessageShow = errorMessage ? errorMessageId : void 0;
|
|
3870
3931
|
const describedBy = spaceDelimitedList([
|
|
3871
3932
|
shouldErrorMessageShow,
|
|
@@ -3913,13 +3974,13 @@ var init_Select2 = __esm({
|
|
|
3913
3974
|
});
|
|
3914
3975
|
|
|
3915
3976
|
// src/components/Slider/Slider.tsx
|
|
3916
|
-
var import_dedupe42,
|
|
3977
|
+
var import_dedupe42, import_react36, import_Slider, import_jsx_runtime53;
|
|
3917
3978
|
var init_Slider = __esm({
|
|
3918
3979
|
"src/components/Slider/Slider.tsx"() {
|
|
3919
3980
|
"use strict";
|
|
3920
3981
|
"use client";
|
|
3921
3982
|
import_dedupe42 = __toESM(require("classnames/dedupe"));
|
|
3922
|
-
|
|
3983
|
+
import_react36 = require("react");
|
|
3923
3984
|
import_Slider = require("@simplybusiness/mobius/src/components/Slider/Slider.css");
|
|
3924
3985
|
import_jsx_runtime53 = require("react/jsx-runtime");
|
|
3925
3986
|
}
|
|
@@ -3934,17 +3995,17 @@ var init_Slider2 = __esm({
|
|
|
3934
3995
|
});
|
|
3935
3996
|
|
|
3936
3997
|
// src/components/SVG/SVG.tsx
|
|
3937
|
-
var
|
|
3998
|
+
var import_react37, import_dedupe43, import_jsx_runtime54, SVG;
|
|
3938
3999
|
var init_SVG = __esm({
|
|
3939
4000
|
"src/components/SVG/SVG.tsx"() {
|
|
3940
4001
|
"use strict";
|
|
3941
|
-
|
|
4002
|
+
import_react37 = require("react");
|
|
3942
4003
|
import_dedupe43 = __toESM(require("classnames/dedupe"));
|
|
3943
4004
|
import_jsx_runtime54 = require("react/jsx-runtime");
|
|
3944
4005
|
SVG = ({ ref, ...props }) => {
|
|
3945
4006
|
const { children, className, ...otherProps } = props;
|
|
3946
4007
|
const classes = (0, import_dedupe43.default)("mobius", "mobius-svg", className);
|
|
3947
|
-
const svgNode =
|
|
4008
|
+
const svgNode = import_react37.Children.only(children);
|
|
3948
4009
|
const { children: svgChildren, viewBox, xmlns } = svgNode.props;
|
|
3949
4010
|
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
3950
4011
|
"svg",
|
|
@@ -3971,12 +4032,12 @@ var init_SVG2 = __esm({
|
|
|
3971
4032
|
});
|
|
3972
4033
|
|
|
3973
4034
|
// src/components/Switch/Switch.tsx
|
|
3974
|
-
var
|
|
4035
|
+
var import_react38, import_dedupe44, import_Switch, import_jsx_runtime55, Switch;
|
|
3975
4036
|
var init_Switch = __esm({
|
|
3976
4037
|
"src/components/Switch/Switch.tsx"() {
|
|
3977
4038
|
"use strict";
|
|
3978
4039
|
"use client";
|
|
3979
|
-
|
|
4040
|
+
import_react38 = require("react");
|
|
3980
4041
|
import_dedupe44 = __toESM(require("classnames/dedupe"));
|
|
3981
4042
|
init_VisuallyHidden2();
|
|
3982
4043
|
import_Switch = require("@simplybusiness/mobius/src/components/Switch/Switch.css");
|
|
@@ -3989,8 +4050,8 @@ var init_Switch = __esm({
|
|
|
3989
4050
|
isDisabled = false,
|
|
3990
4051
|
...otherProps
|
|
3991
4052
|
} = props;
|
|
3992
|
-
const [enabled, setEnabled] = (0,
|
|
3993
|
-
(0,
|
|
4053
|
+
const [enabled, setEnabled] = (0, import_react38.useState)(checked);
|
|
4054
|
+
(0, import_react38.useEffect)(() => {
|
|
3994
4055
|
setEnabled(checked);
|
|
3995
4056
|
}, [checked]);
|
|
3996
4057
|
const classes = (0, import_dedupe44.default)(
|
|
@@ -4119,13 +4180,13 @@ var init_HeaderCell = __esm({
|
|
|
4119
4180
|
"use strict";
|
|
4120
4181
|
import_dedupe50 = __toESM(require("classnames/dedupe"));
|
|
4121
4182
|
import_jsx_runtime61 = require("react/jsx-runtime");
|
|
4122
|
-
HeaderCell = ({ ref, ...props }) => {
|
|
4183
|
+
HeaderCell = ({ ref, scope = "col", ...props }) => {
|
|
4123
4184
|
const classes = (0, import_dedupe50.default)(
|
|
4124
4185
|
"mobius",
|
|
4125
4186
|
"mobius-table__head-cell",
|
|
4126
4187
|
props.className
|
|
4127
4188
|
);
|
|
4128
|
-
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("th", { ...props, ref, className: classes });
|
|
4189
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("th", { ...props, ref, scope, className: classes });
|
|
4129
4190
|
};
|
|
4130
4191
|
HeaderCell.displayName = "Table.HeaderCell";
|
|
4131
4192
|
}
|
|
@@ -4330,12 +4391,12 @@ var init_Toast = __esm({
|
|
|
4330
4391
|
});
|
|
4331
4392
|
|
|
4332
4393
|
// src/components/Trust/Trust.tsx
|
|
4333
|
-
var import_dedupe55,
|
|
4394
|
+
var import_dedupe55, import_react39, import_jsx_runtime66;
|
|
4334
4395
|
var init_Trust = __esm({
|
|
4335
4396
|
"src/components/Trust/Trust.tsx"() {
|
|
4336
4397
|
"use strict";
|
|
4337
4398
|
import_dedupe55 = __toESM(require("classnames/dedupe"));
|
|
4338
|
-
|
|
4399
|
+
import_react39 = require("react");
|
|
4339
4400
|
import_jsx_runtime66 = require("react/jsx-runtime");
|
|
4340
4401
|
}
|
|
4341
4402
|
});
|
|
@@ -4357,13 +4418,13 @@ var init_Trust2 = __esm({
|
|
|
4357
4418
|
});
|
|
4358
4419
|
|
|
4359
4420
|
// src/components/ExpandableText/ExpandableText.tsx
|
|
4360
|
-
var import_dedupe56,
|
|
4421
|
+
var import_dedupe56, import_react40, import_ExpandableText, import_jsx_runtime67, ExpandableText;
|
|
4361
4422
|
var init_ExpandableText = __esm({
|
|
4362
4423
|
"src/components/ExpandableText/ExpandableText.tsx"() {
|
|
4363
4424
|
"use strict";
|
|
4364
4425
|
"use client";
|
|
4365
4426
|
import_dedupe56 = __toESM(require("classnames/dedupe"));
|
|
4366
|
-
|
|
4427
|
+
import_react40 = require("react");
|
|
4367
4428
|
init_src();
|
|
4368
4429
|
import_ExpandableText = require("@simplybusiness/mobius/src/components/ExpandableText/ExpandableText.css");
|
|
4369
4430
|
import_jsx_runtime67 = require("react/jsx-runtime");
|
|
@@ -4380,14 +4441,14 @@ var init_ExpandableText = __esm({
|
|
|
4380
4441
|
onToggle,
|
|
4381
4442
|
...otherProps
|
|
4382
4443
|
} = props;
|
|
4383
|
-
const [isExpanded, setIsExpanded] = (0,
|
|
4384
|
-
const [isCollapsed, setIsCollapsed] = (0,
|
|
4385
|
-
const textRef = (0,
|
|
4444
|
+
const [isExpanded, setIsExpanded] = (0, import_react40.useState)(false);
|
|
4445
|
+
const [isCollapsed, setIsCollapsed] = (0, import_react40.useState)(false);
|
|
4446
|
+
const textRef = (0, import_react40.useRef)(null);
|
|
4386
4447
|
const { down } = useBreakpoint();
|
|
4387
|
-
const baseId = (0,
|
|
4448
|
+
const baseId = (0, import_react40.useId)();
|
|
4388
4449
|
const expandButtonId = `expandable-text-expand-${baseId}`;
|
|
4389
4450
|
const shouldCollapse = breakpoint ? down(breakpoint) : true;
|
|
4390
|
-
(0,
|
|
4451
|
+
(0, import_react40.useEffect)(() => {
|
|
4391
4452
|
if (!shouldCollapse || !textRef.current) {
|
|
4392
4453
|
setIsCollapsed(false);
|
|
4393
4454
|
return;
|
|
@@ -4464,17 +4525,17 @@ var MaskedField_exports = {};
|
|
|
4464
4525
|
__export(MaskedField_exports, {
|
|
4465
4526
|
MaskedField: () => MaskedField
|
|
4466
4527
|
});
|
|
4467
|
-
var
|
|
4528
|
+
var import_react41, import_react_imask, import_jsx_runtime68, useAcceptHandler, useCombinedRef, useBlurHandler, ControlledMaskedField, UncontrolledMaskedField, MaskedField;
|
|
4468
4529
|
var init_MaskedField = __esm({
|
|
4469
4530
|
"src/components/MaskedField/MaskedField.tsx"() {
|
|
4470
4531
|
"use strict";
|
|
4471
4532
|
"use client";
|
|
4472
|
-
|
|
4533
|
+
import_react41 = require("react");
|
|
4473
4534
|
import_react_imask = require("react-imask");
|
|
4474
4535
|
init_TextField2();
|
|
4475
4536
|
import_jsx_runtime68 = require("react/jsx-runtime");
|
|
4476
4537
|
useAcceptHandler = (onChange, useMaskedValue, name) => {
|
|
4477
|
-
return (0,
|
|
4538
|
+
return (0, import_react41.useCallback)(
|
|
4478
4539
|
(maskedValue, maskInstance) => {
|
|
4479
4540
|
if (!onChange) {
|
|
4480
4541
|
return;
|
|
@@ -4490,7 +4551,7 @@ var init_MaskedField = __esm({
|
|
|
4490
4551
|
);
|
|
4491
4552
|
};
|
|
4492
4553
|
useCombinedRef = (imaskRef, forwardedRef) => {
|
|
4493
|
-
return (0,
|
|
4554
|
+
return (0, import_react41.useCallback)(
|
|
4494
4555
|
(element) => {
|
|
4495
4556
|
imaskRef.current = element;
|
|
4496
4557
|
if (typeof forwardedRef === "function") {
|
|
@@ -4503,7 +4564,7 @@ var init_MaskedField = __esm({
|
|
|
4503
4564
|
);
|
|
4504
4565
|
};
|
|
4505
4566
|
useBlurHandler = (onBlur, maskRef, useMaskedValue, name) => {
|
|
4506
|
-
return (0,
|
|
4567
|
+
return (0, import_react41.useCallback)(
|
|
4507
4568
|
(event) => {
|
|
4508
4569
|
if (!onBlur || !maskRef.current) {
|
|
4509
4570
|
return;
|
|
@@ -4533,7 +4594,7 @@ var init_MaskedField = __esm({
|
|
|
4533
4594
|
const { ref: imaskRef, maskRef, setValue } = (0, import_react_imask.useIMask)(mask, { onAccept });
|
|
4534
4595
|
const combinedRef = useCombinedRef(imaskRef, forwardedRef);
|
|
4535
4596
|
const handleBlur = useBlurHandler(onBlur, maskRef, useMaskedValue, name);
|
|
4536
|
-
(0,
|
|
4597
|
+
(0, import_react41.useEffect)(() => {
|
|
4537
4598
|
if (!maskRef.current) {
|
|
4538
4599
|
return;
|
|
4539
4600
|
}
|
|
@@ -4803,15 +4864,15 @@ var init_ErrorMessage2 = __esm({
|
|
|
4803
4864
|
});
|
|
4804
4865
|
|
|
4805
4866
|
// src/components/TextField/adornmentWithClassName.ts
|
|
4806
|
-
var import_dedupe58,
|
|
4867
|
+
var import_dedupe58, import_react42, adornmentWithClassName;
|
|
4807
4868
|
var init_adornmentWithClassName = __esm({
|
|
4808
4869
|
"src/components/TextField/adornmentWithClassName.ts"() {
|
|
4809
4870
|
"use strict";
|
|
4810
4871
|
import_dedupe58 = __toESM(require("classnames/dedupe"));
|
|
4811
|
-
|
|
4872
|
+
import_react42 = require("react");
|
|
4812
4873
|
adornmentWithClassName = (component, validationClasses, className) => {
|
|
4813
4874
|
if (!component) return null;
|
|
4814
|
-
return (0,
|
|
4875
|
+
return (0, import_react42.cloneElement)(component, {
|
|
4815
4876
|
className: (0, import_dedupe58.default)(
|
|
4816
4877
|
component.props.className,
|
|
4817
4878
|
validationClasses,
|
|
@@ -4971,11 +5032,11 @@ var init_utils3 = __esm({
|
|
|
4971
5032
|
});
|
|
4972
5033
|
|
|
4973
5034
|
// src/components/Combobox/Option.tsx
|
|
4974
|
-
var
|
|
5035
|
+
var import_react43, import_dedupe60, import_jsx_runtime72, Option2;
|
|
4975
5036
|
var init_Option3 = __esm({
|
|
4976
5037
|
"src/components/Combobox/Option.tsx"() {
|
|
4977
5038
|
"use strict";
|
|
4978
|
-
|
|
5039
|
+
import_react43 = require("react");
|
|
4979
5040
|
import_dedupe60 = __toESM(require("classnames/dedupe"));
|
|
4980
5041
|
init_utils3();
|
|
4981
5042
|
import_jsx_runtime72 = require("react/jsx-runtime");
|
|
@@ -4987,13 +5048,13 @@ var init_Option3 = __esm({
|
|
|
4987
5048
|
optionTestIdPrefix,
|
|
4988
5049
|
id
|
|
4989
5050
|
}) => {
|
|
4990
|
-
const optionRef = (0,
|
|
5051
|
+
const optionRef = (0, import_react43.useRef)(null);
|
|
4991
5052
|
const optionValue = getOptionValue(option) || "";
|
|
4992
5053
|
const testId = buildOptionTestId(
|
|
4993
5054
|
optionTestIdPrefix || "combobox-option",
|
|
4994
5055
|
optionValue
|
|
4995
5056
|
);
|
|
4996
|
-
(0,
|
|
5057
|
+
(0, import_react43.useEffect)(() => {
|
|
4997
5058
|
if (isHighlighted && optionRef.current && optionRef.current.scrollIntoView) {
|
|
4998
5059
|
optionRef.current.scrollIntoView({ block: "nearest" });
|
|
4999
5060
|
}
|
|
@@ -5109,10 +5170,10 @@ var init_Listbox = __esm({
|
|
|
5109
5170
|
|
|
5110
5171
|
// src/components/Combobox/useComboboxHighlight.tsx
|
|
5111
5172
|
function useComboboxHighlight(options) {
|
|
5112
|
-
const [highlightedIndex, setHighlightedIndex] = (0,
|
|
5173
|
+
const [highlightedIndex, setHighlightedIndex] = (0, import_react44.useState)(
|
|
5113
5174
|
options && options.length ? 0 : -1
|
|
5114
5175
|
);
|
|
5115
|
-
const [highlightedGroupIndex, setHighlightedGroupIndex] = (0,
|
|
5176
|
+
const [highlightedGroupIndex, setHighlightedGroupIndex] = (0, import_react44.useState)(0);
|
|
5116
5177
|
function highlightNextOption() {
|
|
5117
5178
|
const isGroup = isOptionGroup(options);
|
|
5118
5179
|
if (!options) {
|
|
@@ -5188,11 +5249,11 @@ function useComboboxHighlight(options) {
|
|
|
5188
5249
|
clearHighlight
|
|
5189
5250
|
};
|
|
5190
5251
|
}
|
|
5191
|
-
var
|
|
5252
|
+
var import_react44;
|
|
5192
5253
|
var init_useComboboxHighlight = __esm({
|
|
5193
5254
|
"src/components/Combobox/useComboboxHighlight.tsx"() {
|
|
5194
5255
|
"use strict";
|
|
5195
|
-
|
|
5256
|
+
import_react44 = require("react");
|
|
5196
5257
|
init_utils3();
|
|
5197
5258
|
}
|
|
5198
5259
|
});
|
|
@@ -5207,19 +5268,19 @@ function useComboboxOptions({
|
|
|
5207
5268
|
skipNextDebounceRef,
|
|
5208
5269
|
onSearched
|
|
5209
5270
|
}) {
|
|
5210
|
-
const [filteredOptions, setFilteredOptions] = (0,
|
|
5271
|
+
const [filteredOptions, setFilteredOptions] = (0, import_react45.useState)(void 0);
|
|
5211
5272
|
const debouncedInputValue = (0, import_mobius_hooks5.useDebouncedValue)(
|
|
5212
5273
|
inputValue,
|
|
5213
5274
|
// Don't debounce synchronous options
|
|
5214
5275
|
options ? 0 : delay
|
|
5215
5276
|
);
|
|
5216
|
-
const [isLoading, setIsLoading] = (0,
|
|
5217
|
-
const [error3, setError] = (0,
|
|
5218
|
-
const asyncOptionsRef = (0,
|
|
5277
|
+
const [isLoading, setIsLoading] = (0, import_react45.useState)(false);
|
|
5278
|
+
const [error3, setError] = (0, import_react45.useState)(null);
|
|
5279
|
+
const asyncOptionsRef = (0, import_react45.useRef)(asyncOptions);
|
|
5219
5280
|
asyncOptionsRef.current = asyncOptions;
|
|
5220
|
-
const onSearchedRef = (0,
|
|
5281
|
+
const onSearchedRef = (0, import_react45.useRef)(onSearched);
|
|
5221
5282
|
onSearchedRef.current = onSearched;
|
|
5222
|
-
(0,
|
|
5283
|
+
(0, import_react45.useEffect)(() => {
|
|
5223
5284
|
const controller = new AbortController();
|
|
5224
5285
|
const { signal } = controller;
|
|
5225
5286
|
const fetchOptions = async () => {
|
|
@@ -5277,24 +5338,24 @@ function useComboboxOptions({
|
|
|
5277
5338
|
isError: error3 != null
|
|
5278
5339
|
};
|
|
5279
5340
|
}
|
|
5280
|
-
var import_mobius_hooks5,
|
|
5341
|
+
var import_mobius_hooks5, import_react45;
|
|
5281
5342
|
var init_useComboboxOptions = __esm({
|
|
5282
5343
|
"src/components/Combobox/useComboboxOptions.ts"() {
|
|
5283
5344
|
"use strict";
|
|
5284
5345
|
import_mobius_hooks5 = require("@simplybusiness/mobius-hooks");
|
|
5285
|
-
|
|
5346
|
+
import_react45 = require("react");
|
|
5286
5347
|
init_utils3();
|
|
5287
5348
|
}
|
|
5288
5349
|
});
|
|
5289
5350
|
|
|
5290
5351
|
// src/components/Combobox/Combobox.tsx
|
|
5291
|
-
var import_mobius_hooks6, import_dedupe62,
|
|
5352
|
+
var import_mobius_hooks6, import_dedupe62, import_react46, import_Combobox2, import_jsx_runtime74, ComboboxInner, Combobox;
|
|
5292
5353
|
var init_Combobox = __esm({
|
|
5293
5354
|
"src/components/Combobox/Combobox.tsx"() {
|
|
5294
5355
|
"use strict";
|
|
5295
5356
|
import_mobius_hooks6 = require("@simplybusiness/mobius-hooks");
|
|
5296
5357
|
import_dedupe62 = __toESM(require("classnames/dedupe"));
|
|
5297
|
-
|
|
5358
|
+
import_react46 = require("react");
|
|
5298
5359
|
init_hooks();
|
|
5299
5360
|
init_TextField2();
|
|
5300
5361
|
init_VisuallyHidden2();
|
|
@@ -5329,11 +5390,11 @@ var init_Combobox = __esm({
|
|
|
5329
5390
|
errorMessage,
|
|
5330
5391
|
...otherProps
|
|
5331
5392
|
} = props;
|
|
5332
|
-
const skipNextDebounceRef = (0,
|
|
5333
|
-
const fallbackRef = (0,
|
|
5334
|
-
const [inputValue, setInputValue] = (0,
|
|
5335
|
-
const [isOpen, setIsOpen] = (0,
|
|
5336
|
-
const [isChanging, setIsChanging] = (0,
|
|
5393
|
+
const skipNextDebounceRef = (0, import_react46.useRef)(false);
|
|
5394
|
+
const fallbackRef = (0, import_react46.useRef)(null);
|
|
5395
|
+
const [inputValue, setInputValue] = (0, import_react46.useState)(defaultValue || "");
|
|
5396
|
+
const [isOpen, setIsOpen] = (0, import_react46.useState)(false);
|
|
5397
|
+
const [isChanging, setIsChanging] = (0, import_react46.useState)(false);
|
|
5337
5398
|
const { filteredOptions, updateFilteredOptions, isLoading, error: error3 } = useComboboxOptions({
|
|
5338
5399
|
options,
|
|
5339
5400
|
asyncOptions,
|
|
@@ -5342,7 +5403,7 @@ var init_Combobox = __esm({
|
|
|
5342
5403
|
minSearchLength,
|
|
5343
5404
|
skipNextDebounceRef
|
|
5344
5405
|
});
|
|
5345
|
-
const [validationError, setValidationError] = (0,
|
|
5406
|
+
const [validationError, setValidationError] = (0, import_react46.useState)(
|
|
5346
5407
|
error3?.message || errorMessage
|
|
5347
5408
|
);
|
|
5348
5409
|
const {
|
|
@@ -5355,14 +5416,14 @@ var init_Combobox = __esm({
|
|
|
5355
5416
|
clearHighlight
|
|
5356
5417
|
} = useComboboxHighlight(filteredOptions);
|
|
5357
5418
|
const inputRef = ref || fallbackRef;
|
|
5358
|
-
const listboxId = (0,
|
|
5359
|
-
const statusId = (0,
|
|
5360
|
-
const blurTimeoutRef = (0,
|
|
5361
|
-
const userInteractedRef = (0,
|
|
5362
|
-
const justSelectedRef = (0,
|
|
5419
|
+
const listboxId = (0, import_react46.useId)();
|
|
5420
|
+
const statusId = (0, import_react46.useId)();
|
|
5421
|
+
const blurTimeoutRef = (0, import_react46.useRef)(null);
|
|
5422
|
+
const userInteractedRef = (0, import_react46.useRef)(false);
|
|
5423
|
+
const justSelectedRef = (0, import_react46.useRef)(false);
|
|
5363
5424
|
const { down } = useBreakpoint();
|
|
5364
5425
|
const isMobile = down("md");
|
|
5365
|
-
(0,
|
|
5426
|
+
(0, import_react46.useEffect)(() => {
|
|
5366
5427
|
setValidationError(error3?.message || errorMessage);
|
|
5367
5428
|
}, [error3, errorMessage]);
|
|
5368
5429
|
const getEmptyValue = () => {
|
|
@@ -5391,7 +5452,7 @@ var init_Combobox = __esm({
|
|
|
5391
5452
|
justSelectedRef.current = false;
|
|
5392
5453
|
}
|
|
5393
5454
|
};
|
|
5394
|
-
(0,
|
|
5455
|
+
(0, import_react46.useEffect)(() => {
|
|
5395
5456
|
if (!inputRef || typeof inputRef === "function") return;
|
|
5396
5457
|
const inputElement = inputRef.current;
|
|
5397
5458
|
if (!inputElement) return;
|
|
@@ -5544,12 +5605,12 @@ var init_Combobox = __esm({
|
|
|
5544
5605
|
default:
|
|
5545
5606
|
}
|
|
5546
5607
|
};
|
|
5547
|
-
(0,
|
|
5608
|
+
(0, import_react46.useEffect)(() => {
|
|
5548
5609
|
if (value) {
|
|
5549
5610
|
setInputValue(value);
|
|
5550
5611
|
}
|
|
5551
5612
|
}, [value]);
|
|
5552
|
-
(0,
|
|
5613
|
+
(0, import_react46.useEffect)(() => {
|
|
5553
5614
|
if (asyncOptions && isChanging) {
|
|
5554
5615
|
setIsOpen(!!filteredOptions && filteredOptions.length > 0);
|
|
5555
5616
|
}
|