@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
package/dist/cjs/index.js
CHANGED
|
@@ -6,9 +6,6 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
6
6
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
7
|
var __getProtoOf = Object.getPrototypeOf;
|
|
8
8
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
-
var __typeError = (msg) => {
|
|
10
|
-
throw TypeError(msg);
|
|
11
|
-
};
|
|
12
9
|
var __esm = (fn, res) => function __init() {
|
|
13
10
|
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
14
11
|
};
|
|
@@ -33,10 +30,6 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
33
30
|
mod
|
|
34
31
|
));
|
|
35
32
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
36
|
-
var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
|
|
37
|
-
var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
38
|
-
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);
|
|
39
|
-
var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
|
|
40
33
|
|
|
41
34
|
// src/utils/changeCSS.ts
|
|
42
35
|
var init_changeCSS = __esm({
|
|
@@ -946,9 +939,10 @@ var init_adornmentWithClassName = __esm({
|
|
|
946
939
|
import_react10 = require("react");
|
|
947
940
|
adornmentWithClassName = (component, validationClasses, className) => {
|
|
948
941
|
if (!component) return null;
|
|
949
|
-
|
|
942
|
+
const typedComponent = component;
|
|
943
|
+
return (0, import_react10.cloneElement)(typedComponent, {
|
|
950
944
|
className: (0, import_dedupe12.default)(
|
|
951
|
-
|
|
945
|
+
typedComponent.props.className,
|
|
952
946
|
validationClasses,
|
|
953
947
|
className
|
|
954
948
|
)
|
|
@@ -958,12 +952,13 @@ var init_adornmentWithClassName = __esm({
|
|
|
958
952
|
});
|
|
959
953
|
|
|
960
954
|
// src/components/TextField/TextField.tsx
|
|
961
|
-
var import_dedupe13, import_TextField, import_jsx_runtime12, TextField;
|
|
955
|
+
var import_dedupe13, import_react11, import_TextField, import_jsx_runtime12, TextFieldInner, TextField;
|
|
962
956
|
var init_TextField = __esm({
|
|
963
957
|
"src/components/TextField/TextField.tsx"() {
|
|
964
958
|
"use strict";
|
|
965
959
|
"use client";
|
|
966
960
|
import_dedupe13 = __toESM(require("classnames/dedupe"));
|
|
961
|
+
import_react11 = require("react");
|
|
967
962
|
init_hooks();
|
|
968
963
|
init_ErrorMessage2();
|
|
969
964
|
init_Label2();
|
|
@@ -971,7 +966,7 @@ var init_TextField = __esm({
|
|
|
971
966
|
init_adornmentWithClassName();
|
|
972
967
|
import_TextField = require("@simplybusiness/mobius/src/components/TextField/TextField.css");
|
|
973
968
|
import_jsx_runtime12 = require("react/jsx-runtime");
|
|
974
|
-
|
|
969
|
+
TextFieldInner = ({ ref, ...props }) => {
|
|
975
970
|
const {
|
|
976
971
|
isDisabled,
|
|
977
972
|
type = "text",
|
|
@@ -1065,6 +1060,7 @@ var init_TextField = __esm({
|
|
|
1065
1060
|
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(ErrorMessage, { ...errorMessageProps, errorMessage })
|
|
1066
1061
|
] });
|
|
1067
1062
|
};
|
|
1063
|
+
TextField = (0, import_react11.memo)(TextFieldInner);
|
|
1068
1064
|
TextField.displayName = "TextField";
|
|
1069
1065
|
}
|
|
1070
1066
|
});
|
|
@@ -1082,17 +1078,17 @@ var MaskedField_exports = {};
|
|
|
1082
1078
|
__export(MaskedField_exports, {
|
|
1083
1079
|
MaskedField: () => MaskedField
|
|
1084
1080
|
});
|
|
1085
|
-
var
|
|
1081
|
+
var import_react51, import_react_imask, import_jsx_runtime77, useAcceptHandler, useCombinedRef, useBlurHandler, ControlledMaskedField, UncontrolledMaskedField, MaskedField;
|
|
1086
1082
|
var init_MaskedField = __esm({
|
|
1087
1083
|
"src/components/MaskedField/MaskedField.tsx"() {
|
|
1088
1084
|
"use strict";
|
|
1089
1085
|
"use client";
|
|
1090
|
-
|
|
1086
|
+
import_react51 = require("react");
|
|
1091
1087
|
import_react_imask = require("react-imask");
|
|
1092
1088
|
init_TextField2();
|
|
1093
|
-
|
|
1089
|
+
import_jsx_runtime77 = require("react/jsx-runtime");
|
|
1094
1090
|
useAcceptHandler = (onChange, useMaskedValue, name) => {
|
|
1095
|
-
return (0,
|
|
1091
|
+
return (0, import_react51.useCallback)(
|
|
1096
1092
|
(maskedValue, maskInstance) => {
|
|
1097
1093
|
if (!onChange) {
|
|
1098
1094
|
return;
|
|
@@ -1108,7 +1104,7 @@ var init_MaskedField = __esm({
|
|
|
1108
1104
|
);
|
|
1109
1105
|
};
|
|
1110
1106
|
useCombinedRef = (imaskRef, forwardedRef) => {
|
|
1111
|
-
return (0,
|
|
1107
|
+
return (0, import_react51.useCallback)(
|
|
1112
1108
|
(element) => {
|
|
1113
1109
|
imaskRef.current = element;
|
|
1114
1110
|
if (typeof forwardedRef === "function") {
|
|
@@ -1121,7 +1117,7 @@ var init_MaskedField = __esm({
|
|
|
1121
1117
|
);
|
|
1122
1118
|
};
|
|
1123
1119
|
useBlurHandler = (onBlur, maskRef, useMaskedValue, name) => {
|
|
1124
|
-
return (0,
|
|
1120
|
+
return (0, import_react51.useCallback)(
|
|
1125
1121
|
(event) => {
|
|
1126
1122
|
if (!onBlur || !maskRef.current) {
|
|
1127
1123
|
return;
|
|
@@ -1151,7 +1147,7 @@ var init_MaskedField = __esm({
|
|
|
1151
1147
|
const { ref: imaskRef, maskRef, setValue } = (0, import_react_imask.useIMask)(mask, { onAccept });
|
|
1152
1148
|
const combinedRef = useCombinedRef(imaskRef, forwardedRef);
|
|
1153
1149
|
const handleBlur = useBlurHandler(onBlur, maskRef, useMaskedValue, name);
|
|
1154
|
-
(0,
|
|
1150
|
+
(0, import_react51.useEffect)(() => {
|
|
1155
1151
|
if (!maskRef.current) {
|
|
1156
1152
|
return;
|
|
1157
1153
|
}
|
|
@@ -1162,7 +1158,7 @@ var init_MaskedField = __esm({
|
|
|
1162
1158
|
setValue(stringValue);
|
|
1163
1159
|
}
|
|
1164
1160
|
}, [value, maskRef, setValue, imaskRef]);
|
|
1165
|
-
return /* @__PURE__ */ (0,
|
|
1161
|
+
return /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
1166
1162
|
TextField,
|
|
1167
1163
|
{
|
|
1168
1164
|
...textFieldProps,
|
|
@@ -1186,7 +1182,7 @@ var init_MaskedField = __esm({
|
|
|
1186
1182
|
const { ref: imaskRef, maskRef } = (0, import_react_imask.useIMask)(mask, { onAccept });
|
|
1187
1183
|
const combinedRef = useCombinedRef(imaskRef, forwardedRef);
|
|
1188
1184
|
const handleBlur = useBlurHandler(onBlur, maskRef, useMaskedValue, name);
|
|
1189
|
-
return /* @__PURE__ */ (0,
|
|
1185
|
+
return /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
1190
1186
|
TextField,
|
|
1191
1187
|
{
|
|
1192
1188
|
...textFieldProps,
|
|
@@ -1200,7 +1196,7 @@ var init_MaskedField = __esm({
|
|
|
1200
1196
|
MaskedField = ({ ref: forwardedRef, ...props }) => {
|
|
1201
1197
|
const { value, defaultValue, ...rest } = props;
|
|
1202
1198
|
if ("value" in props) {
|
|
1203
|
-
return /* @__PURE__ */ (0,
|
|
1199
|
+
return /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
1204
1200
|
ControlledMaskedField,
|
|
1205
1201
|
{
|
|
1206
1202
|
...rest,
|
|
@@ -1209,7 +1205,7 @@ var init_MaskedField = __esm({
|
|
|
1209
1205
|
}
|
|
1210
1206
|
);
|
|
1211
1207
|
} else {
|
|
1212
|
-
return /* @__PURE__ */ (0,
|
|
1208
|
+
return /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
1213
1209
|
UncontrolledMaskedField,
|
|
1214
1210
|
{
|
|
1215
1211
|
...rest,
|
|
@@ -1274,6 +1270,7 @@ __export(src_exports, {
|
|
|
1274
1270
|
Select: () => Select,
|
|
1275
1271
|
Slider: () => Slider,
|
|
1276
1272
|
Stack: () => Stack,
|
|
1273
|
+
StickyOnMobile: () => StickyOnMobile,
|
|
1277
1274
|
Switch: () => Switch,
|
|
1278
1275
|
Table: () => Table2,
|
|
1279
1276
|
Text: () => Text,
|
|
@@ -1671,12 +1668,12 @@ AccordionList.displayName = "AccordionList";
|
|
|
1671
1668
|
|
|
1672
1669
|
// src/components/AddressLookup/AddressLookup.tsx
|
|
1673
1670
|
var import_icons3 = require("@simplybusiness/icons");
|
|
1674
|
-
var
|
|
1671
|
+
var import_react16 = require("react");
|
|
1675
1672
|
|
|
1676
1673
|
// src/components/Combobox/Combobox.tsx
|
|
1677
1674
|
var import_mobius_hooks5 = require("@simplybusiness/mobius-hooks");
|
|
1678
1675
|
var import_dedupe16 = __toESM(require("classnames/dedupe"));
|
|
1679
|
-
var
|
|
1676
|
+
var import_react15 = require("react");
|
|
1680
1677
|
init_hooks();
|
|
1681
1678
|
init_TextField2();
|
|
1682
1679
|
|
|
@@ -1715,7 +1712,7 @@ function VisuallyHidden(props) {
|
|
|
1715
1712
|
var import_dedupe15 = __toESM(require("classnames/dedupe"));
|
|
1716
1713
|
|
|
1717
1714
|
// src/components/Combobox/Option.tsx
|
|
1718
|
-
var
|
|
1715
|
+
var import_react12 = require("react");
|
|
1719
1716
|
var import_dedupe14 = __toESM(require("classnames/dedupe"));
|
|
1720
1717
|
|
|
1721
1718
|
// src/components/Combobox/utils.tsx
|
|
@@ -1750,13 +1747,13 @@ var Option = ({
|
|
|
1750
1747
|
optionTestIdPrefix,
|
|
1751
1748
|
id
|
|
1752
1749
|
}) => {
|
|
1753
|
-
const optionRef = (0,
|
|
1750
|
+
const optionRef = (0, import_react12.useRef)(null);
|
|
1754
1751
|
const optionValue = getOptionValue(option) || "";
|
|
1755
1752
|
const testId = buildOptionTestId(
|
|
1756
1753
|
optionTestIdPrefix || "combobox-option",
|
|
1757
1754
|
optionValue
|
|
1758
1755
|
);
|
|
1759
|
-
(0,
|
|
1756
|
+
(0, import_react12.useEffect)(() => {
|
|
1760
1757
|
if (isHighlighted && optionRef.current && optionRef.current.scrollIntoView) {
|
|
1761
1758
|
optionRef.current.scrollIntoView({ block: "nearest" });
|
|
1762
1759
|
}
|
|
@@ -1860,12 +1857,12 @@ var Listbox = ({
|
|
|
1860
1857
|
};
|
|
1861
1858
|
|
|
1862
1859
|
// src/components/Combobox/useComboboxHighlight.tsx
|
|
1863
|
-
var
|
|
1860
|
+
var import_react13 = require("react");
|
|
1864
1861
|
function useComboboxHighlight(options) {
|
|
1865
|
-
const [highlightedIndex, setHighlightedIndex] = (0,
|
|
1862
|
+
const [highlightedIndex, setHighlightedIndex] = (0, import_react13.useState)(
|
|
1866
1863
|
options && options.length ? 0 : -1
|
|
1867
1864
|
);
|
|
1868
|
-
const [highlightedGroupIndex, setHighlightedGroupIndex] = (0,
|
|
1865
|
+
const [highlightedGroupIndex, setHighlightedGroupIndex] = (0, import_react13.useState)(0);
|
|
1869
1866
|
function highlightNextOption() {
|
|
1870
1867
|
const isGroup = isOptionGroup(options);
|
|
1871
1868
|
if (!options) {
|
|
@@ -1944,7 +1941,7 @@ function useComboboxHighlight(options) {
|
|
|
1944
1941
|
|
|
1945
1942
|
// src/components/Combobox/useComboboxOptions.ts
|
|
1946
1943
|
var import_mobius_hooks4 = require("@simplybusiness/mobius-hooks");
|
|
1947
|
-
var
|
|
1944
|
+
var import_react14 = require("react");
|
|
1948
1945
|
function useComboboxOptions({
|
|
1949
1946
|
options,
|
|
1950
1947
|
asyncOptions,
|
|
@@ -1954,19 +1951,19 @@ function useComboboxOptions({
|
|
|
1954
1951
|
skipNextDebounceRef,
|
|
1955
1952
|
onSearched
|
|
1956
1953
|
}) {
|
|
1957
|
-
const [filteredOptions, setFilteredOptions] = (0,
|
|
1954
|
+
const [filteredOptions, setFilteredOptions] = (0, import_react14.useState)(void 0);
|
|
1958
1955
|
const debouncedInputValue = (0, import_mobius_hooks4.useDebouncedValue)(
|
|
1959
1956
|
inputValue,
|
|
1960
1957
|
// Don't debounce synchronous options
|
|
1961
1958
|
options ? 0 : delay
|
|
1962
1959
|
);
|
|
1963
|
-
const [isLoading, setIsLoading] = (0,
|
|
1964
|
-
const [error3, setError] = (0,
|
|
1965
|
-
const asyncOptionsRef = (0,
|
|
1960
|
+
const [isLoading, setIsLoading] = (0, import_react14.useState)(false);
|
|
1961
|
+
const [error3, setError] = (0, import_react14.useState)(null);
|
|
1962
|
+
const asyncOptionsRef = (0, import_react14.useRef)(asyncOptions);
|
|
1966
1963
|
asyncOptionsRef.current = asyncOptions;
|
|
1967
|
-
const onSearchedRef = (0,
|
|
1964
|
+
const onSearchedRef = (0, import_react14.useRef)(onSearched);
|
|
1968
1965
|
onSearchedRef.current = onSearched;
|
|
1969
|
-
(0,
|
|
1966
|
+
(0, import_react14.useEffect)(() => {
|
|
1970
1967
|
const controller = new AbortController();
|
|
1971
1968
|
const { signal } = controller;
|
|
1972
1969
|
const fetchOptions = async () => {
|
|
@@ -2053,11 +2050,11 @@ var ComboboxInner = ({
|
|
|
2053
2050
|
errorMessage,
|
|
2054
2051
|
...otherProps
|
|
2055
2052
|
} = props;
|
|
2056
|
-
const skipNextDebounceRef = (0,
|
|
2057
|
-
const fallbackRef = (0,
|
|
2058
|
-
const [inputValue, setInputValue] = (0,
|
|
2059
|
-
const [isOpen, setIsOpen] = (0,
|
|
2060
|
-
const [isChanging, setIsChanging] = (0,
|
|
2053
|
+
const skipNextDebounceRef = (0, import_react15.useRef)(false);
|
|
2054
|
+
const fallbackRef = (0, import_react15.useRef)(null);
|
|
2055
|
+
const [inputValue, setInputValue] = (0, import_react15.useState)(defaultValue || "");
|
|
2056
|
+
const [isOpen, setIsOpen] = (0, import_react15.useState)(false);
|
|
2057
|
+
const [isChanging, setIsChanging] = (0, import_react15.useState)(false);
|
|
2061
2058
|
const { filteredOptions, updateFilteredOptions, isLoading, error: error3 } = useComboboxOptions({
|
|
2062
2059
|
options,
|
|
2063
2060
|
asyncOptions,
|
|
@@ -2066,7 +2063,7 @@ var ComboboxInner = ({
|
|
|
2066
2063
|
minSearchLength,
|
|
2067
2064
|
skipNextDebounceRef
|
|
2068
2065
|
});
|
|
2069
|
-
const [validationError, setValidationError] = (0,
|
|
2066
|
+
const [validationError, setValidationError] = (0, import_react15.useState)(
|
|
2070
2067
|
error3?.message || errorMessage
|
|
2071
2068
|
);
|
|
2072
2069
|
const {
|
|
@@ -2079,14 +2076,14 @@ var ComboboxInner = ({
|
|
|
2079
2076
|
clearHighlight
|
|
2080
2077
|
} = useComboboxHighlight(filteredOptions);
|
|
2081
2078
|
const inputRef = ref || fallbackRef;
|
|
2082
|
-
const listboxId = (0,
|
|
2083
|
-
const statusId = (0,
|
|
2084
|
-
const blurTimeoutRef = (0,
|
|
2085
|
-
const userInteractedRef = (0,
|
|
2086
|
-
const justSelectedRef = (0,
|
|
2079
|
+
const listboxId = (0, import_react15.useId)();
|
|
2080
|
+
const statusId = (0, import_react15.useId)();
|
|
2081
|
+
const blurTimeoutRef = (0, import_react15.useRef)(null);
|
|
2082
|
+
const userInteractedRef = (0, import_react15.useRef)(false);
|
|
2083
|
+
const justSelectedRef = (0, import_react15.useRef)(false);
|
|
2087
2084
|
const { down } = useBreakpoint();
|
|
2088
2085
|
const isMobile = down("md");
|
|
2089
|
-
(0,
|
|
2086
|
+
(0, import_react15.useEffect)(() => {
|
|
2090
2087
|
setValidationError(error3?.message || errorMessage);
|
|
2091
2088
|
}, [error3, errorMessage]);
|
|
2092
2089
|
const getEmptyValue = () => {
|
|
@@ -2115,7 +2112,7 @@ var ComboboxInner = ({
|
|
|
2115
2112
|
justSelectedRef.current = false;
|
|
2116
2113
|
}
|
|
2117
2114
|
};
|
|
2118
|
-
(0,
|
|
2115
|
+
(0, import_react15.useEffect)(() => {
|
|
2119
2116
|
if (!inputRef || typeof inputRef === "function") return;
|
|
2120
2117
|
const inputElement = inputRef.current;
|
|
2121
2118
|
if (!inputElement) return;
|
|
@@ -2268,12 +2265,12 @@ var ComboboxInner = ({
|
|
|
2268
2265
|
default:
|
|
2269
2266
|
}
|
|
2270
2267
|
};
|
|
2271
|
-
(0,
|
|
2268
|
+
(0, import_react15.useEffect)(() => {
|
|
2272
2269
|
if (value) {
|
|
2273
2270
|
setInputValue(value);
|
|
2274
2271
|
}
|
|
2275
2272
|
}, [value]);
|
|
2276
|
-
(0,
|
|
2273
|
+
(0, import_react15.useEffect)(() => {
|
|
2277
2274
|
if (asyncOptions && isChanging) {
|
|
2278
2275
|
setIsOpen(!!filteredOptions && filteredOptions.length > 0);
|
|
2279
2276
|
}
|
|
@@ -2387,15 +2384,15 @@ var AddressLookup = ({
|
|
|
2387
2384
|
errorMessage,
|
|
2388
2385
|
...otherProps
|
|
2389
2386
|
}) => {
|
|
2390
|
-
const [error3, _setError] = (0,
|
|
2391
|
-
const setError = (0,
|
|
2387
|
+
const [error3, _setError] = (0, import_react16.useState)(null);
|
|
2388
|
+
const setError = (0, import_react16.useCallback)(
|
|
2392
2389
|
(newError) => {
|
|
2393
2390
|
if (newError != null) onError?.(newError);
|
|
2394
2391
|
_setError(newError);
|
|
2395
2392
|
},
|
|
2396
2393
|
[onError]
|
|
2397
2394
|
);
|
|
2398
|
-
const asyncOptions = (0,
|
|
2395
|
+
const asyncOptions = (0, import_react16.useCallback)(
|
|
2399
2396
|
async (searchTerm) => {
|
|
2400
2397
|
try {
|
|
2401
2398
|
const response = await addressLookupService.search(searchTerm);
|
|
@@ -2451,39 +2448,38 @@ var LOQATE_BASE_URL = "https://api.addressy.com/Capture/Interactive";
|
|
|
2451
2448
|
var LOQATE_FIND_URL = "/Find/v1.00/json3.ws";
|
|
2452
2449
|
var LOQATE_RETRIEVE_URL = "/Retrieve/v1.2/json3.ws";
|
|
2453
2450
|
var DEFAULT_COUNTRIES = ["GB"];
|
|
2454
|
-
var _baseUrl, _apiKey, _countries, _filters;
|
|
2455
2451
|
var LoqateAddressLookupService = class {
|
|
2452
|
+
/**
|
|
2453
|
+
* Base URL for the Loqate API
|
|
2454
|
+
*/
|
|
2455
|
+
#baseUrl;
|
|
2456
|
+
/**
|
|
2457
|
+
* API key for the Loqate API
|
|
2458
|
+
*/
|
|
2459
|
+
#apiKey;
|
|
2460
|
+
/**
|
|
2461
|
+
* List of allowed country codes for the Loqate API
|
|
2462
|
+
* 2 or 3 character ISO country codes
|
|
2463
|
+
*/
|
|
2464
|
+
#countries;
|
|
2465
|
+
/**
|
|
2466
|
+
* Optional filters for the Loqate API
|
|
2467
|
+
* E.g., { AdministrativeArea: "CA", PostalCode: "90210" }
|
|
2468
|
+
*/
|
|
2469
|
+
#filters;
|
|
2456
2470
|
constructor({
|
|
2457
2471
|
baseUrl,
|
|
2458
2472
|
apiKey,
|
|
2459
2473
|
countries,
|
|
2460
2474
|
filters
|
|
2461
2475
|
}) {
|
|
2462
|
-
|
|
2463
|
-
|
|
2464
|
-
|
|
2465
|
-
|
|
2466
|
-
/**
|
|
2467
|
-
* API key for the Loqate API
|
|
2468
|
-
*/
|
|
2469
|
-
__privateAdd(this, _apiKey);
|
|
2470
|
-
/**
|
|
2471
|
-
* List of allowed country codes for the Loqate API
|
|
2472
|
-
* 2 or 3 character ISO country codes
|
|
2473
|
-
*/
|
|
2474
|
-
__privateAdd(this, _countries);
|
|
2475
|
-
/**
|
|
2476
|
-
* Optional filters for the Loqate API
|
|
2477
|
-
* E.g., { AdministrativeArea: "CA", PostalCode: "90210" }
|
|
2478
|
-
*/
|
|
2479
|
-
__privateAdd(this, _filters);
|
|
2480
|
-
__privateSet(this, _apiKey, apiKey);
|
|
2481
|
-
__privateSet(this, _baseUrl, baseUrl || LOQATE_BASE_URL);
|
|
2482
|
-
__privateSet(this, _countries, countries || DEFAULT_COUNTRIES);
|
|
2483
|
-
__privateSet(this, _filters, filters);
|
|
2476
|
+
this.#apiKey = apiKey;
|
|
2477
|
+
this.#baseUrl = baseUrl || LOQATE_BASE_URL;
|
|
2478
|
+
this.#countries = countries || DEFAULT_COUNTRIES;
|
|
2479
|
+
this.#filters = filters;
|
|
2484
2480
|
}
|
|
2485
2481
|
fetchFromApi(url) {
|
|
2486
|
-
return fetch(`${
|
|
2482
|
+
return fetch(`${this.#baseUrl}${url}`).then((response) => response.json()).then((json) => {
|
|
2487
2483
|
if (json.Items?.some((item) => item.Error)) {
|
|
2488
2484
|
throw new LoqateAddressLookupError(json);
|
|
2489
2485
|
}
|
|
@@ -2498,32 +2494,28 @@ var LoqateAddressLookupService = class {
|
|
|
2498
2494
|
* @returns Empty string if no filters, otherwise "&Filters=key1:value1&key2:value2" (Loqate's expected format for Filters)
|
|
2499
2495
|
*/
|
|
2500
2496
|
buildFiltersQuery() {
|
|
2501
|
-
if (!
|
|
2497
|
+
if (!this.#filters || Object.keys(this.#filters).length === 0) {
|
|
2502
2498
|
return "";
|
|
2503
2499
|
}
|
|
2504
|
-
const encodedFilters = Object.entries(
|
|
2500
|
+
const encodedFilters = Object.entries(this.#filters).map(([key, value]) => `${key}:${encodeURIComponent(value)}`).join("&");
|
|
2505
2501
|
return `&Filters=${encodedFilters}`;
|
|
2506
2502
|
}
|
|
2507
2503
|
search(searchTerm) {
|
|
2508
|
-
let url = `${LOQATE_FIND_URL}?Key=${
|
|
2504
|
+
let url = `${LOQATE_FIND_URL}?Key=${this.#apiKey}&Text=${searchTerm}&Countries=${this.#countries?.join(",")}`;
|
|
2509
2505
|
url += this.buildFiltersQuery();
|
|
2510
2506
|
return this.fetchFromApi(url);
|
|
2511
2507
|
}
|
|
2512
2508
|
findById(id) {
|
|
2513
|
-
let url = `${LOQATE_FIND_URL}?Key=${
|
|
2509
|
+
let url = `${LOQATE_FIND_URL}?Key=${this.#apiKey}&Container=${id}&Countries=${this.#countries?.join(",")}`;
|
|
2514
2510
|
url += this.buildFiltersQuery();
|
|
2515
2511
|
return this.fetchFromApi(url);
|
|
2516
2512
|
}
|
|
2517
2513
|
async get(id) {
|
|
2518
|
-
const url = `${LOQATE_RETRIEVE_URL}?Key=${
|
|
2514
|
+
const url = `${LOQATE_RETRIEVE_URL}?Key=${this.#apiKey}&Id=${id}`;
|
|
2519
2515
|
const response = await this.fetchFromApi(url);
|
|
2520
2516
|
return response.Items[0];
|
|
2521
2517
|
}
|
|
2522
2518
|
};
|
|
2523
|
-
_baseUrl = new WeakMap();
|
|
2524
|
-
_apiKey = new WeakMap();
|
|
2525
|
-
_countries = new WeakMap();
|
|
2526
|
-
_filters = new WeakMap();
|
|
2527
2519
|
|
|
2528
2520
|
// src/components/Alert/Alert.tsx
|
|
2529
2521
|
var import_icons4 = require("@simplybusiness/icons");
|
|
@@ -2642,7 +2634,7 @@ var Box = ({ ref, ...props }) => {
|
|
|
2642
2634
|
Box.displayName = "Box";
|
|
2643
2635
|
|
|
2644
2636
|
// src/components/Breadcrumbs/Breadcrumbs.tsx
|
|
2645
|
-
var
|
|
2637
|
+
var import_react17 = require("react");
|
|
2646
2638
|
var import_dedupe19 = __toESM(require("classnames/dedupe"));
|
|
2647
2639
|
var import_Breadcrumbs = require("@simplybusiness/mobius/src/components/Breadcrumbs/Breadcrumbs.css");
|
|
2648
2640
|
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
@@ -2650,26 +2642,22 @@ var Breadcrumbs = ({ ref, ...props }) => {
|
|
|
2650
2642
|
const { "aria-label": ariaLabel = "Breadcrumbs" } = props;
|
|
2651
2643
|
const { navProps } = { navProps: { "aria-label": ariaLabel } };
|
|
2652
2644
|
const { children, ...otherProps } = props;
|
|
2653
|
-
const childArray =
|
|
2645
|
+
const childArray = import_react17.Children.toArray(children);
|
|
2654
2646
|
const classes = (0, import_dedupe19.default)(
|
|
2655
2647
|
"mobius",
|
|
2656
2648
|
"mobius-breadcrumb",
|
|
2657
2649
|
otherProps.className
|
|
2658
2650
|
);
|
|
2659
2651
|
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("nav", { ref, ...otherProps, ...navProps, className: classes, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("ul", { children: childArray.map(
|
|
2660
|
-
(child, i) => (0,
|
|
2661
|
-
|
|
2662
|
-
|
|
2663
|
-
key: i,
|
|
2664
|
-
isCurrent: i === childArray.length - 1
|
|
2665
|
-
}
|
|
2666
|
-
)
|
|
2652
|
+
(child, i) => (0, import_react17.cloneElement)(child, {
|
|
2653
|
+
isCurrent: i === childArray.length - 1
|
|
2654
|
+
})
|
|
2667
2655
|
) }) });
|
|
2668
2656
|
};
|
|
2669
2657
|
Breadcrumbs.displayName = "Breadcrumbs";
|
|
2670
2658
|
|
|
2671
2659
|
// src/components/Breadcrumbs/BreadcrumbItem.tsx
|
|
2672
|
-
var
|
|
2660
|
+
var import_react18 = require("react");
|
|
2673
2661
|
var import_dedupe20 = __toESM(require("classnames/dedupe"));
|
|
2674
2662
|
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
2675
2663
|
var BreadcrumbItem = ({ ref, ...props }) => {
|
|
@@ -2693,9 +2681,9 @@ var BreadcrumbItem = ({ ref, ...props }) => {
|
|
|
2693
2681
|
"mobius-breadcrumb__item",
|
|
2694
2682
|
props.className
|
|
2695
2683
|
);
|
|
2696
|
-
const child = typeof children === "string" ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { ...itemProps, children }) :
|
|
2684
|
+
const child = typeof children === "string" ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { ...itemProps, children }) : import_react18.Children.only(children);
|
|
2697
2685
|
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("li", { className: classes, children: [
|
|
2698
|
-
(0,
|
|
2686
|
+
(0, import_react18.cloneElement)(child, {
|
|
2699
2687
|
...child.props,
|
|
2700
2688
|
...itemProps,
|
|
2701
2689
|
ref
|
|
@@ -2770,7 +2758,7 @@ var Button = ({ ref, ...props }) => {
|
|
|
2770
2758
|
Button.displayName = "Button";
|
|
2771
2759
|
|
|
2772
2760
|
// src/components/Checkbox/Checkbox.tsx
|
|
2773
|
-
var
|
|
2761
|
+
var import_react19 = require("react");
|
|
2774
2762
|
var import_dedupe22 = __toESM(require("classnames/dedupe"));
|
|
2775
2763
|
var import_icons7 = require("@simplybusiness/icons");
|
|
2776
2764
|
init_ErrorMessage2();
|
|
@@ -2799,12 +2787,12 @@ var Checkbox = ({ ref, ...props }) => {
|
|
|
2799
2787
|
["aria-describedby"]: ariaDescribedBy,
|
|
2800
2788
|
...rest
|
|
2801
2789
|
} = props;
|
|
2802
|
-
const [checked, setChecked] = (0,
|
|
2803
|
-
const fallbackRef = (0,
|
|
2790
|
+
const [checked, setChecked] = (0, import_react19.useState)(defaultSelected);
|
|
2791
|
+
const fallbackRef = (0, import_react19.useRef)(null);
|
|
2804
2792
|
const refObj = ref || fallbackRef;
|
|
2805
|
-
const inputId = (0,
|
|
2793
|
+
const inputId = (0, import_react19.useId)();
|
|
2806
2794
|
const isControlled = typeof selected === "boolean";
|
|
2807
|
-
(0,
|
|
2795
|
+
(0, import_react19.useEffect)(() => {
|
|
2808
2796
|
if (isControlled) {
|
|
2809
2797
|
setChecked(selected);
|
|
2810
2798
|
}
|
|
@@ -2828,13 +2816,13 @@ var Checkbox = ({ ref, ...props }) => {
|
|
|
2828
2816
|
const labelClasses = (0, import_dedupe22.default)("mobius-checkbox__label", sharedClasses);
|
|
2829
2817
|
const inputClasses = (0, import_dedupe22.default)("mobius-checkbox__input", sharedClasses);
|
|
2830
2818
|
const iconClasses = (0, import_dedupe22.default)("mobius-checkbox__icon", sharedClasses);
|
|
2831
|
-
const errorMessageId = (0,
|
|
2819
|
+
const errorMessageId = (0, import_react19.useId)();
|
|
2832
2820
|
const shouldErrorMessageShow = errorMessage ? errorMessageId : void 0;
|
|
2833
2821
|
const describedBy = spaceDelimitedList([
|
|
2834
2822
|
shouldErrorMessageShow,
|
|
2835
2823
|
ariaDescribedBy
|
|
2836
2824
|
]);
|
|
2837
|
-
const labelId = (0,
|
|
2825
|
+
const labelId = (0, import_react19.useId)();
|
|
2838
2826
|
const handleChange = (event) => {
|
|
2839
2827
|
setChecked(!checked);
|
|
2840
2828
|
if (onChange) {
|
|
@@ -2881,7 +2869,7 @@ Checkbox.displayName = "Checkbox";
|
|
|
2881
2869
|
|
|
2882
2870
|
// src/components/Checkbox/CheckboxGroup.tsx
|
|
2883
2871
|
var import_dedupe23 = __toESM(require("classnames/dedupe"));
|
|
2884
|
-
var
|
|
2872
|
+
var import_react20 = require("react");
|
|
2885
2873
|
init_hooks();
|
|
2886
2874
|
init_spaceDelimitedList();
|
|
2887
2875
|
init_ErrorMessage2();
|
|
@@ -2905,10 +2893,10 @@ var CheckboxGroup = ({ ref, ...props }) => {
|
|
|
2905
2893
|
lastItemDisables = false,
|
|
2906
2894
|
...rest
|
|
2907
2895
|
} = props;
|
|
2908
|
-
const [selected, setSelected] = (0,
|
|
2909
|
-
const isInitializedRef = (0,
|
|
2910
|
-
const prevDefaultValueRef = (0,
|
|
2911
|
-
(0,
|
|
2896
|
+
const [selected, setSelected] = (0, import_react20.useState)(defaultValue);
|
|
2897
|
+
const isInitializedRef = (0, import_react20.useRef)(false);
|
|
2898
|
+
const prevDefaultValueRef = (0, import_react20.useRef)(defaultValue);
|
|
2899
|
+
(0, import_react20.useEffect)(() => {
|
|
2912
2900
|
const hasChanged = defaultValue.length !== prevDefaultValueRef.current.length || defaultValue.some(
|
|
2913
2901
|
(val, index) => val !== prevDefaultValueRef.current[index]
|
|
2914
2902
|
);
|
|
@@ -2936,13 +2924,13 @@ var CheckboxGroup = ({ ref, ...props }) => {
|
|
|
2936
2924
|
},
|
|
2937
2925
|
validationClasses
|
|
2938
2926
|
);
|
|
2939
|
-
const errorMessageId = (0,
|
|
2927
|
+
const errorMessageId = (0, import_react20.useId)();
|
|
2940
2928
|
const shouldErrorMessageShow = errorMessage ? errorMessageId : void 0;
|
|
2941
2929
|
const describedBy = spaceDelimitedList([
|
|
2942
2930
|
shouldErrorMessageShow,
|
|
2943
2931
|
props["aria-describedby"]
|
|
2944
2932
|
]);
|
|
2945
|
-
const labelId = (0,
|
|
2933
|
+
const labelId = (0, import_react20.useId)();
|
|
2946
2934
|
const handleChange = (event, isLastItem = false) => {
|
|
2947
2935
|
const {
|
|
2948
2936
|
target: { value, checked }
|
|
@@ -2960,9 +2948,9 @@ var CheckboxGroup = ({ ref, ...props }) => {
|
|
|
2960
2948
|
setSelected(newValue);
|
|
2961
2949
|
onChange?.(newValue);
|
|
2962
2950
|
};
|
|
2963
|
-
const childrenArray =
|
|
2951
|
+
const childrenArray = import_react20.Children.toArray(children);
|
|
2964
2952
|
const lastCheckbox = childrenArray.filter(
|
|
2965
|
-
(child) => (0,
|
|
2953
|
+
(child) => (0, import_react20.isValidElement)(child) && child.type === Checkbox
|
|
2966
2954
|
).pop();
|
|
2967
2955
|
const lastCheckboxIsChecked = lastCheckbox && selected.includes(lastCheckbox.props.value);
|
|
2968
2956
|
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
@@ -2974,16 +2962,16 @@ var CheckboxGroup = ({ ref, ...props }) => {
|
|
|
2974
2962
|
className: checkboxGroupClasses,
|
|
2975
2963
|
role: "group",
|
|
2976
2964
|
style: {
|
|
2977
|
-
"--checkbox-items-per-row": itemsPerRow ||
|
|
2965
|
+
"--checkbox-items-per-row": itemsPerRow || import_react20.Children.count(children)
|
|
2978
2966
|
},
|
|
2979
2967
|
children: [
|
|
2980
2968
|
label && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Label, { elementType: "span", id: labelId, className: labelClasses, children: label }),
|
|
2981
2969
|
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "mobius-checkbox-group__wrapper", children: childrenArray.map((child) => {
|
|
2982
|
-
if ((0,
|
|
2970
|
+
if ((0, import_react20.isValidElement)(child)) {
|
|
2983
2971
|
const isLastItem = child === lastCheckbox;
|
|
2984
2972
|
const isChildDisabled = isDisabled || lastItemDisables && lastCheckboxIsChecked && !isLastItem;
|
|
2985
2973
|
const childProps = child.props;
|
|
2986
|
-
return (0,
|
|
2974
|
+
return (0, import_react20.cloneElement)(
|
|
2987
2975
|
child,
|
|
2988
2976
|
{
|
|
2989
2977
|
isDisabled: isChildDisabled,
|
|
@@ -3025,7 +3013,7 @@ Container.displayName = "Container";
|
|
|
3025
3013
|
|
|
3026
3014
|
// src/components/DateField/DateField.tsx
|
|
3027
3015
|
var import_dedupe25 = __toESM(require("classnames/dedupe"));
|
|
3028
|
-
var
|
|
3016
|
+
var import_react21 = require("react");
|
|
3029
3017
|
init_mergeRefs();
|
|
3030
3018
|
init_TextField2();
|
|
3031
3019
|
|
|
@@ -3075,9 +3063,9 @@ var DateField = ({ ref, ...props }) => {
|
|
|
3075
3063
|
value,
|
|
3076
3064
|
...otherProps
|
|
3077
3065
|
} = props;
|
|
3078
|
-
const [error3, setError] = (0,
|
|
3079
|
-
const [isInvalid, setIsInvalid] = (0,
|
|
3080
|
-
const localRef = (0,
|
|
3066
|
+
const [error3, setError] = (0, import_react21.useState)(errorMessage);
|
|
3067
|
+
const [isInvalid, setIsInvalid] = (0, import_react21.useState)(void 0);
|
|
3068
|
+
const localRef = (0, import_react21.useRef)(null);
|
|
3081
3069
|
const classes = (0, import_dedupe25.default)("mobius-date-field", className);
|
|
3082
3070
|
const formattedMin = min ? convertToDateFormat(min, format) : void 0;
|
|
3083
3071
|
const formattedMax = max ? convertToDateFormat(max, format) : void 0;
|
|
@@ -3091,7 +3079,7 @@ var DateField = ({ ref, ...props }) => {
|
|
|
3091
3079
|
setError(props.errorMessage);
|
|
3092
3080
|
setIsInvalid(false);
|
|
3093
3081
|
};
|
|
3094
|
-
(0,
|
|
3082
|
+
(0, import_react21.useEffect)(() => {
|
|
3095
3083
|
if (!isValidDate(min, format)) {
|
|
3096
3084
|
setInvalidState(`Invalid min date: ${min}`);
|
|
3097
3085
|
return;
|
|
@@ -3150,13 +3138,13 @@ Content.displayName = "Content";
|
|
|
3150
3138
|
|
|
3151
3139
|
// src/components/Drawer/Drawer.tsx
|
|
3152
3140
|
var import_dedupe26 = __toESM(require("classnames/dedupe"));
|
|
3153
|
-
var
|
|
3141
|
+
var import_react23 = require("react");
|
|
3154
3142
|
init_hooks();
|
|
3155
3143
|
init_utils();
|
|
3156
3144
|
|
|
3157
3145
|
// src/components/Drawer/DrawerContext.tsx
|
|
3158
|
-
var
|
|
3159
|
-
var DrawerContext = (0,
|
|
3146
|
+
var import_react22 = require("react");
|
|
3147
|
+
var DrawerContext = (0, import_react22.createContext)({
|
|
3160
3148
|
onClose: () => {
|
|
3161
3149
|
},
|
|
3162
3150
|
closeLabel: void 0,
|
|
@@ -3178,8 +3166,8 @@ var Drawer = ({ ref, ...props }) => {
|
|
|
3178
3166
|
onClose,
|
|
3179
3167
|
children
|
|
3180
3168
|
} = props;
|
|
3181
|
-
const dialogRef = (0,
|
|
3182
|
-
const [shouldTransition, setShouldTransition] = (0,
|
|
3169
|
+
const dialogRef = (0, import_react23.useRef)(null);
|
|
3170
|
+
const [shouldTransition, setShouldTransition] = (0, import_react23.useState)(false);
|
|
3183
3171
|
const { close } = useDialog({
|
|
3184
3172
|
ref: dialogRef,
|
|
3185
3173
|
isOpen,
|
|
@@ -3190,8 +3178,8 @@ var Drawer = ({ ref, ...props }) => {
|
|
|
3190
3178
|
CSSVariable: TRANSITION_CSS_VARIABLE
|
|
3191
3179
|
}
|
|
3192
3180
|
});
|
|
3193
|
-
const hiddenId = `dialog-screen-reader-announce-${(0,
|
|
3194
|
-
const headerId = `dialog-header-${(0,
|
|
3181
|
+
const hiddenId = `dialog-screen-reader-announce-${(0, import_react23.useId)()}`;
|
|
3182
|
+
const headerId = `dialog-header-${(0, import_react23.useId)()}`;
|
|
3195
3183
|
const dialogClasses = (0, import_dedupe26.default)(
|
|
3196
3184
|
"mobius",
|
|
3197
3185
|
"mobius-drawer",
|
|
@@ -3201,10 +3189,10 @@ var Drawer = ({ ref, ...props }) => {
|
|
|
3201
3189
|
"--should-transition": shouldTransition
|
|
3202
3190
|
}
|
|
3203
3191
|
);
|
|
3204
|
-
(0,
|
|
3192
|
+
(0, import_react23.useEffect)(() => {
|
|
3205
3193
|
setShouldTransition(supportsDialog());
|
|
3206
3194
|
}, []);
|
|
3207
|
-
const contextValue = (0,
|
|
3195
|
+
const contextValue = (0, import_react23.useMemo)(
|
|
3208
3196
|
() => ({
|
|
3209
3197
|
onClose: close,
|
|
3210
3198
|
closeLabel,
|
|
@@ -3215,7 +3203,7 @@ var Drawer = ({ ref, ...props }) => {
|
|
|
3215
3203
|
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
|
|
3216
3204
|
"dialog",
|
|
3217
3205
|
{
|
|
3218
|
-
id: (0,
|
|
3206
|
+
id: (0, import_react23.useId)(),
|
|
3219
3207
|
ref: mergeRefs([dialogRef, ref]),
|
|
3220
3208
|
onCancel: close,
|
|
3221
3209
|
className: dialogClasses,
|
|
@@ -3231,9 +3219,9 @@ var Drawer = ({ ref, ...props }) => {
|
|
|
3231
3219
|
Drawer.displayName = "Drawer";
|
|
3232
3220
|
|
|
3233
3221
|
// src/components/Drawer/useDrawer.ts
|
|
3234
|
-
var
|
|
3222
|
+
var import_react24 = require("react");
|
|
3235
3223
|
var useDrawer = () => {
|
|
3236
|
-
const { onClose, closeLabel, headerId } = (0,
|
|
3224
|
+
const { onClose, closeLabel, headerId } = (0, import_react24.useContext)(DrawerContext);
|
|
3237
3225
|
return { onClose, closeLabel, headerId };
|
|
3238
3226
|
};
|
|
3239
3227
|
|
|
@@ -3272,7 +3260,7 @@ var Drawer2 = Object.assign(Drawer, {
|
|
|
3272
3260
|
Drawer2.displayName = "Drawer";
|
|
3273
3261
|
|
|
3274
3262
|
// src/components/DropdownMenu/DropdownMenu.tsx
|
|
3275
|
-
var
|
|
3263
|
+
var import_react25 = require("react");
|
|
3276
3264
|
var import_react_accessible_dropdown_menu_hook = __toESM(require("react-accessible-dropdown-menu-hook"));
|
|
3277
3265
|
var import_dedupe27 = __toESM(require("classnames/dedupe"));
|
|
3278
3266
|
var import_DropdownMenu = require("@simplybusiness/mobius/src/components/DropdownMenu/DropdownMenu.css");
|
|
@@ -3285,8 +3273,8 @@ var DropdownMenu = ({ ref, ...props }) => {
|
|
|
3285
3273
|
children,
|
|
3286
3274
|
...otherProps
|
|
3287
3275
|
} = props;
|
|
3288
|
-
const [activeId, setActiveId] = (0,
|
|
3289
|
-
const numberOfItems =
|
|
3276
|
+
const [activeId, setActiveId] = (0, import_react25.useState)(null);
|
|
3277
|
+
const numberOfItems = import_react25.Children.count(children);
|
|
3290
3278
|
const {
|
|
3291
3279
|
buttonProps,
|
|
3292
3280
|
itemProps,
|
|
@@ -3310,15 +3298,15 @@ var DropdownMenu = ({ ref, ...props }) => {
|
|
|
3310
3298
|
}
|
|
3311
3299
|
};
|
|
3312
3300
|
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(Element, { ref, ...otherProps, className: classes, children: [
|
|
3313
|
-
trigger ? (0,
|
|
3301
|
+
trigger ? (0, import_react25.cloneElement)(trigger, {
|
|
3314
3302
|
className: triggerClasses,
|
|
3315
3303
|
open,
|
|
3316
3304
|
label,
|
|
3317
3305
|
...buttonProps
|
|
3318
3306
|
}) : /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Button, { className: triggerClasses, ...buttonProps, children: label }),
|
|
3319
|
-
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("ul", { className: listClasses, role: "menu", children:
|
|
3320
|
-
if ((0,
|
|
3321
|
-
return (0,
|
|
3307
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("ul", { className: listClasses, role: "menu", children: import_react25.Children.map(children, (child, index) => {
|
|
3308
|
+
if ((0, import_react25.isValidElement)(child)) {
|
|
3309
|
+
return (0, import_react25.cloneElement)(child, {
|
|
3322
3310
|
onClick: () => handleChildClick(child.props, index),
|
|
3323
3311
|
active: index === activeId,
|
|
3324
3312
|
...itemProps[index]
|
|
@@ -3331,7 +3319,7 @@ var DropdownMenu = ({ ref, ...props }) => {
|
|
|
3331
3319
|
DropdownMenu.displayName = "DropdownMenu";
|
|
3332
3320
|
|
|
3333
3321
|
// src/components/DropdownMenu/Item.tsx
|
|
3334
|
-
var
|
|
3322
|
+
var import_react26 = require("react");
|
|
3335
3323
|
var import_dedupe28 = __toESM(require("classnames/dedupe"));
|
|
3336
3324
|
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
3337
3325
|
var Item = ({ ref, ...props }) => {
|
|
@@ -3348,18 +3336,15 @@ var Item = ({ ref, ...props }) => {
|
|
|
3348
3336
|
{ "--is-active": active },
|
|
3349
3337
|
otherProps.className
|
|
3350
3338
|
);
|
|
3351
|
-
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Element, { ref, onClick, ...otherProps, children:
|
|
3352
|
-
if ((0,
|
|
3339
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Element, { ref, onClick, ...otherProps, children: import_react26.Children.map(children, (child) => {
|
|
3340
|
+
if ((0, import_react26.isValidElement)(child)) {
|
|
3353
3341
|
const childClasses = (0, import_dedupe28.default)(
|
|
3354
3342
|
child.props.className,
|
|
3355
3343
|
classes
|
|
3356
3344
|
);
|
|
3357
|
-
return (0,
|
|
3358
|
-
|
|
3359
|
-
|
|
3360
|
-
className: childClasses
|
|
3361
|
-
}
|
|
3362
|
-
);
|
|
3345
|
+
return (0, import_react26.cloneElement)(child, {
|
|
3346
|
+
className: childClasses
|
|
3347
|
+
});
|
|
3363
3348
|
}
|
|
3364
3349
|
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: classes, children: child });
|
|
3365
3350
|
}) });
|
|
@@ -3377,7 +3362,7 @@ DropdownMenu2.displayName = "DropdownMenu";
|
|
|
3377
3362
|
|
|
3378
3363
|
// src/components/Fieldset/Fieldset.tsx
|
|
3379
3364
|
var import_dedupe29 = __toESM(require("classnames/dedupe"));
|
|
3380
|
-
var
|
|
3365
|
+
var import_react27 = require("react");
|
|
3381
3366
|
var import_Fieldset = require("@simplybusiness/mobius/src/components/Fieldset/Fieldset.css");
|
|
3382
3367
|
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
3383
3368
|
var useFieldset = (props) => {
|
|
@@ -3386,7 +3371,7 @@ var useFieldset = (props) => {
|
|
|
3386
3371
|
let containerProps = {
|
|
3387
3372
|
role: "group"
|
|
3388
3373
|
};
|
|
3389
|
-
const legendId = (0,
|
|
3374
|
+
const legendId = (0, import_react27.useId)();
|
|
3390
3375
|
if (legend) {
|
|
3391
3376
|
legendProps = {
|
|
3392
3377
|
...legendProps,
|
|
@@ -3413,7 +3398,7 @@ var Fieldset = ({ ref: _ref, ...props }) => {
|
|
|
3413
3398
|
const classes = (0, import_dedupe29.default)("mobius", "mobius-fieldset", props.className);
|
|
3414
3399
|
legendProps.className = "mobius-fieldset__legend";
|
|
3415
3400
|
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(Flex, { ...containerProps, ...otherProps, className: classes, children: [
|
|
3416
|
-
legend && (0,
|
|
3401
|
+
legend && (0, import_react27.cloneElement)(legendComponent, { ...legendProps }, [legend]),
|
|
3417
3402
|
children
|
|
3418
3403
|
] });
|
|
3419
3404
|
};
|
|
@@ -3456,7 +3441,7 @@ var Grid = ({ ref, ...props }) => {
|
|
|
3456
3441
|
Grid.displayName = "Grid";
|
|
3457
3442
|
|
|
3458
3443
|
// src/components/Grid/Item.tsx
|
|
3459
|
-
var
|
|
3444
|
+
var import_react28 = require("react");
|
|
3460
3445
|
var import_dedupe31 = __toESM(require("classnames/dedupe"));
|
|
3461
3446
|
init_hooks();
|
|
3462
3447
|
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
@@ -3494,9 +3479,9 @@ var GridItem = ({ ref, ...props }) => {
|
|
|
3494
3479
|
xl,
|
|
3495
3480
|
xxl
|
|
3496
3481
|
});
|
|
3497
|
-
const [responsiveSpan, setResponsiveSpan] = (0,
|
|
3482
|
+
const [responsiveSpan, setResponsiveSpan] = (0, import_react28.useState)();
|
|
3498
3483
|
const classes = (0, import_dedupe31.default)("mobius", "mobius-grid__item", className);
|
|
3499
|
-
(0,
|
|
3484
|
+
(0, import_react28.useEffect)(() => {
|
|
3500
3485
|
setResponsiveSpan(breakpointMap[breakpointSize]);
|
|
3501
3486
|
}, [breakpointSize, breakpointMap]);
|
|
3502
3487
|
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,
|
|
@@ -4948,16 +4933,31 @@ var Slider = (props) => {
|
|
|
4948
4933
|
] });
|
|
4949
4934
|
};
|
|
4950
4935
|
|
|
4951
|
-
// src/components/
|
|
4952
|
-
var import_react45 = require("react");
|
|
4936
|
+
// src/components/StickyOnMobile/StickyOnMobile.tsx
|
|
4953
4937
|
var import_dedupe50 = __toESM(require("classnames/dedupe"));
|
|
4938
|
+
var import_StickyOnMobile = require("@simplybusiness/mobius/src/components/StickyOnMobile/StickyOnMobile.css");
|
|
4954
4939
|
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
4940
|
+
var StickyOnMobile = ({ ref, ...props }) => {
|
|
4941
|
+
const { elementType: Element = "div", ...otherProps } = props;
|
|
4942
|
+
const classes = (0, import_dedupe50.default)(
|
|
4943
|
+
"mobius",
|
|
4944
|
+
"mobius-sticky-on-mobile",
|
|
4945
|
+
otherProps.className
|
|
4946
|
+
);
|
|
4947
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(Element, { ref, ...otherProps, className: classes });
|
|
4948
|
+
};
|
|
4949
|
+
StickyOnMobile.displayName = "StickyOnMobile";
|
|
4950
|
+
|
|
4951
|
+
// src/components/SVG/SVG.tsx
|
|
4952
|
+
var import_react46 = require("react");
|
|
4953
|
+
var import_dedupe51 = __toESM(require("classnames/dedupe"));
|
|
4954
|
+
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
4955
4955
|
var SVG = ({ ref, ...props }) => {
|
|
4956
4956
|
const { children, className, ...otherProps } = props;
|
|
4957
|
-
const classes = (0,
|
|
4958
|
-
const svgNode =
|
|
4957
|
+
const classes = (0, import_dedupe51.default)("mobius", "mobius-svg", className);
|
|
4958
|
+
const svgNode = import_react46.Children.only(children);
|
|
4959
4959
|
const { children: svgChildren, viewBox, xmlns } = svgNode.props;
|
|
4960
|
-
return /* @__PURE__ */ (0,
|
|
4960
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
4961
4961
|
"svg",
|
|
4962
4962
|
{
|
|
4963
4963
|
viewBox,
|
|
@@ -4972,10 +4972,10 @@ var SVG = ({ ref, ...props }) => {
|
|
|
4972
4972
|
SVG.displayName = "SVG";
|
|
4973
4973
|
|
|
4974
4974
|
// src/components/Switch/Switch.tsx
|
|
4975
|
-
var
|
|
4976
|
-
var
|
|
4975
|
+
var import_react47 = require("react");
|
|
4976
|
+
var import_dedupe52 = __toESM(require("classnames/dedupe"));
|
|
4977
4977
|
var import_Switch = require("@simplybusiness/mobius/src/components/Switch/Switch.css");
|
|
4978
|
-
var
|
|
4978
|
+
var import_jsx_runtime62 = require("react/jsx-runtime");
|
|
4979
4979
|
var Switch = ({ ref, ...props }) => {
|
|
4980
4980
|
const {
|
|
4981
4981
|
checked = false,
|
|
@@ -4984,11 +4984,11 @@ var Switch = ({ ref, ...props }) => {
|
|
|
4984
4984
|
isDisabled = false,
|
|
4985
4985
|
...otherProps
|
|
4986
4986
|
} = props;
|
|
4987
|
-
const [enabled, setEnabled] = (0,
|
|
4988
|
-
(0,
|
|
4987
|
+
const [enabled, setEnabled] = (0, import_react47.useState)(checked);
|
|
4988
|
+
(0, import_react47.useEffect)(() => {
|
|
4989
4989
|
setEnabled(checked);
|
|
4990
4990
|
}, [checked]);
|
|
4991
|
-
const classes = (0,
|
|
4991
|
+
const classes = (0, import_dedupe52.default)(
|
|
4992
4992
|
"mobius",
|
|
4993
4993
|
"mobius-switch",
|
|
4994
4994
|
{
|
|
@@ -5003,9 +5003,9 @@ var Switch = ({ ref, ...props }) => {
|
|
|
5003
5003
|
onChange(event);
|
|
5004
5004
|
}
|
|
5005
5005
|
};
|
|
5006
|
-
return /* @__PURE__ */ (0,
|
|
5007
|
-
/* @__PURE__ */ (0,
|
|
5008
|
-
/* @__PURE__ */ (0,
|
|
5006
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("label", { ref, className: classes, children: [
|
|
5007
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(VisuallyHidden, { children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("span", { children: enabled ? "On" : "Off" }) }),
|
|
5008
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
5009
5009
|
"input",
|
|
5010
5010
|
{
|
|
5011
5011
|
type: "checkbox",
|
|
@@ -5016,80 +5016,80 @@ var Switch = ({ ref, ...props }) => {
|
|
|
5016
5016
|
...otherProps
|
|
5017
5017
|
}
|
|
5018
5018
|
),
|
|
5019
|
-
/* @__PURE__ */ (0,
|
|
5019
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("span", { className: "mobius-switch__slider" })
|
|
5020
5020
|
] });
|
|
5021
5021
|
};
|
|
5022
5022
|
Switch.displayName = "Switch";
|
|
5023
5023
|
|
|
5024
5024
|
// src/components/Table/Table.tsx
|
|
5025
|
-
var
|
|
5025
|
+
var import_dedupe53 = __toESM(require("classnames/dedupe"));
|
|
5026
5026
|
var import_Table = require("@simplybusiness/mobius/src/components/Table/Table.css");
|
|
5027
|
-
var
|
|
5027
|
+
var import_jsx_runtime63 = require("react/jsx-runtime");
|
|
5028
5028
|
var Table = ({ ref, ...props }) => {
|
|
5029
|
-
const classes = (0,
|
|
5030
|
-
return /* @__PURE__ */ (0,
|
|
5029
|
+
const classes = (0, import_dedupe53.default)("mobius", "mobius-table", props.className);
|
|
5030
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("table", { ref, ...props, className: classes });
|
|
5031
5031
|
};
|
|
5032
5032
|
Table.displayName = "Table";
|
|
5033
5033
|
|
|
5034
5034
|
// src/components/Table/Head.tsx
|
|
5035
|
-
var
|
|
5036
|
-
var
|
|
5035
|
+
var import_dedupe54 = __toESM(require("classnames/dedupe"));
|
|
5036
|
+
var import_jsx_runtime64 = require("react/jsx-runtime");
|
|
5037
5037
|
var Head = ({ ref, ...props }) => {
|
|
5038
|
-
const classes = (0,
|
|
5039
|
-
return /* @__PURE__ */ (0,
|
|
5038
|
+
const classes = (0, import_dedupe54.default)("mobius", "mobius-table__head", props.className);
|
|
5039
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("thead", { ref, ...props, className: classes });
|
|
5040
5040
|
};
|
|
5041
5041
|
Head.displayName = "Table.Head";
|
|
5042
5042
|
|
|
5043
5043
|
// src/components/Table/Body.tsx
|
|
5044
|
-
var
|
|
5045
|
-
var
|
|
5044
|
+
var import_dedupe55 = __toESM(require("classnames/dedupe"));
|
|
5045
|
+
var import_jsx_runtime65 = require("react/jsx-runtime");
|
|
5046
5046
|
var Body = ({ ref, ...props }) => {
|
|
5047
|
-
const classes = (0,
|
|
5048
|
-
return /* @__PURE__ */ (0,
|
|
5047
|
+
const classes = (0, import_dedupe55.default)("mobius", "mobius-table__body", props.className);
|
|
5048
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("tbody", { ref, ...props, className: classes });
|
|
5049
5049
|
};
|
|
5050
5050
|
Body.displayName = "Table.Body";
|
|
5051
5051
|
|
|
5052
5052
|
// src/components/Table/Foot.tsx
|
|
5053
|
-
var
|
|
5054
|
-
var
|
|
5053
|
+
var import_dedupe56 = __toESM(require("classnames/dedupe"));
|
|
5054
|
+
var import_jsx_runtime66 = require("react/jsx-runtime");
|
|
5055
5055
|
var Foot = ({ ref, ...props }) => {
|
|
5056
|
-
const classes = (0,
|
|
5057
|
-
return /* @__PURE__ */ (0,
|
|
5056
|
+
const classes = (0, import_dedupe56.default)("mobius", "mobius-table__foot", props.className);
|
|
5057
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("tfoot", { ref, ...props, className: classes });
|
|
5058
5058
|
};
|
|
5059
5059
|
Foot.displayName = "Table.Foot";
|
|
5060
5060
|
|
|
5061
5061
|
// src/components/Table/Row.tsx
|
|
5062
|
-
var
|
|
5063
|
-
var
|
|
5062
|
+
var import_dedupe57 = __toESM(require("classnames/dedupe"));
|
|
5063
|
+
var import_jsx_runtime67 = require("react/jsx-runtime");
|
|
5064
5064
|
var Row = ({ ref, ...props }) => {
|
|
5065
|
-
const classes = (0,
|
|
5066
|
-
return /* @__PURE__ */ (0,
|
|
5065
|
+
const classes = (0, import_dedupe57.default)("mobius", "mobius-table__row", props.className);
|
|
5066
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("tr", { ref, ...props, className: classes });
|
|
5067
5067
|
};
|
|
5068
5068
|
Row.displayName = "Table.Row";
|
|
5069
5069
|
|
|
5070
5070
|
// src/components/Table/HeaderCell.tsx
|
|
5071
|
-
var
|
|
5072
|
-
var
|
|
5071
|
+
var import_dedupe58 = __toESM(require("classnames/dedupe"));
|
|
5072
|
+
var import_jsx_runtime68 = require("react/jsx-runtime");
|
|
5073
5073
|
var HeaderCell = ({ ref, scope = "col", ...props }) => {
|
|
5074
|
-
const classes = (0,
|
|
5074
|
+
const classes = (0, import_dedupe58.default)(
|
|
5075
5075
|
"mobius",
|
|
5076
5076
|
"mobius-table__head-cell",
|
|
5077
5077
|
props.className
|
|
5078
5078
|
);
|
|
5079
|
-
return /* @__PURE__ */ (0,
|
|
5079
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("th", { ...props, ref, scope, className: classes });
|
|
5080
5080
|
};
|
|
5081
5081
|
HeaderCell.displayName = "Table.HeaderCell";
|
|
5082
5082
|
|
|
5083
5083
|
// src/components/Table/Cell.tsx
|
|
5084
|
-
var
|
|
5085
|
-
var
|
|
5084
|
+
var import_dedupe59 = __toESM(require("classnames/dedupe"));
|
|
5085
|
+
var import_jsx_runtime69 = require("react/jsx-runtime");
|
|
5086
5086
|
var Cell = ({ ref, ...props }) => {
|
|
5087
|
-
const classes = (0,
|
|
5087
|
+
const classes = (0, import_dedupe59.default)(
|
|
5088
5088
|
"mobius",
|
|
5089
5089
|
"mobius-table__body-cell",
|
|
5090
5090
|
props.className
|
|
5091
5091
|
);
|
|
5092
|
-
return /* @__PURE__ */ (0,
|
|
5092
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("td", { ref, ...props, className: classes });
|
|
5093
5093
|
};
|
|
5094
5094
|
Cell.displayName = "Table.Cell";
|
|
5095
5095
|
|
|
@@ -5105,18 +5105,18 @@ var Table2 = Object.assign(Table, {
|
|
|
5105
5105
|
Table2.displayName = "Table";
|
|
5106
5106
|
|
|
5107
5107
|
// src/components/TextArea/TextArea.tsx
|
|
5108
|
-
var
|
|
5108
|
+
var import_dedupe61 = __toESM(require("classnames/dedupe"));
|
|
5109
5109
|
init_hooks();
|
|
5110
5110
|
init_ErrorMessage2();
|
|
5111
5111
|
init_Label2();
|
|
5112
5112
|
init_Stack2();
|
|
5113
5113
|
|
|
5114
5114
|
// src/components/TextAreaInput/TextAreaInput.tsx
|
|
5115
|
-
var
|
|
5116
|
-
var
|
|
5115
|
+
var import_dedupe60 = __toESM(require("classnames/dedupe"));
|
|
5116
|
+
var import_jsx_runtime70 = require("react/jsx-runtime");
|
|
5117
5117
|
var TextAreaInput = ({ ref, ...props }) => {
|
|
5118
5118
|
const { isSelected, isDisabled, isReadOnly, isRequired, ...otherProps } = props;
|
|
5119
|
-
const classes = (0,
|
|
5119
|
+
const classes = (0, import_dedupe60.default)(
|
|
5120
5120
|
"mobius",
|
|
5121
5121
|
"mobius-text-area__input",
|
|
5122
5122
|
{
|
|
@@ -5126,7 +5126,7 @@ var TextAreaInput = ({ ref, ...props }) => {
|
|
|
5126
5126
|
},
|
|
5127
5127
|
otherProps.className
|
|
5128
5128
|
);
|
|
5129
|
-
return /* @__PURE__ */ (0,
|
|
5129
|
+
return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
5130
5130
|
"textarea",
|
|
5131
5131
|
{
|
|
5132
5132
|
ref,
|
|
@@ -5141,7 +5141,7 @@ TextAreaInput.displayName = "TextAreaInput";
|
|
|
5141
5141
|
|
|
5142
5142
|
// src/components/TextArea/TextArea.tsx
|
|
5143
5143
|
var import_TextArea = require("@simplybusiness/mobius/src/components/TextArea/TextArea.css");
|
|
5144
|
-
var
|
|
5144
|
+
var import_jsx_runtime71 = require("react/jsx-runtime");
|
|
5145
5145
|
var TextArea = ({ ref, ...props }) => {
|
|
5146
5146
|
const {
|
|
5147
5147
|
isDisabled,
|
|
@@ -5152,18 +5152,18 @@ var TextArea = ({ ref, ...props }) => {
|
|
|
5152
5152
|
...otherProps
|
|
5153
5153
|
} = props;
|
|
5154
5154
|
const { inputProps, labelProps, errorMessageProps } = useTextField(props);
|
|
5155
|
-
const classes = (0,
|
|
5155
|
+
const classes = (0, import_dedupe61.default)("mobius", "mobius-text-area", className);
|
|
5156
5156
|
const validationClasses = useValidationClasses({ isInvalid });
|
|
5157
|
-
const inputClasses = (0,
|
|
5158
|
-
const labelClasses = (0,
|
|
5157
|
+
const inputClasses = (0, import_dedupe61.default)("mobius-text-area__input", validationClasses);
|
|
5158
|
+
const labelClasses = (0, import_dedupe61.default)(
|
|
5159
5159
|
{
|
|
5160
5160
|
"--is-disabled": isDisabled
|
|
5161
5161
|
},
|
|
5162
5162
|
validationClasses
|
|
5163
5163
|
);
|
|
5164
|
-
return /* @__PURE__ */ (0,
|
|
5165
|
-
label && /* @__PURE__ */ (0,
|
|
5166
|
-
/* @__PURE__ */ (0,
|
|
5164
|
+
return /* @__PURE__ */ (0, import_jsx_runtime71.jsxs)(Stack, { className: classes, gap: "xs", children: [
|
|
5165
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(Label, { ...labelProps, className: labelClasses, children: props.label }),
|
|
5166
|
+
/* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
|
|
5167
5167
|
TextAreaInput,
|
|
5168
5168
|
{
|
|
5169
5169
|
...otherProps,
|
|
@@ -5174,15 +5174,15 @@ var TextArea = ({ ref, ...props }) => {
|
|
|
5174
5174
|
"aria-invalid": errorMessage != null
|
|
5175
5175
|
}
|
|
5176
5176
|
),
|
|
5177
|
-
/* @__PURE__ */ (0,
|
|
5177
|
+
/* @__PURE__ */ (0, import_jsx_runtime71.jsx)(ErrorMessage, { ...errorMessageProps, errorMessage })
|
|
5178
5178
|
] });
|
|
5179
5179
|
};
|
|
5180
5180
|
TextArea.displayName = "TextArea";
|
|
5181
5181
|
|
|
5182
5182
|
// src/components/Title/Title.tsx
|
|
5183
|
-
var
|
|
5183
|
+
var import_dedupe62 = __toESM(require("classnames/dedupe"));
|
|
5184
5184
|
var import_Title = require("@simplybusiness/mobius/src/components/Title/Title.css");
|
|
5185
|
-
var
|
|
5185
|
+
var import_jsx_runtime72 = require("react/jsx-runtime");
|
|
5186
5186
|
var Title = ({ ref, ...props }) => {
|
|
5187
5187
|
const {
|
|
5188
5188
|
elementType: Element = "div",
|
|
@@ -5190,20 +5190,20 @@ var Title = ({ ref, ...props }) => {
|
|
|
5190
5190
|
description,
|
|
5191
5191
|
...otherProps
|
|
5192
5192
|
} = props;
|
|
5193
|
-
const classes = (0,
|
|
5194
|
-
const headerClasses = (0,
|
|
5195
|
-
const contentClasses = (0,
|
|
5196
|
-
const containerClasses = (0,
|
|
5197
|
-
return /* @__PURE__ */ (0,
|
|
5198
|
-
/* @__PURE__ */ (0,
|
|
5199
|
-
/* @__PURE__ */ (0,
|
|
5193
|
+
const classes = (0, import_dedupe62.default)("mobius", "mobius-title", otherProps.className);
|
|
5194
|
+
const headerClasses = (0, import_dedupe62.default)("mobius", "mobius-title__header");
|
|
5195
|
+
const contentClasses = (0, import_dedupe62.default)("mobius", "mobius-title__description");
|
|
5196
|
+
const containerClasses = (0, import_dedupe62.default)("mobius", "mobius-title__container");
|
|
5197
|
+
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: [
|
|
5198
|
+
/* @__PURE__ */ (0, import_jsx_runtime72.jsx)("p", { className: headerClasses, children: title }),
|
|
5199
|
+
/* @__PURE__ */ (0, import_jsx_runtime72.jsx)("p", { className: contentClasses, children: description })
|
|
5200
5200
|
] }) });
|
|
5201
5201
|
};
|
|
5202
5202
|
Title.displayName = "Title";
|
|
5203
5203
|
|
|
5204
5204
|
// src/components/Toast/Toast.tsx
|
|
5205
5205
|
var import_icons14 = require("@simplybusiness/icons");
|
|
5206
|
-
var
|
|
5206
|
+
var import_dedupe63 = __toESM(require("classnames/dedupe"));
|
|
5207
5207
|
var import_sonner = require("sonner");
|
|
5208
5208
|
init_Icon2();
|
|
5209
5209
|
|
|
@@ -5214,7 +5214,7 @@ var toastState = {
|
|
|
5214
5214
|
|
|
5215
5215
|
// src/components/Toast/Toast.tsx
|
|
5216
5216
|
var import_Toast = require("@simplybusiness/mobius/src/components/Toast/Toast.css");
|
|
5217
|
-
var
|
|
5217
|
+
var import_jsx_runtime73 = require("react/jsx-runtime");
|
|
5218
5218
|
var variantIcons = {
|
|
5219
5219
|
info: import_icons14.circleInfo,
|
|
5220
5220
|
success: import_icons14.circleCheck,
|
|
@@ -5227,8 +5227,8 @@ var variantColors = {
|
|
|
5227
5227
|
warning: "var(--color-warning)",
|
|
5228
5228
|
error: "var(--color-error)"
|
|
5229
5229
|
};
|
|
5230
|
-
var ToastIcon = ({ variant }) => /* @__PURE__ */ (0,
|
|
5231
|
-
var CloseIcon = () => /* @__PURE__ */ (0,
|
|
5230
|
+
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] }) });
|
|
5231
|
+
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 }) });
|
|
5232
5232
|
var ToastContent = ({
|
|
5233
5233
|
toastId,
|
|
5234
5234
|
variant,
|
|
@@ -5237,15 +5237,15 @@ var ToastContent = ({
|
|
|
5237
5237
|
action,
|
|
5238
5238
|
cancel,
|
|
5239
5239
|
showCloseButton = toastState.showCloseButton
|
|
5240
|
-
}) => /* @__PURE__ */ (0,
|
|
5241
|
-
/* @__PURE__ */ (0,
|
|
5242
|
-
/* @__PURE__ */ (0,
|
|
5243
|
-
/* @__PURE__ */ (0,
|
|
5244
|
-
title && /* @__PURE__ */ (0,
|
|
5245
|
-
description && /* @__PURE__ */ (0,
|
|
5240
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)("div", { className: (0, import_dedupe63.default)("mobius", "mobius-toast", `--${variant}`), children: [
|
|
5241
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsx)(ToastIcon, { variant }),
|
|
5242
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsxs)("div", { className: "mobius-toast__body", children: [
|
|
5243
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsxs)("div", { className: "mobius-toast__content", children: [
|
|
5244
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("div", { className: "mobius-toast__title", children: title }),
|
|
5245
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("div", { className: "mobius-toast__description", children: description })
|
|
5246
5246
|
] }),
|
|
5247
|
-
(action || cancel) && /* @__PURE__ */ (0,
|
|
5248
|
-
cancel && /* @__PURE__ */ (0,
|
|
5247
|
+
(action || cancel) && /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)("div", { className: "mobius-toast__actions", children: [
|
|
5248
|
+
cancel && /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
|
|
5249
5249
|
"button",
|
|
5250
5250
|
{
|
|
5251
5251
|
type: "button",
|
|
@@ -5257,7 +5257,7 @@ var ToastContent = ({
|
|
|
5257
5257
|
children: cancel.label
|
|
5258
5258
|
}
|
|
5259
5259
|
),
|
|
5260
|
-
action && /* @__PURE__ */ (0,
|
|
5260
|
+
action && /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
|
|
5261
5261
|
"button",
|
|
5262
5262
|
{
|
|
5263
5263
|
type: "button",
|
|
@@ -5271,19 +5271,19 @@ var ToastContent = ({
|
|
|
5271
5271
|
)
|
|
5272
5272
|
] })
|
|
5273
5273
|
] }),
|
|
5274
|
-
showCloseButton && /* @__PURE__ */ (0,
|
|
5274
|
+
showCloseButton && /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
|
|
5275
5275
|
"button",
|
|
5276
5276
|
{
|
|
5277
5277
|
type: "button",
|
|
5278
5278
|
className: "mobius-toast__close",
|
|
5279
5279
|
onClick: () => import_sonner.toast.dismiss(toastId),
|
|
5280
5280
|
"aria-label": "Close",
|
|
5281
|
-
children: /* @__PURE__ */ (0,
|
|
5281
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(CloseIcon, {})
|
|
5282
5282
|
}
|
|
5283
5283
|
)
|
|
5284
5284
|
] });
|
|
5285
5285
|
var createCustomToast = (message, variant, options) => import_sonner.toast.custom(
|
|
5286
|
-
(id) => /* @__PURE__ */ (0,
|
|
5286
|
+
(id) => /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
|
|
5287
5287
|
ToastContent,
|
|
5288
5288
|
{
|
|
5289
5289
|
toastId: id,
|
|
@@ -5315,9 +5315,9 @@ var toast = {
|
|
|
5315
5315
|
};
|
|
5316
5316
|
|
|
5317
5317
|
// src/components/Toast/Toaster.tsx
|
|
5318
|
-
var
|
|
5318
|
+
var import_react48 = require("react");
|
|
5319
5319
|
var import_sonner2 = require("sonner");
|
|
5320
|
-
var
|
|
5320
|
+
var import_jsx_runtime74 = require("react/jsx-runtime");
|
|
5321
5321
|
var Toaster = ({
|
|
5322
5322
|
position = "top-right",
|
|
5323
5323
|
closeButton = true,
|
|
@@ -5326,10 +5326,10 @@ var Toaster = ({
|
|
|
5326
5326
|
visibleToasts = 3,
|
|
5327
5327
|
gap = 8
|
|
5328
5328
|
}) => {
|
|
5329
|
-
(0,
|
|
5329
|
+
(0, import_react48.useEffect)(() => {
|
|
5330
5330
|
toastState.showCloseButton = closeButton;
|
|
5331
5331
|
}, [closeButton]);
|
|
5332
|
-
return /* @__PURE__ */ (0,
|
|
5332
|
+
return /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
5333
5333
|
import_sonner2.Toaster,
|
|
5334
5334
|
{
|
|
5335
5335
|
position,
|
|
@@ -5344,8 +5344,8 @@ var Toaster = ({
|
|
|
5344
5344
|
Toaster.displayName = "Toaster";
|
|
5345
5345
|
|
|
5346
5346
|
// src/components/Trust/Trust.tsx
|
|
5347
|
-
var
|
|
5348
|
-
var
|
|
5347
|
+
var import_dedupe64 = __toESM(require("classnames/dedupe"));
|
|
5348
|
+
var import_react49 = require("react");
|
|
5349
5349
|
init_utils();
|
|
5350
5350
|
|
|
5351
5351
|
// src/components/Trust/constants.ts
|
|
@@ -5410,7 +5410,7 @@ var TRUSTPILOT_WIDGET = {
|
|
|
5410
5410
|
};
|
|
5411
5411
|
|
|
5412
5412
|
// src/components/Trust/Trust.tsx
|
|
5413
|
-
var
|
|
5413
|
+
var import_jsx_runtime75 = require("react/jsx-runtime");
|
|
5414
5414
|
var Trust = ({ ref, ...props }) => {
|
|
5415
5415
|
const {
|
|
5416
5416
|
elementType: Element = "div",
|
|
@@ -5422,8 +5422,8 @@ var Trust = ({ ref, ...props }) => {
|
|
|
5422
5422
|
stars,
|
|
5423
5423
|
className
|
|
5424
5424
|
} = props;
|
|
5425
|
-
const [isMounted, setIsMounted] = (0,
|
|
5426
|
-
const trustRef = (0,
|
|
5425
|
+
const [isMounted, setIsMounted] = (0, import_react49.useState)(false);
|
|
5426
|
+
const trustRef = (0, import_react49.useRef)(null);
|
|
5427
5427
|
const {
|
|
5428
5428
|
templateId,
|
|
5429
5429
|
className: variantClassName,
|
|
@@ -5440,7 +5440,7 @@ var Trust = ({ ref, ...props }) => {
|
|
|
5440
5440
|
"data-style-height": height,
|
|
5441
5441
|
"data-stars": stars
|
|
5442
5442
|
};
|
|
5443
|
-
const classes = (0,
|
|
5443
|
+
const classes = (0, import_dedupe64.default)(
|
|
5444
5444
|
"mobius",
|
|
5445
5445
|
"mobius-trust",
|
|
5446
5446
|
REQUIRED_TRUSTPILOT_CLASS_NAME,
|
|
@@ -5450,24 +5450,24 @@ var Trust = ({ ref, ...props }) => {
|
|
|
5450
5450
|
},
|
|
5451
5451
|
className
|
|
5452
5452
|
);
|
|
5453
|
-
(0,
|
|
5453
|
+
(0, import_react49.useEffect)(() => {
|
|
5454
5454
|
const hasTrustpilotLoaded = trustRef.current && window?.Trustpilot && window?.Trustpilot.loadFromElement;
|
|
5455
5455
|
if (isMounted && hasTrustpilotLoaded) {
|
|
5456
5456
|
window.Trustpilot.loadFromElement(trustRef.current, true);
|
|
5457
5457
|
}
|
|
5458
5458
|
}, [isMounted]);
|
|
5459
|
-
(0,
|
|
5459
|
+
(0, import_react49.useEffect)(() => {
|
|
5460
5460
|
setIsMounted(true);
|
|
5461
5461
|
}, []);
|
|
5462
|
-
if (!isMounted) return /* @__PURE__ */ (0,
|
|
5463
|
-
return /* @__PURE__ */ (0,
|
|
5462
|
+
if (!isMounted) return /* @__PURE__ */ (0, import_jsx_runtime75.jsx)("div", { style: styles });
|
|
5463
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
5464
5464
|
Element,
|
|
5465
5465
|
{
|
|
5466
5466
|
ref: mergeRefs([trustRef, ref]),
|
|
5467
5467
|
className: classes,
|
|
5468
5468
|
style: styles,
|
|
5469
5469
|
...dataProps,
|
|
5470
|
-
children: /* @__PURE__ */ (0,
|
|
5470
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
5471
5471
|
"a",
|
|
5472
5472
|
{
|
|
5473
5473
|
href: link,
|
|
@@ -5482,12 +5482,12 @@ var Trust = ({ ref, ...props }) => {
|
|
|
5482
5482
|
};
|
|
5483
5483
|
|
|
5484
5484
|
// src/components/ExpandableText/ExpandableText.tsx
|
|
5485
|
-
var
|
|
5486
|
-
var
|
|
5485
|
+
var import_dedupe65 = __toESM(require("classnames/dedupe"));
|
|
5486
|
+
var import_react50 = require("react");
|
|
5487
5487
|
init_hooks();
|
|
5488
5488
|
init_TextOrHTML2();
|
|
5489
5489
|
var import_ExpandableText = require("@simplybusiness/mobius/src/components/ExpandableText/ExpandableText.css");
|
|
5490
|
-
var
|
|
5490
|
+
var import_jsx_runtime76 = require("react/jsx-runtime");
|
|
5491
5491
|
var ExpandableText = ({ ref, ...props }) => {
|
|
5492
5492
|
const {
|
|
5493
5493
|
text,
|
|
@@ -5501,14 +5501,14 @@ var ExpandableText = ({ ref, ...props }) => {
|
|
|
5501
5501
|
onToggle,
|
|
5502
5502
|
...otherProps
|
|
5503
5503
|
} = props;
|
|
5504
|
-
const [isExpanded, setIsExpanded] = (0,
|
|
5505
|
-
const [isCollapsed, setIsCollapsed] = (0,
|
|
5506
|
-
const textRef = (0,
|
|
5504
|
+
const [isExpanded, setIsExpanded] = (0, import_react50.useState)(false);
|
|
5505
|
+
const [isCollapsed, setIsCollapsed] = (0, import_react50.useState)(false);
|
|
5506
|
+
const textRef = (0, import_react50.useRef)(null);
|
|
5507
5507
|
const { down } = useBreakpoint();
|
|
5508
|
-
const baseId = (0,
|
|
5508
|
+
const baseId = (0, import_react50.useId)();
|
|
5509
5509
|
const expandButtonId = `expandable-text-expand-${baseId}`;
|
|
5510
5510
|
const shouldCollapse = breakpoint ? down(breakpoint) : true;
|
|
5511
|
-
(0,
|
|
5511
|
+
(0, import_react50.useEffect)(() => {
|
|
5512
5512
|
if (!shouldCollapse || !textRef.current) {
|
|
5513
5513
|
setIsCollapsed(false);
|
|
5514
5514
|
return;
|
|
@@ -5518,20 +5518,20 @@ var ExpandableText = ({ ref, ...props }) => {
|
|
|
5518
5518
|
setIsCollapsed(isOverflowing);
|
|
5519
5519
|
}, [text, shouldCollapse, maxLines]);
|
|
5520
5520
|
if (breakpoint && !shouldCollapse) {
|
|
5521
|
-
return /* @__PURE__ */ (0,
|
|
5521
|
+
return /* @__PURE__ */ (0, import_jsx_runtime76.jsx)("div", { ref, className, ...otherProps, children: /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(TextOrHTML, { text, textWrapper: true, ...textProps }) });
|
|
5522
5522
|
}
|
|
5523
5523
|
const handleAccordionChange = (expanded) => {
|
|
5524
5524
|
setIsExpanded(expanded);
|
|
5525
5525
|
onToggle?.(expanded);
|
|
5526
5526
|
};
|
|
5527
|
-
const classes = (0,
|
|
5528
|
-
const textContainerClasses = (0,
|
|
5527
|
+
const classes = (0, import_dedupe65.default)("mobius-expandable-text", className);
|
|
5528
|
+
const textContainerClasses = (0, import_dedupe65.default)("mobius-expandable-text__content", {
|
|
5529
5529
|
"mobius-expandable-text__content--collapsed": !isExpanded
|
|
5530
5530
|
});
|
|
5531
5531
|
const textContainerStyle = {
|
|
5532
5532
|
"--line-clamp": maxLines
|
|
5533
5533
|
};
|
|
5534
|
-
return /* @__PURE__ */ (0,
|
|
5534
|
+
return /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)(
|
|
5535
5535
|
"div",
|
|
5536
5536
|
{
|
|
5537
5537
|
ref,
|
|
@@ -5539,7 +5539,7 @@ var ExpandableText = ({ ref, ...props }) => {
|
|
|
5539
5539
|
"data-testid": "expandable-text",
|
|
5540
5540
|
...otherProps,
|
|
5541
5541
|
children: [
|
|
5542
|
-
/* @__PURE__ */ (0,
|
|
5542
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
|
|
5543
5543
|
"div",
|
|
5544
5544
|
{
|
|
5545
5545
|
ref: textRef,
|
|
@@ -5547,10 +5547,10 @@ var ExpandableText = ({ ref, ...props }) => {
|
|
|
5547
5547
|
style: textContainerStyle,
|
|
5548
5548
|
"data-testid": "expandable-text-content",
|
|
5549
5549
|
"aria-describedby": isCollapsed ? expandButtonId : void 0,
|
|
5550
|
-
children: /* @__PURE__ */ (0,
|
|
5550
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(TextOrHTML, { elementType: "span", textWrapper: true, text, ...textProps })
|
|
5551
5551
|
}
|
|
5552
5552
|
),
|
|
5553
|
-
isCollapsed && /* @__PURE__ */ (0,
|
|
5553
|
+
isCollapsed && /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
|
|
5554
5554
|
Accordion,
|
|
5555
5555
|
{
|
|
5556
5556
|
showText,
|
|
@@ -5573,7 +5573,7 @@ ExpandableText.displayName = "ExpandableText";
|
|
|
5573
5573
|
// src/components/MaskedField/index.tsx
|
|
5574
5574
|
var import_component = __toESM(require("@loadable/component"));
|
|
5575
5575
|
init_TextField2();
|
|
5576
|
-
var
|
|
5576
|
+
var import_jsx_runtime78 = require("react/jsx-runtime");
|
|
5577
5577
|
var LoadableMaskedField = (0, import_component.default)(() => Promise.resolve().then(() => (init_MaskedField(), MaskedField_exports)), {
|
|
5578
5578
|
resolveComponent: (mod) => mod.MaskedField
|
|
5579
5579
|
});
|
|
@@ -5585,11 +5585,11 @@ function MaskedField2(props) {
|
|
|
5585
5585
|
ref: forwardedRef,
|
|
5586
5586
|
...textFieldProps
|
|
5587
5587
|
} = props;
|
|
5588
|
-
return /* @__PURE__ */ (0,
|
|
5588
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
5589
5589
|
LoadableMaskedField,
|
|
5590
5590
|
{
|
|
5591
5591
|
...props,
|
|
5592
|
-
fallback: /* @__PURE__ */ (0,
|
|
5592
|
+
fallback: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
5593
5593
|
TextField,
|
|
5594
5594
|
{
|
|
5595
5595
|
...textFieldProps,
|