@telus-uds/components-web 2.43.0 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.cjs +26 -0
- package/CHANGELOG.md +21 -2
- package/babel.config.cjs +4 -0
- package/jest.config.cjs +29 -0
- package/lib/Badge/Badge.js +21 -29
- package/lib/Badge/index.js +2 -10
- package/lib/BlockQuote/BlockQuote.js +31 -39
- package/lib/BlockQuote/index.js +2 -10
- package/lib/Breadcrumbs/Breadcrumbs.js +39 -49
- package/lib/Breadcrumbs/Item/Item.js +26 -34
- package/lib/Breadcrumbs/index.js +1 -13
- package/lib/Callout/Callout.js +19 -27
- package/lib/Callout/index.js +2 -10
- package/lib/Card/Card.js +44 -54
- package/lib/Card/CardContent.js +17 -25
- package/lib/Card/CardFooter.js +16 -24
- package/lib/Card/index.js +2 -10
- package/lib/Countdown/Countdown.js +34 -42
- package/lib/Countdown/Segment.js +26 -34
- package/lib/Countdown/constants.js +4 -14
- package/lib/Countdown/dictionary.js +2 -9
- package/lib/Countdown/index.js +2 -10
- package/lib/Countdown/types.js +18 -28
- package/lib/Countdown/useCountdown.js +4 -11
- package/lib/DatePicker/CalendarContainer.js +6 -12
- package/lib/DatePicker/DatePicker.js +105 -101
- package/lib/DatePicker/dictionary.js +1 -8
- package/lib/DatePicker/index.js +2 -10
- package/lib/DatePicker/reactDatesCss.js +3 -10
- package/lib/Disclaimer/Disclaimer.js +15 -23
- package/lib/Disclaimer/index.js +1 -13
- package/lib/ExpandCollapseMini/ExpandCollapseMini.js +16 -24
- package/lib/ExpandCollapseMini/ExpandCollapseMiniControl.js +17 -26
- package/lib/ExpandCollapseMini/index.js +2 -10
- package/lib/Footnote/Footnote.js +85 -95
- package/lib/Footnote/FootnoteLink.js +25 -33
- package/lib/Footnote/dictionary.js +2 -9
- package/lib/Footnote/index.js +4 -12
- package/lib/IconButton/IconButton.js +12 -20
- package/lib/IconButton/index.js +2 -10
- package/lib/Image/Image.js +17 -25
- package/lib/Image/index.js +6 -18
- package/lib/Image/server.js +4 -12
- package/lib/List/List.js +2 -9
- package/lib/List/ListItem.js +10 -18
- package/lib/List/index.js +4 -12
- package/lib/NavigationBar/NavigationBar.js +51 -59
- package/lib/NavigationBar/NavigationItem.js +19 -27
- package/lib/NavigationBar/NavigationSubMenu.js +34 -40
- package/lib/NavigationBar/collapseItems.js +1 -11
- package/lib/NavigationBar/index.js +4 -12
- package/lib/NavigationBar/resolveItemSelection.js +1 -8
- package/lib/OptimizeImage/OptimizeImage.js +26 -34
- package/lib/OptimizeImage/index.js +2 -10
- package/lib/OptimizeImage/utils/getFallbackUrl.js +3 -10
- package/lib/OptimizeImage/utils/getImageUrls.js +9 -16
- package/lib/OptimizeImage/utils/getOptimizedUrl.js +3 -10
- package/lib/OptimizeImage/utils/hasWebpSupport.js +1 -7
- package/lib/OptimizeImage/utils/index.js +5 -34
- package/lib/OptimizeImage/utils/isSvgUrl.js +1 -7
- package/lib/OrderedList/Item.js +28 -36
- package/lib/OrderedList/ItemBase.js +8 -16
- package/lib/OrderedList/OrderedList.js +22 -30
- package/lib/OrderedList/OrderedListBase.js +12 -20
- package/lib/OrderedList/constants.js +1 -8
- package/lib/OrderedList/index.js +4 -12
- package/lib/Paragraph/Paragraph.js +22 -30
- package/lib/Paragraph/index.js +2 -10
- package/lib/PreviewCard/AuthorDate.js +17 -21
- package/lib/PreviewCard/PreviewCard.js +40 -49
- package/lib/PreviewCard/index.js +2 -10
- package/lib/PriceLockup/PriceLockup.js +56 -64
- package/lib/PriceLockup/index.js +2 -10
- package/lib/PriceLockup/tokens.js +2 -9
- package/lib/Progress/ProgressBar.js +17 -24
- package/lib/Progress/index.js +4 -12
- package/lib/QuantitySelector/QuantitySelector.js +55 -63
- package/lib/QuantitySelector/SideButton.js +15 -23
- package/lib/QuantitySelector/dictionary.js +2 -9
- package/lib/QuantitySelector/index.js +2 -10
- package/lib/QuantitySelector/styles.js +4 -13
- package/lib/ResponsiveImage/ResponsiveImage.js +29 -37
- package/lib/ResponsiveImage/index.js +2 -10
- package/lib/Ribbon/Ribbon.js +22 -30
- package/lib/Ribbon/index.js +2 -10
- package/lib/SkeletonProvider/SkeletonImage.js +14 -22
- package/lib/SkeletonProvider/SkeletonProvider.js +17 -25
- package/lib/SkeletonProvider/SkeletonTypography.js +14 -22
- package/lib/SkeletonProvider/index.js +2 -10
- package/lib/Span/Span.js +23 -31
- package/lib/Span/index.js +2 -10
- package/lib/Spinner/Spinner.js +43 -51
- package/lib/Spinner/SpinnerContent.js +21 -29
- package/lib/Spinner/constants.js +4 -14
- package/lib/Spinner/index.js +2 -10
- package/lib/StoryCard/StoryCard.js +40 -49
- package/lib/StoryCard/index.js +2 -10
- package/lib/Table/Body.js +7 -15
- package/lib/Table/Cell.js +28 -38
- package/lib/Table/Header.js +11 -19
- package/lib/Table/Row.js +8 -16
- package/lib/Table/SubHeading.js +10 -18
- package/lib/Table/Table.js +26 -35
- package/lib/Table/index.js +12 -20
- package/lib/TermsAndConditions/ExpandCollapse.js +22 -30
- package/lib/TermsAndConditions/TermsAndConditions.js +52 -60
- package/lib/TermsAndConditions/dictionary.js +2 -9
- package/lib/TermsAndConditions/index.js +1 -13
- package/lib/Testimonial/Testimonial.js +37 -45
- package/lib/Testimonial/index.js +2 -10
- package/lib/Toast/Toast.js +32 -42
- package/lib/Toast/index.js +2 -10
- package/lib/Video/ControlBar/ControlBar.js +73 -81
- package/lib/Video/ControlBar/Controls/VideoButton/VideoButton.js +16 -24
- package/lib/Video/ControlBar/Controls/VideoMenu/VideoMenu.js +27 -35
- package/lib/Video/ControlBar/Controls/VideoProgressBar/VideoProgressBar.js +27 -36
- package/lib/Video/ControlBar/Controls/VolumeSlider/VolumeSlider.js +30 -38
- package/lib/Video/MiddleControlButton/MiddleControlButton.js +16 -24
- package/lib/Video/Video.js +74 -83
- package/lib/Video/index.js +2 -10
- package/lib/Video/videoText.js +1 -8
- package/lib/VideoPicker/VideoPicker.js +43 -53
- package/lib/VideoPicker/VideoPickerPlayer.js +17 -25
- package/lib/VideoPicker/VideoPickerThumbnail.js +38 -46
- package/lib/VideoPicker/VideoSlider.js +17 -26
- package/lib/VideoPicker/index.js +2 -10
- package/lib/VideoPicker/videoPropType.js +9 -18
- package/lib/WaffleGrid/WaffleGrid.js +33 -43
- package/lib/WaffleGrid/index.js +2 -10
- package/lib/WebVideo/WebVideo.js +42 -52
- package/lib/WebVideo/index.js +2 -10
- package/lib/WebVideo/utils/index.js +3 -11
- package/lib/baseExports.js +18 -431
- package/lib/index.js +38 -323
- package/lib/server.js +4 -12
- package/lib/shared/ConditionalWrapper/ConditionalWrapper.js +9 -17
- package/lib/shared/ConditionalWrapper/index.js +2 -10
- package/lib/shared/FullBleedContent/FullBleedContent.js +21 -29
- package/lib/shared/FullBleedContent/getFullBleedBorderRadius.js +1 -8
- package/lib/shared/FullBleedContent/index.js +4 -24
- package/lib/shared/FullBleedContent/useFullBleedContentProps.js +4 -11
- package/lib/shared/VideoSplash/SplashButton/SplashButton.js +19 -27
- package/lib/shared/VideoSplash/SplashButtonWithDetails/SplashButtonWithDetails.js +27 -35
- package/lib/shared/VideoSplash/VideoSplash.js +24 -32
- package/lib/shared/VideoSplash/helpers.js +5 -14
- package/lib/utils/index.js +10 -75
- package/lib/utils/isElementFocusable.js +1 -8
- package/lib/utils/logger.js +6 -15
- package/lib/utils/media.js +5 -11
- package/lib/utils/renderStructuredContent.js +8 -15
- package/lib/utils/ssr.js +5 -12
- package/lib/utils/theming/get-theme-from-server.js +2 -10
- package/lib/utils/theming/with-client-theme.js +9 -17
- package/lib/utils/theming/with-server-theme.js +11 -19
- package/lib/utils/transforms.js +3 -11
- package/lib/utils/useOverlaidPosition.js +15 -23
- package/lib/utils/useTypographyTheme.js +6 -13
- package/package.json +18 -20
- package/src/Card/Card.jsx +2 -2
- package/src/DatePicker/DatePicker.jsx +17 -4
- package/src/PreviewCard/AuthorDate.jsx +5 -3
- package/src/utils/logger.js +2 -2
- package/lib-module/Badge/Badge.js +0 -121
- package/lib-module/Badge/index.js +0 -2
- package/lib-module/BlockQuote/BlockQuote.js +0 -204
- package/lib-module/BlockQuote/index.js +0 -2
- package/lib-module/Breadcrumbs/Breadcrumbs.js +0 -250
- package/lib-module/Breadcrumbs/Item/Item.js +0 -175
- package/lib-module/Breadcrumbs/index.js +0 -1
- package/lib-module/Callout/Callout.js +0 -135
- package/lib-module/Callout/index.js +0 -2
- package/lib-module/Card/Card.js +0 -251
- package/lib-module/Card/CardContent.js +0 -90
- package/lib-module/Card/CardFooter.js +0 -78
- package/lib-module/Card/index.js +0 -2
- package/lib-module/Countdown/Countdown.js +0 -169
- package/lib-module/Countdown/Segment.js +0 -96
- package/lib-module/Countdown/constants.js +0 -4
- package/lib-module/Countdown/dictionary.js +0 -22
- package/lib-module/Countdown/index.js +0 -2
- package/lib-module/Countdown/types.js +0 -24
- package/lib-module/Countdown/useCountdown.js +0 -26
- package/lib-module/DatePicker/CalendarContainer.js +0 -208
- package/lib-module/DatePicker/DatePicker.js +0 -506
- package/lib-module/DatePicker/dictionary.js +0 -119
- package/lib-module/DatePicker/index.js +0 -2
- package/lib-module/DatePicker/reactDatesCss.js +0 -3
- package/lib-module/Disclaimer/Disclaimer.js +0 -54
- package/lib-module/Disclaimer/index.js +0 -1
- package/lib-module/ExpandCollapseMini/ExpandCollapseMini.js +0 -73
- package/lib-module/ExpandCollapseMini/ExpandCollapseMiniControl.js +0 -117
- package/lib-module/ExpandCollapseMini/index.js +0 -2
- package/lib-module/Footnote/Footnote.js +0 -632
- package/lib-module/Footnote/FootnoteLink.js +0 -118
- package/lib-module/Footnote/dictionary.js +0 -12
- package/lib-module/Footnote/index.js +0 -4
- package/lib-module/IconButton/IconButton.js +0 -55
- package/lib-module/IconButton/index.js +0 -2
- package/lib-module/Image/Image.js +0 -83
- package/lib-module/Image/index.js +0 -9
- package/lib-module/Image/server.js +0 -4
- package/lib-module/List/List.js +0 -2
- package/lib-module/List/ListItem.js +0 -28
- package/lib-module/List/index.js +0 -4
- package/lib-module/NavigationBar/NavigationBar.js +0 -224
- package/lib-module/NavigationBar/NavigationItem.js +0 -87
- package/lib-module/NavigationBar/NavigationSubMenu.js +0 -162
- package/lib-module/NavigationBar/collapseItems.js +0 -41
- package/lib-module/NavigationBar/index.js +0 -4
- package/lib-module/NavigationBar/resolveItemSelection.js +0 -16
- package/lib-module/OptimizeImage/OptimizeImage.js +0 -92
- package/lib-module/OptimizeImage/index.js +0 -2
- package/lib-module/OptimizeImage/utils/getFallbackUrl.js +0 -7
- package/lib-module/OptimizeImage/utils/getImageUrls.js +0 -12
- package/lib-module/OptimizeImage/utils/getOptimizedUrl.js +0 -17
- package/lib-module/OptimizeImage/utils/hasWebpSupport.js +0 -28
- package/lib-module/OptimizeImage/utils/index.js +0 -5
- package/lib-module/OptimizeImage/utils/isSvgUrl.js +0 -3
- package/lib-module/OrderedList/Item.js +0 -145
- package/lib-module/OrderedList/ItemBase.js +0 -27
- package/lib-module/OrderedList/OrderedList.js +0 -86
- package/lib-module/OrderedList/OrderedListBase.js +0 -45
- package/lib-module/OrderedList/constants.js +0 -2
- package/lib-module/OrderedList/index.js +0 -4
- package/lib-module/Paragraph/Paragraph.js +0 -90
- package/lib-module/Paragraph/index.js +0 -2
- package/lib-module/PreviewCard/AuthorDate.js +0 -57
- package/lib-module/PreviewCard/PreviewCard.js +0 -209
- package/lib-module/PreviewCard/index.js +0 -2
- package/lib-module/PriceLockup/PriceLockup.js +0 -335
- package/lib-module/PriceLockup/index.js +0 -2
- package/lib-module/PriceLockup/tokens.js +0 -55
- package/lib-module/Progress/ProgressBar.js +0 -83
- package/lib-module/Progress/index.js +0 -4
- package/lib-module/QuantitySelector/QuantitySelector.js +0 -261
- package/lib-module/QuantitySelector/SideButton.js +0 -70
- package/lib-module/QuantitySelector/dictionary.js +0 -26
- package/lib-module/QuantitySelector/index.js +0 -2
- package/lib-module/QuantitySelector/styles.js +0 -9
- package/lib-module/ResponsiveImage/ResponsiveImage.js +0 -95
- package/lib-module/ResponsiveImage/index.js +0 -2
- package/lib-module/Ribbon/Ribbon.js +0 -216
- package/lib-module/Ribbon/index.js +0 -2
- package/lib-module/SkeletonProvider/SkeletonImage.js +0 -39
- package/lib-module/SkeletonProvider/SkeletonProvider.js +0 -57
- package/lib-module/SkeletonProvider/SkeletonTypography.js +0 -38
- package/lib-module/SkeletonProvider/index.js +0 -2
- package/lib-module/Span/Span.js +0 -72
- package/lib-module/Span/index.js +0 -2
- package/lib-module/Spinner/Spinner.js +0 -215
- package/lib-module/Spinner/SpinnerContent.js +0 -94
- package/lib-module/Spinner/constants.js +0 -4
- package/lib-module/Spinner/index.js +0 -2
- package/lib-module/StoryCard/StoryCard.js +0 -212
- package/lib-module/StoryCard/index.js +0 -2
- package/lib-module/Table/Body.js +0 -17
- package/lib-module/Table/Cell.js +0 -176
- package/lib-module/Table/Header.js +0 -25
- package/lib-module/Table/Row.js +0 -19
- package/lib-module/Table/SubHeading.js +0 -23
- package/lib-module/Table/Table.js +0 -114
- package/lib-module/Table/index.js +0 -12
- package/lib-module/TermsAndConditions/ExpandCollapse.js +0 -153
- package/lib-module/TermsAndConditions/TermsAndConditions.js +0 -277
- package/lib-module/TermsAndConditions/dictionary.js +0 -16
- package/lib-module/TermsAndConditions/index.js +0 -1
- package/lib-module/Testimonial/Testimonial.js +0 -234
- package/lib-module/Testimonial/index.js +0 -2
- package/lib-module/Toast/Toast.js +0 -158
- package/lib-module/Toast/index.js +0 -2
- package/lib-module/Video/ControlBar/ControlBar.js +0 -288
- package/lib-module/Video/ControlBar/Controls/VideoButton/VideoButton.js +0 -70
- package/lib-module/Video/ControlBar/Controls/VideoMenu/VideoMenu.js +0 -163
- package/lib-module/Video/ControlBar/Controls/VideoProgressBar/VideoProgressBar.js +0 -203
- package/lib-module/Video/ControlBar/Controls/VolumeSlider/VolumeSlider.js +0 -191
- package/lib-module/Video/MiddleControlButton/MiddleControlButton.js +0 -71
- package/lib-module/Video/Video.js +0 -959
- package/lib-module/Video/index.js +0 -2
- package/lib-module/Video/videoText.js +0 -55
- package/lib-module/VideoPicker/VideoPicker.js +0 -190
- package/lib-module/VideoPicker/VideoPickerPlayer.js +0 -48
- package/lib-module/VideoPicker/VideoPickerThumbnail.js +0 -218
- package/lib-module/VideoPicker/VideoSlider.js +0 -82
- package/lib-module/VideoPicker/index.js +0 -2
- package/lib-module/VideoPicker/videoPropType.js +0 -10
- package/lib-module/WaffleGrid/WaffleGrid.js +0 -157
- package/lib-module/WaffleGrid/index.js +0 -2
- package/lib-module/WebVideo/WebVideo.js +0 -191
- package/lib-module/WebVideo/index.js +0 -2
- package/lib-module/WebVideo/utils/index.js +0 -50
- package/lib-module/baseExports.js +0 -19
- package/lib-module/index.js +0 -40
- package/lib-module/server.js +0 -5
- package/lib-module/shared/ConditionalWrapper/ConditionalWrapper.js +0 -22
- package/lib-module/shared/ConditionalWrapper/index.js +0 -2
- package/lib-module/shared/FullBleedContent/FullBleedContent.js +0 -101
- package/lib-module/shared/FullBleedContent/getFullBleedBorderRadius.js +0 -55
- package/lib-module/shared/FullBleedContent/index.js +0 -4
- package/lib-module/shared/FullBleedContent/useFullBleedContentProps.js +0 -55
- package/lib-module/shared/VideoSplash/SplashButton/SplashButton.js +0 -84
- package/lib-module/shared/VideoSplash/SplashButtonWithDetails/SplashButtonWithDetails.js +0 -223
- package/lib-module/shared/VideoSplash/VideoSplash.js +0 -65
- package/lib-module/shared/VideoSplash/helpers.js +0 -23
- package/lib-module/utils/index.js +0 -10
- package/lib-module/utils/isElementFocusable.js +0 -8
- package/lib-module/utils/logger.js +0 -18
- package/lib-module/utils/media.js +0 -39
- package/lib-module/utils/renderStructuredContent.js +0 -66
- package/lib-module/utils/ssr.js +0 -37
- package/lib-module/utils/theming/get-theme-from-server.js +0 -16
- package/lib-module/utils/theming/with-client-theme.js +0 -24
- package/lib-module/utils/theming/with-server-theme.js +0 -26
- package/lib-module/utils/transforms.js +0 -4
- package/lib-module/utils/useOverlaidPosition.js +0 -216
- package/lib-module/utils/useTypographyTheme.js +0 -24
|
@@ -1,22 +1,17 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import { Icon, useResponsiveProp, useThemeTokens, Listbox, getTokensPropType } from '@telus-uds/components-base';
|
|
4
|
+
import NavigationItem from './NavigationItem';
|
|
5
|
+
import useOverlaidPosition from '../utils/useOverlaidPosition';
|
|
6
|
+
import resolveItemSelection from './resolveItemSelection';
|
|
2
7
|
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _react = _interopRequireDefault(require("react"));
|
|
8
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
-
var _componentsBase = require("@telus-uds/components-base");
|
|
10
|
-
var _NavigationItem = _interopRequireDefault(require("./NavigationItem"));
|
|
11
|
-
var _useOverlaidPosition = _interopRequireDefault(require("../utils/useOverlaidPosition"));
|
|
12
|
-
var _resolveItemSelection = _interopRequireDefault(require("./resolveItemSelection"));
|
|
13
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
14
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
8
|
/**
|
|
16
9
|
* A NavigationItem that opens or closes a Listbox of other NavigationItems.
|
|
17
10
|
*
|
|
18
11
|
* This is rendered automatically by `NavigationBar` and isn't intended be used directly.
|
|
19
|
-
*/
|
|
12
|
+
*/
|
|
13
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
|
+
const NavigationSubMenu = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
20
15
|
let {
|
|
21
16
|
children,
|
|
22
17
|
id,
|
|
@@ -31,7 +26,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
31
26
|
linkRouterProps,
|
|
32
27
|
itemsContainerRef
|
|
33
28
|
} = _ref;
|
|
34
|
-
const focusTrapRef =
|
|
29
|
+
const focusTrapRef = React.useRef();
|
|
35
30
|
const maxWidth = 289; // Slightly over 288 of nav item to account for subpixel rounding
|
|
36
31
|
const defaultOffsets = {
|
|
37
32
|
offsets: {
|
|
@@ -42,7 +37,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
42
37
|
align,
|
|
43
38
|
offsets,
|
|
44
39
|
minWidth
|
|
45
|
-
} =
|
|
40
|
+
} = useResponsiveProp({
|
|
46
41
|
xs: {
|
|
47
42
|
...defaultOffsets,
|
|
48
43
|
align: {
|
|
@@ -74,14 +69,14 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
74
69
|
targetRef,
|
|
75
70
|
onTargetLayout,
|
|
76
71
|
isReady
|
|
77
|
-
} = (
|
|
72
|
+
} = useOverlaidPosition({
|
|
78
73
|
isShown: isOpen,
|
|
79
74
|
offsets,
|
|
80
75
|
align
|
|
81
76
|
});
|
|
82
77
|
const {
|
|
83
78
|
selected
|
|
84
|
-
} = (
|
|
79
|
+
} = resolveItemSelection({
|
|
85
80
|
id,
|
|
86
81
|
label,
|
|
87
82
|
items
|
|
@@ -91,11 +86,11 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
91
86
|
};
|
|
92
87
|
const {
|
|
93
88
|
icoMenu
|
|
94
|
-
} =
|
|
89
|
+
} = useThemeTokens('NavigationBar', {}, {}, {
|
|
95
90
|
expanded: isOpen
|
|
96
91
|
});
|
|
97
|
-
return /*#__PURE__*/(
|
|
98
|
-
children: [/*#__PURE__*/(
|
|
92
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
93
|
+
children: [/*#__PURE__*/_jsx(NavigationItem, {
|
|
99
94
|
ref: sourceRef,
|
|
100
95
|
accessibilityRole: "button",
|
|
101
96
|
id: id,
|
|
@@ -108,7 +103,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
108
103
|
let {
|
|
109
104
|
textStyles
|
|
110
105
|
} = _ref2;
|
|
111
|
-
return [children, /*#__PURE__*/(
|
|
106
|
+
return [children, /*#__PURE__*/_jsx(Icon, {
|
|
112
107
|
icon: icoMenu,
|
|
113
108
|
variant: {
|
|
114
109
|
size: 'micro'
|
|
@@ -118,15 +113,15 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
118
113
|
}
|
|
119
114
|
}, `${id}_icon`)];
|
|
120
115
|
}
|
|
121
|
-
}), isOpen && /*#__PURE__*/(
|
|
122
|
-
children: [/*#__PURE__*/(
|
|
116
|
+
}), isOpen && /*#__PURE__*/_jsxs(_Fragment, {
|
|
117
|
+
children: [/*#__PURE__*/_jsx(Listbox.Overlay, {
|
|
123
118
|
overlaidPosition: overlaidPosition,
|
|
124
119
|
maxWidth: maxWidth,
|
|
125
120
|
minWidth: minWidth,
|
|
126
121
|
isReady: isReady,
|
|
127
122
|
onLayout: onTargetLayout,
|
|
128
123
|
ref: openOverlayRef,
|
|
129
|
-
children: /*#__PURE__*/(
|
|
124
|
+
children: /*#__PURE__*/_jsx(Listbox, {
|
|
130
125
|
items: items,
|
|
131
126
|
firstItemRef: targetRef,
|
|
132
127
|
parentRef: sourceRef,
|
|
@@ -135,7 +130,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
135
130
|
linkRouterProps: linkRouterProps,
|
|
136
131
|
ref: itemsContainerRef || ref
|
|
137
132
|
})
|
|
138
|
-
}), /*#__PURE__*/(
|
|
133
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
139
134
|
// This catches and shifts focus to other interactive elements.
|
|
140
135
|
// eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex
|
|
141
136
|
tabIndex: 0,
|
|
@@ -149,18 +144,17 @@ NavigationSubMenu.displayName = 'NavigationSubMenu';
|
|
|
149
144
|
|
|
150
145
|
// @TODO - proper prop types and comments
|
|
151
146
|
NavigationSubMenu.propTypes = {
|
|
152
|
-
tokens:
|
|
153
|
-
children:
|
|
154
|
-
id:
|
|
155
|
-
isOpen:
|
|
156
|
-
label:
|
|
157
|
-
onClick:
|
|
158
|
-
selectedId:
|
|
159
|
-
items:
|
|
160
|
-
openOverlayRef:
|
|
161
|
-
LinkRouter:
|
|
162
|
-
linkRouterProps:
|
|
163
|
-
itemsContainerRef:
|
|
147
|
+
tokens: getTokensPropType('NavigationBar'),
|
|
148
|
+
children: PropTypes.node,
|
|
149
|
+
id: PropTypes.string,
|
|
150
|
+
isOpen: PropTypes.bool,
|
|
151
|
+
label: PropTypes.string,
|
|
152
|
+
onClick: PropTypes.func,
|
|
153
|
+
selectedId: PropTypes.string,
|
|
154
|
+
items: PropTypes.array,
|
|
155
|
+
openOverlayRef: PropTypes.object,
|
|
156
|
+
LinkRouter: PropTypes.elementType,
|
|
157
|
+
linkRouterProps: PropTypes.object,
|
|
158
|
+
itemsContainerRef: PropTypes.object
|
|
164
159
|
};
|
|
165
|
-
|
|
166
|
-
exports.default = _default;
|
|
160
|
+
export default NavigationSubMenu;
|
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
1
|
/**
|
|
8
2
|
* Make a list of items into a one-item list where all items are nested under the first item
|
|
9
3
|
*/
|
|
@@ -28,21 +22,17 @@ const collapseItems = (items, selectedId) => {
|
|
|
28
22
|
rootLabel = item.label;
|
|
29
23
|
return true; // break
|
|
30
24
|
}
|
|
31
|
-
|
|
32
25
|
const nestedMatch = (_item$items = item.items) === null || _item$items === void 0 ? void 0 : _item$items.find(isSelected);
|
|
33
26
|
if (nestedMatch) {
|
|
34
27
|
rootLabel = nestedMatch.label;
|
|
35
28
|
return true; // break
|
|
36
29
|
}
|
|
37
|
-
|
|
38
30
|
return false; // continue
|
|
39
31
|
});
|
|
40
|
-
|
|
41
32
|
return [{
|
|
42
33
|
id: 'navigation-bar-root',
|
|
43
34
|
label: rootLabel,
|
|
44
35
|
items
|
|
45
36
|
}];
|
|
46
37
|
};
|
|
47
|
-
|
|
48
|
-
exports.default = _default;
|
|
38
|
+
export default collapseItems;
|
|
@@ -1,12 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _NavigationBar = _interopRequireDefault(require("./NavigationBar"));
|
|
8
|
-
var _NavigationItem = _interopRequireDefault(require("./NavigationItem"));
|
|
9
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
|
-
_NavigationBar.default.Item = _NavigationItem.default;
|
|
11
|
-
var _default = _NavigationBar.default;
|
|
12
|
-
exports.default = _default;
|
|
1
|
+
import NavigationBar from './NavigationBar';
|
|
2
|
+
import NavigationItem from './NavigationItem';
|
|
3
|
+
NavigationBar.Item = NavigationItem;
|
|
4
|
+
export default NavigationBar;
|
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
1
|
const resolveItemSelection = (_ref, selectedId) => {
|
|
8
2
|
let {
|
|
9
3
|
id,
|
|
@@ -19,5 +13,4 @@ const resolveItemSelection = (_ref, selectedId) => {
|
|
|
19
13
|
selected
|
|
20
14
|
};
|
|
21
15
|
};
|
|
22
|
-
|
|
23
|
-
exports.default = _default;
|
|
16
|
+
export default resolveItemSelection;
|
|
@@ -1,19 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
var _ResponsiveImage = _interopRequireDefault(require("../ResponsiveImage"));
|
|
11
|
-
var _utils = require("./utils");
|
|
12
|
-
var _utils2 = require("../utils");
|
|
13
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
14
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
-
const [selectProps, selectedSystemPropTypes] = (0, _componentsBase.selectSystemProps)([_utils2.htmlAttrs]);
|
|
16
|
-
const OptimizeImage = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import { selectSystemProps } from '@telus-uds/components-base';
|
|
4
|
+
import ResponsiveImage from '../ResponsiveImage';
|
|
5
|
+
import { hasWebpSupport, getImageUrls } from './utils';
|
|
6
|
+
import { htmlAttrs } from '../utils';
|
|
7
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
|
+
const [selectProps, selectedSystemPropTypes] = selectSystemProps([htmlAttrs]);
|
|
9
|
+
const OptimizeImage = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
17
10
|
let {
|
|
18
11
|
contentfulAssetUrl,
|
|
19
12
|
alt,
|
|
@@ -30,16 +23,16 @@ const OptimizeImage = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
|
|
|
30
23
|
// `useHeight` is a deprecated TDS prop, replaced by `sizeByHeight`
|
|
31
24
|
const dimension = sizeByHeight || rest.useHeight ? 'h' : 'w';
|
|
32
25
|
// by default assuming webP support for SSR
|
|
33
|
-
const [imgUrls, setImgUrls] =
|
|
34
|
-
|
|
26
|
+
const [imgUrls, setImgUrls] = React.useState(getImageUrls(contentfulAssetUrl, dimension, xs, sm, md, lg, xl, quality, disableRetina, true));
|
|
27
|
+
React.useEffect(() => {
|
|
35
28
|
// Checking for webP support for CSR
|
|
36
|
-
|
|
37
|
-
const imageUrls =
|
|
29
|
+
hasWebpSupport().then(supportsWebp => {
|
|
30
|
+
const imageUrls = getImageUrls(contentfulAssetUrl, dimension, xs, sm, md, lg, xl, quality, disableRetina, supportsWebp);
|
|
38
31
|
setImgUrls(imageUrls);
|
|
39
32
|
});
|
|
40
33
|
}, [contentfulAssetUrl, dimension, disableRetina, lg, md, quality, sm, xl, xs]);
|
|
41
34
|
if (!imgUrls) return null;
|
|
42
|
-
return /*#__PURE__*/(
|
|
35
|
+
return /*#__PURE__*/_jsx(ResponsiveImage, {
|
|
43
36
|
...imgUrls,
|
|
44
37
|
alt: alt,
|
|
45
38
|
...selectProps(rest),
|
|
@@ -52,49 +45,48 @@ OptimizeImage.propTypes = {
|
|
|
52
45
|
/**
|
|
53
46
|
* The source to load the image. Only contentful image urls are supported. See https://www.contentful.com/developers/docs/references/images-api/ for details.
|
|
54
47
|
*/
|
|
55
|
-
contentfulAssetUrl:
|
|
48
|
+
contentfulAssetUrl: PropTypes.string.isRequired,
|
|
56
49
|
/**
|
|
57
50
|
* Alternative text to display if image cannot be loaded or a screen reader is used.
|
|
58
51
|
*/
|
|
59
|
-
alt:
|
|
52
|
+
alt: PropTypes.string.isRequired,
|
|
60
53
|
/**
|
|
61
54
|
* Customize quality as a percentage between 1 and 100.
|
|
62
55
|
*/
|
|
63
|
-
quality:
|
|
56
|
+
quality: PropTypes.number,
|
|
64
57
|
/**
|
|
65
58
|
* Customize width for xs screen size in px, this may affect the quality of the image.
|
|
66
59
|
*/
|
|
67
|
-
xs:
|
|
60
|
+
xs: PropTypes.number,
|
|
68
61
|
/**
|
|
69
62
|
* Customize width for sm screen size in px, this may affect the quality of the image.
|
|
70
63
|
*/
|
|
71
|
-
sm:
|
|
64
|
+
sm: PropTypes.number,
|
|
72
65
|
/**
|
|
73
66
|
* Customize width for md screen size in px, this may affect the quality of the image.
|
|
74
67
|
*/
|
|
75
|
-
md:
|
|
68
|
+
md: PropTypes.number,
|
|
76
69
|
/**
|
|
77
70
|
* Customize width for lg screen size in px, this may affect the quality of the image.
|
|
78
71
|
*/
|
|
79
|
-
lg:
|
|
72
|
+
lg: PropTypes.number,
|
|
80
73
|
/**
|
|
81
74
|
* Customize width for xl screen size in px, this may affect the quality of the image.
|
|
82
75
|
*/
|
|
83
|
-
xl:
|
|
76
|
+
xl: PropTypes.number,
|
|
84
77
|
/**
|
|
85
78
|
* Switches size dimension to height, default is false
|
|
86
79
|
*/
|
|
87
|
-
sizeByHeight:
|
|
80
|
+
sizeByHeight: PropTypes.bool,
|
|
88
81
|
/**
|
|
89
82
|
* Turns off retina display functionality
|
|
90
83
|
*/
|
|
91
|
-
disableRetina:
|
|
84
|
+
disableRetina: PropTypes.bool,
|
|
92
85
|
/**
|
|
93
86
|
* Loading strategy.
|
|
94
87
|
* @default 'eager'
|
|
95
88
|
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img#attr-loading
|
|
96
89
|
*/
|
|
97
|
-
loading:
|
|
90
|
+
loading: PropTypes.oneOf(['eager', 'lazy'])
|
|
98
91
|
};
|
|
99
|
-
|
|
100
|
-
exports.default = _default;
|
|
92
|
+
export default OptimizeImage;
|
|
@@ -1,10 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _OptimizeImage = _interopRequireDefault(require("./OptimizeImage"));
|
|
8
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
9
|
-
var _default = _OptimizeImage.default;
|
|
10
|
-
exports.default = _default;
|
|
1
|
+
import OptimizeImage from './OptimizeImage';
|
|
2
|
+
export default OptimizeImage;
|
|
@@ -1,13 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = getFallbackUrl;
|
|
7
|
-
var _isSvgUrl = _interopRequireDefault(require("./isSvgUrl"));
|
|
8
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
9
|
-
function getFallbackUrl(url, dimension, size, quality) {
|
|
10
|
-
if (!(0, _isSvgUrl.default)(url)) {
|
|
1
|
+
import isSvgUrl from './isSvgUrl';
|
|
2
|
+
export default function getFallbackUrl(url, dimension, size, quality) {
|
|
3
|
+
if (!isSvgUrl(url)) {
|
|
11
4
|
return `${url}?${dimension}=${size}&q=${quality}`;
|
|
12
5
|
}
|
|
13
6
|
return url;
|
|
@@ -1,19 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = getImageUrls;
|
|
7
|
-
var _getOptimizedUrl = _interopRequireDefault(require("./getOptimizedUrl"));
|
|
8
|
-
var _getFallbackUrl = _interopRequireDefault(require("./getFallbackUrl"));
|
|
9
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
|
-
function getImageUrls(contentfulAssetUrl, dimension, xs, sm, md, lg, xl, quality, disableRetina, supportsWebp) {
|
|
1
|
+
import getOptimizedUrl from './getOptimizedUrl';
|
|
2
|
+
import getFallbackUrl from './getFallbackUrl';
|
|
3
|
+
export default function getImageUrls(contentfulAssetUrl, dimension, xs, sm, md, lg, xl, quality, disableRetina, supportsWebp) {
|
|
11
4
|
return {
|
|
12
|
-
xsSrc: (
|
|
13
|
-
smSrc: (
|
|
14
|
-
mdSrc: (
|
|
15
|
-
lgSrc: (
|
|
16
|
-
xlSrc: (
|
|
17
|
-
fallbackSrc: (
|
|
5
|
+
xsSrc: getOptimizedUrl(contentfulAssetUrl, dimension, xs, quality, disableRetina, supportsWebp),
|
|
6
|
+
smSrc: getOptimizedUrl(contentfulAssetUrl, dimension, sm, quality, disableRetina, supportsWebp),
|
|
7
|
+
mdSrc: getOptimizedUrl(contentfulAssetUrl, dimension, md, quality, disableRetina, supportsWebp),
|
|
8
|
+
lgSrc: getOptimizedUrl(contentfulAssetUrl, dimension, lg, quality, disableRetina, supportsWebp),
|
|
9
|
+
xlSrc: getOptimizedUrl(contentfulAssetUrl, dimension, xl, quality, disableRetina, supportsWebp),
|
|
10
|
+
fallbackSrc: getFallbackUrl(contentfulAssetUrl, dimension, xl, quality)
|
|
18
11
|
};
|
|
19
12
|
}
|
|
@@ -1,13 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = getOptimizedUrl;
|
|
7
|
-
var _isSvgUrl = _interopRequireDefault(require("./isSvgUrl"));
|
|
8
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
9
|
-
function getOptimizedUrl(url, dimension, size, quality, disableRetina, supportsWebp) {
|
|
10
|
-
if (!(0, _isSvgUrl.default)(url)) {
|
|
1
|
+
import isSvgUrl from './isSvgUrl';
|
|
2
|
+
export default function getOptimizedUrl(url, dimension, size, quality, disableRetina, supportsWebp) {
|
|
3
|
+
if (!isSvgUrl(url)) {
|
|
11
4
|
let format = '';
|
|
12
5
|
if (supportsWebp) {
|
|
13
6
|
format = 'fm=webp';
|
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = hasWebpSupport;
|
|
7
1
|
let promise;
|
|
8
2
|
|
|
9
3
|
/**
|
|
@@ -12,7 +6,7 @@ let promise;
|
|
|
12
6
|
* @see https://developers.google.com/speed/webp/faq#in_your_own_javascript
|
|
13
7
|
* @return {Promise<boolean>}
|
|
14
8
|
*/
|
|
15
|
-
function hasWebpSupport() {
|
|
9
|
+
export default function hasWebpSupport() {
|
|
16
10
|
// cache the result, so that this function runs only once
|
|
17
11
|
if (!promise) {
|
|
18
12
|
promise = new Promise(resolve => {
|
|
@@ -1,34 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
}
|
|
6
|
-
Object.defineProperty(exports, "getFallbackUrl", {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: function () {
|
|
9
|
-
return _getFallbackUrl.default;
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
Object.defineProperty(exports, "getImageUrls", {
|
|
13
|
-
enumerable: true,
|
|
14
|
-
get: function () {
|
|
15
|
-
return _getImageUrls.default;
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
Object.defineProperty(exports, "getOptimizedUrl", {
|
|
19
|
-
enumerable: true,
|
|
20
|
-
get: function () {
|
|
21
|
-
return _getOptimizedUrl.default;
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
Object.defineProperty(exports, "hasWebpSupport", {
|
|
25
|
-
enumerable: true,
|
|
26
|
-
get: function () {
|
|
27
|
-
return _hasWebpSupport.default;
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
var _getOptimizedUrl = _interopRequireDefault(require("./getOptimizedUrl"));
|
|
31
|
-
var _getFallbackUrl = _interopRequireDefault(require("./getFallbackUrl"));
|
|
32
|
-
var _hasWebpSupport = _interopRequireDefault(require("./hasWebpSupport"));
|
|
33
|
-
var _getImageUrls = _interopRequireDefault(require("./getImageUrls"));
|
|
34
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
1
|
+
import getOptimizedUrl from './getOptimizedUrl';
|
|
2
|
+
import getFallbackUrl from './getFallbackUrl';
|
|
3
|
+
import hasWebpSupport from './hasWebpSupport';
|
|
4
|
+
import getImageUrls from './getImageUrls';
|
|
5
|
+
export { getOptimizedUrl, getFallbackUrl, hasWebpSupport, getImageUrls };
|
package/lib/OrderedList/Item.js
CHANGED
|
@@ -1,19 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
var _componentsBase = require("@telus-uds/components-base");
|
|
11
|
-
var _ItemBase = _interopRequireDefault(require("./ItemBase"));
|
|
12
|
-
var _utils = require("../utils");
|
|
13
|
-
var _constants = require("./constants");
|
|
14
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
16
|
-
const [selectProps, selectedSystemPropTypes] = (0, _componentsBase.selectSystemProps)([_utils.htmlAttrs]);
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import styled from 'styled-components';
|
|
4
|
+
import { applyTextStyles, getTokensPropType, selectSystemProps, StackView, Typography, useTheme, useThemeTokens, wrapStringsInText } from '@telus-uds/components-base';
|
|
5
|
+
import ItemBase from './ItemBase';
|
|
6
|
+
import { htmlAttrs } from '../utils';
|
|
7
|
+
import { OL_COUNTER_NAME } from './constants';
|
|
8
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
9
|
+
const [selectProps, selectedSystemPropTypes] = selectSystemProps([htmlAttrs]);
|
|
17
10
|
const selectItemTextStyles = (_ref, themeOptions) => {
|
|
18
11
|
let {
|
|
19
12
|
itemFontWeight,
|
|
@@ -23,7 +16,7 @@ const selectItemTextStyles = (_ref, themeOptions) => {
|
|
|
23
16
|
itemColor,
|
|
24
17
|
itemTextColor
|
|
25
18
|
} = _ref;
|
|
26
|
-
return
|
|
19
|
+
return applyTextStyles({
|
|
27
20
|
fontWeight: itemFontWeight,
|
|
28
21
|
fontSize: itemFontSize,
|
|
29
22
|
fontName: itemFontName,
|
|
@@ -32,7 +25,7 @@ const selectItemTextStyles = (_ref, themeOptions) => {
|
|
|
32
25
|
lineHeight: itemLineHeight
|
|
33
26
|
});
|
|
34
27
|
};
|
|
35
|
-
const StyledItemBase = /*#__PURE__*/(
|
|
28
|
+
const StyledItemBase = /*#__PURE__*/styled(ItemBase).withConfig({
|
|
36
29
|
displayName: "Item__StyledItemBase",
|
|
37
30
|
componentId: "components-web__sc-7jzwcq-0"
|
|
38
31
|
})(_ref2 => {
|
|
@@ -50,9 +43,9 @@ const StyledItemBase = /*#__PURE__*/(0, _styledComponents.default)(_ItemBase.def
|
|
|
50
43
|
itemTextColor
|
|
51
44
|
} = _ref2;
|
|
52
45
|
return {
|
|
53
|
-
counterIncrement:
|
|
46
|
+
counterIncrement: OL_COUNTER_NAME,
|
|
54
47
|
'::before': {
|
|
55
|
-
content: `counter(${
|
|
48
|
+
content: `counter(${OL_COUNTER_NAME})'.'`,
|
|
56
49
|
display: 'inline-block',
|
|
57
50
|
color: itemColor || itemTextColor,
|
|
58
51
|
width: itemBulletContainerWidth,
|
|
@@ -61,7 +54,7 @@ const StyledItemBase = /*#__PURE__*/(0, _styledComponents.default)(_ItemBase.def
|
|
|
61
54
|
flexShrink: 0,
|
|
62
55
|
whiteSpace: 'nowrap',
|
|
63
56
|
overflow: 'hidden',
|
|
64
|
-
...
|
|
57
|
+
...applyTextStyles({
|
|
65
58
|
fontWeight: itemFontWeight,
|
|
66
59
|
fontSize: itemFontSize,
|
|
67
60
|
fontName: itemFontName,
|
|
@@ -74,7 +67,7 @@ const StyledItemBase = /*#__PURE__*/(0, _styledComponents.default)(_ItemBase.def
|
|
|
74
67
|
}
|
|
75
68
|
};
|
|
76
69
|
});
|
|
77
|
-
const ItemContent = /*#__PURE__*/
|
|
70
|
+
const ItemContent = /*#__PURE__*/styled.div.withConfig({
|
|
78
71
|
displayName: "Item__ItemContent",
|
|
79
72
|
componentId: "components-web__sc-7jzwcq-1"
|
|
80
73
|
})({
|
|
@@ -82,7 +75,7 @@ const ItemContent = /*#__PURE__*/_styledComponents.default.div.withConfig({
|
|
|
82
75
|
flexDirection: 'column',
|
|
83
76
|
gap: 5
|
|
84
77
|
});
|
|
85
|
-
const Item = /*#__PURE__*/
|
|
78
|
+
const Item = /*#__PURE__*/React.forwardRef((_ref3, ref) => {
|
|
86
79
|
let {
|
|
87
80
|
children,
|
|
88
81
|
counterName,
|
|
@@ -93,7 +86,7 @@ const Item = /*#__PURE__*/_react.default.forwardRef((_ref3, ref) => {
|
|
|
93
86
|
} = _ref3;
|
|
94
87
|
// We are reusing some tokens from the list component here in order to provide a unified
|
|
95
88
|
// experience
|
|
96
|
-
const themeTokens =
|
|
89
|
+
const themeTokens = useThemeTokens('OrderedList', tokens, variant);
|
|
97
90
|
const headingTokens = title && {
|
|
98
91
|
lineHeight: themeTokens.itemLineHeight,
|
|
99
92
|
fontSize: themeTokens.itemFontSize,
|
|
@@ -103,31 +96,31 @@ const Item = /*#__PURE__*/_react.default.forwardRef((_ref3, ref) => {
|
|
|
103
96
|
};
|
|
104
97
|
const {
|
|
105
98
|
themeOptions
|
|
106
|
-
} =
|
|
107
|
-
const itemContent =
|
|
99
|
+
} = useTheme();
|
|
100
|
+
const itemContent = wrapStringsInText(children, {
|
|
108
101
|
style: selectItemTextStyles(themeTokens, themeOptions)
|
|
109
102
|
});
|
|
110
|
-
return /*#__PURE__*/(
|
|
103
|
+
return /*#__PURE__*/_jsx(StyledItemBase, {
|
|
111
104
|
ref: ref,
|
|
112
105
|
themeOptions: themeOptions,
|
|
113
106
|
...themeTokens,
|
|
114
107
|
...selectProps(rest),
|
|
115
|
-
children: title ? /*#__PURE__*/(
|
|
108
|
+
children: title ? /*#__PURE__*/_jsxs(StackView, {
|
|
116
109
|
tokens: {
|
|
117
110
|
flexShrink: 1
|
|
118
111
|
},
|
|
119
112
|
space: 0,
|
|
120
|
-
children: [/*#__PURE__*/(
|
|
113
|
+
children: [/*#__PURE__*/_jsx(Typography, {
|
|
121
114
|
variant: {
|
|
122
115
|
size: 'h4'
|
|
123
116
|
},
|
|
124
117
|
tokens: headingTokens,
|
|
125
118
|
children: title
|
|
126
|
-
}), /*#__PURE__*/(
|
|
119
|
+
}), /*#__PURE__*/_jsx(ItemContent, {
|
|
127
120
|
...themeTokens,
|
|
128
121
|
children: itemContent
|
|
129
122
|
})]
|
|
130
|
-
}) : /*#__PURE__*/(
|
|
123
|
+
}) : /*#__PURE__*/_jsx(ItemContent, {
|
|
131
124
|
children: itemContent
|
|
132
125
|
})
|
|
133
126
|
});
|
|
@@ -138,15 +131,14 @@ Item.propTypes = {
|
|
|
138
131
|
/**
|
|
139
132
|
* Item content
|
|
140
133
|
*/
|
|
141
|
-
children:
|
|
134
|
+
children: PropTypes.node.isRequired,
|
|
142
135
|
/**
|
|
143
136
|
* Defines the title of the `OrderedList.Item`
|
|
144
137
|
*/
|
|
145
|
-
title:
|
|
138
|
+
title: PropTypes.string,
|
|
146
139
|
/**
|
|
147
140
|
* Item tokens
|
|
148
141
|
*/
|
|
149
|
-
tokens:
|
|
142
|
+
tokens: getTokensPropType('OrderedList')
|
|
150
143
|
};
|
|
151
|
-
|
|
152
|
-
exports.default = _default;
|
|
144
|
+
export default Item;
|