@telus-uds/components-base 2.5.0 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +41 -2
- package/lib/cjs/A11yInfoProvider/index.js +73 -0
- package/lib/cjs/A11yText/index.js +75 -0
- package/lib/cjs/ActionCard/ActionCard.js +349 -0
- package/lib/cjs/ActionCard/index.js +9 -0
- package/lib/cjs/ActivityIndicator/Spinner.js +85 -0
- package/lib/cjs/ActivityIndicator/Spinner.native.js +151 -0
- package/lib/cjs/ActivityIndicator/index.js +51 -0
- package/lib/cjs/ActivityIndicator/shared.js +20 -0
- package/lib/cjs/Autocomplete/Autocomplete.js +480 -0
- package/lib/cjs/Autocomplete/Loading.js +42 -0
- package/lib/cjs/Autocomplete/Suggestions.js +71 -0
- package/lib/cjs/Autocomplete/constants.js +10 -0
- package/lib/cjs/Autocomplete/dictionary.js +18 -0
- package/lib/cjs/Autocomplete/index.js +9 -0
- package/lib/cjs/Badge/Badge.js +109 -0
- package/lib/cjs/Badge/index.js +9 -0
- package/lib/cjs/BaseProvider/HydrationContext.js +56 -0
- package/lib/cjs/BaseProvider/index.js +46 -0
- package/lib/cjs/Box/Box.js +385 -0
- package/lib/cjs/Box/backgroundImageStylesMap.js +100 -0
- package/lib/cjs/Box/index.js +9 -0
- package/lib/cjs/Button/Button.js +43 -0
- package/lib/cjs/Button/ButtonBase.js +353 -0
- package/lib/cjs/Button/ButtonDropdown.js +182 -0
- package/lib/cjs/Button/ButtonGroup.js +279 -0
- package/lib/cjs/Button/ButtonLink.js +57 -0
- package/lib/cjs/Button/index.js +34 -0
- package/lib/cjs/Button/propTypes.js +53 -0
- package/lib/cjs/Card/Card.js +334 -0
- package/lib/cjs/Card/CardBase.js +127 -0
- package/lib/cjs/Card/PressableCardBase.js +121 -0
- package/lib/cjs/Card/index.js +32 -0
- package/lib/cjs/CardGroup/CardGroup.js +219 -0
- package/lib/cjs/CardGroup/dictionary.js +14 -0
- package/lib/cjs/CardGroup/index.js +9 -0
- package/lib/cjs/Carousel/Carousel.js +1045 -0
- package/lib/cjs/Carousel/CarouselContext.js +59 -0
- package/lib/cjs/Carousel/CarouselFirstFocus/CarouselFirstFocus.js +57 -0
- package/lib/cjs/Carousel/CarouselItem/CarouselItem.js +185 -0
- package/lib/cjs/Carousel/CarouselItem/index.js +9 -0
- package/lib/cjs/Carousel/CarouselStepTracker/CarouselStepTracker.js +101 -0
- package/lib/cjs/Carousel/CarouselStepTracker/index.js +9 -0
- package/lib/cjs/Carousel/CarouselTabs/CarouselTabs.js +54 -0
- package/lib/cjs/Carousel/CarouselTabs/CarouselTabsPanel.js +95 -0
- package/lib/cjs/Carousel/CarouselTabs/CarouselTabsPanelItem.js +125 -0
- package/lib/cjs/Carousel/CarouselTabs/index.js +9 -0
- package/lib/cjs/Carousel/CarouselThumbnail.js +120 -0
- package/lib/cjs/Carousel/CarouselThumbnailNavigation.js +78 -0
- package/lib/cjs/Carousel/Constants.js +13 -0
- package/lib/cjs/Carousel/dictionary.js +28 -0
- package/lib/cjs/Carousel/index.js +36 -0
- package/lib/cjs/Checkbox/Checkbox.js +349 -0
- package/lib/cjs/Checkbox/CheckboxButton.js +171 -0
- package/lib/cjs/Checkbox/CheckboxGroup.js +249 -0
- package/lib/cjs/Checkbox/CheckboxInput.js +55 -0
- package/lib/cjs/Checkbox/CheckboxInput.native.js +11 -0
- package/lib/cjs/Checkbox/index.js +16 -0
- package/lib/cjs/CheckboxCard/CheckboxCard.js +191 -0
- package/lib/cjs/CheckboxCard/index.js +9 -0
- package/lib/cjs/CheckboxCardGroup/CheckboxCardGroup.js +215 -0
- package/lib/cjs/CheckboxCardGroup/index.js +9 -0
- package/lib/cjs/ColourToggle/ColourBubble.js +133 -0
- package/lib/cjs/ColourToggle/ColourToggle.js +98 -0
- package/lib/cjs/ColourToggle/index.js +9 -0
- package/lib/cjs/Divider/Divider.js +138 -0
- package/lib/cjs/Divider/index.js +9 -0
- package/lib/cjs/DownloadApp/DownloadApp.js +167 -0
- package/lib/cjs/DownloadApp/dictionary.js +16 -0
- package/lib/cjs/DownloadApp/index.js +9 -0
- package/lib/cjs/ExpandCollapse/Accordion.js +20 -0
- package/lib/cjs/ExpandCollapse/Control.js +170 -0
- package/lib/cjs/ExpandCollapse/ExpandCollapse.js +105 -0
- package/lib/cjs/ExpandCollapse/Panel.js +270 -0
- package/lib/cjs/ExpandCollapse/dictionary.js +16 -0
- package/lib/cjs/ExpandCollapse/index.js +19 -0
- package/lib/cjs/ExpandCollapseMini/ExpandCollapseMini.js +84 -0
- package/lib/cjs/ExpandCollapseMini/ExpandCollapseMiniControl.js +133 -0
- package/lib/cjs/ExpandCollapseMini/index.js +9 -0
- package/lib/cjs/Feedback/Feedback.js +167 -0
- package/lib/cjs/Feedback/index.js +9 -0
- package/lib/cjs/Fieldset/Fieldset.js +198 -0
- package/lib/cjs/Fieldset/FieldsetContainer.js +55 -0
- package/lib/cjs/Fieldset/FieldsetContainer.native.js +39 -0
- package/lib/cjs/Fieldset/Legend.js +29 -0
- package/lib/cjs/Fieldset/Legend.native.js +36 -0
- package/lib/cjs/Fieldset/cssReset.js +20 -0
- package/lib/cjs/Fieldset/index.js +9 -0
- package/lib/cjs/FileUpload/FileUpload.js +370 -0
- package/lib/cjs/FileUpload/NotificationContent.js +59 -0
- package/lib/cjs/FileUpload/dictionary.js +50 -0
- package/lib/cjs/FileUpload/index.js +9 -0
- package/lib/cjs/FlexGrid/Col/Col.js +264 -0
- package/lib/cjs/FlexGrid/Col/index.js +9 -0
- package/lib/cjs/FlexGrid/FlexGrid.js +165 -0
- package/lib/cjs/FlexGrid/Row/Row.js +188 -0
- package/lib/cjs/FlexGrid/Row/index.js +9 -0
- package/lib/cjs/FlexGrid/helpers/index.js +21 -0
- package/lib/cjs/FlexGrid/index.js +9 -0
- package/lib/cjs/FlexGrid/providers/GutterContext.js +10 -0
- package/lib/cjs/Footnote/Footnote.js +323 -0
- package/lib/cjs/Footnote/FootnoteLink.js +114 -0
- package/lib/cjs/Footnote/dictionary.js +18 -0
- package/lib/cjs/Footnote/index.js +11 -0
- package/lib/cjs/HorizontalScroll/HorizontalScroll.js +175 -0
- package/lib/cjs/HorizontalScroll/HorizontalScrollButton.js +86 -0
- package/lib/cjs/HorizontalScroll/ScrollViewEnd.js +53 -0
- package/lib/cjs/HorizontalScroll/ScrollViewEnd.native.js +32 -0
- package/lib/cjs/HorizontalScroll/dictionary.js +17 -0
- package/lib/cjs/HorizontalScroll/index.js +26 -0
- package/lib/cjs/HorizontalScroll/itemPositions.js +122 -0
- package/lib/cjs/Icon/Icon.js +105 -0
- package/lib/cjs/Icon/IconText.js +117 -0
- package/lib/cjs/Icon/index.js +24 -0
- package/lib/cjs/IconButton/IconButton.js +208 -0
- package/lib/cjs/IconButton/index.js +9 -0
- package/lib/cjs/InputLabel/InputLabel.js +184 -0
- package/lib/cjs/InputLabel/LabelContent.js +35 -0
- package/lib/cjs/InputLabel/LabelContent.native.js +26 -0
- package/lib/cjs/InputLabel/index.js +9 -0
- package/lib/cjs/InputSupports/InputSupports.js +140 -0
- package/lib/cjs/InputSupports/dictionary.js +18 -0
- package/lib/cjs/InputSupports/index.js +9 -0
- package/lib/cjs/InputSupports/useInputSupports.js +47 -0
- package/lib/cjs/Link/ChevronLink.js +73 -0
- package/lib/cjs/Link/InlinePressable.js +53 -0
- package/lib/cjs/Link/InlinePressable.native.js +93 -0
- package/lib/cjs/Link/Link.js +35 -0
- package/lib/cjs/Link/LinkBase.js +283 -0
- package/lib/cjs/Link/TextButton.js +48 -0
- package/lib/cjs/Link/index.js +34 -0
- package/lib/cjs/List/List.js +83 -0
- package/lib/cjs/List/ListItem.js +37 -0
- package/lib/cjs/List/ListItemBase.js +171 -0
- package/lib/cjs/List/ListItemContent.js +80 -0
- package/lib/cjs/List/ListItemMark.js +132 -0
- package/lib/cjs/List/PressableListItemBase.js +117 -0
- package/lib/cjs/List/index.js +23 -0
- package/lib/cjs/Listbox/GroupControl.js +112 -0
- package/lib/cjs/Listbox/Listbox.js +177 -0
- package/lib/cjs/Listbox/ListboxContext.js +11 -0
- package/lib/cjs/Listbox/ListboxGroup.js +133 -0
- package/lib/cjs/Listbox/ListboxItem.js +83 -0
- package/lib/cjs/Listbox/ListboxOverlay.js +87 -0
- package/lib/cjs/Listbox/PressableItem.js +146 -0
- package/lib/cjs/Listbox/index.js +9 -0
- package/lib/cjs/Modal/Modal.js +375 -0
- package/lib/cjs/Modal/ModalContent.js +205 -0
- package/lib/cjs/Modal/WebModal.js +83 -0
- package/lib/cjs/Modal/dictionary.js +15 -0
- package/lib/cjs/Modal/index.js +9 -0
- package/lib/cjs/MultiSelectFilter/ModalOverlay.js +162 -0
- package/lib/cjs/MultiSelectFilter/MultiSelectFilter.js +546 -0
- package/lib/cjs/MultiSelectFilter/dictionary.js +18 -0
- package/lib/cjs/MultiSelectFilter/index.js +9 -0
- package/lib/cjs/Notification/Notification.js +436 -0
- package/lib/cjs/Notification/dictionary.js +14 -0
- package/lib/cjs/Notification/index.js +9 -0
- package/lib/cjs/OrderedList/Item.js +166 -0
- package/lib/cjs/OrderedList/ItemBase.js +51 -0
- package/lib/cjs/OrderedList/OrderedList.js +70 -0
- package/lib/cjs/OrderedList/OrderedListBase.js +44 -0
- package/lib/cjs/OrderedList/index.js +9 -0
- package/lib/cjs/Pagination/PageButton.js +82 -0
- package/lib/cjs/Pagination/Pagination.js +226 -0
- package/lib/cjs/Pagination/SideButton.js +119 -0
- package/lib/cjs/Pagination/constants.js +9 -0
- package/lib/cjs/Pagination/dictionary.js +24 -0
- package/lib/cjs/Pagination/index.js +9 -0
- package/lib/cjs/Pagination/usePagination.js +83 -0
- package/lib/cjs/Portal/Portal.js +56 -0
- package/lib/cjs/Portal/Portal.native.js +8 -0
- package/lib/cjs/Portal/index.js +9 -0
- package/lib/cjs/PriceLockup/PriceLockup.js +230 -0
- package/lib/cjs/PriceLockup/index.js +9 -0
- package/lib/cjs/PriceLockup/utils/renderFootnoteContent.js +92 -0
- package/lib/cjs/PriceLockup/utils/renderFootnoteLinks.js +35 -0
- package/lib/cjs/PriceLockup/utils/renderPrice.js +146 -0
- package/lib/cjs/PriceLockup/utils/renderTypography.js +30 -0
- package/lib/cjs/ProductCard/ProductCard.js +237 -0
- package/lib/cjs/ProductCard/dictionary.js +44 -0
- package/lib/cjs/ProductCard/index.js +9 -0
- package/lib/cjs/ProductCardGroup/ProductCardGroup.js +77 -0
- package/lib/cjs/ProductCardGroup/index.js +9 -0
- package/lib/cjs/Progress/Progress.js +101 -0
- package/lib/cjs/Progress/ProgressBar.js +168 -0
- package/lib/cjs/Progress/ProgressBarBackground.js +49 -0
- package/lib/cjs/Progress/constants.js +10 -0
- package/lib/cjs/Progress/index.js +11 -0
- package/lib/cjs/QuickLinks/QuickLinks.js +83 -0
- package/lib/cjs/QuickLinks/QuickLinksCard.js +38 -0
- package/lib/cjs/QuickLinks/QuickLinksItem.js +56 -0
- package/lib/cjs/QuickLinks/index.js +11 -0
- package/lib/cjs/QuickLinksFeature/QuickLinksFeature.js +74 -0
- package/lib/cjs/QuickLinksFeature/QuickLinksFeatureItem.js +152 -0
- package/lib/cjs/QuickLinksFeature/index.js +11 -0
- package/lib/cjs/Radio/Radio.js +291 -0
- package/lib/cjs/Radio/RadioButton.js +191 -0
- package/lib/cjs/Radio/RadioGroup.js +262 -0
- package/lib/cjs/Radio/RadioInput.js +55 -0
- package/lib/cjs/Radio/RadioInput.native.js +11 -0
- package/lib/cjs/Radio/index.js +16 -0
- package/lib/cjs/RadioCard/RadioCard.js +219 -0
- package/lib/cjs/RadioCard/RadioCardGroup.js +266 -0
- package/lib/cjs/RadioCard/index.js +16 -0
- package/lib/cjs/Responsive/Responsive.js +70 -0
- package/lib/cjs/Responsive/ResponsiveProp.js +45 -0
- package/lib/cjs/Responsive/ResponsiveWithMediaQueryStyleSheet.js +75 -0
- package/lib/cjs/Responsive/index.js +9 -0
- package/lib/cjs/Search/Search.js +281 -0
- package/lib/cjs/Search/dictionary.js +18 -0
- package/lib/cjs/Search/index.js +9 -0
- package/lib/cjs/Select/Group.js +31 -0
- package/lib/cjs/Select/Group.native.js +23 -0
- package/lib/cjs/Select/Item.js +30 -0
- package/lib/cjs/Select/Item.native.js +8 -0
- package/lib/cjs/Select/Picker.js +103 -0
- package/lib/cjs/Select/Picker.native.js +130 -0
- package/lib/cjs/Select/Select.js +339 -0
- package/lib/cjs/Select/constants.js +13 -0
- package/lib/cjs/Select/index.js +13 -0
- package/lib/cjs/SideNav/Item.js +150 -0
- package/lib/cjs/SideNav/ItemContent.js +56 -0
- package/lib/cjs/SideNav/ItemsGroup.js +125 -0
- package/lib/cjs/SideNav/SideNav.js +139 -0
- package/lib/cjs/SideNav/index.js +13 -0
- package/lib/cjs/Skeleton/Skeleton.js +184 -0
- package/lib/cjs/Skeleton/index.js +9 -0
- package/lib/cjs/Skeleton/skeleton.constant.js +8 -0
- package/lib/cjs/Skeleton/skeletonWebAnimation.js +20 -0
- package/lib/cjs/Skeleton/useSkeletonNativeAnimation.js +35 -0
- package/lib/cjs/SkipLink/SkipLink.js +196 -0
- package/lib/cjs/SkipLink/index.js +9 -0
- package/lib/cjs/Spacer/Spacer.js +100 -0
- package/lib/cjs/Spacer/index.js +9 -0
- package/lib/cjs/StackView/StackView.js +133 -0
- package/lib/cjs/StackView/StackWrap.js +54 -0
- package/lib/cjs/StackView/StackWrap.native.js +10 -0
- package/lib/cjs/StackView/StackWrapBox.js +121 -0
- package/lib/cjs/StackView/StackWrapGap.js +68 -0
- package/lib/cjs/StackView/common.js +43 -0
- package/lib/cjs/StackView/getStackedContent.js +128 -0
- package/lib/cjs/StackView/index.js +23 -0
- package/lib/cjs/Status/Status.js +176 -0
- package/lib/cjs/Status/index.js +9 -0
- package/lib/cjs/StepTracker/Step.js +271 -0
- package/lib/cjs/StepTracker/StepTracker.js +220 -0
- package/lib/cjs/StepTracker/dictionary.js +36 -0
- package/lib/cjs/StepTracker/index.js +9 -0
- package/lib/cjs/TabBar/TabBar.js +132 -0
- package/lib/cjs/TabBar/TabBarItem.js +182 -0
- package/lib/cjs/TabBar/index.js +9 -0
- package/lib/cjs/Tabs/Tabs.js +188 -0
- package/lib/cjs/Tabs/TabsItem.js +249 -0
- package/lib/cjs/Tabs/index.js +9 -0
- package/lib/cjs/Tags/Tags.js +252 -0
- package/lib/cjs/Tags/index.js +9 -0
- package/lib/cjs/TextInput/TextArea.js +105 -0
- package/lib/cjs/TextInput/TextInput.js +86 -0
- package/lib/cjs/TextInput/TextInputBase.js +473 -0
- package/lib/cjs/TextInput/dictionary.js +18 -0
- package/lib/cjs/TextInput/index.js +20 -0
- package/lib/cjs/TextInput/propTypes.js +40 -0
- package/lib/cjs/ThemeProvider/ThemeProvider.js +91 -0
- package/lib/cjs/ThemeProvider/index.js +59 -0
- package/lib/cjs/ThemeProvider/useResponsiveThemeTokens.js +88 -0
- package/lib/cjs/ThemeProvider/useSetTheme.js +30 -0
- package/lib/cjs/ThemeProvider/useTheme.js +17 -0
- package/lib/cjs/ThemeProvider/useThemeTokens.js +118 -0
- package/lib/cjs/ThemeProvider/utils/index.js +27 -0
- package/lib/cjs/ThemeProvider/utils/styles.js +208 -0
- package/lib/cjs/ThemeProvider/utils/theme-tokens.js +173 -0
- package/lib/cjs/Timeline/Timeline.js +175 -0
- package/lib/cjs/Timeline/index.js +9 -0
- package/lib/cjs/ToggleSwitch/ToggleSwitch.js +286 -0
- package/lib/cjs/ToggleSwitch/ToggleSwitchGroup.js +215 -0
- package/lib/cjs/ToggleSwitch/index.js +20 -0
- package/lib/cjs/Tooltip/Backdrop.js +57 -0
- package/lib/cjs/Tooltip/Backdrop.native.js +46 -0
- package/lib/cjs/Tooltip/Tooltip.js +295 -0
- package/lib/cjs/Tooltip/Tooltip.native.js +370 -0
- package/lib/cjs/Tooltip/dictionary.js +14 -0
- package/lib/cjs/Tooltip/getTooltipPosition.js +175 -0
- package/lib/cjs/Tooltip/index.js +12 -0
- package/lib/cjs/Tooltip/shared.js +48 -0
- package/lib/cjs/TooltipButton/TooltipButton.js +97 -0
- package/lib/cjs/TooltipButton/index.js +9 -0
- package/lib/cjs/Typography/Typography.js +271 -0
- package/lib/cjs/Typography/index.js +9 -0
- package/lib/cjs/Validator/Validator.js +228 -0
- package/lib/cjs/Validator/index.js +9 -0
- package/lib/cjs/ViewportProvider/ViewportProvider.js +32 -0
- package/lib/cjs/ViewportProvider/index.js +22 -0
- package/lib/cjs/ViewportProvider/useViewport.js +10 -0
- package/lib/cjs/ViewportProvider/useViewportListener.js +43 -0
- package/lib/cjs/index.js +781 -0
- package/lib/cjs/server.js +40 -0
- package/lib/cjs/utils/BaseView/BaseView.js +47 -0
- package/lib/cjs/utils/BaseView/BaseView.native.js +12 -0
- package/lib/cjs/utils/BaseView/index.js +9 -0
- package/lib/cjs/utils/a11y/index.js +27 -0
- package/lib/cjs/utils/a11y/semantics.js +145 -0
- package/lib/cjs/utils/a11y/textSize.js +44 -0
- package/lib/cjs/utils/animation/index.js +13 -0
- package/lib/cjs/utils/animation/useVerticalExpandAnimation.js +92 -0
- package/lib/cjs/utils/children.js +121 -0
- package/lib/cjs/utils/containUniqueFields.js +30 -0
- package/lib/cjs/utils/convertFromMegaByteToByte.js +16 -0
- package/lib/cjs/utils/floating-ui/index.js +42 -0
- package/lib/cjs/utils/floating-ui/index.native.js +42 -0
- package/lib/cjs/utils/formatImageSource.js +33 -0
- package/lib/cjs/utils/hasOwnProperty.js +17 -0
- package/lib/cjs/utils/htmlAttrs.js +30 -0
- package/lib/cjs/utils/index.js +245 -0
- package/lib/cjs/utils/info/index.js +14 -0
- package/lib/cjs/utils/info/platform/index.js +18 -0
- package/lib/cjs/utils/info/platform/platform.android.js +7 -0
- package/lib/cjs/utils/info/platform/platform.ios.js +7 -0
- package/lib/cjs/utils/info/platform/platform.js +7 -0
- package/lib/cjs/utils/info/platform/platform.native.js +10 -0
- package/lib/cjs/utils/info/versions.js +12 -0
- package/lib/cjs/utils/input.js +193 -0
- package/lib/cjs/utils/pressability.js +122 -0
- package/lib/cjs/utils/props/a11yProps.js +315 -0
- package/lib/cjs/utils/props/clickProps.js +32 -0
- package/lib/cjs/utils/props/componentPropType.js +55 -0
- package/lib/cjs/utils/props/contentfulProps.js +29 -0
- package/lib/cjs/utils/props/copyPropTypes.js +9 -0
- package/lib/cjs/utils/props/getPropSelector.js +58 -0
- package/lib/cjs/utils/props/handlerProps.js +111 -0
- package/lib/cjs/utils/props/hrefAttrsProp.js +39 -0
- package/lib/cjs/utils/props/index.js +176 -0
- package/lib/cjs/utils/props/inputSupportsProps.js +87 -0
- package/lib/cjs/utils/props/linkProps.js +50 -0
- package/lib/cjs/utils/props/paddingProp.js +16 -0
- package/lib/cjs/utils/props/pressProps.js +49 -0
- package/lib/cjs/utils/props/rectProp.js +16 -0
- package/lib/cjs/utils/props/responsiveProps.js +35 -0
- package/lib/cjs/utils/props/selectSystemProps.js +29 -0
- package/lib/cjs/utils/props/spacingProps.js +63 -0
- package/lib/cjs/utils/props/textInputProps.js +194 -0
- package/lib/cjs/utils/props/textProps.js +67 -0
- package/lib/cjs/utils/props/tokens.js +140 -0
- package/lib/cjs/utils/props/variantProp.js +24 -0
- package/lib/cjs/utils/props/viewProps.js +28 -0
- package/lib/cjs/utils/ssr-media-query/create-stylesheet/create-stylesheet-mobile.js +55 -0
- package/lib/cjs/utils/ssr-media-query/create-stylesheet/index.android.js +9 -0
- package/lib/cjs/utils/ssr-media-query/create-stylesheet/index.ios.js +9 -0
- package/lib/cjs/utils/ssr-media-query/create-stylesheet/index.js +42 -0
- package/lib/cjs/utils/ssr-media-query/hash.js +19 -0
- package/lib/cjs/utils/ssr-media-query/index.js +18 -0
- package/lib/cjs/utils/ssr-media-query/utils/common.js +44 -0
- package/lib/cjs/utils/ssr-media-query/utils/create-declaration-block.js +23 -0
- package/lib/cjs/utils/ssr-media-query/utils/create-media-query-styles.js +66 -0
- package/lib/cjs/utils/ssr-media-query/utils/hyphenate-style-name.js +18 -0
- package/lib/cjs/utils/ssr-media-query/utils/inject.js +47 -0
- package/lib/cjs/utils/ssr.js +150 -0
- package/lib/cjs/utils/transformGradient.js +22 -0
- package/lib/cjs/utils/useCopy.js +48 -0
- package/lib/cjs/utils/useHash.js +44 -0
- package/lib/cjs/utils/useHash.native.js +12 -0
- package/lib/cjs/utils/useOverlaidPosition.js +242 -0
- package/lib/cjs/utils/useResponsiveProp.js +53 -0
- package/lib/cjs/utils/useSafeLayoutEffect.js +34 -0
- package/lib/cjs/utils/useScrollBlocking.js +55 -0
- package/lib/cjs/utils/useScrollBlocking.native.js +9 -0
- package/lib/cjs/utils/useSpacingScale.js +129 -0
- package/lib/cjs/utils/useUniqueId.js +17 -0
- package/lib/cjs/utils/withLinkRouter.js +89 -0
- package/lib/{Carousel → esm/Carousel}/Carousel.js +164 -106
- package/lib/{Carousel → esm/Carousel}/CarouselItem/CarouselItem.js +23 -6
- package/lib/esm/Carousel/Constants.js +7 -0
- package/lib/{ExpandCollapse → esm/ExpandCollapse}/Panel.js +29 -7
- package/lib/{Icon → esm/Icon}/Icon.js +6 -2
- package/lib/{Link → esm/Link}/LinkBase.js +1 -1
- package/lib/{Modal → esm/Modal}/Modal.js +2 -4
- package/lib/{MultiSelectFilter → esm/MultiSelectFilter}/MultiSelectFilter.js +3 -1
- package/lib/{Notification → esm/Notification}/Notification.js +0 -1
- package/lib/{Tabs → esm/Tabs}/TabsItem.js +6 -2
- package/lib/package.json +88 -0
- package/package.json +13 -11
- package/src/Carousel/Carousel.jsx +225 -152
- package/src/Carousel/CarouselItem/CarouselItem.jsx +14 -4
- package/src/Carousel/Constants.js +4 -0
- package/src/ExpandCollapse/Panel.jsx +44 -14
- package/src/Icon/Icon.jsx +4 -3
- package/src/Link/LinkBase.jsx +3 -1
- package/src/Modal/Modal.jsx +2 -2
- package/src/MultiSelectFilter/MultiSelectFilter.jsx +3 -1
- package/src/Notification/Notification.jsx +0 -1
- package/src/Tabs/TabsItem.jsx +6 -2
- package/types/Listbox.d.ts +60 -0
- package/types/index.d.ts +3 -0
- package/lib/Carousel/Constants.js +0 -3
- /package/lib/{A11yInfoProvider → esm/A11yInfoProvider}/index.js +0 -0
- /package/lib/{A11yText → esm/A11yText}/index.js +0 -0
- /package/lib/{ActionCard → esm/ActionCard}/ActionCard.js +0 -0
- /package/lib/{ActionCard → esm/ActionCard}/index.js +0 -0
- /package/lib/{ActivityIndicator → esm/ActivityIndicator}/Spinner.js +0 -0
- /package/lib/{ActivityIndicator → esm/ActivityIndicator}/Spinner.native.js +0 -0
- /package/lib/{ActivityIndicator → esm/ActivityIndicator}/index.js +0 -0
- /package/lib/{ActivityIndicator → esm/ActivityIndicator}/shared.js +0 -0
- /package/lib/{Autocomplete → esm/Autocomplete}/Autocomplete.js +0 -0
- /package/lib/{Autocomplete → esm/Autocomplete}/Loading.js +0 -0
- /package/lib/{Autocomplete → esm/Autocomplete}/Suggestions.js +0 -0
- /package/lib/{Autocomplete → esm/Autocomplete}/constants.js +0 -0
- /package/lib/{Autocomplete → esm/Autocomplete}/dictionary.js +0 -0
- /package/lib/{Autocomplete → esm/Autocomplete}/index.js +0 -0
- /package/lib/{Badge → esm/Badge}/Badge.js +0 -0
- /package/lib/{Badge → esm/Badge}/index.js +0 -0
- /package/lib/{BaseProvider → esm/BaseProvider}/HydrationContext.js +0 -0
- /package/lib/{BaseProvider → esm/BaseProvider}/index.js +0 -0
- /package/lib/{Box → esm/Box}/Box.js +0 -0
- /package/lib/{Box → esm/Box}/backgroundImageStylesMap.js +0 -0
- /package/lib/{Box → esm/Box}/index.js +0 -0
- /package/lib/{Button → esm/Button}/Button.js +0 -0
- /package/lib/{Button → esm/Button}/ButtonBase.js +0 -0
- /package/lib/{Button → esm/Button}/ButtonDropdown.js +0 -0
- /package/lib/{Button → esm/Button}/ButtonGroup.js +0 -0
- /package/lib/{Button → esm/Button}/ButtonLink.js +0 -0
- /package/lib/{Button → esm/Button}/index.js +0 -0
- /package/lib/{Button → esm/Button}/propTypes.js +0 -0
- /package/lib/{Card → esm/Card}/Card.js +0 -0
- /package/lib/{Card → esm/Card}/CardBase.js +0 -0
- /package/lib/{Card → esm/Card}/PressableCardBase.js +0 -0
- /package/lib/{Card → esm/Card}/index.js +0 -0
- /package/lib/{CardGroup → esm/CardGroup}/CardGroup.js +0 -0
- /package/lib/{CardGroup → esm/CardGroup}/dictionary.js +0 -0
- /package/lib/{CardGroup → esm/CardGroup}/index.js +0 -0
- /package/lib/{Carousel → esm/Carousel}/CarouselContext.js +0 -0
- /package/lib/{Carousel → esm/Carousel}/CarouselFirstFocus/CarouselFirstFocus.js +0 -0
- /package/lib/{Carousel → esm/Carousel}/CarouselItem/index.js +0 -0
- /package/lib/{Carousel → esm/Carousel}/CarouselStepTracker/CarouselStepTracker.js +0 -0
- /package/lib/{Carousel → esm/Carousel}/CarouselStepTracker/index.js +0 -0
- /package/lib/{Carousel → esm/Carousel}/CarouselTabs/CarouselTabs.js +0 -0
- /package/lib/{Carousel → esm/Carousel}/CarouselTabs/CarouselTabsPanel.js +0 -0
- /package/lib/{Carousel → esm/Carousel}/CarouselTabs/CarouselTabsPanelItem.js +0 -0
- /package/lib/{Carousel → esm/Carousel}/CarouselTabs/index.js +0 -0
- /package/lib/{Carousel → esm/Carousel}/CarouselThumbnail.js +0 -0
- /package/lib/{Carousel → esm/Carousel}/CarouselThumbnailNavigation.js +0 -0
- /package/lib/{Carousel → esm/Carousel}/dictionary.js +0 -0
- /package/lib/{Carousel → esm/Carousel}/index.js +0 -0
- /package/lib/{Checkbox → esm/Checkbox}/Checkbox.js +0 -0
- /package/lib/{Checkbox → esm/Checkbox}/CheckboxButton.js +0 -0
- /package/lib/{Checkbox → esm/Checkbox}/CheckboxGroup.js +0 -0
- /package/lib/{Checkbox → esm/Checkbox}/CheckboxInput.js +0 -0
- /package/lib/{Checkbox → esm/Checkbox}/CheckboxInput.native.js +0 -0
- /package/lib/{Checkbox → esm/Checkbox}/index.js +0 -0
- /package/lib/{CheckboxCard → esm/CheckboxCard}/CheckboxCard.js +0 -0
- /package/lib/{CheckboxCard → esm/CheckboxCard}/index.js +0 -0
- /package/lib/{CheckboxCardGroup → esm/CheckboxCardGroup}/CheckboxCardGroup.js +0 -0
- /package/lib/{CheckboxCardGroup → esm/CheckboxCardGroup}/index.js +0 -0
- /package/lib/{ColourToggle → esm/ColourToggle}/ColourBubble.js +0 -0
- /package/lib/{ColourToggle → esm/ColourToggle}/ColourToggle.js +0 -0
- /package/lib/{ColourToggle → esm/ColourToggle}/index.js +0 -0
- /package/lib/{Divider → esm/Divider}/Divider.js +0 -0
- /package/lib/{Divider → esm/Divider}/index.js +0 -0
- /package/lib/{DownloadApp → esm/DownloadApp}/DownloadApp.js +0 -0
- /package/lib/{DownloadApp → esm/DownloadApp}/dictionary.js +0 -0
- /package/lib/{DownloadApp → esm/DownloadApp}/index.js +0 -0
- /package/lib/{ExpandCollapse → esm/ExpandCollapse}/Accordion.js +0 -0
- /package/lib/{ExpandCollapse → esm/ExpandCollapse}/Control.js +0 -0
- /package/lib/{ExpandCollapse → esm/ExpandCollapse}/ExpandCollapse.js +0 -0
- /package/lib/{ExpandCollapse → esm/ExpandCollapse}/dictionary.js +0 -0
- /package/lib/{ExpandCollapse → esm/ExpandCollapse}/index.js +0 -0
- /package/lib/{ExpandCollapseMini → esm/ExpandCollapseMini}/ExpandCollapseMini.js +0 -0
- /package/lib/{ExpandCollapseMini → esm/ExpandCollapseMini}/ExpandCollapseMiniControl.js +0 -0
- /package/lib/{ExpandCollapseMini → esm/ExpandCollapseMini}/index.js +0 -0
- /package/lib/{Feedback → esm/Feedback}/Feedback.js +0 -0
- /package/lib/{Feedback → esm/Feedback}/index.js +0 -0
- /package/lib/{Fieldset → esm/Fieldset}/Fieldset.js +0 -0
- /package/lib/{Fieldset → esm/Fieldset}/FieldsetContainer.js +0 -0
- /package/lib/{Fieldset → esm/Fieldset}/FieldsetContainer.native.js +0 -0
- /package/lib/{Fieldset → esm/Fieldset}/Legend.js +0 -0
- /package/lib/{Fieldset → esm/Fieldset}/Legend.native.js +0 -0
- /package/lib/{Fieldset → esm/Fieldset}/cssReset.js +0 -0
- /package/lib/{Fieldset → esm/Fieldset}/index.js +0 -0
- /package/lib/{FileUpload → esm/FileUpload}/FileUpload.js +0 -0
- /package/lib/{FileUpload → esm/FileUpload}/NotificationContent.js +0 -0
- /package/lib/{FileUpload → esm/FileUpload}/dictionary.js +0 -0
- /package/lib/{FileUpload → esm/FileUpload}/index.js +0 -0
- /package/lib/{FlexGrid → esm/FlexGrid}/Col/Col.js +0 -0
- /package/lib/{FlexGrid → esm/FlexGrid}/Col/index.js +0 -0
- /package/lib/{FlexGrid → esm/FlexGrid}/FlexGrid.js +0 -0
- /package/lib/{FlexGrid → esm/FlexGrid}/Row/Row.js +0 -0
- /package/lib/{FlexGrid → esm/FlexGrid}/Row/index.js +0 -0
- /package/lib/{FlexGrid → esm/FlexGrid}/helpers/index.js +0 -0
- /package/lib/{FlexGrid → esm/FlexGrid}/index.js +0 -0
- /package/lib/{FlexGrid → esm/FlexGrid}/providers/GutterContext.js +0 -0
- /package/lib/{Footnote → esm/Footnote}/Footnote.js +0 -0
- /package/lib/{Footnote → esm/Footnote}/FootnoteLink.js +0 -0
- /package/lib/{Footnote → esm/Footnote}/dictionary.js +0 -0
- /package/lib/{Footnote → esm/Footnote}/index.js +0 -0
- /package/lib/{HorizontalScroll → esm/HorizontalScroll}/HorizontalScroll.js +0 -0
- /package/lib/{HorizontalScroll → esm/HorizontalScroll}/HorizontalScrollButton.js +0 -0
- /package/lib/{HorizontalScroll → esm/HorizontalScroll}/ScrollViewEnd.js +0 -0
- /package/lib/{HorizontalScroll → esm/HorizontalScroll}/ScrollViewEnd.native.js +0 -0
- /package/lib/{HorizontalScroll → esm/HorizontalScroll}/dictionary.js +0 -0
- /package/lib/{HorizontalScroll → esm/HorizontalScroll}/index.js +0 -0
- /package/lib/{HorizontalScroll → esm/HorizontalScroll}/itemPositions.js +0 -0
- /package/lib/{Icon → esm/Icon}/IconText.js +0 -0
- /package/lib/{Icon → esm/Icon}/index.js +0 -0
- /package/lib/{IconButton → esm/IconButton}/IconButton.js +0 -0
- /package/lib/{IconButton → esm/IconButton}/index.js +0 -0
- /package/lib/{InputLabel → esm/InputLabel}/InputLabel.js +0 -0
- /package/lib/{InputLabel → esm/InputLabel}/LabelContent.js +0 -0
- /package/lib/{InputLabel → esm/InputLabel}/LabelContent.native.js +0 -0
- /package/lib/{InputLabel → esm/InputLabel}/index.js +0 -0
- /package/lib/{InputSupports → esm/InputSupports}/InputSupports.js +0 -0
- /package/lib/{InputSupports → esm/InputSupports}/dictionary.js +0 -0
- /package/lib/{InputSupports → esm/InputSupports}/index.js +0 -0
- /package/lib/{InputSupports → esm/InputSupports}/useInputSupports.js +0 -0
- /package/lib/{Link → esm/Link}/ChevronLink.js +0 -0
- /package/lib/{Link → esm/Link}/InlinePressable.js +0 -0
- /package/lib/{Link → esm/Link}/InlinePressable.native.js +0 -0
- /package/lib/{Link → esm/Link}/Link.js +0 -0
- /package/lib/{Link → esm/Link}/TextButton.js +0 -0
- /package/lib/{Link → esm/Link}/index.js +0 -0
- /package/lib/{List → esm/List}/List.js +0 -0
- /package/lib/{List → esm/List}/ListItem.js +0 -0
- /package/lib/{List → esm/List}/ListItemBase.js +0 -0
- /package/lib/{List → esm/List}/ListItemContent.js +0 -0
- /package/lib/{List → esm/List}/ListItemMark.js +0 -0
- /package/lib/{List → esm/List}/PressableListItemBase.js +0 -0
- /package/lib/{List → esm/List}/index.js +0 -0
- /package/lib/{Listbox → esm/Listbox}/GroupControl.js +0 -0
- /package/lib/{Listbox → esm/Listbox}/Listbox.js +0 -0
- /package/lib/{Listbox → esm/Listbox}/ListboxContext.js +0 -0
- /package/lib/{Listbox → esm/Listbox}/ListboxGroup.js +0 -0
- /package/lib/{Listbox → esm/Listbox}/ListboxItem.js +0 -0
- /package/lib/{Listbox → esm/Listbox}/ListboxOverlay.js +0 -0
- /package/lib/{Listbox → esm/Listbox}/PressableItem.js +0 -0
- /package/lib/{Listbox → esm/Listbox}/index.js +0 -0
- /package/lib/{Modal → esm/Modal}/ModalContent.js +0 -0
- /package/lib/{Modal → esm/Modal}/WebModal.js +0 -0
- /package/lib/{Modal → esm/Modal}/dictionary.js +0 -0
- /package/lib/{Modal → esm/Modal}/index.js +0 -0
- /package/lib/{MultiSelectFilter → esm/MultiSelectFilter}/ModalOverlay.js +0 -0
- /package/lib/{MultiSelectFilter → esm/MultiSelectFilter}/dictionary.js +0 -0
- /package/lib/{MultiSelectFilter → esm/MultiSelectFilter}/index.js +0 -0
- /package/lib/{Notification → esm/Notification}/dictionary.js +0 -0
- /package/lib/{Notification → esm/Notification}/index.js +0 -0
- /package/lib/{OrderedList → esm/OrderedList}/Item.js +0 -0
- /package/lib/{OrderedList → esm/OrderedList}/ItemBase.js +0 -0
- /package/lib/{OrderedList → esm/OrderedList}/OrderedList.js +0 -0
- /package/lib/{OrderedList → esm/OrderedList}/OrderedListBase.js +0 -0
- /package/lib/{OrderedList → esm/OrderedList}/index.js +0 -0
- /package/lib/{Pagination → esm/Pagination}/PageButton.js +0 -0
- /package/lib/{Pagination → esm/Pagination}/Pagination.js +0 -0
- /package/lib/{Pagination → esm/Pagination}/SideButton.js +0 -0
- /package/lib/{Pagination → esm/Pagination}/constants.js +0 -0
- /package/lib/{Pagination → esm/Pagination}/dictionary.js +0 -0
- /package/lib/{Pagination → esm/Pagination}/index.js +0 -0
- /package/lib/{Pagination → esm/Pagination}/usePagination.js +0 -0
- /package/lib/{Portal → esm/Portal}/Portal.js +0 -0
- /package/lib/{Portal → esm/Portal}/Portal.native.js +0 -0
- /package/lib/{Portal → esm/Portal}/index.js +0 -0
- /package/lib/{PriceLockup → esm/PriceLockup}/PriceLockup.js +0 -0
- /package/lib/{PriceLockup → esm/PriceLockup}/index.js +0 -0
- /package/lib/{PriceLockup → esm/PriceLockup}/utils/renderFootnoteContent.js +0 -0
- /package/lib/{PriceLockup → esm/PriceLockup}/utils/renderFootnoteLinks.js +0 -0
- /package/lib/{PriceLockup → esm/PriceLockup}/utils/renderPrice.js +0 -0
- /package/lib/{PriceLockup → esm/PriceLockup}/utils/renderTypography.js +0 -0
- /package/lib/{ProductCard → esm/ProductCard}/ProductCard.js +0 -0
- /package/lib/{ProductCard → esm/ProductCard}/dictionary.js +0 -0
- /package/lib/{ProductCard → esm/ProductCard}/index.js +0 -0
- /package/lib/{ProductCardGroup → esm/ProductCardGroup}/ProductCardGroup.js +0 -0
- /package/lib/{ProductCardGroup → esm/ProductCardGroup}/index.js +0 -0
- /package/lib/{Progress → esm/Progress}/Progress.js +0 -0
- /package/lib/{Progress → esm/Progress}/ProgressBar.js +0 -0
- /package/lib/{Progress → esm/Progress}/ProgressBarBackground.js +0 -0
- /package/lib/{Progress → esm/Progress}/constants.js +0 -0
- /package/lib/{Progress → esm/Progress}/index.js +0 -0
- /package/lib/{QuickLinks → esm/QuickLinks}/QuickLinks.js +0 -0
- /package/lib/{QuickLinks → esm/QuickLinks}/QuickLinksCard.js +0 -0
- /package/lib/{QuickLinks → esm/QuickLinks}/QuickLinksItem.js +0 -0
- /package/lib/{QuickLinks → esm/QuickLinks}/index.js +0 -0
- /package/lib/{QuickLinksFeature → esm/QuickLinksFeature}/QuickLinksFeature.js +0 -0
- /package/lib/{QuickLinksFeature → esm/QuickLinksFeature}/QuickLinksFeatureItem.js +0 -0
- /package/lib/{QuickLinksFeature → esm/QuickLinksFeature}/index.js +0 -0
- /package/lib/{Radio → esm/Radio}/Radio.js +0 -0
- /package/lib/{Radio → esm/Radio}/RadioButton.js +0 -0
- /package/lib/{Radio → esm/Radio}/RadioGroup.js +0 -0
- /package/lib/{Radio → esm/Radio}/RadioInput.js +0 -0
- /package/lib/{Radio → esm/Radio}/RadioInput.native.js +0 -0
- /package/lib/{Radio → esm/Radio}/index.js +0 -0
- /package/lib/{RadioCard → esm/RadioCard}/RadioCard.js +0 -0
- /package/lib/{RadioCard → esm/RadioCard}/RadioCardGroup.js +0 -0
- /package/lib/{RadioCard → esm/RadioCard}/index.js +0 -0
- /package/lib/{Responsive → esm/Responsive}/Responsive.js +0 -0
- /package/lib/{Responsive → esm/Responsive}/ResponsiveProp.js +0 -0
- /package/lib/{Responsive → esm/Responsive}/ResponsiveWithMediaQueryStyleSheet.js +0 -0
- /package/lib/{Responsive → esm/Responsive}/index.js +0 -0
- /package/lib/{Search → esm/Search}/Search.js +0 -0
- /package/lib/{Search → esm/Search}/dictionary.js +0 -0
- /package/lib/{Search → esm/Search}/index.js +0 -0
- /package/lib/{Select → esm/Select}/Group.js +0 -0
- /package/lib/{Select → esm/Select}/Group.native.js +0 -0
- /package/lib/{Select → esm/Select}/Item.js +0 -0
- /package/lib/{Select → esm/Select}/Item.native.js +0 -0
- /package/lib/{Select → esm/Select}/Picker.js +0 -0
- /package/lib/{Select → esm/Select}/Picker.native.js +0 -0
- /package/lib/{Select → esm/Select}/Select.js +0 -0
- /package/lib/{Select → esm/Select}/constants.js +0 -0
- /package/lib/{Select → esm/Select}/index.js +0 -0
- /package/lib/{SideNav → esm/SideNav}/Item.js +0 -0
- /package/lib/{SideNav → esm/SideNav}/ItemContent.js +0 -0
- /package/lib/{SideNav → esm/SideNav}/ItemsGroup.js +0 -0
- /package/lib/{SideNav → esm/SideNav}/SideNav.js +0 -0
- /package/lib/{SideNav → esm/SideNav}/index.js +0 -0
- /package/lib/{Skeleton → esm/Skeleton}/Skeleton.js +0 -0
- /package/lib/{Skeleton → esm/Skeleton}/index.js +0 -0
- /package/lib/{Skeleton → esm/Skeleton}/skeleton.constant.js +0 -0
- /package/lib/{Skeleton → esm/Skeleton}/skeletonWebAnimation.js +0 -0
- /package/lib/{Skeleton → esm/Skeleton}/useSkeletonNativeAnimation.js +0 -0
- /package/lib/{SkipLink → esm/SkipLink}/SkipLink.js +0 -0
- /package/lib/{SkipLink → esm/SkipLink}/index.js +0 -0
- /package/lib/{Spacer → esm/Spacer}/Spacer.js +0 -0
- /package/lib/{Spacer → esm/Spacer}/index.js +0 -0
- /package/lib/{StackView → esm/StackView}/StackView.js +0 -0
- /package/lib/{StackView → esm/StackView}/StackWrap.js +0 -0
- /package/lib/{StackView → esm/StackView}/StackWrap.native.js +0 -0
- /package/lib/{StackView → esm/StackView}/StackWrapBox.js +0 -0
- /package/lib/{StackView → esm/StackView}/StackWrapGap.js +0 -0
- /package/lib/{StackView → esm/StackView}/common.js +0 -0
- /package/lib/{StackView → esm/StackView}/getStackedContent.js +0 -0
- /package/lib/{StackView → esm/StackView}/index.js +0 -0
- /package/lib/{Status → esm/Status}/Status.js +0 -0
- /package/lib/{Status → esm/Status}/index.js +0 -0
- /package/lib/{StepTracker → esm/StepTracker}/Step.js +0 -0
- /package/lib/{StepTracker → esm/StepTracker}/StepTracker.js +0 -0
- /package/lib/{StepTracker → esm/StepTracker}/dictionary.js +0 -0
- /package/lib/{StepTracker → esm/StepTracker}/index.js +0 -0
- /package/lib/{TabBar → esm/TabBar}/TabBar.js +0 -0
- /package/lib/{TabBar → esm/TabBar}/TabBarItem.js +0 -0
- /package/lib/{TabBar → esm/TabBar}/index.js +0 -0
- /package/lib/{Tabs → esm/Tabs}/Tabs.js +0 -0
- /package/lib/{Tabs → esm/Tabs}/index.js +0 -0
- /package/lib/{Tags → esm/Tags}/Tags.js +0 -0
- /package/lib/{Tags → esm/Tags}/index.js +0 -0
- /package/lib/{TextInput → esm/TextInput}/TextArea.js +0 -0
- /package/lib/{TextInput → esm/TextInput}/TextInput.js +0 -0
- /package/lib/{TextInput → esm/TextInput}/TextInputBase.js +0 -0
- /package/lib/{TextInput → esm/TextInput}/dictionary.js +0 -0
- /package/lib/{TextInput → esm/TextInput}/index.js +0 -0
- /package/lib/{TextInput → esm/TextInput}/propTypes.js +0 -0
- /package/lib/{ThemeProvider → esm/ThemeProvider}/ThemeProvider.js +0 -0
- /package/lib/{ThemeProvider → esm/ThemeProvider}/index.js +0 -0
- /package/lib/{ThemeProvider → esm/ThemeProvider}/useResponsiveThemeTokens.js +0 -0
- /package/lib/{ThemeProvider → esm/ThemeProvider}/useSetTheme.js +0 -0
- /package/lib/{ThemeProvider → esm/ThemeProvider}/useTheme.js +0 -0
- /package/lib/{ThemeProvider → esm/ThemeProvider}/useThemeTokens.js +0 -0
- /package/lib/{ThemeProvider → esm/ThemeProvider}/utils/index.js +0 -0
- /package/lib/{ThemeProvider → esm/ThemeProvider}/utils/styles.js +0 -0
- /package/lib/{ThemeProvider → esm/ThemeProvider}/utils/theme-tokens.js +0 -0
- /package/lib/{Timeline → esm/Timeline}/Timeline.js +0 -0
- /package/lib/{Timeline → esm/Timeline}/index.js +0 -0
- /package/lib/{ToggleSwitch → esm/ToggleSwitch}/ToggleSwitch.js +0 -0
- /package/lib/{ToggleSwitch → esm/ToggleSwitch}/ToggleSwitchGroup.js +0 -0
- /package/lib/{ToggleSwitch → esm/ToggleSwitch}/index.js +0 -0
- /package/lib/{Tooltip → esm/Tooltip}/Backdrop.js +0 -0
- /package/lib/{Tooltip → esm/Tooltip}/Backdrop.native.js +0 -0
- /package/lib/{Tooltip → esm/Tooltip}/Tooltip.js +0 -0
- /package/lib/{Tooltip → esm/Tooltip}/Tooltip.native.js +0 -0
- /package/lib/{Tooltip → esm/Tooltip}/dictionary.js +0 -0
- /package/lib/{Tooltip → esm/Tooltip}/getTooltipPosition.js +0 -0
- /package/lib/{Tooltip → esm/Tooltip}/index.js +0 -0
- /package/lib/{Tooltip → esm/Tooltip}/shared.js +0 -0
- /package/lib/{TooltipButton → esm/TooltipButton}/TooltipButton.js +0 -0
- /package/lib/{TooltipButton → esm/TooltipButton}/index.js +0 -0
- /package/lib/{Typography → esm/Typography}/Typography.js +0 -0
- /package/lib/{Typography → esm/Typography}/index.js +0 -0
- /package/lib/{Validator → esm/Validator}/Validator.js +0 -0
- /package/lib/{Validator → esm/Validator}/index.js +0 -0
- /package/lib/{ViewportProvider → esm/ViewportProvider}/ViewportProvider.js +0 -0
- /package/lib/{ViewportProvider → esm/ViewportProvider}/index.js +0 -0
- /package/lib/{ViewportProvider → esm/ViewportProvider}/useViewport.js +0 -0
- /package/lib/{ViewportProvider → esm/ViewportProvider}/useViewportListener.js +0 -0
- /package/lib/{index.js → esm/index.js} +0 -0
- /package/lib/{server.js → esm/server.js} +0 -0
- /package/lib/{utils → esm/utils}/BaseView/BaseView.js +0 -0
- /package/lib/{utils → esm/utils}/BaseView/BaseView.native.js +0 -0
- /package/lib/{utils → esm/utils}/BaseView/index.js +0 -0
- /package/lib/{utils → esm/utils}/a11y/index.js +0 -0
- /package/lib/{utils → esm/utils}/a11y/semantics.js +0 -0
- /package/lib/{utils → esm/utils}/a11y/textSize.js +0 -0
- /package/lib/{utils → esm/utils}/animation/index.js +0 -0
- /package/lib/{utils → esm/utils}/animation/useVerticalExpandAnimation.js +0 -0
- /package/lib/{utils → esm/utils}/children.js +0 -0
- /package/lib/{utils → esm/utils}/containUniqueFields.js +0 -0
- /package/lib/{utils → esm/utils}/convertFromMegaByteToByte.js +0 -0
- /package/lib/{utils → esm/utils}/floating-ui/index.js +0 -0
- /package/lib/{utils → esm/utils}/floating-ui/index.native.js +0 -0
- /package/lib/{utils → esm/utils}/formatImageSource.js +0 -0
- /package/lib/{utils → esm/utils}/hasOwnProperty.js +0 -0
- /package/lib/{utils → esm/utils}/htmlAttrs.js +0 -0
- /package/lib/{utils → esm/utils}/index.js +0 -0
- /package/lib/{utils → esm/utils}/info/index.js +0 -0
- /package/lib/{utils → esm/utils}/info/platform/index.js +0 -0
- /package/lib/{utils → esm/utils}/info/platform/platform.android.js +0 -0
- /package/lib/{utils → esm/utils}/info/platform/platform.ios.js +0 -0
- /package/lib/{utils → esm/utils}/info/platform/platform.js +0 -0
- /package/lib/{utils → esm/utils}/info/platform/platform.native.js +0 -0
- /package/lib/{utils → esm/utils}/info/versions.js +0 -0
- /package/lib/{utils → esm/utils}/input.js +0 -0
- /package/lib/{utils → esm/utils}/pressability.js +0 -0
- /package/lib/{utils → esm/utils}/props/a11yProps.js +0 -0
- /package/lib/{utils → esm/utils}/props/clickProps.js +0 -0
- /package/lib/{utils → esm/utils}/props/componentPropType.js +0 -0
- /package/lib/{utils → esm/utils}/props/contentfulProps.js +0 -0
- /package/lib/{utils → esm/utils}/props/copyPropTypes.js +0 -0
- /package/lib/{utils → esm/utils}/props/getPropSelector.js +0 -0
- /package/lib/{utils → esm/utils}/props/handlerProps.js +0 -0
- /package/lib/{utils → esm/utils}/props/hrefAttrsProp.js +0 -0
- /package/lib/{utils → esm/utils}/props/index.js +0 -0
- /package/lib/{utils → esm/utils}/props/inputSupportsProps.js +0 -0
- /package/lib/{utils → esm/utils}/props/linkProps.js +0 -0
- /package/lib/{utils → esm/utils}/props/paddingProp.js +0 -0
- /package/lib/{utils → esm/utils}/props/pressProps.js +0 -0
- /package/lib/{utils → esm/utils}/props/rectProp.js +0 -0
- /package/lib/{utils → esm/utils}/props/responsiveProps.js +0 -0
- /package/lib/{utils → esm/utils}/props/selectSystemProps.js +0 -0
- /package/lib/{utils → esm/utils}/props/spacingProps.js +0 -0
- /package/lib/{utils → esm/utils}/props/textInputProps.js +0 -0
- /package/lib/{utils → esm/utils}/props/textProps.js +0 -0
- /package/lib/{utils → esm/utils}/props/tokens.js +0 -0
- /package/lib/{utils → esm/utils}/props/variantProp.js +0 -0
- /package/lib/{utils → esm/utils}/props/viewProps.js +0 -0
- /package/lib/{utils → esm/utils}/ssr-media-query/create-stylesheet/create-stylesheet-mobile.js +0 -0
- /package/lib/{utils → esm/utils}/ssr-media-query/create-stylesheet/index.android.js +0 -0
- /package/lib/{utils → esm/utils}/ssr-media-query/create-stylesheet/index.ios.js +0 -0
- /package/lib/{utils → esm/utils}/ssr-media-query/create-stylesheet/index.js +0 -0
- /package/lib/{utils → esm/utils}/ssr-media-query/hash.js +0 -0
- /package/lib/{utils → esm/utils}/ssr-media-query/index.js +0 -0
- /package/lib/{utils → esm/utils}/ssr-media-query/utils/common.js +0 -0
- /package/lib/{utils → esm/utils}/ssr-media-query/utils/create-declaration-block.js +0 -0
- /package/lib/{utils → esm/utils}/ssr-media-query/utils/create-media-query-styles.js +0 -0
- /package/lib/{utils → esm/utils}/ssr-media-query/utils/hyphenate-style-name.js +0 -0
- /package/lib/{utils → esm/utils}/ssr-media-query/utils/inject.js +0 -0
- /package/lib/{utils → esm/utils}/ssr.js +0 -0
- /package/lib/{utils → esm/utils}/transformGradient.js +0 -0
- /package/lib/{utils → esm/utils}/useCopy.js +0 -0
- /package/lib/{utils → esm/utils}/useHash.js +0 -0
- /package/lib/{utils → esm/utils}/useHash.native.js +0 -0
- /package/lib/{utils → esm/utils}/useOverlaidPosition.js +0 -0
- /package/lib/{utils → esm/utils}/useResponsiveProp.js +0 -0
- /package/lib/{utils → esm/utils}/useSafeLayoutEffect.js +0 -0
- /package/lib/{utils → esm/utils}/useScrollBlocking.js +0 -0
- /package/lib/{utils → esm/utils}/useScrollBlocking.native.js +0 -0
- /package/lib/{utils → esm/utils}/useSpacingScale.js +0 -0
- /package/lib/{utils → esm/utils}/useUniqueId.js +0 -0
- /package/lib/{utils → esm/utils}/withLinkRouter.js +0 -0
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.uninitialisedError = exports.default = exports.ThemeSetterContext = exports.ThemeContext = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
+
var _utils = require("./utils");
|
|
10
|
+
var _responsiveProps = _interopRequireDefault(require("../utils/props/responsiveProps"));
|
|
11
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
|
+
const uninitialisedError = exports.uninitialisedError = new Error('Theme context used outside of ThemeProvider');
|
|
14
|
+
const ThemeContext = exports.ThemeContext = /*#__PURE__*/_react.default.createContext(uninitialisedError);
|
|
15
|
+
const ThemeSetterContext = exports.ThemeSetterContext = /*#__PURE__*/_react.default.createContext(uninitialisedError);
|
|
16
|
+
|
|
17
|
+
// These options default to `true` in v1.x to match legacy defaults and avoid breaking changes.
|
|
18
|
+
// This should change in future major releases to become "opt-in" legacy support.
|
|
19
|
+
const defaultThemeOptions = {
|
|
20
|
+
// TODO: switch `forceAbsoluteFontSizing` to be false by default in the next major version
|
|
21
|
+
forceAbsoluteFontSizing: true,
|
|
22
|
+
// TODO: switch `forceZIndex` to be false by default in the next major version
|
|
23
|
+
forceZIndex: true,
|
|
24
|
+
// TODO: switch `enableHelmetSSR` to be false by default in the next major version
|
|
25
|
+
enableHelmetSSR: true,
|
|
26
|
+
enableMediaQueryStyleSheet: false
|
|
27
|
+
};
|
|
28
|
+
const ThemeProvider = _ref => {
|
|
29
|
+
let {
|
|
30
|
+
children,
|
|
31
|
+
defaultTheme,
|
|
32
|
+
themeOptions = {}
|
|
33
|
+
} = _ref;
|
|
34
|
+
const [theme, setTheme] = _react.default.useState(defaultTheme);
|
|
35
|
+
_react.default.useEffect(() => {
|
|
36
|
+
if (theme.metadata.name !== defaultTheme.metadata.name) {
|
|
37
|
+
setTheme(defaultTheme);
|
|
38
|
+
}
|
|
39
|
+
}, [theme.metadata.name, defaultTheme]);
|
|
40
|
+
const appliedThemeOptions = {
|
|
41
|
+
...defaultThemeOptions,
|
|
42
|
+
...themeOptions
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
// Validate the theme tokens version on every render.
|
|
46
|
+
// This will intentionally break the application when attempting to use an invalid theme.
|
|
47
|
+
// This will surface an incompatibility quickly rather than allowing the potential for strange bugs due to missing or incompatible tokens.
|
|
48
|
+
(0, _utils.validateThemeTokensVersion)(theme);
|
|
49
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(ThemeSetterContext.Provider, {
|
|
50
|
+
value: setTheme,
|
|
51
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(ThemeContext.Provider, {
|
|
52
|
+
value: {
|
|
53
|
+
...theme,
|
|
54
|
+
themeOptions: appliedThemeOptions
|
|
55
|
+
},
|
|
56
|
+
children: children
|
|
57
|
+
})
|
|
58
|
+
});
|
|
59
|
+
};
|
|
60
|
+
ThemeProvider.propTypes = {
|
|
61
|
+
children: _propTypes.default.node.isRequired,
|
|
62
|
+
defaultTheme: _propTypes.default.shape({
|
|
63
|
+
metadata: _propTypes.default.shape({
|
|
64
|
+
themeTokensVersion: _propTypes.default.string.isRequired,
|
|
65
|
+
name: _propTypes.default.string.isRequired
|
|
66
|
+
}).isRequired
|
|
67
|
+
}).isRequired,
|
|
68
|
+
/**
|
|
69
|
+
* An object containing options allowing to customize the theming experience:
|
|
70
|
+
*
|
|
71
|
+
* - `forceAbsoluteFontSizing`: available on web only; when set to true, allows
|
|
72
|
+
* using absolute font sizing (in pixels, doesn't scale) instead of the
|
|
73
|
+
* relative sizing (in `rem`, scales depending on the browser settings)
|
|
74
|
+
* - `contentMaxWidth`: allows configuration of the content max width to be used in components
|
|
75
|
+
* such as Footnote and Notification to avoid content to stretch width more then the page's width
|
|
76
|
+
* - `forceZIndex`: available on web only, when set to false, sets zIndex on `View` to be `auto`
|
|
77
|
+
* and when true, sets zIndex to be `0` (the default from `react-native-web`)
|
|
78
|
+
* - `enableHelmetSSR`: on Web SSR, allows React Helmet to run during server-side rendering. This should be
|
|
79
|
+
* disabled unless a web app has been specifically configured to stop React Helmet accumulating
|
|
80
|
+
* instances (which may cause a memory leak). See React Helmet's docs: https://github.com/nfl/react-helmet
|
|
81
|
+
* - `enableMediaQueryStyleSheet`: enables the use of Media Query StyleSheet.
|
|
82
|
+
*/
|
|
83
|
+
themeOptions: _propTypes.default.shape({
|
|
84
|
+
forceAbsoluteFontSizing: _propTypes.default.bool,
|
|
85
|
+
forceZIndex: _propTypes.default.bool,
|
|
86
|
+
enableHelmetSSR: _propTypes.default.bool,
|
|
87
|
+
contentMaxWidth: _responsiveProps.default.getTypeOptionallyByViewport(_propTypes.default.number),
|
|
88
|
+
enableMediaQueryStyleSheet: _propTypes.default.bool
|
|
89
|
+
})
|
|
90
|
+
};
|
|
91
|
+
var _default = exports.default = ThemeProvider;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _exportNames = {
|
|
7
|
+
useTheme: true,
|
|
8
|
+
useSetTheme: true,
|
|
9
|
+
useResponsiveThemeTokens: true
|
|
10
|
+
};
|
|
11
|
+
exports.default = void 0;
|
|
12
|
+
Object.defineProperty(exports, "useResponsiveThemeTokens", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _useResponsiveThemeTokens.default;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
Object.defineProperty(exports, "useSetTheme", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function () {
|
|
21
|
+
return _useSetTheme.default;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
Object.defineProperty(exports, "useTheme", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function () {
|
|
27
|
+
return _useTheme.default;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
var _ThemeProvider = _interopRequireDefault(require("./ThemeProvider"));
|
|
31
|
+
var _useTheme = _interopRequireDefault(require("./useTheme"));
|
|
32
|
+
var _useSetTheme = _interopRequireDefault(require("./useSetTheme"));
|
|
33
|
+
var _useResponsiveThemeTokens = _interopRequireDefault(require("./useResponsiveThemeTokens"));
|
|
34
|
+
var _useThemeTokens = require("./useThemeTokens");
|
|
35
|
+
Object.keys(_useThemeTokens).forEach(function (key) {
|
|
36
|
+
if (key === "default" || key === "__esModule") return;
|
|
37
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
38
|
+
if (key in exports && exports[key] === _useThemeTokens[key]) return;
|
|
39
|
+
Object.defineProperty(exports, key, {
|
|
40
|
+
enumerable: true,
|
|
41
|
+
get: function () {
|
|
42
|
+
return _useThemeTokens[key];
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
});
|
|
46
|
+
var _utils = require("./utils");
|
|
47
|
+
Object.keys(_utils).forEach(function (key) {
|
|
48
|
+
if (key === "default" || key === "__esModule") return;
|
|
49
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
50
|
+
if (key in exports && exports[key] === _utils[key]) return;
|
|
51
|
+
Object.defineProperty(exports, key, {
|
|
52
|
+
enumerable: true,
|
|
53
|
+
get: function () {
|
|
54
|
+
return _utils[key];
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
});
|
|
58
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
59
|
+
var _default = exports.default = _ThemeProvider.default;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _systemConstants = require("@telus-uds/system-constants");
|
|
8
|
+
var _useTheme = _interopRequireDefault(require("./useTheme"));
|
|
9
|
+
var _utils = require("./utils");
|
|
10
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
|
+
const getResponsiveThemeTokens = function (_ref, tokensProp) {
|
|
12
|
+
let {
|
|
13
|
+
rules = [],
|
|
14
|
+
tokens: defaultThemeTokens = {}
|
|
15
|
+
} = _ref;
|
|
16
|
+
let variants = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
17
|
+
let states = arguments.length > 3 ? arguments[3] : undefined;
|
|
18
|
+
const appearances = (0, _utils.mergeAppearances)(variants, states);
|
|
19
|
+
const tokensByViewport = Object.fromEntries(_systemConstants.viewports.keys.map(viewport => [viewport, {
|
|
20
|
+
...defaultThemeTokens
|
|
21
|
+
}]));
|
|
22
|
+
|
|
23
|
+
// Go through each rule and collect them for the corresponding viewport if they apply
|
|
24
|
+
rules.forEach(rule => {
|
|
25
|
+
if (doesRuleApply(rule, appearances)) {
|
|
26
|
+
// If the rule does not have a viewport specified, we collect it in all viewports
|
|
27
|
+
let targetViewports = rule.if.viewport || _systemConstants.viewports.keys;
|
|
28
|
+
if (!Array.isArray(targetViewports)) {
|
|
29
|
+
targetViewports = [targetViewports];
|
|
30
|
+
}
|
|
31
|
+
targetViewports.forEach(viewport => {
|
|
32
|
+
tokensByViewport[viewport] = {
|
|
33
|
+
...tokensByViewport[viewport],
|
|
34
|
+
...rule.tokens
|
|
35
|
+
};
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
Object.keys(tokensByViewport).forEach(viewport => {
|
|
40
|
+
tokensByViewport[viewport] = (0, _utils.resolveThemeTokens)(tokensByViewport[viewport], appearances, tokensProp);
|
|
41
|
+
});
|
|
42
|
+
return tokensByViewport;
|
|
43
|
+
};
|
|
44
|
+
const doesRuleApply = (rule, appearances) => Object.entries(rule.if).every(condition => doesConditionApply(condition, appearances));
|
|
45
|
+
const doesConditionApply = (_ref2, appearances) => {
|
|
46
|
+
let [key, value] = _ref2;
|
|
47
|
+
if (key === 'viewport') {
|
|
48
|
+
return true;
|
|
49
|
+
}
|
|
50
|
+
// use null rather than undefined so we can serialise the value in themes
|
|
51
|
+
const appearanceValue = appearances[key] ?? null;
|
|
52
|
+
return Array.isArray(value) ? value.includes(appearanceValue) : value === appearanceValue;
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* @typedef {import('../utils/props/tokens.js').TokensSet} TokensSet
|
|
57
|
+
* @typedef {import('../utils/props/tokens.js').TokensProp} TokensProp
|
|
58
|
+
* @typedef {import('../utils/props/variantProp').AppearanceSet} AppearanceSet
|
|
59
|
+
*
|
|
60
|
+
* Returns a complete set of tokens for a component for each viewport based on which of the
|
|
61
|
+
* component's theme rules apply to the current set of theme appearances.
|
|
62
|
+
* Pass the returned output to createMediaQueryStyles to generate media query styles for use inside
|
|
63
|
+
* the media query stylesheet from './utils/ssr-media-query'.
|
|
64
|
+
*
|
|
65
|
+
* @typedef {Object} ResponsiveObject
|
|
66
|
+
* @property {TokensSet} xs
|
|
67
|
+
* @property {TokensSet} sm
|
|
68
|
+
* @property {TokensSet} md
|
|
69
|
+
* @property {TokensSet} lg
|
|
70
|
+
* @property {TokensSet} xl
|
|
71
|
+
*
|
|
72
|
+
* @param { string } componentName
|
|
73
|
+
* @param { TokensProp } tokens
|
|
74
|
+
* @param { AppearanceSet } variants
|
|
75
|
+
* @param { AppearanceSet } states
|
|
76
|
+
* @returns { ResponsiveObject }
|
|
77
|
+
*/
|
|
78
|
+
|
|
79
|
+
const useResponsiveThemeTokens = function (componentName) {
|
|
80
|
+
let tokens = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
81
|
+
let variants = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
82
|
+
let states = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
|
83
|
+
const theme = (0, _useTheme.default)();
|
|
84
|
+
const componentTheme = (0, _utils.getComponentTheme)(theme, componentName);
|
|
85
|
+
const themeTokens = getResponsiveThemeTokens(componentTheme, tokens, variants, states);
|
|
86
|
+
return themeTokens;
|
|
87
|
+
};
|
|
88
|
+
var _default = exports.default = useResponsiveThemeTokens;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
var _ThemeProvider = require("./ThemeProvider");
|
|
9
|
+
const useSetTheme = () => {
|
|
10
|
+
// Replace current theme with provided object
|
|
11
|
+
const setTheme = (0, _react.useContext)(_ThemeProvider.ThemeSetterContext);
|
|
12
|
+
// Fail fast if dev uses useSetTheme outside of ThemeProvider
|
|
13
|
+
if (setTheme instanceof Error) {
|
|
14
|
+
throw setTheme;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
// Merge provided object into current theme
|
|
18
|
+
const editTheme = (0, _react.useCallback)(newTheme => setTheme(function () {
|
|
19
|
+
let oldTheme = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
20
|
+
return {
|
|
21
|
+
...oldTheme,
|
|
22
|
+
...newTheme
|
|
23
|
+
};
|
|
24
|
+
}), [setTheme]);
|
|
25
|
+
return {
|
|
26
|
+
setTheme,
|
|
27
|
+
editTheme
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
var _default = exports.default = useSetTheme;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
var _ThemeProvider = require("./ThemeProvider");
|
|
9
|
+
const useTheme = () => {
|
|
10
|
+
const theme = (0, _react.useContext)(_ThemeProvider.ThemeContext);
|
|
11
|
+
// Fail fast if dev uses useTheme outside of ThemeProvider
|
|
12
|
+
if (theme instanceof Error) {
|
|
13
|
+
throw theme;
|
|
14
|
+
}
|
|
15
|
+
return theme;
|
|
16
|
+
};
|
|
17
|
+
var _default = exports.default = useTheme;
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useThemeTokensCallback = exports.useThemeTokens = void 0;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
var _useTheme = _interopRequireDefault(require("./useTheme"));
|
|
9
|
+
var _utils = require("./utils");
|
|
10
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
|
+
/**
|
|
12
|
+
* @typedef {import('../utils/props/variantProp.js').AppearanceSet} AppearanceSet
|
|
13
|
+
* @typedef {import('../utils/props/tokens.js').TokensProp} TokensProp
|
|
14
|
+
* @typedef {import('../utils/props/tokens.js').TokensSet} TokensSet
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Returns a complete set of theme tokens for a component based on which of the
|
|
19
|
+
* component's theme rules apply to the current set of theme appearances.
|
|
20
|
+
*
|
|
21
|
+
* When applying theme tokens as styles to a component, don't spread the theme tokens
|
|
22
|
+
* object, explicitly select each property. This way, if new theme tokens are added to the
|
|
23
|
+
* component's theme in a minor or patch release of the theme package, the appearance
|
|
24
|
+
* of the component in sites and apps will only change when the component itself is updated.
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* const seletContainerTokens = ({ color, width, height }) => ({
|
|
28
|
+
* backgroundColor: color, width, height
|
|
29
|
+
* })
|
|
30
|
+
* const MyComponent = ({ tokens, variant, children }) => {
|
|
31
|
+
* const viewport = useViewport()
|
|
32
|
+
* const themeTokens = useThemeTokens('MyComponent', tokens, variant, { viewport })
|
|
33
|
+
* const style = seletContainerTokens(themeTokens)
|
|
34
|
+
* return <View style={style}>{children}</View>
|
|
35
|
+
* }
|
|
36
|
+
*
|
|
37
|
+
* @param {string} componentName - the name as defined in the theme schema of the component whose theme is to be used
|
|
38
|
+
* @param {TokensProp} [tokens] - every themed component should accept an optional `tokens` prop allowing theme tokens to be overridden
|
|
39
|
+
* @param {AppearanceSet} [variants] - every themed component should accept an optional `variants` prop specifying theme variants
|
|
40
|
+
* @param {AppearanceSet} [states] - optional object containing current theme appearances dictated by user action or context
|
|
41
|
+
* @returns {TokensSet} - the currently-applicable resolved set of theme tokens to apply
|
|
42
|
+
*/
|
|
43
|
+
const useThemeTokens = function (componentName) {
|
|
44
|
+
let tokens = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
45
|
+
let variants = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
46
|
+
let states = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
|
47
|
+
const theme = (0, _useTheme.default)();
|
|
48
|
+
const componentTheme = (0, _utils.getComponentTheme)(theme, componentName);
|
|
49
|
+
const themeTokens = (0, _utils.getThemeTokens)(componentTheme, tokens, variants, states);
|
|
50
|
+
return themeTokens;
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Returns a memoised tokens getter function that gets tokens similar to calling useThemeTokens.
|
|
55
|
+
* Scenarios where `useThemeTokensCallback` should be used instead of `useThemeTokens` include:
|
|
56
|
+
*
|
|
57
|
+
* - Where tokens are to be obtained from state that is accessible only in scopes like callbacks
|
|
58
|
+
* and render functions, where calling useThemeTokens directly would be disallowed by React's hook rules.
|
|
59
|
+
* - Passing a tokens getter down via a child component's `tokens` prop, applying rules using the
|
|
60
|
+
* child component's current state. Consider wrapping the returned tokens in `selectTokens()`.
|
|
61
|
+
*
|
|
62
|
+
* The function returned by `useThemeTokens` may be called with an object of state appearances to get an object
|
|
63
|
+
* of tokens, or may be passed as a `tokens` prop to other themed components or `useThemeTokens`/`useThemeTokensCallback`
|
|
64
|
+
* hooks.
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* // Resolving tokens inside Pressable's style function, based on Pressable state
|
|
68
|
+
* const PressMe = ({ tokens, variant, children }) => {
|
|
69
|
+
* const getTokens = useThemeTokensCallback('PressMe', tokens, variant)
|
|
70
|
+
* const getPressableStyle = ({ pressed }) => {
|
|
71
|
+
* const { color, width, height } = getTokens({ pressed })
|
|
72
|
+
* return { backgroundColor: color, width, height }
|
|
73
|
+
* }
|
|
74
|
+
* return <Pressable style={getPressableStyle}>{children}</Pressable>
|
|
75
|
+
* }
|
|
76
|
+
*
|
|
77
|
+
* @example
|
|
78
|
+
* // Setting the theme in a parent and resolving it in a child based on child's state
|
|
79
|
+
* const MenuButton = ({ tokens, variant, ...buttonProps }) => {
|
|
80
|
+
* // Define what theme, variant etc we want in this component...
|
|
81
|
+
* const getTokens = useThemeTokensCallback('Button', tokens, variant)
|
|
82
|
+
* // ...resolve them in another component based on its state (e.g. press, hover...)
|
|
83
|
+
* return <ButtonBase tokens={getTokens} accessibilityRole="menuitem" {...buttonProps} />
|
|
84
|
+
* }
|
|
85
|
+
*
|
|
86
|
+
* @example
|
|
87
|
+
* // Chaining multiple themes together, sharing the same variants and state
|
|
88
|
+
* const GlowingLink = ({ tokens, variant, children }) => {
|
|
89
|
+
* // applies a small theme for a glowing effect, using same variants and states as "link"
|
|
90
|
+
* const getGlowTokens = useThemeCallback('GlowingLink', tokens, variant)
|
|
91
|
+
* // applies link state to get "Link" theme tokens and merge "GlowingLink" tokens on top
|
|
92
|
+
* const getTokens = useThemeCallback('Link', getGlowTokens, variant)
|
|
93
|
+
* // renders a link with both themes applied, both based on current link state
|
|
94
|
+
* return <LinkBase tokens={getTokens}>{children}</LinkBase>
|
|
95
|
+
* }
|
|
96
|
+
*
|
|
97
|
+
* @param {string} componentName - the name as defined in the theme schema of the component whose theme is to be used
|
|
98
|
+
* @param {TokensProp} [tokens] - every themed component should accept a `tokens` prop allowing theme tokens to be overridden
|
|
99
|
+
* @param {AppearanceSet} [variants] - variants passed in as props that don't change dynamically
|
|
100
|
+
* @returns {(states: AppearanceSet, tokenOverrides?: TokensProp) => TokensSet}
|
|
101
|
+
* - callback function that returning an overridable tokens set for current state. Only pass
|
|
102
|
+
* tokenOverrides in rare cases where tokens overrides are also generated outside hook scope,
|
|
103
|
+
* e.g. if one theme tokens callback needs to pass certain token overrides to another.
|
|
104
|
+
*/
|
|
105
|
+
exports.useThemeTokens = useThemeTokens;
|
|
106
|
+
const useThemeTokensCallback = function (componentName) {
|
|
107
|
+
let tokens = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
108
|
+
let variants = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
109
|
+
const theme = (0, _useTheme.default)();
|
|
110
|
+
const componentTheme = (0, _utils.getComponentTheme)(theme, componentName);
|
|
111
|
+
const getThemeTokensCallback = (0, _react.useCallback)((states, tokenOverrides) => {
|
|
112
|
+
const appearances = (0, _utils.mergeAppearances)(variants, states);
|
|
113
|
+
const resolvedTokens = (0, _utils.resolveThemeTokens)(tokens, appearances, tokenOverrides);
|
|
114
|
+
return (0, _utils.getThemeTokens)(componentTheme, resolvedTokens, appearances);
|
|
115
|
+
}, [componentTheme, tokens, variants]);
|
|
116
|
+
return getThemeTokensCallback;
|
|
117
|
+
};
|
|
118
|
+
exports.useThemeTokensCallback = useThemeTokensCallback;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _styles = require("./styles");
|
|
7
|
+
Object.keys(_styles).forEach(function (key) {
|
|
8
|
+
if (key === "default" || key === "__esModule") return;
|
|
9
|
+
if (key in exports && exports[key] === _styles[key]) return;
|
|
10
|
+
Object.defineProperty(exports, key, {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function () {
|
|
13
|
+
return _styles[key];
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
var _themeTokens = require("./theme-tokens");
|
|
18
|
+
Object.keys(_themeTokens).forEach(function (key) {
|
|
19
|
+
if (key === "default" || key === "__esModule") return;
|
|
20
|
+
if (key in exports && exports[key] === _themeTokens[key]) return;
|
|
21
|
+
Object.defineProperty(exports, key, {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get: function () {
|
|
24
|
+
return _themeTokens[key];
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
});
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.applyOuterBorder = void 0;
|
|
7
|
+
exports.applyShadowToken = applyShadowToken;
|
|
8
|
+
exports.applyTextStyles = applyTextStyles;
|
|
9
|
+
exports.verticalAlignRow = verticalAlignRow;
|
|
10
|
+
var _Platform = _interopRequireDefault(require("react-native-web/dist/cjs/exports/Platform"));
|
|
11
|
+
var _systemConstants = require("@telus-uds/system-constants");
|
|
12
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
|
+
/**
|
|
14
|
+
* React-Native specific implementations of style patterns that
|
|
15
|
+
* don't map directly to cross-platform design token values.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
// Make design tokens fit React Native's text styles' specific requirements and quirks
|
|
19
|
+
function applyTextStyles(_ref) {
|
|
20
|
+
let {
|
|
21
|
+
fontColor,
|
|
22
|
+
fontSize,
|
|
23
|
+
fontScaleCap,
|
|
24
|
+
lineHeight,
|
|
25
|
+
letterSpacing,
|
|
26
|
+
fontWeight = '400',
|
|
27
|
+
fontName,
|
|
28
|
+
fontStyle = 'normal',
|
|
29
|
+
themeOptions = {
|
|
30
|
+
// TODO: switch `forceAbsoluteFontSizing` to be false by default in the next major version
|
|
31
|
+
forceAbsoluteFontSizing: true
|
|
32
|
+
},
|
|
33
|
+
...rest
|
|
34
|
+
} = _ref;
|
|
35
|
+
const styles = {
|
|
36
|
+
...rest
|
|
37
|
+
};
|
|
38
|
+
const {
|
|
39
|
+
forceAbsoluteFontSizing
|
|
40
|
+
} = themeOptions;
|
|
41
|
+
if (fontSize) {
|
|
42
|
+
// If relative font sizes are needed, catch and calculate them here
|
|
43
|
+
styles.fontSize = _Platform.default.OS === 'web' && !forceAbsoluteFontSizing ? `${fontSize / _systemConstants.fontBasePixels}rem` : fontSize;
|
|
44
|
+
}
|
|
45
|
+
if (typeof lineHeight === 'number') {
|
|
46
|
+
// React Native expects absolute line heights but multipliers are better as design tokens
|
|
47
|
+
styles.lineHeight = lineHeight * (fontSize || _systemConstants.fontBasePixels);
|
|
48
|
+
}
|
|
49
|
+
if (typeof letterSpacing === 'number' && letterSpacing) {
|
|
50
|
+
// Same as for line heights - React Native expects absolute letter spacing value
|
|
51
|
+
styles.letterSpacing = letterSpacing * (fontSize || _systemConstants.fontBasePixels);
|
|
52
|
+
}
|
|
53
|
+
if (fontName) {
|
|
54
|
+
// Don't set undefined font families. May need some validation here that the font is available.
|
|
55
|
+
// Android doesn't recognise font weights natively so apply custom font weights via `fontFamily`.
|
|
56
|
+
styles.fontFamily = `${fontName}${fontWeight}${fontStyle}`;
|
|
57
|
+
} else if (fontWeight) {
|
|
58
|
+
// If using system default font, apply the font weight directly.
|
|
59
|
+
// Font weight support in Android is limited to 'bold' or anything else === 'normal'.
|
|
60
|
+
styles.fontWeight = _Platform.default.OS === 'android' && Number(fontWeight) > 400 ? 'bold' : fontWeight;
|
|
61
|
+
}
|
|
62
|
+
if (fontColor) {
|
|
63
|
+
styles.color = fontColor;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// TODO: look into calculating typographic spacing with PixelRatio.getFontScale()
|
|
67
|
+
// Do while implementing advanced typography e.g. paragraph etc
|
|
68
|
+
// https://github.com/telus/universal-design-system/issues/89
|
|
69
|
+
|
|
70
|
+
return styles;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* React Native's in-built shadow support is limited. Take an object describing an ideal shadow and
|
|
75
|
+
* return a platform-appropriate implementation that gets close to the described effect.
|
|
76
|
+
*
|
|
77
|
+
* @param {object} shadowToken
|
|
78
|
+
* @param {boolean} shadowToken.inset
|
|
79
|
+
* @param {color} shadowToken.string
|
|
80
|
+
* @param {number} shadowToken.offsetX
|
|
81
|
+
* @param {number} shadowToken.offsetY
|
|
82
|
+
* @param {number} shadowToken.blur
|
|
83
|
+
* @param {number} shadowToken.spread
|
|
84
|
+
* @return {object}
|
|
85
|
+
*/
|
|
86
|
+
function applyShadowToken(shadowToken) {
|
|
87
|
+
if (!shadowToken) return {};
|
|
88
|
+
const applyShadow = _Platform.default.select({
|
|
89
|
+
web: () => applyWebShadow(shadowToken),
|
|
90
|
+
ios: () => applyIosShadow(shadowToken),
|
|
91
|
+
android: () => applyAndroidShadow(shadowToken)
|
|
92
|
+
});
|
|
93
|
+
return applyShadow();
|
|
94
|
+
}
|
|
95
|
+
function applyWebShadow(_ref2) {
|
|
96
|
+
let {
|
|
97
|
+
inset,
|
|
98
|
+
color = '',
|
|
99
|
+
offsetX = 0,
|
|
100
|
+
offsetY = 0,
|
|
101
|
+
blur = 0,
|
|
102
|
+
spread = 0
|
|
103
|
+
} = _ref2;
|
|
104
|
+
const insetString = inset ? 'inset ' : '';
|
|
105
|
+
const boxShadow = {
|
|
106
|
+
boxShadow: `${insetString}${offsetX}px ${offsetY}px ${blur}px ${spread}px ${color}`
|
|
107
|
+
};
|
|
108
|
+
return boxShadow;
|
|
109
|
+
}
|
|
110
|
+
function applyAndroidShadow(shadowToken) {
|
|
111
|
+
const {
|
|
112
|
+
color,
|
|
113
|
+
inset,
|
|
114
|
+
spread,
|
|
115
|
+
offsetY,
|
|
116
|
+
offsetX
|
|
117
|
+
} = shadowToken;
|
|
118
|
+
// Android shadows are very limited and workarounds are hacky. Use the built-in `elevation` API unless
|
|
119
|
+
// shadow design is radically different to a simple top-down shadow (e.g. horizontal, upward, or inset)
|
|
120
|
+
if (!inset && offsetY >= 0 && offsetY >= offsetX) {
|
|
121
|
+
return {
|
|
122
|
+
// Can't match other platforms, but can give longer shadows to elements designed for longer shadows
|
|
123
|
+
elevation: spread + offsetY,
|
|
124
|
+
shadowColor: color // Only applies on Android >= 9 and React Native >= 0.64.0
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
// TODO: maybe use a library or workaround to increase capabilities.
|
|
128
|
+
// https://github.com/telus/universal-design-system/issues/535
|
|
129
|
+
return {};
|
|
130
|
+
}
|
|
131
|
+
function applyIosShadow(_ref3) {
|
|
132
|
+
let {
|
|
133
|
+
inset,
|
|
134
|
+
color,
|
|
135
|
+
offsetX,
|
|
136
|
+
offsetY,
|
|
137
|
+
spread,
|
|
138
|
+
blur
|
|
139
|
+
} = _ref3;
|
|
140
|
+
// React Native iOS doesn't support inset shadows.
|
|
141
|
+
// TODO: maybe use a library or workaround for inset shadows. This is a sizable task and would
|
|
142
|
+
// involve changing component implementations to use a custom view, can't be done with styles alone.
|
|
143
|
+
// https://github.com/telus/universal-design-system/issues/535
|
|
144
|
+
if (inset) return {};
|
|
145
|
+
|
|
146
|
+
// React Native iOS doesn't support spread. Where there's an offset, can approximate positive spread by
|
|
147
|
+
// increasing the (positive or negative) offset by the spread. This makes the shadow reach the point it
|
|
148
|
+
// would if spread was supported (with a side effect that its start is further "under" the element).
|
|
149
|
+
const nudgeBySpread = offset => {
|
|
150
|
+
if (!offset || spread <= 0) return 0;
|
|
151
|
+
return offset > 0 ? spread : spread * -1;
|
|
152
|
+
};
|
|
153
|
+
return {
|
|
154
|
+
shadowColor: color,
|
|
155
|
+
shadowOffset: {
|
|
156
|
+
width: offsetX + nudgeBySpread(offsetX),
|
|
157
|
+
height: offsetY + nudgeBySpread(offsetY)
|
|
158
|
+
},
|
|
159
|
+
shadowRadius: blur,
|
|
160
|
+
shadowOpacity: 1 // opacity is applied via RGBA in the `color` token
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
const verticalAlignToFlexRowAlign = {
|
|
164
|
+
top: 'flex-start',
|
|
165
|
+
middle: 'center',
|
|
166
|
+
bottom: 'flex-end'
|
|
167
|
+
};
|
|
168
|
+
function verticalAlignRow(verticalAlign) {
|
|
169
|
+
let reverse = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
170
|
+
return {
|
|
171
|
+
flexDirection: reverse ? 'row-reverse' : 'row',
|
|
172
|
+
alignItems: verticalAlignToFlexRowAlign[verticalAlign]
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
const calculateBorderRadius = (borderRadius, outerBorderGap, outerBorderWidth) => {
|
|
176
|
+
if (borderRadius) {
|
|
177
|
+
return borderRadius + outerBorderGap + outerBorderWidth;
|
|
178
|
+
}
|
|
179
|
+
return null;
|
|
180
|
+
};
|
|
181
|
+
/**
|
|
182
|
+
* Use on an outer container to create an outer border with an optional gap around it
|
|
183
|
+
* that matches the border radius of any inner border.
|
|
184
|
+
*/
|
|
185
|
+
const applyOuterBorder = _ref4 => {
|
|
186
|
+
let {
|
|
187
|
+
outerBorderColor,
|
|
188
|
+
outerBorderWidth = 0,
|
|
189
|
+
outerBorderGap = 0,
|
|
190
|
+
borderRadius,
|
|
191
|
+
borderTopLeftRadius,
|
|
192
|
+
borderTopRightRadius,
|
|
193
|
+
borderBottomLeftRadius,
|
|
194
|
+
borderBottomRightRadius
|
|
195
|
+
} = _ref4;
|
|
196
|
+
return {
|
|
197
|
+
margin: 0 - outerBorderWidth - outerBorderGap,
|
|
198
|
+
padding: outerBorderGap,
|
|
199
|
+
borderRadius: calculateBorderRadius(borderRadius, outerBorderGap, outerBorderWidth),
|
|
200
|
+
borderTopLeftRadius: calculateBorderRadius(borderTopLeftRadius, outerBorderGap, outerBorderWidth),
|
|
201
|
+
borderTopRightRadius: calculateBorderRadius(borderTopRightRadius, outerBorderGap, outerBorderWidth),
|
|
202
|
+
borderBottomLeftRadius: calculateBorderRadius(borderBottomLeftRadius, outerBorderGap, outerBorderWidth),
|
|
203
|
+
borderBottomRightRadius: calculateBorderRadius(borderBottomRightRadius, outerBorderGap, outerBorderWidth),
|
|
204
|
+
borderWidth: outerBorderWidth,
|
|
205
|
+
borderColor: outerBorderColor
|
|
206
|
+
};
|
|
207
|
+
};
|
|
208
|
+
exports.applyOuterBorder = applyOuterBorder;
|