@telus-uds/components-base 1.83.0 → 1.85.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 +36 -2
- package/lib/A11yInfoProvider/index.js +8 -10
- package/lib/A11yText/index.js +2 -4
- package/lib/ActivityIndicator/Spinner.js +3 -4
- package/lib/ActivityIndicator/Spinner.native.js +2 -4
- package/lib/Autocomplete/Autocomplete.js +13 -17
- package/lib/Autocomplete/Loading.js +4 -2
- package/lib/Autocomplete/Suggestions.js +2 -4
- package/lib/Badge/Badge.js +2 -4
- package/lib/BaseProvider/HydrationContext.js +5 -7
- package/lib/Box/Box.js +5 -7
- package/lib/Button/Button.js +3 -3
- package/lib/Button/ButtonBase.js +2 -7
- package/lib/Button/ButtonDropdown.js +3 -3
- package/lib/Button/ButtonGroup.js +11 -4
- package/lib/Button/ButtonLink.js +3 -3
- package/lib/Card/Card.js +159 -16
- package/lib/Card/CardBase.js +2 -4
- package/lib/Card/PressableCardBase.js +3 -5
- package/lib/CardGroup/CardGroup.js +220 -0
- package/lib/CardGroup/dictionary.js +15 -0
- package/lib/CardGroup/index.js +10 -0
- package/lib/Carousel/Carousel.js +308 -129
- package/lib/Carousel/CarouselFirstFocus/CarouselFirstFocus.js +2 -4
- package/lib/Carousel/CarouselItem/CarouselItem.js +3 -2
- package/lib/Carousel/CarouselStepTracker/CarouselStepTracker.js +4 -2
- package/lib/Carousel/CarouselTabs/CarouselTabs.js +2 -4
- package/lib/Carousel/CarouselTabs/CarouselTabsPanel.js +6 -8
- package/lib/Carousel/CarouselTabs/CarouselTabsPanelItem.js +3 -5
- package/lib/Carousel/CarouselThumbnail.js +4 -2
- package/lib/Carousel/CarouselThumbnailNavigation.js +2 -4
- package/lib/Checkbox/Checkbox.js +2 -4
- package/lib/Checkbox/CheckboxButton.js +3 -5
- package/lib/Checkbox/CheckboxGroup.js +2 -4
- package/lib/Checkbox/CheckboxInput.js +4 -14
- package/lib/CheckboxCard/CheckboxCard.js +3 -3
- package/lib/CheckboxCardGroup/CheckboxCardGroup.js +3 -3
- package/lib/ColourToggle/ColourBubble.js +5 -6
- package/lib/ColourToggle/ColourToggle.js +3 -5
- package/lib/Divider/Divider.js +2 -4
- package/lib/ExpandCollapse/Accordion.js +2 -4
- package/lib/ExpandCollapse/Control.js +2 -4
- package/lib/ExpandCollapse/ExpandCollapse.js +20 -13
- package/lib/ExpandCollapse/Panel.js +15 -5
- package/lib/ExpandCollapse/dictionary.js +17 -0
- package/lib/Feedback/Feedback.js +2 -4
- package/lib/Fieldset/Fieldset.js +2 -4
- package/lib/Fieldset/FieldsetContainer.js +2 -4
- package/lib/Fieldset/FieldsetContainer.native.js +2 -4
- package/lib/Fieldset/Legend.js +2 -4
- package/lib/Fieldset/Legend.native.js +2 -4
- package/lib/FlexGrid/Col/Col.js +3 -5
- package/lib/FlexGrid/FlexGrid.js +2 -4
- package/lib/FlexGrid/Row/Row.js +2 -4
- package/lib/Footnote/Footnote.js +9 -9
- package/lib/Footnote/FootnoteLink.js +5 -3
- package/lib/HorizontalScroll/HorizontalScroll.js +8 -10
- package/lib/HorizontalScroll/HorizontalScrollButton.js +2 -4
- package/lib/HorizontalScroll/ScrollViewEnd.js +5 -10
- package/lib/HorizontalScroll/ScrollViewEnd.native.js +2 -4
- package/lib/Icon/Icon.js +2 -4
- package/lib/Icon/IconText.js +6 -6
- package/lib/IconButton/IconButton.js +2 -4
- package/lib/InputLabel/InputLabel.js +2 -4
- package/lib/InputLabel/LabelContent.js +2 -4
- package/lib/InputLabel/LabelContent.native.js +2 -4
- package/lib/InputSupports/InputSupports.js +4 -5
- package/lib/Link/ChevronLink.js +2 -4
- package/lib/Link/InlinePressable.js +8 -7
- package/lib/Link/InlinePressable.native.js +10 -8
- package/lib/Link/Link.js +2 -4
- package/lib/Link/LinkBase.js +2 -4
- package/lib/Link/TextButton.js +2 -4
- package/lib/List/List.js +13 -11
- package/lib/List/ListItem.js +2 -4
- package/lib/List/ListItemBase.js +6 -10
- package/lib/List/ListItemContent.js +4 -2
- package/lib/List/ListItemMark.js +4 -2
- package/lib/List/PressableListItemBase.js +2 -4
- package/lib/Listbox/GroupControl.js +4 -2
- package/lib/Listbox/Listbox.js +6 -6
- package/lib/Listbox/ListboxContext.js +3 -4
- package/lib/Listbox/ListboxGroup.js +2 -4
- package/lib/Listbox/ListboxItem.js +2 -6
- package/lib/Listbox/ListboxOverlay.js +2 -6
- package/lib/Listbox/PressableItem.js +2 -6
- package/lib/Modal/Modal.js +5 -7
- package/lib/Modal/ModalContent.js +7 -7
- package/lib/Modal/WebModal.js +19 -10
- package/lib/MultiSelectFilter/ModalOverlay.js +2 -4
- package/lib/MultiSelectFilter/MultiSelectFilter.js +10 -10
- package/lib/Notification/Notification.js +5 -7
- package/lib/OrderedList/Item.js +4 -10
- package/lib/OrderedList/ItemBase.js +2 -4
- package/lib/OrderedList/OrderedList.js +5 -13
- package/lib/OrderedList/OrderedListBase.js +2 -4
- package/lib/Pagination/PageButton.js +1 -1
- package/lib/Pagination/Pagination.js +1 -1
- package/lib/Pagination/SideButton.js +2 -4
- package/lib/PriceLockup/PriceLockup.js +5 -5
- package/lib/ProductCard/ProductCard.js +3 -2
- package/lib/ProductCardGroup/ProductCardGroup.js +5 -6
- package/lib/Progress/Progress.js +2 -4
- package/lib/Progress/ProgressBar.js +2 -4
- package/lib/Progress/ProgressBarBackground.js +2 -4
- package/lib/QuickLinks/QuickLinks.js +2 -4
- package/lib/QuickLinks/QuickLinksCard.js +4 -2
- package/lib/QuickLinks/QuickLinksItem.js +2 -4
- package/lib/QuickLinksFeature/QuickLinksFeature.js +9 -7
- package/lib/QuickLinksFeature/QuickLinksFeatureItem.js +10 -12
- package/lib/Radio/Radio.js +3 -3
- package/lib/Radio/RadioButton.js +61 -15
- package/lib/Radio/RadioGroup.js +2 -4
- package/lib/Radio/RadioInput.js +6 -18
- package/lib/RadioCard/RadioCard.js +3 -3
- package/lib/RadioCard/RadioCardGroup.js +3 -3
- package/lib/Responsive/Responsive.js +3 -2
- package/lib/Responsive/ResponsiveWithMediaQueryStyleSheet.js +3 -2
- package/lib/Search/Search.js +2 -4
- package/lib/Select/Group.js +4 -2
- package/lib/Select/Item.js +4 -2
- package/lib/Select/Picker.js +2 -4
- package/lib/Select/Picker.native.js +3 -5
- package/lib/Select/Select.js +4 -6
- package/lib/SideNav/Item.js +2 -4
- package/lib/SideNav/ItemContent.js +4 -2
- package/lib/SideNav/ItemsGroup.js +2 -4
- package/lib/SideNav/SideNav.js +2 -2
- package/lib/Skeleton/Skeleton.js +2 -4
- package/lib/SkipLink/SkipLink.js +2 -4
- package/lib/Spacer/Spacer.js +2 -4
- package/lib/StackView/StackView.js +2 -4
- package/lib/StackView/StackWrap.js +3 -5
- package/lib/StackView/StackWrapBox.js +2 -4
- package/lib/StackView/StackWrapGap.js +2 -4
- package/lib/StackView/getStackedContent.js +3 -3
- package/lib/StepTracker/Step.js +4 -2
- package/lib/StepTracker/StepTracker.js +2 -4
- package/lib/Tabs/Tabs.js +4 -4
- package/lib/Tabs/TabsItem.js +3 -5
- package/lib/Tags/Tags.js +2 -4
- package/lib/TextInput/TextArea.js +3 -5
- package/lib/TextInput/TextInput.js +2 -4
- package/lib/TextInput/TextInputBase.js +7 -9
- package/lib/ThemeProvider/ThemeProvider.js +5 -7
- package/lib/Timeline/Timeline.js +2 -4
- package/lib/ToggleSwitch/ToggleSwitch.js +2 -4
- package/lib/ToggleSwitch/ToggleSwitchGroup.js +2 -4
- package/lib/Tooltip/Tooltip.js +6 -8
- package/lib/Tooltip/Tooltip.native.js +12 -14
- package/lib/TooltipButton/TooltipButton.js +4 -2
- package/lib/Typography/Typography.js +2 -4
- package/lib/Validator/Validator.js +11 -13
- package/lib/ViewportProvider/ViewportProvider.js +2 -4
- package/lib/index.js +8 -0
- package/lib/utils/BaseView/BaseView.js +2 -4
- package/lib/utils/children.js +4 -6
- package/lib/utils/withLinkRouter.js +3 -5
- package/lib-module/A11yInfoProvider/index.js +8 -8
- package/lib-module/A11yText/index.js +2 -2
- package/lib-module/ActivityIndicator/Spinner.js +2 -2
- package/lib-module/ActivityIndicator/Spinner.native.js +2 -2
- package/lib-module/Autocomplete/Autocomplete.js +13 -14
- package/lib-module/Autocomplete/Loading.js +4 -2
- package/lib-module/Autocomplete/Suggestions.js +2 -2
- package/lib-module/Badge/Badge.js +2 -2
- package/lib-module/BaseProvider/HydrationContext.js +5 -5
- package/lib-module/Box/Box.js +5 -5
- package/lib-module/Button/Button.js +2 -2
- package/lib-module/Button/ButtonBase.js +2 -5
- package/lib-module/Button/ButtonDropdown.js +2 -2
- package/lib-module/Button/ButtonGroup.js +11 -2
- package/lib-module/Button/ButtonLink.js +2 -2
- package/lib-module/Card/Card.js +159 -14
- package/lib-module/Card/CardBase.js +2 -2
- package/lib-module/Card/PressableCardBase.js +4 -4
- package/lib-module/CardGroup/CardGroup.js +210 -0
- package/lib-module/CardGroup/dictionary.js +8 -0
- package/lib-module/CardGroup/index.js +2 -0
- package/lib-module/Carousel/Carousel.js +308 -129
- package/lib-module/Carousel/CarouselFirstFocus/CarouselFirstFocus.js +2 -2
- package/lib-module/Carousel/CarouselItem/CarouselItem.js +3 -2
- package/lib-module/Carousel/CarouselStepTracker/CarouselStepTracker.js +4 -2
- package/lib-module/Carousel/CarouselTabs/CarouselTabs.js +2 -2
- package/lib-module/Carousel/CarouselTabs/CarouselTabsPanel.js +6 -6
- package/lib-module/Carousel/CarouselTabs/CarouselTabsPanelItem.js +3 -3
- package/lib-module/Carousel/CarouselThumbnail.js +4 -2
- package/lib-module/Carousel/CarouselThumbnailNavigation.js +2 -2
- package/lib-module/Checkbox/Checkbox.js +2 -2
- package/lib-module/Checkbox/CheckboxButton.js +3 -3
- package/lib-module/Checkbox/CheckboxGroup.js +2 -2
- package/lib-module/Checkbox/CheckboxInput.js +4 -12
- package/lib-module/CheckboxCard/CheckboxCard.js +2 -2
- package/lib-module/CheckboxCardGroup/CheckboxCardGroup.js +2 -2
- package/lib-module/ColourToggle/ColourBubble.js +5 -4
- package/lib-module/ColourToggle/ColourToggle.js +3 -3
- package/lib-module/Divider/Divider.js +2 -2
- package/lib-module/ExpandCollapse/Accordion.js +2 -2
- package/lib-module/ExpandCollapse/Control.js +2 -2
- package/lib-module/ExpandCollapse/ExpandCollapse.js +20 -11
- package/lib-module/ExpandCollapse/Panel.js +16 -4
- package/lib-module/ExpandCollapse/dictionary.js +10 -0
- package/lib-module/Feedback/Feedback.js +2 -2
- package/lib-module/Fieldset/Fieldset.js +2 -2
- package/lib-module/Fieldset/FieldsetContainer.js +2 -2
- package/lib-module/Fieldset/FieldsetContainer.native.js +2 -2
- package/lib-module/Fieldset/Legend.js +2 -2
- package/lib-module/Fieldset/Legend.native.js +2 -2
- package/lib-module/FlexGrid/Col/Col.js +3 -3
- package/lib-module/FlexGrid/FlexGrid.js +2 -2
- package/lib-module/FlexGrid/Row/Row.js +2 -2
- package/lib-module/Footnote/Footnote.js +9 -7
- package/lib-module/Footnote/FootnoteLink.js +5 -4
- package/lib-module/HorizontalScroll/HorizontalScroll.js +8 -8
- package/lib-module/HorizontalScroll/HorizontalScrollButton.js +2 -2
- package/lib-module/HorizontalScroll/ScrollViewEnd.js +5 -8
- package/lib-module/HorizontalScroll/ScrollViewEnd.native.js +2 -2
- package/lib-module/Icon/Icon.js +2 -2
- package/lib-module/Icon/IconText.js +5 -5
- package/lib-module/IconButton/IconButton.js +2 -2
- package/lib-module/InputLabel/InputLabel.js +2 -2
- package/lib-module/InputLabel/LabelContent.js +2 -2
- package/lib-module/InputLabel/LabelContent.native.js +2 -2
- package/lib-module/InputSupports/InputSupports.js +4 -3
- package/lib-module/Link/ChevronLink.js +2 -2
- package/lib-module/Link/InlinePressable.js +10 -4
- package/lib-module/Link/InlinePressable.native.js +12 -6
- package/lib-module/Link/Link.js +2 -2
- package/lib-module/Link/LinkBase.js +2 -2
- package/lib-module/Link/TextButton.js +2 -2
- package/lib-module/List/List.js +13 -9
- package/lib-module/List/ListItem.js +2 -2
- package/lib-module/List/ListItemBase.js +6 -8
- package/lib-module/List/ListItemContent.js +4 -2
- package/lib-module/List/ListItemMark.js +4 -2
- package/lib-module/List/PressableListItemBase.js +2 -2
- package/lib-module/Listbox/GroupControl.js +4 -2
- package/lib-module/Listbox/Listbox.js +7 -7
- package/lib-module/Listbox/ListboxContext.js +2 -2
- package/lib-module/Listbox/ListboxGroup.js +2 -2
- package/lib-module/Listbox/ListboxItem.js +2 -3
- package/lib-module/Listbox/ListboxOverlay.js +2 -3
- package/lib-module/Listbox/PressableItem.js +2 -3
- package/lib-module/Modal/Modal.js +5 -5
- package/lib-module/Modal/ModalContent.js +7 -5
- package/lib-module/Modal/WebModal.js +19 -10
- package/lib-module/MultiSelectFilter/ModalOverlay.js +2 -2
- package/lib-module/MultiSelectFilter/MultiSelectFilter.js +10 -8
- package/lib-module/Notification/Notification.js +5 -5
- package/lib-module/OrderedList/Item.js +4 -8
- package/lib-module/OrderedList/ItemBase.js +2 -2
- package/lib-module/OrderedList/OrderedList.js +6 -12
- package/lib-module/OrderedList/OrderedListBase.js +2 -2
- package/lib-module/Pagination/PageButton.js +2 -2
- package/lib-module/Pagination/Pagination.js +2 -2
- package/lib-module/Pagination/SideButton.js +2 -2
- package/lib-module/PriceLockup/PriceLockup.js +5 -5
- package/lib-module/ProductCard/ProductCard.js +3 -2
- package/lib-module/ProductCardGroup/ProductCardGroup.js +5 -4
- package/lib-module/Progress/Progress.js +2 -2
- package/lib-module/Progress/ProgressBar.js +2 -2
- package/lib-module/Progress/ProgressBarBackground.js +2 -2
- package/lib-module/QuickLinks/QuickLinks.js +2 -2
- package/lib-module/QuickLinks/QuickLinksCard.js +4 -2
- package/lib-module/QuickLinks/QuickLinksItem.js +2 -2
- package/lib-module/QuickLinksFeature/QuickLinksFeature.js +9 -5
- package/lib-module/QuickLinksFeature/QuickLinksFeatureItem.js +10 -10
- package/lib-module/Radio/Radio.js +2 -2
- package/lib-module/Radio/RadioButton.js +62 -14
- package/lib-module/Radio/RadioGroup.js +2 -2
- package/lib-module/Radio/RadioInput.js +6 -16
- package/lib-module/RadioCard/RadioCard.js +2 -2
- package/lib-module/RadioCard/RadioCardGroup.js +2 -2
- package/lib-module/Responsive/Responsive.js +3 -2
- package/lib-module/Responsive/ResponsiveWithMediaQueryStyleSheet.js +3 -2
- package/lib-module/Search/Search.js +2 -2
- package/lib-module/Select/Group.js +4 -2
- package/lib-module/Select/Item.js +4 -2
- package/lib-module/Select/Picker.js +2 -2
- package/lib-module/Select/Picker.native.js +3 -3
- package/lib-module/Select/Select.js +4 -4
- package/lib-module/SideNav/Item.js +2 -2
- package/lib-module/SideNav/ItemContent.js +4 -2
- package/lib-module/SideNav/ItemsGroup.js +2 -2
- package/lib-module/SideNav/SideNav.js +3 -3
- package/lib-module/Skeleton/Skeleton.js +2 -2
- package/lib-module/SkipLink/SkipLink.js +2 -2
- package/lib-module/Spacer/Spacer.js +2 -2
- package/lib-module/StackView/StackView.js +2 -2
- package/lib-module/StackView/StackWrap.js +3 -3
- package/lib-module/StackView/StackWrapBox.js +2 -2
- package/lib-module/StackView/StackWrapGap.js +2 -2
- package/lib-module/StackView/getStackedContent.js +4 -4
- package/lib-module/StepTracker/Step.js +4 -2
- package/lib-module/StepTracker/StepTracker.js +2 -2
- package/lib-module/Tabs/Tabs.js +3 -3
- package/lib-module/Tabs/TabsItem.js +3 -3
- package/lib-module/Tags/Tags.js +2 -2
- package/lib-module/TextInput/TextArea.js +3 -3
- package/lib-module/TextInput/TextInput.js +2 -2
- package/lib-module/TextInput/TextInputBase.js +7 -7
- package/lib-module/ThemeProvider/ThemeProvider.js +5 -5
- package/lib-module/Timeline/Timeline.js +2 -2
- package/lib-module/ToggleSwitch/ToggleSwitch.js +2 -2
- package/lib-module/ToggleSwitch/ToggleSwitchGroup.js +2 -2
- package/lib-module/Tooltip/Tooltip.js +6 -6
- package/lib-module/Tooltip/Tooltip.native.js +12 -12
- package/lib-module/TooltipButton/TooltipButton.js +4 -2
- package/lib-module/Typography/Typography.js +2 -2
- package/lib-module/Validator/Validator.js +11 -11
- package/lib-module/ViewportProvider/ViewportProvider.js +2 -2
- package/lib-module/index.js +1 -0
- package/lib-module/utils/BaseView/BaseView.js +2 -2
- package/lib-module/utils/children.js +4 -4
- package/lib-module/utils/withLinkRouter.js +3 -3
- package/package.json +2 -2
- package/src/A11yInfoProvider/index.jsx +8 -8
- package/src/A11yText/index.jsx +2 -2
- package/src/ActivityIndicator/Spinner.jsx +2 -2
- package/src/ActivityIndicator/Spinner.native.jsx +2 -2
- package/src/Autocomplete/Autocomplete.jsx +15 -14
- package/src/Autocomplete/Loading.jsx +6 -3
- package/src/Autocomplete/Suggestions.jsx +2 -2
- package/src/Badge/Badge.jsx +2 -2
- package/src/BaseProvider/HydrationContext.jsx +5 -5
- package/src/Box/Box.jsx +5 -5
- package/src/Button/Button.jsx +11 -9
- package/src/Button/ButtonBase.jsx +2 -3
- package/src/Button/ButtonDropdown.jsx +2 -2
- package/src/Button/ButtonGroup.jsx +11 -2
- package/src/Button/ButtonLink.jsx +2 -2
- package/src/Card/Card.jsx +151 -11
- package/src/Card/CardBase.jsx +2 -2
- package/src/Card/PressableCardBase.jsx +18 -4
- package/src/CardGroup/CardGroup.jsx +249 -0
- package/src/CardGroup/dictionary.js +8 -0
- package/src/CardGroup/index.js +3 -0
- package/src/Carousel/Carousel.jsx +338 -117
- package/src/Carousel/CarouselFirstFocus/CarouselFirstFocus.jsx +2 -2
- package/src/Carousel/CarouselItem/CarouselItem.jsx +19 -17
- package/src/Carousel/CarouselStepTracker/CarouselStepTracker.jsx +5 -3
- package/src/Carousel/CarouselTabs/CarouselTabs.jsx +2 -2
- package/src/Carousel/CarouselTabs/CarouselTabsPanel.jsx +6 -6
- package/src/Carousel/CarouselTabs/CarouselTabsPanelItem.jsx +3 -3
- package/src/Carousel/CarouselThumbnail.jsx +6 -2
- package/src/Carousel/CarouselThumbnailNavigation.jsx +2 -2
- package/src/Checkbox/Checkbox.jsx +2 -2
- package/src/Checkbox/CheckboxButton.jsx +5 -7
- package/src/Checkbox/CheckboxGroup.jsx +2 -2
- package/src/Checkbox/CheckboxInput.jsx +15 -12
- package/src/CheckboxCard/CheckboxCard.jsx +2 -2
- package/src/CheckboxCardGroup/CheckboxCardGroup.jsx +2 -2
- package/src/ColourToggle/ColourBubble.jsx +5 -4
- package/src/ColourToggle/ColourToggle.jsx +3 -3
- package/src/Divider/Divider.jsx +2 -2
- package/src/ExpandCollapse/Accordion.jsx +4 -2
- package/src/ExpandCollapse/Control.jsx +2 -2
- package/src/ExpandCollapse/ExpandCollapse.jsx +15 -7
- package/src/ExpandCollapse/Panel.jsx +30 -8
- package/src/ExpandCollapse/dictionary.js +10 -0
- package/src/Feedback/Feedback.jsx +2 -2
- package/src/Fieldset/Fieldset.jsx +2 -2
- package/src/Fieldset/FieldsetContainer.jsx +2 -2
- package/src/Fieldset/FieldsetContainer.native.jsx +2 -2
- package/src/Fieldset/Legend.jsx +2 -2
- package/src/Fieldset/Legend.native.jsx +2 -2
- package/src/FlexGrid/Col/Col.jsx +3 -3
- package/src/FlexGrid/FlexGrid.jsx +2 -2
- package/src/FlexGrid/Row/Row.jsx +2 -2
- package/src/Footnote/Footnote.jsx +111 -98
- package/src/Footnote/FootnoteLink.jsx +35 -31
- package/src/HorizontalScroll/HorizontalScroll.jsx +8 -8
- package/src/HorizontalScroll/HorizontalScrollButton.jsx +2 -2
- package/src/HorizontalScroll/ScrollViewEnd.jsx +4 -8
- package/src/HorizontalScroll/ScrollViewEnd.native.jsx +2 -2
- package/src/Icon/Icon.jsx +2 -2
- package/src/Icon/IconText.jsx +7 -5
- package/src/IconButton/IconButton.jsx +2 -2
- package/src/InputLabel/InputLabel.jsx +2 -2
- package/src/InputLabel/LabelContent.jsx +2 -2
- package/src/InputLabel/LabelContent.native.jsx +2 -2
- package/src/InputSupports/InputSupports.jsx +4 -3
- package/src/Link/ChevronLink.jsx +2 -2
- package/src/Link/InlinePressable.jsx +22 -15
- package/src/Link/InlinePressable.native.jsx +12 -6
- package/src/Link/Link.jsx +2 -2
- package/src/Link/LinkBase.jsx +2 -2
- package/src/Link/TextButton.jsx +2 -2
- package/src/List/List.jsx +15 -7
- package/src/List/ListItem.jsx +2 -2
- package/src/List/ListItemBase.jsx +6 -12
- package/src/List/ListItemContent.jsx +5 -2
- package/src/List/ListItemMark.jsx +5 -3
- package/src/List/PressableListItemBase.jsx +2 -2
- package/src/Listbox/GroupControl.jsx +5 -2
- package/src/Listbox/Listbox.jsx +7 -7
- package/src/Listbox/ListboxContext.js +2 -2
- package/src/Listbox/ListboxGroup.jsx +2 -2
- package/src/Listbox/ListboxItem.jsx +2 -3
- package/src/Listbox/ListboxOverlay.jsx +2 -3
- package/src/Listbox/PressableItem.jsx +2 -3
- package/src/Modal/Modal.jsx +5 -5
- package/src/Modal/ModalContent.jsx +132 -125
- package/src/Modal/WebModal.jsx +17 -8
- package/src/MultiSelectFilter/ModalOverlay.jsx +2 -2
- package/src/MultiSelectFilter/MultiSelectFilter.jsx +263 -252
- package/src/Notification/Notification.jsx +5 -5
- package/src/OrderedList/Item.jsx +4 -6
- package/src/OrderedList/ItemBase.jsx +2 -2
- package/src/OrderedList/OrderedList.jsx +4 -7
- package/src/OrderedList/OrderedListBase.jsx +2 -2
- package/src/Pagination/PageButton.jsx +2 -2
- package/src/Pagination/Pagination.jsx +2 -2
- package/src/Pagination/SideButton.jsx +2 -2
- package/src/PriceLockup/PriceLockup.jsx +93 -88
- package/src/ProductCard/ProductCard.jsx +90 -84
- package/src/ProductCardGroup/ProductCardGroup.jsx +5 -5
- package/src/Progress/Progress.jsx +2 -2
- package/src/Progress/ProgressBar.jsx +2 -2
- package/src/Progress/ProgressBarBackground.jsx +4 -2
- package/src/QuickLinks/QuickLinks.jsx +2 -2
- package/src/QuickLinks/QuickLinksCard.jsx +9 -3
- package/src/QuickLinks/QuickLinksItem.jsx +2 -2
- package/src/QuickLinksFeature/QuickLinksFeature.jsx +31 -27
- package/src/QuickLinksFeature/QuickLinksFeatureItem.jsx +3 -3
- package/src/Radio/Radio.jsx +2 -2
- package/src/Radio/RadioButton.jsx +58 -6
- package/src/Radio/RadioGroup.jsx +2 -2
- package/src/Radio/RadioInput.jsx +15 -14
- package/src/RadioCard/RadioCard.jsx +2 -2
- package/src/RadioCard/RadioCardGroup.jsx +2 -2
- package/src/Responsive/Responsive.jsx +8 -3
- package/src/Responsive/ResponsiveWithMediaQueryStyleSheet.jsx +23 -16
- package/src/Search/Search.jsx +2 -2
- package/src/Select/Group.jsx +9 -3
- package/src/Select/Item.jsx +7 -1
- package/src/Select/Picker.jsx +2 -2
- package/src/Select/Picker.native.jsx +3 -3
- package/src/Select/Select.jsx +4 -4
- package/src/SideNav/Item.jsx +2 -2
- package/src/SideNav/ItemContent.jsx +7 -3
- package/src/SideNav/ItemsGroup.jsx +2 -2
- package/src/SideNav/SideNav.jsx +3 -3
- package/src/Skeleton/Skeleton.jsx +2 -2
- package/src/SkipLink/SkipLink.jsx +2 -2
- package/src/Spacer/Spacer.jsx +2 -2
- package/src/StackView/StackView.jsx +2 -2
- package/src/StackView/StackWrap.jsx +3 -3
- package/src/StackView/StackWrapBox.jsx +2 -2
- package/src/StackView/StackWrapGap.jsx +2 -2
- package/src/StackView/getStackedContent.jsx +4 -4
- package/src/StepTracker/Step.jsx +75 -67
- package/src/StepTracker/StepTracker.jsx +2 -2
- package/src/Tabs/Tabs.jsx +3 -3
- package/src/Tabs/TabsItem.jsx +3 -3
- package/src/Tags/Tags.jsx +2 -2
- package/src/TextInput/TextArea.jsx +3 -3
- package/src/TextInput/TextInput.jsx +2 -2
- package/src/TextInput/TextInputBase.jsx +7 -7
- package/src/ThemeProvider/ThemeProvider.jsx +5 -5
- package/src/Timeline/Timeline.jsx +2 -2
- package/src/ToggleSwitch/ToggleSwitch.jsx +2 -2
- package/src/ToggleSwitch/ToggleSwitchGroup.jsx +2 -2
- package/src/Tooltip/Tooltip.jsx +6 -6
- package/src/Tooltip/Tooltip.native.jsx +12 -12
- package/src/TooltipButton/TooltipButton.jsx +5 -2
- package/src/Typography/Typography.jsx +2 -2
- package/src/Validator/Validator.jsx +11 -11
- package/src/ViewportProvider/ViewportProvider.jsx +2 -2
- package/src/index.js +1 -0
- package/src/utils/BaseView/BaseView.jsx +2 -2
- package/src/utils/children.jsx +4 -4
- package/src/utils/withLinkRouter.jsx +3 -3
- package/types/ExpandCollapse.d.ts +1 -1
package/lib/Tooltip/Tooltip.js
CHANGED
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
var _react =
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _Platform = _interopRequireDefault(require("react-native-web/dist/cjs/exports/Platform"));
|
|
9
9
|
var _Pressable = _interopRequireDefault(require("react-native-web/dist/cjs/exports/Pressable"));
|
|
10
10
|
var _StyleSheet = _interopRequireDefault(require("react-native-web/dist/cjs/exports/StyleSheet"));
|
|
@@ -19,8 +19,6 @@ var _useCopy = _interopRequireDefault(require("../utils/useCopy"));
|
|
|
19
19
|
var _dictionary = _interopRequireDefault(require("./dictionary"));
|
|
20
20
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
21
21
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
22
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
23
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
24
22
|
const [selectProps, selectedSystemPropTypes] = (0, _utils.selectSystemProps)([_utils.a11yProps, _utils.viewProps]);
|
|
25
23
|
const selectTooltipStyles = _ref => {
|
|
26
24
|
let {
|
|
@@ -118,7 +116,7 @@ const defaultControl = (pressableState, variant) => /*#__PURE__*/(0, _jsxRuntime
|
|
|
118
116
|
* - You may use one when the information is useful only to a small percentage of users (ie. tech savvy people wouldn't need this info).
|
|
119
117
|
* - Tooltips may also be useful when vertical space is an issue.
|
|
120
118
|
*/
|
|
121
|
-
const Tooltip = /*#__PURE__*/
|
|
119
|
+
const Tooltip = /*#__PURE__*/_react.default.forwardRef((_ref6, ref) => {
|
|
122
120
|
let {
|
|
123
121
|
children,
|
|
124
122
|
content,
|
|
@@ -131,9 +129,9 @@ const Tooltip = /*#__PURE__*/(0, _react.forwardRef)((_ref6, ref) => {
|
|
|
131
129
|
nativeID,
|
|
132
130
|
...rest
|
|
133
131
|
} = _ref6;
|
|
134
|
-
const [isOpen, setIsOpen] =
|
|
135
|
-
const arrowRef =
|
|
136
|
-
const [tooltipDimensions, setTooltipDimensions] =
|
|
132
|
+
const [isOpen, setIsOpen] = _react.default.useState(false);
|
|
133
|
+
const arrowRef = _react.default.useRef();
|
|
134
|
+
const [tooltipDimensions, setTooltipDimensions] = _react.default.useState(null);
|
|
137
135
|
const positions = {
|
|
138
136
|
auto: undefined,
|
|
139
137
|
// Auto needs to specifically bet set to undefined
|
|
@@ -203,7 +201,7 @@ const Tooltip = /*#__PURE__*/(0, _react.forwardRef)((_ref6, ref) => {
|
|
|
203
201
|
});
|
|
204
202
|
}
|
|
205
203
|
};
|
|
206
|
-
|
|
204
|
+
_react.default.useEffect(() => {
|
|
207
205
|
if (!isOpen) {
|
|
208
206
|
setTooltipDimensions(null);
|
|
209
207
|
}
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
var _react =
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _Dimensions = _interopRequireDefault(require("react-native-web/dist/cjs/exports/Dimensions"));
|
|
9
9
|
var _Platform = _interopRequireDefault(require("react-native-web/dist/cjs/exports/Platform"));
|
|
10
10
|
var _Pressable = _interopRequireDefault(require("react-native-web/dist/cjs/exports/Pressable"));
|
|
@@ -21,8 +21,6 @@ var _useCopy = _interopRequireDefault(require("../utils/useCopy"));
|
|
|
21
21
|
var _dictionary = _interopRequireDefault(require("./dictionary"));
|
|
22
22
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
23
23
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
24
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
25
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
26
24
|
const [selectProps, selectedSystemPropTypes] = (0, _utils.selectSystemProps)([_utils.a11yProps, _utils.viewProps]);
|
|
27
25
|
const selectTooltipStyles = _ref => {
|
|
28
26
|
let {
|
|
@@ -147,7 +145,7 @@ const defaultControl = (pressableState, variant) => /*#__PURE__*/(0, _jsxRuntime
|
|
|
147
145
|
* - You may use one when the information is useful only to a small percentage of users (ie. tech savvy people wouldn't need this info).
|
|
148
146
|
* - Tooltips may also be useful when vertical space is an issue.
|
|
149
147
|
*/
|
|
150
|
-
const Tooltip = /*#__PURE__*/
|
|
148
|
+
const Tooltip = /*#__PURE__*/_react.default.forwardRef((_ref6, ref) => {
|
|
151
149
|
let {
|
|
152
150
|
children,
|
|
153
151
|
content,
|
|
@@ -160,12 +158,12 @@ const Tooltip = /*#__PURE__*/(0, _react.forwardRef)((_ref6, ref) => {
|
|
|
160
158
|
nativeID,
|
|
161
159
|
...rest
|
|
162
160
|
} = _ref6;
|
|
163
|
-
const [isOpen, setIsOpen] =
|
|
164
|
-
const controlRef =
|
|
165
|
-
const [controlLayout, setControlLayout] =
|
|
166
|
-
const [tooltipDimensions, setTooltipDimensions] =
|
|
167
|
-
const [windowDimensions, setWindowDimensions] =
|
|
168
|
-
const [tooltipPosition, setTooltipPosition] =
|
|
161
|
+
const [isOpen, setIsOpen] = _react.default.useState(false);
|
|
162
|
+
const controlRef = _react.default.useRef();
|
|
163
|
+
const [controlLayout, setControlLayout] = _react.default.useState(null);
|
|
164
|
+
const [tooltipDimensions, setTooltipDimensions] = _react.default.useState(null);
|
|
165
|
+
const [windowDimensions, setWindowDimensions] = _react.default.useState(_Dimensions.default.get('window'));
|
|
166
|
+
const [tooltipPosition, setTooltipPosition] = _react.default.useState(null);
|
|
169
167
|
const getCopy = (0, _useCopy.default)({
|
|
170
168
|
dictionary: _dictionary.default,
|
|
171
169
|
copy
|
|
@@ -175,7 +173,7 @@ const Tooltip = /*#__PURE__*/(0, _react.forwardRef)((_ref6, ref) => {
|
|
|
175
173
|
arrowWidth,
|
|
176
174
|
arrowOffset
|
|
177
175
|
} = themeTokens;
|
|
178
|
-
|
|
176
|
+
_react.default.useEffect(() => {
|
|
179
177
|
const subscription = _Dimensions.default.addEventListener('change', _ref7 => {
|
|
180
178
|
let {
|
|
181
179
|
window
|
|
@@ -221,7 +219,7 @@ const Tooltip = /*#__PURE__*/(0, _react.forwardRef)((_ref6, ref) => {
|
|
|
221
219
|
});
|
|
222
220
|
}
|
|
223
221
|
};
|
|
224
|
-
|
|
222
|
+
_react.default.useEffect(() => {
|
|
225
223
|
if (isOpen) {
|
|
226
224
|
controlRef.current.measureInWindow((x, y, width, height) => {
|
|
227
225
|
setControlLayout({
|
|
@@ -237,10 +235,10 @@ const Tooltip = /*#__PURE__*/(0, _react.forwardRef)((_ref6, ref) => {
|
|
|
237
235
|
setTooltipPosition(null);
|
|
238
236
|
}
|
|
239
237
|
}, [isOpen]);
|
|
240
|
-
|
|
238
|
+
_react.default.useEffect(() => {
|
|
241
239
|
setIsOpen(false);
|
|
242
240
|
}, [windowDimensions]);
|
|
243
|
-
|
|
241
|
+
_react.default.useEffect(() => {
|
|
244
242
|
if (tooltipPosition !== null && !(tooltipPosition !== null && tooltipPosition !== void 0 && tooltipPosition.isNormalized) || !isOpen || controlLayout === null || tooltipDimensions == null) {
|
|
245
243
|
return;
|
|
246
244
|
}
|
|
@@ -45,7 +45,7 @@ const selectIconTokens = _ref2 => {
|
|
|
45
45
|
* In fact though, it isn't actually a pressable - it's meant to be used as pressable's content.
|
|
46
46
|
* Due to this any interaction states (e.g. pressed, hover, etc.) has to be passed down to it as a prop.
|
|
47
47
|
*/
|
|
48
|
-
const TooltipButton = _ref3 => {
|
|
48
|
+
const TooltipButton = /*#__PURE__*/_react.default.forwardRef((_ref3, ref) => {
|
|
49
49
|
let {
|
|
50
50
|
pressableState,
|
|
51
51
|
tokens,
|
|
@@ -61,6 +61,7 @@ const TooltipButton = _ref3 => {
|
|
|
61
61
|
margin: -themeTokens.outerBorderWidth
|
|
62
62
|
}, staticStyles.bubblePointerEvents],
|
|
63
63
|
...selectProps(rest),
|
|
64
|
+
ref: ref,
|
|
64
65
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, {
|
|
65
66
|
style: selectInnerContainerStyles(themeTokens),
|
|
66
67
|
children: IconComponent && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.default, {
|
|
@@ -69,7 +70,8 @@ const TooltipButton = _ref3 => {
|
|
|
69
70
|
})
|
|
70
71
|
})
|
|
71
72
|
});
|
|
72
|
-
};
|
|
73
|
+
});
|
|
74
|
+
TooltipButton.displayName = 'TooltipButton';
|
|
73
75
|
const staticStyles = _StyleSheet.default.create({
|
|
74
76
|
bubblePointerEvents: {
|
|
75
77
|
..._Platform.default.select({
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
var _react =
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
9
|
var _Text = _interopRequireDefault(require("react-native-web/dist/cjs/exports/Text"));
|
|
10
10
|
var _View = _interopRequireDefault(require("react-native-web/dist/cjs/exports/View"));
|
|
@@ -14,8 +14,6 @@ var _utils2 = require("../utils");
|
|
|
14
14
|
var _ViewportProvider = require("../ViewportProvider");
|
|
15
15
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
16
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
18
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
19
17
|
/**
|
|
20
18
|
* @typedef {import('../utils/a11y/semantics').TextTag} TextTag
|
|
21
19
|
*/const [selectContainerProps, selectedContainerPropTypes] = (0, _utils2.selectSystemProps)([_utils2.a11yProps, _utils2.viewProps]);
|
|
@@ -49,7 +47,7 @@ const selectTextStyles = (_ref, themeOptions) => {
|
|
|
49
47
|
};
|
|
50
48
|
|
|
51
49
|
// General-purpose flexible theme-neutral base component for text
|
|
52
|
-
const Typography = /*#__PURE__*/
|
|
50
|
+
const Typography = /*#__PURE__*/_react.default.forwardRef((_ref2, ref) => {
|
|
53
51
|
let {
|
|
54
52
|
children,
|
|
55
53
|
variant,
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
var _react =
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
9
|
var _View = _interopRequireDefault(require("react-native-web/dist/cjs/exports/View"));
|
|
10
10
|
var _StyleSheet = _interopRequireDefault(require("react-native-web/dist/cjs/exports/StyleSheet"));
|
|
@@ -16,8 +16,6 @@ var _InputSupports = _interopRequireDefault(require("../InputSupports"));
|
|
|
16
16
|
var _ThemeProvider = require("../ThemeProvider");
|
|
17
17
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
18
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
20
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
21
19
|
const [selectProps, selectedSystemPropTypes] = (0, _utils.selectSystemProps)([_utils.inputSupportsProps]);
|
|
22
20
|
const selectCodeTextInputTokens = _ref => {
|
|
23
21
|
let {
|
|
@@ -30,7 +28,7 @@ const selectCodeTextInputTokens = _ref => {
|
|
|
30
28
|
icon: null
|
|
31
29
|
};
|
|
32
30
|
};
|
|
33
|
-
const Validator = /*#__PURE__*/
|
|
31
|
+
const Validator = /*#__PURE__*/_react.default.forwardRef((_ref2, ref) => {
|
|
34
32
|
let {
|
|
35
33
|
value = '',
|
|
36
34
|
inactive,
|
|
@@ -39,18 +37,18 @@ const Validator = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) => {
|
|
|
39
37
|
variant = {},
|
|
40
38
|
...rest
|
|
41
39
|
} = _ref2;
|
|
42
|
-
const defaultRef =
|
|
40
|
+
const defaultRef = _react.default.useRef();
|
|
43
41
|
const codeRef = ref ?? defaultRef;
|
|
44
42
|
const {
|
|
45
43
|
supportsProps
|
|
46
44
|
} = selectProps(rest);
|
|
47
45
|
const strValidation = supportsProps.validation;
|
|
48
|
-
const [individualCodes, setIndividualCodes] =
|
|
49
|
-
const [text, setText] =
|
|
46
|
+
const [individualCodes, setIndividualCodes] = _react.default.useState({});
|
|
47
|
+
const [text, setText] = _react.default.useState(value);
|
|
50
48
|
const validatorsLength = 6;
|
|
51
49
|
const prefix = 'code';
|
|
52
50
|
const sufixValidation = 'Validation';
|
|
53
|
-
const [isHover, setIsHover] =
|
|
51
|
+
const [isHover, setIsHover] = _react.default.useState(false);
|
|
54
52
|
const handleMouseOver = () => {
|
|
55
53
|
setIsHover(true);
|
|
56
54
|
};
|
|
@@ -60,11 +58,11 @@ const Validator = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) => {
|
|
|
60
58
|
const themeTokens = (0, _ThemeProvider.useThemeTokens)('TextInput', tokens, variant, {
|
|
61
59
|
hover: isHover
|
|
62
60
|
});
|
|
63
|
-
const [codeReferences, singleCodes] =
|
|
61
|
+
const [codeReferences, singleCodes] = _react.default.useMemo(() => {
|
|
64
62
|
const codes = [];
|
|
65
63
|
const valueCodes = {};
|
|
66
64
|
for (let i = 0; validatorsLength && i < validatorsLength; i += 1) {
|
|
67
|
-
codes[prefix + i] = /*#__PURE__*/
|
|
65
|
+
codes[prefix + i] = /*#__PURE__*/_react.default.createRef();
|
|
68
66
|
valueCodes[prefix + i] = '';
|
|
69
67
|
valueCodes[prefix + i + sufixValidation] = '';
|
|
70
68
|
}
|
|
@@ -144,13 +142,13 @@ const Validator = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) => {
|
|
|
144
142
|
}
|
|
145
143
|
return components;
|
|
146
144
|
};
|
|
147
|
-
|
|
145
|
+
_react.default.useEffect(() => {
|
|
148
146
|
/* eslint-disable no-unused-expressions */
|
|
149
147
|
if (Number(value).toString() !== 'NaN') setText(value);
|
|
150
148
|
}, [value]);
|
|
151
149
|
|
|
152
150
|
/* eslint-disable react-hooks/exhaustive-deps */
|
|
153
|
-
|
|
151
|
+
_react.default.useEffect(() => {
|
|
154
152
|
for (let i = 0; i < validatorsLength; i += 1) {
|
|
155
153
|
codeReferences[prefix + i].current.value = text[i] ?? '';
|
|
156
154
|
handleSingleCodes(prefix + i, text[i] ?? '', text[i] ? 'success' : '');
|
|
@@ -158,7 +156,7 @@ const Validator = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) => {
|
|
|
158
156
|
}, [text]);
|
|
159
157
|
|
|
160
158
|
/* eslint-disable react-hooks/exhaustive-deps */
|
|
161
|
-
|
|
159
|
+
_react.default.useEffect(() => {
|
|
162
160
|
const handlePasteCode = event => {
|
|
163
161
|
setText('');
|
|
164
162
|
const clipBoardText = event.clipboardData.getData('text');
|
|
@@ -4,15 +4,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
var _react =
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
9
|
var _systemConstants = require("@telus-uds/system-constants");
|
|
10
10
|
var _useViewport = require("./useViewport");
|
|
11
11
|
var _useViewportListener = _interopRequireDefault(require("./useViewportListener"));
|
|
12
12
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
13
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
15
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
16
14
|
/**
|
|
17
15
|
* Provides an up-to-date viewport value from system-constants, available via the `useViewport` hook
|
|
18
16
|
*/const ViewportProvider = _ref => {
|
|
@@ -21,7 +19,7 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
21
19
|
} = _ref;
|
|
22
20
|
// Default to the smallest viewport for mobile-first SSR. On client side, this is updated
|
|
23
21
|
// by useViewportListener in a layout effect before anything is shown to the user.
|
|
24
|
-
const [viewport, setViewport] =
|
|
22
|
+
const [viewport, setViewport] = _react.default.useState(_systemConstants.viewports.keys[0]);
|
|
25
23
|
(0, _useViewportListener.default)(setViewport);
|
|
26
24
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_useViewport.ViewportContext.Provider, {
|
|
27
25
|
value: viewport,
|
package/lib/index.js
CHANGED
|
@@ -11,6 +11,7 @@ var _exportNames = {
|
|
|
11
11
|
Badge: true,
|
|
12
12
|
Card: true,
|
|
13
13
|
PressableCardBase: true,
|
|
14
|
+
CardGroup: true,
|
|
14
15
|
Listbox: true,
|
|
15
16
|
Checkbox: true,
|
|
16
17
|
CheckboxCard: true,
|
|
@@ -132,6 +133,12 @@ Object.defineProperty(exports, "Card", {
|
|
|
132
133
|
return _Card.default;
|
|
133
134
|
}
|
|
134
135
|
});
|
|
136
|
+
Object.defineProperty(exports, "CardGroup", {
|
|
137
|
+
enumerable: true,
|
|
138
|
+
get: function () {
|
|
139
|
+
return _CardGroup.default;
|
|
140
|
+
}
|
|
141
|
+
});
|
|
135
142
|
Object.defineProperty(exports, "Checkbox", {
|
|
136
143
|
enumerable: true,
|
|
137
144
|
get: function () {
|
|
@@ -534,6 +541,7 @@ Object.keys(_Button).forEach(function (key) {
|
|
|
534
541
|
});
|
|
535
542
|
});
|
|
536
543
|
var _Card = _interopRequireWildcard(require("./Card"));
|
|
544
|
+
var _CardGroup = _interopRequireDefault(require("./CardGroup"));
|
|
537
545
|
var _Carousel = require("./Carousel");
|
|
538
546
|
Object.keys(_Carousel).forEach(function (key) {
|
|
539
547
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -4,19 +4,17 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
var _react =
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _View = _interopRequireDefault(require("react-native-web/dist/cjs/exports/View"));
|
|
9
9
|
var _StyleSheet = _interopRequireDefault(require("react-native-web/dist/cjs/exports/StyleSheet"));
|
|
10
10
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
11
|
var _ThemeProvider = require("../../ThemeProvider");
|
|
12
12
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
13
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
15
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
16
14
|
/**
|
|
17
15
|
* Identical to React Native's View and supporting all the same props, but with:
|
|
18
16
|
* - a zIndex: 'auto' style added to prevent unexpectedly causing children to overlap other elements from other stacking contexts
|
|
19
|
-
*/const BaseView = /*#__PURE__*/
|
|
17
|
+
*/const BaseView = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
|
|
20
18
|
let {
|
|
21
19
|
children,
|
|
22
20
|
style,
|
package/lib/utils/children.js
CHANGED
|
@@ -4,13 +4,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.wrapStringsInText = exports.unpackFragment = void 0;
|
|
7
|
-
var _react =
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _Text = _interopRequireDefault(require("react-native-web/dist/cjs/exports/Text"));
|
|
9
9
|
var _A11yText = _interopRequireDefault(require("../A11yText"));
|
|
10
10
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
13
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
14
12
|
/**
|
|
15
13
|
* Unpacks top-level fragments, so that common compositional patterns such as the following examples
|
|
16
14
|
* can be iterated as flat siblings (as if they were `<Child1 /><Child2 /><Child3 />`):
|
|
@@ -46,10 +44,10 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
46
44
|
const unpackFragment = child => {
|
|
47
45
|
var _child$props;
|
|
48
46
|
// If this level is a set of top-level siblings rather than one child, check each in turn
|
|
49
|
-
if (_react.Children.count(child) > 1) return _react.Children.map(child, unpackFragment);
|
|
47
|
+
if (_react.default.Children.count(child) > 1) return _react.default.Children.map(child, unpackFragment);
|
|
50
48
|
|
|
51
49
|
// When a fragment is found, unpack its children to the top level and check them
|
|
52
|
-
if ((child === null || child === void 0 ? void 0 : child.type) === _react.Fragment) return unpackFragment((_child$props = child.props) === null || _child$props === void 0 ? void 0 : _child$props.children);
|
|
50
|
+
if ((child === null || child === void 0 ? void 0 : child.type) === _react.default.Fragment) return unpackFragment((_child$props = child.props) === null || _child$props === void 0 ? void 0 : _child$props.children);
|
|
53
51
|
|
|
54
52
|
// Stop unpacking as soon as any non-fragment child is found
|
|
55
53
|
return child;
|
|
@@ -93,7 +91,7 @@ const wrapChild = (child, wrappedText) => {
|
|
|
93
91
|
*/
|
|
94
92
|
const wrapStringsInText = function (children) {
|
|
95
93
|
let textProps = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
96
|
-
const childrenArray = unpackFragment(_react.Children.toArray(children));
|
|
94
|
+
const childrenArray = unpackFragment(_react.default.Children.toArray(children));
|
|
97
95
|
|
|
98
96
|
// Group adjacent wrapable children together in one Text element to create as few Text elements
|
|
99
97
|
// as possible, e.g. give <X>Text {someString}</X> one Text, same as <X>{`Text ${someString}`}</X>
|
|
@@ -4,13 +4,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
var _react =
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
9
|
var _hasOwnProperty = _interopRequireDefault(require("./hasOwnProperty"));
|
|
10
10
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
13
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
14
12
|
/**
|
|
15
13
|
* Higher-order component that has no effect unless an additional prop `LinkRouter` is passed.
|
|
16
14
|
* This may be used to provide custom wrappers for integrations with third party libraries.
|
|
@@ -26,7 +24,7 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
26
24
|
* @example A LinkRouter component to be used with link-like components might look like:
|
|
27
25
|
*
|
|
28
26
|
* ```jsx
|
|
29
|
-
* const LinkLinkRouter = forwardRef(({ Component, linkRouterProps: { to, options }, href, ...rest }, ref) => {
|
|
27
|
+
* const LinkLinkRouter = React.forwardRef(({ Component, linkRouterProps: { to, options }, href, ...rest }, ref) => {
|
|
30
28
|
* const { href: resolvedHref, onClick } = useSomeRouterHook({ to, href, options })
|
|
31
29
|
* return <Component href={resolvedHref} onPress={onClick} {...rest} />
|
|
32
30
|
* })
|
|
@@ -39,7 +37,7 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
39
37
|
* <IconButton icon={SomeIcon} LinkRouter={LinkLinkRouter} linkRouterProps={{ to, options }} ref={iconRef} />
|
|
40
38
|
* ```
|
|
41
39
|
*/const withLinkRouter = Component => {
|
|
42
|
-
const wrappedComponent = /*#__PURE__*/
|
|
40
|
+
const wrappedComponent = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
|
|
43
41
|
let {
|
|
44
42
|
LinkRouter,
|
|
45
43
|
linkRouterProps,
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import AccessibilityInfo from "react-native-web/dist/exports/AccessibilityInfo";
|
|
4
4
|
import Platform from "react-native-web/dist/exports/Platform";
|
|
5
5
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
-
const ScreenReaderContext = /*#__PURE__*/createContext(false);
|
|
7
|
-
const ReducedMotionContext = /*#__PURE__*/createContext(false);
|
|
6
|
+
const ScreenReaderContext = /*#__PURE__*/React.createContext(false);
|
|
7
|
+
const ReducedMotionContext = /*#__PURE__*/React.createContext(false);
|
|
8
8
|
const A11yInfoProvider = _ref => {
|
|
9
9
|
let {
|
|
10
10
|
children
|
|
11
11
|
} = _ref;
|
|
12
|
-
const [reduceMotionEnabled, setReduceMotionEnabled] = useState(false);
|
|
13
|
-
const [screenReaderEnabled, setScreenReaderEnabled] = useState(false);
|
|
14
|
-
useEffect(() => {
|
|
12
|
+
const [reduceMotionEnabled, setReduceMotionEnabled] = React.useState(false);
|
|
13
|
+
const [screenReaderEnabled, setScreenReaderEnabled] = React.useState(false);
|
|
14
|
+
React.useEffect(() => {
|
|
15
15
|
if (process.env.NODE_ENV === 'test') {
|
|
16
16
|
// On Jest these effects do nothing but can cause `act` state change warnings
|
|
17
17
|
// and "...after the Jest environment has been torn down" errors, so skip them.
|
|
@@ -53,8 +53,8 @@ A11yInfoProvider.propTypes = {
|
|
|
53
53
|
};
|
|
54
54
|
export default A11yInfoProvider;
|
|
55
55
|
export const useA11yInfo = () => {
|
|
56
|
-
const screenReaderEnabled = useContext(ScreenReaderContext);
|
|
57
|
-
const reduceMotionEnabled = useContext(ReducedMotionContext);
|
|
56
|
+
const screenReaderEnabled = React.useContext(ScreenReaderContext);
|
|
57
|
+
const reduceMotionEnabled = React.useContext(ReducedMotionContext);
|
|
58
58
|
return {
|
|
59
59
|
reduceMotionEnabled,
|
|
60
60
|
screenReaderEnabled
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import Platform from "react-native-web/dist/exports/Platform";
|
|
3
3
|
import StyleSheet from "react-native-web/dist/exports/StyleSheet";
|
|
4
4
|
import View from "react-native-web/dist/exports/View";
|
|
@@ -13,7 +13,7 @@ const [selectProps, selectedSystemPropTypes] = selectSystemProps([a11yProps, vie
|
|
|
13
13
|
* It should be used to add selectable screen-reader-only text to the main document flow,
|
|
14
14
|
* as a sibling to blocks of text like paragraphs and interactive elements like buttons.
|
|
15
15
|
*/
|
|
16
|
-
const A11yText = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
16
|
+
const A11yText = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
17
17
|
let {
|
|
18
18
|
text,
|
|
19
19
|
heading,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import { DURATION, MIN_EMPTY_ANGLE, MIN_STROKE_ANGLE, BEZIER, propTypes } from './shared';
|
|
3
3
|
import { useA11yInfo } from '../A11yInfoProvider';
|
|
4
4
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -21,7 +21,7 @@ const bezierProps = {
|
|
|
21
21
|
};
|
|
22
22
|
// We're using svg rather than css here to define the animation to avoid needing to introduce css injection mechanism
|
|
23
23
|
// It's possible to replicate this functionality with RNW animations, but it snags on chrome at least, see https://github.com/telus/universal-design-system/pull/477 for details.
|
|
24
|
-
const Spinner = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
24
|
+
const Spinner = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
25
25
|
let {
|
|
26
26
|
size,
|
|
27
27
|
color,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import Animated from "react-native-web/dist/exports/Animated";
|
|
3
3
|
import Easing from "react-native-web/dist/exports/Easing";
|
|
4
4
|
import StyleSheet from "react-native-web/dist/exports/StyleSheet";
|
|
@@ -8,7 +8,7 @@ import { useA11yInfo } from '../A11yInfoProvider';
|
|
|
8
8
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
9
|
const ea = MIN_EMPTY_ANGLE / 2;
|
|
10
10
|
const sa = MIN_STROKE_ANGLE / 2;
|
|
11
|
-
const Spinner = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
11
|
+
const Spinner = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
12
12
|
let {
|
|
13
13
|
size,
|
|
14
14
|
color,
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
import React, { forwardRef, useEffect, useRef, useState } from 'react';
|
|
1
|
+
import React from 'react';
|
|
3
2
|
import PropTypes from 'prop-types';
|
|
4
3
|
import Dimensions from "react-native-web/dist/exports/Dimensions";
|
|
5
4
|
import Platform from "react-native-web/dist/exports/Platform";
|
|
@@ -87,7 +86,7 @@ const highlight = function () {
|
|
|
87
86
|
return [...acc, item];
|
|
88
87
|
}, []);
|
|
89
88
|
};
|
|
90
|
-
const Autocomplete = /*#__PURE__*/forwardRef((_ref2, ref) => {
|
|
89
|
+
const Autocomplete = /*#__PURE__*/React.forwardRef((_ref2, ref) => {
|
|
91
90
|
var _ref3;
|
|
92
91
|
let {
|
|
93
92
|
children,
|
|
@@ -122,23 +121,23 @@ const Autocomplete = /*#__PURE__*/forwardRef((_ref2, ref) => {
|
|
|
122
121
|
const isControlled = value !== undefined;
|
|
123
122
|
|
|
124
123
|
// We need to store current items for uncontrolled usage
|
|
125
|
-
const [currentItems, setCurrentItems] = useState(initialItems);
|
|
126
|
-
const [otherItems, setOtherItems] = useState(items);
|
|
124
|
+
const [currentItems, setCurrentItems] = React.useState(initialItems);
|
|
125
|
+
const [otherItems, setOtherItems] = React.useState(items);
|
|
127
126
|
|
|
128
127
|
// We need to store the current value as well to be able to highlight it
|
|
129
|
-
const [currentValue, setCurrentValue] = useState(value ?? initialValue);
|
|
128
|
+
const [currentValue, setCurrentValue] = React.useState(value ?? initialValue);
|
|
130
129
|
const inputTokens = {
|
|
131
130
|
paddingLeft: INPUT_LEFT_PADDING
|
|
132
131
|
};
|
|
133
132
|
|
|
134
133
|
// Setting up the overlay
|
|
135
|
-
const openOverlayRef = useRef();
|
|
136
|
-
const [isExpanded, setIsExpanded] = useState(((_ref3 = value ?? initialValue) === null || _ref3 === void 0 ? void 0 : _ref3.length) >= minToSuggestion);
|
|
137
|
-
const [isFocused, setisFocused] = useState(false);
|
|
138
|
-
const [sourceLayout, setSourceLayout] = useState(null);
|
|
134
|
+
const openOverlayRef = React.useRef();
|
|
135
|
+
const [isExpanded, setIsExpanded] = React.useState(((_ref3 = value ?? initialValue) === null || _ref3 === void 0 ? void 0 : _ref3.length) >= minToSuggestion);
|
|
136
|
+
const [isFocused, setisFocused] = React.useState(false);
|
|
137
|
+
const [sourceLayout, setSourceLayout] = React.useState(null);
|
|
139
138
|
|
|
140
139
|
// When it's nested, selected value
|
|
141
|
-
const [nestedSelectedValue, setNestedSelectedValue] = useState(null);
|
|
140
|
+
const [nestedSelectedValue, setNestedSelectedValue] = React.useState(null);
|
|
142
141
|
const {
|
|
143
142
|
supportsProps,
|
|
144
143
|
...selectedProps
|
|
@@ -160,7 +159,7 @@ const Autocomplete = /*#__PURE__*/forwardRef((_ref2, ref) => {
|
|
|
160
159
|
vertical: Platform.OS !== 'web' && (hint || inputLabel) ? 28 : 4
|
|
161
160
|
}
|
|
162
161
|
});
|
|
163
|
-
const targetRef = useRef(null);
|
|
162
|
+
const targetRef = React.useRef(null);
|
|
164
163
|
// We limit the number of suggestions displayed to avoid huge lists
|
|
165
164
|
// TODO: add a way to make the `Listbox` occupy fixed height and be scrollable
|
|
166
165
|
// within that height, which will unlock similar behaviour for `AutoComplete` as well
|
|
@@ -173,7 +172,7 @@ const Autocomplete = /*#__PURE__*/forwardRef((_ref2, ref) => {
|
|
|
173
172
|
copy
|
|
174
173
|
});
|
|
175
174
|
// Tracking input width changes to resize the listbox overlay accordingly
|
|
176
|
-
const [inputWidth, setInputWidth] = useState();
|
|
175
|
+
const [inputWidth, setInputWidth] = React.useState();
|
|
177
176
|
useSafeLayoutEffect(() => {
|
|
178
177
|
if (Platform.OS === 'web') {
|
|
179
178
|
const updateInputWidth = () => {
|
|
@@ -248,7 +247,7 @@ const Autocomplete = /*#__PURE__*/forwardRef((_ref2, ref) => {
|
|
|
248
247
|
* within the list, if doesn't exist the nested item is added to the top of the list,
|
|
249
248
|
* the nested item is added with an id equal "0"
|
|
250
249
|
*/
|
|
251
|
-
useEffect(() => {
|
|
250
|
+
React.useEffect(() => {
|
|
252
251
|
if (nestedSelectedValue && !items.find(item => item.id === 0)) {
|
|
253
252
|
const tmpItems = [...items];
|
|
254
253
|
tmpItems.unshift({
|
|
@@ -6,12 +6,13 @@ import Box from '../Box';
|
|
|
6
6
|
import StackView from '../StackView';
|
|
7
7
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
8
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
9
|
-
const Loading = _ref => {
|
|
9
|
+
const Loading = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
10
10
|
let {
|
|
11
11
|
label
|
|
12
12
|
} = _ref;
|
|
13
13
|
return /*#__PURE__*/_jsx(Box, {
|
|
14
14
|
space: 3,
|
|
15
|
+
ref: ref,
|
|
15
16
|
children: /*#__PURE__*/_jsxs(StackView, {
|
|
16
17
|
direction: "row",
|
|
17
18
|
space: 2,
|
|
@@ -27,7 +28,8 @@ const Loading = _ref => {
|
|
|
27
28
|
})]
|
|
28
29
|
})
|
|
29
30
|
});
|
|
30
|
-
};
|
|
31
|
+
});
|
|
32
|
+
Loading.displayName = 'Loading';
|
|
31
33
|
Loading.propTypes = {
|
|
32
34
|
label: PropTypes.string
|
|
33
35
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import A11yText from '../A11yText';
|
|
4
4
|
import Typography from '../Typography';
|
|
@@ -7,7 +7,7 @@ import Listbox from '../Listbox';
|
|
|
7
7
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
8
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
9
9
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
10
|
-
const Suggestions = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
10
|
+
const Suggestions = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
11
11
|
let {
|
|
12
12
|
hasResults,
|
|
13
13
|
items = [],
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import View from "react-native-web/dist/exports/View";
|
|
3
3
|
import StyleSheet from "react-native-web/dist/exports/StyleSheet";
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
@@ -66,7 +66,7 @@ const getTypographyVariant = _ref5 => {
|
|
|
66
66
|
size: fontSizeMapping[fontSize]
|
|
67
67
|
};
|
|
68
68
|
};
|
|
69
|
-
const Badge = /*#__PURE__*/forwardRef((_ref6, ref) => {
|
|
69
|
+
const Badge = /*#__PURE__*/React.forwardRef((_ref6, ref) => {
|
|
70
70
|
let {
|
|
71
71
|
children,
|
|
72
72
|
tokens,
|