@telus-uds/components-base 1.86.0 → 1.88.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 +34 -2
- package/lib/ActionCard/ActionCard.js +350 -0
- package/lib/ActionCard/index.js +10 -0
- package/lib/Card/Card.js +3 -3
- package/lib/Card/PressableCardBase.js +1 -1
- package/lib/Checkbox/Checkbox.js +4 -0
- package/lib/List/List.js +9 -2
- package/lib/Modal/WebModal.js +2 -1
- package/lib/Notification/Notification.js +20 -15
- package/lib/OrderedList/Item.js +14 -23
- package/lib/Radio/Radio.js +4 -0
- package/lib/Radio/RadioGroup.js +1 -1
- package/lib/Tabs/Tabs.js +4 -1
- package/lib/Tabs/TabsItem.js +7 -1
- package/lib/Validator/Validator.js +18 -9
- package/lib/index.js +8 -0
- package/lib/utils/animation/useVerticalExpandAnimation.js +3 -3
- package/lib/utils/props/tokens.js +2 -2
- package/lib-module/ActionCard/ActionCard.js +343 -0
- package/lib-module/ActionCard/index.js +2 -0
- package/lib-module/Card/Card.js +4 -4
- package/lib-module/Card/PressableCardBase.js +1 -1
- package/lib-module/Checkbox/Checkbox.js +4 -0
- package/lib-module/List/List.js +9 -2
- package/lib-module/Modal/WebModal.js +2 -1
- package/lib-module/Notification/Notification.js +20 -15
- package/lib-module/OrderedList/Item.js +14 -23
- package/lib-module/Radio/Radio.js +4 -0
- package/lib-module/Radio/RadioGroup.js +1 -1
- package/lib-module/Tabs/Tabs.js +4 -1
- package/lib-module/Tabs/TabsItem.js +7 -1
- package/lib-module/Validator/Validator.js +18 -9
- package/lib-module/index.js +1 -0
- package/lib-module/utils/animation/useVerticalExpandAnimation.js +3 -3
- package/lib-module/utils/props/tokens.js +2 -2
- package/package.json +2 -2
- package/src/ActionCard/ActionCard.jsx +306 -0
- package/src/ActionCard/index.js +3 -0
- package/src/Card/Card.jsx +6 -4
- package/src/Card/PressableCardBase.jsx +1 -1
- package/src/Checkbox/Checkbox.jsx +3 -1
- package/src/List/List.jsx +7 -2
- package/src/Modal/WebModal.jsx +2 -1
- package/src/Notification/Notification.jsx +36 -16
- package/src/OrderedList/Item.jsx +12 -16
- package/src/Radio/Radio.jsx +3 -1
- package/src/Radio/RadioGroup.jsx +1 -1
- package/src/Tabs/Tabs.jsx +4 -1
- package/src/Tabs/TabsItem.jsx +5 -1
- package/src/Validator/Validator.jsx +21 -9
- package/src/index.js +1 -0
- package/src/utils/animation/useVerticalExpandAnimation.js +3 -3
- package/src/utils/props/tokens.js +4 -2
|
@@ -60,13 +60,17 @@ const selectDismissButtonContainerStyles = _ref4 => {
|
|
|
60
60
|
} = _ref4;
|
|
61
61
|
return {
|
|
62
62
|
paddingLeft: dismissButtonGap,
|
|
63
|
-
placeContent: '
|
|
63
|
+
placeContent: 'start'
|
|
64
64
|
};
|
|
65
65
|
};
|
|
66
|
-
const selectContentContainerStyle = maxWidth => ({
|
|
67
|
-
maxWidth: maxWidth
|
|
66
|
+
const selectContentContainerStyle = (themeTokens, maxWidth, viewport, system) => ({
|
|
67
|
+
maxWidth: viewport === 'xl' && system === true ? maxWidth : 'auto',
|
|
68
|
+
minWidth: viewport === 'xl' && system === true ? maxWidth : 'auto',
|
|
69
|
+
paddingRight: themeTokens === null || themeTokens === void 0 ? void 0 : themeTokens.containerPaddingRight,
|
|
70
|
+
paddingLeft: themeTokens === null || themeTokens === void 0 ? void 0 : themeTokens.containerPaddingLeft
|
|
68
71
|
});
|
|
69
|
-
const getMediaQueryStyles = (themeTokens, themeOptions,
|
|
72
|
+
const getMediaQueryStyles = (themeTokens, themeOptions, mediaIdsRef, dismissible, viewport, system) => {
|
|
73
|
+
var _themeOptions$content, _themeOptions$content2, _themeOptions$content3, _themeOptions$content4, _themeOptions$content5;
|
|
70
74
|
const transformedSelectContainerStyles = Object.entries(themeTokens).reduce((acc, _ref5) => {
|
|
71
75
|
let [vp, viewportTokens] = _ref5;
|
|
72
76
|
acc[vp] = selectContainerStyles({
|
|
@@ -80,7 +84,7 @@ const getMediaQueryStyles = (themeTokens, themeOptions, viewport, mediaIdsRef, d
|
|
|
80
84
|
styles: containerStyles
|
|
81
85
|
} = StyleSheet.create({
|
|
82
86
|
container: {
|
|
83
|
-
flexDirection: 'row',
|
|
87
|
+
flexDirection: system === true && viewport === 'xl' ? 'row' : 'inherit',
|
|
84
88
|
...selectContainerMediaQueryStyles
|
|
85
89
|
}
|
|
86
90
|
});
|
|
@@ -94,19 +98,19 @@ const getMediaQueryStyles = (themeTokens, themeOptions, viewport, mediaIdsRef, d
|
|
|
94
98
|
justifyContent: 'space-between',
|
|
95
99
|
...createMediaQueryStyles({
|
|
96
100
|
xs: {
|
|
97
|
-
width: (themeOptions === null || themeOptions === void 0 ? void 0 : themeOptions.contentMaxWidth.xs) || '100%'
|
|
101
|
+
width: (themeOptions === null || themeOptions === void 0 ? void 0 : (_themeOptions$content = themeOptions.contentMaxWidth) === null || _themeOptions$content === void 0 ? void 0 : _themeOptions$content.xs) || '100%'
|
|
98
102
|
},
|
|
99
103
|
md: {
|
|
100
|
-
width: (themeOptions === null || themeOptions === void 0 ? void 0 : themeOptions.contentMaxWidth.md) || '100%'
|
|
104
|
+
width: (themeOptions === null || themeOptions === void 0 ? void 0 : (_themeOptions$content2 = themeOptions.contentMaxWidth) === null || _themeOptions$content2 === void 0 ? void 0 : _themeOptions$content2.md) || '100%'
|
|
101
105
|
},
|
|
102
106
|
lg: {
|
|
103
|
-
width: (themeOptions === null || themeOptions === void 0 ? void 0 : themeOptions.contentMaxWidth.lg) || '100%'
|
|
107
|
+
width: (themeOptions === null || themeOptions === void 0 ? void 0 : (_themeOptions$content3 = themeOptions.contentMaxWidth) === null || _themeOptions$content3 === void 0 ? void 0 : _themeOptions$content3.lg) || '100%'
|
|
104
108
|
},
|
|
105
109
|
sm: {
|
|
106
|
-
width: (themeOptions === null || themeOptions === void 0 ? void 0 : themeOptions.contentMaxWidth.sm) || '100%'
|
|
110
|
+
width: (themeOptions === null || themeOptions === void 0 ? void 0 : (_themeOptions$content4 = themeOptions.contentMaxWidth) === null || _themeOptions$content4 === void 0 ? void 0 : _themeOptions$content4.sm) || '100%'
|
|
107
111
|
},
|
|
108
112
|
xl: {
|
|
109
|
-
width: (themeOptions === null || themeOptions === void 0 ? void 0 : themeOptions.contentMaxWidth.xl) || '100%'
|
|
113
|
+
width: (themeOptions === null || themeOptions === void 0 ? void 0 : (_themeOptions$content5 = themeOptions.contentMaxWidth) === null || _themeOptions$content5 === void 0 ? void 0 : _themeOptions$content5.xl) || '100%'
|
|
110
114
|
}
|
|
111
115
|
})
|
|
112
116
|
}
|
|
@@ -169,19 +173,20 @@ const getMediaQueryStyles = (themeTokens, themeOptions, viewport, mediaIdsRef, d
|
|
|
169
173
|
selectDismissIconPropsStyles
|
|
170
174
|
};
|
|
171
175
|
};
|
|
172
|
-
const getDefaultStyles = (themeTokens, themeOptions, maxWidth, dismissible) => ({
|
|
176
|
+
const getDefaultStyles = (themeTokens, themeOptions, maxWidth, dismissible, viewport, system) => ({
|
|
173
177
|
containerStyles: {
|
|
174
178
|
container: {
|
|
175
|
-
flexDirection: 'row',
|
|
179
|
+
flexDirection: system === true && viewport === 'xl' ? 'row' : 'inherit',
|
|
176
180
|
...selectContainerStyles(themeTokens)
|
|
177
181
|
}
|
|
178
182
|
},
|
|
179
183
|
contentContainerStyles: {
|
|
180
184
|
contentContainer: {
|
|
185
|
+
flex: 1,
|
|
181
186
|
flexDirection: 'row',
|
|
182
187
|
flexShrink: 1,
|
|
183
188
|
justifyContent: 'space-between',
|
|
184
|
-
...selectContentContainerStyle(maxWidth)
|
|
189
|
+
...selectContentContainerStyle(themeTokens, maxWidth, viewport, system)
|
|
185
190
|
}
|
|
186
191
|
},
|
|
187
192
|
staticContentContainerStyles: {
|
|
@@ -317,9 +322,9 @@ const Notification = /*#__PURE__*/React.forwardRef((_ref6, ref) => {
|
|
|
317
322
|
selectDismissIconPropsIds: {}
|
|
318
323
|
});
|
|
319
324
|
if (enableMediaQueryStyleSheet) {
|
|
320
|
-
notificationComponentRef.current = getMediaQueryStyles(themeTokens, themeOptions,
|
|
325
|
+
notificationComponentRef.current = getMediaQueryStyles(themeTokens, themeOptions, mediaIdsRef, dismissible, viewport, system);
|
|
321
326
|
} else {
|
|
322
|
-
notificationComponentRef.current = getDefaultStyles(themeTokens, themeOptions, maxWidth, dismissible);
|
|
327
|
+
notificationComponentRef.current = getDefaultStyles(themeTokens, themeOptions, maxWidth, dismissible, viewport, system);
|
|
323
328
|
}
|
|
324
329
|
if (isDismissed) {
|
|
325
330
|
return null;
|
|
@@ -4,7 +4,6 @@ import View from "react-native-web/dist/exports/View";
|
|
|
4
4
|
import StyleSheet from "react-native-web/dist/exports/StyleSheet";
|
|
5
5
|
import { getTokensPropType, htmlAttrs, selectSystemProps, variantProp, viewProps, wrapStringsInText } from '../utils';
|
|
6
6
|
import { applyTextStyles, useTheme, useThemeTokens } from '../ThemeProvider';
|
|
7
|
-
import StackView from '../StackView';
|
|
8
7
|
import Typography from '../Typography';
|
|
9
8
|
import ItemBase from './ItemBase';
|
|
10
9
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -30,20 +29,18 @@ const selectItemTextStyles = (_ref, themeOptions) => {
|
|
|
30
29
|
const selectItemCounterStyles = _ref2 => {
|
|
31
30
|
let {
|
|
32
31
|
itemBulletContainerWidth,
|
|
33
|
-
|
|
32
|
+
itemBulletTextAlign,
|
|
34
33
|
itemFontWeight,
|
|
35
34
|
itemFontSize,
|
|
36
35
|
itemFontName,
|
|
37
36
|
itemLineHeight,
|
|
38
37
|
themeOptions,
|
|
39
|
-
listGutter,
|
|
40
38
|
itemColor
|
|
41
39
|
} = _ref2;
|
|
42
40
|
return {
|
|
43
41
|
color: itemColor,
|
|
44
42
|
width: itemBulletContainerWidth,
|
|
45
|
-
|
|
46
|
-
textAlign: itemBulletContainerAlign,
|
|
43
|
+
textAlign: itemBulletTextAlign,
|
|
47
44
|
...applyTextStyles({
|
|
48
45
|
fontWeight: itemFontWeight,
|
|
49
46
|
fontSize: itemFontSize,
|
|
@@ -56,10 +53,12 @@ const selectItemCounterStyles = _ref2 => {
|
|
|
56
53
|
const selectItemContentStyles = (_ref3, isLastChild) => {
|
|
57
54
|
let {
|
|
58
55
|
interItemMargin,
|
|
56
|
+
listGutter,
|
|
59
57
|
...themeTokens
|
|
60
58
|
} = _ref3;
|
|
61
59
|
return {
|
|
62
60
|
...themeTokens,
|
|
61
|
+
marginLeft: listGutter,
|
|
63
62
|
marginBottom: !isLastChild ? interItemMargin : 0
|
|
64
63
|
};
|
|
65
64
|
};
|
|
@@ -100,27 +99,19 @@ const Item = /*#__PURE__*/React.forwardRef((_ref4, ref) => {
|
|
|
100
99
|
children: [/*#__PURE__*/_jsx(View, {
|
|
101
100
|
style: [staticStyles.itemCounter, selectItemCounterStyles(themeTokens)],
|
|
102
101
|
children: itemCounter
|
|
103
|
-
}), /*#__PURE__*/
|
|
104
|
-
style: staticStyles.itemContent,
|
|
105
|
-
children: title
|
|
106
|
-
|
|
107
|
-
flexShrink: 1
|
|
108
|
-
},
|
|
109
|
-
space: 0,
|
|
110
|
-
children: [/*#__PURE__*/_jsx(Typography, {
|
|
102
|
+
}), /*#__PURE__*/_jsxs(View, {
|
|
103
|
+
style: [staticStyles.itemContent, selectItemContentStyles(themeTokens, isLastChild)],
|
|
104
|
+
children: [title && /*#__PURE__*/_jsx(View, {
|
|
105
|
+
children: /*#__PURE__*/_jsx(Typography, {
|
|
111
106
|
variant: {
|
|
112
107
|
size: 'h4'
|
|
113
108
|
},
|
|
114
109
|
tokens: headingTokens,
|
|
115
110
|
children: title
|
|
116
|
-
})
|
|
117
|
-
|
|
118
|
-
children: itemContent
|
|
119
|
-
})]
|
|
120
|
-
}) : /*#__PURE__*/_jsx(View, {
|
|
121
|
-
style: selectItemContentStyles(themeTokens, isLastChild),
|
|
111
|
+
})
|
|
112
|
+
}), /*#__PURE__*/_jsx(View, {
|
|
122
113
|
children: itemContent
|
|
123
|
-
})
|
|
114
|
+
})]
|
|
124
115
|
})]
|
|
125
116
|
});
|
|
126
117
|
});
|
|
@@ -155,13 +146,13 @@ Item.displayName = 'OrderedListItem';
|
|
|
155
146
|
export default Item;
|
|
156
147
|
const staticStyles = StyleSheet.create({
|
|
157
148
|
container: {
|
|
149
|
+
flex: 1,
|
|
158
150
|
flexDirection: 'row'
|
|
159
151
|
},
|
|
160
152
|
itemCounter: {
|
|
161
|
-
|
|
153
|
+
alignItems: 'flex-end'
|
|
162
154
|
},
|
|
163
155
|
itemContent: {
|
|
164
|
-
|
|
165
|
-
marginLeft: 8
|
|
156
|
+
flexShrink: 1
|
|
166
157
|
}
|
|
167
158
|
});
|
|
@@ -164,6 +164,7 @@ const Radio = /*#__PURE__*/React.forwardRef((_ref4, ref) => {
|
|
|
164
164
|
onKeyDown: handleKeyDown,
|
|
165
165
|
onPress: handleChange,
|
|
166
166
|
...selectedProps,
|
|
167
|
+
style: staticStyles.removeOutline,
|
|
167
168
|
children: _ref5 => {
|
|
168
169
|
let {
|
|
169
170
|
focused: focus,
|
|
@@ -275,5 +276,8 @@ const staticStyles = StyleSheet.create({
|
|
|
275
276
|
alignWithLabel: {
|
|
276
277
|
alignSelf: 'flex-start',
|
|
277
278
|
justifyContent: 'center'
|
|
279
|
+
},
|
|
280
|
+
removeOutline: {
|
|
281
|
+
outlineStyle: 'none'
|
|
278
282
|
}
|
|
279
283
|
});
|
|
@@ -114,7 +114,7 @@ const RadioGroup = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
114
114
|
onChange,
|
|
115
115
|
readOnly: readOnly || inactive
|
|
116
116
|
});
|
|
117
|
-
const uniqueFields = ['id'
|
|
117
|
+
const uniqueFields = ['id'];
|
|
118
118
|
if (!containUniqueFields(items, uniqueFields)) {
|
|
119
119
|
throw new Error(`RadioGroup items must have unique ${uniqueFields.join(', ')}`);
|
|
120
120
|
}
|
package/lib-module/Tabs/Tabs.js
CHANGED
|
@@ -106,6 +106,7 @@ const Tabs = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
106
106
|
ref: itemRef,
|
|
107
107
|
LinkRouter: ItemLinkRouter = LinkRouter,
|
|
108
108
|
linkRouterProps: itemLinkRouterProps,
|
|
109
|
+
render,
|
|
109
110
|
...itemRest
|
|
110
111
|
} = _ref3;
|
|
111
112
|
const itemId = id ?? label;
|
|
@@ -131,6 +132,7 @@ const Tabs = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
131
132
|
...linkRouterProps,
|
|
132
133
|
...itemLinkRouterProps
|
|
133
134
|
},
|
|
135
|
+
render: render,
|
|
134
136
|
...itemProps,
|
|
135
137
|
children: label
|
|
136
138
|
}, itemId);
|
|
@@ -151,7 +153,8 @@ Tabs.propTypes = {
|
|
|
151
153
|
href: PropTypes.string,
|
|
152
154
|
label: PropTypes.string,
|
|
153
155
|
id: PropTypes.string,
|
|
154
|
-
ref: ABBPropTypes.ref()
|
|
156
|
+
ref: ABBPropTypes.ref(),
|
|
157
|
+
render: PropTypes.func
|
|
155
158
|
})),
|
|
156
159
|
/**
|
|
157
160
|
* `id` property of the current tab in the items array
|
|
@@ -95,6 +95,7 @@ const TabsItem = /*#__PURE__*/React.forwardRef((_ref4, ref) => {
|
|
|
95
95
|
selected
|
|
96
96
|
} : undefined,
|
|
97
97
|
id,
|
|
98
|
+
render,
|
|
98
99
|
...rawRest
|
|
99
100
|
} = _ref4;
|
|
100
101
|
// Convert onClick etc to onPress etc if used in an integration
|
|
@@ -150,6 +151,10 @@ const TabsItem = /*#__PURE__*/React.forwardRef((_ref4, ref) => {
|
|
|
150
151
|
}
|
|
151
152
|
// itemPositions is a ref object so this should only re-run when `selected` (or `index`) change
|
|
152
153
|
}, [selected, index, itemPositions]);
|
|
154
|
+
if (render) return render({
|
|
155
|
+
selected,
|
|
156
|
+
handlePress
|
|
157
|
+
});
|
|
153
158
|
return /*#__PURE__*/_jsx(Pressable, {
|
|
154
159
|
ref: ref,
|
|
155
160
|
onPress: handlePress,
|
|
@@ -207,7 +212,8 @@ TabsItem.propTypes = {
|
|
|
207
212
|
selected: PropTypes.bool,
|
|
208
213
|
itemPositions: itemPositionsPropType,
|
|
209
214
|
children: PropTypes.string,
|
|
210
|
-
id: PropTypes.string
|
|
215
|
+
id: PropTypes.string,
|
|
216
|
+
render: PropTypes.func
|
|
211
217
|
};
|
|
212
218
|
const staticStyles = StyleSheet.create({
|
|
213
219
|
center: {
|
|
@@ -25,6 +25,7 @@ const Validator = /*#__PURE__*/React.forwardRef((_ref2, ref) => {
|
|
|
25
25
|
let {
|
|
26
26
|
value = '',
|
|
27
27
|
inactive,
|
|
28
|
+
mask = '',
|
|
28
29
|
onChange,
|
|
29
30
|
tokens = {},
|
|
30
31
|
variant = {},
|
|
@@ -70,32 +71,36 @@ const Validator = /*#__PURE__*/React.forwardRef((_ref2, ref) => {
|
|
|
70
71
|
[codeId]: val
|
|
71
72
|
});
|
|
72
73
|
};
|
|
74
|
+
const changeDataMasking = boxElement => {
|
|
75
|
+
let charMasking = '';
|
|
76
|
+
const element = boxElement;
|
|
77
|
+
if (mask && mask.length === 1) charMasking = mask;else if (mask && mask.length > 1) charMasking = mask.substring(0, 1);
|
|
78
|
+
if (charMasking) element.value = charMasking;
|
|
79
|
+
};
|
|
73
80
|
const handleChangeCode = () => {
|
|
74
81
|
let code = '';
|
|
75
82
|
for (let i = 0; i < validatorsLength; i += 1) code += singleCodes[prefix + i];
|
|
76
83
|
if (typeof onChange === 'function') onChange(code, singleCodes);
|
|
77
84
|
};
|
|
78
85
|
const handleChangeCodeValues = (event, codeId, nextIndex) => {
|
|
79
|
-
var _codeReferences$codeI, _event$nativeEvent, _event$target, _codeElement$value
|
|
86
|
+
var _codeReferences$codeI, _event$nativeEvent, _event$target, _codeElement$value;
|
|
80
87
|
const codeElement = (_codeReferences$codeI = codeReferences[codeId]) === null || _codeReferences$codeI === void 0 ? void 0 : _codeReferences$codeI.current;
|
|
81
88
|
const val = ((_event$nativeEvent = event.nativeEvent) === null || _event$nativeEvent === void 0 ? void 0 : _event$nativeEvent.value) || ((_event$target = event.target) === null || _event$target === void 0 ? void 0 : _event$target.value);
|
|
82
89
|
if (Number(val).toString() === 'NaN') {
|
|
83
90
|
codeElement.value = singleCodes[codeId] ?? '';
|
|
84
91
|
return;
|
|
85
92
|
}
|
|
86
|
-
if ((codeElement === null || codeElement === void 0 ? void 0 : (_codeElement$value = codeElement.value) === null || _codeElement$value === void 0 ? void 0 : _codeElement$value.length) > 1) {
|
|
87
|
-
const oldValue = singleCodes[codeId];
|
|
88
|
-
const newValue = codeElement.value.replace(oldValue, '');
|
|
89
|
-
codeElement.value = newValue;
|
|
90
|
-
handleSingleCodes(codeId, codeElement.value, 'success');
|
|
91
|
-
}
|
|
92
93
|
handleSingleCodes(codeId, (codeElement === null || codeElement === void 0 ? void 0 : codeElement.value) ?? singleCodes[codeId], 'success');
|
|
93
94
|
handleChangeCode();
|
|
94
95
|
if (nextIndex === validatorsLength) {
|
|
95
96
|
codeElement.blur();
|
|
97
|
+
changeDataMasking(codeElement);
|
|
96
98
|
return;
|
|
97
99
|
}
|
|
98
|
-
if ((codeElement === null || codeElement === void 0 ? void 0 : (_codeElement$
|
|
100
|
+
if ((codeElement === null || codeElement === void 0 ? void 0 : (_codeElement$value = codeElement.value) === null || _codeElement$value === void 0 ? void 0 : _codeElement$value.length) > 0) {
|
|
101
|
+
codeReferences[prefix + nextIndex].current.focus();
|
|
102
|
+
changeDataMasking(codeElement);
|
|
103
|
+
}
|
|
99
104
|
};
|
|
100
105
|
const handleKeyPress = (event, currentIndex, previousIndex) => {
|
|
101
106
|
if (!(event.keyCode === 8 || event.code === 'Backspace')) return;
|
|
@@ -143,7 +148,7 @@ const Validator = /*#__PURE__*/React.forwardRef((_ref2, ref) => {
|
|
|
143
148
|
/* eslint-disable react-hooks/exhaustive-deps */
|
|
144
149
|
React.useEffect(() => {
|
|
145
150
|
for (let i = 0; i < validatorsLength; i += 1) {
|
|
146
|
-
codeReferences[prefix + i].current.value = text[i] ?? '';
|
|
151
|
+
if (mask && text[i]) codeReferences[prefix + i].current.value = mask;else codeReferences[prefix + i].current.value = text[i] ?? '';
|
|
147
152
|
handleSingleCodes(prefix + i, text[i] ?? '', text[i] ? 'success' : '');
|
|
148
153
|
}
|
|
149
154
|
}, [text]);
|
|
@@ -200,6 +205,10 @@ Validator.propTypes = {
|
|
|
200
205
|
* If true, the component is inactive and non editable.
|
|
201
206
|
*/
|
|
202
207
|
inactive: PropTypes.bool,
|
|
208
|
+
/**
|
|
209
|
+
* Show masked characters and obscure the actual input. For example: '*'
|
|
210
|
+
*/
|
|
211
|
+
mask: PropTypes.string,
|
|
203
212
|
/**
|
|
204
213
|
* Use to react upon input's value changes. Required when the `value` prop is set. Will receive the input's value as an argument.
|
|
205
214
|
*/
|
package/lib-module/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { default as A11yText } from './A11yText';
|
|
2
|
+
export { default as ActionCard } from './ActionCard';
|
|
2
3
|
export { default as ActivityIndicator } from './ActivityIndicator';
|
|
3
4
|
export { default as Autocomplete } from './Autocomplete';
|
|
4
5
|
export { default as Box } from './Box';
|
|
@@ -52,8 +52,8 @@ function useVerticalExpandAnimation(_ref) {
|
|
|
52
52
|
if (isAnimating || expandStateChanged) containerStyles.overflow = 'hidden';
|
|
53
53
|
if (!isExpanded && !isAnimating && !expandStateChanged) {
|
|
54
54
|
if (Platform.OS === 'web') {
|
|
55
|
-
// Without `
|
|
56
|
-
containerStyles.
|
|
55
|
+
// Without `display: 'none', descendents are focusable on web even when collapsed.
|
|
56
|
+
containerStyles.display = 'none';
|
|
57
57
|
} else {
|
|
58
58
|
// There's no `visibility: hidden` in React Native, and display: none causes a flicker on expand.
|
|
59
59
|
// Without some form of hiding, some children leak through even when closed e.g. `List.Item` bullets.
|
|
@@ -67,7 +67,7 @@ function useVerticalExpandAnimation(_ref) {
|
|
|
67
67
|
// on web we can hide the contents until we have the container measured and avoid occasional jitter
|
|
68
68
|
// this won't work on native platforms
|
|
69
69
|
containerStyles.height = 0;
|
|
70
|
-
containerStyles.
|
|
70
|
+
containerStyles.display = 'none';
|
|
71
71
|
}
|
|
72
72
|
} else if (Platform.OS === 'web') {
|
|
73
73
|
const transitionDuration = isExpanded ? expandDuration : collapseDuration;
|
|
@@ -105,7 +105,7 @@ export const getTokensPropType = function () {
|
|
|
105
105
|
* For example, for a set of tokens used in a common style, or for a set of tokens required by
|
|
106
106
|
* a themeless component whose tokens are set by a parent but requires tokens of a certain shape.
|
|
107
107
|
*
|
|
108
|
-
* By default, requires an object with a complete set of tokens (allowing `null
|
|
108
|
+
* By default, requires an object with a complete set of tokens (allowing `null` and `undefined`).
|
|
109
109
|
*
|
|
110
110
|
* @param {string[]} componentTokenKeys - array of strings of token names
|
|
111
111
|
* @param {object} [options]
|
|
@@ -124,7 +124,7 @@ export const getTokensSetPropType = function (componentTokenKeys) {
|
|
|
124
124
|
for (var _len2 = arguments.length, args = new Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
|
|
125
125
|
args[_key2 - 2] = arguments[_key2];
|
|
126
126
|
}
|
|
127
|
-
return props[propName] !== null && tokenValueType.isRequired(props, propName, ...args);
|
|
127
|
+
return props[propName] !== null && props[propName] !== undefined && tokenValueType.isRequired(props, propName, ...args);
|
|
128
128
|
}])));
|
|
129
129
|
return allowFunction ? PropTypes.oneOfType([tokensObjectValidator, PropTypes.func]) : tokensObjectValidator;
|
|
130
130
|
};
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"@floating-ui/react-native": "^0.8.1",
|
|
12
12
|
"@gorhom/portal": "^1.0.14",
|
|
13
13
|
"@telus-uds/system-constants": "^1.3.0",
|
|
14
|
-
"@telus-uds/system-theme-tokens": "^2.
|
|
14
|
+
"@telus-uds/system-theme-tokens": "^2.59.0",
|
|
15
15
|
"airbnb-prop-types": "^2.16.0",
|
|
16
16
|
"css-mediaquery": "^0.1.2",
|
|
17
17
|
"expo-linear-gradient": "^12.5.0",
|
|
@@ -85,6 +85,6 @@
|
|
|
85
85
|
"standard-engine": {
|
|
86
86
|
"skip": true
|
|
87
87
|
},
|
|
88
|
-
"version": "1.
|
|
88
|
+
"version": "1.88.0",
|
|
89
89
|
"types": "types/index.d.ts"
|
|
90
90
|
}
|