@telus-uds/components-web 2.37.0 → 2.38.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/lib/ExpandCollapseMini/ExpandCollapseMini.js +8 -1
- package/lib/OrderedList/Item.js +8 -6
- package/lib/OrderedList/OrderedList.js +17 -10
- package/lib/QuantitySelector/dictionary.js +12 -12
- package/lib/Ribbon/Ribbon.js +1 -1
- package/lib-module/ExpandCollapseMini/ExpandCollapseMini.js +8 -1
- package/lib-module/OrderedList/Item.js +8 -6
- package/lib-module/OrderedList/OrderedList.js +18 -11
- package/lib-module/QuantitySelector/dictionary.js +12 -12
- package/lib-module/Ribbon/Ribbon.js +1 -1
- package/package.json +3 -3
- package/src/ExpandCollapseMini/ExpandCollapseMini.jsx +12 -3
- package/src/OrderedList/Item.jsx +7 -6
- package/src/OrderedList/OrderedList.jsx +32 -29
- package/src/QuantitySelector/dictionary.js +14 -12
- package/src/Ribbon/Ribbon.jsx +1 -0
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
|
|
3
|
+
This log was last generated on Mon, 12 Aug 2024 06:26:58 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## 2.38.0
|
|
8
|
+
|
|
9
|
+
Mon, 12 Aug 2024 06:26:58 GMT
|
|
10
|
+
|
|
11
|
+
### Minor changes
|
|
12
|
+
|
|
13
|
+
- `ExpandCollapseMini`: Add `initialOpen` prop to control the expand behavior on first render (jaime.tuyuc@telus.com)
|
|
14
|
+
- OrderedList: add itemTextColor token and pass tokens down to children (jacqui.koroll@telus.com)
|
|
15
|
+
- Bump @telus-uds/components-base to v1.91.0
|
|
16
|
+
- Bump @telus-uds/system-theme-tokens to v2.61.0
|
|
17
|
+
|
|
18
|
+
### Patches
|
|
19
|
+
|
|
20
|
+
- Ribbon: add overflow hidden to fix sharp ribbon curve (jacqui.koroll@telus.com)
|
|
21
|
+
- QuantitySelector: update default dictionary values (jacqui.koroll@telus.com)
|
|
22
|
+
|
|
7
23
|
## 2.37.0
|
|
8
24
|
|
|
9
|
-
Fri, 26 Jul 2024 21:
|
|
25
|
+
Fri, 26 Jul 2024 21:24:32 GMT
|
|
10
26
|
|
|
11
27
|
### Minor changes
|
|
12
28
|
|
|
@@ -16,8 +16,10 @@ const ExpandCollapseMini = /*#__PURE__*/_react.default.forwardRef((_ref, ref) =>
|
|
|
16
16
|
onToggle = () => {},
|
|
17
17
|
tokens = {},
|
|
18
18
|
nativeID,
|
|
19
|
+
initialOpen = false,
|
|
19
20
|
...rest
|
|
20
21
|
} = _ref;
|
|
22
|
+
const expandCollapeMiniPanelId = 'ExpandCollapseMiniPanel';
|
|
21
23
|
const handleChange = (openPanels, event) => {
|
|
22
24
|
if (typeof onToggle === 'function') {
|
|
23
25
|
const isOpen = openPanels.length > 0;
|
|
@@ -27,9 +29,10 @@ const ExpandCollapseMini = /*#__PURE__*/_react.default.forwardRef((_ref, ref) =>
|
|
|
27
29
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.ExpandCollapse, {
|
|
28
30
|
onChange: handleChange,
|
|
29
31
|
tokens: tokens,
|
|
32
|
+
initialOpen: initialOpen ? [expandCollapeMiniPanelId] : [],
|
|
30
33
|
children: expandProps => /*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.ExpandCollapse.Panel, {
|
|
31
34
|
...expandProps,
|
|
32
|
-
panelId:
|
|
35
|
+
panelId: expandCollapeMiniPanelId,
|
|
33
36
|
variant: {
|
|
34
37
|
mini: true
|
|
35
38
|
},
|
|
@@ -68,6 +71,10 @@ ExpandCollapseMini.propTypes = {
|
|
|
68
71
|
* Children nodes that can be added
|
|
69
72
|
*/
|
|
70
73
|
children: _propTypes.default.node.isRequired,
|
|
74
|
+
/**
|
|
75
|
+
* Controls if the panel and the content is opened by default on the first load
|
|
76
|
+
*/
|
|
77
|
+
initialOpen: _propTypes.default.bool,
|
|
71
78
|
tokens: (0, _componentsBase.getTokensPropType)('ExpandCollapseMini')
|
|
72
79
|
};
|
|
73
80
|
var _default = ExpandCollapseMini;
|
package/lib/OrderedList/Item.js
CHANGED
|
@@ -20,13 +20,14 @@ const selectItemTextStyles = (_ref, themeOptions) => {
|
|
|
20
20
|
itemFontSize,
|
|
21
21
|
itemLineHeight,
|
|
22
22
|
itemFontName,
|
|
23
|
-
itemColor
|
|
23
|
+
itemColor,
|
|
24
|
+
itemTextColor
|
|
24
25
|
} = _ref;
|
|
25
26
|
return (0, _componentsBase.applyTextStyles)({
|
|
26
27
|
fontWeight: itemFontWeight,
|
|
27
28
|
fontSize: itemFontSize,
|
|
28
29
|
fontName: itemFontName,
|
|
29
|
-
color: itemColor,
|
|
30
|
+
color: itemColor || itemTextColor,
|
|
30
31
|
themeOptions,
|
|
31
32
|
lineHeight: itemLineHeight
|
|
32
33
|
});
|
|
@@ -45,14 +46,15 @@ const StyledItemBase = /*#__PURE__*/(0, _styledComponents.default)(_ItemBase.def
|
|
|
45
46
|
itemLineHeight,
|
|
46
47
|
themeOptions,
|
|
47
48
|
listGutter,
|
|
48
|
-
itemColor
|
|
49
|
+
itemColor,
|
|
50
|
+
itemTextColor
|
|
49
51
|
} = _ref2;
|
|
50
52
|
return {
|
|
51
53
|
counterIncrement: _constants.OL_COUNTER_NAME,
|
|
52
54
|
'::before': {
|
|
53
55
|
content: `counter(${_constants.OL_COUNTER_NAME})'.'`,
|
|
54
56
|
display: 'inline-flex',
|
|
55
|
-
color: itemColor,
|
|
57
|
+
color: itemColor || itemTextColor,
|
|
56
58
|
width: itemBulletContainerWidth,
|
|
57
59
|
paddingRight: listGutter,
|
|
58
60
|
justifyContent: itemBulletTextAlign,
|
|
@@ -90,7 +92,7 @@ const Item = /*#__PURE__*/_react.default.forwardRef((_ref3, ref) => {
|
|
|
90
92
|
const headingTokens = title && {
|
|
91
93
|
lineHeight: themeTokens.itemLineHeight,
|
|
92
94
|
fontSize: themeTokens.itemFontSize,
|
|
93
|
-
color: themeTokens.itemColor,
|
|
95
|
+
color: themeTokens.itemColor || themeTokens.itemTextColor,
|
|
94
96
|
fontName: themeTokens.headerFontName,
|
|
95
97
|
fontWeight: themeTokens.headerFontWeight
|
|
96
98
|
};
|
|
@@ -137,7 +139,7 @@ Item.propTypes = {
|
|
|
137
139
|
/**
|
|
138
140
|
* Item tokens
|
|
139
141
|
*/
|
|
140
|
-
tokens: (0, _componentsBase.getTokensPropType)('
|
|
142
|
+
tokens: (0, _componentsBase.getTokensPropType)('OrderedList')
|
|
141
143
|
};
|
|
142
144
|
var _default = Item;
|
|
143
145
|
exports.default = _default;
|
|
@@ -37,36 +37,42 @@ const OrderedList = /*#__PURE__*/_react.default.forwardRef((_ref2, ref) => {
|
|
|
37
37
|
children,
|
|
38
38
|
start = 1,
|
|
39
39
|
variant = {},
|
|
40
|
+
tokens = {},
|
|
40
41
|
...rest
|
|
41
42
|
} = _ref2;
|
|
42
43
|
// Check if children is an array
|
|
43
44
|
const isChildrenArray = Array.isArray(children);
|
|
44
45
|
|
|
45
|
-
// Pass any variants "OrderedList" receives down to the individual list items.
|
|
46
|
-
const
|
|
47
|
-
const
|
|
48
|
-
var _child$props;
|
|
46
|
+
// Pass any variants and tokens "OrderedList" receives down to the individual list items.
|
|
47
|
+
const childrenWithParentVariantsAndTokens = _react.default.useMemo(() => {
|
|
48
|
+
const addVariantAndTokensToProps = child => {
|
|
49
|
+
var _child$props, _child$props2;
|
|
49
50
|
const existingChildVariants = ((_child$props = child.props) === null || _child$props === void 0 ? void 0 : _child$props.variant) ?? {};
|
|
51
|
+
const existingChildTokens = ((_child$props2 = child.props) === null || _child$props2 === void 0 ? void 0 : _child$props2.tokens) ?? {};
|
|
50
52
|
return /*#__PURE__*/_react.default.cloneElement(child, {
|
|
51
53
|
variant: {
|
|
52
54
|
...existingChildVariants,
|
|
53
55
|
...variant
|
|
56
|
+
},
|
|
57
|
+
tokens: {
|
|
58
|
+
...existingChildTokens,
|
|
59
|
+
...tokens
|
|
54
60
|
}
|
|
55
61
|
});
|
|
56
62
|
};
|
|
57
|
-
if (variant) {
|
|
63
|
+
if (variant || tokens) {
|
|
58
64
|
if (isChildrenArray) {
|
|
59
|
-
return children.map(
|
|
65
|
+
return children.map(addVariantAndTokensToProps);
|
|
60
66
|
}
|
|
61
|
-
return [
|
|
67
|
+
return [addVariantAndTokensToProps(children)];
|
|
62
68
|
}
|
|
63
69
|
return children;
|
|
64
|
-
}, [children, variant, isChildrenArray]);
|
|
70
|
+
}, [children, variant, isChildrenArray, tokens]);
|
|
65
71
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledOrderedListBase, {
|
|
66
72
|
...selectProps(rest),
|
|
67
73
|
ref: ref,
|
|
68
74
|
start: start,
|
|
69
|
-
children:
|
|
75
|
+
children: childrenWithParentVariantsAndTokens
|
|
70
76
|
});
|
|
71
77
|
});
|
|
72
78
|
OrderedList.displayName = 'OrderedList';
|
|
@@ -80,7 +86,8 @@ OrderedList.propTypes = {
|
|
|
80
86
|
* The position to start the list with.
|
|
81
87
|
*/
|
|
82
88
|
start: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
|
|
83
|
-
variant: _componentsBase.variantProp.propType
|
|
89
|
+
variant: _componentsBase.variantProp.propType,
|
|
90
|
+
tokens: (0, _componentsBase.getTokensPropType)('OrderedList')
|
|
84
91
|
};
|
|
85
92
|
OrderedList.Item = _Item.default;
|
|
86
93
|
var _default = OrderedList;
|
|
@@ -7,26 +7,26 @@ exports.default = void 0;
|
|
|
7
7
|
var _default = {
|
|
8
8
|
en: {
|
|
9
9
|
accessibility: {
|
|
10
|
-
a11yLabel: 'Quantity
|
|
11
|
-
increaseButton: 'Increase quantity
|
|
12
|
-
decreaseButton: 'Decrease quantity
|
|
10
|
+
a11yLabel: 'Quantity selector',
|
|
11
|
+
increaseButton: 'Increase quantity',
|
|
12
|
+
decreaseButton: 'Decrease quantity'
|
|
13
13
|
},
|
|
14
14
|
errors: {
|
|
15
|
-
numberIsTooSmall: minNumber => `
|
|
16
|
-
numberIsTooBig: maxNumber => `
|
|
17
|
-
invalidCharacters: '
|
|
15
|
+
numberIsTooSmall: minNumber => `You can enter a number equal or greater than ${minNumber}.`,
|
|
16
|
+
numberIsTooBig: maxNumber => `You can enter a number equal or less than ${maxNumber}.`,
|
|
17
|
+
invalidCharacters: 'Try using numbers only. Alphabetical or symbols characters are not allowed.'
|
|
18
18
|
}
|
|
19
19
|
},
|
|
20
20
|
fr: {
|
|
21
21
|
accessibility: {
|
|
22
|
-
a11yLabel: '
|
|
23
|
-
increaseButton: `
|
|
24
|
-
decreaseButton: `
|
|
22
|
+
a11yLabel: 'Sélecteur de quantité',
|
|
23
|
+
increaseButton: `Augmenter la quantité`,
|
|
24
|
+
decreaseButton: `Réduire la quantité`
|
|
25
25
|
},
|
|
26
26
|
errors: {
|
|
27
|
-
numberIsTooSmall: minNumber => `
|
|
28
|
-
numberIsTooBig: maxNumber => `
|
|
29
|
-
invalidCharacters: `
|
|
27
|
+
numberIsTooSmall: minNumber => `Vous pouvez saisir un nombre égal ou supérieur à ${minNumber}.`,
|
|
28
|
+
numberIsTooBig: maxNumber => `Vous pouvez saisir un nombre égal ou inférieur à ${maxNumber}.`,
|
|
29
|
+
invalidCharacters: `Essayez d'utiliser seulement des chiffres. Les caractères alphabétiques ou les symboles ne sont pas permis.`
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
32
|
};
|
package/lib/Ribbon/Ribbon.js
CHANGED
|
@@ -70,7 +70,7 @@ const RibbonContainer = /*#__PURE__*/_styledComponents.default.div.withConfig({
|
|
|
70
70
|
const RibbonCurve = /*#__PURE__*/_styledComponents.default.div.withConfig({
|
|
71
71
|
displayName: "Ribbon__RibbonCurve",
|
|
72
72
|
componentId: "components-web__sc-186270k-2"
|
|
73
|
-
})(["background:", ";width:", ";height:", ";margin-top:-", ";border-radius:0 0 0 100%;position:relative;z-index:-1;&::after{content:'';border-bottom-left-radius:", ";position:absolute;height:", ";background:", ";width:", ";}"], _ref10 => {
|
|
73
|
+
})(["background:", ";width:", ";height:", ";margin-top:-", ";border-radius:0 0 0 100%;position:relative;z-index:-1;overflow:hidden;&::after{content:'';border-bottom-left-radius:", ";position:absolute;height:", ";background:", ";width:", ";}"], _ref10 => {
|
|
74
74
|
let {
|
|
75
75
|
curveBackgroundColor
|
|
76
76
|
} = _ref10;
|
|
@@ -9,8 +9,10 @@ const ExpandCollapseMini = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
9
9
|
onToggle = () => {},
|
|
10
10
|
tokens = {},
|
|
11
11
|
nativeID,
|
|
12
|
+
initialOpen = false,
|
|
12
13
|
...rest
|
|
13
14
|
} = _ref;
|
|
15
|
+
const expandCollapeMiniPanelId = 'ExpandCollapseMiniPanel';
|
|
14
16
|
const handleChange = (openPanels, event) => {
|
|
15
17
|
if (typeof onToggle === 'function') {
|
|
16
18
|
const isOpen = openPanels.length > 0;
|
|
@@ -20,9 +22,10 @@ const ExpandCollapseMini = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
20
22
|
return /*#__PURE__*/_jsx(ExpandCollapse, {
|
|
21
23
|
onChange: handleChange,
|
|
22
24
|
tokens: tokens,
|
|
25
|
+
initialOpen: initialOpen ? [expandCollapeMiniPanelId] : [],
|
|
23
26
|
children: expandProps => /*#__PURE__*/_jsx(ExpandCollapse.Panel, {
|
|
24
27
|
...expandProps,
|
|
25
|
-
panelId:
|
|
28
|
+
panelId: expandCollapeMiniPanelId,
|
|
26
29
|
variant: {
|
|
27
30
|
mini: true
|
|
28
31
|
},
|
|
@@ -61,6 +64,10 @@ ExpandCollapseMini.propTypes = {
|
|
|
61
64
|
* Children nodes that can be added
|
|
62
65
|
*/
|
|
63
66
|
children: PropTypes.node.isRequired,
|
|
67
|
+
/**
|
|
68
|
+
* Controls if the panel and the content is opened by default on the first load
|
|
69
|
+
*/
|
|
70
|
+
initialOpen: PropTypes.bool,
|
|
64
71
|
tokens: getTokensPropType('ExpandCollapseMini')
|
|
65
72
|
};
|
|
66
73
|
export default ExpandCollapseMini;
|
|
@@ -14,13 +14,14 @@ const selectItemTextStyles = (_ref, themeOptions) => {
|
|
|
14
14
|
itemFontSize,
|
|
15
15
|
itemLineHeight,
|
|
16
16
|
itemFontName,
|
|
17
|
-
itemColor
|
|
17
|
+
itemColor,
|
|
18
|
+
itemTextColor
|
|
18
19
|
} = _ref;
|
|
19
20
|
return applyTextStyles({
|
|
20
21
|
fontWeight: itemFontWeight,
|
|
21
22
|
fontSize: itemFontSize,
|
|
22
23
|
fontName: itemFontName,
|
|
23
|
-
color: itemColor,
|
|
24
|
+
color: itemColor || itemTextColor,
|
|
24
25
|
themeOptions,
|
|
25
26
|
lineHeight: itemLineHeight
|
|
26
27
|
});
|
|
@@ -39,14 +40,15 @@ const StyledItemBase = /*#__PURE__*/styled(ItemBase).withConfig({
|
|
|
39
40
|
itemLineHeight,
|
|
40
41
|
themeOptions,
|
|
41
42
|
listGutter,
|
|
42
|
-
itemColor
|
|
43
|
+
itemColor,
|
|
44
|
+
itemTextColor
|
|
43
45
|
} = _ref2;
|
|
44
46
|
return {
|
|
45
47
|
counterIncrement: OL_COUNTER_NAME,
|
|
46
48
|
'::before': {
|
|
47
49
|
content: `counter(${OL_COUNTER_NAME})'.'`,
|
|
48
50
|
display: 'inline-flex',
|
|
49
|
-
color: itemColor,
|
|
51
|
+
color: itemColor || itemTextColor,
|
|
50
52
|
width: itemBulletContainerWidth,
|
|
51
53
|
paddingRight: listGutter,
|
|
52
54
|
justifyContent: itemBulletTextAlign,
|
|
@@ -84,7 +86,7 @@ const Item = /*#__PURE__*/React.forwardRef((_ref3, ref) => {
|
|
|
84
86
|
const headingTokens = title && {
|
|
85
87
|
lineHeight: themeTokens.itemLineHeight,
|
|
86
88
|
fontSize: themeTokens.itemFontSize,
|
|
87
|
-
color: themeTokens.itemColor,
|
|
89
|
+
color: themeTokens.itemColor || themeTokens.itemTextColor,
|
|
88
90
|
fontName: themeTokens.headerFontName,
|
|
89
91
|
fontWeight: themeTokens.headerFontWeight
|
|
90
92
|
};
|
|
@@ -131,6 +133,6 @@ Item.propTypes = {
|
|
|
131
133
|
/**
|
|
132
134
|
* Item tokens
|
|
133
135
|
*/
|
|
134
|
-
tokens: getTokensPropType('
|
|
136
|
+
tokens: getTokensPropType('OrderedList')
|
|
135
137
|
};
|
|
136
138
|
export default Item;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import styled from 'styled-components';
|
|
4
|
-
import { selectSystemProps, variantProp } from '@telus-uds/components-base';
|
|
4
|
+
import { getTokensPropType, selectSystemProps, variantProp } from '@telus-uds/components-base';
|
|
5
5
|
import { htmlAttrs } from '../utils';
|
|
6
6
|
import OrderedListBase from './OrderedListBase';
|
|
7
7
|
import Item from './Item';
|
|
@@ -30,36 +30,42 @@ const OrderedList = /*#__PURE__*/React.forwardRef((_ref2, ref) => {
|
|
|
30
30
|
children,
|
|
31
31
|
start = 1,
|
|
32
32
|
variant = {},
|
|
33
|
+
tokens = {},
|
|
33
34
|
...rest
|
|
34
35
|
} = _ref2;
|
|
35
36
|
// Check if children is an array
|
|
36
37
|
const isChildrenArray = Array.isArray(children);
|
|
37
38
|
|
|
38
|
-
// Pass any variants "OrderedList" receives down to the individual list items.
|
|
39
|
-
const
|
|
40
|
-
const
|
|
41
|
-
var _child$props;
|
|
39
|
+
// Pass any variants and tokens "OrderedList" receives down to the individual list items.
|
|
40
|
+
const childrenWithParentVariantsAndTokens = React.useMemo(() => {
|
|
41
|
+
const addVariantAndTokensToProps = child => {
|
|
42
|
+
var _child$props, _child$props2;
|
|
42
43
|
const existingChildVariants = ((_child$props = child.props) === null || _child$props === void 0 ? void 0 : _child$props.variant) ?? {};
|
|
44
|
+
const existingChildTokens = ((_child$props2 = child.props) === null || _child$props2 === void 0 ? void 0 : _child$props2.tokens) ?? {};
|
|
43
45
|
return /*#__PURE__*/React.cloneElement(child, {
|
|
44
46
|
variant: {
|
|
45
47
|
...existingChildVariants,
|
|
46
48
|
...variant
|
|
49
|
+
},
|
|
50
|
+
tokens: {
|
|
51
|
+
...existingChildTokens,
|
|
52
|
+
...tokens
|
|
47
53
|
}
|
|
48
54
|
});
|
|
49
55
|
};
|
|
50
|
-
if (variant) {
|
|
56
|
+
if (variant || tokens) {
|
|
51
57
|
if (isChildrenArray) {
|
|
52
|
-
return children.map(
|
|
58
|
+
return children.map(addVariantAndTokensToProps);
|
|
53
59
|
}
|
|
54
|
-
return [
|
|
60
|
+
return [addVariantAndTokensToProps(children)];
|
|
55
61
|
}
|
|
56
62
|
return children;
|
|
57
|
-
}, [children, variant, isChildrenArray]);
|
|
63
|
+
}, [children, variant, isChildrenArray, tokens]);
|
|
58
64
|
return /*#__PURE__*/_jsx(StyledOrderedListBase, {
|
|
59
65
|
...selectProps(rest),
|
|
60
66
|
ref: ref,
|
|
61
67
|
start: start,
|
|
62
|
-
children:
|
|
68
|
+
children: childrenWithParentVariantsAndTokens
|
|
63
69
|
});
|
|
64
70
|
});
|
|
65
71
|
OrderedList.displayName = 'OrderedList';
|
|
@@ -73,7 +79,8 @@ OrderedList.propTypes = {
|
|
|
73
79
|
* The position to start the list with.
|
|
74
80
|
*/
|
|
75
81
|
start: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
76
|
-
variant: variantProp.propType
|
|
82
|
+
variant: variantProp.propType,
|
|
83
|
+
tokens: getTokensPropType('OrderedList')
|
|
77
84
|
};
|
|
78
85
|
OrderedList.Item = Item;
|
|
79
86
|
export default OrderedList;
|
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
export default {
|
|
2
2
|
en: {
|
|
3
3
|
accessibility: {
|
|
4
|
-
a11yLabel: 'Quantity
|
|
5
|
-
increaseButton: 'Increase quantity
|
|
6
|
-
decreaseButton: 'Decrease quantity
|
|
4
|
+
a11yLabel: 'Quantity selector',
|
|
5
|
+
increaseButton: 'Increase quantity',
|
|
6
|
+
decreaseButton: 'Decrease quantity'
|
|
7
7
|
},
|
|
8
8
|
errors: {
|
|
9
|
-
numberIsTooSmall: minNumber => `
|
|
10
|
-
numberIsTooBig: maxNumber => `
|
|
11
|
-
invalidCharacters: '
|
|
9
|
+
numberIsTooSmall: minNumber => `You can enter a number equal or greater than ${minNumber}.`,
|
|
10
|
+
numberIsTooBig: maxNumber => `You can enter a number equal or less than ${maxNumber}.`,
|
|
11
|
+
invalidCharacters: 'Try using numbers only. Alphabetical or symbols characters are not allowed.'
|
|
12
12
|
}
|
|
13
13
|
},
|
|
14
14
|
fr: {
|
|
15
15
|
accessibility: {
|
|
16
|
-
a11yLabel: '
|
|
17
|
-
increaseButton: `
|
|
18
|
-
decreaseButton: `
|
|
16
|
+
a11yLabel: 'Sélecteur de quantité',
|
|
17
|
+
increaseButton: `Augmenter la quantité`,
|
|
18
|
+
decreaseButton: `Réduire la quantité`
|
|
19
19
|
},
|
|
20
20
|
errors: {
|
|
21
|
-
numberIsTooSmall: minNumber => `
|
|
22
|
-
numberIsTooBig: maxNumber => `
|
|
23
|
-
invalidCharacters: `
|
|
21
|
+
numberIsTooSmall: minNumber => `Vous pouvez saisir un nombre égal ou supérieur à ${minNumber}.`,
|
|
22
|
+
numberIsTooBig: maxNumber => `Vous pouvez saisir un nombre égal ou inférieur à ${maxNumber}.`,
|
|
23
|
+
invalidCharacters: `Essayez d'utiliser seulement des chiffres. Les caractères alphabétiques ou les symboles ne sont pas permis.`
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
};
|
|
@@ -64,7 +64,7 @@ const RibbonContainer = /*#__PURE__*/styled.div.withConfig({
|
|
|
64
64
|
const RibbonCurve = /*#__PURE__*/styled.div.withConfig({
|
|
65
65
|
displayName: "Ribbon__RibbonCurve",
|
|
66
66
|
componentId: "components-web__sc-186270k-2"
|
|
67
|
-
})(["background:", ";width:", ";height:", ";margin-top:-", ";border-radius:0 0 0 100%;position:relative;z-index:-1;&::after{content:'';border-bottom-left-radius:", ";position:absolute;height:", ";background:", ";width:", ";}"], _ref10 => {
|
|
67
|
+
})(["background:", ";width:", ";height:", ";margin-top:-", ";border-radius:0 0 0 100%;position:relative;z-index:-1;overflow:hidden;&::after{content:'';border-bottom-left-radius:", ";position:absolute;height:", ";background:", ";width:", ";}"], _ref10 => {
|
|
68
68
|
let {
|
|
69
69
|
curveBackgroundColor
|
|
70
70
|
} = _ref10;
|
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.91.0",
|
|
9
9
|
"@telus-uds/system-constants": "^1.3.0",
|
|
10
10
|
"fscreen": "^1.2.0",
|
|
11
11
|
"lodash.omit": "^4.5.0",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"react-dates": "^21.8.0",
|
|
14
14
|
"react-helmet-async": "^1.3.0",
|
|
15
15
|
"react-moment-proptypes": "^1.8.1",
|
|
16
|
-
"@telus-uds/system-theme-tokens": "^2.
|
|
16
|
+
"@telus-uds/system-theme-tokens": "^2.61.0",
|
|
17
17
|
"prop-types": "^15.7.2",
|
|
18
18
|
"lodash.throttle": "^4.1.1",
|
|
19
19
|
"react-youtube": "^10.1.0",
|
|
@@ -83,5 +83,5 @@
|
|
|
83
83
|
"skip": true
|
|
84
84
|
},
|
|
85
85
|
"types": "types/index.d.ts",
|
|
86
|
-
"version": "2.
|
|
86
|
+
"version": "2.38.0"
|
|
87
87
|
}
|
|
@@ -4,7 +4,8 @@ import { ExpandCollapse, getTokensPropType } from '@telus-uds/components-base'
|
|
|
4
4
|
import ExpandCollapseMiniControl from './ExpandCollapseMiniControl'
|
|
5
5
|
|
|
6
6
|
const ExpandCollapseMini = React.forwardRef(
|
|
7
|
-
({ children, onToggle = () => {}, tokens = {}, nativeID, ...rest }, ref) => {
|
|
7
|
+
({ children, onToggle = () => {}, tokens = {}, nativeID, initialOpen = false, ...rest }, ref) => {
|
|
8
|
+
const expandCollapeMiniPanelId = 'ExpandCollapseMiniPanel'
|
|
8
9
|
const handleChange = (openPanels, event) => {
|
|
9
10
|
if (typeof onToggle === 'function') {
|
|
10
11
|
const isOpen = openPanels.length > 0
|
|
@@ -13,11 +14,15 @@ const ExpandCollapseMini = React.forwardRef(
|
|
|
13
14
|
}
|
|
14
15
|
|
|
15
16
|
return (
|
|
16
|
-
<ExpandCollapse
|
|
17
|
+
<ExpandCollapse
|
|
18
|
+
onChange={handleChange}
|
|
19
|
+
tokens={tokens}
|
|
20
|
+
initialOpen={initialOpen ? [expandCollapeMiniPanelId] : []}
|
|
21
|
+
>
|
|
17
22
|
{(expandProps) => (
|
|
18
23
|
<ExpandCollapse.Panel
|
|
19
24
|
{...expandProps}
|
|
20
|
-
panelId=
|
|
25
|
+
panelId={expandCollapeMiniPanelId}
|
|
21
26
|
variant={{ mini: true }}
|
|
22
27
|
controlTokens={{
|
|
23
28
|
// Remove unwanted look and feel from ExpandCollapse(background pressed, focus border and text underline)
|
|
@@ -57,6 +62,10 @@ ExpandCollapseMini.propTypes = {
|
|
|
57
62
|
* Children nodes that can be added
|
|
58
63
|
*/
|
|
59
64
|
children: PropTypes.node.isRequired,
|
|
65
|
+
/**
|
|
66
|
+
* Controls if the panel and the content is opened by default on the first load
|
|
67
|
+
*/
|
|
68
|
+
initialOpen: PropTypes.bool,
|
|
60
69
|
tokens: getTokensPropType('ExpandCollapseMini')
|
|
61
70
|
}
|
|
62
71
|
|
package/src/OrderedList/Item.jsx
CHANGED
|
@@ -18,14 +18,14 @@ import { OL_COUNTER_NAME } from './constants'
|
|
|
18
18
|
const [selectProps, selectedSystemPropTypes] = selectSystemProps([htmlAttrs])
|
|
19
19
|
|
|
20
20
|
const selectItemTextStyles = (
|
|
21
|
-
{ itemFontWeight, itemFontSize, itemLineHeight, itemFontName, itemColor },
|
|
21
|
+
{ itemFontWeight, itemFontSize, itemLineHeight, itemFontName, itemColor, itemTextColor },
|
|
22
22
|
themeOptions
|
|
23
23
|
) =>
|
|
24
24
|
applyTextStyles({
|
|
25
25
|
fontWeight: itemFontWeight,
|
|
26
26
|
fontSize: itemFontSize,
|
|
27
27
|
fontName: itemFontName,
|
|
28
|
-
color: itemColor,
|
|
28
|
+
color: itemColor || itemTextColor,
|
|
29
29
|
themeOptions,
|
|
30
30
|
lineHeight: itemLineHeight
|
|
31
31
|
})
|
|
@@ -41,13 +41,14 @@ const StyledItemBase = styled(ItemBase)(
|
|
|
41
41
|
itemLineHeight,
|
|
42
42
|
themeOptions,
|
|
43
43
|
listGutter,
|
|
44
|
-
itemColor
|
|
44
|
+
itemColor,
|
|
45
|
+
itemTextColor
|
|
45
46
|
}) => ({
|
|
46
47
|
counterIncrement: OL_COUNTER_NAME,
|
|
47
48
|
'::before': {
|
|
48
49
|
content: `counter(${OL_COUNTER_NAME})'.'`,
|
|
49
50
|
display: 'inline-flex',
|
|
50
|
-
color: itemColor,
|
|
51
|
+
color: itemColor || itemTextColor,
|
|
51
52
|
width: itemBulletContainerWidth,
|
|
52
53
|
paddingRight: listGutter,
|
|
53
54
|
justifyContent: itemBulletTextAlign,
|
|
@@ -75,7 +76,7 @@ const Item = React.forwardRef(
|
|
|
75
76
|
const headingTokens = title && {
|
|
76
77
|
lineHeight: themeTokens.itemLineHeight,
|
|
77
78
|
fontSize: themeTokens.itemFontSize,
|
|
78
|
-
color: themeTokens.itemColor,
|
|
79
|
+
color: themeTokens.itemColor || themeTokens.itemTextColor,
|
|
79
80
|
fontName: themeTokens.headerFontName,
|
|
80
81
|
fontWeight: themeTokens.headerFontWeight
|
|
81
82
|
}
|
|
@@ -117,7 +118,7 @@ Item.propTypes = {
|
|
|
117
118
|
/**
|
|
118
119
|
* Item tokens
|
|
119
120
|
*/
|
|
120
|
-
tokens: getTokensPropType('
|
|
121
|
+
tokens: getTokensPropType('OrderedList')
|
|
121
122
|
}
|
|
122
123
|
|
|
123
124
|
export default Item
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import PropTypes from 'prop-types'
|
|
3
3
|
import styled from 'styled-components'
|
|
4
|
-
import { selectSystemProps, variantProp } from '@telus-uds/components-base'
|
|
4
|
+
import { getTokensPropType, selectSystemProps, variantProp } from '@telus-uds/components-base'
|
|
5
5
|
import { htmlAttrs } from '../utils'
|
|
6
6
|
import OrderedListBase from './OrderedListBase'
|
|
7
7
|
import Item from './Item'
|
|
@@ -18,38 +18,40 @@ const StyledOrderedListBase = styled(OrderedListBase)(({ start }) => ({
|
|
|
18
18
|
/**
|
|
19
19
|
* Themed semantic ordered list.
|
|
20
20
|
*/
|
|
21
|
-
const OrderedList = React.forwardRef(
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
const OrderedList = React.forwardRef(
|
|
22
|
+
({ children, start = 1, variant = {}, tokens = {}, ...rest }, ref) => {
|
|
23
|
+
// Check if children is an array
|
|
24
|
+
const isChildrenArray = Array.isArray(children)
|
|
24
25
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
...variant
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
26
|
+
// Pass any variants and tokens "OrderedList" receives down to the individual list items.
|
|
27
|
+
const childrenWithParentVariantsAndTokens = React.useMemo(() => {
|
|
28
|
+
const addVariantAndTokensToProps = (child) => {
|
|
29
|
+
const existingChildVariants = child.props?.variant ?? {}
|
|
30
|
+
const existingChildTokens = child.props?.tokens ?? {}
|
|
31
|
+
|
|
32
|
+
return React.cloneElement(child, {
|
|
33
|
+
variant: { ...existingChildVariants, ...variant },
|
|
34
|
+
tokens: { ...existingChildTokens, ...tokens }
|
|
35
|
+
})
|
|
36
|
+
}
|
|
36
37
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
if (variant || tokens) {
|
|
39
|
+
if (isChildrenArray) {
|
|
40
|
+
return children.map(addVariantAndTokensToProps)
|
|
41
|
+
}
|
|
42
|
+
return [addVariantAndTokensToProps(children)]
|
|
40
43
|
}
|
|
41
|
-
return [addVariantToProps(children)]
|
|
42
|
-
}
|
|
43
44
|
|
|
44
|
-
|
|
45
|
-
|
|
45
|
+
return children
|
|
46
|
+
}, [children, variant, isChildrenArray, tokens])
|
|
46
47
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
}
|
|
48
|
+
return (
|
|
49
|
+
<StyledOrderedListBase {...selectProps(rest)} ref={ref} start={start}>
|
|
50
|
+
{childrenWithParentVariantsAndTokens}
|
|
51
|
+
</StyledOrderedListBase>
|
|
52
|
+
)
|
|
53
|
+
}
|
|
54
|
+
)
|
|
53
55
|
OrderedList.displayName = 'OrderedList'
|
|
54
56
|
|
|
55
57
|
OrderedList.propTypes = {
|
|
@@ -62,7 +64,8 @@ OrderedList.propTypes = {
|
|
|
62
64
|
* The position to start the list with.
|
|
63
65
|
*/
|
|
64
66
|
start: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
65
|
-
variant: variantProp.propType
|
|
67
|
+
variant: variantProp.propType,
|
|
68
|
+
tokens: getTokensPropType('OrderedList')
|
|
66
69
|
}
|
|
67
70
|
|
|
68
71
|
OrderedList.Item = Item
|
|
@@ -1,27 +1,29 @@
|
|
|
1
1
|
export default {
|
|
2
2
|
en: {
|
|
3
3
|
accessibility: {
|
|
4
|
-
a11yLabel: 'Quantity
|
|
5
|
-
increaseButton: 'Increase quantity
|
|
6
|
-
decreaseButton: 'Decrease quantity
|
|
4
|
+
a11yLabel: 'Quantity selector',
|
|
5
|
+
increaseButton: 'Increase quantity',
|
|
6
|
+
decreaseButton: 'Decrease quantity'
|
|
7
7
|
},
|
|
8
8
|
errors: {
|
|
9
|
-
numberIsTooSmall: (minNumber) => `
|
|
10
|
-
numberIsTooBig: (maxNumber) => `
|
|
9
|
+
numberIsTooSmall: (minNumber) => `You can enter a number equal or greater than ${minNumber}.`,
|
|
10
|
+
numberIsTooBig: (maxNumber) => `You can enter a number equal or less than ${maxNumber}.`,
|
|
11
11
|
invalidCharacters:
|
|
12
|
-
'
|
|
12
|
+
'Try using numbers only. Alphabetical or symbols characters are not allowed.'
|
|
13
13
|
}
|
|
14
14
|
},
|
|
15
15
|
fr: {
|
|
16
16
|
accessibility: {
|
|
17
|
-
a11yLabel: '
|
|
18
|
-
increaseButton: `
|
|
19
|
-
decreaseButton: `
|
|
17
|
+
a11yLabel: 'Sélecteur de quantité',
|
|
18
|
+
increaseButton: `Augmenter la quantité`,
|
|
19
|
+
decreaseButton: `Réduire la quantité`
|
|
20
20
|
},
|
|
21
21
|
errors: {
|
|
22
|
-
numberIsTooSmall: (minNumber) =>
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
numberIsTooSmall: (minNumber) =>
|
|
23
|
+
`Vous pouvez saisir un nombre égal ou supérieur à ${minNumber}.`,
|
|
24
|
+
numberIsTooBig: (maxNumber) =>
|
|
25
|
+
`Vous pouvez saisir un nombre égal ou inférieur à ${maxNumber}.`,
|
|
26
|
+
invalidCharacters: `Essayez d'utiliser seulement des chiffres. Les caractères alphabétiques ou les symboles ne sont pas permis.`
|
|
25
27
|
}
|
|
26
28
|
}
|
|
27
29
|
}
|
package/src/Ribbon/Ribbon.jsx
CHANGED