@telus-uds/components-web 2.21.1 → 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 +22 -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
|
@@ -17,29 +17,22 @@ import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
|
17
17
|
const [selectProps, selectedSystemPropTypes] = selectSystemProps([htmlAttrs]);
|
|
18
18
|
const dateFormat = 'DD / MM / YYYY';
|
|
19
19
|
const dateFormatWithoutSpaces = 'DD/MM/YYYY';
|
|
20
|
-
|
|
21
20
|
const getResponsiveDaySize = function () {
|
|
22
21
|
let inline = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
23
22
|
let viewport = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'md';
|
|
24
|
-
|
|
25
23
|
if (viewport === 'xs') {
|
|
26
24
|
return inline ? undefined : 36;
|
|
27
25
|
}
|
|
28
|
-
|
|
29
26
|
return inline ? 60 : 44;
|
|
30
27
|
};
|
|
31
|
-
|
|
32
28
|
const getResponsiveCircleSize = function () {
|
|
33
29
|
let inline = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
34
30
|
let viewport = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'md';
|
|
35
|
-
|
|
36
31
|
if (viewport === 'xs') {
|
|
37
32
|
return 26;
|
|
38
33
|
}
|
|
39
|
-
|
|
40
34
|
return inline ? 44 : 26;
|
|
41
35
|
};
|
|
42
|
-
|
|
43
36
|
const MonthCenterContainer = /*#__PURE__*/styled.div.withConfig({
|
|
44
37
|
displayName: "DatePicker__MonthCenterContainer",
|
|
45
38
|
componentId: "components-web__sc-mz8fi3-0"
|
|
@@ -54,6 +47,7 @@ const DateInputWrapper = /*#__PURE__*/styled.div.withConfig({
|
|
|
54
47
|
display: 'flex',
|
|
55
48
|
flexDirection: 'column'
|
|
56
49
|
});
|
|
50
|
+
|
|
57
51
|
/**
|
|
58
52
|
* Use DatePicker to select a date on a calendar.
|
|
59
53
|
*
|
|
@@ -75,10 +69,8 @@ const DateInputWrapper = /*#__PURE__*/styled.div.withConfig({
|
|
|
75
69
|
* - Optimized for keyboard interaction and tablet touch
|
|
76
70
|
* - Recommended for viewports greater than or equal to 576px
|
|
77
71
|
*/
|
|
78
|
-
|
|
79
72
|
const DatePicker = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
80
73
|
var _dictionary$copy;
|
|
81
|
-
|
|
82
74
|
let {
|
|
83
75
|
copy = 'en',
|
|
84
76
|
id,
|
|
@@ -117,25 +109,20 @@ const DatePicker = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
117
109
|
setInputText(date instanceof moment ? date.format(dateFormat) : '');
|
|
118
110
|
}
|
|
119
111
|
}, [date, inputDate]);
|
|
120
|
-
|
|
121
112
|
const onFocusChange = _ref2 => {
|
|
122
113
|
let {
|
|
123
114
|
focused
|
|
124
115
|
} = _ref2;
|
|
125
|
-
|
|
126
116
|
if (!isClickedInside) {
|
|
127
117
|
setIsFocused(focused);
|
|
128
118
|
}
|
|
129
|
-
|
|
130
119
|
setIsClickedInside(false);
|
|
131
120
|
};
|
|
132
|
-
|
|
133
121
|
const handleFocus = event => {
|
|
134
122
|
if (event.target.tagName === 'INPUT' && !disabled) {
|
|
135
123
|
setIsFocused(true);
|
|
136
124
|
}
|
|
137
125
|
};
|
|
138
|
-
|
|
139
126
|
const handleMouseDown = event => {
|
|
140
127
|
if (!disabled) {
|
|
141
128
|
if (event.target.tagName === 'INPUT') {
|
|
@@ -150,14 +137,12 @@ const DatePicker = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
150
137
|
}
|
|
151
138
|
}
|
|
152
139
|
};
|
|
153
|
-
|
|
154
140
|
const onChange = value => {
|
|
155
141
|
setInputDate(value);
|
|
156
142
|
setInputText(value.format(dateFormat));
|
|
157
143
|
setIsFocused(false);
|
|
158
144
|
if (onDateChange) onDateChange(value);
|
|
159
145
|
};
|
|
160
|
-
|
|
161
146
|
const onChangeInput = value => {
|
|
162
147
|
if (moment(value.replace(/\s/g, ''), dateFormatWithoutSpaces, true).isValid()) {
|
|
163
148
|
setInputDate(moment(value, dateFormat));
|
|
@@ -167,7 +152,6 @@ const DatePicker = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
167
152
|
setInputText(value);
|
|
168
153
|
}
|
|
169
154
|
};
|
|
170
|
-
|
|
171
155
|
const viewport = useViewport();
|
|
172
156
|
const daySize = getResponsiveDaySize(inline, viewport);
|
|
173
157
|
const circleSize = getResponsiveCircleSize(inline, viewport);
|
|
@@ -181,7 +165,8 @@ const DatePicker = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
181
165
|
previousIcon,
|
|
182
166
|
nextIcon,
|
|
183
167
|
...remainingTokens
|
|
184
|
-
} = useThemeTokens('DatePicker', tokens, {
|
|
168
|
+
} = useThemeTokens('DatePicker', tokens, {
|
|
169
|
+
...variant,
|
|
185
170
|
inline
|
|
186
171
|
}, {
|
|
187
172
|
viewport
|
|
@@ -198,7 +183,6 @@ const DatePicker = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
198
183
|
fontName: remainingTokens.dayPickerWeekHeaderFontName,
|
|
199
184
|
fontWeight: remainingTokens.dayPickerWeekHeaderFontWeight
|
|
200
185
|
});
|
|
201
|
-
|
|
202
186
|
const renderPrevButton = _ref3 => {
|
|
203
187
|
let {
|
|
204
188
|
onClick
|
|
@@ -214,7 +198,6 @@ const DatePicker = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
214
198
|
testID: prevTestID
|
|
215
199
|
});
|
|
216
200
|
};
|
|
217
|
-
|
|
218
201
|
const renderNextButton = _ref4 => {
|
|
219
202
|
let {
|
|
220
203
|
onClick
|
|
@@ -230,11 +213,12 @@ const DatePicker = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
230
213
|
testID: nextTestID
|
|
231
214
|
});
|
|
232
215
|
};
|
|
233
|
-
|
|
234
|
-
|
|
216
|
+
return /*#__PURE__*/_jsx(CalendarContainer, {
|
|
217
|
+
...selectProps(rest),
|
|
235
218
|
daySize: daySize,
|
|
236
219
|
validation: validation,
|
|
237
|
-
remainingTokens: {
|
|
220
|
+
remainingTokens: {
|
|
221
|
+
...remainingTokens
|
|
238
222
|
},
|
|
239
223
|
calendarDayDefaultHeight: circleSize,
|
|
240
224
|
calendarDayDefaultWidth: circleSize,
|
|
@@ -329,85 +313,71 @@ const DatePicker = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
329
313
|
});
|
|
330
314
|
});
|
|
331
315
|
DatePicker.displayName = 'DatePicker';
|
|
332
|
-
DatePicker.propTypes = {
|
|
316
|
+
DatePicker.propTypes = {
|
|
317
|
+
...selectedSystemPropTypes,
|
|
333
318
|
tokens: getTokensPropType('DatePicker'),
|
|
334
|
-
|
|
335
319
|
/**
|
|
336
320
|
* A unique identifier.
|
|
337
321
|
*/
|
|
338
322
|
id: PropTypes.string.isRequired,
|
|
339
|
-
|
|
340
323
|
/**
|
|
341
324
|
* Whether the English or French copy will be used (e.g. for accessibility labels).
|
|
342
325
|
*/
|
|
343
326
|
copy: PropTypes.oneOf(['en', 'fr']),
|
|
344
|
-
|
|
345
327
|
/**
|
|
346
328
|
* A Moment instance representing the currently selected date, i.e. `moment()`
|
|
347
329
|
*/
|
|
348
330
|
date: momentPropTypes.momentObj,
|
|
349
|
-
|
|
350
331
|
/**
|
|
351
332
|
* A detailed description of validation error/success or additional instructions.
|
|
352
333
|
* Visual variant is determined based on the `validation` prop.
|
|
353
334
|
*/
|
|
354
335
|
feedback: PropTypes.string,
|
|
355
|
-
|
|
356
336
|
/**
|
|
357
337
|
* Event triggered every time a new date is clicked on
|
|
358
338
|
* @param {Moment} date The new date that was selected
|
|
359
339
|
*/
|
|
360
340
|
onDateChange: PropTypes.func,
|
|
361
|
-
|
|
362
341
|
/**
|
|
363
342
|
* A function determining whether a given date should be disabled
|
|
364
343
|
* @param {Moment} date The date to optionally disable
|
|
365
344
|
* @returns {bool}
|
|
366
345
|
*/
|
|
367
346
|
isDayDisabled: PropTypes.func,
|
|
368
|
-
|
|
369
347
|
/**
|
|
370
348
|
* The field label to be displayed above the calendar
|
|
371
349
|
*/
|
|
372
350
|
label: PropTypes.string,
|
|
373
|
-
|
|
374
351
|
/**
|
|
375
352
|
* A flag determining if the calendar picker is standalone or an input with overlay
|
|
376
353
|
*/
|
|
377
354
|
inline: PropTypes.bool,
|
|
378
|
-
|
|
379
355
|
/**
|
|
380
356
|
* A short description of the expected input.
|
|
381
357
|
*/
|
|
382
358
|
hint: PropTypes.string,
|
|
383
|
-
|
|
384
359
|
/**
|
|
385
360
|
* Position of the hint relative to label. Use `below` to display a larger hint below the label.
|
|
386
361
|
*/
|
|
387
362
|
hintPosition: PropTypes.oneOf(['inline', 'below']),
|
|
388
|
-
|
|
389
363
|
/**
|
|
390
364
|
* Content of an optional `Tooltip`. If set, a tooltip button will be shown next to the label.
|
|
391
365
|
*/
|
|
392
366
|
tooltip: PropTypes.string,
|
|
393
|
-
|
|
394
367
|
/**
|
|
395
368
|
* Use to visually mark an input as valid or invalid.
|
|
396
369
|
*/
|
|
397
370
|
validation: PropTypes.oneOf(['error', 'success']),
|
|
398
|
-
|
|
399
371
|
/**
|
|
400
372
|
* Disable the input which will not open the calendar picker
|
|
401
373
|
*/
|
|
402
374
|
disabled: PropTypes.bool,
|
|
403
|
-
|
|
404
375
|
/**
|
|
405
376
|
* A unique identifier for the previous icon button located on the datepicker.
|
|
406
377
|
* This is for automation testing purposes.
|
|
407
378
|
* Will be added as a `data-testid-prev` attribute for example.
|
|
408
379
|
*/
|
|
409
380
|
prevTestID: PropTypes.string,
|
|
410
|
-
|
|
411
381
|
/**
|
|
412
382
|
* A unique identifier for the next icon button located on the datepicker.
|
|
413
383
|
* This is for automation testing purposes.
|
|
@@ -34,56 +34,48 @@ const weekDays = {
|
|
|
34
34
|
Fr: 'Ven',
|
|
35
35
|
Sa: 'Sam'
|
|
36
36
|
};
|
|
37
|
-
|
|
38
37
|
const chooseAvailableStartDate = _ref => {
|
|
39
38
|
let {
|
|
40
39
|
date
|
|
41
40
|
} = _ref;
|
|
42
41
|
return `Choisir ${date}. Disponible.`;
|
|
43
42
|
};
|
|
44
|
-
|
|
45
43
|
const chooseAvailableEndDate = _ref2 => {
|
|
46
44
|
let {
|
|
47
45
|
date
|
|
48
46
|
} = _ref2;
|
|
49
47
|
return `Non disponible. ${date}`;
|
|
50
48
|
};
|
|
51
|
-
|
|
52
49
|
const chooseAvailableDate = _ref3 => {
|
|
53
50
|
let {
|
|
54
51
|
date
|
|
55
52
|
} = _ref3;
|
|
56
53
|
return date;
|
|
57
54
|
};
|
|
58
|
-
|
|
59
55
|
const dateIsUnavailable = _ref4 => {
|
|
60
56
|
let {
|
|
61
57
|
date
|
|
62
58
|
} = _ref4;
|
|
63
59
|
return `Not available. ${date}`;
|
|
64
60
|
};
|
|
65
|
-
|
|
66
61
|
const dateIsSelected = _ref5 => {
|
|
67
62
|
let {
|
|
68
63
|
date
|
|
69
64
|
} = _ref5;
|
|
70
65
|
return `Choisie. ${date}`;
|
|
71
66
|
};
|
|
72
|
-
|
|
73
67
|
const dateIsSelectedAsStartDate = _ref6 => {
|
|
74
68
|
let {
|
|
75
69
|
date
|
|
76
70
|
} = _ref6;
|
|
77
71
|
return `Choisie comme date de début. ${date}`;
|
|
78
72
|
};
|
|
79
|
-
|
|
80
73
|
const dateIsSelectedAsEndDate = _ref7 => {
|
|
81
74
|
let {
|
|
82
75
|
date
|
|
83
76
|
} = _ref7;
|
|
84
77
|
return `Choisie comme date de fin. ${date}`;
|
|
85
78
|
};
|
|
86
|
-
|
|
87
79
|
const dictionary = {
|
|
88
80
|
en: undefined,
|
|
89
81
|
// uses react-dates defaults
|
|
@@ -27,24 +27,25 @@ const StyledDisclaimer = /*#__PURE__*/styled.p.withConfig({
|
|
|
27
27
|
...tokens
|
|
28
28
|
};
|
|
29
29
|
});
|
|
30
|
+
|
|
30
31
|
/**
|
|
31
32
|
* Use Disclaimer to display singular legal statement and must be displayed
|
|
32
33
|
* immediately adjacent to the related, originating content.
|
|
33
34
|
*/
|
|
34
|
-
|
|
35
35
|
const Disclaimer = _ref2 => {
|
|
36
36
|
let {
|
|
37
37
|
children,
|
|
38
38
|
...rest
|
|
39
39
|
} = _ref2;
|
|
40
40
|
const themeTokens = useThemeTokens('Disclaimer');
|
|
41
|
-
return /*#__PURE__*/_jsx(StyledDisclaimer, {
|
|
41
|
+
return /*#__PURE__*/_jsx(StyledDisclaimer, {
|
|
42
|
+
...selectProps(rest),
|
|
42
43
|
...themeTokens,
|
|
43
44
|
children: children
|
|
44
45
|
});
|
|
45
46
|
};
|
|
46
|
-
|
|
47
|
-
|
|
47
|
+
Disclaimer.propTypes = {
|
|
48
|
+
...selectedSystemPropTypes,
|
|
48
49
|
tokens: getTokensPropType('Disclaimer'),
|
|
49
50
|
children: PropTypes.node.isRequired
|
|
50
51
|
};
|
|
@@ -11,17 +11,16 @@ const ExpandCollapseMini = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
11
11
|
nativeID,
|
|
12
12
|
...rest
|
|
13
13
|
} = _ref;
|
|
14
|
-
|
|
15
14
|
const handleChange = (openPanels, event) => {
|
|
16
15
|
if (typeof onToggle === 'function') {
|
|
17
16
|
const isOpen = openPanels.length > 0;
|
|
18
17
|
onToggle(event, isOpen);
|
|
19
18
|
}
|
|
20
19
|
};
|
|
21
|
-
|
|
22
20
|
return /*#__PURE__*/_jsx(ExpandCollapse, {
|
|
23
21
|
onChange: handleChange,
|
|
24
|
-
children: expandProps => /*#__PURE__*/_jsx(ExpandCollapse.Panel, {
|
|
22
|
+
children: expandProps => /*#__PURE__*/_jsx(ExpandCollapse.Panel, {
|
|
23
|
+
...expandProps,
|
|
25
24
|
panelId: "ExpandCollapseMiniPanel",
|
|
26
25
|
variant: {
|
|
27
26
|
mini: true
|
|
@@ -32,7 +31,8 @@ const ExpandCollapseMini = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
32
31
|
borderColor: 'transparent',
|
|
33
32
|
textLine: 'none',
|
|
34
33
|
backgroundColor: 'transparent'
|
|
35
|
-
}
|
|
34
|
+
}
|
|
35
|
+
// TODO refactor
|
|
36
36
|
// eslint-disable-next-line react/no-unstable-nested-components
|
|
37
37
|
,
|
|
38
38
|
control: pressableState => /*#__PURE__*/_jsx(ExpandCollapseMiniControl, {
|
|
@@ -46,18 +46,16 @@ const ExpandCollapseMini = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
46
46
|
});
|
|
47
47
|
});
|
|
48
48
|
ExpandCollapseMini.displayName = 'ExpandCollapseMini';
|
|
49
|
-
ExpandCollapseMini.propTypes = {
|
|
50
|
-
|
|
49
|
+
ExpandCollapseMini.propTypes = {
|
|
50
|
+
...ExpandCollapseMiniControl.propTypes,
|
|
51
51
|
/**
|
|
52
52
|
* Function to call on pressing the panel's control, which should open or close the panel.
|
|
53
53
|
*/
|
|
54
54
|
onToggle: PropTypes.func,
|
|
55
|
-
|
|
56
55
|
/**
|
|
57
56
|
* ID for DOM element on web
|
|
58
57
|
*/
|
|
59
58
|
nativeID: PropTypes.string,
|
|
60
|
-
|
|
61
59
|
/**
|
|
62
60
|
* Children nodes that can be added
|
|
63
61
|
*/
|
|
@@ -3,16 +3,16 @@ import PropTypes from 'prop-types';
|
|
|
3
3
|
import { selectSystemProps, Link, useThemeTokens } from '@telus-uds/components-base';
|
|
4
4
|
import { htmlAttrs } from '../utils';
|
|
5
5
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
-
const [selectProps, selectedSystemPropTypes] = selectSystemProps([htmlAttrs]);
|
|
7
|
-
// and a more appropriate press area, defer interaction handling to it.
|
|
6
|
+
const [selectProps, selectedSystemPropTypes] = selectSystemProps([htmlAttrs]);
|
|
8
7
|
|
|
8
|
+
// The ExpandCollapseControl has all the appropriate role, a11y, press handling etc
|
|
9
|
+
// and a more appropriate press area, defer interaction handling to it.
|
|
9
10
|
const presentationOnly = {
|
|
10
11
|
accessibilityRole: null,
|
|
11
12
|
// Treat as regular flow content with the Control
|
|
12
13
|
pointerEvents: 'none',
|
|
13
14
|
// Stop RNW from stopping clicks from bubbling to Control
|
|
14
15
|
focusable: false // Stop RNW from setting tabIndex={0}: focus goes to Control only
|
|
15
|
-
|
|
16
16
|
};
|
|
17
17
|
|
|
18
18
|
const selectLinkTokens = _ref => {
|
|
@@ -29,7 +29,6 @@ const selectLinkTokens = _ref => {
|
|
|
29
29
|
blockFontSize: fontSize
|
|
30
30
|
};
|
|
31
31
|
};
|
|
32
|
-
|
|
33
32
|
const ExpandCollapseMiniControl = _ref2 => {
|
|
34
33
|
let {
|
|
35
34
|
pressableState,
|
|
@@ -44,8 +43,8 @@ const ExpandCollapseMiniControl = _ref2 => {
|
|
|
44
43
|
expanded,
|
|
45
44
|
hover,
|
|
46
45
|
focus
|
|
47
|
-
} = pressableState || {};
|
|
48
|
-
|
|
46
|
+
} = pressableState || {};
|
|
47
|
+
// we only want focus outline when focusing, if user is pressing we don't want the border.
|
|
49
48
|
const {
|
|
50
49
|
outerBorderColor
|
|
51
50
|
} = useThemeTokens('Link', {}, {}, {
|
|
@@ -58,33 +57,32 @@ const ExpandCollapseMiniControl = _ref2 => {
|
|
|
58
57
|
} = useThemeTokens('ExpandCollapseMiniControl', tokens, variant, {
|
|
59
58
|
expanded,
|
|
60
59
|
focus
|
|
61
|
-
});
|
|
60
|
+
});
|
|
62
61
|
|
|
63
|
-
|
|
62
|
+
// Choose hover styles when any part of Control is hoverred
|
|
63
|
+
const appearance = {
|
|
64
|
+
...variant,
|
|
64
65
|
hover
|
|
65
66
|
};
|
|
66
|
-
|
|
67
67
|
const getTokens = linkState => {
|
|
68
68
|
const {
|
|
69
69
|
hover: linkHover
|
|
70
70
|
} = linkState || {};
|
|
71
71
|
const isHovered = hover || linkHover;
|
|
72
|
-
|
|
73
72
|
if (isHovered) {
|
|
74
73
|
// Include vertical icon animation on hover alongside built-in Link theme, the size is size4
|
|
75
74
|
return {
|
|
76
75
|
iconTranslateY: (expanded ? -1 : 1) * size
|
|
77
76
|
};
|
|
78
77
|
}
|
|
79
|
-
|
|
80
78
|
return {};
|
|
81
79
|
};
|
|
82
|
-
|
|
83
80
|
return /*#__PURE__*/_jsx(Link, {
|
|
84
81
|
variant: appearance,
|
|
85
82
|
icon: icon,
|
|
86
83
|
iconPosition: iconPosition,
|
|
87
|
-
tokens: linkState => ({
|
|
84
|
+
tokens: linkState => ({
|
|
85
|
+
...getTokens(linkState),
|
|
88
86
|
...selectLinkTokens(themeTokens),
|
|
89
87
|
outerBorderColor
|
|
90
88
|
}),
|
|
@@ -93,25 +91,21 @@ const ExpandCollapseMiniControl = _ref2 => {
|
|
|
93
91
|
children: expanded ? expandTitle : collapseTitle
|
|
94
92
|
});
|
|
95
93
|
};
|
|
96
|
-
|
|
97
|
-
|
|
94
|
+
ExpandCollapseMiniControl.propTypes = {
|
|
95
|
+
...selectedSystemPropTypes,
|
|
98
96
|
...Link.propTypes,
|
|
99
|
-
|
|
100
97
|
/**
|
|
101
98
|
* Optional function to call on pressing the panel's control, in addition to opening or closing the panel
|
|
102
99
|
*/
|
|
103
100
|
onPress: PropTypes.func,
|
|
104
|
-
|
|
105
101
|
/**
|
|
106
102
|
* ExpandCollapseMiniControl title when expanded
|
|
107
103
|
*/
|
|
108
104
|
expandTitle: PropTypes.string.isRequired,
|
|
109
|
-
|
|
110
105
|
/**
|
|
111
106
|
* ExpandCollapseMiniControl title when collapsed
|
|
112
107
|
*/
|
|
113
108
|
collapseTitle: PropTypes.string.isRequired,
|
|
114
|
-
|
|
115
109
|
/**
|
|
116
110
|
* React Native's `Pressable`'s state object
|
|
117
111
|
*/
|