@telus-uds/components-base 1.65.0 → 1.67.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 +22 -2
- package/lib/A11yInfoProvider/index.js +5 -20
- package/lib/A11yText/index.js +3 -17
- package/lib/ActivityIndicator/Spinner.js +2 -9
- package/lib/ActivityIndicator/Spinner.native.js +4 -27
- package/lib/ActivityIndicator/index.js +1 -13
- package/lib/ActivityIndicator/shared.js +0 -3
- package/lib/Autocomplete/Autocomplete.js +34 -85
- package/lib/Autocomplete/Loading.js +0 -10
- package/lib/Autocomplete/Suggestions.js +0 -11
- package/lib/Autocomplete/index.js +0 -3
- package/lib/BaseProvider/HydrationContext.js +4 -18
- package/lib/BaseProvider/index.js +0 -12
- package/lib/Box/Box.js +10 -35
- package/lib/Box/index.js +0 -3
- package/lib/Button/Button.js +4 -13
- package/lib/Button/ButtonBase.js +23 -55
- package/lib/Button/ButtonDropdown.js +7 -32
- package/lib/Button/ButtonGroup.js +15 -48
- package/lib/Button/ButtonLink.js +3 -17
- package/lib/Button/index.js +0 -5
- package/lib/Button/propTypes.js +0 -15
- package/lib/Card/Card.js +3 -14
- package/lib/Card/CardBase.js +5 -16
- package/lib/Card/PressableCardBase.js +7 -30
- package/lib/Card/index.js +0 -7
- package/lib/Carousel/Carousel.js +22 -115
- package/lib/Carousel/CarouselContext.js +0 -14
- package/lib/Carousel/CarouselFirstFocus/CarouselFirstFocus.js +6 -18
- package/lib/Carousel/CarouselItem/CarouselItem.js +5 -20
- package/lib/Carousel/CarouselItem/index.js +0 -3
- package/lib/Carousel/CarouselStepTracker/CarouselStepTracker.js +0 -9
- package/lib/Carousel/CarouselStepTracker/index.js +0 -3
- package/lib/Carousel/CarouselTabs/CarouselTabs.js +5 -15
- package/lib/Carousel/CarouselTabs/CarouselTabsPanel.js +7 -16
- package/lib/Carousel/CarouselTabs/CarouselTabsPanelItem.js +2 -22
- package/lib/Carousel/CarouselTabs/index.js +0 -3
- package/lib/Carousel/CarouselThumbnail.js +1 -16
- package/lib/Carousel/CarouselThumbnailNavigation.js +0 -15
- package/lib/Carousel/index.js +0 -5
- package/lib/Checkbox/Checkbox.js +5 -44
- package/lib/Checkbox/CheckboxButton.js +7 -33
- package/lib/Checkbox/CheckboxGroup.js +5 -37
- package/lib/Checkbox/CheckboxInput.js +1 -11
- package/lib/Checkbox/CheckboxInput.native.js +0 -2
- package/lib/Checkbox/index.js +0 -4
- package/lib/CheckboxCard/CheckboxCard.js +4 -37
- package/lib/CheckboxCard/index.js +0 -3
- package/lib/CheckboxCardGroup/CheckboxCardGroup.js +215 -0
- package/lib/CheckboxCardGroup/index.js +10 -0
- package/lib/Divider/Divider.js +13 -24
- package/lib/Divider/index.js +0 -3
- package/lib/ExpandCollapse/Accordion.js +1 -9
- package/lib/ExpandCollapse/Control.js +10 -32
- package/lib/ExpandCollapse/ExpandCollapse.js +3 -19
- package/lib/ExpandCollapse/Panel.js +13 -38
- package/lib/ExpandCollapse/index.js +0 -5
- package/lib/Feedback/Feedback.js +13 -30
- package/lib/Feedback/index.js +0 -3
- package/lib/Fieldset/Fieldset.js +6 -37
- package/lib/Fieldset/FieldsetContainer.js +1 -10
- package/lib/Fieldset/FieldsetContainer.native.js +0 -8
- package/lib/Fieldset/Legend.js +1 -10
- package/lib/Fieldset/Legend.native.js +1 -13
- package/lib/Fieldset/index.js +0 -3
- package/lib/FlexGrid/Col/Col.js +10 -53
- package/lib/FlexGrid/Col/index.js +0 -3
- package/lib/FlexGrid/FlexGrid.js +3 -34
- package/lib/FlexGrid/Row/Row.js +0 -38
- package/lib/FlexGrid/Row/index.js +0 -3
- package/lib/FlexGrid/helpers/index.js +0 -4
- package/lib/FlexGrid/index.js +0 -3
- package/lib/FlexGrid/providers/GutterContext.js +0 -4
- package/lib/HorizontalScroll/HorizontalScroll.js +17 -45
- package/lib/HorizontalScroll/HorizontalScrollButton.js +1 -17
- package/lib/HorizontalScroll/ScrollViewEnd.js +5 -13
- package/lib/HorizontalScroll/ScrollViewEnd.native.js +1 -10
- package/lib/HorizontalScroll/index.js +0 -7
- package/lib/HorizontalScroll/itemPositions.js +8 -19
- package/lib/Icon/Icon.js +4 -17
- package/lib/Icon/IconText.js +5 -25
- package/lib/Icon/index.js +0 -6
- package/lib/IconButton/IconButton.js +5 -37
- package/lib/IconButton/index.js +0 -3
- package/lib/InputLabel/InputLabel.js +4 -28
- package/lib/InputLabel/LabelContent.js +2 -8
- package/lib/InputLabel/LabelContent.native.js +0 -8
- package/lib/InputLabel/index.js +0 -3
- package/lib/InputSupports/InputSupports.js +0 -21
- package/lib/InputSupports/index.js +0 -3
- package/lib/InputSupports/useInputSupports.js +2 -6
- package/lib/Link/ChevronLink.js +7 -18
- package/lib/Link/InlinePressable.js +0 -10
- package/lib/Link/InlinePressable.native.js +5 -18
- package/lib/Link/Link.js +0 -8
- package/lib/Link/LinkBase.js +17 -47
- package/lib/Link/TextButton.js +3 -16
- package/lib/Link/index.js +0 -5
- package/lib/List/List.js +5 -21
- package/lib/List/ListItem.js +1 -11
- package/lib/List/ListItemBase.js +5 -34
- package/lib/List/ListItemContent.js +1 -14
- package/lib/List/ListItemMark.js +3 -23
- package/lib/List/PressableListItemBase.js +2 -28
- package/lib/List/index.js +0 -4
- package/lib/Listbox/GroupControl.js +0 -14
- package/lib/Listbox/Listbox.js +15 -40
- package/lib/Listbox/ListboxContext.js +0 -7
- package/lib/Listbox/ListboxGroup.js +7 -19
- package/lib/Listbox/ListboxItem.js +3 -17
- package/lib/Listbox/ListboxOverlay.js +4 -20
- package/lib/Listbox/PressableItem.js +3 -18
- package/lib/Listbox/index.js +0 -3
- package/lib/Modal/Modal.js +94 -45
- package/lib/Modal/ModalContent.js +184 -0
- package/lib/Modal/index.js +0 -3
- package/lib/MultiSelectFilter/ModalOverlay.js +1 -20
- package/lib/MultiSelectFilter/MultiSelectFilter.js +20 -69
- package/lib/MultiSelectFilter/index.js +0 -3
- package/lib/Notification/Notification.js +11 -38
- package/lib/Notification/index.js +0 -3
- package/lib/Pagination/PageButton.js +2 -22
- package/lib/Pagination/Pagination.js +21 -42
- package/lib/Pagination/SideButton.js +0 -24
- package/lib/Pagination/index.js +0 -3
- package/lib/Pagination/usePagination.js +4 -9
- package/lib/Progress/Progress.js +3 -17
- package/lib/Progress/ProgressBar.js +3 -25
- package/lib/Progress/ProgressBarBackground.js +0 -12
- package/lib/Progress/index.js +0 -4
- package/lib/QuickLinks/QuickLinks.js +1 -18
- package/lib/QuickLinks/QuickLinksCard.js +1 -11
- package/lib/QuickLinks/QuickLinksItem.js +3 -17
- package/lib/QuickLinks/index.js +0 -4
- package/lib/QuickLinksFeature/QuickLinksFeature.js +3 -20
- package/lib/QuickLinksFeature/QuickLinksFeatureItem.js +7 -30
- package/lib/QuickLinksFeature/index.js +0 -4
- package/lib/Radio/Radio.js +5 -39
- package/lib/Radio/RadioButton.js +7 -26
- package/lib/Radio/RadioGroup.js +6 -39
- package/lib/Radio/RadioInput.js +1 -11
- package/lib/Radio/RadioInput.native.js +0 -2
- package/lib/Radio/index.js +0 -4
- package/lib/RadioCard/RadioCard.js +5 -38
- package/lib/RadioCard/RadioCardGroup.js +7 -38
- package/lib/RadioCard/index.js +0 -4
- package/lib/Responsive/Responsive.js +1 -14
- package/lib/Responsive/index.js +0 -3
- package/lib/Search/Search.js +22 -45
- package/lib/Search/index.js +0 -3
- package/lib/Select/Group.js +0 -8
- package/lib/Select/Group.native.js +0 -6
- package/lib/Select/Item.js +0 -7
- package/lib/Select/Item.native.js +0 -2
- package/lib/Select/Picker.js +0 -8
- package/lib/Select/Picker.native.js +6 -22
- package/lib/Select/Select.js +9 -52
- package/lib/Select/index.js +0 -5
- package/lib/SideNav/Item.js +5 -29
- package/lib/SideNav/ItemContent.js +1 -14
- package/lib/SideNav/ItemsGroup.js +9 -31
- package/lib/SideNav/SideNav.js +9 -33
- package/lib/SideNav/index.js +0 -2
- package/lib/Skeleton/Skeleton.js +10 -42
- package/lib/Skeleton/index.js +0 -3
- package/lib/Skeleton/skeletonWebAnimation.js +0 -2
- package/lib/Skeleton/useSkeletonNativeAnimation.js +1 -9
- package/lib/SkipLink/SkipLink.js +7 -27
- package/lib/SkipLink/index.js +0 -3
- package/lib/Spacer/Spacer.js +4 -20
- package/lib/Spacer/index.js +0 -3
- package/lib/StackView/StackView.js +3 -21
- package/lib/StackView/StackWrap.js +11 -21
- package/lib/StackView/StackWrap.native.js +0 -3
- package/lib/StackView/StackWrapBox.js +5 -21
- package/lib/StackView/StackWrapGap.js +1 -14
- package/lib/StackView/common.js +0 -6
- package/lib/StackView/getStackedContent.js +10 -21
- package/lib/StackView/index.js +0 -5
- package/lib/StepTracker/Step.js +3 -27
- package/lib/StepTracker/StepTracker.js +5 -32
- package/lib/StepTracker/index.js +0 -3
- package/lib/Tabs/Tabs.js +7 -30
- package/lib/Tabs/TabsItem.js +13 -38
- package/lib/Tabs/index.js +0 -3
- package/lib/Tags/Tags.js +9 -42
- package/lib/Tags/index.js +0 -3
- package/lib/TextInput/TextArea.js +11 -20
- package/lib/TextInput/TextInput.js +7 -16
- package/lib/TextInput/TextInputBase.js +106 -69
- package/lib/TextInput/index.js +0 -3
- package/lib/TextInput/propTypes.js +4 -7
- package/lib/ThemeProvider/ThemeProvider.js +10 -18
- package/lib/ThemeProvider/index.js +0 -9
- package/lib/ThemeProvider/useSetTheme.js +6 -9
- package/lib/ThemeProvider/useTheme.js +2 -7
- package/lib/ThemeProvider/useThemeTokens.js +1 -9
- package/lib/ThemeProvider/utils/index.js +0 -4
- package/lib/ThemeProvider/utils/styles.js +14 -35
- package/lib/ThemeProvider/utils/theme-tokens.js +15 -43
- package/lib/Timeline/Timeline.js +11 -27
- package/lib/Timeline/index.js +0 -3
- package/lib/ToggleSwitch/ToggleSwitch.js +12 -43
- package/lib/ToggleSwitch/ToggleSwitchGroup.js +4 -38
- package/lib/ToggleSwitch/index.js +0 -3
- package/lib/Tooltip/Backdrop.js +4 -11
- package/lib/Tooltip/Backdrop.native.js +1 -14
- package/lib/Tooltip/Tooltip.js +9 -37
- package/lib/Tooltip/Tooltip.native.js +14 -45
- package/lib/Tooltip/getTooltipPosition.js +26 -31
- package/lib/Tooltip/index.js +0 -5
- package/lib/Tooltip/shared.js +0 -10
- package/lib/TooltipButton/TooltipButton.js +5 -20
- package/lib/TooltipButton/index.js +0 -3
- package/lib/Typography/Typography.js +15 -38
- package/lib/Typography/index.js +0 -3
- package/lib/Validator/Validator.js +10 -58
- package/lib/Validator/index.js +0 -3
- package/lib/ViewportProvider/ViewportProvider.js +1 -13
- package/lib/ViewportProvider/index.js +0 -5
- package/lib/ViewportProvider/useViewport.js +0 -4
- package/lib/ViewportProvider/useViewportListener.js +3 -12
- package/lib/index.js +8 -71
- package/lib/utils/BaseView/BaseView.js +3 -17
- package/lib/utils/BaseView/BaseView.native.js +0 -3
- package/lib/utils/BaseView/index.js +0 -3
- package/lib/utils/a11y/index.js +0 -4
- package/lib/utils/a11y/semantics.js +14 -32
- package/lib/utils/a11y/textSize.js +1 -8
- package/lib/utils/animation/index.js +0 -2
- package/lib/utils/animation/useVerticalExpandAnimation.js +5 -18
- package/lib/utils/children.js +16 -28
- package/lib/utils/containUniqueFields.js +2 -5
- package/lib/utils/floating-ui/index.js +0 -1
- package/lib/utils/floating-ui/index.native.js +0 -1
- package/lib/utils/hasOwnProperty.js +0 -1
- package/lib/utils/htmlAttrs.js +2 -4
- package/lib/utils/index.js +0 -31
- package/lib/utils/info/index.js +0 -4
- package/lib/utils/info/platform/index.js +0 -4
- package/lib/utils/info/versions.js +0 -3
- package/lib/utils/input.js +12 -24
- package/lib/utils/pressability.js +7 -21
- package/lib/utils/props/a11yProps.js +19 -25
- package/lib/utils/props/clickProps.js +0 -4
- package/lib/utils/props/componentPropType.js +0 -14
- package/lib/utils/props/copyPropTypes.js +0 -4
- package/lib/utils/props/getPropSelector.js +11 -12
- package/lib/utils/props/handlerProps.js +2 -23
- package/lib/utils/props/hrefAttrsProp.js +0 -4
- package/lib/utils/props/index.js +0 -22
- package/lib/utils/props/inputSupportsProps.js +0 -9
- package/lib/utils/props/linkProps.js +2 -12
- package/lib/utils/props/paddingProp.js +0 -3
- package/lib/utils/props/pressProps.js +2 -8
- package/lib/utils/props/rectProp.js +0 -3
- package/lib/utils/props/responsiveProps.js +1 -5
- package/lib/utils/props/selectSystemProps.js +4 -6
- package/lib/utils/props/spacingProps.js +3 -10
- package/lib/utils/props/textInputProps.js +11 -31
- package/lib/utils/props/textProps.js +6 -11
- package/lib/utils/props/tokens.js +7 -26
- package/lib/utils/props/variantProp.js +0 -3
- package/lib/utils/props/viewProps.js +0 -5
- package/lib/utils/ssr.js +13 -33
- package/lib/utils/useCopy.js +3 -6
- package/lib/utils/useHash.js +5 -10
- package/lib/utils/useHash.native.js +0 -2
- package/lib/utils/useOverlaidPosition.js +6 -29
- package/lib/utils/useResponsiveProp.js +6 -13
- package/lib/utils/useSafeLayoutEffect.js +5 -10
- package/lib/utils/useScrollBlocking.js +3 -11
- package/lib/utils/useScrollBlocking.native.js +0 -2
- package/lib/utils/useSpacingScale.js +5 -8
- package/lib/utils/useUniqueId.js +0 -4
- package/lib/utils/withLinkRouter.js +13 -18
- package/lib-module/A11yInfoProvider/index.js +5 -9
- package/lib-module/A11yText/index.js +3 -4
- package/lib-module/ActivityIndicator/Spinner.js +2 -2
- package/lib-module/ActivityIndicator/Spinner.native.js +4 -6
- package/lib-module/ActivityIndicator/index.js +1 -5
- package/lib-module/ActivityIndicator/shared.js +2 -1
- package/lib-module/Autocomplete/Autocomplete.js +34 -59
- package/lib-module/Autocomplete/Loading.js +0 -2
- package/lib-module/BaseProvider/HydrationContext.js +4 -7
- package/lib-module/BaseProvider/index.js +0 -3
- package/lib-module/Box/Box.js +10 -24
- package/lib-module/Button/Button.js +4 -2
- package/lib-module/Button/ButtonBase.js +23 -35
- package/lib-module/Button/ButtonDropdown.js +7 -16
- package/lib-module/Button/ButtonGroup.js +15 -32
- package/lib-module/Button/ButtonLink.js +3 -2
- package/lib-module/Button/propTypes.js +0 -7
- package/lib-module/Card/Card.js +3 -2
- package/lib-module/Card/CardBase.js +5 -4
- package/lib-module/Card/PressableCardBase.js +7 -11
- package/lib-module/Carousel/Carousel.js +22 -60
- package/lib-module/Carousel/CarouselContext.js +0 -5
- package/lib-module/Carousel/CarouselFirstFocus/CarouselFirstFocus.js +7 -5
- package/lib-module/Carousel/CarouselItem/CarouselItem.js +5 -11
- package/lib-module/Carousel/CarouselStepTracker/CarouselStepTracker.js +0 -2
- package/lib-module/Carousel/CarouselTabs/CarouselTabs.js +3 -4
- package/lib-module/Carousel/CarouselTabs/CarouselTabsPanel.js +7 -6
- package/lib-module/Carousel/CarouselTabs/CarouselTabsPanelItem.js +2 -10
- package/lib-module/Carousel/CarouselThumbnail.js +1 -7
- package/lib-module/Carousel/CarouselThumbnailNavigation.js +0 -2
- package/lib-module/Checkbox/Checkbox.js +5 -23
- package/lib-module/Checkbox/CheckboxButton.js +7 -17
- package/lib-module/Checkbox/CheckboxGroup.js +5 -23
- package/lib-module/Checkbox/CheckboxInput.js +1 -3
- package/lib-module/Checkbox/CheckboxInput.native.js +0 -1
- package/lib-module/CheckboxCard/CheckboxCard.js +4 -21
- package/lib-module/CheckboxCardGroup/CheckboxCardGroup.js +205 -0
- package/lib-module/CheckboxCardGroup/index.js +2 -0
- package/lib-module/Divider/Divider.js +13 -11
- package/lib-module/ExpandCollapse/Accordion.js +1 -1
- package/lib-module/ExpandCollapse/Control.js +10 -17
- package/lib-module/ExpandCollapse/ExpandCollapse.js +3 -9
- package/lib-module/ExpandCollapse/Panel.js +13 -23
- package/lib-module/Feedback/Feedback.js +13 -16
- package/lib-module/Fieldset/Fieldset.js +6 -25
- package/lib-module/Fieldset/FieldsetContainer.js +1 -1
- package/lib-module/Fieldset/FieldsetContainer.native.js +0 -1
- package/lib-module/Fieldset/Legend.js +1 -1
- package/lib-module/Fieldset/Legend.native.js +1 -1
- package/lib-module/FlexGrid/Col/Col.js +10 -37
- package/lib-module/FlexGrid/FlexGrid.js +3 -17
- package/lib-module/FlexGrid/Row/Row.js +0 -25
- package/lib-module/FlexGrid/helpers/index.js +0 -3
- package/lib-module/HorizontalScroll/HorizontalScroll.js +17 -27
- package/lib-module/HorizontalScroll/HorizontalScrollButton.js +1 -3
- package/lib-module/HorizontalScroll/ScrollViewEnd.js +5 -4
- package/lib-module/HorizontalScroll/ScrollViewEnd.native.js +0 -1
- package/lib-module/HorizontalScroll/itemPositions.js +11 -10
- package/lib-module/Icon/Icon.js +4 -8
- package/lib-module/Icon/IconText.js +6 -17
- package/lib-module/IconButton/IconButton.js +7 -20
- package/lib-module/InputLabel/InputLabel.js +4 -13
- package/lib-module/InputLabel/LabelContent.js +2 -1
- package/lib-module/InputLabel/LabelContent.native.js +0 -1
- package/lib-module/InputSupports/InputSupports.js +0 -9
- package/lib-module/InputSupports/useInputSupports.js +2 -4
- package/lib-module/Link/ChevronLink.js +7 -7
- package/lib-module/Link/InlinePressable.js +0 -2
- package/lib-module/Link/InlinePressable.native.js +4 -12
- package/lib-module/Link/LinkBase.js +17 -25
- package/lib-module/Link/TextButton.js +3 -5
- package/lib-module/List/List.js +5 -9
- package/lib-module/List/ListItem.js +1 -1
- package/lib-module/List/ListItemBase.js +5 -17
- package/lib-module/List/ListItemContent.js +1 -4
- package/lib-module/List/ListItemMark.js +3 -16
- package/lib-module/List/PressableListItemBase.js +2 -6
- package/lib-module/Listbox/GroupControl.js +0 -2
- package/lib-module/Listbox/Listbox.js +15 -23
- package/lib-module/Listbox/ListboxContext.js +0 -2
- package/lib-module/Listbox/ListboxGroup.js +6 -4
- package/lib-module/Listbox/ListboxItem.js +2 -1
- package/lib-module/Listbox/ListboxOverlay.js +3 -4
- package/lib-module/Listbox/PressableItem.js +2 -7
- package/lib-module/Modal/Modal.js +94 -25
- package/lib-module/Modal/ModalContent.js +175 -0
- package/lib-module/MultiSelectFilter/ModalOverlay.js +1 -4
- package/lib-module/MultiSelectFilter/MultiSelectFilter.js +20 -42
- package/lib-module/Notification/Notification.js +11 -22
- package/lib-module/Pagination/PageButton.js +2 -6
- package/lib-module/Pagination/Pagination.js +21 -21
- package/lib-module/Pagination/SideButton.js +3 -8
- package/lib-module/Pagination/usePagination.js +4 -8
- package/lib-module/Progress/Progress.js +3 -7
- package/lib-module/Progress/ProgressBar.js +3 -11
- package/lib-module/Progress/ProgressBarBackground.js +0 -2
- package/lib-module/QuickLinks/QuickLinks.js +1 -6
- package/lib-module/QuickLinks/QuickLinksCard.js +1 -3
- package/lib-module/QuickLinks/QuickLinksItem.js +3 -2
- package/lib-module/QuickLinksFeature/QuickLinksFeature.js +5 -9
- package/lib-module/QuickLinksFeature/QuickLinksFeatureItem.js +9 -13
- package/lib-module/Radio/Radio.js +5 -22
- package/lib-module/Radio/RadioButton.js +8 -10
- package/lib-module/Radio/RadioGroup.js +6 -25
- package/lib-module/Radio/RadioInput.js +1 -3
- package/lib-module/Radio/RadioInput.native.js +0 -1
- package/lib-module/RadioCard/RadioCard.js +5 -21
- package/lib-module/RadioCard/RadioCardGroup.js +7 -25
- package/lib-module/Responsive/Responsive.js +1 -6
- package/lib-module/Search/Search.js +22 -31
- package/lib-module/Select/Group.js +0 -3
- package/lib-module/Select/Group.native.js +0 -3
- package/lib-module/Select/Item.js +0 -3
- package/lib-module/Select/Item.native.js +0 -1
- package/lib-module/Select/Picker.native.js +8 -10
- package/lib-module/Select/Select.js +10 -35
- package/lib-module/SideNav/Item.js +5 -16
- package/lib-module/SideNav/ItemContent.js +1 -2
- package/lib-module/SideNav/ItemsGroup.js +9 -19
- package/lib-module/SideNav/SideNav.js +9 -22
- package/lib-module/Skeleton/Skeleton.js +10 -25
- package/lib-module/Skeleton/skeletonWebAnimation.js +0 -1
- package/lib-module/Skeleton/useSkeletonNativeAnimation.js +1 -3
- package/lib-module/SkipLink/SkipLink.js +7 -9
- package/lib-module/Spacer/Spacer.js +4 -7
- package/lib-module/StackView/StackView.js +3 -7
- package/lib-module/StackView/StackWrap.js +13 -13
- package/lib-module/StackView/StackWrap.native.js +2 -1
- package/lib-module/StackView/StackWrapBox.js +5 -8
- package/lib-module/StackView/StackWrapGap.js +1 -1
- package/lib-module/StackView/getStackedContent.js +10 -10
- package/lib-module/StepTracker/Step.js +3 -14
- package/lib-module/StepTracker/StepTracker.js +5 -13
- package/lib-module/Tabs/Tabs.js +7 -16
- package/lib-module/Tabs/TabsItem.js +13 -16
- package/lib-module/Tags/Tags.js +9 -26
- package/lib-module/TextInput/TextArea.js +11 -8
- package/lib-module/TextInput/TextInput.js +7 -5
- package/lib-module/TextInput/TextInputBase.js +107 -51
- package/lib-module/TextInput/propTypes.js +7 -6
- package/lib-module/ThemeProvider/ThemeProvider.js +10 -9
- package/lib-module/ThemeProvider/useSetTheme.js +6 -7
- package/lib-module/ThemeProvider/useTheme.js +2 -5
- package/lib-module/ThemeProvider/useThemeTokens.js +1 -2
- package/lib-module/ThemeProvider/utils/styles.js +15 -27
- package/lib-module/ThemeProvider/utils/theme-tokens.js +15 -20
- package/lib-module/Timeline/Timeline.js +11 -17
- package/lib-module/ToggleSwitch/ToggleSwitch.js +13 -26
- package/lib-module/ToggleSwitch/ToggleSwitchGroup.js +4 -23
- package/lib-module/Tooltip/Backdrop.js +4 -7
- package/lib-module/Tooltip/Backdrop.native.js +1 -4
- package/lib-module/Tooltip/Tooltip.js +9 -18
- package/lib-module/Tooltip/Tooltip.native.js +14 -23
- package/lib-module/Tooltip/getTooltipPosition.js +26 -30
- package/lib-module/Tooltip/shared.js +0 -6
- package/lib-module/TooltipButton/TooltipButton.js +5 -8
- package/lib-module/Typography/Typography.js +14 -22
- package/lib-module/Validator/Validator.js +10 -42
- package/lib-module/ViewportProvider/ViewportProvider.js +1 -3
- package/lib-module/ViewportProvider/useViewportListener.js +6 -8
- package/lib-module/index.js +1 -0
- package/lib-module/utils/BaseView/BaseView.js +3 -4
- package/lib-module/utils/BaseView/BaseView.native.js +0 -1
- package/lib-module/utils/a11y/semantics.js +14 -27
- package/lib-module/utils/a11y/textSize.js +1 -2
- package/lib-module/utils/animation/useVerticalExpandAnimation.js +8 -11
- package/lib-module/utils/children.js +17 -19
- package/lib-module/utils/containUniqueFields.js +2 -4
- package/lib-module/utils/htmlAttrs.js +2 -1
- package/lib-module/utils/info/index.js +2 -1
- package/lib-module/utils/info/platform/index.js +4 -1
- package/lib-module/utils/info/versions.js +2 -1
- package/lib-module/utils/input.js +11 -19
- package/lib-module/utils/pressability.js +8 -7
- package/lib-module/utils/props/a11yProps.js +22 -20
- package/lib-module/utils/props/clickProps.js +0 -1
- package/lib-module/utils/props/componentPropType.js +0 -13
- package/lib-module/utils/props/getPropSelector.js +12 -8
- package/lib-module/utils/props/handlerProps.js +2 -19
- package/lib-module/utils/props/hrefAttrsProp.js +2 -2
- package/lib-module/utils/props/inputSupportsProps.js +0 -6
- package/lib-module/utils/props/linkProps.js +2 -3
- package/lib-module/utils/props/pressProps.js +2 -2
- package/lib-module/utils/props/responsiveProps.js +1 -3
- package/lib-module/utils/props/selectSystemProps.js +4 -5
- package/lib-module/utils/props/spacingProps.js +4 -3
- package/lib-module/utils/props/textInputProps.js +14 -27
- package/lib-module/utils/props/textProps.js +9 -7
- package/lib-module/utils/props/tokens.js +10 -13
- package/lib-module/utils/props/variantProp.js +1 -1
- package/lib-module/utils/props/viewProps.js +0 -1
- package/lib-module/utils/ssr.js +14 -18
- package/lib-module/utils/useCopy.js +3 -5
- package/lib-module/utils/useHash.js +5 -9
- package/lib-module/utils/useHash.native.js +0 -1
- package/lib-module/utils/useOverlaidPosition.js +6 -25
- package/lib-module/utils/useResponsiveProp.js +6 -7
- package/lib-module/utils/useSafeLayoutEffect.js +5 -7
- package/lib-module/utils/useScrollBlocking.js +3 -10
- package/lib-module/utils/useSpacingScale.js +4 -4
- package/lib-module/utils/useUniqueId.js +0 -2
- package/lib-module/utils/withLinkRouter.js +13 -10
- package/package.json +2 -2
- package/src/CheckboxCardGroup/CheckboxCardGroup.jsx +230 -0
- package/src/CheckboxCardGroup/index.js +3 -0
- package/src/Modal/Modal.jsx +98 -5
- package/src/Modal/ModalContent.jsx +171 -0
- package/src/TextInput/TextInputBase.jsx +67 -12
- package/src/TextInput/propTypes.js +4 -0
- package/src/index.js +1 -0
- package/src/utils/props/textInputProps.js +1 -0
|
@@ -7,7 +7,6 @@ import { useThemeTokens } from '../ThemeProvider';
|
|
|
7
7
|
import { a11yProps, componentPropType, getTokensPropType, selectSystemProps, variantProp, viewProps } from '../utils';
|
|
8
8
|
import { createElement as _createElement } from "react";
|
|
9
9
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
|
-
|
|
11
10
|
function selectBorderStyles(tokens) {
|
|
12
11
|
return {
|
|
13
12
|
borderBottomWidth: tokens.borderWidth,
|
|
@@ -15,14 +14,13 @@ function selectBorderStyles(tokens) {
|
|
|
15
14
|
borderBottomColor: tokens.borderColor
|
|
16
15
|
};
|
|
17
16
|
}
|
|
18
|
-
|
|
19
17
|
const [selectProps, selectedSystemPropTypes] = selectSystemProps([a11yProps, viewProps]);
|
|
18
|
+
|
|
20
19
|
/**
|
|
21
20
|
## Usage Criteria
|
|
22
21
|
- Use in conjunction with a large amount of educational / informational content
|
|
23
22
|
- Allow the user to navigate between options frequently and efficiently
|
|
24
23
|
*/
|
|
25
|
-
|
|
26
24
|
const SideNav = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
27
25
|
let {
|
|
28
26
|
children,
|
|
@@ -38,18 +36,15 @@ const SideNav = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
38
36
|
groupId: undefined,
|
|
39
37
|
itemId: undefined
|
|
40
38
|
});
|
|
41
|
-
|
|
42
39
|
const onItemPress = (itemId, groupId) => {
|
|
43
40
|
setActive({
|
|
44
41
|
itemId,
|
|
45
42
|
groupId
|
|
46
43
|
});
|
|
47
44
|
};
|
|
48
|
-
|
|
49
45
|
const isItemActive = (itemId, groupId) => {
|
|
50
46
|
return active.groupId === groupId && active.itemId === itemId;
|
|
51
47
|
};
|
|
52
|
-
|
|
53
48
|
return /*#__PURE__*/_jsx(ExpandCollapse, {
|
|
54
49
|
ref: ref,
|
|
55
50
|
maxOpen: accordion ? 1 : null,
|
|
@@ -60,23 +55,22 @@ const SideNav = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
60
55
|
openIds,
|
|
61
56
|
onToggle
|
|
62
57
|
} = _ref2;
|
|
63
|
-
|
|
64
58
|
const renderItem = (item, index, groupId) => {
|
|
65
59
|
const {
|
|
66
60
|
itemId = `item-${index}`,
|
|
67
61
|
onPress
|
|
68
62
|
} = item.props;
|
|
69
|
-
|
|
70
63
|
const handlePress = function () {
|
|
71
64
|
onItemPress(...arguments);
|
|
72
65
|
if (onPress) onPress(...arguments);
|
|
73
66
|
};
|
|
74
|
-
|
|
75
|
-
|
|
67
|
+
return /*#__PURE__*/_createElement(Item, {
|
|
68
|
+
...item.props,
|
|
76
69
|
key: itemId,
|
|
77
70
|
itemId: itemId,
|
|
78
71
|
groupId: groupId,
|
|
79
|
-
variant: groupId ? {
|
|
72
|
+
variant: groupId ? {
|
|
73
|
+
...variant,
|
|
80
74
|
type: 'child'
|
|
81
75
|
} : variant,
|
|
82
76
|
tokens: itemTokens,
|
|
@@ -84,20 +78,17 @@ const SideNav = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
84
78
|
onPress: handlePress
|
|
85
79
|
});
|
|
86
80
|
};
|
|
87
|
-
|
|
88
81
|
return React.Children.map(children, (child, index) => {
|
|
89
82
|
// iterate over children and identify them internally to later reference expanded groups and active items
|
|
90
83
|
if (child.type === Item) return renderItem(child, index);
|
|
91
|
-
|
|
92
84
|
if (child.type === ItemsGroup) {
|
|
93
85
|
const {
|
|
94
86
|
groupId = `group-${index}`
|
|
95
87
|
} = child.props;
|
|
96
88
|
const isGroupActive = active.itemId !== undefined && active.groupId === groupId;
|
|
97
|
-
|
|
98
89
|
const handleToggle = event => onToggle(groupId, event);
|
|
99
|
-
|
|
100
|
-
|
|
90
|
+
return /*#__PURE__*/_createElement(ItemsGroup, {
|
|
91
|
+
...child.props,
|
|
101
92
|
key: groupId,
|
|
102
93
|
groupId: groupId,
|
|
103
94
|
variant: variant,
|
|
@@ -108,32 +99,28 @@ const SideNav = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
108
99
|
onToggle: handleToggle
|
|
109
100
|
}, React.Children.map(child.props.children, (item, itemIndex) => renderItem(item, itemIndex, groupId)));
|
|
110
101
|
}
|
|
111
|
-
|
|
112
102
|
return null;
|
|
113
103
|
});
|
|
114
104
|
}
|
|
115
105
|
});
|
|
116
106
|
});
|
|
117
107
|
SideNav.displayName = 'SideNav';
|
|
118
|
-
SideNav.propTypes = {
|
|
119
|
-
|
|
108
|
+
SideNav.propTypes = {
|
|
109
|
+
...selectedSystemPropTypes,
|
|
120
110
|
/**
|
|
121
111
|
* Specifies the structure and links of the `SideNav`. It may only consist of `SideNav.Item` and `SideNav.ItemsGroup`.
|
|
122
112
|
*/
|
|
123
113
|
children: componentPropType(['Item', 'ItemsGroup']),
|
|
124
|
-
|
|
125
114
|
/**
|
|
126
115
|
* Identifies if only one `SideNav.ItemsGroup` should be open at a time.
|
|
127
116
|
*/
|
|
128
117
|
accordion: PropTypes.bool,
|
|
129
118
|
variant: variantProp.propType,
|
|
130
119
|
tokens: getTokensPropType('SideNav'),
|
|
131
|
-
|
|
132
120
|
/**
|
|
133
121
|
* Custom tokens for `SideNav.Item`
|
|
134
122
|
*/
|
|
135
123
|
itemTokens: getTokensPropType('SideNavItem'),
|
|
136
|
-
|
|
137
124
|
/**
|
|
138
125
|
* Custom tokens for `SideNavItemsGroup`
|
|
139
126
|
*/
|
|
@@ -11,7 +11,6 @@ import useSkeletonNativeAnimation from './useSkeletonNativeAnimation';
|
|
|
11
11
|
import skeletonWebAnimation from './skeletonWebAnimation';
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
13
|
const [selectProps, selectedSystemPropTypes] = selectSystemProps([a11yProps, viewProps]);
|
|
14
|
-
|
|
15
14
|
const selectSkeletonStyles = _ref => {
|
|
16
15
|
let {
|
|
17
16
|
color,
|
|
@@ -23,7 +22,6 @@ const selectSkeletonStyles = _ref => {
|
|
|
23
22
|
maxWidth: '100%'
|
|
24
23
|
};
|
|
25
24
|
};
|
|
26
|
-
|
|
27
25
|
const selectLineStyles = _ref2 => {
|
|
28
26
|
let {
|
|
29
27
|
skeletonHeight,
|
|
@@ -34,7 +32,6 @@ const selectLineStyles = _ref2 => {
|
|
|
34
32
|
height: skeletonHeight
|
|
35
33
|
};
|
|
36
34
|
};
|
|
37
|
-
|
|
38
35
|
const selectShapeStyles = _ref3 => {
|
|
39
36
|
let {
|
|
40
37
|
skeletonHeight
|
|
@@ -44,7 +41,6 @@ const selectShapeStyles = _ref3 => {
|
|
|
44
41
|
width: skeletonHeight
|
|
45
42
|
};
|
|
46
43
|
};
|
|
47
|
-
|
|
48
44
|
const selectSquareStyles = _ref4 => {
|
|
49
45
|
let {
|
|
50
46
|
radius
|
|
@@ -53,7 +49,6 @@ const selectSquareStyles = _ref4 => {
|
|
|
53
49
|
borderRadius: radius
|
|
54
50
|
};
|
|
55
51
|
};
|
|
56
|
-
|
|
57
52
|
const Skeleton = /*#__PURE__*/forwardRef((_ref5, ref) => {
|
|
58
53
|
let {
|
|
59
54
|
tokens,
|
|
@@ -68,15 +63,18 @@ const Skeleton = /*#__PURE__*/forwardRef((_ref5, ref) => {
|
|
|
68
63
|
} = _ref5;
|
|
69
64
|
const themeTokens = useThemeTokens('Skeleton', tokens, variant);
|
|
70
65
|
const pixels = useResponsiveProp(sizePixels);
|
|
71
|
-
const spacingScaleValue = typeof pixels === 'number' ?
|
|
66
|
+
const spacingScaleValue = typeof pixels === 'number' ?
|
|
67
|
+
// Size by an exact number of pixels
|
|
72
68
|
{
|
|
73
69
|
options: {
|
|
74
70
|
size: pixels
|
|
75
71
|
}
|
|
76
|
-
} :
|
|
72
|
+
} :
|
|
73
|
+
// Size by an index on the spacing scale (getting default index from theme if none provided)
|
|
77
74
|
sizeIndex || themeTokens.size;
|
|
78
|
-
const skeletonHeight = useSpacingScale(spacingScaleValue);
|
|
75
|
+
const skeletonHeight = useSpacingScale(spacingScaleValue);
|
|
79
76
|
|
|
77
|
+
// Animation color and animation duration
|
|
80
78
|
const {
|
|
81
79
|
secondColor,
|
|
82
80
|
animationDuration
|
|
@@ -84,32 +82,27 @@ const Skeleton = /*#__PURE__*/forwardRef((_ref5, ref) => {
|
|
|
84
82
|
const nativeAnimation = useSkeletonNativeAnimation({
|
|
85
83
|
animationDuration
|
|
86
84
|
});
|
|
87
|
-
|
|
88
85
|
const getAnimationBasedOnPlatform = () => {
|
|
89
|
-
const animation = Platform.OS === 'web' ? skeletonWebAnimation(secondColor, animationDuration) : nativeAnimation;
|
|
86
|
+
const animation = Platform.OS === 'web' ? skeletonWebAnimation(secondColor, animationDuration) : nativeAnimation;
|
|
87
|
+
// We must pass the animation styles through `StyleSheet.create`
|
|
90
88
|
// @see https://github.com/necolas/react-native-web/issues/2387
|
|
91
|
-
|
|
92
89
|
const styles = StyleSheet.create({
|
|
93
90
|
animation
|
|
94
91
|
});
|
|
95
92
|
return styles.animation;
|
|
96
93
|
};
|
|
97
|
-
|
|
98
94
|
const getLineWidth = () => {
|
|
99
95
|
if (characters) {
|
|
100
96
|
return characters * themeTokens.baseWidth;
|
|
101
97
|
}
|
|
102
|
-
|
|
103
98
|
return themeTokens.characters * themeTokens.baseWidth;
|
|
104
99
|
};
|
|
105
|
-
|
|
106
100
|
const getStyledBasedOnShape = () => {
|
|
107
101
|
if (shape === 'circle') {
|
|
108
102
|
return selectShapeStyles({
|
|
109
103
|
skeletonHeight
|
|
110
104
|
});
|
|
111
105
|
}
|
|
112
|
-
|
|
113
106
|
if (shape === 'box') {
|
|
114
107
|
return [selectShapeStyles({
|
|
115
108
|
skeletonHeight
|
|
@@ -117,13 +110,11 @@ const Skeleton = /*#__PURE__*/forwardRef((_ref5, ref) => {
|
|
|
117
110
|
radius: themeTokens.squareRadius
|
|
118
111
|
})];
|
|
119
112
|
}
|
|
120
|
-
|
|
121
113
|
return selectLineStyles({
|
|
122
114
|
skeletonHeight,
|
|
123
115
|
lineWidth: getLineWidth()
|
|
124
116
|
});
|
|
125
117
|
};
|
|
126
|
-
|
|
127
118
|
const renderSkeleton = function () {
|
|
128
119
|
let index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
129
120
|
// @see https://github.com/necolas/react-native-web/issues/2387
|
|
@@ -133,7 +124,6 @@ const Skeleton = /*#__PURE__*/forwardRef((_ref5, ref) => {
|
|
|
133
124
|
style: [selectSkeletonStyles(themeTokens), getAnimationBasedOnPlatform(), getStyledBasedOnShape()]
|
|
134
125
|
}, `skeleton-${index + 1}`);
|
|
135
126
|
};
|
|
136
|
-
|
|
137
127
|
return /*#__PURE__*/_jsx(StackView, {
|
|
138
128
|
space: themeTokens.spaceBetweenLines,
|
|
139
129
|
ref: ref,
|
|
@@ -142,36 +132,32 @@ const Skeleton = /*#__PURE__*/forwardRef((_ref5, ref) => {
|
|
|
142
132
|
});
|
|
143
133
|
});
|
|
144
134
|
Skeleton.displayName = 'Skeleton';
|
|
145
|
-
Skeleton.propTypes = {
|
|
135
|
+
Skeleton.propTypes = {
|
|
136
|
+
...selectedSystemPropTypes,
|
|
146
137
|
tokens: getTokensPropType('Skeleton'),
|
|
147
138
|
variant: variantProp.propType,
|
|
148
|
-
|
|
149
139
|
/**
|
|
150
140
|
* Sets the size of Skeleton lines or shape according to the theme's spacing scale. For example, size={1} gives the smallest non-zero theme-defined spacing size.
|
|
151
141
|
*
|
|
152
142
|
* May also accept an object with responsive viewport keys or spacing scale options - see `useSpacingScale` for details.
|
|
153
143
|
*/
|
|
154
144
|
sizeIndex: spacingProps.types.spacingValue,
|
|
155
|
-
|
|
156
145
|
/**
|
|
157
146
|
* @deprecated alias for `sizeIndex`
|
|
158
147
|
*/
|
|
159
148
|
size: spacingProps.types.spacingValue,
|
|
160
|
-
|
|
161
149
|
/**
|
|
162
150
|
* Sets the size of Skeleton lines or shape to an exact number of pixels. Use when it's necessary to exactly match sizes of images or other boxes.
|
|
163
151
|
*
|
|
164
152
|
* Accepts a number or an object with responsive viewport keys, e.g. { xs: 32, lg: 64 } would be 32px at xs, sm and md and 64 at lg and xl viewports.
|
|
165
153
|
*/
|
|
166
154
|
sizePixels: responsiveProps.getTypeOptionallyByViewport(propTypes.number),
|
|
167
|
-
|
|
168
155
|
/**
|
|
169
156
|
* Determines the width of simulated lines of text if the Skeleton's shape is 'line' (the default shape).
|
|
170
157
|
*
|
|
171
158
|
* Only has any affect if shape is line (the default). If unset, takes a default value from the theme.
|
|
172
159
|
*/
|
|
173
160
|
characters: propTypes.number,
|
|
174
|
-
|
|
175
161
|
/**
|
|
176
162
|
* Determines how many Skeleton items are rendered (default 1).
|
|
177
163
|
*
|
|
@@ -180,7 +166,6 @@ Skeleton.propTypes = { ...selectedSystemPropTypes,
|
|
|
180
166
|
* The amount of spacing between multiple lines is controlled by theme tokens.
|
|
181
167
|
*/
|
|
182
168
|
lines: propTypes.number,
|
|
183
|
-
|
|
184
169
|
/**
|
|
185
170
|
* Determines if the skeleton should resemble lines of text (default), a circle, or a square box with themed rounded corners.
|
|
186
171
|
*/
|
|
@@ -2,14 +2,13 @@ import { useEffect, useRef } from 'react';
|
|
|
2
2
|
import Animated from "react-native-web/dist/exports/Animated";
|
|
3
3
|
import Platform from "react-native-web/dist/exports/Platform";
|
|
4
4
|
import { DEFAULT_OPACITY, OPACITY_STOP } from './skeleton.constant';
|
|
5
|
-
|
|
6
5
|
const useSkeletonNativeAnimation = _ref => {
|
|
7
6
|
let {
|
|
8
7
|
animationDuration
|
|
9
8
|
} = _ref;
|
|
10
9
|
const fadeAnimation = useRef(new Animated.Value(DEFAULT_OPACITY)).current;
|
|
11
|
-
/* eslint-disable react-hooks/exhaustive-deps */
|
|
12
10
|
|
|
11
|
+
/* eslint-disable react-hooks/exhaustive-deps */
|
|
13
12
|
useEffect(() => {
|
|
14
13
|
const fade = Animated.sequence([Animated.timing(fadeAnimation, {
|
|
15
14
|
toValue: OPACITY_STOP,
|
|
@@ -26,5 +25,4 @@ const useSkeletonNativeAnimation = _ref => {
|
|
|
26
25
|
opacity: fadeAnimation
|
|
27
26
|
};
|
|
28
27
|
};
|
|
29
|
-
|
|
30
28
|
export default useSkeletonNativeAnimation;
|
|
@@ -7,8 +7,9 @@ import PropTypes from 'prop-types';
|
|
|
7
7
|
import { useThemeTokensCallback } from '../ThemeProvider';
|
|
8
8
|
import { a11yProps, clickProps, getTokensPropType, linkProps, resolvePressableTokens, selectSystemProps, variantProp, withLinkRouter } from '../utils';
|
|
9
9
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
|
-
const [selectProps, selectedSystemPropTypes] = selectSystemProps([a11yProps, linkProps]);
|
|
10
|
+
const [selectProps, selectedSystemPropTypes] = selectSystemProps([a11yProps, linkProps]);
|
|
11
11
|
|
|
12
|
+
// ensure explicit selection of tokens
|
|
12
13
|
const selectStyles = _ref => {
|
|
13
14
|
let {
|
|
14
15
|
backgroundColor,
|
|
@@ -31,7 +32,6 @@ const selectStyles = _ref => {
|
|
|
31
32
|
borderRadius
|
|
32
33
|
};
|
|
33
34
|
};
|
|
34
|
-
|
|
35
35
|
const selectTextStyles = _ref2 => {
|
|
36
36
|
let {
|
|
37
37
|
color,
|
|
@@ -49,6 +49,7 @@ const selectTextStyles = _ref2 => {
|
|
|
49
49
|
fontSize
|
|
50
50
|
};
|
|
51
51
|
};
|
|
52
|
+
|
|
52
53
|
/**
|
|
53
54
|
* A generic Skip link component, unstyled by default.
|
|
54
55
|
* A Skip link component help keyboard-only users, screen reader users to skip
|
|
@@ -104,8 +105,6 @@ const selectTextStyles = _ref2 => {
|
|
|
104
105
|
*
|
|
105
106
|
* Skip link supports all the common a11y and link props.
|
|
106
107
|
*/
|
|
107
|
-
|
|
108
|
-
|
|
109
108
|
const SkipLink = /*#__PURE__*/forwardRef((_ref3, ref) => {
|
|
110
109
|
let {
|
|
111
110
|
tokens,
|
|
@@ -119,9 +118,9 @@ const SkipLink = /*#__PURE__*/forwardRef((_ref3, ref) => {
|
|
|
119
118
|
...rest
|
|
120
119
|
} = clickProps.toPressProps(rawRest);
|
|
121
120
|
const getTokens = useThemeTokensCallback('SkipLink', tokens, variant);
|
|
122
|
-
|
|
123
121
|
const handlePress = event => {
|
|
124
|
-
if (typeof onPress === 'function') onPress(event);
|
|
122
|
+
if (typeof onPress === 'function') onPress(event);
|
|
123
|
+
// TODO - support native apps with something based on refs and/or setAccessibilityFocus
|
|
125
124
|
};
|
|
126
125
|
|
|
127
126
|
return /*#__PURE__*/_jsx(Pressable, {
|
|
@@ -149,13 +148,12 @@ const SkipLink = /*#__PURE__*/forwardRef((_ref3, ref) => {
|
|
|
149
148
|
});
|
|
150
149
|
});
|
|
151
150
|
SkipLink.displayName = 'SkipLink';
|
|
152
|
-
SkipLink.propTypes = {
|
|
153
|
-
|
|
151
|
+
SkipLink.propTypes = {
|
|
152
|
+
...selectedSystemPropTypes,
|
|
154
153
|
/**
|
|
155
154
|
* The text content shown or read out when the SkipLink is focused, usually a string.
|
|
156
155
|
*/
|
|
157
156
|
children: PropTypes.node,
|
|
158
|
-
|
|
159
157
|
/**
|
|
160
158
|
* The target to skip to. Usually an anchor link to a section id (e.g. href="#main-section").
|
|
161
159
|
*/
|
|
@@ -3,19 +3,19 @@ import PropTypes from 'prop-types';
|
|
|
3
3
|
import StyleSheet from "react-native-web/dist/exports/StyleSheet";
|
|
4
4
|
import View from "react-native-web/dist/exports/View";
|
|
5
5
|
import { a11yProps, selectSystemProps, spacingProps, useSpacingScale, viewProps } from '../utils';
|
|
6
|
+
|
|
6
7
|
/**
|
|
7
8
|
* @typedef {import('../utils/props/spacingProps.js').SpacingValue} SpacingValue
|
|
8
9
|
* @typedef {import('../utils/props/spacingProps.js').SpacingObject} SpacingObject
|
|
9
10
|
*/
|
|
10
|
-
|
|
11
11
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
12
|
const [selectProps, selectedSystemPropTypes] = selectSystemProps([a11yProps, viewProps]);
|
|
13
|
-
|
|
14
13
|
const selectSizeStyle = (size, direction) => ({
|
|
15
14
|
// Only apply space in one direction at a time, else large spacers will increase the
|
|
16
15
|
// 'across' size of the parent and mess up siblings with styles like `alignItems: stretch`.
|
|
17
16
|
[direction === 'row' ? 'width' : 'height']: size
|
|
18
17
|
});
|
|
18
|
+
|
|
19
19
|
/**
|
|
20
20
|
* An empty element used to create a gap between components that is sized according to the theme spacing scale,
|
|
21
21
|
* passing its `space` prop ({@link SpacingValue}) to `useSpacingScale`.
|
|
@@ -56,8 +56,6 @@ const selectSizeStyle = (size, direction) => ({
|
|
|
56
56
|
* Spacer has no content and is ignored by tools such as screen readers. Use `Divider` for
|
|
57
57
|
* separations between elements that may be treated as semantically meaningful on web.
|
|
58
58
|
*/
|
|
59
|
-
|
|
60
|
-
|
|
61
59
|
const Spacer = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
62
60
|
let {
|
|
63
61
|
space = 1,
|
|
@@ -73,15 +71,14 @@ const Spacer = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
73
71
|
});
|
|
74
72
|
});
|
|
75
73
|
Spacer.displayName = 'Spacer';
|
|
76
|
-
Spacer.propTypes = {
|
|
77
|
-
|
|
74
|
+
Spacer.propTypes = {
|
|
75
|
+
...selectedSystemPropTypes,
|
|
78
76
|
/**
|
|
79
77
|
* The size of the spacer according to the theme's spacing scale.
|
|
80
78
|
* Either a number corresponding to a position on the theme's spacing scale (1 is smallest, 2 is second smallest, etc),
|
|
81
79
|
* or, a SpacingObject with viewport keys and options (see `useSpacingScale` for details).
|
|
82
80
|
*/
|
|
83
81
|
space: spacingProps.types.spacingValue,
|
|
84
|
-
|
|
85
82
|
/**
|
|
86
83
|
* The spacer applies space in only one direction, which is controlled by the `direction` prop:
|
|
87
84
|
*
|
|
@@ -9,6 +9,7 @@ import getStackedContent from './getStackedContent';
|
|
|
9
9
|
import { staticStyles, selectFlexStyles } from './common';
|
|
10
10
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
11
|
const [selectProps, selectedSystemPropTypes] = selectSystemProps([a11yProps, viewProps]);
|
|
12
|
+
|
|
12
13
|
/**
|
|
13
14
|
* StackView evenly spaces its children, by default placing `Spacer` components between them.
|
|
14
15
|
*
|
|
@@ -51,7 +52,6 @@ const [selectProps, selectedSystemPropTypes] = selectSystemProps([a11yProps, vie
|
|
|
51
52
|
* It applies no accessibility props of its own, unless `divider` prop is passed (`Divider` has a
|
|
52
53
|
* semantic role but only on web, not within native apps).
|
|
53
54
|
*/
|
|
54
|
-
|
|
55
55
|
const StackView = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
56
56
|
let {
|
|
57
57
|
space = 0,
|
|
@@ -91,28 +91,25 @@ const StackView = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
91
91
|
});
|
|
92
92
|
});
|
|
93
93
|
StackView.displayName = 'StackView';
|
|
94
|
-
StackView.propTypes = {
|
|
94
|
+
StackView.propTypes = {
|
|
95
|
+
...selectedSystemPropTypes,
|
|
95
96
|
tokens: getTokensPropType('StackView'),
|
|
96
97
|
variant: variantProp.propType,
|
|
97
|
-
|
|
98
98
|
/**
|
|
99
99
|
* Sets the `flexDirection` of the container and, if `divider` is used, gives the Divider the appropriate direction.
|
|
100
100
|
*/
|
|
101
101
|
direction: responsiveProps.getTypeOptionallyByViewport(PropTypes.oneOf(['column', 'row', 'column-reverse', 'row-reverse'])),
|
|
102
|
-
|
|
103
102
|
/**
|
|
104
103
|
* If true, renders a UDS `Divider` component between each item. If an object is passed,
|
|
105
104
|
* this object is passes as props to each Divider.
|
|
106
105
|
*/
|
|
107
106
|
divider: PropTypes.oneOfType([PropTypes.bool, PropTypes.shape(Divider.propTypes)]),
|
|
108
|
-
|
|
109
107
|
/**
|
|
110
108
|
* The size of the spacer according to the theme's spacing scale.
|
|
111
109
|
* Either a number corresponding to a position on the theme's spacing scale (1 is smallest, 2 is second smallest, etc),
|
|
112
110
|
* or, a SpacingObject with viewport keys and options (see `useSpacingScale` for details).
|
|
113
111
|
*/
|
|
114
112
|
space: spacingProps.types.spacingValue,
|
|
115
|
-
|
|
116
113
|
/**
|
|
117
114
|
* Optional semantic HTML tag, to apply to the container on web. Does not change styling.
|
|
118
115
|
*
|
|
@@ -120,7 +117,6 @@ StackView.propTypes = { ...selectedSystemPropTypes,
|
|
|
120
117
|
* is not defined, the accessibilityRole will default to "heading".
|
|
121
118
|
*/
|
|
122
119
|
tag: PropTypes.oneOf(layoutTags),
|
|
123
|
-
|
|
124
120
|
/**
|
|
125
121
|
* A StackView may take any children, but will have no effect if it is only passed one child or is passed children
|
|
126
122
|
* wrapped in a component. If necessary, children may be wrapped in one React Fragment.
|
|
@@ -2,19 +2,19 @@ import React, { forwardRef, useState } from 'react';
|
|
|
2
2
|
import Platform from "react-native-web/dist/exports/Platform";
|
|
3
3
|
import useSafeLayoutEffect from '../utils/useSafeLayoutEffect';
|
|
4
4
|
import StackWrapBox from './StackWrapBox';
|
|
5
|
-
import StackWrapGap from './StackWrapGap';
|
|
5
|
+
import StackWrapGap from './StackWrapGap';
|
|
6
6
|
|
|
7
|
+
// In Jest/CI/SSR, global CSS isn't always available and doesn't always have .supports method
|
|
7
8
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
|
-
|
|
9
9
|
const cssSupports = (property, value) => {
|
|
10
10
|
var _window$CSS;
|
|
11
|
-
|
|
12
11
|
return Platform.OS === 'web' && typeof window !== 'undefined' && typeof ((_window$CSS = window.CSS) === null || _window$CSS === void 0 ? void 0 : _window$CSS.supports) === 'function' && window.CSS.supports(property, value);
|
|
13
|
-
};
|
|
14
|
-
// Will be an integer appended `px` after hooks and JSX styles are resolved.
|
|
15
|
-
|
|
12
|
+
};
|
|
16
13
|
|
|
14
|
+
// CSS.supports needs an example of the type of value you intend to use.
|
|
15
|
+
// Will be an integer appended `px` after hooks and JSX styles are resolved.
|
|
17
16
|
const exampleGapValue = '1px';
|
|
17
|
+
|
|
18
18
|
/**
|
|
19
19
|
* StackWrap is an alternative to StackView where the spaced items are allowed to wrap.
|
|
20
20
|
*
|
|
@@ -22,22 +22,22 @@ const exampleGapValue = '1px';
|
|
|
22
22
|
* wrapped lines of items. By default, this `gap` is the same as the gap between spaced items.
|
|
23
23
|
* If a different spacing is desired between wrapped lines, pass a spacing value to the `gap` prop.
|
|
24
24
|
*/
|
|
25
|
-
|
|
26
25
|
const StackWrap = /*#__PURE__*/forwardRef((props, ref) => {
|
|
27
26
|
const [canUseCSSGap, setCanUseCSSGap] = useState(false);
|
|
28
27
|
const {
|
|
29
28
|
space
|
|
30
|
-
} = props;
|
|
31
|
-
|
|
29
|
+
} = props;
|
|
30
|
+
// Don't apply separate gap if `null` or `undefined`, so can be unset in Storybook etc
|
|
32
31
|
const gap = props.gap ?? space;
|
|
33
|
-
const gapEqualsSpace = gap === space;
|
|
32
|
+
const gapEqualsSpace = gap === space;
|
|
33
|
+
|
|
34
|
+
// If possible, use the cleaner implementation that applies CSS `gap` styles to the container,
|
|
34
35
|
// preserving direct parent-child relationships between the container and each item, which
|
|
35
36
|
// can result in clearer descriptions on some screen readers (e.g. radio "X of Y" on MacOS).
|
|
36
37
|
// Else, use the fallback implementation which renders a `Box` component around each child.
|
|
37
|
-
|
|
38
|
-
|
|
38
|
+
const Component = canUseCSSGap ? StackWrapGap : StackWrapBox;
|
|
39
|
+
// In SSR, the type of implementation must match the server during hydration, but
|
|
39
40
|
// the server can't know if gap is supported, so never use it until after hydration.
|
|
40
|
-
|
|
41
41
|
useSafeLayoutEffect(() => {
|
|
42
42
|
setCanUseCSSGap(gapEqualsSpace && cssSupports('gap', exampleGapValue));
|
|
43
43
|
}, [gapEqualsSpace]);
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import StackWrapBox from './StackWrapBox';
|
|
1
|
+
import StackWrapBox from './StackWrapBox';
|
|
2
2
|
|
|
3
|
+
// No support for CSS `gap` on React Native, so always use the fallback "box" implementation.
|
|
3
4
|
export default StackWrapBox;
|
|
@@ -20,6 +20,7 @@ const spaceSides = {
|
|
|
20
20
|
row: 'right',
|
|
21
21
|
column: 'bottom'
|
|
22
22
|
};
|
|
23
|
+
|
|
23
24
|
/**
|
|
24
25
|
* An alternative fallback implementation of `StackWrap` that doesn't use CSS `gap`.
|
|
25
26
|
*
|
|
@@ -32,7 +33,6 @@ const spaceSides = {
|
|
|
32
33
|
* Unlike the cleaner and more side-effect-free CSS gap StackWrap implementation, this renders a Box (View)
|
|
33
34
|
* between the container and the stacked children, and requires a negative margin on the container.
|
|
34
35
|
*/
|
|
35
|
-
|
|
36
36
|
const StackWrapBox = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
37
37
|
let {
|
|
38
38
|
space = 1,
|
|
@@ -55,8 +55,9 @@ const StackWrapBox = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
55
55
|
accessibilityRole,
|
|
56
56
|
...getA11yPropsFromHtmlTag(tag, accessibilityRole),
|
|
57
57
|
...rest
|
|
58
|
-
});
|
|
58
|
+
});
|
|
59
59
|
|
|
60
|
+
// Mimic CSS `gap` using box spacing on the side after a wrapped row then offsetting it on the last row.
|
|
60
61
|
const gapSize = useSpacingScale(gap);
|
|
61
62
|
const offsetStyle = {
|
|
62
63
|
[offsetSides[direction]]: -1 * gapSize
|
|
@@ -78,28 +79,25 @@ const StackWrapBox = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
78
79
|
});
|
|
79
80
|
});
|
|
80
81
|
StackWrapBox.displayName = 'StackWrapBox';
|
|
81
|
-
StackWrapBox.propTypes = {
|
|
82
|
+
StackWrapBox.propTypes = {
|
|
83
|
+
...selectedSystemPropTypes,
|
|
82
84
|
tokens: getTokensPropType('StackView'),
|
|
83
|
-
|
|
84
85
|
/**
|
|
85
86
|
* Sets the `flexDirection` of the container
|
|
86
87
|
*/
|
|
87
88
|
direction: responsiveProps.getTypeOptionallyByViewport(PropTypes.oneOf(['column', 'row', 'row-reverse', 'column-reverse'])),
|
|
88
|
-
|
|
89
89
|
/**
|
|
90
90
|
* The size of the space between items according to the theme's spacing scale.
|
|
91
91
|
* Either a number corresponding to a position on the theme's spacing scale (1 is smallest, 2 is second smallest, etc),
|
|
92
92
|
* or, a SpacingObject with viewport keys and options (see `useSpacingScale` for details).
|
|
93
93
|
*/
|
|
94
94
|
space: spacingProps.types.spacingValue,
|
|
95
|
-
|
|
96
95
|
/**
|
|
97
96
|
* The size of the space between lines of content, according to the theme's spacing scale. By default, matches `space`.
|
|
98
97
|
* Either a number corresponding to a position on the theme's spacing scale (1 is smallest, 2 is second smallest, etc),
|
|
99
98
|
* or, a SpacingObject with viewport keys and options (see `useSpacingScale` for details).
|
|
100
99
|
*/
|
|
101
100
|
gap: spacingProps.types.spacingValue,
|
|
102
|
-
|
|
103
101
|
/**
|
|
104
102
|
* Optional semantic HTML tag, to apply to the container on web. Does not change styling.
|
|
105
103
|
*
|
|
@@ -107,7 +105,6 @@ StackWrapBox.propTypes = { ...selectedSystemPropTypes,
|
|
|
107
105
|
* is not defined, the accessibilityRole will default to "heading".
|
|
108
106
|
*/
|
|
109
107
|
tag: PropTypes.oneOf(layoutTags),
|
|
110
|
-
|
|
111
108
|
/**
|
|
112
109
|
* A StackWrap may take any children, but will have no effect if it is only passed one child or is passed children
|
|
113
110
|
* wrapped in a component. If necessary, children may be wrapped in one React Fragment.
|
|
@@ -8,6 +8,7 @@ import getStackedContent from './getStackedContent';
|
|
|
8
8
|
import { staticStyles, selectFlexStyles } from './common';
|
|
9
9
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
10
|
const [selectProps] = selectSystemProps([a11yProps, viewProps]);
|
|
11
|
+
|
|
11
12
|
/**
|
|
12
13
|
* The primary implementation of StackWrap.
|
|
13
14
|
*
|
|
@@ -18,7 +19,6 @@ const [selectProps] = selectSystemProps([a11yProps, viewProps]);
|
|
|
18
19
|
* - The `space` between items is the same as the `gap` between wrapped rows (this is the
|
|
19
20
|
* default if `gap` prop is undefined)
|
|
20
21
|
*/
|
|
21
|
-
|
|
22
22
|
const StackWrapGap = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
23
23
|
let {
|
|
24
24
|
space = 1,
|