@telus-uds/components-web 2.11.0 → 2.12.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 +18 -2
- package/component-docs.json +64 -11
- package/lib/Card/Card.js +2 -0
- package/lib/ExpandCollapseMini/ExpandCollapseMini.js +5 -10
- package/lib/ExpandCollapseMini/ExpandCollapseMiniControl.js +32 -7
- package/lib/Footnote/FootnoteLink.js +1 -2
- package/lib/PriceLockup/PriceLockup.js +6 -1
- package/lib-module/Card/Card.js +2 -0
- package/lib-module/ExpandCollapseMini/ExpandCollapseMini.js +6 -11
- package/lib-module/ExpandCollapseMini/ExpandCollapseMiniControl.js +32 -7
- package/lib-module/Footnote/FootnoteLink.js +1 -2
- package/lib-module/PriceLockup/PriceLockup.js +7 -2
- package/package.json +3 -3
- package/src/Card/Card.jsx +12 -8
- package/src/ExpandCollapseMini/ExpandCollapseMini.jsx +9 -6
- package/src/ExpandCollapseMini/ExpandCollapseMiniControl.jsx +21 -4
- package/src/Footnote/FootnoteLink.jsx +1 -2
- package/src/PriceLockup/PriceLockup.jsx +7 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,28 @@
|
|
|
1
1
|
# Change Log - @telus-uds/components-web
|
|
2
2
|
|
|
3
|
-
This log was last generated on Wed,
|
|
3
|
+
This log was last generated on Wed, 28 Jun 2023 23:16:56 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## 2.12.0
|
|
8
|
+
|
|
9
|
+
Wed, 28 Jun 2023 23:16:56 GMT
|
|
10
|
+
|
|
11
|
+
### Minor changes
|
|
12
|
+
|
|
13
|
+
- Fixed an issue where FootnoteLink had a default property value which was being applied as 'smallerpx' instead of the intended 'smaller' (kyle.king2@telus.com)
|
|
14
|
+
- Gradient token added to Card component (35577399+JoshHC@users.noreply.github.com)
|
|
15
|
+
- added function to select link tokens from themeTokens (kyle.king2@telus.com)
|
|
16
|
+
- Bump @telus-uds/components-base to v1.53.0
|
|
17
|
+
- Bump @telus-uds/system-theme-tokens to v2.36.0
|
|
18
|
+
|
|
19
|
+
### Patches
|
|
20
|
+
|
|
21
|
+
- May not be able to focus `ChevronLink` for `theme-allium` (shahzaibkhalidmalik@outlook.com)
|
|
22
|
+
|
|
7
23
|
## 2.11.0
|
|
8
24
|
|
|
9
|
-
Wed, 21 Jun 2023 20:
|
|
25
|
+
Wed, 21 Jun 2023 20:40:42 GMT
|
|
10
26
|
|
|
11
27
|
### Minor changes
|
|
12
28
|
|
package/component-docs.json
CHANGED
|
@@ -522,6 +522,7 @@
|
|
|
522
522
|
"flex": "integer",
|
|
523
523
|
"backgroundColor": "color",
|
|
524
524
|
"borderColor": "color",
|
|
525
|
+
"gradient": "gradient",
|
|
525
526
|
"borderRadius": "radius",
|
|
526
527
|
"borderWidth": "border",
|
|
527
528
|
"paddingBottom": "size",
|
|
@@ -1067,11 +1068,14 @@
|
|
|
1067
1068
|
},
|
|
1068
1069
|
"required": false
|
|
1069
1070
|
},
|
|
1070
|
-
"
|
|
1071
|
-
"
|
|
1072
|
-
"
|
|
1073
|
-
"computed": false
|
|
1071
|
+
"onClick": {
|
|
1072
|
+
"type": {
|
|
1073
|
+
"name": "func"
|
|
1074
1074
|
},
|
|
1075
|
+
"required": true,
|
|
1076
|
+
"description": "A callback function to handle the click of a FootnoteLink."
|
|
1077
|
+
},
|
|
1078
|
+
"fontSize": {
|
|
1075
1079
|
"type": {
|
|
1076
1080
|
"name": "union",
|
|
1077
1081
|
"value": [
|
|
@@ -1085,13 +1089,6 @@
|
|
|
1085
1089
|
},
|
|
1086
1090
|
"required": false,
|
|
1087
1091
|
"description": "Override default `fontSize` to set specific font size value"
|
|
1088
|
-
},
|
|
1089
|
-
"onClick": {
|
|
1090
|
-
"type": {
|
|
1091
|
-
"name": "func"
|
|
1092
|
-
},
|
|
1093
|
-
"required": true,
|
|
1094
|
-
"description": "A callback function to handle the click of a FootnoteLink."
|
|
1095
1092
|
}
|
|
1096
1093
|
},
|
|
1097
1094
|
"attributes": {}
|
|
@@ -2362,6 +2359,55 @@
|
|
|
2362
2359
|
},
|
|
2363
2360
|
"required": false,
|
|
2364
2361
|
"description": "To provide a11y text for `PriceLockup` component\n\n**Note:** a11yText will override strikethrough price, so it must include price (ie. \"was 50 dollars per month\")"
|
|
2362
|
+
},
|
|
2363
|
+
"tokens": {
|
|
2364
|
+
"type": {
|
|
2365
|
+
"name": "custom",
|
|
2366
|
+
"raw": {
|
|
2367
|
+
"fontName": "fontName",
|
|
2368
|
+
"fontWeight": "fontWeight",
|
|
2369
|
+
"footnoteMarginTop": "size",
|
|
2370
|
+
"footnoteGap": "size",
|
|
2371
|
+
"bottomTextMarginTop": "size",
|
|
2372
|
+
"priceMarginBottom": "size",
|
|
2373
|
+
"bottomLinksMarginLeft": "size",
|
|
2374
|
+
"topTextMarginBottom": "size",
|
|
2375
|
+
"strikeThroughHeight": "size",
|
|
2376
|
+
"strikeThroughColor": "color",
|
|
2377
|
+
"fontColor": "color",
|
|
2378
|
+
"dividerColor": "color",
|
|
2379
|
+
"topTextFontSize": "fontSize",
|
|
2380
|
+
"strikeThroughPosition": "size",
|
|
2381
|
+
"topTextLineHeight": "lineHeight",
|
|
2382
|
+
"currencySymbolFontSize": "fontSize",
|
|
2383
|
+
"currencySymbolLineHeight": "lineHeight",
|
|
2384
|
+
"currencySymbolFontName": "fontName",
|
|
2385
|
+
"currencySymbolFontWeight": "fontWeight",
|
|
2386
|
+
"amountFontSize": "fontSize",
|
|
2387
|
+
"amountLineHeight": "lineHeight",
|
|
2388
|
+
"amountLetterSpacing": "letterSpacing",
|
|
2389
|
+
"amountFontWeight": "fontWeight",
|
|
2390
|
+
"amountFontName": "fontName",
|
|
2391
|
+
"centsFontSize": "fontSize",
|
|
2392
|
+
"centsLineHeight": "lineHeight",
|
|
2393
|
+
"centsFontName": "fontName",
|
|
2394
|
+
"centsFontWeight": "fontWeight",
|
|
2395
|
+
"topTextFontName": "fontName",
|
|
2396
|
+
"topTextFontWeight": "fontWeight",
|
|
2397
|
+
"rateFontSize": "fontSize",
|
|
2398
|
+
"rateLineHeight": "lineHeight",
|
|
2399
|
+
"rateFontName": "fontName",
|
|
2400
|
+
"rateFontWeight": "fontWeight",
|
|
2401
|
+
"bottomTextFontSize": "fontSize",
|
|
2402
|
+
"bottomTextLineHeight": "lineHeight",
|
|
2403
|
+
"footnoteLinkColor": "color",
|
|
2404
|
+
"footnoteLinkFontName": "fontName",
|
|
2405
|
+
"footnoteLinkFontWeight": "fontWeight",
|
|
2406
|
+
"footnoteLinkFontSize": "fontSize"
|
|
2407
|
+
}
|
|
2408
|
+
},
|
|
2409
|
+
"required": false,
|
|
2410
|
+
"description": "`PriceLockup` tokens"
|
|
2365
2411
|
}
|
|
2366
2412
|
},
|
|
2367
2413
|
"attributes": {}
|
|
@@ -9118,6 +9164,7 @@
|
|
|
9118
9164
|
"flex": "integer",
|
|
9119
9165
|
"backgroundColor": "color",
|
|
9120
9166
|
"borderColor": "color",
|
|
9167
|
+
"gradient": "gradient",
|
|
9121
9168
|
"borderRadius": "radius",
|
|
9122
9169
|
"borderWidth": "border",
|
|
9123
9170
|
"paddingBottom": "size",
|
|
@@ -12742,7 +12789,10 @@
|
|
|
12742
12789
|
"paddingBottom": "size",
|
|
12743
12790
|
"shadow": "shadow",
|
|
12744
12791
|
"alignSelf": "flexAlign",
|
|
12792
|
+
"space": "integer",
|
|
12745
12793
|
"icon": "icon",
|
|
12794
|
+
"trackHeight": "size",
|
|
12795
|
+
"outerBorderGapButton": "size",
|
|
12746
12796
|
"width": "size",
|
|
12747
12797
|
"trackBorderWidth": "border",
|
|
12748
12798
|
"trackBorderColor": "color",
|
|
@@ -13068,7 +13118,10 @@
|
|
|
13068
13118
|
"paddingBottom": "size",
|
|
13069
13119
|
"shadow": "shadow",
|
|
13070
13120
|
"alignSelf": "flexAlign",
|
|
13121
|
+
"space": "integer",
|
|
13071
13122
|
"icon": "icon",
|
|
13123
|
+
"trackHeight": "size",
|
|
13124
|
+
"outerBorderGapButton": "size",
|
|
13072
13125
|
"width": "size",
|
|
13073
13126
|
"trackBorderWidth": "border",
|
|
13074
13127
|
"trackBorderColor": "color",
|
package/lib/Card/Card.js
CHANGED
|
@@ -30,6 +30,7 @@ const selectCardBaseTokens = _ref => {
|
|
|
30
30
|
let {
|
|
31
31
|
backgroundColor,
|
|
32
32
|
borderColor,
|
|
33
|
+
gradient,
|
|
33
34
|
borderWidth,
|
|
34
35
|
borderRadius,
|
|
35
36
|
shadow,
|
|
@@ -38,6 +39,7 @@ const selectCardBaseTokens = _ref => {
|
|
|
38
39
|
return {
|
|
39
40
|
backgroundColor,
|
|
40
41
|
borderColor,
|
|
42
|
+
gradient,
|
|
41
43
|
borderWidth,
|
|
42
44
|
borderRadius,
|
|
43
45
|
shadow,
|
|
@@ -28,12 +28,6 @@ const ExpandCollapseMini = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
|
28
28
|
tokens,
|
|
29
29
|
...rest
|
|
30
30
|
} = _ref;
|
|
31
|
-
const {
|
|
32
|
-
variant
|
|
33
|
-
} = rest;
|
|
34
|
-
const {
|
|
35
|
-
borderWidth
|
|
36
|
-
} = (0, _componentsBase.useThemeTokens)('ExpandCollapseMini', tokens, variant);
|
|
37
31
|
|
|
38
32
|
const handleChange = (openPanels, event) => {
|
|
39
33
|
if (typeof onToggle === 'function') {
|
|
@@ -43,9 +37,6 @@ const ExpandCollapseMini = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
|
43
37
|
};
|
|
44
38
|
|
|
45
39
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.ExpandCollapse, {
|
|
46
|
-
tokens: {
|
|
47
|
-
borderWidth
|
|
48
|
-
},
|
|
49
40
|
onChange: handleChange,
|
|
50
41
|
children: expandProps => /*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.ExpandCollapse.Panel, { ...expandProps,
|
|
51
42
|
panelId: "ExpandCollapseMiniPanel",
|
|
@@ -53,7 +44,11 @@ const ExpandCollapseMini = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
|
53
44
|
mini: true
|
|
54
45
|
},
|
|
55
46
|
controlTokens: {
|
|
56
|
-
|
|
47
|
+
// Remove unwanted look and feel from ExpandCollapse(background pressed, focus border and text underline)
|
|
48
|
+
icon: null,
|
|
49
|
+
borderColor: 'transparent',
|
|
50
|
+
textLine: 'none',
|
|
51
|
+
backgroundColor: 'transparent'
|
|
57
52
|
} // TODO refactor
|
|
58
53
|
// eslint-disable-next-line react/no-unstable-nested-components
|
|
59
54
|
,
|
|
@@ -29,7 +29,22 @@ const presentationOnly = {
|
|
|
29
29
|
|
|
30
30
|
};
|
|
31
31
|
|
|
32
|
-
const
|
|
32
|
+
const selectLinkTokens = _ref => {
|
|
33
|
+
let {
|
|
34
|
+
color,
|
|
35
|
+
textLine,
|
|
36
|
+
lineHeight,
|
|
37
|
+
fontSize
|
|
38
|
+
} = _ref;
|
|
39
|
+
return {
|
|
40
|
+
color,
|
|
41
|
+
textLine,
|
|
42
|
+
blockLineHeight: lineHeight,
|
|
43
|
+
blockFontSize: fontSize
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
const ExpandCollapseMiniControl = _ref2 => {
|
|
33
48
|
let {
|
|
34
49
|
pressableState,
|
|
35
50
|
collapseTitle,
|
|
@@ -38,16 +53,25 @@ const ExpandCollapseMiniControl = _ref => {
|
|
|
38
53
|
tokens,
|
|
39
54
|
variant = {},
|
|
40
55
|
...rest
|
|
41
|
-
} =
|
|
56
|
+
} = _ref2;
|
|
42
57
|
const {
|
|
43
58
|
expanded,
|
|
44
|
-
hover
|
|
45
|
-
|
|
59
|
+
hover,
|
|
60
|
+
focus
|
|
61
|
+
} = pressableState || {}; // we only want focus outline when focusing, if user is pressing we don't want the border.
|
|
62
|
+
|
|
63
|
+
const {
|
|
64
|
+
outerBorderColor
|
|
65
|
+
} = (0, _componentsBase.useThemeTokens)('Link', {}, {}, {
|
|
66
|
+
focus
|
|
67
|
+
});
|
|
46
68
|
const {
|
|
47
69
|
size,
|
|
48
|
-
icon
|
|
70
|
+
icon,
|
|
71
|
+
...themeTokens
|
|
49
72
|
} = (0, _componentsBase.useThemeTokens)('ExpandCollapseMiniControl', tokens, variant, {
|
|
50
|
-
expanded
|
|
73
|
+
expanded,
|
|
74
|
+
focus
|
|
51
75
|
}); // Choose hover styles when any part of Control is hoverred
|
|
52
76
|
|
|
53
77
|
const appearance = { ...variant,
|
|
@@ -75,7 +99,8 @@ const ExpandCollapseMiniControl = _ref => {
|
|
|
75
99
|
icon: icon,
|
|
76
100
|
iconPosition: iconPosition,
|
|
77
101
|
tokens: linkState => ({ ...getTokens(linkState),
|
|
78
|
-
|
|
102
|
+
...selectLinkTokens(themeTokens),
|
|
103
|
+
outerBorderColor
|
|
79
104
|
}),
|
|
80
105
|
...presentationOnly,
|
|
81
106
|
...selectProps(rest),
|
|
@@ -140,8 +140,7 @@ FootnoteLink.propTypes = { ...selectedSystemPropTypes,
|
|
|
140
140
|
fontSize: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string])
|
|
141
141
|
};
|
|
142
142
|
FootnoteLink.defaultProps = {
|
|
143
|
-
copy: 'en'
|
|
144
|
-
fontSize: 'smaller'
|
|
143
|
+
copy: 'en'
|
|
145
144
|
};
|
|
146
145
|
var _default = FootnoteLink;
|
|
147
146
|
exports.default = _default;
|
|
@@ -316,7 +316,12 @@ PriceLockup.propTypes = { ...selectedSystemPropTypes,
|
|
|
316
316
|
*
|
|
317
317
|
* **Note:** a11yText will override strikethrough price, so it must include price (ie. "was 50 dollars per month")
|
|
318
318
|
*/
|
|
319
|
-
a11yText: _propTypes.default.string
|
|
319
|
+
a11yText: _propTypes.default.string,
|
|
320
|
+
|
|
321
|
+
/**
|
|
322
|
+
* `PriceLockup` tokens
|
|
323
|
+
*/
|
|
324
|
+
tokens: (0, _componentsBase.getTokensPropType)('PriceLockup')
|
|
320
325
|
};
|
|
321
326
|
var _default = PriceLockup;
|
|
322
327
|
exports.default = _default;
|
package/lib-module/Card/Card.js
CHANGED
|
@@ -12,6 +12,7 @@ const selectCardBaseTokens = _ref => {
|
|
|
12
12
|
let {
|
|
13
13
|
backgroundColor,
|
|
14
14
|
borderColor,
|
|
15
|
+
gradient,
|
|
15
16
|
borderWidth,
|
|
16
17
|
borderRadius,
|
|
17
18
|
shadow,
|
|
@@ -20,6 +21,7 @@ const selectCardBaseTokens = _ref => {
|
|
|
20
21
|
return {
|
|
21
22
|
backgroundColor,
|
|
22
23
|
borderColor,
|
|
24
|
+
gradient,
|
|
23
25
|
borderWidth,
|
|
24
26
|
borderRadius,
|
|
25
27
|
shadow,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { forwardRef } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import { ExpandCollapse
|
|
3
|
+
import { ExpandCollapse } from '@telus-uds/components-base';
|
|
4
4
|
import ExpandCollapseMiniControl from './ExpandCollapseMiniControl';
|
|
5
5
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
6
|
const ExpandCollapseMini = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
@@ -10,12 +10,6 @@ const ExpandCollapseMini = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
10
10
|
tokens,
|
|
11
11
|
...rest
|
|
12
12
|
} = _ref;
|
|
13
|
-
const {
|
|
14
|
-
variant
|
|
15
|
-
} = rest;
|
|
16
|
-
const {
|
|
17
|
-
borderWidth
|
|
18
|
-
} = useThemeTokens('ExpandCollapseMini', tokens, variant);
|
|
19
13
|
|
|
20
14
|
const handleChange = (openPanels, event) => {
|
|
21
15
|
if (typeof onToggle === 'function') {
|
|
@@ -25,9 +19,6 @@ const ExpandCollapseMini = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
25
19
|
};
|
|
26
20
|
|
|
27
21
|
return /*#__PURE__*/_jsx(ExpandCollapse, {
|
|
28
|
-
tokens: {
|
|
29
|
-
borderWidth
|
|
30
|
-
},
|
|
31
22
|
onChange: handleChange,
|
|
32
23
|
children: expandProps => /*#__PURE__*/_jsx(ExpandCollapse.Panel, { ...expandProps,
|
|
33
24
|
panelId: "ExpandCollapseMiniPanel",
|
|
@@ -35,7 +26,11 @@ const ExpandCollapseMini = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
35
26
|
mini: true
|
|
36
27
|
},
|
|
37
28
|
controlTokens: {
|
|
38
|
-
|
|
29
|
+
// Remove unwanted look and feel from ExpandCollapse(background pressed, focus border and text underline)
|
|
30
|
+
icon: null,
|
|
31
|
+
borderColor: 'transparent',
|
|
32
|
+
textLine: 'none',
|
|
33
|
+
backgroundColor: 'transparent'
|
|
39
34
|
} // TODO refactor
|
|
40
35
|
// eslint-disable-next-line react/no-unstable-nested-components
|
|
41
36
|
,
|
|
@@ -15,7 +15,22 @@ const presentationOnly = {
|
|
|
15
15
|
|
|
16
16
|
};
|
|
17
17
|
|
|
18
|
-
const
|
|
18
|
+
const selectLinkTokens = _ref => {
|
|
19
|
+
let {
|
|
20
|
+
color,
|
|
21
|
+
textLine,
|
|
22
|
+
lineHeight,
|
|
23
|
+
fontSize
|
|
24
|
+
} = _ref;
|
|
25
|
+
return {
|
|
26
|
+
color,
|
|
27
|
+
textLine,
|
|
28
|
+
blockLineHeight: lineHeight,
|
|
29
|
+
blockFontSize: fontSize
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
const ExpandCollapseMiniControl = _ref2 => {
|
|
19
34
|
let {
|
|
20
35
|
pressableState,
|
|
21
36
|
collapseTitle,
|
|
@@ -24,16 +39,25 @@ const ExpandCollapseMiniControl = _ref => {
|
|
|
24
39
|
tokens,
|
|
25
40
|
variant = {},
|
|
26
41
|
...rest
|
|
27
|
-
} =
|
|
42
|
+
} = _ref2;
|
|
28
43
|
const {
|
|
29
44
|
expanded,
|
|
30
|
-
hover
|
|
31
|
-
|
|
45
|
+
hover,
|
|
46
|
+
focus
|
|
47
|
+
} = pressableState || {}; // we only want focus outline when focusing, if user is pressing we don't want the border.
|
|
48
|
+
|
|
49
|
+
const {
|
|
50
|
+
outerBorderColor
|
|
51
|
+
} = useThemeTokens('Link', {}, {}, {
|
|
52
|
+
focus
|
|
53
|
+
});
|
|
32
54
|
const {
|
|
33
55
|
size,
|
|
34
|
-
icon
|
|
56
|
+
icon,
|
|
57
|
+
...themeTokens
|
|
35
58
|
} = useThemeTokens('ExpandCollapseMiniControl', tokens, variant, {
|
|
36
|
-
expanded
|
|
59
|
+
expanded,
|
|
60
|
+
focus
|
|
37
61
|
}); // Choose hover styles when any part of Control is hoverred
|
|
38
62
|
|
|
39
63
|
const appearance = { ...variant,
|
|
@@ -61,7 +85,8 @@ const ExpandCollapseMiniControl = _ref => {
|
|
|
61
85
|
icon: icon,
|
|
62
86
|
iconPosition: iconPosition,
|
|
63
87
|
tokens: linkState => ({ ...getTokens(linkState),
|
|
64
|
-
|
|
88
|
+
...selectLinkTokens(themeTokens),
|
|
89
|
+
outerBorderColor
|
|
65
90
|
}),
|
|
66
91
|
...presentationOnly,
|
|
67
92
|
...selectProps(rest),
|
|
@@ -122,7 +122,6 @@ FootnoteLink.propTypes = { ...selectedSystemPropTypes,
|
|
|
122
122
|
fontSize: PropTypes.oneOfType([PropTypes.number, PropTypes.string])
|
|
123
123
|
};
|
|
124
124
|
FootnoteLink.defaultProps = {
|
|
125
|
-
copy: 'en'
|
|
126
|
-
fontSize: 'smaller'
|
|
125
|
+
copy: 'en'
|
|
127
126
|
};
|
|
128
127
|
export default FootnoteLink;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import { A11yText, Divider, selectSystemProps, Typography, useThemeTokens, useViewport } from '@telus-uds/components-base';
|
|
3
|
+
import { A11yText, Divider, selectSystemProps, Typography, useThemeTokens, useViewport, getTokensPropType } from '@telus-uds/components-base';
|
|
4
4
|
import styled from 'styled-components';
|
|
5
5
|
import FootnoteLink from '../Footnote/FootnoteLink';
|
|
6
6
|
import getTypographyTokens from './tokens';
|
|
@@ -293,6 +293,11 @@ PriceLockup.propTypes = { ...selectedSystemPropTypes,
|
|
|
293
293
|
*
|
|
294
294
|
* **Note:** a11yText will override strikethrough price, so it must include price (ie. "was 50 dollars per month")
|
|
295
295
|
*/
|
|
296
|
-
a11yText: PropTypes.string
|
|
296
|
+
a11yText: PropTypes.string,
|
|
297
|
+
|
|
298
|
+
/**
|
|
299
|
+
* `PriceLockup` tokens
|
|
300
|
+
*/
|
|
301
|
+
tokens: getTokensPropType('PriceLockup')
|
|
297
302
|
};
|
|
298
303
|
export default PriceLockup;
|
package/package.json
CHANGED
|
@@ -5,14 +5,14 @@
|
|
|
5
5
|
],
|
|
6
6
|
"dependencies": {
|
|
7
7
|
"@gorhom/portal": "^1.0.14",
|
|
8
|
-
"@telus-uds/components-base": "1.
|
|
8
|
+
"@telus-uds/components-base": "1.53.0",
|
|
9
9
|
"@telus-uds/system-constants": "^1.2.1",
|
|
10
10
|
"fscreen": "^1.2.0",
|
|
11
11
|
"lodash.omit": "^4.5.0",
|
|
12
12
|
"react-dates": "^21.8.0",
|
|
13
13
|
"react-helmet-async": "^1.3.0",
|
|
14
14
|
"react-moment-proptypes": "^1.8.1",
|
|
15
|
-
"@telus-uds/system-theme-tokens": "^2.
|
|
15
|
+
"@telus-uds/system-theme-tokens": "^2.36.0",
|
|
16
16
|
"prop-types": "^15.7.2",
|
|
17
17
|
"lodash.throttle": "^4.1.1",
|
|
18
18
|
"react-youtube": "^10.1.0",
|
|
@@ -63,5 +63,5 @@
|
|
|
63
63
|
"skip": true
|
|
64
64
|
},
|
|
65
65
|
"types": "types/index.d.ts",
|
|
66
|
-
"version": "2.
|
|
66
|
+
"version": "2.12.0"
|
|
67
67
|
}
|
package/src/Card/Card.jsx
CHANGED
|
@@ -23,18 +23,22 @@ import FullBleedContent, {
|
|
|
23
23
|
const selectCardBaseTokens = ({
|
|
24
24
|
backgroundColor,
|
|
25
25
|
borderColor,
|
|
26
|
+
gradient,
|
|
26
27
|
borderWidth,
|
|
27
28
|
borderRadius,
|
|
28
29
|
shadow,
|
|
29
30
|
minWidth
|
|
30
|
-
}) =>
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
31
|
+
}) => {
|
|
32
|
+
return {
|
|
33
|
+
backgroundColor,
|
|
34
|
+
borderColor,
|
|
35
|
+
gradient,
|
|
36
|
+
borderWidth,
|
|
37
|
+
borderRadius,
|
|
38
|
+
shadow,
|
|
39
|
+
minWidth
|
|
40
|
+
}
|
|
41
|
+
}
|
|
38
42
|
|
|
39
43
|
// Passes React Native-oriented system props through UDS Card
|
|
40
44
|
const [selectProps, selectedSystemPropTypes] = selectSystemProps([a11yProps, viewProps])
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
import React, { forwardRef } from 'react'
|
|
2
2
|
import PropTypes from 'prop-types'
|
|
3
|
-
import { ExpandCollapse
|
|
3
|
+
import { ExpandCollapse } from '@telus-uds/components-base'
|
|
4
4
|
import ExpandCollapseMiniControl from './ExpandCollapseMiniControl'
|
|
5
5
|
|
|
6
6
|
const ExpandCollapseMini = forwardRef(({ children, onToggle, tokens, ...rest }, ref) => {
|
|
7
|
-
const { variant } = rest
|
|
8
|
-
const { borderWidth } = useThemeTokens('ExpandCollapseMini', tokens, variant)
|
|
9
|
-
|
|
10
7
|
const handleChange = (openPanels, event) => {
|
|
11
8
|
if (typeof onToggle === 'function') {
|
|
12
9
|
const isOpen = openPanels.length > 0
|
|
@@ -15,13 +12,19 @@ const ExpandCollapseMini = forwardRef(({ children, onToggle, tokens, ...rest },
|
|
|
15
12
|
}
|
|
16
13
|
|
|
17
14
|
return (
|
|
18
|
-
<ExpandCollapse
|
|
15
|
+
<ExpandCollapse onChange={handleChange}>
|
|
19
16
|
{(expandProps) => (
|
|
20
17
|
<ExpandCollapse.Panel
|
|
21
18
|
{...expandProps}
|
|
22
19
|
panelId="ExpandCollapseMiniPanel"
|
|
23
20
|
variant={{ mini: true }}
|
|
24
|
-
controlTokens={{
|
|
21
|
+
controlTokens={{
|
|
22
|
+
// Remove unwanted look and feel from ExpandCollapse(background pressed, focus border and text underline)
|
|
23
|
+
icon: null,
|
|
24
|
+
borderColor: 'transparent',
|
|
25
|
+
textLine: 'none',
|
|
26
|
+
backgroundColor: 'transparent'
|
|
27
|
+
}}
|
|
25
28
|
// TODO refactor
|
|
26
29
|
// eslint-disable-next-line react/no-unstable-nested-components
|
|
27
30
|
control={(pressableState) => (
|
|
@@ -13,6 +13,13 @@ const presentationOnly = {
|
|
|
13
13
|
focusable: false // Stop RNW from setting tabIndex={0}: focus goes to Control only
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
+
const selectLinkTokens = ({ color, textLine, lineHeight, fontSize }) => ({
|
|
17
|
+
color,
|
|
18
|
+
textLine,
|
|
19
|
+
blockLineHeight: lineHeight,
|
|
20
|
+
blockFontSize: fontSize
|
|
21
|
+
})
|
|
22
|
+
|
|
16
23
|
const ExpandCollapseMiniControl = ({
|
|
17
24
|
pressableState,
|
|
18
25
|
collapseTitle,
|
|
@@ -22,9 +29,15 @@ const ExpandCollapseMiniControl = ({
|
|
|
22
29
|
variant = {},
|
|
23
30
|
...rest
|
|
24
31
|
}) => {
|
|
25
|
-
const { expanded, hover } = pressableState || {}
|
|
26
|
-
|
|
27
|
-
const {
|
|
32
|
+
const { expanded, hover, focus } = pressableState || {}
|
|
33
|
+
// we only want focus outline when focusing, if user is pressing we don't want the border.
|
|
34
|
+
const { outerBorderColor } = useThemeTokens('Link', {}, {}, { focus })
|
|
35
|
+
const { size, icon, ...themeTokens } = useThemeTokens(
|
|
36
|
+
'ExpandCollapseMiniControl',
|
|
37
|
+
tokens,
|
|
38
|
+
variant,
|
|
39
|
+
{ expanded, focus }
|
|
40
|
+
)
|
|
28
41
|
|
|
29
42
|
// Choose hover styles when any part of Control is hoverred
|
|
30
43
|
const appearance = { ...variant, hover }
|
|
@@ -45,7 +58,11 @@ const ExpandCollapseMiniControl = ({
|
|
|
45
58
|
variant={appearance}
|
|
46
59
|
icon={icon}
|
|
47
60
|
iconPosition={iconPosition}
|
|
48
|
-
tokens={(linkState) => ({
|
|
61
|
+
tokens={(linkState) => ({
|
|
62
|
+
...getTokens(linkState),
|
|
63
|
+
...selectLinkTokens(themeTokens),
|
|
64
|
+
outerBorderColor
|
|
65
|
+
})}
|
|
49
66
|
{...presentationOnly}
|
|
50
67
|
{...selectProps(rest)}
|
|
51
68
|
>
|
|
@@ -6,7 +6,8 @@ import {
|
|
|
6
6
|
selectSystemProps,
|
|
7
7
|
Typography,
|
|
8
8
|
useThemeTokens,
|
|
9
|
-
useViewport
|
|
9
|
+
useViewport,
|
|
10
|
+
getTokensPropType
|
|
10
11
|
} from '@telus-uds/components-base'
|
|
11
12
|
import styled from 'styled-components'
|
|
12
13
|
import FootnoteLink from '../Footnote/FootnoteLink'
|
|
@@ -273,7 +274,11 @@ PriceLockup.propTypes = {
|
|
|
273
274
|
*
|
|
274
275
|
* **Note:** a11yText will override strikethrough price, so it must include price (ie. "was 50 dollars per month")
|
|
275
276
|
*/
|
|
276
|
-
a11yText: PropTypes.string
|
|
277
|
+
a11yText: PropTypes.string,
|
|
278
|
+
/**
|
|
279
|
+
* `PriceLockup` tokens
|
|
280
|
+
*/
|
|
281
|
+
tokens: getTokensPropType('PriceLockup')
|
|
277
282
|
}
|
|
278
283
|
|
|
279
284
|
export default PriceLockup
|