@telus-uds/components-web 2.9.0 → 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 +13 -2
- package/component-docs.json +82 -81
- package/lib/BlockQuote/BlockQuote.js +49 -4
- package/lib/Callout/Callout.js +12 -0
- 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/IconButton/IconButton.js +8 -0
- package/lib/Listbox/Listbox.js +8 -0
- 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/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 +16 -0
- package/lib-module/BlockQuote/BlockQuote.js +50 -5
- package/lib-module/Callout/Callout.js +12 -0
- 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/IconButton/IconButton.js +8 -0
- package/lib-module/Listbox/Listbox.js +8 -0
- 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/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 +16 -0
- package/package.json +3 -3
- package/src/BlockQuote/BlockQuote.jsx +53 -6
- package/src/Callout/Callout.jsx +9 -0
- 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/IconButton/IconButton.jsx +6 -0
- package/src/Listbox/Listbox.jsx +6 -0
- 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/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 +12 -0
|
@@ -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;
|
|
@@ -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
|
};
|
|
@@ -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;
|
|
@@ -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;
|
|
@@ -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;
|
|
@@ -219,25 +219,76 @@ const dictionaryContentShape = _propTypes.default.shape({
|
|
|
219
219
|
});
|
|
220
220
|
|
|
221
221
|
QuantitySelector.propTypes = {
|
|
222
|
+
/**
|
|
223
|
+
* The id of the input field
|
|
224
|
+
*/
|
|
222
225
|
id: _propTypes.default.string,
|
|
226
|
+
|
|
227
|
+
/**
|
|
228
|
+
* The minimum number allowed
|
|
229
|
+
*/
|
|
223
230
|
minNumber: _propTypes.default.number,
|
|
231
|
+
|
|
232
|
+
/**
|
|
233
|
+
* The maximum number allowed
|
|
234
|
+
*/
|
|
224
235
|
maxNumber: _propTypes.default.number,
|
|
236
|
+
|
|
237
|
+
/**
|
|
238
|
+
* The callback function that is called when the value of the input field changes
|
|
239
|
+
*/
|
|
225
240
|
onChange: _propTypes.default.func,
|
|
241
|
+
|
|
242
|
+
/**
|
|
243
|
+
* The default value of the input field
|
|
244
|
+
*/
|
|
226
245
|
defaultValue: _propTypes.default.number,
|
|
246
|
+
|
|
247
|
+
/**
|
|
248
|
+
* The label of the input field
|
|
249
|
+
*/
|
|
227
250
|
label: _propTypes.default.string,
|
|
251
|
+
|
|
252
|
+
/**
|
|
253
|
+
* The hint of the input field
|
|
254
|
+
*/
|
|
228
255
|
hint: _propTypes.default.string,
|
|
256
|
+
|
|
257
|
+
/**
|
|
258
|
+
* The position of the hint. Could be shown along side the label or below it
|
|
259
|
+
*/
|
|
229
260
|
hintPosition: _propTypes.default.oneOf(['inline', 'below']),
|
|
261
|
+
|
|
262
|
+
/**
|
|
263
|
+
* Adds a question mark which will display a tooltip when clicked
|
|
264
|
+
*/
|
|
230
265
|
tooltip: _propTypes.default.string,
|
|
266
|
+
|
|
267
|
+
/**
|
|
268
|
+
* The accessibility label of the input field
|
|
269
|
+
*/
|
|
231
270
|
accessibilityLabel: _propTypes.default.string,
|
|
271
|
+
|
|
272
|
+
/**
|
|
273
|
+
* The dictionary object containing the content for the input field
|
|
274
|
+
*/
|
|
232
275
|
dictionary: _propTypes.default.shape({
|
|
233
276
|
en: dictionaryContentShape,
|
|
234
277
|
fr: dictionaryContentShape
|
|
235
278
|
}),
|
|
279
|
+
|
|
280
|
+
/**
|
|
281
|
+
* The language to use for the copy.
|
|
282
|
+
*/
|
|
236
283
|
copy: _propTypes.default.oneOfType([_propTypes.default.oneOf(['en', 'fr'])]),
|
|
237
284
|
variant: _propTypes.default.exact({
|
|
238
285
|
alternative: _propTypes.default.bool
|
|
239
286
|
}),
|
|
240
287
|
tokens: _propTypes.default.oneOf([_propTypes.default.object, _propTypes.default.func]),
|
|
288
|
+
|
|
289
|
+
/**
|
|
290
|
+
* Sets `data-testid` attribute on the input field for testing purposes.
|
|
291
|
+
*/
|
|
241
292
|
testID: _propTypes.default.string
|
|
242
293
|
};
|
|
243
294
|
QuantitySelector.defaultProps = {
|
package/lib/Span/Span.js
CHANGED
package/lib/Table/Table.js
CHANGED
|
@@ -124,6 +124,10 @@ const Table = _ref2 => {
|
|
|
124
124
|
|
|
125
125
|
Table.propTypes = { ...selectedSystemPropTypes,
|
|
126
126
|
children: _propTypes.default.node,
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* Sets text style
|
|
130
|
+
*/
|
|
127
131
|
text: _propTypes.default.oneOf(['medium', 'small'])
|
|
128
132
|
};
|
|
129
133
|
var _default = Table;
|
package/lib/Toast/Toast.js
CHANGED
|
@@ -143,9 +143,25 @@ const Toast = _ref3 => {
|
|
|
143
143
|
};
|
|
144
144
|
|
|
145
145
|
Toast.propTypes = { ...selectedSystemPropTypes,
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* If true, the toast will be displayed
|
|
149
|
+
*/
|
|
146
150
|
toast: _propTypes.default.bool,
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* The copy to display in the toast
|
|
154
|
+
*/
|
|
147
155
|
copy: _propTypes.default.string.isRequired,
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* The headline to display in the toast (before copy)
|
|
159
|
+
*/
|
|
148
160
|
headline: _propTypes.default.string,
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* The link to display in the toast (after copy)
|
|
164
|
+
*/
|
|
149
165
|
link: _propTypes.default.shape({
|
|
150
166
|
href: _propTypes.default.string.isRequired,
|
|
151
167
|
text: _propTypes.default.string.isRequired,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import { Link, selectSystemProps, StackView, Typography, useThemeTokens, withLinkRouter } from '@telus-uds/components-base';
|
|
3
|
+
import { Link, selectSystemProps, StackView, Typography, useThemeTokens, withLinkRouter, useViewport } from '@telus-uds/components-base';
|
|
4
4
|
import styled from 'styled-components';
|
|
5
5
|
import { htmlAttrs, transformGradient } from '../utils';
|
|
6
6
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -63,6 +63,7 @@ const BlockQuote = _ref8 => {
|
|
|
63
63
|
variant,
|
|
64
64
|
...rest
|
|
65
65
|
} = _ref8;
|
|
66
|
+
const viewport = useViewport();
|
|
66
67
|
const {
|
|
67
68
|
color,
|
|
68
69
|
paddingTop,
|
|
@@ -71,16 +72,44 @@ const BlockQuote = _ref8 => {
|
|
|
71
72
|
paddingRight,
|
|
72
73
|
marginBottom,
|
|
73
74
|
width,
|
|
74
|
-
backgroundGradient
|
|
75
|
-
|
|
75
|
+
backgroundGradient,
|
|
76
|
+
titleHeadingFontSize,
|
|
77
|
+
titleHeadingFontName,
|
|
78
|
+
titleHeadingFontWeight,
|
|
79
|
+
titleHeadingLineHeight,
|
|
80
|
+
titleFontSize,
|
|
81
|
+
titleFontName,
|
|
82
|
+
titleFontWeight,
|
|
83
|
+
titleLineHeight,
|
|
84
|
+
linkFontSize,
|
|
85
|
+
linkFontName,
|
|
86
|
+
linkFontWeight,
|
|
87
|
+
linkLineHeight
|
|
88
|
+
} = useThemeTokens('BlockQuote', tokens, variant, {
|
|
89
|
+
viewport
|
|
90
|
+
});
|
|
76
91
|
const mappedTextSize = textStyle === 'heading' ? 'h3' : textStyle;
|
|
92
|
+
const titleTokens = textStyle === 'heading' ? {
|
|
93
|
+
fontSize: titleHeadingFontSize,
|
|
94
|
+
fontName: titleHeadingFontName,
|
|
95
|
+
fontWeight: titleHeadingFontWeight,
|
|
96
|
+
lineHeight: titleHeadingLineHeight
|
|
97
|
+
} : {
|
|
98
|
+
fontSize: titleFontSize,
|
|
99
|
+
fontName: titleFontName,
|
|
100
|
+
fontWeight: titleFontWeight,
|
|
101
|
+
lineHeight: titleLineHeight
|
|
102
|
+
};
|
|
77
103
|
|
|
78
104
|
const renderLink = () => {
|
|
79
105
|
if (linkHref) {
|
|
80
106
|
return /*#__PURE__*/_jsx(Link, {
|
|
81
107
|
href: linkHref,
|
|
82
108
|
tokens: {
|
|
83
|
-
|
|
109
|
+
blockFontSize: linkFontSize,
|
|
110
|
+
blockFontName: linkFontName,
|
|
111
|
+
blockFontWeight: linkFontWeight,
|
|
112
|
+
blockLineHeight: linkLineHeight,
|
|
84
113
|
color
|
|
85
114
|
},
|
|
86
115
|
variant: {
|
|
@@ -105,7 +134,7 @@ const BlockQuote = _ref8 => {
|
|
|
105
134
|
const quote = /*#__PURE__*/_jsx(Typography, {
|
|
106
135
|
tokens: {
|
|
107
136
|
color,
|
|
108
|
-
|
|
137
|
+
...titleTokens
|
|
109
138
|
},
|
|
110
139
|
variant: {
|
|
111
140
|
size: mappedTextSize
|
|
@@ -148,9 +177,25 @@ const BlockQuote = _ref8 => {
|
|
|
148
177
|
BlockQuote.propTypes = { ...selectedSystemPropTypes,
|
|
149
178
|
...withLinkRouter.propTypes,
|
|
150
179
|
children: PropTypes.node.isRequired,
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* External source's identifier (e.g. author's name)
|
|
183
|
+
*/
|
|
151
184
|
link: PropTypes.string,
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* External source's URL
|
|
188
|
+
*/
|
|
152
189
|
linkHref: PropTypes.string,
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* To provide additional information about the source, rendered underneath `link`
|
|
193
|
+
*/
|
|
153
194
|
additionalInfo: PropTypes.string,
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* Whether to render BlockQuote as a heading size of `h3` or large text size
|
|
198
|
+
*/
|
|
154
199
|
textStyle: PropTypes.oneOf(['large', 'heading'])
|
|
155
200
|
};
|
|
156
201
|
export default BlockQuote;
|
|
@@ -122,9 +122,21 @@ const Callout = _ref2 => {
|
|
|
122
122
|
};
|
|
123
123
|
|
|
124
124
|
Callout.propTypes = { ...selectedSystemPropTypes,
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Icon to display on the left side of the Callout
|
|
128
|
+
*/
|
|
125
129
|
icon: PropTypes.elementType,
|
|
126
130
|
children: PropTypes.node.isRequired,
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* To change the horizontal alignment of the Callout's text
|
|
134
|
+
*/
|
|
127
135
|
textAlignToFlex: PropTypes.oneOf(['center', 'left']),
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* To change the vertical alignment of the Callout's icon
|
|
139
|
+
*/
|
|
128
140
|
verticalAlign: PropTypes.oneOf(['top', 'middle', 'bottom'])
|
|
129
141
|
};
|
|
130
142
|
export default Callout;
|
|
@@ -162,6 +162,30 @@ const CalendarContainer = /*#__PURE__*/styled.div.withConfig({
|
|
|
162
162
|
}
|
|
163
163
|
}
|
|
164
164
|
|
|
165
|
+
.CalendarDay
|
|
166
|
+
.CalendarDay__default
|
|
167
|
+
.CalendarDay__selected
|
|
168
|
+
.CalendarDay__blocked_out_of_range{
|
|
169
|
+
background: ${remainingTokens.calendarDaySelectedDisabledBackground};
|
|
170
|
+
color: ${remainingTokens.calendarDaySelectedDisabledColor};
|
|
171
|
+
text-decoration: none;
|
|
172
|
+
z-index: 0;
|
|
173
|
+
&:before {
|
|
174
|
+
content: '';
|
|
175
|
+
position: absolute;
|
|
176
|
+
top: 50%;
|
|
177
|
+
left: 50%;
|
|
178
|
+
transform: translate(-50%, -50%);
|
|
179
|
+
height: ${calendarDayDefaultHeight}px;
|
|
180
|
+
border: 1px solid ${remainingTokens.calendarDaySelectedDisabledContentBackgroundColor};
|
|
181
|
+
width: ${calendarDayDefaultWidth}px;
|
|
182
|
+
border-radius: 50%;
|
|
183
|
+
background: ${remainingTokens.calendarDaySelectedDisabledContentBackgroundColor};
|
|
184
|
+
transition: all 0.3s;
|
|
185
|
+
z-index: -1;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
|
|
165
189
|
.CalendarDay__blocked_out_of_range,
|
|
166
190
|
.CalendarDay__blocked_out_of_range:active,
|
|
167
191
|
.CalendarDay__blocked_out_of_range:hover,
|
|
@@ -122,14 +122,20 @@ const DatePicker = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
122
122
|
setIsClickedInside(false);
|
|
123
123
|
};
|
|
124
124
|
|
|
125
|
-
const handleFocus =
|
|
126
|
-
|
|
125
|
+
const handleFocus = event => {
|
|
126
|
+
if (event.target.tagName === 'INPUT') {
|
|
127
|
+
setIsFocused(true);
|
|
128
|
+
}
|
|
127
129
|
};
|
|
128
130
|
|
|
129
131
|
const handleMouseDown = event => {
|
|
130
132
|
if (event.target.tagName === 'INPUT') {
|
|
131
133
|
setIsClickedInside(true);
|
|
132
134
|
setIsFocused(true);
|
|
135
|
+
} else if (event.target.tagName === 'path') {
|
|
136
|
+
// needed to handle the case where the user clicks on the tooltip icon
|
|
137
|
+
setIsClickedInside(true);
|
|
138
|
+
event.stopPropagation();
|
|
133
139
|
} else {
|
|
134
140
|
event.stopPropagation();
|
|
135
141
|
}
|