@telus-uds/components-base 2.5.0 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +41 -2
- package/lib/cjs/A11yInfoProvider/index.js +73 -0
- package/lib/cjs/A11yText/index.js +75 -0
- package/lib/cjs/ActionCard/ActionCard.js +349 -0
- package/lib/cjs/ActionCard/index.js +9 -0
- package/lib/cjs/ActivityIndicator/Spinner.js +85 -0
- package/lib/cjs/ActivityIndicator/Spinner.native.js +151 -0
- package/lib/cjs/ActivityIndicator/index.js +51 -0
- package/lib/cjs/ActivityIndicator/shared.js +20 -0
- package/lib/cjs/Autocomplete/Autocomplete.js +480 -0
- package/lib/cjs/Autocomplete/Loading.js +42 -0
- package/lib/cjs/Autocomplete/Suggestions.js +71 -0
- package/lib/cjs/Autocomplete/constants.js +10 -0
- package/lib/cjs/Autocomplete/dictionary.js +18 -0
- package/lib/cjs/Autocomplete/index.js +9 -0
- package/lib/cjs/Badge/Badge.js +109 -0
- package/lib/cjs/Badge/index.js +9 -0
- package/lib/cjs/BaseProvider/HydrationContext.js +56 -0
- package/lib/cjs/BaseProvider/index.js +46 -0
- package/lib/cjs/Box/Box.js +385 -0
- package/lib/cjs/Box/backgroundImageStylesMap.js +100 -0
- package/lib/cjs/Box/index.js +9 -0
- package/lib/cjs/Button/Button.js +43 -0
- package/lib/cjs/Button/ButtonBase.js +353 -0
- package/lib/cjs/Button/ButtonDropdown.js +182 -0
- package/lib/cjs/Button/ButtonGroup.js +279 -0
- package/lib/cjs/Button/ButtonLink.js +57 -0
- package/lib/cjs/Button/index.js +34 -0
- package/lib/cjs/Button/propTypes.js +53 -0
- package/lib/cjs/Card/Card.js +334 -0
- package/lib/cjs/Card/CardBase.js +127 -0
- package/lib/cjs/Card/PressableCardBase.js +121 -0
- package/lib/cjs/Card/index.js +32 -0
- package/lib/cjs/CardGroup/CardGroup.js +219 -0
- package/lib/cjs/CardGroup/dictionary.js +14 -0
- package/lib/cjs/CardGroup/index.js +9 -0
- package/lib/cjs/Carousel/Carousel.js +1045 -0
- package/lib/cjs/Carousel/CarouselContext.js +59 -0
- package/lib/cjs/Carousel/CarouselFirstFocus/CarouselFirstFocus.js +57 -0
- package/lib/cjs/Carousel/CarouselItem/CarouselItem.js +185 -0
- package/lib/cjs/Carousel/CarouselItem/index.js +9 -0
- package/lib/cjs/Carousel/CarouselStepTracker/CarouselStepTracker.js +101 -0
- package/lib/cjs/Carousel/CarouselStepTracker/index.js +9 -0
- package/lib/cjs/Carousel/CarouselTabs/CarouselTabs.js +54 -0
- package/lib/cjs/Carousel/CarouselTabs/CarouselTabsPanel.js +95 -0
- package/lib/cjs/Carousel/CarouselTabs/CarouselTabsPanelItem.js +125 -0
- package/lib/cjs/Carousel/CarouselTabs/index.js +9 -0
- package/lib/cjs/Carousel/CarouselThumbnail.js +120 -0
- package/lib/cjs/Carousel/CarouselThumbnailNavigation.js +78 -0
- package/lib/cjs/Carousel/Constants.js +13 -0
- package/lib/cjs/Carousel/dictionary.js +28 -0
- package/lib/cjs/Carousel/index.js +36 -0
- package/lib/cjs/Checkbox/Checkbox.js +349 -0
- package/lib/cjs/Checkbox/CheckboxButton.js +171 -0
- package/lib/cjs/Checkbox/CheckboxGroup.js +249 -0
- package/lib/cjs/Checkbox/CheckboxInput.js +55 -0
- package/lib/cjs/Checkbox/CheckboxInput.native.js +11 -0
- package/lib/cjs/Checkbox/index.js +16 -0
- package/lib/cjs/CheckboxCard/CheckboxCard.js +191 -0
- package/lib/cjs/CheckboxCard/index.js +9 -0
- package/lib/cjs/CheckboxCardGroup/CheckboxCardGroup.js +215 -0
- package/lib/cjs/CheckboxCardGroup/index.js +9 -0
- package/lib/cjs/ColourToggle/ColourBubble.js +133 -0
- package/lib/cjs/ColourToggle/ColourToggle.js +98 -0
- package/lib/cjs/ColourToggle/index.js +9 -0
- package/lib/cjs/Divider/Divider.js +138 -0
- package/lib/cjs/Divider/index.js +9 -0
- package/lib/cjs/DownloadApp/DownloadApp.js +167 -0
- package/lib/cjs/DownloadApp/dictionary.js +16 -0
- package/lib/cjs/DownloadApp/index.js +9 -0
- package/lib/cjs/ExpandCollapse/Accordion.js +20 -0
- package/lib/cjs/ExpandCollapse/Control.js +170 -0
- package/lib/cjs/ExpandCollapse/ExpandCollapse.js +105 -0
- package/lib/cjs/ExpandCollapse/Panel.js +270 -0
- package/lib/cjs/ExpandCollapse/dictionary.js +16 -0
- package/lib/cjs/ExpandCollapse/index.js +19 -0
- package/lib/cjs/ExpandCollapseMini/ExpandCollapseMini.js +84 -0
- package/lib/cjs/ExpandCollapseMini/ExpandCollapseMiniControl.js +133 -0
- package/lib/cjs/ExpandCollapseMini/index.js +9 -0
- package/lib/cjs/Feedback/Feedback.js +167 -0
- package/lib/cjs/Feedback/index.js +9 -0
- package/lib/cjs/Fieldset/Fieldset.js +198 -0
- package/lib/cjs/Fieldset/FieldsetContainer.js +55 -0
- package/lib/cjs/Fieldset/FieldsetContainer.native.js +39 -0
- package/lib/cjs/Fieldset/Legend.js +29 -0
- package/lib/cjs/Fieldset/Legend.native.js +36 -0
- package/lib/cjs/Fieldset/cssReset.js +20 -0
- package/lib/cjs/Fieldset/index.js +9 -0
- package/lib/cjs/FileUpload/FileUpload.js +370 -0
- package/lib/cjs/FileUpload/NotificationContent.js +59 -0
- package/lib/cjs/FileUpload/dictionary.js +50 -0
- package/lib/cjs/FileUpload/index.js +9 -0
- package/lib/cjs/FlexGrid/Col/Col.js +264 -0
- package/lib/cjs/FlexGrid/Col/index.js +9 -0
- package/lib/cjs/FlexGrid/FlexGrid.js +165 -0
- package/lib/cjs/FlexGrid/Row/Row.js +188 -0
- package/lib/cjs/FlexGrid/Row/index.js +9 -0
- package/lib/cjs/FlexGrid/helpers/index.js +21 -0
- package/lib/cjs/FlexGrid/index.js +9 -0
- package/lib/cjs/FlexGrid/providers/GutterContext.js +10 -0
- package/lib/cjs/Footnote/Footnote.js +323 -0
- package/lib/cjs/Footnote/FootnoteLink.js +114 -0
- package/lib/cjs/Footnote/dictionary.js +18 -0
- package/lib/cjs/Footnote/index.js +11 -0
- package/lib/cjs/HorizontalScroll/HorizontalScroll.js +175 -0
- package/lib/cjs/HorizontalScroll/HorizontalScrollButton.js +86 -0
- package/lib/cjs/HorizontalScroll/ScrollViewEnd.js +53 -0
- package/lib/cjs/HorizontalScroll/ScrollViewEnd.native.js +32 -0
- package/lib/cjs/HorizontalScroll/dictionary.js +17 -0
- package/lib/cjs/HorizontalScroll/index.js +26 -0
- package/lib/cjs/HorizontalScroll/itemPositions.js +122 -0
- package/lib/cjs/Icon/Icon.js +105 -0
- package/lib/cjs/Icon/IconText.js +117 -0
- package/lib/cjs/Icon/index.js +24 -0
- package/lib/cjs/IconButton/IconButton.js +208 -0
- package/lib/cjs/IconButton/index.js +9 -0
- package/lib/cjs/InputLabel/InputLabel.js +184 -0
- package/lib/cjs/InputLabel/LabelContent.js +35 -0
- package/lib/cjs/InputLabel/LabelContent.native.js +26 -0
- package/lib/cjs/InputLabel/index.js +9 -0
- package/lib/cjs/InputSupports/InputSupports.js +140 -0
- package/lib/cjs/InputSupports/dictionary.js +18 -0
- package/lib/cjs/InputSupports/index.js +9 -0
- package/lib/cjs/InputSupports/useInputSupports.js +47 -0
- package/lib/cjs/Link/ChevronLink.js +73 -0
- package/lib/cjs/Link/InlinePressable.js +53 -0
- package/lib/cjs/Link/InlinePressable.native.js +93 -0
- package/lib/cjs/Link/Link.js +35 -0
- package/lib/cjs/Link/LinkBase.js +283 -0
- package/lib/cjs/Link/TextButton.js +48 -0
- package/lib/cjs/Link/index.js +34 -0
- package/lib/cjs/List/List.js +83 -0
- package/lib/cjs/List/ListItem.js +37 -0
- package/lib/cjs/List/ListItemBase.js +171 -0
- package/lib/cjs/List/ListItemContent.js +80 -0
- package/lib/cjs/List/ListItemMark.js +132 -0
- package/lib/cjs/List/PressableListItemBase.js +117 -0
- package/lib/cjs/List/index.js +23 -0
- package/lib/cjs/Listbox/GroupControl.js +112 -0
- package/lib/cjs/Listbox/Listbox.js +177 -0
- package/lib/cjs/Listbox/ListboxContext.js +11 -0
- package/lib/cjs/Listbox/ListboxGroup.js +133 -0
- package/lib/cjs/Listbox/ListboxItem.js +83 -0
- package/lib/cjs/Listbox/ListboxOverlay.js +87 -0
- package/lib/cjs/Listbox/PressableItem.js +146 -0
- package/lib/cjs/Listbox/index.js +9 -0
- package/lib/cjs/Modal/Modal.js +375 -0
- package/lib/cjs/Modal/ModalContent.js +205 -0
- package/lib/cjs/Modal/WebModal.js +83 -0
- package/lib/cjs/Modal/dictionary.js +15 -0
- package/lib/cjs/Modal/index.js +9 -0
- package/lib/cjs/MultiSelectFilter/ModalOverlay.js +162 -0
- package/lib/cjs/MultiSelectFilter/MultiSelectFilter.js +546 -0
- package/lib/cjs/MultiSelectFilter/dictionary.js +18 -0
- package/lib/cjs/MultiSelectFilter/index.js +9 -0
- package/lib/cjs/Notification/Notification.js +436 -0
- package/lib/cjs/Notification/dictionary.js +14 -0
- package/lib/cjs/Notification/index.js +9 -0
- package/lib/cjs/OrderedList/Item.js +166 -0
- package/lib/cjs/OrderedList/ItemBase.js +51 -0
- package/lib/cjs/OrderedList/OrderedList.js +70 -0
- package/lib/cjs/OrderedList/OrderedListBase.js +44 -0
- package/lib/cjs/OrderedList/index.js +9 -0
- package/lib/cjs/Pagination/PageButton.js +82 -0
- package/lib/cjs/Pagination/Pagination.js +226 -0
- package/lib/cjs/Pagination/SideButton.js +119 -0
- package/lib/cjs/Pagination/constants.js +9 -0
- package/lib/cjs/Pagination/dictionary.js +24 -0
- package/lib/cjs/Pagination/index.js +9 -0
- package/lib/cjs/Pagination/usePagination.js +83 -0
- package/lib/cjs/Portal/Portal.js +56 -0
- package/lib/cjs/Portal/Portal.native.js +8 -0
- package/lib/cjs/Portal/index.js +9 -0
- package/lib/cjs/PriceLockup/PriceLockup.js +230 -0
- package/lib/cjs/PriceLockup/index.js +9 -0
- package/lib/cjs/PriceLockup/utils/renderFootnoteContent.js +92 -0
- package/lib/cjs/PriceLockup/utils/renderFootnoteLinks.js +35 -0
- package/lib/cjs/PriceLockup/utils/renderPrice.js +146 -0
- package/lib/cjs/PriceLockup/utils/renderTypography.js +30 -0
- package/lib/cjs/ProductCard/ProductCard.js +237 -0
- package/lib/cjs/ProductCard/dictionary.js +44 -0
- package/lib/cjs/ProductCard/index.js +9 -0
- package/lib/cjs/ProductCardGroup/ProductCardGroup.js +77 -0
- package/lib/cjs/ProductCardGroup/index.js +9 -0
- package/lib/cjs/Progress/Progress.js +101 -0
- package/lib/cjs/Progress/ProgressBar.js +168 -0
- package/lib/cjs/Progress/ProgressBarBackground.js +49 -0
- package/lib/cjs/Progress/constants.js +10 -0
- package/lib/cjs/Progress/index.js +11 -0
- package/lib/cjs/QuickLinks/QuickLinks.js +83 -0
- package/lib/cjs/QuickLinks/QuickLinksCard.js +38 -0
- package/lib/cjs/QuickLinks/QuickLinksItem.js +56 -0
- package/lib/cjs/QuickLinks/index.js +11 -0
- package/lib/cjs/QuickLinksFeature/QuickLinksFeature.js +74 -0
- package/lib/cjs/QuickLinksFeature/QuickLinksFeatureItem.js +152 -0
- package/lib/cjs/QuickLinksFeature/index.js +11 -0
- package/lib/cjs/Radio/Radio.js +291 -0
- package/lib/cjs/Radio/RadioButton.js +191 -0
- package/lib/cjs/Radio/RadioGroup.js +262 -0
- package/lib/cjs/Radio/RadioInput.js +55 -0
- package/lib/cjs/Radio/RadioInput.native.js +11 -0
- package/lib/cjs/Radio/index.js +16 -0
- package/lib/cjs/RadioCard/RadioCard.js +219 -0
- package/lib/cjs/RadioCard/RadioCardGroup.js +266 -0
- package/lib/cjs/RadioCard/index.js +16 -0
- package/lib/cjs/Responsive/Responsive.js +70 -0
- package/lib/cjs/Responsive/ResponsiveProp.js +45 -0
- package/lib/cjs/Responsive/ResponsiveWithMediaQueryStyleSheet.js +75 -0
- package/lib/cjs/Responsive/index.js +9 -0
- package/lib/cjs/Search/Search.js +281 -0
- package/lib/cjs/Search/dictionary.js +18 -0
- package/lib/cjs/Search/index.js +9 -0
- package/lib/cjs/Select/Group.js +31 -0
- package/lib/cjs/Select/Group.native.js +23 -0
- package/lib/cjs/Select/Item.js +30 -0
- package/lib/cjs/Select/Item.native.js +8 -0
- package/lib/cjs/Select/Picker.js +103 -0
- package/lib/cjs/Select/Picker.native.js +130 -0
- package/lib/cjs/Select/Select.js +339 -0
- package/lib/cjs/Select/constants.js +13 -0
- package/lib/cjs/Select/index.js +13 -0
- package/lib/cjs/SideNav/Item.js +150 -0
- package/lib/cjs/SideNav/ItemContent.js +56 -0
- package/lib/cjs/SideNav/ItemsGroup.js +125 -0
- package/lib/cjs/SideNav/SideNav.js +139 -0
- package/lib/cjs/SideNav/index.js +13 -0
- package/lib/cjs/Skeleton/Skeleton.js +184 -0
- package/lib/cjs/Skeleton/index.js +9 -0
- package/lib/cjs/Skeleton/skeleton.constant.js +8 -0
- package/lib/cjs/Skeleton/skeletonWebAnimation.js +20 -0
- package/lib/cjs/Skeleton/useSkeletonNativeAnimation.js +35 -0
- package/lib/cjs/SkipLink/SkipLink.js +196 -0
- package/lib/cjs/SkipLink/index.js +9 -0
- package/lib/cjs/Spacer/Spacer.js +100 -0
- package/lib/cjs/Spacer/index.js +9 -0
- package/lib/cjs/StackView/StackView.js +133 -0
- package/lib/cjs/StackView/StackWrap.js +54 -0
- package/lib/cjs/StackView/StackWrap.native.js +10 -0
- package/lib/cjs/StackView/StackWrapBox.js +121 -0
- package/lib/cjs/StackView/StackWrapGap.js +68 -0
- package/lib/cjs/StackView/common.js +43 -0
- package/lib/cjs/StackView/getStackedContent.js +128 -0
- package/lib/cjs/StackView/index.js +23 -0
- package/lib/cjs/Status/Status.js +176 -0
- package/lib/cjs/Status/index.js +9 -0
- package/lib/cjs/StepTracker/Step.js +271 -0
- package/lib/cjs/StepTracker/StepTracker.js +220 -0
- package/lib/cjs/StepTracker/dictionary.js +36 -0
- package/lib/cjs/StepTracker/index.js +9 -0
- package/lib/cjs/TabBar/TabBar.js +132 -0
- package/lib/cjs/TabBar/TabBarItem.js +182 -0
- package/lib/cjs/TabBar/index.js +9 -0
- package/lib/cjs/Tabs/Tabs.js +188 -0
- package/lib/cjs/Tabs/TabsItem.js +249 -0
- package/lib/cjs/Tabs/index.js +9 -0
- package/lib/cjs/Tags/Tags.js +252 -0
- package/lib/cjs/Tags/index.js +9 -0
- package/lib/cjs/TextInput/TextArea.js +105 -0
- package/lib/cjs/TextInput/TextInput.js +86 -0
- package/lib/cjs/TextInput/TextInputBase.js +473 -0
- package/lib/cjs/TextInput/dictionary.js +18 -0
- package/lib/cjs/TextInput/index.js +20 -0
- package/lib/cjs/TextInput/propTypes.js +40 -0
- package/lib/cjs/ThemeProvider/ThemeProvider.js +91 -0
- package/lib/cjs/ThemeProvider/index.js +59 -0
- package/lib/cjs/ThemeProvider/useResponsiveThemeTokens.js +88 -0
- package/lib/cjs/ThemeProvider/useSetTheme.js +30 -0
- package/lib/cjs/ThemeProvider/useTheme.js +17 -0
- package/lib/cjs/ThemeProvider/useThemeTokens.js +118 -0
- package/lib/cjs/ThemeProvider/utils/index.js +27 -0
- package/lib/cjs/ThemeProvider/utils/styles.js +208 -0
- package/lib/cjs/ThemeProvider/utils/theme-tokens.js +173 -0
- package/lib/cjs/Timeline/Timeline.js +175 -0
- package/lib/cjs/Timeline/index.js +9 -0
- package/lib/cjs/ToggleSwitch/ToggleSwitch.js +286 -0
- package/lib/cjs/ToggleSwitch/ToggleSwitchGroup.js +215 -0
- package/lib/cjs/ToggleSwitch/index.js +20 -0
- package/lib/cjs/Tooltip/Backdrop.js +57 -0
- package/lib/cjs/Tooltip/Backdrop.native.js +46 -0
- package/lib/cjs/Tooltip/Tooltip.js +295 -0
- package/lib/cjs/Tooltip/Tooltip.native.js +370 -0
- package/lib/cjs/Tooltip/dictionary.js +14 -0
- package/lib/cjs/Tooltip/getTooltipPosition.js +175 -0
- package/lib/cjs/Tooltip/index.js +12 -0
- package/lib/cjs/Tooltip/shared.js +48 -0
- package/lib/cjs/TooltipButton/TooltipButton.js +97 -0
- package/lib/cjs/TooltipButton/index.js +9 -0
- package/lib/cjs/Typography/Typography.js +271 -0
- package/lib/cjs/Typography/index.js +9 -0
- package/lib/cjs/Validator/Validator.js +228 -0
- package/lib/cjs/Validator/index.js +9 -0
- package/lib/cjs/ViewportProvider/ViewportProvider.js +32 -0
- package/lib/cjs/ViewportProvider/index.js +22 -0
- package/lib/cjs/ViewportProvider/useViewport.js +10 -0
- package/lib/cjs/ViewportProvider/useViewportListener.js +43 -0
- package/lib/cjs/index.js +781 -0
- package/lib/cjs/server.js +40 -0
- package/lib/cjs/utils/BaseView/BaseView.js +47 -0
- package/lib/cjs/utils/BaseView/BaseView.native.js +12 -0
- package/lib/cjs/utils/BaseView/index.js +9 -0
- package/lib/cjs/utils/a11y/index.js +27 -0
- package/lib/cjs/utils/a11y/semantics.js +145 -0
- package/lib/cjs/utils/a11y/textSize.js +44 -0
- package/lib/cjs/utils/animation/index.js +13 -0
- package/lib/cjs/utils/animation/useVerticalExpandAnimation.js +92 -0
- package/lib/cjs/utils/children.js +121 -0
- package/lib/cjs/utils/containUniqueFields.js +30 -0
- package/lib/cjs/utils/convertFromMegaByteToByte.js +16 -0
- package/lib/cjs/utils/floating-ui/index.js +42 -0
- package/lib/cjs/utils/floating-ui/index.native.js +42 -0
- package/lib/cjs/utils/formatImageSource.js +33 -0
- package/lib/cjs/utils/hasOwnProperty.js +17 -0
- package/lib/cjs/utils/htmlAttrs.js +30 -0
- package/lib/cjs/utils/index.js +245 -0
- package/lib/cjs/utils/info/index.js +14 -0
- package/lib/cjs/utils/info/platform/index.js +18 -0
- package/lib/cjs/utils/info/platform/platform.android.js +7 -0
- package/lib/cjs/utils/info/platform/platform.ios.js +7 -0
- package/lib/cjs/utils/info/platform/platform.js +7 -0
- package/lib/cjs/utils/info/platform/platform.native.js +10 -0
- package/lib/cjs/utils/info/versions.js +12 -0
- package/lib/cjs/utils/input.js +193 -0
- package/lib/cjs/utils/pressability.js +122 -0
- package/lib/cjs/utils/props/a11yProps.js +315 -0
- package/lib/cjs/utils/props/clickProps.js +32 -0
- package/lib/cjs/utils/props/componentPropType.js +55 -0
- package/lib/cjs/utils/props/contentfulProps.js +29 -0
- package/lib/cjs/utils/props/copyPropTypes.js +9 -0
- package/lib/cjs/utils/props/getPropSelector.js +58 -0
- package/lib/cjs/utils/props/handlerProps.js +111 -0
- package/lib/cjs/utils/props/hrefAttrsProp.js +39 -0
- package/lib/cjs/utils/props/index.js +176 -0
- package/lib/cjs/utils/props/inputSupportsProps.js +87 -0
- package/lib/cjs/utils/props/linkProps.js +50 -0
- package/lib/cjs/utils/props/paddingProp.js +16 -0
- package/lib/cjs/utils/props/pressProps.js +49 -0
- package/lib/cjs/utils/props/rectProp.js +16 -0
- package/lib/cjs/utils/props/responsiveProps.js +35 -0
- package/lib/cjs/utils/props/selectSystemProps.js +29 -0
- package/lib/cjs/utils/props/spacingProps.js +63 -0
- package/lib/cjs/utils/props/textInputProps.js +194 -0
- package/lib/cjs/utils/props/textProps.js +67 -0
- package/lib/cjs/utils/props/tokens.js +140 -0
- package/lib/cjs/utils/props/variantProp.js +24 -0
- package/lib/cjs/utils/props/viewProps.js +28 -0
- package/lib/cjs/utils/ssr-media-query/create-stylesheet/create-stylesheet-mobile.js +55 -0
- package/lib/cjs/utils/ssr-media-query/create-stylesheet/index.android.js +9 -0
- package/lib/cjs/utils/ssr-media-query/create-stylesheet/index.ios.js +9 -0
- package/lib/cjs/utils/ssr-media-query/create-stylesheet/index.js +42 -0
- package/lib/cjs/utils/ssr-media-query/hash.js +19 -0
- package/lib/cjs/utils/ssr-media-query/index.js +18 -0
- package/lib/cjs/utils/ssr-media-query/utils/common.js +44 -0
- package/lib/cjs/utils/ssr-media-query/utils/create-declaration-block.js +23 -0
- package/lib/cjs/utils/ssr-media-query/utils/create-media-query-styles.js +66 -0
- package/lib/cjs/utils/ssr-media-query/utils/hyphenate-style-name.js +18 -0
- package/lib/cjs/utils/ssr-media-query/utils/inject.js +47 -0
- package/lib/cjs/utils/ssr.js +150 -0
- package/lib/cjs/utils/transformGradient.js +22 -0
- package/lib/cjs/utils/useCopy.js +48 -0
- package/lib/cjs/utils/useHash.js +44 -0
- package/lib/cjs/utils/useHash.native.js +12 -0
- package/lib/cjs/utils/useOverlaidPosition.js +242 -0
- package/lib/cjs/utils/useResponsiveProp.js +53 -0
- package/lib/cjs/utils/useSafeLayoutEffect.js +34 -0
- package/lib/cjs/utils/useScrollBlocking.js +55 -0
- package/lib/cjs/utils/useScrollBlocking.native.js +9 -0
- package/lib/cjs/utils/useSpacingScale.js +129 -0
- package/lib/cjs/utils/useUniqueId.js +17 -0
- package/lib/cjs/utils/withLinkRouter.js +89 -0
- package/lib/{Carousel → esm/Carousel}/Carousel.js +164 -106
- package/lib/{Carousel → esm/Carousel}/CarouselItem/CarouselItem.js +23 -6
- package/lib/esm/Carousel/Constants.js +7 -0
- package/lib/{ExpandCollapse → esm/ExpandCollapse}/Panel.js +29 -7
- package/lib/{Icon → esm/Icon}/Icon.js +6 -2
- package/lib/{Link → esm/Link}/LinkBase.js +1 -1
- package/lib/{Modal → esm/Modal}/Modal.js +2 -4
- package/lib/{MultiSelectFilter → esm/MultiSelectFilter}/MultiSelectFilter.js +3 -1
- package/lib/{Notification → esm/Notification}/Notification.js +0 -1
- package/lib/{Tabs → esm/Tabs}/TabsItem.js +6 -2
- package/lib/package.json +88 -0
- package/package.json +13 -11
- package/src/Carousel/Carousel.jsx +225 -152
- package/src/Carousel/CarouselItem/CarouselItem.jsx +14 -4
- package/src/Carousel/Constants.js +4 -0
- package/src/ExpandCollapse/Panel.jsx +44 -14
- package/src/Icon/Icon.jsx +4 -3
- package/src/Link/LinkBase.jsx +3 -1
- package/src/Modal/Modal.jsx +2 -2
- package/src/MultiSelectFilter/MultiSelectFilter.jsx +3 -1
- package/src/Notification/Notification.jsx +0 -1
- package/src/Tabs/TabsItem.jsx +6 -2
- package/types/Listbox.d.ts +60 -0
- package/types/index.d.ts +3 -0
- package/lib/Carousel/Constants.js +0 -3
- /package/lib/{A11yInfoProvider → esm/A11yInfoProvider}/index.js +0 -0
- /package/lib/{A11yText → esm/A11yText}/index.js +0 -0
- /package/lib/{ActionCard → esm/ActionCard}/ActionCard.js +0 -0
- /package/lib/{ActionCard → esm/ActionCard}/index.js +0 -0
- /package/lib/{ActivityIndicator → esm/ActivityIndicator}/Spinner.js +0 -0
- /package/lib/{ActivityIndicator → esm/ActivityIndicator}/Spinner.native.js +0 -0
- /package/lib/{ActivityIndicator → esm/ActivityIndicator}/index.js +0 -0
- /package/lib/{ActivityIndicator → esm/ActivityIndicator}/shared.js +0 -0
- /package/lib/{Autocomplete → esm/Autocomplete}/Autocomplete.js +0 -0
- /package/lib/{Autocomplete → esm/Autocomplete}/Loading.js +0 -0
- /package/lib/{Autocomplete → esm/Autocomplete}/Suggestions.js +0 -0
- /package/lib/{Autocomplete → esm/Autocomplete}/constants.js +0 -0
- /package/lib/{Autocomplete → esm/Autocomplete}/dictionary.js +0 -0
- /package/lib/{Autocomplete → esm/Autocomplete}/index.js +0 -0
- /package/lib/{Badge → esm/Badge}/Badge.js +0 -0
- /package/lib/{Badge → esm/Badge}/index.js +0 -0
- /package/lib/{BaseProvider → esm/BaseProvider}/HydrationContext.js +0 -0
- /package/lib/{BaseProvider → esm/BaseProvider}/index.js +0 -0
- /package/lib/{Box → esm/Box}/Box.js +0 -0
- /package/lib/{Box → esm/Box}/backgroundImageStylesMap.js +0 -0
- /package/lib/{Box → esm/Box}/index.js +0 -0
- /package/lib/{Button → esm/Button}/Button.js +0 -0
- /package/lib/{Button → esm/Button}/ButtonBase.js +0 -0
- /package/lib/{Button → esm/Button}/ButtonDropdown.js +0 -0
- /package/lib/{Button → esm/Button}/ButtonGroup.js +0 -0
- /package/lib/{Button → esm/Button}/ButtonLink.js +0 -0
- /package/lib/{Button → esm/Button}/index.js +0 -0
- /package/lib/{Button → esm/Button}/propTypes.js +0 -0
- /package/lib/{Card → esm/Card}/Card.js +0 -0
- /package/lib/{Card → esm/Card}/CardBase.js +0 -0
- /package/lib/{Card → esm/Card}/PressableCardBase.js +0 -0
- /package/lib/{Card → esm/Card}/index.js +0 -0
- /package/lib/{CardGroup → esm/CardGroup}/CardGroup.js +0 -0
- /package/lib/{CardGroup → esm/CardGroup}/dictionary.js +0 -0
- /package/lib/{CardGroup → esm/CardGroup}/index.js +0 -0
- /package/lib/{Carousel → esm/Carousel}/CarouselContext.js +0 -0
- /package/lib/{Carousel → esm/Carousel}/CarouselFirstFocus/CarouselFirstFocus.js +0 -0
- /package/lib/{Carousel → esm/Carousel}/CarouselItem/index.js +0 -0
- /package/lib/{Carousel → esm/Carousel}/CarouselStepTracker/CarouselStepTracker.js +0 -0
- /package/lib/{Carousel → esm/Carousel}/CarouselStepTracker/index.js +0 -0
- /package/lib/{Carousel → esm/Carousel}/CarouselTabs/CarouselTabs.js +0 -0
- /package/lib/{Carousel → esm/Carousel}/CarouselTabs/CarouselTabsPanel.js +0 -0
- /package/lib/{Carousel → esm/Carousel}/CarouselTabs/CarouselTabsPanelItem.js +0 -0
- /package/lib/{Carousel → esm/Carousel}/CarouselTabs/index.js +0 -0
- /package/lib/{Carousel → esm/Carousel}/CarouselThumbnail.js +0 -0
- /package/lib/{Carousel → esm/Carousel}/CarouselThumbnailNavigation.js +0 -0
- /package/lib/{Carousel → esm/Carousel}/dictionary.js +0 -0
- /package/lib/{Carousel → esm/Carousel}/index.js +0 -0
- /package/lib/{Checkbox → esm/Checkbox}/Checkbox.js +0 -0
- /package/lib/{Checkbox → esm/Checkbox}/CheckboxButton.js +0 -0
- /package/lib/{Checkbox → esm/Checkbox}/CheckboxGroup.js +0 -0
- /package/lib/{Checkbox → esm/Checkbox}/CheckboxInput.js +0 -0
- /package/lib/{Checkbox → esm/Checkbox}/CheckboxInput.native.js +0 -0
- /package/lib/{Checkbox → esm/Checkbox}/index.js +0 -0
- /package/lib/{CheckboxCard → esm/CheckboxCard}/CheckboxCard.js +0 -0
- /package/lib/{CheckboxCard → esm/CheckboxCard}/index.js +0 -0
- /package/lib/{CheckboxCardGroup → esm/CheckboxCardGroup}/CheckboxCardGroup.js +0 -0
- /package/lib/{CheckboxCardGroup → esm/CheckboxCardGroup}/index.js +0 -0
- /package/lib/{ColourToggle → esm/ColourToggle}/ColourBubble.js +0 -0
- /package/lib/{ColourToggle → esm/ColourToggle}/ColourToggle.js +0 -0
- /package/lib/{ColourToggle → esm/ColourToggle}/index.js +0 -0
- /package/lib/{Divider → esm/Divider}/Divider.js +0 -0
- /package/lib/{Divider → esm/Divider}/index.js +0 -0
- /package/lib/{DownloadApp → esm/DownloadApp}/DownloadApp.js +0 -0
- /package/lib/{DownloadApp → esm/DownloadApp}/dictionary.js +0 -0
- /package/lib/{DownloadApp → esm/DownloadApp}/index.js +0 -0
- /package/lib/{ExpandCollapse → esm/ExpandCollapse}/Accordion.js +0 -0
- /package/lib/{ExpandCollapse → esm/ExpandCollapse}/Control.js +0 -0
- /package/lib/{ExpandCollapse → esm/ExpandCollapse}/ExpandCollapse.js +0 -0
- /package/lib/{ExpandCollapse → esm/ExpandCollapse}/dictionary.js +0 -0
- /package/lib/{ExpandCollapse → esm/ExpandCollapse}/index.js +0 -0
- /package/lib/{ExpandCollapseMini → esm/ExpandCollapseMini}/ExpandCollapseMini.js +0 -0
- /package/lib/{ExpandCollapseMini → esm/ExpandCollapseMini}/ExpandCollapseMiniControl.js +0 -0
- /package/lib/{ExpandCollapseMini → esm/ExpandCollapseMini}/index.js +0 -0
- /package/lib/{Feedback → esm/Feedback}/Feedback.js +0 -0
- /package/lib/{Feedback → esm/Feedback}/index.js +0 -0
- /package/lib/{Fieldset → esm/Fieldset}/Fieldset.js +0 -0
- /package/lib/{Fieldset → esm/Fieldset}/FieldsetContainer.js +0 -0
- /package/lib/{Fieldset → esm/Fieldset}/FieldsetContainer.native.js +0 -0
- /package/lib/{Fieldset → esm/Fieldset}/Legend.js +0 -0
- /package/lib/{Fieldset → esm/Fieldset}/Legend.native.js +0 -0
- /package/lib/{Fieldset → esm/Fieldset}/cssReset.js +0 -0
- /package/lib/{Fieldset → esm/Fieldset}/index.js +0 -0
- /package/lib/{FileUpload → esm/FileUpload}/FileUpload.js +0 -0
- /package/lib/{FileUpload → esm/FileUpload}/NotificationContent.js +0 -0
- /package/lib/{FileUpload → esm/FileUpload}/dictionary.js +0 -0
- /package/lib/{FileUpload → esm/FileUpload}/index.js +0 -0
- /package/lib/{FlexGrid → esm/FlexGrid}/Col/Col.js +0 -0
- /package/lib/{FlexGrid → esm/FlexGrid}/Col/index.js +0 -0
- /package/lib/{FlexGrid → esm/FlexGrid}/FlexGrid.js +0 -0
- /package/lib/{FlexGrid → esm/FlexGrid}/Row/Row.js +0 -0
- /package/lib/{FlexGrid → esm/FlexGrid}/Row/index.js +0 -0
- /package/lib/{FlexGrid → esm/FlexGrid}/helpers/index.js +0 -0
- /package/lib/{FlexGrid → esm/FlexGrid}/index.js +0 -0
- /package/lib/{FlexGrid → esm/FlexGrid}/providers/GutterContext.js +0 -0
- /package/lib/{Footnote → esm/Footnote}/Footnote.js +0 -0
- /package/lib/{Footnote → esm/Footnote}/FootnoteLink.js +0 -0
- /package/lib/{Footnote → esm/Footnote}/dictionary.js +0 -0
- /package/lib/{Footnote → esm/Footnote}/index.js +0 -0
- /package/lib/{HorizontalScroll → esm/HorizontalScroll}/HorizontalScroll.js +0 -0
- /package/lib/{HorizontalScroll → esm/HorizontalScroll}/HorizontalScrollButton.js +0 -0
- /package/lib/{HorizontalScroll → esm/HorizontalScroll}/ScrollViewEnd.js +0 -0
- /package/lib/{HorizontalScroll → esm/HorizontalScroll}/ScrollViewEnd.native.js +0 -0
- /package/lib/{HorizontalScroll → esm/HorizontalScroll}/dictionary.js +0 -0
- /package/lib/{HorizontalScroll → esm/HorizontalScroll}/index.js +0 -0
- /package/lib/{HorizontalScroll → esm/HorizontalScroll}/itemPositions.js +0 -0
- /package/lib/{Icon → esm/Icon}/IconText.js +0 -0
- /package/lib/{Icon → esm/Icon}/index.js +0 -0
- /package/lib/{IconButton → esm/IconButton}/IconButton.js +0 -0
- /package/lib/{IconButton → esm/IconButton}/index.js +0 -0
- /package/lib/{InputLabel → esm/InputLabel}/InputLabel.js +0 -0
- /package/lib/{InputLabel → esm/InputLabel}/LabelContent.js +0 -0
- /package/lib/{InputLabel → esm/InputLabel}/LabelContent.native.js +0 -0
- /package/lib/{InputLabel → esm/InputLabel}/index.js +0 -0
- /package/lib/{InputSupports → esm/InputSupports}/InputSupports.js +0 -0
- /package/lib/{InputSupports → esm/InputSupports}/dictionary.js +0 -0
- /package/lib/{InputSupports → esm/InputSupports}/index.js +0 -0
- /package/lib/{InputSupports → esm/InputSupports}/useInputSupports.js +0 -0
- /package/lib/{Link → esm/Link}/ChevronLink.js +0 -0
- /package/lib/{Link → esm/Link}/InlinePressable.js +0 -0
- /package/lib/{Link → esm/Link}/InlinePressable.native.js +0 -0
- /package/lib/{Link → esm/Link}/Link.js +0 -0
- /package/lib/{Link → esm/Link}/TextButton.js +0 -0
- /package/lib/{Link → esm/Link}/index.js +0 -0
- /package/lib/{List → esm/List}/List.js +0 -0
- /package/lib/{List → esm/List}/ListItem.js +0 -0
- /package/lib/{List → esm/List}/ListItemBase.js +0 -0
- /package/lib/{List → esm/List}/ListItemContent.js +0 -0
- /package/lib/{List → esm/List}/ListItemMark.js +0 -0
- /package/lib/{List → esm/List}/PressableListItemBase.js +0 -0
- /package/lib/{List → esm/List}/index.js +0 -0
- /package/lib/{Listbox → esm/Listbox}/GroupControl.js +0 -0
- /package/lib/{Listbox → esm/Listbox}/Listbox.js +0 -0
- /package/lib/{Listbox → esm/Listbox}/ListboxContext.js +0 -0
- /package/lib/{Listbox → esm/Listbox}/ListboxGroup.js +0 -0
- /package/lib/{Listbox → esm/Listbox}/ListboxItem.js +0 -0
- /package/lib/{Listbox → esm/Listbox}/ListboxOverlay.js +0 -0
- /package/lib/{Listbox → esm/Listbox}/PressableItem.js +0 -0
- /package/lib/{Listbox → esm/Listbox}/index.js +0 -0
- /package/lib/{Modal → esm/Modal}/ModalContent.js +0 -0
- /package/lib/{Modal → esm/Modal}/WebModal.js +0 -0
- /package/lib/{Modal → esm/Modal}/dictionary.js +0 -0
- /package/lib/{Modal → esm/Modal}/index.js +0 -0
- /package/lib/{MultiSelectFilter → esm/MultiSelectFilter}/ModalOverlay.js +0 -0
- /package/lib/{MultiSelectFilter → esm/MultiSelectFilter}/dictionary.js +0 -0
- /package/lib/{MultiSelectFilter → esm/MultiSelectFilter}/index.js +0 -0
- /package/lib/{Notification → esm/Notification}/dictionary.js +0 -0
- /package/lib/{Notification → esm/Notification}/index.js +0 -0
- /package/lib/{OrderedList → esm/OrderedList}/Item.js +0 -0
- /package/lib/{OrderedList → esm/OrderedList}/ItemBase.js +0 -0
- /package/lib/{OrderedList → esm/OrderedList}/OrderedList.js +0 -0
- /package/lib/{OrderedList → esm/OrderedList}/OrderedListBase.js +0 -0
- /package/lib/{OrderedList → esm/OrderedList}/index.js +0 -0
- /package/lib/{Pagination → esm/Pagination}/PageButton.js +0 -0
- /package/lib/{Pagination → esm/Pagination}/Pagination.js +0 -0
- /package/lib/{Pagination → esm/Pagination}/SideButton.js +0 -0
- /package/lib/{Pagination → esm/Pagination}/constants.js +0 -0
- /package/lib/{Pagination → esm/Pagination}/dictionary.js +0 -0
- /package/lib/{Pagination → esm/Pagination}/index.js +0 -0
- /package/lib/{Pagination → esm/Pagination}/usePagination.js +0 -0
- /package/lib/{Portal → esm/Portal}/Portal.js +0 -0
- /package/lib/{Portal → esm/Portal}/Portal.native.js +0 -0
- /package/lib/{Portal → esm/Portal}/index.js +0 -0
- /package/lib/{PriceLockup → esm/PriceLockup}/PriceLockup.js +0 -0
- /package/lib/{PriceLockup → esm/PriceLockup}/index.js +0 -0
- /package/lib/{PriceLockup → esm/PriceLockup}/utils/renderFootnoteContent.js +0 -0
- /package/lib/{PriceLockup → esm/PriceLockup}/utils/renderFootnoteLinks.js +0 -0
- /package/lib/{PriceLockup → esm/PriceLockup}/utils/renderPrice.js +0 -0
- /package/lib/{PriceLockup → esm/PriceLockup}/utils/renderTypography.js +0 -0
- /package/lib/{ProductCard → esm/ProductCard}/ProductCard.js +0 -0
- /package/lib/{ProductCard → esm/ProductCard}/dictionary.js +0 -0
- /package/lib/{ProductCard → esm/ProductCard}/index.js +0 -0
- /package/lib/{ProductCardGroup → esm/ProductCardGroup}/ProductCardGroup.js +0 -0
- /package/lib/{ProductCardGroup → esm/ProductCardGroup}/index.js +0 -0
- /package/lib/{Progress → esm/Progress}/Progress.js +0 -0
- /package/lib/{Progress → esm/Progress}/ProgressBar.js +0 -0
- /package/lib/{Progress → esm/Progress}/ProgressBarBackground.js +0 -0
- /package/lib/{Progress → esm/Progress}/constants.js +0 -0
- /package/lib/{Progress → esm/Progress}/index.js +0 -0
- /package/lib/{QuickLinks → esm/QuickLinks}/QuickLinks.js +0 -0
- /package/lib/{QuickLinks → esm/QuickLinks}/QuickLinksCard.js +0 -0
- /package/lib/{QuickLinks → esm/QuickLinks}/QuickLinksItem.js +0 -0
- /package/lib/{QuickLinks → esm/QuickLinks}/index.js +0 -0
- /package/lib/{QuickLinksFeature → esm/QuickLinksFeature}/QuickLinksFeature.js +0 -0
- /package/lib/{QuickLinksFeature → esm/QuickLinksFeature}/QuickLinksFeatureItem.js +0 -0
- /package/lib/{QuickLinksFeature → esm/QuickLinksFeature}/index.js +0 -0
- /package/lib/{Radio → esm/Radio}/Radio.js +0 -0
- /package/lib/{Radio → esm/Radio}/RadioButton.js +0 -0
- /package/lib/{Radio → esm/Radio}/RadioGroup.js +0 -0
- /package/lib/{Radio → esm/Radio}/RadioInput.js +0 -0
- /package/lib/{Radio → esm/Radio}/RadioInput.native.js +0 -0
- /package/lib/{Radio → esm/Radio}/index.js +0 -0
- /package/lib/{RadioCard → esm/RadioCard}/RadioCard.js +0 -0
- /package/lib/{RadioCard → esm/RadioCard}/RadioCardGroup.js +0 -0
- /package/lib/{RadioCard → esm/RadioCard}/index.js +0 -0
- /package/lib/{Responsive → esm/Responsive}/Responsive.js +0 -0
- /package/lib/{Responsive → esm/Responsive}/ResponsiveProp.js +0 -0
- /package/lib/{Responsive → esm/Responsive}/ResponsiveWithMediaQueryStyleSheet.js +0 -0
- /package/lib/{Responsive → esm/Responsive}/index.js +0 -0
- /package/lib/{Search → esm/Search}/Search.js +0 -0
- /package/lib/{Search → esm/Search}/dictionary.js +0 -0
- /package/lib/{Search → esm/Search}/index.js +0 -0
- /package/lib/{Select → esm/Select}/Group.js +0 -0
- /package/lib/{Select → esm/Select}/Group.native.js +0 -0
- /package/lib/{Select → esm/Select}/Item.js +0 -0
- /package/lib/{Select → esm/Select}/Item.native.js +0 -0
- /package/lib/{Select → esm/Select}/Picker.js +0 -0
- /package/lib/{Select → esm/Select}/Picker.native.js +0 -0
- /package/lib/{Select → esm/Select}/Select.js +0 -0
- /package/lib/{Select → esm/Select}/constants.js +0 -0
- /package/lib/{Select → esm/Select}/index.js +0 -0
- /package/lib/{SideNav → esm/SideNav}/Item.js +0 -0
- /package/lib/{SideNav → esm/SideNav}/ItemContent.js +0 -0
- /package/lib/{SideNav → esm/SideNav}/ItemsGroup.js +0 -0
- /package/lib/{SideNav → esm/SideNav}/SideNav.js +0 -0
- /package/lib/{SideNav → esm/SideNav}/index.js +0 -0
- /package/lib/{Skeleton → esm/Skeleton}/Skeleton.js +0 -0
- /package/lib/{Skeleton → esm/Skeleton}/index.js +0 -0
- /package/lib/{Skeleton → esm/Skeleton}/skeleton.constant.js +0 -0
- /package/lib/{Skeleton → esm/Skeleton}/skeletonWebAnimation.js +0 -0
- /package/lib/{Skeleton → esm/Skeleton}/useSkeletonNativeAnimation.js +0 -0
- /package/lib/{SkipLink → esm/SkipLink}/SkipLink.js +0 -0
- /package/lib/{SkipLink → esm/SkipLink}/index.js +0 -0
- /package/lib/{Spacer → esm/Spacer}/Spacer.js +0 -0
- /package/lib/{Spacer → esm/Spacer}/index.js +0 -0
- /package/lib/{StackView → esm/StackView}/StackView.js +0 -0
- /package/lib/{StackView → esm/StackView}/StackWrap.js +0 -0
- /package/lib/{StackView → esm/StackView}/StackWrap.native.js +0 -0
- /package/lib/{StackView → esm/StackView}/StackWrapBox.js +0 -0
- /package/lib/{StackView → esm/StackView}/StackWrapGap.js +0 -0
- /package/lib/{StackView → esm/StackView}/common.js +0 -0
- /package/lib/{StackView → esm/StackView}/getStackedContent.js +0 -0
- /package/lib/{StackView → esm/StackView}/index.js +0 -0
- /package/lib/{Status → esm/Status}/Status.js +0 -0
- /package/lib/{Status → esm/Status}/index.js +0 -0
- /package/lib/{StepTracker → esm/StepTracker}/Step.js +0 -0
- /package/lib/{StepTracker → esm/StepTracker}/StepTracker.js +0 -0
- /package/lib/{StepTracker → esm/StepTracker}/dictionary.js +0 -0
- /package/lib/{StepTracker → esm/StepTracker}/index.js +0 -0
- /package/lib/{TabBar → esm/TabBar}/TabBar.js +0 -0
- /package/lib/{TabBar → esm/TabBar}/TabBarItem.js +0 -0
- /package/lib/{TabBar → esm/TabBar}/index.js +0 -0
- /package/lib/{Tabs → esm/Tabs}/Tabs.js +0 -0
- /package/lib/{Tabs → esm/Tabs}/index.js +0 -0
- /package/lib/{Tags → esm/Tags}/Tags.js +0 -0
- /package/lib/{Tags → esm/Tags}/index.js +0 -0
- /package/lib/{TextInput → esm/TextInput}/TextArea.js +0 -0
- /package/lib/{TextInput → esm/TextInput}/TextInput.js +0 -0
- /package/lib/{TextInput → esm/TextInput}/TextInputBase.js +0 -0
- /package/lib/{TextInput → esm/TextInput}/dictionary.js +0 -0
- /package/lib/{TextInput → esm/TextInput}/index.js +0 -0
- /package/lib/{TextInput → esm/TextInput}/propTypes.js +0 -0
- /package/lib/{ThemeProvider → esm/ThemeProvider}/ThemeProvider.js +0 -0
- /package/lib/{ThemeProvider → esm/ThemeProvider}/index.js +0 -0
- /package/lib/{ThemeProvider → esm/ThemeProvider}/useResponsiveThemeTokens.js +0 -0
- /package/lib/{ThemeProvider → esm/ThemeProvider}/useSetTheme.js +0 -0
- /package/lib/{ThemeProvider → esm/ThemeProvider}/useTheme.js +0 -0
- /package/lib/{ThemeProvider → esm/ThemeProvider}/useThemeTokens.js +0 -0
- /package/lib/{ThemeProvider → esm/ThemeProvider}/utils/index.js +0 -0
- /package/lib/{ThemeProvider → esm/ThemeProvider}/utils/styles.js +0 -0
- /package/lib/{ThemeProvider → esm/ThemeProvider}/utils/theme-tokens.js +0 -0
- /package/lib/{Timeline → esm/Timeline}/Timeline.js +0 -0
- /package/lib/{Timeline → esm/Timeline}/index.js +0 -0
- /package/lib/{ToggleSwitch → esm/ToggleSwitch}/ToggleSwitch.js +0 -0
- /package/lib/{ToggleSwitch → esm/ToggleSwitch}/ToggleSwitchGroup.js +0 -0
- /package/lib/{ToggleSwitch → esm/ToggleSwitch}/index.js +0 -0
- /package/lib/{Tooltip → esm/Tooltip}/Backdrop.js +0 -0
- /package/lib/{Tooltip → esm/Tooltip}/Backdrop.native.js +0 -0
- /package/lib/{Tooltip → esm/Tooltip}/Tooltip.js +0 -0
- /package/lib/{Tooltip → esm/Tooltip}/Tooltip.native.js +0 -0
- /package/lib/{Tooltip → esm/Tooltip}/dictionary.js +0 -0
- /package/lib/{Tooltip → esm/Tooltip}/getTooltipPosition.js +0 -0
- /package/lib/{Tooltip → esm/Tooltip}/index.js +0 -0
- /package/lib/{Tooltip → esm/Tooltip}/shared.js +0 -0
- /package/lib/{TooltipButton → esm/TooltipButton}/TooltipButton.js +0 -0
- /package/lib/{TooltipButton → esm/TooltipButton}/index.js +0 -0
- /package/lib/{Typography → esm/Typography}/Typography.js +0 -0
- /package/lib/{Typography → esm/Typography}/index.js +0 -0
- /package/lib/{Validator → esm/Validator}/Validator.js +0 -0
- /package/lib/{Validator → esm/Validator}/index.js +0 -0
- /package/lib/{ViewportProvider → esm/ViewportProvider}/ViewportProvider.js +0 -0
- /package/lib/{ViewportProvider → esm/ViewportProvider}/index.js +0 -0
- /package/lib/{ViewportProvider → esm/ViewportProvider}/useViewport.js +0 -0
- /package/lib/{ViewportProvider → esm/ViewportProvider}/useViewportListener.js +0 -0
- /package/lib/{index.js → esm/index.js} +0 -0
- /package/lib/{server.js → esm/server.js} +0 -0
- /package/lib/{utils → esm/utils}/BaseView/BaseView.js +0 -0
- /package/lib/{utils → esm/utils}/BaseView/BaseView.native.js +0 -0
- /package/lib/{utils → esm/utils}/BaseView/index.js +0 -0
- /package/lib/{utils → esm/utils}/a11y/index.js +0 -0
- /package/lib/{utils → esm/utils}/a11y/semantics.js +0 -0
- /package/lib/{utils → esm/utils}/a11y/textSize.js +0 -0
- /package/lib/{utils → esm/utils}/animation/index.js +0 -0
- /package/lib/{utils → esm/utils}/animation/useVerticalExpandAnimation.js +0 -0
- /package/lib/{utils → esm/utils}/children.js +0 -0
- /package/lib/{utils → esm/utils}/containUniqueFields.js +0 -0
- /package/lib/{utils → esm/utils}/convertFromMegaByteToByte.js +0 -0
- /package/lib/{utils → esm/utils}/floating-ui/index.js +0 -0
- /package/lib/{utils → esm/utils}/floating-ui/index.native.js +0 -0
- /package/lib/{utils → esm/utils}/formatImageSource.js +0 -0
- /package/lib/{utils → esm/utils}/hasOwnProperty.js +0 -0
- /package/lib/{utils → esm/utils}/htmlAttrs.js +0 -0
- /package/lib/{utils → esm/utils}/index.js +0 -0
- /package/lib/{utils → esm/utils}/info/index.js +0 -0
- /package/lib/{utils → esm/utils}/info/platform/index.js +0 -0
- /package/lib/{utils → esm/utils}/info/platform/platform.android.js +0 -0
- /package/lib/{utils → esm/utils}/info/platform/platform.ios.js +0 -0
- /package/lib/{utils → esm/utils}/info/platform/platform.js +0 -0
- /package/lib/{utils → esm/utils}/info/platform/platform.native.js +0 -0
- /package/lib/{utils → esm/utils}/info/versions.js +0 -0
- /package/lib/{utils → esm/utils}/input.js +0 -0
- /package/lib/{utils → esm/utils}/pressability.js +0 -0
- /package/lib/{utils → esm/utils}/props/a11yProps.js +0 -0
- /package/lib/{utils → esm/utils}/props/clickProps.js +0 -0
- /package/lib/{utils → esm/utils}/props/componentPropType.js +0 -0
- /package/lib/{utils → esm/utils}/props/contentfulProps.js +0 -0
- /package/lib/{utils → esm/utils}/props/copyPropTypes.js +0 -0
- /package/lib/{utils → esm/utils}/props/getPropSelector.js +0 -0
- /package/lib/{utils → esm/utils}/props/handlerProps.js +0 -0
- /package/lib/{utils → esm/utils}/props/hrefAttrsProp.js +0 -0
- /package/lib/{utils → esm/utils}/props/index.js +0 -0
- /package/lib/{utils → esm/utils}/props/inputSupportsProps.js +0 -0
- /package/lib/{utils → esm/utils}/props/linkProps.js +0 -0
- /package/lib/{utils → esm/utils}/props/paddingProp.js +0 -0
- /package/lib/{utils → esm/utils}/props/pressProps.js +0 -0
- /package/lib/{utils → esm/utils}/props/rectProp.js +0 -0
- /package/lib/{utils → esm/utils}/props/responsiveProps.js +0 -0
- /package/lib/{utils → esm/utils}/props/selectSystemProps.js +0 -0
- /package/lib/{utils → esm/utils}/props/spacingProps.js +0 -0
- /package/lib/{utils → esm/utils}/props/textInputProps.js +0 -0
- /package/lib/{utils → esm/utils}/props/textProps.js +0 -0
- /package/lib/{utils → esm/utils}/props/tokens.js +0 -0
- /package/lib/{utils → esm/utils}/props/variantProp.js +0 -0
- /package/lib/{utils → esm/utils}/props/viewProps.js +0 -0
- /package/lib/{utils → esm/utils}/ssr-media-query/create-stylesheet/create-stylesheet-mobile.js +0 -0
- /package/lib/{utils → esm/utils}/ssr-media-query/create-stylesheet/index.android.js +0 -0
- /package/lib/{utils → esm/utils}/ssr-media-query/create-stylesheet/index.ios.js +0 -0
- /package/lib/{utils → esm/utils}/ssr-media-query/create-stylesheet/index.js +0 -0
- /package/lib/{utils → esm/utils}/ssr-media-query/hash.js +0 -0
- /package/lib/{utils → esm/utils}/ssr-media-query/index.js +0 -0
- /package/lib/{utils → esm/utils}/ssr-media-query/utils/common.js +0 -0
- /package/lib/{utils → esm/utils}/ssr-media-query/utils/create-declaration-block.js +0 -0
- /package/lib/{utils → esm/utils}/ssr-media-query/utils/create-media-query-styles.js +0 -0
- /package/lib/{utils → esm/utils}/ssr-media-query/utils/hyphenate-style-name.js +0 -0
- /package/lib/{utils → esm/utils}/ssr-media-query/utils/inject.js +0 -0
- /package/lib/{utils → esm/utils}/ssr.js +0 -0
- /package/lib/{utils → esm/utils}/transformGradient.js +0 -0
- /package/lib/{utils → esm/utils}/useCopy.js +0 -0
- /package/lib/{utils → esm/utils}/useHash.js +0 -0
- /package/lib/{utils → esm/utils}/useHash.native.js +0 -0
- /package/lib/{utils → esm/utils}/useOverlaidPosition.js +0 -0
- /package/lib/{utils → esm/utils}/useResponsiveProp.js +0 -0
- /package/lib/{utils → esm/utils}/useSafeLayoutEffect.js +0 -0
- /package/lib/{utils → esm/utils}/useScrollBlocking.js +0 -0
- /package/lib/{utils → esm/utils}/useScrollBlocking.native.js +0 -0
- /package/lib/{utils → esm/utils}/useSpacingScale.js +0 -0
- /package/lib/{utils → esm/utils}/useUniqueId.js +0 -0
- /package/lib/{utils → esm/utils}/withLinkRouter.js +0 -0
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
+
var _Pressable = _interopRequireDefault(require("react-native-web/dist/cjs/exports/Pressable"));
|
|
10
|
+
var _Text = _interopRequireDefault(require("react-native-web/dist/cjs/exports/Text"));
|
|
11
|
+
var _utils = require("../utils");
|
|
12
|
+
var _ListboxContext = require("./ListboxContext");
|
|
13
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
14
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
15
|
+
const [selectProps, selectedSystemPropTypes] = (0, _utils.selectSystemProps)([_utils.htmlAttrs]);
|
|
16
|
+
const getItemStyles = _ref => {
|
|
17
|
+
let {
|
|
18
|
+
groupFontName,
|
|
19
|
+
groupFontWeight,
|
|
20
|
+
itemFontSize,
|
|
21
|
+
itemPaddingTop,
|
|
22
|
+
itemPaddingBottom,
|
|
23
|
+
itemPaddingLeft,
|
|
24
|
+
itemBorderLeftWidth,
|
|
25
|
+
itemPaddingRight,
|
|
26
|
+
itemBackgroundColor,
|
|
27
|
+
itemColor,
|
|
28
|
+
itemOutline,
|
|
29
|
+
itemTextDecoration,
|
|
30
|
+
itemBorderLeftColor,
|
|
31
|
+
itemBorderRightWidth,
|
|
32
|
+
itemBorderRightColor,
|
|
33
|
+
itemBorderTopWidth,
|
|
34
|
+
itemBorderTopColor,
|
|
35
|
+
itemBorderBottomWidth,
|
|
36
|
+
itemBorderBottomColor,
|
|
37
|
+
itemBorderRadius
|
|
38
|
+
} = _ref;
|
|
39
|
+
return {
|
|
40
|
+
fontFamily: `${groupFontName}${groupFontWeight}normal`,
|
|
41
|
+
fontSize: itemFontSize,
|
|
42
|
+
paddingTop: itemPaddingTop - itemBorderTopWidth,
|
|
43
|
+
paddingBottom: itemPaddingBottom - itemBorderBottomWidth,
|
|
44
|
+
paddingLeft: itemPaddingLeft - itemBorderLeftWidth,
|
|
45
|
+
paddingRight: itemPaddingRight - itemBorderRightWidth,
|
|
46
|
+
width: '100%',
|
|
47
|
+
backgroundColor: itemBackgroundColor,
|
|
48
|
+
color: itemColor,
|
|
49
|
+
outline: itemOutline,
|
|
50
|
+
textDecoration: itemTextDecoration,
|
|
51
|
+
borderLeft: `${itemBorderLeftWidth}px solid ${itemBorderLeftColor}`,
|
|
52
|
+
borderRight: `${itemBorderRightWidth}px solid ${itemBorderRightColor}`,
|
|
53
|
+
borderTop: `${itemBorderTopWidth}px solid ${itemBorderTopColor}`,
|
|
54
|
+
borderBottom: `${itemBorderBottomWidth}px solid ${itemBorderBottomColor}`,
|
|
55
|
+
borderRadius: itemBorderRadius,
|
|
56
|
+
justifyContent: 'center'
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
const PressableItem = /*#__PURE__*/_react.default.forwardRef((_ref2, ref) => {
|
|
60
|
+
let {
|
|
61
|
+
children,
|
|
62
|
+
href,
|
|
63
|
+
isChild = false,
|
|
64
|
+
onBlur,
|
|
65
|
+
onPress,
|
|
66
|
+
tabIndex = 0,
|
|
67
|
+
nextItemRef,
|
|
68
|
+
prevItemRef,
|
|
69
|
+
tokens,
|
|
70
|
+
id,
|
|
71
|
+
...rest
|
|
72
|
+
} = _ref2;
|
|
73
|
+
const {
|
|
74
|
+
selectedId,
|
|
75
|
+
setSelectedId
|
|
76
|
+
} = (0, _ListboxContext.useListboxContext)();
|
|
77
|
+
const selectTextStyles = _ref3 => {
|
|
78
|
+
let {
|
|
79
|
+
groupFontName,
|
|
80
|
+
groupFontWeight,
|
|
81
|
+
itemFontSize,
|
|
82
|
+
itemColor,
|
|
83
|
+
lineHeight
|
|
84
|
+
} = _ref3;
|
|
85
|
+
return {
|
|
86
|
+
fontFamily: `${groupFontName}${groupFontWeight}normal`,
|
|
87
|
+
fontSize: itemFontSize,
|
|
88
|
+
color: itemColor,
|
|
89
|
+
lineHeight: lineHeight * itemFontSize
|
|
90
|
+
};
|
|
91
|
+
};
|
|
92
|
+
const resolveButtonTokens = pressableState => {
|
|
93
|
+
const themeTokens = (0, _utils.resolvePressableTokens)(tokens, pressableState, {
|
|
94
|
+
isChild,
|
|
95
|
+
current: id === selectedId && id !== undefined
|
|
96
|
+
});
|
|
97
|
+
return themeTokens;
|
|
98
|
+
};
|
|
99
|
+
const handleKeyPress = event => {
|
|
100
|
+
if (['Enter', ' '].includes(event?.key)) {
|
|
101
|
+
onPress?.(event);
|
|
102
|
+
} else if (event?.key === 'ArrowDown') {
|
|
103
|
+
nextItemRef.current.focus();
|
|
104
|
+
} else if (event?.key === 'ArrowUp' && prevItemRef?.current) {
|
|
105
|
+
prevItemRef.current.focus();
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Pressable.default, {
|
|
109
|
+
isChild: isChild,
|
|
110
|
+
style: pressableState => getItemStyles(resolveButtonTokens(pressableState)),
|
|
111
|
+
onBlur: onBlur,
|
|
112
|
+
onClick: onPress,
|
|
113
|
+
onKeyPress: handleKeyPress,
|
|
114
|
+
ref: ref,
|
|
115
|
+
tabIndex: tabIndex,
|
|
116
|
+
...(href && {
|
|
117
|
+
href
|
|
118
|
+
}),
|
|
119
|
+
...(onPress && {
|
|
120
|
+
onClick: onPress
|
|
121
|
+
}),
|
|
122
|
+
...selectProps(rest),
|
|
123
|
+
onPress: event => {
|
|
124
|
+
setSelectedId(id);
|
|
125
|
+
onPress(event);
|
|
126
|
+
},
|
|
127
|
+
children: pressableState => {
|
|
128
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Text.default, {
|
|
129
|
+
style: selectTextStyles(resolveButtonTokens(pressableState)),
|
|
130
|
+
children: [children, " "]
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
});
|
|
134
|
+
});
|
|
135
|
+
PressableItem.displayName = 'PressableItem';
|
|
136
|
+
PressableItem.propTypes = {
|
|
137
|
+
...selectedSystemPropTypes,
|
|
138
|
+
href: _propTypes.default.string,
|
|
139
|
+
isChild: _propTypes.default.bool,
|
|
140
|
+
children: _propTypes.default.node.isRequired,
|
|
141
|
+
onBlur: _propTypes.default.func,
|
|
142
|
+
onPress: _propTypes.default.func,
|
|
143
|
+
nextItemRef: _propTypes.default.object,
|
|
144
|
+
prevItemRef: _propTypes.default.object
|
|
145
|
+
};
|
|
146
|
+
var _default = exports.default = PressableItem;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _Listbox = _interopRequireDefault(require("./Listbox"));
|
|
8
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
|
+
var _default = exports.default = _Listbox.default;
|
|
@@ -0,0 +1,375 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _StyleSheet = _interopRequireDefault(require("react-native-web/dist/cjs/exports/StyleSheet"));
|
|
9
|
+
var _TouchableWithoutFeedback = _interopRequireDefault(require("react-native-web/dist/cjs/exports/TouchableWithoutFeedback"));
|
|
10
|
+
var _View = _interopRequireDefault(require("react-native-web/dist/cjs/exports/View"));
|
|
11
|
+
var _ScrollView = _interopRequireDefault(require("react-native-web/dist/cjs/exports/ScrollView"));
|
|
12
|
+
var _Modal = _interopRequireDefault(require("react-native-web/dist/cjs/exports/Modal"));
|
|
13
|
+
var _Platform = _interopRequireDefault(require("react-native-web/dist/cjs/exports/Platform"));
|
|
14
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
15
|
+
var _ThemeProvider = require("../ThemeProvider");
|
|
16
|
+
var _utils = require("../utils");
|
|
17
|
+
var _ViewportProvider = require("../ViewportProvider");
|
|
18
|
+
var _IconButton = _interopRequireDefault(require("../IconButton"));
|
|
19
|
+
var _dictionary = _interopRequireDefault(require("./dictionary"));
|
|
20
|
+
var _useScrollBlocking = _interopRequireDefault(require("../utils/useScrollBlocking"));
|
|
21
|
+
var _ModalContent = _interopRequireDefault(require("./ModalContent"));
|
|
22
|
+
var _WebModal = _interopRequireDefault(require("./WebModal"));
|
|
23
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
24
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
25
|
+
const [selectProps, selectedSystemPropTypes] = (0, _utils.selectSystemProps)([_utils.a11yProps, _utils.viewProps]);
|
|
26
|
+
const selectContainerStyles = _ref => {
|
|
27
|
+
let {
|
|
28
|
+
containerPaddingLeft,
|
|
29
|
+
containerPaddingRight,
|
|
30
|
+
containerPaddingTop,
|
|
31
|
+
containerPaddingBottom,
|
|
32
|
+
maxWidth,
|
|
33
|
+
height
|
|
34
|
+
} = _ref;
|
|
35
|
+
return {
|
|
36
|
+
height,
|
|
37
|
+
maxWidth,
|
|
38
|
+
paddingLeft: containerPaddingLeft,
|
|
39
|
+
paddingRight: containerPaddingRight,
|
|
40
|
+
paddingTop: containerPaddingTop,
|
|
41
|
+
paddingBottom: containerPaddingBottom
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
const selectModalStyles = _ref2 => {
|
|
45
|
+
let {
|
|
46
|
+
backgroundColor,
|
|
47
|
+
borderColor,
|
|
48
|
+
borderRadius,
|
|
49
|
+
borderWidth,
|
|
50
|
+
height,
|
|
51
|
+
paddingLeft,
|
|
52
|
+
paddingRight,
|
|
53
|
+
paddingTop,
|
|
54
|
+
paddingBottom,
|
|
55
|
+
shadow
|
|
56
|
+
} = _ref2;
|
|
57
|
+
return {
|
|
58
|
+
backgroundColor,
|
|
59
|
+
borderColor,
|
|
60
|
+
borderRadius,
|
|
61
|
+
borderWidth,
|
|
62
|
+
height,
|
|
63
|
+
paddingLeft,
|
|
64
|
+
paddingRight,
|
|
65
|
+
paddingTop: _Platform.default.OS !== 'web' ? 16 + paddingTop : paddingTop,
|
|
66
|
+
// the 16 additions are due to the border that is present in the mobile version
|
|
67
|
+
paddingBottom,
|
|
68
|
+
...(0, _ThemeProvider.applyShadowToken)(shadow)
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
const selectBackdropStyles = _ref3 => {
|
|
72
|
+
let {
|
|
73
|
+
backdropColor,
|
|
74
|
+
backdropOpacity
|
|
75
|
+
} = _ref3;
|
|
76
|
+
return {
|
|
77
|
+
backgroundColor: backdropColor,
|
|
78
|
+
opacity: backdropOpacity
|
|
79
|
+
};
|
|
80
|
+
};
|
|
81
|
+
const selectCloseButtonContainerStyles = _ref4 => {
|
|
82
|
+
let {
|
|
83
|
+
paddingRight,
|
|
84
|
+
paddingTop
|
|
85
|
+
} = _ref4;
|
|
86
|
+
return {
|
|
87
|
+
paddingRight,
|
|
88
|
+
paddingTop: _Platform.default.OS !== 'web' ? 24 + paddingTop : paddingTop // The 24 additions are due to the border that is present in the mobile version for the close button
|
|
89
|
+
};
|
|
90
|
+
};
|
|
91
|
+
const selectScrollViewStyles = () => ({
|
|
92
|
+
flex: 1
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* A modal window is a secondary window that opens on top of the main one.
|
|
97
|
+
* Users have to interact with it before they can carry out their task and return to the main window.
|
|
98
|
+
* Use to reveal additional information to a user after they have performed an explicit interaction.
|
|
99
|
+
* They are a strongly discouraged pattern; it's preferred to have all relevant information within a page,
|
|
100
|
+
* and irrelevant information either linked externally or omitted.
|
|
101
|
+
*
|
|
102
|
+
* - Must only appear after a customer interaction, not on page load or any other circumstance
|
|
103
|
+
* - Open a modal based on explicit customer action e.g. clicking on a button/link/form field
|
|
104
|
+
* - Only one modal should be "current" at any time
|
|
105
|
+
* - Read [WebAIM's documentation](https://www.w3.org/TR/wai-aria-practices/examples/dialog-modal/dialog.html) to create accessible modals
|
|
106
|
+
* - Don’t use modals to reinforce or repeat information already available in the parent page or view
|
|
107
|
+
* - Don’t use modals consecutively
|
|
108
|
+
*/
|
|
109
|
+
const Modal = /*#__PURE__*/_react.default.forwardRef((_ref5, ref) => {
|
|
110
|
+
let {
|
|
111
|
+
children,
|
|
112
|
+
isOpen,
|
|
113
|
+
onClose,
|
|
114
|
+
maxWidth,
|
|
115
|
+
tokens,
|
|
116
|
+
copy,
|
|
117
|
+
closeButton,
|
|
118
|
+
onCancel = onClose,
|
|
119
|
+
onConfirm,
|
|
120
|
+
heading,
|
|
121
|
+
headingLevel,
|
|
122
|
+
subHeading,
|
|
123
|
+
subHeadingSize,
|
|
124
|
+
bodyText,
|
|
125
|
+
variant = {},
|
|
126
|
+
confirmButtonText,
|
|
127
|
+
confirmButtonVariant,
|
|
128
|
+
cancelButtonText,
|
|
129
|
+
cancelButtonType,
|
|
130
|
+
...rest
|
|
131
|
+
} = _ref5;
|
|
132
|
+
const viewport = (0, _ViewportProvider.useViewport)();
|
|
133
|
+
const themeTokens = (0, _ThemeProvider.useThemeTokens)('Modal', tokens, variant, {
|
|
134
|
+
viewport,
|
|
135
|
+
maxWidth
|
|
136
|
+
});
|
|
137
|
+
const modalRef = (0, _useScrollBlocking.default)(isOpen);
|
|
138
|
+
const modalBodyRef = _react.default.useRef(ref);
|
|
139
|
+
const modalContentRef = _react.default.useRef(null);
|
|
140
|
+
const {
|
|
141
|
+
closeIcon: CloseIconComponent
|
|
142
|
+
} = themeTokens;
|
|
143
|
+
const getCopy = (0, _utils.useCopy)({
|
|
144
|
+
dictionary: _dictionary.default,
|
|
145
|
+
copy
|
|
146
|
+
});
|
|
147
|
+
const closeLabel = getCopy('closeButton');
|
|
148
|
+
const handleClose = () => {
|
|
149
|
+
if (typeof onClose === 'function') onClose();
|
|
150
|
+
};
|
|
151
|
+
const handleKeyUp = event => {
|
|
152
|
+
if (event.key === 'Escape') onClose();
|
|
153
|
+
};
|
|
154
|
+
const manageFocus = _react.default.useCallback(event => {
|
|
155
|
+
if (event.key === 'Tab') {
|
|
156
|
+
const focusableElements = Array.from(modalBodyRef?.current?.querySelectorAll(`
|
|
157
|
+
a[href], button, textarea, input, select,
|
|
158
|
+
[tabindex]:not([tabindex="-1"]),
|
|
159
|
+
[contenteditable="true"]
|
|
160
|
+
`) || []);
|
|
161
|
+
const firstElement = focusableElements[0];
|
|
162
|
+
const lastElement = focusableElements[focusableElements.length - 1];
|
|
163
|
+
if (event.shiftKey && document.activeElement === firstElement) {
|
|
164
|
+
event.preventDefault();
|
|
165
|
+
lastElement.focus();
|
|
166
|
+
} else if (!event.shiftKey && document.activeElement === lastElement) {
|
|
167
|
+
event.preventDefault();
|
|
168
|
+
firstElement.focus();
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
}, [modalBodyRef]);
|
|
172
|
+
|
|
173
|
+
// Show the custom react node passed to `closedButton` or the default close button if `closeButton` is `undefined`.
|
|
174
|
+
// Hide the close button if `closeButton` is `null`.
|
|
175
|
+
const showCloseButton = closeButton !== null;
|
|
176
|
+
|
|
177
|
+
// These refs are used to manage focus in the web modal container
|
|
178
|
+
const focusTrapRef = _react.default.useRef(null);
|
|
179
|
+
const closeButtonRef = _react.default.useRef(null);
|
|
180
|
+
_react.default.useEffect(() => {
|
|
181
|
+
if (_Platform.default.OS === 'web') {
|
|
182
|
+
// Add an event listener to manage keydown and focus in the web modal container
|
|
183
|
+
document.addEventListener('keydown', manageFocus);
|
|
184
|
+
|
|
185
|
+
// Clean up the event listener
|
|
186
|
+
return () => document.removeEventListener('keydown', manageFocus);
|
|
187
|
+
}
|
|
188
|
+
return undefined;
|
|
189
|
+
}, [manageFocus]);
|
|
190
|
+
_react.default.useEffect(() => {
|
|
191
|
+
if (isOpen) {
|
|
192
|
+
modalContentRef?.current?.focus();
|
|
193
|
+
}
|
|
194
|
+
}, [isOpen, modalContentRef?.current?.focus]);
|
|
195
|
+
if (!isOpen) {
|
|
196
|
+
return null;
|
|
197
|
+
}
|
|
198
|
+
const content = /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
|
|
199
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_ScrollView.default, {
|
|
200
|
+
contentContainerStyle: [staticStyles.positioningContainer],
|
|
201
|
+
ref: modalRef,
|
|
202
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, {
|
|
203
|
+
style: [staticStyles.sizingContainer, selectContainerStyles(themeTokens)],
|
|
204
|
+
pointerEvents: "box-none" // don't capture backdrop press events
|
|
205
|
+
,
|
|
206
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_View.default, {
|
|
207
|
+
ref: modalBodyRef,
|
|
208
|
+
style: [staticStyles.modal, selectModalStyles(themeTokens)],
|
|
209
|
+
onKeyUp: handleKeyUp,
|
|
210
|
+
children: [showCloseButton && /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, {
|
|
211
|
+
style: [staticStyles.closeButtonContainer, selectCloseButtonContainerStyles(themeTokens)],
|
|
212
|
+
children: closeButton || /*#__PURE__*/(0, _jsxRuntime.jsx)(_IconButton.default, {
|
|
213
|
+
onPress: handleClose,
|
|
214
|
+
icon: CloseIconComponent,
|
|
215
|
+
accessibilityRole: "button",
|
|
216
|
+
accessibilityLabel: closeLabel,
|
|
217
|
+
ref: closeButtonRef
|
|
218
|
+
})
|
|
219
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ModalContent.default, {
|
|
220
|
+
tokens: tokens,
|
|
221
|
+
variant: variant,
|
|
222
|
+
onCancel: onCancel,
|
|
223
|
+
onConfirm: onConfirm,
|
|
224
|
+
heading: heading,
|
|
225
|
+
headingLevel: headingLevel,
|
|
226
|
+
subHeading: subHeading,
|
|
227
|
+
subHeadingSize: subHeadingSize,
|
|
228
|
+
bodyText: bodyText,
|
|
229
|
+
confirmButtonText: confirmButtonText,
|
|
230
|
+
confirmButtonVariant: confirmButtonVariant,
|
|
231
|
+
cancelButtonText: cancelButtonText,
|
|
232
|
+
cancelButtonType: cancelButtonType,
|
|
233
|
+
children: _Platform.default.OS !== 'web' ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScrollView.default, {
|
|
234
|
+
style: selectScrollViewStyles,
|
|
235
|
+
children: children
|
|
236
|
+
}) : children
|
|
237
|
+
})]
|
|
238
|
+
})
|
|
239
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_TouchableWithoutFeedback.default, {
|
|
240
|
+
onPress: handleClose,
|
|
241
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, {
|
|
242
|
+
style: [staticStyles.backdrop, selectBackdropStyles(themeTokens)]
|
|
243
|
+
})
|
|
244
|
+
})]
|
|
245
|
+
})
|
|
246
|
+
});
|
|
247
|
+
if (_Platform.default.OS === 'web') {
|
|
248
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_WebModal.default, {
|
|
249
|
+
...selectProps(rest),
|
|
250
|
+
ref: modalContentRef,
|
|
251
|
+
children: [content, /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, {
|
|
252
|
+
accessibilityRole: "button",
|
|
253
|
+
ref: focusTrapRef
|
|
254
|
+
})]
|
|
255
|
+
});
|
|
256
|
+
}
|
|
257
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Modal.default, {
|
|
258
|
+
transparent: true,
|
|
259
|
+
...selectProps(rest),
|
|
260
|
+
children: content
|
|
261
|
+
});
|
|
262
|
+
});
|
|
263
|
+
Modal.displayName = 'Modal';
|
|
264
|
+
Modal.propTypes = {
|
|
265
|
+
...selectedSystemPropTypes,
|
|
266
|
+
children: _propTypes.default.oneOfType([_propTypes.default.node, _propTypes.default.arrayOf(_propTypes.default.node)]),
|
|
267
|
+
/**
|
|
268
|
+
* To define the locale of the copy
|
|
269
|
+
*/
|
|
270
|
+
copy: _utils.copyPropTypes,
|
|
271
|
+
/**
|
|
272
|
+
* Setting this to `true` will open the `Modal`
|
|
273
|
+
*/
|
|
274
|
+
isOpen: _propTypes.default.bool,
|
|
275
|
+
/**
|
|
276
|
+
* This function is triggered when the `Modal` is closed
|
|
277
|
+
*/
|
|
278
|
+
onClose: _propTypes.default.func,
|
|
279
|
+
/**
|
|
280
|
+
* `max-width` is applied to the `Modal` container
|
|
281
|
+
*/
|
|
282
|
+
maxWidth: _propTypes.default.bool,
|
|
283
|
+
tokens: (0, _utils.getTokensPropType)('Modal'),
|
|
284
|
+
variant: _utils.variantProp.propType,
|
|
285
|
+
/**
|
|
286
|
+
* Pass a react node to override the default close button or pass `null` to hide the close button.
|
|
287
|
+
*/
|
|
288
|
+
closeButton: _propTypes.default.node,
|
|
289
|
+
/**
|
|
290
|
+
* Receive a string to set the heading of the modal.
|
|
291
|
+
*/
|
|
292
|
+
heading: _propTypes.default.string,
|
|
293
|
+
/**
|
|
294
|
+
* Receive h3 or h4 to define the level of the heading.
|
|
295
|
+
*/
|
|
296
|
+
headingLevel: _propTypes.default.oneOf(['h3', 'h4']),
|
|
297
|
+
/**
|
|
298
|
+
* Receive a string to set the sub heading of the modal.
|
|
299
|
+
*/
|
|
300
|
+
subHeading: _propTypes.default.string,
|
|
301
|
+
/**
|
|
302
|
+
* Receive small, medium or large to set the size of the sub heading.
|
|
303
|
+
*/
|
|
304
|
+
subHeadingSize: _propTypes.default.oneOf(['small', 'medium', 'large']),
|
|
305
|
+
/**
|
|
306
|
+
* Receive a string to set the bodyText of the modal.
|
|
307
|
+
*/
|
|
308
|
+
bodyText: _propTypes.default.string,
|
|
309
|
+
/**
|
|
310
|
+
* Receive a string text for the confirm button.
|
|
311
|
+
*/
|
|
312
|
+
confirmButtonText: _propTypes.default.string,
|
|
313
|
+
/**
|
|
314
|
+
* Receives a variant of button for the confirm button.
|
|
315
|
+
*/
|
|
316
|
+
confirmButtonVariant: _propTypes.default.object,
|
|
317
|
+
/**
|
|
318
|
+
* Receive a function for the onConfirm event in the confirm button.
|
|
319
|
+
*/
|
|
320
|
+
onConfirm: _propTypes.default.func,
|
|
321
|
+
/**
|
|
322
|
+
* Receive a string text for the cancel button.
|
|
323
|
+
*/
|
|
324
|
+
cancelButtonText: _propTypes.default.string,
|
|
325
|
+
/**
|
|
326
|
+
* Receives a variant of button for the cancel button.
|
|
327
|
+
*/
|
|
328
|
+
cancelButtonType: _propTypes.default.elementType,
|
|
329
|
+
// TODO: figure out a way of passing an icon to the TextButton
|
|
330
|
+
/**
|
|
331
|
+
* Receive a function for the onCancel event in the cancel button.
|
|
332
|
+
*/
|
|
333
|
+
onCancel: _propTypes.default.func
|
|
334
|
+
};
|
|
335
|
+
var _default = exports.default = Modal;
|
|
336
|
+
const staticStyles = _StyleSheet.default.create({
|
|
337
|
+
backdrop: {
|
|
338
|
+
position: 'absolute',
|
|
339
|
+
top: 0,
|
|
340
|
+
left: 0,
|
|
341
|
+
right: 0,
|
|
342
|
+
bottom: 0,
|
|
343
|
+
zIndex: -1,
|
|
344
|
+
..._Platform.default.select({
|
|
345
|
+
web: {
|
|
346
|
+
cursor: 'pointer'
|
|
347
|
+
}
|
|
348
|
+
})
|
|
349
|
+
},
|
|
350
|
+
positioningContainer: {
|
|
351
|
+
flexBasis: '100%',
|
|
352
|
+
alignItems: 'center',
|
|
353
|
+
justifyContent: 'center'
|
|
354
|
+
},
|
|
355
|
+
sizingContainer: {
|
|
356
|
+
maxHeight: '100%',
|
|
357
|
+
// so that the container can expand up to the full viewport height
|
|
358
|
+
width: '100%' // ensure that the modal actually expands to the set maxWidth
|
|
359
|
+
},
|
|
360
|
+
modal: {
|
|
361
|
+
maxHeight: '100%',
|
|
362
|
+
// so that the modal can expand vertically up to the sizing container's height (exclusive of its vertical padding)
|
|
363
|
+
..._Platform.default.select({
|
|
364
|
+
web: {
|
|
365
|
+
overflow: 'auto'
|
|
366
|
+
}
|
|
367
|
+
})
|
|
368
|
+
},
|
|
369
|
+
closeButtonContainer: {
|
|
370
|
+
position: 'absolute',
|
|
371
|
+
top: 0,
|
|
372
|
+
right: 0,
|
|
373
|
+
zIndex: 1
|
|
374
|
+
}
|
|
375
|
+
});
|