@simplybusiness/mobius 10.4.3 → 10.5.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 +18 -0
- package/dist/cjs/components/AddressLookup/AddressLookup.js +39 -36
- package/dist/cjs/components/AddressLookup/AddressLookup.js.map +3 -3
- package/dist/cjs/components/AddressLookup/LoqateAddressLookupService.js +28 -40
- package/dist/cjs/components/AddressLookup/LoqateAddressLookupService.js.map +1 -1
- package/dist/cjs/components/AddressLookup/index.js +67 -76
- package/dist/cjs/components/AddressLookup/index.js.map +3 -3
- package/dist/cjs/components/Breadcrumbs/Breadcrumbs.js +3 -7
- package/dist/cjs/components/Breadcrumbs/Breadcrumbs.js.map +2 -2
- package/dist/cjs/components/Breadcrumbs/index.js +3 -7
- package/dist/cjs/components/Breadcrumbs/index.js.map +2 -2
- package/dist/cjs/components/Combobox/Combobox.js +35 -32
- package/dist/cjs/components/Combobox/Combobox.js.map +3 -3
- package/dist/cjs/components/Combobox/index.js +35 -32
- package/dist/cjs/components/Combobox/index.js.map +3 -3
- package/dist/cjs/components/DateField/DateField.js +11 -8
- package/dist/cjs/components/DateField/DateField.js.map +3 -3
- package/dist/cjs/components/DateField/index.js +11 -8
- package/dist/cjs/components/DateField/index.js.map +3 -3
- package/dist/cjs/components/DropdownMenu/Item.js +3 -6
- package/dist/cjs/components/DropdownMenu/Item.js.map +2 -2
- package/dist/cjs/components/DropdownMenu/index.js +3 -6
- package/dist/cjs/components/DropdownMenu/index.js.map +2 -2
- package/dist/cjs/components/MaskedField/MaskedField.js +11 -8
- package/dist/cjs/components/MaskedField/MaskedField.js.map +3 -3
- package/dist/cjs/components/MaskedField/index.js +13 -10
- package/dist/cjs/components/MaskedField/index.js.map +3 -3
- package/dist/cjs/components/NumberField/NumberField.js +10 -7
- package/dist/cjs/components/NumberField/NumberField.js.map +3 -3
- package/dist/cjs/components/NumberField/index.js +10 -7
- package/dist/cjs/components/NumberField/index.js.map +3 -3
- package/dist/cjs/components/PasswordField/PasswordField.js +9 -6
- package/dist/cjs/components/PasswordField/PasswordField.js.map +3 -3
- package/dist/cjs/components/PasswordField/index.js +9 -6
- package/dist/cjs/components/PasswordField/index.js.map +3 -3
- package/dist/cjs/components/StickyOnMobile/StickyOnMobile.js +49 -0
- package/dist/cjs/components/StickyOnMobile/StickyOnMobile.js.map +7 -0
- package/dist/cjs/components/StickyOnMobile/index.js +51 -0
- package/dist/cjs/components/StickyOnMobile/index.js.map +7 -0
- package/dist/cjs/components/TextField/TextField.js +6 -3
- package/dist/cjs/components/TextField/TextField.js.map +3 -3
- package/dist/cjs/components/TextField/adornmentWithClassName.js +3 -2
- package/dist/cjs/components/TextField/adornmentWithClassName.js.map +2 -2
- package/dist/cjs/components/TextField/index.js +6 -3
- package/dist/cjs/components/TextField/index.js.map +3 -3
- package/dist/cjs/components/index.js +343 -343
- package/dist/cjs/components/index.js.map +4 -4
- package/dist/cjs/index.js +343 -343
- package/dist/cjs/index.js.map +4 -4
- package/dist/cjs/meta.json +329 -107
- package/dist/esm/{chunk-NEFRXIFY.js → chunk-53QMWUHB.js} +2 -2
- package/dist/esm/chunk-53QMWUHB.js.map +7 -0
- package/dist/esm/{chunk-4HI2AOBC.js → chunk-6TSYA7CJ.js} +4 -7
- package/dist/esm/{chunk-4HI2AOBC.js.map → chunk-6TSYA7CJ.js.map} +2 -2
- package/dist/esm/{chunk-VHAA22YE.js → chunk-A7KFYNH6.js} +1 -3
- package/dist/esm/{chunk-IQKS662C.js → chunk-AKCNBW55.js} +8 -6
- package/dist/esm/chunk-AKCNBW55.js.map +7 -0
- package/dist/esm/{chunk-6JCU4CGA.js → chunk-AZUVQRYC.js} +4 -4
- package/dist/esm/{chunk-XNEQHHNV.js → chunk-C2QJDKXS.js} +2 -2
- package/dist/esm/chunk-CTY6LDFI.js +1 -0
- package/dist/esm/{chunk-KFHPI67N.js → chunk-GJBH37DH.js} +4 -4
- package/dist/esm/{chunk-IM3I5CZL.js → chunk-I6CFRGID.js} +4 -3
- package/dist/esm/{chunk-IM3I5CZL.js.map → chunk-I6CFRGID.js.map} +2 -2
- package/dist/esm/{chunk-LGZWQZLS.js → chunk-IF7FRSC2.js} +2 -2
- package/dist/esm/{chunk-OEDU5ZEA.js → chunk-KUH5AB5T.js} +2 -2
- package/dist/esm/chunk-L2X5IF3K.js +1 -0
- package/dist/esm/chunk-L2X5IF3K.js.map +7 -0
- package/dist/esm/{chunk-2HUMNED2.js → chunk-M3X3ECNH.js} +4 -4
- package/dist/esm/chunk-NXWWQSZA.js +82 -0
- package/dist/esm/{chunk-VVL4B2KD.js.map → chunk-NXWWQSZA.js.map} +1 -1
- package/dist/esm/{chunk-JFDDW3IV.js → chunk-P7TPNRU4.js} +4 -8
- package/dist/esm/{chunk-JFDDW3IV.js.map → chunk-P7TPNRU4.js.map} +2 -2
- package/dist/esm/{chunk-VZ3IWSK6.js → chunk-Q5RB4O4S.js} +7 -7
- package/dist/esm/{chunk-S4CU4XRB.js → chunk-RBB3WHBJ.js} +2 -2
- package/dist/esm/{chunk-GV36OVX7.js → chunk-TQWUPLN6.js} +2 -2
- package/dist/esm/{chunk-X4CMSAET.js → chunk-YEZ6KR3Q.js} +2 -2
- package/dist/esm/chunk-YWFAKGQQ.js +19 -0
- package/dist/esm/chunk-YWFAKGQQ.js.map +7 -0
- package/dist/esm/{chunk-P6YHEIFT.js → chunk-ZLAAOGRQ.js} +4 -4
- package/dist/esm/components/Accordion/Accordion.js +1 -1
- package/dist/esm/components/Accordion/AccordionLink.js +1 -1
- package/dist/esm/components/Accordion/AccordionList.js +1 -1
- package/dist/esm/components/Accordion/index.js +1 -1
- package/dist/esm/components/AddressLookup/AddressLookup.js +7 -7
- package/dist/esm/components/AddressLookup/LoqateAddressLookupError.js +1 -1
- package/dist/esm/components/AddressLookup/LoqateAddressLookupService.js +2 -2
- package/dist/esm/components/AddressLookup/__mocks__/LoqateAddressLookupService.js +1 -1
- package/dist/esm/components/AddressLookup/index.js +10 -10
- package/dist/esm/components/AddressLookup/utils.js +1 -1
- package/dist/esm/components/Alert/Alert.js +1 -1
- package/dist/esm/components/Alert/index.js +1 -1
- package/dist/esm/components/Box/Box.js +1 -1
- package/dist/esm/components/Box/index.js +1 -1
- package/dist/esm/components/Breadcrumbs/BreadcrumbItem.js +1 -1
- package/dist/esm/components/Breadcrumbs/Breadcrumbs.js +2 -2
- package/dist/esm/components/Breadcrumbs/index.js +3 -3
- package/dist/esm/components/Button/Button.js +1 -1
- package/dist/esm/components/Button/Loading.js +1 -1
- package/dist/esm/components/Button/Success.js +1 -1
- package/dist/esm/components/Button/index.js +1 -1
- package/dist/esm/components/Checkbox/Checkbox.js +1 -1
- package/dist/esm/components/Checkbox/CheckboxGroup.js +3 -3
- package/dist/esm/components/Checkbox/index.js +3 -3
- package/dist/esm/components/Combobox/Combobox.js +6 -6
- package/dist/esm/components/Combobox/Listbox.js +1 -1
- package/dist/esm/components/Combobox/Option.js +1 -1
- package/dist/esm/components/Combobox/fixtures.js +1 -1
- package/dist/esm/components/Combobox/index.js +6 -6
- package/dist/esm/components/Combobox/useComboboxHighlight.js +1 -1
- package/dist/esm/components/Combobox/useComboboxOptions.js +1 -1
- package/dist/esm/components/Combobox/utils.js +1 -1
- package/dist/esm/components/Container/Container.js +1 -1
- package/dist/esm/components/Container/index.js +1 -1
- package/dist/esm/components/DateField/DateField.js +6 -6
- package/dist/esm/components/DateField/index.js +6 -6
- package/dist/esm/components/DateField/validation.js +1 -1
- package/dist/esm/components/Divider/Divider.js +1 -1
- package/dist/esm/components/Divider/index.js +1 -1
- package/dist/esm/components/Drawer/Content.js +1 -1
- package/dist/esm/components/Drawer/Drawer.js +1 -1
- package/dist/esm/components/Drawer/DrawerContext.js +1 -1
- package/dist/esm/components/Drawer/Header.js +1 -1
- package/dist/esm/components/Drawer/index.js +4 -4
- package/dist/esm/components/Drawer/useDrawer.js +1 -1
- package/dist/esm/components/DropdownMenu/DropdownMenu.js +1 -1
- package/dist/esm/components/DropdownMenu/Item.js +2 -2
- package/dist/esm/components/DropdownMenu/index.js +3 -3
- package/dist/esm/components/ErrorMessage/ErrorMessage.js +1 -1
- package/dist/esm/components/ErrorMessage/index.js +1 -1
- package/dist/esm/components/ExpandableText/ExpandableText.js +1 -1
- package/dist/esm/components/ExpandableText/index.js +1 -1
- package/dist/esm/components/Fieldset/Fieldset.js +1 -1
- package/dist/esm/components/Fieldset/index.js +1 -1
- package/dist/esm/components/Flex/Flex.js +1 -1
- package/dist/esm/components/Flex/index.js +1 -1
- package/dist/esm/components/Flex/propUtils.js +1 -1
- package/dist/esm/components/Grid/Grid.js +1 -1
- package/dist/esm/components/Grid/Item.js +1 -1
- package/dist/esm/components/Grid/index.js +1 -1
- package/dist/esm/components/Icon/Icon.js +1 -1
- package/dist/esm/components/Icon/index.js +1 -1
- package/dist/esm/components/Image/Image.js +1 -1
- package/dist/esm/components/Image/index.js +1 -1
- package/dist/esm/components/Label/Label.js +1 -1
- package/dist/esm/components/Label/index.js +1 -1
- package/dist/esm/components/Link/Link.js +1 -1
- package/dist/esm/components/Link/index.js +1 -1
- package/dist/esm/components/LinkButton/LinkButton.js +1 -1
- package/dist/esm/components/LinkButton/index.js +1 -1
- package/dist/esm/components/List/List.js +1 -1
- package/dist/esm/components/List/ListItem.js +1 -1
- package/dist/esm/components/List/index.js +1 -1
- package/dist/esm/components/LoadingIndicator/LoadingIndicator.js +1 -1
- package/dist/esm/components/LoadingIndicator/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 +5 -5
- package/dist/esm/components/MaskedField/index.js +6 -6
- package/dist/esm/components/Modal/Content.js +1 -1
- package/dist/esm/components/Modal/Header.js +1 -1
- package/dist/esm/components/Modal/Modal.js +1 -1
- package/dist/esm/components/Modal/ModalContext.js +1 -1
- package/dist/esm/components/Modal/index.js +1 -1
- package/dist/esm/components/Modal/useModal.js +1 -1
- package/dist/esm/components/NumberField/NumberField.js +6 -6
- package/dist/esm/components/NumberField/index.js +6 -6
- package/dist/esm/components/Option/Option.js +1 -1
- package/dist/esm/components/Option/index.js +1 -1
- package/dist/esm/components/PasswordField/PasswordField.js +6 -6
- package/dist/esm/components/PasswordField/ShowHideButton.js +1 -1
- package/dist/esm/components/PasswordField/index.js +6 -6
- package/dist/esm/components/Popover/Arrow.js +1 -1
- package/dist/esm/components/Popover/Popover.js +4 -4
- package/dist/esm/components/Popover/index.js +4 -4
- package/dist/esm/components/Popover/useAutoUpdate.js +1 -1
- package/dist/esm/components/Popover/useFloatingPosition.js +1 -1
- package/dist/esm/components/Popover/useOutsidePress.js +1 -1
- package/dist/esm/components/Progress/Progress.js +1 -1
- package/dist/esm/components/Progress/index.js +1 -1
- package/dist/esm/components/Radio/Radio.js +1 -1
- package/dist/esm/components/Radio/RadioGroup.js +4 -4
- package/dist/esm/components/Radio/index.js +6 -6
- 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/SegmentGroup.js +1 -1
- package/dist/esm/components/Segment/index.js +1 -1
- package/dist/esm/components/Select/Select.js +4 -4
- package/dist/esm/components/Select/index.js +4 -4
- package/dist/esm/components/Slider/Slider.js +1 -1
- package/dist/esm/components/Slider/helpers.js +1 -1
- package/dist/esm/components/Slider/index.js +1 -1
- package/dist/esm/components/Stack/Stack.js +1 -1
- package/dist/esm/components/Stack/index.js +1 -1
- package/dist/esm/components/StickyOnMobile/StickyOnMobile.js +8 -0
- package/dist/esm/components/StickyOnMobile/StickyOnMobile.js.map +7 -0
- package/dist/esm/components/StickyOnMobile/index.js +9 -0
- package/dist/esm/components/StickyOnMobile/index.js.map +7 -0
- package/dist/esm/components/Switch/Switch.js +1 -1
- package/dist/esm/components/Switch/index.js +1 -1
- package/dist/esm/components/Table/Body.js +1 -1
- package/dist/esm/components/Table/Cell.js +1 -1
- package/dist/esm/components/Table/Foot.js +1 -1
- package/dist/esm/components/Table/Head.js +1 -1
- package/dist/esm/components/Table/HeaderCell.js +1 -1
- package/dist/esm/components/Table/Row.js +1 -1
- package/dist/esm/components/Table/Table.js +1 -1
- package/dist/esm/components/Table/index.js +1 -1
- 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 +4 -4
- package/dist/esm/components/TextArea/index.js +4 -4
- package/dist/esm/components/TextAreaInput/TextAreaInput.js +1 -1
- package/dist/esm/components/TextAreaInput/index.js +1 -1
- package/dist/esm/components/TextField/TextField.js +5 -5
- package/dist/esm/components/TextField/adornmentWithClassName.js +2 -2
- package/dist/esm/components/TextField/index.js +5 -5
- package/dist/esm/components/TextOrHTML/TextOrHTML.js +1 -1
- package/dist/esm/components/TextOrHTML/index.js +1 -1
- package/dist/esm/components/Title/Title.js +1 -1
- package/dist/esm/components/Title/index.js +1 -1
- package/dist/esm/components/Toast/Toast.js +1 -1
- package/dist/esm/components/Toast/ToastOptionsDoc.js +1 -1
- package/dist/esm/components/Toast/Toaster.js +1 -1
- package/dist/esm/components/Toast/index.js +1 -1
- package/dist/esm/components/Toast/state.js +1 -1
- package/dist/esm/components/Trust/Trust.js +1 -1
- package/dist/esm/components/Trust/TrustpilotProvider.js +1 -1
- package/dist/esm/components/Trust/constants.js +1 -1
- package/dist/esm/components/Trust/index.js +1 -1
- package/dist/esm/components/VisuallyHidden/VisuallyHidden.js +1 -1
- package/dist/esm/components/VisuallyHidden/index.js +1 -1
- package/dist/esm/components/index.js +68 -63
- package/dist/esm/hooks/index.js +1 -1
- package/dist/esm/hooks/useBreakpoint/index.js +1 -1
- package/dist/esm/hooks/useBreakpoint/useBreakpoint.js +1 -1
- package/dist/esm/hooks/useButton/index.js +1 -1
- package/dist/esm/hooks/useButton/useButton.js +1 -1
- package/dist/esm/hooks/useDialog/index.js +1 -1
- package/dist/esm/hooks/useDialog/useDialog.js +1 -1
- package/dist/esm/hooks/useDialogPolyfill/index.js +1 -1
- package/dist/esm/hooks/useDialogPolyfill/useDialogPolyfill.js +1 -1
- package/dist/esm/hooks/useLabel/index.js +1 -1
- package/dist/esm/hooks/useLabel/useLabel.js +1 -1
- package/dist/esm/hooks/useTextField/index.js +1 -1
- package/dist/esm/hooks/useTextField/useTextField.js +1 -1
- package/dist/esm/hooks/useValidationClasses/index.js +1 -1
- package/dist/esm/hooks/useValidationClasses/useValidationClasses.js +1 -1
- package/dist/esm/index.js +68 -63
- package/dist/esm/meta.json +3460 -3303
- package/dist/esm/utils/StoryContainer.js +1 -1
- package/dist/esm/utils/changeCSS.js +1 -1
- package/dist/esm/utils/colours.js +1 -1
- package/dist/esm/utils/delay.js +1 -1
- package/dist/esm/utils/excludeControls.js +1 -1
- package/dist/esm/utils/filterUndefinedProps.js +1 -1
- package/dist/esm/utils/filterUnsetValues.js +1 -1
- package/dist/esm/utils/getSpacingValue.js +1 -1
- package/dist/esm/utils/htmlDialogPolyfill.js +1 -1
- package/dist/esm/utils/index.js +1 -1
- package/dist/esm/utils/mergeRefs.js +1 -1
- package/dist/esm/utils/mockMatchMedia.js +1 -1
- package/dist/esm/utils/polyfill-tests.js +1 -1
- package/dist/esm/utils/sizeClasses.js +1 -1
- package/dist/esm/utils/sizeOptions.js +1 -1
- package/dist/esm/utils/spaceDelimitedList.js +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/types/components/Accordion/Accordion.d.ts +4 -4
- package/dist/types/components/Accordion/AccordionList.d.ts +4 -4
- package/dist/types/components/AddressLookup/AddressLookup.d.ts +4 -4
- package/dist/types/components/AddressLookup/LoqateAddressLookupService.d.ts +1 -1
- package/dist/types/components/Alert/Alert.d.ts +4 -4
- package/dist/types/components/Box/Box.d.ts +4 -4
- package/dist/types/components/Breadcrumbs/BreadcrumbItem.d.ts +4 -4
- package/dist/types/components/Breadcrumbs/Breadcrumbs.d.ts +4 -4
- package/dist/types/components/Button/Button.d.ts +4 -4
- package/dist/types/components/Checkbox/Checkbox.d.ts +4 -4
- package/dist/types/components/Checkbox/CheckboxGroup.d.ts +4 -4
- package/dist/types/components/Combobox/Combobox.d.ts +2 -5
- package/dist/types/components/Combobox/useComboboxOptions.d.ts +1 -1
- package/dist/types/components/Container/Container.d.ts +4 -4
- package/dist/types/components/DateField/DateField.d.ts +4 -4
- package/dist/types/components/Divider/Divider.d.ts +4 -4
- package/dist/types/components/Drawer/Content.d.ts +4 -4
- package/dist/types/components/Drawer/Drawer.d.ts +4 -4
- package/dist/types/components/Drawer/Header.d.ts +4 -4
- package/dist/types/components/DropdownMenu/DropdownMenu.d.ts +4 -4
- package/dist/types/components/DropdownMenu/Item.d.ts +4 -4
- package/dist/types/components/ErrorMessage/ErrorMessage.d.ts +4 -4
- package/dist/types/components/ExpandableText/ExpandableText.d.ts +4 -4
- package/dist/types/components/Fieldset/Fieldset.d.ts +4 -4
- package/dist/types/components/Flex/Flex.d.ts +4 -4
- package/dist/types/components/Grid/Grid.d.ts +4 -4
- package/dist/types/components/Grid/Item.d.ts +4 -4
- package/dist/types/components/Image/Image.d.ts +4 -4
- package/dist/types/components/Label/Label.d.ts +4 -4
- package/dist/types/components/Link/Link.d.ts +4 -4
- package/dist/types/components/List/List.d.ts +4 -4
- package/dist/types/components/List/ListItem.d.ts +4 -4
- package/dist/types/components/LoadingIndicator/LoadingIndicator.d.ts +4 -4
- package/dist/types/components/Logo/Logo.d.ts +4 -4
- package/dist/types/components/MaskedField/MaskedField.d.ts +4 -4
- package/dist/types/components/Modal/Content.d.ts +4 -4
- package/dist/types/components/Modal/Header.d.ts +4 -4
- package/dist/types/components/Modal/Modal.d.ts +4 -4
- package/dist/types/components/NumberField/NumberField.d.ts +4 -4
- package/dist/types/components/Option/Option.d.ts +4 -4
- package/dist/types/components/PasswordField/PasswordField.d.ts +4 -4
- package/dist/types/components/Progress/Progress.d.ts +4 -4
- package/dist/types/components/Radio/Radio.d.ts +4 -4
- package/dist/types/components/Radio/RadioGroup.d.ts +4 -4
- package/dist/types/components/SVG/SVG.d.ts +4 -4
- package/dist/types/components/Segment/Segment.d.ts +4 -4
- package/dist/types/components/Segment/SegmentGroup.d.ts +4 -4
- package/dist/types/components/Select/Select.d.ts +4 -4
- package/dist/types/components/Stack/Stack.d.ts +4 -4
- package/dist/types/components/StickyOnMobile/StickyOnMobile.d.ts +15 -0
- package/dist/types/components/StickyOnMobile/index.d.ts +1 -0
- package/dist/types/components/Switch/Switch.d.ts +4 -4
- package/dist/types/components/Table/Body.d.ts +4 -4
- package/dist/types/components/Table/Cell.d.ts +4 -4
- package/dist/types/components/Table/Foot.d.ts +4 -4
- package/dist/types/components/Table/Head.d.ts +4 -4
- package/dist/types/components/Table/HeaderCell.d.ts +4 -4
- package/dist/types/components/Table/Row.d.ts +4 -4
- package/dist/types/components/Table/Table.d.ts +4 -4
- package/dist/types/components/Text/Text.d.ts +4 -4
- package/dist/types/components/TextArea/TextArea.d.ts +4 -4
- package/dist/types/components/TextAreaInput/TextAreaInput.d.ts +4 -4
- package/dist/types/components/TextField/TextField.d.ts +1 -4
- package/dist/types/components/TextField/adornmentWithClassName.d.ts +3 -1
- package/dist/types/components/TextOrHTML/TextOrHTML.d.ts +4 -4
- package/dist/types/components/Title/Title.d.ts +4 -4
- package/dist/types/components/Toast/ToastOptionsDoc.d.ts +4 -8
- package/dist/types/components/Toast/Toaster.d.ts +4 -4
- package/dist/types/components/index.d.ts +1 -0
- package/dist/types/hooks/useButton/useButton.d.ts +5 -5
- package/dist/types/hooks/useLabel/useLabel.d.ts +1 -1
- package/package.json +22 -21
- package/src/components/Box/Box.test.tsx +1 -2
- package/src/components/Breadcrumbs/Breadcrumbs.tsx +3 -7
- package/src/components/Button/Button.stories.tsx +1 -1
- package/src/components/Combobox/Combobox.tsx +2 -4
- package/src/components/DropdownMenu/DropdownMenu.stories.tsx +1 -1
- package/src/components/DropdownMenu/Item.tsx +3 -6
- package/src/components/Grid/Grid.stories.tsx +1 -1
- package/src/components/StickyOnMobile/StickyOnMobile.css +19 -0
- package/src/components/StickyOnMobile/StickyOnMobile.mdx +52 -0
- package/src/components/StickyOnMobile/StickyOnMobile.stories.tsx +99 -0
- package/src/components/StickyOnMobile/StickyOnMobile.test.tsx +100 -0
- package/src/components/StickyOnMobile/StickyOnMobile.tsx +37 -0
- package/src/components/StickyOnMobile/index.tsx +1 -0
- package/src/components/TextField/TextField.tsx +3 -1
- package/src/components/TextField/adornmentWithClassName.ts +4 -3
- package/src/components/index.tsx +1 -0
- package/src/hooks/useBreakpoint/useBreakpoint.test.tsx +4 -4
- package/src/styles.d.ts +2 -0
- package/dist/esm/chunk-IQKS662C.js.map +0 -7
- package/dist/esm/chunk-NEFRXIFY.js.map +0 -7
- package/dist/esm/chunk-NOQ27VLY.js +0 -1
- package/dist/esm/chunk-VVL4B2KD.js +0 -92
- /package/dist/esm/{chunk-NOQ27VLY.js.map → chunk-A7KFYNH6.js.map} +0 -0
- /package/dist/esm/{chunk-6JCU4CGA.js.map → chunk-AZUVQRYC.js.map} +0 -0
- /package/dist/esm/{chunk-XNEQHHNV.js.map → chunk-C2QJDKXS.js.map} +0 -0
- /package/dist/esm/{chunk-VHAA22YE.js.map → chunk-CTY6LDFI.js.map} +0 -0
- /package/dist/esm/{chunk-KFHPI67N.js.map → chunk-GJBH37DH.js.map} +0 -0
- /package/dist/esm/{chunk-LGZWQZLS.js.map → chunk-IF7FRSC2.js.map} +0 -0
- /package/dist/esm/{chunk-OEDU5ZEA.js.map → chunk-KUH5AB5T.js.map} +0 -0
- /package/dist/esm/{chunk-2HUMNED2.js.map → chunk-M3X3ECNH.js.map} +0 -0
- /package/dist/esm/{chunk-VZ3IWSK6.js.map → chunk-Q5RB4O4S.js.map} +0 -0
- /package/dist/esm/{chunk-S4CU4XRB.js.map → chunk-RBB3WHBJ.js.map} +0 -0
- /package/dist/esm/{chunk-GV36OVX7.js.map → chunk-TQWUPLN6.js.map} +0 -0
- /package/dist/esm/{chunk-X4CMSAET.js.map → chunk-YEZ6KR3Q.js.map} +0 -0
- /package/dist/esm/{chunk-P6YHEIFT.js.map → chunk-ZLAAOGRQ.js.map} +0 -0
|
@@ -5,9 +5,6 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
5
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
6
|
var __getProtoOf = Object.getPrototypeOf;
|
|
7
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __typeError = (msg) => {
|
|
9
|
-
throw TypeError(msg);
|
|
10
|
-
};
|
|
11
8
|
var __esm = (fn, res) => function __init() {
|
|
12
9
|
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
13
10
|
};
|
|
@@ -32,10 +29,6 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
32
29
|
mod
|
|
33
30
|
));
|
|
34
31
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
35
|
-
var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
|
|
36
|
-
var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
37
|
-
var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
38
|
-
var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
|
|
39
32
|
|
|
40
33
|
// src/utils/changeCSS.ts
|
|
41
34
|
var init_changeCSS = __esm({
|
|
@@ -945,9 +938,10 @@ var init_adornmentWithClassName = __esm({
|
|
|
945
938
|
import_react10 = require("react");
|
|
946
939
|
adornmentWithClassName = (component, validationClasses, className) => {
|
|
947
940
|
if (!component) return null;
|
|
948
|
-
|
|
941
|
+
const typedComponent = component;
|
|
942
|
+
return (0, import_react10.cloneElement)(typedComponent, {
|
|
949
943
|
className: (0, import_dedupe12.default)(
|
|
950
|
-
|
|
944
|
+
typedComponent.props.className,
|
|
951
945
|
validationClasses,
|
|
952
946
|
className
|
|
953
947
|
)
|
|
@@ -957,12 +951,13 @@ var init_adornmentWithClassName = __esm({
|
|
|
957
951
|
});
|
|
958
952
|
|
|
959
953
|
// src/components/TextField/TextField.tsx
|
|
960
|
-
var import_dedupe13, import_TextField, import_jsx_runtime12, TextField;
|
|
954
|
+
var import_dedupe13, import_react11, import_TextField, import_jsx_runtime12, TextFieldInner, TextField;
|
|
961
955
|
var init_TextField = __esm({
|
|
962
956
|
"src/components/TextField/TextField.tsx"() {
|
|
963
957
|
"use strict";
|
|
964
958
|
"use client";
|
|
965
959
|
import_dedupe13 = __toESM(require("classnames/dedupe"));
|
|
960
|
+
import_react11 = require("react");
|
|
966
961
|
init_hooks();
|
|
967
962
|
init_ErrorMessage2();
|
|
968
963
|
init_Label2();
|
|
@@ -970,7 +965,7 @@ var init_TextField = __esm({
|
|
|
970
965
|
init_adornmentWithClassName();
|
|
971
966
|
import_TextField = require("@simplybusiness/mobius/src/components/TextField/TextField.css");
|
|
972
967
|
import_jsx_runtime12 = require("react/jsx-runtime");
|
|
973
|
-
|
|
968
|
+
TextFieldInner = ({ ref, ...props }) => {
|
|
974
969
|
const {
|
|
975
970
|
isDisabled,
|
|
976
971
|
type = "text",
|
|
@@ -1064,6 +1059,7 @@ var init_TextField = __esm({
|
|
|
1064
1059
|
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(ErrorMessage, { ...errorMessageProps, errorMessage })
|
|
1065
1060
|
] });
|
|
1066
1061
|
};
|
|
1062
|
+
TextField = (0, import_react11.memo)(TextFieldInner);
|
|
1067
1063
|
TextField.displayName = "TextField";
|
|
1068
1064
|
}
|
|
1069
1065
|
});
|
|
@@ -1081,17 +1077,17 @@ var MaskedField_exports = {};
|
|
|
1081
1077
|
__export(MaskedField_exports, {
|
|
1082
1078
|
MaskedField: () => MaskedField
|
|
1083
1079
|
});
|
|
1084
|
-
var
|
|
1080
|
+
var import_react51, import_react_imask, import_jsx_runtime77, useAcceptHandler, useCombinedRef, useBlurHandler, ControlledMaskedField, UncontrolledMaskedField, MaskedField;
|
|
1085
1081
|
var init_MaskedField = __esm({
|
|
1086
1082
|
"src/components/MaskedField/MaskedField.tsx"() {
|
|
1087
1083
|
"use strict";
|
|
1088
1084
|
"use client";
|
|
1089
|
-
|
|
1085
|
+
import_react51 = require("react");
|
|
1090
1086
|
import_react_imask = require("react-imask");
|
|
1091
1087
|
init_TextField2();
|
|
1092
|
-
|
|
1088
|
+
import_jsx_runtime77 = require("react/jsx-runtime");
|
|
1093
1089
|
useAcceptHandler = (onChange, useMaskedValue, name) => {
|
|
1094
|
-
return (0,
|
|
1090
|
+
return (0, import_react51.useCallback)(
|
|
1095
1091
|
(maskedValue, maskInstance) => {
|
|
1096
1092
|
if (!onChange) {
|
|
1097
1093
|
return;
|
|
@@ -1107,7 +1103,7 @@ var init_MaskedField = __esm({
|
|
|
1107
1103
|
);
|
|
1108
1104
|
};
|
|
1109
1105
|
useCombinedRef = (imaskRef, forwardedRef) => {
|
|
1110
|
-
return (0,
|
|
1106
|
+
return (0, import_react51.useCallback)(
|
|
1111
1107
|
(element) => {
|
|
1112
1108
|
imaskRef.current = element;
|
|
1113
1109
|
if (typeof forwardedRef === "function") {
|
|
@@ -1120,7 +1116,7 @@ var init_MaskedField = __esm({
|
|
|
1120
1116
|
);
|
|
1121
1117
|
};
|
|
1122
1118
|
useBlurHandler = (onBlur, maskRef, useMaskedValue, name) => {
|
|
1123
|
-
return (0,
|
|
1119
|
+
return (0, import_react51.useCallback)(
|
|
1124
1120
|
(event) => {
|
|
1125
1121
|
if (!onBlur || !maskRef.current) {
|
|
1126
1122
|
return;
|
|
@@ -1150,7 +1146,7 @@ var init_MaskedField = __esm({
|
|
|
1150
1146
|
const { ref: imaskRef, maskRef, setValue } = (0, import_react_imask.useIMask)(mask, { onAccept });
|
|
1151
1147
|
const combinedRef = useCombinedRef(imaskRef, forwardedRef);
|
|
1152
1148
|
const handleBlur = useBlurHandler(onBlur, maskRef, useMaskedValue, name);
|
|
1153
|
-
(0,
|
|
1149
|
+
(0, import_react51.useEffect)(() => {
|
|
1154
1150
|
if (!maskRef.current) {
|
|
1155
1151
|
return;
|
|
1156
1152
|
}
|
|
@@ -1161,7 +1157,7 @@ var init_MaskedField = __esm({
|
|
|
1161
1157
|
setValue(stringValue);
|
|
1162
1158
|
}
|
|
1163
1159
|
}, [value, maskRef, setValue, imaskRef]);
|
|
1164
|
-
return /* @__PURE__ */ (0,
|
|
1160
|
+
return /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
1165
1161
|
TextField,
|
|
1166
1162
|
{
|
|
1167
1163
|
...textFieldProps,
|
|
@@ -1185,7 +1181,7 @@ var init_MaskedField = __esm({
|
|
|
1185
1181
|
const { ref: imaskRef, maskRef } = (0, import_react_imask.useIMask)(mask, { onAccept });
|
|
1186
1182
|
const combinedRef = useCombinedRef(imaskRef, forwardedRef);
|
|
1187
1183
|
const handleBlur = useBlurHandler(onBlur, maskRef, useMaskedValue, name);
|
|
1188
|
-
return /* @__PURE__ */ (0,
|
|
1184
|
+
return /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
1189
1185
|
TextField,
|
|
1190
1186
|
{
|
|
1191
1187
|
...textFieldProps,
|
|
@@ -1199,7 +1195,7 @@ var init_MaskedField = __esm({
|
|
|
1199
1195
|
MaskedField = ({ ref: forwardedRef, ...props }) => {
|
|
1200
1196
|
const { value, defaultValue, ...rest } = props;
|
|
1201
1197
|
if ("value" in props) {
|
|
1202
|
-
return /* @__PURE__ */ (0,
|
|
1198
|
+
return /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
1203
1199
|
ControlledMaskedField,
|
|
1204
1200
|
{
|
|
1205
1201
|
...rest,
|
|
@@ -1208,7 +1204,7 @@ var init_MaskedField = __esm({
|
|
|
1208
1204
|
}
|
|
1209
1205
|
);
|
|
1210
1206
|
} else {
|
|
1211
|
-
return /* @__PURE__ */ (0,
|
|
1207
|
+
return /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
1212
1208
|
UncontrolledMaskedField,
|
|
1213
1209
|
{
|
|
1214
1210
|
...rest,
|
|
@@ -1272,6 +1268,7 @@ __export(components_exports, {
|
|
|
1272
1268
|
Select: () => Select,
|
|
1273
1269
|
Slider: () => Slider,
|
|
1274
1270
|
Stack: () => Stack,
|
|
1271
|
+
StickyOnMobile: () => StickyOnMobile,
|
|
1275
1272
|
Switch: () => Switch,
|
|
1276
1273
|
Table: () => Table2,
|
|
1277
1274
|
Text: () => Text,
|
|
@@ -1662,12 +1659,12 @@ AccordionList.displayName = "AccordionList";
|
|
|
1662
1659
|
|
|
1663
1660
|
// src/components/AddressLookup/AddressLookup.tsx
|
|
1664
1661
|
var import_icons3 = require("@simplybusiness/icons");
|
|
1665
|
-
var
|
|
1662
|
+
var import_react16 = require("react");
|
|
1666
1663
|
|
|
1667
1664
|
// src/components/Combobox/Combobox.tsx
|
|
1668
1665
|
var import_mobius_hooks5 = require("@simplybusiness/mobius-hooks");
|
|
1669
1666
|
var import_dedupe16 = __toESM(require("classnames/dedupe"));
|
|
1670
|
-
var
|
|
1667
|
+
var import_react15 = require("react");
|
|
1671
1668
|
init_hooks();
|
|
1672
1669
|
init_TextField2();
|
|
1673
1670
|
|
|
@@ -1706,7 +1703,7 @@ function VisuallyHidden(props) {
|
|
|
1706
1703
|
var import_dedupe15 = __toESM(require("classnames/dedupe"));
|
|
1707
1704
|
|
|
1708
1705
|
// src/components/Combobox/Option.tsx
|
|
1709
|
-
var
|
|
1706
|
+
var import_react12 = require("react");
|
|
1710
1707
|
var import_dedupe14 = __toESM(require("classnames/dedupe"));
|
|
1711
1708
|
|
|
1712
1709
|
// src/components/Combobox/utils.tsx
|
|
@@ -1741,13 +1738,13 @@ var Option = ({
|
|
|
1741
1738
|
optionTestIdPrefix,
|
|
1742
1739
|
id
|
|
1743
1740
|
}) => {
|
|
1744
|
-
const optionRef = (0,
|
|
1741
|
+
const optionRef = (0, import_react12.useRef)(null);
|
|
1745
1742
|
const optionValue = getOptionValue(option) || "";
|
|
1746
1743
|
const testId = buildOptionTestId(
|
|
1747
1744
|
optionTestIdPrefix || "combobox-option",
|
|
1748
1745
|
optionValue
|
|
1749
1746
|
);
|
|
1750
|
-
(0,
|
|
1747
|
+
(0, import_react12.useEffect)(() => {
|
|
1751
1748
|
if (isHighlighted && optionRef.current && optionRef.current.scrollIntoView) {
|
|
1752
1749
|
optionRef.current.scrollIntoView({ block: "nearest" });
|
|
1753
1750
|
}
|
|
@@ -1851,12 +1848,12 @@ var Listbox = ({
|
|
|
1851
1848
|
};
|
|
1852
1849
|
|
|
1853
1850
|
// src/components/Combobox/useComboboxHighlight.tsx
|
|
1854
|
-
var
|
|
1851
|
+
var import_react13 = require("react");
|
|
1855
1852
|
function useComboboxHighlight(options) {
|
|
1856
|
-
const [highlightedIndex, setHighlightedIndex] = (0,
|
|
1853
|
+
const [highlightedIndex, setHighlightedIndex] = (0, import_react13.useState)(
|
|
1857
1854
|
options && options.length ? 0 : -1
|
|
1858
1855
|
);
|
|
1859
|
-
const [highlightedGroupIndex, setHighlightedGroupIndex] = (0,
|
|
1856
|
+
const [highlightedGroupIndex, setHighlightedGroupIndex] = (0, import_react13.useState)(0);
|
|
1860
1857
|
function highlightNextOption() {
|
|
1861
1858
|
const isGroup = isOptionGroup(options);
|
|
1862
1859
|
if (!options) {
|
|
@@ -1935,7 +1932,7 @@ function useComboboxHighlight(options) {
|
|
|
1935
1932
|
|
|
1936
1933
|
// src/components/Combobox/useComboboxOptions.ts
|
|
1937
1934
|
var import_mobius_hooks4 = require("@simplybusiness/mobius-hooks");
|
|
1938
|
-
var
|
|
1935
|
+
var import_react14 = require("react");
|
|
1939
1936
|
function useComboboxOptions({
|
|
1940
1937
|
options,
|
|
1941
1938
|
asyncOptions,
|
|
@@ -1945,19 +1942,19 @@ function useComboboxOptions({
|
|
|
1945
1942
|
skipNextDebounceRef,
|
|
1946
1943
|
onSearched
|
|
1947
1944
|
}) {
|
|
1948
|
-
const [filteredOptions, setFilteredOptions] = (0,
|
|
1945
|
+
const [filteredOptions, setFilteredOptions] = (0, import_react14.useState)(void 0);
|
|
1949
1946
|
const debouncedInputValue = (0, import_mobius_hooks4.useDebouncedValue)(
|
|
1950
1947
|
inputValue,
|
|
1951
1948
|
// Don't debounce synchronous options
|
|
1952
1949
|
options ? 0 : delay
|
|
1953
1950
|
);
|
|
1954
|
-
const [isLoading, setIsLoading] = (0,
|
|
1955
|
-
const [error3, setError] = (0,
|
|
1956
|
-
const asyncOptionsRef = (0,
|
|
1951
|
+
const [isLoading, setIsLoading] = (0, import_react14.useState)(false);
|
|
1952
|
+
const [error3, setError] = (0, import_react14.useState)(null);
|
|
1953
|
+
const asyncOptionsRef = (0, import_react14.useRef)(asyncOptions);
|
|
1957
1954
|
asyncOptionsRef.current = asyncOptions;
|
|
1958
|
-
const onSearchedRef = (0,
|
|
1955
|
+
const onSearchedRef = (0, import_react14.useRef)(onSearched);
|
|
1959
1956
|
onSearchedRef.current = onSearched;
|
|
1960
|
-
(0,
|
|
1957
|
+
(0, import_react14.useEffect)(() => {
|
|
1961
1958
|
const controller = new AbortController();
|
|
1962
1959
|
const { signal } = controller;
|
|
1963
1960
|
const fetchOptions = async () => {
|
|
@@ -2044,11 +2041,11 @@ var ComboboxInner = ({
|
|
|
2044
2041
|
errorMessage,
|
|
2045
2042
|
...otherProps
|
|
2046
2043
|
} = props;
|
|
2047
|
-
const skipNextDebounceRef = (0,
|
|
2048
|
-
const fallbackRef = (0,
|
|
2049
|
-
const [inputValue, setInputValue] = (0,
|
|
2050
|
-
const [isOpen, setIsOpen] = (0,
|
|
2051
|
-
const [isChanging, setIsChanging] = (0,
|
|
2044
|
+
const skipNextDebounceRef = (0, import_react15.useRef)(false);
|
|
2045
|
+
const fallbackRef = (0, import_react15.useRef)(null);
|
|
2046
|
+
const [inputValue, setInputValue] = (0, import_react15.useState)(defaultValue || "");
|
|
2047
|
+
const [isOpen, setIsOpen] = (0, import_react15.useState)(false);
|
|
2048
|
+
const [isChanging, setIsChanging] = (0, import_react15.useState)(false);
|
|
2052
2049
|
const { filteredOptions, updateFilteredOptions, isLoading, error: error3 } = useComboboxOptions({
|
|
2053
2050
|
options,
|
|
2054
2051
|
asyncOptions,
|
|
@@ -2057,7 +2054,7 @@ var ComboboxInner = ({
|
|
|
2057
2054
|
minSearchLength,
|
|
2058
2055
|
skipNextDebounceRef
|
|
2059
2056
|
});
|
|
2060
|
-
const [validationError, setValidationError] = (0,
|
|
2057
|
+
const [validationError, setValidationError] = (0, import_react15.useState)(
|
|
2061
2058
|
error3?.message || errorMessage
|
|
2062
2059
|
);
|
|
2063
2060
|
const {
|
|
@@ -2070,14 +2067,14 @@ var ComboboxInner = ({
|
|
|
2070
2067
|
clearHighlight
|
|
2071
2068
|
} = useComboboxHighlight(filteredOptions);
|
|
2072
2069
|
const inputRef = ref || fallbackRef;
|
|
2073
|
-
const listboxId = (0,
|
|
2074
|
-
const statusId = (0,
|
|
2075
|
-
const blurTimeoutRef = (0,
|
|
2076
|
-
const userInteractedRef = (0,
|
|
2077
|
-
const justSelectedRef = (0,
|
|
2070
|
+
const listboxId = (0, import_react15.useId)();
|
|
2071
|
+
const statusId = (0, import_react15.useId)();
|
|
2072
|
+
const blurTimeoutRef = (0, import_react15.useRef)(null);
|
|
2073
|
+
const userInteractedRef = (0, import_react15.useRef)(false);
|
|
2074
|
+
const justSelectedRef = (0, import_react15.useRef)(false);
|
|
2078
2075
|
const { down } = useBreakpoint();
|
|
2079
2076
|
const isMobile = down("md");
|
|
2080
|
-
(0,
|
|
2077
|
+
(0, import_react15.useEffect)(() => {
|
|
2081
2078
|
setValidationError(error3?.message || errorMessage);
|
|
2082
2079
|
}, [error3, errorMessage]);
|
|
2083
2080
|
const getEmptyValue = () => {
|
|
@@ -2106,7 +2103,7 @@ var ComboboxInner = ({
|
|
|
2106
2103
|
justSelectedRef.current = false;
|
|
2107
2104
|
}
|
|
2108
2105
|
};
|
|
2109
|
-
(0,
|
|
2106
|
+
(0, import_react15.useEffect)(() => {
|
|
2110
2107
|
if (!inputRef || typeof inputRef === "function") return;
|
|
2111
2108
|
const inputElement = inputRef.current;
|
|
2112
2109
|
if (!inputElement) return;
|
|
@@ -2259,12 +2256,12 @@ var ComboboxInner = ({
|
|
|
2259
2256
|
default:
|
|
2260
2257
|
}
|
|
2261
2258
|
};
|
|
2262
|
-
(0,
|
|
2259
|
+
(0, import_react15.useEffect)(() => {
|
|
2263
2260
|
if (value) {
|
|
2264
2261
|
setInputValue(value);
|
|
2265
2262
|
}
|
|
2266
2263
|
}, [value]);
|
|
2267
|
-
(0,
|
|
2264
|
+
(0, import_react15.useEffect)(() => {
|
|
2268
2265
|
if (asyncOptions && isChanging) {
|
|
2269
2266
|
setIsOpen(!!filteredOptions && filteredOptions.length > 0);
|
|
2270
2267
|
}
|
|
@@ -2378,15 +2375,15 @@ var AddressLookup = ({
|
|
|
2378
2375
|
errorMessage,
|
|
2379
2376
|
...otherProps
|
|
2380
2377
|
}) => {
|
|
2381
|
-
const [error3, _setError] = (0,
|
|
2382
|
-
const setError = (0,
|
|
2378
|
+
const [error3, _setError] = (0, import_react16.useState)(null);
|
|
2379
|
+
const setError = (0, import_react16.useCallback)(
|
|
2383
2380
|
(newError) => {
|
|
2384
2381
|
if (newError != null) onError?.(newError);
|
|
2385
2382
|
_setError(newError);
|
|
2386
2383
|
},
|
|
2387
2384
|
[onError]
|
|
2388
2385
|
);
|
|
2389
|
-
const asyncOptions = (0,
|
|
2386
|
+
const asyncOptions = (0, import_react16.useCallback)(
|
|
2390
2387
|
async (searchTerm) => {
|
|
2391
2388
|
try {
|
|
2392
2389
|
const response = await addressLookupService.search(searchTerm);
|
|
@@ -2442,39 +2439,38 @@ var LOQATE_BASE_URL = "https://api.addressy.com/Capture/Interactive";
|
|
|
2442
2439
|
var LOQATE_FIND_URL = "/Find/v1.00/json3.ws";
|
|
2443
2440
|
var LOQATE_RETRIEVE_URL = "/Retrieve/v1.2/json3.ws";
|
|
2444
2441
|
var DEFAULT_COUNTRIES = ["GB"];
|
|
2445
|
-
var _baseUrl, _apiKey, _countries, _filters;
|
|
2446
2442
|
var LoqateAddressLookupService = class {
|
|
2443
|
+
/**
|
|
2444
|
+
* Base URL for the Loqate API
|
|
2445
|
+
*/
|
|
2446
|
+
#baseUrl;
|
|
2447
|
+
/**
|
|
2448
|
+
* API key for the Loqate API
|
|
2449
|
+
*/
|
|
2450
|
+
#apiKey;
|
|
2451
|
+
/**
|
|
2452
|
+
* List of allowed country codes for the Loqate API
|
|
2453
|
+
* 2 or 3 character ISO country codes
|
|
2454
|
+
*/
|
|
2455
|
+
#countries;
|
|
2456
|
+
/**
|
|
2457
|
+
* Optional filters for the Loqate API
|
|
2458
|
+
* E.g., { AdministrativeArea: "CA", PostalCode: "90210" }
|
|
2459
|
+
*/
|
|
2460
|
+
#filters;
|
|
2447
2461
|
constructor({
|
|
2448
2462
|
baseUrl,
|
|
2449
2463
|
apiKey,
|
|
2450
2464
|
countries,
|
|
2451
2465
|
filters
|
|
2452
2466
|
}) {
|
|
2453
|
-
|
|
2454
|
-
|
|
2455
|
-
|
|
2456
|
-
|
|
2457
|
-
/**
|
|
2458
|
-
* API key for the Loqate API
|
|
2459
|
-
*/
|
|
2460
|
-
__privateAdd(this, _apiKey);
|
|
2461
|
-
/**
|
|
2462
|
-
* List of allowed country codes for the Loqate API
|
|
2463
|
-
* 2 or 3 character ISO country codes
|
|
2464
|
-
*/
|
|
2465
|
-
__privateAdd(this, _countries);
|
|
2466
|
-
/**
|
|
2467
|
-
* Optional filters for the Loqate API
|
|
2468
|
-
* E.g., { AdministrativeArea: "CA", PostalCode: "90210" }
|
|
2469
|
-
*/
|
|
2470
|
-
__privateAdd(this, _filters);
|
|
2471
|
-
__privateSet(this, _apiKey, apiKey);
|
|
2472
|
-
__privateSet(this, _baseUrl, baseUrl || LOQATE_BASE_URL);
|
|
2473
|
-
__privateSet(this, _countries, countries || DEFAULT_COUNTRIES);
|
|
2474
|
-
__privateSet(this, _filters, filters);
|
|
2467
|
+
this.#apiKey = apiKey;
|
|
2468
|
+
this.#baseUrl = baseUrl || LOQATE_BASE_URL;
|
|
2469
|
+
this.#countries = countries || DEFAULT_COUNTRIES;
|
|
2470
|
+
this.#filters = filters;
|
|
2475
2471
|
}
|
|
2476
2472
|
fetchFromApi(url) {
|
|
2477
|
-
return fetch(`${
|
|
2473
|
+
return fetch(`${this.#baseUrl}${url}`).then((response) => response.json()).then((json) => {
|
|
2478
2474
|
if (json.Items?.some((item) => item.Error)) {
|
|
2479
2475
|
throw new LoqateAddressLookupError(json);
|
|
2480
2476
|
}
|
|
@@ -2489,32 +2485,28 @@ var LoqateAddressLookupService = class {
|
|
|
2489
2485
|
* @returns Empty string if no filters, otherwise "&Filters=key1:value1&key2:value2" (Loqate's expected format for Filters)
|
|
2490
2486
|
*/
|
|
2491
2487
|
buildFiltersQuery() {
|
|
2492
|
-
if (!
|
|
2488
|
+
if (!this.#filters || Object.keys(this.#filters).length === 0) {
|
|
2493
2489
|
return "";
|
|
2494
2490
|
}
|
|
2495
|
-
const encodedFilters = Object.entries(
|
|
2491
|
+
const encodedFilters = Object.entries(this.#filters).map(([key, value]) => `${key}:${encodeURIComponent(value)}`).join("&");
|
|
2496
2492
|
return `&Filters=${encodedFilters}`;
|
|
2497
2493
|
}
|
|
2498
2494
|
search(searchTerm) {
|
|
2499
|
-
let url = `${LOQATE_FIND_URL}?Key=${
|
|
2495
|
+
let url = `${LOQATE_FIND_URL}?Key=${this.#apiKey}&Text=${searchTerm}&Countries=${this.#countries?.join(",")}`;
|
|
2500
2496
|
url += this.buildFiltersQuery();
|
|
2501
2497
|
return this.fetchFromApi(url);
|
|
2502
2498
|
}
|
|
2503
2499
|
findById(id) {
|
|
2504
|
-
let url = `${LOQATE_FIND_URL}?Key=${
|
|
2500
|
+
let url = `${LOQATE_FIND_URL}?Key=${this.#apiKey}&Container=${id}&Countries=${this.#countries?.join(",")}`;
|
|
2505
2501
|
url += this.buildFiltersQuery();
|
|
2506
2502
|
return this.fetchFromApi(url);
|
|
2507
2503
|
}
|
|
2508
2504
|
async get(id) {
|
|
2509
|
-
const url = `${LOQATE_RETRIEVE_URL}?Key=${
|
|
2505
|
+
const url = `${LOQATE_RETRIEVE_URL}?Key=${this.#apiKey}&Id=${id}`;
|
|
2510
2506
|
const response = await this.fetchFromApi(url);
|
|
2511
2507
|
return response.Items[0];
|
|
2512
2508
|
}
|
|
2513
2509
|
};
|
|
2514
|
-
_baseUrl = new WeakMap();
|
|
2515
|
-
_apiKey = new WeakMap();
|
|
2516
|
-
_countries = new WeakMap();
|
|
2517
|
-
_filters = new WeakMap();
|
|
2518
2510
|
|
|
2519
2511
|
// src/components/Alert/Alert.tsx
|
|
2520
2512
|
var import_icons4 = require("@simplybusiness/icons");
|
|
@@ -2633,7 +2625,7 @@ var Box = ({ ref, ...props }) => {
|
|
|
2633
2625
|
Box.displayName = "Box";
|
|
2634
2626
|
|
|
2635
2627
|
// src/components/Breadcrumbs/Breadcrumbs.tsx
|
|
2636
|
-
var
|
|
2628
|
+
var import_react17 = require("react");
|
|
2637
2629
|
var import_dedupe19 = __toESM(require("classnames/dedupe"));
|
|
2638
2630
|
var import_Breadcrumbs = require("@simplybusiness/mobius/src/components/Breadcrumbs/Breadcrumbs.css");
|
|
2639
2631
|
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
@@ -2641,26 +2633,22 @@ var Breadcrumbs = ({ ref, ...props }) => {
|
|
|
2641
2633
|
const { "aria-label": ariaLabel = "Breadcrumbs" } = props;
|
|
2642
2634
|
const { navProps } = { navProps: { "aria-label": ariaLabel } };
|
|
2643
2635
|
const { children, ...otherProps } = props;
|
|
2644
|
-
const childArray =
|
|
2636
|
+
const childArray = import_react17.Children.toArray(children);
|
|
2645
2637
|
const classes = (0, import_dedupe19.default)(
|
|
2646
2638
|
"mobius",
|
|
2647
2639
|
"mobius-breadcrumb",
|
|
2648
2640
|
otherProps.className
|
|
2649
2641
|
);
|
|
2650
2642
|
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("nav", { ref, ...otherProps, ...navProps, className: classes, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("ul", { children: childArray.map(
|
|
2651
|
-
(child, i) => (0,
|
|
2652
|
-
|
|
2653
|
-
|
|
2654
|
-
key: i,
|
|
2655
|
-
isCurrent: i === childArray.length - 1
|
|
2656
|
-
}
|
|
2657
|
-
)
|
|
2643
|
+
(child, i) => (0, import_react17.cloneElement)(child, {
|
|
2644
|
+
isCurrent: i === childArray.length - 1
|
|
2645
|
+
})
|
|
2658
2646
|
) }) });
|
|
2659
2647
|
};
|
|
2660
2648
|
Breadcrumbs.displayName = "Breadcrumbs";
|
|
2661
2649
|
|
|
2662
2650
|
// src/components/Breadcrumbs/BreadcrumbItem.tsx
|
|
2663
|
-
var
|
|
2651
|
+
var import_react18 = require("react");
|
|
2664
2652
|
var import_dedupe20 = __toESM(require("classnames/dedupe"));
|
|
2665
2653
|
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
2666
2654
|
var BreadcrumbItem = ({ ref, ...props }) => {
|
|
@@ -2684,9 +2672,9 @@ var BreadcrumbItem = ({ ref, ...props }) => {
|
|
|
2684
2672
|
"mobius-breadcrumb__item",
|
|
2685
2673
|
props.className
|
|
2686
2674
|
);
|
|
2687
|
-
const child = typeof children === "string" ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { ...itemProps, children }) :
|
|
2675
|
+
const child = typeof children === "string" ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { ...itemProps, children }) : import_react18.Children.only(children);
|
|
2688
2676
|
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("li", { className: classes, children: [
|
|
2689
|
-
(0,
|
|
2677
|
+
(0, import_react18.cloneElement)(child, {
|
|
2690
2678
|
...child.props,
|
|
2691
2679
|
...itemProps,
|
|
2692
2680
|
ref
|
|
@@ -2761,7 +2749,7 @@ var Button = ({ ref, ...props }) => {
|
|
|
2761
2749
|
Button.displayName = "Button";
|
|
2762
2750
|
|
|
2763
2751
|
// src/components/Checkbox/Checkbox.tsx
|
|
2764
|
-
var
|
|
2752
|
+
var import_react19 = require("react");
|
|
2765
2753
|
var import_dedupe22 = __toESM(require("classnames/dedupe"));
|
|
2766
2754
|
var import_icons7 = require("@simplybusiness/icons");
|
|
2767
2755
|
init_ErrorMessage2();
|
|
@@ -2790,12 +2778,12 @@ var Checkbox = ({ ref, ...props }) => {
|
|
|
2790
2778
|
["aria-describedby"]: ariaDescribedBy,
|
|
2791
2779
|
...rest
|
|
2792
2780
|
} = props;
|
|
2793
|
-
const [checked, setChecked] = (0,
|
|
2794
|
-
const fallbackRef = (0,
|
|
2781
|
+
const [checked, setChecked] = (0, import_react19.useState)(defaultSelected);
|
|
2782
|
+
const fallbackRef = (0, import_react19.useRef)(null);
|
|
2795
2783
|
const refObj = ref || fallbackRef;
|
|
2796
|
-
const inputId = (0,
|
|
2784
|
+
const inputId = (0, import_react19.useId)();
|
|
2797
2785
|
const isControlled = typeof selected === "boolean";
|
|
2798
|
-
(0,
|
|
2786
|
+
(0, import_react19.useEffect)(() => {
|
|
2799
2787
|
if (isControlled) {
|
|
2800
2788
|
setChecked(selected);
|
|
2801
2789
|
}
|
|
@@ -2819,13 +2807,13 @@ var Checkbox = ({ ref, ...props }) => {
|
|
|
2819
2807
|
const labelClasses = (0, import_dedupe22.default)("mobius-checkbox__label", sharedClasses);
|
|
2820
2808
|
const inputClasses = (0, import_dedupe22.default)("mobius-checkbox__input", sharedClasses);
|
|
2821
2809
|
const iconClasses = (0, import_dedupe22.default)("mobius-checkbox__icon", sharedClasses);
|
|
2822
|
-
const errorMessageId = (0,
|
|
2810
|
+
const errorMessageId = (0, import_react19.useId)();
|
|
2823
2811
|
const shouldErrorMessageShow = errorMessage ? errorMessageId : void 0;
|
|
2824
2812
|
const describedBy = spaceDelimitedList([
|
|
2825
2813
|
shouldErrorMessageShow,
|
|
2826
2814
|
ariaDescribedBy
|
|
2827
2815
|
]);
|
|
2828
|
-
const labelId = (0,
|
|
2816
|
+
const labelId = (0, import_react19.useId)();
|
|
2829
2817
|
const handleChange = (event) => {
|
|
2830
2818
|
setChecked(!checked);
|
|
2831
2819
|
if (onChange) {
|
|
@@ -2872,7 +2860,7 @@ Checkbox.displayName = "Checkbox";
|
|
|
2872
2860
|
|
|
2873
2861
|
// src/components/Checkbox/CheckboxGroup.tsx
|
|
2874
2862
|
var import_dedupe23 = __toESM(require("classnames/dedupe"));
|
|
2875
|
-
var
|
|
2863
|
+
var import_react20 = require("react");
|
|
2876
2864
|
init_hooks();
|
|
2877
2865
|
init_spaceDelimitedList();
|
|
2878
2866
|
init_ErrorMessage2();
|
|
@@ -2896,10 +2884,10 @@ var CheckboxGroup = ({ ref, ...props }) => {
|
|
|
2896
2884
|
lastItemDisables = false,
|
|
2897
2885
|
...rest
|
|
2898
2886
|
} = props;
|
|
2899
|
-
const [selected, setSelected] = (0,
|
|
2900
|
-
const isInitializedRef = (0,
|
|
2901
|
-
const prevDefaultValueRef = (0,
|
|
2902
|
-
(0,
|
|
2887
|
+
const [selected, setSelected] = (0, import_react20.useState)(defaultValue);
|
|
2888
|
+
const isInitializedRef = (0, import_react20.useRef)(false);
|
|
2889
|
+
const prevDefaultValueRef = (0, import_react20.useRef)(defaultValue);
|
|
2890
|
+
(0, import_react20.useEffect)(() => {
|
|
2903
2891
|
const hasChanged = defaultValue.length !== prevDefaultValueRef.current.length || defaultValue.some(
|
|
2904
2892
|
(val, index) => val !== prevDefaultValueRef.current[index]
|
|
2905
2893
|
);
|
|
@@ -2927,13 +2915,13 @@ var CheckboxGroup = ({ ref, ...props }) => {
|
|
|
2927
2915
|
},
|
|
2928
2916
|
validationClasses
|
|
2929
2917
|
);
|
|
2930
|
-
const errorMessageId = (0,
|
|
2918
|
+
const errorMessageId = (0, import_react20.useId)();
|
|
2931
2919
|
const shouldErrorMessageShow = errorMessage ? errorMessageId : void 0;
|
|
2932
2920
|
const describedBy = spaceDelimitedList([
|
|
2933
2921
|
shouldErrorMessageShow,
|
|
2934
2922
|
props["aria-describedby"]
|
|
2935
2923
|
]);
|
|
2936
|
-
const labelId = (0,
|
|
2924
|
+
const labelId = (0, import_react20.useId)();
|
|
2937
2925
|
const handleChange = (event, isLastItem = false) => {
|
|
2938
2926
|
const {
|
|
2939
2927
|
target: { value, checked }
|
|
@@ -2951,9 +2939,9 @@ var CheckboxGroup = ({ ref, ...props }) => {
|
|
|
2951
2939
|
setSelected(newValue);
|
|
2952
2940
|
onChange?.(newValue);
|
|
2953
2941
|
};
|
|
2954
|
-
const childrenArray =
|
|
2942
|
+
const childrenArray = import_react20.Children.toArray(children);
|
|
2955
2943
|
const lastCheckbox = childrenArray.filter(
|
|
2956
|
-
(child) => (0,
|
|
2944
|
+
(child) => (0, import_react20.isValidElement)(child) && child.type === Checkbox
|
|
2957
2945
|
).pop();
|
|
2958
2946
|
const lastCheckboxIsChecked = lastCheckbox && selected.includes(lastCheckbox.props.value);
|
|
2959
2947
|
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
@@ -2965,16 +2953,16 @@ var CheckboxGroup = ({ ref, ...props }) => {
|
|
|
2965
2953
|
className: checkboxGroupClasses,
|
|
2966
2954
|
role: "group",
|
|
2967
2955
|
style: {
|
|
2968
|
-
"--checkbox-items-per-row": itemsPerRow ||
|
|
2956
|
+
"--checkbox-items-per-row": itemsPerRow || import_react20.Children.count(children)
|
|
2969
2957
|
},
|
|
2970
2958
|
children: [
|
|
2971
2959
|
label && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Label, { elementType: "span", id: labelId, className: labelClasses, children: label }),
|
|
2972
2960
|
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "mobius-checkbox-group__wrapper", children: childrenArray.map((child) => {
|
|
2973
|
-
if ((0,
|
|
2961
|
+
if ((0, import_react20.isValidElement)(child)) {
|
|
2974
2962
|
const isLastItem = child === lastCheckbox;
|
|
2975
2963
|
const isChildDisabled = isDisabled || lastItemDisables && lastCheckboxIsChecked && !isLastItem;
|
|
2976
2964
|
const childProps = child.props;
|
|
2977
|
-
return (0,
|
|
2965
|
+
return (0, import_react20.cloneElement)(
|
|
2978
2966
|
child,
|
|
2979
2967
|
{
|
|
2980
2968
|
isDisabled: isChildDisabled,
|
|
@@ -3016,7 +3004,7 @@ Container.displayName = "Container";
|
|
|
3016
3004
|
|
|
3017
3005
|
// src/components/DateField/DateField.tsx
|
|
3018
3006
|
var import_dedupe25 = __toESM(require("classnames/dedupe"));
|
|
3019
|
-
var
|
|
3007
|
+
var import_react21 = require("react");
|
|
3020
3008
|
init_mergeRefs();
|
|
3021
3009
|
init_TextField2();
|
|
3022
3010
|
|
|
@@ -3066,9 +3054,9 @@ var DateField = ({ ref, ...props }) => {
|
|
|
3066
3054
|
value,
|
|
3067
3055
|
...otherProps
|
|
3068
3056
|
} = props;
|
|
3069
|
-
const [error3, setError] = (0,
|
|
3070
|
-
const [isInvalid, setIsInvalid] = (0,
|
|
3071
|
-
const localRef = (0,
|
|
3057
|
+
const [error3, setError] = (0, import_react21.useState)(errorMessage);
|
|
3058
|
+
const [isInvalid, setIsInvalid] = (0, import_react21.useState)(void 0);
|
|
3059
|
+
const localRef = (0, import_react21.useRef)(null);
|
|
3072
3060
|
const classes = (0, import_dedupe25.default)("mobius-date-field", className);
|
|
3073
3061
|
const formattedMin = min ? convertToDateFormat(min, format) : void 0;
|
|
3074
3062
|
const formattedMax = max ? convertToDateFormat(max, format) : void 0;
|
|
@@ -3082,7 +3070,7 @@ var DateField = ({ ref, ...props }) => {
|
|
|
3082
3070
|
setError(props.errorMessage);
|
|
3083
3071
|
setIsInvalid(false);
|
|
3084
3072
|
};
|
|
3085
|
-
(0,
|
|
3073
|
+
(0, import_react21.useEffect)(() => {
|
|
3086
3074
|
if (!isValidDate(min, format)) {
|
|
3087
3075
|
setInvalidState(`Invalid min date: ${min}`);
|
|
3088
3076
|
return;
|
|
@@ -3141,13 +3129,13 @@ Content.displayName = "Content";
|
|
|
3141
3129
|
|
|
3142
3130
|
// src/components/Drawer/Drawer.tsx
|
|
3143
3131
|
var import_dedupe26 = __toESM(require("classnames/dedupe"));
|
|
3144
|
-
var
|
|
3132
|
+
var import_react23 = require("react");
|
|
3145
3133
|
init_hooks();
|
|
3146
3134
|
init_utils();
|
|
3147
3135
|
|
|
3148
3136
|
// src/components/Drawer/DrawerContext.tsx
|
|
3149
|
-
var
|
|
3150
|
-
var DrawerContext = (0,
|
|
3137
|
+
var import_react22 = require("react");
|
|
3138
|
+
var DrawerContext = (0, import_react22.createContext)({
|
|
3151
3139
|
onClose: () => {
|
|
3152
3140
|
},
|
|
3153
3141
|
closeLabel: void 0,
|
|
@@ -3169,8 +3157,8 @@ var Drawer = ({ ref, ...props }) => {
|
|
|
3169
3157
|
onClose,
|
|
3170
3158
|
children
|
|
3171
3159
|
} = props;
|
|
3172
|
-
const dialogRef = (0,
|
|
3173
|
-
const [shouldTransition, setShouldTransition] = (0,
|
|
3160
|
+
const dialogRef = (0, import_react23.useRef)(null);
|
|
3161
|
+
const [shouldTransition, setShouldTransition] = (0, import_react23.useState)(false);
|
|
3174
3162
|
const { close } = useDialog({
|
|
3175
3163
|
ref: dialogRef,
|
|
3176
3164
|
isOpen,
|
|
@@ -3181,8 +3169,8 @@ var Drawer = ({ ref, ...props }) => {
|
|
|
3181
3169
|
CSSVariable: TRANSITION_CSS_VARIABLE
|
|
3182
3170
|
}
|
|
3183
3171
|
});
|
|
3184
|
-
const hiddenId = `dialog-screen-reader-announce-${(0,
|
|
3185
|
-
const headerId = `dialog-header-${(0,
|
|
3172
|
+
const hiddenId = `dialog-screen-reader-announce-${(0, import_react23.useId)()}`;
|
|
3173
|
+
const headerId = `dialog-header-${(0, import_react23.useId)()}`;
|
|
3186
3174
|
const dialogClasses = (0, import_dedupe26.default)(
|
|
3187
3175
|
"mobius",
|
|
3188
3176
|
"mobius-drawer",
|
|
@@ -3192,10 +3180,10 @@ var Drawer = ({ ref, ...props }) => {
|
|
|
3192
3180
|
"--should-transition": shouldTransition
|
|
3193
3181
|
}
|
|
3194
3182
|
);
|
|
3195
|
-
(0,
|
|
3183
|
+
(0, import_react23.useEffect)(() => {
|
|
3196
3184
|
setShouldTransition(supportsDialog());
|
|
3197
3185
|
}, []);
|
|
3198
|
-
const contextValue = (0,
|
|
3186
|
+
const contextValue = (0, import_react23.useMemo)(
|
|
3199
3187
|
() => ({
|
|
3200
3188
|
onClose: close,
|
|
3201
3189
|
closeLabel,
|
|
@@ -3206,7 +3194,7 @@ var Drawer = ({ ref, ...props }) => {
|
|
|
3206
3194
|
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
|
|
3207
3195
|
"dialog",
|
|
3208
3196
|
{
|
|
3209
|
-
id: (0,
|
|
3197
|
+
id: (0, import_react23.useId)(),
|
|
3210
3198
|
ref: mergeRefs([dialogRef, ref]),
|
|
3211
3199
|
onCancel: close,
|
|
3212
3200
|
className: dialogClasses,
|
|
@@ -3222,9 +3210,9 @@ var Drawer = ({ ref, ...props }) => {
|
|
|
3222
3210
|
Drawer.displayName = "Drawer";
|
|
3223
3211
|
|
|
3224
3212
|
// src/components/Drawer/useDrawer.ts
|
|
3225
|
-
var
|
|
3213
|
+
var import_react24 = require("react");
|
|
3226
3214
|
var useDrawer = () => {
|
|
3227
|
-
const { onClose, closeLabel, headerId } = (0,
|
|
3215
|
+
const { onClose, closeLabel, headerId } = (0, import_react24.useContext)(DrawerContext);
|
|
3228
3216
|
return { onClose, closeLabel, headerId };
|
|
3229
3217
|
};
|
|
3230
3218
|
|
|
@@ -3263,7 +3251,7 @@ var Drawer2 = Object.assign(Drawer, {
|
|
|
3263
3251
|
Drawer2.displayName = "Drawer";
|
|
3264
3252
|
|
|
3265
3253
|
// src/components/DropdownMenu/DropdownMenu.tsx
|
|
3266
|
-
var
|
|
3254
|
+
var import_react25 = require("react");
|
|
3267
3255
|
var import_react_accessible_dropdown_menu_hook = __toESM(require("react-accessible-dropdown-menu-hook"));
|
|
3268
3256
|
var import_dedupe27 = __toESM(require("classnames/dedupe"));
|
|
3269
3257
|
var import_DropdownMenu = require("@simplybusiness/mobius/src/components/DropdownMenu/DropdownMenu.css");
|
|
@@ -3276,8 +3264,8 @@ var DropdownMenu = ({ ref, ...props }) => {
|
|
|
3276
3264
|
children,
|
|
3277
3265
|
...otherProps
|
|
3278
3266
|
} = props;
|
|
3279
|
-
const [activeId, setActiveId] = (0,
|
|
3280
|
-
const numberOfItems =
|
|
3267
|
+
const [activeId, setActiveId] = (0, import_react25.useState)(null);
|
|
3268
|
+
const numberOfItems = import_react25.Children.count(children);
|
|
3281
3269
|
const {
|
|
3282
3270
|
buttonProps,
|
|
3283
3271
|
itemProps,
|
|
@@ -3301,15 +3289,15 @@ var DropdownMenu = ({ ref, ...props }) => {
|
|
|
3301
3289
|
}
|
|
3302
3290
|
};
|
|
3303
3291
|
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(Element, { ref, ...otherProps, className: classes, children: [
|
|
3304
|
-
trigger ? (0,
|
|
3292
|
+
trigger ? (0, import_react25.cloneElement)(trigger, {
|
|
3305
3293
|
className: triggerClasses,
|
|
3306
3294
|
open,
|
|
3307
3295
|
label,
|
|
3308
3296
|
...buttonProps
|
|
3309
3297
|
}) : /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Button, { className: triggerClasses, ...buttonProps, children: label }),
|
|
3310
|
-
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("ul", { className: listClasses, role: "menu", children:
|
|
3311
|
-
if ((0,
|
|
3312
|
-
return (0,
|
|
3298
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("ul", { className: listClasses, role: "menu", children: import_react25.Children.map(children, (child, index) => {
|
|
3299
|
+
if ((0, import_react25.isValidElement)(child)) {
|
|
3300
|
+
return (0, import_react25.cloneElement)(child, {
|
|
3313
3301
|
onClick: () => handleChildClick(child.props, index),
|
|
3314
3302
|
active: index === activeId,
|
|
3315
3303
|
...itemProps[index]
|
|
@@ -3322,7 +3310,7 @@ var DropdownMenu = ({ ref, ...props }) => {
|
|
|
3322
3310
|
DropdownMenu.displayName = "DropdownMenu";
|
|
3323
3311
|
|
|
3324
3312
|
// src/components/DropdownMenu/Item.tsx
|
|
3325
|
-
var
|
|
3313
|
+
var import_react26 = require("react");
|
|
3326
3314
|
var import_dedupe28 = __toESM(require("classnames/dedupe"));
|
|
3327
3315
|
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
3328
3316
|
var Item = ({ ref, ...props }) => {
|
|
@@ -3339,18 +3327,15 @@ var Item = ({ ref, ...props }) => {
|
|
|
3339
3327
|
{ "--is-active": active },
|
|
3340
3328
|
otherProps.className
|
|
3341
3329
|
);
|
|
3342
|
-
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Element, { ref, onClick, ...otherProps, children:
|
|
3343
|
-
if ((0,
|
|
3330
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Element, { ref, onClick, ...otherProps, children: import_react26.Children.map(children, (child) => {
|
|
3331
|
+
if ((0, import_react26.isValidElement)(child)) {
|
|
3344
3332
|
const childClasses = (0, import_dedupe28.default)(
|
|
3345
3333
|
child.props.className,
|
|
3346
3334
|
classes
|
|
3347
3335
|
);
|
|
3348
|
-
return (0,
|
|
3349
|
-
|
|
3350
|
-
|
|
3351
|
-
className: childClasses
|
|
3352
|
-
}
|
|
3353
|
-
);
|
|
3336
|
+
return (0, import_react26.cloneElement)(child, {
|
|
3337
|
+
className: childClasses
|
|
3338
|
+
});
|
|
3354
3339
|
}
|
|
3355
3340
|
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: classes, children: child });
|
|
3356
3341
|
}) });
|
|
@@ -3371,7 +3356,7 @@ init_ErrorMessage2();
|
|
|
3371
3356
|
|
|
3372
3357
|
// src/components/Fieldset/Fieldset.tsx
|
|
3373
3358
|
var import_dedupe29 = __toESM(require("classnames/dedupe"));
|
|
3374
|
-
var
|
|
3359
|
+
var import_react27 = require("react");
|
|
3375
3360
|
var import_Fieldset = require("@simplybusiness/mobius/src/components/Fieldset/Fieldset.css");
|
|
3376
3361
|
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
3377
3362
|
var useFieldset = (props) => {
|
|
@@ -3380,7 +3365,7 @@ var useFieldset = (props) => {
|
|
|
3380
3365
|
let containerProps = {
|
|
3381
3366
|
role: "group"
|
|
3382
3367
|
};
|
|
3383
|
-
const legendId = (0,
|
|
3368
|
+
const legendId = (0, import_react27.useId)();
|
|
3384
3369
|
if (legend) {
|
|
3385
3370
|
legendProps = {
|
|
3386
3371
|
...legendProps,
|
|
@@ -3407,7 +3392,7 @@ var Fieldset = ({ ref: _ref, ...props }) => {
|
|
|
3407
3392
|
const classes = (0, import_dedupe29.default)("mobius", "mobius-fieldset", props.className);
|
|
3408
3393
|
legendProps.className = "mobius-fieldset__legend";
|
|
3409
3394
|
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(Flex, { ...containerProps, ...otherProps, className: classes, children: [
|
|
3410
|
-
legend && (0,
|
|
3395
|
+
legend && (0, import_react27.cloneElement)(legendComponent, { ...legendProps }, [legend]),
|
|
3411
3396
|
children
|
|
3412
3397
|
] });
|
|
3413
3398
|
};
|
|
@@ -3450,7 +3435,7 @@ var Grid = ({ ref, ...props }) => {
|
|
|
3450
3435
|
Grid.displayName = "Grid";
|
|
3451
3436
|
|
|
3452
3437
|
// src/components/Grid/Item.tsx
|
|
3453
|
-
var
|
|
3438
|
+
var import_react28 = require("react");
|
|
3454
3439
|
var import_dedupe31 = __toESM(require("classnames/dedupe"));
|
|
3455
3440
|
init_hooks();
|
|
3456
3441
|
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
@@ -3488,9 +3473,9 @@ var GridItem = ({ ref, ...props }) => {
|
|
|
3488
3473
|
xl,
|
|
3489
3474
|
xxl
|
|
3490
3475
|
});
|
|
3491
|
-
const [responsiveSpan, setResponsiveSpan] = (0,
|
|
3476
|
+
const [responsiveSpan, setResponsiveSpan] = (0, import_react28.useState)();
|
|
3492
3477
|
const classes = (0, import_dedupe31.default)("mobius", "mobius-grid__item", className);
|
|
3493
|
-
(0,
|
|
3478
|
+
(0, import_react28.useEffect)(() => {
|
|
3494
3479
|
setResponsiveSpan(breakpointMap[breakpointSize]);
|
|
3495
3480
|
}, [breakpointSize, breakpointMap]);
|
|
3496
3481
|
const styles = {
|
|
@@ -3586,7 +3571,7 @@ function LinkButton({
|
|
|
3586
3571
|
}
|
|
3587
3572
|
|
|
3588
3573
|
// src/components/List/List.tsx
|
|
3589
|
-
var
|
|
3574
|
+
var import_react29 = require("react");
|
|
3590
3575
|
var import_dedupe35 = __toESM(require("classnames/dedupe"));
|
|
3591
3576
|
var import_List = require("@simplybusiness/mobius/src/components/List/List.css");
|
|
3592
3577
|
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
@@ -3613,9 +3598,9 @@ var List = ({ ref, ...props }) => {
|
|
|
3613
3598
|
ref,
|
|
3614
3599
|
...mappedProps,
|
|
3615
3600
|
className: classes,
|
|
3616
|
-
children:
|
|
3617
|
-
if ((0,
|
|
3618
|
-
return (0,
|
|
3601
|
+
children: import_react29.Children.map(children, (child) => {
|
|
3602
|
+
if ((0, import_react29.isValidElement)(child)) {
|
|
3603
|
+
return (0, import_react29.cloneElement)(child, {
|
|
3619
3604
|
parentIcon: icon
|
|
3620
3605
|
});
|
|
3621
3606
|
}
|
|
@@ -3734,16 +3719,16 @@ var Content2 = ({ ref, children, ...otherProps }) => /* @__PURE__ */ (0, import_
|
|
|
3734
3719
|
Content2.displayName = "Content";
|
|
3735
3720
|
|
|
3736
3721
|
// src/components/Modal/Header.tsx
|
|
3737
|
-
var
|
|
3722
|
+
var import_react32 = require("react");
|
|
3738
3723
|
var import_icons10 = require("@simplybusiness/icons");
|
|
3739
3724
|
init_Icon2();
|
|
3740
3725
|
|
|
3741
3726
|
// src/components/Modal/useModal.ts
|
|
3742
|
-
var
|
|
3727
|
+
var import_react31 = require("react");
|
|
3743
3728
|
|
|
3744
3729
|
// src/components/Modal/ModalContext.tsx
|
|
3745
|
-
var
|
|
3746
|
-
var ModalContext = (0,
|
|
3730
|
+
var import_react30 = require("react");
|
|
3731
|
+
var ModalContext = (0, import_react30.createContext)({
|
|
3747
3732
|
onClose: () => {
|
|
3748
3733
|
},
|
|
3749
3734
|
closeLabel: void 0,
|
|
@@ -3754,7 +3739,7 @@ var ModalContext = (0, import_react29.createContext)({
|
|
|
3754
3739
|
|
|
3755
3740
|
// src/components/Modal/useModal.ts
|
|
3756
3741
|
var useModal = () => {
|
|
3757
|
-
const { onClose, closeLabel, titleId, setTitleId } = (0,
|
|
3742
|
+
const { onClose, closeLabel, titleId, setTitleId } = (0, import_react31.useContext)(ModalContext);
|
|
3758
3743
|
return { onClose, closeLabel, titleId, setTitleId };
|
|
3759
3744
|
};
|
|
3760
3745
|
|
|
@@ -3762,8 +3747,8 @@ var useModal = () => {
|
|
|
3762
3747
|
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
3763
3748
|
var Header2 = ({ ref, children, ...otherProps }) => {
|
|
3764
3749
|
const { onClose, closeLabel, setTitleId } = useModal();
|
|
3765
|
-
const titleId = (0,
|
|
3766
|
-
(0,
|
|
3750
|
+
const titleId = (0, import_react32.useId)();
|
|
3751
|
+
(0, import_react32.useEffect)(() => {
|
|
3767
3752
|
setTitleId(titleId);
|
|
3768
3753
|
}, [titleId, setTitleId]);
|
|
3769
3754
|
return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
|
|
@@ -3797,7 +3782,7 @@ Header2.displayName = "Header";
|
|
|
3797
3782
|
|
|
3798
3783
|
// src/components/Modal/Modal.tsx
|
|
3799
3784
|
var import_dedupe39 = __toESM(require("classnames/dedupe"));
|
|
3800
|
-
var
|
|
3785
|
+
var import_react33 = require("react");
|
|
3801
3786
|
init_hooks();
|
|
3802
3787
|
init_utils();
|
|
3803
3788
|
init_polyfill_tests();
|
|
@@ -3817,11 +3802,11 @@ var Modal = ({ ref, ...props }) => {
|
|
|
3817
3802
|
animation,
|
|
3818
3803
|
...rest
|
|
3819
3804
|
} = props;
|
|
3820
|
-
const [shouldTransition, setShouldTransition] = (0,
|
|
3821
|
-
(0,
|
|
3805
|
+
const [shouldTransition, setShouldTransition] = (0, import_react33.useState)(false);
|
|
3806
|
+
(0, import_react33.useEffect)(() => {
|
|
3822
3807
|
setShouldTransition(supportsDialog());
|
|
3823
3808
|
}, []);
|
|
3824
|
-
const dialogRef = (0,
|
|
3809
|
+
const dialogRef = (0, import_react33.useRef)(null);
|
|
3825
3810
|
const { close } = useDialog({
|
|
3826
3811
|
ref: dialogRef,
|
|
3827
3812
|
isOpen,
|
|
@@ -3845,11 +3830,11 @@ var Modal = ({ ref, ...props }) => {
|
|
|
3845
3830
|
},
|
|
3846
3831
|
className
|
|
3847
3832
|
);
|
|
3848
|
-
const [titleId, setTitleId] = (0,
|
|
3849
|
-
const handleSetTitleId = (0,
|
|
3833
|
+
const [titleId, setTitleId] = (0, import_react33.useState)(void 0);
|
|
3834
|
+
const handleSetTitleId = (0, import_react33.useCallback)((id) => {
|
|
3850
3835
|
setTitleId(id);
|
|
3851
3836
|
}, []);
|
|
3852
|
-
const contextValue = (0,
|
|
3837
|
+
const contextValue = (0, import_react33.useMemo)(
|
|
3853
3838
|
() => ({
|
|
3854
3839
|
onClose: close,
|
|
3855
3840
|
closeLabel,
|
|
@@ -3886,7 +3871,7 @@ Modal2.displayName = "Modal";
|
|
|
3886
3871
|
|
|
3887
3872
|
// src/components/NumberField/NumberField.tsx
|
|
3888
3873
|
var import_dedupe40 = __toESM(require("classnames/dedupe"));
|
|
3889
|
-
var
|
|
3874
|
+
var import_react34 = require("react");
|
|
3890
3875
|
init_TextField2();
|
|
3891
3876
|
var import_NumberField = require("@simplybusiness/mobius/src/components/NumberField/NumberField.css");
|
|
3892
3877
|
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
@@ -3905,9 +3890,9 @@ var NumberField = ({ ref, ...props }) => {
|
|
|
3905
3890
|
onBlur: customOnBlur,
|
|
3906
3891
|
...rest
|
|
3907
3892
|
} = otherProps;
|
|
3908
|
-
const focusedInputRef = (0,
|
|
3909
|
-
const wheelHandler = (0,
|
|
3910
|
-
(0,
|
|
3893
|
+
const focusedInputRef = (0, import_react34.useRef)(null);
|
|
3894
|
+
const wheelHandler = (0, import_react34.useCallback)((ev) => ev.preventDefault(), []);
|
|
3895
|
+
(0, import_react34.useEffect)(() => {
|
|
3911
3896
|
return () => {
|
|
3912
3897
|
focusedInputRef.current?.removeEventListener("wheel", wheelHandler);
|
|
3913
3898
|
focusedInputRef.current = null;
|
|
@@ -3988,7 +3973,7 @@ Option2.displayName = "Option";
|
|
|
3988
3973
|
|
|
3989
3974
|
// src/components/PasswordField/PasswordField.tsx
|
|
3990
3975
|
var import_dedupe41 = __toESM(require("classnames/dedupe"));
|
|
3991
|
-
var
|
|
3976
|
+
var import_react35 = require("react");
|
|
3992
3977
|
init_mergeRefs();
|
|
3993
3978
|
init_TextField2();
|
|
3994
3979
|
|
|
@@ -4023,10 +4008,10 @@ var PasswordField = ({
|
|
|
4023
4008
|
autoComplete = "current-password",
|
|
4024
4009
|
...props
|
|
4025
4010
|
}) => {
|
|
4026
|
-
const [show, setShow] = (0,
|
|
4011
|
+
const [show, setShow] = (0, import_react35.useState)(false);
|
|
4027
4012
|
const type = show ? "text" : "password";
|
|
4028
4013
|
const classes = (0, import_dedupe41.default)("mobius-password-field", className);
|
|
4029
|
-
const localRef = (0,
|
|
4014
|
+
const localRef = (0, import_react35.useRef)(null);
|
|
4030
4015
|
const handleShowHideButtonClick = () => {
|
|
4031
4016
|
const selectionStart = localRef.current?.selectionStart;
|
|
4032
4017
|
const selectionEnd = localRef.current?.selectionEnd;
|
|
@@ -4055,7 +4040,7 @@ PasswordField.displayName = "PasswordField";
|
|
|
4055
4040
|
// src/components/Popover/Popover.tsx
|
|
4056
4041
|
var import_icons12 = require("@simplybusiness/icons");
|
|
4057
4042
|
var import_dedupe42 = __toESM(require("classnames/dedupe"));
|
|
4058
|
-
var
|
|
4043
|
+
var import_react39 = require("react");
|
|
4059
4044
|
var import_react_dom = require("react-dom");
|
|
4060
4045
|
var import_mobius_hooks6 = require("@simplybusiness/mobius-hooks");
|
|
4061
4046
|
init_Icon2();
|
|
@@ -4080,14 +4065,14 @@ var Arrow = ({ ref, width = 20, className, style }) => {
|
|
|
4080
4065
|
};
|
|
4081
4066
|
|
|
4082
4067
|
// src/components/Popover/useAutoUpdate.ts
|
|
4083
|
-
var
|
|
4068
|
+
var import_react36 = require("react");
|
|
4084
4069
|
var useAutoUpdate = ({
|
|
4085
4070
|
referenceRef,
|
|
4086
4071
|
floatingRef,
|
|
4087
4072
|
onUpdate,
|
|
4088
4073
|
enabled
|
|
4089
4074
|
}) => {
|
|
4090
|
-
(0,
|
|
4075
|
+
(0, import_react36.useEffect)(() => {
|
|
4091
4076
|
if (!enabled) return;
|
|
4092
4077
|
const reference = referenceRef.current;
|
|
4093
4078
|
const floating = floatingRef.current;
|
|
@@ -4109,7 +4094,7 @@ var useAutoUpdate = ({
|
|
|
4109
4094
|
};
|
|
4110
4095
|
|
|
4111
4096
|
// src/components/Popover/useFloatingPosition.ts
|
|
4112
|
-
var
|
|
4097
|
+
var import_react37 = require("react");
|
|
4113
4098
|
var ABSOLUTE_FLOATING_STYLES = {
|
|
4114
4099
|
position: "absolute",
|
|
4115
4100
|
top: 0,
|
|
@@ -4139,7 +4124,7 @@ var useFloatingPosition = ({
|
|
|
4139
4124
|
arrowWidth,
|
|
4140
4125
|
useFixedStrategy
|
|
4141
4126
|
}) => {
|
|
4142
|
-
const update = (0,
|
|
4127
|
+
const update = (0, import_react37.useCallback)(() => {
|
|
4143
4128
|
const reference = referenceRef.current;
|
|
4144
4129
|
const floating = floatingRef.current;
|
|
4145
4130
|
if (!reference || !floating) return;
|
|
@@ -4201,7 +4186,7 @@ var useFloatingPosition = ({
|
|
|
4201
4186
|
arrowWidth,
|
|
4202
4187
|
useFixedStrategy
|
|
4203
4188
|
]);
|
|
4204
|
-
(0,
|
|
4189
|
+
(0, import_react37.useLayoutEffect)(() => {
|
|
4205
4190
|
if (!isOpen) return;
|
|
4206
4191
|
update();
|
|
4207
4192
|
}, [isOpen, update]);
|
|
@@ -4213,14 +4198,14 @@ var useFloatingPosition = ({
|
|
|
4213
4198
|
};
|
|
4214
4199
|
|
|
4215
4200
|
// src/components/Popover/useOutsidePress.ts
|
|
4216
|
-
var
|
|
4201
|
+
var import_react38 = require("react");
|
|
4217
4202
|
var useOutsidePress = ({
|
|
4218
4203
|
referenceRef,
|
|
4219
4204
|
floatingRef,
|
|
4220
4205
|
enabled,
|
|
4221
4206
|
onOutsidePress
|
|
4222
4207
|
}) => {
|
|
4223
|
-
(0,
|
|
4208
|
+
(0, import_react38.useEffect)(() => {
|
|
4224
4209
|
if (!enabled) return;
|
|
4225
4210
|
const handler = (event) => {
|
|
4226
4211
|
const target = event.target;
|
|
@@ -4241,11 +4226,11 @@ var OFFSET_FROM_CONTENT_DEFAULT = 10;
|
|
|
4241
4226
|
var ARROW_WIDTH = 20;
|
|
4242
4227
|
var Popover = (props) => {
|
|
4243
4228
|
const { trigger, children, onOpen, onClose, className } = props;
|
|
4244
|
-
const referenceRef = (0,
|
|
4245
|
-
const floatingRef = (0,
|
|
4246
|
-
const arrowRef = (0,
|
|
4247
|
-
const [isOpen, setIsOpen] = (0,
|
|
4248
|
-
const [portalTarget, setPortalTarget] = (0,
|
|
4229
|
+
const referenceRef = (0, import_react39.useRef)(null);
|
|
4230
|
+
const floatingRef = (0, import_react39.useRef)(null);
|
|
4231
|
+
const arrowRef = (0, import_react39.useRef)(null);
|
|
4232
|
+
const [isOpen, setIsOpen] = (0, import_react39.useState)(false);
|
|
4233
|
+
const [portalTarget, setPortalTarget] = (0, import_react39.useState)(null);
|
|
4249
4234
|
const isInsideDialog = portalTarget !== null && portalTarget.tagName === "DIALOG";
|
|
4250
4235
|
const { initialFloatingStyles, initialArrowStyles, update } = useFloatingPosition({
|
|
4251
4236
|
referenceRef,
|
|
@@ -4276,7 +4261,7 @@ var Popover = (props) => {
|
|
|
4276
4261
|
"mobius-popover__container",
|
|
4277
4262
|
className
|
|
4278
4263
|
);
|
|
4279
|
-
(0,
|
|
4264
|
+
(0, import_react39.useEffect)(() => {
|
|
4280
4265
|
const el = floatingRef.current;
|
|
4281
4266
|
if (!el) return;
|
|
4282
4267
|
const preventLabelActivation = (e) => {
|
|
@@ -4299,10 +4284,10 @@ var Popover = (props) => {
|
|
|
4299
4284
|
setIsOpen(true);
|
|
4300
4285
|
onOpen?.();
|
|
4301
4286
|
};
|
|
4302
|
-
const setReferenceRef = (0,
|
|
4287
|
+
const setReferenceRef = (0, import_react39.useCallback)((node) => {
|
|
4303
4288
|
referenceRef.current = node;
|
|
4304
4289
|
}, []);
|
|
4305
|
-
const triggerComponent = (0,
|
|
4290
|
+
const triggerComponent = (0, import_react39.cloneElement)(trigger, {
|
|
4306
4291
|
ref: setReferenceRef,
|
|
4307
4292
|
className: (0, import_dedupe42.default)(
|
|
4308
4293
|
trigger.props.className,
|
|
@@ -4366,7 +4351,7 @@ var Popover = (props) => {
|
|
|
4366
4351
|
|
|
4367
4352
|
// src/components/Progress/Progress.tsx
|
|
4368
4353
|
var import_dedupe43 = __toESM(require("classnames/dedupe"));
|
|
4369
|
-
var
|
|
4354
|
+
var import_react40 = require("react");
|
|
4370
4355
|
init_Label2();
|
|
4371
4356
|
var import_Progress = require("@simplybusiness/mobius/src/components/Progress/Progress.css");
|
|
4372
4357
|
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
@@ -4413,8 +4398,8 @@ var DEFAULT_VALUE = 0;
|
|
|
4413
4398
|
var DEFAULT_MIN_VALUE = 0;
|
|
4414
4399
|
var DEFAULT_MAX_VALUE = 100;
|
|
4415
4400
|
var Progress = ({ ref, ...props }) => {
|
|
4416
|
-
const progressId = (0,
|
|
4417
|
-
const progressLabelId = (0,
|
|
4401
|
+
const progressId = (0, import_react40.useId)();
|
|
4402
|
+
const progressLabelId = (0, import_react40.useId)();
|
|
4418
4403
|
const {
|
|
4419
4404
|
id,
|
|
4420
4405
|
label,
|
|
@@ -4470,7 +4455,7 @@ Progress.displayName = "Progress";
|
|
|
4470
4455
|
|
|
4471
4456
|
// src/components/Radio/Radio.tsx
|
|
4472
4457
|
var import_dedupe44 = __toESM(require("classnames/dedupe"));
|
|
4473
|
-
var
|
|
4458
|
+
var import_react41 = require("react");
|
|
4474
4459
|
init_ErrorMessage2();
|
|
4475
4460
|
init_Label2();
|
|
4476
4461
|
var import_Radio = require("@simplybusiness/mobius/src/components/Radio/Radio.css");
|
|
@@ -4498,19 +4483,19 @@ var Radio = ({ ref, ...props }) => {
|
|
|
4498
4483
|
const isMultiline = label && children;
|
|
4499
4484
|
const isControlled = selected !== void 0;
|
|
4500
4485
|
const isChecked = isControlled ? selected === value : defaultChecked;
|
|
4501
|
-
const contentRef = (0,
|
|
4502
|
-
const prevOverflowRef = (0,
|
|
4486
|
+
const contentRef = (0, import_react41.useRef)(null);
|
|
4487
|
+
const prevOverflowRef = (0, import_react41.useRef)({
|
|
4503
4488
|
vertical: false,
|
|
4504
4489
|
horizontal: false
|
|
4505
4490
|
});
|
|
4506
|
-
const hasIconFirst = (0,
|
|
4507
|
-
if (!children ||
|
|
4508
|
-
const firstChild =
|
|
4509
|
-
if (!(0,
|
|
4491
|
+
const hasIconFirst = (0, import_react41.useMemo)(() => {
|
|
4492
|
+
if (!children || import_react41.Children.count(children) === 0) return false;
|
|
4493
|
+
const firstChild = import_react41.Children.toArray(children)[0];
|
|
4494
|
+
if (!(0, import_react41.isValidElement)(firstChild)) return false;
|
|
4510
4495
|
const props2 = firstChild.props;
|
|
4511
4496
|
return "icon" in props2 && props2.icon !== void 0;
|
|
4512
4497
|
}, [children]);
|
|
4513
|
-
(0,
|
|
4498
|
+
(0, import_react41.useLayoutEffect)(() => {
|
|
4514
4499
|
if (!contentRef.current || !onOverflow) return;
|
|
4515
4500
|
if (orientation === "vertical") {
|
|
4516
4501
|
return;
|
|
@@ -4590,7 +4575,7 @@ Radio.displayName = "Radio";
|
|
|
4590
4575
|
|
|
4591
4576
|
// src/components/Radio/RadioGroup.tsx
|
|
4592
4577
|
var import_dedupe45 = __toESM(require("classnames/dedupe"));
|
|
4593
|
-
var
|
|
4578
|
+
var import_react42 = require("react");
|
|
4594
4579
|
init_hooks();
|
|
4595
4580
|
init_spaceDelimitedList();
|
|
4596
4581
|
init_ErrorMessage2();
|
|
@@ -4624,15 +4609,15 @@ var RadioGroup = ({ ref, ...props }) => {
|
|
|
4624
4609
|
...rest
|
|
4625
4610
|
} = props;
|
|
4626
4611
|
const defaultSelected = getDefaultVal(children, value || defaultValue);
|
|
4627
|
-
const [selected, setSelected] = (0,
|
|
4628
|
-
const overflowsRef = (0,
|
|
4629
|
-
const [hasOverflow, setHasOverflow] = (0,
|
|
4630
|
-
(0,
|
|
4612
|
+
const [selected, setSelected] = (0, import_react42.useState)(defaultSelected);
|
|
4613
|
+
const overflowsRef = (0, import_react42.useRef)({});
|
|
4614
|
+
const [hasOverflow, setHasOverflow] = (0, import_react42.useState)(false);
|
|
4615
|
+
(0, import_react42.useEffect)(() => {
|
|
4631
4616
|
if (value !== void 0) {
|
|
4632
4617
|
setSelected(value);
|
|
4633
4618
|
}
|
|
4634
4619
|
}, [value]);
|
|
4635
|
-
const handleOverflow = (0,
|
|
4620
|
+
const handleOverflow = (0, import_react42.useCallback)(
|
|
4636
4621
|
(radioValue, overflow) => {
|
|
4637
4622
|
overflowsRef.current = {
|
|
4638
4623
|
...overflowsRef.current,
|
|
@@ -4666,15 +4651,15 @@ var RadioGroup = ({ ref, ...props }) => {
|
|
|
4666
4651
|
[`--is-${effectiveOrientation}`]: true
|
|
4667
4652
|
});
|
|
4668
4653
|
const labelClasses = (0, import_dedupe45.default)(radioClasses, validationClasses);
|
|
4669
|
-
const errorMessageId = (0,
|
|
4670
|
-
const defaultNameAttrId = (0,
|
|
4654
|
+
const errorMessageId = (0, import_react42.useId)();
|
|
4655
|
+
const defaultNameAttrId = (0, import_react42.useId)();
|
|
4671
4656
|
const nameAttribute = name || defaultNameAttrId;
|
|
4672
4657
|
const shouldErrorMessageShow = errorMessage ? errorMessageId : void 0;
|
|
4673
4658
|
const describedBy = spaceDelimitedList([
|
|
4674
4659
|
shouldErrorMessageShow,
|
|
4675
4660
|
props["aria-describedby"]
|
|
4676
4661
|
]);
|
|
4677
|
-
const labelId = (0,
|
|
4662
|
+
const labelId = (0, import_react42.useId)();
|
|
4678
4663
|
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
4679
4664
|
"div",
|
|
4680
4665
|
{
|
|
@@ -4693,10 +4678,10 @@ var RadioGroup = ({ ref, ...props }) => {
|
|
|
4693
4678
|
role: "radiogroup",
|
|
4694
4679
|
children: /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(Stack, { gap: "xs", children: [
|
|
4695
4680
|
label && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Label, { htmlFor: name, id: labelId, className: labelClasses, children: label }),
|
|
4696
|
-
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className: radioWrapperClasses, children:
|
|
4697
|
-
if ((0,
|
|
4681
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className: radioWrapperClasses, children: import_react42.Children.map(children, (child) => {
|
|
4682
|
+
if ((0, import_react42.isValidElement)(child)) {
|
|
4698
4683
|
const childValue = child.props.value;
|
|
4699
|
-
return (0,
|
|
4684
|
+
return (0, import_react42.cloneElement)(
|
|
4700
4685
|
child,
|
|
4701
4686
|
{
|
|
4702
4687
|
orientation: effectiveOrientation,
|
|
@@ -4761,7 +4746,7 @@ Segment.displayName = "Segment";
|
|
|
4761
4746
|
// src/components/Select/Select.tsx
|
|
4762
4747
|
var import_icons13 = require("@simplybusiness/icons");
|
|
4763
4748
|
var import_dedupe48 = __toESM(require("classnames/dedupe"));
|
|
4764
|
-
var
|
|
4749
|
+
var import_react43 = require("react");
|
|
4765
4750
|
init_hooks();
|
|
4766
4751
|
init_useLabel2();
|
|
4767
4752
|
init_spaceDelimitedList();
|
|
@@ -4808,7 +4793,7 @@ var Select = ({ ref, ...props }) => {
|
|
|
4808
4793
|
otherProps.className
|
|
4809
4794
|
);
|
|
4810
4795
|
const iconClasses = (0, import_dedupe48.default)("mobius-select__icon", sharedClasses);
|
|
4811
|
-
const errorMessageId = (0,
|
|
4796
|
+
const errorMessageId = (0, import_react43.useId)();
|
|
4812
4797
|
const shouldErrorMessageShow = errorMessage ? errorMessageId : void 0;
|
|
4813
4798
|
const describedBy = spaceDelimitedList([
|
|
4814
4799
|
shouldErrorMessageShow,
|
|
@@ -4847,12 +4832,12 @@ Select.displayName = "Select";
|
|
|
4847
4832
|
|
|
4848
4833
|
// src/components/Slider/Slider.tsx
|
|
4849
4834
|
var import_dedupe49 = __toESM(require("classnames/dedupe"));
|
|
4850
|
-
var
|
|
4835
|
+
var import_react45 = require("react");
|
|
4851
4836
|
init_hooks();
|
|
4852
4837
|
init_Label2();
|
|
4853
4838
|
|
|
4854
4839
|
// src/components/Slider/helpers.ts
|
|
4855
|
-
var
|
|
4840
|
+
var import_react44 = require("react");
|
|
4856
4841
|
function numberFormatter(value, formatOptions, locale = navigator.languages?.[0] || "en-GB") {
|
|
4857
4842
|
if (!formatOptions) {
|
|
4858
4843
|
return value?.toString() || "";
|
|
@@ -4883,11 +4868,11 @@ var Slider = (props) => {
|
|
|
4883
4868
|
formatOptions,
|
|
4884
4869
|
isDisabled = false
|
|
4885
4870
|
} = props;
|
|
4886
|
-
const trackRef = (0,
|
|
4887
|
-
const [currentValue, setCurrentValue] = (0,
|
|
4871
|
+
const trackRef = (0, import_react45.useRef)(null);
|
|
4872
|
+
const [currentValue, setCurrentValue] = (0, import_react45.useState)(
|
|
4888
4873
|
value || defaultValue || 0
|
|
4889
4874
|
);
|
|
4890
|
-
const [isDragging, setIsDraggging] = (0,
|
|
4875
|
+
const [isDragging, setIsDraggging] = (0, import_react45.useState)(false);
|
|
4891
4876
|
const { labelProps, fieldProps } = useLabel({
|
|
4892
4877
|
id,
|
|
4893
4878
|
label,
|
|
@@ -4951,16 +4936,31 @@ var Slider = (props) => {
|
|
|
4951
4936
|
// src/components/index.tsx
|
|
4952
4937
|
init_Stack2();
|
|
4953
4938
|
|
|
4954
|
-
// src/components/
|
|
4955
|
-
var import_react45 = require("react");
|
|
4939
|
+
// src/components/StickyOnMobile/StickyOnMobile.tsx
|
|
4956
4940
|
var import_dedupe50 = __toESM(require("classnames/dedupe"));
|
|
4941
|
+
var import_StickyOnMobile = require("@simplybusiness/mobius/src/components/StickyOnMobile/StickyOnMobile.css");
|
|
4957
4942
|
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
4943
|
+
var StickyOnMobile = ({ ref, ...props }) => {
|
|
4944
|
+
const { elementType: Element = "div", ...otherProps } = props;
|
|
4945
|
+
const classes = (0, import_dedupe50.default)(
|
|
4946
|
+
"mobius",
|
|
4947
|
+
"mobius-sticky-on-mobile",
|
|
4948
|
+
otherProps.className
|
|
4949
|
+
);
|
|
4950
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(Element, { ref, ...otherProps, className: classes });
|
|
4951
|
+
};
|
|
4952
|
+
StickyOnMobile.displayName = "StickyOnMobile";
|
|
4953
|
+
|
|
4954
|
+
// src/components/SVG/SVG.tsx
|
|
4955
|
+
var import_react46 = require("react");
|
|
4956
|
+
var import_dedupe51 = __toESM(require("classnames/dedupe"));
|
|
4957
|
+
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
4958
4958
|
var SVG = ({ ref, ...props }) => {
|
|
4959
4959
|
const { children, className, ...otherProps } = props;
|
|
4960
|
-
const classes = (0,
|
|
4961
|
-
const svgNode =
|
|
4960
|
+
const classes = (0, import_dedupe51.default)("mobius", "mobius-svg", className);
|
|
4961
|
+
const svgNode = import_react46.Children.only(children);
|
|
4962
4962
|
const { children: svgChildren, viewBox, xmlns } = svgNode.props;
|
|
4963
|
-
return /* @__PURE__ */ (0,
|
|
4963
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
4964
4964
|
"svg",
|
|
4965
4965
|
{
|
|
4966
4966
|
viewBox,
|
|
@@ -4975,10 +4975,10 @@ var SVG = ({ ref, ...props }) => {
|
|
|
4975
4975
|
SVG.displayName = "SVG";
|
|
4976
4976
|
|
|
4977
4977
|
// src/components/Switch/Switch.tsx
|
|
4978
|
-
var
|
|
4979
|
-
var
|
|
4978
|
+
var import_react47 = require("react");
|
|
4979
|
+
var import_dedupe52 = __toESM(require("classnames/dedupe"));
|
|
4980
4980
|
var import_Switch = require("@simplybusiness/mobius/src/components/Switch/Switch.css");
|
|
4981
|
-
var
|
|
4981
|
+
var import_jsx_runtime62 = require("react/jsx-runtime");
|
|
4982
4982
|
var Switch = ({ ref, ...props }) => {
|
|
4983
4983
|
const {
|
|
4984
4984
|
checked = false,
|
|
@@ -4987,11 +4987,11 @@ var Switch = ({ ref, ...props }) => {
|
|
|
4987
4987
|
isDisabled = false,
|
|
4988
4988
|
...otherProps
|
|
4989
4989
|
} = props;
|
|
4990
|
-
const [enabled, setEnabled] = (0,
|
|
4991
|
-
(0,
|
|
4990
|
+
const [enabled, setEnabled] = (0, import_react47.useState)(checked);
|
|
4991
|
+
(0, import_react47.useEffect)(() => {
|
|
4992
4992
|
setEnabled(checked);
|
|
4993
4993
|
}, [checked]);
|
|
4994
|
-
const classes = (0,
|
|
4994
|
+
const classes = (0, import_dedupe52.default)(
|
|
4995
4995
|
"mobius",
|
|
4996
4996
|
"mobius-switch",
|
|
4997
4997
|
{
|
|
@@ -5006,9 +5006,9 @@ var Switch = ({ ref, ...props }) => {
|
|
|
5006
5006
|
onChange(event);
|
|
5007
5007
|
}
|
|
5008
5008
|
};
|
|
5009
|
-
return /* @__PURE__ */ (0,
|
|
5010
|
-
/* @__PURE__ */ (0,
|
|
5011
|
-
/* @__PURE__ */ (0,
|
|
5009
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("label", { ref, className: classes, children: [
|
|
5010
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(VisuallyHidden, { children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("span", { children: enabled ? "On" : "Off" }) }),
|
|
5011
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
5012
5012
|
"input",
|
|
5013
5013
|
{
|
|
5014
5014
|
type: "checkbox",
|
|
@@ -5019,80 +5019,80 @@ var Switch = ({ ref, ...props }) => {
|
|
|
5019
5019
|
...otherProps
|
|
5020
5020
|
}
|
|
5021
5021
|
),
|
|
5022
|
-
/* @__PURE__ */ (0,
|
|
5022
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("span", { className: "mobius-switch__slider" })
|
|
5023
5023
|
] });
|
|
5024
5024
|
};
|
|
5025
5025
|
Switch.displayName = "Switch";
|
|
5026
5026
|
|
|
5027
5027
|
// src/components/Table/Table.tsx
|
|
5028
|
-
var
|
|
5028
|
+
var import_dedupe53 = __toESM(require("classnames/dedupe"));
|
|
5029
5029
|
var import_Table = require("@simplybusiness/mobius/src/components/Table/Table.css");
|
|
5030
|
-
var
|
|
5030
|
+
var import_jsx_runtime63 = require("react/jsx-runtime");
|
|
5031
5031
|
var Table = ({ ref, ...props }) => {
|
|
5032
|
-
const classes = (0,
|
|
5033
|
-
return /* @__PURE__ */ (0,
|
|
5032
|
+
const classes = (0, import_dedupe53.default)("mobius", "mobius-table", props.className);
|
|
5033
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("table", { ref, ...props, className: classes });
|
|
5034
5034
|
};
|
|
5035
5035
|
Table.displayName = "Table";
|
|
5036
5036
|
|
|
5037
5037
|
// src/components/Table/Head.tsx
|
|
5038
|
-
var
|
|
5039
|
-
var
|
|
5038
|
+
var import_dedupe54 = __toESM(require("classnames/dedupe"));
|
|
5039
|
+
var import_jsx_runtime64 = require("react/jsx-runtime");
|
|
5040
5040
|
var Head = ({ ref, ...props }) => {
|
|
5041
|
-
const classes = (0,
|
|
5042
|
-
return /* @__PURE__ */ (0,
|
|
5041
|
+
const classes = (0, import_dedupe54.default)("mobius", "mobius-table__head", props.className);
|
|
5042
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("thead", { ref, ...props, className: classes });
|
|
5043
5043
|
};
|
|
5044
5044
|
Head.displayName = "Table.Head";
|
|
5045
5045
|
|
|
5046
5046
|
// src/components/Table/Body.tsx
|
|
5047
|
-
var
|
|
5048
|
-
var
|
|
5047
|
+
var import_dedupe55 = __toESM(require("classnames/dedupe"));
|
|
5048
|
+
var import_jsx_runtime65 = require("react/jsx-runtime");
|
|
5049
5049
|
var Body = ({ ref, ...props }) => {
|
|
5050
|
-
const classes = (0,
|
|
5051
|
-
return /* @__PURE__ */ (0,
|
|
5050
|
+
const classes = (0, import_dedupe55.default)("mobius", "mobius-table__body", props.className);
|
|
5051
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("tbody", { ref, ...props, className: classes });
|
|
5052
5052
|
};
|
|
5053
5053
|
Body.displayName = "Table.Body";
|
|
5054
5054
|
|
|
5055
5055
|
// src/components/Table/Foot.tsx
|
|
5056
|
-
var
|
|
5057
|
-
var
|
|
5056
|
+
var import_dedupe56 = __toESM(require("classnames/dedupe"));
|
|
5057
|
+
var import_jsx_runtime66 = require("react/jsx-runtime");
|
|
5058
5058
|
var Foot = ({ ref, ...props }) => {
|
|
5059
|
-
const classes = (0,
|
|
5060
|
-
return /* @__PURE__ */ (0,
|
|
5059
|
+
const classes = (0, import_dedupe56.default)("mobius", "mobius-table__foot", props.className);
|
|
5060
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("tfoot", { ref, ...props, className: classes });
|
|
5061
5061
|
};
|
|
5062
5062
|
Foot.displayName = "Table.Foot";
|
|
5063
5063
|
|
|
5064
5064
|
// src/components/Table/Row.tsx
|
|
5065
|
-
var
|
|
5066
|
-
var
|
|
5065
|
+
var import_dedupe57 = __toESM(require("classnames/dedupe"));
|
|
5066
|
+
var import_jsx_runtime67 = require("react/jsx-runtime");
|
|
5067
5067
|
var Row = ({ ref, ...props }) => {
|
|
5068
|
-
const classes = (0,
|
|
5069
|
-
return /* @__PURE__ */ (0,
|
|
5068
|
+
const classes = (0, import_dedupe57.default)("mobius", "mobius-table__row", props.className);
|
|
5069
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("tr", { ref, ...props, className: classes });
|
|
5070
5070
|
};
|
|
5071
5071
|
Row.displayName = "Table.Row";
|
|
5072
5072
|
|
|
5073
5073
|
// src/components/Table/HeaderCell.tsx
|
|
5074
|
-
var
|
|
5075
|
-
var
|
|
5074
|
+
var import_dedupe58 = __toESM(require("classnames/dedupe"));
|
|
5075
|
+
var import_jsx_runtime68 = require("react/jsx-runtime");
|
|
5076
5076
|
var HeaderCell = ({ ref, scope = "col", ...props }) => {
|
|
5077
|
-
const classes = (0,
|
|
5077
|
+
const classes = (0, import_dedupe58.default)(
|
|
5078
5078
|
"mobius",
|
|
5079
5079
|
"mobius-table__head-cell",
|
|
5080
5080
|
props.className
|
|
5081
5081
|
);
|
|
5082
|
-
return /* @__PURE__ */ (0,
|
|
5082
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("th", { ...props, ref, scope, className: classes });
|
|
5083
5083
|
};
|
|
5084
5084
|
HeaderCell.displayName = "Table.HeaderCell";
|
|
5085
5085
|
|
|
5086
5086
|
// src/components/Table/Cell.tsx
|
|
5087
|
-
var
|
|
5088
|
-
var
|
|
5087
|
+
var import_dedupe59 = __toESM(require("classnames/dedupe"));
|
|
5088
|
+
var import_jsx_runtime69 = require("react/jsx-runtime");
|
|
5089
5089
|
var Cell = ({ ref, ...props }) => {
|
|
5090
|
-
const classes = (0,
|
|
5090
|
+
const classes = (0, import_dedupe59.default)(
|
|
5091
5091
|
"mobius",
|
|
5092
5092
|
"mobius-table__body-cell",
|
|
5093
5093
|
props.className
|
|
5094
5094
|
);
|
|
5095
|
-
return /* @__PURE__ */ (0,
|
|
5095
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("td", { ref, ...props, className: classes });
|
|
5096
5096
|
};
|
|
5097
5097
|
Cell.displayName = "Table.Cell";
|
|
5098
5098
|
|
|
@@ -5108,18 +5108,18 @@ var Table2 = Object.assign(Table, {
|
|
|
5108
5108
|
Table2.displayName = "Table";
|
|
5109
5109
|
|
|
5110
5110
|
// src/components/TextArea/TextArea.tsx
|
|
5111
|
-
var
|
|
5111
|
+
var import_dedupe61 = __toESM(require("classnames/dedupe"));
|
|
5112
5112
|
init_hooks();
|
|
5113
5113
|
init_ErrorMessage2();
|
|
5114
5114
|
init_Label2();
|
|
5115
5115
|
init_Stack2();
|
|
5116
5116
|
|
|
5117
5117
|
// src/components/TextAreaInput/TextAreaInput.tsx
|
|
5118
|
-
var
|
|
5119
|
-
var
|
|
5118
|
+
var import_dedupe60 = __toESM(require("classnames/dedupe"));
|
|
5119
|
+
var import_jsx_runtime70 = require("react/jsx-runtime");
|
|
5120
5120
|
var TextAreaInput = ({ ref, ...props }) => {
|
|
5121
5121
|
const { isSelected, isDisabled, isReadOnly, isRequired, ...otherProps } = props;
|
|
5122
|
-
const classes = (0,
|
|
5122
|
+
const classes = (0, import_dedupe60.default)(
|
|
5123
5123
|
"mobius",
|
|
5124
5124
|
"mobius-text-area__input",
|
|
5125
5125
|
{
|
|
@@ -5129,7 +5129,7 @@ var TextAreaInput = ({ ref, ...props }) => {
|
|
|
5129
5129
|
},
|
|
5130
5130
|
otherProps.className
|
|
5131
5131
|
);
|
|
5132
|
-
return /* @__PURE__ */ (0,
|
|
5132
|
+
return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
5133
5133
|
"textarea",
|
|
5134
5134
|
{
|
|
5135
5135
|
ref,
|
|
@@ -5144,7 +5144,7 @@ TextAreaInput.displayName = "TextAreaInput";
|
|
|
5144
5144
|
|
|
5145
5145
|
// src/components/TextArea/TextArea.tsx
|
|
5146
5146
|
var import_TextArea = require("@simplybusiness/mobius/src/components/TextArea/TextArea.css");
|
|
5147
|
-
var
|
|
5147
|
+
var import_jsx_runtime71 = require("react/jsx-runtime");
|
|
5148
5148
|
var TextArea = ({ ref, ...props }) => {
|
|
5149
5149
|
const {
|
|
5150
5150
|
isDisabled,
|
|
@@ -5155,18 +5155,18 @@ var TextArea = ({ ref, ...props }) => {
|
|
|
5155
5155
|
...otherProps
|
|
5156
5156
|
} = props;
|
|
5157
5157
|
const { inputProps, labelProps, errorMessageProps } = useTextField(props);
|
|
5158
|
-
const classes = (0,
|
|
5158
|
+
const classes = (0, import_dedupe61.default)("mobius", "mobius-text-area", className);
|
|
5159
5159
|
const validationClasses = useValidationClasses({ isInvalid });
|
|
5160
|
-
const inputClasses = (0,
|
|
5161
|
-
const labelClasses = (0,
|
|
5160
|
+
const inputClasses = (0, import_dedupe61.default)("mobius-text-area__input", validationClasses);
|
|
5161
|
+
const labelClasses = (0, import_dedupe61.default)(
|
|
5162
5162
|
{
|
|
5163
5163
|
"--is-disabled": isDisabled
|
|
5164
5164
|
},
|
|
5165
5165
|
validationClasses
|
|
5166
5166
|
);
|
|
5167
|
-
return /* @__PURE__ */ (0,
|
|
5168
|
-
label && /* @__PURE__ */ (0,
|
|
5169
|
-
/* @__PURE__ */ (0,
|
|
5167
|
+
return /* @__PURE__ */ (0, import_jsx_runtime71.jsxs)(Stack, { className: classes, gap: "xs", children: [
|
|
5168
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(Label, { ...labelProps, className: labelClasses, children: props.label }),
|
|
5169
|
+
/* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
|
|
5170
5170
|
TextAreaInput,
|
|
5171
5171
|
{
|
|
5172
5172
|
...otherProps,
|
|
@@ -5177,7 +5177,7 @@ var TextArea = ({ ref, ...props }) => {
|
|
|
5177
5177
|
"aria-invalid": errorMessage != null
|
|
5178
5178
|
}
|
|
5179
5179
|
),
|
|
5180
|
-
/* @__PURE__ */ (0,
|
|
5180
|
+
/* @__PURE__ */ (0, import_jsx_runtime71.jsx)(ErrorMessage, { ...errorMessageProps, errorMessage })
|
|
5181
5181
|
] });
|
|
5182
5182
|
};
|
|
5183
5183
|
TextArea.displayName = "TextArea";
|
|
@@ -5187,9 +5187,9 @@ init_TextField2();
|
|
|
5187
5187
|
init_TextOrHTML2();
|
|
5188
5188
|
|
|
5189
5189
|
// src/components/Title/Title.tsx
|
|
5190
|
-
var
|
|
5190
|
+
var import_dedupe62 = __toESM(require("classnames/dedupe"));
|
|
5191
5191
|
var import_Title = require("@simplybusiness/mobius/src/components/Title/Title.css");
|
|
5192
|
-
var
|
|
5192
|
+
var import_jsx_runtime72 = require("react/jsx-runtime");
|
|
5193
5193
|
var Title = ({ ref, ...props }) => {
|
|
5194
5194
|
const {
|
|
5195
5195
|
elementType: Element = "div",
|
|
@@ -5197,20 +5197,20 @@ var Title = ({ ref, ...props }) => {
|
|
|
5197
5197
|
description,
|
|
5198
5198
|
...otherProps
|
|
5199
5199
|
} = props;
|
|
5200
|
-
const classes = (0,
|
|
5201
|
-
const headerClasses = (0,
|
|
5202
|
-
const contentClasses = (0,
|
|
5203
|
-
const containerClasses = (0,
|
|
5204
|
-
return /* @__PURE__ */ (0,
|
|
5205
|
-
/* @__PURE__ */ (0,
|
|
5206
|
-
/* @__PURE__ */ (0,
|
|
5200
|
+
const classes = (0, import_dedupe62.default)("mobius", "mobius-title", otherProps.className);
|
|
5201
|
+
const headerClasses = (0, import_dedupe62.default)("mobius", "mobius-title__header");
|
|
5202
|
+
const contentClasses = (0, import_dedupe62.default)("mobius", "mobius-title__description");
|
|
5203
|
+
const containerClasses = (0, import_dedupe62.default)("mobius", "mobius-title__container");
|
|
5204
|
+
return /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(Element, { ref, ...otherProps, className: classes, children: /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)(Flex, { flexDirection: "column", className: containerClasses, children: [
|
|
5205
|
+
/* @__PURE__ */ (0, import_jsx_runtime72.jsx)("p", { className: headerClasses, children: title }),
|
|
5206
|
+
/* @__PURE__ */ (0, import_jsx_runtime72.jsx)("p", { className: contentClasses, children: description })
|
|
5207
5207
|
] }) });
|
|
5208
5208
|
};
|
|
5209
5209
|
Title.displayName = "Title";
|
|
5210
5210
|
|
|
5211
5211
|
// src/components/Toast/Toast.tsx
|
|
5212
5212
|
var import_icons14 = require("@simplybusiness/icons");
|
|
5213
|
-
var
|
|
5213
|
+
var import_dedupe63 = __toESM(require("classnames/dedupe"));
|
|
5214
5214
|
var import_sonner = require("sonner");
|
|
5215
5215
|
init_Icon2();
|
|
5216
5216
|
|
|
@@ -5221,7 +5221,7 @@ var toastState = {
|
|
|
5221
5221
|
|
|
5222
5222
|
// src/components/Toast/Toast.tsx
|
|
5223
5223
|
var import_Toast = require("@simplybusiness/mobius/src/components/Toast/Toast.css");
|
|
5224
|
-
var
|
|
5224
|
+
var import_jsx_runtime73 = require("react/jsx-runtime");
|
|
5225
5225
|
var variantIcons = {
|
|
5226
5226
|
info: import_icons14.circleInfo,
|
|
5227
5227
|
success: import_icons14.circleCheck,
|
|
@@ -5234,8 +5234,8 @@ var variantColors = {
|
|
|
5234
5234
|
warning: "var(--color-warning)",
|
|
5235
5235
|
error: "var(--color-error)"
|
|
5236
5236
|
};
|
|
5237
|
-
var ToastIcon = ({ variant }) => /* @__PURE__ */ (0,
|
|
5238
|
-
var CloseIcon = () => /* @__PURE__ */ (0,
|
|
5237
|
+
var ToastIcon = ({ variant }) => /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("span", { className: "mobius-toast__icon", children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(Icon, { icon: variantIcons[variant], color: variantColors[variant] }) });
|
|
5238
|
+
var CloseIcon = () => /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("span", { className: "mobius-toast__close-icon", children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(Icon, { icon: import_icons14.cross }) });
|
|
5239
5239
|
var ToastContent = ({
|
|
5240
5240
|
toastId,
|
|
5241
5241
|
variant,
|
|
@@ -5244,15 +5244,15 @@ var ToastContent = ({
|
|
|
5244
5244
|
action,
|
|
5245
5245
|
cancel,
|
|
5246
5246
|
showCloseButton = toastState.showCloseButton
|
|
5247
|
-
}) => /* @__PURE__ */ (0,
|
|
5248
|
-
/* @__PURE__ */ (0,
|
|
5249
|
-
/* @__PURE__ */ (0,
|
|
5250
|
-
/* @__PURE__ */ (0,
|
|
5251
|
-
title && /* @__PURE__ */ (0,
|
|
5252
|
-
description && /* @__PURE__ */ (0,
|
|
5247
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)("div", { className: (0, import_dedupe63.default)("mobius", "mobius-toast", `--${variant}`), children: [
|
|
5248
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsx)(ToastIcon, { variant }),
|
|
5249
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsxs)("div", { className: "mobius-toast__body", children: [
|
|
5250
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsxs)("div", { className: "mobius-toast__content", children: [
|
|
5251
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("div", { className: "mobius-toast__title", children: title }),
|
|
5252
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("div", { className: "mobius-toast__description", children: description })
|
|
5253
5253
|
] }),
|
|
5254
|
-
(action || cancel) && /* @__PURE__ */ (0,
|
|
5255
|
-
cancel && /* @__PURE__ */ (0,
|
|
5254
|
+
(action || cancel) && /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)("div", { className: "mobius-toast__actions", children: [
|
|
5255
|
+
cancel && /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
|
|
5256
5256
|
"button",
|
|
5257
5257
|
{
|
|
5258
5258
|
type: "button",
|
|
@@ -5264,7 +5264,7 @@ var ToastContent = ({
|
|
|
5264
5264
|
children: cancel.label
|
|
5265
5265
|
}
|
|
5266
5266
|
),
|
|
5267
|
-
action && /* @__PURE__ */ (0,
|
|
5267
|
+
action && /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
|
|
5268
5268
|
"button",
|
|
5269
5269
|
{
|
|
5270
5270
|
type: "button",
|
|
@@ -5278,19 +5278,19 @@ var ToastContent = ({
|
|
|
5278
5278
|
)
|
|
5279
5279
|
] })
|
|
5280
5280
|
] }),
|
|
5281
|
-
showCloseButton && /* @__PURE__ */ (0,
|
|
5281
|
+
showCloseButton && /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
|
|
5282
5282
|
"button",
|
|
5283
5283
|
{
|
|
5284
5284
|
type: "button",
|
|
5285
5285
|
className: "mobius-toast__close",
|
|
5286
5286
|
onClick: () => import_sonner.toast.dismiss(toastId),
|
|
5287
5287
|
"aria-label": "Close",
|
|
5288
|
-
children: /* @__PURE__ */ (0,
|
|
5288
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(CloseIcon, {})
|
|
5289
5289
|
}
|
|
5290
5290
|
)
|
|
5291
5291
|
] });
|
|
5292
5292
|
var createCustomToast = (message, variant, options) => import_sonner.toast.custom(
|
|
5293
|
-
(id) => /* @__PURE__ */ (0,
|
|
5293
|
+
(id) => /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
|
|
5294
5294
|
ToastContent,
|
|
5295
5295
|
{
|
|
5296
5296
|
toastId: id,
|
|
@@ -5322,9 +5322,9 @@ var toast = {
|
|
|
5322
5322
|
};
|
|
5323
5323
|
|
|
5324
5324
|
// src/components/Toast/Toaster.tsx
|
|
5325
|
-
var
|
|
5325
|
+
var import_react48 = require("react");
|
|
5326
5326
|
var import_sonner2 = require("sonner");
|
|
5327
|
-
var
|
|
5327
|
+
var import_jsx_runtime74 = require("react/jsx-runtime");
|
|
5328
5328
|
var Toaster = ({
|
|
5329
5329
|
position = "top-right",
|
|
5330
5330
|
closeButton = true,
|
|
@@ -5333,10 +5333,10 @@ var Toaster = ({
|
|
|
5333
5333
|
visibleToasts = 3,
|
|
5334
5334
|
gap = 8
|
|
5335
5335
|
}) => {
|
|
5336
|
-
(0,
|
|
5336
|
+
(0, import_react48.useEffect)(() => {
|
|
5337
5337
|
toastState.showCloseButton = closeButton;
|
|
5338
5338
|
}, [closeButton]);
|
|
5339
|
-
return /* @__PURE__ */ (0,
|
|
5339
|
+
return /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
5340
5340
|
import_sonner2.Toaster,
|
|
5341
5341
|
{
|
|
5342
5342
|
position,
|
|
@@ -5351,8 +5351,8 @@ var Toaster = ({
|
|
|
5351
5351
|
Toaster.displayName = "Toaster";
|
|
5352
5352
|
|
|
5353
5353
|
// src/components/Trust/Trust.tsx
|
|
5354
|
-
var
|
|
5355
|
-
var
|
|
5354
|
+
var import_dedupe64 = __toESM(require("classnames/dedupe"));
|
|
5355
|
+
var import_react49 = require("react");
|
|
5356
5356
|
init_utils();
|
|
5357
5357
|
|
|
5358
5358
|
// src/components/Trust/constants.ts
|
|
@@ -5417,7 +5417,7 @@ var TRUSTPILOT_WIDGET = {
|
|
|
5417
5417
|
};
|
|
5418
5418
|
|
|
5419
5419
|
// src/components/Trust/Trust.tsx
|
|
5420
|
-
var
|
|
5420
|
+
var import_jsx_runtime75 = require("react/jsx-runtime");
|
|
5421
5421
|
var Trust = ({ ref, ...props }) => {
|
|
5422
5422
|
const {
|
|
5423
5423
|
elementType: Element = "div",
|
|
@@ -5429,8 +5429,8 @@ var Trust = ({ ref, ...props }) => {
|
|
|
5429
5429
|
stars,
|
|
5430
5430
|
className
|
|
5431
5431
|
} = props;
|
|
5432
|
-
const [isMounted, setIsMounted] = (0,
|
|
5433
|
-
const trustRef = (0,
|
|
5432
|
+
const [isMounted, setIsMounted] = (0, import_react49.useState)(false);
|
|
5433
|
+
const trustRef = (0, import_react49.useRef)(null);
|
|
5434
5434
|
const {
|
|
5435
5435
|
templateId,
|
|
5436
5436
|
className: variantClassName,
|
|
@@ -5447,7 +5447,7 @@ var Trust = ({ ref, ...props }) => {
|
|
|
5447
5447
|
"data-style-height": height,
|
|
5448
5448
|
"data-stars": stars
|
|
5449
5449
|
};
|
|
5450
|
-
const classes = (0,
|
|
5450
|
+
const classes = (0, import_dedupe64.default)(
|
|
5451
5451
|
"mobius",
|
|
5452
5452
|
"mobius-trust",
|
|
5453
5453
|
REQUIRED_TRUSTPILOT_CLASS_NAME,
|
|
@@ -5457,24 +5457,24 @@ var Trust = ({ ref, ...props }) => {
|
|
|
5457
5457
|
},
|
|
5458
5458
|
className
|
|
5459
5459
|
);
|
|
5460
|
-
(0,
|
|
5460
|
+
(0, import_react49.useEffect)(() => {
|
|
5461
5461
|
const hasTrustpilotLoaded = trustRef.current && window?.Trustpilot && window?.Trustpilot.loadFromElement;
|
|
5462
5462
|
if (isMounted && hasTrustpilotLoaded) {
|
|
5463
5463
|
window.Trustpilot.loadFromElement(trustRef.current, true);
|
|
5464
5464
|
}
|
|
5465
5465
|
}, [isMounted]);
|
|
5466
|
-
(0,
|
|
5466
|
+
(0, import_react49.useEffect)(() => {
|
|
5467
5467
|
setIsMounted(true);
|
|
5468
5468
|
}, []);
|
|
5469
|
-
if (!isMounted) return /* @__PURE__ */ (0,
|
|
5470
|
-
return /* @__PURE__ */ (0,
|
|
5469
|
+
if (!isMounted) return /* @__PURE__ */ (0, import_jsx_runtime75.jsx)("div", { style: styles });
|
|
5470
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
5471
5471
|
Element,
|
|
5472
5472
|
{
|
|
5473
5473
|
ref: mergeRefs([trustRef, ref]),
|
|
5474
5474
|
className: classes,
|
|
5475
5475
|
style: styles,
|
|
5476
5476
|
...dataProps,
|
|
5477
|
-
children: /* @__PURE__ */ (0,
|
|
5477
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
5478
5478
|
"a",
|
|
5479
5479
|
{
|
|
5480
5480
|
href: link,
|
|
@@ -5489,12 +5489,12 @@ var Trust = ({ ref, ...props }) => {
|
|
|
5489
5489
|
};
|
|
5490
5490
|
|
|
5491
5491
|
// src/components/ExpandableText/ExpandableText.tsx
|
|
5492
|
-
var
|
|
5493
|
-
var
|
|
5492
|
+
var import_dedupe65 = __toESM(require("classnames/dedupe"));
|
|
5493
|
+
var import_react50 = require("react");
|
|
5494
5494
|
init_hooks();
|
|
5495
5495
|
init_TextOrHTML2();
|
|
5496
5496
|
var import_ExpandableText = require("@simplybusiness/mobius/src/components/ExpandableText/ExpandableText.css");
|
|
5497
|
-
var
|
|
5497
|
+
var import_jsx_runtime76 = require("react/jsx-runtime");
|
|
5498
5498
|
var ExpandableText = ({ ref, ...props }) => {
|
|
5499
5499
|
const {
|
|
5500
5500
|
text,
|
|
@@ -5508,14 +5508,14 @@ var ExpandableText = ({ ref, ...props }) => {
|
|
|
5508
5508
|
onToggle,
|
|
5509
5509
|
...otherProps
|
|
5510
5510
|
} = props;
|
|
5511
|
-
const [isExpanded, setIsExpanded] = (0,
|
|
5512
|
-
const [isCollapsed, setIsCollapsed] = (0,
|
|
5513
|
-
const textRef = (0,
|
|
5511
|
+
const [isExpanded, setIsExpanded] = (0, import_react50.useState)(false);
|
|
5512
|
+
const [isCollapsed, setIsCollapsed] = (0, import_react50.useState)(false);
|
|
5513
|
+
const textRef = (0, import_react50.useRef)(null);
|
|
5514
5514
|
const { down } = useBreakpoint();
|
|
5515
|
-
const baseId = (0,
|
|
5515
|
+
const baseId = (0, import_react50.useId)();
|
|
5516
5516
|
const expandButtonId = `expandable-text-expand-${baseId}`;
|
|
5517
5517
|
const shouldCollapse = breakpoint ? down(breakpoint) : true;
|
|
5518
|
-
(0,
|
|
5518
|
+
(0, import_react50.useEffect)(() => {
|
|
5519
5519
|
if (!shouldCollapse || !textRef.current) {
|
|
5520
5520
|
setIsCollapsed(false);
|
|
5521
5521
|
return;
|
|
@@ -5525,20 +5525,20 @@ var ExpandableText = ({ ref, ...props }) => {
|
|
|
5525
5525
|
setIsCollapsed(isOverflowing);
|
|
5526
5526
|
}, [text, shouldCollapse, maxLines]);
|
|
5527
5527
|
if (breakpoint && !shouldCollapse) {
|
|
5528
|
-
return /* @__PURE__ */ (0,
|
|
5528
|
+
return /* @__PURE__ */ (0, import_jsx_runtime76.jsx)("div", { ref, className, ...otherProps, children: /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(TextOrHTML, { text, textWrapper: true, ...textProps }) });
|
|
5529
5529
|
}
|
|
5530
5530
|
const handleAccordionChange = (expanded) => {
|
|
5531
5531
|
setIsExpanded(expanded);
|
|
5532
5532
|
onToggle?.(expanded);
|
|
5533
5533
|
};
|
|
5534
|
-
const classes = (0,
|
|
5535
|
-
const textContainerClasses = (0,
|
|
5534
|
+
const classes = (0, import_dedupe65.default)("mobius-expandable-text", className);
|
|
5535
|
+
const textContainerClasses = (0, import_dedupe65.default)("mobius-expandable-text__content", {
|
|
5536
5536
|
"mobius-expandable-text__content--collapsed": !isExpanded
|
|
5537
5537
|
});
|
|
5538
5538
|
const textContainerStyle = {
|
|
5539
5539
|
"--line-clamp": maxLines
|
|
5540
5540
|
};
|
|
5541
|
-
return /* @__PURE__ */ (0,
|
|
5541
|
+
return /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)(
|
|
5542
5542
|
"div",
|
|
5543
5543
|
{
|
|
5544
5544
|
ref,
|
|
@@ -5546,7 +5546,7 @@ var ExpandableText = ({ ref, ...props }) => {
|
|
|
5546
5546
|
"data-testid": "expandable-text",
|
|
5547
5547
|
...otherProps,
|
|
5548
5548
|
children: [
|
|
5549
|
-
/* @__PURE__ */ (0,
|
|
5549
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
|
|
5550
5550
|
"div",
|
|
5551
5551
|
{
|
|
5552
5552
|
ref: textRef,
|
|
@@ -5554,10 +5554,10 @@ var ExpandableText = ({ ref, ...props }) => {
|
|
|
5554
5554
|
style: textContainerStyle,
|
|
5555
5555
|
"data-testid": "expandable-text-content",
|
|
5556
5556
|
"aria-describedby": isCollapsed ? expandButtonId : void 0,
|
|
5557
|
-
children: /* @__PURE__ */ (0,
|
|
5557
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(TextOrHTML, { elementType: "span", textWrapper: true, text, ...textProps })
|
|
5558
5558
|
}
|
|
5559
5559
|
),
|
|
5560
|
-
isCollapsed && /* @__PURE__ */ (0,
|
|
5560
|
+
isCollapsed && /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
|
|
5561
5561
|
Accordion,
|
|
5562
5562
|
{
|
|
5563
5563
|
showText,
|
|
@@ -5580,7 +5580,7 @@ ExpandableText.displayName = "ExpandableText";
|
|
|
5580
5580
|
// src/components/MaskedField/index.tsx
|
|
5581
5581
|
var import_component = __toESM(require("@loadable/component"));
|
|
5582
5582
|
init_TextField2();
|
|
5583
|
-
var
|
|
5583
|
+
var import_jsx_runtime78 = require("react/jsx-runtime");
|
|
5584
5584
|
var LoadableMaskedField = (0, import_component.default)(() => Promise.resolve().then(() => (init_MaskedField(), MaskedField_exports)), {
|
|
5585
5585
|
resolveComponent: (mod) => mod.MaskedField
|
|
5586
5586
|
});
|
|
@@ -5592,11 +5592,11 @@ function MaskedField2(props) {
|
|
|
5592
5592
|
ref: forwardedRef,
|
|
5593
5593
|
...textFieldProps
|
|
5594
5594
|
} = props;
|
|
5595
|
-
return /* @__PURE__ */ (0,
|
|
5595
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
5596
5596
|
LoadableMaskedField,
|
|
5597
5597
|
{
|
|
5598
5598
|
...props,
|
|
5599
|
-
fallback: /* @__PURE__ */ (0,
|
|
5599
|
+
fallback: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
5600
5600
|
TextField,
|
|
5601
5601
|
{
|
|
5602
5602
|
...textFieldProps,
|