@telus-uds/components-base 1.83.0 → 1.84.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 +20 -2
- package/lib/Button/ButtonGroup.js +9 -0
- package/lib/Carousel/Carousel.js +314 -145
- package/lib/ExpandCollapse/ExpandCollapse.js +18 -9
- package/lib/ExpandCollapse/Panel.js +12 -0
- package/lib/ExpandCollapse/dictionary.js +17 -0
- package/lib/Icon/IconText.js +3 -3
- package/lib/Modal/WebModal.js +5 -3
- package/lib-module/Button/ButtonGroup.js +9 -0
- package/lib-module/Carousel/Carousel.js +312 -145
- package/lib-module/ExpandCollapse/ExpandCollapse.js +18 -9
- package/lib-module/ExpandCollapse/Panel.js +13 -1
- package/lib-module/ExpandCollapse/dictionary.js +10 -0
- package/lib-module/Icon/IconText.js +3 -3
- package/lib-module/Modal/WebModal.js +5 -3
- package/package.json +2 -2
- package/src/Button/ButtonGroup.jsx +9 -0
- package/src/Carousel/Carousel.jsx +338 -133
- package/src/ExpandCollapse/ExpandCollapse.jsx +13 -5
- package/src/ExpandCollapse/Panel.jsx +27 -5
- package/src/ExpandCollapse/dictionary.js +10 -0
- package/src/Icon/IconText.jsx +5 -3
- package/src/Modal/WebModal.jsx +8 -4
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
8
8
|
var _View = _interopRequireDefault(require("react-native-web/dist/cjs/exports/View"));
|
|
9
|
+
var _StyleSheet = _interopRequireDefault(require("react-native-web/dist/cjs/exports/StyleSheet"));
|
|
9
10
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
10
11
|
var _ThemeProvider = require("../ThemeProvider");
|
|
11
12
|
var _utils = require("../utils");
|
|
@@ -54,16 +55,19 @@ const ExpandCollapse = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
|
54
55
|
});
|
|
55
56
|
const themeTokens = (0, _ThemeProvider.useThemeTokens)('ExpandCollapse', tokens, variant);
|
|
56
57
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, {
|
|
58
|
+
style: staticStyles.container,
|
|
57
59
|
ref: ref,
|
|
58
|
-
style: selectBorderStyles(themeTokens),
|
|
59
60
|
...selectProps(rest),
|
|
60
|
-
children:
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
61
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, {
|
|
62
|
+
style: selectBorderStyles(themeTokens),
|
|
63
|
+
children: typeof children === 'function' ? children({
|
|
64
|
+
openIds,
|
|
65
|
+
onToggle,
|
|
66
|
+
resetValues,
|
|
67
|
+
setValues,
|
|
68
|
+
unsetValues
|
|
69
|
+
}) : children
|
|
70
|
+
})
|
|
67
71
|
});
|
|
68
72
|
});
|
|
69
73
|
ExpandCollapse.displayName = 'ExpandCollapse';
|
|
@@ -96,4 +100,9 @@ ExpandCollapse.propTypes = {
|
|
|
96
100
|
initialOpen: _propTypes.default.arrayOf(_propTypes.default.string)
|
|
97
101
|
};
|
|
98
102
|
var _default = ExpandCollapse;
|
|
99
|
-
exports.default = _default;
|
|
103
|
+
exports.default = _default;
|
|
104
|
+
const staticStyles = _StyleSheet.default.create({
|
|
105
|
+
container: {
|
|
106
|
+
display: 'flex'
|
|
107
|
+
}
|
|
108
|
+
});
|
|
@@ -14,6 +14,7 @@ var _airbnbPropTypes = _interopRequireDefault(require("airbnb-prop-types"));
|
|
|
14
14
|
var _Control = _interopRequireDefault(require("./Control"));
|
|
15
15
|
var _ThemeProvider = require("../ThemeProvider");
|
|
16
16
|
var _utils = require("../utils");
|
|
17
|
+
var _dictionary = _interopRequireDefault(require("./dictionary"));
|
|
17
18
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
18
19
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
20
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
@@ -108,10 +109,15 @@ const ExpandCollapsePanel = /*#__PURE__*/(0, _react.forwardRef)((_ref5, ref) =>
|
|
|
108
109
|
variant,
|
|
109
110
|
controlRef,
|
|
110
111
|
content,
|
|
112
|
+
copy = 'en',
|
|
111
113
|
...rest
|
|
112
114
|
} = _ref5;
|
|
113
115
|
const [containerHeight, setContainerHeight] = (0, _react.useState)(null);
|
|
114
116
|
const isExpanded = openIds.includes(panelId);
|
|
117
|
+
const getCopy = (0, _utils.useCopy)({
|
|
118
|
+
dictionary: _dictionary.default,
|
|
119
|
+
copy
|
|
120
|
+
});
|
|
115
121
|
const selectedProps = selectProps({
|
|
116
122
|
...rest,
|
|
117
123
|
accessibilityState: {
|
|
@@ -142,15 +148,20 @@ const ExpandCollapsePanel = /*#__PURE__*/(0, _react.forwardRef)((_ref5, ref) =>
|
|
|
142
148
|
tokens: themeTokens
|
|
143
149
|
});
|
|
144
150
|
const focusabilityProps = isExpanded ? {} : _utils.a11yProps.nonFocusableProps;
|
|
151
|
+
const panelAccessibilityLabel = `${panelId} ${getCopy('panel')}`;
|
|
152
|
+
const subPanelAccessibilityLabel = `${panelId} ${getCopy('subPanel')}`;
|
|
145
153
|
return content ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, {
|
|
146
154
|
style: selectContentPanelStyles(themeTokens),
|
|
155
|
+
accessibilityLabel: panelAccessibilityLabel,
|
|
147
156
|
children: typeof children === 'string' ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Text.default, {
|
|
148
157
|
style: selectTextStyles(themeTokens),
|
|
158
|
+
accessibilityLabel: subPanelAccessibilityLabel,
|
|
149
159
|
children: children
|
|
150
160
|
}) : children
|
|
151
161
|
}) : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_View.default, {
|
|
152
162
|
ref: ref,
|
|
153
163
|
style: themeTokens,
|
|
164
|
+
accessibilityLabel: panelAccessibilityLabel,
|
|
154
165
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, {
|
|
155
166
|
style: selectControlPanelStyles(themeTokens),
|
|
156
167
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Control.default, {
|
|
@@ -185,6 +196,7 @@ const ExpandCollapsePanel = /*#__PURE__*/(0, _react.forwardRef)((_ref5, ref) =>
|
|
|
185
196
|
},
|
|
186
197
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, {
|
|
187
198
|
style: selectContainerStyles(themeTokens),
|
|
199
|
+
accessibilityLabel: subPanelAccessibilityLabel,
|
|
188
200
|
children: children
|
|
189
201
|
})
|
|
190
202
|
})
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _default = {
|
|
8
|
+
en: {
|
|
9
|
+
panel: 'Panel',
|
|
10
|
+
subPanel: 'SubPanel'
|
|
11
|
+
},
|
|
12
|
+
fr: {
|
|
13
|
+
panel: 'Panneau',
|
|
14
|
+
subPanel: 'Sous-Panneau'
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
exports.default = _default;
|
package/lib/Icon/IconText.js
CHANGED
|
@@ -48,10 +48,10 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
48
48
|
* The issue was mainly on IOS, the translateY style didn't match with the old calculations.
|
|
49
49
|
*/
|
|
50
50
|
const resultY = valueTranslateY ? Math.floor(-1 * (valueTranslateY - 4)) : 0;
|
|
51
|
-
const
|
|
51
|
+
const iconAdjustedAndroid = /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, {
|
|
52
52
|
style: {
|
|
53
53
|
transform: [{
|
|
54
|
-
translateY: size * 0.2
|
|
54
|
+
translateY: valueTranslateY ? size * 0.2 : size * 0.01
|
|
55
55
|
}]
|
|
56
56
|
},
|
|
57
57
|
children: iconContent
|
|
@@ -64,7 +64,7 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
64
64
|
},
|
|
65
65
|
children: iconContent
|
|
66
66
|
});
|
|
67
|
-
const mobile = _Platform.default.OS === 'android' ?
|
|
67
|
+
const mobile = _Platform.default.OS === 'android' ? iconAdjustedAndroid : iconAdjustedIOS;
|
|
68
68
|
const adjustedContainer = _Platform.default.OS === 'web' ? iconContent : mobile;
|
|
69
69
|
return (0, _StackView.getStackedContent)(iconPosition === 'left' ? [adjustedContainer, children] : [children, adjustedContainer], {
|
|
70
70
|
space,
|
package/lib/Modal/WebModal.js
CHANGED
|
@@ -31,6 +31,7 @@ const WebModal = _ref => {
|
|
|
31
31
|
...selectProps(rest),
|
|
32
32
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, {
|
|
33
33
|
style: staticStyles.content,
|
|
34
|
+
accessibilityRole: "dialog",
|
|
34
35
|
children: children
|
|
35
36
|
})
|
|
36
37
|
});
|
|
@@ -59,14 +60,15 @@ const staticStyles = _StyleSheet.default.create({
|
|
|
59
60
|
minHeight: 0,
|
|
60
61
|
minWidth: 0,
|
|
61
62
|
padding: 0,
|
|
62
|
-
|
|
63
|
-
zIndex:
|
|
63
|
+
textDecorationLine: 'none',
|
|
64
|
+
zIndex: 1000
|
|
64
65
|
},
|
|
65
66
|
content: {
|
|
66
67
|
flex: 1,
|
|
67
68
|
flexGrow: 1,
|
|
68
69
|
flexShrink: 1,
|
|
69
|
-
flexBasis: 0
|
|
70
|
+
flexBasis: 0,
|
|
71
|
+
zIndex: 1000
|
|
70
72
|
}
|
|
71
73
|
});
|
|
72
74
|
var _default = WebModal;
|
|
@@ -15,6 +15,7 @@ const [selectItemProps, selectedItemPropTypes] = selectSystemProps([a11yProps, f
|
|
|
15
15
|
const ButtonGroup = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
16
16
|
let {
|
|
17
17
|
variant,
|
|
18
|
+
buttonVariant,
|
|
18
19
|
tokens,
|
|
19
20
|
items = [],
|
|
20
21
|
values,
|
|
@@ -127,6 +128,7 @@ const ButtonGroup = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
127
128
|
// "radio" if it's a direct child of "radiogroup", even if aria-posinset etc exists
|
|
128
129
|
return /*#__PURE__*/_jsx(ButtonBase, {
|
|
129
130
|
ref: itemRef,
|
|
131
|
+
variant: buttonVariant,
|
|
130
132
|
...pressHandlers,
|
|
131
133
|
onPress: handlePress,
|
|
132
134
|
tokens: getButtonTokens,
|
|
@@ -148,6 +150,13 @@ ButtonGroup.displayName = 'ButtonGroup';
|
|
|
148
150
|
ButtonGroup.propTypes = {
|
|
149
151
|
...selectedSystemPropTypes,
|
|
150
152
|
tokens: getTokensPropType('ButtonGroup'),
|
|
153
|
+
/**
|
|
154
|
+
* To allow Button specific variant
|
|
155
|
+
*/
|
|
156
|
+
buttonVariant: variantProp.propType,
|
|
157
|
+
/**
|
|
158
|
+
* Default variant prop
|
|
159
|
+
*/
|
|
151
160
|
variant: variantProp.propType,
|
|
152
161
|
/**
|
|
153
162
|
* The maximum number of items a user may select at once. Defaults to 1 and behaves
|