@telus-uds/components-web 2.8.1 → 2.10.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 +28 -2
- package/component-docs.json +106 -84
- package/lib/BlockQuote/BlockQuote.js +49 -4
- package/lib/Callout/Callout.js +12 -0
- package/lib/Countdown/Countdown.js +34 -25
- package/lib/Countdown/Segment.js +2 -0
- package/lib/Countdown/constants.js +3 -3
- package/lib/DatePicker/CalendarContainer.js +24 -0
- package/lib/DatePicker/DatePicker.js +8 -2
- package/lib/Disclaimer/Disclaimer.js +0 -4
- package/lib/ExpandCollapseMini/ExpandCollapseMini.js +4 -0
- package/lib/ExpandCollapseMini/ExpandCollapseMiniControl.js +16 -0
- package/lib/Footnote/Footnote.js +28 -11
- package/lib/IconButton/IconButton.js +8 -0
- package/lib/Listbox/Listbox.js +8 -0
- package/lib/Modal/ModalContent.js +0 -1
- package/lib/NavigationBar/NavigationBar.js +4 -0
- package/lib/OrderedList/Item.js +4 -0
- package/lib/Paragraph/Paragraph.js +4 -0
- package/lib/PreviewCard/AuthorDate.js +7 -0
- package/lib/PreviewCard/PreviewCard.js +3 -6
- package/lib/PriceLockup/PriceLockup.js +48 -0
- package/lib/QuantitySelector/QuantitySelector.js +51 -0
- package/lib/Span/Span.js +4 -0
- package/lib/Table/Table.js +4 -0
- package/lib/Toast/Toast.js +32 -2
- package/lib-module/BlockQuote/BlockQuote.js +50 -5
- package/lib-module/Callout/Callout.js +12 -0
- package/lib-module/Countdown/Countdown.js +34 -25
- package/lib-module/Countdown/Segment.js +3 -1
- package/lib-module/Countdown/constants.js +2 -2
- package/lib-module/DatePicker/CalendarContainer.js +24 -0
- package/lib-module/DatePicker/DatePicker.js +8 -2
- package/lib-module/Disclaimer/Disclaimer.js +0 -4
- package/lib-module/ExpandCollapseMini/ExpandCollapseMini.js +4 -0
- package/lib-module/ExpandCollapseMini/ExpandCollapseMiniControl.js +16 -0
- package/lib-module/Footnote/Footnote.js +28 -11
- package/lib-module/IconButton/IconButton.js +8 -0
- package/lib-module/Listbox/Listbox.js +8 -0
- package/lib-module/Modal/ModalContent.js +0 -1
- package/lib-module/NavigationBar/NavigationBar.js +4 -0
- package/lib-module/OrderedList/Item.js +4 -0
- package/lib-module/Paragraph/Paragraph.js +4 -0
- package/lib-module/PreviewCard/AuthorDate.js +7 -0
- package/lib-module/PreviewCard/PreviewCard.js +3 -6
- package/lib-module/PriceLockup/PriceLockup.js +48 -0
- package/lib-module/QuantitySelector/QuantitySelector.js +51 -0
- package/lib-module/Span/Span.js +4 -0
- package/lib-module/Table/Table.js +4 -0
- package/lib-module/Toast/Toast.js +33 -3
- package/package.json +3 -3
- package/src/BlockQuote/BlockQuote.jsx +53 -6
- package/src/Callout/Callout.jsx +9 -0
- package/src/Countdown/Countdown.jsx +34 -23
- package/src/Countdown/Segment.jsx +2 -1
- package/src/Countdown/constants.js +1 -1
- package/src/DatePicker/CalendarContainer.jsx +24 -0
- package/src/DatePicker/DatePicker.jsx +8 -2
- package/src/Disclaimer/Disclaimer.jsx +0 -3
- package/src/ExpandCollapseMini/ExpandCollapseMini.jsx +3 -0
- package/src/ExpandCollapseMini/ExpandCollapseMiniControl.jsx +12 -0
- package/src/Footnote/Footnote.jsx +44 -17
- package/src/IconButton/IconButton.jsx +6 -0
- package/src/Listbox/Listbox.jsx +6 -0
- package/src/Modal/ModalContent.jsx +0 -1
- package/src/NavigationBar/NavigationBar.jsx +3 -0
- package/src/OrderedList/Item.jsx +3 -0
- package/src/Paragraph/Paragraph.jsx +3 -0
- package/src/PreviewCard/AuthorDate.jsx +6 -0
- package/src/PreviewCard/PreviewCard.jsx +3 -7
- package/src/PriceLockup/PriceLockup.jsx +37 -0
- package/src/QuantitySelector/QuantitySelector.jsx +39 -0
- package/src/Span/Span.jsx +3 -0
- package/src/Table/Table.jsx +3 -0
- package/src/Toast/Toast.jsx +27 -4
|
@@ -79,6 +79,7 @@ const BlockQuote = _ref8 => {
|
|
|
79
79
|
variant,
|
|
80
80
|
...rest
|
|
81
81
|
} = _ref8;
|
|
82
|
+
const viewport = (0, _componentsBase.useViewport)();
|
|
82
83
|
const {
|
|
83
84
|
color,
|
|
84
85
|
paddingTop,
|
|
@@ -87,16 +88,44 @@ const BlockQuote = _ref8 => {
|
|
|
87
88
|
paddingRight,
|
|
88
89
|
marginBottom,
|
|
89
90
|
width,
|
|
90
|
-
backgroundGradient
|
|
91
|
-
|
|
91
|
+
backgroundGradient,
|
|
92
|
+
titleHeadingFontSize,
|
|
93
|
+
titleHeadingFontName,
|
|
94
|
+
titleHeadingFontWeight,
|
|
95
|
+
titleHeadingLineHeight,
|
|
96
|
+
titleFontSize,
|
|
97
|
+
titleFontName,
|
|
98
|
+
titleFontWeight,
|
|
99
|
+
titleLineHeight,
|
|
100
|
+
linkFontSize,
|
|
101
|
+
linkFontName,
|
|
102
|
+
linkFontWeight,
|
|
103
|
+
linkLineHeight
|
|
104
|
+
} = (0, _componentsBase.useThemeTokens)('BlockQuote', tokens, variant, {
|
|
105
|
+
viewport
|
|
106
|
+
});
|
|
92
107
|
const mappedTextSize = textStyle === 'heading' ? 'h3' : textStyle;
|
|
108
|
+
const titleTokens = textStyle === 'heading' ? {
|
|
109
|
+
fontSize: titleHeadingFontSize,
|
|
110
|
+
fontName: titleHeadingFontName,
|
|
111
|
+
fontWeight: titleHeadingFontWeight,
|
|
112
|
+
lineHeight: titleHeadingLineHeight
|
|
113
|
+
} : {
|
|
114
|
+
fontSize: titleFontSize,
|
|
115
|
+
fontName: titleFontName,
|
|
116
|
+
fontWeight: titleFontWeight,
|
|
117
|
+
lineHeight: titleLineHeight
|
|
118
|
+
};
|
|
93
119
|
|
|
94
120
|
const renderLink = () => {
|
|
95
121
|
if (linkHref) {
|
|
96
122
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.Link, {
|
|
97
123
|
href: linkHref,
|
|
98
124
|
tokens: {
|
|
99
|
-
|
|
125
|
+
blockFontSize: linkFontSize,
|
|
126
|
+
blockFontName: linkFontName,
|
|
127
|
+
blockFontWeight: linkFontWeight,
|
|
128
|
+
blockLineHeight: linkLineHeight,
|
|
100
129
|
color
|
|
101
130
|
},
|
|
102
131
|
variant: {
|
|
@@ -121,7 +150,7 @@ const BlockQuote = _ref8 => {
|
|
|
121
150
|
const quote = /*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.Typography, {
|
|
122
151
|
tokens: {
|
|
123
152
|
color,
|
|
124
|
-
|
|
153
|
+
...titleTokens
|
|
125
154
|
},
|
|
126
155
|
variant: {
|
|
127
156
|
size: mappedTextSize
|
|
@@ -164,9 +193,25 @@ const BlockQuote = _ref8 => {
|
|
|
164
193
|
BlockQuote.propTypes = { ...selectedSystemPropTypes,
|
|
165
194
|
..._componentsBase.withLinkRouter.propTypes,
|
|
166
195
|
children: _propTypes.default.node.isRequired,
|
|
196
|
+
|
|
197
|
+
/**
|
|
198
|
+
* External source's identifier (e.g. author's name)
|
|
199
|
+
*/
|
|
167
200
|
link: _propTypes.default.string,
|
|
201
|
+
|
|
202
|
+
/**
|
|
203
|
+
* External source's URL
|
|
204
|
+
*/
|
|
168
205
|
linkHref: _propTypes.default.string,
|
|
206
|
+
|
|
207
|
+
/**
|
|
208
|
+
* To provide additional information about the source, rendered underneath `link`
|
|
209
|
+
*/
|
|
169
210
|
additionalInfo: _propTypes.default.string,
|
|
211
|
+
|
|
212
|
+
/**
|
|
213
|
+
* Whether to render BlockQuote as a heading size of `h3` or large text size
|
|
214
|
+
*/
|
|
170
215
|
textStyle: _propTypes.default.oneOf(['large', 'heading'])
|
|
171
216
|
};
|
|
172
217
|
var _default = BlockQuote;
|
package/lib/Callout/Callout.js
CHANGED
|
@@ -136,9 +136,21 @@ const Callout = _ref2 => {
|
|
|
136
136
|
};
|
|
137
137
|
|
|
138
138
|
Callout.propTypes = { ...selectedSystemPropTypes,
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* Icon to display on the left side of the Callout
|
|
142
|
+
*/
|
|
139
143
|
icon: _propTypes.default.elementType,
|
|
140
144
|
children: _propTypes.default.node.isRequired,
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* To change the horizontal alignment of the Callout's text
|
|
148
|
+
*/
|
|
141
149
|
textAlignToFlex: _propTypes.default.oneOf(['center', 'left']),
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* To change the vertical alignment of the Callout's icon
|
|
153
|
+
*/
|
|
142
154
|
verticalAlign: _propTypes.default.oneOf(['top', 'middle', 'bottom'])
|
|
143
155
|
};
|
|
144
156
|
var _default = Callout;
|
|
@@ -49,12 +49,15 @@ const Container = /*#__PURE__*/_styledComponents.default.div.withConfig({
|
|
|
49
49
|
themeTokens,
|
|
50
50
|
gradient
|
|
51
51
|
} = _ref;
|
|
52
|
-
return { ...(large || feature
|
|
52
|
+
return { ...(large || feature ? {
|
|
53
53
|
display: 'flex',
|
|
54
54
|
flex: 0
|
|
55
|
-
}),
|
|
55
|
+
} : {}),
|
|
56
56
|
...(feature && {
|
|
57
57
|
borderRadius: themeTokens.containerBorderRadius,
|
|
58
|
+
borderColor: themeTokens.containerBorderColor,
|
|
59
|
+
borderStyle: 'solid',
|
|
60
|
+
borderWidth: `${themeTokens.containerBorderWidth}px`,
|
|
58
61
|
justifyContent: 'center',
|
|
59
62
|
paddingBottom: `${themeTokens.containerPaddingBottomTop}px`,
|
|
60
63
|
paddingLeft: `${themeTokens.containerPaddingLeftRight}px`,
|
|
@@ -62,38 +65,44 @@ const Container = /*#__PURE__*/_styledComponents.default.div.withConfig({
|
|
|
62
65
|
paddingTop: `${themeTokens.containerPaddingBottomTop}px`,
|
|
63
66
|
width: 'fit-content'
|
|
64
67
|
}),
|
|
65
|
-
...(feature && !inverse && {
|
|
66
|
-
background: `linear-gradient(#fff 0 0) padding-box, ${gradient} border-box
|
|
67
|
-
border: `${themeTokens.containerInverseBorder}px solid transparent`
|
|
68
|
-
}),
|
|
69
|
-
...(feature && inverse && {
|
|
70
|
-
border: `${themeTokens.containerInverseBorder}px solid ${themeTokens.inverseBorderColor}`
|
|
68
|
+
...(feature && !inverse && gradient && {
|
|
69
|
+
background: `linear-gradient(#fff 0 0) padding-box, ${gradient} border-box`
|
|
71
70
|
})
|
|
72
71
|
};
|
|
73
72
|
});
|
|
74
73
|
|
|
75
74
|
const getLabelTokens = themeTokens => ({
|
|
76
75
|
color: themeTokens.labelBorderColor,
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
lineHeight:
|
|
76
|
+
fontSize: themeTokens.labelFontSize,
|
|
77
|
+
fontWeight: themeTokens.labelFontWeight,
|
|
78
|
+
lineHeight: themeTokens.labelLineHeight
|
|
80
79
|
});
|
|
81
80
|
|
|
82
|
-
const getMainTextTokens =
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
81
|
+
const getMainTextTokens = _ref2 => {
|
|
82
|
+
let {
|
|
83
|
+
labelBorderColor,
|
|
84
|
+
textTimerFontWeight,
|
|
85
|
+
textFontSize,
|
|
86
|
+
textLineHeight,
|
|
87
|
+
textTimerFontName
|
|
88
|
+
} = _ref2;
|
|
89
|
+
return {
|
|
90
|
+
color: labelBorderColor,
|
|
91
|
+
lineHeight: textLineHeight,
|
|
92
|
+
fontWeight: textTimerFontWeight,
|
|
93
|
+
fontSize: textFontSize,
|
|
94
|
+
fontName: textTimerFontName
|
|
95
|
+
};
|
|
96
|
+
};
|
|
88
97
|
|
|
89
|
-
const Countdown = /*#__PURE__*/(0, _react.forwardRef)((
|
|
98
|
+
const Countdown = /*#__PURE__*/(0, _react.forwardRef)((_ref3, ref) => {
|
|
90
99
|
let {
|
|
91
100
|
copy = 'en',
|
|
92
101
|
targetTime,
|
|
93
102
|
tokens,
|
|
94
103
|
variant = {},
|
|
95
104
|
...rest
|
|
96
|
-
} =
|
|
105
|
+
} = _ref3;
|
|
97
106
|
const [days, hours, minutes, seconds] = (0, _useCountdown.default)(targetTime);
|
|
98
107
|
const viewport = (0, _componentsBase.useViewport)();
|
|
99
108
|
const {
|
|
@@ -118,13 +127,13 @@ const Countdown = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) => {
|
|
|
118
127
|
// StackView-based subcontainer adds a 1-step space on the each side of the divider
|
|
119
128
|
(0, _jsxRuntime.jsx)(_componentsBase.Spacer, {
|
|
120
129
|
direction: "row",
|
|
121
|
-
space: (feature || large) && viewport !== _systemConstants.viewports.xs ?
|
|
130
|
+
space: (feature || large) && viewport !== _systemConstants.viewports.xs ? 4 : 1
|
|
122
131
|
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.Typography, {
|
|
123
132
|
tokens: mainTextTokens,
|
|
124
133
|
children: ":"
|
|
125
134
|
});
|
|
126
135
|
const labelTokens = getLabelTokens(themeTokens);
|
|
127
|
-
const
|
|
136
|
+
const segmentProps = {
|
|
128
137
|
copy,
|
|
129
138
|
labelTokens,
|
|
130
139
|
numberTokens: mainTextTokens,
|
|
@@ -148,21 +157,21 @@ const Countdown = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) => {
|
|
|
148
157
|
labelKey: "day",
|
|
149
158
|
number: days,
|
|
150
159
|
segmentWidth: String(days).length,
|
|
151
|
-
...
|
|
160
|
+
...segmentProps
|
|
152
161
|
}), divider, /*#__PURE__*/(0, _jsxRuntime.jsx)(_Segment.default, {
|
|
153
162
|
labelKey: "hour",
|
|
154
163
|
number: hours,
|
|
155
|
-
...
|
|
164
|
+
...segmentProps,
|
|
156
165
|
...(0, _componentsBase.applyTextStyles)(themeTokens)
|
|
157
166
|
}), divider, /*#__PURE__*/(0, _jsxRuntime.jsx)(_Segment.default, {
|
|
158
167
|
labelKey: "minute",
|
|
159
168
|
number: minutes,
|
|
160
|
-
...
|
|
169
|
+
...segmentProps,
|
|
161
170
|
...(0, _componentsBase.applyTextStyles)(themeTokens)
|
|
162
171
|
}), divider, /*#__PURE__*/(0, _jsxRuntime.jsx)(_Segment.default, {
|
|
163
172
|
labelKey: "second",
|
|
164
173
|
number: seconds,
|
|
165
|
-
...
|
|
174
|
+
...segmentProps,
|
|
166
175
|
...(0, _componentsBase.applyTextStyles)(themeTokens)
|
|
167
176
|
})]
|
|
168
177
|
})
|
package/lib/Countdown/Segment.js
CHANGED
|
@@ -23,6 +23,7 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
23
23
|
|
|
24
24
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
25
25
|
|
|
26
|
+
// !TODO: put this back
|
|
26
27
|
// Pads with zeros on the left if it's a single digit number
|
|
27
28
|
const pad = function (number) {
|
|
28
29
|
let segmentWidth = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2;
|
|
@@ -44,6 +45,7 @@ const Container = /*#__PURE__*/_styledComponents.default.div.withConfig({
|
|
|
44
45
|
justifyContent: 'space-evenly',
|
|
45
46
|
display: 'inline-flex',
|
|
46
47
|
...(feature && {
|
|
48
|
+
// This is required because when the numbers for Countdown change, the character widths will change and thereby effecting the container demensions.
|
|
47
49
|
width: `${segmentFontSize * _constants.SEGMENT_WIDTH_TO_FONT_SIZE_RATIO * segmentWidth}px`,
|
|
48
50
|
display: 'flex'
|
|
49
51
|
})
|
|
@@ -8,7 +8,7 @@ const DEFAULT_FONT_SIZE = 16;
|
|
|
8
8
|
exports.DEFAULT_FONT_SIZE = DEFAULT_FONT_SIZE;
|
|
9
9
|
const LARGE_FONT_SIZE = 64;
|
|
10
10
|
exports.LARGE_FONT_SIZE = LARGE_FONT_SIZE;
|
|
11
|
-
const SEGMENT_WIDTH_TO_FONT_SIZE_RATIO = 0.8;
|
|
12
|
-
exports.SEGMENT_WIDTH_TO_FONT_SIZE_RATIO = SEGMENT_WIDTH_TO_FONT_SIZE_RATIO;
|
|
13
11
|
const XS_FONT_SIZE = 28;
|
|
14
|
-
exports.XS_FONT_SIZE = XS_FONT_SIZE;
|
|
12
|
+
exports.XS_FONT_SIZE = XS_FONT_SIZE;
|
|
13
|
+
const SEGMENT_WIDTH_TO_FONT_SIZE_RATIO = 0.8;
|
|
14
|
+
exports.SEGMENT_WIDTH_TO_FONT_SIZE_RATIO = SEGMENT_WIDTH_TO_FONT_SIZE_RATIO;
|
|
@@ -173,6 +173,30 @@ const CalendarContainer = /*#__PURE__*/_styledComponents.default.div.withConfig(
|
|
|
173
173
|
}
|
|
174
174
|
}
|
|
175
175
|
|
|
176
|
+
.CalendarDay
|
|
177
|
+
.CalendarDay__default
|
|
178
|
+
.CalendarDay__selected
|
|
179
|
+
.CalendarDay__blocked_out_of_range{
|
|
180
|
+
background: ${remainingTokens.calendarDaySelectedDisabledBackground};
|
|
181
|
+
color: ${remainingTokens.calendarDaySelectedDisabledColor};
|
|
182
|
+
text-decoration: none;
|
|
183
|
+
z-index: 0;
|
|
184
|
+
&:before {
|
|
185
|
+
content: '';
|
|
186
|
+
position: absolute;
|
|
187
|
+
top: 50%;
|
|
188
|
+
left: 50%;
|
|
189
|
+
transform: translate(-50%, -50%);
|
|
190
|
+
height: ${calendarDayDefaultHeight}px;
|
|
191
|
+
border: 1px solid ${remainingTokens.calendarDaySelectedDisabledContentBackgroundColor};
|
|
192
|
+
width: ${calendarDayDefaultWidth}px;
|
|
193
|
+
border-radius: 50%;
|
|
194
|
+
background: ${remainingTokens.calendarDaySelectedDisabledContentBackgroundColor};
|
|
195
|
+
transition: all 0.3s;
|
|
196
|
+
z-index: -1;
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
|
|
176
200
|
.CalendarDay__blocked_out_of_range,
|
|
177
201
|
.CalendarDay__blocked_out_of_range:active,
|
|
178
202
|
.CalendarDay__blocked_out_of_range:hover,
|
|
@@ -148,14 +148,20 @@ const DatePicker = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
|
148
148
|
setIsClickedInside(false);
|
|
149
149
|
};
|
|
150
150
|
|
|
151
|
-
const handleFocus =
|
|
152
|
-
|
|
151
|
+
const handleFocus = event => {
|
|
152
|
+
if (event.target.tagName === 'INPUT') {
|
|
153
|
+
setIsFocused(true);
|
|
154
|
+
}
|
|
153
155
|
};
|
|
154
156
|
|
|
155
157
|
const handleMouseDown = event => {
|
|
156
158
|
if (event.target.tagName === 'INPUT') {
|
|
157
159
|
setIsClickedInside(true);
|
|
158
160
|
setIsFocused(true);
|
|
161
|
+
} else if (event.target.tagName === 'path') {
|
|
162
|
+
// needed to handle the case where the user clicks on the tooltip icon
|
|
163
|
+
setIsClickedInside(true);
|
|
164
|
+
event.stopPropagation();
|
|
159
165
|
} else {
|
|
160
166
|
event.stopPropagation();
|
|
161
167
|
}
|
|
@@ -68,6 +68,10 @@ const ExpandCollapseMini = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
|
68
68
|
});
|
|
69
69
|
ExpandCollapseMini.displayName = 'ExpandCollapseMini';
|
|
70
70
|
ExpandCollapseMini.propTypes = { ..._ExpandCollapseMiniControl.default.propTypes,
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Function to call on pressing the panel's control, which should open or close the panel.
|
|
74
|
+
*/
|
|
71
75
|
onToggle: _propTypes.default.func,
|
|
72
76
|
children: _propTypes.default.node.isRequired
|
|
73
77
|
};
|
|
@@ -85,9 +85,25 @@ const ExpandCollapseMiniControl = _ref => {
|
|
|
85
85
|
|
|
86
86
|
ExpandCollapseMiniControl.propTypes = { ...selectedSystemPropTypes,
|
|
87
87
|
..._componentsBase.Link.propTypes,
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Optional function to call on pressing the panel's control, in addition to opening or closing the panel
|
|
91
|
+
*/
|
|
88
92
|
onPress: _propTypes.default.func,
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* ExpandCollapseMiniControl title when expanded
|
|
96
|
+
*/
|
|
89
97
|
expandTitle: _propTypes.default.string.isRequired,
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* ExpandCollapseMiniControl title when collapsed
|
|
101
|
+
*/
|
|
90
102
|
collapseTitle: _propTypes.default.string.isRequired,
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* React Native's `Pressable`'s state object
|
|
106
|
+
*/
|
|
91
107
|
pressableState: _propTypes.default.object,
|
|
92
108
|
variant: _propTypes.default.object
|
|
93
109
|
};
|
package/lib/Footnote/Footnote.js
CHANGED
|
@@ -198,6 +198,7 @@ const CloseButton = /*#__PURE__*/_styledComponents.default.button.withConfig({
|
|
|
198
198
|
let {
|
|
199
199
|
closeButtonBorder,
|
|
200
200
|
closeButtonHeight,
|
|
201
|
+
closeButtonBackgroundColor,
|
|
201
202
|
closeButtonMargin,
|
|
202
203
|
closeButtonWidth
|
|
203
204
|
} = _ref9;
|
|
@@ -207,7 +208,7 @@ const CloseButton = /*#__PURE__*/_styledComponents.default.button.withConfig({
|
|
|
207
208
|
cursor: 'pointer',
|
|
208
209
|
display: 'flex',
|
|
209
210
|
justifyContent: 'center',
|
|
210
|
-
backgroundColor:
|
|
211
|
+
backgroundColor: closeButtonBackgroundColor,
|
|
211
212
|
border: closeButtonBorder,
|
|
212
213
|
height: closeButtonHeight,
|
|
213
214
|
margin: closeButtonMargin,
|
|
@@ -237,10 +238,16 @@ const StyledCustomContentContainer = /*#__PURE__*/_styledComponents.default.div.
|
|
|
237
238
|
componentId: "components-web__sc-1563bo5-8"
|
|
238
239
|
})(_ref11 => {
|
|
239
240
|
let {
|
|
240
|
-
|
|
241
|
+
listItemColor,
|
|
242
|
+
listItemFontSize,
|
|
243
|
+
listItemLineHeight,
|
|
244
|
+
listItemPaddingLeft
|
|
241
245
|
} = _ref11;
|
|
242
246
|
return {
|
|
243
|
-
|
|
247
|
+
fontSize: listItemFontSize,
|
|
248
|
+
lineHeight: listItemLineHeight,
|
|
249
|
+
paddingLeft: listItemPaddingLeft,
|
|
250
|
+
color: listItemColor,
|
|
244
251
|
fontFamily: 'HelveticaNow400normal'
|
|
245
252
|
};
|
|
246
253
|
});
|
|
@@ -307,8 +314,6 @@ const Footnote = props => {
|
|
|
307
314
|
footnoteHeaderPaddingBottom,
|
|
308
315
|
headerLineHeight,
|
|
309
316
|
headerFontSize,
|
|
310
|
-
headerFontName,
|
|
311
|
-
headerFontWeight,
|
|
312
317
|
listPaddingLeft,
|
|
313
318
|
listItemMarkerFontSize,
|
|
314
319
|
listItemMarkerLineHeight,
|
|
@@ -318,6 +323,7 @@ const Footnote = props => {
|
|
|
318
323
|
listItemPaddingLeft,
|
|
319
324
|
closeButtonBorderSize,
|
|
320
325
|
closeButtonBorderColor,
|
|
326
|
+
closeButtonBackgroundColor,
|
|
321
327
|
closeButtonHeight,
|
|
322
328
|
closeButtonMarginTop,
|
|
323
329
|
closeButtonMarginLeft,
|
|
@@ -486,6 +492,10 @@ const Footnote = props => {
|
|
|
486
492
|
|
|
487
493
|
if ( /*#__PURE__*/_react.default.isValidElement(data.content)) {
|
|
488
494
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledCustomContentContainer, {
|
|
495
|
+
listItemColor: listItemColor,
|
|
496
|
+
listItemFontSize: listItemFontSize,
|
|
497
|
+
listItemLineHeight: listItemLineHeight,
|
|
498
|
+
listItemPaddingLeft: listItemPaddingLeft,
|
|
489
499
|
ref: contentRef,
|
|
490
500
|
children: data.content
|
|
491
501
|
});
|
|
@@ -503,6 +513,10 @@ const Footnote = props => {
|
|
|
503
513
|
listItemLineHeight: listItemLineHeight,
|
|
504
514
|
listItemPaddingLeft: listItemPaddingLeft,
|
|
505
515
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.Typography, {
|
|
516
|
+
tokens: {
|
|
517
|
+
fontSize: listItemFontSize,
|
|
518
|
+
lineHeight: listItemLineHeight
|
|
519
|
+
},
|
|
506
520
|
children: (0, _utils.renderStructuredContent)(data.content)
|
|
507
521
|
})
|
|
508
522
|
})
|
|
@@ -529,17 +543,20 @@ const Footnote = props => {
|
|
|
529
543
|
footnoteHeaderPaddingTop: footnoteHeaderPaddingTop,
|
|
530
544
|
footnoteHeaderPaddingBottom: footnoteHeaderPaddingBottom,
|
|
531
545
|
headerMargin: headerMargin,
|
|
532
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
533
|
-
|
|
534
|
-
fontSize:
|
|
535
|
-
lineHeight:
|
|
536
|
-
|
|
546
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.Typography, {
|
|
547
|
+
tokens: {
|
|
548
|
+
fontSize: headerFontSize,
|
|
549
|
+
lineHeight: headerLineHeight
|
|
550
|
+
},
|
|
551
|
+
variant: {
|
|
552
|
+
size: 'h4'
|
|
537
553
|
},
|
|
538
554
|
children: getCopy('heading')
|
|
539
555
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(CloseButton, {
|
|
540
|
-
closeButtonBorder: `${closeButtonBorderSize}
|
|
556
|
+
closeButtonBorder: `${closeButtonBorderSize} solid ${closeButtonBorderColor}`,
|
|
541
557
|
closeButtonWidth: `${closeButtonWidth}px`,
|
|
542
558
|
closeButtonHeight: `${closeButtonHeight}px`,
|
|
559
|
+
closeButtonBackgroundColor: closeButtonBackgroundColor,
|
|
543
560
|
closeButtonMargin: `${closeButtonMarginTop}px ${closeButtonMarginRight}px ${closeButtonMarginBottom}px ${closeButtonMarginLeft}px`,
|
|
544
561
|
onClick: event => {
|
|
545
562
|
closeFootnote(event, {
|
|
@@ -59,8 +59,16 @@ const propsWithoutIcon = _ref2 => {
|
|
|
59
59
|
};
|
|
60
60
|
|
|
61
61
|
IconButton.propTypes = { ...propsWithoutIcon(_componentsBase.IconButton.propTypes),
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* To set the icon to a multi-brand compatabile icon
|
|
65
|
+
*/
|
|
62
66
|
// eslint-disable-next-line react/require-default-props
|
|
63
67
|
action: _propTypes.default.oneOf(multiBrandIconNames),
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* To set a custom icon
|
|
71
|
+
*/
|
|
64
72
|
icon: _propTypes.default.func
|
|
65
73
|
};
|
|
66
74
|
IconButton.defaultProps = {
|
package/lib/Listbox/Listbox.js
CHANGED
|
@@ -156,7 +156,15 @@ Listbox.propTypes = { ..._componentsBase.withLinkRouter.propTypes,
|
|
|
156
156
|
* the last menu item.
|
|
157
157
|
*/
|
|
158
158
|
parentRef: _propTypes.default.object,
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* `Listbox` items
|
|
162
|
+
*/
|
|
159
163
|
items: _propTypes.default.array,
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* To select an item by default
|
|
167
|
+
*/
|
|
160
168
|
selectedId: _propTypes.default.string
|
|
161
169
|
};
|
|
162
170
|
Listbox.Overlay = _ListboxOverlay.default;
|
|
@@ -21,7 +21,6 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
21
21
|
|
|
22
22
|
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; }
|
|
23
23
|
|
|
24
|
-
/* eslint-disable react/jsx-filename-extension */
|
|
25
24
|
const StyledModalContent = /*#__PURE__*/_styledComponents.default.div.withConfig({
|
|
26
25
|
displayName: "ModalContent__StyledModalContent",
|
|
27
26
|
componentId: "components-web__sc-k40cwb-0"
|
|
@@ -210,6 +210,10 @@ NavigationBar.propTypes = { ...selectedSystemPropTypes,
|
|
|
210
210
|
* Common navigation bar heading.
|
|
211
211
|
*/
|
|
212
212
|
heading: _propTypes.default.string,
|
|
213
|
+
|
|
214
|
+
/**
|
|
215
|
+
* Sets the `headingLevel` of the `heading`
|
|
216
|
+
*/
|
|
213
217
|
headingLevel: _propTypes.default.oneOf(['h1', 'h2', 'h3', 'h4', 'h5', 'h6']),
|
|
214
218
|
|
|
215
219
|
/**
|
package/lib/OrderedList/Item.js
CHANGED
|
@@ -73,6 +73,10 @@ const Paragraph = _ref3 => {
|
|
|
73
73
|
|
|
74
74
|
Paragraph.propTypes = { ...selectedSystemPropTypes,
|
|
75
75
|
children: _propTypes.default.node.isRequired,
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Adds a `data-testid` attribute to the element for testing purposes
|
|
79
|
+
*/
|
|
76
80
|
testID: _propTypes.default.string,
|
|
77
81
|
|
|
78
82
|
/**
|
|
@@ -57,7 +57,14 @@ const AuthorDate = _ref => {
|
|
|
57
57
|
};
|
|
58
58
|
|
|
59
59
|
AuthorDate.propTypes = {
|
|
60
|
+
/**
|
|
61
|
+
* Name of the author
|
|
62
|
+
*/
|
|
60
63
|
author: _propTypes.default.string.isRequired,
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Date of the post
|
|
67
|
+
*/
|
|
61
68
|
date: _propTypes.default.string.isRequired
|
|
62
69
|
};
|
|
63
70
|
var _default = AuthorDate;
|
|
@@ -149,8 +149,7 @@ const PreviewCard = /*#__PURE__*/(0, _react.forwardRef)((_ref3, ref) => {
|
|
|
149
149
|
children: [Boolean(tag) && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
150
150
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.Typography, {
|
|
151
151
|
variant: {
|
|
152
|
-
size: 'eyebrow'
|
|
153
|
-
colour: 'secondary'
|
|
152
|
+
size: 'eyebrow'
|
|
154
153
|
},
|
|
155
154
|
children: tag
|
|
156
155
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.Spacer, {
|
|
@@ -158,8 +157,7 @@ const PreviewCard = /*#__PURE__*/(0, _react.forwardRef)((_ref3, ref) => {
|
|
|
158
157
|
})]
|
|
159
158
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.Typography, {
|
|
160
159
|
variant: {
|
|
161
|
-
size: 'h4'
|
|
162
|
-
colour: 'secondary'
|
|
160
|
+
size: 'h4'
|
|
163
161
|
},
|
|
164
162
|
children: title
|
|
165
163
|
}), Boolean(footer) && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
@@ -167,8 +165,7 @@ const PreviewCard = /*#__PURE__*/(0, _react.forwardRef)((_ref3, ref) => {
|
|
|
167
165
|
space: 2
|
|
168
166
|
}), typeof footer === 'string' ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.Typography, {
|
|
169
167
|
variant: {
|
|
170
|
-
size: 'small'
|
|
171
|
-
colour: 'secondary'
|
|
168
|
+
size: 'small'
|
|
172
169
|
},
|
|
173
170
|
children: footer
|
|
174
171
|
}) : footer]
|
|
@@ -258,16 +258,64 @@ const PriceLockup = _ref12 => {
|
|
|
258
258
|
};
|
|
259
259
|
|
|
260
260
|
PriceLockup.propTypes = { ...selectedSystemPropTypes,
|
|
261
|
+
|
|
262
|
+
/**
|
|
263
|
+
* Size of the component
|
|
264
|
+
*
|
|
265
|
+
* Small for pricing in product catalogue pages, medium for pricing in product comparison cards and large for pricing in banners and promo cards
|
|
266
|
+
*/
|
|
261
267
|
size: _propTypes.default.oneOf(['small', 'medium', 'large']),
|
|
268
|
+
|
|
269
|
+
/**
|
|
270
|
+
* If currency symbol other than `$` to be used
|
|
271
|
+
*/
|
|
262
272
|
currencySymbol: _propTypes.default.string,
|
|
273
|
+
|
|
274
|
+
/**
|
|
275
|
+
* Shows additional info above the price
|
|
276
|
+
*/
|
|
263
277
|
topText: _propTypes.default.string,
|
|
278
|
+
|
|
279
|
+
/**
|
|
280
|
+
* Monetary value (including decimals separated by ".")
|
|
281
|
+
*/
|
|
264
282
|
price: _propTypes.default.string.isRequired,
|
|
283
|
+
|
|
284
|
+
/**
|
|
285
|
+
* Shows month/year unit
|
|
286
|
+
*/
|
|
265
287
|
rateText: _propTypes.default.string,
|
|
288
|
+
|
|
289
|
+
/**
|
|
290
|
+
* Shows additional info below the price with a `Divider`
|
|
291
|
+
*/
|
|
266
292
|
bottomText: _propTypes.default.string,
|
|
293
|
+
|
|
294
|
+
/**
|
|
295
|
+
* Displays which side the currency should apperar (left, right)
|
|
296
|
+
*/
|
|
267
297
|
signDirection: _propTypes.default.oneOf(['right', 'left']),
|
|
298
|
+
|
|
299
|
+
/**
|
|
300
|
+
* Shows additional link for context
|
|
301
|
+
*/
|
|
268
302
|
footnoteLinks: _propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string])),
|
|
303
|
+
|
|
304
|
+
/**
|
|
305
|
+
* Function to be called when a footnote link is clicked
|
|
306
|
+
*/
|
|
269
307
|
onClickFootnote: _propTypes.default.func,
|
|
308
|
+
|
|
309
|
+
/**
|
|
310
|
+
* To show price savings comparison
|
|
311
|
+
*/
|
|
270
312
|
strikeThrough: _propTypes.default.bool,
|
|
313
|
+
|
|
314
|
+
/**
|
|
315
|
+
* To provide a11y text for `PriceLockup` component
|
|
316
|
+
*
|
|
317
|
+
* **Note:** a11yText will override strikethrough price, so it must include price (ie. "was 50 dollars per month")
|
|
318
|
+
*/
|
|
271
319
|
a11yText: _propTypes.default.string
|
|
272
320
|
};
|
|
273
321
|
var _default = PriceLockup;
|