@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
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import Text from "react-native-web/dist/exports/Text";
|
|
4
|
+
import View from "react-native-web/dist/exports/View";
|
|
5
|
+
import Platform from "react-native-web/dist/exports/Platform";
|
|
6
|
+
import { useResponsiveThemeTokens, useTheme, useThemeTokens } from '../ThemeProvider';
|
|
7
|
+
import { applyTextStyles } from '../ThemeProvider/utils';
|
|
8
|
+
import { a11yProps, variantProp, getTokensPropType, getMaxFontMultiplier, headingTags, selectSystemProps, textTags, textProps, viewProps, getA11yPropsFromHtmlTag, StyleSheet, createMediaQueryStyles } from '../utils';
|
|
9
|
+
import { useViewport } from '../ViewportProvider';
|
|
10
|
+
/**
|
|
11
|
+
* @typedef {import('../utils/a11y/semantics').TextTag} TextTag
|
|
12
|
+
*/
|
|
13
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
|
+
const [selectContainerProps, selectedContainerPropTypes] = selectSystemProps([a11yProps, viewProps]);
|
|
15
|
+
const [selectTextProps, selectedTextPropTypes] = selectSystemProps([textProps]);
|
|
16
|
+
const selectTextStyles = (_ref, themeOptions) => {
|
|
17
|
+
let {
|
|
18
|
+
fontWeight,
|
|
19
|
+
fontSize,
|
|
20
|
+
color,
|
|
21
|
+
lineHeight,
|
|
22
|
+
fontName,
|
|
23
|
+
textAlign,
|
|
24
|
+
textTransform,
|
|
25
|
+
letterSpacing,
|
|
26
|
+
textDecorationLine,
|
|
27
|
+
gradient
|
|
28
|
+
} = _ref;
|
|
29
|
+
return applyTextStyles({
|
|
30
|
+
fontWeight,
|
|
31
|
+
fontSize,
|
|
32
|
+
color,
|
|
33
|
+
lineHeight,
|
|
34
|
+
fontName,
|
|
35
|
+
themeOptions,
|
|
36
|
+
textAlign,
|
|
37
|
+
textTransform,
|
|
38
|
+
letterSpacing,
|
|
39
|
+
textDecorationLine,
|
|
40
|
+
gradient
|
|
41
|
+
});
|
|
42
|
+
};
|
|
43
|
+
const HALF_FONT_SIZE = 2;
|
|
44
|
+
const QUARTER_FONT_SIZE = 4;
|
|
45
|
+
const selectMobileSubSupStyles = (_ref2, type) => {
|
|
46
|
+
let {
|
|
47
|
+
fontSize
|
|
48
|
+
} = _ref2;
|
|
49
|
+
return {
|
|
50
|
+
fontSize: fontSize / HALF_FONT_SIZE,
|
|
51
|
+
lineHeight: fontSize,
|
|
52
|
+
position: 'relative',
|
|
53
|
+
top: type === 'sub' ? fontSize / QUARTER_FONT_SIZE : -fontSize / QUARTER_FONT_SIZE
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
// General-purpose flexible theme-neutral base component for text
|
|
58
|
+
const Typography = /*#__PURE__*/React.forwardRef((_ref3, ref) => {
|
|
59
|
+
let {
|
|
60
|
+
children,
|
|
61
|
+
variant,
|
|
62
|
+
heading,
|
|
63
|
+
tag = typeof heading === 'string' ? heading : undefined,
|
|
64
|
+
accessibilityRole = heading === true ? 'header' : undefined,
|
|
65
|
+
block = false,
|
|
66
|
+
align = undefined,
|
|
67
|
+
tokens,
|
|
68
|
+
dataSet,
|
|
69
|
+
strikeThrough = false,
|
|
70
|
+
...rest
|
|
71
|
+
} = _ref3;
|
|
72
|
+
const viewport = useViewport();
|
|
73
|
+
const {
|
|
74
|
+
themeOptions
|
|
75
|
+
} = useTheme();
|
|
76
|
+
const {
|
|
77
|
+
enableMediaQueryStyleSheet
|
|
78
|
+
} = themeOptions;
|
|
79
|
+
const useTokens = enableMediaQueryStyleSheet ? useResponsiveThemeTokens : useThemeTokens;
|
|
80
|
+
const themeTokens = useTokens('Typography', tokens, variant, !enableMediaQueryStyleSheet && {
|
|
81
|
+
viewport
|
|
82
|
+
});
|
|
83
|
+
const maxFontSizeMultiplier = enableMediaQueryStyleSheet ? getMaxFontMultiplier(themeTokens[viewport]) : getMaxFontMultiplier(themeTokens);
|
|
84
|
+
const textDecorationLine = strikeThrough ? 'line-through' : 'none';
|
|
85
|
+
const generateGradientString = gradientObj => {
|
|
86
|
+
let gradientStr = '';
|
|
87
|
+
const {
|
|
88
|
+
type,
|
|
89
|
+
angle,
|
|
90
|
+
stops: [stopOne, stopTwo],
|
|
91
|
+
specification
|
|
92
|
+
} = gradientObj;
|
|
93
|
+
if (type === 'radial') {
|
|
94
|
+
gradientStr = `radial-gradient(${specification}`;
|
|
95
|
+
gradientStr += `, ${stopOne.color} ${stopOne.stop * 100}%, ${stopTwo.color} ${stopTwo.stop * 100}%`;
|
|
96
|
+
} else if (type === 'linear') {
|
|
97
|
+
gradientStr = `linear-gradient(${angle}deg`;
|
|
98
|
+
if (angle === 135) {
|
|
99
|
+
gradientStr += `, ${stopOne.color}, 75%, ${stopTwo.color}`;
|
|
100
|
+
} else {
|
|
101
|
+
gradientStr += `, ${stopOne.color}, ${stopTwo.color}`;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
gradientStr += ')';
|
|
105
|
+
return gradientStr;
|
|
106
|
+
};
|
|
107
|
+
const getStyleWithGradient = styles => {
|
|
108
|
+
return styles.gradient ? {
|
|
109
|
+
...styles,
|
|
110
|
+
color: 'transparent',
|
|
111
|
+
backgroundImage: generateGradientString(styles.gradient),
|
|
112
|
+
backgroundClip: 'text'
|
|
113
|
+
} : styles;
|
|
114
|
+
};
|
|
115
|
+
let textStyles;
|
|
116
|
+
let mediaIds;
|
|
117
|
+
if (enableMediaQueryStyleSheet) {
|
|
118
|
+
const transformedThemeTokens = Object.entries(themeTokens).reduce((acc, _ref4) => {
|
|
119
|
+
let [vp, viewportTokens] = _ref4;
|
|
120
|
+
acc[vp] = selectTextStyles({
|
|
121
|
+
textAlign: align,
|
|
122
|
+
textDecorationLine,
|
|
123
|
+
...viewportTokens
|
|
124
|
+
}, themeOptions);
|
|
125
|
+
if (themeTokens[vp].gradient) {
|
|
126
|
+
const tokensWithGradient = {
|
|
127
|
+
...acc[vp],
|
|
128
|
+
color: 'transparent',
|
|
129
|
+
backgroundImage: generateGradientString(themeTokens[vp].gradient),
|
|
130
|
+
backgroundClip: 'text'
|
|
131
|
+
};
|
|
132
|
+
return {
|
|
133
|
+
...acc,
|
|
134
|
+
[vp]: tokensWithGradient
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
return acc;
|
|
138
|
+
}, {});
|
|
139
|
+
const mediaQueryStyles = createMediaQueryStyles(transformedThemeTokens);
|
|
140
|
+
const {
|
|
141
|
+
ids,
|
|
142
|
+
styles
|
|
143
|
+
} = StyleSheet.create({
|
|
144
|
+
text: mediaQueryStyles
|
|
145
|
+
});
|
|
146
|
+
textStyles = styles.text;
|
|
147
|
+
mediaIds = ids.text;
|
|
148
|
+
} else {
|
|
149
|
+
textStyles = selectTextStyles({
|
|
150
|
+
textAlign: align,
|
|
151
|
+
textDecorationLine,
|
|
152
|
+
...themeTokens
|
|
153
|
+
}, themeOptions);
|
|
154
|
+
}
|
|
155
|
+
const resolvedTextProps = {
|
|
156
|
+
...selectTextProps(rest),
|
|
157
|
+
maxFontSizeMultiplier
|
|
158
|
+
};
|
|
159
|
+
const containerProps = {
|
|
160
|
+
accessibilityRole,
|
|
161
|
+
...getA11yPropsFromHtmlTag(tag, accessibilityRole),
|
|
162
|
+
...selectContainerProps(rest)
|
|
163
|
+
};
|
|
164
|
+
const resetTagStyling = child => {
|
|
165
|
+
if (typeof child !== 'object' || !(child?.type === 'sub' || child?.type === 'sup')) {
|
|
166
|
+
return child;
|
|
167
|
+
}
|
|
168
|
+
const childStyles = child?.props?.style || {};
|
|
169
|
+
const supFontSize = childStyles.fontSize ?? themeTokens.superScriptFontSize;
|
|
170
|
+
const isMobile = Platform.OS === 'ios' || Platform.OS === 'android';
|
|
171
|
+
const isSubSup = child?.type === 'sub' || child?.type === 'sup';
|
|
172
|
+
const mobileStyles = isMobile && isSubSup ? selectMobileSubSupStyles(themeTokens, child?.type) : {};
|
|
173
|
+
const defaultStyles = !isMobile && isSubSup ? {
|
|
174
|
+
fontSize: supFontSize,
|
|
175
|
+
lineHeight: 0
|
|
176
|
+
} : {};
|
|
177
|
+
const sanitizedChild = /*#__PURE__*/React.cloneElement(isMobile && isSubSup ? /*#__PURE__*/_jsx(View, {
|
|
178
|
+
children: /*#__PURE__*/_jsx(Text, {
|
|
179
|
+
style: [childStyles, mobileStyles],
|
|
180
|
+
children: child.props.children
|
|
181
|
+
})
|
|
182
|
+
}) : child, {
|
|
183
|
+
style: {
|
|
184
|
+
...childStyles,
|
|
185
|
+
...defaultStyles
|
|
186
|
+
}
|
|
187
|
+
});
|
|
188
|
+
return sanitizedChild;
|
|
189
|
+
};
|
|
190
|
+
const sanitizeChildren = () => {
|
|
191
|
+
if (Array.isArray(children)) {
|
|
192
|
+
return children.map(resetTagStyling);
|
|
193
|
+
}
|
|
194
|
+
return resetTagStyling(children);
|
|
195
|
+
};
|
|
196
|
+
const dataSetValue = mediaIds ? {
|
|
197
|
+
media: mediaIds,
|
|
198
|
+
...dataSet
|
|
199
|
+
} : dataSet;
|
|
200
|
+
return block ? /*#__PURE__*/_jsx(View, {
|
|
201
|
+
ref: ref,
|
|
202
|
+
...containerProps,
|
|
203
|
+
children: /*#__PURE__*/_jsx(Text, {
|
|
204
|
+
...resolvedTextProps,
|
|
205
|
+
style: getStyleWithGradient(textStyles),
|
|
206
|
+
dataSet: dataSetValue,
|
|
207
|
+
children: sanitizeChildren(children)
|
|
208
|
+
})
|
|
209
|
+
}) : /*#__PURE__*/_jsx(Text, {
|
|
210
|
+
ref: ref,
|
|
211
|
+
...containerProps,
|
|
212
|
+
...resolvedTextProps,
|
|
213
|
+
style: getStyleWithGradient(textStyles),
|
|
214
|
+
dataSet: dataSetValue,
|
|
215
|
+
children: sanitizeChildren(children)
|
|
216
|
+
});
|
|
217
|
+
});
|
|
218
|
+
Typography.displayName = 'Typography';
|
|
219
|
+
Typography.propTypes = {
|
|
220
|
+
...selectedContainerPropTypes,
|
|
221
|
+
...selectedTextPropTypes,
|
|
222
|
+
tokens: getTokensPropType('Typography'),
|
|
223
|
+
variant: variantProp.propType,
|
|
224
|
+
/**
|
|
225
|
+
* Renders the text with "text-decoration: 'line-through'" applied.
|
|
226
|
+
*/
|
|
227
|
+
strikeThrough: PropTypes.bool,
|
|
228
|
+
/**
|
|
229
|
+
* Renders the text as a semantic heading. If a html heading tag is provided, uses that tag on Web.
|
|
230
|
+
*
|
|
231
|
+
* Does not affect styling: <Typography heading="h2"> will render a <h2> that looks like plain text.
|
|
232
|
+
* Use both `heading` and `variant` props to render semantic headings that look like headings.
|
|
233
|
+
*
|
|
234
|
+
* In native apps, if this is `true` or any html heading tag string and accessibilityRole prop
|
|
235
|
+
* is not defined, the accessibilityRole will default to "heading".
|
|
236
|
+
*/
|
|
237
|
+
heading: PropTypes.oneOf([...headingTags, true]),
|
|
238
|
+
/**
|
|
239
|
+
* Optional semantic HTML tag, to apply to the text on web. Does not change styling.
|
|
240
|
+
*
|
|
241
|
+
* `tag` and `heading` props set the same thing, so shouldn't be used together (`tag` overrides `heading`).
|
|
242
|
+
*
|
|
243
|
+
* In native apps, if a header tag is provided ("h1", "h2" etc) and accessibilityRole prop
|
|
244
|
+
* is not defined, the accessibilityRole will default to "heading".
|
|
245
|
+
*/
|
|
246
|
+
tag: PropTypes.oneOf(textTags),
|
|
247
|
+
/**
|
|
248
|
+
* If true, forces the element to behave as a View block even if nested in other text
|
|
249
|
+
*/
|
|
250
|
+
block: PropTypes.bool,
|
|
251
|
+
/**
|
|
252
|
+
* Works the same as css text-align, note that RN doesn't support "start" or "end" (see https://reactnative.dev/docs/text-style-props#textalign)
|
|
253
|
+
* Justify is known to make text harder to read, especially for people with dyslexia (see https://developer.mozilla.org/en-US/docs/Web/CSS/text-align#accessibility_concerns)
|
|
254
|
+
*/
|
|
255
|
+
align: PropTypes.oneOf(['auto', 'left', 'right', 'center', 'justify']),
|
|
256
|
+
/**
|
|
257
|
+
* Same children allowed as a React Native <Text> node
|
|
258
|
+
*/
|
|
259
|
+
children: PropTypes.node,
|
|
260
|
+
/**
|
|
261
|
+
* Data attributes to be added to the element
|
|
262
|
+
*/
|
|
263
|
+
dataSet: PropTypes.object
|
|
264
|
+
};
|
|
265
|
+
export default Typography;
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import View from "react-native-web/dist/exports/View";
|
|
4
|
+
import StyleSheet from "react-native-web/dist/exports/StyleSheet";
|
|
5
|
+
import Platform from "react-native-web/dist/exports/Platform";
|
|
6
|
+
import { inputSupportsProps, selectSystemProps } from '../utils';
|
|
7
|
+
import { TextInput } from '../TextInput';
|
|
8
|
+
import StackView from '../StackView';
|
|
9
|
+
import InputSupports from '../InputSupports';
|
|
10
|
+
import { useThemeTokens } from '../ThemeProvider';
|
|
11
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
|
+
const [selectProps, selectedSystemPropTypes] = selectSystemProps([inputSupportsProps]);
|
|
13
|
+
const selectCodeTextInputTokens = _ref => {
|
|
14
|
+
let {
|
|
15
|
+
outerBorderColor,
|
|
16
|
+
outerBackgroundColor
|
|
17
|
+
} = _ref;
|
|
18
|
+
return {
|
|
19
|
+
outerBorderColor,
|
|
20
|
+
outerBackgroundColor,
|
|
21
|
+
icon: null
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
const Validator = /*#__PURE__*/React.forwardRef((_ref2, ref) => {
|
|
25
|
+
let {
|
|
26
|
+
value = '',
|
|
27
|
+
inactive,
|
|
28
|
+
mask = '',
|
|
29
|
+
onChange,
|
|
30
|
+
tokens = {},
|
|
31
|
+
variant = {},
|
|
32
|
+
...rest
|
|
33
|
+
} = _ref2;
|
|
34
|
+
const defaultRef = React.useRef();
|
|
35
|
+
const codeRef = ref ?? defaultRef;
|
|
36
|
+
const {
|
|
37
|
+
supportsProps
|
|
38
|
+
} = selectProps(rest);
|
|
39
|
+
const strValidation = supportsProps.validation;
|
|
40
|
+
const [individualCodes, setIndividualCodes] = React.useState({});
|
|
41
|
+
const [text, setText] = React.useState(value);
|
|
42
|
+
const validatorsLength = 6;
|
|
43
|
+
const prefix = 'code';
|
|
44
|
+
const sufixValidation = 'Validation';
|
|
45
|
+
const [isHover, setIsHover] = React.useState(false);
|
|
46
|
+
const handleMouseOver = () => {
|
|
47
|
+
setIsHover(true);
|
|
48
|
+
};
|
|
49
|
+
const handleMouseOut = () => {
|
|
50
|
+
setIsHover(false);
|
|
51
|
+
};
|
|
52
|
+
const themeTokens = useThemeTokens('TextInput', tokens, variant, {
|
|
53
|
+
hover: isHover
|
|
54
|
+
});
|
|
55
|
+
const [codeReferences, singleCodes] = React.useMemo(() => {
|
|
56
|
+
const codes = [];
|
|
57
|
+
const valueCodes = {};
|
|
58
|
+
for (let i = 0; validatorsLength && i < validatorsLength; i += 1) {
|
|
59
|
+
codes[prefix + i] = /*#__PURE__*/React.createRef();
|
|
60
|
+
valueCodes[prefix + i] = '';
|
|
61
|
+
valueCodes[prefix + i + sufixValidation] = '';
|
|
62
|
+
}
|
|
63
|
+
return [codes, valueCodes];
|
|
64
|
+
}, []);
|
|
65
|
+
const handleSingleCodes = (codeId, val, validation) => {
|
|
66
|
+
singleCodes[codeId] = val;
|
|
67
|
+
singleCodes[codeId + sufixValidation] = validation;
|
|
68
|
+
/* eslint-disable no-unused-expressions */
|
|
69
|
+
setIndividualCodes({
|
|
70
|
+
...individualCodes,
|
|
71
|
+
[codeId]: val
|
|
72
|
+
});
|
|
73
|
+
};
|
|
74
|
+
const changeDataMasking = boxElement => {
|
|
75
|
+
let charMasking = '';
|
|
76
|
+
const element = boxElement;
|
|
77
|
+
if (mask && mask.length === 1) charMasking = mask;else if (mask && mask.length > 1) charMasking = mask.substring(0, 1);
|
|
78
|
+
if (charMasking) element.value = charMasking;
|
|
79
|
+
};
|
|
80
|
+
const handleChangeCode = () => {
|
|
81
|
+
let code = '';
|
|
82
|
+
for (let i = 0; i < validatorsLength; i += 1) code += singleCodes[prefix + i];
|
|
83
|
+
if (typeof onChange === 'function') onChange(code, singleCodes);
|
|
84
|
+
};
|
|
85
|
+
const handleChangeCodeValues = (event, codeId, nextIndex) => {
|
|
86
|
+
const codeElement = codeReferences[codeId]?.current;
|
|
87
|
+
const val = event.nativeEvent?.value || event.target?.value;
|
|
88
|
+
if (Number(val).toString() === 'NaN') {
|
|
89
|
+
codeElement.value = singleCodes[codeId] ?? '';
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
handleSingleCodes(codeId, codeElement?.value ?? singleCodes[codeId], 'success');
|
|
93
|
+
handleChangeCode();
|
|
94
|
+
if (nextIndex === validatorsLength) {
|
|
95
|
+
codeElement.blur();
|
|
96
|
+
changeDataMasking(codeElement);
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
if (codeElement?.value?.length > 0) {
|
|
100
|
+
codeReferences[prefix + nextIndex].current.focus();
|
|
101
|
+
changeDataMasking(codeElement);
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
const handleKeyPress = (event, currentIndex, previousIndex) => {
|
|
105
|
+
if (!(event.keyCode === 8 || event.code === 'Backspace')) return;
|
|
106
|
+
if (currentIndex > 0) {
|
|
107
|
+
codeReferences[prefix + currentIndex].current.value = '';
|
|
108
|
+
codeReferences[prefix + previousIndex].current.focus();
|
|
109
|
+
}
|
|
110
|
+
handleSingleCodes(prefix + currentIndex, '', '');
|
|
111
|
+
handleChangeCode();
|
|
112
|
+
};
|
|
113
|
+
const getCodeComponents = () => {
|
|
114
|
+
const components = [];
|
|
115
|
+
for (let i = 0; validatorsLength && i < validatorsLength; i += 1) {
|
|
116
|
+
const codeId = prefix + i;
|
|
117
|
+
const codeInputProps = {
|
|
118
|
+
nativeID: codeId,
|
|
119
|
+
keyboardType: 'numeric',
|
|
120
|
+
ref: codeReferences[codeId] ?? null,
|
|
121
|
+
validation: strValidation || singleCodes[codeId + sufixValidation],
|
|
122
|
+
tokens: selectCodeTextInputTokens(themeTokens),
|
|
123
|
+
onFocus: () => codeReferences[codeId]?.current?.select() ?? null,
|
|
124
|
+
onKeyPress: event => handleKeyPress(event, i, i - 1),
|
|
125
|
+
onMouseOver: handleMouseOver,
|
|
126
|
+
onMouseOut: handleMouseOut,
|
|
127
|
+
inactive
|
|
128
|
+
};
|
|
129
|
+
codeInputProps.validation || delete codeInputProps.validation;
|
|
130
|
+
components.push(/*#__PURE__*/_jsx(View, {
|
|
131
|
+
style: staticStyles.codeInputWidth,
|
|
132
|
+
children: /*#__PURE__*/_jsx(TextInput, {
|
|
133
|
+
...codeInputProps
|
|
134
|
+
})
|
|
135
|
+
}, codeId));
|
|
136
|
+
}
|
|
137
|
+
return components;
|
|
138
|
+
};
|
|
139
|
+
React.useEffect(() => {
|
|
140
|
+
/* eslint-disable no-unused-expressions */
|
|
141
|
+
if (Number(value).toString() !== 'NaN') setText(value);
|
|
142
|
+
}, [value]);
|
|
143
|
+
|
|
144
|
+
/* eslint-disable react-hooks/exhaustive-deps */
|
|
145
|
+
React.useEffect(() => {
|
|
146
|
+
for (let i = 0; i < validatorsLength; i += 1) {
|
|
147
|
+
if (mask && text[i]) codeReferences[prefix + i].current.value = mask;else codeReferences[prefix + i].current.value = text[i] ?? '';
|
|
148
|
+
handleSingleCodes(prefix + i, text[i] ?? '', text[i] ? 'success' : '');
|
|
149
|
+
}
|
|
150
|
+
}, [text]);
|
|
151
|
+
|
|
152
|
+
/* eslint-disable react-hooks/exhaustive-deps */
|
|
153
|
+
React.useEffect(() => {
|
|
154
|
+
const handlePasteCode = event => {
|
|
155
|
+
setText('');
|
|
156
|
+
const clipBoardText = event.clipboardData.getData('text');
|
|
157
|
+
if (Number(clipBoardText).toString() !== 'NaN') setText(clipBoardText);
|
|
158
|
+
};
|
|
159
|
+
const handleCopy = event => {
|
|
160
|
+
let clipBoardText = '';
|
|
161
|
+
for (let i = 0; i < validatorsLength; i += 1) singleCodes[prefix + i] && (clipBoardText += singleCodes[prefix + i]);
|
|
162
|
+
event.clipboardData.setData('text/plain', clipBoardText);
|
|
163
|
+
event.preventDefault();
|
|
164
|
+
};
|
|
165
|
+
if (Platform.OS === 'web') {
|
|
166
|
+
for (let i = 0; i < validatorsLength; i += 1) {
|
|
167
|
+
codeReferences[prefix + i].current.addEventListener('paste', handlePasteCode);
|
|
168
|
+
codeReferences[prefix + i].current.addEventListener('copy', handleCopy);
|
|
169
|
+
codeReferences[prefix + i].current.addEventListener('input', event => handleChangeCodeValues(event, prefix + i, i + 1));
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
return () => {
|
|
173
|
+
if (Platform.oldValue === 'web') {
|
|
174
|
+
for (let i = 0; i < validatorsLength; i += 1) {
|
|
175
|
+
codeReferences[prefix + i]?.current?.removeEventListener('paste', handlePasteCode);
|
|
176
|
+
codeReferences[prefix + i]?.current?.removeEventListener('copy', handleCopy);
|
|
177
|
+
codeReferences[prefix + i]?.current?.removeEventListener('input', event => handleChangeCodeValues(event, prefix + i, i + 1));
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
};
|
|
181
|
+
}, []);
|
|
182
|
+
return /*#__PURE__*/_jsx(InputSupports, {
|
|
183
|
+
...supportsProps,
|
|
184
|
+
feedbackProps: {
|
|
185
|
+
...rest?.feedbackProps,
|
|
186
|
+
showFeedbackIcon: true
|
|
187
|
+
},
|
|
188
|
+
children: /*#__PURE__*/_jsx(StackView, {
|
|
189
|
+
space: 2,
|
|
190
|
+
direction: "row",
|
|
191
|
+
ref: codeRef,
|
|
192
|
+
children: getCodeComponents()
|
|
193
|
+
})
|
|
194
|
+
});
|
|
195
|
+
});
|
|
196
|
+
Validator.displayName = 'Validator';
|
|
197
|
+
Validator.propTypes = {
|
|
198
|
+
...selectedSystemPropTypes,
|
|
199
|
+
/**
|
|
200
|
+
* The value is a 6-digit code, may be only numeric characters, non numeric character aren't renderize
|
|
201
|
+
*/
|
|
202
|
+
value: PropTypes.string,
|
|
203
|
+
/**
|
|
204
|
+
* If true, the component is inactive and non editable.
|
|
205
|
+
*/
|
|
206
|
+
inactive: PropTypes.bool,
|
|
207
|
+
/**
|
|
208
|
+
* Show masked characters and obscure the actual input. For example: '*'
|
|
209
|
+
*/
|
|
210
|
+
mask: PropTypes.string,
|
|
211
|
+
/**
|
|
212
|
+
* Use to react upon input's value changes. Required when the `value` prop is set. Will receive the input's value as an argument.
|
|
213
|
+
*/
|
|
214
|
+
onChange: PropTypes.func
|
|
215
|
+
};
|
|
216
|
+
export default Validator;
|
|
217
|
+
const staticStyles = StyleSheet.create({
|
|
218
|
+
codeInputWidth: {
|
|
219
|
+
width: 43
|
|
220
|
+
}
|
|
221
|
+
});
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import Dimensions from "react-native-web/dist/exports/Dimensions";
|
|
2
|
+
import { viewports } from '@telus-uds/system-constants';
|
|
3
|
+
import useSafeLayoutEffect from '../utils/useSafeLayoutEffect';
|
|
4
|
+
|
|
5
|
+
// Use Dimensions instead of useWindowDimensions because useWindowDimensions forces context
|
|
6
|
+
// to update on every pixel change during window resize; but we only want rerenders to occur
|
|
7
|
+
// when a viewport threshold has been crossed.
|
|
8
|
+
const lookupViewport = () => viewports.select(Dimensions.get('window').width);
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* When client-side rendering, immediately set the viewport to the correct value as a layout effect so
|
|
12
|
+
* if the viewport isn't the smallest, any SSR-rendered components rerender correctly before anything
|
|
13
|
+
* is shown to the user. Then bind events to update the viewport if it changes.
|
|
14
|
+
*/
|
|
15
|
+
const useViewportListener = setViewport => {
|
|
16
|
+
useSafeLayoutEffect(() => {
|
|
17
|
+
setViewport(lookupViewport());
|
|
18
|
+
const onChange = _ref => {
|
|
19
|
+
let {
|
|
20
|
+
window
|
|
21
|
+
} = _ref;
|
|
22
|
+
return setViewport(viewports.select(window.width));
|
|
23
|
+
};
|
|
24
|
+
const listener = Dimensions.addEventListener('change', onChange);
|
|
25
|
+
return () => {
|
|
26
|
+
if (typeof listener?.remove === 'function') {
|
|
27
|
+
// Can't just return listener.remove because listener.emitter disappears, causing an internal error.
|
|
28
|
+
// See https://github.com/facebook/react-native/issues/34508
|
|
29
|
+
listener.remove();
|
|
30
|
+
// From RN 0.65.0, Dimensions.removeEventListener is deprecated for `remove` on addEventListener return value
|
|
31
|
+
} else if (typeof Dimensions.removeEventListener === 'function') {
|
|
32
|
+
Dimensions.removeEventListener('change', onChange);
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
}, [setViewport]);
|
|
36
|
+
};
|
|
37
|
+
export default useViewportListener;
|
package/lib/esm/index.js
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
export { default as A11yText } from './A11yText';
|
|
2
|
+
export { default as ActionCard } from './ActionCard';
|
|
3
|
+
export { default as ActivityIndicator } from './ActivityIndicator';
|
|
4
|
+
export { default as Autocomplete } from './Autocomplete';
|
|
5
|
+
export { default as Box } from './Box';
|
|
6
|
+
export { default as Badge } from './Badge';
|
|
7
|
+
export * from './Button';
|
|
8
|
+
export { default as Card, PressableCardBase } from './Card';
|
|
9
|
+
export { default as CardGroup } from './CardGroup';
|
|
10
|
+
export * from './Carousel';
|
|
11
|
+
export { default as FileUpload } from './FileUpload';
|
|
12
|
+
export { default as Listbox } from './Listbox';
|
|
13
|
+
export { default as Checkbox } from './Checkbox';
|
|
14
|
+
export * from './Checkbox';
|
|
15
|
+
export { default as CheckboxCard } from './CheckboxCard';
|
|
16
|
+
export { default as CheckboxCardGroup } from './CheckboxCardGroup';
|
|
17
|
+
export { default as ColourToggle } from './ColourToggle';
|
|
18
|
+
export { default as DownloadApp } from './DownloadApp';
|
|
19
|
+
export { default as Divider } from './Divider';
|
|
20
|
+
export { default as ExpandCollapse, Accordion } from './ExpandCollapse';
|
|
21
|
+
export { default as ExpandCollapseMini } from './ExpandCollapseMini';
|
|
22
|
+
export { default as Feedback } from './Feedback';
|
|
23
|
+
export { default as Fieldset } from './Fieldset';
|
|
24
|
+
export { default as FlexGrid } from './FlexGrid';
|
|
25
|
+
export { default as Footnote } from './Footnote';
|
|
26
|
+
export { default as HorizontalScroll, horizontalScrollUtils, HorizontalScrollButton } from './HorizontalScroll';
|
|
27
|
+
export { default as Icon, IconText, iconComponentPropTypes } from './Icon';
|
|
28
|
+
export { default as IconButton } from './IconButton';
|
|
29
|
+
export { default as InputLabel } from './InputLabel';
|
|
30
|
+
export { default as InputSupports } from './InputSupports';
|
|
31
|
+
export * from './Link';
|
|
32
|
+
export { default as List, ListItem, ListBase } from './List';
|
|
33
|
+
export { default as Modal } from './Modal';
|
|
34
|
+
export { default as MultiSelectFilter } from './MultiSelectFilter';
|
|
35
|
+
export { default as Notification } from './Notification';
|
|
36
|
+
export { default as OrderedList } from './OrderedList';
|
|
37
|
+
export { default as Pagination } from './Pagination';
|
|
38
|
+
export { default as PriceLockup } from './PriceLockup';
|
|
39
|
+
export { default as ProductCard } from './ProductCard';
|
|
40
|
+
export { default as ProductCardGroup } from './ProductCardGroup';
|
|
41
|
+
export { default as Progress } from './Progress';
|
|
42
|
+
export { default as QuickLinks } from './QuickLinks';
|
|
43
|
+
export { default as QuickLinksFeature } from './QuickLinksFeature';
|
|
44
|
+
export { default as Radio, RadioGroup } from './Radio';
|
|
45
|
+
export { default as RadioCard, RadioCardGroup } from './RadioCard';
|
|
46
|
+
export { default as Responsive } from './Responsive';
|
|
47
|
+
export { default as Search } from './Search';
|
|
48
|
+
export { default as Select } from './Select';
|
|
49
|
+
export { default as SideNav } from './SideNav';
|
|
50
|
+
export { default as Skeleton } from './Skeleton';
|
|
51
|
+
export { default as SkipLink } from './SkipLink';
|
|
52
|
+
export { default as Spacer } from './Spacer';
|
|
53
|
+
export { default as StackView, StackWrap, getStackedContent } from './StackView';
|
|
54
|
+
export { default as Status } from './Status';
|
|
55
|
+
export { default as StepTracker } from './StepTracker';
|
|
56
|
+
export { default as Tabs } from './Tabs';
|
|
57
|
+
export { default as TabBar } from './TabBar';
|
|
58
|
+
export { default as Tags } from './Tags';
|
|
59
|
+
export * from './TextInput';
|
|
60
|
+
export { default as Timeline } from './Timeline';
|
|
61
|
+
export * from './ToggleSwitch';
|
|
62
|
+
export { default as Tooltip } from './Tooltip';
|
|
63
|
+
export { default as TooltipButton } from './TooltipButton';
|
|
64
|
+
export { default as Typography } from './Typography';
|
|
65
|
+
export { default as A11yInfoProvider, useA11yInfo } from './A11yInfoProvider';
|
|
66
|
+
export { default as BaseProvider } from './BaseProvider';
|
|
67
|
+
export { useHydrationContext } from './BaseProvider/HydrationContext';
|
|
68
|
+
export { default as Validator } from './Validator';
|
|
69
|
+
export { default as ViewportProvider, useViewport, ViewportContext } from './ViewportProvider';
|
|
70
|
+
export { default as ThemeProvider, useTheme, useSetTheme, useThemeTokens, useThemeTokensCallback, getThemeTokens, applyOuterBorder, applyTextStyles, applyShadowToken, useResponsiveThemeTokens } from './ThemeProvider';
|
|
71
|
+
export * from './utils';
|
|
72
|
+
export { default as Portal } from './Portal';
|