@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();
|
|
@@ -1163,15 +1182,18 @@ var init_Text = __esm({
|
|
|
1163
1182
|
import_Text = require("@simplybusiness/mobius/src/components/Text/Text.css");
|
|
1164
1183
|
import_jsx_runtime7 = require("react/jsx-runtime");
|
|
1165
1184
|
getElementType = (variant, elementType) => {
|
|
1166
|
-
if (
|
|
1167
|
-
return
|
|
1185
|
+
if (elementType) {
|
|
1186
|
+
return elementType;
|
|
1187
|
+
}
|
|
1188
|
+
if (variant && ["h1", "h2", "h3", "h4"].includes(variant)) {
|
|
1189
|
+
return variant;
|
|
1168
1190
|
}
|
|
1169
|
-
return
|
|
1191
|
+
return "p";
|
|
1170
1192
|
};
|
|
1171
|
-
Text = ({ ref, elementType
|
|
1193
|
+
Text = ({ ref, elementType, ...props }) => {
|
|
1172
1194
|
const { variant, className, spacing, ...otherProps } = props;
|
|
1173
|
-
const
|
|
1174
|
-
const variantType = variant ||
|
|
1195
|
+
const Element = getElementType(variant, elementType);
|
|
1196
|
+
const variantType = variant || Element;
|
|
1175
1197
|
const classes = (0, import_dedupe7.default)(
|
|
1176
1198
|
"mobius",
|
|
1177
1199
|
"mobius-text",
|
|
@@ -1179,7 +1201,7 @@ var init_Text = __esm({
|
|
|
1179
1201
|
{ [`--has-line-height-${spacing}`]: spacing },
|
|
1180
1202
|
className
|
|
1181
1203
|
);
|
|
1182
|
-
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1204
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Element, { ref, ...otherProps, className: classes });
|
|
1183
1205
|
};
|
|
1184
1206
|
Text.displayName = "Text";
|
|
1185
1207
|
}
|
|
@@ -1343,7 +1365,7 @@ var init_Box = __esm({
|
|
|
1343
1365
|
...otherProps
|
|
1344
1366
|
} = props;
|
|
1345
1367
|
const classes = (0, import_dedupe9.default)("mobius", "mobius-box", otherProps.className);
|
|
1346
|
-
const
|
|
1368
|
+
const fromProps = filterUndefinedProps({
|
|
1347
1369
|
padding: getSpacingValue(padding),
|
|
1348
1370
|
paddingInline: getSpacingValue(paddingInline || paddingX),
|
|
1349
1371
|
paddingBlock: getSpacingValue(paddingBlock || paddingY),
|
|
@@ -1356,8 +1378,11 @@ var init_Box = __esm({
|
|
|
1356
1378
|
maxWidth,
|
|
1357
1379
|
maxHeight,
|
|
1358
1380
|
width,
|
|
1359
|
-
height
|
|
1360
|
-
|
|
1381
|
+
height
|
|
1382
|
+
});
|
|
1383
|
+
const styleProps = filterUndefinedProps({
|
|
1384
|
+
...fromProps,
|
|
1385
|
+
...style ? filterUnsetValues(style) : {}
|
|
1361
1386
|
});
|
|
1362
1387
|
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Element, { ref, style: styleProps, ...otherProps, className: classes });
|
|
1363
1388
|
};
|
|
@@ -2461,7 +2486,7 @@ var init_Grid = __esm({
|
|
|
2461
2486
|
import_dedupe23 = __toESM(require("classnames/dedupe"));
|
|
2462
2487
|
init_utils();
|
|
2463
2488
|
import_jsx_runtime29 = require("react/jsx-runtime");
|
|
2464
|
-
Grid = ({ ref
|
|
2489
|
+
Grid = ({ ref, ...props }) => {
|
|
2465
2490
|
const {
|
|
2466
2491
|
columns = 12,
|
|
2467
2492
|
gap,
|
|
@@ -2489,7 +2514,7 @@ var init_Grid = __esm({
|
|
|
2489
2514
|
justifyItems,
|
|
2490
2515
|
...style
|
|
2491
2516
|
});
|
|
2492
|
-
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { style: styles, className: classes, ...rest });
|
|
2517
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { ref, style: styles, className: classes, ...rest });
|
|
2493
2518
|
};
|
|
2494
2519
|
Grid.displayName = "Grid";
|
|
2495
2520
|
}
|
|
@@ -2514,7 +2539,7 @@ var init_Item2 = __esm({
|
|
|
2514
2539
|
{}
|
|
2515
2540
|
);
|
|
2516
2541
|
DEFAULT_SPAN = 12;
|
|
2517
|
-
GridItem = ({ ref
|
|
2542
|
+
GridItem = ({ ref, ...props }) => {
|
|
2518
2543
|
const {
|
|
2519
2544
|
breakpoint: { size: breakpointSize }
|
|
2520
2545
|
} = useBreakpoint();
|
|
@@ -2540,7 +2565,7 @@ var init_Item2 = __esm({
|
|
|
2540
2565
|
xxl
|
|
2541
2566
|
});
|
|
2542
2567
|
const [responsiveSpan, setResponsiveSpan] = (0, import_react21.useState)();
|
|
2543
|
-
const classes = (0, import_dedupe24.default)("mobius-grid__item", className);
|
|
2568
|
+
const classes = (0, import_dedupe24.default)("mobius", "mobius-grid__item", className);
|
|
2544
2569
|
(0, import_react21.useEffect)(() => {
|
|
2545
2570
|
setResponsiveSpan(breakpointMap[breakpointSize]);
|
|
2546
2571
|
}, [breakpointSize, breakpointMap]);
|
|
@@ -2549,7 +2574,7 @@ var init_Item2 = __esm({
|
|
|
2549
2574
|
alignSelf,
|
|
2550
2575
|
justifySelf
|
|
2551
2576
|
};
|
|
2552
|
-
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { style: { ...styles }, className: classes, ...rest });
|
|
2577
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { ref, style: { ...styles }, className: classes, ...rest });
|
|
2553
2578
|
};
|
|
2554
2579
|
GridItem.displayName = "GridItem";
|
|
2555
2580
|
}
|
|
@@ -2695,14 +2720,22 @@ var init_List = __esm({
|
|
|
2695
2720
|
},
|
|
2696
2721
|
otherProps.className
|
|
2697
2722
|
);
|
|
2698
|
-
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
2699
|
-
|
|
2700
|
-
|
|
2701
|
-
|
|
2702
|
-
|
|
2723
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
2724
|
+
Component,
|
|
2725
|
+
{
|
|
2726
|
+
ref,
|
|
2727
|
+
...mappedProps,
|
|
2728
|
+
className: classes,
|
|
2729
|
+
children: import_react22.Children.map(children, (child) => {
|
|
2730
|
+
if ((0, import_react22.isValidElement)(child)) {
|
|
2731
|
+
return (0, import_react22.cloneElement)(child, {
|
|
2732
|
+
parentIcon: icon
|
|
2733
|
+
});
|
|
2734
|
+
}
|
|
2735
|
+
return child;
|
|
2736
|
+
})
|
|
2703
2737
|
}
|
|
2704
|
-
|
|
2705
|
-
}) });
|
|
2738
|
+
);
|
|
2706
2739
|
};
|
|
2707
2740
|
List.displayName = "List";
|
|
2708
2741
|
}
|
|
@@ -2873,7 +2906,10 @@ var init_ModalContext = __esm({
|
|
|
2873
2906
|
ModalContext = (0, import_react23.createContext)({
|
|
2874
2907
|
onClose: () => {
|
|
2875
2908
|
},
|
|
2876
|
-
closeLabel: void 0
|
|
2909
|
+
closeLabel: void 0,
|
|
2910
|
+
titleId: void 0,
|
|
2911
|
+
setTitleId: () => {
|
|
2912
|
+
}
|
|
2877
2913
|
});
|
|
2878
2914
|
}
|
|
2879
2915
|
});
|
|
@@ -2886,54 +2922,68 @@ var init_useModal = __esm({
|
|
|
2886
2922
|
import_react24 = require("react");
|
|
2887
2923
|
init_ModalContext();
|
|
2888
2924
|
useModal = () => {
|
|
2889
|
-
const { onClose, closeLabel } = (0, import_react24.useContext)(ModalContext);
|
|
2890
|
-
return { onClose, closeLabel };
|
|
2925
|
+
const { onClose, closeLabel, titleId, setTitleId } = (0, import_react24.useContext)(ModalContext);
|
|
2926
|
+
return { onClose, closeLabel, titleId, setTitleId };
|
|
2891
2927
|
};
|
|
2892
2928
|
}
|
|
2893
2929
|
});
|
|
2894
2930
|
|
|
2895
2931
|
// src/components/Modal/Header.tsx
|
|
2896
|
-
var import_icons8, import_jsx_runtime39, Header2;
|
|
2932
|
+
var import_react25, import_icons8, import_jsx_runtime39, Header2;
|
|
2897
2933
|
var init_Header2 = __esm({
|
|
2898
2934
|
"src/components/Modal/Header.tsx"() {
|
|
2899
2935
|
"use strict";
|
|
2936
|
+
import_react25 = require("react");
|
|
2900
2937
|
import_icons8 = require("@simplybusiness/icons");
|
|
2901
2938
|
init_Button2();
|
|
2902
2939
|
init_Icon2();
|
|
2903
2940
|
init_useModal();
|
|
2904
2941
|
import_jsx_runtime39 = require("react/jsx-runtime");
|
|
2905
2942
|
Header2 = ({ ref, children, ...otherProps }) => {
|
|
2906
|
-
const { onClose, closeLabel } = useModal();
|
|
2907
|
-
|
|
2908
|
-
|
|
2909
|
-
|
|
2910
|
-
|
|
2911
|
-
|
|
2912
|
-
|
|
2913
|
-
|
|
2914
|
-
|
|
2915
|
-
|
|
2916
|
-
|
|
2917
|
-
|
|
2918
|
-
|
|
2919
|
-
|
|
2920
|
-
|
|
2921
|
-
|
|
2922
|
-
|
|
2923
|
-
|
|
2943
|
+
const { onClose, closeLabel, setTitleId } = useModal();
|
|
2944
|
+
const titleId = (0, import_react25.useId)();
|
|
2945
|
+
(0, import_react25.useEffect)(() => {
|
|
2946
|
+
setTitleId(titleId);
|
|
2947
|
+
}, [titleId, setTitleId]);
|
|
2948
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
|
|
2949
|
+
"header",
|
|
2950
|
+
{
|
|
2951
|
+
ref,
|
|
2952
|
+
...otherProps,
|
|
2953
|
+
className: "mobius-modal__header",
|
|
2954
|
+
id: titleId,
|
|
2955
|
+
children: [
|
|
2956
|
+
children,
|
|
2957
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
|
|
2958
|
+
Button,
|
|
2959
|
+
{
|
|
2960
|
+
"aria-label": "Close",
|
|
2961
|
+
variant: "basic",
|
|
2962
|
+
onPress: onClose,
|
|
2963
|
+
className: "mobius-modal__close",
|
|
2964
|
+
children: [
|
|
2965
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Icon, { icon: import_icons8.cross }),
|
|
2966
|
+
" ",
|
|
2967
|
+
closeLabel
|
|
2968
|
+
]
|
|
2969
|
+
}
|
|
2970
|
+
)
|
|
2971
|
+
]
|
|
2972
|
+
}
|
|
2973
|
+
);
|
|
2924
2974
|
};
|
|
2925
2975
|
Header2.displayName = "Header";
|
|
2926
2976
|
}
|
|
2927
2977
|
});
|
|
2928
2978
|
|
|
2929
2979
|
// src/components/Modal/Modal.tsx
|
|
2930
|
-
var import_dedupe32,
|
|
2980
|
+
var import_dedupe32, import_react26, import_Modal, import_jsx_runtime40, TRANSITION_CSS_VARIABLE2, Modal;
|
|
2931
2981
|
var init_Modal = __esm({
|
|
2932
2982
|
"src/components/Modal/Modal.tsx"() {
|
|
2933
2983
|
"use strict";
|
|
2934
2984
|
"use client";
|
|
2935
2985
|
import_dedupe32 = __toESM(require("classnames/dedupe"));
|
|
2936
|
-
|
|
2986
|
+
import_react26 = require("react");
|
|
2937
2987
|
init_hooks();
|
|
2938
2988
|
init_utils();
|
|
2939
2989
|
init_polyfill_tests();
|
|
@@ -2953,11 +3003,11 @@ var init_Modal = __esm({
|
|
|
2953
3003
|
animation,
|
|
2954
3004
|
...rest
|
|
2955
3005
|
} = props;
|
|
2956
|
-
const [shouldTransition, setShouldTransition] = (0,
|
|
2957
|
-
(0,
|
|
3006
|
+
const [shouldTransition, setShouldTransition] = (0, import_react26.useState)(false);
|
|
3007
|
+
(0, import_react26.useEffect)(() => {
|
|
2958
3008
|
setShouldTransition(supportsDialog());
|
|
2959
3009
|
}, []);
|
|
2960
|
-
const dialogRef = (0,
|
|
3010
|
+
const dialogRef = (0, import_react26.useRef)(null);
|
|
2961
3011
|
const { close } = useDialog({
|
|
2962
3012
|
ref: dialogRef,
|
|
2963
3013
|
isOpen,
|
|
@@ -2981,12 +3031,18 @@ var init_Modal = __esm({
|
|
|
2981
3031
|
},
|
|
2982
3032
|
className
|
|
2983
3033
|
);
|
|
2984
|
-
const
|
|
3034
|
+
const [titleId, setTitleId] = (0, import_react26.useState)(void 0);
|
|
3035
|
+
const handleSetTitleId = (0, import_react26.useCallback)((id) => {
|
|
3036
|
+
setTitleId(id);
|
|
3037
|
+
}, []);
|
|
3038
|
+
const contextValue = (0, import_react26.useMemo)(
|
|
2985
3039
|
() => ({
|
|
2986
3040
|
onClose: close,
|
|
2987
|
-
closeLabel
|
|
3041
|
+
closeLabel,
|
|
3042
|
+
titleId,
|
|
3043
|
+
setTitleId: handleSetTitleId
|
|
2988
3044
|
}),
|
|
2989
|
-
[close, closeLabel]
|
|
3045
|
+
[close, closeLabel, titleId, handleSetTitleId]
|
|
2990
3046
|
);
|
|
2991
3047
|
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
2992
3048
|
"dialog",
|
|
@@ -2994,6 +3050,7 @@ var init_Modal = __esm({
|
|
|
2994
3050
|
ref: mergeRefs([dialogRef, ref]),
|
|
2995
3051
|
onCancel: close,
|
|
2996
3052
|
className: modalClasses,
|
|
3053
|
+
"aria-labelledby": titleId,
|
|
2997
3054
|
...rest,
|
|
2998
3055
|
children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(ModalContext.Provider, { value: contextValue, children })
|
|
2999
3056
|
}
|
|
@@ -3020,13 +3077,13 @@ var init_Modal2 = __esm({
|
|
|
3020
3077
|
});
|
|
3021
3078
|
|
|
3022
3079
|
// src/components/NumberField/NumberField.tsx
|
|
3023
|
-
var import_dedupe33,
|
|
3080
|
+
var import_dedupe33, import_react27, import_NumberField, import_jsx_runtime41, NumberField;
|
|
3024
3081
|
var init_NumberField = __esm({
|
|
3025
3082
|
"src/components/NumberField/NumberField.tsx"() {
|
|
3026
3083
|
"use strict";
|
|
3027
3084
|
"use client";
|
|
3028
3085
|
import_dedupe33 = __toESM(require("classnames/dedupe"));
|
|
3029
|
-
|
|
3086
|
+
import_react27 = require("react");
|
|
3030
3087
|
init_TextField2();
|
|
3031
3088
|
import_NumberField = require("@simplybusiness/mobius/src/components/NumberField/NumberField.css");
|
|
3032
3089
|
import_jsx_runtime41 = require("react/jsx-runtime");
|
|
@@ -3045,9 +3102,9 @@ var init_NumberField = __esm({
|
|
|
3045
3102
|
onBlur: customOnBlur,
|
|
3046
3103
|
...rest
|
|
3047
3104
|
} = otherProps;
|
|
3048
|
-
const focusedInputRef = (0,
|
|
3049
|
-
const wheelHandler = (0,
|
|
3050
|
-
(0,
|
|
3105
|
+
const focusedInputRef = (0, import_react27.useRef)(null);
|
|
3106
|
+
const wheelHandler = (0, import_react27.useCallback)((ev) => ev.preventDefault(), []);
|
|
3107
|
+
(0, import_react27.useEffect)(() => {
|
|
3051
3108
|
return () => {
|
|
3052
3109
|
focusedInputRef.current?.removeEventListener("wheel", wheelHandler);
|
|
3053
3110
|
focusedInputRef.current = null;
|
|
@@ -3179,13 +3236,13 @@ var init_ShowHideButton = __esm({
|
|
|
3179
3236
|
});
|
|
3180
3237
|
|
|
3181
3238
|
// src/components/PasswordField/PasswordField.tsx
|
|
3182
|
-
var import_dedupe34,
|
|
3239
|
+
var import_dedupe34, import_react28, import_PasswordField, import_jsx_runtime44, PasswordField;
|
|
3183
3240
|
var init_PasswordField = __esm({
|
|
3184
3241
|
"src/components/PasswordField/PasswordField.tsx"() {
|
|
3185
3242
|
"use strict";
|
|
3186
3243
|
"use client";
|
|
3187
3244
|
import_dedupe34 = __toESM(require("classnames/dedupe"));
|
|
3188
|
-
|
|
3245
|
+
import_react28 = require("react");
|
|
3189
3246
|
init_mergeRefs();
|
|
3190
3247
|
init_TextField2();
|
|
3191
3248
|
init_ShowHideButton();
|
|
@@ -3197,10 +3254,10 @@ var init_PasswordField = __esm({
|
|
|
3197
3254
|
autoComplete = "current-password",
|
|
3198
3255
|
...props
|
|
3199
3256
|
}) => {
|
|
3200
|
-
const [show, setShow] = (0,
|
|
3257
|
+
const [show, setShow] = (0, import_react28.useState)(false);
|
|
3201
3258
|
const type = show ? "text" : "password";
|
|
3202
3259
|
const classes = (0, import_dedupe34.default)("mobius-password-field", className);
|
|
3203
|
-
const localRef = (0,
|
|
3260
|
+
const localRef = (0, import_react28.useRef)(null);
|
|
3204
3261
|
const handleShowHideButtonClick = () => {
|
|
3205
3262
|
const selectionStart = localRef.current?.selectionStart;
|
|
3206
3263
|
const selectionEnd = localRef.current?.selectionEnd;
|
|
@@ -3237,14 +3294,14 @@ var init_PasswordField2 = __esm({
|
|
|
3237
3294
|
});
|
|
3238
3295
|
|
|
3239
3296
|
// src/components/Popover/Popover.tsx
|
|
3240
|
-
var
|
|
3297
|
+
var import_react29, import_icons10, import_dedupe35, import_react30, import_mobius_hooks4, import_Popover, import_jsx_runtime45;
|
|
3241
3298
|
var init_Popover = __esm({
|
|
3242
3299
|
"src/components/Popover/Popover.tsx"() {
|
|
3243
3300
|
"use strict";
|
|
3244
|
-
|
|
3301
|
+
import_react29 = require("@floating-ui/react");
|
|
3245
3302
|
import_icons10 = require("@simplybusiness/icons");
|
|
3246
3303
|
import_dedupe35 = __toESM(require("classnames/dedupe"));
|
|
3247
|
-
|
|
3304
|
+
import_react30 = require("react");
|
|
3248
3305
|
import_mobius_hooks4 = require("@simplybusiness/mobius-hooks");
|
|
3249
3306
|
import_Popover = require("@simplybusiness/mobius/src/components/Popover/Popover.css");
|
|
3250
3307
|
import_jsx_runtime45 = require("react/jsx-runtime");
|
|
@@ -3271,13 +3328,13 @@ function warnAboutInvalidValues(value, minValue, maxValue) {
|
|
|
3271
3328
|
console.warn("Progress value is greater than maxValue");
|
|
3272
3329
|
}
|
|
3273
3330
|
}
|
|
3274
|
-
var import_dedupe36,
|
|
3331
|
+
var import_dedupe36, import_react31, import_Progress, import_jsx_runtime46, sanitizedValue, getLabelComponent, DEFAULT_VALUE, DEFAULT_MIN_VALUE, DEFAULT_MAX_VALUE, Progress;
|
|
3275
3332
|
var init_Progress = __esm({
|
|
3276
3333
|
"src/components/Progress/Progress.tsx"() {
|
|
3277
3334
|
"use strict";
|
|
3278
3335
|
"use client";
|
|
3279
3336
|
import_dedupe36 = __toESM(require("classnames/dedupe"));
|
|
3280
|
-
|
|
3337
|
+
import_react31 = require("react");
|
|
3281
3338
|
init_Label2();
|
|
3282
3339
|
init_VisuallyHidden2();
|
|
3283
3340
|
import_Progress = require("@simplybusiness/mobius/src/components/Progress/Progress.css");
|
|
@@ -3314,8 +3371,8 @@ var init_Progress = __esm({
|
|
|
3314
3371
|
DEFAULT_MIN_VALUE = 0;
|
|
3315
3372
|
DEFAULT_MAX_VALUE = 100;
|
|
3316
3373
|
Progress = ({ ref, ...props }) => {
|
|
3317
|
-
const progressId = (0,
|
|
3318
|
-
const progressLabelId = (0,
|
|
3374
|
+
const progressId = (0, import_react31.useId)();
|
|
3375
|
+
const progressLabelId = (0, import_react31.useId)();
|
|
3319
3376
|
const {
|
|
3320
3377
|
id,
|
|
3321
3378
|
label,
|
|
@@ -3380,13 +3437,13 @@ var init_Progress2 = __esm({
|
|
|
3380
3437
|
});
|
|
3381
3438
|
|
|
3382
3439
|
// src/components/Radio/Radio.tsx
|
|
3383
|
-
var import_dedupe37,
|
|
3440
|
+
var import_dedupe37, import_react32, import_Radio, import_jsx_runtime47, Radio;
|
|
3384
3441
|
var init_Radio = __esm({
|
|
3385
3442
|
"src/components/Radio/Radio.tsx"() {
|
|
3386
3443
|
"use strict";
|
|
3387
3444
|
"use client";
|
|
3388
3445
|
import_dedupe37 = __toESM(require("classnames/dedupe"));
|
|
3389
|
-
|
|
3446
|
+
import_react32 = require("react");
|
|
3390
3447
|
init_ErrorMessage2();
|
|
3391
3448
|
init_Label2();
|
|
3392
3449
|
import_Radio = require("@simplybusiness/mobius/src/components/Radio/Radio.css");
|
|
@@ -3414,19 +3471,19 @@ var init_Radio = __esm({
|
|
|
3414
3471
|
const isMultiline = label && children;
|
|
3415
3472
|
const isControlled = selected !== void 0;
|
|
3416
3473
|
const isChecked = isControlled ? selected === value : defaultChecked;
|
|
3417
|
-
const contentRef = (0,
|
|
3418
|
-
const prevOverflowRef = (0,
|
|
3474
|
+
const contentRef = (0, import_react32.useRef)(null);
|
|
3475
|
+
const prevOverflowRef = (0, import_react32.useRef)({
|
|
3419
3476
|
vertical: false,
|
|
3420
3477
|
horizontal: false
|
|
3421
3478
|
});
|
|
3422
|
-
const hasIconFirst = (0,
|
|
3423
|
-
if (!children ||
|
|
3424
|
-
const firstChild =
|
|
3425
|
-
if (!(0,
|
|
3479
|
+
const hasIconFirst = (0, import_react32.useMemo)(() => {
|
|
3480
|
+
if (!children || import_react32.Children.count(children) === 0) return false;
|
|
3481
|
+
const firstChild = import_react32.Children.toArray(children)[0];
|
|
3482
|
+
if (!(0, import_react32.isValidElement)(firstChild)) return false;
|
|
3426
3483
|
const props2 = firstChild.props;
|
|
3427
3484
|
return "icon" in props2 && props2.icon !== void 0;
|
|
3428
3485
|
}, [children]);
|
|
3429
|
-
(0,
|
|
3486
|
+
(0, import_react32.useLayoutEffect)(() => {
|
|
3430
3487
|
if (!contentRef.current || !onOverflow) return;
|
|
3431
3488
|
if (orientation === "vertical") {
|
|
3432
3489
|
return;
|
|
@@ -3507,13 +3564,13 @@ var init_Radio = __esm({
|
|
|
3507
3564
|
});
|
|
3508
3565
|
|
|
3509
3566
|
// src/components/Radio/RadioGroup.tsx
|
|
3510
|
-
var import_dedupe38,
|
|
3567
|
+
var import_dedupe38, import_react33, import_jsx_runtime48, getDefaultVal, RadioGroup;
|
|
3511
3568
|
var init_RadioGroup = __esm({
|
|
3512
3569
|
"src/components/Radio/RadioGroup.tsx"() {
|
|
3513
3570
|
"use strict";
|
|
3514
3571
|
"use client";
|
|
3515
3572
|
import_dedupe38 = __toESM(require("classnames/dedupe"));
|
|
3516
|
-
|
|
3573
|
+
import_react33 = require("react");
|
|
3517
3574
|
init_hooks();
|
|
3518
3575
|
init_spaceDelimitedList();
|
|
3519
3576
|
init_ErrorMessage2();
|
|
@@ -3547,15 +3604,15 @@ var init_RadioGroup = __esm({
|
|
|
3547
3604
|
...rest
|
|
3548
3605
|
} = props;
|
|
3549
3606
|
const defaultSelected = getDefaultVal(children, value || defaultValue);
|
|
3550
|
-
const [selected, setSelected] = (0,
|
|
3551
|
-
const overflowsRef = (0,
|
|
3552
|
-
const [hasOverflow, setHasOverflow] = (0,
|
|
3553
|
-
(0,
|
|
3607
|
+
const [selected, setSelected] = (0, import_react33.useState)(defaultSelected);
|
|
3608
|
+
const overflowsRef = (0, import_react33.useRef)({});
|
|
3609
|
+
const [hasOverflow, setHasOverflow] = (0, import_react33.useState)(false);
|
|
3610
|
+
(0, import_react33.useEffect)(() => {
|
|
3554
3611
|
if (value !== void 0) {
|
|
3555
3612
|
setSelected(value);
|
|
3556
3613
|
}
|
|
3557
3614
|
}, [value]);
|
|
3558
|
-
const handleOverflow = (0,
|
|
3615
|
+
const handleOverflow = (0, import_react33.useCallback)(
|
|
3559
3616
|
(radioValue, overflow) => {
|
|
3560
3617
|
overflowsRef.current = {
|
|
3561
3618
|
...overflowsRef.current,
|
|
@@ -3589,15 +3646,15 @@ var init_RadioGroup = __esm({
|
|
|
3589
3646
|
[`--is-${effectiveOrientation}`]: true
|
|
3590
3647
|
});
|
|
3591
3648
|
const labelClasses = (0, import_dedupe38.default)(radioClasses, validationClasses);
|
|
3592
|
-
const errorMessageId = (0,
|
|
3593
|
-
const defaultNameAttrId = (0,
|
|
3649
|
+
const errorMessageId = (0, import_react33.useId)();
|
|
3650
|
+
const defaultNameAttrId = (0, import_react33.useId)();
|
|
3594
3651
|
const nameAttribute = name || defaultNameAttrId;
|
|
3595
3652
|
const shouldErrorMessageShow = errorMessage ? errorMessageId : void 0;
|
|
3596
3653
|
const describedBy = spaceDelimitedList([
|
|
3597
3654
|
shouldErrorMessageShow,
|
|
3598
3655
|
props["aria-describedby"]
|
|
3599
3656
|
]);
|
|
3600
|
-
const labelId = (0,
|
|
3657
|
+
const labelId = (0, import_react33.useId)();
|
|
3601
3658
|
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
3602
3659
|
"div",
|
|
3603
3660
|
{
|
|
@@ -3616,10 +3673,10 @@ var init_RadioGroup = __esm({
|
|
|
3616
3673
|
role: "radiogroup",
|
|
3617
3674
|
children: /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(Stack, { gap: "xs", children: [
|
|
3618
3675
|
label && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Label, { htmlFor: name, id: labelId, className: labelClasses, children: label }),
|
|
3619
|
-
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: radioWrapperClasses, children:
|
|
3620
|
-
if ((0,
|
|
3676
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: radioWrapperClasses, children: import_react33.Children.map(children, (child) => {
|
|
3677
|
+
if ((0, import_react33.isValidElement)(child)) {
|
|
3621
3678
|
const childValue = child.props.value;
|
|
3622
|
-
return (0,
|
|
3679
|
+
return (0, import_react33.cloneElement)(
|
|
3623
3680
|
child,
|
|
3624
3681
|
{
|
|
3625
3682
|
orientation: effectiveOrientation,
|
|
@@ -3686,7 +3743,7 @@ var init_Segment = __esm({
|
|
|
3686
3743
|
import_dedupe40 = __toESM(require("classnames/dedupe"));
|
|
3687
3744
|
import_Segment = require("@simplybusiness/mobius/src/components/Segment/Segment.css");
|
|
3688
3745
|
import_jsx_runtime50 = require("react/jsx-runtime");
|
|
3689
|
-
Segment = (props) => {
|
|
3746
|
+
Segment = ({ ref, ...props }) => {
|
|
3690
3747
|
const { heading, children, colour, inverted, className, ...rest } = props;
|
|
3691
3748
|
const classes = (0, import_dedupe40.default)(
|
|
3692
3749
|
"mobius",
|
|
@@ -3695,7 +3752,7 @@ var init_Segment = __esm({
|
|
|
3695
3752
|
{ inverted },
|
|
3696
3753
|
className
|
|
3697
3754
|
);
|
|
3698
|
-
return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: classes, ...rest, children: [
|
|
3755
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { ref, className: classes, ...rest, children: [
|
|
3699
3756
|
heading && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: "mobius-segment__heading", children: heading }),
|
|
3700
3757
|
children
|
|
3701
3758
|
] });
|
|
@@ -3714,14 +3771,14 @@ var init_Segment2 = __esm({
|
|
|
3714
3771
|
});
|
|
3715
3772
|
|
|
3716
3773
|
// src/components/Select/Select.tsx
|
|
3717
|
-
var import_icons11, import_dedupe41,
|
|
3774
|
+
var import_icons11, import_dedupe41, import_react34, import_Select, import_jsx_runtime51, Select;
|
|
3718
3775
|
var init_Select = __esm({
|
|
3719
3776
|
"src/components/Select/Select.tsx"() {
|
|
3720
3777
|
"use strict";
|
|
3721
3778
|
"use client";
|
|
3722
3779
|
import_icons11 = require("@simplybusiness/icons");
|
|
3723
3780
|
import_dedupe41 = __toESM(require("classnames/dedupe"));
|
|
3724
|
-
|
|
3781
|
+
import_react34 = require("react");
|
|
3725
3782
|
init_hooks();
|
|
3726
3783
|
init_useLabel2();
|
|
3727
3784
|
init_spaceDelimitedList();
|
|
@@ -3768,7 +3825,7 @@ var init_Select = __esm({
|
|
|
3768
3825
|
otherProps.className
|
|
3769
3826
|
);
|
|
3770
3827
|
const iconClasses = (0, import_dedupe41.default)("mobius-select__icon", sharedClasses);
|
|
3771
|
-
const errorMessageId = (0,
|
|
3828
|
+
const errorMessageId = (0, import_react34.useId)();
|
|
3772
3829
|
const shouldErrorMessageShow = errorMessage ? errorMessageId : void 0;
|
|
3773
3830
|
const describedBy = spaceDelimitedList([
|
|
3774
3831
|
shouldErrorMessageShow,
|
|
@@ -3816,13 +3873,13 @@ var init_Select2 = __esm({
|
|
|
3816
3873
|
});
|
|
3817
3874
|
|
|
3818
3875
|
// src/components/Slider/Slider.tsx
|
|
3819
|
-
var import_dedupe42,
|
|
3876
|
+
var import_dedupe42, import_react35, import_Slider, import_jsx_runtime52;
|
|
3820
3877
|
var init_Slider = __esm({
|
|
3821
3878
|
"src/components/Slider/Slider.tsx"() {
|
|
3822
3879
|
"use strict";
|
|
3823
3880
|
"use client";
|
|
3824
3881
|
import_dedupe42 = __toESM(require("classnames/dedupe"));
|
|
3825
|
-
|
|
3882
|
+
import_react35 = require("react");
|
|
3826
3883
|
import_Slider = require("@simplybusiness/mobius/src/components/Slider/Slider.css");
|
|
3827
3884
|
import_jsx_runtime52 = require("react/jsx-runtime");
|
|
3828
3885
|
}
|
|
@@ -3837,17 +3894,17 @@ var init_Slider2 = __esm({
|
|
|
3837
3894
|
});
|
|
3838
3895
|
|
|
3839
3896
|
// src/components/SVG/SVG.tsx
|
|
3840
|
-
var
|
|
3897
|
+
var import_react36, import_dedupe43, import_jsx_runtime53, SVG;
|
|
3841
3898
|
var init_SVG = __esm({
|
|
3842
3899
|
"src/components/SVG/SVG.tsx"() {
|
|
3843
3900
|
"use strict";
|
|
3844
|
-
|
|
3901
|
+
import_react36 = require("react");
|
|
3845
3902
|
import_dedupe43 = __toESM(require("classnames/dedupe"));
|
|
3846
3903
|
import_jsx_runtime53 = require("react/jsx-runtime");
|
|
3847
3904
|
SVG = ({ ref, ...props }) => {
|
|
3848
3905
|
const { children, className, ...otherProps } = props;
|
|
3849
3906
|
const classes = (0, import_dedupe43.default)("mobius", "mobius-svg", className);
|
|
3850
|
-
const svgNode =
|
|
3907
|
+
const svgNode = import_react36.Children.only(children);
|
|
3851
3908
|
const { children: svgChildren, viewBox, xmlns } = svgNode.props;
|
|
3852
3909
|
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
3853
3910
|
"svg",
|
|
@@ -3874,12 +3931,12 @@ var init_SVG2 = __esm({
|
|
|
3874
3931
|
});
|
|
3875
3932
|
|
|
3876
3933
|
// src/components/Switch/Switch.tsx
|
|
3877
|
-
var
|
|
3934
|
+
var import_react37, import_dedupe44, import_Switch, import_jsx_runtime54, Switch;
|
|
3878
3935
|
var init_Switch = __esm({
|
|
3879
3936
|
"src/components/Switch/Switch.tsx"() {
|
|
3880
3937
|
"use strict";
|
|
3881
3938
|
"use client";
|
|
3882
|
-
|
|
3939
|
+
import_react37 = require("react");
|
|
3883
3940
|
import_dedupe44 = __toESM(require("classnames/dedupe"));
|
|
3884
3941
|
init_VisuallyHidden2();
|
|
3885
3942
|
import_Switch = require("@simplybusiness/mobius/src/components/Switch/Switch.css");
|
|
@@ -3892,8 +3949,8 @@ var init_Switch = __esm({
|
|
|
3892
3949
|
isDisabled = false,
|
|
3893
3950
|
...otherProps
|
|
3894
3951
|
} = props;
|
|
3895
|
-
const [enabled, setEnabled] = (0,
|
|
3896
|
-
(0,
|
|
3952
|
+
const [enabled, setEnabled] = (0, import_react37.useState)(checked);
|
|
3953
|
+
(0, import_react37.useEffect)(() => {
|
|
3897
3954
|
setEnabled(checked);
|
|
3898
3955
|
}, [checked]);
|
|
3899
3956
|
const classes = (0, import_dedupe44.default)(
|
|
@@ -4022,13 +4079,13 @@ var init_HeaderCell = __esm({
|
|
|
4022
4079
|
"use strict";
|
|
4023
4080
|
import_dedupe50 = __toESM(require("classnames/dedupe"));
|
|
4024
4081
|
import_jsx_runtime60 = require("react/jsx-runtime");
|
|
4025
|
-
HeaderCell = ({ ref, ...props }) => {
|
|
4082
|
+
HeaderCell = ({ ref, scope = "col", ...props }) => {
|
|
4026
4083
|
const classes = (0, import_dedupe50.default)(
|
|
4027
4084
|
"mobius",
|
|
4028
4085
|
"mobius-table__head-cell",
|
|
4029
4086
|
props.className
|
|
4030
4087
|
);
|
|
4031
|
-
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("th", { ...props, ref, className: classes });
|
|
4088
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("th", { ...props, ref, scope, className: classes });
|
|
4032
4089
|
};
|
|
4033
4090
|
HeaderCell.displayName = "Table.HeaderCell";
|
|
4034
4091
|
}
|
|
@@ -4233,12 +4290,12 @@ var init_Toast = __esm({
|
|
|
4233
4290
|
});
|
|
4234
4291
|
|
|
4235
4292
|
// src/components/Trust/Trust.tsx
|
|
4236
|
-
var import_dedupe55,
|
|
4293
|
+
var import_dedupe55, import_react38, import_jsx_runtime65;
|
|
4237
4294
|
var init_Trust = __esm({
|
|
4238
4295
|
"src/components/Trust/Trust.tsx"() {
|
|
4239
4296
|
"use strict";
|
|
4240
4297
|
import_dedupe55 = __toESM(require("classnames/dedupe"));
|
|
4241
|
-
|
|
4298
|
+
import_react38 = require("react");
|
|
4242
4299
|
import_jsx_runtime65 = require("react/jsx-runtime");
|
|
4243
4300
|
}
|
|
4244
4301
|
});
|
|
@@ -4260,13 +4317,13 @@ var init_Trust2 = __esm({
|
|
|
4260
4317
|
});
|
|
4261
4318
|
|
|
4262
4319
|
// src/components/ExpandableText/ExpandableText.tsx
|
|
4263
|
-
var import_dedupe56,
|
|
4320
|
+
var import_dedupe56, import_react39, import_ExpandableText, import_jsx_runtime66, ExpandableText;
|
|
4264
4321
|
var init_ExpandableText = __esm({
|
|
4265
4322
|
"src/components/ExpandableText/ExpandableText.tsx"() {
|
|
4266
4323
|
"use strict";
|
|
4267
4324
|
"use client";
|
|
4268
4325
|
import_dedupe56 = __toESM(require("classnames/dedupe"));
|
|
4269
|
-
|
|
4326
|
+
import_react39 = require("react");
|
|
4270
4327
|
init_src();
|
|
4271
4328
|
import_ExpandableText = require("@simplybusiness/mobius/src/components/ExpandableText/ExpandableText.css");
|
|
4272
4329
|
import_jsx_runtime66 = require("react/jsx-runtime");
|
|
@@ -4283,14 +4340,14 @@ var init_ExpandableText = __esm({
|
|
|
4283
4340
|
onToggle,
|
|
4284
4341
|
...otherProps
|
|
4285
4342
|
} = props;
|
|
4286
|
-
const [isExpanded, setIsExpanded] = (0,
|
|
4287
|
-
const [isCollapsed, setIsCollapsed] = (0,
|
|
4288
|
-
const textRef = (0,
|
|
4343
|
+
const [isExpanded, setIsExpanded] = (0, import_react39.useState)(false);
|
|
4344
|
+
const [isCollapsed, setIsCollapsed] = (0, import_react39.useState)(false);
|
|
4345
|
+
const textRef = (0, import_react39.useRef)(null);
|
|
4289
4346
|
const { down } = useBreakpoint();
|
|
4290
|
-
const baseId = (0,
|
|
4347
|
+
const baseId = (0, import_react39.useId)();
|
|
4291
4348
|
const expandButtonId = `expandable-text-expand-${baseId}`;
|
|
4292
4349
|
const shouldCollapse = breakpoint ? down(breakpoint) : true;
|
|
4293
|
-
(0,
|
|
4350
|
+
(0, import_react39.useEffect)(() => {
|
|
4294
4351
|
if (!shouldCollapse || !textRef.current) {
|
|
4295
4352
|
setIsCollapsed(false);
|
|
4296
4353
|
return;
|
|
@@ -4367,17 +4424,17 @@ var MaskedField_exports = {};
|
|
|
4367
4424
|
__export(MaskedField_exports, {
|
|
4368
4425
|
MaskedField: () => MaskedField
|
|
4369
4426
|
});
|
|
4370
|
-
var
|
|
4427
|
+
var import_react40, import_react_imask, import_jsx_runtime67, useAcceptHandler, useCombinedRef, useBlurHandler, ControlledMaskedField, UncontrolledMaskedField, MaskedField;
|
|
4371
4428
|
var init_MaskedField = __esm({
|
|
4372
4429
|
"src/components/MaskedField/MaskedField.tsx"() {
|
|
4373
4430
|
"use strict";
|
|
4374
4431
|
"use client";
|
|
4375
|
-
|
|
4432
|
+
import_react40 = require("react");
|
|
4376
4433
|
import_react_imask = require("react-imask");
|
|
4377
4434
|
init_TextField2();
|
|
4378
4435
|
import_jsx_runtime67 = require("react/jsx-runtime");
|
|
4379
4436
|
useAcceptHandler = (onChange, useMaskedValue, name) => {
|
|
4380
|
-
return (0,
|
|
4437
|
+
return (0, import_react40.useCallback)(
|
|
4381
4438
|
(maskedValue, maskInstance) => {
|
|
4382
4439
|
if (!onChange) {
|
|
4383
4440
|
return;
|
|
@@ -4393,7 +4450,7 @@ var init_MaskedField = __esm({
|
|
|
4393
4450
|
);
|
|
4394
4451
|
};
|
|
4395
4452
|
useCombinedRef = (imaskRef, forwardedRef) => {
|
|
4396
|
-
return (0,
|
|
4453
|
+
return (0, import_react40.useCallback)(
|
|
4397
4454
|
(element) => {
|
|
4398
4455
|
imaskRef.current = element;
|
|
4399
4456
|
if (typeof forwardedRef === "function") {
|
|
@@ -4406,7 +4463,7 @@ var init_MaskedField = __esm({
|
|
|
4406
4463
|
);
|
|
4407
4464
|
};
|
|
4408
4465
|
useBlurHandler = (onBlur, maskRef, useMaskedValue, name) => {
|
|
4409
|
-
return (0,
|
|
4466
|
+
return (0, import_react40.useCallback)(
|
|
4410
4467
|
(event) => {
|
|
4411
4468
|
if (!onBlur || !maskRef.current) {
|
|
4412
4469
|
return;
|
|
@@ -4436,7 +4493,7 @@ var init_MaskedField = __esm({
|
|
|
4436
4493
|
const { ref: imaskRef, maskRef, setValue } = (0, import_react_imask.useIMask)(mask, { onAccept });
|
|
4437
4494
|
const combinedRef = useCombinedRef(imaskRef, forwardedRef);
|
|
4438
4495
|
const handleBlur = useBlurHandler(onBlur, maskRef, useMaskedValue, name);
|
|
4439
|
-
(0,
|
|
4496
|
+
(0, import_react40.useEffect)(() => {
|
|
4440
4497
|
if (!maskRef.current) {
|
|
4441
4498
|
return;
|
|
4442
4499
|
}
|
|
@@ -4706,15 +4763,15 @@ var init_ErrorMessage2 = __esm({
|
|
|
4706
4763
|
});
|
|
4707
4764
|
|
|
4708
4765
|
// src/components/TextField/adornmentWithClassName.ts
|
|
4709
|
-
var import_dedupe58,
|
|
4766
|
+
var import_dedupe58, import_react41, adornmentWithClassName;
|
|
4710
4767
|
var init_adornmentWithClassName = __esm({
|
|
4711
4768
|
"src/components/TextField/adornmentWithClassName.ts"() {
|
|
4712
4769
|
"use strict";
|
|
4713
4770
|
import_dedupe58 = __toESM(require("classnames/dedupe"));
|
|
4714
|
-
|
|
4771
|
+
import_react41 = require("react");
|
|
4715
4772
|
adornmentWithClassName = (component, validationClasses, className) => {
|
|
4716
4773
|
if (!component) return null;
|
|
4717
|
-
return (0,
|
|
4774
|
+
return (0, import_react41.cloneElement)(component, {
|
|
4718
4775
|
className: (0, import_dedupe58.default)(
|
|
4719
4776
|
component.props.className,
|
|
4720
4777
|
validationClasses,
|
|
@@ -4874,11 +4931,11 @@ var init_utils2 = __esm({
|
|
|
4874
4931
|
});
|
|
4875
4932
|
|
|
4876
4933
|
// src/components/Combobox/Option.tsx
|
|
4877
|
-
var
|
|
4934
|
+
var import_react42, import_dedupe60, import_jsx_runtime71, Option2;
|
|
4878
4935
|
var init_Option3 = __esm({
|
|
4879
4936
|
"src/components/Combobox/Option.tsx"() {
|
|
4880
4937
|
"use strict";
|
|
4881
|
-
|
|
4938
|
+
import_react42 = require("react");
|
|
4882
4939
|
import_dedupe60 = __toESM(require("classnames/dedupe"));
|
|
4883
4940
|
init_utils2();
|
|
4884
4941
|
import_jsx_runtime71 = require("react/jsx-runtime");
|
|
@@ -4890,13 +4947,13 @@ var init_Option3 = __esm({
|
|
|
4890
4947
|
optionTestIdPrefix,
|
|
4891
4948
|
id
|
|
4892
4949
|
}) => {
|
|
4893
|
-
const optionRef = (0,
|
|
4950
|
+
const optionRef = (0, import_react42.useRef)(null);
|
|
4894
4951
|
const optionValue = getOptionValue(option) || "";
|
|
4895
4952
|
const testId = buildOptionTestId(
|
|
4896
4953
|
optionTestIdPrefix || "combobox-option",
|
|
4897
4954
|
optionValue
|
|
4898
4955
|
);
|
|
4899
|
-
(0,
|
|
4956
|
+
(0, import_react42.useEffect)(() => {
|
|
4900
4957
|
if (isHighlighted && optionRef.current && optionRef.current.scrollIntoView) {
|
|
4901
4958
|
optionRef.current.scrollIntoView({ block: "nearest" });
|
|
4902
4959
|
}
|
|
@@ -5012,10 +5069,10 @@ var init_Listbox = __esm({
|
|
|
5012
5069
|
|
|
5013
5070
|
// src/components/Combobox/useComboboxHighlight.tsx
|
|
5014
5071
|
function useComboboxHighlight(options) {
|
|
5015
|
-
const [highlightedIndex, setHighlightedIndex] = (0,
|
|
5072
|
+
const [highlightedIndex, setHighlightedIndex] = (0, import_react43.useState)(
|
|
5016
5073
|
options && options.length ? 0 : -1
|
|
5017
5074
|
);
|
|
5018
|
-
const [highlightedGroupIndex, setHighlightedGroupIndex] = (0,
|
|
5075
|
+
const [highlightedGroupIndex, setHighlightedGroupIndex] = (0, import_react43.useState)(0);
|
|
5019
5076
|
function highlightNextOption() {
|
|
5020
5077
|
const isGroup = isOptionGroup(options);
|
|
5021
5078
|
if (!options) {
|
|
@@ -5091,11 +5148,11 @@ function useComboboxHighlight(options) {
|
|
|
5091
5148
|
clearHighlight
|
|
5092
5149
|
};
|
|
5093
5150
|
}
|
|
5094
|
-
var
|
|
5151
|
+
var import_react43;
|
|
5095
5152
|
var init_useComboboxHighlight = __esm({
|
|
5096
5153
|
"src/components/Combobox/useComboboxHighlight.tsx"() {
|
|
5097
5154
|
"use strict";
|
|
5098
|
-
|
|
5155
|
+
import_react43 = require("react");
|
|
5099
5156
|
init_utils2();
|
|
5100
5157
|
}
|
|
5101
5158
|
});
|
|
@@ -5110,19 +5167,19 @@ function useComboboxOptions({
|
|
|
5110
5167
|
skipNextDebounceRef,
|
|
5111
5168
|
onSearched
|
|
5112
5169
|
}) {
|
|
5113
|
-
const [filteredOptions, setFilteredOptions] = (0,
|
|
5170
|
+
const [filteredOptions, setFilteredOptions] = (0, import_react44.useState)(void 0);
|
|
5114
5171
|
const debouncedInputValue = (0, import_mobius_hooks5.useDebouncedValue)(
|
|
5115
5172
|
inputValue,
|
|
5116
5173
|
// Don't debounce synchronous options
|
|
5117
5174
|
options ? 0 : delay
|
|
5118
5175
|
);
|
|
5119
|
-
const [isLoading, setIsLoading] = (0,
|
|
5120
|
-
const [error3, setError] = (0,
|
|
5121
|
-
const asyncOptionsRef = (0,
|
|
5176
|
+
const [isLoading, setIsLoading] = (0, import_react44.useState)(false);
|
|
5177
|
+
const [error3, setError] = (0, import_react44.useState)(null);
|
|
5178
|
+
const asyncOptionsRef = (0, import_react44.useRef)(asyncOptions);
|
|
5122
5179
|
asyncOptionsRef.current = asyncOptions;
|
|
5123
|
-
const onSearchedRef = (0,
|
|
5180
|
+
const onSearchedRef = (0, import_react44.useRef)(onSearched);
|
|
5124
5181
|
onSearchedRef.current = onSearched;
|
|
5125
|
-
(0,
|
|
5182
|
+
(0, import_react44.useEffect)(() => {
|
|
5126
5183
|
const controller = new AbortController();
|
|
5127
5184
|
const { signal } = controller;
|
|
5128
5185
|
const fetchOptions = async () => {
|
|
@@ -5180,24 +5237,24 @@ function useComboboxOptions({
|
|
|
5180
5237
|
isError: error3 != null
|
|
5181
5238
|
};
|
|
5182
5239
|
}
|
|
5183
|
-
var import_mobius_hooks5,
|
|
5240
|
+
var import_mobius_hooks5, import_react44;
|
|
5184
5241
|
var init_useComboboxOptions = __esm({
|
|
5185
5242
|
"src/components/Combobox/useComboboxOptions.ts"() {
|
|
5186
5243
|
"use strict";
|
|
5187
5244
|
import_mobius_hooks5 = require("@simplybusiness/mobius-hooks");
|
|
5188
|
-
|
|
5245
|
+
import_react44 = require("react");
|
|
5189
5246
|
init_utils2();
|
|
5190
5247
|
}
|
|
5191
5248
|
});
|
|
5192
5249
|
|
|
5193
5250
|
// src/components/Combobox/Combobox.tsx
|
|
5194
|
-
var import_mobius_hooks6, import_dedupe62,
|
|
5251
|
+
var import_mobius_hooks6, import_dedupe62, import_react45, import_Combobox, import_jsx_runtime73, ComboboxInner, Combobox;
|
|
5195
5252
|
var init_Combobox = __esm({
|
|
5196
5253
|
"src/components/Combobox/Combobox.tsx"() {
|
|
5197
5254
|
"use strict";
|
|
5198
5255
|
import_mobius_hooks6 = require("@simplybusiness/mobius-hooks");
|
|
5199
5256
|
import_dedupe62 = __toESM(require("classnames/dedupe"));
|
|
5200
|
-
|
|
5257
|
+
import_react45 = require("react");
|
|
5201
5258
|
init_hooks();
|
|
5202
5259
|
init_TextField2();
|
|
5203
5260
|
init_VisuallyHidden2();
|
|
@@ -5232,11 +5289,11 @@ var init_Combobox = __esm({
|
|
|
5232
5289
|
errorMessage,
|
|
5233
5290
|
...otherProps
|
|
5234
5291
|
} = props;
|
|
5235
|
-
const skipNextDebounceRef = (0,
|
|
5236
|
-
const fallbackRef = (0,
|
|
5237
|
-
const [inputValue, setInputValue] = (0,
|
|
5238
|
-
const [isOpen, setIsOpen] = (0,
|
|
5239
|
-
const [isChanging, setIsChanging] = (0,
|
|
5292
|
+
const skipNextDebounceRef = (0, import_react45.useRef)(false);
|
|
5293
|
+
const fallbackRef = (0, import_react45.useRef)(null);
|
|
5294
|
+
const [inputValue, setInputValue] = (0, import_react45.useState)(defaultValue || "");
|
|
5295
|
+
const [isOpen, setIsOpen] = (0, import_react45.useState)(false);
|
|
5296
|
+
const [isChanging, setIsChanging] = (0, import_react45.useState)(false);
|
|
5240
5297
|
const { filteredOptions, updateFilteredOptions, isLoading, error: error3 } = useComboboxOptions({
|
|
5241
5298
|
options,
|
|
5242
5299
|
asyncOptions,
|
|
@@ -5245,7 +5302,7 @@ var init_Combobox = __esm({
|
|
|
5245
5302
|
minSearchLength,
|
|
5246
5303
|
skipNextDebounceRef
|
|
5247
5304
|
});
|
|
5248
|
-
const [validationError, setValidationError] = (0,
|
|
5305
|
+
const [validationError, setValidationError] = (0, import_react45.useState)(
|
|
5249
5306
|
error3?.message || errorMessage
|
|
5250
5307
|
);
|
|
5251
5308
|
const {
|
|
@@ -5258,14 +5315,14 @@ var init_Combobox = __esm({
|
|
|
5258
5315
|
clearHighlight
|
|
5259
5316
|
} = useComboboxHighlight(filteredOptions);
|
|
5260
5317
|
const inputRef = ref || fallbackRef;
|
|
5261
|
-
const listboxId = (0,
|
|
5262
|
-
const statusId = (0,
|
|
5263
|
-
const blurTimeoutRef = (0,
|
|
5264
|
-
const userInteractedRef = (0,
|
|
5265
|
-
const justSelectedRef = (0,
|
|
5318
|
+
const listboxId = (0, import_react45.useId)();
|
|
5319
|
+
const statusId = (0, import_react45.useId)();
|
|
5320
|
+
const blurTimeoutRef = (0, import_react45.useRef)(null);
|
|
5321
|
+
const userInteractedRef = (0, import_react45.useRef)(false);
|
|
5322
|
+
const justSelectedRef = (0, import_react45.useRef)(false);
|
|
5266
5323
|
const { down } = useBreakpoint();
|
|
5267
5324
|
const isMobile = down("md");
|
|
5268
|
-
(0,
|
|
5325
|
+
(0, import_react45.useEffect)(() => {
|
|
5269
5326
|
setValidationError(error3?.message || errorMessage);
|
|
5270
5327
|
}, [error3, errorMessage]);
|
|
5271
5328
|
const getEmptyValue = () => {
|
|
@@ -5294,7 +5351,7 @@ var init_Combobox = __esm({
|
|
|
5294
5351
|
justSelectedRef.current = false;
|
|
5295
5352
|
}
|
|
5296
5353
|
};
|
|
5297
|
-
(0,
|
|
5354
|
+
(0, import_react45.useEffect)(() => {
|
|
5298
5355
|
if (!inputRef || typeof inputRef === "function") return;
|
|
5299
5356
|
const inputElement = inputRef.current;
|
|
5300
5357
|
if (!inputElement) return;
|
|
@@ -5447,12 +5504,12 @@ var init_Combobox = __esm({
|
|
|
5447
5504
|
default:
|
|
5448
5505
|
}
|
|
5449
5506
|
};
|
|
5450
|
-
(0,
|
|
5507
|
+
(0, import_react45.useEffect)(() => {
|
|
5451
5508
|
if (value) {
|
|
5452
5509
|
setInputValue(value);
|
|
5453
5510
|
}
|
|
5454
5511
|
}, [value]);
|
|
5455
|
-
(0,
|
|
5512
|
+
(0, import_react45.useEffect)(() => {
|
|
5456
5513
|
if (asyncOptions && isChanging) {
|
|
5457
5514
|
setIsOpen(!!filteredOptions && filteredOptions.length > 0);
|
|
5458
5515
|
}
|
|
@@ -5581,11 +5638,11 @@ function optionsFromResponse({ Items }, addressLookupService) {
|
|
|
5581
5638
|
}
|
|
5582
5639
|
}));
|
|
5583
5640
|
}
|
|
5584
|
-
var import_icons13,
|
|
5641
|
+
var import_icons13, import_react46, import_jsx_runtime74, AddressLookup;
|
|
5585
5642
|
var init_AddressLookup2 = __esm({
|
|
5586
5643
|
"src/components/AddressLookup/AddressLookup.tsx"() {
|
|
5587
5644
|
import_icons13 = require("@simplybusiness/icons");
|
|
5588
|
-
|
|
5645
|
+
import_react46 = require("react");
|
|
5589
5646
|
init_Combobox2();
|
|
5590
5647
|
init_Icon2();
|
|
5591
5648
|
init_utils3();
|
|
@@ -5599,15 +5656,15 @@ var init_AddressLookup2 = __esm({
|
|
|
5599
5656
|
errorMessage,
|
|
5600
5657
|
...otherProps
|
|
5601
5658
|
}) => {
|
|
5602
|
-
const [error3, _setError] = (0,
|
|
5603
|
-
const setError = (0,
|
|
5659
|
+
const [error3, _setError] = (0, import_react46.useState)(null);
|
|
5660
|
+
const setError = (0, import_react46.useCallback)(
|
|
5604
5661
|
(newError) => {
|
|
5605
5662
|
if (newError != null) onError?.(newError);
|
|
5606
5663
|
_setError(newError);
|
|
5607
5664
|
},
|
|
5608
5665
|
[onError]
|
|
5609
5666
|
);
|
|
5610
|
-
const asyncOptions = (0,
|
|
5667
|
+
const asyncOptions = (0, import_react46.useCallback)(
|
|
5611
5668
|
async (searchTerm) => {
|
|
5612
5669
|
try {
|
|
5613
5670
|
const response = await addressLookupService.search(searchTerm);
|
|
@@ -5624,6 +5681,10 @@ var init_AddressLookup2 = __esm({
|
|
|
5624
5681
|
);
|
|
5625
5682
|
const handleSelected = (selected) => {
|
|
5626
5683
|
setError(null);
|
|
5684
|
+
const isEmpty = typeof selected === "string" ? selected === "" : !selected.id && !selected.value;
|
|
5685
|
+
if (isEmpty) {
|
|
5686
|
+
return Promise.resolve();
|
|
5687
|
+
}
|
|
5627
5688
|
if (typeof selected === "string" || !selected.id) {
|
|
5628
5689
|
setError(new Error("Selected option missing id"));
|
|
5629
5690
|
return Promise.resolve();
|