@telus-uds/components-base 2.4.0 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +33 -2
- package/lib/cjs/A11yInfoProvider/index.js +73 -0
- package/lib/cjs/A11yText/index.js +75 -0
- package/lib/cjs/ActionCard/ActionCard.js +349 -0
- package/lib/cjs/ActionCard/index.js +9 -0
- package/lib/cjs/ActivityIndicator/Spinner.js +85 -0
- package/lib/cjs/ActivityIndicator/Spinner.native.js +151 -0
- package/lib/cjs/ActivityIndicator/index.js +51 -0
- package/lib/cjs/ActivityIndicator/shared.js +20 -0
- package/lib/cjs/Autocomplete/Autocomplete.js +480 -0
- package/lib/cjs/Autocomplete/Loading.js +42 -0
- package/lib/cjs/Autocomplete/Suggestions.js +71 -0
- package/lib/cjs/Autocomplete/constants.js +10 -0
- package/lib/cjs/Autocomplete/dictionary.js +18 -0
- package/lib/cjs/Autocomplete/index.js +9 -0
- package/lib/cjs/Badge/Badge.js +109 -0
- package/lib/cjs/Badge/index.js +9 -0
- package/lib/cjs/BaseProvider/HydrationContext.js +56 -0
- package/lib/cjs/BaseProvider/index.js +46 -0
- package/lib/cjs/Box/Box.js +385 -0
- package/lib/cjs/Box/backgroundImageStylesMap.js +100 -0
- package/lib/cjs/Box/index.js +9 -0
- package/lib/cjs/Button/Button.js +43 -0
- package/lib/cjs/Button/ButtonBase.js +353 -0
- package/lib/cjs/Button/ButtonDropdown.js +182 -0
- package/lib/cjs/Button/ButtonGroup.js +279 -0
- package/lib/cjs/Button/ButtonLink.js +57 -0
- package/lib/cjs/Button/index.js +34 -0
- package/lib/cjs/Button/propTypes.js +53 -0
- package/lib/cjs/Card/Card.js +334 -0
- package/lib/cjs/Card/CardBase.js +127 -0
- package/lib/cjs/Card/PressableCardBase.js +121 -0
- package/lib/cjs/Card/index.js +32 -0
- package/lib/cjs/CardGroup/CardGroup.js +219 -0
- package/lib/cjs/CardGroup/dictionary.js +14 -0
- package/lib/cjs/CardGroup/index.js +9 -0
- package/lib/cjs/Carousel/Carousel.js +1046 -0
- package/lib/cjs/Carousel/CarouselContext.js +59 -0
- package/lib/cjs/Carousel/CarouselFirstFocus/CarouselFirstFocus.js +57 -0
- package/lib/cjs/Carousel/CarouselItem/CarouselItem.js +185 -0
- package/lib/cjs/Carousel/CarouselItem/index.js +9 -0
- package/lib/cjs/Carousel/CarouselStepTracker/CarouselStepTracker.js +101 -0
- package/lib/cjs/Carousel/CarouselStepTracker/index.js +9 -0
- package/lib/cjs/Carousel/CarouselTabs/CarouselTabs.js +54 -0
- package/lib/cjs/Carousel/CarouselTabs/CarouselTabsPanel.js +95 -0
- package/lib/cjs/Carousel/CarouselTabs/CarouselTabsPanelItem.js +125 -0
- package/lib/cjs/Carousel/CarouselTabs/index.js +9 -0
- package/lib/cjs/Carousel/CarouselThumbnail.js +120 -0
- package/lib/cjs/Carousel/CarouselThumbnailNavigation.js +78 -0
- package/lib/cjs/Carousel/Constants.js +13 -0
- package/lib/cjs/Carousel/dictionary.js +28 -0
- package/lib/cjs/Carousel/index.js +36 -0
- package/lib/cjs/Checkbox/Checkbox.js +349 -0
- package/lib/cjs/Checkbox/CheckboxButton.js +171 -0
- package/lib/cjs/Checkbox/CheckboxGroup.js +249 -0
- package/lib/cjs/Checkbox/CheckboxInput.js +55 -0
- package/lib/cjs/Checkbox/CheckboxInput.native.js +11 -0
- package/lib/cjs/Checkbox/index.js +16 -0
- package/lib/cjs/CheckboxCard/CheckboxCard.js +191 -0
- package/lib/cjs/CheckboxCard/index.js +9 -0
- package/lib/cjs/CheckboxCardGroup/CheckboxCardGroup.js +215 -0
- package/lib/cjs/CheckboxCardGroup/index.js +9 -0
- package/lib/cjs/ColourToggle/ColourBubble.js +133 -0
- package/lib/cjs/ColourToggle/ColourToggle.js +98 -0
- package/lib/cjs/ColourToggle/index.js +9 -0
- package/lib/cjs/Divider/Divider.js +138 -0
- package/lib/cjs/Divider/index.js +9 -0
- package/lib/cjs/DownloadApp/DownloadApp.js +167 -0
- package/lib/cjs/DownloadApp/dictionary.js +16 -0
- package/lib/cjs/DownloadApp/index.js +9 -0
- package/lib/cjs/ExpandCollapse/Accordion.js +20 -0
- package/lib/cjs/ExpandCollapse/Control.js +170 -0
- package/lib/cjs/ExpandCollapse/ExpandCollapse.js +105 -0
- package/lib/cjs/ExpandCollapse/Panel.js +248 -0
- package/lib/cjs/ExpandCollapse/dictionary.js +16 -0
- package/lib/cjs/ExpandCollapse/index.js +19 -0
- package/lib/cjs/ExpandCollapseMini/ExpandCollapseMini.js +84 -0
- package/lib/cjs/ExpandCollapseMini/ExpandCollapseMiniControl.js +133 -0
- package/lib/cjs/ExpandCollapseMini/index.js +9 -0
- package/lib/cjs/Feedback/Feedback.js +167 -0
- package/lib/cjs/Feedback/index.js +9 -0
- package/lib/cjs/Fieldset/Fieldset.js +198 -0
- package/lib/cjs/Fieldset/FieldsetContainer.js +55 -0
- package/lib/cjs/Fieldset/FieldsetContainer.native.js +39 -0
- package/lib/cjs/Fieldset/Legend.js +29 -0
- package/lib/cjs/Fieldset/Legend.native.js +36 -0
- package/lib/cjs/Fieldset/cssReset.js +20 -0
- package/lib/cjs/Fieldset/index.js +9 -0
- package/lib/cjs/FileUpload/FileUpload.js +370 -0
- package/lib/cjs/FileUpload/NotificationContent.js +59 -0
- package/lib/cjs/FileUpload/dictionary.js +50 -0
- package/lib/cjs/FileUpload/index.js +9 -0
- package/lib/cjs/FlexGrid/Col/Col.js +264 -0
- package/lib/cjs/FlexGrid/Col/index.js +9 -0
- package/lib/cjs/FlexGrid/FlexGrid.js +165 -0
- package/lib/cjs/FlexGrid/Row/Row.js +188 -0
- package/lib/cjs/FlexGrid/Row/index.js +9 -0
- package/lib/cjs/FlexGrid/helpers/index.js +21 -0
- package/lib/cjs/FlexGrid/index.js +9 -0
- package/lib/cjs/FlexGrid/providers/GutterContext.js +10 -0
- package/lib/cjs/Footnote/Footnote.js +323 -0
- package/lib/cjs/Footnote/FootnoteLink.js +114 -0
- package/lib/cjs/Footnote/dictionary.js +18 -0
- package/lib/cjs/Footnote/index.js +11 -0
- package/lib/cjs/HorizontalScroll/HorizontalScroll.js +175 -0
- package/lib/cjs/HorizontalScroll/HorizontalScrollButton.js +86 -0
- package/lib/cjs/HorizontalScroll/ScrollViewEnd.js +53 -0
- package/lib/cjs/HorizontalScroll/ScrollViewEnd.native.js +32 -0
- package/lib/cjs/HorizontalScroll/dictionary.js +17 -0
- package/lib/cjs/HorizontalScroll/index.js +26 -0
- package/lib/cjs/HorizontalScroll/itemPositions.js +122 -0
- package/lib/cjs/Icon/Icon.js +101 -0
- package/lib/cjs/Icon/IconText.js +117 -0
- package/lib/cjs/Icon/index.js +24 -0
- package/lib/cjs/IconButton/IconButton.js +208 -0
- package/lib/cjs/IconButton/index.js +9 -0
- package/lib/cjs/InputLabel/InputLabel.js +184 -0
- package/lib/cjs/InputLabel/LabelContent.js +35 -0
- package/lib/cjs/InputLabel/LabelContent.native.js +26 -0
- package/lib/cjs/InputLabel/index.js +9 -0
- package/lib/cjs/InputSupports/InputSupports.js +140 -0
- package/lib/cjs/InputSupports/dictionary.js +18 -0
- package/lib/cjs/InputSupports/index.js +9 -0
- package/lib/cjs/InputSupports/useInputSupports.js +47 -0
- package/lib/cjs/Link/ChevronLink.js +73 -0
- package/lib/cjs/Link/InlinePressable.js +53 -0
- package/lib/cjs/Link/InlinePressable.native.js +93 -0
- package/lib/cjs/Link/Link.js +35 -0
- package/lib/cjs/Link/LinkBase.js +283 -0
- package/lib/cjs/Link/TextButton.js +48 -0
- package/lib/cjs/Link/index.js +34 -0
- package/lib/cjs/List/List.js +83 -0
- package/lib/cjs/List/ListItem.js +37 -0
- package/lib/cjs/List/ListItemBase.js +171 -0
- package/lib/cjs/List/ListItemContent.js +80 -0
- package/lib/cjs/List/ListItemMark.js +132 -0
- package/lib/cjs/List/PressableListItemBase.js +117 -0
- package/lib/cjs/List/index.js +23 -0
- package/lib/cjs/Listbox/GroupControl.js +112 -0
- package/lib/cjs/Listbox/Listbox.js +177 -0
- package/lib/cjs/Listbox/ListboxContext.js +11 -0
- package/lib/cjs/Listbox/ListboxGroup.js +133 -0
- package/lib/cjs/Listbox/ListboxItem.js +83 -0
- package/lib/cjs/Listbox/ListboxOverlay.js +87 -0
- package/lib/cjs/Listbox/PressableItem.js +146 -0
- package/lib/cjs/Listbox/index.js +9 -0
- package/lib/cjs/Modal/Modal.js +377 -0
- package/lib/cjs/Modal/ModalContent.js +205 -0
- package/lib/cjs/Modal/WebModal.js +83 -0
- package/lib/cjs/Modal/dictionary.js +15 -0
- package/lib/cjs/Modal/index.js +9 -0
- package/lib/cjs/MultiSelectFilter/ModalOverlay.js +162 -0
- package/lib/cjs/MultiSelectFilter/MultiSelectFilter.js +544 -0
- package/lib/cjs/MultiSelectFilter/dictionary.js +18 -0
- package/lib/cjs/MultiSelectFilter/index.js +9 -0
- package/lib/cjs/Notification/Notification.js +437 -0
- package/lib/cjs/Notification/dictionary.js +14 -0
- package/lib/cjs/Notification/index.js +9 -0
- package/lib/cjs/OrderedList/Item.js +166 -0
- package/lib/cjs/OrderedList/ItemBase.js +51 -0
- package/lib/cjs/OrderedList/OrderedList.js +70 -0
- package/lib/cjs/OrderedList/OrderedListBase.js +44 -0
- package/lib/cjs/OrderedList/index.js +9 -0
- package/lib/cjs/Pagination/PageButton.js +82 -0
- package/lib/cjs/Pagination/Pagination.js +226 -0
- package/lib/cjs/Pagination/SideButton.js +119 -0
- package/lib/cjs/Pagination/constants.js +9 -0
- package/lib/cjs/Pagination/dictionary.js +24 -0
- package/lib/cjs/Pagination/index.js +9 -0
- package/lib/cjs/Pagination/usePagination.js +83 -0
- package/lib/cjs/Portal/Portal.js +56 -0
- package/lib/cjs/Portal/Portal.native.js +8 -0
- package/lib/cjs/Portal/index.js +9 -0
- package/lib/cjs/PriceLockup/PriceLockup.js +230 -0
- package/lib/cjs/PriceLockup/index.js +9 -0
- package/lib/cjs/PriceLockup/utils/renderFootnoteContent.js +92 -0
- package/lib/cjs/PriceLockup/utils/renderFootnoteLinks.js +35 -0
- package/lib/cjs/PriceLockup/utils/renderPrice.js +146 -0
- package/lib/cjs/PriceLockup/utils/renderTypography.js +30 -0
- package/lib/cjs/ProductCard/ProductCard.js +237 -0
- package/lib/cjs/ProductCard/dictionary.js +44 -0
- package/lib/cjs/ProductCard/index.js +9 -0
- package/lib/cjs/ProductCardGroup/ProductCardGroup.js +77 -0
- package/lib/cjs/ProductCardGroup/index.js +9 -0
- package/lib/cjs/Progress/Progress.js +101 -0
- package/lib/cjs/Progress/ProgressBar.js +168 -0
- package/lib/cjs/Progress/ProgressBarBackground.js +49 -0
- package/lib/cjs/Progress/constants.js +10 -0
- package/lib/cjs/Progress/index.js +11 -0
- package/lib/cjs/QuickLinks/QuickLinks.js +83 -0
- package/lib/cjs/QuickLinks/QuickLinksCard.js +38 -0
- package/lib/cjs/QuickLinks/QuickLinksItem.js +56 -0
- package/lib/cjs/QuickLinks/index.js +11 -0
- package/lib/cjs/QuickLinksFeature/QuickLinksFeature.js +74 -0
- package/lib/cjs/QuickLinksFeature/QuickLinksFeatureItem.js +152 -0
- package/lib/cjs/QuickLinksFeature/index.js +11 -0
- package/lib/cjs/Radio/Radio.js +291 -0
- package/lib/cjs/Radio/RadioButton.js +191 -0
- package/lib/cjs/Radio/RadioGroup.js +262 -0
- package/lib/cjs/Radio/RadioInput.js +55 -0
- package/lib/cjs/Radio/RadioInput.native.js +11 -0
- package/lib/cjs/Radio/index.js +16 -0
- package/lib/cjs/RadioCard/RadioCard.js +219 -0
- package/lib/cjs/RadioCard/RadioCardGroup.js +266 -0
- package/lib/cjs/RadioCard/index.js +16 -0
- package/lib/cjs/Responsive/Responsive.js +70 -0
- package/lib/cjs/Responsive/ResponsiveProp.js +45 -0
- package/lib/cjs/Responsive/ResponsiveWithMediaQueryStyleSheet.js +75 -0
- package/lib/cjs/Responsive/index.js +9 -0
- package/lib/cjs/Search/Search.js +281 -0
- package/lib/cjs/Search/dictionary.js +18 -0
- package/lib/cjs/Search/index.js +9 -0
- package/lib/cjs/Select/Group.js +31 -0
- package/lib/cjs/Select/Group.native.js +23 -0
- package/lib/cjs/Select/Item.js +30 -0
- package/lib/cjs/Select/Item.native.js +8 -0
- package/lib/cjs/Select/Picker.js +103 -0
- package/lib/cjs/Select/Picker.native.js +130 -0
- package/lib/cjs/Select/Select.js +339 -0
- package/lib/cjs/Select/constants.js +13 -0
- package/lib/cjs/Select/index.js +13 -0
- package/lib/cjs/SideNav/Item.js +150 -0
- package/lib/cjs/SideNav/ItemContent.js +56 -0
- package/lib/cjs/SideNav/ItemsGroup.js +125 -0
- package/lib/cjs/SideNav/SideNav.js +139 -0
- package/lib/cjs/SideNav/index.js +13 -0
- package/lib/cjs/Skeleton/Skeleton.js +184 -0
- package/lib/cjs/Skeleton/index.js +9 -0
- package/lib/cjs/Skeleton/skeleton.constant.js +8 -0
- package/lib/cjs/Skeleton/skeletonWebAnimation.js +20 -0
- package/lib/cjs/Skeleton/useSkeletonNativeAnimation.js +35 -0
- package/lib/cjs/SkipLink/SkipLink.js +196 -0
- package/lib/cjs/SkipLink/index.js +9 -0
- package/lib/cjs/Spacer/Spacer.js +100 -0
- package/lib/cjs/Spacer/index.js +9 -0
- package/lib/cjs/StackView/StackView.js +133 -0
- package/lib/cjs/StackView/StackWrap.js +54 -0
- package/lib/cjs/StackView/StackWrap.native.js +10 -0
- package/lib/cjs/StackView/StackWrapBox.js +121 -0
- package/lib/cjs/StackView/StackWrapGap.js +68 -0
- package/lib/cjs/StackView/common.js +43 -0
- package/lib/cjs/StackView/getStackedContent.js +128 -0
- package/lib/cjs/StackView/index.js +23 -0
- package/lib/cjs/Status/Status.js +176 -0
- package/lib/cjs/Status/index.js +9 -0
- package/lib/cjs/StepTracker/Step.js +271 -0
- package/lib/cjs/StepTracker/StepTracker.js +220 -0
- package/lib/cjs/StepTracker/dictionary.js +36 -0
- package/lib/cjs/StepTracker/index.js +9 -0
- package/lib/cjs/TabBar/TabBar.js +132 -0
- package/lib/cjs/TabBar/TabBarItem.js +182 -0
- package/lib/cjs/TabBar/index.js +9 -0
- package/lib/cjs/Tabs/Tabs.js +188 -0
- package/lib/cjs/Tabs/TabsItem.js +245 -0
- package/lib/cjs/Tabs/index.js +9 -0
- package/lib/cjs/Tags/Tags.js +252 -0
- package/lib/cjs/Tags/index.js +9 -0
- package/lib/cjs/TextInput/TextArea.js +105 -0
- package/lib/cjs/TextInput/TextInput.js +86 -0
- package/lib/cjs/TextInput/TextInputBase.js +502 -0
- package/lib/cjs/TextInput/dictionary.js +18 -0
- package/lib/cjs/TextInput/index.js +20 -0
- package/lib/cjs/TextInput/propTypes.js +40 -0
- package/lib/cjs/ThemeProvider/ThemeProvider.js +91 -0
- package/lib/cjs/ThemeProvider/index.js +59 -0
- package/lib/cjs/ThemeProvider/useResponsiveThemeTokens.js +88 -0
- package/lib/cjs/ThemeProvider/useSetTheme.js +30 -0
- package/lib/cjs/ThemeProvider/useTheme.js +17 -0
- package/lib/cjs/ThemeProvider/useThemeTokens.js +118 -0
- package/lib/cjs/ThemeProvider/utils/index.js +27 -0
- package/lib/cjs/ThemeProvider/utils/styles.js +208 -0
- package/lib/cjs/ThemeProvider/utils/theme-tokens.js +173 -0
- package/lib/cjs/Timeline/Timeline.js +175 -0
- package/lib/cjs/Timeline/index.js +9 -0
- package/lib/cjs/ToggleSwitch/ToggleSwitch.js +286 -0
- package/lib/cjs/ToggleSwitch/ToggleSwitchGroup.js +215 -0
- package/lib/cjs/ToggleSwitch/index.js +20 -0
- package/lib/cjs/Tooltip/Backdrop.js +57 -0
- package/lib/cjs/Tooltip/Backdrop.native.js +46 -0
- package/lib/cjs/Tooltip/Tooltip.js +295 -0
- package/lib/cjs/Tooltip/Tooltip.native.js +370 -0
- package/lib/cjs/Tooltip/dictionary.js +14 -0
- package/lib/cjs/Tooltip/getTooltipPosition.js +175 -0
- package/lib/cjs/Tooltip/index.js +12 -0
- package/lib/cjs/Tooltip/shared.js +48 -0
- package/lib/cjs/TooltipButton/TooltipButton.js +97 -0
- package/lib/cjs/TooltipButton/index.js +9 -0
- package/lib/cjs/Typography/Typography.js +271 -0
- package/lib/cjs/Typography/index.js +9 -0
- package/lib/cjs/Validator/Validator.js +228 -0
- package/lib/cjs/Validator/index.js +9 -0
- package/lib/cjs/ViewportProvider/ViewportProvider.js +32 -0
- package/lib/cjs/ViewportProvider/index.js +22 -0
- package/lib/cjs/ViewportProvider/useViewport.js +10 -0
- package/lib/cjs/ViewportProvider/useViewportListener.js +43 -0
- package/lib/cjs/index.js +781 -0
- package/lib/cjs/server.js +40 -0
- package/lib/cjs/utils/BaseView/BaseView.js +47 -0
- package/lib/cjs/utils/BaseView/BaseView.native.js +12 -0
- package/lib/cjs/utils/BaseView/index.js +9 -0
- package/lib/cjs/utils/a11y/index.js +27 -0
- package/lib/cjs/utils/a11y/semantics.js +145 -0
- package/lib/cjs/utils/a11y/textSize.js +44 -0
- package/lib/cjs/utils/animation/index.js +13 -0
- package/lib/cjs/utils/animation/useVerticalExpandAnimation.js +92 -0
- package/lib/cjs/utils/children.js +121 -0
- package/lib/cjs/utils/containUniqueFields.js +30 -0
- package/lib/cjs/utils/convertFromMegaByteToByte.js +16 -0
- package/lib/cjs/utils/floating-ui/index.js +42 -0
- package/lib/cjs/utils/floating-ui/index.native.js +42 -0
- package/lib/cjs/utils/formatImageSource.js +33 -0
- package/lib/cjs/utils/hasOwnProperty.js +17 -0
- package/lib/cjs/utils/htmlAttrs.js +30 -0
- package/lib/cjs/utils/index.js +245 -0
- package/lib/cjs/utils/info/index.js +14 -0
- package/lib/cjs/utils/info/platform/index.js +18 -0
- package/lib/cjs/utils/info/platform/platform.android.js +7 -0
- package/lib/cjs/utils/info/platform/platform.ios.js +7 -0
- package/lib/cjs/utils/info/platform/platform.js +7 -0
- package/lib/cjs/utils/info/platform/platform.native.js +10 -0
- package/lib/cjs/utils/info/versions.js +12 -0
- package/lib/cjs/utils/input.js +193 -0
- package/lib/cjs/utils/pressability.js +122 -0
- package/lib/cjs/utils/props/a11yProps.js +315 -0
- package/lib/cjs/utils/props/clickProps.js +32 -0
- package/lib/cjs/utils/props/componentPropType.js +55 -0
- package/lib/cjs/utils/props/contentfulProps.js +29 -0
- package/lib/cjs/utils/props/copyPropTypes.js +9 -0
- package/lib/cjs/utils/props/getPropSelector.js +58 -0
- package/lib/cjs/utils/props/handlerProps.js +111 -0
- package/lib/cjs/utils/props/hrefAttrsProp.js +39 -0
- package/lib/cjs/utils/props/index.js +176 -0
- package/lib/cjs/utils/props/inputSupportsProps.js +87 -0
- package/lib/cjs/utils/props/linkProps.js +50 -0
- package/lib/cjs/utils/props/paddingProp.js +16 -0
- package/lib/cjs/utils/props/pressProps.js +49 -0
- package/lib/cjs/utils/props/rectProp.js +16 -0
- package/lib/cjs/utils/props/responsiveProps.js +35 -0
- package/lib/cjs/utils/props/selectSystemProps.js +29 -0
- package/lib/cjs/utils/props/spacingProps.js +63 -0
- package/lib/cjs/utils/props/textInputProps.js +194 -0
- package/lib/cjs/utils/props/textProps.js +67 -0
- package/lib/cjs/utils/props/tokens.js +140 -0
- package/lib/cjs/utils/props/variantProp.js +24 -0
- package/lib/cjs/utils/props/viewProps.js +28 -0
- package/lib/cjs/utils/ssr-media-query/create-stylesheet/create-stylesheet-mobile.js +55 -0
- package/lib/cjs/utils/ssr-media-query/create-stylesheet/index.android.js +9 -0
- package/lib/cjs/utils/ssr-media-query/create-stylesheet/index.ios.js +9 -0
- package/lib/cjs/utils/ssr-media-query/create-stylesheet/index.js +42 -0
- package/lib/cjs/utils/ssr-media-query/hash.js +19 -0
- package/lib/cjs/utils/ssr-media-query/index.js +18 -0
- package/lib/cjs/utils/ssr-media-query/utils/common.js +44 -0
- package/lib/cjs/utils/ssr-media-query/utils/create-declaration-block.js +23 -0
- package/lib/cjs/utils/ssr-media-query/utils/create-media-query-styles.js +66 -0
- package/lib/cjs/utils/ssr-media-query/utils/hyphenate-style-name.js +18 -0
- package/lib/cjs/utils/ssr-media-query/utils/inject.js +47 -0
- package/lib/cjs/utils/ssr.js +150 -0
- package/lib/cjs/utils/transformGradient.js +22 -0
- package/lib/cjs/utils/useCopy.js +48 -0
- package/lib/cjs/utils/useHash.js +44 -0
- package/lib/cjs/utils/useHash.native.js +12 -0
- package/lib/cjs/utils/useOverlaidPosition.js +242 -0
- package/lib/cjs/utils/useResponsiveProp.js +53 -0
- package/lib/cjs/utils/useSafeLayoutEffect.js +34 -0
- package/lib/cjs/utils/useScrollBlocking.js +55 -0
- package/lib/cjs/utils/useScrollBlocking.native.js +9 -0
- package/lib/cjs/utils/useSpacingScale.js +129 -0
- package/lib/cjs/utils/useUniqueId.js +17 -0
- package/lib/cjs/utils/withLinkRouter.js +89 -0
- package/lib/esm/A11yInfoProvider/index.js +65 -0
- package/lib/esm/Autocomplete/Autocomplete.js +473 -0
- package/lib/esm/Autocomplete/Suggestions.js +64 -0
- package/lib/esm/BaseProvider/HydrationContext.js +47 -0
- package/lib/esm/BaseProvider/index.js +40 -0
- package/lib/esm/Button/ButtonDropdown.js +173 -0
- package/lib/esm/Card/Card.js +327 -0
- package/lib/esm/Card/CardBase.js +120 -0
- package/lib/esm/Card/PressableCardBase.js +113 -0
- package/lib/esm/CardGroup/CardGroup.js +210 -0
- package/lib/esm/Carousel/Carousel.js +1039 -0
- package/lib/esm/Carousel/CarouselItem/CarouselItem.js +178 -0
- package/lib/esm/Carousel/CarouselStepTracker/CarouselStepTracker.js +94 -0
- package/lib/esm/Carousel/CarouselTabs/CarouselTabs.js +49 -0
- package/lib/esm/Carousel/CarouselTabs/CarouselTabsPanel.js +88 -0
- package/lib/esm/Carousel/CarouselTabs/CarouselTabsPanelItem.js +118 -0
- package/lib/esm/Carousel/CarouselThumbnail.js +113 -0
- package/lib/esm/Carousel/Constants.js +7 -0
- package/lib/esm/Checkbox/Checkbox.js +342 -0
- package/lib/esm/ColourToggle/ColourToggle.js +91 -0
- package/lib/esm/ExpandCollapseMini/ExpandCollapseMini.js +77 -0
- package/lib/esm/ExpandCollapseMini/ExpandCollapseMiniControl.js +126 -0
- package/lib/esm/ExpandCollapseMini/index.js +2 -0
- package/lib/esm/Footnote/Footnote.js +316 -0
- package/lib/esm/HorizontalScroll/HorizontalScroll.js +167 -0
- package/lib/esm/Icon/Icon.js +94 -0
- package/lib/esm/Icon/IconText.js +110 -0
- package/lib/esm/IconButton/IconButton.js +202 -0
- package/lib/esm/InputSupports/InputSupports.js +133 -0
- package/lib/esm/Link/LinkBase.js +276 -0
- package/lib/esm/List/List.js +76 -0
- package/lib/esm/List/ListItemContent.js +73 -0
- package/lib/esm/Listbox/Listbox.js +168 -0
- package/lib/esm/Listbox/PressableItem.js +139 -0
- package/lib/esm/Modal/Modal.js +370 -0
- package/lib/esm/MultiSelectFilter/MultiSelectFilter.js +537 -0
- package/lib/esm/Notification/Notification.js +430 -0
- package/lib/esm/OrderedList/OrderedList.js +63 -0
- package/lib/esm/Pagination/usePagination.js +77 -0
- package/lib/esm/PriceLockup/utils/renderFootnoteContent.js +85 -0
- package/lib/esm/PriceLockup/utils/renderFootnoteLinks.js +28 -0
- package/lib/esm/PriceLockup/utils/renderPrice.js +139 -0
- package/lib/esm/ProductCard/ProductCard.js +230 -0
- package/lib/esm/Progress/ProgressBarBackground.js +42 -0
- package/lib/esm/QuickLinksFeature/QuickLinksFeature.js +68 -0
- package/lib/esm/Radio/Radio.js +282 -0
- package/lib/esm/Search/Search.js +274 -0
- package/lib/esm/Select/Picker.js +96 -0
- package/lib/esm/StackView/StackWrap.js +48 -0
- package/lib/esm/StackView/getStackedContent.js +121 -0
- package/lib/esm/StepTracker/StepTracker.js +213 -0
- package/lib/esm/TabBar/TabBar.js +125 -0
- package/lib/esm/Tabs/Tabs.js +179 -0
- package/lib/esm/Tabs/TabsItem.js +238 -0
- package/lib/esm/TextInput/TextArea.js +98 -0
- package/lib/esm/TextInput/TextInput.js +79 -0
- package/lib/esm/TextInput/TextInputBase.js +495 -0
- package/lib/esm/ThemeProvider/utils/theme-tokens.js +158 -0
- package/lib/esm/Timeline/Timeline.js +168 -0
- package/lib/esm/Tooltip/Tooltip.native.js +363 -0
- package/lib/esm/Typography/Typography.js +265 -0
- package/lib/esm/Validator/Validator.js +221 -0
- package/lib/esm/ViewportProvider/useViewportListener.js +37 -0
- package/lib/esm/index.js +72 -0
- package/lib/esm/utils/children.js +113 -0
- package/lib/esm/utils/input.js +185 -0
- package/lib/esm/utils/props/componentPropType.js +49 -0
- package/lib/esm/utils/props/selectSystemProps.js +23 -0
- package/lib/esm/utils/ssr-media-query/create-stylesheet/create-stylesheet-mobile.js +48 -0
- package/lib/esm/utils/ssr-media-query/create-stylesheet/index.js +35 -0
- package/lib/esm/utils/ssr-media-query/utils/inject.js +37 -0
- package/lib/esm/utils/useHash.js +38 -0
- package/lib/esm/utils/useOverlaidPosition.js +235 -0
- package/lib/esm/utils/useScrollBlocking.js +49 -0
- package/lib/esm/utils/useSpacingScale.js +123 -0
- package/lib/package.json +88 -0
- package/package.json +13 -11
- package/src/Carousel/Carousel.jsx +228 -155
- package/src/Carousel/CarouselItem/CarouselItem.jsx +14 -4
- package/src/Carousel/CarouselStepTracker/CarouselStepTracker.jsx +3 -0
- package/src/Carousel/Constants.js +4 -0
- package/src/ExpandCollapseMini/ExpandCollapseMini.jsx +76 -0
- package/src/ExpandCollapseMini/ExpandCollapseMiniControl.jsx +119 -0
- package/src/ExpandCollapseMini/index.js +3 -0
- package/src/Link/LinkBase.jsx +8 -3
- package/src/TextInput/TextInputBase.jsx +30 -1
- package/src/index.js +1 -0
- package/src/utils/useOverlaidPosition.js +23 -0
- package/lib/A11yInfoProvider/index.js +0 -65
- package/lib/Autocomplete/Autocomplete.js +0 -483
- package/lib/Autocomplete/Suggestions.js +0 -64
- package/lib/BaseProvider/HydrationContext.js +0 -48
- package/lib/BaseProvider/index.js +0 -41
- package/lib/Button/ButtonDropdown.js +0 -173
- package/lib/Card/Card.js +0 -328
- package/lib/Card/CardBase.js +0 -120
- package/lib/Card/PressableCardBase.js +0 -113
- package/lib/CardGroup/CardGroup.js +0 -210
- package/lib/Carousel/Carousel.js +0 -981
- package/lib/Carousel/CarouselItem/CarouselItem.js +0 -161
- package/lib/Carousel/CarouselStepTracker/CarouselStepTracker.js +0 -91
- package/lib/Carousel/CarouselTabs/CarouselTabs.js +0 -50
- package/lib/Carousel/CarouselTabs/CarouselTabsPanel.js +0 -88
- package/lib/Carousel/CarouselTabs/CarouselTabsPanelItem.js +0 -118
- package/lib/Carousel/CarouselThumbnail.js +0 -113
- package/lib/Carousel/Constants.js +0 -3
- package/lib/Checkbox/Checkbox.js +0 -342
- package/lib/ColourToggle/ColourToggle.js +0 -91
- package/lib/Footnote/Footnote.js +0 -316
- package/lib/HorizontalScroll/HorizontalScroll.js +0 -168
- package/lib/Icon/Icon.js +0 -94
- package/lib/Icon/IconText.js +0 -111
- package/lib/IconButton/IconButton.js +0 -203
- package/lib/InputSupports/InputSupports.js +0 -133
- package/lib/Link/LinkBase.js +0 -271
- package/lib/List/List.js +0 -77
- package/lib/List/ListItemContent.js +0 -73
- package/lib/Listbox/Listbox.js +0 -171
- package/lib/Listbox/PressableItem.js +0 -139
- package/lib/Modal/Modal.js +0 -373
- package/lib/MultiSelectFilter/MultiSelectFilter.js +0 -537
- package/lib/Notification/Notification.js +0 -432
- package/lib/OrderedList/OrderedList.js +0 -64
- package/lib/Pagination/usePagination.js +0 -78
- package/lib/PriceLockup/utils/renderFootnoteContent.js +0 -85
- package/lib/PriceLockup/utils/renderFootnoteLinks.js +0 -28
- package/lib/PriceLockup/utils/renderPrice.js +0 -139
- package/lib/ProductCard/ProductCard.js +0 -231
- package/lib/Progress/ProgressBarBackground.js +0 -42
- package/lib/QuickLinksFeature/QuickLinksFeature.js +0 -69
- package/lib/Radio/Radio.js +0 -282
- package/lib/Search/Search.js +0 -275
- package/lib/Select/Picker.js +0 -96
- package/lib/StackView/StackWrap.js +0 -51
- package/lib/StackView/getStackedContent.js +0 -122
- package/lib/StepTracker/StepTracker.js +0 -214
- package/lib/TabBar/TabBar.js +0 -125
- package/lib/Tabs/Tabs.js +0 -179
- package/lib/Tabs/TabsItem.js +0 -238
- package/lib/TextInput/TextArea.js +0 -98
- package/lib/TextInput/TextInput.js +0 -79
- package/lib/TextInput/TextInputBase.js +0 -468
- package/lib/ThemeProvider/utils/theme-tokens.js +0 -160
- package/lib/Timeline/Timeline.js +0 -169
- package/lib/Tooltip/Tooltip.native.js +0 -363
- package/lib/Typography/Typography.js +0 -266
- package/lib/Validator/Validator.js +0 -226
- package/lib/ViewportProvider/useViewportListener.js +0 -37
- package/lib/index.js +0 -71
- package/lib/utils/children.js +0 -117
- package/lib/utils/input.js +0 -185
- package/lib/utils/props/componentPropType.js +0 -50
- package/lib/utils/props/selectSystemProps.js +0 -23
- package/lib/utils/ssr-media-query/create-stylesheet/create-stylesheet-mobile.js +0 -48
- package/lib/utils/ssr-media-query/create-stylesheet/index.js +0 -36
- package/lib/utils/ssr-media-query/utils/inject.js +0 -39
- package/lib/utils/useHash.js +0 -41
- package/lib/utils/useOverlaidPosition.js +0 -214
- package/lib/utils/useScrollBlocking.js +0 -51
- package/lib/utils/useSpacingScale.js +0 -123
- /package/lib/{A11yText → esm/A11yText}/index.js +0 -0
- /package/lib/{ActionCard → esm/ActionCard}/ActionCard.js +0 -0
- /package/lib/{ActionCard → esm/ActionCard}/index.js +0 -0
- /package/lib/{ActivityIndicator → esm/ActivityIndicator}/Spinner.js +0 -0
- /package/lib/{ActivityIndicator → esm/ActivityIndicator}/Spinner.native.js +0 -0
- /package/lib/{ActivityIndicator → esm/ActivityIndicator}/index.js +0 -0
- /package/lib/{ActivityIndicator → esm/ActivityIndicator}/shared.js +0 -0
- /package/lib/{Autocomplete → esm/Autocomplete}/Loading.js +0 -0
- /package/lib/{Autocomplete → esm/Autocomplete}/constants.js +0 -0
- /package/lib/{Autocomplete → esm/Autocomplete}/dictionary.js +0 -0
- /package/lib/{Autocomplete → esm/Autocomplete}/index.js +0 -0
- /package/lib/{Badge → esm/Badge}/Badge.js +0 -0
- /package/lib/{Badge → esm/Badge}/index.js +0 -0
- /package/lib/{Box → esm/Box}/Box.js +0 -0
- /package/lib/{Box → esm/Box}/backgroundImageStylesMap.js +0 -0
- /package/lib/{Box → esm/Box}/index.js +0 -0
- /package/lib/{Button → esm/Button}/Button.js +0 -0
- /package/lib/{Button → esm/Button}/ButtonBase.js +0 -0
- /package/lib/{Button → esm/Button}/ButtonGroup.js +0 -0
- /package/lib/{Button → esm/Button}/ButtonLink.js +0 -0
- /package/lib/{Button → esm/Button}/index.js +0 -0
- /package/lib/{Button → esm/Button}/propTypes.js +0 -0
- /package/lib/{Card → esm/Card}/index.js +0 -0
- /package/lib/{CardGroup → esm/CardGroup}/dictionary.js +0 -0
- /package/lib/{CardGroup → esm/CardGroup}/index.js +0 -0
- /package/lib/{Carousel → esm/Carousel}/CarouselContext.js +0 -0
- /package/lib/{Carousel → esm/Carousel}/CarouselFirstFocus/CarouselFirstFocus.js +0 -0
- /package/lib/{Carousel → esm/Carousel}/CarouselItem/index.js +0 -0
- /package/lib/{Carousel → esm/Carousel}/CarouselStepTracker/index.js +0 -0
- /package/lib/{Carousel → esm/Carousel}/CarouselTabs/index.js +0 -0
- /package/lib/{Carousel → esm/Carousel}/CarouselThumbnailNavigation.js +0 -0
- /package/lib/{Carousel → esm/Carousel}/dictionary.js +0 -0
- /package/lib/{Carousel → esm/Carousel}/index.js +0 -0
- /package/lib/{Checkbox → esm/Checkbox}/CheckboxButton.js +0 -0
- /package/lib/{Checkbox → esm/Checkbox}/CheckboxGroup.js +0 -0
- /package/lib/{Checkbox → esm/Checkbox}/CheckboxInput.js +0 -0
- /package/lib/{Checkbox → esm/Checkbox}/CheckboxInput.native.js +0 -0
- /package/lib/{Checkbox → esm/Checkbox}/index.js +0 -0
- /package/lib/{CheckboxCard → esm/CheckboxCard}/CheckboxCard.js +0 -0
- /package/lib/{CheckboxCard → esm/CheckboxCard}/index.js +0 -0
- /package/lib/{CheckboxCardGroup → esm/CheckboxCardGroup}/CheckboxCardGroup.js +0 -0
- /package/lib/{CheckboxCardGroup → esm/CheckboxCardGroup}/index.js +0 -0
- /package/lib/{ColourToggle → esm/ColourToggle}/ColourBubble.js +0 -0
- /package/lib/{ColourToggle → esm/ColourToggle}/index.js +0 -0
- /package/lib/{Divider → esm/Divider}/Divider.js +0 -0
- /package/lib/{Divider → esm/Divider}/index.js +0 -0
- /package/lib/{DownloadApp → esm/DownloadApp}/DownloadApp.js +0 -0
- /package/lib/{DownloadApp → esm/DownloadApp}/dictionary.js +0 -0
- /package/lib/{DownloadApp → esm/DownloadApp}/index.js +0 -0
- /package/lib/{ExpandCollapse → esm/ExpandCollapse}/Accordion.js +0 -0
- /package/lib/{ExpandCollapse → esm/ExpandCollapse}/Control.js +0 -0
- /package/lib/{ExpandCollapse → esm/ExpandCollapse}/ExpandCollapse.js +0 -0
- /package/lib/{ExpandCollapse → esm/ExpandCollapse}/Panel.js +0 -0
- /package/lib/{ExpandCollapse → esm/ExpandCollapse}/dictionary.js +0 -0
- /package/lib/{ExpandCollapse → esm/ExpandCollapse}/index.js +0 -0
- /package/lib/{Feedback → esm/Feedback}/Feedback.js +0 -0
- /package/lib/{Feedback → esm/Feedback}/index.js +0 -0
- /package/lib/{Fieldset → esm/Fieldset}/Fieldset.js +0 -0
- /package/lib/{Fieldset → esm/Fieldset}/FieldsetContainer.js +0 -0
- /package/lib/{Fieldset → esm/Fieldset}/FieldsetContainer.native.js +0 -0
- /package/lib/{Fieldset → esm/Fieldset}/Legend.js +0 -0
- /package/lib/{Fieldset → esm/Fieldset}/Legend.native.js +0 -0
- /package/lib/{Fieldset → esm/Fieldset}/cssReset.js +0 -0
- /package/lib/{Fieldset → esm/Fieldset}/index.js +0 -0
- /package/lib/{FileUpload → esm/FileUpload}/FileUpload.js +0 -0
- /package/lib/{FileUpload → esm/FileUpload}/NotificationContent.js +0 -0
- /package/lib/{FileUpload → esm/FileUpload}/dictionary.js +0 -0
- /package/lib/{FileUpload → esm/FileUpload}/index.js +0 -0
- /package/lib/{FlexGrid → esm/FlexGrid}/Col/Col.js +0 -0
- /package/lib/{FlexGrid → esm/FlexGrid}/Col/index.js +0 -0
- /package/lib/{FlexGrid → esm/FlexGrid}/FlexGrid.js +0 -0
- /package/lib/{FlexGrid → esm/FlexGrid}/Row/Row.js +0 -0
- /package/lib/{FlexGrid → esm/FlexGrid}/Row/index.js +0 -0
- /package/lib/{FlexGrid → esm/FlexGrid}/helpers/index.js +0 -0
- /package/lib/{FlexGrid → esm/FlexGrid}/index.js +0 -0
- /package/lib/{FlexGrid → esm/FlexGrid}/providers/GutterContext.js +0 -0
- /package/lib/{Footnote → esm/Footnote}/FootnoteLink.js +0 -0
- /package/lib/{Footnote → esm/Footnote}/dictionary.js +0 -0
- /package/lib/{Footnote → esm/Footnote}/index.js +0 -0
- /package/lib/{HorizontalScroll → esm/HorizontalScroll}/HorizontalScrollButton.js +0 -0
- /package/lib/{HorizontalScroll → esm/HorizontalScroll}/ScrollViewEnd.js +0 -0
- /package/lib/{HorizontalScroll → esm/HorizontalScroll}/ScrollViewEnd.native.js +0 -0
- /package/lib/{HorizontalScroll → esm/HorizontalScroll}/dictionary.js +0 -0
- /package/lib/{HorizontalScroll → esm/HorizontalScroll}/index.js +0 -0
- /package/lib/{HorizontalScroll → esm/HorizontalScroll}/itemPositions.js +0 -0
- /package/lib/{Icon → esm/Icon}/index.js +0 -0
- /package/lib/{IconButton → esm/IconButton}/index.js +0 -0
- /package/lib/{InputLabel → esm/InputLabel}/InputLabel.js +0 -0
- /package/lib/{InputLabel → esm/InputLabel}/LabelContent.js +0 -0
- /package/lib/{InputLabel → esm/InputLabel}/LabelContent.native.js +0 -0
- /package/lib/{InputLabel → esm/InputLabel}/index.js +0 -0
- /package/lib/{InputSupports → esm/InputSupports}/dictionary.js +0 -0
- /package/lib/{InputSupports → esm/InputSupports}/index.js +0 -0
- /package/lib/{InputSupports → esm/InputSupports}/useInputSupports.js +0 -0
- /package/lib/{Link → esm/Link}/ChevronLink.js +0 -0
- /package/lib/{Link → esm/Link}/InlinePressable.js +0 -0
- /package/lib/{Link → esm/Link}/InlinePressable.native.js +0 -0
- /package/lib/{Link → esm/Link}/Link.js +0 -0
- /package/lib/{Link → esm/Link}/TextButton.js +0 -0
- /package/lib/{Link → esm/Link}/index.js +0 -0
- /package/lib/{List → esm/List}/ListItem.js +0 -0
- /package/lib/{List → esm/List}/ListItemBase.js +0 -0
- /package/lib/{List → esm/List}/ListItemMark.js +0 -0
- /package/lib/{List → esm/List}/PressableListItemBase.js +0 -0
- /package/lib/{List → esm/List}/index.js +0 -0
- /package/lib/{Listbox → esm/Listbox}/GroupControl.js +0 -0
- /package/lib/{Listbox → esm/Listbox}/ListboxContext.js +0 -0
- /package/lib/{Listbox → esm/Listbox}/ListboxGroup.js +0 -0
- /package/lib/{Listbox → esm/Listbox}/ListboxItem.js +0 -0
- /package/lib/{Listbox → esm/Listbox}/ListboxOverlay.js +0 -0
- /package/lib/{Listbox → esm/Listbox}/index.js +0 -0
- /package/lib/{Modal → esm/Modal}/ModalContent.js +0 -0
- /package/lib/{Modal → esm/Modal}/WebModal.js +0 -0
- /package/lib/{Modal → esm/Modal}/dictionary.js +0 -0
- /package/lib/{Modal → esm/Modal}/index.js +0 -0
- /package/lib/{MultiSelectFilter → esm/MultiSelectFilter}/ModalOverlay.js +0 -0
- /package/lib/{MultiSelectFilter → esm/MultiSelectFilter}/dictionary.js +0 -0
- /package/lib/{MultiSelectFilter → esm/MultiSelectFilter}/index.js +0 -0
- /package/lib/{Notification → esm/Notification}/dictionary.js +0 -0
- /package/lib/{Notification → esm/Notification}/index.js +0 -0
- /package/lib/{OrderedList → esm/OrderedList}/Item.js +0 -0
- /package/lib/{OrderedList → esm/OrderedList}/ItemBase.js +0 -0
- /package/lib/{OrderedList → esm/OrderedList}/OrderedListBase.js +0 -0
- /package/lib/{OrderedList → esm/OrderedList}/index.js +0 -0
- /package/lib/{Pagination → esm/Pagination}/PageButton.js +0 -0
- /package/lib/{Pagination → esm/Pagination}/Pagination.js +0 -0
- /package/lib/{Pagination → esm/Pagination}/SideButton.js +0 -0
- /package/lib/{Pagination → esm/Pagination}/constants.js +0 -0
- /package/lib/{Pagination → esm/Pagination}/dictionary.js +0 -0
- /package/lib/{Pagination → esm/Pagination}/index.js +0 -0
- /package/lib/{Portal → esm/Portal}/Portal.js +0 -0
- /package/lib/{Portal → esm/Portal}/Portal.native.js +0 -0
- /package/lib/{Portal → esm/Portal}/index.js +0 -0
- /package/lib/{PriceLockup → esm/PriceLockup}/PriceLockup.js +0 -0
- /package/lib/{PriceLockup → esm/PriceLockup}/index.js +0 -0
- /package/lib/{PriceLockup → esm/PriceLockup}/utils/renderTypography.js +0 -0
- /package/lib/{ProductCard → esm/ProductCard}/dictionary.js +0 -0
- /package/lib/{ProductCard → esm/ProductCard}/index.js +0 -0
- /package/lib/{ProductCardGroup → esm/ProductCardGroup}/ProductCardGroup.js +0 -0
- /package/lib/{ProductCardGroup → esm/ProductCardGroup}/index.js +0 -0
- /package/lib/{Progress → esm/Progress}/Progress.js +0 -0
- /package/lib/{Progress → esm/Progress}/ProgressBar.js +0 -0
- /package/lib/{Progress → esm/Progress}/constants.js +0 -0
- /package/lib/{Progress → esm/Progress}/index.js +0 -0
- /package/lib/{QuickLinks → esm/QuickLinks}/QuickLinks.js +0 -0
- /package/lib/{QuickLinks → esm/QuickLinks}/QuickLinksCard.js +0 -0
- /package/lib/{QuickLinks → esm/QuickLinks}/QuickLinksItem.js +0 -0
- /package/lib/{QuickLinks → esm/QuickLinks}/index.js +0 -0
- /package/lib/{QuickLinksFeature → esm/QuickLinksFeature}/QuickLinksFeatureItem.js +0 -0
- /package/lib/{QuickLinksFeature → esm/QuickLinksFeature}/index.js +0 -0
- /package/lib/{Radio → esm/Radio}/RadioButton.js +0 -0
- /package/lib/{Radio → esm/Radio}/RadioGroup.js +0 -0
- /package/lib/{Radio → esm/Radio}/RadioInput.js +0 -0
- /package/lib/{Radio → esm/Radio}/RadioInput.native.js +0 -0
- /package/lib/{Radio → esm/Radio}/index.js +0 -0
- /package/lib/{RadioCard → esm/RadioCard}/RadioCard.js +0 -0
- /package/lib/{RadioCard → esm/RadioCard}/RadioCardGroup.js +0 -0
- /package/lib/{RadioCard → esm/RadioCard}/index.js +0 -0
- /package/lib/{Responsive → esm/Responsive}/Responsive.js +0 -0
- /package/lib/{Responsive → esm/Responsive}/ResponsiveProp.js +0 -0
- /package/lib/{Responsive → esm/Responsive}/ResponsiveWithMediaQueryStyleSheet.js +0 -0
- /package/lib/{Responsive → esm/Responsive}/index.js +0 -0
- /package/lib/{Search → esm/Search}/dictionary.js +0 -0
- /package/lib/{Search → esm/Search}/index.js +0 -0
- /package/lib/{Select → esm/Select}/Group.js +0 -0
- /package/lib/{Select → esm/Select}/Group.native.js +0 -0
- /package/lib/{Select → esm/Select}/Item.js +0 -0
- /package/lib/{Select → esm/Select}/Item.native.js +0 -0
- /package/lib/{Select → esm/Select}/Picker.native.js +0 -0
- /package/lib/{Select → esm/Select}/Select.js +0 -0
- /package/lib/{Select → esm/Select}/constants.js +0 -0
- /package/lib/{Select → esm/Select}/index.js +0 -0
- /package/lib/{SideNav → esm/SideNav}/Item.js +0 -0
- /package/lib/{SideNav → esm/SideNav}/ItemContent.js +0 -0
- /package/lib/{SideNav → esm/SideNav}/ItemsGroup.js +0 -0
- /package/lib/{SideNav → esm/SideNav}/SideNav.js +0 -0
- /package/lib/{SideNav → esm/SideNav}/index.js +0 -0
- /package/lib/{Skeleton → esm/Skeleton}/Skeleton.js +0 -0
- /package/lib/{Skeleton → esm/Skeleton}/index.js +0 -0
- /package/lib/{Skeleton → esm/Skeleton}/skeleton.constant.js +0 -0
- /package/lib/{Skeleton → esm/Skeleton}/skeletonWebAnimation.js +0 -0
- /package/lib/{Skeleton → esm/Skeleton}/useSkeletonNativeAnimation.js +0 -0
- /package/lib/{SkipLink → esm/SkipLink}/SkipLink.js +0 -0
- /package/lib/{SkipLink → esm/SkipLink}/index.js +0 -0
- /package/lib/{Spacer → esm/Spacer}/Spacer.js +0 -0
- /package/lib/{Spacer → esm/Spacer}/index.js +0 -0
- /package/lib/{StackView → esm/StackView}/StackView.js +0 -0
- /package/lib/{StackView → esm/StackView}/StackWrap.native.js +0 -0
- /package/lib/{StackView → esm/StackView}/StackWrapBox.js +0 -0
- /package/lib/{StackView → esm/StackView}/StackWrapGap.js +0 -0
- /package/lib/{StackView → esm/StackView}/common.js +0 -0
- /package/lib/{StackView → esm/StackView}/index.js +0 -0
- /package/lib/{Status → esm/Status}/Status.js +0 -0
- /package/lib/{Status → esm/Status}/index.js +0 -0
- /package/lib/{StepTracker → esm/StepTracker}/Step.js +0 -0
- /package/lib/{StepTracker → esm/StepTracker}/dictionary.js +0 -0
- /package/lib/{StepTracker → esm/StepTracker}/index.js +0 -0
- /package/lib/{TabBar → esm/TabBar}/TabBarItem.js +0 -0
- /package/lib/{TabBar → esm/TabBar}/index.js +0 -0
- /package/lib/{Tabs → esm/Tabs}/index.js +0 -0
- /package/lib/{Tags → esm/Tags}/Tags.js +0 -0
- /package/lib/{Tags → esm/Tags}/index.js +0 -0
- /package/lib/{TextInput → esm/TextInput}/dictionary.js +0 -0
- /package/lib/{TextInput → esm/TextInput}/index.js +0 -0
- /package/lib/{TextInput → esm/TextInput}/propTypes.js +0 -0
- /package/lib/{ThemeProvider → esm/ThemeProvider}/ThemeProvider.js +0 -0
- /package/lib/{ThemeProvider → esm/ThemeProvider}/index.js +0 -0
- /package/lib/{ThemeProvider → esm/ThemeProvider}/useResponsiveThemeTokens.js +0 -0
- /package/lib/{ThemeProvider → esm/ThemeProvider}/useSetTheme.js +0 -0
- /package/lib/{ThemeProvider → esm/ThemeProvider}/useTheme.js +0 -0
- /package/lib/{ThemeProvider → esm/ThemeProvider}/useThemeTokens.js +0 -0
- /package/lib/{ThemeProvider → esm/ThemeProvider}/utils/index.js +0 -0
- /package/lib/{ThemeProvider → esm/ThemeProvider}/utils/styles.js +0 -0
- /package/lib/{Timeline → esm/Timeline}/index.js +0 -0
- /package/lib/{ToggleSwitch → esm/ToggleSwitch}/ToggleSwitch.js +0 -0
- /package/lib/{ToggleSwitch → esm/ToggleSwitch}/ToggleSwitchGroup.js +0 -0
- /package/lib/{ToggleSwitch → esm/ToggleSwitch}/index.js +0 -0
- /package/lib/{Tooltip → esm/Tooltip}/Backdrop.js +0 -0
- /package/lib/{Tooltip → esm/Tooltip}/Backdrop.native.js +0 -0
- /package/lib/{Tooltip → esm/Tooltip}/Tooltip.js +0 -0
- /package/lib/{Tooltip → esm/Tooltip}/dictionary.js +0 -0
- /package/lib/{Tooltip → esm/Tooltip}/getTooltipPosition.js +0 -0
- /package/lib/{Tooltip → esm/Tooltip}/index.js +0 -0
- /package/lib/{Tooltip → esm/Tooltip}/shared.js +0 -0
- /package/lib/{TooltipButton → esm/TooltipButton}/TooltipButton.js +0 -0
- /package/lib/{TooltipButton → esm/TooltipButton}/index.js +0 -0
- /package/lib/{Typography → esm/Typography}/index.js +0 -0
- /package/lib/{Validator → esm/Validator}/index.js +0 -0
- /package/lib/{ViewportProvider → esm/ViewportProvider}/ViewportProvider.js +0 -0
- /package/lib/{ViewportProvider → esm/ViewportProvider}/index.js +0 -0
- /package/lib/{ViewportProvider → esm/ViewportProvider}/useViewport.js +0 -0
- /package/lib/{server.js → esm/server.js} +0 -0
- /package/lib/{utils → esm/utils}/BaseView/BaseView.js +0 -0
- /package/lib/{utils → esm/utils}/BaseView/BaseView.native.js +0 -0
- /package/lib/{utils → esm/utils}/BaseView/index.js +0 -0
- /package/lib/{utils → esm/utils}/a11y/index.js +0 -0
- /package/lib/{utils → esm/utils}/a11y/semantics.js +0 -0
- /package/lib/{utils → esm/utils}/a11y/textSize.js +0 -0
- /package/lib/{utils → esm/utils}/animation/index.js +0 -0
- /package/lib/{utils → esm/utils}/animation/useVerticalExpandAnimation.js +0 -0
- /package/lib/{utils → esm/utils}/containUniqueFields.js +0 -0
- /package/lib/{utils → esm/utils}/convertFromMegaByteToByte.js +0 -0
- /package/lib/{utils → esm/utils}/floating-ui/index.js +0 -0
- /package/lib/{utils → esm/utils}/floating-ui/index.native.js +0 -0
- /package/lib/{utils → esm/utils}/formatImageSource.js +0 -0
- /package/lib/{utils → esm/utils}/hasOwnProperty.js +0 -0
- /package/lib/{utils → esm/utils}/htmlAttrs.js +0 -0
- /package/lib/{utils → esm/utils}/index.js +0 -0
- /package/lib/{utils → esm/utils}/info/index.js +0 -0
- /package/lib/{utils → esm/utils}/info/platform/index.js +0 -0
- /package/lib/{utils → esm/utils}/info/platform/platform.android.js +0 -0
- /package/lib/{utils → esm/utils}/info/platform/platform.ios.js +0 -0
- /package/lib/{utils → esm/utils}/info/platform/platform.js +0 -0
- /package/lib/{utils → esm/utils}/info/platform/platform.native.js +0 -0
- /package/lib/{utils → esm/utils}/info/versions.js +0 -0
- /package/lib/{utils → esm/utils}/pressability.js +0 -0
- /package/lib/{utils → esm/utils}/props/a11yProps.js +0 -0
- /package/lib/{utils → esm/utils}/props/clickProps.js +0 -0
- /package/lib/{utils → esm/utils}/props/contentfulProps.js +0 -0
- /package/lib/{utils → esm/utils}/props/copyPropTypes.js +0 -0
- /package/lib/{utils → esm/utils}/props/getPropSelector.js +0 -0
- /package/lib/{utils → esm/utils}/props/handlerProps.js +0 -0
- /package/lib/{utils → esm/utils}/props/hrefAttrsProp.js +0 -0
- /package/lib/{utils → esm/utils}/props/index.js +0 -0
- /package/lib/{utils → esm/utils}/props/inputSupportsProps.js +0 -0
- /package/lib/{utils → esm/utils}/props/linkProps.js +0 -0
- /package/lib/{utils → esm/utils}/props/paddingProp.js +0 -0
- /package/lib/{utils → esm/utils}/props/pressProps.js +0 -0
- /package/lib/{utils → esm/utils}/props/rectProp.js +0 -0
- /package/lib/{utils → esm/utils}/props/responsiveProps.js +0 -0
- /package/lib/{utils → esm/utils}/props/spacingProps.js +0 -0
- /package/lib/{utils → esm/utils}/props/textInputProps.js +0 -0
- /package/lib/{utils → esm/utils}/props/textProps.js +0 -0
- /package/lib/{utils → esm/utils}/props/tokens.js +0 -0
- /package/lib/{utils → esm/utils}/props/variantProp.js +0 -0
- /package/lib/{utils → esm/utils}/props/viewProps.js +0 -0
- /package/lib/{utils → esm/utils}/ssr-media-query/create-stylesheet/index.android.js +0 -0
- /package/lib/{utils → esm/utils}/ssr-media-query/create-stylesheet/index.ios.js +0 -0
- /package/lib/{utils → esm/utils}/ssr-media-query/hash.js +0 -0
- /package/lib/{utils → esm/utils}/ssr-media-query/index.js +0 -0
- /package/lib/{utils → esm/utils}/ssr-media-query/utils/common.js +0 -0
- /package/lib/{utils → esm/utils}/ssr-media-query/utils/create-declaration-block.js +0 -0
- /package/lib/{utils → esm/utils}/ssr-media-query/utils/create-media-query-styles.js +0 -0
- /package/lib/{utils → esm/utils}/ssr-media-query/utils/hyphenate-style-name.js +0 -0
- /package/lib/{utils → esm/utils}/ssr.js +0 -0
- /package/lib/{utils → esm/utils}/transformGradient.js +0 -0
- /package/lib/{utils → esm/utils}/useCopy.js +0 -0
- /package/lib/{utils → esm/utils}/useHash.native.js +0 -0
- /package/lib/{utils → esm/utils}/useResponsiveProp.js +0 -0
- /package/lib/{utils → esm/utils}/useSafeLayoutEffect.js +0 -0
- /package/lib/{utils → esm/utils}/useScrollBlocking.native.js +0 -0
- /package/lib/{utils → esm/utils}/useUniqueId.js +0 -0
- /package/lib/{utils → esm/utils}/withLinkRouter.js +0 -0
package/lib/utils/children.js
DELETED
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import Text from "react-native-web/dist/exports/Text";
|
|
3
|
-
import A11yText from '../A11yText';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Unpacks top-level fragments, so that common compositional patterns such as the following examples
|
|
7
|
-
* can be iterated as flat siblings (as if they were `<Child1 /><Child2 /><Child3 />`):
|
|
8
|
-
*
|
|
9
|
-
* - Setting `children` as a property wrapped in a fragment:
|
|
10
|
-
*
|
|
11
|
-
* ```jsx
|
|
12
|
-
* args.children = <><Child1 /><Child2 /><Child3 /></>
|
|
13
|
-
* ```
|
|
14
|
-
*
|
|
15
|
-
* - Defining `children` as a variable wrapped in a fragment:
|
|
16
|
-
*
|
|
17
|
-
* ```jsx
|
|
18
|
-
* const content = <><Child1 /><Child2 /><Child3 /></>
|
|
19
|
-
* if (someCondition) return <SomeWrapper>{content}</SomeWrapper>
|
|
20
|
-
* ```
|
|
21
|
-
*
|
|
22
|
-
* - Using fragments at the top level of a JSX block for conditional rendering:
|
|
23
|
-
*
|
|
24
|
-
* ```jsx
|
|
25
|
-
* <Child1 />
|
|
26
|
-
* {someCondition && (
|
|
27
|
-
* <>
|
|
28
|
-
* <Child2 />
|
|
29
|
-
* <Child3 />
|
|
30
|
-
* </>
|
|
31
|
-
* )}
|
|
32
|
-
* ```
|
|
33
|
-
*
|
|
34
|
-
* @param {ReactChildren} child
|
|
35
|
-
* @returns {ReactChildren}
|
|
36
|
-
*/
|
|
37
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
38
|
-
export const unpackFragment = child => {
|
|
39
|
-
var _child$props;
|
|
40
|
-
// If this level is a set of top-level siblings rather than one child, check each in turn
|
|
41
|
-
if (React.Children.count(child) > 1) return React.Children.map(child, unpackFragment);
|
|
42
|
-
|
|
43
|
-
// When a fragment is found, unpack its children to the top level and check them
|
|
44
|
-
if ((child === null || child === void 0 ? void 0 : child.type) === React.Fragment) return unpackFragment((_child$props = child.props) === null || _child$props === void 0 ? void 0 : _child$props.children);
|
|
45
|
-
|
|
46
|
-
// Stop unpacking as soon as any non-fragment child is found
|
|
47
|
-
return child;
|
|
48
|
-
};
|
|
49
|
-
const isStringOrNumber = child => typeof child === 'string' || typeof child === 'number';
|
|
50
|
-
// Wrap an A11yText with neighouring text strings so it doesn't split them into multiple <Text>s
|
|
51
|
-
const isWrapable = child => {
|
|
52
|
-
var _child$type;
|
|
53
|
-
return isStringOrNumber(child) || child.type === A11yText || ((_child$type = child.type) === null || _child$type === void 0 ? void 0 : _child$type.name) === 'FootnoteLink';
|
|
54
|
-
};
|
|
55
|
-
const combineKeys = childrenArray => childrenArray.reduce((newKey, child) => `${newKey}${child.key || ''}`, '');
|
|
56
|
-
|
|
57
|
-
// Group wrappable children for one `<Text>` parent, merging adjacent text nodes
|
|
58
|
-
const wrapChild = (child, wrappedText) => {
|
|
59
|
-
const lastIndex = wrappedText.length - 1;
|
|
60
|
-
// If possible, simplify content by combining text nodes into one string.
|
|
61
|
-
// jest-native's `.toHaveTextContent` is buggy about array of text nodes in <Text> elements.
|
|
62
|
-
if (lastIndex >= 0 && isStringOrNumber(child) && isStringOrNumber(wrappedText[lastIndex])) {
|
|
63
|
-
/* eslint-disable-next-line no-param-reassign */
|
|
64
|
-
wrappedText[lastIndex] = `${wrappedText[lastIndex]}${child}`;
|
|
65
|
-
} else {
|
|
66
|
-
wrappedText.push(child);
|
|
67
|
-
}
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
/**
|
|
71
|
-
* React Native on Native crashes if text content is rendered outside `<Text>`, and on web,
|
|
72
|
-
* text style inheritance behaves differently with text compared to regular HTML.
|
|
73
|
-
*
|
|
74
|
-
* Call this function on children that may contain text (strings or numbers) at the top level,
|
|
75
|
-
* and any that are found will be wrapped in a React Native `<Text>` element with supplied props.
|
|
76
|
-
*
|
|
77
|
-
* Note that this does not wrap strings that are nested children of rendered top level children:
|
|
78
|
-
* `wrapStringsInText(<View>Some text</View>)` will not wrap the inner text and will still crash,
|
|
79
|
-
* but `wrapStringsInText(<>{someString}{anotherString}</>)` wraps the strings inside the fragment.
|
|
80
|
-
*
|
|
81
|
-
* @param {ReactChildren} children
|
|
82
|
-
* @param {TextProps} props
|
|
83
|
-
* @returns {ReactChildren}
|
|
84
|
-
*/
|
|
85
|
-
export const wrapStringsInText = function (children) {
|
|
86
|
-
let textProps = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
87
|
-
const childrenArray = unpackFragment(React.Children.toArray(children));
|
|
88
|
-
|
|
89
|
-
// Group adjacent wrapable children together in one Text element to create as few Text elements
|
|
90
|
-
// as possible, e.g. give <X>Text {someString}</X> one Text, same as <X>{`Text ${someString}`}</X>
|
|
91
|
-
const wrapables = [[]];
|
|
92
|
-
let wrapablesIndex = 0;
|
|
93
|
-
childrenArray.forEach(child => {
|
|
94
|
-
if (isWrapable(child)) {
|
|
95
|
-
// Make this child a child of the current `Text`
|
|
96
|
-
wrapChild(child, wrapables[wrapablesIndex]);
|
|
97
|
-
} else {
|
|
98
|
-
// Close current `Text` and start a new one after this child
|
|
99
|
-
wrapables.push(child, []);
|
|
100
|
-
wrapablesIndex += 2;
|
|
101
|
-
}
|
|
102
|
-
});
|
|
103
|
-
const items = wrapables.reduce((flatChildren, group, index) => {
|
|
104
|
-
// Skip nullish children and empty arrays
|
|
105
|
-
if (!group || Array.isArray(group) && !group.length) return flatChildren;
|
|
106
|
-
return [...flatChildren, Array.isArray(group) && group.some(child => isStringOrNumber(child)) ?
|
|
107
|
-
/*#__PURE__*/
|
|
108
|
-
// Wrap text nodes and their wrappable neighbours in Text with as stable a key as possible.
|
|
109
|
-
// Avoid one-item arrays because jest-native's `.toHaveTextContent` is buggy
|
|
110
|
-
// and sometimes fails to match text content in arrays.
|
|
111
|
-
_jsx(Text, {
|
|
112
|
-
...textProps,
|
|
113
|
-
children: group.length === 1 ? group[0] : group
|
|
114
|
-
}, combineKeys(group) || index) : group];
|
|
115
|
-
}, []);
|
|
116
|
-
return items.length === 1 ? items[0] : items;
|
|
117
|
-
};
|
package/lib/utils/input.js
DELETED
|
@@ -1,185 +0,0 @@
|
|
|
1
|
-
import { useCallback, useRef, useState } from 'react';
|
|
2
|
-
/**
|
|
3
|
-
* @typedef {import('react').SyntheticEvent} Event
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
const pluralHooks = ['useMultipleInputValues'];
|
|
7
|
-
const validateProps = (_ref, _ref2, hookName) => {
|
|
8
|
-
let {
|
|
9
|
-
value,
|
|
10
|
-
onChange,
|
|
11
|
-
readOnly,
|
|
12
|
-
initialValue
|
|
13
|
-
} = _ref;
|
|
14
|
-
let {
|
|
15
|
-
isCurrentlyControlled,
|
|
16
|
-
isControlled
|
|
17
|
-
} = _ref2;
|
|
18
|
-
const s = pluralHooks.includes(hookName) ? 's' : '';
|
|
19
|
-
const usageError = error => {
|
|
20
|
-
// Errors inside hooks in React Native get incomplete stack traces pointing at parent component only.
|
|
21
|
-
// Help devs out by telling them exactly which hook threw the error as well as why.
|
|
22
|
-
throw new Error(`${hookName} ${error}.
|
|
23
|
-
|
|
24
|
-
Consumers of this hook must be one of:
|
|
25
|
-
1. An "uncontrolled" component responding directly to user actions, with an optional \`initialValue${s}\` but no \`value${s}\` prop,
|
|
26
|
-
2. A "controlled" component where an always-defined \`value${s}\` prop is managed by an \`onChange\` handler, with no \`initialValue${s}\`,
|
|
27
|
-
3. A "read-only" component, with \`readOnly\` prop set as \`true\`.
|
|
28
|
-
`);
|
|
29
|
-
};
|
|
30
|
-
if (value && !onChange && !readOnly) {
|
|
31
|
-
usageError(`has \`value${s}\` prop without \`onChange\` or \`readOnly\``);
|
|
32
|
-
}
|
|
33
|
-
if (initialValue && value) {
|
|
34
|
-
usageError(`has both \`initialValue${s}\` and \`value${s}\``);
|
|
35
|
-
}
|
|
36
|
-
if (isControlled && !isCurrentlyControlled) {
|
|
37
|
-
usageError(`stopped receiving \`value${s}\` from parent after delegating state management`);
|
|
38
|
-
}
|
|
39
|
-
if (!isControlled && isCurrentlyControlled) {
|
|
40
|
-
usageError(`started receiving \`value${s}\` from parent after starting managing own state`);
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* Hook used for controlling the input state of input components that have a singular value.
|
|
46
|
-
* If `value` prop is passed in, this delegates state management to a parent using a passed-in `onChange` prop.
|
|
47
|
-
* If `value` prop is undefined, the hook manages its own state.
|
|
48
|
-
*
|
|
49
|
-
* TODO: when implementing full UDS forms, integrate validation support etc and test alongside common forms
|
|
50
|
-
* management tools such as Formik and React Hooks Form.
|
|
51
|
-
*
|
|
52
|
-
* @param {object} props
|
|
53
|
-
* @param {string|number|null} [props.value] - for a controlled input, the active values as set by a parent
|
|
54
|
-
* @param {string|number} [props.initialValue] - for an uncontrolled input, the default active values
|
|
55
|
-
* @param {function} [props.onChange] - function called when values change (required for controlled inputs)
|
|
56
|
-
* @param {boolean} [props.readOnly] - if true, stops the input values from changing
|
|
57
|
-
*
|
|
58
|
-
* @param {string} hookName - optional, used for tailoring error messages
|
|
59
|
-
*
|
|
60
|
-
* @returns {{
|
|
61
|
-
* currentValue: string|number|null
|
|
62
|
-
* setValue: (newValue: string|number|null|(oldValue: string|number) => string|number, event: Event) => void
|
|
63
|
-
* resetValue: () => void
|
|
64
|
-
* isControlled: bool
|
|
65
|
-
* }}
|
|
66
|
-
*/
|
|
67
|
-
export const useInputValue = function () {
|
|
68
|
-
let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
69
|
-
let hookName = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'useInputValue';
|
|
70
|
-
const isCurrentlyControlled = props.value !== undefined;
|
|
71
|
-
const [isControlled] = useState(isCurrentlyControlled);
|
|
72
|
-
validateProps(props, {
|
|
73
|
-
isControlled,
|
|
74
|
-
isCurrentlyControlled
|
|
75
|
-
}, hookName);
|
|
76
|
-
const {
|
|
77
|
-
value,
|
|
78
|
-
initialValue,
|
|
79
|
-
inputRef,
|
|
80
|
-
onChange,
|
|
81
|
-
readOnly = false
|
|
82
|
-
} = props;
|
|
83
|
-
const [ownValue, setOwnValue] = useState(!isControlled && initialValue);
|
|
84
|
-
const currentValue = isControlled ? value : ownValue;
|
|
85
|
-
|
|
86
|
-
// Store the first valid value, for resetting input to default. If behaviour like Formik's `enableReinitialize`
|
|
87
|
-
// is needed, add useEffect calling a set fn if !deepEqual(initializedValues, initialValues)
|
|
88
|
-
const valueRef = useRef({
|
|
89
|
-
initial: currentValue,
|
|
90
|
-
value: currentValue
|
|
91
|
-
});
|
|
92
|
-
// Make current value accessible inside useCallback without rememoizing every time the value changes
|
|
93
|
-
valueRef.current.value = currentValue;
|
|
94
|
-
const isDirty = currentValue !== valueRef.current.initial;
|
|
95
|
-
const setValue = useCallback((arg, event) => {
|
|
96
|
-
if (readOnly) return;
|
|
97
|
-
const newValue = typeof arg === 'function' ? arg(valueRef.current.value) : arg;
|
|
98
|
-
if (!isControlled) {
|
|
99
|
-
setOwnValue(newValue);
|
|
100
|
-
if (inputRef !== null && inputRef !== void 0 && inputRef.current) inputRef.current.value = newValue ?? '';
|
|
101
|
-
}
|
|
102
|
-
// Call onChange handler if there's something for it to handle (event or a changed value)
|
|
103
|
-
if (onChange && (event || valueRef.current.value !== newValue)) onChange(newValue, event);
|
|
104
|
-
}, [inputRef, isControlled, onChange, readOnly]);
|
|
105
|
-
const resetValue = useCallback(event => setValue(valueRef.current.initial, event), [setValue]);
|
|
106
|
-
return {
|
|
107
|
-
currentValue,
|
|
108
|
-
setValue,
|
|
109
|
-
resetValue,
|
|
110
|
-
isControlled,
|
|
111
|
-
isDirty
|
|
112
|
-
};
|
|
113
|
-
};
|
|
114
|
-
|
|
115
|
-
/**
|
|
116
|
-
* Hook used for controlling the input state of input components that have multiple named on/off states.
|
|
117
|
-
* If `values` are passed in, this delegates state management to a parent using a passed-in `onChange` prop.
|
|
118
|
-
* If `values` prop is not passed in, the hook manages its own state.
|
|
119
|
-
*
|
|
120
|
-
* TODO: when implementing full UDS forms, integrate validation support etc and test alongside common forms
|
|
121
|
-
* management tools such as Formik and React Hooks Form.
|
|
122
|
-
*
|
|
123
|
-
* @param {object} props
|
|
124
|
-
* @param {string[]|number[]} [props.values] - for a controlled input, the active values as set by a parent
|
|
125
|
-
* @param {string[]|number[]} [props.initialValues] - for an uncontrolled input, the default active values
|
|
126
|
-
* @param {number?} [props.maxValues] - maximum number of values that may be selected at once (no limit if null)
|
|
127
|
-
* @param {function} [props.onChange] - function called when values change (required for controlled inputs)
|
|
128
|
-
* @param {boolean} [props.readOnly] - if true, stops the input values from changing
|
|
129
|
-
*
|
|
130
|
-
* @param {string} componentName - optional, used in error messages
|
|
131
|
-
*
|
|
132
|
-
* @returns {{
|
|
133
|
-
* currentValues: any
|
|
134
|
-
* resetValues: () => void
|
|
135
|
-
* setValues: (newValues: string[]|number[]|(oldValues: string[]|number[]) => string[]|number[], event: Event) => void
|
|
136
|
-
* toggleOneValue: (value: string|number) => void
|
|
137
|
-
* unsetValues: () => void
|
|
138
|
-
* }}
|
|
139
|
-
*/
|
|
140
|
-
export const useMultipleInputValues = function () {
|
|
141
|
-
let {
|
|
142
|
-
values,
|
|
143
|
-
initialValues,
|
|
144
|
-
maxValues,
|
|
145
|
-
onChange,
|
|
146
|
-
readOnly
|
|
147
|
-
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
148
|
-
const {
|
|
149
|
-
currentValue,
|
|
150
|
-
setValue,
|
|
151
|
-
resetValue
|
|
152
|
-
} = useInputValue({
|
|
153
|
-
readOnly,
|
|
154
|
-
onChange,
|
|
155
|
-
value: values,
|
|
156
|
-
// if we're controlling our own state, always start with an array
|
|
157
|
-
initialValue: initialValues ?? (values === undefined ? [] : undefined)
|
|
158
|
-
}, 'useMultipleInputValues');
|
|
159
|
-
const enforceMaxValues = useCallback(newValues => {
|
|
160
|
-
if (!maxValues) return newValues;
|
|
161
|
-
const excess = newValues.length - maxValues;
|
|
162
|
-
return excess > 0 ? newValues.slice(excess) : newValues;
|
|
163
|
-
}, [maxValues]);
|
|
164
|
-
const currentValues = enforceMaxValues(currentValue);
|
|
165
|
-
const setValues = useCallback((newValues, event) => {
|
|
166
|
-
const validNewValues = enforceMaxValues(newValues);
|
|
167
|
-
setValue(validNewValues, event);
|
|
168
|
-
}, [setValue, enforceMaxValues]);
|
|
169
|
-
const resetValues = resetValue;
|
|
170
|
-
const unsetValues = useCallback(event => setValues([], event), [setValues]);
|
|
171
|
-
const toggleOneValue = useCallback((newValue, event) => {
|
|
172
|
-
if (readOnly) return;
|
|
173
|
-
// This will only work with primitive values (e.g. strings, numbers), swap for .some() and
|
|
174
|
-
// a deepEqual() function if there's any use case for toggling stored objects or arrays.
|
|
175
|
-
const newValues = currentValues.includes(newValue) ? currentValues.filter(oldValue => oldValue !== newValue) : [...currentValues, newValue];
|
|
176
|
-
setValues(newValues, event);
|
|
177
|
-
}, [currentValues, readOnly, setValues]);
|
|
178
|
-
return {
|
|
179
|
-
currentValues,
|
|
180
|
-
resetValues,
|
|
181
|
-
setValues,
|
|
182
|
-
toggleOneValue,
|
|
183
|
-
unsetValues
|
|
184
|
-
};
|
|
185
|
-
};
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Returns a prop type validator which checks whether a prop is either a component or an array of
|
|
3
|
-
* components of a given type, based on their `name` or `displayName` properties.
|
|
4
|
-
* Use an array of strings for `passedName` to accept more than one component type.
|
|
5
|
-
* For an array the validation fails on the first occurrence of an invalid element.
|
|
6
|
-
*
|
|
7
|
-
* @param {string|string[]} passedName
|
|
8
|
-
* @return {function}
|
|
9
|
-
*/
|
|
10
|
-
export default function componentPropType(passedName) {
|
|
11
|
-
const passedNames = typeof passedName === 'string' ? [passedName] : passedName;
|
|
12
|
-
const checkProp = (props, propName, componentName) => {
|
|
13
|
-
var _props$propName$type, _props$propName$type2;
|
|
14
|
-
if (props[propName] === undefined || props[propName] === null) {
|
|
15
|
-
return undefined;
|
|
16
|
-
}
|
|
17
|
-
if (Array.isArray(props[propName])) {
|
|
18
|
-
// Iterates through every child and try to find the first element that does not match the passed name
|
|
19
|
-
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean
|
|
20
|
-
return props[propName].map((_, index) => checkProp(props[propName], index, componentName)).find(Boolean);
|
|
21
|
-
}
|
|
22
|
-
const nameInProp = ((_props$propName$type = props[propName].type) === null || _props$propName$type === void 0 ? void 0 : _props$propName$type.displayName) || ((_props$propName$type2 = props[propName].type) === null || _props$propName$type2 === void 0 ? void 0 : _props$propName$type2.name);
|
|
23
|
-
if (!nameInProp || !passedNames.includes(nameInProp)) {
|
|
24
|
-
const propDescription = nameInProp ? `Component ${nameInProp}` : typeof props[propName];
|
|
25
|
-
return new Error(`${componentName}: ${propDescription} was passed to \`${propName}\` prop; should be ${passedNames.join(' or ')}`);
|
|
26
|
-
}
|
|
27
|
-
return undefined;
|
|
28
|
-
};
|
|
29
|
-
const checkRequired = (props, propName, componentName) => {
|
|
30
|
-
if (props[propName] === undefined) {
|
|
31
|
-
return new Error(`The prop \`${propName}\` is marked as required in \`${componentName}\`, but its value is ${props[propName]}.`);
|
|
32
|
-
}
|
|
33
|
-
return undefined;
|
|
34
|
-
};
|
|
35
|
-
const createValidate = isRequired => {
|
|
36
|
-
if (isRequired) {
|
|
37
|
-
return (props, propName, componentName) => {
|
|
38
|
-
const checkForError = checkProp(props, propName, componentName);
|
|
39
|
-
if (checkForError) {
|
|
40
|
-
return checkForError;
|
|
41
|
-
}
|
|
42
|
-
return checkRequired(props, propName, componentName);
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
return checkProp;
|
|
46
|
-
};
|
|
47
|
-
const validate = createValidate();
|
|
48
|
-
validate.isRequired = createValidate(true);
|
|
49
|
-
return validate;
|
|
50
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
// Returns a selector for requested prop kinds as well as the propTypes for
|
|
2
|
-
// those props merged into one object
|
|
3
|
-
export default function selectSystemProps(systemPropHelpers) {
|
|
4
|
-
const selectProps = props => systemPropHelpers.reduce((acc, propHelper) => {
|
|
5
|
-
if (typeof (propHelper === null || propHelper === void 0 ? void 0 : propHelper.select) !== 'function') {
|
|
6
|
-
throw new Error(`An invalid system prop helper has been passed to 'selectSystemProps': prop selector ('.select') is missing in ${propHelper}`);
|
|
7
|
-
}
|
|
8
|
-
return {
|
|
9
|
-
...acc,
|
|
10
|
-
...propHelper.select(props)
|
|
11
|
-
};
|
|
12
|
-
}, {});
|
|
13
|
-
const selectedPropTypes = systemPropHelpers.reduce((acc, propHelper) => {
|
|
14
|
-
if (!(propHelper !== null && propHelper !== void 0 && propHelper.types)) {
|
|
15
|
-
throw new Error(`An invalid system prop helper has been passed to 'selectSystemProps': types selector ('.types') is missing in ${propHelper}`);
|
|
16
|
-
}
|
|
17
|
-
return {
|
|
18
|
-
...acc,
|
|
19
|
-
...propHelper.types
|
|
20
|
-
};
|
|
21
|
-
}, {});
|
|
22
|
-
return [selectProps, selectedPropTypes];
|
|
23
|
-
}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import mediaQuery from 'css-mediaquery';
|
|
2
|
-
import Dimensions from "react-native-web/dist/exports/Dimensions";
|
|
3
|
-
import { isMediaOrPseudo, isMedia } from '../utils/common';
|
|
4
|
-
const createStyleSheet = stylesWithQuery => {
|
|
5
|
-
if (!stylesWithQuery) return {
|
|
6
|
-
ids: {},
|
|
7
|
-
styles: {},
|
|
8
|
-
fullStyles: {}
|
|
9
|
-
};
|
|
10
|
-
let cleanStyles;
|
|
11
|
-
const ids = {};
|
|
12
|
-
Object.keys(stylesWithQuery).forEach(key => {
|
|
13
|
-
if (!(stylesWithQuery !== null && stylesWithQuery !== void 0 && stylesWithQuery[key])) return;
|
|
14
|
-
const mediaQueriesAndPseudoClasses = Object.keys(stylesWithQuery[key]).filter(isMediaOrPseudo);
|
|
15
|
-
cleanStyles = JSON.parse(JSON.stringify(stylesWithQuery));
|
|
16
|
-
mediaQueriesAndPseudoClasses.forEach(str => {
|
|
17
|
-
if (isMedia(str)) {
|
|
18
|
-
const mqStr = str.replace('@media', '');
|
|
19
|
-
const {
|
|
20
|
-
width,
|
|
21
|
-
height
|
|
22
|
-
} = Dimensions.get('window');
|
|
23
|
-
const isMatchingMediaQuery = mediaQuery.match(mqStr, {
|
|
24
|
-
width,
|
|
25
|
-
height,
|
|
26
|
-
orientation: width > height ? 'landscape' : 'portrait',
|
|
27
|
-
'aspect-ratio': width / height
|
|
28
|
-
});
|
|
29
|
-
if (isMatchingMediaQuery) {
|
|
30
|
-
cleanStyles = {
|
|
31
|
-
...cleanStyles,
|
|
32
|
-
[key]: {
|
|
33
|
-
...cleanStyles[key],
|
|
34
|
-
...stylesWithQuery[key][str]
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
delete cleanStyles[key][str];
|
|
40
|
-
});
|
|
41
|
-
});
|
|
42
|
-
return {
|
|
43
|
-
ids,
|
|
44
|
-
styles: cleanStyles,
|
|
45
|
-
fullStyles: stylesWithQuery
|
|
46
|
-
};
|
|
47
|
-
};
|
|
48
|
-
export default createStyleSheet;
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { addCss } from '../utils/inject';
|
|
2
|
-
import createDeclarationBlock from '../utils/create-declaration-block';
|
|
3
|
-
import hash from '../hash';
|
|
4
|
-
import { isMediaOrPseudo, deepClone, createCssRule, sanitizeStyle } from '../utils/common';
|
|
5
|
-
const createStyleSheet = stylesWithQuery => {
|
|
6
|
-
if (!stylesWithQuery) return {
|
|
7
|
-
ids: {},
|
|
8
|
-
styles: {},
|
|
9
|
-
fullStyles: {}
|
|
10
|
-
};
|
|
11
|
-
let ids = {};
|
|
12
|
-
const cleanStyles = deepClone(stylesWithQuery);
|
|
13
|
-
Object.keys(stylesWithQuery).forEach(key => {
|
|
14
|
-
if (!(stylesWithQuery !== null && stylesWithQuery !== void 0 && stylesWithQuery[key])) return;
|
|
15
|
-
const mediaQueriesAndPseudoClasses = Object.keys(stylesWithQuery[key]).filter(isMediaOrPseudo);
|
|
16
|
-
mediaQueriesAndPseudoClasses.forEach(query => {
|
|
17
|
-
var _ids;
|
|
18
|
-
const sanitizedStyle = sanitizeStyle(stylesWithQuery[key][query]);
|
|
19
|
-
const css = createDeclarationBlock(sanitizedStyle);
|
|
20
|
-
const stringHash = `rnmq-${hash(`${key}${query}${css}`)}`;
|
|
21
|
-
const rule = createCssRule(query, stringHash, css);
|
|
22
|
-
addCss(`${stringHash}`, rule);
|
|
23
|
-
delete cleanStyles[key][query];
|
|
24
|
-
ids = {
|
|
25
|
-
...ids,
|
|
26
|
-
[key]: `${(_ids = ids) !== null && _ids !== void 0 && _ids[key] ? `${ids[key]} ` : ''}${stringHash}`
|
|
27
|
-
};
|
|
28
|
-
});
|
|
29
|
-
});
|
|
30
|
-
return {
|
|
31
|
-
ids,
|
|
32
|
-
styles: cleanStyles,
|
|
33
|
-
fullStyles: stylesWithQuery
|
|
34
|
-
};
|
|
35
|
-
};
|
|
36
|
-
export default createStyleSheet;
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import Platform from "react-native-web/dist/exports/Platform";
|
|
3
|
-
const rules = {};
|
|
4
|
-
let styleSheet;
|
|
5
|
-
if (typeof window !== 'undefined' && typeof document !== 'undefined') {
|
|
6
|
-
styleSheet = (() => {
|
|
7
|
-
const style = document.createElement('style');
|
|
8
|
-
style.id = 'RNMQCSS';
|
|
9
|
-
style.appendChild(document.createTextNode(''));
|
|
10
|
-
document.head.appendChild(style);
|
|
11
|
-
return style.sheet;
|
|
12
|
-
})();
|
|
13
|
-
}
|
|
14
|
-
export const hasCss = (id, text) => {
|
|
15
|
-
var _rules$id$text, _rules$id$text$includ;
|
|
16
|
-
return !!rules[id] && !!((_rules$id$text = rules[id].text) !== null && _rules$id$text !== void 0 && (_rules$id$text$includ = _rules$id$text.includes) !== null && _rules$id$text$includ !== void 0 && _rules$id$text$includ.call(_rules$id$text, text));
|
|
17
|
-
};
|
|
18
|
-
export const addCss = (id, text) => {
|
|
19
|
-
if (!hasCss(id, text)) {
|
|
20
|
-
var _rules$id;
|
|
21
|
-
rules[id] = (rules === null || rules === void 0 ? void 0 : rules[id]) || {};
|
|
22
|
-
rules[id].text = (((_rules$id = rules[id]) === null || _rules$id === void 0 ? void 0 : _rules$id.text) || '') + text;
|
|
23
|
-
if (styleSheet) {
|
|
24
|
-
styleSheet.insertRule(text, Object.keys(rules).length - 1);
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
export const flush = () => {
|
|
29
|
-
if (Platform.OS === 'web') {
|
|
30
|
-
return /*#__PURE__*/React.createElement('style', {
|
|
31
|
-
id: 'rnmq',
|
|
32
|
-
key: 'rnmq',
|
|
33
|
-
dangerouslySetInnerHTML: {
|
|
34
|
-
__html: Object.keys(rules).map(key => rules[key].text).join('\n')
|
|
35
|
-
}
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
return {};
|
|
39
|
-
};
|
package/lib/utils/useHash.js
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { useEffect, useState } from 'react';
|
|
2
|
-
const doAction = (action, event) => {
|
|
3
|
-
var _window;
|
|
4
|
-
return typeof action === 'function' && action((_window = window) === null || _window === void 0 || (_window = _window.location) === null || _window === void 0 ? void 0 : _window.hash, event);
|
|
5
|
-
};
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* @typedef {import('react').SyntheticEvent} SyntheticEvent
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Calls a function (passing it the current hash) based on the current hash state on mount,
|
|
13
|
-
* and binds it to call it again any time the hash changes.
|
|
14
|
-
*
|
|
15
|
-
* Consider using `useCallback` on the function to minimise adding and removing of event listeners.
|
|
16
|
-
*
|
|
17
|
-
* On Native, this is replaced with a harmless no-op function as there is no direct equivalent.
|
|
18
|
-
*
|
|
19
|
-
* @param {(hash: string, event?: SyntheticEvent) => void} action - a function to act on the current hash on load and when it changes
|
|
20
|
-
* @returns
|
|
21
|
-
*/
|
|
22
|
-
const useHash = function (action) {
|
|
23
|
-
let isReady = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
24
|
-
const [isDone, setIsDone] = useState(false);
|
|
25
|
-
// Do the action just once when ready after component mount, from hash on page load
|
|
26
|
-
const isToDo = isReady && !isDone;
|
|
27
|
-
useEffect(() => {
|
|
28
|
-
if (isToDo) {
|
|
29
|
-
setIsDone(true);
|
|
30
|
-
doAction(action);
|
|
31
|
-
}
|
|
32
|
-
}, [isToDo, action]);
|
|
33
|
-
|
|
34
|
-
// Bind the action for each hash change; do re-bind if the function changes.
|
|
35
|
-
useEffect(() => {
|
|
36
|
-
const handleChange = event => doAction(action, event);
|
|
37
|
-
window.addEventListener('hashchange', handleChange);
|
|
38
|
-
return () => window.removeEventListener('hashchange', handleChange);
|
|
39
|
-
}, [action]);
|
|
40
|
-
};
|
|
41
|
-
export default useHash;
|