@pega/cosmos-react-core 9.0.0-build.1.0 → 9.0.0-build.10.1
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/lib/components/AppShell/AppHeader.d.ts.map +1 -1
- package/lib/components/AppShell/AppHeader.js +4 -1
- package/lib/components/AppShell/AppHeader.js.map +1 -1
- package/lib/components/AppShell/AppShell.styles.d.ts.map +1 -1
- package/lib/components/AppShell/AppShell.styles.js +3 -1
- package/lib/components/AppShell/AppShell.styles.js.map +1 -1
- package/lib/components/AppShell/NavigationListItemWrapper.d.ts.map +1 -1
- package/lib/components/AppShell/NavigationListItemWrapper.js +3 -4
- package/lib/components/AppShell/NavigationListItemWrapper.js.map +1 -1
- package/lib/components/AppShell/ThemeSwitcher.d.ts +9 -0
- package/lib/components/AppShell/ThemeSwitcher.d.ts.map +1 -0
- package/lib/components/AppShell/ThemeSwitcher.js +58 -0
- package/lib/components/AppShell/ThemeSwitcher.js.map +1 -0
- package/lib/components/AppShell/ThemeSwitcher.test-ids.d.ts +2 -0
- package/lib/components/AppShell/ThemeSwitcher.test-ids.d.ts.map +1 -0
- package/lib/components/AppShell/ThemeSwitcher.test-ids.js +3 -0
- package/lib/components/AppShell/ThemeSwitcher.test-ids.js.map +1 -0
- package/lib/components/Avatar/Avatar.d.ts.map +1 -1
- package/lib/components/Avatar/Avatar.js +10 -4
- package/lib/components/Avatar/Avatar.js.map +1 -1
- package/lib/components/Banner/Banner.js +1 -1
- package/lib/components/Banner/Banner.js.map +1 -1
- package/lib/components/Card/CardHeader.d.ts.map +1 -1
- package/lib/components/Card/CardHeader.js +2 -2
- package/lib/components/Card/CardHeader.js.map +1 -1
- package/lib/components/ComboBox/ComboBox.d.ts.map +1 -1
- package/lib/components/ComboBox/ComboBox.js +8 -3
- package/lib/components/ComboBox/ComboBox.js.map +1 -1
- package/lib/components/ComboBox/ComboBox.types.d.ts +5 -0
- package/lib/components/ComboBox/ComboBox.types.d.ts.map +1 -1
- package/lib/components/ComboBox/ComboBox.types.js.map +1 -1
- package/lib/components/CompositeInput/CompositeInput.d.ts.map +1 -1
- package/lib/components/CompositeInput/CompositeInput.js +3 -9
- package/lib/components/CompositeInput/CompositeInput.js.map +1 -1
- package/lib/components/Configuration/Configuration.d.ts +7 -2
- package/lib/components/Configuration/Configuration.d.ts.map +1 -1
- package/lib/components/Configuration/Configuration.js +6 -4
- package/lib/components/Configuration/Configuration.js.map +1 -1
- package/lib/components/CreditCard/CreditCardInput.d.ts +1 -1
- package/lib/components/Currency/CurrencyInput.d.ts.map +1 -1
- package/lib/components/Currency/CurrencyInput.js +8 -4
- package/lib/components/Currency/CurrencyInput.js.map +1 -1
- package/lib/components/DateTime/Input/DateInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/DateInput.js +8 -6
- package/lib/components/DateTime/Input/DateInput.js.map +1 -1
- package/lib/components/DateTime/Input/DateTime.styles.d.ts.map +1 -1
- package/lib/components/DateTime/Input/DateTime.styles.js +0 -4
- package/lib/components/DateTime/Input/DateTime.styles.js.map +1 -1
- package/lib/components/DateTime/Input/DateTimeInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/DateTimeInput.js +29 -10
- package/lib/components/DateTime/Input/DateTimeInput.js.map +1 -1
- package/lib/components/DateTime/Input/MonthInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/MonthInput.js +1 -1
- package/lib/components/DateTime/Input/MonthInput.js.map +1 -1
- package/lib/components/DateTime/Input/PartInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/PartInput.js +6 -1
- package/lib/components/DateTime/Input/PartInput.js.map +1 -1
- package/lib/components/DateTime/Input/QuarterInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/QuarterInput.js +1 -1
- package/lib/components/DateTime/Input/QuarterInput.js.map +1 -1
- package/lib/components/DateTime/Input/TimeInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/TimeInput.js +1 -1
- package/lib/components/DateTime/Input/TimeInput.js.map +1 -1
- package/lib/components/DateTime/Input/WeekInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/WeekInput.js +7 -5
- package/lib/components/DateTime/Input/WeekInput.js.map +1 -1
- package/lib/components/DateTime/Input/utils.d.ts +2 -2
- package/lib/components/DateTime/Input/utils.d.ts.map +1 -1
- package/lib/components/DateTime/Input/utils.js +4 -3
- package/lib/components/DateTime/Input/utils.js.map +1 -1
- package/lib/components/DateTime/Picker/utils.d.ts.map +1 -1
- package/lib/components/DateTime/Picker/utils.js +2 -6
- package/lib/components/DateTime/Picker/utils.js.map +1 -1
- package/lib/components/Dialog/Dialog.types.d.ts +4 -0
- package/lib/components/Dialog/Dialog.types.d.ts.map +1 -1
- package/lib/components/Dialog/Dialog.types.js.map +1 -1
- package/lib/components/Dialog/FormDialog.d.ts.map +1 -1
- package/lib/components/Dialog/FormDialog.js +7 -2
- package/lib/components/Dialog/FormDialog.js.map +1 -1
- package/lib/components/Dialog/InfoDialog.js +1 -1
- package/lib/components/Dialog/InfoDialog.js.map +1 -1
- package/lib/components/Drawer/Drawer.d.ts +8 -1
- package/lib/components/Drawer/Drawer.d.ts.map +1 -1
- package/lib/components/Drawer/Drawer.js +67 -8
- package/lib/components/Drawer/Drawer.js.map +1 -1
- package/lib/components/Drawer/ResizeHandle.d.ts +9 -0
- package/lib/components/Drawer/ResizeHandle.d.ts.map +1 -0
- package/lib/components/Drawer/ResizeHandle.js +109 -0
- package/lib/components/Drawer/ResizeHandle.js.map +1 -0
- package/lib/components/Drawer/index.d.ts +2 -0
- package/lib/components/Drawer/index.d.ts.map +1 -1
- package/lib/components/Drawer/index.js +1 -0
- package/lib/components/Drawer/index.js.map +1 -1
- package/lib/components/FieldGroup/FieldGroup.d.ts +5 -0
- package/lib/components/FieldGroup/FieldGroup.d.ts.map +1 -1
- package/lib/components/FieldGroup/FieldGroup.js +10 -6
- package/lib/components/FieldGroup/FieldGroup.js.map +1 -1
- package/lib/components/FieldGroup/FieldGroupList.d.ts +17 -2
- package/lib/components/FieldGroup/FieldGroupList.d.ts.map +1 -1
- package/lib/components/FieldGroup/FieldGroupList.js +202 -50
- package/lib/components/FieldGroup/FieldGroupList.js.map +1 -1
- package/lib/components/FieldGroup/FieldGroupList.utils.d.ts +33 -0
- package/lib/components/FieldGroup/FieldGroupList.utils.d.ts.map +1 -0
- package/lib/components/FieldGroup/FieldGroupList.utils.js +74 -0
- package/lib/components/FieldGroup/FieldGroupList.utils.js.map +1 -0
- package/lib/components/FieldGroup/FieldGroupListContext.d.ts +8 -0
- package/lib/components/FieldGroup/FieldGroupListContext.d.ts.map +1 -0
- package/lib/components/FieldGroup/FieldGroupListContext.js +9 -0
- package/lib/components/FieldGroup/FieldGroupListContext.js.map +1 -0
- package/lib/components/FieldGroup/index.d.ts +2 -0
- package/lib/components/FieldGroup/index.d.ts.map +1 -1
- package/lib/components/FieldGroup/index.js +2 -0
- package/lib/components/FieldGroup/index.js.map +1 -1
- package/lib/components/FieldValueList/FieldValueList.d.ts.map +1 -1
- package/lib/components/FieldValueList/FieldValueList.js +11 -5
- package/lib/components/FieldValueList/FieldValueList.js.map +1 -1
- package/lib/components/File/FileInput.d.ts.map +1 -1
- package/lib/components/File/FileInput.js +4 -3
- package/lib/components/File/FileInput.js.map +1 -1
- package/lib/components/File/FileItem.d.ts.map +1 -1
- package/lib/components/File/FileItem.js +2 -2
- package/lib/components/File/FileItem.js.map +1 -1
- package/lib/components/Form/Form.d.ts +2 -0
- package/lib/components/Form/Form.d.ts.map +1 -1
- package/lib/components/Form/Form.js +2 -2
- package/lib/components/Form/Form.js.map +1 -1
- package/lib/components/FormField/FormField.d.ts.map +1 -1
- package/lib/components/FormField/FormField.js +3 -2
- package/lib/components/FormField/FormField.js.map +1 -1
- package/lib/components/Fullscreen/Fullscreen.d.ts.map +1 -1
- package/lib/components/Fullscreen/Fullscreen.js +8 -5
- package/lib/components/Fullscreen/Fullscreen.js.map +1 -1
- package/lib/components/Icon/Icon.d.ts.map +1 -1
- package/lib/components/Icon/Icon.js +7 -2
- package/lib/components/Icon/Icon.js.map +1 -1
- package/lib/components/Icon/streamline-icons/archive-solid.icon.d.ts +5 -0
- package/lib/components/Icon/streamline-icons/archive-solid.icon.d.ts.map +1 -0
- package/lib/components/Icon/streamline-icons/archive-solid.icon.js +7 -0
- package/lib/components/Icon/streamline-icons/archive-solid.icon.js.map +1 -0
- package/lib/components/Icon/streamline-icons/archive.icon.d.ts +5 -0
- package/lib/components/Icon/streamline-icons/archive.icon.d.ts.map +1 -0
- package/lib/components/Icon/streamline-icons/archive.icon.js +7 -0
- package/lib/components/Icon/streamline-icons/archive.icon.js.map +1 -0
- package/lib/components/Icon/streamline-icons/article-solid.icon.d.ts +5 -0
- package/lib/components/Icon/streamline-icons/article-solid.icon.d.ts.map +1 -0
- package/lib/components/Icon/streamline-icons/article-solid.icon.js +7 -0
- package/lib/components/Icon/streamline-icons/article-solid.icon.js.map +1 -0
- package/lib/components/Icon/streamline-icons/article.icon.d.ts +5 -0
- package/lib/components/Icon/streamline-icons/article.icon.d.ts.map +1 -0
- package/lib/components/Icon/streamline-icons/article.icon.js +7 -0
- package/lib/components/Icon/streamline-icons/article.icon.js.map +1 -0
- package/lib/components/Icon/streamline-icons/bell-solid.icon.d.ts +5 -0
- package/lib/components/Icon/streamline-icons/bell-solid.icon.d.ts.map +1 -0
- package/lib/components/Icon/streamline-icons/bell-solid.icon.js +7 -0
- package/lib/components/Icon/streamline-icons/bell-solid.icon.js.map +1 -0
- package/lib/components/Icon/streamline-icons/browser-site.icon.d.ts +5 -0
- package/lib/components/Icon/streamline-icons/browser-site.icon.d.ts.map +1 -0
- package/lib/components/Icon/streamline-icons/browser-site.icon.js +7 -0
- package/lib/components/Icon/streamline-icons/browser-site.icon.js.map +1 -0
- package/lib/components/Icon/streamline-icons/circle-mixed-right.icon.d.ts +5 -0
- package/lib/components/Icon/streamline-icons/circle-mixed-right.icon.d.ts.map +1 -0
- package/lib/components/Icon/streamline-icons/circle-mixed-right.icon.js +7 -0
- package/lib/components/Icon/streamline-icons/circle-mixed-right.icon.js.map +1 -0
- package/lib/components/Icon/streamline-icons/circle-stacked-mixed.icon.d.ts +5 -0
- package/lib/components/Icon/streamline-icons/circle-stacked-mixed.icon.d.ts.map +1 -0
- package/lib/components/Icon/streamline-icons/circle-stacked-mixed.icon.js +7 -0
- package/lib/components/Icon/streamline-icons/circle-stacked-mixed.icon.js.map +1 -0
- package/lib/components/Icon/streamline-icons/circle-stacked.icon.d.ts +5 -0
- package/lib/components/Icon/streamline-icons/circle-stacked.icon.d.ts.map +1 -0
- package/lib/components/Icon/streamline-icons/circle-stacked.icon.js +7 -0
- package/lib/components/Icon/streamline-icons/circle-stacked.icon.js.map +1 -0
- package/lib/components/Icon/streamline-icons/cloud-nodes.icon.d.ts +5 -0
- package/lib/components/Icon/streamline-icons/cloud-nodes.icon.d.ts.map +1 -0
- package/lib/components/Icon/streamline-icons/cloud-nodes.icon.js +7 -0
- package/lib/components/Icon/streamline-icons/cloud-nodes.icon.js.map +1 -0
- package/lib/components/Icon/streamline-icons/condition-critical.icon.d.ts +5 -0
- package/lib/components/Icon/streamline-icons/condition-critical.icon.d.ts.map +1 -0
- package/lib/components/Icon/streamline-icons/condition-critical.icon.js +7 -0
- package/lib/components/Icon/streamline-icons/condition-critical.icon.js.map +1 -0
- package/lib/components/Icon/streamline-icons/condition-satisfactory.icon.d.ts +5 -0
- package/lib/components/Icon/streamline-icons/condition-satisfactory.icon.d.ts.map +1 -0
- package/lib/components/Icon/streamline-icons/condition-satisfactory.icon.js +7 -0
- package/lib/components/Icon/streamline-icons/condition-satisfactory.icon.js.map +1 -0
- package/lib/components/Icon/streamline-icons/disc-document.icon.d.ts +5 -0
- package/lib/components/Icon/streamline-icons/disc-document.icon.d.ts.map +1 -0
- package/lib/components/Icon/streamline-icons/disc-document.icon.js +7 -0
- package/lib/components/Icon/streamline-icons/disc-document.icon.js.map +1 -0
- package/lib/components/Icon/streamline-icons/disc-nodes.icon.d.ts +5 -0
- package/lib/components/Icon/streamline-icons/disc-nodes.icon.d.ts.map +1 -0
- package/lib/components/Icon/streamline-icons/disc-nodes.icon.js +7 -0
- package/lib/components/Icon/streamline-icons/disc-nodes.icon.js.map +1 -0
- package/lib/components/Icon/streamline-icons/document-doc.icon.d.ts +5 -0
- package/lib/components/Icon/streamline-icons/document-doc.icon.d.ts.map +1 -0
- package/lib/components/Icon/streamline-icons/document-doc.icon.js +7 -0
- package/lib/components/Icon/streamline-icons/document-doc.icon.js.map +1 -0
- package/lib/components/Icon/streamline-icons/document-json.icon.d.ts +5 -0
- package/lib/components/Icon/streamline-icons/document-json.icon.d.ts.map +1 -0
- package/lib/components/Icon/streamline-icons/document-json.icon.js +7 -0
- package/lib/components/Icon/streamline-icons/document-json.icon.js.map +1 -0
- package/lib/components/Icon/streamline-icons/document-xls.icon.d.ts +5 -0
- package/lib/components/Icon/streamline-icons/document-xls.icon.d.ts.map +1 -0
- package/lib/components/Icon/streamline-icons/document-xls.icon.js +7 -0
- package/lib/components/Icon/streamline-icons/document-xls.icon.js.map +1 -0
- package/lib/components/Icon/streamline-icons/documents.icon.d.ts +5 -0
- package/lib/components/Icon/streamline-icons/documents.icon.d.ts.map +1 -0
- package/lib/components/Icon/streamline-icons/documents.icon.js +7 -0
- package/lib/components/Icon/streamline-icons/documents.icon.js.map +1 -0
- package/lib/components/Icon/streamline-icons/field-cursor.icon.js +1 -1
- package/lib/components/Icon/streamline-icons/field-cursor.icon.js.map +1 -1
- package/lib/components/Icon/streamline-icons/filter-on.icon.d.ts +5 -0
- package/lib/components/Icon/streamline-icons/filter-on.icon.d.ts.map +1 -0
- package/lib/components/Icon/streamline-icons/filter-on.icon.js +7 -0
- package/lib/components/Icon/streamline-icons/filter-on.icon.js.map +1 -0
- package/lib/components/Icon/streamline-icons/freeze-column.icon.d.ts +5 -0
- package/lib/components/Icon/streamline-icons/freeze-column.icon.d.ts.map +1 -0
- package/lib/components/Icon/streamline-icons/freeze-column.icon.js +7 -0
- package/lib/components/Icon/streamline-icons/freeze-column.icon.js.map +1 -0
- package/lib/components/Icon/streamline-icons/galaxy.icon.d.ts +5 -0
- package/lib/components/Icon/streamline-icons/galaxy.icon.d.ts.map +1 -0
- package/lib/components/Icon/streamline-icons/galaxy.icon.js +7 -0
- package/lib/components/Icon/streamline-icons/galaxy.icon.js.map +1 -0
- package/lib/components/Icon/streamline-icons/grid-solid.icon.d.ts +5 -0
- package/lib/components/Icon/streamline-icons/grid-solid.icon.d.ts.map +1 -0
- package/lib/components/Icon/streamline-icons/grid-solid.icon.js +7 -0
- package/lib/components/Icon/streamline-icons/grid-solid.icon.js.map +1 -0
- package/lib/components/Icon/streamline-icons/grid.icon.d.ts +5 -0
- package/lib/components/Icon/streamline-icons/grid.icon.d.ts.map +1 -0
- package/lib/components/Icon/streamline-icons/grid.icon.js +7 -0
- package/lib/components/Icon/streamline-icons/grid.icon.js.map +1 -0
- package/lib/components/Icon/streamline-icons/language-pack.icon.d.ts +5 -0
- package/lib/components/Icon/streamline-icons/language-pack.icon.d.ts.map +1 -0
- package/lib/components/Icon/streamline-icons/language-pack.icon.js +7 -0
- package/lib/components/Icon/streamline-icons/language-pack.icon.js.map +1 -0
- package/lib/components/Icon/streamline-icons/layout.icon.d.ts +5 -0
- package/lib/components/Icon/streamline-icons/layout.icon.d.ts.map +1 -0
- package/lib/components/Icon/streamline-icons/layout.icon.js +7 -0
- package/lib/components/Icon/streamline-icons/layout.icon.js.map +1 -0
- package/lib/components/Icon/streamline-icons/lock-closed.icon.d.ts +5 -0
- package/lib/components/Icon/streamline-icons/lock-closed.icon.d.ts.map +1 -0
- package/lib/components/Icon/streamline-icons/lock-closed.icon.js +7 -0
- package/lib/components/Icon/streamline-icons/lock-closed.icon.js.map +1 -0
- package/lib/components/Icon/streamline-icons/mail-solid.icon.d.ts +5 -0
- package/lib/components/Icon/streamline-icons/mail-solid.icon.d.ts.map +1 -0
- package/lib/components/Icon/streamline-icons/mail-solid.icon.js +7 -0
- package/lib/components/Icon/streamline-icons/mail-solid.icon.js.map +1 -0
- package/lib/components/Icon/streamline-icons/mail.icon.d.ts.map +1 -1
- package/lib/components/Icon/streamline-icons/mail.icon.js +1 -1
- package/lib/components/Icon/streamline-icons/mail.icon.js.map +1 -1
- package/lib/components/Icon/streamline-icons/mobius.icon.d.ts +5 -0
- package/lib/components/Icon/streamline-icons/mobius.icon.d.ts.map +1 -0
- package/lib/components/Icon/streamline-icons/mobius.icon.js +7 -0
- package/lib/components/Icon/streamline-icons/mobius.icon.js.map +1 -0
- package/lib/components/Icon/streamline-icons/phone-in-solid.icon.d.ts +5 -0
- package/lib/components/Icon/streamline-icons/phone-in-solid.icon.d.ts.map +1 -0
- package/lib/components/Icon/streamline-icons/phone-in-solid.icon.js +7 -0
- package/lib/components/Icon/streamline-icons/phone-in-solid.icon.js.map +1 -0
- package/lib/components/Icon/streamline-icons/picture-solid.icon.d.ts +5 -0
- package/lib/components/Icon/streamline-icons/picture-solid.icon.d.ts.map +1 -0
- package/lib/components/Icon/streamline-icons/picture-solid.icon.js +7 -0
- package/lib/components/Icon/streamline-icons/picture-solid.icon.js.map +1 -0
- package/lib/components/Icon/streamline-icons/plug-connect.icon.d.ts +5 -0
- package/lib/components/Icon/streamline-icons/plug-connect.icon.d.ts.map +1 -0
- package/lib/components/Icon/streamline-icons/plug-connect.icon.js +7 -0
- package/lib/components/Icon/streamline-icons/plug-connect.icon.js.map +1 -0
- package/lib/components/Icon/streamline-icons/return.icon.d.ts +5 -0
- package/lib/components/Icon/streamline-icons/return.icon.d.ts.map +1 -0
- package/lib/components/Icon/streamline-icons/return.icon.js +7 -0
- package/lib/components/Icon/streamline-icons/return.icon.js.map +1 -0
- package/lib/components/Icon/streamline-icons/robot-solid.icon.d.ts +5 -0
- package/lib/components/Icon/streamline-icons/robot-solid.icon.d.ts.map +1 -0
- package/lib/components/Icon/streamline-icons/robot-solid.icon.js +7 -0
- package/lib/components/Icon/streamline-icons/robot-solid.icon.js.map +1 -0
- package/lib/components/Icon/streamline-icons/shapes.icon.d.ts +5 -0
- package/lib/components/Icon/streamline-icons/shapes.icon.d.ts.map +1 -0
- package/lib/components/Icon/streamline-icons/shapes.icon.js +7 -0
- package/lib/components/Icon/streamline-icons/shapes.icon.js.map +1 -0
- package/lib/components/Icon/streamline-icons/share-case.icon.d.ts +5 -0
- package/lib/components/Icon/streamline-icons/share-case.icon.d.ts.map +1 -0
- package/lib/components/Icon/streamline-icons/share-case.icon.js +7 -0
- package/lib/components/Icon/streamline-icons/share-case.icon.js.map +1 -0
- package/lib/components/Icon/streamline-icons/share-document.icon.d.ts +5 -0
- package/lib/components/Icon/streamline-icons/share-document.icon.d.ts.map +1 -0
- package/lib/components/Icon/streamline-icons/share-document.icon.js +7 -0
- package/lib/components/Icon/streamline-icons/share-document.icon.js.map +1 -0
- package/lib/components/Icon/streamline-icons/shield-lock.icon.d.ts +5 -0
- package/lib/components/Icon/streamline-icons/shield-lock.icon.d.ts.map +1 -0
- package/lib/components/Icon/streamline-icons/shield-lock.icon.js +7 -0
- package/lib/components/Icon/streamline-icons/shield-lock.icon.js.map +1 -0
- package/lib/components/Icon/streamline-icons/slideshow-solid.icon.d.ts +5 -0
- package/lib/components/Icon/streamline-icons/slideshow-solid.icon.d.ts.map +1 -0
- package/lib/components/Icon/streamline-icons/slideshow-solid.icon.js +7 -0
- package/lib/components/Icon/streamline-icons/slideshow-solid.icon.js.map +1 -0
- package/lib/components/Icon/streamline-icons/speaker-on-sold.icon.d.ts +5 -0
- package/lib/components/Icon/streamline-icons/speaker-on-sold.icon.d.ts.map +1 -0
- package/lib/components/Icon/streamline-icons/speaker-on-sold.icon.js +7 -0
- package/lib/components/Icon/streamline-icons/speaker-on-sold.icon.js.map +1 -0
- package/lib/components/Icon/streamline-icons/speaker-on.icon.d.ts +5 -0
- package/lib/components/Icon/streamline-icons/speaker-on.icon.d.ts.map +1 -0
- package/lib/components/Icon/streamline-icons/speaker-on.icon.js +7 -0
- package/lib/components/Icon/streamline-icons/speaker-on.icon.js.map +1 -0
- package/lib/components/Icon/streamline-icons/table-disc.icon.d.ts +5 -0
- package/lib/components/Icon/streamline-icons/table-disc.icon.d.ts.map +1 -0
- package/lib/components/Icon/streamline-icons/table-disc.icon.js +7 -0
- package/lib/components/Icon/streamline-icons/table-disc.icon.js.map +1 -0
- package/lib/components/Icon/streamline-icons/translate.icon.d.ts +5 -0
- package/lib/components/Icon/streamline-icons/translate.icon.d.ts.map +1 -0
- package/lib/components/Icon/streamline-icons/translate.icon.js +7 -0
- package/lib/components/Icon/streamline-icons/translate.icon.js.map +1 -0
- package/lib/components/Icon/streamline-icons/user-check-solid.icon.d.ts +5 -0
- package/lib/components/Icon/streamline-icons/user-check-solid.icon.d.ts.map +1 -0
- package/lib/components/Icon/streamline-icons/user-check-solid.icon.js +7 -0
- package/lib/components/Icon/streamline-icons/user-check-solid.icon.js.map +1 -0
- package/lib/components/Icon/streamline-icons/user-close-solid.icon.d.ts +5 -0
- package/lib/components/Icon/streamline-icons/user-close-solid.icon.d.ts.map +1 -0
- package/lib/components/Icon/streamline-icons/user-close-solid.icon.js +7 -0
- package/lib/components/Icon/streamline-icons/user-close-solid.icon.js.map +1 -0
- package/lib/components/Icon/streamline-icons/user-close.icon.d.ts +5 -0
- package/lib/components/Icon/streamline-icons/user-close.icon.d.ts.map +1 -0
- package/lib/components/Icon/streamline-icons/user-close.icon.js +7 -0
- package/lib/components/Icon/streamline-icons/user-close.icon.js.map +1 -0
- package/lib/components/Icon/streamline-icons/user-female-solid.icon.d.ts +5 -0
- package/lib/components/Icon/streamline-icons/user-female-solid.icon.d.ts.map +1 -0
- package/lib/components/Icon/streamline-icons/user-female-solid.icon.js +7 -0
- package/lib/components/Icon/streamline-icons/user-female-solid.icon.js.map +1 -0
- package/lib/components/Icon/streamline-icons/user-female.icon.d.ts +5 -0
- package/lib/components/Icon/streamline-icons/user-female.icon.d.ts.map +1 -0
- package/lib/components/Icon/streamline-icons/user-female.icon.js +7 -0
- package/lib/components/Icon/streamline-icons/user-female.icon.js.map +1 -0
- package/lib/components/Icon/streamline-icons/user-list-solid.icon.d.ts +5 -0
- package/lib/components/Icon/streamline-icons/user-list-solid.icon.d.ts.map +1 -0
- package/lib/components/Icon/streamline-icons/user-list-solid.icon.js +7 -0
- package/lib/components/Icon/streamline-icons/user-list-solid.icon.js.map +1 -0
- package/lib/components/Icon/streamline-icons/user-list.icon.d.ts +5 -0
- package/lib/components/Icon/streamline-icons/user-list.icon.d.ts.map +1 -0
- package/lib/components/Icon/streamline-icons/user-list.icon.js +7 -0
- package/lib/components/Icon/streamline-icons/user-list.icon.js.map +1 -0
- package/lib/components/Icon/streamline-icons/user-plus-solid.icon.d.ts +5 -0
- package/lib/components/Icon/streamline-icons/user-plus-solid.icon.d.ts.map +1 -0
- package/lib/components/Icon/streamline-icons/user-plus-solid.icon.js +7 -0
- package/lib/components/Icon/streamline-icons/user-plus-solid.icon.js.map +1 -0
- package/lib/components/Icon/streamline-icons/user-plus.icon.d.ts +5 -0
- package/lib/components/Icon/streamline-icons/user-plus.icon.d.ts.map +1 -0
- package/lib/components/Icon/streamline-icons/user-plus.icon.js +7 -0
- package/lib/components/Icon/streamline-icons/user-plus.icon.js.map +1 -0
- package/lib/components/Icon/streamline-icons/user-question-mark-solid.icon.d.ts +5 -0
- package/lib/components/Icon/streamline-icons/user-question-mark-solid.icon.d.ts.map +1 -0
- package/lib/components/Icon/streamline-icons/user-question-mark-solid.icon.js +7 -0
- package/lib/components/Icon/streamline-icons/user-question-mark-solid.icon.js.map +1 -0
- package/lib/components/Icon/streamline-icons/user-question-mark.icon.d.ts +5 -0
- package/lib/components/Icon/streamline-icons/user-question-mark.icon.d.ts.map +1 -0
- package/lib/components/Icon/streamline-icons/user-question-mark.icon.js +7 -0
- package/lib/components/Icon/streamline-icons/user-question-mark.icon.js.map +1 -0
- package/lib/components/Icon/streamline-icons/user-search-solid.icon.d.ts +5 -0
- package/lib/components/Icon/streamline-icons/user-search-solid.icon.d.ts.map +1 -0
- package/lib/components/Icon/streamline-icons/user-search-solid.icon.js +7 -0
- package/lib/components/Icon/streamline-icons/user-search-solid.icon.js.map +1 -0
- package/lib/components/Icon/streamline-icons/user-search.icon.d.ts +5 -0
- package/lib/components/Icon/streamline-icons/user-search.icon.d.ts.map +1 -0
- package/lib/components/Icon/streamline-icons/user-search.icon.js +7 -0
- package/lib/components/Icon/streamline-icons/user-search.icon.js.map +1 -0
- package/lib/components/Icon/streamline-icons/user-star-solid.icon.d.ts +5 -0
- package/lib/components/Icon/streamline-icons/user-star-solid.icon.d.ts.map +1 -0
- package/lib/components/Icon/streamline-icons/user-star-solid.icon.js +7 -0
- package/lib/components/Icon/streamline-icons/user-star-solid.icon.js.map +1 -0
- package/lib/components/Icon/streamline-icons/user-star.icon.js +2 -2
- package/lib/components/Icon/streamline-icons/user-star.icon.js.map +1 -1
- package/lib/components/Icon/streamline-icons/users-solid.icon.d.ts +5 -0
- package/lib/components/Icon/streamline-icons/users-solid.icon.d.ts.map +1 -0
- package/lib/components/Icon/streamline-icons/users-solid.icon.js +7 -0
- package/lib/components/Icon/streamline-icons/users-solid.icon.js.map +1 -0
- package/lib/components/Icon/streamline-icons/users.icon.d.ts +5 -0
- package/lib/components/Icon/streamline-icons/users.icon.d.ts.map +1 -0
- package/lib/components/Icon/streamline-icons/users.icon.js +7 -0
- package/lib/components/Icon/streamline-icons/users.icon.js.map +1 -0
- package/lib/components/Icon/streamline-icons/versions.icon.d.ts +5 -0
- package/lib/components/Icon/streamline-icons/versions.icon.d.ts.map +1 -0
- package/lib/components/Icon/streamline-icons/versions.icon.js +7 -0
- package/lib/components/Icon/streamline-icons/versions.icon.js.map +1 -0
- package/lib/components/Icon/streamline-icons/video-off.icon.d.ts +5 -0
- package/lib/components/Icon/streamline-icons/video-off.icon.d.ts.map +1 -0
- package/lib/components/Icon/streamline-icons/video-off.icon.js +7 -0
- package/lib/components/Icon/streamline-icons/video-off.icon.js.map +1 -0
- package/lib/components/Icon/streamline-icons/video-solid.icon.d.ts +5 -0
- package/lib/components/Icon/streamline-icons/video-solid.icon.d.ts.map +1 -0
- package/lib/components/Icon/streamline-icons/video-solid.icon.js +7 -0
- package/lib/components/Icon/streamline-icons/video-solid.icon.js.map +1 -0
- package/lib/components/Icon/streamline-icons/video.icon.d.ts +5 -0
- package/lib/components/Icon/streamline-icons/video.icon.d.ts.map +1 -0
- package/lib/components/Icon/streamline-icons/video.icon.js +7 -0
- package/lib/components/Icon/streamline-icons/video.icon.js.map +1 -0
- package/lib/components/Icon/streamline-icons/voicemail.icon.d.ts +5 -0
- package/lib/components/Icon/streamline-icons/voicemail.icon.d.ts.map +1 -0
- package/lib/components/Icon/streamline-icons/voicemail.icon.js +7 -0
- package/lib/components/Icon/streamline-icons/voicemail.icon.js.map +1 -0
- package/lib/components/Icon/streamline-icons/vr-solid.icon.d.ts +5 -0
- package/lib/components/Icon/streamline-icons/vr-solid.icon.d.ts.map +1 -0
- package/lib/components/Icon/streamline-icons/vr-solid.icon.js +7 -0
- package/lib/components/Icon/streamline-icons/vr-solid.icon.js.map +1 -0
- package/lib/components/Icon/streamline-icons/vr.icon.d.ts +5 -0
- package/lib/components/Icon/streamline-icons/vr.icon.d.ts.map +1 -0
- package/lib/components/Icon/streamline-icons/vr.icon.js +7 -0
- package/lib/components/Icon/streamline-icons/vr.icon.js.map +1 -0
- package/lib/components/Icon/streamline-icons/walkie-solid.icon.d.ts +5 -0
- package/lib/components/Icon/streamline-icons/walkie-solid.icon.d.ts.map +1 -0
- package/lib/components/Icon/streamline-icons/walkie-solid.icon.js +7 -0
- package/lib/components/Icon/streamline-icons/walkie-solid.icon.js.map +1 -0
- package/lib/components/Icon/streamline-icons/walkie.icon.d.ts +5 -0
- package/lib/components/Icon/streamline-icons/walkie.icon.d.ts.map +1 -0
- package/lib/components/Icon/streamline-icons/walkie.icon.js +7 -0
- package/lib/components/Icon/streamline-icons/walkie.icon.js.map +1 -0
- package/lib/components/Icon/streamline-icons/wallet-solid.icon.d.ts +5 -0
- package/lib/components/Icon/streamline-icons/wallet-solid.icon.d.ts.map +1 -0
- package/lib/components/Icon/streamline-icons/wallet-solid.icon.js +7 -0
- package/lib/components/Icon/streamline-icons/wallet-solid.icon.js.map +1 -0
- package/lib/components/Icon/streamline-icons/wallet.icon.d.ts +5 -0
- package/lib/components/Icon/streamline-icons/wallet.icon.d.ts.map +1 -0
- package/lib/components/Icon/streamline-icons/wallet.icon.js +7 -0
- package/lib/components/Icon/streamline-icons/wallet.icon.js.map +1 -0
- package/lib/components/Icon/streamline-icons/watch-solid.icon.d.ts +5 -0
- package/lib/components/Icon/streamline-icons/watch-solid.icon.d.ts.map +1 -0
- package/lib/components/Icon/streamline-icons/watch-solid.icon.js +7 -0
- package/lib/components/Icon/streamline-icons/watch-solid.icon.js.map +1 -0
- package/lib/components/Icon/streamline-icons/watch.icon.d.ts +5 -0
- package/lib/components/Icon/streamline-icons/watch.icon.d.ts.map +1 -0
- package/lib/components/Icon/streamline-icons/watch.icon.js +7 -0
- package/lib/components/Icon/streamline-icons/watch.icon.js.map +1 -0
- package/lib/components/Icon/streamline-icons/waypoint-solid.icon.d.ts +5 -0
- package/lib/components/Icon/streamline-icons/waypoint-solid.icon.d.ts.map +1 -0
- package/lib/components/Icon/streamline-icons/waypoint-solid.icon.js +7 -0
- package/lib/components/Icon/streamline-icons/waypoint-solid.icon.js.map +1 -0
- package/lib/components/Icon/streamline-icons/waypoint.icon.d.ts +5 -0
- package/lib/components/Icon/streamline-icons/waypoint.icon.d.ts.map +1 -0
- package/lib/components/Icon/streamline-icons/waypoint.icon.js +7 -0
- package/lib/components/Icon/streamline-icons/waypoint.icon.js.map +1 -0
- package/lib/components/Icon/streamline-icons/webcam-solid.icon.d.ts +5 -0
- package/lib/components/Icon/streamline-icons/webcam-solid.icon.d.ts.map +1 -0
- package/lib/components/Icon/streamline-icons/webcam-solid.icon.js +7 -0
- package/lib/components/Icon/streamline-icons/webcam-solid.icon.js.map +1 -0
- package/lib/components/Icon/streamline-icons/webcam.icon.d.ts +5 -0
- package/lib/components/Icon/streamline-icons/webcam.icon.d.ts.map +1 -0
- package/lib/components/Icon/streamline-icons/webcam.icon.js +7 -0
- package/lib/components/Icon/streamline-icons/webcam.icon.js.map +1 -0
- package/lib/components/Icon/streamline-icons/whatsapp.icon.d.ts +5 -0
- package/lib/components/Icon/streamline-icons/whatsapp.icon.d.ts.map +1 -0
- package/lib/components/Icon/streamline-icons/whatsapp.icon.js +7 -0
- package/lib/components/Icon/streamline-icons/whatsapp.icon.js.map +1 -0
- package/lib/components/Icon/streamline-icons/wifi-none.icon.d.ts +5 -0
- package/lib/components/Icon/streamline-icons/wifi-none.icon.d.ts.map +1 -0
- package/lib/components/Icon/streamline-icons/wifi-none.icon.js +7 -0
- package/lib/components/Icon/streamline-icons/wifi-none.icon.js.map +1 -0
- package/lib/components/Icon/streamline-icons/wifi-off.icon.d.ts +5 -0
- package/lib/components/Icon/streamline-icons/wifi-off.icon.d.ts.map +1 -0
- package/lib/components/Icon/streamline-icons/wifi-off.icon.js +7 -0
- package/lib/components/Icon/streamline-icons/wifi-off.icon.js.map +1 -0
- package/lib/components/Icon/streamline-icons/wizard-solid.icon.d.ts +5 -0
- package/lib/components/Icon/streamline-icons/wizard-solid.icon.d.ts.map +1 -0
- package/lib/components/Icon/streamline-icons/wizard-solid.icon.js +7 -0
- package/lib/components/Icon/streamline-icons/wizard-solid.icon.js.map +1 -0
- package/lib/components/Icon/streamline-icons/wizard.icon.d.ts +5 -0
- package/lib/components/Icon/streamline-icons/wizard.icon.d.ts.map +1 -0
- package/lib/components/Icon/streamline-icons/wizard.icon.js +7 -0
- package/lib/components/Icon/streamline-icons/wizard.icon.js.map +1 -0
- package/lib/components/Icon/streamline-icons/wrench-solid.icon.d.ts +5 -0
- package/lib/components/Icon/streamline-icons/wrench-solid.icon.d.ts.map +1 -0
- package/lib/components/Icon/streamline-icons/wrench-solid.icon.js +7 -0
- package/lib/components/Icon/streamline-icons/wrench-solid.icon.js.map +1 -0
- package/lib/components/Icon/streamline-icons/wrench.icon.d.ts +5 -0
- package/lib/components/Icon/streamline-icons/wrench.icon.d.ts.map +1 -0
- package/lib/components/Icon/streamline-icons/wrench.icon.js +7 -0
- package/lib/components/Icon/streamline-icons/wrench.icon.js.map +1 -0
- package/lib/components/Icon/streamlineIconNames.d.ts +1 -1
- package/lib/components/Icon/streamlineIconNames.d.ts.map +1 -1
- package/lib/components/Icon/streamlineIconNames.js +82 -0
- package/lib/components/Icon/streamlineIconNames.js.map +1 -1
- package/lib/components/IconPicker/IconPicker.d.ts +4 -4
- package/lib/components/IconPicker/IconPicker.d.ts.map +1 -1
- package/lib/components/IconPicker/IconPicker.js +19 -25
- package/lib/components/IconPicker/IconPicker.js.map +1 -1
- package/lib/components/Input/Input.styles.d.ts.map +1 -1
- package/lib/components/Input/Input.styles.js +2 -17
- package/lib/components/Input/Input.styles.js.map +1 -1
- package/lib/components/Lightbox/Lightbox.d.ts +1 -1
- package/lib/components/Lightbox/Lightbox.d.ts.map +1 -1
- package/lib/components/Lightbox/Lightbox.js +9 -3
- package/lib/components/Lightbox/Lightbox.js.map +1 -1
- package/lib/components/Lightbox/Lightbox.test-ids.d.ts +1 -1
- package/lib/components/Lightbox/Lightbox.test-ids.d.ts.map +1 -1
- package/lib/components/Lightbox/Lightbox.test-ids.js +1 -0
- package/lib/components/Lightbox/Lightbox.test-ids.js.map +1 -1
- package/lib/components/ListToolbar/ListToolbar.d.ts.map +1 -1
- package/lib/components/ListToolbar/ListToolbar.js +100 -39
- package/lib/components/ListToolbar/ListToolbar.js.map +1 -1
- package/lib/components/ListToolbar/ListToolbar.styles.d.ts.map +1 -1
- package/lib/components/ListToolbar/ListToolbar.styles.js +9 -14
- package/lib/components/ListToolbar/ListToolbar.styles.js.map +1 -1
- package/lib/components/ListToolbar/ListToolbar.types.d.ts +7 -3
- package/lib/components/ListToolbar/ListToolbar.types.d.ts.map +1 -1
- package/lib/components/ListToolbar/ListToolbar.types.js.map +1 -1
- package/lib/components/Location/CurrentLocationButton.d.ts.map +1 -1
- package/lib/components/Location/CurrentLocationButton.js +4 -2
- package/lib/components/Location/CurrentLocationButton.js.map +1 -1
- package/lib/components/Location/GoogleMapsAPI.d.ts +43 -0
- package/lib/components/Location/GoogleMapsAPI.d.ts.map +1 -0
- package/lib/components/Location/GoogleMapsAPI.js +244 -0
- package/lib/components/Location/GoogleMapsAPI.js.map +1 -0
- package/lib/components/Location/Location.types.d.ts +3 -2
- package/lib/components/Location/Location.types.d.ts.map +1 -1
- package/lib/components/Location/Location.types.js.map +1 -1
- package/lib/components/Location/LocationAPI.types.d.ts +23 -0
- package/lib/components/Location/LocationAPI.types.d.ts.map +1 -0
- package/lib/components/Location/LocationAPI.types.js +2 -0
- package/lib/components/Location/LocationAPI.types.js.map +1 -0
- package/lib/components/Location/LocationDisplay.d.ts.map +1 -1
- package/lib/components/Location/LocationDisplay.js +5 -3
- package/lib/components/Location/LocationDisplay.js.map +1 -1
- package/lib/components/Location/LocationInput.d.ts.map +1 -1
- package/lib/components/Location/LocationInput.js +24 -21
- package/lib/components/Location/LocationInput.js.map +1 -1
- package/lib/components/Location/LocationView.d.ts.map +1 -1
- package/lib/components/Location/LocationView.js +8 -5
- package/lib/components/Location/LocationView.js.map +1 -1
- package/lib/components/Location/index.d.ts +2 -1
- package/lib/components/Location/index.d.ts.map +1 -1
- package/lib/components/Location/index.js +2 -1
- package/lib/components/Location/index.js.map +1 -1
- package/lib/components/Location/utils.d.ts +3 -19
- package/lib/components/Location/utils.d.ts.map +1 -1
- package/lib/components/Location/utils.js +7 -161
- package/lib/components/Location/utils.js.map +1 -1
- package/lib/components/MetaList/MetaList.d.ts.map +1 -1
- package/lib/components/MetaList/MetaList.js +3 -2
- package/lib/components/MetaList/MetaList.js.map +1 -1
- package/lib/components/Modal/Modal.styles.d.ts.map +1 -1
- package/lib/components/Modal/Modal.styles.js +5 -1
- package/lib/components/Modal/Modal.styles.js.map +1 -1
- package/lib/components/MultiStepForm/MultiStepForm.d.ts.map +1 -1
- package/lib/components/MultiStepForm/MultiStepForm.js +29 -3
- package/lib/components/MultiStepForm/MultiStepForm.js.map +1 -1
- package/lib/components/Number/NumberInput.js +2 -2
- package/lib/components/Number/NumberInput.js.map +1 -1
- package/lib/components/Number/utils.d.ts +1 -1
- package/lib/components/Number/utils.d.ts.map +1 -1
- package/lib/components/Number/utils.js +1 -2
- package/lib/components/Number/utils.js.map +1 -1
- package/lib/components/PageTemplates/DashboardPage.js +2 -2
- package/lib/components/PageTemplates/DashboardPage.js.map +1 -1
- package/lib/components/PageTemplates/GridLayout/EditorBackground.js +1 -1
- package/lib/components/PageTemplates/GridLayout/EditorBackground.js.map +1 -1
- package/lib/components/PageTemplates/GridLayout/GridLayoutEditor.js +1 -1
- package/lib/components/PageTemplates/GridLayout/GridLayoutEditor.js.map +1 -1
- package/lib/components/PageTemplates/GridLayout/GridLayoutViewer.d.ts +5 -0
- package/lib/components/PageTemplates/GridLayout/GridLayoutViewer.d.ts.map +1 -1
- package/lib/components/PageTemplates/GridLayout/GridLayoutViewer.js +2 -2
- package/lib/components/PageTemplates/GridLayout/GridLayoutViewer.js.map +1 -1
- package/lib/components/PageTemplates/GridLayout/config.d.ts +1 -1
- package/lib/components/PageTemplates/GridLayout/config.d.ts.map +1 -1
- package/lib/components/PageTemplates/GridLayout/config.js +3 -3
- package/lib/components/PageTemplates/GridLayout/config.js.map +1 -1
- package/lib/components/PageTemplates/PageTemplates.d.ts.map +1 -1
- package/lib/components/PageTemplates/PageTemplates.js +33 -5
- package/lib/components/PageTemplates/PageTemplates.js.map +1 -1
- package/lib/components/Phone/PhoneInput.d.ts.map +1 -1
- package/lib/components/Phone/PhoneInput.js +1 -1
- package/lib/components/Phone/PhoneInput.js.map +1 -1
- package/lib/components/Popover/Popover.d.ts.map +1 -1
- package/lib/components/Popover/Popover.js +4 -22
- package/lib/components/Popover/Popover.js.map +1 -1
- package/lib/components/Popover/Popover.styles.d.ts.map +1 -1
- package/lib/components/Popover/Popover.styles.js +19 -4
- package/lib/components/Popover/Popover.styles.js.map +1 -1
- package/lib/components/Popover/modifiers.d.ts.map +1 -1
- package/lib/components/Popover/modifiers.js +10 -0
- package/lib/components/Popover/modifiers.js.map +1 -1
- package/lib/components/RadioCheck/RadioCheck.d.ts.map +1 -1
- package/lib/components/RadioCheck/RadioCheck.js +2 -2
- package/lib/components/RadioCheck/RadioCheck.js.map +1 -1
- package/lib/components/Tabs/TabPanel.d.ts.map +1 -1
- package/lib/components/Tabs/TabPanel.js +8 -0
- package/lib/components/Tabs/TabPanel.js.map +1 -1
- package/lib/components/Toaster/Toaster.d.ts.map +1 -1
- package/lib/components/Toaster/Toaster.js +9 -5
- package/lib/components/Toaster/Toaster.js.map +1 -1
- package/lib/components/Toaster/Toaster.types.d.ts +3 -3
- package/lib/components/Toaster/Toaster.types.d.ts.map +1 -1
- package/lib/components/Toaster/Toaster.types.js.map +1 -1
- package/lib/components/Tooltip/Tooltip.d.ts.map +1 -1
- package/lib/components/Tooltip/Tooltip.js +3 -1
- package/lib/components/Tooltip/Tooltip.js.map +1 -1
- package/lib/components/Tree/Tree.js +1 -1
- package/lib/components/Tree/Tree.js.map +1 -1
- package/lib/hooks/index.d.ts +2 -0
- package/lib/hooks/index.d.ts.map +1 -1
- package/lib/hooks/index.js +2 -0
- package/lib/hooks/index.js.map +1 -1
- package/lib/hooks/useAnimatedText.d.ts +11 -0
- package/lib/hooks/useAnimatedText.d.ts.map +1 -0
- package/lib/hooks/useAnimatedText.js +96 -0
- package/lib/hooks/useAnimatedText.js.map +1 -0
- package/lib/hooks/useBreakpoint.d.ts.map +1 -1
- package/lib/hooks/useBreakpoint.js +5 -2
- package/lib/hooks/useBreakpoint.js.map +1 -1
- package/lib/hooks/useChToPxConversionFactor.d.ts +2 -2
- package/lib/hooks/useChToPxConversionFactor.d.ts.map +1 -1
- package/lib/hooks/useChToPxConversionFactor.js +4 -13
- package/lib/hooks/useChToPxConversionFactor.js.map +1 -1
- package/lib/hooks/useI18n.d.ts +182 -2
- package/lib/hooks/useI18n.d.ts.map +1 -1
- package/lib/hooks/useItemIntersection.d.ts +2 -1
- package/lib/hooks/useItemIntersection.d.ts.map +1 -1
- package/lib/hooks/useItemIntersection.js +10 -4
- package/lib/hooks/useItemIntersection.js.map +1 -1
- package/lib/hooks/usePopoverMap.d.ts +10 -0
- package/lib/hooks/usePopoverMap.d.ts.map +1 -0
- package/lib/hooks/usePopoverMap.js +34 -0
- package/lib/hooks/usePopoverMap.js.map +1 -0
- package/lib/hooks/useThemeMode.d.ts +10 -0
- package/lib/hooks/useThemeMode.d.ts.map +1 -0
- package/lib/hooks/useThemeMode.js +11 -0
- package/lib/hooks/useThemeMode.js.map +1 -0
- package/lib/i18n/default.d.ts +186 -2
- package/lib/i18n/default.d.ts.map +1 -1
- package/lib/i18n/default.js +200 -5
- package/lib/i18n/default.js.map +1 -1
- package/lib/i18n/i18n.d.ts +182 -2
- package/lib/i18n/i18n.d.ts.map +1 -1
- package/lib/styles/GlobalStyle.d.ts +2 -2
- package/lib/styles/GlobalStyle.d.ts.map +1 -1
- package/lib/styles/GlobalStyle.js +8 -3
- package/lib/styles/GlobalStyle.js.map +1 -1
- package/lib/styles/animations.d.ts +9 -0
- package/lib/styles/animations.d.ts.map +1 -0
- package/lib/styles/animations.js +78 -0
- package/lib/styles/animations.js.map +1 -0
- package/lib/styles/constants.d.ts +5 -0
- package/lib/styles/constants.d.ts.map +1 -0
- package/lib/styles/constants.js +5 -0
- package/lib/styles/constants.js.map +1 -0
- package/lib/styles/gradients.d.ts +2 -0
- package/lib/styles/gradients.d.ts.map +1 -1
- package/lib/styles/gradients.js +4 -1
- package/lib/styles/gradients.js.map +1 -1
- package/lib/styles/index.d.ts +1 -0
- package/lib/styles/index.d.ts.map +1 -1
- package/lib/styles/index.js +1 -0
- package/lib/styles/index.js.map +1 -1
- package/lib/styles/utils.d.ts +1 -1
- package/lib/styles/utils.d.ts.map +1 -1
- package/lib/styles/utils.js +1 -1
- package/lib/styles/utils.js.map +1 -1
- package/lib/theme/index.d.ts +2 -0
- package/lib/theme/index.d.ts.map +1 -1
- package/lib/theme/index.js +2 -0
- package/lib/theme/index.js.map +1 -1
- package/lib/theme/theme.d.ts +150 -0
- package/lib/theme/theme.d.ts.map +1 -1
- package/lib/theme/themeDefinition.json +82 -0
- package/lib/theme/themeOverrides.schema.json +102 -0
- package/lib/theme/themes/bootes2025Theme.json +3 -3
- package/lib/theme/themes/cygnus2025Theme.json +17 -17
- package/lib/theme/themes/studioDarkTheme.json +240 -0
- package/lib/theme/themes/studioTheme.json +240 -0
- package/lib/utils/focusNonInteractiveElement.d.ts +9 -0
- package/lib/utils/focusNonInteractiveElement.d.ts.map +1 -0
- package/lib/utils/focusNonInteractiveElement.js +27 -0
- package/lib/utils/focusNonInteractiveElement.js.map +1 -0
- package/lib/utils/getChToPxConversionFactor.d.ts +11 -0
- package/lib/utils/getChToPxConversionFactor.d.ts.map +1 -0
- package/lib/utils/getChToPxConversionFactor.js +18 -0
- package/lib/utils/getChToPxConversionFactor.js.map +1 -0
- package/lib/utils/getChildOfRootNode.d.ts +10 -0
- package/lib/utils/getChildOfRootNode.d.ts.map +1 -0
- package/lib/utils/getChildOfRootNode.js +19 -0
- package/lib/utils/getChildOfRootNode.js.map +1 -0
- package/lib/utils/getFocusables.d.ts +4 -2
- package/lib/utils/getFocusables.d.ts.map +1 -1
- package/lib/utils/getFocusables.js +9 -7
- package/lib/utils/getFocusables.js.map +1 -1
- package/lib/utils/index.d.ts +4 -0
- package/lib/utils/index.d.ts.map +1 -1
- package/lib/utils/index.js +4 -0
- package/lib/utils/index.js.map +1 -1
- package/lib/utils/isInstance.d.ts +4 -4
- package/lib/utils/isInstance.d.ts.map +1 -1
- package/lib/utils/isInstance.js +20 -8
- package/lib/utils/isInstance.js.map +1 -1
- package/lib/utils/markdownTokenizer.d.ts +3 -0
- package/lib/utils/markdownTokenizer.d.ts.map +1 -0
- package/lib/utils/markdownTokenizer.js +159 -0
- package/lib/utils/markdownTokenizer.js.map +1 -0
- package/package.json +5 -3
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/// <reference types="google.maps" preserve="true" />
|
|
2
2
|
import { Loader } from '@googlemaps/js-api-loader';
|
|
3
|
-
import {
|
|
3
|
+
import { GeolocationUnsupportedError, GoogleMapsAPINotFoundError, IsNotAnObjectError, ProviderNotSupportedError } from './Location.types';
|
|
4
|
+
import GoogleMapsAPI from './GoogleMapsAPI';
|
|
4
5
|
const DegreeRegexChunks = [
|
|
5
6
|
/^[-+]?/,
|
|
6
7
|
// latitude degrees
|
|
@@ -93,7 +94,7 @@ const providers = {
|
|
|
93
94
|
language: opts.language,
|
|
94
95
|
libraries: ['places', 'marker']
|
|
95
96
|
});
|
|
96
|
-
return loader.load().then(() =>
|
|
97
|
+
return loader.load().then(() => new GoogleMapsAPI(), () => {
|
|
97
98
|
throw new Error(GoogleMapsAPINotFoundError);
|
|
98
99
|
});
|
|
99
100
|
}
|
|
@@ -113,11 +114,13 @@ export async function loadMapsAPI(name = '', opts) {
|
|
|
113
114
|
if (!provider.loadedPromise) {
|
|
114
115
|
provider.loadedPromise = provider
|
|
115
116
|
.loadAPI(opts)
|
|
116
|
-
.then(
|
|
117
|
+
.then(ApiObj => {
|
|
117
118
|
provider.loadedApiKey = opts?.apiKey ?? '';
|
|
119
|
+
return ApiObj;
|
|
118
120
|
})
|
|
119
|
-
.catch(
|
|
121
|
+
.catch(err => {
|
|
120
122
|
provider.loadedPromise = null;
|
|
123
|
+
throw new Error(err);
|
|
121
124
|
});
|
|
122
125
|
}
|
|
123
126
|
return provider.loadedPromise;
|
|
@@ -219,163 +222,6 @@ export async function getNavigatorPosition() {
|
|
|
219
222
|
export function toGoogleLatLng(coords) {
|
|
220
223
|
return new google.maps.LatLng(coords.latitude, coords.longitude);
|
|
221
224
|
}
|
|
222
|
-
/** Returns an array of place prediction objects ('place' can be an establishment, geographic location, or prominent point of interest)
|
|
223
|
-
* and session token (valid for multiple queries, followed by one place selection).
|
|
224
|
-
*/
|
|
225
|
-
export async function getPlacePredictions(location, bias = {}) {
|
|
226
|
-
const autocompleteService = new google.maps.places.AutocompleteService();
|
|
227
|
-
const optionalParams = {};
|
|
228
|
-
if (bias?.location) {
|
|
229
|
-
if (bias?.location.center === 'current') {
|
|
230
|
-
await getNavigatorPosition()
|
|
231
|
-
.then(coords => {
|
|
232
|
-
optionalParams.location = toGoogleLatLng(coords);
|
|
233
|
-
optionalParams.radius = bias.location.radius;
|
|
234
|
-
})
|
|
235
|
-
// no-op user didn't allow location
|
|
236
|
-
.catch(() => { });
|
|
237
|
-
}
|
|
238
|
-
else {
|
|
239
|
-
optionalParams.location = toGoogleLatLng(bias.location.center);
|
|
240
|
-
optionalParams.radius = bias.location.radius;
|
|
241
|
-
}
|
|
242
|
-
}
|
|
243
|
-
if (bias?.bounds) {
|
|
244
|
-
const [sw, ne] = bias.bounds;
|
|
245
|
-
optionalParams.bounds = new google.maps.LatLngBounds(toGoogleLatLng(sw), toGoogleLatLng(ne));
|
|
246
|
-
}
|
|
247
|
-
return new Promise((resolve, reject) => {
|
|
248
|
-
const token = new google.maps.places.AutocompleteSessionToken();
|
|
249
|
-
autocompleteService.getPlacePredictions({
|
|
250
|
-
input: location,
|
|
251
|
-
types: QUERY_TYPES,
|
|
252
|
-
sessionToken: token,
|
|
253
|
-
...optionalParams
|
|
254
|
-
}, (placePredictions, status) => {
|
|
255
|
-
if (status === google.maps.places.PlacesServiceStatus.OK) {
|
|
256
|
-
resolve({ placePredictions: placePredictions ?? [], token });
|
|
257
|
-
}
|
|
258
|
-
else {
|
|
259
|
-
reject(new Error(LocationNotFoundError));
|
|
260
|
-
}
|
|
261
|
-
});
|
|
262
|
-
});
|
|
263
|
-
}
|
|
264
|
-
export async function getPlace(location, mapElement = document.createElement('div')) {
|
|
265
|
-
const placesService = new google.maps.places.PlacesService(mapElement);
|
|
266
|
-
const { placePredictions, token } = await getPlacePredictions(location);
|
|
267
|
-
return new Promise((resolve, reject) => {
|
|
268
|
-
placesService.getDetails({
|
|
269
|
-
placeId: placePredictions[0]?.place_id,
|
|
270
|
-
fields: QUERY_FIELDS,
|
|
271
|
-
sessionToken: token
|
|
272
|
-
}, (place, pStatus) => {
|
|
273
|
-
if (pStatus === google.maps.places.PlacesServiceStatus.OK) {
|
|
274
|
-
resolve({
|
|
275
|
-
latitude: place?.geometry?.location?.lat() ?? NaN,
|
|
276
|
-
longitude: place?.geometry?.location?.lng() ?? NaN
|
|
277
|
-
});
|
|
278
|
-
}
|
|
279
|
-
else {
|
|
280
|
-
reject(new Error(LocationNotFoundError));
|
|
281
|
-
}
|
|
282
|
-
});
|
|
283
|
-
});
|
|
284
|
-
}
|
|
285
|
-
export async function getPlaceById(placeId, sessionToken = new google.maps.places.AutocompleteSessionToken(), mapElement = document.createElement('div')) {
|
|
286
|
-
const placesService = new google.maps.places.PlacesService(mapElement);
|
|
287
|
-
return new Promise((resolve, reject) => {
|
|
288
|
-
placesService.getDetails({ placeId, fields: QUERY_FIELDS, sessionToken }, (place, pStatus) => {
|
|
289
|
-
if (pStatus === google.maps.places.PlacesServiceStatus.OK) {
|
|
290
|
-
resolve({
|
|
291
|
-
name: place?.name,
|
|
292
|
-
address: place?.formatted_address,
|
|
293
|
-
latitude: place?.geometry?.location?.lat(),
|
|
294
|
-
longitude: place?.geometry?.location?.lng()
|
|
295
|
-
});
|
|
296
|
-
}
|
|
297
|
-
else {
|
|
298
|
-
reject(new Error(LocationNotFoundError));
|
|
299
|
-
}
|
|
300
|
-
});
|
|
301
|
-
});
|
|
302
|
-
}
|
|
303
|
-
/** Returns coordinations for given input: either coords, address or current position. */
|
|
304
|
-
export async function getCoords(coords, mapElement) {
|
|
305
|
-
if (coords === '' || coords === undefined)
|
|
306
|
-
throw new Error();
|
|
307
|
-
if (coords === 'current')
|
|
308
|
-
return getNavigatorPosition();
|
|
309
|
-
let location;
|
|
310
|
-
if (typeof coords === 'string') {
|
|
311
|
-
let latLng = [];
|
|
312
|
-
if (isValueDMSCoordinate(coords) ||
|
|
313
|
-
isValueDMCoordinate(coords) ||
|
|
314
|
-
isValueDegreeFormatCoordinate(coords)) {
|
|
315
|
-
latLng = parseDMS(coords);
|
|
316
|
-
}
|
|
317
|
-
else {
|
|
318
|
-
let splitter;
|
|
319
|
-
if (coords.includes(', ')) {
|
|
320
|
-
splitter = ', ';
|
|
321
|
-
}
|
|
322
|
-
else if (coords.includes(',')) {
|
|
323
|
-
splitter = ',';
|
|
324
|
-
}
|
|
325
|
-
else if (coords.includes(' ')) {
|
|
326
|
-
splitter = ' ';
|
|
327
|
-
}
|
|
328
|
-
else {
|
|
329
|
-
splitter = ', ';
|
|
330
|
-
}
|
|
331
|
-
latLng = coords.split(splitter).map(Number);
|
|
332
|
-
}
|
|
333
|
-
const [lat, lng] = latLng;
|
|
334
|
-
if (Number.isNaN(lat) || Number.isNaN(lng) || lat === undefined || lng === undefined)
|
|
335
|
-
return getPlace(coords, mapElement);
|
|
336
|
-
location = { latitude: lat, longitude: lng };
|
|
337
|
-
}
|
|
338
|
-
else {
|
|
339
|
-
location = coords;
|
|
340
|
-
}
|
|
341
|
-
if (Number.isFinite(location.latitude) && Number.isFinite(location.longitude))
|
|
342
|
-
return location;
|
|
343
|
-
throw new Error(CoordsCannotBeParsedError);
|
|
344
|
-
}
|
|
345
|
-
export async function getAddress(coords) {
|
|
346
|
-
const location = {
|
|
347
|
-
lat: coords.latitude,
|
|
348
|
-
lng: coords.longitude
|
|
349
|
-
};
|
|
350
|
-
const geocoder = new google.maps.Geocoder();
|
|
351
|
-
return new Promise((resolve, reject) => {
|
|
352
|
-
geocoder.geocode({ location }, (results, status) => {
|
|
353
|
-
if (status === 'OK') {
|
|
354
|
-
const [result] = results ?? [];
|
|
355
|
-
if (result) {
|
|
356
|
-
resolve({
|
|
357
|
-
name: result.formatted_address,
|
|
358
|
-
address: result.formatted_address,
|
|
359
|
-
...(result.geometry && {
|
|
360
|
-
latitude: result.geometry.location.lat(),
|
|
361
|
-
longitude: result.geometry.location.lng()
|
|
362
|
-
})
|
|
363
|
-
});
|
|
364
|
-
}
|
|
365
|
-
else {
|
|
366
|
-
resolve({
|
|
367
|
-
name: `${coords.latitude}, ${coords.longitude}`,
|
|
368
|
-
latitude: coords.latitude,
|
|
369
|
-
longitude: coords.longitude
|
|
370
|
-
});
|
|
371
|
-
}
|
|
372
|
-
}
|
|
373
|
-
else {
|
|
374
|
-
reject(new Error(`${GeocoderFailedError}: ${status}`));
|
|
375
|
-
}
|
|
376
|
-
});
|
|
377
|
-
});
|
|
378
|
-
}
|
|
379
225
|
export const isLatLngObject = (obj) => {
|
|
380
226
|
return (!!obj &&
|
|
381
227
|
typeof obj === 'object' &&
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/components/Location/utils.ts"],"names":[],"mappings":"AAAA,qDAAqD;AAErD,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AAEnD,OAAO,EACL,yBAAyB,EACzB,mBAAmB,EACnB,2BAA2B,EAC3B,0BAA0B,EAC1B,kBAAkB,EAClB,qBAAqB,EACrB,yBAAyB,EACzB,YAAY,EACZ,WAAW,EACZ,MAAM,kBAAkB,CAAC;AAG1B,MAAM,iBAAiB,GAAG;IACxB,QAAQ;IACR,mBAAmB;IACnB,gCAAgC;IAChC,KAAK;IACL,qBAAqB;IACrB,QAAQ;IACR,2CAA2C;IAC3C,YAAY;IACZ,OAAO;IACP,oBAAoB;IACpB,6CAA6C;IAC7C,KAAK;IACL,sBAAsB;IACtB,SAAS;CACV,CAAC;AAEF,MAAM,uBAAuB,GAAG,IAAI,MAAM,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC;AAE1F,MAAM,aAAa,GAAG;IACpB,QAAQ;IACR,mBAAmB;IACnB,wBAAwB;IACxB,KAAK;IACL,mBAAmB;IACnB,iCAAiC;IACjC,KAAK;IACL,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pD,GAAG,CAAC,YAAY,CAAC,MAAM,CAAC,WAAW,EAAE,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;IAC1D,GAAG,CAAC,YAAY,CAAC,MAAM,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC;IAElD,OAAO,GAAG,CAAC,IAAI,CAAC;AAClB,CAAC,CAAC","sourcesContent":["/// <reference types=\"google.maps\" preserve=\"true\" />\n\nimport { Loader } from '@googlemaps/js-api-loader';\n\nimport {\n CoordsCannotBeParsedError,\n GeocoderFailedError,\n GeolocationUnsupportedError,\n GoogleMapsAPINotFoundError,\n IsNotAnObjectError,\n LocationNotFoundError,\n ProviderNotSupportedError,\n QUERY_FIELDS,\n QUERY_TYPES\n} from './Location.types';\nimport type { Bias, LatLng, MapsProvider, ProviderOpts, Location } from './Location.types';\n\nconst DegreeRegexChunks = [\n /^[-+]?/,\n // latitude degrees\n /([0-9]|[1-8][0-9]|90)(\\.\\d+)?°/,\n /\\s?/,\n // latitude direction\n /(N|S)?/,\n // sepeartor between latitude and longitude\n /(,|,\\s|\\s)/,\n /[-+]?/,\n // longitude degrees\n /([0-9]|[1-9][0-9]|1[0-7][0-9]|180)(\\.\\d+)?°/,\n /\\s?/,\n // longitude direction\n /(W|E)?$/\n];\n\nconst DegreeRegularExpression = new RegExp(DegreeRegexChunks.map(c => c.source).join(''));\n\nconst DMRegexChunks = [\n /^[-+]?/,\n // latitude degrees\n /([0-9]|[1-8][0-9]|90)°/,\n /\\s?/,\n // latitude minutes\n /([0-9]|[0-5][0-9])(\\.\\d+)?('|’)/,\n /\\s?/,\n // latitude direction\n /(N|S)?/,\n // sepeartor between latitude and longitude\n /(,|,\\s|\\s)/,\n /[-+]?/,\n // longitude degrees\n /([0-9]|[1-9][0-9]|1[0-7][0-9]|180)°/,\n /\\s?/,\n // longitude minutes\n /([0-9]|[0-5][0-9])(\\.\\d+)?('|’)/,\n /\\s?/,\n // longitude direction\n /(W|E)?$/\n];\n\nconst DMRegularExpression = new RegExp(DMRegexChunks.map(c => c.source).join(''));\nconst DMSRegexChunks = [\n /^[-+]?/,\n // latitude degrees\n /([0-9]|[1-8][0-9]|90)°/,\n /\\s?/,\n // latitude minutes\n /([0-9]|[0-5][0-9])('|’)/,\n /\\s?/,\n // latitude seconds\n /([0-9]|[0-5][0-9])(\\.\\d+)?(\"|″)/,\n /\\s?/,\n // latitude direction\n /(N|S)?/,\n // sepeartor between latitude and longitude\n /(,|,\\s|\\s)/,\n /[-+]?/,\n // longitude degrees\n /([0-9]|[1-9][0-9]|1[0-7][0-9]|180)°/,\n /\\s?/,\n // longitude minutes\n /([0-9]|[0-5][0-9])('|’)/,\n /\\s?/,\n // longitude seconds\n /([0-9]|[0-5][0-9])(\\.\\d+)?(\"|″)/,\n /\\s?/,\n // longitude direction\n /(W|E)?$/\n];\n\nconst DMSRegularExpression = new RegExp(DMSRegexChunks.map(c => c.source).join(''));\n\nconst decimalRegexChunks = [\n /^[-+]?/,\n /([0-9]|[1-8][0-9]|90)/,\n /(\\.\\d+)?/,\n /(,|\\s|,\\s)/,\n /[-+]?/,\n /([0-9]|[1-9][0-9]|1[0-7][0-9]|180)/,\n /(\\.\\d+)?$/\n];\n\nconst decimalFormatCoordinatesRegularExpression = new RegExp(\n decimalRegexChunks.map(c => c.source).join('')\n);\n\nconst providers: {\n [key: string]: MapsProvider;\n} = {\n google: {\n name: 'Google',\n loadedPromise: null,\n loadedApiKey: '',\n loadAPI(opts) {\n const loader = new Loader({\n version: 'quarterly',\n apiKey: opts.apiKey ?? '',\n region: opts.region,\n language: opts.language,\n libraries: ['places', 'marker']\n });\n\n return loader.load().then(\n () => {},\n () => {\n throw new Error(GoogleMapsAPINotFoundError);\n }\n );\n }\n },\n undefined: {\n name: 'undefined',\n loadedPromise: null,\n loadedApiKey: '',\n loadAPI: data => Promise.reject(new Error(`${ProviderNotSupportedError}: ${data.name}`))\n }\n};\n\nexport async function loadMapsAPI(name: string = '', opts?: ProviderOpts): Promise<void> {\n if (typeof opts !== 'object' || !opts) {\n throw new Error(IsNotAnObjectError);\n }\n\n const provider = providers[name] ?? providers.undefined;\n\n if (!provider.loadedPromise) {\n provider.loadedPromise = provider\n .loadAPI(opts)\n .then(() => {\n provider.loadedApiKey = opts?.apiKey ?? '';\n })\n .catch(() => {\n provider.loadedPromise = null;\n });\n }\n return provider.loadedPromise;\n}\n\n/**\n * Identifies coordinates in degree format\n * eg. 45.78°N 9.11°E\n */\nexport function isValueDegreeFormatCoordinate(value: string): boolean {\n return DegreeRegularExpression.test(value);\n}\n\n/**\n * Identifies coordinates in degree, minute format\n * eg. 45°45.4’N 9°23’E\n */\nexport function isValueDMCoordinate(value: string): boolean {\n return DMRegularExpression.test(value);\n}\n\n/**\n * Identifies coordinates in degree, minute, second format\n * eg. 45°45’32.4″N 9°23’39.9″E\n */\nexport function isValueDMSCoordinate(value: string): boolean {\n return DMSRegularExpression.test(value);\n}\n\n/**\n * Identifies coordinates in decimal format\n * eg. 14.678, -38.765\n */\nexport function isValueACoordinate(value: string): boolean {\n return (\n decimalFormatCoordinatesRegularExpression.test(value) ||\n isValueDMSCoordinate(value) ||\n isValueDMCoordinate(value) ||\n isValueDegreeFormatCoordinate(value)\n );\n}\n\ninterface DMSParts {\n degrees: number;\n minutes?: number;\n seconds?: number;\n}\n\n/**\n * Converts DMS (degree, minute, second) format latitude/longitude into decimal format.\n */\nfunction convertDMSToDD({ degrees, minutes, seconds }: DMSParts, direction?: string): number {\n let dd = degrees;\n if (minutes) {\n if (degrees > 0) dd += minutes / 60;\n if (degrees < 0) dd -= minutes / 60;\n }\n if (seconds) {\n if (degrees > 0) dd += seconds / (60 * 60);\n if (degrees < 0) dd -= seconds / (60 * 60);\n }\n\n if (degrees > 0 && (direction === 'S' || direction === 'W')) {\n dd *= -1;\n }\n\n return dd;\n}\n\n/**\n * Parses DMS (degree, minute, second) format string into decimal format coordinates.\n */\nexport function parseDMS(input: string): number[] {\n if (isValueDMSCoordinate(input)) {\n const parts = input.split(/'|’|\"\\s?|″\\s?|°|,?\\s|,\\s?/);\n\n const lat = convertDMSToDD(\n {\n degrees: Number(parts[0]),\n minutes: Number(parts[1]),\n seconds: Number(parts[2])\n },\n parts[3]\n );\n const lng = convertDMSToDD(\n {\n degrees: Number(parts[4]),\n minutes: Number(parts[5]),\n seconds: Number(parts[6])\n },\n parts[7]\n );\n return [lat, lng];\n }\n if (isValueDMCoordinate(input)) {\n const parts = input.split(/'\\s?|’\\s?|°|,?\\s|,\\s?/);\n\n const lat = convertDMSToDD({ degrees: Number(parts[0]), minutes: Number(parts[1]) }, parts[2]);\n const lng = convertDMSToDD({ degrees: Number(parts[3]), minutes: Number(parts[4]) }, parts[5]);\n return [lat, lng];\n }\n\n const parts = input.split(/°\\s?|,?\\s|,\\s?/);\n\n const lat = convertDMSToDD({ degrees: Number(parts[0]) }, parts[1]);\n const lng = convertDMSToDD({ degrees: Number(parts[2]) }, parts[3]);\n return [lat, lng];\n}\n\nexport async function getNavigatorPosition(): Promise<LatLng> {\n if (!navigator.geolocation) throw new Error(GeolocationUnsupportedError);\n\n return new Promise((resolve, reject) => {\n navigator.geolocation.getCurrentPosition(\n currentLocation => {\n resolve({\n latitude: currentLocation.coords.latitude,\n longitude: currentLocation.coords.longitude\n });\n },\n error => reject(new Error(error.message))\n );\n });\n}\n\nexport function toGoogleLatLng(coords: LatLng): google.maps.LatLng {\n return new google.maps.LatLng(coords.latitude, coords.longitude);\n}\n\n/** Returns an array of place prediction objects ('place' can be an establishment, geographic location, or prominent point of interest)\n * and session token (valid for multiple queries, followed by one place selection).\n */\nexport async function getPlacePredictions(\n location: string,\n bias: Bias = {}\n): Promise<{\n placePredictions: google.maps.places.AutocompletePrediction[];\n token: google.maps.places.AutocompleteSessionToken;\n}> {\n const autocompleteService = new google.maps.places.AutocompleteService();\n const optionalParams: Partial<google.maps.places.AutocompletionRequest> = {};\n if (bias?.location) {\n if (bias?.location.center === 'current') {\n await getNavigatorPosition()\n .then(coords => {\n optionalParams.location = toGoogleLatLng(coords);\n optionalParams.radius = bias.location!.radius;\n })\n // no-op user didn't allow location\n .catch(() => {});\n } else {\n optionalParams.location = toGoogleLatLng(bias.location.center);\n optionalParams.radius = bias.location.radius;\n }\n }\n\n if (bias?.bounds) {\n const [sw, ne] = bias.bounds;\n optionalParams.bounds = new google.maps.LatLngBounds(toGoogleLatLng(sw), toGoogleLatLng(ne));\n }\n return new Promise((resolve, reject) => {\n const token = new google.maps.places.AutocompleteSessionToken();\n autocompleteService.getPlacePredictions(\n {\n input: location,\n types: QUERY_TYPES,\n sessionToken: token,\n ...optionalParams\n },\n (placePredictions, status) => {\n if (status === google.maps.places.PlacesServiceStatus.OK) {\n resolve({ placePredictions: placePredictions ?? [], token });\n } else {\n reject(new Error(LocationNotFoundError));\n }\n }\n );\n });\n}\n\nexport async function getPlace(\n location: string,\n mapElement: HTMLDivElement = document.createElement('div')\n): Promise<LatLng> {\n const placesService = new google.maps.places.PlacesService(mapElement);\n const { placePredictions, token } = await getPlacePredictions(location);\n return new Promise((resolve, reject) => {\n placesService.getDetails(\n {\n placeId: placePredictions[0]?.place_id,\n fields: QUERY_FIELDS,\n sessionToken: token\n },\n (place, pStatus) => {\n if (pStatus === google.maps.places.PlacesServiceStatus.OK) {\n resolve({\n latitude: place?.geometry?.location?.lat() ?? NaN,\n longitude: place?.geometry?.location?.lng() ?? NaN\n });\n } else {\n reject(new Error(LocationNotFoundError));\n }\n }\n );\n });\n}\n\nexport async function getPlaceById(\n placeId: string,\n sessionToken: google.maps.places.AutocompleteSessionToken = new google.maps.places.AutocompleteSessionToken(),\n mapElement: HTMLDivElement = document.createElement('div')\n): Promise<Location> {\n const placesService = new google.maps.places.PlacesService(mapElement);\n return new Promise((resolve, reject) => {\n placesService.getDetails({ placeId, fields: QUERY_FIELDS, sessionToken }, (place, pStatus) => {\n if (pStatus === google.maps.places.PlacesServiceStatus.OK) {\n resolve({\n name: place?.name,\n address: place?.formatted_address,\n latitude: place?.geometry?.location?.lat(),\n longitude: place?.geometry?.location?.lng()\n });\n } else {\n reject(new Error(LocationNotFoundError));\n }\n });\n });\n}\n\n/** Returns coordinations for given input: either coords, address or current position. */\nexport async function getCoords(\n coords: string | 'current' | LatLng,\n mapElement?: HTMLDivElement\n): Promise<LatLng> {\n if (coords === '' || coords === undefined) throw new Error();\n if (coords === 'current') return getNavigatorPosition();\n\n let location: LatLng;\n if (typeof coords === 'string') {\n let latLng: number[] = [];\n if (\n isValueDMSCoordinate(coords) ||\n isValueDMCoordinate(coords) ||\n isValueDegreeFormatCoordinate(coords)\n ) {\n latLng = parseDMS(coords);\n } else {\n let splitter;\n if (coords.includes(', ')) {\n splitter = ', ';\n } else if (coords.includes(',')) {\n splitter = ',';\n } else if (coords.includes(' ')) {\n splitter = ' ';\n } else {\n splitter = ', ';\n }\n\n latLng = coords.split(splitter).map(Number);\n }\n\n const [lat, lng] = latLng;\n if (Number.isNaN(lat) || Number.isNaN(lng) || lat === undefined || lng === undefined)\n return getPlace(coords, mapElement);\n location = { latitude: lat, longitude: lng };\n } else {\n location = coords;\n }\n\n if (Number.isFinite(location.latitude) && Number.isFinite(location.longitude)) return location;\n\n throw new Error(CoordsCannotBeParsedError);\n}\n\nexport async function getAddress(coords: LatLng): Promise<{\n name: string;\n address?: string;\n latitude: number;\n longitude: number;\n}> {\n const location = {\n lat: coords.latitude,\n lng: coords.longitude\n };\n const geocoder = new google.maps.Geocoder();\n return new Promise((resolve, reject) => {\n geocoder.geocode(\n { location },\n (results: google.maps.GeocoderResult[] | null, status: google.maps.GeocoderStatus) => {\n if (status === 'OK') {\n const [result] = results ?? [];\n if (result) {\n resolve({\n name: result.formatted_address,\n address: result.formatted_address,\n ...(result.geometry && {\n latitude: result.geometry.location.lat(),\n longitude: result.geometry.location.lng()\n })\n });\n } else {\n resolve({\n name: `${coords.latitude}, ${coords.longitude}`,\n latitude: coords.latitude,\n longitude: coords.longitude\n });\n }\n } else {\n reject(new Error(`${GeocoderFailedError}: ${status}`));\n }\n }\n );\n });\n}\n\nexport const isLatLngObject = (obj: unknown): obj is google.maps.LatLng => {\n return (\n !!obj &&\n typeof obj === 'object' &&\n 'lat' in obj &&\n typeof obj.lat === 'function' &&\n 'lng' in obj &&\n typeof obj.lng === 'function'\n );\n};\n\nexport const getGoogleMapsDirHref = (\n destination: string,\n waypoints: string[],\n travelMode: string = 'driving'\n) => {\n const url = new URL('https://www.google.com/maps/dir/?api=1');\n\n url.searchParams.append('destination', destination);\n url.searchParams.append('waypoints', waypoints.join('|'));\n url.searchParams.append('travelmode', travelMode);\n\n return url.href;\n};\n"]}
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/components/Location/utils.ts"],"names":[],"mappings":"AAAA,qDAAqD;AAErD,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AAEnD,OAAO,EACL,2BAA2B,EAC3B,0BAA0B,EAC1B,kBAAkB,EAClB,yBAAyB,EAC1B,MAAM,kBAAkB,CAAC;AAG1B,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAE5C,MAAM,iBAAiB,GAAG;IACxB,QAAQ;IACR,mBAAmB;IACnB,gCAAgC;IAChC,KAAK;IACL,qBAAqB;IACrB,QAAQ;IACR,2CAA2C;IAC3C,YAAY;IACZ,OAAO;IACP,oBAAoB;IACpB,6CAA6C;IAC7C,KAAK;IACL,sBAAsB;IACtB,SAAS;CACV,CAAC;AAEF,MAAM,uBAAuB,GAAG,IAAI,MAAM,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC;AAE1F,MAAM,aAAa,GAAG;IACpB,QAAQ;IACR,mBAAmB;IACnB,wBAAwB;IACxB,KAAK;IACL,mBAAmB;IACnB,iCAAiC;IACjC,KAAK;IACL,qBAAqB;IACrB,QAAQ;IACR,2CAA2C;IAC3C,YAAY;IACZ,OAAO;IACP,oBAAoB;IACpB,qCAAqC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AAK,CAAC,EAAE,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAC1C,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,MAAc;IAC3C,OAAO,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,SAAS,CAAC,CAAC;AACnE,CAAC;AAED,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,GAAY,EAA6B,EAAE;IACxE,OAAO,CACL,CAAC,CAAC,GAAG;QACL,OAAO,GAAG,KAAK,QAAQ;QACvB,KAAK,IAAI,GAAG;QACZ,OAAO,GAAG,CAAC,GAAG,KAAK,UAAU;QAC7B,KAAK,IAAI,GAAG;QACZ,OAAO,GAAG,CAAC,GAAG,KAAK,UAAU,CAC9B,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAClC,WAAmB,EACnB,SAAmB,EACnB,aAAqB,SAAS,EAC9B,EAAE;IACF,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,wCAAwC,CAAC,CAAC;IAE9D,GAAG,CAAC,YAAY,CAAC,MAAM,CAAC,aAAa,EAAE,WAAW,CAAC,CAAC;IACpD,GAAG,CAAC,YAAY,CAAC,MAAM,CAAC,WAAW,EAAE,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;IAC1D,GAAG,CAAC,YAAY,CAAC,MAAM,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC;IAElD,OAAO,GAAG,CAAC,IAAI,CAAC;AAClB,CAAC,CAAC","sourcesContent":["/// <reference types=\"google.maps\" preserve=\"true\" />\n\nimport { Loader } from '@googlemaps/js-api-loader';\n\nimport {\n GeolocationUnsupportedError,\n GoogleMapsAPINotFoundError,\n IsNotAnObjectError,\n ProviderNotSupportedError\n} from './Location.types';\nimport type { LatLng, MapsProvider, ProviderOpts } from './Location.types';\nimport type { LocationAPI } from './LocationAPI.types';\nimport GoogleMapsAPI from './GoogleMapsAPI';\n\nconst DegreeRegexChunks = [\n /^[-+]?/,\n // latitude degrees\n /([0-9]|[1-8][0-9]|90)(\\.\\d+)?°/,\n /\\s?/,\n // latitude direction\n /(N|S)?/,\n // sepeartor between latitude and longitude\n /(,|,\\s|\\s)/,\n /[-+]?/,\n // longitude degrees\n /([0-9]|[1-9][0-9]|1[0-7][0-9]|180)(\\.\\d+)?°/,\n /\\s?/,\n // longitude direction\n /(W|E)?$/\n];\n\nconst DegreeRegularExpression = new RegExp(DegreeRegexChunks.map(c => c.source).join(''));\n\nconst DMRegexChunks = [\n /^[-+]?/,\n // latitude degrees\n /([0-9]|[1-8][0-9]|90)°/,\n /\\s?/,\n // latitude minutes\n /([0-9]|[0-5][0-9])(\\.\\d+)?('|’)/,\n /\\s?/,\n // latitude direction\n /(N|S)?/,\n // sepeartor between latitude and longitude\n /(,|,\\s|\\s)/,\n /[-+]?/,\n // longitude degrees\n /([0-9]|[1-9][0-9]|1[0-7][0-9]|180)°/,\n /\\s?/,\n // longitude minutes\n /([0-9]|[0-5][0-9])(\\.\\d+)?('|’)/,\n /\\s?/,\n // longitude direction\n /(W|E)?$/\n];\n\nconst DMRegularExpression = new RegExp(DMRegexChunks.map(c => c.source).join(''));\nconst DMSRegexChunks = [\n /^[-+]?/,\n // latitude degrees\n /([0-9]|[1-8][0-9]|90)°/,\n /\\s?/,\n // latitude minutes\n /([0-9]|[0-5][0-9])('|’)/,\n /\\s?/,\n // latitude seconds\n /([0-9]|[0-5][0-9])(\\.\\d+)?(\"|″)/,\n /\\s?/,\n // latitude direction\n /(N|S)?/,\n // sepeartor between latitude and longitude\n /(,|,\\s|\\s)/,\n /[-+]?/,\n // longitude degrees\n /([0-9]|[1-9][0-9]|1[0-7][0-9]|180)°/,\n /\\s?/,\n // longitude minutes\n /([0-9]|[0-5][0-9])('|’)/,\n /\\s?/,\n // longitude seconds\n /([0-9]|[0-5][0-9])(\\.\\d+)?(\"|″)/,\n /\\s?/,\n // longitude direction\n /(W|E)?$/\n];\n\nconst DMSRegularExpression = new RegExp(DMSRegexChunks.map(c => c.source).join(''));\n\nconst decimalRegexChunks = [\n /^[-+]?/,\n /([0-9]|[1-8][0-9]|90)/,\n /(\\.\\d+)?/,\n /(,|\\s|,\\s)/,\n /[-+]?/,\n /([0-9]|[1-9][0-9]|1[0-7][0-9]|180)/,\n /(\\.\\d+)?$/\n];\n\nconst decimalFormatCoordinatesRegularExpression = new RegExp(\n decimalRegexChunks.map(c => c.source).join('')\n);\n\nconst providers: {\n [key: string]: MapsProvider;\n} = {\n google: {\n name: 'Google',\n loadedPromise: null,\n loadedApiKey: '',\n loadAPI(opts) {\n const loader = new Loader({\n version: 'quarterly',\n apiKey: opts.apiKey ?? '',\n region: opts.region,\n language: opts.language,\n libraries: ['places', 'marker']\n });\n\n return loader.load().then(\n () => new GoogleMapsAPI(),\n () => {\n throw new Error(GoogleMapsAPINotFoundError);\n }\n );\n }\n },\n undefined: {\n name: 'undefined',\n loadedPromise: null,\n loadedApiKey: '',\n loadAPI: data => Promise.reject(new Error(`${ProviderNotSupportedError}: ${data.name}`))\n }\n};\n\nexport async function loadMapsAPI(name: string = '', opts?: ProviderOpts): Promise<LocationAPI> {\n if (typeof opts !== 'object' || !opts) {\n throw new Error(IsNotAnObjectError);\n }\n\n const provider = providers[name] ?? providers.undefined;\n\n if (!provider.loadedPromise) {\n provider.loadedPromise = provider\n .loadAPI(opts)\n .then(ApiObj => {\n provider.loadedApiKey = opts?.apiKey ?? '';\n return ApiObj;\n })\n .catch(err => {\n provider.loadedPromise = null;\n throw new Error(err);\n });\n }\n return provider.loadedPromise;\n}\n\n/**\n * Identifies coordinates in degree format\n * eg. 45.78°N 9.11°E\n */\nexport function isValueDegreeFormatCoordinate(value: string): boolean {\n return DegreeRegularExpression.test(value);\n}\n\n/**\n * Identifies coordinates in degree, minute format\n * eg. 45°45.4’N 9°23’E\n */\nexport function isValueDMCoordinate(value: string): boolean {\n return DMRegularExpression.test(value);\n}\n\n/**\n * Identifies coordinates in degree, minute, second format\n * eg. 45°45’32.4″N 9°23’39.9″E\n */\nexport function isValueDMSCoordinate(value: string): boolean {\n return DMSRegularExpression.test(value);\n}\n\n/**\n * Identifies coordinates in decimal format\n * eg. 14.678, -38.765\n */\nexport function isValueACoordinate(value: string): boolean {\n return (\n decimalFormatCoordinatesRegularExpression.test(value) ||\n isValueDMSCoordinate(value) ||\n isValueDMCoordinate(value) ||\n isValueDegreeFormatCoordinate(value)\n );\n}\n\ninterface DMSParts {\n degrees: number;\n minutes?: number;\n seconds?: number;\n}\n\n/**\n * Converts DMS (degree, minute, second) format latitude/longitude into decimal format.\n */\nfunction convertDMSToDD({ degrees, minutes, seconds }: DMSParts, direction?: string): number {\n let dd = degrees;\n if (minutes) {\n if (degrees > 0) dd += minutes / 60;\n if (degrees < 0) dd -= minutes / 60;\n }\n if (seconds) {\n if (degrees > 0) dd += seconds / (60 * 60);\n if (degrees < 0) dd -= seconds / (60 * 60);\n }\n\n if (degrees > 0 && (direction === 'S' || direction === 'W')) {\n dd *= -1;\n }\n\n return dd;\n}\n\n/**\n * Parses DMS (degree, minute, second) format string into decimal format coordinates.\n */\nexport function parseDMS(input: string): number[] {\n if (isValueDMSCoordinate(input)) {\n const parts = input.split(/'|’|\"\\s?|″\\s?|°|,?\\s|,\\s?/);\n\n const lat = convertDMSToDD(\n {\n degrees: Number(parts[0]),\n minutes: Number(parts[1]),\n seconds: Number(parts[2])\n },\n parts[3]\n );\n const lng = convertDMSToDD(\n {\n degrees: Number(parts[4]),\n minutes: Number(parts[5]),\n seconds: Number(parts[6])\n },\n parts[7]\n );\n return [lat, lng];\n }\n if (isValueDMCoordinate(input)) {\n const parts = input.split(/'\\s?|’\\s?|°|,?\\s|,\\s?/);\n\n const lat = convertDMSToDD({ degrees: Number(parts[0]), minutes: Number(parts[1]) }, parts[2]);\n const lng = convertDMSToDD({ degrees: Number(parts[3]), minutes: Number(parts[4]) }, parts[5]);\n return [lat, lng];\n }\n\n const parts = input.split(/°\\s?|,?\\s|,\\s?/);\n\n const lat = convertDMSToDD({ degrees: Number(parts[0]) }, parts[1]);\n const lng = convertDMSToDD({ degrees: Number(parts[2]) }, parts[3]);\n return [lat, lng];\n}\n\nexport async function getNavigatorPosition(): Promise<LatLng> {\n if (!navigator.geolocation) throw new Error(GeolocationUnsupportedError);\n\n return new Promise((resolve, reject) => {\n navigator.geolocation.getCurrentPosition(\n currentLocation => {\n resolve({\n latitude: currentLocation.coords.latitude,\n longitude: currentLocation.coords.longitude\n });\n },\n error => reject(new Error(error.message))\n );\n });\n}\n\nexport function toGoogleLatLng(coords: LatLng): google.maps.LatLng {\n return new google.maps.LatLng(coords.latitude, coords.longitude);\n}\n\nexport const isLatLngObject = (obj: unknown): obj is google.maps.LatLng => {\n return (\n !!obj &&\n typeof obj === 'object' &&\n 'lat' in obj &&\n typeof obj.lat === 'function' &&\n 'lng' in obj &&\n typeof obj.lng === 'function'\n );\n};\n\nexport const getGoogleMapsDirHref = (\n destination: string,\n waypoints: string[],\n travelMode: string = 'driving'\n) => {\n const url = new URL('https://www.google.com/maps/dir/?api=1');\n\n url.searchParams.append('destination', destination);\n url.searchParams.append('waypoints', waypoints.join('|'));\n url.searchParams.append('travelmode', travelMode);\n\n return url.href;\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MetaList.d.ts","sourceRoot":"","sources":["../../../src/components/MetaList/MetaList.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,GAAG,EAAmB,MAAM,OAAO,CAAC;AAK7D,OAAO,KAAK,EACV,SAAS,EACT,+BAA+B,EAC/B,cAAc,EACd,UAAU,EACX,MAAM,aAAa,CAAC;AAMrB,MAAM,WAAW,aAAc,SAAQ,SAAS,EAAE,cAAc,EAAE,UAAU;IAC1E,yDAAyD;IACzD,KAAK,EAAE,SAAS,EAAE,CAAC;IACnB;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,oCAAoC;IACpC,GAAG,CAAC,EAAE,GAAG,CAAC,gBAAgB,CAAC,CAAC;CAC7B;AAED,eAAO,MAAM,cAAc;eAA0B,OAAO;SAc1D,CAAC;AAEH,eAAO,MAAM,kBAAkB;eAA0B,OAAO;SAoB9D,CAAC;;;;
|
|
1
|
+
{"version":3,"file":"MetaList.d.ts","sourceRoot":"","sources":["../../../src/components/MetaList/MetaList.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,GAAG,EAAmB,MAAM,OAAO,CAAC;AAK7D,OAAO,KAAK,EACV,SAAS,EACT,+BAA+B,EAC/B,cAAc,EACd,UAAU,EACX,MAAM,aAAa,CAAC;AAMrB,MAAM,WAAW,aAAc,SAAQ,SAAS,EAAE,cAAc,EAAE,UAAU;IAC1E,yDAAyD;IACzD,KAAK,EAAE,SAAS,EAAE,CAAC;IACnB;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,oCAAoC;IACpC,GAAG,CAAC,EAAE,GAAG,CAAC,gBAAgB,CAAC,CAAC;CAC7B;AAED,eAAO,MAAM,cAAc;eAA0B,OAAO;SAc1D,CAAC;AAEH,eAAO,MAAM,kBAAkB;eAA0B,OAAO;SAoB9D,CAAC;;;;AAmDH,wBAAyD"}
|
|
@@ -44,9 +44,10 @@ export const StyledMetaListItem = styled.li(({ wrapItems }) => {
|
|
|
44
44
|
});
|
|
45
45
|
const MetaList = forwardRef(function MetaList({ testId, items, wrapItems = true, ...restProps }, ref) {
|
|
46
46
|
const testIds = useTestIds(testId, getMetaListTestIds);
|
|
47
|
-
|
|
47
|
+
const roleAttrValue = items.length <= 1 ? 'none' : undefined;
|
|
48
|
+
return (_jsx(Flex, { "data-testid": testIds.root, ...restProps, as: StyledMetaList, role: roleAttrValue, container: { colGap: 0.5, alignItems: 'center', wrap: wrapItems ? 'wrap' : 'nowrap' }, wrapItems: wrapItems, ref: ref, children: items.flatMap((item, i, arr) => item
|
|
48
49
|
? [
|
|
49
|
-
_jsx(Text, { as: StyledMetaListItem, variant: 'secondary', wrapItems: wrapItems, children: item }, `${i + 0}`)
|
|
50
|
+
_jsx(Text, { as: StyledMetaListItem, variant: 'secondary', role: roleAttrValue, wrapItems: wrapItems, children: item }, `${i + 0}`)
|
|
50
51
|
].concat(i !== arr.length - 1
|
|
51
52
|
? [
|
|
52
53
|
_jsx(Text, { as: StyledMetaListItem, "aria-hidden": true, variant: 'secondary', children: "\u2022" }, `${i + 0}-sep`)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MetaList.js","sourceRoot":"","sources":["../../../src/components/MetaList/MetaList.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAEnC,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,IAAI,MAAM,SAAS,CAAC;AAO3B,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAczD,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC,EAAE,CAAyB,CAAC,EAAE,SAAS,EAAE,EAAE,EAAE;IAChF,OAAO,GAAG,CAAA;;;;;;;;MAQN,CAAC,SAAS;QACZ,GAAG,CAAA;;KAEF;GACF,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,kBAAkB,GAAG,MAAM,CAAC,EAAE,CAAyB,CAAC,EAAE,SAAS,EAAE,EAAE,EAAE;IACpF,OAAO,GAAG,CAAA;;;;MAIN,SAAS;QACT,CAAC,CAAC,GAAG,CAAA;;SAEF;QACH,CAAC,CAAC,GAAG,CAAA;;;;SAIF;;;;;;GA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'react';\nimport styled, { css } from 'styled-components';\n\nimport Text from '../Text';\nimport Flex from '../Flex';\nimport type {\n BaseProps,\n ForwardRefForwardPropsComponent,\n NoChildrenProp,\n TestIdProp\n} from '../../types';\nimport { useTestIds } from '../../hooks';\nimport { withTestIds } from '../../utils';\n\nimport { getMetaListTestIds } from './MetaList.test-ids';\n\nexport interface MetaListProps extends BaseProps, NoChildrenProp, TestIdProp {\n /** Array of nodes or text to be rendered in the list. */\n items: ReactNode[];\n /**\n * If true, MetaList items that extend past the MetaList's container will wrap to a new line.\n * @default true\n */\n wrapItems?: boolean;\n /** Ref for the wrapping element. */\n ref?: Ref<HTMLUListElement>;\n}\n\nexport const StyledMetaList = styled.ul<{ wrapItems: boolean }>(({ wrapItems }) => {\n return css`\n list-style: none;\n overflow: hidden;\n\n /* Negative margin to account for overflow clipping of focus indicator */\n padding: 0.3rem;\n margin: -0.3rem;\n\n ${!wrapItems &&\n css`\n white-space: nowrap;\n `}\n `;\n});\n\nexport const StyledMetaListItem = styled.li<{ wrapItems: boolean }>(({ wrapItems }) => {\n return css`\n min-width: 0;\n display: inline-block;\n\n ${wrapItems\n ? css`\n overflow-wrap: break-word;\n `\n : css`\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n `}\n\n &[role='separator'] {\n -webkit-user-select: none;\n user-select: none;\n }\n `;\n});\n\nconst MetaList: ForwardRefForwardPropsComponent<MetaListProps> = forwardRef(function MetaList(\n { testId, items, wrapItems = true, ...restProps }: PropsWithoutRef<MetaListProps>,\n ref: MetaListProps['ref']\n) {\n const testIds = useTestIds(testId, getMetaListTestIds);\n const roleAttrValue = items.length <= 1 ? 'none' : undefined;\n\n return (\n <Flex\n data-testid={testIds.root}\n {...restProps}\n as={StyledMetaList}\n role={roleAttrValue}\n container={{ colGap: 0.5, alignItems: 'center', wrap: wrapItems ? 'wrap' : 'nowrap' }}\n wrapItems={wrapItems}\n ref={ref}\n >\n {items.flatMap((item, i, arr) =>\n item\n ? [\n <Text\n as={StyledMetaListItem}\n key={`${i + 0}`}\n variant='secondary'\n role={roleAttrValue}\n wrapItems={wrapItems}\n >\n {item}\n </Text>\n ].concat(\n i !== arr.length - 1\n ? [\n <Text\n as={StyledMetaListItem}\n aria-hidden\n key={`${i + 0}-sep`}\n variant='secondary'\n >\n •\n </Text>\n ]\n : []\n )\n : []\n )}\n </Flex>\n );\n});\n\nexport default withTestIds(MetaList, getMetaListTestIds);\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Modal.styles.d.ts","sourceRoot":"","sources":["../../../src/components/Modal/Modal.styles.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAInE,eAAO,MAAM,uBAAuB,yGAAe,CAAC;AAEpD,eAAO,MAAM,iBAAiB;gBAA+B,OAAO;SAqBnE,CAAC;AAIF,eAAO,MAAM,kBAAkB,yGAiB7B,CAAC;AAIH,eAAO,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"Modal.styles.d.ts","sourceRoot":"","sources":["../../../src/components/Modal/Modal.styles.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAInE,eAAO,MAAM,uBAAuB,yGAAe,CAAC;AAEpD,eAAO,MAAM,iBAAiB;gBAA+B,OAAO;SAqBnE,CAAC;AAIF,eAAO,MAAM,kBAAkB,yGAiB7B,CAAC;AAIH,eAAO,MAAM,WAAW,6jBA2HtB,CAAC"}
|
|
@@ -46,7 +46,7 @@ export const StyledModalContent = styled.div(({ theme: { base } }) => {
|
|
|
46
46
|
`;
|
|
47
47
|
});
|
|
48
48
|
StyledModalContent.defaultProps = defaultThemeProp;
|
|
49
|
-
export const StyledModal = styled(StyledCard)(({ theme: { base }, alert, autoWidth, center, stretch, state }) => {
|
|
49
|
+
export const StyledModal = styled(StyledCard)(({ theme: { base, components }, alert, autoWidth, center, stretch, state }) => {
|
|
50
50
|
let defaultMinWidth = '80ch';
|
|
51
51
|
let defaultMaxWidth = '80ch';
|
|
52
52
|
if (alert) {
|
|
@@ -161,6 +161,10 @@ export const StyledModal = styled(StyledCard)(({ theme: { base }, alert, autoWid
|
|
|
161
161
|
min-height: 8rem;
|
|
162
162
|
}
|
|
163
163
|
}
|
|
164
|
+
|
|
165
|
+
&&& {
|
|
166
|
+
background: ${components.modal.background};
|
|
167
|
+
}
|
|
164
168
|
`;
|
|
165
169
|
});
|
|
166
170
|
StyledModal.defaultProps = defaultThemeProp;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Modal.styles.js","sourceRoot":"","sources":["../../../src/components/Modal/Modal.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,gCAAgC,EAAE,MAAM,sBAAsB,CAAC;AACxE,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAMrD,MAAM,CAAC,MAAM,uBAAuB,GAAG,MAAM,CAAC,GAAG,CAAA,EAAE,CAAC;AAEpD,MAAM,CAAC,MAAM,iBAAiB,GAAG,MAAM,CAAC,MAAM,CAC5C,CAAC,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE;IACjC,MAAM,SAAS,GAAG,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;IAEvC,OAAO,GAAG,CAAA;sBACQ,CAAC,GAAG,SAAS,MAAM,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AE;gDACF,eAAe;gDACf,eAAe;;cAEjD,CAAC,MAAM;YACT,GAAG,CAAA;;aAEF;;;+BAGkB,IAAI,CAAC,WAAW,CAAC,EAAE;gDACF,eAAe;gDACf,eAAe;;cAEjD,CAAC,MAAM;YACT,GAAG,CAAA;;aAEF;;SAEJ;;MAEH,KAAK,KAAK,QAAQ;QACpB,GAAG,CAAA;;;;;;;;;;;KAWF;;;QAGG,kBAAkB;;;;;;;;oBAQN,UAAU,CAAC,KAAK,CAAC,UAAU;;GAE5C,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,WAAW,CAAC,YAAY,GAAG,gBAAgB,CAAC","sourcesContent":["import styled, { css } from 'styled-components';\n\nimport { StyledButton } from '../Button';\nimport type { PropsWithDefaults } from '../../types';\nimport { defaultThemeProp } from '../../theme';\nimport { StyledIcon } from '../Icon';\nimport { StyledCard } from '../Card';\nimport { StyledBackdrop } from '../Backdrop';\nimport { StyledResponsiveActionsContainer } from '../ResponsiveActions';\nimport { StyledProgressBackdrop } from '../Progress';\n\nimport type { ModalContextValue, ModalProps } from './Modal.types';\n\ntype ModalPropsWithDefaults = PropsWithDefaults<ModalProps, 'stretch' | 'center' | 'autoWidth'>;\n\nexport const StyledModalChildrenWrap = styled.div``;\n\nexport const StyledModalHeader = styled.header<{ hasAction?: boolean }>(\n ({ theme: { base }, hasAction }) => {\n const padAdjust = hasAction ? 0.75 : 0;\n\n return css`\n padding: calc(${3 - padAdjust} * ${base.spacing}) calc(${3 - padAdjust} * ${base.spacing})\n calc(${2.5 - padAdjust} * ${base.spacing}) calc(3 * ${base.spacing});\n\n h2 {\n margin-block-start: calc(0.5 * ${base.spacing});\n }\n\n h2 > ${StyledIcon} {\n margin-inline-end: ${base.spacing};\n }\n\n ${StyledButton} {\n color: ${base.palette['foreground-color']};\n }\n `;\n }\n);\n\nStyledModalHeader.defaultProps = defaultThemeProp;\n\nexport const StyledModalContent = styled.div(({ theme: { base } }) => {\n return css`\n position: relative;\n padding: calc(0.5 * ${base.spacing}) calc(3 * ${base.spacing});\n\n @media (height >= 31.25rem) {\n overflow-y: auto;\n }\n\n &:last-child {\n padding-bottom: calc(3 * ${base.spacing});\n }\n\n & > ${StyledBackdrop} {\n top: var(--scroll-top, 0);\n }\n `;\n});\n\nStyledModalContent.defaultProps = defaultThemeProp;\n\nexport const StyledModal = styled(StyledCard)<\n ModalPropsWithDefaults & Pick<ModalContextValue, 'alert' | 'state'>\n>(({ theme: { base, components }, alert, autoWidth, center, stretch, state }) => {\n let defaultMinWidth = '80ch';\n let defaultMaxWidth = '80ch';\n\n if (alert) {\n defaultMinWidth = '60ch';\n defaultMaxWidth = '60ch';\n } else if (autoWidth) {\n defaultMaxWidth = '100%';\n }\n\n return css`\n position: relative;\n box-shadow: ${base.shadow.high};\n\n @media (height < 31.25rem) {\n overflow-y: auto;\n }\n\n ${StyledResponsiveActionsContainer} {\n padding: calc(2.5 * ${base.spacing}) calc(3 * ${base.spacing}) calc(3 * ${base.spacing});\n }\n\n ${!alert && stretch\n ? css`\n height: calc(100% - 1rem);\n\n ${autoWidth\n ? css`\n max-width: min(calc(100% - 1rem), ${defaultMaxWidth});\n `\n : css`\n width: calc(100% - 1rem);\n `}\n\n @media (min-width: ${base.breakpoints.sm}) {\n height: calc(100% - 2rem);\n\n ${autoWidth\n ? css`\n max-width: min(calc(100% - 2rem), ${defaultMaxWidth});\n `\n : css`\n width: calc(100% - 2rem);\n `}\n }\n\n @media (min-width: ${base.breakpoints.md}) {\n height: calc(100% - 4rem);\n\n ${autoWidth\n ? css`\n max-width: min(calc(100% - 4rem), ${defaultMaxWidth});\n `\n : css`\n width: calc(100% - 4rem);\n `}\n }\n `\n : css`\n min-width: min(calc(100% - 1rem), ${defaultMinWidth});\n max-width: min(calc(100% - 1rem), ${defaultMaxWidth});\n max-height: calc(100% - 1rem);\n\n &:not(:has(footer)) ${StyledProgressBackdrop} {\n border-end-start-radius: ${base['border-radius']};\n border-end-end-radius: ${base['border-radius']};\n }\n\n ${!center &&\n css`\n margin-block-start: 0.5rem;\n `}\n\n @media (min-width: ${base.breakpoints.sm}) {\n min-width: min(calc(100% - 2rem), ${defaultMinWidth});\n max-width: min(calc(100% - 2rem), ${defaultMaxWidth});\n max-height: calc(100% - 2rem);\n ${!center &&\n css`\n margin-block-start: 1rem;\n `}\n }\n\n @media (min-width: ${base.breakpoints.md}) {\n min-width: min(calc(100% - 4rem), ${defaultMinWidth});\n max-width: min(calc(100% - 4rem), ${defaultMaxWidth});\n max-height: calc(100% - 4rem);\n ${!center &&\n css`\n margin-block-start: 2rem;\n `}\n }\n `}\n\n ${state === 'docked' &&\n css`\n /*\n * This seems like the most optimal of the suboptimal solutions.\n * https://styled-components.com/docs/faqs#how-can-i-override-styles-with-higher-specificity\n */\n &&& {\n /* Using non logical properties due to Safari 14.x support and since the inline bottom values are the same. */\n border-bottom-left-radius: 0;\n border-bottom-right-radius: 0;\n pointer-events: auto;\n }\n `}\n\n &[aria-busy='true'] {\n ${StyledModalContent} {\n /* TODO: Replace with useScrollToggle hook. */\n overflow: hidden;\n min-height: 8rem;\n }\n }\n\n &&& {\n background: ${components.modal.background};\n }\n `;\n});\n\nStyledModal.defaultProps = defaultThemeProp;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MultiStepForm.d.ts","sourceRoot":"","sources":["../../../src/components/MultiStepForm/MultiStepForm.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,aAAa,CAAC;AAWnE,OAAO,KAAK,kBAAkB,MAAM,uBAAuB,CAAC;AAI5D,eAAO,MAAM,UAAU;cAA2B,OAAO;cAAY,OAAO;
|
|
1
|
+
{"version":3,"file":"MultiStepForm.d.ts","sourceRoot":"","sources":["../../../src/components/MultiStepForm/MultiStepForm.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,aAAa,CAAC;AAWnE,OAAO,KAAK,kBAAkB,MAAM,uBAAuB,CAAC;AAI5D,eAAO,MAAM,UAAU;cAA2B,OAAO;cAAY,OAAO;SAuB3E,CAAC;AAIF,eAAO,MAAM,iBAAiB,yGAAe,CAAC;AAE9C,eAAO,MAAM,yBAAyB,gKAqBpC,CAAC;AAIH,QAAA,MAAM,aAAa,EAAE,+BAA+B,CAAC,kBAAkB,CA2LtE,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { forwardRef, useRef, useEffect } from 'react';
|
|
3
3
|
import styled, { css } from 'styled-components';
|
|
4
4
|
import { useAfterInitialEffect, useUID, useI18n, usePrevious, useBreakpoint, useTheme, useConsolidatedRef } from '../../hooks';
|
|
5
|
-
import {
|
|
5
|
+
import { focusNonInteractiveElement, isInstance } from '../../utils';
|
|
6
6
|
import { calculateFontSize } from '../../styles';
|
|
7
7
|
import Text from '../Text';
|
|
8
8
|
import HTML from '../HTML';
|
|
@@ -28,6 +28,11 @@ export const StyledForm = styled.form(({ actions, heading, theme }) => {
|
|
|
28
28
|
padding-block-start: calc(2 * ${theme.base.spacing});
|
|
29
29
|
`}
|
|
30
30
|
}
|
|
31
|
+
|
|
32
|
+
&:focus-visible {
|
|
33
|
+
outline: none;
|
|
34
|
+
box-shadow: ${theme.base.shadow.focus};
|
|
35
|
+
}
|
|
31
36
|
`;
|
|
32
37
|
});
|
|
33
38
|
StyledForm.defaultProps = defaultThemeProp;
|
|
@@ -50,6 +55,7 @@ export const StyledRequiredFieldLegend = styled(Text)(({ theme }) => {
|
|
|
50
55
|
StyledRequiredFieldLegend.defaultProps = defaultThemeProp;
|
|
51
56
|
const MultiStepForm = forwardRef(function MultiStepForm({ currentStepId, steps, heading, stepIndicator: stepIndicatorProp, progress, ...restProps }, ref) {
|
|
52
57
|
const multiStepRef = useConsolidatedRef(ref);
|
|
58
|
+
const headingRef = useRef(null);
|
|
53
59
|
const progressIndicatorRef = useRef(null);
|
|
54
60
|
const multiStepFormContentRef = useRef(null);
|
|
55
61
|
const multiStepActionsRef = useRef(null);
|
|
@@ -76,8 +82,28 @@ const MultiStepForm = forwardRef(function MultiStepForm({ currentStepId, steps,
|
|
|
76
82
|
];
|
|
77
83
|
focusables[0]?.focus();
|
|
78
84
|
}
|
|
85
|
+
else if (headingRef.current) {
|
|
86
|
+
focusNonInteractiveElement(headingRef.current);
|
|
87
|
+
}
|
|
79
88
|
else if (multiStepRef.current) {
|
|
80
|
-
|
|
89
|
+
const containerEl = multiStepRef.current.closest('[data-focusable-form-container]');
|
|
90
|
+
const headingEl = containerEl?.querySelector('[data-focusable-form-heading]');
|
|
91
|
+
if (isInstance(headingEl, HTMLElement)) {
|
|
92
|
+
focusNonInteractiveElement(headingEl);
|
|
93
|
+
}
|
|
94
|
+
else {
|
|
95
|
+
let label;
|
|
96
|
+
if (heading && currentStep.name) {
|
|
97
|
+
label = `${heading} - ${currentStep.name}`;
|
|
98
|
+
}
|
|
99
|
+
else if (currentStep.name) {
|
|
100
|
+
label = currentStep.name;
|
|
101
|
+
}
|
|
102
|
+
else if (heading) {
|
|
103
|
+
label = heading;
|
|
104
|
+
}
|
|
105
|
+
focusNonInteractiveElement(multiStepRef.current, label);
|
|
106
|
+
}
|
|
81
107
|
}
|
|
82
108
|
};
|
|
83
109
|
// Set focus if the current step id updates
|
|
@@ -123,7 +149,7 @@ const MultiStepForm = forwardRef(function MultiStepForm({ currentStepId, steps,
|
|
|
123
149
|
areaDef += '"description" ';
|
|
124
150
|
areaDef += '"content"';
|
|
125
151
|
}
|
|
126
|
-
return (_jsxs(StyledForm, { ref: multiStepRef, ...restProps, "aria-labelledby": heading ? headingId : undefined, "aria-describedby": currentStep.description ? descriptionId : undefined, heading: !!heading, actions: !!currentStep.actions, children: [heading && (_jsx(Text, { id: headingId, variant: 'h3', children: heading })), _jsxs(Grid, { container: {
|
|
152
|
+
return (_jsxs(StyledForm, { ref: multiStepRef, ...restProps, "aria-labelledby": heading ? headingId : undefined, "aria-describedby": currentStep.description ? descriptionId : undefined, heading: !!heading, actions: !!currentStep.actions, children: [heading && (_jsx(Text, { ref: headingRef, id: headingId, variant: 'h3', children: heading })), _jsxs(Grid, { container: {
|
|
127
153
|
cols: stepIndicator === 'vertical'
|
|
128
154
|
? `2fr minmax(${contentWidth.xs}, 1fr)`
|
|
129
155
|
: 'minmax(0, 1fr)',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MultiStepForm.js","sourceRoot":"","sources":["../../../src/components/MultiStepForm/MultiStepForm.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEtD,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EACL,qBAAqB,EACrB,MAAM,EACN,OAAO,EACP,WAAW,EACX,aAAa,EACb,QAAQ,EACR,kBAAkB,EACnB,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,kBAAkB,MAAM,uBAAuB,CAAC;AACvD,OAAO,IAAI,EAAE,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,QAAQ,MAAM,aAAa,CAAC;AACnC,OAAO,iBAAiB,MAAM,sBAAsB,CAAC;AAGrD,OAAO,oBAAoB,MAAM,wBAAwB,CAAC;AAC1D,OAAO,sBAAsB,MAAM,0BAA0B,CAAC;AAE9D,MAAM,CAAC,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CACnC,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,EAAE;I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AC,sBAAsB,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;oCAC/C,CAAC,CAAC,EAAE,GACa,IAChB,CACR,EAEA,WAAW,CAAC,OAAO,IAAI,KAAC,IAAI,IAAC,IAAI,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,YAAG,WAAW,CAAC,OAAO,GAAQ,EAEpF,WAAW,CAAC,WAAW,IAAI,CAC1B,KAAC,IAAI,IAAC,IAAI,EAAE,EAAE,IAAI,EAAE,aAAa,EAAE,YACjC,KAAC,IAAI,IAAC,EAAE,EAAE,aAAa,EAAE,EAAE,EAAC,GAAG,EAAC,OAAO,EAAE,WAAW,CAAC,WAAW,GAAI,GAC/D,CACR,EAED,KAAC,IAAI,IAAC,IAAI,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,EAAE,EAAE,iBAAiB,EAAE,GAAG,EAAE,uBAAuB,YACjF,WAAW,CAAC,OAAO,GACf,EAEP,KAAC,QAAQ,IACP,OAAO,EAAE,CAAC,CAAC,QAAQ,EACnB,cAAc,QACd,SAAS,EAAC,OAAO,EACjB,OAAO,EAAE,OAAO,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,GAC5D,IACG,EACN,WAAW,CAAC,OAAO,IAAI,CACtB,KAAC,iBAAiB,IAAC,UAAU,EAAE,mBAAmB,EAAE,SAAS,EAAE,WAAW,CAAC,OAAO,GAAI,CACvF,IACU,CACd,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,aAAa,CAAC","sourcesContent":["import { forwardRef, useRef, useEffect } from 'react';\nimport type { PropsWithoutRef } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport {\n useAfterInitialEffect,\n useUID,\n useI18n,\n usePrevious,\n useBreakpoint,\n useTheme,\n useConsolidatedRef\n} from '../../hooks';\nimport type { ForwardRefForwardPropsComponent } from '../../types';\nimport { focusHeadingOrContainer } from '../../utils';\nimport { calculateFontSize } from '../../styles';\nimport Text from '../Text';\nimport HTML from '../HTML';\nimport VisuallyHiddenText from '../VisuallyHiddenText';\nimport Grid, { StyledGrid } from '../Grid';\nimport { defaultThemeProp } from '../../theme';\nimport Progress from '../Progress';\nimport ResponsiveActions from '../ResponsiveActions';\n\nimport type MultiStepFormProps from './MultiStepForm.types';\nimport VerticalFormProgress from './VerticalFormProgress';\nimport HorizontalFormProgress from './HorizontalFormProgress';\n\nexport const StyledForm = styled.form<{ actions?: boolean; heading?: boolean }>(\n ({ actions, heading, theme }) => {\n return css`\n & > ${StyledGrid} {\n position: relative;\n\n ${actions &&\n css`\n padding-block-end: calc(2 * ${theme.base.spacing});\n `}\n\n ${heading &&\n css`\n padding-block-start: calc(2 * ${theme.base.spacing});\n `}\n }\n `;\n }\n);\n\nStyledForm.defaultProps = defaultThemeProp;\n\nexport const StyledFormContent = styled.div``;\n\nexport const StyledRequiredFieldLegend = styled(Text)(({ theme }) => {\n const {\n base: {\n 'font-size': fontSize,\n 'font-scale': fontScale,\n palette: { urgent }\n }\n } = theme;\n const { xxs: infoFontSize } = calculateFontSize(fontSize, fontScale);\n\n return css`\n font-size: ${infoFontSize};\n font-style: italic;\n\n &::before {\n display: 'inline';\n content: '\\\\00a0*';\n vertical-align: top;\n color: ${urgent};\n }\n `;\n});\n\nStyledRequiredFieldLegend.defaultProps = defaultThemeProp;\n\nconst MultiStepForm: ForwardRefForwardPropsComponent<MultiStepFormProps> = forwardRef(\n function MultiStepForm(\n {\n currentStepId,\n steps,\n heading,\n stepIndicator: stepIndicatorProp,\n progress,\n ...restProps\n }: PropsWithoutRef<MultiStepFormProps>,\n ref: MultiStepFormProps['ref']\n ) {\n const multiStepRef = useConsolidatedRef<HTMLFormElement>(ref);\n const progressIndicatorRef = useRef<HTMLDivElement>(null);\n const multiStepFormContentRef = useRef<HTMLDivElement>(null);\n const multiStepActionsRef = useRef<HTMLDivElement>(null);\n\n const previousId = usePrevious(currentStepId);\n const currentStep = steps.find(step => step.id === currentStepId)!;\n const headingId = useUID();\n const descriptionId = useUID();\n const t = useI18n();\n const {\n base: { 'content-width': contentWidth }\n } = useTheme();\n\n const isSmallOrAbove = useBreakpoint('sm');\n\n const stepIndicator = (() => {\n if (stepIndicatorProp === 'none' || steps.length < 2) return 'none';\n\n if (!isSmallOrAbove) return 'horizontal';\n\n return stepIndicatorProp ?? 'horizontal';\n })();\n\n const setFocus = () => {\n if (progress) return;\n\n if (stepIndicator !== 'none' && progressIndicatorRef.current) {\n const focusables = [\n ...progressIndicatorRef.current.querySelectorAll(`[id=\"${currentStepId}\"]`)\n ] as HTMLElement[];\n focusables[0]?.focus();\n } else if (multiStepRef.current) {\n focusHeadingOrContainer(multiStepRef.current, currentStep.name);\n }\n };\n\n // Set focus if the current step id updates\n useEffect(() => {\n if (previousId !== currentStepId) {\n setFocus();\n }\n }, [currentStepId, previousId]);\n\n // Set focus if the form content updates while focus is within the actions region of the form\n useAfterInitialEffect(() => {\n if (\n multiStepActionsRef.current &&\n multiStepActionsRef.current.contains(document.activeElement)\n ) {\n setFocus();\n }\n }, [currentStep.content]);\n\n // Set focus if a progress state resolves\n useAfterInitialEffect(() => {\n if (!progress) {\n setFocus();\n }\n }, [progress]);\n\n let areaDef = '';\n switch (stepIndicator) {\n case 'horizontal':\n areaDef += '\"stepIndicator\" ';\n if (currentStep.banners) areaDef += '\"banners\" ';\n if (currentStep.description) areaDef += '\"description\" ';\n areaDef += '\"content\"';\n break;\n case 'vertical':\n if (currentStep.banners) areaDef += '\"banners stepIndicator\" ';\n if (currentStep.description) areaDef += '\"description stepIndicator\" ';\n areaDef += '\"content stepIndicator\"';\n break;\n default:\n if (currentStep.banners) areaDef += '\"banners\" ';\n if (currentStep.description) areaDef += '\"description\" ';\n areaDef += '\"content\"';\n }\n\n return (\n <StyledForm\n ref={multiStepRef}\n {...restProps}\n aria-labelledby={heading ? headingId : undefined}\n aria-describedby={currentStep.description ? descriptionId : undefined}\n heading={!!heading}\n actions={!!currentStep.actions}\n >\n {heading && (\n <Text id={headingId} variant='h3'>\n {heading}\n </Text>\n )}\n\n <Grid\n container={{\n cols:\n stepIndicator === 'vertical'\n ? `2fr minmax(${contentWidth.xs}, 1fr)`\n : 'minmax(0, 1fr)',\n areas: areaDef,\n gap: 2\n }}\n inert={progress ? '' : undefined}\n >\n {steps.length > 1 && (\n <Grid ref={progressIndicatorRef} item={{ area: 'stepIndicator' }}>\n {stepIndicator === 'horizontal' && (\n <Grid\n item={{ area: 'stepIndicator' }}\n as={HorizontalFormProgress}\n steps={steps}\n currentStepId={currentStepId}\n />\n )}\n {stepIndicator === 'vertical' && (\n <Grid\n item={{ area: 'stepIndicator' }}\n as={VerticalFormProgress}\n steps={steps}\n currentStepId={currentStepId}\n />\n )}\n <VisuallyHiddenText aria-live='polite'>\n {previousId !== undefined && previousId !== currentStepId\n ? t('step_changed_to_name', [currentStep.name])\n : ''}\n </VisuallyHiddenText>\n </Grid>\n )}\n\n {currentStep.banners && <Grid item={{ area: 'banners' }}>{currentStep.banners}</Grid>}\n\n {currentStep.description && (\n <Grid item={{ area: 'description' }}>\n <HTML id={descriptionId} as='p' content={currentStep.description} />\n </Grid>\n )}\n\n <Grid item={{ area: 'content' }} as={StyledFormContent} ref={multiStepFormContentRef}>\n {currentStep.content}\n </Grid>\n\n <Progress\n visible={!!progress}\n focusOnVisible\n placement='local'\n message={typeof progress === 'string' ? progress : undefined}\n />\n </Grid>\n {currentStep.actions && (\n <ResponsiveActions actionsRef={multiStepActionsRef} actionsEl={currentStep.actions} />\n )}\n </StyledForm>\n );\n }\n);\n\nexport default MultiStepForm;\n"]}
|
|
1
|
+
{"version":3,"file":"MultiStepForm.js","sourceRoot":"","sources":["../../../src/components/MultiStepForm/MultiStepForm.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEtD,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EACL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,CAAC,OAAO,GAAI,CACvF,IACU,CACd,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,aAAa,CAAC","sourcesContent":["import { forwardRef, useRef, useEffect } from 'react';\nimport type { PropsWithoutRef } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport {\n useAfterInitialEffect,\n useUID,\n useI18n,\n usePrevious,\n useBreakpoint,\n useTheme,\n useConsolidatedRef\n} from '../../hooks';\nimport type { ForwardRefForwardPropsComponent } from '../../types';\nimport { focusNonInteractiveElement, isInstance } from '../../utils';\nimport { calculateFontSize } from '../../styles';\nimport Text from '../Text';\nimport HTML from '../HTML';\nimport VisuallyHiddenText from '../VisuallyHiddenText';\nimport Grid, { StyledGrid } from '../Grid';\nimport { defaultThemeProp } from '../../theme';\nimport Progress from '../Progress';\nimport ResponsiveActions from '../ResponsiveActions';\n\nimport type MultiStepFormProps from './MultiStepForm.types';\nimport VerticalFormProgress from './VerticalFormProgress';\nimport HorizontalFormProgress from './HorizontalFormProgress';\n\nexport const StyledForm = styled.form<{ actions?: boolean; heading?: boolean }>(\n ({ actions, heading, theme }) => {\n return css`\n & > ${StyledGrid} {\n position: relative;\n\n ${actions &&\n css`\n padding-block-end: calc(2 * ${theme.base.spacing});\n `}\n\n ${heading &&\n css`\n padding-block-start: calc(2 * ${theme.base.spacing});\n `}\n }\n\n &:focus-visible {\n outline: none;\n box-shadow: ${theme.base.shadow.focus};\n }\n `;\n }\n);\n\nStyledForm.defaultProps = defaultThemeProp;\n\nexport const StyledFormContent = styled.div``;\n\nexport const StyledRequiredFieldLegend = styled(Text)(({ theme }) => {\n const {\n base: {\n 'font-size': fontSize,\n 'font-scale': fontScale,\n palette: { urgent }\n }\n } = theme;\n const { xxs: infoFontSize } = calculateFontSize(fontSize, fontScale);\n\n return css`\n font-size: ${infoFontSize};\n font-style: italic;\n\n &::before {\n display: 'inline';\n content: '\\\\00a0*';\n vertical-align: top;\n color: ${urgent};\n }\n `;\n});\n\nStyledRequiredFieldLegend.defaultProps = defaultThemeProp;\n\nconst MultiStepForm: ForwardRefForwardPropsComponent<MultiStepFormProps> = forwardRef(\n function MultiStepForm(\n {\n currentStepId,\n steps,\n heading,\n stepIndicator: stepIndicatorProp,\n progress,\n ...restProps\n }: PropsWithoutRef<MultiStepFormProps>,\n ref: MultiStepFormProps['ref']\n ) {\n const multiStepRef = useConsolidatedRef<HTMLFormElement>(ref);\n const headingRef = useRef<HTMLHeadingElement>(null);\n const progressIndicatorRef = useRef<HTMLDivElement>(null);\n const multiStepFormContentRef = useRef<HTMLDivElement>(null);\n const multiStepActionsRef = useRef<HTMLDivElement>(null);\n\n const previousId = usePrevious(currentStepId);\n const currentStep = steps.find(step => step.id === currentStepId)!;\n const headingId = useUID();\n const descriptionId = useUID();\n const t = useI18n();\n const {\n base: { 'content-width': contentWidth }\n } = useTheme();\n\n const isSmallOrAbove = useBreakpoint('sm');\n\n const stepIndicator = (() => {\n if (stepIndicatorProp === 'none' || steps.length < 2) return 'none';\n\n if (!isSmallOrAbove) return 'horizontal';\n\n return stepIndicatorProp ?? 'horizontal';\n })();\n\n const setFocus = () => {\n if (progress) return;\n\n if (stepIndicator !== 'none' && progressIndicatorRef.current) {\n const focusables = [\n ...progressIndicatorRef.current.querySelectorAll(`[id=\"${currentStepId}\"]`)\n ] as HTMLElement[];\n focusables[0]?.focus();\n } else if (headingRef.current) {\n focusNonInteractiveElement(headingRef.current);\n } else if (multiStepRef.current) {\n const containerEl = multiStepRef.current.closest('[data-focusable-form-container]');\n const headingEl = containerEl?.querySelector('[data-focusable-form-heading]');\n if (isInstance(headingEl, HTMLElement)) {\n focusNonInteractiveElement(headingEl);\n } else {\n let label: string | undefined;\n if (heading && currentStep.name) {\n label = `${heading} - ${currentStep.name}`;\n } else if (currentStep.name) {\n label = currentStep.name;\n } else if (heading) {\n label = heading;\n }\n\n focusNonInteractiveElement(multiStepRef.current, label);\n }\n }\n };\n\n // Set focus if the current step id updates\n useEffect(() => {\n if (previousId !== currentStepId) {\n setFocus();\n }\n }, [currentStepId, previousId]);\n\n // Set focus if the form content updates while focus is within the actions region of the form\n useAfterInitialEffect(() => {\n if (\n multiStepActionsRef.current &&\n multiStepActionsRef.current.contains(document.activeElement)\n ) {\n setFocus();\n }\n }, [currentStep.content]);\n\n // Set focus if a progress state resolves\n useAfterInitialEffect(() => {\n if (!progress) {\n setFocus();\n }\n }, [progress]);\n\n let areaDef = '';\n switch (stepIndicator) {\n case 'horizontal':\n areaDef += '\"stepIndicator\" ';\n if (currentStep.banners) areaDef += '\"banners\" ';\n if (currentStep.description) areaDef += '\"description\" ';\n areaDef += '\"content\"';\n break;\n case 'vertical':\n if (currentStep.banners) areaDef += '\"banners stepIndicator\" ';\n if (currentStep.description) areaDef += '\"description stepIndicator\" ';\n areaDef += '\"content stepIndicator\"';\n break;\n default:\n if (currentStep.banners) areaDef += '\"banners\" ';\n if (currentStep.description) areaDef += '\"description\" ';\n areaDef += '\"content\"';\n }\n\n return (\n <StyledForm\n ref={multiStepRef}\n {...restProps}\n aria-labelledby={heading ? headingId : undefined}\n aria-describedby={currentStep.description ? descriptionId : undefined}\n heading={!!heading}\n actions={!!currentStep.actions}\n >\n {heading && (\n <Text ref={headingRef} id={headingId} variant='h3'>\n {heading}\n </Text>\n )}\n\n <Grid\n container={{\n cols:\n stepIndicator === 'vertical'\n ? `2fr minmax(${contentWidth.xs}, 1fr)`\n : 'minmax(0, 1fr)',\n areas: areaDef,\n gap: 2\n }}\n inert={progress ? '' : undefined}\n >\n {steps.length > 1 && (\n <Grid ref={progressIndicatorRef} item={{ area: 'stepIndicator' }}>\n {stepIndicator === 'horizontal' && (\n <Grid\n item={{ area: 'stepIndicator' }}\n as={HorizontalFormProgress}\n steps={steps}\n currentStepId={currentStepId}\n />\n )}\n {stepIndicator === 'vertical' && (\n <Grid\n item={{ area: 'stepIndicator' }}\n as={VerticalFormProgress}\n steps={steps}\n currentStepId={currentStepId}\n />\n )}\n <VisuallyHiddenText aria-live='polite'>\n {previousId !== undefined && previousId !== currentStepId\n ? t('step_changed_to_name', [currentStep.name])\n : ''}\n </VisuallyHiddenText>\n </Grid>\n )}\n\n {currentStep.banners && <Grid item={{ area: 'banners' }}>{currentStep.banners}</Grid>}\n\n {currentStep.description && (\n <Grid item={{ area: 'description' }}>\n <HTML id={descriptionId} as='p' content={currentStep.description} />\n </Grid>\n )}\n\n <Grid item={{ area: 'content' }} as={StyledFormContent} ref={multiStepFormContentRef}>\n {currentStep.content}\n </Grid>\n\n <Progress\n visible={!!progress}\n focusOnVisible\n placement='local'\n message={typeof progress === 'string' ? progress : undefined}\n />\n </Grid>\n {currentStep.actions && (\n <ResponsiveActions actionsRef={multiStepActionsRef} actionsEl={currentStep.actions} />\n )}\n </StyledForm>\n );\n }\n);\n\nexport default MultiStepForm;\n"]}
|
|
@@ -35,7 +35,7 @@ export default withTestIds(forwardRef(function NumberInput(props, ref) {
|
|
|
35
35
|
}, [locale, unit, showGroupSeparators, maximumFractionDigits]);
|
|
36
36
|
const onInputChange = (e) => {
|
|
37
37
|
const inputValue = e.target.value;
|
|
38
|
-
const cleanedInputValue = getCleanedValue(inputValue,
|
|
38
|
+
const cleanedInputValue = getCleanedValue(inputValue, decimalSign, maximumFractionDigits);
|
|
39
39
|
if (cleanedInputValue === value)
|
|
40
40
|
return;
|
|
41
41
|
onChange(cleanedInputValue);
|
|
@@ -63,7 +63,7 @@ export default withTestIds(forwardRef(function NumberInput(props, ref) {
|
|
|
63
63
|
}
|
|
64
64
|
else if (input.selectionStart !== null &&
|
|
65
65
|
!input.value.charAt(input.selectionStart - 1).match(/\d/)) {
|
|
66
|
-
onChange(getCleanedValue(`${input.value}0${decimalSign}`,
|
|
66
|
+
onChange(getCleanedValue(`${input.value}0${decimalSign}`, decimalSign, maximumFractionDigits));
|
|
67
67
|
e.preventDefault();
|
|
68
68
|
}
|
|
69
69
|
break;
|