@telus-uds/components-base 1.66.0 → 1.67.1
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 +23 -3
- 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 +14 -45
- 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 +216 -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 +25 -40
- 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 +12 -58
- package/lib/TextInput/index.js +0 -3
- package/lib/TextInput/propTypes.js +0 -8
- 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 +10 -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 +14 -31
- 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 +206 -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 +25 -27
- 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 +13 -39
- package/lib-module/TextInput/propTypes.js +3 -7
- 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 +13 -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/Checkbox/CheckboxGroup.jsx +10 -8
- package/src/CheckboxCardGroup/CheckboxCardGroup.jsx +231 -0
- package/src/CheckboxCardGroup/index.js +3 -0
- package/src/Modal/Modal.jsx +98 -5
- package/src/Modal/ModalContent.jsx +171 -0
- package/src/RadioCard/RadioCardGroup.jsx +23 -2
- package/src/index.js +1 -0
|
@@ -12,10 +12,10 @@ import { useViewport } from '../ViewportProvider';
|
|
|
12
12
|
import IconButton from '../IconButton';
|
|
13
13
|
import dictionary from './dictionary';
|
|
14
14
|
import useScrollBlocking from '../utils/useScrollBlocking';
|
|
15
|
+
import ModalContent from './ModalContent';
|
|
15
16
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
16
17
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
17
18
|
const [selectProps, selectedSystemPropTypes] = selectSystemProps([a11yProps, viewProps]);
|
|
18
|
-
|
|
19
19
|
const selectContainerStyles = _ref => {
|
|
20
20
|
let {
|
|
21
21
|
containerPaddingLeft,
|
|
@@ -34,7 +34,6 @@ const selectContainerStyles = _ref => {
|
|
|
34
34
|
paddingBottom: containerPaddingBottom
|
|
35
35
|
};
|
|
36
36
|
};
|
|
37
|
-
|
|
38
37
|
const selectModalStyles = _ref2 => {
|
|
39
38
|
let {
|
|
40
39
|
backgroundColor,
|
|
@@ -52,12 +51,12 @@ const selectModalStyles = _ref2 => {
|
|
|
52
51
|
height,
|
|
53
52
|
paddingLeft,
|
|
54
53
|
paddingRight,
|
|
55
|
-
paddingTop,
|
|
54
|
+
paddingTop: Platform.OS !== 'web' ? 16 + paddingTop : paddingTop,
|
|
55
|
+
// the 16 additions are due to the border that is present in the mobile version
|
|
56
56
|
paddingBottom,
|
|
57
57
|
...applyShadowToken(shadow)
|
|
58
58
|
};
|
|
59
59
|
};
|
|
60
|
-
|
|
61
60
|
const selectBackdropStyles = _ref3 => {
|
|
62
61
|
let {
|
|
63
62
|
backdropColor,
|
|
@@ -68,7 +67,6 @@ const selectBackdropStyles = _ref3 => {
|
|
|
68
67
|
opacity: backdropOpacity
|
|
69
68
|
};
|
|
70
69
|
};
|
|
71
|
-
|
|
72
70
|
const selectCloseButtonContainerStyles = _ref4 => {
|
|
73
71
|
let {
|
|
74
72
|
paddingRight,
|
|
@@ -76,9 +74,14 @@ const selectCloseButtonContainerStyles = _ref4 => {
|
|
|
76
74
|
} = _ref4;
|
|
77
75
|
return {
|
|
78
76
|
paddingRight,
|
|
79
|
-
paddingTop
|
|
77
|
+
paddingTop: Platform.OS !== 'web' ? 24 + paddingTop : paddingTop // The 24 additions are due to the border that is present in the mobile version for the close button
|
|
80
78
|
};
|
|
81
79
|
};
|
|
80
|
+
|
|
81
|
+
const selectScrollViewStyles = () => ({
|
|
82
|
+
flex: 1
|
|
83
|
+
});
|
|
84
|
+
|
|
82
85
|
/**
|
|
83
86
|
* A modal window is a secondary window that opens on top of the main one.
|
|
84
87
|
* Users have to interact with it before they can carry out their task and return to the main window.
|
|
@@ -93,8 +96,6 @@ const selectCloseButtonContainerStyles = _ref4 => {
|
|
|
93
96
|
* - Don’t use modals to reinforce or repeat information already available in the parent page or view
|
|
94
97
|
* - Don’t use modals consecutively
|
|
95
98
|
*/
|
|
96
|
-
|
|
97
|
-
|
|
98
99
|
const Modal = /*#__PURE__*/forwardRef((_ref5, ref) => {
|
|
99
100
|
let {
|
|
100
101
|
children,
|
|
@@ -102,9 +103,20 @@ const Modal = /*#__PURE__*/forwardRef((_ref5, ref) => {
|
|
|
102
103
|
onClose,
|
|
103
104
|
maxWidth,
|
|
104
105
|
tokens,
|
|
105
|
-
variant,
|
|
106
106
|
copy,
|
|
107
107
|
closeButton,
|
|
108
|
+
onCancel = onClose,
|
|
109
|
+
onConfirm,
|
|
110
|
+
heading,
|
|
111
|
+
headingLevel,
|
|
112
|
+
subHeading,
|
|
113
|
+
subHeadingSize,
|
|
114
|
+
bodyText,
|
|
115
|
+
variant = {},
|
|
116
|
+
confirmButtonText,
|
|
117
|
+
confirmButtonVariant,
|
|
118
|
+
cancelButtonText,
|
|
119
|
+
cancelButtonType,
|
|
108
120
|
...rest
|
|
109
121
|
} = _ref5;
|
|
110
122
|
const viewport = useViewport();
|
|
@@ -121,23 +133,19 @@ const Modal = /*#__PURE__*/forwardRef((_ref5, ref) => {
|
|
|
121
133
|
copy
|
|
122
134
|
});
|
|
123
135
|
const closeLabel = getCopy('closeButton');
|
|
124
|
-
|
|
125
136
|
const handleClose = () => {
|
|
126
137
|
if (typeof onClose === 'function') onClose();
|
|
127
138
|
};
|
|
128
|
-
|
|
129
139
|
const handleKeyUp = event => {
|
|
130
140
|
if (event.key === 'Escape') onClose();
|
|
131
|
-
};
|
|
132
|
-
// Hide the close button if `closeButton` is `null`.
|
|
133
|
-
|
|
141
|
+
};
|
|
134
142
|
|
|
143
|
+
// Show the custom react node passed to `closedButton` or the default close button if `closeButton` is `undefined`.
|
|
144
|
+
// Hide the close button if `closeButton` is `null`.
|
|
135
145
|
const showCloseButton = closeButton !== null;
|
|
136
|
-
|
|
137
146
|
if (!isOpen) {
|
|
138
147
|
return null;
|
|
139
148
|
}
|
|
140
|
-
|
|
141
149
|
return /*#__PURE__*/_jsx(NativeModal, {
|
|
142
150
|
transparent: true,
|
|
143
151
|
...selectProps(rest),
|
|
@@ -160,7 +168,27 @@ const Modal = /*#__PURE__*/forwardRef((_ref5, ref) => {
|
|
|
160
168
|
accessibilityRole: "button",
|
|
161
169
|
accessibilityLabel: closeLabel
|
|
162
170
|
})
|
|
163
|
-
}),
|
|
171
|
+
}), /*#__PURE__*/_jsx(ModalContent, {
|
|
172
|
+
tokens: tokens,
|
|
173
|
+
variant: variant,
|
|
174
|
+
onCancel: onCancel,
|
|
175
|
+
onConfirm: onConfirm,
|
|
176
|
+
heading: heading,
|
|
177
|
+
headingLevel: headingLevel,
|
|
178
|
+
subHeading: subHeading,
|
|
179
|
+
subHeadingSize: subHeadingSize,
|
|
180
|
+
bodyText: bodyText,
|
|
181
|
+
confirmButtonText: confirmButtonText,
|
|
182
|
+
confirmButtonVariant: confirmButtonVariant,
|
|
183
|
+
cancelButtonText: cancelButtonText,
|
|
184
|
+
cancelButtonType: cancelButtonType,
|
|
185
|
+
children: Platform !== 'web' ? /*#__PURE__*/_jsx(ScrollView, {
|
|
186
|
+
style: selectScrollViewStyles,
|
|
187
|
+
children: children
|
|
188
|
+
}) : {
|
|
189
|
+
children
|
|
190
|
+
}
|
|
191
|
+
})]
|
|
164
192
|
})
|
|
165
193
|
}), /*#__PURE__*/_jsx(TouchableWithoutFeedback, {
|
|
166
194
|
onPress: handleClose,
|
|
@@ -172,35 +200,76 @@ const Modal = /*#__PURE__*/forwardRef((_ref5, ref) => {
|
|
|
172
200
|
});
|
|
173
201
|
});
|
|
174
202
|
Modal.displayName = 'Modal';
|
|
175
|
-
Modal.propTypes = {
|
|
203
|
+
Modal.propTypes = {
|
|
204
|
+
...selectedSystemPropTypes,
|
|
176
205
|
children: PropTypes.oneOfType([PropTypes.node, PropTypes.arrayOf(PropTypes.node)]),
|
|
177
|
-
|
|
178
206
|
/**
|
|
179
207
|
* To define the locale of the copy
|
|
180
208
|
*/
|
|
181
209
|
copy: copyPropTypes,
|
|
182
|
-
|
|
183
210
|
/**
|
|
184
211
|
* Setting this to `true` will open the `Modal`
|
|
185
212
|
*/
|
|
186
213
|
isOpen: PropTypes.bool,
|
|
187
|
-
|
|
188
214
|
/**
|
|
189
215
|
* This function is triggered when the `Modal` is closed
|
|
190
216
|
*/
|
|
191
217
|
onClose: PropTypes.func,
|
|
192
|
-
|
|
193
218
|
/**
|
|
194
219
|
* `max-width` is applied to the `Modal` container
|
|
195
220
|
*/
|
|
196
221
|
maxWidth: PropTypes.bool,
|
|
197
222
|
tokens: getTokensPropType('Modal'),
|
|
198
223
|
variant: variantProp.propType,
|
|
199
|
-
|
|
200
224
|
/**
|
|
201
225
|
* Pass a react node to override the default close button or pass `null` to hide the close button.
|
|
202
226
|
*/
|
|
203
|
-
closeButton: PropTypes.node
|
|
227
|
+
closeButton: PropTypes.node,
|
|
228
|
+
/**
|
|
229
|
+
* Receive a string to set the heading of the modal.
|
|
230
|
+
*/
|
|
231
|
+
heading: PropTypes.string,
|
|
232
|
+
/**
|
|
233
|
+
* Receive h3 or h4 to define the level of the heading.
|
|
234
|
+
*/
|
|
235
|
+
headingLevel: PropTypes.oneOf(['h3', 'h4']),
|
|
236
|
+
/**
|
|
237
|
+
* Receive a string to set the sub heading of the modal.
|
|
238
|
+
*/
|
|
239
|
+
subHeading: PropTypes.string,
|
|
240
|
+
/**
|
|
241
|
+
* Receive small, medium or large to set the size of the sub heading.
|
|
242
|
+
*/
|
|
243
|
+
subHeadingSize: PropTypes.oneOf(['small', 'medium', 'large']),
|
|
244
|
+
/**
|
|
245
|
+
* Receive a string to set the bodyText of the modal.
|
|
246
|
+
*/
|
|
247
|
+
bodyText: PropTypes.string,
|
|
248
|
+
/**
|
|
249
|
+
* Receive a string text for the confirm button.
|
|
250
|
+
*/
|
|
251
|
+
confirmButtonText: PropTypes.string,
|
|
252
|
+
/**
|
|
253
|
+
* Receives a variant of button for the confirm button.
|
|
254
|
+
*/
|
|
255
|
+
confirmButtonVariant: PropTypes.object,
|
|
256
|
+
/**
|
|
257
|
+
* Receive a function for the onConfirm event in the confirm button.
|
|
258
|
+
*/
|
|
259
|
+
onConfirm: PropTypes.func,
|
|
260
|
+
/**
|
|
261
|
+
* Receive a string text for the cancel button.
|
|
262
|
+
*/
|
|
263
|
+
cancelButtonText: PropTypes.string,
|
|
264
|
+
/**
|
|
265
|
+
* Receives a variant of button for the cancel button.
|
|
266
|
+
*/
|
|
267
|
+
cancelButtonType: PropTypes.elementType,
|
|
268
|
+
// TODO: figure out a way of passing an icon to the TextButton
|
|
269
|
+
/**
|
|
270
|
+
* Receive a function for the onCancel event in the cancel button.
|
|
271
|
+
*/
|
|
272
|
+
onCancel: PropTypes.func
|
|
204
273
|
};
|
|
205
274
|
export default Modal;
|
|
206
275
|
const staticStyles = StyleSheet.create({
|
|
@@ -226,8 +295,8 @@ const staticStyles = StyleSheet.create({
|
|
|
226
295
|
maxHeight: '100%',
|
|
227
296
|
// so that the container can expand up to the full viewport height
|
|
228
297
|
width: '100%' // ensure that the modal actually expands to the set maxWidth
|
|
229
|
-
|
|
230
298
|
},
|
|
299
|
+
|
|
231
300
|
modal: {
|
|
232
301
|
maxHeight: '100%',
|
|
233
302
|
// so that the modal can expand vertically up to the sizing container's height (exclusive of its vertical padding)
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import View from "react-native-web/dist/exports/View";
|
|
3
|
+
import StyleSheet from "react-native-web/dist/exports/StyleSheet";
|
|
4
|
+
import Platform from "react-native-web/dist/exports/Platform";
|
|
5
|
+
import PropTypes from 'prop-types';
|
|
6
|
+
import Box from '../Box';
|
|
7
|
+
import { Button } from '../Button';
|
|
8
|
+
import { TextButton } from '../Link';
|
|
9
|
+
import Spacer from '../Spacer';
|
|
10
|
+
import Typography from '../Typography';
|
|
11
|
+
import { useThemeTokens } from '../ThemeProvider';
|
|
12
|
+
import { useViewport } from '../ViewportProvider';
|
|
13
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
15
|
+
const ModalContent = _ref => {
|
|
16
|
+
let {
|
|
17
|
+
heading,
|
|
18
|
+
headingLevel = 'h3',
|
|
19
|
+
subHeading,
|
|
20
|
+
subHeadingSize = 'medium',
|
|
21
|
+
bodyText,
|
|
22
|
+
confirmButtonText,
|
|
23
|
+
confirmButtonVariant = {
|
|
24
|
+
priority: 'high'
|
|
25
|
+
},
|
|
26
|
+
onConfirm,
|
|
27
|
+
tokens,
|
|
28
|
+
variant,
|
|
29
|
+
cancelButtonText,
|
|
30
|
+
cancelButtonType: CancelButton = TextButton,
|
|
31
|
+
children,
|
|
32
|
+
onCancel
|
|
33
|
+
} = _ref;
|
|
34
|
+
const {
|
|
35
|
+
headingColor,
|
|
36
|
+
cancelButtonColor,
|
|
37
|
+
...themeTokens
|
|
38
|
+
} = useThemeTokens('Modal', tokens, variant);
|
|
39
|
+
const [scrollContainerHeight, setScrollContainerHeight] = useState(0);
|
|
40
|
+
const [scrollContentHeight, setScrollContentHeight] = useState(0);
|
|
41
|
+
const viewport = useViewport();
|
|
42
|
+
const handleContainerLayout = _ref2 => {
|
|
43
|
+
let {
|
|
44
|
+
nativeEvent: {
|
|
45
|
+
layout: {
|
|
46
|
+
height
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
} = _ref2;
|
|
50
|
+
return setScrollContainerHeight(height);
|
|
51
|
+
};
|
|
52
|
+
const onContentSizeChange = (_, height) => setScrollContentHeight(height);
|
|
53
|
+
const isContentOverflowing = scrollContentHeight > scrollContainerHeight;
|
|
54
|
+
const hasConfirmButton = confirmButtonText !== undefined && onConfirm !== undefined;
|
|
55
|
+
const hasCancelButton = cancelButtonText !== undefined && onCancel !== undefined;
|
|
56
|
+
const hasHeadingSection = Boolean(heading || subHeading);
|
|
57
|
+
const selectFooterContainerStyles = _ref3 => {
|
|
58
|
+
let {
|
|
59
|
+
paddingLeft,
|
|
60
|
+
paddingRight,
|
|
61
|
+
paddingTop,
|
|
62
|
+
marginLeft,
|
|
63
|
+
marginRight,
|
|
64
|
+
borderColor,
|
|
65
|
+
gap,
|
|
66
|
+
direction,
|
|
67
|
+
hasBorder
|
|
68
|
+
} = _ref3;
|
|
69
|
+
return {
|
|
70
|
+
flexDirection: direction,
|
|
71
|
+
alignItems: 'center',
|
|
72
|
+
gap,
|
|
73
|
+
marginLeft: -marginLeft,
|
|
74
|
+
marginRight: -marginRight,
|
|
75
|
+
paddingLeft,
|
|
76
|
+
paddingRight,
|
|
77
|
+
paddingTop,
|
|
78
|
+
borderTopColor: hasBorder ? borderColor : 'transparent',
|
|
79
|
+
borderTopWidth: hasBorder ? 1 : 0
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
const headingStyles = {
|
|
83
|
+
flexDirection: 'column',
|
|
84
|
+
paddingTop: 8,
|
|
85
|
+
paddingRight: themeTokens.headingPaddingRight
|
|
86
|
+
};
|
|
87
|
+
const subheadingStyles = {
|
|
88
|
+
marginTop: themeTokens.subHeadingMarginTop
|
|
89
|
+
};
|
|
90
|
+
return /*#__PURE__*/_jsxs(View, {
|
|
91
|
+
style: styles.modalContent,
|
|
92
|
+
children: [hasHeadingSection && /*#__PURE__*/_jsxs(View, {
|
|
93
|
+
style: headingStyles,
|
|
94
|
+
children: [heading && /*#__PURE__*/_jsx(Typography, {
|
|
95
|
+
variant: {
|
|
96
|
+
size: headingLevel
|
|
97
|
+
},
|
|
98
|
+
tokens: {
|
|
99
|
+
color: headingColor
|
|
100
|
+
},
|
|
101
|
+
heading: headingLevel,
|
|
102
|
+
children: heading
|
|
103
|
+
}), subHeading && /*#__PURE__*/_jsx(View, {
|
|
104
|
+
style: subheadingStyles,
|
|
105
|
+
children: /*#__PURE__*/_jsx(Typography, {
|
|
106
|
+
variant: {
|
|
107
|
+
size: subHeadingSize
|
|
108
|
+
},
|
|
109
|
+
children: subHeading
|
|
110
|
+
})
|
|
111
|
+
}), Boolean(bodyText && hasHeadingSection) && /*#__PURE__*/_jsx(Spacer, {
|
|
112
|
+
space: 3
|
|
113
|
+
})]
|
|
114
|
+
}), bodyText && /*#__PURE__*/_jsx(Box, {
|
|
115
|
+
scroll: {
|
|
116
|
+
onContentSizeChange,
|
|
117
|
+
showsVerticalScrollIndicator: true
|
|
118
|
+
},
|
|
119
|
+
onLayout: handleContainerLayout,
|
|
120
|
+
children: /*#__PURE__*/_jsx(Typography, {
|
|
121
|
+
children: bodyText
|
|
122
|
+
})
|
|
123
|
+
}), children, (hasConfirmButton || hasCancelButton) && /*#__PURE__*/_jsxs(View, {
|
|
124
|
+
style: [selectFooterContainerStyles({
|
|
125
|
+
...themeTokens,
|
|
126
|
+
hasBorder: isContentOverflowing
|
|
127
|
+
})],
|
|
128
|
+
children: [hasConfirmButton && /*#__PURE__*/_jsx(Button, {
|
|
129
|
+
variant: confirmButtonVariant,
|
|
130
|
+
tokens: {
|
|
131
|
+
width: viewport === 'xs' || viewport === 'sm' ? '100%' : undefined
|
|
132
|
+
},
|
|
133
|
+
onPress: onConfirm,
|
|
134
|
+
children: confirmButtonText
|
|
135
|
+
}), hasCancelButton ? /*#__PURE__*/_jsx(View, {
|
|
136
|
+
style: styles.styledTextButtonContainer,
|
|
137
|
+
children: /*#__PURE__*/_jsx(CancelButton, {
|
|
138
|
+
tokens: {
|
|
139
|
+
color: cancelButtonColor
|
|
140
|
+
},
|
|
141
|
+
onPress: onCancel,
|
|
142
|
+
children: cancelButtonText
|
|
143
|
+
})
|
|
144
|
+
}) : null]
|
|
145
|
+
})]
|
|
146
|
+
});
|
|
147
|
+
};
|
|
148
|
+
const styles = StyleSheet.create({
|
|
149
|
+
modalContent: {
|
|
150
|
+
flex: 1,
|
|
151
|
+
flexDirection: 'column',
|
|
152
|
+
minHeight: Platform.OS === 'web' ? '100%' : 'auto'
|
|
153
|
+
},
|
|
154
|
+
styledTextButtonContainer: {
|
|
155
|
+
flex: 1
|
|
156
|
+
}
|
|
157
|
+
});
|
|
158
|
+
ModalContent.propTypes = {
|
|
159
|
+
tokens: PropTypes.object,
|
|
160
|
+
variant: PropTypes.object,
|
|
161
|
+
heading: PropTypes.string,
|
|
162
|
+
headingLevel: PropTypes.oneOf(['h3', 'h4']),
|
|
163
|
+
subHeading: PropTypes.string,
|
|
164
|
+
subHeadingSize: PropTypes.oneOf(['small', 'medium', 'large']),
|
|
165
|
+
bodyText: PropTypes.string,
|
|
166
|
+
confirmButtonText: PropTypes.string,
|
|
167
|
+
confirmButtonVariant: PropTypes.object,
|
|
168
|
+
onConfirm: PropTypes.func,
|
|
169
|
+
cancelButtonText: PropTypes.string,
|
|
170
|
+
cancelButtonType: PropTypes.elementType,
|
|
171
|
+
// TODO: figure out a way of passing an icon to the TextButton
|
|
172
|
+
children: PropTypes.node,
|
|
173
|
+
onCancel: PropTypes.func
|
|
174
|
+
};
|
|
175
|
+
export default ModalContent;
|
|
@@ -17,8 +17,8 @@ const staticStyles = StyleSheet.create({
|
|
|
17
17
|
// Grow to maxWidth when possible, shrink when not possible
|
|
18
18
|
position: 'absolute',
|
|
19
19
|
zIndex: 10000 // Position on top of all the other overlays, including backdrops and modals
|
|
20
|
-
|
|
21
20
|
},
|
|
21
|
+
|
|
22
22
|
closeButtonContainer: {
|
|
23
23
|
position: 'absolute',
|
|
24
24
|
top: 0,
|
|
@@ -31,7 +31,6 @@ const staticStyles = StyleSheet.create({
|
|
|
31
31
|
opacity: 0
|
|
32
32
|
}
|
|
33
33
|
});
|
|
34
|
-
|
|
35
34
|
const selectCloseButtonContainerStyles = _ref => {
|
|
36
35
|
let {
|
|
37
36
|
paddingRight,
|
|
@@ -42,7 +41,6 @@ const selectCloseButtonContainerStyles = _ref => {
|
|
|
42
41
|
paddingTop
|
|
43
42
|
};
|
|
44
43
|
};
|
|
45
|
-
|
|
46
44
|
const selectPaddingContainerStyles = _ref2 => {
|
|
47
45
|
let {
|
|
48
46
|
paddingTop,
|
|
@@ -56,7 +54,6 @@ const selectPaddingContainerStyles = _ref2 => {
|
|
|
56
54
|
paddingRight
|
|
57
55
|
};
|
|
58
56
|
};
|
|
59
|
-
|
|
60
57
|
const ModalOverlay = /*#__PURE__*/forwardRef((_ref3, ref) => {
|
|
61
58
|
let {
|
|
62
59
|
children,
|