@telus-uds/components-web 2.21.2 → 2.22.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 +13 -2
- package/lib/Badge/Badge.js +2 -14
- package/lib/Badge/index.js +0 -3
- package/lib/BlockQuote/BlockQuote.js +4 -25
- package/lib/BlockQuote/index.js +0 -3
- package/lib/Breadcrumbs/Breadcrumbs.js +9 -36
- package/lib/Breadcrumbs/Item/Item.js +15 -25
- package/lib/Breadcrumbs/index.js +0 -2
- package/lib/Callout/Callout.js +2 -24
- package/lib/Callout/index.js +0 -3
- package/lib/Card/Card.js +15 -29
- package/lib/Card/CardContent.js +5 -18
- package/lib/Card/CardFooter.js +7 -19
- package/lib/Card/index.js +0 -3
- package/lib/Countdown/Countdown.js +5 -24
- package/lib/Countdown/Segment.js +3 -15
- package/lib/Countdown/index.js +0 -3
- package/lib/Countdown/types.js +2 -7
- package/lib/Countdown/useCountdown.js +0 -7
- package/lib/DatePicker/CalendarContainer.js +0 -5
- package/lib/DatePicker/DatePicker.js +9 -61
- package/lib/DatePicker/dictionary.js +0 -8
- package/lib/DatePicker/index.js +0 -3
- package/lib/DatePicker/reactDatesCss.js +0 -2
- package/lib/Disclaimer/Disclaimer.js +5 -14
- package/lib/Disclaimer/index.js +0 -2
- package/lib/ExpandCollapseMini/ExpandCollapseMini.js +6 -17
- package/lib/ExpandCollapseMini/ExpandCollapseMiniControl.js +12 -25
- package/lib/ExpandCollapseMini/index.js +0 -3
- package/lib/Footnote/Footnote.js +17 -63
- package/lib/Footnote/FootnoteLink.js +3 -24
- package/lib/Footnote/index.js +0 -4
- package/lib/IconButton/IconButton.js +4 -14
- package/lib/IconButton/index.js +0 -3
- package/lib/Image/Image.js +5 -24
- package/lib/Image/index.js +0 -3
- package/lib/List/List.js +0 -2
- package/lib/List/ListItem.js +0 -8
- package/lib/List/index.js +0 -4
- package/lib/NavigationBar/NavigationBar.js +10 -35
- package/lib/NavigationBar/NavigationItem.js +5 -17
- package/lib/NavigationBar/NavigationSubMenu.js +3 -19
- package/lib/NavigationBar/collapseItems.js +6 -9
- package/lib/NavigationBar/index.js +0 -3
- package/lib/NavigationBar/resolveItemSelection.js +2 -3
- package/lib/OptimizeImage/OptimizeImage.js +6 -27
- package/lib/OptimizeImage/index.js +0 -3
- package/lib/OptimizeImage/utils/getFallbackUrl.js +0 -4
- package/lib/OptimizeImage/utils/getOptimizedUrl.js +0 -8
- package/lib/OptimizeImage/utils/hasWebpSupport.js +1 -5
- package/lib/OptimizeImage/utils/index.js +0 -4
- package/lib/OptimizeImage/utils/isSvgUrl.js +0 -1
- package/lib/OrderedList/Item.js +4 -21
- package/lib/OrderedList/ItemBase.js +2 -9
- package/lib/OrderedList/OrderedList.js +11 -22
- package/lib/OrderedList/OrderedListBase.js +3 -13
- package/lib/OrderedList/index.js +0 -4
- package/lib/Paragraph/Paragraph.js +3 -18
- package/lib/Paragraph/index.js +0 -3
- package/lib/PreviewCard/AuthorDate.js +1 -10
- package/lib/PreviewCard/PreviewCard.js +15 -35
- package/lib/PreviewCard/index.js +0 -3
- package/lib/PriceLockup/PriceLockup.js +78 -75
- package/lib/PriceLockup/index.js +0 -3
- package/lib/PriceLockup/tokens.js +0 -2
- package/lib/Progress/ProgressBar.js +5 -16
- package/lib/Progress/index.js +0 -4
- package/lib/QuantitySelector/QuantitySelector.js +8 -42
- package/lib/QuantitySelector/SideButton.js +4 -11
- package/lib/QuantitySelector/index.js +0 -3
- package/lib/QuantitySelector/styles.js +0 -6
- package/lib/ResponsiveImage/ResponsiveImage.js +5 -20
- package/lib/ResponsiveImage/index.js +0 -3
- package/lib/Ribbon/Ribbon.js +4 -20
- package/lib/Ribbon/index.js +0 -3
- package/lib/SkeletonProvider/SkeletonImage.js +0 -10
- package/lib/SkeletonProvider/SkeletonProvider.js +4 -22
- package/lib/SkeletonProvider/SkeletonTypography.js +0 -10
- package/lib/SkeletonProvider/index.js +0 -3
- package/lib/Span/Span.js +3 -17
- package/lib/Span/index.js +0 -3
- package/lib/Spinner/Spinner.js +11 -39
- package/lib/Spinner/SpinnerContent.js +2 -18
- package/lib/Spinner/index.js +0 -3
- package/lib/StoryCard/StoryCard.js +11 -31
- package/lib/StoryCard/index.js +0 -3
- package/lib/Table/Body.js +0 -6
- package/lib/Table/Cell.js +4 -24
- package/lib/Table/Header.js +0 -9
- package/lib/Table/Row.js +0 -8
- package/lib/Table/SubHeading.js +0 -9
- package/lib/Table/Table.js +5 -23
- package/lib/Table/index.js +0 -8
- package/lib/TermsAndConditions/ExpandCollapse.js +4 -14
- package/lib/TermsAndConditions/TermsAndConditions.js +7 -29
- package/lib/TermsAndConditions/index.js +0 -2
- package/lib/Testimonial/Testimonial.js +2 -26
- package/lib/Testimonial/index.js +0 -3
- package/lib/Toast/Toast.js +4 -25
- package/lib/Toast/index.js +0 -3
- package/lib/Video/ControlBar/ControlBar.js +2 -25
- package/lib/Video/ControlBar/Controls/VideoButton/VideoButton.js +4 -17
- package/lib/Video/ControlBar/Controls/VideoMenu/VideoMenu.js +4 -20
- package/lib/Video/ControlBar/Controls/VideoProgressBar/VideoProgressBar.js +12 -26
- package/lib/Video/ControlBar/Controls/VolumeSlider/VolumeSlider.js +8 -23
- package/lib/Video/MiddleControlButton/MiddleControlButton.js +2 -12
- package/lib/Video/Video.js +122 -194
- package/lib/Video/index.js +0 -3
- package/lib/VideoPicker/VideoPicker.js +6 -32
- package/lib/VideoPicker/VideoPickerPlayer.js +2 -10
- package/lib/VideoPicker/VideoPickerThumbnail.js +7 -28
- package/lib/VideoPicker/VideoSlider.js +7 -17
- package/lib/VideoPicker/index.js +0 -3
- package/lib/VideoPicker/videoPropType.js +2 -8
- package/lib/WaffleGrid/WaffleGrid.js +11 -28
- package/lib/WaffleGrid/index.js +0 -3
- package/lib/WebPortal/WebPortal.js +1 -5
- package/lib/WebPortal/index.js +0 -3
- package/lib/WebVideo/WebVideo.js +4 -30
- package/lib/WebVideo/index.js +0 -3
- package/lib/baseExports.js +6 -1
- package/lib/index.js +0 -49
- package/lib/shared/FullBleedContent/FullBleedContent.js +5 -17
- package/lib/shared/FullBleedContent/getFullBleedBorderRadius.js +0 -11
- package/lib/shared/FullBleedContent/index.js +0 -5
- package/lib/shared/FullBleedContent/useFullBleedContentProps.js +1 -12
- package/lib/shared/VideoSplash/SplashButton/SplashButton.js +2 -12
- package/lib/shared/VideoSplash/SplashButtonWithDetails/SplashButtonWithDetails.js +7 -23
- package/lib/shared/VideoSplash/VideoSplash.js +4 -17
- package/lib/shared/VideoSplash/helpers.js +0 -6
- package/lib/utils/index.js +0 -9
- package/lib/utils/logger.js +0 -6
- package/lib/utils/media.js +2 -11
- package/lib/utils/renderStructuredContent.js +14 -31
- package/lib/utils/ssr.js +0 -6
- package/lib/utils/transforms.js +0 -2
- package/lib/utils/useOverlaidPosition.js +6 -28
- package/lib/utils/useTypographyTheme.js +4 -5
- package/lib-module/Badge/Badge.js +2 -5
- package/lib-module/BlockQuote/BlockQuote.js +4 -15
- package/lib-module/Breadcrumbs/Breadcrumbs.js +9 -25
- package/lib-module/Breadcrumbs/Item/Item.js +15 -12
- package/lib-module/Callout/Callout.js +2 -16
- package/lib-module/Card/Card.js +14 -17
- package/lib-module/Card/CardContent.js +5 -8
- package/lib-module/Card/CardFooter.js +7 -9
- package/lib-module/Countdown/Countdown.js +6 -11
- package/lib-module/Countdown/Segment.js +6 -8
- package/lib-module/Countdown/types.js +2 -1
- package/lib-module/Countdown/useCountdown.js +0 -6
- package/lib-module/DatePicker/CalendarContainer.js +3 -1
- package/lib-module/DatePicker/DatePicker.js +9 -39
- package/lib-module/DatePicker/dictionary.js +0 -8
- package/lib-module/Disclaimer/Disclaimer.js +5 -4
- package/lib-module/ExpandCollapseMini/ExpandCollapseMini.js +6 -8
- package/lib-module/ExpandCollapseMini/ExpandCollapseMiniControl.js +13 -19
- package/lib-module/Footnote/Footnote.js +17 -41
- package/lib-module/Footnote/FootnoteLink.js +3 -12
- package/lib-module/IconButton/IconButton.js +4 -6
- package/lib-module/Image/Image.js +5 -14
- package/lib-module/NavigationBar/NavigationBar.js +10 -20
- package/lib-module/NavigationBar/NavigationItem.js +5 -5
- package/lib-module/NavigationBar/NavigationSubMenu.js +3 -8
- package/lib-module/NavigationBar/collapseItems.js +6 -8
- package/lib-module/NavigationBar/resolveItemSelection.js +2 -2
- package/lib-module/OptimizeImage/OptimizeImage.js +6 -16
- package/lib-module/OptimizeImage/utils/getFallbackUrl.js +0 -1
- package/lib-module/OptimizeImage/utils/getOptimizedUrl.js +0 -5
- package/lib-module/OptimizeImage/utils/hasWebpSupport.js +1 -5
- package/lib-module/OrderedList/Item.js +4 -7
- package/lib-module/OrderedList/ItemBase.js +2 -3
- package/lib-module/OrderedList/OrderedList.js +11 -9
- package/lib-module/OrderedList/OrderedListBase.js +3 -3
- package/lib-module/Paragraph/Paragraph.js +3 -8
- package/lib-module/PreviewCard/AuthorDate.js +1 -4
- package/lib-module/PreviewCard/PreviewCard.js +16 -19
- package/lib-module/PriceLockup/PriceLockup.js +78 -57
- package/lib-module/Progress/ProgressBar.js +7 -8
- package/lib-module/QuantitySelector/QuantitySelector.js +8 -30
- package/lib-module/QuantitySelector/SideButton.js +4 -6
- package/lib-module/ResponsiveImage/ResponsiveImage.js +5 -12
- package/lib-module/Ribbon/Ribbon.js +4 -9
- package/lib-module/SkeletonProvider/SkeletonImage.js +0 -5
- package/lib-module/SkeletonProvider/SkeletonProvider.js +4 -12
- package/lib-module/SkeletonProvider/SkeletonTypography.js +0 -5
- package/lib-module/Span/Span.js +3 -7
- package/lib-module/Spinner/Spinner.js +11 -24
- package/lib-module/Spinner/SpinnerContent.js +2 -8
- package/lib-module/StoryCard/StoryCard.js +12 -17
- package/lib-module/Table/Body.js +0 -2
- package/lib-module/Table/Cell.js +4 -14
- package/lib-module/Table/Header.js +0 -2
- package/lib-module/Table/Row.js +0 -2
- package/lib-module/Table/SubHeading.js +0 -2
- package/lib-module/Table/Table.js +5 -6
- package/lib-module/TermsAndConditions/ExpandCollapse.js +4 -2
- package/lib-module/TermsAndConditions/TermsAndConditions.js +7 -9
- package/lib-module/Testimonial/Testimonial.js +2 -11
- package/lib-module/Toast/Toast.js +4 -15
- package/lib-module/Video/ControlBar/ControlBar.js +2 -9
- package/lib-module/Video/ControlBar/Controls/VideoButton/VideoButton.js +4 -8
- package/lib-module/Video/ControlBar/Controls/VideoMenu/VideoMenu.js +4 -8
- package/lib-module/Video/ControlBar/Controls/VideoProgressBar/VideoProgressBar.js +12 -13
- package/lib-module/Video/ControlBar/Controls/VolumeSlider/VolumeSlider.js +8 -10
- package/lib-module/Video/MiddleControlButton/MiddleControlButton.js +2 -3
- package/lib-module/Video/Video.js +122 -173
- package/lib-module/VideoPicker/VideoPicker.js +6 -15
- package/lib-module/VideoPicker/VideoPickerPlayer.js +2 -3
- package/lib-module/VideoPicker/VideoPickerThumbnail.js +7 -13
- package/lib-module/VideoPicker/VideoSlider.js +6 -9
- package/lib-module/VideoPicker/videoPropType.js +2 -1
- package/lib-module/WaffleGrid/WaffleGrid.js +11 -15
- package/lib-module/WebPortal/WebPortal.js +1 -1
- package/lib-module/WebVideo/WebVideo.js +4 -15
- package/lib-module/baseExports.js +3 -2
- package/lib-module/index.js +0 -1
- package/lib-module/shared/FullBleedContent/FullBleedContent.js +5 -10
- package/lib-module/shared/FullBleedContent/getFullBleedBorderRadius.js +0 -10
- package/lib-module/shared/FullBleedContent/useFullBleedContentProps.js +1 -11
- package/lib-module/shared/VideoSplash/SplashButton/SplashButton.js +2 -3
- package/lib-module/shared/VideoSplash/SplashButtonWithDetails/SplashButtonWithDetails.js +7 -12
- package/lib-module/shared/VideoSplash/VideoSplash.js +4 -4
- package/lib-module/utils/logger.js +2 -2
- package/lib-module/utils/media.js +2 -9
- package/lib-module/utils/renderStructuredContent.js +14 -25
- package/lib-module/utils/ssr.js +0 -4
- package/lib-module/utils/useOverlaidPosition.js +8 -27
- package/lib-module/utils/useTypographyTheme.js +4 -4
- package/package.json +3 -3
- package/src/PriceLockup/PriceLockup.jsx +36 -11
- package/src/baseExports.js +1 -0
- package/src/index.js +0 -1
- package/lib/Modal/Modal.js +0 -146
- package/lib/Modal/ModalContent.js +0 -203
- package/lib/Modal/index.js +0 -13
- package/lib-module/Modal/Modal.js +0 -132
- package/lib-module/Modal/ModalContent.js +0 -181
- package/lib-module/Modal/index.js +0 -2
- package/src/Modal/Modal.jsx +0 -121
- package/src/Modal/ModalContent.jsx +0 -167
- package/src/Modal/index.js +0 -3
|
@@ -4,32 +4,20 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
|
|
10
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
-
|
|
12
9
|
var _componentsBase = require("@telus-uds/components-base");
|
|
13
|
-
|
|
14
10
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
15
|
-
|
|
16
11
|
var _FootnoteLink = _interopRequireDefault(require("../Footnote/FootnoteLink"));
|
|
17
|
-
|
|
18
12
|
var _tokens = _interopRequireDefault(require("./tokens"));
|
|
19
|
-
|
|
20
13
|
var _utils = require("../utils");
|
|
21
|
-
|
|
22
14
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
23
|
-
|
|
24
15
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
25
|
-
|
|
26
16
|
const [selectProps, selectedSystemPropTypes] = (0, _componentsBase.selectSystemProps)([_utils.htmlAttrs]);
|
|
27
|
-
|
|
28
17
|
const PriceLockupContainer = /*#__PURE__*/_styledComponents.default.div.withConfig({
|
|
29
18
|
displayName: "PriceLockup__PriceLockupContainer",
|
|
30
19
|
componentId: "components-web__sc-1x6duay-0"
|
|
31
20
|
})(["display:flex;flex-direction:column;width:fit-content;"]);
|
|
32
|
-
|
|
33
21
|
const PriceContainer = /*#__PURE__*/_styledComponents.default.div.withConfig({
|
|
34
22
|
displayName: "PriceLockup__PriceContainer",
|
|
35
23
|
componentId: "components-web__sc-1x6duay-1"
|
|
@@ -39,7 +27,6 @@ const PriceContainer = /*#__PURE__*/_styledComponents.default.div.withConfig({
|
|
|
39
27
|
} = _ref;
|
|
40
28
|
return priceMarginBottom;
|
|
41
29
|
});
|
|
42
|
-
|
|
43
30
|
const FootnoteContainer = /*#__PURE__*/_styledComponents.default.div.withConfig({
|
|
44
31
|
displayName: "PriceLockup__FootnoteContainer",
|
|
45
32
|
componentId: "components-web__sc-1x6duay-2"
|
|
@@ -54,7 +41,6 @@ const FootnoteContainer = /*#__PURE__*/_styledComponents.default.div.withConfig(
|
|
|
54
41
|
} = _ref3;
|
|
55
42
|
return footnoteGap;
|
|
56
43
|
});
|
|
57
|
-
|
|
58
44
|
const BottomTextContainer = /*#__PURE__*/_styledComponents.default.div.withConfig({
|
|
59
45
|
displayName: "PriceLockup__BottomTextContainer",
|
|
60
46
|
componentId: "components-web__sc-1x6duay-3"
|
|
@@ -64,7 +50,6 @@ const BottomTextContainer = /*#__PURE__*/_styledComponents.default.div.withConfi
|
|
|
64
50
|
} = _ref4;
|
|
65
51
|
return bottomTextMarginTop;
|
|
66
52
|
});
|
|
67
|
-
|
|
68
53
|
const BottomLinksContainer = /*#__PURE__*/_styledComponents.default.div.withConfig({
|
|
69
54
|
displayName: "PriceLockup__BottomLinksContainer",
|
|
70
55
|
componentId: "components-web__sc-1x6duay-4"
|
|
@@ -74,7 +59,6 @@ const BottomLinksContainer = /*#__PURE__*/_styledComponents.default.div.withConf
|
|
|
74
59
|
} = _ref5;
|
|
75
60
|
return bottomLinksMarginLeft;
|
|
76
61
|
});
|
|
77
|
-
|
|
78
62
|
const TopTextContainer = /*#__PURE__*/_styledComponents.default.div.withConfig({
|
|
79
63
|
displayName: "PriceLockup__TopTextContainer",
|
|
80
64
|
componentId: "components-web__sc-1x6duay-5"
|
|
@@ -84,39 +68,54 @@ const TopTextContainer = /*#__PURE__*/_styledComponents.default.div.withConfig({
|
|
|
84
68
|
} = _ref6;
|
|
85
69
|
return topTextMarginBottom;
|
|
86
70
|
});
|
|
87
|
-
|
|
71
|
+
const PriceTextContainer = /*#__PURE__*/_styledComponents.default.div.withConfig({
|
|
72
|
+
displayName: "PriceLockup__PriceTextContainer",
|
|
73
|
+
componentId: "components-web__sc-1x6duay-6"
|
|
74
|
+
})(["display:flex;flex-direction:", ";"], _ref7 => {
|
|
75
|
+
let {
|
|
76
|
+
ratePosition
|
|
77
|
+
} = _ref7;
|
|
78
|
+
return ratePosition === 'bottom' ? 'column' : 'row';
|
|
79
|
+
});
|
|
80
|
+
const RateContainer = /*#__PURE__*/_styledComponents.default.div.withConfig({
|
|
81
|
+
displayName: "PriceLockup__RateContainer",
|
|
82
|
+
componentId: "components-web__sc-1x6duay-7"
|
|
83
|
+
})(["display:flex;"]);
|
|
88
84
|
const RateTextContainer = /*#__PURE__*/_styledComponents.default.div.withConfig({
|
|
89
85
|
displayName: "PriceLockup__RateTextContainer",
|
|
90
|
-
componentId: "components-web__sc-1x6duay-
|
|
91
|
-
})(["align-self:
|
|
92
|
-
|
|
86
|
+
componentId: "components-web__sc-1x6duay-8"
|
|
87
|
+
})(["align-self:", ";"], _ref8 => {
|
|
88
|
+
let {
|
|
89
|
+
ratePosition
|
|
90
|
+
} = _ref8;
|
|
91
|
+
return ratePosition === 'bottom' ? 'flex-start' : 'flex-end';
|
|
92
|
+
});
|
|
93
93
|
const StrikeThroughContainer = /*#__PURE__*/_styledComponents.default.div.withConfig({
|
|
94
94
|
displayName: "PriceLockup__StrikeThroughContainer",
|
|
95
|
-
componentId: "components-web__sc-1x6duay-
|
|
96
|
-
})(["display:flex;position:relative;align-items:center;::before{content:'';width:100%;top:", ";height:", ";background:", ";position:absolute;}"],
|
|
95
|
+
componentId: "components-web__sc-1x6duay-9"
|
|
96
|
+
})(["display:flex;position:relative;align-items:center;::before{content:'';width:100%;top:", ";height:", ";background:", ";position:absolute;}"], _ref9 => {
|
|
97
97
|
let {
|
|
98
98
|
strikeThroughPosition
|
|
99
|
-
} =
|
|
99
|
+
} = _ref9;
|
|
100
100
|
return `${strikeThroughPosition}px`;
|
|
101
|
-
},
|
|
101
|
+
}, _ref10 => {
|
|
102
102
|
let {
|
|
103
103
|
strikeThroughHeight
|
|
104
|
-
} =
|
|
104
|
+
} = _ref10;
|
|
105
105
|
return `${strikeThroughHeight}px`;
|
|
106
|
-
},
|
|
106
|
+
}, _ref11 => {
|
|
107
107
|
let {
|
|
108
108
|
strikeThroughColor
|
|
109
|
-
} =
|
|
109
|
+
} = _ref11;
|
|
110
110
|
return strikeThroughColor;
|
|
111
111
|
});
|
|
112
|
-
|
|
113
|
-
const selectFootnoteLinkStyles = _ref10 => {
|
|
112
|
+
const selectFootnoteLinkStyles = _ref12 => {
|
|
114
113
|
let {
|
|
115
114
|
footnoteLinkColor,
|
|
116
115
|
footnoteLinkFontName,
|
|
117
116
|
footnoteLinkFontWeight,
|
|
118
117
|
footnoteLinkLineHeight
|
|
119
|
-
} =
|
|
118
|
+
} = _ref12;
|
|
120
119
|
return {
|
|
121
120
|
color: footnoteLinkColor,
|
|
122
121
|
fontName: footnoteLinkFontName,
|
|
@@ -124,21 +123,19 @@ const selectFootnoteLinkStyles = _ref10 => {
|
|
|
124
123
|
lineHeight: footnoteLinkLineHeight
|
|
125
124
|
};
|
|
126
125
|
};
|
|
127
|
-
|
|
128
|
-
const selectStrikeThroughTokens = _ref11 => {
|
|
126
|
+
const selectStrikeThroughTokens = _ref13 => {
|
|
129
127
|
let {
|
|
130
128
|
strikeThroughPosition,
|
|
131
129
|
strikeThroughHeight,
|
|
132
130
|
strikeThroughColor
|
|
133
|
-
} =
|
|
131
|
+
} = _ref13;
|
|
134
132
|
return {
|
|
135
133
|
strikeThroughHeight,
|
|
136
134
|
strikeThroughPosition,
|
|
137
135
|
strikeThroughColor
|
|
138
136
|
};
|
|
139
137
|
};
|
|
140
|
-
|
|
141
|
-
const PriceLockup = _ref12 => {
|
|
138
|
+
const PriceLockup = _ref14 => {
|
|
142
139
|
let {
|
|
143
140
|
size = 'medium',
|
|
144
141
|
signDirection = 'left',
|
|
@@ -147,6 +144,7 @@ const PriceLockup = _ref12 => {
|
|
|
147
144
|
price,
|
|
148
145
|
currencySymbol = '$',
|
|
149
146
|
rateText,
|
|
147
|
+
ratePosition = 'right',
|
|
150
148
|
bottomText,
|
|
151
149
|
onClickFootnote,
|
|
152
150
|
strikeThrough,
|
|
@@ -154,7 +152,7 @@ const PriceLockup = _ref12 => {
|
|
|
154
152
|
tokens: priceLockupTokens,
|
|
155
153
|
variant = {},
|
|
156
154
|
...rest
|
|
157
|
-
} =
|
|
155
|
+
} = _ref14;
|
|
158
156
|
const viewport = (0, _componentsBase.useViewport)();
|
|
159
157
|
const {
|
|
160
158
|
footnoteMarginTop,
|
|
@@ -167,7 +165,8 @@ const PriceLockup = _ref12 => {
|
|
|
167
165
|
dividerColor,
|
|
168
166
|
footnoteLinkFontSize,
|
|
169
167
|
...themeTokens
|
|
170
|
-
} = (0, _componentsBase.useThemeTokens)('PriceLockup', priceLockupTokens, {
|
|
168
|
+
} = (0, _componentsBase.useThemeTokens)('PriceLockup', priceLockupTokens, {
|
|
169
|
+
...variant,
|
|
171
170
|
size
|
|
172
171
|
}, {
|
|
173
172
|
viewport,
|
|
@@ -177,59 +176,72 @@ const PriceLockup = _ref12 => {
|
|
|
177
176
|
const priceString = String(price);
|
|
178
177
|
const lastDotPosition = priceString.lastIndexOf('.');
|
|
179
178
|
const lastCommaPosition = priceString.lastIndexOf(',');
|
|
180
|
-
const [separator, separatorPosition] = lastDotPosition > lastCommaPosition ? ['.', lastDotPosition] : [',', lastCommaPosition];
|
|
181
|
-
// a part of the amount, and the cents are not included in the price string
|
|
179
|
+
const [separator, separatorPosition] = lastDotPosition > lastCommaPosition ? ['.', lastDotPosition] : [',', lastCommaPosition];
|
|
182
180
|
|
|
181
|
+
// If the separator is at the fourth character from the end of the string or more, it's most probably
|
|
182
|
+
// a part of the amount, and the cents are not included in the price string
|
|
183
183
|
const hasCents = separatorPosition !== -1 && separatorPosition >= priceString.length - 3;
|
|
184
184
|
const amount = hasCents ? priceString.substring(0, separatorPosition) : priceString;
|
|
185
185
|
const cents = hasCents ? priceString.substring(separatorPosition + 1) : null;
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
186
|
+
const renderTypography = (value, tokens, position) => {
|
|
187
|
+
const customProps = position === 'bottom' ? {
|
|
188
|
+
variant: {
|
|
189
|
+
size: 'micro'
|
|
190
|
+
},
|
|
191
|
+
tokens: {
|
|
192
|
+
color: fontColor
|
|
193
|
+
}
|
|
194
|
+
} : {
|
|
195
|
+
tokens: {
|
|
196
|
+
...tokens,
|
|
197
|
+
color: fontColor
|
|
198
|
+
}
|
|
199
|
+
};
|
|
200
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.Typography, {
|
|
201
|
+
...customProps,
|
|
202
|
+
children: value
|
|
203
|
+
});
|
|
204
|
+
};
|
|
194
205
|
const renderCurrencySymbol = () => renderTypography(`${currencySymbol}`, typographyTokens.dollarSign);
|
|
195
|
-
|
|
196
206
|
const renderFootnoteLinks = () => footnoteLinks && footnoteLinks.length > 0 ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_FootnoteLink.default, {
|
|
197
207
|
fontSize: footnoteLinkFontSize,
|
|
198
208
|
tokens: selectFootnoteLinkStyles(themeTokens),
|
|
199
209
|
number: footnoteLinks,
|
|
200
210
|
onClick: onClickFootnote
|
|
201
211
|
}) : null;
|
|
202
|
-
|
|
203
212
|
const renderAmount = () => {
|
|
204
213
|
const amountComponent = renderTypography(amount, typographyTokens.amount);
|
|
205
|
-
|
|
206
214
|
if (strikeThrough) {
|
|
207
215
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
208
216
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.A11yText, {
|
|
209
217
|
text: a11yText
|
|
210
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(StrikeThroughContainer, {
|
|
218
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(StrikeThroughContainer, {
|
|
219
|
+
...selectStrikeThroughTokens(themeTokens),
|
|
211
220
|
children: amountComponent
|
|
212
221
|
})]
|
|
213
222
|
});
|
|
214
223
|
}
|
|
215
|
-
|
|
216
224
|
return amountComponent;
|
|
217
225
|
};
|
|
218
|
-
|
|
219
226
|
const renderPrice = () => /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
220
227
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(PriceContainer, {
|
|
221
228
|
priceMarginBottom: `${priceMarginBottom}px`,
|
|
222
|
-
children: [
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
229
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(PriceTextContainer, {
|
|
230
|
+
ratePosition: ratePosition,
|
|
231
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(RateContainer, {
|
|
232
|
+
children: [signDirection === 'left' && renderCurrencySymbol(), renderAmount(), cents && renderTypography(`${separator}${cents}`, typographyTokens.cents), signDirection === 'right' && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
233
|
+
children: ["\xA0", renderCurrencySymbol()]
|
|
234
|
+
})]
|
|
235
|
+
}), rateText && /*#__PURE__*/(0, _jsxRuntime.jsx)(RateTextContainer, {
|
|
236
|
+
ratePosition: ratePosition,
|
|
237
|
+
children: renderTypography(rateText, typographyTokens.rate, ratePosition)
|
|
238
|
+
})]
|
|
226
239
|
}), !bottomText && footnoteLinks.length <= 3 && /*#__PURE__*/(0, _jsxRuntime.jsx)(BottomLinksContainer, {
|
|
227
240
|
bottomLinksMarginLeft: `${bottomLinksMarginLeft}px`,
|
|
228
241
|
children: renderFootnoteLinks()
|
|
229
242
|
})]
|
|
230
243
|
}), !bottomText && footnoteLinks.length > 3 && renderFootnoteLinks()]
|
|
231
244
|
});
|
|
232
|
-
|
|
233
245
|
const renderFootnoteContent = () => /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
234
246
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(FootnoteContainer, {
|
|
235
247
|
footnoteMarginTop: `${footnoteMarginTop}px`,
|
|
@@ -240,12 +252,11 @@ const PriceLockup = _ref12 => {
|
|
|
240
252
|
}), footnoteLinks.length <= 3 && renderFootnoteLinks()]
|
|
241
253
|
}), footnoteLinks.length > 3 && renderFootnoteLinks()]
|
|
242
254
|
});
|
|
243
|
-
|
|
244
255
|
if (strikeThrough && !a11yText) {
|
|
245
256
|
(0, _utils.warn)('PriceLockup', 'a11yText must be provided with strikethrough pricing');
|
|
246
257
|
}
|
|
247
|
-
|
|
248
|
-
|
|
258
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(PriceLockupContainer, {
|
|
259
|
+
...selectProps(rest),
|
|
249
260
|
children: [topText && /*#__PURE__*/(0, _jsxRuntime.jsx)(TopTextContainer, {
|
|
250
261
|
topTextMarginBottom: `${topTextMarginBottom}px`,
|
|
251
262
|
children: renderTypography(topText, typographyTokens.topText)
|
|
@@ -258,68 +269,60 @@ const PriceLockup = _ref12 => {
|
|
|
258
269
|
}), bottomText && renderFootnoteContent()]
|
|
259
270
|
});
|
|
260
271
|
};
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
272
|
+
PriceLockup.propTypes = {
|
|
273
|
+
...selectedSystemPropTypes,
|
|
264
274
|
/**
|
|
265
275
|
* Size of the component
|
|
266
276
|
*
|
|
267
277
|
* Small for pricing in product catalogue pages, medium for pricing in product comparison cards and large for pricing in banners and promo cards
|
|
268
278
|
*/
|
|
269
279
|
size: _propTypes.default.oneOf(['small', 'medium', 'large']),
|
|
270
|
-
|
|
271
280
|
/**
|
|
272
281
|
* If currency symbol other than `$` to be used
|
|
273
282
|
*/
|
|
274
283
|
currencySymbol: _propTypes.default.string,
|
|
275
|
-
|
|
276
284
|
/**
|
|
277
285
|
* Shows additional info above the price
|
|
278
286
|
*/
|
|
279
287
|
topText: _propTypes.default.string,
|
|
280
|
-
|
|
281
288
|
/**
|
|
282
289
|
* Monetary value (including decimals separated by ".")
|
|
283
290
|
*/
|
|
284
291
|
price: _propTypes.default.string.isRequired,
|
|
285
|
-
|
|
286
292
|
/**
|
|
287
293
|
* Shows month/year unit
|
|
288
294
|
*/
|
|
289
295
|
rateText: _propTypes.default.string,
|
|
290
|
-
|
|
291
296
|
/**
|
|
292
297
|
* Shows additional info below the price with a `Divider`
|
|
293
298
|
*/
|
|
294
299
|
bottomText: _propTypes.default.string,
|
|
295
|
-
|
|
296
300
|
/**
|
|
297
301
|
* Displays which side the currency should apperar (left, right)
|
|
298
302
|
*/
|
|
299
303
|
signDirection: _propTypes.default.oneOf(['right', 'left']),
|
|
300
|
-
|
|
304
|
+
/**
|
|
305
|
+
* Displays where the rate should apperar (bottom, right)
|
|
306
|
+
*/
|
|
307
|
+
ratePosition: _propTypes.default.oneOf(['right', 'bottom']),
|
|
301
308
|
/**
|
|
302
309
|
* Shows additional link for context
|
|
303
310
|
*/
|
|
304
311
|
footnoteLinks: _propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string])),
|
|
305
|
-
|
|
306
312
|
/**
|
|
307
313
|
* Function to be called when a footnote link is clicked
|
|
308
314
|
*/
|
|
309
315
|
onClickFootnote: _propTypes.default.func,
|
|
310
|
-
|
|
311
316
|
/**
|
|
312
317
|
* To show price savings comparison
|
|
313
318
|
*/
|
|
314
319
|
strikeThrough: _propTypes.default.bool,
|
|
315
|
-
|
|
316
320
|
/**
|
|
317
321
|
* To provide a11y text for `PriceLockup` component
|
|
318
322
|
*
|
|
319
323
|
* **Note:** a11yText will override strikethrough price, so it must include price (ie. "was 50 dollars per month")
|
|
320
324
|
*/
|
|
321
325
|
a11yText: _propTypes.default.string,
|
|
322
|
-
|
|
323
326
|
/**
|
|
324
327
|
* `PriceLockup` tokens
|
|
325
328
|
*/
|
package/lib/PriceLockup/index.js
CHANGED
|
@@ -4,10 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var _PriceLockup = _interopRequireDefault(require("./PriceLockup"));
|
|
9
|
-
|
|
10
8
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
-
|
|
12
9
|
var _default = _PriceLockup.default;
|
|
13
10
|
exports.default = _default;
|
|
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
// map typography tokens accordenly
|
|
9
8
|
var _default = _ref => {
|
|
10
9
|
let {
|
|
@@ -60,5 +59,4 @@ var _default = _ref => {
|
|
|
60
59
|
}
|
|
61
60
|
};
|
|
62
61
|
};
|
|
63
|
-
|
|
64
62
|
exports.default = _default;
|
|
@@ -4,25 +4,17 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
|
|
10
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
-
|
|
12
9
|
var _componentsBase = require("@telus-uds/components-base");
|
|
13
|
-
|
|
14
10
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
15
|
-
|
|
16
11
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
17
|
-
|
|
18
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
|
-
|
|
20
13
|
// Passes React Native-oriented system props through UDS Progress
|
|
21
14
|
const [selectProps, selectedSystemPropTypes] = (0, _componentsBase.selectSystemProps)([_componentsBase.a11yProps, _componentsBase.viewProps]);
|
|
22
15
|
const {
|
|
23
16
|
Bar: ProgressBarBase
|
|
24
17
|
} = _componentsBase.Progress;
|
|
25
|
-
|
|
26
18
|
const Gradient = /*#__PURE__*/_styledComponents.default.div.attrs({
|
|
27
19
|
'data-testid': 'ProgressBar-Gradient'
|
|
28
20
|
}).withConfig({
|
|
@@ -46,6 +38,7 @@ const Gradient = /*#__PURE__*/_styledComponents.default.div.attrs({
|
|
|
46
38
|
background: `${type}-gradient(${angle}deg, ${stops[0].color}, ${stops[1].color})`
|
|
47
39
|
};
|
|
48
40
|
});
|
|
41
|
+
|
|
49
42
|
/**
|
|
50
43
|
* The `ProgressBar` is a visual representation of linear progression.
|
|
51
44
|
* It provides simple but important information at a quick glance.
|
|
@@ -57,8 +50,6 @@ const Gradient = /*#__PURE__*/_styledComponents.default.div.attrs({
|
|
|
57
50
|
* `gradient` is being used here to provide gradient filling.
|
|
58
51
|
*
|
|
59
52
|
*/
|
|
60
|
-
|
|
61
|
-
|
|
62
53
|
const ProgressBar = _ref2 => {
|
|
63
54
|
let {
|
|
64
55
|
percentage,
|
|
@@ -73,24 +64,22 @@ const ProgressBar = _ref2 => {
|
|
|
73
64
|
tokens: tokens,
|
|
74
65
|
variant: variant,
|
|
75
66
|
...selectedProps,
|
|
76
|
-
children: themeTokens.gradient && /*#__PURE__*/(0, _jsxRuntime.jsx)(Gradient, {
|
|
67
|
+
children: themeTokens.gradient && /*#__PURE__*/(0, _jsxRuntime.jsx)(Gradient, {
|
|
68
|
+
...themeTokens,
|
|
77
69
|
percentage: percentage
|
|
78
70
|
})
|
|
79
71
|
});
|
|
80
72
|
};
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
73
|
+
ProgressBar.propTypes = {
|
|
74
|
+
...selectedSystemPropTypes,
|
|
84
75
|
/**
|
|
85
76
|
* Percentage of completion.
|
|
86
77
|
*/
|
|
87
78
|
percentage: _propTypes.default.number,
|
|
88
|
-
|
|
89
79
|
/**
|
|
90
80
|
* ProgressBar tokens.
|
|
91
81
|
*/
|
|
92
82
|
tokens: (0, _componentsBase.getTokensPropType)('ProgressBar'),
|
|
93
|
-
|
|
94
83
|
/**
|
|
95
84
|
* ProgressBar variant.
|
|
96
85
|
*/
|
package/lib/Progress/index.js
CHANGED
|
@@ -4,13 +4,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var _componentsBase = require("@telus-uds/components-base");
|
|
9
|
-
|
|
10
8
|
var _ProgressBar = _interopRequireDefault(require("./ProgressBar"));
|
|
11
|
-
|
|
12
9
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
-
|
|
14
10
|
_componentsBase.Progress.Bar = _ProgressBar.default;
|
|
15
11
|
var _default = _componentsBase.Progress;
|
|
16
12
|
exports.default = _default;
|
|
@@ -4,35 +4,22 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
-
|
|
10
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
-
|
|
12
9
|
var _componentsBase = require("@telus-uds/components-base");
|
|
13
|
-
|
|
14
10
|
var _styles = require("./styles");
|
|
15
|
-
|
|
16
11
|
var _dictionary = _interopRequireDefault(require("./dictionary"));
|
|
17
|
-
|
|
18
12
|
var _SideButton = _interopRequireDefault(require("./SideButton"));
|
|
19
|
-
|
|
20
13
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
21
|
-
|
|
22
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
23
|
-
|
|
24
15
|
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
|
-
|
|
26
16
|
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; }
|
|
27
|
-
|
|
28
17
|
const {
|
|
29
18
|
isNaN
|
|
30
19
|
} = Number;
|
|
31
|
-
|
|
32
20
|
const isNumber = value => {
|
|
33
21
|
return typeof value === 'number' && !isNaN(value);
|
|
34
22
|
};
|
|
35
|
-
|
|
36
23
|
const QuantitySelector = _ref => {
|
|
37
24
|
let {
|
|
38
25
|
id,
|
|
@@ -60,14 +47,12 @@ const QuantitySelector = _ref => {
|
|
|
60
47
|
dictionary,
|
|
61
48
|
copy
|
|
62
49
|
});
|
|
63
|
-
|
|
64
50
|
const getValidatedNumber = numberToEvaluate => {
|
|
65
51
|
if (isNaN(numberToEvaluate)) return null;
|
|
66
52
|
if (isNumber(minNumber) && numberToEvaluate < minNumber) throw getCopy('errors').numberIsTooSmall(minNumber);
|
|
67
53
|
if (isNumber(maxNumber) && numberToEvaluate > maxNumber) throw getCopy('errors').numberIsTooBig(maxNumber);
|
|
68
54
|
return numberToEvaluate;
|
|
69
55
|
};
|
|
70
|
-
|
|
71
56
|
const {
|
|
72
57
|
currentValue: number,
|
|
73
58
|
setValue: setNumber
|
|
@@ -79,7 +64,6 @@ const QuantitySelector = _ref => {
|
|
|
79
64
|
const isDecreaseEnabled = !disabled && !isNumber(minNumber) || number > minNumber;
|
|
80
65
|
const isIncreaseEnabled = !disabled && !isNumber(maxNumber) || number < maxNumber;
|
|
81
66
|
const inputValue = isNumber(number) ? number.toString() : '';
|
|
82
|
-
|
|
83
67
|
const updateNumber = (newNumber, originalInputEvent) => {
|
|
84
68
|
try {
|
|
85
69
|
const validatedNumber = getValidatedNumber(newNumber);
|
|
@@ -89,18 +73,15 @@ const QuantitySelector = _ref => {
|
|
|
89
73
|
setError(e);
|
|
90
74
|
}
|
|
91
75
|
};
|
|
92
|
-
|
|
93
76
|
const inputChangeHandler = (textInputValue, event) => {
|
|
94
77
|
if (textInputValue === '') setNumber(null);
|
|
95
78
|
const numberFromTextInput = Number(textInputValue);
|
|
96
|
-
|
|
97
79
|
if (isNumber(numberFromTextInput)) {
|
|
98
80
|
updateNumber(numberFromTextInput, event);
|
|
99
81
|
} else {
|
|
100
82
|
setError(getCopy('errors').invalidCharacters);
|
|
101
83
|
}
|
|
102
84
|
};
|
|
103
|
-
|
|
104
85
|
const renderLabel = () => label ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.InputLabel, {
|
|
105
86
|
forId: id,
|
|
106
87
|
label: label,
|
|
@@ -108,9 +89,7 @@ const QuantitySelector = _ref => {
|
|
|
108
89
|
hintPosition: hintPosition,
|
|
109
90
|
tooltip: tooltip
|
|
110
91
|
}) : null;
|
|
111
|
-
|
|
112
92
|
const getTokens = (0, _componentsBase.useThemeTokensCallback)('QuantitySelector', tokens, variant);
|
|
113
|
-
|
|
114
93
|
const renderTextInput = () => /*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.TextInput, {
|
|
115
94
|
nativeID: id,
|
|
116
95
|
value: inputValue,
|
|
@@ -123,9 +102,11 @@ const QuantitySelector = _ref => {
|
|
|
123
102
|
textColor,
|
|
124
103
|
inputBackgroundColor,
|
|
125
104
|
...rest
|
|
126
|
-
} = getTokens({
|
|
105
|
+
} = getTokens({
|
|
106
|
+
...textInputState
|
|
127
107
|
});
|
|
128
|
-
return {
|
|
108
|
+
return {
|
|
109
|
+
...rest,
|
|
129
110
|
order: 1,
|
|
130
111
|
borderWidth: inputBorderWidth,
|
|
131
112
|
backgroundColor: inputBackgroundColor,
|
|
@@ -136,7 +117,8 @@ const QuantitySelector = _ref => {
|
|
|
136
117
|
outerBorderWidth: 0
|
|
137
118
|
};
|
|
138
119
|
},
|
|
139
|
-
onChange: inputChangeHandler
|
|
120
|
+
onChange: inputChangeHandler
|
|
121
|
+
// Using title as an accessibility workaround
|
|
140
122
|
// given that accessibilityLabel is not available
|
|
141
123
|
,
|
|
142
124
|
keyboardType: "numeric",
|
|
@@ -146,11 +128,9 @@ const QuantitySelector = _ref => {
|
|
|
146
128
|
accessibilityValueMin: minNumber,
|
|
147
129
|
accessibilityValueNow: number
|
|
148
130
|
});
|
|
149
|
-
|
|
150
131
|
const flexOrder = order => ({
|
|
151
132
|
order
|
|
152
133
|
});
|
|
153
|
-
|
|
154
134
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_componentsBase.Box, {
|
|
155
135
|
space: 2,
|
|
156
136
|
testID: testID,
|
|
@@ -196,9 +176,9 @@ const QuantitySelector = _ref => {
|
|
|
196
176
|
})
|
|
197
177
|
}) : null]
|
|
198
178
|
});
|
|
199
|
-
};
|
|
200
|
-
|
|
179
|
+
};
|
|
201
180
|
|
|
181
|
+
// If a language dictionary entry is provided, it must contain every key
|
|
202
182
|
const dictionaryContentShape = _propTypes.default.shape({
|
|
203
183
|
accessibility: _propTypes.default.shape({
|
|
204
184
|
a11yLabel: _propTypes.default.string.isRequired,
|
|
@@ -211,64 +191,52 @@ const dictionaryContentShape = _propTypes.default.shape({
|
|
|
211
191
|
invalidCharacters: _propTypes.default.string.isRequired
|
|
212
192
|
}).isRequired
|
|
213
193
|
});
|
|
214
|
-
|
|
215
194
|
QuantitySelector.propTypes = {
|
|
216
195
|
/**
|
|
217
196
|
* The id of the input field
|
|
218
197
|
*/
|
|
219
198
|
id: _propTypes.default.string,
|
|
220
|
-
|
|
221
199
|
/**
|
|
222
200
|
* The minimum number allowed
|
|
223
201
|
*/
|
|
224
202
|
minNumber: _propTypes.default.number,
|
|
225
|
-
|
|
226
203
|
/**
|
|
227
204
|
* The maximum number allowed
|
|
228
205
|
*/
|
|
229
206
|
maxNumber: _propTypes.default.number,
|
|
230
|
-
|
|
231
207
|
/**
|
|
232
208
|
* The callback function that is called when the value of the input field changes
|
|
233
209
|
*/
|
|
234
210
|
onChange: _propTypes.default.func,
|
|
235
|
-
|
|
236
211
|
/**
|
|
237
212
|
* The default value of the input field
|
|
238
213
|
*/
|
|
239
214
|
defaultValue: _propTypes.default.number,
|
|
240
|
-
|
|
241
215
|
/**
|
|
242
216
|
* If the input's state is to be controlled by a parent component, use this prop
|
|
243
217
|
* together with the `onChange` to pass down and update the lifted state.
|
|
244
218
|
*/
|
|
245
219
|
value: _propTypes.default.number,
|
|
246
|
-
|
|
247
220
|
/**
|
|
248
221
|
* The label of the input field
|
|
249
222
|
*/
|
|
250
223
|
label: _propTypes.default.string,
|
|
251
|
-
|
|
252
224
|
/**
|
|
253
225
|
* The hint of the input field
|
|
254
226
|
*/
|
|
255
227
|
hint: _propTypes.default.string,
|
|
256
|
-
|
|
257
228
|
/**
|
|
258
229
|
* The position of the hint. Could be shown along side the label or below it
|
|
259
230
|
*/
|
|
260
231
|
hintPosition: _propTypes.default.oneOf(['inline', 'below']),
|
|
261
|
-
|
|
262
232
|
/**
|
|
263
233
|
* Adds a question mark which will display a tooltip when clicked
|
|
264
234
|
*/
|
|
265
235
|
tooltip: _propTypes.default.string,
|
|
266
|
-
|
|
267
236
|
/**
|
|
268
237
|
* The accessibility label of the input field
|
|
269
238
|
*/
|
|
270
239
|
accessibilityLabel: _propTypes.default.string,
|
|
271
|
-
|
|
272
240
|
/**
|
|
273
241
|
* The dictionary object containing the content for the input field
|
|
274
242
|
*/
|
|
@@ -276,7 +244,6 @@ QuantitySelector.propTypes = {
|
|
|
276
244
|
en: dictionaryContentShape,
|
|
277
245
|
fr: dictionaryContentShape
|
|
278
246
|
}),
|
|
279
|
-
|
|
280
247
|
/**
|
|
281
248
|
* The language to use for the copy.
|
|
282
249
|
*/
|
|
@@ -286,7 +253,6 @@ QuantitySelector.propTypes = {
|
|
|
286
253
|
disabled: _propTypes.default.bool
|
|
287
254
|
}),
|
|
288
255
|
tokens: _propTypes.default.oneOf([_propTypes.default.object, _propTypes.default.func]),
|
|
289
|
-
|
|
290
256
|
/**
|
|
291
257
|
* Sets `data-testid` attribute on the input field for testing purposes.
|
|
292
258
|
*/
|