@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,151 @@
|
|
|
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 _Animated = _interopRequireDefault(require("react-native-web/dist/cjs/exports/Animated"));
|
|
9
|
+
var _Easing = _interopRequireDefault(require("react-native-web/dist/cjs/exports/Easing"));
|
|
10
|
+
var _StyleSheet = _interopRequireDefault(require("react-native-web/dist/cjs/exports/StyleSheet"));
|
|
11
|
+
var _View = _interopRequireDefault(require("react-native-web/dist/cjs/exports/View"));
|
|
12
|
+
var _shared = require("./shared");
|
|
13
|
+
var _A11yInfoProvider = require("../A11yInfoProvider");
|
|
14
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
16
|
+
const ea = _shared.MIN_EMPTY_ANGLE / 2;
|
|
17
|
+
const sa = _shared.MIN_STROKE_ANGLE / 2;
|
|
18
|
+
const Spinner = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
|
|
19
|
+
let {
|
|
20
|
+
size,
|
|
21
|
+
color,
|
|
22
|
+
thickness,
|
|
23
|
+
label,
|
|
24
|
+
isStatic = false
|
|
25
|
+
} = _ref;
|
|
26
|
+
const {
|
|
27
|
+
current: timer
|
|
28
|
+
} = _react.default.useRef(new _Animated.default.Value(0));
|
|
29
|
+
const {
|
|
30
|
+
reduceMotionEnabled
|
|
31
|
+
} = (0, _A11yInfoProvider.useA11yInfo)();
|
|
32
|
+
const reduceMotion = reduceMotionEnabled || isStatic;
|
|
33
|
+
_react.default.useLayoutEffect(() => {
|
|
34
|
+
const loop = _Animated.default.timing(timer, {
|
|
35
|
+
duration: _shared.DURATION,
|
|
36
|
+
easing: _Easing.default.linear,
|
|
37
|
+
// Animated.loop does not work if useNativeDriver is true on web
|
|
38
|
+
useNativeDriver: true,
|
|
39
|
+
toValue: 1,
|
|
40
|
+
isInteraction: false
|
|
41
|
+
});
|
|
42
|
+
if (!reduceMotion) _Animated.default.loop(loop).start();else loop.stop();
|
|
43
|
+
}, [timer, reduceMotion]);
|
|
44
|
+
const frames = 60 * _shared.DURATION / 1000;
|
|
45
|
+
const easing = _Easing.default.bezier(..._shared.BEZIER);
|
|
46
|
+
const containerStyle = {
|
|
47
|
+
width: size,
|
|
48
|
+
height: size / (reduceMotion ? 1.5 : 2),
|
|
49
|
+
overflow: 'hidden'
|
|
50
|
+
};
|
|
51
|
+
const animationFrequency = reduceMotion ? [0] : [0, 1];
|
|
52
|
+
|
|
53
|
+
// Credit to https://github.com/n4kz/react-native-indicators and https://github.com/callstack/react-native-paper for this
|
|
54
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, {
|
|
55
|
+
ref: ref,
|
|
56
|
+
style: [styles.container],
|
|
57
|
+
accessible: true,
|
|
58
|
+
accessibilityLabel: label,
|
|
59
|
+
accessibilityRole: "progressbar",
|
|
60
|
+
accessibilityState: {
|
|
61
|
+
busy: true
|
|
62
|
+
},
|
|
63
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Animated.default.View, {
|
|
64
|
+
style: [{
|
|
65
|
+
width: size,
|
|
66
|
+
height: size
|
|
67
|
+
}],
|
|
68
|
+
collapsable: false,
|
|
69
|
+
children: animationFrequency.map(index => {
|
|
70
|
+
const inputRange = Array.from(new Array(frames), (_, frameIndex) => frameIndex / (frames - 1));
|
|
71
|
+
const outputRange = Array.from(new Array(frames), (_, frameIndex) => {
|
|
72
|
+
let progress = 2 * frameIndex / (frames - 1);
|
|
73
|
+
const rotation = index ? +(360 - sa) : -(180 - sa);
|
|
74
|
+
if (progress > 1.0) {
|
|
75
|
+
progress = 2.0 - progress;
|
|
76
|
+
}
|
|
77
|
+
const direction = index ? -1 : +1;
|
|
78
|
+
return `${direction * (180 - (sa + ea)) * easing(progress) + rotation}deg`;
|
|
79
|
+
});
|
|
80
|
+
const layerStyle = {
|
|
81
|
+
width: size,
|
|
82
|
+
height: size
|
|
83
|
+
};
|
|
84
|
+
const viewportStyle = {
|
|
85
|
+
width: size,
|
|
86
|
+
height: size
|
|
87
|
+
};
|
|
88
|
+
if (!reduceMotion) {
|
|
89
|
+
layerStyle.transform = [{
|
|
90
|
+
rotate: timer.interpolate({
|
|
91
|
+
inputRange: [0, 1],
|
|
92
|
+
outputRange: [`${0 + ea + sa}deg`, `${2 * 360 + ea + sa}deg`]
|
|
93
|
+
})
|
|
94
|
+
}];
|
|
95
|
+
viewportStyle.transform = [{
|
|
96
|
+
translateY: index ? -size / 2 : 0
|
|
97
|
+
}, {
|
|
98
|
+
rotate: timer.interpolate({
|
|
99
|
+
inputRange,
|
|
100
|
+
outputRange
|
|
101
|
+
})
|
|
102
|
+
}];
|
|
103
|
+
}
|
|
104
|
+
const offsetStyle = index ? {
|
|
105
|
+
top: size / 2
|
|
106
|
+
} : null;
|
|
107
|
+
const lineStyle = {
|
|
108
|
+
width: size,
|
|
109
|
+
height: size,
|
|
110
|
+
borderColor: color,
|
|
111
|
+
borderWidth: thickness,
|
|
112
|
+
borderRadius: size / 2
|
|
113
|
+
};
|
|
114
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Animated.default.View, {
|
|
115
|
+
style: [styles.layer],
|
|
116
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Animated.default.View, {
|
|
117
|
+
style: layerStyle,
|
|
118
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Animated.default.View, {
|
|
119
|
+
style: [containerStyle, offsetStyle],
|
|
120
|
+
collapsable: false,
|
|
121
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Animated.default.View, {
|
|
122
|
+
style: viewportStyle,
|
|
123
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Animated.default.View, {
|
|
124
|
+
style: containerStyle,
|
|
125
|
+
collapsable: false,
|
|
126
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Animated.default.View, {
|
|
127
|
+
style: lineStyle
|
|
128
|
+
})
|
|
129
|
+
})
|
|
130
|
+
})
|
|
131
|
+
})
|
|
132
|
+
})
|
|
133
|
+
}, index);
|
|
134
|
+
})
|
|
135
|
+
})
|
|
136
|
+
});
|
|
137
|
+
});
|
|
138
|
+
Spinner.displayName = 'Spinner';
|
|
139
|
+
Spinner.propTypes = _shared.propTypes;
|
|
140
|
+
const styles = _StyleSheet.default.create({
|
|
141
|
+
container: {
|
|
142
|
+
flexGrow: 0,
|
|
143
|
+
flexShrink: 0
|
|
144
|
+
},
|
|
145
|
+
layer: {
|
|
146
|
+
..._StyleSheet.default.absoluteFillObject,
|
|
147
|
+
justifyContent: 'center',
|
|
148
|
+
alignItems: 'center'
|
|
149
|
+
}
|
|
150
|
+
});
|
|
151
|
+
var _default = exports.default = Spinner;
|
|
@@ -0,0 +1,51 @@
|
|
|
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 _ThemeProvider = require("../ThemeProvider");
|
|
10
|
+
var _props = require("../utils/props");
|
|
11
|
+
var _Spinner = _interopRequireDefault(require("./Spinner"));
|
|
12
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
14
|
+
/**
|
|
15
|
+
* `ActivityIndicator` renders a visual loading state.
|
|
16
|
+
* It does not handle positioning or layout of that visual loader.
|
|
17
|
+
*/const ActivityIndicator = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
|
|
18
|
+
let {
|
|
19
|
+
variant,
|
|
20
|
+
tokens,
|
|
21
|
+
label,
|
|
22
|
+
isStatic = false
|
|
23
|
+
} = _ref;
|
|
24
|
+
const {
|
|
25
|
+
size,
|
|
26
|
+
color,
|
|
27
|
+
thickness
|
|
28
|
+
} = (0, _ThemeProvider.useThemeTokens)('ActivityIndicator', tokens, variant);
|
|
29
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Spinner.default, {
|
|
30
|
+
ref: ref,
|
|
31
|
+
size: size,
|
|
32
|
+
color: color,
|
|
33
|
+
thickness: thickness,
|
|
34
|
+
label: label,
|
|
35
|
+
isStatic: isStatic
|
|
36
|
+
});
|
|
37
|
+
});
|
|
38
|
+
ActivityIndicator.displayName = 'ActivityIndicator';
|
|
39
|
+
ActivityIndicator.propTypes = {
|
|
40
|
+
variant: _props.variantProp.propType,
|
|
41
|
+
tokens: (0, _props.getTokensPropType)('ActivityIndicator'),
|
|
42
|
+
/**
|
|
43
|
+
* A visually hidden accessible label describing the action taking place
|
|
44
|
+
*/
|
|
45
|
+
label: _propTypes.default.string.isRequired,
|
|
46
|
+
/**
|
|
47
|
+
* If true, it should render a static spinner
|
|
48
|
+
*/
|
|
49
|
+
isStatic: _propTypes.default.bool
|
|
50
|
+
};
|
|
51
|
+
var _default = exports.default = ActivityIndicator;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.propTypes = exports.MIN_STROKE_ANGLE = exports.MIN_EMPTY_ANGLE = exports.DURATION = exports.BEZIER = void 0;
|
|
7
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
8
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
|
+
// these could be specified by the theme
|
|
10
|
+
const DURATION = exports.DURATION = 1800;
|
|
11
|
+
const MIN_EMPTY_ANGLE = exports.MIN_EMPTY_ANGLE = 60;
|
|
12
|
+
const MIN_STROKE_ANGLE = exports.MIN_STROKE_ANGLE = 30;
|
|
13
|
+
const BEZIER = exports.BEZIER = [0.42, 0.0, 0.58, 1.0];
|
|
14
|
+
const propTypes = exports.propTypes = {
|
|
15
|
+
color: _propTypes.default.string.isRequired,
|
|
16
|
+
label: _propTypes.default.string.isRequired,
|
|
17
|
+
size: _propTypes.default.number.isRequired,
|
|
18
|
+
thickness: _propTypes.default.number.isRequired,
|
|
19
|
+
isStatic: _propTypes.default.bool
|
|
20
|
+
};
|
|
@@ -0,0 +1,480 @@
|
|
|
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 _Dimensions = _interopRequireDefault(require("react-native-web/dist/cjs/exports/Dimensions"));
|
|
10
|
+
var _Platform = _interopRequireDefault(require("react-native-web/dist/cjs/exports/Platform"));
|
|
11
|
+
var _View = _interopRequireDefault(require("react-native-web/dist/cjs/exports/View"));
|
|
12
|
+
var _StyleSheet = _interopRequireDefault(require("react-native-web/dist/cjs/exports/StyleSheet"));
|
|
13
|
+
var _lodash = _interopRequireDefault(require("lodash.throttle"));
|
|
14
|
+
var _stringPrototype = _interopRequireDefault(require("string.prototype.matchall"));
|
|
15
|
+
var _utils = require("../utils");
|
|
16
|
+
var _ThemeProvider = require("../ThemeProvider");
|
|
17
|
+
var _Listbox = _interopRequireDefault(require("../Listbox"));
|
|
18
|
+
var _Typography = _interopRequireDefault(require("../Typography"));
|
|
19
|
+
var _TextInput = require("../TextInput");
|
|
20
|
+
var _InputSupports = _interopRequireDefault(require("../InputSupports"));
|
|
21
|
+
var _Loading = _interopRequireDefault(require("./Loading"));
|
|
22
|
+
var _Suggestions = _interopRequireDefault(require("./Suggestions"));
|
|
23
|
+
var _constants = require("./constants");
|
|
24
|
+
var _dictionary = _interopRequireDefault(require("./dictionary"));
|
|
25
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
26
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
27
|
+
const staticStyles = _StyleSheet.default.create({
|
|
28
|
+
container: {
|
|
29
|
+
zIndex: 100,
|
|
30
|
+
flexDirection: 'column',
|
|
31
|
+
justifyContent: 'flex-start',
|
|
32
|
+
flexGrow: 0,
|
|
33
|
+
flexShrink: 0
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
const [selectProps, selectedSystemPropTypes] = (0, _utils.selectSystemProps)([_utils.htmlAttrs, _utils.inputSupportsProps, _utils.textInputHandlerProps, _utils.textInputProps]);
|
|
37
|
+
|
|
38
|
+
// Returns JSX to display a bold string `str` with unbolded occurrences of the
|
|
39
|
+
// `substring` based in the array of `matchIndexes` provided
|
|
40
|
+
const highlightAllMatches = function (str) {
|
|
41
|
+
let substring = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
|
42
|
+
let matchIndexes = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
|
|
43
|
+
let resultsTextColor = arguments.length > 3 ? arguments[3] : undefined;
|
|
44
|
+
return (
|
|
45
|
+
/*#__PURE__*/
|
|
46
|
+
// Wrapping all in bold
|
|
47
|
+
(0, _jsxRuntime.jsx)(_Typography.default, {
|
|
48
|
+
variant: {
|
|
49
|
+
bold: false
|
|
50
|
+
},
|
|
51
|
+
tokens: {
|
|
52
|
+
color: resultsTextColor
|
|
53
|
+
},
|
|
54
|
+
children: matchIndexes.reduce((acc, matchIndex, index) => [...acc,
|
|
55
|
+
// Add a piece of the string up to the first occurrence of the substring
|
|
56
|
+
index === 0 && (str.slice(0, matchIndex) ?? ''),
|
|
57
|
+
/*#__PURE__*/
|
|
58
|
+
// Unbold the occurrence of the substring (while keeping the original casing)
|
|
59
|
+
(0, _jsxRuntime.jsx)(_Typography.default, {
|
|
60
|
+
variant: {
|
|
61
|
+
bold: true
|
|
62
|
+
},
|
|
63
|
+
tokens: {
|
|
64
|
+
color: resultsTextColor
|
|
65
|
+
},
|
|
66
|
+
children: str.slice(matchIndex, matchIndex + substring.length)
|
|
67
|
+
}, matchIndex),
|
|
68
|
+
// Add the rest of the string until the next occurrence or the end of it
|
|
69
|
+
str.slice(matchIndex + substring.length, matchIndexes[index + 1] ?? str.length)], [])
|
|
70
|
+
})
|
|
71
|
+
);
|
|
72
|
+
};
|
|
73
|
+
const highlight = function () {
|
|
74
|
+
let items = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
75
|
+
let text = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
|
76
|
+
let color = arguments.length > 2 ? arguments[2] : undefined;
|
|
77
|
+
return items.reduce((acc, item) => {
|
|
78
|
+
const matches = Array.from((0, _stringPrototype.default)(item.label.toLowerCase(), text.toLowerCase().replace(/[/\-\\^$*+?.()|[\]{}]/g, '\\$&')))?.map(_ref => {
|
|
79
|
+
let {
|
|
80
|
+
index
|
|
81
|
+
} = _ref;
|
|
82
|
+
return index;
|
|
83
|
+
});
|
|
84
|
+
if (matches?.length) {
|
|
85
|
+
return [...acc, {
|
|
86
|
+
...item,
|
|
87
|
+
label: highlightAllMatches(item.label, text, matches, color)
|
|
88
|
+
}];
|
|
89
|
+
}
|
|
90
|
+
return [...acc, item];
|
|
91
|
+
}, []);
|
|
92
|
+
};
|
|
93
|
+
const Autocomplete = /*#__PURE__*/_react.default.forwardRef((_ref2, ref) => {
|
|
94
|
+
let {
|
|
95
|
+
children,
|
|
96
|
+
copy = 'en',
|
|
97
|
+
fullWidth = true,
|
|
98
|
+
initialItems,
|
|
99
|
+
initialValue,
|
|
100
|
+
isLoading = false,
|
|
101
|
+
items,
|
|
102
|
+
maxSuggestions = _constants.DEFAULT_MAX_SUGGESTIONS,
|
|
103
|
+
minToSuggestion = _constants.DEFAULT_MIN_TO_SUGGESTION,
|
|
104
|
+
noResults,
|
|
105
|
+
onChange,
|
|
106
|
+
onClear,
|
|
107
|
+
onSelect,
|
|
108
|
+
readOnly,
|
|
109
|
+
validation,
|
|
110
|
+
value,
|
|
111
|
+
helpText = '',
|
|
112
|
+
loadingLabel,
|
|
113
|
+
tokens,
|
|
114
|
+
...rest
|
|
115
|
+
} = _ref2;
|
|
116
|
+
const {
|
|
117
|
+
color: resultsTextColor,
|
|
118
|
+
...restOfTokens
|
|
119
|
+
} = (0, _ThemeProvider.useThemeTokens)('Autocomplete', tokens, {
|
|
120
|
+
focus: true
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
// The wrapped input is mostly responsible for controlled vs uncontrolled handling,
|
|
124
|
+
// but we also need to adjust suggestions based on the mode:
|
|
125
|
+
// - in controlled mode we rely entirely on the suggestions passed via the `items` prop,
|
|
126
|
+
// - in uncontrolled mode we filter the suggestions ourselves based on the `initialItems`
|
|
127
|
+
// prop and the text entered
|
|
128
|
+
const isControlled = value !== undefined;
|
|
129
|
+
|
|
130
|
+
// We need to store current items for uncontrolled usage
|
|
131
|
+
const [currentItems, setCurrentItems] = _react.default.useState(initialItems);
|
|
132
|
+
const [otherItems, setOtherItems] = _react.default.useState(items);
|
|
133
|
+
|
|
134
|
+
// We need to store the current value as well to be able to highlight it
|
|
135
|
+
const [currentValue, setCurrentValue] = _react.default.useState(value ?? initialValue);
|
|
136
|
+
const inputTokens = {
|
|
137
|
+
paddingLeft: _constants.INPUT_LEFT_PADDING
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
// Setting up the overlay
|
|
141
|
+
const openOverlayRef = _react.default.useRef();
|
|
142
|
+
const [isExpanded, setIsExpanded] = _react.default.useState((value ?? initialValue)?.length >= minToSuggestion);
|
|
143
|
+
const [isFocused, setisFocused] = _react.default.useState(false);
|
|
144
|
+
const [sourceLayout, setSourceLayout] = _react.default.useState(null);
|
|
145
|
+
|
|
146
|
+
// When it's nested, selected value
|
|
147
|
+
const [nestedSelectedValue, setNestedSelectedValue] = _react.default.useState(null);
|
|
148
|
+
const [isInputVisible, setIsInputVisible] = _react.default.useState(true);
|
|
149
|
+
const {
|
|
150
|
+
supportsProps,
|
|
151
|
+
...selectedProps
|
|
152
|
+
} = selectProps(rest);
|
|
153
|
+
const {
|
|
154
|
+
hint,
|
|
155
|
+
label: inputLabel
|
|
156
|
+
} = supportsProps;
|
|
157
|
+
const hintExpansionEnabled = isFocused && helpText && !currentValue;
|
|
158
|
+
const {
|
|
159
|
+
overlaidPosition,
|
|
160
|
+
sourceRef: inputRef,
|
|
161
|
+
// targetRef,
|
|
162
|
+
onTargetLayout,
|
|
163
|
+
isReady
|
|
164
|
+
} = (0, _utils.useOverlaidPosition)({
|
|
165
|
+
isShown: isExpanded || hintExpansionEnabled,
|
|
166
|
+
offsets: {
|
|
167
|
+
vertical: _Platform.default.OS !== 'web' && (hint || inputLabel) ? 28 : 4
|
|
168
|
+
}
|
|
169
|
+
});
|
|
170
|
+
const targetRef = _react.default.useRef(null);
|
|
171
|
+
// We limit the number of suggestions displayed to avoid huge lists
|
|
172
|
+
// TODO: add a way to make the `Listbox` occupy fixed height and be scrollable
|
|
173
|
+
// within that height, which will unlock similar behaviour for `AutoComplete` as well
|
|
174
|
+
const itemsToSuggest = function () {
|
|
175
|
+
let data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
176
|
+
return maxSuggestions ? data.slice(0, maxSuggestions) : [...data];
|
|
177
|
+
};
|
|
178
|
+
const getCopy = (0, _utils.useCopy)({
|
|
179
|
+
dictionary: _dictionary.default,
|
|
180
|
+
copy
|
|
181
|
+
});
|
|
182
|
+
// Tracking input width changes to resize the listbox overlay accordingly
|
|
183
|
+
const [inputWidth, setInputWidth] = _react.default.useState();
|
|
184
|
+
(0, _utils.useSafeLayoutEffect)(() => {
|
|
185
|
+
if (_Platform.default.OS === 'web') {
|
|
186
|
+
const updateInputWidth = () => {
|
|
187
|
+
setInputWidth(inputRef?.current?.clientWidth + 4); // adding back all the input borders / outlines
|
|
188
|
+
setIsExpanded(false); // close the suggestions while the input is changing
|
|
189
|
+
};
|
|
190
|
+
const throttledUpdateInputWidth = (0, _lodash.default)(updateInputWidth, 100, {
|
|
191
|
+
leading: false
|
|
192
|
+
});
|
|
193
|
+
throttledUpdateInputWidth();
|
|
194
|
+
_Dimensions.default.addEventListener('change', throttledUpdateInputWidth);
|
|
195
|
+
return () => {
|
|
196
|
+
_Dimensions.default.removeEventListener('change', throttledUpdateInputWidth);
|
|
197
|
+
};
|
|
198
|
+
}
|
|
199
|
+
setInputWidth(sourceLayout?.width);
|
|
200
|
+
return () => {};
|
|
201
|
+
}, [inputRef, sourceLayout]);
|
|
202
|
+
const handleMeasure = event => {
|
|
203
|
+
onTargetLayout(event);
|
|
204
|
+
if (_Platform.default.OS !== 'web') {
|
|
205
|
+
inputRef?.current?.measureInWindow((x, y, width) => {
|
|
206
|
+
setInputWidth(width);
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
};
|
|
210
|
+
const handleChange = newValue => {
|
|
211
|
+
onChange?.(newValue || '');
|
|
212
|
+
setCurrentValue(newValue);
|
|
213
|
+
setIsExpanded(newValue?.length >= minToSuggestion);
|
|
214
|
+
if (!isControlled && initialItems !== undefined) {
|
|
215
|
+
setCurrentItems(initialItems.filter(_ref3 => {
|
|
216
|
+
let {
|
|
217
|
+
label
|
|
218
|
+
} = _ref3;
|
|
219
|
+
return label?.toLowerCase()?.includes(newValue?.toLowerCase());
|
|
220
|
+
}));
|
|
221
|
+
}
|
|
222
|
+
};
|
|
223
|
+
const handleSelect = selectedId => {
|
|
224
|
+
onSelect?.(selectedId);
|
|
225
|
+
const {
|
|
226
|
+
label: newValue,
|
|
227
|
+
nested,
|
|
228
|
+
title
|
|
229
|
+
} = (isControlled ? items : currentItems)?.find(_ref4 => {
|
|
230
|
+
let {
|
|
231
|
+
id
|
|
232
|
+
} = _ref4;
|
|
233
|
+
return id === selectedId;
|
|
234
|
+
});
|
|
235
|
+
if (title) return;
|
|
236
|
+
if (!nested) {
|
|
237
|
+
setNestedSelectedValue(null);
|
|
238
|
+
onChange?.(newValue);
|
|
239
|
+
setIsExpanded(false);
|
|
240
|
+
}
|
|
241
|
+
setCurrentValue(newValue);
|
|
242
|
+
if (!isControlled && inputRef?.current) inputRef.current.value = newValue;
|
|
243
|
+
if (nested) setNestedSelectedValue(newValue);
|
|
244
|
+
inputRef.current.focus();
|
|
245
|
+
};
|
|
246
|
+
|
|
247
|
+
/**
|
|
248
|
+
* When an item that is nested equal "true" is selected this useEffect is executed.
|
|
249
|
+
* The nested item is added to the item list at the top, the if validates it doesn't exist
|
|
250
|
+
* within the list, if doesn't exist the nested item is added to the top of the list,
|
|
251
|
+
* the nested item is added with an id equal "0"
|
|
252
|
+
*/
|
|
253
|
+
_react.default.useEffect(() => {
|
|
254
|
+
if (nestedSelectedValue && !items.find(item => item.id === 0)) {
|
|
255
|
+
const tmpItems = [...items];
|
|
256
|
+
tmpItems.unshift({
|
|
257
|
+
label: nestedSelectedValue,
|
|
258
|
+
title: true,
|
|
259
|
+
id: 0
|
|
260
|
+
});
|
|
261
|
+
setOtherItems(tmpItems.map(item => {
|
|
262
|
+
return {
|
|
263
|
+
...item,
|
|
264
|
+
nestedChild: item.id !== 0
|
|
265
|
+
};
|
|
266
|
+
}));
|
|
267
|
+
}
|
|
268
|
+
}, [nestedSelectedValue, items]);
|
|
269
|
+
_react.default.useEffect(() => {
|
|
270
|
+
if (_Platform.default.OS === 'ios' || _Platform.default.OS === 'android') {
|
|
271
|
+
return undefined;
|
|
272
|
+
}
|
|
273
|
+
const observer = new IntersectionObserver(entries => {
|
|
274
|
+
const [entry] = entries;
|
|
275
|
+
setIsInputVisible(entry.isIntersecting);
|
|
276
|
+
if (!entry.isIntersecting) {
|
|
277
|
+
setIsExpanded(false);
|
|
278
|
+
}
|
|
279
|
+
});
|
|
280
|
+
const currentInputRef = inputRef.current;
|
|
281
|
+
if (currentInputRef) {
|
|
282
|
+
observer.observe(currentInputRef);
|
|
283
|
+
}
|
|
284
|
+
return () => {
|
|
285
|
+
if (currentInputRef) {
|
|
286
|
+
observer.unobserve(currentInputRef);
|
|
287
|
+
}
|
|
288
|
+
};
|
|
289
|
+
}, [inputRef]);
|
|
290
|
+
const handleClose = event => {
|
|
291
|
+
if (event.type === 'keydown' && (event.key === 'Escape' || event.key === '27') || event.type === 'click' && !openOverlayRef?.current?.contains(event.target) || event.type === 'touchstart' && openOverlayRef?.current && event.touches[0].target && !openOverlayRef?.current?.contains(event.touches[0].target)) {
|
|
292
|
+
setIsExpanded(false);
|
|
293
|
+
setNestedSelectedValue(null);
|
|
294
|
+
} else if (event.type === 'keydown' && (event.key === 'ArrowDown' || event.key === 'Tab') && isExpanded && !isLoading && targetRef?.current) {
|
|
295
|
+
event.preventDefault();
|
|
296
|
+
targetRef.current.focus();
|
|
297
|
+
}
|
|
298
|
+
};
|
|
299
|
+
const itemsToShow = currentValue ? itemsToSuggest(highlight(isControlled ? items : currentItems, currentValue, resultsTextColor)) : [];
|
|
300
|
+
const helpTextToShow = isFocused && !currentValue ? helpText : noResults ?? getCopy('noResults');
|
|
301
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_View.default, {
|
|
302
|
+
style: staticStyles.container,
|
|
303
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_InputSupports.default, {
|
|
304
|
+
...supportsProps,
|
|
305
|
+
accessibilityAutoComplete: "list",
|
|
306
|
+
accessibilityControls: "autocomplete",
|
|
307
|
+
accessibilityExpanded: isExpanded,
|
|
308
|
+
accessibilityRole: "combobox",
|
|
309
|
+
...selectedProps,
|
|
310
|
+
validation: validation,
|
|
311
|
+
ref: ref,
|
|
312
|
+
children: _ref5 => {
|
|
313
|
+
let {
|
|
314
|
+
inputId,
|
|
315
|
+
...props
|
|
316
|
+
} = _ref5;
|
|
317
|
+
if (typeof children === 'function') return children({
|
|
318
|
+
inputId,
|
|
319
|
+
inputRef,
|
|
320
|
+
onChange: handleChange,
|
|
321
|
+
onKeyPress: handleClose,
|
|
322
|
+
readOnly,
|
|
323
|
+
tokens: inputTokens,
|
|
324
|
+
...selectedProps,
|
|
325
|
+
...props,
|
|
326
|
+
...(isControlled ? {
|
|
327
|
+
value
|
|
328
|
+
} : {
|
|
329
|
+
initialValue
|
|
330
|
+
})
|
|
331
|
+
});
|
|
332
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_TextInput.TextInput, {
|
|
333
|
+
onChange: handleChange,
|
|
334
|
+
onFocus: () => {
|
|
335
|
+
setisFocused(true);
|
|
336
|
+
},
|
|
337
|
+
onBlur: () => {
|
|
338
|
+
setisFocused(false);
|
|
339
|
+
},
|
|
340
|
+
onClear: onClear,
|
|
341
|
+
onKeyPress: handleClose,
|
|
342
|
+
readOnly: readOnly,
|
|
343
|
+
ref: inputRef,
|
|
344
|
+
...(_Platform.default.OS !== 'web' ? {
|
|
345
|
+
onLayout: event => {
|
|
346
|
+
setSourceLayout(event.nativeEvent.layout);
|
|
347
|
+
const {
|
|
348
|
+
y,
|
|
349
|
+
height
|
|
350
|
+
} = event.nativeEvent.layout;
|
|
351
|
+
if (y >= 0 && height > 0) {
|
|
352
|
+
setIsInputVisible(true);
|
|
353
|
+
} else {
|
|
354
|
+
setIsInputVisible(false);
|
|
355
|
+
setIsExpanded(false);
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
} : {}),
|
|
359
|
+
tokens: inputTokens,
|
|
360
|
+
validation: validation,
|
|
361
|
+
...selectedProps,
|
|
362
|
+
...props,
|
|
363
|
+
...(isControlled ? {
|
|
364
|
+
value
|
|
365
|
+
} : {
|
|
366
|
+
initialValue
|
|
367
|
+
})
|
|
368
|
+
});
|
|
369
|
+
}
|
|
370
|
+
}), (isExpanded || hintExpansionEnabled) && isInputVisible && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
371
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Listbox.default.Overlay, {
|
|
372
|
+
overlaidPosition: overlaidPosition,
|
|
373
|
+
isReady: isReady,
|
|
374
|
+
minWidth: fullWidth ? inputWidth : _constants.MIN_LISTBOX_WIDTH,
|
|
375
|
+
maxWidth: inputWidth,
|
|
376
|
+
onLayout: handleMeasure,
|
|
377
|
+
tokens: restOfTokens,
|
|
378
|
+
ref: openOverlayRef,
|
|
379
|
+
children: isLoading ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Loading.default, {
|
|
380
|
+
label: loadingLabel ?? getCopy('loading')
|
|
381
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_Suggestions.default, {
|
|
382
|
+
hasResults: getCopy('hasResults'),
|
|
383
|
+
id: "autocomplete",
|
|
384
|
+
items: nestedSelectedValue ? itemsToSuggest(highlight(otherItems, nestedSelectedValue, resultsTextColor)) : itemsToShow,
|
|
385
|
+
noResults: helpTextToShow,
|
|
386
|
+
onClose: handleClose,
|
|
387
|
+
onSelect: handleSelect,
|
|
388
|
+
parentRef: inputRef,
|
|
389
|
+
ref: targetRef
|
|
390
|
+
})
|
|
391
|
+
}), targetRef?.current && /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default
|
|
392
|
+
// This catches and shifts focus to other interactive elements.
|
|
393
|
+
, {
|
|
394
|
+
onFocus: () => targetRef?.current?.focus(),
|
|
395
|
+
tabIndex: 0
|
|
396
|
+
})]
|
|
397
|
+
})]
|
|
398
|
+
});
|
|
399
|
+
});
|
|
400
|
+
Autocomplete.displayName = 'Autocomplete';
|
|
401
|
+
|
|
402
|
+
// If a language dictionary entry is provided, it must contain every key
|
|
403
|
+
const dictionaryContentShape = _propTypes.default.shape({
|
|
404
|
+
hasResults: _propTypes.default.string.isRequired,
|
|
405
|
+
loading: _propTypes.default.string.isRequired,
|
|
406
|
+
noResults: _propTypes.default.string.isRequired
|
|
407
|
+
});
|
|
408
|
+
Autocomplete.propTypes = {
|
|
409
|
+
...selectedSystemPropTypes,
|
|
410
|
+
/**
|
|
411
|
+
* Can be used to provide a function that renders a custom input:
|
|
412
|
+
* <Autocomplete items={items} value={currentValue}>
|
|
413
|
+
* {({ inputId, inputRef, onChange, onKeyPress, readOnly, tokens, value }) => (
|
|
414
|
+
* <Search
|
|
415
|
+
* nativeID={inputId}
|
|
416
|
+
* ref={inputRef}
|
|
417
|
+
* onChange={onChange}
|
|
418
|
+
* onKeyPress={onKeyPress}
|
|
419
|
+
* readOnly={readOnly}
|
|
420
|
+
* tokens={tokens}
|
|
421
|
+
* value={value}
|
|
422
|
+
* />
|
|
423
|
+
* )}
|
|
424
|
+
* </Autocomplete>
|
|
425
|
+
*/
|
|
426
|
+
children: _propTypes.default.func,
|
|
427
|
+
tokens: (0, _utils.getTokensPropType)('Autocomplete'),
|
|
428
|
+
/**
|
|
429
|
+
* Copy language identifier
|
|
430
|
+
*/
|
|
431
|
+
copy: _propTypes.default.oneOfType([_propTypes.default.oneOf(['en', 'fr']), dictionaryContentShape]),
|
|
432
|
+
/**
|
|
433
|
+
* Set to true in order to display the loading indicator instead of results
|
|
434
|
+
*/
|
|
435
|
+
isLoading: _propTypes.default.bool,
|
|
436
|
+
/**
|
|
437
|
+
* List of items to display as suggestions
|
|
438
|
+
*/
|
|
439
|
+
items: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
440
|
+
id: _propTypes.default.string,
|
|
441
|
+
label: _propTypes.default.string
|
|
442
|
+
})),
|
|
443
|
+
/**
|
|
444
|
+
* Label to display alongside the spinner when in a loading state
|
|
445
|
+
*/
|
|
446
|
+
loadingLabel: _propTypes.default.string,
|
|
447
|
+
/**
|
|
448
|
+
* Minimum number of characters typed for a list of suggestions to appear
|
|
449
|
+
*/
|
|
450
|
+
minToSuggestion: _propTypes.default.number,
|
|
451
|
+
/**
|
|
452
|
+
* Maximum number of suggestions provided at the same time
|
|
453
|
+
*/
|
|
454
|
+
maxSuggestions: _propTypes.default.number,
|
|
455
|
+
/**
|
|
456
|
+
* Text or JSX to render when no results are available
|
|
457
|
+
*/
|
|
458
|
+
noResults: _propTypes.default.node,
|
|
459
|
+
/**
|
|
460
|
+
* Help text to display when the input is focused and empty
|
|
461
|
+
*/
|
|
462
|
+
helpText: _propTypes.default.string,
|
|
463
|
+
/**
|
|
464
|
+
* Handler function to be called when the input value changes
|
|
465
|
+
*/
|
|
466
|
+
onChange: _propTypes.default.func,
|
|
467
|
+
/**
|
|
468
|
+
* Handler function to be called when the clear button (appears if the handler is passed) is pressed
|
|
469
|
+
*/
|
|
470
|
+
onClear: _propTypes.default.func,
|
|
471
|
+
/**
|
|
472
|
+
* Callback function to be called when an item is selected from the list
|
|
473
|
+
*/
|
|
474
|
+
onSelect: _propTypes.default.func,
|
|
475
|
+
/**
|
|
476
|
+
* Input value for controlled usage
|
|
477
|
+
*/
|
|
478
|
+
value: _propTypes.default.string
|
|
479
|
+
};
|
|
480
|
+
var _default = exports.default = Autocomplete;
|