@telus-uds/components-base 2.0.2 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +27 -2
- package/lib/A11yInfoProvider/index.js +0 -0
- package/lib/A11yText/index.js +0 -0
- package/lib/ActionCard/ActionCard.js +0 -0
- package/lib/ActionCard/index.js +0 -0
- package/lib/ActivityIndicator/Spinner.js +0 -0
- package/lib/ActivityIndicator/Spinner.native.js +0 -0
- package/lib/ActivityIndicator/index.js +0 -0
- package/lib/ActivityIndicator/shared.js +0 -0
- package/lib/Autocomplete/Autocomplete.js +0 -0
- package/lib/Autocomplete/Loading.js +0 -0
- package/lib/Autocomplete/Suggestions.js +0 -0
- package/lib/Autocomplete/constants.js +0 -0
- package/lib/Autocomplete/dictionary.js +0 -0
- package/lib/Autocomplete/index.js +0 -0
- package/lib/Badge/Badge.js +0 -0
- package/lib/Badge/index.js +0 -0
- package/lib/BaseProvider/HydrationContext.js +0 -0
- package/lib/BaseProvider/index.js +0 -0
- package/lib/Box/Box.js +0 -0
- package/lib/Box/backgroundImageStylesMap.js +0 -0
- package/lib/Box/index.js +0 -0
- package/lib/Button/Button.js +0 -0
- package/lib/Button/ButtonBase.js +0 -0
- package/lib/Button/ButtonDropdown.js +0 -0
- package/lib/Button/ButtonGroup.js +0 -0
- package/lib/Button/ButtonLink.js +0 -0
- package/lib/Button/index.js +0 -0
- package/lib/Button/propTypes.js +0 -0
- package/lib/Card/Card.js +0 -0
- package/lib/Card/CardBase.js +0 -0
- package/lib/Card/PressableCardBase.js +2 -1
- package/lib/Card/index.js +0 -0
- package/lib/CardGroup/CardGroup.js +0 -0
- package/lib/CardGroup/dictionary.js +0 -0
- package/lib/CardGroup/index.js +0 -0
- package/lib/Carousel/Carousel.js +121 -33
- package/lib/Carousel/CarouselContext.js +0 -0
- package/lib/Carousel/CarouselFirstFocus/CarouselFirstFocus.js +0 -0
- package/lib/Carousel/CarouselItem/CarouselItem.js +39 -24
- package/lib/Carousel/CarouselItem/index.js +0 -0
- package/lib/Carousel/CarouselStepTracker/CarouselStepTracker.js +41 -4
- package/lib/Carousel/CarouselStepTracker/index.js +0 -0
- package/lib/Carousel/CarouselTabs/CarouselTabs.js +0 -0
- package/lib/Carousel/CarouselTabs/CarouselTabsPanel.js +0 -0
- package/lib/Carousel/CarouselTabs/CarouselTabsPanelItem.js +0 -0
- package/lib/Carousel/CarouselTabs/index.js +0 -0
- package/lib/Carousel/CarouselThumbnail.js +0 -0
- package/lib/Carousel/CarouselThumbnailNavigation.js +0 -0
- package/lib/Carousel/Constants.js +3 -0
- package/lib/Carousel/dictionary.js +0 -0
- package/lib/Carousel/index.js +0 -0
- package/lib/Checkbox/Checkbox.js +0 -0
- package/lib/Checkbox/CheckboxButton.js +0 -0
- package/lib/Checkbox/CheckboxGroup.js +4 -2
- package/lib/Checkbox/CheckboxInput.js +0 -0
- package/lib/Checkbox/CheckboxInput.native.js +0 -0
- package/lib/Checkbox/index.js +0 -0
- package/lib/CheckboxCard/CheckboxCard.js +0 -0
- package/lib/CheckboxCard/index.js +0 -0
- package/lib/CheckboxCardGroup/CheckboxCardGroup.js +0 -0
- package/lib/CheckboxCardGroup/index.js +0 -0
- package/lib/ColourToggle/ColourBubble.js +0 -0
- package/lib/ColourToggle/ColourToggle.js +0 -0
- package/lib/ColourToggle/index.js +0 -0
- package/lib/Divider/Divider.js +0 -0
- package/lib/Divider/index.js +0 -0
- package/lib/DownloadApp/DownloadApp.js +0 -0
- package/lib/DownloadApp/dictionary.js +0 -0
- package/lib/DownloadApp/index.js +0 -0
- package/lib/ExpandCollapse/Accordion.js +0 -0
- package/lib/ExpandCollapse/Control.js +0 -0
- package/lib/ExpandCollapse/ExpandCollapse.js +0 -0
- package/lib/ExpandCollapse/Panel.js +0 -0
- package/lib/ExpandCollapse/dictionary.js +0 -0
- package/lib/ExpandCollapse/index.js +0 -0
- package/lib/Feedback/Feedback.js +0 -0
- package/lib/Feedback/index.js +0 -0
- package/lib/Fieldset/Fieldset.js +0 -0
- package/lib/Fieldset/FieldsetContainer.js +0 -0
- package/lib/Fieldset/FieldsetContainer.native.js +0 -0
- package/lib/Fieldset/Legend.js +0 -0
- package/lib/Fieldset/Legend.native.js +0 -0
- package/lib/Fieldset/cssReset.js +0 -0
- package/lib/Fieldset/index.js +0 -0
- package/lib/FileUpload/FileUpload.js +0 -0
- package/lib/FileUpload/NotificationContent.js +0 -0
- package/lib/FileUpload/dictionary.js +0 -0
- package/lib/FileUpload/index.js +0 -0
- package/lib/FlexGrid/Col/Col.js +0 -0
- package/lib/FlexGrid/Col/index.js +0 -0
- package/lib/FlexGrid/FlexGrid.js +0 -0
- package/lib/FlexGrid/Row/Row.js +0 -0
- package/lib/FlexGrid/Row/index.js +0 -0
- package/lib/FlexGrid/helpers/index.js +0 -0
- package/lib/FlexGrid/index.js +0 -0
- package/lib/FlexGrid/providers/GutterContext.js +0 -0
- package/lib/Footnote/Footnote.js +0 -0
- package/lib/Footnote/FootnoteLink.js +0 -0
- package/lib/Footnote/dictionary.js +0 -0
- package/lib/Footnote/index.js +0 -0
- package/lib/HorizontalScroll/HorizontalScroll.js +17 -13
- package/lib/HorizontalScroll/HorizontalScrollButton.js +0 -0
- package/lib/HorizontalScroll/ScrollViewEnd.js +0 -0
- package/lib/HorizontalScroll/ScrollViewEnd.native.js +0 -0
- package/lib/HorizontalScroll/dictionary.js +0 -0
- package/lib/HorizontalScroll/index.js +0 -0
- package/lib/HorizontalScroll/itemPositions.js +0 -0
- package/lib/Icon/Icon.js +1 -0
- package/lib/Icon/IconText.js +0 -0
- package/lib/Icon/index.js +0 -0
- package/lib/IconButton/IconButton.js +0 -0
- package/lib/IconButton/index.js +0 -0
- package/lib/InputLabel/InputLabel.js +0 -0
- package/lib/InputLabel/LabelContent.js +0 -0
- package/lib/InputLabel/LabelContent.native.js +0 -0
- package/lib/InputLabel/index.js +0 -0
- package/lib/InputSupports/InputSupports.js +3 -0
- package/lib/InputSupports/index.js +0 -0
- package/lib/InputSupports/useInputSupports.js +0 -0
- package/lib/Link/ChevronLink.js +0 -0
- package/lib/Link/InlinePressable.js +0 -0
- package/lib/Link/InlinePressable.native.js +0 -0
- package/lib/Link/Link.js +0 -0
- package/lib/Link/LinkBase.js +2 -2
- package/lib/Link/TextButton.js +0 -0
- package/lib/Link/index.js +0 -0
- package/lib/List/List.js +0 -0
- package/lib/List/ListItem.js +0 -0
- package/lib/List/ListItemBase.js +0 -0
- package/lib/List/ListItemContent.js +0 -0
- package/lib/List/ListItemMark.js +0 -0
- package/lib/List/PressableListItemBase.js +0 -0
- package/lib/List/index.js +0 -0
- package/lib/Listbox/GroupControl.js +0 -0
- package/lib/Listbox/Listbox.js +0 -0
- package/lib/Listbox/ListboxContext.js +0 -0
- package/lib/Listbox/ListboxGroup.js +0 -0
- package/lib/Listbox/ListboxItem.js +0 -0
- package/lib/Listbox/ListboxOverlay.js +0 -0
- package/lib/Listbox/PressableItem.js +0 -0
- package/lib/Listbox/index.js +0 -0
- package/lib/Modal/Modal.js +4 -0
- package/lib/Modal/ModalContent.js +27 -8
- package/lib/Modal/WebModal.js +0 -0
- package/lib/Modal/dictionary.js +0 -0
- package/lib/Modal/index.js +0 -0
- package/lib/MultiSelectFilter/ModalOverlay.js +0 -0
- package/lib/MultiSelectFilter/MultiSelectFilter.js +0 -0
- package/lib/MultiSelectFilter/dictionary.js +0 -0
- package/lib/MultiSelectFilter/index.js +0 -0
- package/lib/Notification/Notification.js +0 -0
- package/lib/Notification/dictionary.js +0 -0
- package/lib/Notification/index.js +0 -0
- package/lib/OrderedList/Item.js +0 -0
- package/lib/OrderedList/ItemBase.js +0 -0
- package/lib/OrderedList/OrderedList.js +0 -0
- package/lib/OrderedList/OrderedListBase.js +0 -0
- package/lib/OrderedList/index.js +0 -0
- package/lib/Pagination/PageButton.js +0 -0
- package/lib/Pagination/Pagination.js +0 -0
- package/lib/Pagination/SideButton.js +0 -0
- package/lib/Pagination/constants.js +0 -0
- package/lib/Pagination/dictionary.js +0 -0
- package/lib/Pagination/index.js +0 -0
- package/lib/Pagination/usePagination.js +0 -0
- package/lib/Portal/Portal.js +0 -0
- package/lib/Portal/Portal.native.js +0 -0
- package/lib/Portal/index.js +0 -0
- package/lib/PriceLockup/PriceLockup.js +0 -0
- package/lib/PriceLockup/index.js +0 -0
- package/lib/PriceLockup/utils/renderFootnoteContent.js +0 -0
- package/lib/PriceLockup/utils/renderFootnoteLinks.js +0 -0
- package/lib/PriceLockup/utils/renderPrice.js +0 -0
- package/lib/PriceLockup/utils/renderTypography.js +0 -0
- package/lib/ProductCard/ProductCard.js +0 -0
- package/lib/ProductCard/dictionary.js +0 -0
- package/lib/ProductCard/index.js +0 -0
- package/lib/ProductCardGroup/ProductCardGroup.js +0 -0
- package/lib/ProductCardGroup/index.js +0 -0
- package/lib/Progress/Progress.js +8 -2
- package/lib/Progress/ProgressBar.js +40 -12
- package/lib/Progress/ProgressBarBackground.js +4 -2
- package/lib/Progress/constants.js +4 -0
- package/lib/Progress/index.js +0 -0
- package/lib/QuickLinks/QuickLinks.js +0 -0
- package/lib/QuickLinks/QuickLinksCard.js +0 -0
- package/lib/QuickLinks/QuickLinksItem.js +0 -0
- package/lib/QuickLinks/index.js +0 -0
- package/lib/QuickLinksFeature/QuickLinksFeature.js +0 -0
- package/lib/QuickLinksFeature/QuickLinksFeatureItem.js +0 -0
- package/lib/QuickLinksFeature/index.js +0 -0
- package/lib/Radio/Radio.js +0 -0
- package/lib/Radio/RadioButton.js +0 -0
- package/lib/Radio/RadioGroup.js +0 -0
- package/lib/Radio/RadioInput.js +0 -0
- package/lib/Radio/RadioInput.native.js +0 -0
- package/lib/Radio/index.js +0 -0
- package/lib/RadioCard/RadioCard.js +0 -0
- package/lib/RadioCard/RadioCardGroup.js +0 -0
- package/lib/RadioCard/index.js +0 -0
- package/lib/Responsive/Responsive.js +0 -0
- package/lib/Responsive/ResponsiveProp.js +0 -0
- package/lib/Responsive/ResponsiveWithMediaQueryStyleSheet.js +0 -0
- package/lib/Responsive/index.js +0 -0
- package/lib/Search/Search.js +2 -2
- package/lib/Search/dictionary.js +0 -0
- package/lib/Search/index.js +0 -0
- package/lib/Select/Group.js +0 -0
- package/lib/Select/Group.native.js +0 -0
- package/lib/Select/Item.js +0 -0
- package/lib/Select/Item.native.js +0 -0
- package/lib/Select/Picker.js +0 -0
- package/lib/Select/Picker.native.js +1 -0
- package/lib/Select/Select.js +1 -4
- package/lib/Select/constants.js +0 -0
- package/lib/Select/index.js +0 -0
- package/lib/SideNav/Item.js +0 -0
- package/lib/SideNav/ItemContent.js +0 -0
- package/lib/SideNav/ItemsGroup.js +0 -0
- package/lib/SideNav/SideNav.js +0 -0
- package/lib/SideNav/index.js +0 -0
- package/lib/Skeleton/Skeleton.js +0 -0
- package/lib/Skeleton/index.js +0 -0
- package/lib/Skeleton/skeleton.constant.js +0 -0
- package/lib/Skeleton/skeletonWebAnimation.js +0 -0
- package/lib/Skeleton/useSkeletonNativeAnimation.js +0 -0
- package/lib/SkipLink/SkipLink.js +0 -0
- package/lib/SkipLink/index.js +0 -0
- package/lib/Spacer/Spacer.js +0 -0
- package/lib/Spacer/index.js +0 -0
- package/lib/StackView/StackView.js +0 -0
- package/lib/StackView/StackWrap.js +0 -0
- package/lib/StackView/StackWrap.native.js +0 -0
- package/lib/StackView/StackWrapBox.js +0 -0
- package/lib/StackView/StackWrapGap.js +0 -0
- package/lib/StackView/common.js +0 -0
- package/lib/StackView/getStackedContent.js +0 -0
- package/lib/StackView/index.js +0 -0
- package/lib/Status/Status.js +6 -2
- package/lib/Status/index.js +0 -0
- package/lib/StepTracker/Step.js +0 -0
- package/lib/StepTracker/StepTracker.js +0 -0
- package/lib/StepTracker/dictionary.js +0 -0
- package/lib/StepTracker/index.js +0 -0
- package/lib/TabBar/TabBar.js +0 -0
- package/lib/TabBar/TabBarItem.js +0 -0
- package/lib/TabBar/index.js +0 -0
- package/lib/Tabs/Tabs.js +0 -0
- package/lib/Tabs/TabsItem.js +0 -0
- package/lib/Tabs/index.js +0 -0
- package/lib/Tags/Tags.js +0 -0
- package/lib/Tags/index.js +0 -0
- package/lib/TextInput/TextArea.js +0 -0
- package/lib/TextInput/TextInput.js +0 -0
- package/lib/TextInput/TextInputBase.js +2 -2
- package/lib/TextInput/dictionary.js +0 -0
- package/lib/TextInput/index.js +0 -0
- package/lib/TextInput/propTypes.js +0 -0
- package/lib/ThemeProvider/ThemeProvider.js +0 -0
- package/lib/ThemeProvider/index.js +0 -0
- package/lib/ThemeProvider/useResponsiveThemeTokens.js +0 -0
- package/lib/ThemeProvider/useSetTheme.js +0 -0
- package/lib/ThemeProvider/useTheme.js +0 -0
- package/lib/ThemeProvider/useThemeTokens.js +0 -0
- package/lib/ThemeProvider/utils/index.js +0 -0
- package/lib/ThemeProvider/utils/styles.js +0 -0
- package/lib/ThemeProvider/utils/theme-tokens.js +0 -0
- package/lib/Timeline/Timeline.js +0 -0
- package/lib/Timeline/index.js +0 -0
- package/lib/ToggleSwitch/ToggleSwitch.js +0 -0
- package/lib/ToggleSwitch/ToggleSwitchGroup.js +0 -0
- package/lib/ToggleSwitch/index.js +0 -0
- package/lib/Tooltip/Backdrop.js +0 -0
- package/lib/Tooltip/Backdrop.native.js +0 -0
- package/lib/Tooltip/Tooltip.js +22 -13
- package/lib/Tooltip/Tooltip.native.js +24 -15
- package/lib/Tooltip/dictionary.js +0 -0
- package/lib/Tooltip/getTooltipPosition.js +0 -0
- package/lib/Tooltip/index.js +0 -0
- package/lib/Tooltip/shared.js +0 -0
- package/lib/TooltipButton/TooltipButton.js +0 -0
- package/lib/TooltipButton/index.js +0 -0
- package/lib/Typography/Typography.js +0 -0
- package/lib/Typography/index.js +0 -0
- package/lib/Validator/Validator.js +4 -0
- package/lib/Validator/index.js +0 -0
- package/lib/ViewportProvider/ViewportProvider.js +0 -0
- package/lib/ViewportProvider/index.js +0 -0
- package/lib/ViewportProvider/useViewport.js +0 -0
- package/lib/ViewportProvider/useViewportListener.js +0 -0
- package/lib/index.js +0 -0
- package/lib/server.js +0 -0
- package/lib/utils/BaseView/BaseView.js +0 -0
- package/lib/utils/BaseView/BaseView.native.js +0 -0
- package/lib/utils/BaseView/index.js +0 -0
- package/lib/utils/a11y/index.js +0 -0
- package/lib/utils/a11y/semantics.js +0 -0
- package/lib/utils/a11y/textSize.js +0 -0
- package/lib/utils/animation/index.js +0 -0
- package/lib/utils/animation/useVerticalExpandAnimation.js +0 -0
- package/lib/utils/children.js +0 -0
- package/lib/utils/containUniqueFields.js +0 -0
- package/lib/utils/convertFromMegaByteToByte.js +0 -0
- package/lib/utils/floating-ui/index.js +0 -0
- package/lib/utils/floating-ui/index.native.js +0 -0
- package/lib/utils/formatImageSource.js +0 -0
- package/lib/utils/hasOwnProperty.js +0 -0
- package/lib/utils/htmlAttrs.js +0 -0
- package/lib/utils/index.js +0 -0
- package/lib/utils/info/index.js +0 -0
- package/lib/utils/info/platform/index.js +0 -0
- package/lib/utils/info/platform/platform.android.js +0 -0
- package/lib/utils/info/platform/platform.ios.js +0 -0
- package/lib/utils/info/platform/platform.js +0 -0
- package/lib/utils/info/platform/platform.native.js +0 -0
- package/lib/utils/info/versions.js +0 -0
- package/lib/utils/input.js +0 -0
- package/lib/utils/pressability.js +0 -0
- package/lib/utils/props/a11yProps.js +0 -0
- package/lib/utils/props/clickProps.js +0 -0
- package/lib/utils/props/componentPropType.js +0 -0
- package/lib/utils/props/contentfulProps.js +22 -0
- package/lib/utils/props/copyPropTypes.js +0 -0
- package/lib/utils/props/getPropSelector.js +0 -0
- package/lib/utils/props/handlerProps.js +0 -0
- package/lib/utils/props/hrefAttrsProp.js +0 -0
- package/lib/utils/props/index.js +2 -1
- package/lib/utils/props/inputSupportsProps.js +0 -0
- package/lib/utils/props/linkProps.js +0 -0
- package/lib/utils/props/paddingProp.js +0 -0
- package/lib/utils/props/pressProps.js +0 -0
- package/lib/utils/props/rectProp.js +0 -0
- package/lib/utils/props/responsiveProps.js +0 -0
- package/lib/utils/props/selectSystemProps.js +0 -0
- package/lib/utils/props/spacingProps.js +0 -0
- package/lib/utils/props/textInputProps.js +0 -0
- package/lib/utils/props/textProps.js +0 -0
- package/lib/utils/props/tokens.js +0 -0
- package/lib/utils/props/variantProp.js +0 -0
- package/lib/utils/props/viewProps.js +0 -0
- package/lib/utils/ssr-media-query/create-stylesheet/create-stylesheet-mobile.js +0 -0
- package/lib/utils/ssr-media-query/create-stylesheet/index.android.js +0 -0
- package/lib/utils/ssr-media-query/create-stylesheet/index.ios.js +0 -0
- package/lib/utils/ssr-media-query/create-stylesheet/index.js +0 -0
- package/lib/utils/ssr-media-query/hash.js +0 -0
- package/lib/utils/ssr-media-query/index.js +0 -0
- package/lib/utils/ssr-media-query/utils/common.js +0 -0
- package/lib/utils/ssr-media-query/utils/create-declaration-block.js +0 -0
- package/lib/utils/ssr-media-query/utils/create-media-query-styles.js +0 -0
- package/lib/utils/ssr-media-query/utils/hyphenate-style-name.js +0 -0
- package/lib/utils/ssr-media-query/utils/inject.js +0 -0
- package/lib/utils/ssr.js +0 -0
- package/lib/utils/transformGradient.js +0 -0
- package/lib/utils/useCopy.js +0 -0
- package/lib/utils/useHash.js +0 -0
- package/lib/utils/useHash.native.js +0 -0
- package/lib/utils/useOverlaidPosition.js +0 -0
- package/lib/utils/useResponsiveProp.js +0 -0
- package/lib/utils/useSafeLayoutEffect.js +0 -0
- package/lib/utils/useScrollBlocking.js +0 -0
- package/lib/utils/useScrollBlocking.native.js +0 -0
- package/lib/utils/useSpacingScale.js +0 -0
- package/lib/utils/useUniqueId.js +0 -0
- package/lib/utils/withLinkRouter.js +0 -0
- package/package.json +2 -2
- package/src/Card/PressableCardBase.jsx +1 -1
- package/src/Carousel/Carousel.jsx +166 -34
- package/src/Carousel/CarouselItem/CarouselItem.jsx +56 -26
- package/src/Carousel/CarouselStepTracker/CarouselStepTracker.jsx +71 -37
- package/src/Carousel/Constants.js +3 -0
- package/src/Checkbox/CheckboxGroup.jsx +7 -3
- package/src/HorizontalScroll/HorizontalScroll.jsx +19 -15
- package/src/Icon/Icon.jsx +1 -0
- package/src/InputSupports/InputSupports.jsx +1 -0
- package/src/Link/LinkBase.jsx +8 -2
- package/src/Modal/Modal.jsx +4 -0
- package/src/Modal/ModalContent.jsx +23 -7
- package/src/Progress/Progress.jsx +12 -2
- package/src/Progress/ProgressBar.jsx +48 -13
- package/src/Progress/ProgressBarBackground.jsx +4 -2
- package/src/Progress/constants.js +4 -0
- package/src/Search/Search.jsx +7 -2
- package/src/Select/Picker.native.jsx +1 -0
- package/src/Select/Select.jsx +8 -9
- package/src/Status/Status.jsx +2 -2
- package/src/TextInput/TextInputBase.jsx +2 -2
- package/src/Tooltip/Tooltip.jsx +6 -1
- package/src/Tooltip/Tooltip.native.jsx +7 -1
- package/src/Validator/Validator.jsx +7 -1
- package/src/utils/props/contentfulProps.js +24 -0
- package/src/utils/props/index.js +1 -0
|
@@ -134,7 +134,10 @@ const CheckboxGroup = React.forwardRef(
|
|
|
134
134
|
}
|
|
135
135
|
|
|
136
136
|
const checkboxes = items.map(
|
|
137
|
-
(
|
|
137
|
+
(
|
|
138
|
+
{ label, id, onChange: itemOnChange, ref: itemRef, inactive: itemInactive, ...itemRest },
|
|
139
|
+
index
|
|
140
|
+
) => {
|
|
138
141
|
const checkboxId = id || `Checkbox[${index}]`
|
|
139
142
|
const handleChange = (newCheckedState, event) => {
|
|
140
143
|
if (typeof itemOnChange === 'function') itemOnChange(newCheckedState, event)
|
|
@@ -148,7 +151,7 @@ const CheckboxGroup = React.forwardRef(
|
|
|
148
151
|
id={checkboxId}
|
|
149
152
|
checked={currentValues.includes(checkboxId)}
|
|
150
153
|
onChange={handleChange}
|
|
151
|
-
inactive={
|
|
154
|
+
inactive={itemInactive}
|
|
152
155
|
label={label}
|
|
153
156
|
name={inputGroupName}
|
|
154
157
|
tokens={radioTokens}
|
|
@@ -206,7 +209,8 @@ CheckboxGroup.propTypes = {
|
|
|
206
209
|
label: PropTypes.string,
|
|
207
210
|
id: PropTypes.string,
|
|
208
211
|
onChange: PropTypes.func,
|
|
209
|
-
ref: ABBPropTypes.ref()
|
|
212
|
+
ref: ABBPropTypes.ref(),
|
|
213
|
+
inactive: PropTypes.bool
|
|
210
214
|
})
|
|
211
215
|
),
|
|
212
216
|
/**
|
|
@@ -26,6 +26,11 @@ const tokenKeys = [
|
|
|
26
26
|
export const selectHorizontalScrollTokens = (themeTokens, prefix) =>
|
|
27
27
|
selectTokens(tokenKeys, themeTokens, prefix)
|
|
28
28
|
|
|
29
|
+
const selectBorderStyles = (borderBottomWidth, borderBottomColor) => ({
|
|
30
|
+
borderBottomWidth,
|
|
31
|
+
borderBottomColor
|
|
32
|
+
})
|
|
33
|
+
|
|
29
34
|
/**
|
|
30
35
|
* Base component that scrolls horizontally and displays left and right buttons if
|
|
31
36
|
* there is content to the left and the right which can be scrolled to.
|
|
@@ -120,21 +125,20 @@ const HorizontalScroll = React.forwardRef(
|
|
|
120
125
|
// Apply a fixed margin gutter that tab highlight effects can overhang without getting trimmed.
|
|
121
126
|
return (
|
|
122
127
|
<View ref={ref} style={staticStyles.container}>
|
|
123
|
-
<
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
staticStyles.scrollContainer
|
|
132
|
-
{
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
</ScrollViewEnd>
|
|
128
|
+
<View style={selectBorderStyles(borderBottomWidth, borderBottomColor)}>
|
|
129
|
+
<ScrollViewEnd
|
|
130
|
+
onScrollEnd={handleScrollEnd}
|
|
131
|
+
ref={scrollRef}
|
|
132
|
+
horizontal
|
|
133
|
+
onContentSizeChange={handleContentWidth}
|
|
134
|
+
onLayout={handleContainerLayout}
|
|
135
|
+
showsHorizontalScrollIndicator={false}
|
|
136
|
+
contentContainerStyle={staticStyles.scrollContainer}
|
|
137
|
+
{...selectProps(rest)}
|
|
138
|
+
>
|
|
139
|
+
{children}
|
|
140
|
+
</ScrollViewEnd>
|
|
141
|
+
</View>
|
|
138
142
|
{showPreviousButton && (
|
|
139
143
|
<ScrollButton
|
|
140
144
|
icon={previousIcon}
|
package/src/Icon/Icon.jsx
CHANGED
package/src/Link/LinkBase.jsx
CHANGED
|
@@ -9,7 +9,8 @@ import {
|
|
|
9
9
|
linkProps,
|
|
10
10
|
selectSystemProps,
|
|
11
11
|
variantProp,
|
|
12
|
-
viewProps
|
|
12
|
+
viewProps,
|
|
13
|
+
contentfulProps
|
|
13
14
|
} from '../utils/props'
|
|
14
15
|
import { resolvePressableTokens } from '../utils/pressability'
|
|
15
16
|
import { withLinkRouter } from '../utils'
|
|
@@ -18,7 +19,12 @@ import InlinePressable from './InlinePressable'
|
|
|
18
19
|
import { applyTextStyles, applyOuterBorder, useTheme } from '../ThemeProvider'
|
|
19
20
|
import { IconText, iconComponentPropTypes } from '../Icon'
|
|
20
21
|
|
|
21
|
-
const [selectProps, selectedSystemPropTypes] = selectSystemProps([
|
|
22
|
+
const [selectProps, selectedSystemPropTypes] = selectSystemProps([
|
|
23
|
+
a11yProps,
|
|
24
|
+
linkProps,
|
|
25
|
+
viewProps,
|
|
26
|
+
contentfulProps
|
|
27
|
+
])
|
|
22
28
|
|
|
23
29
|
const selectOuterBorderStyles = ({
|
|
24
30
|
outerBorderColor,
|
package/src/Modal/Modal.jsx
CHANGED
|
@@ -46,7 +46,9 @@ const selectContainerStyles = ({
|
|
|
46
46
|
|
|
47
47
|
const selectModalStyles = ({
|
|
48
48
|
backgroundColor,
|
|
49
|
+
borderColor,
|
|
49
50
|
borderRadius,
|
|
51
|
+
borderWidth,
|
|
50
52
|
height,
|
|
51
53
|
paddingLeft,
|
|
52
54
|
paddingRight,
|
|
@@ -55,7 +57,9 @@ const selectModalStyles = ({
|
|
|
55
57
|
shadow
|
|
56
58
|
}) => ({
|
|
57
59
|
backgroundColor,
|
|
60
|
+
borderColor,
|
|
58
61
|
borderRadius,
|
|
62
|
+
borderWidth,
|
|
59
63
|
height,
|
|
60
64
|
paddingLeft,
|
|
61
65
|
paddingRight,
|
|
@@ -51,6 +51,26 @@ const ModalContent = React.forwardRef(
|
|
|
51
51
|
const hasCancelButton = cancelButtonText !== undefined && onCancel !== undefined
|
|
52
52
|
const hasHeadingSection = Boolean(heading || subHeading)
|
|
53
53
|
|
|
54
|
+
const selectHeadingContainerStyles = ({
|
|
55
|
+
paddingLeft,
|
|
56
|
+
paddingRight,
|
|
57
|
+
marginLeft,
|
|
58
|
+
marginRight,
|
|
59
|
+
borderColor,
|
|
60
|
+
headingBorderBottomWidth,
|
|
61
|
+
headingPaddingRight,
|
|
62
|
+
headingPaddingTop
|
|
63
|
+
}) => ({
|
|
64
|
+
flexDirection: 'column',
|
|
65
|
+
marginLeft: -marginLeft,
|
|
66
|
+
marginRight: -marginRight,
|
|
67
|
+
paddingLeft,
|
|
68
|
+
paddingTop: headingPaddingTop,
|
|
69
|
+
paddingRight: paddingRight + headingPaddingRight,
|
|
70
|
+
borderBottomColor: borderColor,
|
|
71
|
+
borderBottomWidth: headingBorderBottomWidth
|
|
72
|
+
})
|
|
73
|
+
|
|
54
74
|
const selectFooterContainerStyles = ({
|
|
55
75
|
paddingLeft,
|
|
56
76
|
paddingRight,
|
|
@@ -75,12 +95,6 @@ const ModalContent = React.forwardRef(
|
|
|
75
95
|
borderTopColor: borderColor
|
|
76
96
|
})
|
|
77
97
|
|
|
78
|
-
const headingStyles = {
|
|
79
|
-
flexDirection: 'column',
|
|
80
|
-
paddingTop: 8,
|
|
81
|
-
paddingRight: themeTokens.headingPaddingRight
|
|
82
|
-
}
|
|
83
|
-
|
|
84
98
|
const subheadingStyles = {
|
|
85
99
|
marginTop: themeTokens.subHeadingMarginTop
|
|
86
100
|
}
|
|
@@ -88,7 +102,7 @@ const ModalContent = React.forwardRef(
|
|
|
88
102
|
return (
|
|
89
103
|
<View style={styles.modalContent} ref={ref}>
|
|
90
104
|
{hasHeadingSection && (
|
|
91
|
-
<View style={
|
|
105
|
+
<View style={selectHeadingContainerStyles(themeTokens)}>
|
|
92
106
|
{heading && (
|
|
93
107
|
<Typography
|
|
94
108
|
variant={{ size: headingLevel }}
|
|
@@ -110,6 +124,8 @@ const ModalContent = React.forwardRef(
|
|
|
110
124
|
<Box
|
|
111
125
|
scroll={{ onContentSizeChange, showsVerticalScrollIndicator: true }}
|
|
112
126
|
onLayout={handleContainerLayout}
|
|
127
|
+
top={themeTokens.contentPaddingTop}
|
|
128
|
+
bottom={themeTokens.contentPaddingBottom}
|
|
113
129
|
>
|
|
114
130
|
<Typography>{bodyText}</Typography>
|
|
115
131
|
</Box>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import PropTypes from 'prop-types'
|
|
3
|
-
import { View } from 'react-native'
|
|
3
|
+
import { View, StyleSheet } from 'react-native'
|
|
4
4
|
|
|
5
5
|
import { applyShadowToken, useThemeTokens } from '../ThemeProvider'
|
|
6
6
|
import { a11yProps, getTokensPropType, selectSystemProps, variantProp, viewProps } from '../utils'
|
|
@@ -57,7 +57,11 @@ const Progress = React.forwardRef(({ children, tokens, variant, ...rest }, ref)
|
|
|
57
57
|
const themeTokens = useThemeTokens('Progress', tokens, variant)
|
|
58
58
|
|
|
59
59
|
return (
|
|
60
|
-
<View
|
|
60
|
+
<View
|
|
61
|
+
ref={ref}
|
|
62
|
+
style={[staticStyles.progressContainer, selectProgressStyles(themeTokens)]}
|
|
63
|
+
{...selectProps(rest)}
|
|
64
|
+
>
|
|
61
65
|
{children}
|
|
62
66
|
</View>
|
|
63
67
|
)
|
|
@@ -81,3 +85,9 @@ Progress.propTypes = {
|
|
|
81
85
|
}
|
|
82
86
|
|
|
83
87
|
export default Progress
|
|
88
|
+
|
|
89
|
+
const staticStyles = StyleSheet.create({
|
|
90
|
+
progressContainer: {
|
|
91
|
+
position: 'relative'
|
|
92
|
+
}
|
|
93
|
+
})
|
|
@@ -5,19 +5,22 @@ import { Platform, StyleSheet, View } from 'react-native'
|
|
|
5
5
|
import ProgressBarBackground from './ProgressBarBackground'
|
|
6
6
|
import { applyShadowToken, useThemeTokens } from '../ThemeProvider'
|
|
7
7
|
import { a11yProps, getTokensPropType, selectSystemProps, variantProp, viewProps } from '../utils'
|
|
8
|
+
import { MAX_PERCENT_VALUE, MIN_PERCENT_VALUE } from './constants'
|
|
8
9
|
|
|
9
10
|
const [selectProps, selectedSystemPropTypes] = selectSystemProps([a11yProps, viewProps])
|
|
10
11
|
|
|
11
12
|
const selectBarStyles = (
|
|
12
13
|
{ backgroundColor, borderRadius, outlineWidth, outlineColor, shadow },
|
|
13
|
-
|
|
14
|
+
calculatedPercentage,
|
|
15
|
+
barPosition
|
|
14
16
|
) => ({
|
|
15
17
|
backgroundColor,
|
|
16
18
|
borderRadius,
|
|
17
19
|
outlineWidth,
|
|
18
20
|
outlineColor,
|
|
19
21
|
...applyShadowToken(shadow),
|
|
20
|
-
width: `${
|
|
22
|
+
width: `${calculatedPercentage}%`,
|
|
23
|
+
left: `${barPosition}%`
|
|
21
24
|
})
|
|
22
25
|
|
|
23
26
|
/**
|
|
@@ -56,28 +59,52 @@ const selectBarStyles = (
|
|
|
56
59
|
*
|
|
57
60
|
*/
|
|
58
61
|
const ProgressBar = React.forwardRef(
|
|
59
|
-
(
|
|
62
|
+
(
|
|
63
|
+
{
|
|
64
|
+
children = null,
|
|
65
|
+
percentage = 0,
|
|
66
|
+
tokens,
|
|
67
|
+
variant,
|
|
68
|
+
offset = { items: 0, current: 1 },
|
|
69
|
+
...rest
|
|
70
|
+
},
|
|
71
|
+
ref
|
|
72
|
+
) => {
|
|
73
|
+
const { items, current } = offset
|
|
74
|
+
let calculatedPercentage = percentage
|
|
75
|
+
let barPosition = MIN_PERCENT_VALUE
|
|
76
|
+
const validItems = items > MIN_PERCENT_VALUE
|
|
77
|
+
if (validItems) {
|
|
78
|
+
calculatedPercentage = MAX_PERCENT_VALUE / items
|
|
79
|
+
barPosition = calculatedPercentage * (current < 1 ? MIN_PERCENT_VALUE : current - 1)
|
|
80
|
+
if (current > items) {
|
|
81
|
+
barPosition = calculatedPercentage * (items - 1)
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
60
85
|
const themeTokens = useThemeTokens('ProgressBar', tokens, variant)
|
|
61
|
-
if (percentage <
|
|
86
|
+
if (percentage < MIN_PERCENT_VALUE) {
|
|
62
87
|
throw new Error('ProgressBar: `percentage` must be a positive number')
|
|
63
|
-
} else if (percentage >
|
|
88
|
+
} else if (percentage > MAX_PERCENT_VALUE) {
|
|
64
89
|
throw new Error('ProgressBar: `percentage` cannot exceed 100')
|
|
65
90
|
}
|
|
66
91
|
const selectedProps = selectProps({
|
|
67
92
|
accessibilityRole: 'progressbar',
|
|
68
93
|
accessibilityValue: {
|
|
69
|
-
min:
|
|
70
|
-
max:
|
|
71
|
-
now:
|
|
72
|
-
text: `${
|
|
94
|
+
min: MIN_PERCENT_VALUE,
|
|
95
|
+
max: MAX_PERCENT_VALUE,
|
|
96
|
+
now: calculatedPercentage.toFixed(2),
|
|
97
|
+
text: `${
|
|
98
|
+
validItems ? (barPosition + calculatedPercentage).toFixed(2) : calculatedPercentage
|
|
99
|
+
}%`
|
|
73
100
|
},
|
|
74
101
|
...rest
|
|
75
102
|
})
|
|
76
103
|
|
|
77
|
-
return percentage >
|
|
104
|
+
return percentage > MIN_PERCENT_VALUE || items ? (
|
|
78
105
|
<View
|
|
79
106
|
ref={ref}
|
|
80
|
-
style={[staticStyles.bar, selectBarStyles(themeTokens,
|
|
107
|
+
style={[staticStyles.bar, selectBarStyles(themeTokens, calculatedPercentage, barPosition)]}
|
|
81
108
|
{...selectedProps}
|
|
82
109
|
>
|
|
83
110
|
{children ?? <ProgressBarBackground variant={variant} />}
|
|
@@ -108,7 +135,15 @@ ProgressBar.propTypes = {
|
|
|
108
135
|
/**
|
|
109
136
|
* Progress bar variant.
|
|
110
137
|
*/
|
|
111
|
-
variant: variantProp.propType
|
|
138
|
+
variant: variantProp.propType,
|
|
139
|
+
/**
|
|
140
|
+
* Using the offset object, the `items` will determine the total number of items.
|
|
141
|
+
* The `current` will determine the current position of the progress bar.
|
|
142
|
+
*/
|
|
143
|
+
offset: PropTypes.shape({
|
|
144
|
+
items: PropTypes.number,
|
|
145
|
+
current: PropTypes.number
|
|
146
|
+
})
|
|
112
147
|
}
|
|
113
148
|
|
|
114
149
|
export default ProgressBar
|
|
@@ -117,7 +152,7 @@ const staticStyles = StyleSheet.create({
|
|
|
117
152
|
bar: {
|
|
118
153
|
height: '100%',
|
|
119
154
|
overflow: 'hidden',
|
|
120
|
-
position: '
|
|
155
|
+
position: 'relative',
|
|
121
156
|
...Platform.select({
|
|
122
157
|
web: {
|
|
123
158
|
outlineStyle: 'solid'
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import { ImageBackground, StyleSheet } from 'react-native'
|
|
3
|
+
import { INACTIVE_VARIANT, NEGATIVE_VARIANT } from './constants'
|
|
3
4
|
|
|
4
5
|
import { variantProp } from '../utils'
|
|
5
6
|
|
|
@@ -8,9 +9,10 @@ const negativeBackground = `%3Csvg xmlns='http://www.w3.org/2000/svg' width='100
|
|
|
8
9
|
|
|
9
10
|
const ProgressBarBackground = React.forwardRef(({ variant }, ref) => {
|
|
10
11
|
let source = null
|
|
11
|
-
|
|
12
|
+
// TODO: Remove the `variant?.inactive` & `variant?.negative` to complete the deprecation
|
|
13
|
+
if (variant?.inactive || variant?.style === INACTIVE_VARIANT) {
|
|
12
14
|
source = inactiveBackground
|
|
13
|
-
} else if (variant?.negative) {
|
|
15
|
+
} else if (variant?.negative || variant?.style === NEGATIVE_VARIANT) {
|
|
14
16
|
source = negativeBackground
|
|
15
17
|
} else {
|
|
16
18
|
return null
|
package/src/Search/Search.jsx
CHANGED
|
@@ -13,14 +13,19 @@ import {
|
|
|
13
13
|
textInputHandlerProps,
|
|
14
14
|
textInputProps,
|
|
15
15
|
variantProp,
|
|
16
|
-
viewProps
|
|
16
|
+
viewProps,
|
|
17
|
+
contentfulProps
|
|
17
18
|
} from '../utils'
|
|
18
19
|
import TextInputBase from '../TextInput/TextInputBase'
|
|
19
20
|
import ButtonBase from '../Button/ButtonBase'
|
|
20
21
|
import useCopy from '../utils/useCopy'
|
|
21
22
|
import dictionary from './dictionary'
|
|
22
23
|
|
|
23
|
-
const [selectContainerProps, selectedContainerPropTypes] = selectSystemProps([
|
|
24
|
+
const [selectContainerProps, selectedContainerPropTypes] = selectSystemProps([
|
|
25
|
+
a11yProps,
|
|
26
|
+
viewProps,
|
|
27
|
+
contentfulProps
|
|
28
|
+
])
|
|
24
29
|
const [selectInputProps, selectedInputPropTypes] = selectSystemProps([
|
|
25
30
|
textInputHandlerProps,
|
|
26
31
|
textInputProps
|
package/src/Select/Select.jsx
CHANGED
|
@@ -271,15 +271,14 @@ const Select = React.forwardRef(
|
|
|
271
271
|
<ValidationIconComponent {...selectValidationIconTokens(themeTokens)} />
|
|
272
272
|
</View>
|
|
273
273
|
)}
|
|
274
|
-
{IconComponent &&
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
)}
|
|
274
|
+
{IconComponent && (
|
|
275
|
+
<View
|
|
276
|
+
pointerEvents="none"
|
|
277
|
+
style={[staticStyles.iconContainer, selectIconContainerStyles(themeTokens)]}
|
|
278
|
+
>
|
|
279
|
+
<IconComponent {...selectIconTokens(themeTokens)} />
|
|
280
|
+
</View>
|
|
281
|
+
)}
|
|
283
282
|
</View>
|
|
284
283
|
)}
|
|
285
284
|
</InputSupports>
|
package/src/Status/Status.jsx
CHANGED
|
@@ -57,9 +57,9 @@ const selectContainerStyles = ({
|
|
|
57
57
|
return styles
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
-
const selectIconProps = ({ icon, iconColor }) => ({
|
|
60
|
+
const selectIconProps = ({ icon, iconColor, iconSize, iconPaddingTop }) => ({
|
|
61
61
|
icon,
|
|
62
|
-
tokens: { color: iconColor },
|
|
62
|
+
tokens: { color: iconColor, paddingTop: iconPaddingTop, size: iconSize },
|
|
63
63
|
variant: { size: 'small' }
|
|
64
64
|
})
|
|
65
65
|
|
|
@@ -295,7 +295,7 @@ const TextInputBase = React.forwardRef(
|
|
|
295
295
|
textInputButtons?.unshift(
|
|
296
296
|
<IconButton
|
|
297
297
|
accessibilityLabel={
|
|
298
|
-
|
|
298
|
+
showPassword
|
|
299
299
|
? getCopy('hidePasswordAccessibilityLabel')
|
|
300
300
|
: getCopy('showPasswordAccessibilityLabel')
|
|
301
301
|
}
|
|
@@ -363,7 +363,7 @@ const TextInputBase = React.forwardRef(
|
|
|
363
363
|
<IconComponent {...selectIconTokens(themeTokens)} />
|
|
364
364
|
</View>
|
|
365
365
|
)}
|
|
366
|
-
{buttons?.length > 0 && (
|
|
366
|
+
{buttons?.length > 0 && !inactive && (
|
|
367
367
|
<View style={[staticStyles.buttonsContainer, selectButtonsContainerStyle(themeTokens)]}>
|
|
368
368
|
<StackView direction="row" space={buttonsGap}>
|
|
369
369
|
{textInputButtons}
|
package/src/Tooltip/Tooltip.jsx
CHANGED
|
@@ -31,6 +31,11 @@ const selectTooltipShadowStyles = ({ shadow, borderRadius }) => ({
|
|
|
31
31
|
...applyShadowToken(shadow)
|
|
32
32
|
})
|
|
33
33
|
|
|
34
|
+
const selectToolTipSizeStyles = ({ maxWidth, minWidth }) => ({
|
|
35
|
+
maxWidth,
|
|
36
|
+
minWidth
|
|
37
|
+
})
|
|
38
|
+
|
|
34
39
|
const selectMobileTooltipPositionStyles = ({ top, left, position }) => {
|
|
35
40
|
return { top, left, position }
|
|
36
41
|
}
|
|
@@ -206,6 +211,7 @@ const Tooltip = React.forwardRef(
|
|
|
206
211
|
style={[
|
|
207
212
|
selectTooltipShadowStyles(themeTokens),
|
|
208
213
|
staticStyles.tooltip, // applied separately so that it doesn't cover the arrow
|
|
214
|
+
selectToolTipSizeStyles,
|
|
209
215
|
selectMobileTooltipPositionStyles({
|
|
210
216
|
position: strategy,
|
|
211
217
|
top: y ?? 0,
|
|
@@ -250,7 +256,6 @@ const staticStyles = StyleSheet.create({
|
|
|
250
256
|
},
|
|
251
257
|
tooltip: {
|
|
252
258
|
position: 'absolute',
|
|
253
|
-
maxWidth: 240,
|
|
254
259
|
top: 0,
|
|
255
260
|
left: 0
|
|
256
261
|
},
|
|
@@ -31,6 +31,12 @@ const selectTooltipShadowStyles = ({ shadow, borderRadius }) => ({
|
|
|
31
31
|
borderRadius,
|
|
32
32
|
...applyShadowToken(shadow)
|
|
33
33
|
})
|
|
34
|
+
|
|
35
|
+
const selectToolTipSizeStyles = ({ maxWidth, minWidth }) => ({
|
|
36
|
+
maxWidth,
|
|
37
|
+
minWidth
|
|
38
|
+
})
|
|
39
|
+
|
|
34
40
|
const selectTooltipPositionStyles = ({ top, left, width }) => {
|
|
35
41
|
return { top, left, width }
|
|
36
42
|
}
|
|
@@ -294,6 +300,7 @@ const Tooltip = React.forwardRef(
|
|
|
294
300
|
style={[
|
|
295
301
|
staticStyles.tooltip,
|
|
296
302
|
selectTooltipShadowStyles(themeTokens), // applied separately so that it doesn't cover the arrow
|
|
303
|
+
selectToolTipSizeStyles(themeTokens),
|
|
297
304
|
tooltipPosition && selectTooltipPositionStyles(tooltipPosition),
|
|
298
305
|
(tooltipPosition === null || tooltipPosition?.isNormalized) &&
|
|
299
306
|
staticStyles.tooltipHidden // visually hide the tooltip until we have a final measurement
|
|
@@ -332,7 +339,6 @@ const staticStyles = StyleSheet.create({
|
|
|
332
339
|
},
|
|
333
340
|
tooltip: {
|
|
334
341
|
position: 'absolute',
|
|
335
|
-
maxWidth: 240,
|
|
336
342
|
top: 0,
|
|
337
343
|
left: 0
|
|
338
344
|
},
|
|
@@ -191,7 +191,13 @@ const Validator = React.forwardRef(
|
|
|
191
191
|
}, [])
|
|
192
192
|
|
|
193
193
|
return (
|
|
194
|
-
<InputSupports
|
|
194
|
+
<InputSupports
|
|
195
|
+
{...supportsProps}
|
|
196
|
+
feedbackProps={{
|
|
197
|
+
...rest?.feedbackProps,
|
|
198
|
+
showFeedbackIcon: true
|
|
199
|
+
}}
|
|
200
|
+
>
|
|
195
201
|
<StackView space={2} direction="row" ref={codeRef}>
|
|
196
202
|
{getCodeComponents()}
|
|
197
203
|
</StackView>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import PropTypes from 'prop-types'
|
|
2
|
+
import { Platform } from 'react-native'
|
|
3
|
+
import getPropSelector from './getPropSelector'
|
|
4
|
+
|
|
5
|
+
const contentfulPropsTypes = {
|
|
6
|
+
...Platform.select({
|
|
7
|
+
web: {
|
|
8
|
+
'data-contentful-field-id': PropTypes.string,
|
|
9
|
+
'data-contentful-entry-id': PropTypes.string
|
|
10
|
+
},
|
|
11
|
+
default: {}
|
|
12
|
+
})
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export default {
|
|
16
|
+
/**
|
|
17
|
+
* Set of contentful properties used for the content preview inspector.
|
|
18
|
+
*/
|
|
19
|
+
types: contentfulPropsTypes,
|
|
20
|
+
/**
|
|
21
|
+
* Filters a props object, returning only contentful props.
|
|
22
|
+
*/
|
|
23
|
+
select: getPropSelector(contentfulPropsTypes)
|
|
24
|
+
}
|
package/src/utils/props/index.js
CHANGED
|
@@ -17,3 +17,4 @@ export { default as textInputProps } from './textInputProps'
|
|
|
17
17
|
export { default as textProps } from './textProps'
|
|
18
18
|
export { default as variantProp } from './variantProp'
|
|
19
19
|
export { default as viewProps } from './viewProps'
|
|
20
|
+
export { default as contentfulProps } from './contentfulProps'
|