@telus-uds/components-web 2.35.1 → 2.36.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 +16 -2
- package/lib/PriceLockup/PriceLockup.js +2 -2
- package/lib/TermsAndConditions/ExpandCollapse.js +9 -3
- package/lib/TermsAndConditions/TermsAndConditions.js +3 -5
- package/lib/TermsAndConditions/dictionary.js +6 -2
- package/lib-module/PriceLockup/PriceLockup.js +2 -2
- package/lib-module/TermsAndConditions/ExpandCollapse.js +9 -3
- package/lib-module/TermsAndConditions/TermsAndConditions.js +3 -5
- package/lib-module/TermsAndConditions/dictionary.js +6 -2
- package/package.json +2 -2
- package/src/PriceLockup/PriceLockup.jsx +3 -2
- package/src/TermsAndConditions/ExpandCollapse.jsx +11 -3
- package/src/TermsAndConditions/TermsAndConditions.jsx +4 -6
- package/src/TermsAndConditions/dictionary.js +6 -2
- package/types/PriceLockup.d.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,26 @@
|
|
|
1
1
|
# Change Log - @telus-uds/components-web
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Fri, 19 Jul 2024 18:14:09 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## 2.36.0
|
|
8
|
+
|
|
9
|
+
Fri, 19 Jul 2024 18:14:09 GMT
|
|
10
|
+
|
|
11
|
+
### Minor changes
|
|
12
|
+
|
|
13
|
+
- `PriceLockup`: Add `micro` option to `size` variant (tim.hysniu@telus.com)
|
|
14
|
+
- Bump @telus-uds/components-base to v1.89.0
|
|
15
|
+
|
|
16
|
+
### Patches
|
|
17
|
+
|
|
18
|
+
- `TermsAndConditions`: add accessibilityLabel to resolve accessibility issue (<tony.eng@telus.com>)
|
|
19
|
+
- `TermsAndConditions`: remove main container (guillermo.peitzner@telus.com)
|
|
20
|
+
|
|
7
21
|
## 2.35.1
|
|
8
22
|
|
|
9
|
-
Thu, 04 Jul 2024 19:
|
|
23
|
+
Thu, 04 Jul 2024 19:35:15 GMT
|
|
10
24
|
|
|
11
25
|
### Patches
|
|
12
26
|
|
|
@@ -276,9 +276,9 @@ PriceLockup.propTypes = {
|
|
|
276
276
|
/**
|
|
277
277
|
* Size of the component
|
|
278
278
|
*
|
|
279
|
-
*
|
|
279
|
+
* Micro for mini cart pricing, small for pricing in product catalogue pages, medium for pricing in product comparison cards and large for pricing in banners and promo cards
|
|
280
280
|
*/
|
|
281
|
-
size: _propTypes.default.oneOf(['small', 'medium', 'large']),
|
|
281
|
+
size: _propTypes.default.oneOf(['micro', 'small', 'medium', 'large']),
|
|
282
282
|
/**
|
|
283
283
|
* If currency symbol other than `$` to be used
|
|
284
284
|
*/
|
|
@@ -74,7 +74,9 @@ const ExpandCollapse = /*#__PURE__*/_react.default.forwardRef((_ref4, ref) => {
|
|
|
74
74
|
let {
|
|
75
75
|
children,
|
|
76
76
|
collapseTitle,
|
|
77
|
-
expandTitle = collapseTitle
|
|
77
|
+
expandTitle = collapseTitle,
|
|
78
|
+
expandLabel,
|
|
79
|
+
collapseLabel
|
|
78
80
|
} = _ref4;
|
|
79
81
|
const getTokens = (0, _componentsBase.useThemeTokensCallback)('TermsAndConditions', {}, {});
|
|
80
82
|
const {
|
|
@@ -114,6 +116,7 @@ const ExpandCollapse = /*#__PURE__*/_react.default.forwardRef((_ref4, ref) => {
|
|
|
114
116
|
expanded
|
|
115
117
|
} = pressableState || {};
|
|
116
118
|
const iconTokens = getIconButtonTokens(getTokens(pressableState || {}));
|
|
119
|
+
const label = expanded ? collapseLabel : expandLabel;
|
|
117
120
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(ExpandCollapseControl, {
|
|
118
121
|
ref: ref,
|
|
119
122
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(ExpandCollapseIconContainer, {
|
|
@@ -123,7 +126,8 @@ const ExpandCollapse = /*#__PURE__*/_react.default.forwardRef((_ref4, ref) => {
|
|
|
123
126
|
size: 'small'
|
|
124
127
|
},
|
|
125
128
|
tokens: iconTokens,
|
|
126
|
-
focusable: false
|
|
129
|
+
focusable: false,
|
|
130
|
+
accessibilityLabel: label
|
|
127
131
|
})
|
|
128
132
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(ExpandCollapseTitle, {
|
|
129
133
|
tokens: getTokens(),
|
|
@@ -148,7 +152,9 @@ ExpandCollapse.displayName = 'ExpandCollapse';
|
|
|
148
152
|
ExpandCollapse.propTypes = {
|
|
149
153
|
children: _propTypes.default.node.isRequired,
|
|
150
154
|
collapseTitle: _propTypes.default.string.isRequired,
|
|
151
|
-
expandTitle: _propTypes.default.string
|
|
155
|
+
expandTitle: _propTypes.default.string,
|
|
156
|
+
collapseLabel: _propTypes.default.string,
|
|
157
|
+
expandLabel: _propTypes.default.string
|
|
152
158
|
};
|
|
153
159
|
var _default = ExpandCollapse;
|
|
154
160
|
exports.default = _default;
|
|
@@ -95,10 +95,6 @@ const NonIndexedContentTitle = /*#__PURE__*/_styledComponents.default.div.withCo
|
|
|
95
95
|
paddingLeft: tokens.titlePaddingLeft
|
|
96
96
|
};
|
|
97
97
|
});
|
|
98
|
-
const MainContainer = /*#__PURE__*/_styledComponents.default.div.withConfig({
|
|
99
|
-
displayName: "TermsAndConditions__MainContainer",
|
|
100
|
-
componentId: "components-web__sc-1199epn-5"
|
|
101
|
-
})(["overflow:hidden;"]);
|
|
102
98
|
|
|
103
99
|
/**
|
|
104
100
|
* Use `TermsAndConditions` to display important legal content.
|
|
@@ -129,7 +125,7 @@ const TermsAndConditions = /*#__PURE__*/_react.default.forwardRef((_ref6, ref) =
|
|
|
129
125
|
const themeTokens = (0, _componentsBase.useThemeTokens)('TermsAndConditions', tokens, variant, {
|
|
130
126
|
viewport
|
|
131
127
|
});
|
|
132
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(
|
|
128
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
133
129
|
...selectProps(rest),
|
|
134
130
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.Divider, {
|
|
135
131
|
tokens: {
|
|
@@ -138,6 +134,8 @@ const TermsAndConditions = /*#__PURE__*/_react.default.forwardRef((_ref6, ref) =
|
|
|
138
134
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ExpandCollapse.default, {
|
|
139
135
|
collapseTitle: getCopy('headingView'),
|
|
140
136
|
expandTitle: getCopy('headingHide'),
|
|
137
|
+
collapseLabel: getCopy('collapseLabel'),
|
|
138
|
+
expandLabel: getCopy('expandLabel'),
|
|
141
139
|
ref: ref,
|
|
142
140
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(ContentContainer, {
|
|
143
141
|
tokens: themeTokens,
|
|
@@ -8,12 +8,16 @@ var _default = {
|
|
|
8
8
|
en: {
|
|
9
9
|
headingHide: 'Hide terms and conditions',
|
|
10
10
|
headingView: 'View terms and conditions',
|
|
11
|
-
nonIndexedTitle: 'The following applies to all terms and conditions above'
|
|
11
|
+
nonIndexedTitle: 'The following applies to all terms and conditions above',
|
|
12
|
+
expandLabel: 'Expand',
|
|
13
|
+
collapseLabel: 'Collapse'
|
|
12
14
|
},
|
|
13
15
|
fr: {
|
|
14
16
|
headingHide: 'Masquer les modalités et conditions',
|
|
15
17
|
headingView: 'Voir les modalités et conditions',
|
|
16
|
-
nonIndexedTitle: 'Ce qui suit s’applique aux modalités et conditions ci-dessus'
|
|
18
|
+
nonIndexedTitle: 'Ce qui suit s’applique aux modalités et conditions ci-dessus',
|
|
19
|
+
expandLabel: 'Détailler',
|
|
20
|
+
collapseLabel: 'Réduire'
|
|
17
21
|
}
|
|
18
22
|
};
|
|
19
23
|
exports.default = _default;
|
|
@@ -271,9 +271,9 @@ PriceLockup.propTypes = {
|
|
|
271
271
|
/**
|
|
272
272
|
* Size of the component
|
|
273
273
|
*
|
|
274
|
-
*
|
|
274
|
+
* Micro for mini cart pricing, small for pricing in product catalogue pages, medium for pricing in product comparison cards and large for pricing in banners and promo cards
|
|
275
275
|
*/
|
|
276
|
-
size: PropTypes.oneOf(['small', 'medium', 'large']),
|
|
276
|
+
size: PropTypes.oneOf(['micro', 'small', 'medium', 'large']),
|
|
277
277
|
/**
|
|
278
278
|
* If currency symbol other than `$` to be used
|
|
279
279
|
*/
|
|
@@ -68,7 +68,9 @@ const ExpandCollapse = /*#__PURE__*/React.forwardRef((_ref4, ref) => {
|
|
|
68
68
|
let {
|
|
69
69
|
children,
|
|
70
70
|
collapseTitle,
|
|
71
|
-
expandTitle = collapseTitle
|
|
71
|
+
expandTitle = collapseTitle,
|
|
72
|
+
expandLabel,
|
|
73
|
+
collapseLabel
|
|
72
74
|
} = _ref4;
|
|
73
75
|
const getTokens = useThemeTokensCallback('TermsAndConditions', {}, {});
|
|
74
76
|
const {
|
|
@@ -108,6 +110,7 @@ const ExpandCollapse = /*#__PURE__*/React.forwardRef((_ref4, ref) => {
|
|
|
108
110
|
expanded
|
|
109
111
|
} = pressableState || {};
|
|
110
112
|
const iconTokens = getIconButtonTokens(getTokens(pressableState || {}));
|
|
113
|
+
const label = expanded ? collapseLabel : expandLabel;
|
|
111
114
|
return /*#__PURE__*/_jsxs(ExpandCollapseControl, {
|
|
112
115
|
ref: ref,
|
|
113
116
|
children: [/*#__PURE__*/_jsx(ExpandCollapseIconContainer, {
|
|
@@ -117,7 +120,8 @@ const ExpandCollapse = /*#__PURE__*/React.forwardRef((_ref4, ref) => {
|
|
|
117
120
|
size: 'small'
|
|
118
121
|
},
|
|
119
122
|
tokens: iconTokens,
|
|
120
|
-
focusable: false
|
|
123
|
+
focusable: false,
|
|
124
|
+
accessibilityLabel: label
|
|
121
125
|
})
|
|
122
126
|
}), /*#__PURE__*/_jsx(ExpandCollapseTitle, {
|
|
123
127
|
tokens: getTokens(),
|
|
@@ -142,6 +146,8 @@ ExpandCollapse.displayName = 'ExpandCollapse';
|
|
|
142
146
|
ExpandCollapse.propTypes = {
|
|
143
147
|
children: PropTypes.node.isRequired,
|
|
144
148
|
collapseTitle: PropTypes.string.isRequired,
|
|
145
|
-
expandTitle: PropTypes.string
|
|
149
|
+
expandTitle: PropTypes.string,
|
|
150
|
+
collapseLabel: PropTypes.string,
|
|
151
|
+
expandLabel: PropTypes.string
|
|
146
152
|
};
|
|
147
153
|
export default ExpandCollapse;
|
|
@@ -89,10 +89,6 @@ const NonIndexedContentTitle = /*#__PURE__*/styled.div.withConfig({
|
|
|
89
89
|
paddingLeft: tokens.titlePaddingLeft
|
|
90
90
|
};
|
|
91
91
|
});
|
|
92
|
-
const MainContainer = /*#__PURE__*/styled.div.withConfig({
|
|
93
|
-
displayName: "TermsAndConditions__MainContainer",
|
|
94
|
-
componentId: "components-web__sc-1199epn-5"
|
|
95
|
-
})(["overflow:hidden;"]);
|
|
96
92
|
|
|
97
93
|
/**
|
|
98
94
|
* Use `TermsAndConditions` to display important legal content.
|
|
@@ -123,7 +119,7 @@ const TermsAndConditions = /*#__PURE__*/React.forwardRef((_ref6, ref) => {
|
|
|
123
119
|
const themeTokens = useThemeTokens('TermsAndConditions', tokens, variant, {
|
|
124
120
|
viewport
|
|
125
121
|
});
|
|
126
|
-
return /*#__PURE__*/_jsxs(
|
|
122
|
+
return /*#__PURE__*/_jsxs("div", {
|
|
127
123
|
...selectProps(rest),
|
|
128
124
|
children: [/*#__PURE__*/_jsx(Divider, {
|
|
129
125
|
tokens: {
|
|
@@ -132,6 +128,8 @@ const TermsAndConditions = /*#__PURE__*/React.forwardRef((_ref6, ref) => {
|
|
|
132
128
|
}), /*#__PURE__*/_jsx(ExpandCollapse, {
|
|
133
129
|
collapseTitle: getCopy('headingView'),
|
|
134
130
|
expandTitle: getCopy('headingHide'),
|
|
131
|
+
collapseLabel: getCopy('collapseLabel'),
|
|
132
|
+
expandLabel: getCopy('expandLabel'),
|
|
135
133
|
ref: ref,
|
|
136
134
|
children: /*#__PURE__*/_jsxs(ContentContainer, {
|
|
137
135
|
tokens: themeTokens,
|
|
@@ -2,11 +2,15 @@ export default {
|
|
|
2
2
|
en: {
|
|
3
3
|
headingHide: 'Hide terms and conditions',
|
|
4
4
|
headingView: 'View terms and conditions',
|
|
5
|
-
nonIndexedTitle: 'The following applies to all terms and conditions above'
|
|
5
|
+
nonIndexedTitle: 'The following applies to all terms and conditions above',
|
|
6
|
+
expandLabel: 'Expand',
|
|
7
|
+
collapseLabel: 'Collapse'
|
|
6
8
|
},
|
|
7
9
|
fr: {
|
|
8
10
|
headingHide: 'Masquer les modalités et conditions',
|
|
9
11
|
headingView: 'Voir les modalités et conditions',
|
|
10
|
-
nonIndexedTitle: 'Ce qui suit s’applique aux modalités et conditions ci-dessus'
|
|
12
|
+
nonIndexedTitle: 'Ce qui suit s’applique aux modalités et conditions ci-dessus',
|
|
13
|
+
expandLabel: 'Détailler',
|
|
14
|
+
collapseLabel: 'Réduire'
|
|
11
15
|
}
|
|
12
16
|
};
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
],
|
|
6
6
|
"dependencies": {
|
|
7
7
|
"@gorhom/portal": "^1.0.14",
|
|
8
|
-
"@telus-uds/components-base": "1.
|
|
8
|
+
"@telus-uds/components-base": "1.89.0",
|
|
9
9
|
"@telus-uds/system-constants": "^1.3.0",
|
|
10
10
|
"fscreen": "^1.2.0",
|
|
11
11
|
"lodash.omit": "^4.5.0",
|
|
@@ -83,5 +83,5 @@
|
|
|
83
83
|
"skip": true
|
|
84
84
|
},
|
|
85
85
|
"types": "types/index.d.ts",
|
|
86
|
-
"version": "2.
|
|
86
|
+
"version": "2.36.0"
|
|
87
87
|
}
|
|
@@ -136,6 +136,7 @@ const PriceLockup = React.forwardRef(
|
|
|
136
136
|
{ ...variant, size },
|
|
137
137
|
{ viewport, strikeThrough }
|
|
138
138
|
)
|
|
139
|
+
|
|
139
140
|
const typographyTokens = getTypographyTokens(themeTokens)
|
|
140
141
|
const priceString = String(price)
|
|
141
142
|
const lastDotPosition = priceString.lastIndexOf('.')
|
|
@@ -260,9 +261,9 @@ PriceLockup.propTypes = {
|
|
|
260
261
|
/**
|
|
261
262
|
* Size of the component
|
|
262
263
|
*
|
|
263
|
-
*
|
|
264
|
+
* Micro for mini cart pricing, small for pricing in product catalogue pages, medium for pricing in product comparison cards and large for pricing in banners and promo cards
|
|
264
265
|
*/
|
|
265
|
-
size: PropTypes.oneOf(['small', 'medium', 'large']),
|
|
266
|
+
size: PropTypes.oneOf(['micro', 'small', 'medium', 'large']),
|
|
266
267
|
/**
|
|
267
268
|
* If currency symbol other than `$` to be used
|
|
268
269
|
*/
|
|
@@ -50,7 +50,7 @@ const getIconButtonTokens = ({
|
|
|
50
50
|
})
|
|
51
51
|
|
|
52
52
|
const ExpandCollapse = React.forwardRef(
|
|
53
|
-
({ children, collapseTitle, expandTitle = collapseTitle }, ref) => {
|
|
53
|
+
({ children, collapseTitle, expandTitle = collapseTitle, expandLabel, collapseLabel }, ref) => {
|
|
54
54
|
const getTokens = useThemeTokensCallback('TermsAndConditions', {}, {})
|
|
55
55
|
const {
|
|
56
56
|
expandBaseBorderWidth,
|
|
@@ -89,12 +89,18 @@ const ExpandCollapse = React.forwardRef(
|
|
|
89
89
|
control={(pressableState) => {
|
|
90
90
|
const { expanded } = pressableState || {}
|
|
91
91
|
const iconTokens = getIconButtonTokens(getTokens(pressableState || {}))
|
|
92
|
+
const label = expanded ? collapseLabel : expandLabel
|
|
92
93
|
|
|
93
94
|
return (
|
|
94
95
|
<ExpandCollapseControl ref={ref}>
|
|
95
96
|
<ExpandCollapseIconContainer tokens={getTokens()}>
|
|
96
97
|
{/* Can use `Icon` instead of `IconButton` but `Icon` does not have required stylistic variants */}
|
|
97
|
-
<IconButton
|
|
98
|
+
<IconButton
|
|
99
|
+
variant={{ size: 'small' }}
|
|
100
|
+
tokens={iconTokens}
|
|
101
|
+
focusable={false}
|
|
102
|
+
accessibilityLabel={label}
|
|
103
|
+
/>
|
|
98
104
|
</ExpandCollapseIconContainer>
|
|
99
105
|
<ExpandCollapseTitle tokens={getTokens()}>
|
|
100
106
|
{expanded ? expandTitle : collapseTitle}
|
|
@@ -125,7 +131,9 @@ ExpandCollapse.displayName = 'ExpandCollapse'
|
|
|
125
131
|
ExpandCollapse.propTypes = {
|
|
126
132
|
children: PropTypes.node.isRequired,
|
|
127
133
|
collapseTitle: PropTypes.string.isRequired,
|
|
128
|
-
expandTitle: PropTypes.string
|
|
134
|
+
expandTitle: PropTypes.string,
|
|
135
|
+
collapseLabel: PropTypes.string,
|
|
136
|
+
expandLabel: PropTypes.string
|
|
129
137
|
}
|
|
130
138
|
|
|
131
139
|
export default ExpandCollapse
|
|
@@ -63,10 +63,6 @@ const NonIndexedContentTitle = styled.div(({ tokens }) => ({
|
|
|
63
63
|
paddingLeft: tokens.titlePaddingLeft
|
|
64
64
|
}))
|
|
65
65
|
|
|
66
|
-
const MainContainer = styled.div`
|
|
67
|
-
overflow: hidden;
|
|
68
|
-
`
|
|
69
|
-
|
|
70
66
|
/**
|
|
71
67
|
* Use `TermsAndConditions` to display important legal content.
|
|
72
68
|
*
|
|
@@ -97,11 +93,13 @@ const TermsAndConditions = React.forwardRef(
|
|
|
97
93
|
const themeTokens = useThemeTokens('TermsAndConditions', tokens, variant, { viewport })
|
|
98
94
|
|
|
99
95
|
return (
|
|
100
|
-
<
|
|
96
|
+
<div {...selectProps(rest)}>
|
|
101
97
|
<Divider tokens={{ color: themeTokens.dividerColor }} />
|
|
102
98
|
<ExpandCollapse
|
|
103
99
|
collapseTitle={getCopy('headingView')}
|
|
104
100
|
expandTitle={getCopy('headingHide')}
|
|
101
|
+
collapseLabel={getCopy('collapseLabel')}
|
|
102
|
+
expandLabel={getCopy('expandLabel')}
|
|
105
103
|
ref={ref}
|
|
106
104
|
>
|
|
107
105
|
<ContentContainer tokens={themeTokens}>
|
|
@@ -144,7 +142,7 @@ const TermsAndConditions = React.forwardRef(
|
|
|
144
142
|
</ContentContainer>
|
|
145
143
|
</ExpandCollapse>
|
|
146
144
|
<Divider tokens={{ color: themeTokens.dividerColor }} />
|
|
147
|
-
</
|
|
145
|
+
</div>
|
|
148
146
|
)
|
|
149
147
|
}
|
|
150
148
|
)
|
|
@@ -2,11 +2,15 @@ export default {
|
|
|
2
2
|
en: {
|
|
3
3
|
headingHide: 'Hide terms and conditions',
|
|
4
4
|
headingView: 'View terms and conditions',
|
|
5
|
-
nonIndexedTitle: 'The following applies to all terms and conditions above'
|
|
5
|
+
nonIndexedTitle: 'The following applies to all terms and conditions above',
|
|
6
|
+
expandLabel: 'Expand',
|
|
7
|
+
collapseLabel: 'Collapse'
|
|
6
8
|
},
|
|
7
9
|
fr: {
|
|
8
10
|
headingHide: 'Masquer les modalités et conditions',
|
|
9
11
|
headingView: 'Voir les modalités et conditions',
|
|
10
|
-
nonIndexedTitle: 'Ce qui suit s’applique aux modalités et conditions ci-dessus'
|
|
12
|
+
nonIndexedTitle: 'Ce qui suit s’applique aux modalités et conditions ci-dessus',
|
|
13
|
+
expandLabel: 'Détailler',
|
|
14
|
+
collapseLabel: 'Réduire'
|
|
11
15
|
}
|
|
12
16
|
}
|
package/types/PriceLockup.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import type { HTMLAttrs, Variant } from './common'
|
|
|
4
4
|
export interface PriceLockupProps extends HTMLAttrs {
|
|
5
5
|
children: ReactNode
|
|
6
6
|
variant?: Variant
|
|
7
|
-
size?: 'small' | 'medium' | 'large'
|
|
7
|
+
size?: 'micro' | 'small' | 'medium' | 'large'
|
|
8
8
|
signDirection?: 'left' | 'right'
|
|
9
9
|
footnoteLinks?: [number] | [string]
|
|
10
10
|
topText?: string
|