@telus-uds/components-base 2.4.0 → 3.0.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 +33 -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 +1046 -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 +248 -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 +101 -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 +377 -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 +544 -0
- package/lib/cjs/MultiSelectFilter/dictionary.js +18 -0
- package/lib/cjs/MultiSelectFilter/index.js +9 -0
- package/lib/cjs/Notification/Notification.js +437 -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 +245 -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 +502 -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/esm/A11yInfoProvider/index.js +65 -0
- package/lib/esm/Autocomplete/Autocomplete.js +473 -0
- package/lib/esm/Autocomplete/Suggestions.js +64 -0
- package/lib/esm/BaseProvider/HydrationContext.js +47 -0
- package/lib/esm/BaseProvider/index.js +40 -0
- package/lib/esm/Button/ButtonDropdown.js +173 -0
- package/lib/esm/Card/Card.js +327 -0
- package/lib/esm/Card/CardBase.js +120 -0
- package/lib/esm/Card/PressableCardBase.js +113 -0
- package/lib/esm/CardGroup/CardGroup.js +210 -0
- package/lib/esm/Carousel/Carousel.js +1039 -0
- package/lib/esm/Carousel/CarouselItem/CarouselItem.js +178 -0
- package/lib/esm/Carousel/CarouselStepTracker/CarouselStepTracker.js +94 -0
- package/lib/esm/Carousel/CarouselTabs/CarouselTabs.js +49 -0
- package/lib/esm/Carousel/CarouselTabs/CarouselTabsPanel.js +88 -0
- package/lib/esm/Carousel/CarouselTabs/CarouselTabsPanelItem.js +118 -0
- package/lib/esm/Carousel/CarouselThumbnail.js +113 -0
- package/lib/esm/Carousel/Constants.js +7 -0
- package/lib/esm/Checkbox/Checkbox.js +342 -0
- package/lib/esm/ColourToggle/ColourToggle.js +91 -0
- package/lib/esm/ExpandCollapseMini/ExpandCollapseMini.js +77 -0
- package/lib/esm/ExpandCollapseMini/ExpandCollapseMiniControl.js +126 -0
- package/lib/esm/ExpandCollapseMini/index.js +2 -0
- package/lib/esm/Footnote/Footnote.js +316 -0
- package/lib/esm/HorizontalScroll/HorizontalScroll.js +167 -0
- package/lib/esm/Icon/Icon.js +94 -0
- package/lib/esm/Icon/IconText.js +110 -0
- package/lib/esm/IconButton/IconButton.js +202 -0
- package/lib/esm/InputSupports/InputSupports.js +133 -0
- package/lib/esm/Link/LinkBase.js +276 -0
- package/lib/esm/List/List.js +76 -0
- package/lib/esm/List/ListItemContent.js +73 -0
- package/lib/esm/Listbox/Listbox.js +168 -0
- package/lib/esm/Listbox/PressableItem.js +139 -0
- package/lib/esm/Modal/Modal.js +370 -0
- package/lib/esm/MultiSelectFilter/MultiSelectFilter.js +537 -0
- package/lib/esm/Notification/Notification.js +430 -0
- package/lib/esm/OrderedList/OrderedList.js +63 -0
- package/lib/esm/Pagination/usePagination.js +77 -0
- package/lib/esm/PriceLockup/utils/renderFootnoteContent.js +85 -0
- package/lib/esm/PriceLockup/utils/renderFootnoteLinks.js +28 -0
- package/lib/esm/PriceLockup/utils/renderPrice.js +139 -0
- package/lib/esm/ProductCard/ProductCard.js +230 -0
- package/lib/esm/Progress/ProgressBarBackground.js +42 -0
- package/lib/esm/QuickLinksFeature/QuickLinksFeature.js +68 -0
- package/lib/esm/Radio/Radio.js +282 -0
- package/lib/esm/Search/Search.js +274 -0
- package/lib/esm/Select/Picker.js +96 -0
- package/lib/esm/StackView/StackWrap.js +48 -0
- package/lib/esm/StackView/getStackedContent.js +121 -0
- package/lib/esm/StepTracker/StepTracker.js +213 -0
- package/lib/esm/TabBar/TabBar.js +125 -0
- package/lib/esm/Tabs/Tabs.js +179 -0
- package/lib/esm/Tabs/TabsItem.js +238 -0
- package/lib/esm/TextInput/TextArea.js +98 -0
- package/lib/esm/TextInput/TextInput.js +79 -0
- package/lib/esm/TextInput/TextInputBase.js +495 -0
- package/lib/esm/ThemeProvider/utils/theme-tokens.js +158 -0
- package/lib/esm/Timeline/Timeline.js +168 -0
- package/lib/esm/Tooltip/Tooltip.native.js +363 -0
- package/lib/esm/Typography/Typography.js +265 -0
- package/lib/esm/Validator/Validator.js +221 -0
- package/lib/esm/ViewportProvider/useViewportListener.js +37 -0
- package/lib/esm/index.js +72 -0
- package/lib/esm/utils/children.js +113 -0
- package/lib/esm/utils/input.js +185 -0
- package/lib/esm/utils/props/componentPropType.js +49 -0
- package/lib/esm/utils/props/selectSystemProps.js +23 -0
- package/lib/esm/utils/ssr-media-query/create-stylesheet/create-stylesheet-mobile.js +48 -0
- package/lib/esm/utils/ssr-media-query/create-stylesheet/index.js +35 -0
- package/lib/esm/utils/ssr-media-query/utils/inject.js +37 -0
- package/lib/esm/utils/useHash.js +38 -0
- package/lib/esm/utils/useOverlaidPosition.js +235 -0
- package/lib/esm/utils/useScrollBlocking.js +49 -0
- package/lib/esm/utils/useSpacingScale.js +123 -0
- package/lib/package.json +88 -0
- package/package.json +13 -11
- package/src/Carousel/Carousel.jsx +228 -155
- package/src/Carousel/CarouselItem/CarouselItem.jsx +14 -4
- package/src/Carousel/CarouselStepTracker/CarouselStepTracker.jsx +3 -0
- package/src/Carousel/Constants.js +4 -0
- package/src/ExpandCollapseMini/ExpandCollapseMini.jsx +76 -0
- package/src/ExpandCollapseMini/ExpandCollapseMiniControl.jsx +119 -0
- package/src/ExpandCollapseMini/index.js +3 -0
- package/src/Link/LinkBase.jsx +8 -3
- package/src/TextInput/TextInputBase.jsx +30 -1
- package/src/index.js +1 -0
- package/src/utils/useOverlaidPosition.js +23 -0
- package/lib/A11yInfoProvider/index.js +0 -65
- package/lib/Autocomplete/Autocomplete.js +0 -483
- package/lib/Autocomplete/Suggestions.js +0 -64
- package/lib/BaseProvider/HydrationContext.js +0 -48
- package/lib/BaseProvider/index.js +0 -41
- package/lib/Button/ButtonDropdown.js +0 -173
- package/lib/Card/Card.js +0 -328
- package/lib/Card/CardBase.js +0 -120
- package/lib/Card/PressableCardBase.js +0 -113
- package/lib/CardGroup/CardGroup.js +0 -210
- package/lib/Carousel/Carousel.js +0 -981
- package/lib/Carousel/CarouselItem/CarouselItem.js +0 -161
- package/lib/Carousel/CarouselStepTracker/CarouselStepTracker.js +0 -91
- package/lib/Carousel/CarouselTabs/CarouselTabs.js +0 -50
- package/lib/Carousel/CarouselTabs/CarouselTabsPanel.js +0 -88
- package/lib/Carousel/CarouselTabs/CarouselTabsPanelItem.js +0 -118
- package/lib/Carousel/CarouselThumbnail.js +0 -113
- package/lib/Carousel/Constants.js +0 -3
- package/lib/Checkbox/Checkbox.js +0 -342
- package/lib/ColourToggle/ColourToggle.js +0 -91
- package/lib/Footnote/Footnote.js +0 -316
- package/lib/HorizontalScroll/HorizontalScroll.js +0 -168
- package/lib/Icon/Icon.js +0 -94
- package/lib/Icon/IconText.js +0 -111
- package/lib/IconButton/IconButton.js +0 -203
- package/lib/InputSupports/InputSupports.js +0 -133
- package/lib/Link/LinkBase.js +0 -271
- package/lib/List/List.js +0 -77
- package/lib/List/ListItemContent.js +0 -73
- package/lib/Listbox/Listbox.js +0 -171
- package/lib/Listbox/PressableItem.js +0 -139
- package/lib/Modal/Modal.js +0 -373
- package/lib/MultiSelectFilter/MultiSelectFilter.js +0 -537
- package/lib/Notification/Notification.js +0 -432
- package/lib/OrderedList/OrderedList.js +0 -64
- package/lib/Pagination/usePagination.js +0 -78
- package/lib/PriceLockup/utils/renderFootnoteContent.js +0 -85
- package/lib/PriceLockup/utils/renderFootnoteLinks.js +0 -28
- package/lib/PriceLockup/utils/renderPrice.js +0 -139
- package/lib/ProductCard/ProductCard.js +0 -231
- package/lib/Progress/ProgressBarBackground.js +0 -42
- package/lib/QuickLinksFeature/QuickLinksFeature.js +0 -69
- package/lib/Radio/Radio.js +0 -282
- package/lib/Search/Search.js +0 -275
- package/lib/Select/Picker.js +0 -96
- package/lib/StackView/StackWrap.js +0 -51
- package/lib/StackView/getStackedContent.js +0 -122
- package/lib/StepTracker/StepTracker.js +0 -214
- package/lib/TabBar/TabBar.js +0 -125
- package/lib/Tabs/Tabs.js +0 -179
- package/lib/Tabs/TabsItem.js +0 -238
- package/lib/TextInput/TextArea.js +0 -98
- package/lib/TextInput/TextInput.js +0 -79
- package/lib/TextInput/TextInputBase.js +0 -468
- package/lib/ThemeProvider/utils/theme-tokens.js +0 -160
- package/lib/Timeline/Timeline.js +0 -169
- package/lib/Tooltip/Tooltip.native.js +0 -363
- package/lib/Typography/Typography.js +0 -266
- package/lib/Validator/Validator.js +0 -226
- package/lib/ViewportProvider/useViewportListener.js +0 -37
- package/lib/index.js +0 -71
- package/lib/utils/children.js +0 -117
- package/lib/utils/input.js +0 -185
- package/lib/utils/props/componentPropType.js +0 -50
- package/lib/utils/props/selectSystemProps.js +0 -23
- package/lib/utils/ssr-media-query/create-stylesheet/create-stylesheet-mobile.js +0 -48
- package/lib/utils/ssr-media-query/create-stylesheet/index.js +0 -36
- package/lib/utils/ssr-media-query/utils/inject.js +0 -39
- package/lib/utils/useHash.js +0 -41
- package/lib/utils/useOverlaidPosition.js +0 -214
- package/lib/utils/useScrollBlocking.js +0 -51
- package/lib/utils/useSpacingScale.js +0 -123
- /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}/Loading.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/{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}/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}/index.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/index.js +0 -0
- /package/lib/{Carousel → esm/Carousel}/CarouselTabs/index.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}/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}/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}/Panel.js +0 -0
- /package/lib/{ExpandCollapse → esm/ExpandCollapse}/dictionary.js +0 -0
- /package/lib/{ExpandCollapse → esm/ExpandCollapse}/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}/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}/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}/index.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}/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}/ListItem.js +0 -0
- /package/lib/{List → esm/List}/ListItemBase.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}/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}/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}/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/{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/renderTypography.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}/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}/QuickLinksFeatureItem.js +0 -0
- /package/lib/{QuickLinksFeature → esm/QuickLinksFeature}/index.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}/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.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.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}/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}/dictionary.js +0 -0
- /package/lib/{StepTracker → esm/StepTracker}/index.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}/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}/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/{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}/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}/index.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/{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}/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}/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/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/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/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/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.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.native.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.native.js +0 -0
- /package/lib/{utils → esm/utils}/useUniqueId.js +0 -0
- /package/lib/{utils → esm/utils}/withLinkRouter.js +0 -0
|
@@ -1,483 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import Dimensions from "react-native-web/dist/exports/Dimensions";
|
|
4
|
-
import Platform from "react-native-web/dist/exports/Platform";
|
|
5
|
-
import View from "react-native-web/dist/exports/View";
|
|
6
|
-
import StyleSheet from "react-native-web/dist/exports/StyleSheet";
|
|
7
|
-
import throttle from 'lodash.throttle';
|
|
8
|
-
import matchAll from 'string.prototype.matchall';
|
|
9
|
-
import { inputSupportsProps, selectSystemProps, textInputProps, textInputHandlerProps, useCopy, htmlAttrs, useOverlaidPosition, useSafeLayoutEffect, getTokensPropType } from '../utils';
|
|
10
|
-
import { useThemeTokens } from '../ThemeProvider';
|
|
11
|
-
import Listbox from '../Listbox';
|
|
12
|
-
import Typography from '../Typography';
|
|
13
|
-
import { TextInput } from '../TextInput';
|
|
14
|
-
import InputSupports from '../InputSupports';
|
|
15
|
-
import Loading from './Loading';
|
|
16
|
-
import Suggestions from './Suggestions';
|
|
17
|
-
import { DEFAULT_MAX_SUGGESTIONS, DEFAULT_MIN_TO_SUGGESTION, INPUT_LEFT_PADDING, MIN_LISTBOX_WIDTH } from './constants';
|
|
18
|
-
import dictionary from './dictionary';
|
|
19
|
-
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
20
|
-
const staticStyles = StyleSheet.create({
|
|
21
|
-
container: {
|
|
22
|
-
zIndex: 100,
|
|
23
|
-
flexDirection: 'column',
|
|
24
|
-
justifyContent: 'flex-start',
|
|
25
|
-
flexGrow: 0,
|
|
26
|
-
flexShrink: 0
|
|
27
|
-
}
|
|
28
|
-
});
|
|
29
|
-
const [selectProps, selectedSystemPropTypes] = selectSystemProps([htmlAttrs, inputSupportsProps, textInputHandlerProps, textInputProps]);
|
|
30
|
-
|
|
31
|
-
// Returns JSX to display a bold string `str` with unbolded occurrences of the
|
|
32
|
-
// `substring` based in the array of `matchIndexes` provided
|
|
33
|
-
const highlightAllMatches = function (str) {
|
|
34
|
-
let substring = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
|
35
|
-
let matchIndexes = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
|
|
36
|
-
let resultsTextColor = arguments.length > 3 ? arguments[3] : undefined;
|
|
37
|
-
return (
|
|
38
|
-
/*#__PURE__*/
|
|
39
|
-
// Wrapping all in bold
|
|
40
|
-
_jsx(Typography, {
|
|
41
|
-
variant: {
|
|
42
|
-
bold: false
|
|
43
|
-
},
|
|
44
|
-
tokens: {
|
|
45
|
-
color: resultsTextColor
|
|
46
|
-
},
|
|
47
|
-
children: matchIndexes.reduce((acc, matchIndex, index) => [...acc,
|
|
48
|
-
// Add a piece of the string up to the first occurrence of the substring
|
|
49
|
-
index === 0 && (str.slice(0, matchIndex) ?? ''),
|
|
50
|
-
/*#__PURE__*/
|
|
51
|
-
// Unbold the occurrence of the substring (while keeping the original casing)
|
|
52
|
-
_jsx(Typography, {
|
|
53
|
-
variant: {
|
|
54
|
-
bold: true
|
|
55
|
-
},
|
|
56
|
-
tokens: {
|
|
57
|
-
color: resultsTextColor
|
|
58
|
-
},
|
|
59
|
-
children: str.slice(matchIndex, matchIndex + substring.length)
|
|
60
|
-
}, matchIndex),
|
|
61
|
-
// Add the rest of the string until the next occurrence or the end of it
|
|
62
|
-
str.slice(matchIndex + substring.length, matchIndexes[index + 1] ?? str.length)], [])
|
|
63
|
-
})
|
|
64
|
-
);
|
|
65
|
-
};
|
|
66
|
-
const highlight = function () {
|
|
67
|
-
let items = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
68
|
-
let text = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
|
69
|
-
let color = arguments.length > 2 ? arguments[2] : undefined;
|
|
70
|
-
return items.reduce((acc, item) => {
|
|
71
|
-
var _Array$from;
|
|
72
|
-
const matches = (_Array$from = Array.from(matchAll(item.label.toLowerCase(), text.toLowerCase().replace(/[/\-\\^$*+?.()|[\]{}]/g, '\\$&')))) === null || _Array$from === void 0 ? void 0 : _Array$from.map(_ref => {
|
|
73
|
-
let {
|
|
74
|
-
index
|
|
75
|
-
} = _ref;
|
|
76
|
-
return index;
|
|
77
|
-
});
|
|
78
|
-
if (matches !== null && matches !== void 0 && matches.length) {
|
|
79
|
-
return [...acc, {
|
|
80
|
-
...item,
|
|
81
|
-
label: highlightAllMatches(item.label, text, matches, color)
|
|
82
|
-
}];
|
|
83
|
-
}
|
|
84
|
-
return [...acc, item];
|
|
85
|
-
}, []);
|
|
86
|
-
};
|
|
87
|
-
const Autocomplete = /*#__PURE__*/React.forwardRef((_ref2, ref) => {
|
|
88
|
-
var _ref3;
|
|
89
|
-
let {
|
|
90
|
-
children,
|
|
91
|
-
copy = 'en',
|
|
92
|
-
fullWidth = true,
|
|
93
|
-
initialItems,
|
|
94
|
-
initialValue,
|
|
95
|
-
isLoading = false,
|
|
96
|
-
items,
|
|
97
|
-
maxSuggestions = DEFAULT_MAX_SUGGESTIONS,
|
|
98
|
-
minToSuggestion = DEFAULT_MIN_TO_SUGGESTION,
|
|
99
|
-
noResults,
|
|
100
|
-
onChange,
|
|
101
|
-
onClear,
|
|
102
|
-
onSelect,
|
|
103
|
-
readOnly,
|
|
104
|
-
validation,
|
|
105
|
-
value,
|
|
106
|
-
helpText = '',
|
|
107
|
-
loadingLabel,
|
|
108
|
-
tokens,
|
|
109
|
-
...rest
|
|
110
|
-
} = _ref2;
|
|
111
|
-
const {
|
|
112
|
-
color: resultsTextColor,
|
|
113
|
-
...restOfTokens
|
|
114
|
-
} = useThemeTokens('Autocomplete', tokens, {
|
|
115
|
-
focus: true
|
|
116
|
-
});
|
|
117
|
-
|
|
118
|
-
// The wrapped input is mostly responsible for controlled vs uncontrolled handling,
|
|
119
|
-
// but we also need to adjust suggestions based on the mode:
|
|
120
|
-
// - in controlled mode we rely entirely on the suggestions passed via the `items` prop,
|
|
121
|
-
// - in uncontrolled mode we filter the suggestions ourselves based on the `initialItems`
|
|
122
|
-
// prop and the text entered
|
|
123
|
-
const isControlled = value !== undefined;
|
|
124
|
-
|
|
125
|
-
// We need to store current items for uncontrolled usage
|
|
126
|
-
const [currentItems, setCurrentItems] = React.useState(initialItems);
|
|
127
|
-
const [otherItems, setOtherItems] = React.useState(items);
|
|
128
|
-
|
|
129
|
-
// We need to store the current value as well to be able to highlight it
|
|
130
|
-
const [currentValue, setCurrentValue] = React.useState(value ?? initialValue);
|
|
131
|
-
const inputTokens = {
|
|
132
|
-
paddingLeft: INPUT_LEFT_PADDING
|
|
133
|
-
};
|
|
134
|
-
|
|
135
|
-
// Setting up the overlay
|
|
136
|
-
const openOverlayRef = React.useRef();
|
|
137
|
-
const [isExpanded, setIsExpanded] = React.useState(((_ref3 = value ?? initialValue) === null || _ref3 === void 0 ? void 0 : _ref3.length) >= minToSuggestion);
|
|
138
|
-
const [isFocused, setisFocused] = React.useState(false);
|
|
139
|
-
const [sourceLayout, setSourceLayout] = React.useState(null);
|
|
140
|
-
|
|
141
|
-
// When it's nested, selected value
|
|
142
|
-
const [nestedSelectedValue, setNestedSelectedValue] = React.useState(null);
|
|
143
|
-
const [isInputVisible, setIsInputVisible] = React.useState(true);
|
|
144
|
-
const {
|
|
145
|
-
supportsProps,
|
|
146
|
-
...selectedProps
|
|
147
|
-
} = selectProps(rest);
|
|
148
|
-
const {
|
|
149
|
-
hint,
|
|
150
|
-
label: inputLabel
|
|
151
|
-
} = supportsProps;
|
|
152
|
-
const hintExpansionEnabled = isFocused && helpText && !currentValue;
|
|
153
|
-
const {
|
|
154
|
-
overlaidPosition,
|
|
155
|
-
sourceRef: inputRef,
|
|
156
|
-
// targetRef,
|
|
157
|
-
onTargetLayout,
|
|
158
|
-
isReady
|
|
159
|
-
} = useOverlaidPosition({
|
|
160
|
-
isShown: isExpanded || hintExpansionEnabled,
|
|
161
|
-
offsets: {
|
|
162
|
-
vertical: Platform.OS !== 'web' && (hint || inputLabel) ? 28 : 4
|
|
163
|
-
}
|
|
164
|
-
});
|
|
165
|
-
const targetRef = React.useRef(null);
|
|
166
|
-
// We limit the number of suggestions displayed to avoid huge lists
|
|
167
|
-
// TODO: add a way to make the `Listbox` occupy fixed height and be scrollable
|
|
168
|
-
// within that height, which will unlock similar behaviour for `AutoComplete` as well
|
|
169
|
-
const itemsToSuggest = function () {
|
|
170
|
-
let data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
171
|
-
return maxSuggestions ? data.slice(0, maxSuggestions) : [...data];
|
|
172
|
-
};
|
|
173
|
-
const getCopy = useCopy({
|
|
174
|
-
dictionary,
|
|
175
|
-
copy
|
|
176
|
-
});
|
|
177
|
-
// Tracking input width changes to resize the listbox overlay accordingly
|
|
178
|
-
const [inputWidth, setInputWidth] = React.useState();
|
|
179
|
-
useSafeLayoutEffect(() => {
|
|
180
|
-
if (Platform.OS === 'web') {
|
|
181
|
-
const updateInputWidth = () => {
|
|
182
|
-
var _inputRef$current;
|
|
183
|
-
setInputWidth((inputRef === null || inputRef === void 0 || (_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : _inputRef$current.clientWidth) + 4); // adding back all the input borders / outlines
|
|
184
|
-
setIsExpanded(false); // close the suggestions while the input is changing
|
|
185
|
-
};
|
|
186
|
-
const throttledUpdateInputWidth = throttle(updateInputWidth, 100, {
|
|
187
|
-
leading: false
|
|
188
|
-
});
|
|
189
|
-
throttledUpdateInputWidth();
|
|
190
|
-
Dimensions.addEventListener('change', throttledUpdateInputWidth);
|
|
191
|
-
return () => {
|
|
192
|
-
Dimensions.removeEventListener('change', throttledUpdateInputWidth);
|
|
193
|
-
};
|
|
194
|
-
}
|
|
195
|
-
setInputWidth(sourceLayout === null || sourceLayout === void 0 ? void 0 : sourceLayout.width);
|
|
196
|
-
return () => {};
|
|
197
|
-
}, [inputRef, sourceLayout]);
|
|
198
|
-
const handleMeasure = event => {
|
|
199
|
-
onTargetLayout(event);
|
|
200
|
-
if (Platform.OS !== 'web') {
|
|
201
|
-
var _inputRef$current2;
|
|
202
|
-
inputRef === null || inputRef === void 0 || (_inputRef$current2 = inputRef.current) === null || _inputRef$current2 === void 0 || _inputRef$current2.measureInWindow((x, y, width) => {
|
|
203
|
-
setInputWidth(width);
|
|
204
|
-
});
|
|
205
|
-
}
|
|
206
|
-
};
|
|
207
|
-
const handleChange = newValue => {
|
|
208
|
-
onChange === null || onChange === void 0 || onChange(newValue || '');
|
|
209
|
-
setCurrentValue(newValue);
|
|
210
|
-
setIsExpanded((newValue === null || newValue === void 0 ? void 0 : newValue.length) >= minToSuggestion);
|
|
211
|
-
if (!isControlled && initialItems !== undefined) {
|
|
212
|
-
setCurrentItems(initialItems.filter(_ref4 => {
|
|
213
|
-
var _label$toLowerCase;
|
|
214
|
-
let {
|
|
215
|
-
label
|
|
216
|
-
} = _ref4;
|
|
217
|
-
return label === null || label === void 0 || (_label$toLowerCase = label.toLowerCase()) === null || _label$toLowerCase === void 0 ? void 0 : _label$toLowerCase.includes(newValue === null || newValue === void 0 ? void 0 : newValue.toLowerCase());
|
|
218
|
-
}));
|
|
219
|
-
}
|
|
220
|
-
};
|
|
221
|
-
const handleSelect = selectedId => {
|
|
222
|
-
var _ref5;
|
|
223
|
-
onSelect === null || onSelect === void 0 || onSelect(selectedId);
|
|
224
|
-
const {
|
|
225
|
-
label: newValue,
|
|
226
|
-
nested,
|
|
227
|
-
title
|
|
228
|
-
} = (_ref5 = isControlled ? items : currentItems) === null || _ref5 === void 0 ? void 0 : _ref5.find(_ref6 => {
|
|
229
|
-
let {
|
|
230
|
-
id
|
|
231
|
-
} = _ref6;
|
|
232
|
-
return id === selectedId;
|
|
233
|
-
});
|
|
234
|
-
if (title) return;
|
|
235
|
-
if (!nested) {
|
|
236
|
-
setNestedSelectedValue(null);
|
|
237
|
-
onChange === null || onChange === void 0 || onChange(newValue);
|
|
238
|
-
setIsExpanded(false);
|
|
239
|
-
}
|
|
240
|
-
setCurrentValue(newValue);
|
|
241
|
-
if (!isControlled && inputRef !== null && inputRef !== void 0 && inputRef.current) inputRef.current.value = newValue;
|
|
242
|
-
if (nested) setNestedSelectedValue(newValue);
|
|
243
|
-
inputRef.current.focus();
|
|
244
|
-
};
|
|
245
|
-
|
|
246
|
-
/**
|
|
247
|
-
* When an item that is nested equal "true" is selected this useEffect is executed.
|
|
248
|
-
* The nested item is added to the item list at the top, the if validates it doesn't exist
|
|
249
|
-
* within the list, if doesn't exist the nested item is added to the top of the list,
|
|
250
|
-
* the nested item is added with an id equal "0"
|
|
251
|
-
*/
|
|
252
|
-
React.useEffect(() => {
|
|
253
|
-
if (nestedSelectedValue && !items.find(item => item.id === 0)) {
|
|
254
|
-
const tmpItems = [...items];
|
|
255
|
-
tmpItems.unshift({
|
|
256
|
-
label: nestedSelectedValue,
|
|
257
|
-
title: true,
|
|
258
|
-
id: 0
|
|
259
|
-
});
|
|
260
|
-
setOtherItems(tmpItems.map(item => {
|
|
261
|
-
return {
|
|
262
|
-
...item,
|
|
263
|
-
nestedChild: item.id !== 0
|
|
264
|
-
};
|
|
265
|
-
}));
|
|
266
|
-
}
|
|
267
|
-
}, [nestedSelectedValue, items]);
|
|
268
|
-
React.useEffect(() => {
|
|
269
|
-
if (Platform.OS === 'ios' || Platform.OS === 'android') {
|
|
270
|
-
return undefined;
|
|
271
|
-
}
|
|
272
|
-
const observer = new IntersectionObserver(entries => {
|
|
273
|
-
const [entry] = entries;
|
|
274
|
-
setIsInputVisible(entry.isIntersecting);
|
|
275
|
-
if (!entry.isIntersecting) {
|
|
276
|
-
setIsExpanded(false);
|
|
277
|
-
}
|
|
278
|
-
});
|
|
279
|
-
const currentInputRef = inputRef.current;
|
|
280
|
-
if (currentInputRef) {
|
|
281
|
-
observer.observe(currentInputRef);
|
|
282
|
-
}
|
|
283
|
-
return () => {
|
|
284
|
-
if (currentInputRef) {
|
|
285
|
-
observer.unobserve(currentInputRef);
|
|
286
|
-
}
|
|
287
|
-
};
|
|
288
|
-
}, [inputRef]);
|
|
289
|
-
const handleClose = event => {
|
|
290
|
-
var _openOverlayRef$curre, _openOverlayRef$curre2;
|
|
291
|
-
if (event.type === 'keydown' && (event.key === 'Escape' || event.key === '27') || event.type === 'click' && !(openOverlayRef !== null && openOverlayRef !== void 0 && (_openOverlayRef$curre = openOverlayRef.current) !== null && _openOverlayRef$curre !== void 0 && _openOverlayRef$curre.contains(event.target)) || event.type === 'touchstart' && openOverlayRef !== null && openOverlayRef !== void 0 && openOverlayRef.current && event.touches[0].target && !(openOverlayRef !== null && openOverlayRef !== void 0 && (_openOverlayRef$curre2 = openOverlayRef.current) !== null && _openOverlayRef$curre2 !== void 0 && _openOverlayRef$curre2.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 !== null && targetRef !== void 0 && 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__*/_jsxs(View, {
|
|
302
|
-
style: staticStyles.container,
|
|
303
|
-
children: [/*#__PURE__*/_jsx(InputSupports, {
|
|
304
|
-
...supportsProps,
|
|
305
|
-
accessibilityAutoComplete: "list",
|
|
306
|
-
accessibilityControls: "autocomplete",
|
|
307
|
-
accessibilityExpanded: isExpanded,
|
|
308
|
-
accessibilityRole: "combobox",
|
|
309
|
-
...selectedProps,
|
|
310
|
-
validation: validation,
|
|
311
|
-
ref: ref,
|
|
312
|
-
children: _ref7 => {
|
|
313
|
-
let {
|
|
314
|
-
inputId,
|
|
315
|
-
...props
|
|
316
|
-
} = _ref7;
|
|
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__*/_jsx(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.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__*/_jsxs(_Fragment, {
|
|
371
|
-
children: [/*#__PURE__*/_jsx(Listbox.Overlay, {
|
|
372
|
-
overlaidPosition: overlaidPosition,
|
|
373
|
-
isReady: isReady,
|
|
374
|
-
minWidth: fullWidth ? inputWidth : MIN_LISTBOX_WIDTH,
|
|
375
|
-
maxWidth: inputWidth,
|
|
376
|
-
onLayout: handleMeasure,
|
|
377
|
-
tokens: restOfTokens,
|
|
378
|
-
ref: openOverlayRef,
|
|
379
|
-
children: isLoading ? /*#__PURE__*/_jsx(Loading, {
|
|
380
|
-
label: loadingLabel ?? getCopy('loading')
|
|
381
|
-
}) : /*#__PURE__*/_jsx(Suggestions, {
|
|
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 === null || targetRef === void 0 ? void 0 : targetRef.current) && /*#__PURE__*/_jsx(View
|
|
392
|
-
// This catches and shifts focus to other interactive elements.
|
|
393
|
-
, {
|
|
394
|
-
onFocus: () => {
|
|
395
|
-
var _targetRef$current;
|
|
396
|
-
return targetRef === null || targetRef === void 0 || (_targetRef$current = targetRef.current) === null || _targetRef$current === void 0 ? void 0 : _targetRef$current.focus();
|
|
397
|
-
},
|
|
398
|
-
tabIndex: 0
|
|
399
|
-
})]
|
|
400
|
-
})]
|
|
401
|
-
});
|
|
402
|
-
});
|
|
403
|
-
Autocomplete.displayName = 'Autocomplete';
|
|
404
|
-
|
|
405
|
-
// If a language dictionary entry is provided, it must contain every key
|
|
406
|
-
const dictionaryContentShape = PropTypes.shape({
|
|
407
|
-
hasResults: PropTypes.string.isRequired,
|
|
408
|
-
loading: PropTypes.string.isRequired,
|
|
409
|
-
noResults: PropTypes.string.isRequired
|
|
410
|
-
});
|
|
411
|
-
Autocomplete.propTypes = {
|
|
412
|
-
...selectedSystemPropTypes,
|
|
413
|
-
/**
|
|
414
|
-
* Can be used to provide a function that renders a custom input:
|
|
415
|
-
* <Autocomplete items={items} value={currentValue}>
|
|
416
|
-
* {({ inputId, inputRef, onChange, onKeyPress, readOnly, tokens, value }) => (
|
|
417
|
-
* <Search
|
|
418
|
-
* nativeID={inputId}
|
|
419
|
-
* ref={inputRef}
|
|
420
|
-
* onChange={onChange}
|
|
421
|
-
* onKeyPress={onKeyPress}
|
|
422
|
-
* readOnly={readOnly}
|
|
423
|
-
* tokens={tokens}
|
|
424
|
-
* value={value}
|
|
425
|
-
* />
|
|
426
|
-
* )}
|
|
427
|
-
* </Autocomplete>
|
|
428
|
-
*/
|
|
429
|
-
children: PropTypes.func,
|
|
430
|
-
tokens: getTokensPropType('Autocomplete'),
|
|
431
|
-
/**
|
|
432
|
-
* Copy language identifier
|
|
433
|
-
*/
|
|
434
|
-
copy: PropTypes.oneOfType([PropTypes.oneOf(['en', 'fr']), dictionaryContentShape]),
|
|
435
|
-
/**
|
|
436
|
-
* Set to true in order to display the loading indicator instead of results
|
|
437
|
-
*/
|
|
438
|
-
isLoading: PropTypes.bool,
|
|
439
|
-
/**
|
|
440
|
-
* List of items to display as suggestions
|
|
441
|
-
*/
|
|
442
|
-
items: PropTypes.arrayOf(PropTypes.shape({
|
|
443
|
-
id: PropTypes.string,
|
|
444
|
-
label: PropTypes.string
|
|
445
|
-
})),
|
|
446
|
-
/**
|
|
447
|
-
* Label to display alongside the spinner when in a loading state
|
|
448
|
-
*/
|
|
449
|
-
loadingLabel: PropTypes.string,
|
|
450
|
-
/**
|
|
451
|
-
* Minimum number of characters typed for a list of suggestions to appear
|
|
452
|
-
*/
|
|
453
|
-
minToSuggestion: PropTypes.number,
|
|
454
|
-
/**
|
|
455
|
-
* Maximum number of suggestions provided at the same time
|
|
456
|
-
*/
|
|
457
|
-
maxSuggestions: PropTypes.number,
|
|
458
|
-
/**
|
|
459
|
-
* Text or JSX to render when no results are available
|
|
460
|
-
*/
|
|
461
|
-
noResults: PropTypes.node,
|
|
462
|
-
/**
|
|
463
|
-
* Help text to display when the input is focused and empty
|
|
464
|
-
*/
|
|
465
|
-
helpText: PropTypes.string,
|
|
466
|
-
/**
|
|
467
|
-
* Handler function to be called when the input value changes
|
|
468
|
-
*/
|
|
469
|
-
onChange: PropTypes.func,
|
|
470
|
-
/**
|
|
471
|
-
* Handler function to be called when the clear button (appears if the handler is passed) is pressed
|
|
472
|
-
*/
|
|
473
|
-
onClear: PropTypes.func,
|
|
474
|
-
/**
|
|
475
|
-
* Callback function to be called when an item is selected from the list
|
|
476
|
-
*/
|
|
477
|
-
onSelect: PropTypes.func,
|
|
478
|
-
/**
|
|
479
|
-
* Input value for controlled usage
|
|
480
|
-
*/
|
|
481
|
-
value: PropTypes.string
|
|
482
|
-
};
|
|
483
|
-
export default Autocomplete;
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import A11yText from '../A11yText';
|
|
4
|
-
import Typography from '../Typography';
|
|
5
|
-
import Box from '../Box';
|
|
6
|
-
import Listbox from '../Listbox';
|
|
7
|
-
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
8
|
-
const Suggestions = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
9
|
-
let {
|
|
10
|
-
hasResults,
|
|
11
|
-
items = [],
|
|
12
|
-
noResults,
|
|
13
|
-
onClose,
|
|
14
|
-
onSelect,
|
|
15
|
-
parentRef
|
|
16
|
-
} = _ref;
|
|
17
|
-
const pressableItems = items.map(_ref2 => {
|
|
18
|
-
let {
|
|
19
|
-
id,
|
|
20
|
-
...rest
|
|
21
|
-
} = _ref2;
|
|
22
|
-
return {
|
|
23
|
-
id,
|
|
24
|
-
onPress: () => onSelect(id),
|
|
25
|
-
...rest
|
|
26
|
-
};
|
|
27
|
-
});
|
|
28
|
-
if (items !== null && items !== void 0 && items.length) return /*#__PURE__*/_jsxs(_Fragment, {
|
|
29
|
-
children: [/*#__PURE__*/_jsx(A11yText, {
|
|
30
|
-
accessibilityLiveRegion: "polite",
|
|
31
|
-
text: hasResults
|
|
32
|
-
}), /*#__PURE__*/_jsx(Listbox, {
|
|
33
|
-
items: pressableItems,
|
|
34
|
-
firstItemRef: ref,
|
|
35
|
-
parentRef: parentRef,
|
|
36
|
-
onClose: onClose
|
|
37
|
-
})]
|
|
38
|
-
});
|
|
39
|
-
return /*#__PURE__*/_jsx(Box, {
|
|
40
|
-
space: 3,
|
|
41
|
-
children: typeof noResults === 'string' ? /*#__PURE__*/_jsx(_Fragment, {
|
|
42
|
-
children: /*#__PURE__*/_jsx(Typography, {
|
|
43
|
-
accessibilityLiveRegion: "polite",
|
|
44
|
-
variant: {
|
|
45
|
-
size: 'small'
|
|
46
|
-
},
|
|
47
|
-
children: noResults
|
|
48
|
-
})
|
|
49
|
-
}) : noResults
|
|
50
|
-
});
|
|
51
|
-
});
|
|
52
|
-
Suggestions.displayName = 'Suggestions';
|
|
53
|
-
Suggestions.propTypes = {
|
|
54
|
-
hasResults: PropTypes.string.isRequired,
|
|
55
|
-
items: PropTypes.arrayOf(PropTypes.shape({
|
|
56
|
-
id: PropTypes.string,
|
|
57
|
-
label: PropTypes.node
|
|
58
|
-
})).isRequired,
|
|
59
|
-
noResults: PropTypes.node.isRequired,
|
|
60
|
-
onClose: PropTypes.func.isRequired,
|
|
61
|
-
onSelect: PropTypes.func.isRequired,
|
|
62
|
-
parentRef: PropTypes.object.isRequired
|
|
63
|
-
};
|
|
64
|
-
export default Suggestions;
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import Platform from "react-native-web/dist/exports/Platform";
|
|
4
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
|
-
const HydrationContext = /*#__PURE__*/React.createContext();
|
|
6
|
-
const isSSR = typeof window === 'undefined';
|
|
7
|
-
const hasWebStyleTag = () => {
|
|
8
|
-
var _document;
|
|
9
|
-
if (isSSR || Platform.OS !== 'web' || typeof document !== 'object') {
|
|
10
|
-
return false;
|
|
11
|
-
}
|
|
12
|
-
return Boolean((_document = document) === null || _document === void 0 ? void 0 : _document.getElementById('react-native-stylesheet'));
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Returns true if this render cycle is the hydration of existing SSR content.
|
|
17
|
-
*
|
|
18
|
-
* Use this when changing how content renders based on data that is instantly available
|
|
19
|
-
* during the very first client-side render or hydration, but not available on the server,
|
|
20
|
-
* to ensure no changes happen until the original SSR DOM has been hydrated.
|
|
21
|
-
*/
|
|
22
|
-
export const useHydrationContext = () => React.useContext(HydrationContext);
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* Allows components and hooks to observe if SSR hydration is currently in progress
|
|
26
|
-
* and if so, to re-render with content that differs to the server when it is complete.
|
|
27
|
-
*/
|
|
28
|
-
export const HydrationProvider = _ref => {
|
|
29
|
-
let {
|
|
30
|
-
children
|
|
31
|
-
} = _ref;
|
|
32
|
-
const [hasMounted, setHasMounted] = React.useState(false);
|
|
33
|
-
React.useEffect(() => {
|
|
34
|
-
setHasMounted(true);
|
|
35
|
-
}, []);
|
|
36
|
-
|
|
37
|
-
// If we've got a HydrationProvider inside a HydrationProvider somehow, defer to the top one
|
|
38
|
-
const valueFromAncestor = useHydrationContext();
|
|
39
|
-
const isHydrating = valueFromAncestor ?? Boolean(!hasMounted && hasWebStyleTag());
|
|
40
|
-
return /*#__PURE__*/_jsx(HydrationContext.Provider, {
|
|
41
|
-
value: isHydrating,
|
|
42
|
-
children: children
|
|
43
|
-
});
|
|
44
|
-
};
|
|
45
|
-
HydrationProvider.propTypes = {
|
|
46
|
-
children: PropTypes.node
|
|
47
|
-
};
|
|
48
|
-
export default HydrationProvider;
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
var _ThemeProvider$propTy;
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import PropTypes from 'prop-types';
|
|
4
|
-
import { PortalProvider } from '@gorhom/portal';
|
|
5
|
-
import A11yInfoProvider from '../A11yInfoProvider';
|
|
6
|
-
import ViewportProvider from '../ViewportProvider';
|
|
7
|
-
import ThemeProvider from '../ThemeProvider';
|
|
8
|
-
import { HydrationProvider } from './HydrationContext';
|
|
9
|
-
|
|
10
|
-
// eslint-disable-next-line no-unused-vars
|
|
11
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
|
-
const BaseProvider = /*#__PURE__*/React.forwardRef((_ref, _) => {
|
|
13
|
-
let {
|
|
14
|
-
defaultTheme,
|
|
15
|
-
children,
|
|
16
|
-
themeOptions
|
|
17
|
-
} = _ref;
|
|
18
|
-
return /*#__PURE__*/_jsx(HydrationProvider, {
|
|
19
|
-
children: /*#__PURE__*/_jsx(A11yInfoProvider, {
|
|
20
|
-
children: /*#__PURE__*/_jsx(ViewportProvider, {
|
|
21
|
-
children: /*#__PURE__*/_jsx(ThemeProvider, {
|
|
22
|
-
defaultTheme: defaultTheme,
|
|
23
|
-
themeOptions: themeOptions,
|
|
24
|
-
children: /*#__PURE__*/_jsx(PortalProvider, {
|
|
25
|
-
children: children
|
|
26
|
-
})
|
|
27
|
-
})
|
|
28
|
-
})
|
|
29
|
-
})
|
|
30
|
-
});
|
|
31
|
-
});
|
|
32
|
-
BaseProvider.displayName = 'BaseProvider';
|
|
33
|
-
BaseProvider.propTypes = {
|
|
34
|
-
children: PropTypes.node.isRequired,
|
|
35
|
-
defaultTheme: (_ThemeProvider$propTy = ThemeProvider.propTypes) === null || _ThemeProvider$propTy === void 0 ? void 0 : _ThemeProvider$propTy.defaultTheme,
|
|
36
|
-
themeOptions: PropTypes.shape({
|
|
37
|
-
forceAbsoluteFontSizing: PropTypes.bool,
|
|
38
|
-
forceZIndex: PropTypes.bool
|
|
39
|
-
})
|
|
40
|
-
};
|
|
41
|
-
export default BaseProvider;
|