@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,173 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.validateThemeTokensVersion = exports.validateThemeTokens = exports.toArray = exports.resolveThemeTokens = exports.mergeAppearances = exports.getThemeTokens = exports.getComponentTheme = exports.doesThemeRuleApply = exports.doesThemeConditionApply = void 0;
|
|
7
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
8
|
+
var _satisfies = _interopRequireDefault(require("semver/functions/satisfies"));
|
|
9
|
+
var _package = _interopRequireDefault(require("../../../package.json"));
|
|
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
|
+
* General utilities around working with theme tokens
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
const getComponentTheme = (theme, componentName) => {
|
|
22
|
+
// Give clear and understandable error messages for common dev errors, for example,
|
|
23
|
+
// typo in component name, missing export or accessing old version of theme
|
|
24
|
+
if (!theme) {
|
|
25
|
+
throw new Error(`Called useTheme's getStyle on "${componentName}" with no theme provided`);
|
|
26
|
+
}
|
|
27
|
+
const themeName = theme.metadata?.name || '';
|
|
28
|
+
if (!theme.components) {
|
|
29
|
+
throw new Error(`Theme "${themeName}" has no components defined (looking for "${componentName}")`);
|
|
30
|
+
}
|
|
31
|
+
const componentTheme = theme.components[componentName];
|
|
32
|
+
if (!componentTheme) {
|
|
33
|
+
throw new Error(`Theme "${themeName}" does not have styles for component "${componentName}"`);
|
|
34
|
+
}
|
|
35
|
+
return componentTheme;
|
|
36
|
+
};
|
|
37
|
+
exports.getComponentTheme = getComponentTheme;
|
|
38
|
+
const doesThemeConditionApply = (_ref, appearances) => {
|
|
39
|
+
let [key, value] = _ref;
|
|
40
|
+
// use null rather than undefined so we can serialise the value in themes
|
|
41
|
+
const appearanceValue = appearances[key] ?? null;
|
|
42
|
+
return Array.isArray(value) ? value.includes(appearanceValue) : value === appearanceValue;
|
|
43
|
+
};
|
|
44
|
+
exports.doesThemeConditionApply = doesThemeConditionApply;
|
|
45
|
+
const doesThemeRuleApply = (rule, appearances) => Object.entries(rule.if).every(condition => doesThemeConditionApply(condition, appearances));
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Turns a tokens prop (which may be either a tokens object or a tokens getter function)
|
|
49
|
+
* into one resolved tokens object, based on current appearances state.
|
|
50
|
+
*
|
|
51
|
+
* This is used inside `useThemeTokens` and `useThemeTokensCallback` for handling the `tokens`
|
|
52
|
+
* props of themed components. It may also be used directly in cases where a non-themed component
|
|
53
|
+
* needs to resolve a tokens prop that may be a tokens getter function or a resolved tokens object.
|
|
54
|
+
*
|
|
55
|
+
* A second tokens prop of tokens overrides may optionally be passed; it will be resolved to an object
|
|
56
|
+
* based on provided appearance state and then shallow-merged over the first set of tokens.
|
|
57
|
+
*
|
|
58
|
+
* @param {TokensProp} defaultTokens - a set of tokens or tokens getter function which may be overridden
|
|
59
|
+
* @param {AppearanceSet} [appearances] - optional appearance set to pass to tokens getter functions
|
|
60
|
+
* @param {TokensProp} [tokenOverrides] - optional set of tokens or tokens getter function to override the default
|
|
61
|
+
* @returns {TokensSet} - object containing resolved tokens with overrides applied
|
|
62
|
+
*/
|
|
63
|
+
exports.doesThemeRuleApply = doesThemeRuleApply;
|
|
64
|
+
const resolveThemeTokens = function (defaultTokens) {
|
|
65
|
+
let appearances = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
66
|
+
let tokenOverrides = arguments.length > 2 ? arguments[2] : undefined;
|
|
67
|
+
const resolve = tokens => typeof tokens === 'function' ? tokens(appearances) : tokens;
|
|
68
|
+
if (!tokenOverrides) return resolve(defaultTokens);
|
|
69
|
+
return Object.entries(resolve(tokenOverrides)).reduce((mergedTokens, _ref2) => {
|
|
70
|
+
let [tokenName, tokenValue] = _ref2;
|
|
71
|
+
return tokenValue === undefined ? mergedTokens : {
|
|
72
|
+
...mergedTokens,
|
|
73
|
+
[tokenName]: tokenValue
|
|
74
|
+
};
|
|
75
|
+
}, resolve(defaultTokens));
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Gives a prop types error if a set of resolved tokens doesn't match a provided prop
|
|
80
|
+
* types validator.
|
|
81
|
+
*
|
|
82
|
+
* In production, this is a no-op (PropTypes.checkPropTypes is automatically replaced
|
|
83
|
+
* with a no-op function).
|
|
84
|
+
*
|
|
85
|
+
* @param {TokensSet} themeTokens - object containing resolved theme tokens
|
|
86
|
+
* @param {function} validator - PropTypes validator function
|
|
87
|
+
* @param {string} componentName - identifier to display in PropType error messages
|
|
88
|
+
*/
|
|
89
|
+
exports.resolveThemeTokens = resolveThemeTokens;
|
|
90
|
+
const validateThemeTokens = (themeTokens, validator, componentName) => {
|
|
91
|
+
_propTypes.default.checkPropTypes({
|
|
92
|
+
tokens: validator
|
|
93
|
+
}, {
|
|
94
|
+
tokens: themeTokens
|
|
95
|
+
}, 'resolved token', componentName);
|
|
96
|
+
return themeTokens;
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Merges variants over states. Must be merged in that order to allow static showcases of a state,
|
|
101
|
+
* e.g. `<Button variant={{ pressed: true }} />` where button's pressed state is `false` by default.
|
|
102
|
+
* Returns an empty object if both variants and states are undefined.
|
|
103
|
+
*
|
|
104
|
+
* @param {AppearanceSet} [variants]
|
|
105
|
+
* @param {AppearanceSet} [states]
|
|
106
|
+
* @returns {AppearanceSet}
|
|
107
|
+
*/
|
|
108
|
+
exports.validateThemeTokens = validateThemeTokens;
|
|
109
|
+
const mergeAppearances = function () {
|
|
110
|
+
let variants = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
111
|
+
let states = arguments.length > 1 ? arguments[1] : undefined;
|
|
112
|
+
return states ? {
|
|
113
|
+
...states,
|
|
114
|
+
...variants
|
|
115
|
+
} : variants;
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Get a set of theme tokens by applying a theme's component rules based on a component's variants and state.
|
|
120
|
+
*
|
|
121
|
+
* This is used internally in `useThemeTokens` and `useThemeTokensCallback` and should not normally be called directly.
|
|
122
|
+
*
|
|
123
|
+
* @param {object} componentTheme - object containing a theme's `tokens` and `rules` for a component
|
|
124
|
+
* @param {object|function} [tokensProp] - UDS tokens prop containing theming overrides
|
|
125
|
+
* @param {object} [variants] - UDS variant prop containing the variant options for this component instance
|
|
126
|
+
* @param {object} [states] - object containing current state options for this component instance
|
|
127
|
+
* @returns {object} Set of resolved theme tokens
|
|
128
|
+
*/
|
|
129
|
+
exports.mergeAppearances = mergeAppearances;
|
|
130
|
+
const getThemeTokens = function (_ref3, tokensProp) {
|
|
131
|
+
let {
|
|
132
|
+
rules = [],
|
|
133
|
+
tokens: defaultThemeTokens = {}
|
|
134
|
+
} = _ref3;
|
|
135
|
+
let variants = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
136
|
+
let states = arguments.length > 3 ? arguments[3] : undefined;
|
|
137
|
+
const appearances = mergeAppearances(variants, states);
|
|
138
|
+
// TODO: if in dev mode, validate the appearances and provided propTokens
|
|
139
|
+
|
|
140
|
+
// Get the theme's default tokens set and merge tokens from applicable theme rules over it
|
|
141
|
+
const themeTokens = rules.reduce((mergedTokens, rule) => doesThemeRuleApply(rule, appearances) ? {
|
|
142
|
+
...mergedTokens,
|
|
143
|
+
...rule.tokens
|
|
144
|
+
} : mergedTokens, defaultThemeTokens);
|
|
145
|
+
return resolveThemeTokens(themeTokens, appearances, tokensProp);
|
|
146
|
+
};
|
|
147
|
+
exports.getThemeTokens = getThemeTokens;
|
|
148
|
+
const toArray = strOrArr => Array.isArray(strOrArr) ? strOrArr : [strOrArr];
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* Throws an error if the theme was built with an incompatible version of @telus-uds/system-theme-tokens
|
|
152
|
+
*
|
|
153
|
+
* This is used internally by the ThemeProvider to force a fast failure when an incompatible version is detected.
|
|
154
|
+
*
|
|
155
|
+
* Version compatibility is calculated with semver.satisfies.
|
|
156
|
+
* Refer to https://github.com/npm/node-semver and https://semver.npmjs.com/ for details about how
|
|
157
|
+
* semver compatibility.
|
|
158
|
+
*
|
|
159
|
+
* @param {object} theme - UDS theme built for react-native
|
|
160
|
+
*/
|
|
161
|
+
exports.toArray = toArray;
|
|
162
|
+
const validateThemeTokensVersion = theme => {
|
|
163
|
+
const expectedThemeTokensVersion = _package.default.dependencies['@telus-uds/system-theme-tokens'];
|
|
164
|
+
const actualThemeTokensVersion = theme?.metadata?.themeTokensVersion;
|
|
165
|
+
if (!(0, _satisfies.default)(actualThemeTokensVersion, expectedThemeTokensVersion)) {
|
|
166
|
+
throw new Error(`Invalid UDS token schema version detected.
|
|
167
|
+
|
|
168
|
+
The UDS base components ${_package.default.name} v${_package.default.version} are only compatible with UDS themes that are built with @telus-uds/system-theme-tokens version that is semver compatible with ${expectedThemeTokensVersion}. The current theme was built with @telus-uds/system-theme-tokens v${actualThemeTokensVersion}.
|
|
169
|
+
|
|
170
|
+
If you see this error than most likely you have attempted to install ${_package.default.name} and a UDS theme manually because you are building a multi-brand application. If you are building a single brand application, consider installing the brand specific design system package such as @telus-uds/ds-allium. For more information, see https://github.com/telus/universal-design-system/blob/main/docs/docs/multi-brand-usage.md`);
|
|
171
|
+
}
|
|
172
|
+
};
|
|
173
|
+
exports.validateThemeTokensVersion = validateThemeTokensVersion;
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var _Platform = _interopRequireDefault(require("react-native-web/dist/cjs/exports/Platform"));
|
|
10
|
+
var _View = _interopRequireDefault(require("react-native-web/dist/cjs/exports/View"));
|
|
11
|
+
var _ThemeProvider = require("../ThemeProvider");
|
|
12
|
+
var _utils = require("../utils");
|
|
13
|
+
var _ViewportProvider = require("../ViewportProvider");
|
|
14
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
16
|
+
const selectDotStyles = _ref => {
|
|
17
|
+
let {
|
|
18
|
+
dotWidth,
|
|
19
|
+
timelineColor,
|
|
20
|
+
dotBorderWidth,
|
|
21
|
+
dotColor
|
|
22
|
+
} = _ref;
|
|
23
|
+
return {
|
|
24
|
+
width: dotWidth,
|
|
25
|
+
height: dotWidth,
|
|
26
|
+
borderRadius: dotWidth / 2,
|
|
27
|
+
backgroundColor: dotColor,
|
|
28
|
+
borderWidth: dotBorderWidth,
|
|
29
|
+
borderColor: timelineColor
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
const selectConnectorStyles = _ref2 => {
|
|
33
|
+
let {
|
|
34
|
+
timelineConnectorColor,
|
|
35
|
+
connectorHeight,
|
|
36
|
+
connectorWidth
|
|
37
|
+
} = _ref2;
|
|
38
|
+
return {
|
|
39
|
+
width: connectorWidth,
|
|
40
|
+
height: connectorHeight,
|
|
41
|
+
backgroundColor: timelineConnectorColor
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
const selectTimelineContainerStyle = _ref3 => {
|
|
45
|
+
let {
|
|
46
|
+
timelineContainerDirection
|
|
47
|
+
} = _ref3;
|
|
48
|
+
return {
|
|
49
|
+
flexDirection: timelineContainerDirection
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
const selectLineItemStyles = _ref4 => {
|
|
53
|
+
let {
|
|
54
|
+
lineItemAlign,
|
|
55
|
+
lineItemDirection,
|
|
56
|
+
lineItemMarginBottom,
|
|
57
|
+
lineItemMarginRight
|
|
58
|
+
} = _ref4;
|
|
59
|
+
return {
|
|
60
|
+
alignItems: lineItemAlign,
|
|
61
|
+
flexDirection: lineItemDirection,
|
|
62
|
+
marginBottom: lineItemMarginBottom,
|
|
63
|
+
marginRight: lineItemMarginRight,
|
|
64
|
+
overflow: 'hidden'
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
const selectLineItemContainer = _ref5 => {
|
|
68
|
+
let {
|
|
69
|
+
lineItemContainerDirection,
|
|
70
|
+
lineContainerFlexSize
|
|
71
|
+
} = _ref5;
|
|
72
|
+
return {
|
|
73
|
+
flexDirection: lineItemContainerDirection,
|
|
74
|
+
flex: lineContainerFlexSize
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
const selectItemContentStyles = (_ref6, isLastChild) => {
|
|
78
|
+
let {
|
|
79
|
+
itemContentFlexSize,
|
|
80
|
+
itemContentMarginBottom,
|
|
81
|
+
itemContentMarginRight
|
|
82
|
+
} = _ref6;
|
|
83
|
+
return {
|
|
84
|
+
flex: itemContentFlexSize,
|
|
85
|
+
marginBottom: !isLastChild && itemContentMarginBottom,
|
|
86
|
+
marginRight: !isLastChild && itemContentMarginRight
|
|
87
|
+
};
|
|
88
|
+
};
|
|
89
|
+
const [selectProps, selectedSystemPropTypes] = (0, _utils.selectSystemProps)([_utils.a11yProps, _utils.viewProps]);
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Timeline is a component that displays either a horizontal or vertical list of the
|
|
93
|
+
* children components passed by props
|
|
94
|
+
*
|
|
95
|
+
* ## Component API
|
|
96
|
+
*
|
|
97
|
+
* - `horizontal` In order to display the Component list horizontally
|
|
98
|
+
*
|
|
99
|
+
*
|
|
100
|
+
* ## A11y guidelines
|
|
101
|
+
* Timeline link supports all the common a11y props.
|
|
102
|
+
*/
|
|
103
|
+
const Timeline = /*#__PURE__*/_react.default.forwardRef((_ref7, ref) => {
|
|
104
|
+
let {
|
|
105
|
+
tokens,
|
|
106
|
+
variant = {},
|
|
107
|
+
children,
|
|
108
|
+
accessibilityLabel,
|
|
109
|
+
tag = 'ul',
|
|
110
|
+
childrenTag = 'li',
|
|
111
|
+
...rest
|
|
112
|
+
} = _ref7;
|
|
113
|
+
const viewport = (0, _ViewportProvider.useViewport)();
|
|
114
|
+
const themeTokens = (0, _ThemeProvider.useThemeTokens)('Timeline', tokens, variant, {
|
|
115
|
+
viewport
|
|
116
|
+
});
|
|
117
|
+
const containerProps = {
|
|
118
|
+
...selectProps(rest),
|
|
119
|
+
...(0, _utils.getA11yPropsFromHtmlTag)(tag, rest.accessibilityRole || 'list'),
|
|
120
|
+
accessibilityLabel
|
|
121
|
+
};
|
|
122
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, {
|
|
123
|
+
...containerProps,
|
|
124
|
+
ref: ref,
|
|
125
|
+
style: selectTimelineContainerStyle(themeTokens),
|
|
126
|
+
children: children.map((child, index) => {
|
|
127
|
+
const accessibilityRole = _Platform.default.OS !== 'android' ? 'listitem' : undefined;
|
|
128
|
+
const childrenProps = {
|
|
129
|
+
...(0, _utils.getA11yPropsFromHtmlTag)(childrenTag, child?.props?.accessibilityRole || accessibilityRole)
|
|
130
|
+
};
|
|
131
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_View.default, {
|
|
132
|
+
style: selectLineItemContainer(themeTokens)
|
|
133
|
+
// eslint-disable-next-line react/no-array-index-key
|
|
134
|
+
,
|
|
135
|
+
...childrenProps,
|
|
136
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_View.default, {
|
|
137
|
+
style: selectLineItemStyles(themeTokens),
|
|
138
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, {
|
|
139
|
+
style: selectDotStyles(themeTokens)
|
|
140
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, {
|
|
141
|
+
style: selectConnectorStyles(themeTokens)
|
|
142
|
+
})]
|
|
143
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, {
|
|
144
|
+
style: selectItemContentStyles(themeTokens, index + 1 === children.length),
|
|
145
|
+
children: child
|
|
146
|
+
})]
|
|
147
|
+
}, `timeline-${index}-${child.displayName}`);
|
|
148
|
+
})
|
|
149
|
+
});
|
|
150
|
+
});
|
|
151
|
+
Timeline.displayName = 'Timeline';
|
|
152
|
+
Timeline.propTypes = {
|
|
153
|
+
...selectedSystemPropTypes,
|
|
154
|
+
tokens: (0, _utils.getTokensPropType)('Timeline'),
|
|
155
|
+
variant: _utils.variantProp.propType,
|
|
156
|
+
/**
|
|
157
|
+
* A list of components that will be rendered either horizontally or vertically
|
|
158
|
+
*/
|
|
159
|
+
children: _propTypes.default.arrayOf(_propTypes.default.node).isRequired,
|
|
160
|
+
/**
|
|
161
|
+
* A required accessibility label that needs to be passed to be used on List
|
|
162
|
+
* which is applied as normal for a React Native accessibilityLabel prop.
|
|
163
|
+
*/
|
|
164
|
+
accessibilityLabel: _propTypes.default.string.isRequired,
|
|
165
|
+
/**
|
|
166
|
+
* Sets the HTML tag of the outer container and the children. By default `'li'` for the children
|
|
167
|
+
* and `'ul'` for the container
|
|
168
|
+
*
|
|
169
|
+
* If either `tag` or `childrenTag` is overridden, the other should be too, to avoid producing invalid HTML.
|
|
170
|
+
*
|
|
171
|
+
*/
|
|
172
|
+
tag: _propTypes.default.oneOf(_utils.layoutTags),
|
|
173
|
+
childrenTag: _propTypes.default.oneOf(_utils.layoutTags)
|
|
174
|
+
};
|
|
175
|
+
var _default = exports.default = Timeline;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _Timeline = _interopRequireDefault(require("./Timeline"));
|
|
8
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
|
+
var _default = exports.default = _Timeline.default;
|
|
@@ -0,0 +1,286 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
+
var _Platform = _interopRequireDefault(require("react-native-web/dist/cjs/exports/Platform"));
|
|
10
|
+
var _StyleSheet = _interopRequireDefault(require("react-native-web/dist/cjs/exports/StyleSheet"));
|
|
11
|
+
var _View = _interopRequireDefault(require("react-native-web/dist/cjs/exports/View"));
|
|
12
|
+
var _InputLabel = _interopRequireDefault(require("../InputLabel"));
|
|
13
|
+
var _ButtonBase = _interopRequireDefault(require("../Button/ButtonBase"));
|
|
14
|
+
var _StackView = _interopRequireDefault(require("../StackView"));
|
|
15
|
+
var _ThemeProvider = require("../ThemeProvider");
|
|
16
|
+
var _utils = require("../utils");
|
|
17
|
+
var _input = require("../utils/input");
|
|
18
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
19
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
20
|
+
const [selectProps, selectedSystemPropTypes] = (0, _utils.selectSystemProps)([_utils.a11yProps, _utils.focusHandlerProps, _utils.pressProps, _utils.viewProps]);
|
|
21
|
+
|
|
22
|
+
// We need to drop the icon before passing it to the `ButtonBase`, because it's
|
|
23
|
+
// being handled separately in this case
|
|
24
|
+
const selectButtonTokens = (_ref, _ref2) => {
|
|
25
|
+
let {
|
|
26
|
+
icon: _,
|
|
27
|
+
...tokens
|
|
28
|
+
} = _ref;
|
|
29
|
+
let {
|
|
30
|
+
trackHeight,
|
|
31
|
+
outerBorderGapButton
|
|
32
|
+
} = _ref2;
|
|
33
|
+
return (0, _utils.selectTokens)('Button', {
|
|
34
|
+
...tokens,
|
|
35
|
+
// Width tokens are applied to our inner track. Disable Button width token so it wraps our track width.
|
|
36
|
+
outerBorderGap: outerBorderGapButton,
|
|
37
|
+
height: trackHeight,
|
|
38
|
+
width: null
|
|
39
|
+
});
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
// Map and rename icon-specific tokens to name used within Icon
|
|
43
|
+
const selectIconTokens = _ref3 => {
|
|
44
|
+
let {
|
|
45
|
+
iconSize,
|
|
46
|
+
iconColor
|
|
47
|
+
} = _ref3;
|
|
48
|
+
return {
|
|
49
|
+
size: iconSize,
|
|
50
|
+
color: iconColor
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
const selectTrackSwitchStyles = _ref4 => {
|
|
54
|
+
let {
|
|
55
|
+
switchSize,
|
|
56
|
+
width,
|
|
57
|
+
trackHeight
|
|
58
|
+
} = _ref4;
|
|
59
|
+
return {
|
|
60
|
+
width,
|
|
61
|
+
height: Math.max(switchSize, trackHeight)
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
const selectTrackStyles = _ref5 => {
|
|
65
|
+
let {
|
|
66
|
+
trackBorderWidth,
|
|
67
|
+
trackBorderColor,
|
|
68
|
+
trackBorderRadius,
|
|
69
|
+
width
|
|
70
|
+
} = _ref5;
|
|
71
|
+
return {
|
|
72
|
+
borderWidth: trackBorderWidth,
|
|
73
|
+
borderColor: trackBorderColor,
|
|
74
|
+
borderRadius: trackBorderRadius,
|
|
75
|
+
width
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
const selectSwitchStyles = _ref6 => {
|
|
79
|
+
let {
|
|
80
|
+
switchSize,
|
|
81
|
+
switchColor,
|
|
82
|
+
switchBorderWidth,
|
|
83
|
+
switchBorderColor,
|
|
84
|
+
switchBorderRadius,
|
|
85
|
+
switchShadow
|
|
86
|
+
} = _ref6;
|
|
87
|
+
return {
|
|
88
|
+
position: 'absolute',
|
|
89
|
+
width: switchSize,
|
|
90
|
+
height: switchSize,
|
|
91
|
+
backgroundColor: switchColor,
|
|
92
|
+
borderWidth: switchBorderWidth,
|
|
93
|
+
borderColor: switchBorderColor,
|
|
94
|
+
borderRadius: switchBorderRadius,
|
|
95
|
+
...(0, _ThemeProvider.applyShadowToken)(switchShadow),
|
|
96
|
+
..._Platform.default.select({
|
|
97
|
+
// TODO: https://github.com/telus/universal-design-system/issues/487
|
|
98
|
+
web: {
|
|
99
|
+
transition: 'transform 200ms'
|
|
100
|
+
}
|
|
101
|
+
})
|
|
102
|
+
};
|
|
103
|
+
};
|
|
104
|
+
const selectLabelStyles = _ref7 => {
|
|
105
|
+
let {
|
|
106
|
+
labelMarginLeft
|
|
107
|
+
} = _ref7;
|
|
108
|
+
return {
|
|
109
|
+
marginLeft: labelMarginLeft
|
|
110
|
+
};
|
|
111
|
+
};
|
|
112
|
+
const selectLabelTokens = _ref8 => {
|
|
113
|
+
let {
|
|
114
|
+
labelColor,
|
|
115
|
+
labelFontName,
|
|
116
|
+
labelFontSize,
|
|
117
|
+
labelFontWeight,
|
|
118
|
+
labelLineHeight
|
|
119
|
+
} = _ref8;
|
|
120
|
+
return {
|
|
121
|
+
color: labelColor,
|
|
122
|
+
fontName: labelFontName,
|
|
123
|
+
fontWeight: labelFontWeight,
|
|
124
|
+
fontSize: labelFontSize,
|
|
125
|
+
lineHeight: labelLineHeight
|
|
126
|
+
};
|
|
127
|
+
};
|
|
128
|
+
const ToggleSwitch = /*#__PURE__*/_react.default.forwardRef((_ref9, ref) => {
|
|
129
|
+
let {
|
|
130
|
+
copy = 'en',
|
|
131
|
+
value,
|
|
132
|
+
initialValue,
|
|
133
|
+
onChange,
|
|
134
|
+
id,
|
|
135
|
+
label,
|
|
136
|
+
inactive,
|
|
137
|
+
tokens,
|
|
138
|
+
tooltip,
|
|
139
|
+
variant,
|
|
140
|
+
accessibilityRole = 'switch',
|
|
141
|
+
accessibilityLabel = label,
|
|
142
|
+
...rest
|
|
143
|
+
} = _ref9;
|
|
144
|
+
const getTokens = (0, _ThemeProvider.useThemeTokensCallback)('ToggleSwitch', tokens, variant);
|
|
145
|
+
const themeTokens = getTokens();
|
|
146
|
+
const {
|
|
147
|
+
currentValue,
|
|
148
|
+
setValue
|
|
149
|
+
} = (0, _input.useInputValue)({
|
|
150
|
+
value,
|
|
151
|
+
initialValue,
|
|
152
|
+
onChange
|
|
153
|
+
});
|
|
154
|
+
const handlePress = event => setValue(!currentValue, event);
|
|
155
|
+
const getButtonTokens = buttonState => selectButtonTokens(getTokens(buttonState), getTokens(themeTokens));
|
|
156
|
+
const uniqueId = (0, _utils.useUniqueId)('toggleSwitch');
|
|
157
|
+
const inputId = id ?? uniqueId;
|
|
158
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_StackView.default, {
|
|
159
|
+
space: themeTokens.space,
|
|
160
|
+
direction: "row",
|
|
161
|
+
tokens: {
|
|
162
|
+
alignItems: 'center'
|
|
163
|
+
},
|
|
164
|
+
children: [Boolean(label) && /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, {
|
|
165
|
+
style: [selectLabelStyles(themeTokens), staticStyles.containText],
|
|
166
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_InputLabel.default, {
|
|
167
|
+
copy: copy,
|
|
168
|
+
forId: inputId,
|
|
169
|
+
label: label,
|
|
170
|
+
tokens: selectLabelTokens(themeTokens),
|
|
171
|
+
tooltip: tooltip
|
|
172
|
+
})
|
|
173
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ButtonBase.default, {
|
|
174
|
+
id: id,
|
|
175
|
+
ref: ref,
|
|
176
|
+
selected: currentValue,
|
|
177
|
+
inactive: inactive,
|
|
178
|
+
tokens: getButtonTokens,
|
|
179
|
+
accessibilityLabel: accessibilityLabel,
|
|
180
|
+
accessibilityRole: accessibilityRole,
|
|
181
|
+
accessibilityState: {
|
|
182
|
+
checked: currentValue
|
|
183
|
+
},
|
|
184
|
+
onPress: handlePress,
|
|
185
|
+
...selectProps(rest),
|
|
186
|
+
children: buttonState => {
|
|
187
|
+
const stateTokens = getTokens(buttonState);
|
|
188
|
+
const IconComponent = stateTokens.icon;
|
|
189
|
+
const switchStyles = selectSwitchStyles(stateTokens);
|
|
190
|
+
const trackStyles = selectTrackStyles(stateTokens);
|
|
191
|
+
const iconTokens = selectIconTokens(stateTokens);
|
|
192
|
+
const trackSwitchStyles = selectTrackSwitchStyles(stateTokens);
|
|
193
|
+
const {
|
|
194
|
+
switchSize,
|
|
195
|
+
trackHeight,
|
|
196
|
+
width,
|
|
197
|
+
trackBorderWidth
|
|
198
|
+
} = stateTokens;
|
|
199
|
+
// If drag-slide support is needed, use a PanResponder and apply these to an Animated value.
|
|
200
|
+
// Use translate transforms for smoothest non-thread-blocking animations and to allow drag.
|
|
201
|
+
// Two different translates depending on the switchSize and trackSize relationship.
|
|
202
|
+
const isSwitchTallerThanTrack = switchSize >= trackHeight;
|
|
203
|
+
const slideStart = isSwitchTallerThanTrack ? 0 : trackBorderWidth;
|
|
204
|
+
const slideEnd = isSwitchTallerThanTrack ? width - switchSize : width - switchSize - trackBorderWidth;
|
|
205
|
+
const switchOffset = buttonState.selected ? slideEnd : slideStart;
|
|
206
|
+
const switchPositionStyle = {
|
|
207
|
+
transform: [{
|
|
208
|
+
translateX: switchOffset
|
|
209
|
+
}]
|
|
210
|
+
};
|
|
211
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_View.default, {
|
|
212
|
+
nativeID: "trackSwitch",
|
|
213
|
+
style: [trackSwitchStyles, staticStyles.trackSwitch],
|
|
214
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, {
|
|
215
|
+
style: [staticStyles.track, trackStyles]
|
|
216
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, {
|
|
217
|
+
style: [staticStyles.switch, switchStyles, switchPositionStyle],
|
|
218
|
+
children: IconComponent && /*#__PURE__*/(0, _jsxRuntime.jsx)(IconComponent, {
|
|
219
|
+
...iconTokens
|
|
220
|
+
})
|
|
221
|
+
})]
|
|
222
|
+
});
|
|
223
|
+
}
|
|
224
|
+
})]
|
|
225
|
+
});
|
|
226
|
+
});
|
|
227
|
+
ToggleSwitch.displayName = 'ToggleSwitch';
|
|
228
|
+
ToggleSwitch.propTypes = {
|
|
229
|
+
...selectedSystemPropTypes,
|
|
230
|
+
/**
|
|
231
|
+
* Whether the English or French copy will be used (e.g. for accessibility labels).
|
|
232
|
+
*/
|
|
233
|
+
copy: _propTypes.default.oneOf(['en', 'fr']),
|
|
234
|
+
tokens: (0, _utils.getTokensPropType)('ToggleSwitch'),
|
|
235
|
+
variant: _utils.variantProp.propType,
|
|
236
|
+
/**
|
|
237
|
+
* If this is a "controlled" component and a parent handles its selected state,
|
|
238
|
+
* tells the switch if it is on (true) or off (false).
|
|
239
|
+
*/
|
|
240
|
+
value: _propTypes.default.bool,
|
|
241
|
+
/**
|
|
242
|
+
* If this is an "uncontrolled" component that handles its own selected state,
|
|
243
|
+
* optionally tells the switch if it should default to on (true) or off (false).
|
|
244
|
+
*/
|
|
245
|
+
initialValue: _propTypes.default.bool,
|
|
246
|
+
/**
|
|
247
|
+
* Function called when the switch is toggled, with one boolean argument that is the
|
|
248
|
+
* new position of the switch, on (true) or off (false). For "controlled" components,
|
|
249
|
+
* this should always be passed and used to control the state of the switch.
|
|
250
|
+
*/
|
|
251
|
+
onChange: _propTypes.default.func,
|
|
252
|
+
/**
|
|
253
|
+
* Input ID.
|
|
254
|
+
*/
|
|
255
|
+
id: _propTypes.default.string,
|
|
256
|
+
/**
|
|
257
|
+
* An optional label.
|
|
258
|
+
*/
|
|
259
|
+
label: _propTypes.default.string,
|
|
260
|
+
/**
|
|
261
|
+
* If passed, the switch does not respond to user input and may recieve different
|
|
262
|
+
* theme tokens if the theme supports inactive appearance.
|
|
263
|
+
*/
|
|
264
|
+
inactive: _propTypes.default.bool,
|
|
265
|
+
/**
|
|
266
|
+
* Content of an optional Tooltip. If set, a tooltip button will be shown next to the label.
|
|
267
|
+
*/
|
|
268
|
+
tooltip: _propTypes.default.string
|
|
269
|
+
};
|
|
270
|
+
const staticStyles = _StyleSheet.default.create({
|
|
271
|
+
track: {
|
|
272
|
+
flexDirection: 'row'
|
|
273
|
+
},
|
|
274
|
+
switch: {
|
|
275
|
+
alignItems: 'center',
|
|
276
|
+
justifyContent: 'center'
|
|
277
|
+
},
|
|
278
|
+
containText: {
|
|
279
|
+
flexShrink: 1
|
|
280
|
+
},
|
|
281
|
+
trackSwitch: {
|
|
282
|
+
flexDirection: 'row',
|
|
283
|
+
alignItems: 'center'
|
|
284
|
+
}
|
|
285
|
+
});
|
|
286
|
+
var _default = exports.default = ToggleSwitch;
|