@telus-uds/components-base 1.40.0 → 1.41.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/component-docs.json +183 -61
- package/lib/Button/ButtonBase.js +68 -38
- package/lib/ExpandCollapse/Panel.js +9 -3
- package/lib/Icon/IconText.js +1 -1
- package/lib/InputSupports/InputSupports.js +10 -3
- package/lib/Notification/Notification.js +21 -10
- package/lib/Pagination/Pagination.js +57 -14
- package/lib/Radio/Radio.js +5 -1
- package/lib/Select/Select.js +14 -4
- package/lib-module/Button/ButtonBase.js +68 -38
- package/lib-module/ExpandCollapse/Panel.js +9 -3
- package/lib-module/Icon/IconText.js +1 -1
- package/lib-module/InputSupports/InputSupports.js +10 -3
- package/lib-module/Notification/Notification.js +20 -10
- package/lib-module/Pagination/Pagination.js +56 -14
- package/lib-module/Radio/Radio.js +5 -1
- package/lib-module/Select/Select.js +14 -4
- package/package.json +2 -2
- package/src/Button/ButtonBase.jsx +44 -26
- package/src/ExpandCollapse/Control.jsx +1 -0
- package/src/ExpandCollapse/Panel.jsx +12 -2
- package/src/Icon/IconText.jsx +1 -1
- package/src/InputSupports/InputSupports.jsx +13 -1
- package/src/Notification/Notification.jsx +15 -10
- package/src/Pagination/Pagination.jsx +63 -13
- package/src/Radio/Radio.jsx +5 -1
- package/src/Select/Select.jsx +10 -1
|
@@ -42,11 +42,12 @@ const selectOuterContainerStyles = _ref2 => {
|
|
|
42
42
|
};
|
|
43
43
|
};
|
|
44
44
|
|
|
45
|
-
const
|
|
45
|
+
const selectOuterSizeStyles = _ref3 => {
|
|
46
46
|
let {
|
|
47
47
|
outerBorderGap,
|
|
48
48
|
outerBorderWidth,
|
|
49
|
-
width
|
|
49
|
+
width,
|
|
50
|
+
height
|
|
50
51
|
} = _ref3;
|
|
51
52
|
// The inner container's bounding box is the bounding box of the button overall
|
|
52
53
|
// so this many device pixels will sit outside of the overall bounding box
|
|
@@ -54,10 +55,16 @@ const selectOuterWidthStyles = _ref3 => {
|
|
|
54
55
|
outerBorderGap,
|
|
55
56
|
outerBorderWidth
|
|
56
57
|
});
|
|
57
|
-
const
|
|
58
|
+
const sizeStyles = {}; // Apply width/height tokens: number === pixels, string === explicit units e.g. %
|
|
59
|
+
|
|
60
|
+
if (typeof width === 'number' || typeof height === 'number') {
|
|
61
|
+
sizeStyles.width = width ? width + outerBorderOffset * 2 : width;
|
|
62
|
+
sizeStyles.height = height ? height + outerBorderOffset * 2 : height;
|
|
63
|
+
return sizeStyles;
|
|
64
|
+
}
|
|
58
65
|
|
|
59
66
|
if (!width) {
|
|
60
|
-
return { ...
|
|
67
|
+
return { ...sizeStyles,
|
|
61
68
|
// Wrap content, stopping a flex parent's default align-items: stretch stretching focus ring beyond content
|
|
62
69
|
...Platform.select({
|
|
63
70
|
// width: fit-content isn't supported on Firefox; can't cascade props like CSS `width: fit-content; width: --moz-fit-content;`
|
|
@@ -66,30 +73,26 @@ const selectOuterWidthStyles = _ref3 => {
|
|
|
66
73
|
}
|
|
67
74
|
})
|
|
68
75
|
};
|
|
69
|
-
} // Apply width tokens: number === pixels, string === explicit units e.g. %
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
if (typeof width === 'number') {
|
|
73
|
-
widthStyles.width = width + outerBorderOffset * 2;
|
|
74
|
-
return widthStyles;
|
|
75
76
|
} // Ensure the negative margin doesn't make element off-centre
|
|
76
77
|
|
|
77
78
|
|
|
78
79
|
if (Platform.OS === 'web') {
|
|
79
|
-
|
|
80
|
-
|
|
80
|
+
sizeStyles.width = `calc(${width} + ${outerBorderOffset * 2}px)`;
|
|
81
|
+
sizeStyles.height = `calc(${height} + ${outerBorderOffset * 2}px)`;
|
|
82
|
+
return sizeStyles;
|
|
81
83
|
} // Can't use calc() on native but (unlike on web) flexGrow fills the container width here
|
|
82
84
|
|
|
83
85
|
|
|
84
86
|
if (width === '100%') {
|
|
85
|
-
|
|
86
|
-
return
|
|
87
|
+
sizeStyles.flexGrow = 1;
|
|
88
|
+
return sizeStyles;
|
|
87
89
|
} // Slight offset not such a concern if % width < 100%, as the button isn't centered anyway.
|
|
88
90
|
// If centering support is added (e.g. alignSelf: center), set marginHorizontal 0 when centered.
|
|
89
91
|
|
|
90
92
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
+
sizeStyles.width = width;
|
|
94
|
+
sizeStyles.height = height;
|
|
95
|
+
return sizeStyles;
|
|
93
96
|
};
|
|
94
97
|
|
|
95
98
|
const selectInnerContainerStyles = _ref4 => {
|
|
@@ -101,38 +104,68 @@ const selectInnerContainerStyles = _ref4 => {
|
|
|
101
104
|
paddingBottom,
|
|
102
105
|
shadow,
|
|
103
106
|
borderWidth,
|
|
107
|
+
borderLeftWidth,
|
|
108
|
+
borderRightWidth,
|
|
109
|
+
borderTopWidth,
|
|
110
|
+
borderBottomWidth,
|
|
104
111
|
minWidth
|
|
105
112
|
} = _ref4;
|
|
106
113
|
|
|
107
114
|
// Subtract border width from padding so overall button width/height doesn't
|
|
108
115
|
// jump around if the border width changes (avoiding NaN and negative padding)
|
|
109
|
-
const offsetBorder =
|
|
116
|
+
const offsetBorder = _ref5 => {
|
|
117
|
+
let {
|
|
118
|
+
value,
|
|
119
|
+
borderSize = borderWidth
|
|
120
|
+
} = _ref5;
|
|
121
|
+
return typeof value === 'number' && typeof borderSize === 'number' ? Math.max(0, value - borderSize) : value;
|
|
122
|
+
};
|
|
110
123
|
|
|
111
124
|
return {
|
|
112
|
-
paddingLeft: offsetBorder(
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
125
|
+
paddingLeft: offsetBorder({
|
|
126
|
+
value: paddingLeft,
|
|
127
|
+
borderSize: borderLeftWidth
|
|
128
|
+
}),
|
|
129
|
+
paddingRight: offsetBorder({
|
|
130
|
+
value: paddingRight,
|
|
131
|
+
borderSize: borderRightWidth
|
|
132
|
+
}),
|
|
133
|
+
paddingTop: offsetBorder({
|
|
134
|
+
value: paddingTop,
|
|
135
|
+
borderSize: borderTopWidth
|
|
136
|
+
}),
|
|
137
|
+
paddingBottom: offsetBorder({
|
|
138
|
+
value: paddingBottom,
|
|
139
|
+
borderSize: borderBottomWidth
|
|
140
|
+
}),
|
|
116
141
|
backgroundColor,
|
|
117
142
|
minWidth,
|
|
118
143
|
...applyShadowToken(shadow)
|
|
119
144
|
};
|
|
120
145
|
};
|
|
121
146
|
|
|
122
|
-
const selectBorderStyles =
|
|
147
|
+
const selectBorderStyles = _ref6 => {
|
|
123
148
|
let {
|
|
124
149
|
borderColor,
|
|
125
150
|
borderWidth,
|
|
126
|
-
borderRadius
|
|
127
|
-
|
|
151
|
+
borderRadius,
|
|
152
|
+
borderLeftWidth,
|
|
153
|
+
borderRightWidth,
|
|
154
|
+
borderTopWidth,
|
|
155
|
+
borderBottomWidth
|
|
156
|
+
} = _ref6;
|
|
128
157
|
return {
|
|
129
158
|
borderColor,
|
|
130
159
|
borderWidth,
|
|
131
|
-
borderRadius
|
|
160
|
+
borderRadius,
|
|
161
|
+
borderLeftWidth,
|
|
162
|
+
borderRightWidth,
|
|
163
|
+
borderTopWidth,
|
|
164
|
+
borderBottomWidth
|
|
132
165
|
};
|
|
133
166
|
};
|
|
134
167
|
|
|
135
|
-
const selectTextStyles = (
|
|
168
|
+
const selectTextStyles = (_ref7, themeOptions) => {
|
|
136
169
|
let {
|
|
137
170
|
fontSize,
|
|
138
171
|
color,
|
|
@@ -142,7 +175,7 @@ const selectTextStyles = (_ref6, themeOptions) => {
|
|
|
142
175
|
textAlign,
|
|
143
176
|
textLine,
|
|
144
177
|
textLineStyle
|
|
145
|
-
} =
|
|
178
|
+
} = _ref7;
|
|
146
179
|
return applyTextStyles({
|
|
147
180
|
fontSize,
|
|
148
181
|
color,
|
|
@@ -156,10 +189,10 @@ const selectTextStyles = (_ref6, themeOptions) => {
|
|
|
156
189
|
});
|
|
157
190
|
};
|
|
158
191
|
|
|
159
|
-
const selectWebOnlyStyles = (inactive, themeTokens,
|
|
192
|
+
const selectWebOnlyStyles = (inactive, themeTokens, _ref8) => {
|
|
160
193
|
let {
|
|
161
194
|
accessibilityRole
|
|
162
|
-
} =
|
|
195
|
+
} = _ref8;
|
|
163
196
|
return Platform.select({
|
|
164
197
|
web: {
|
|
165
198
|
// if it would overflow the container, wraps instead
|
|
@@ -172,19 +205,19 @@ const selectWebOnlyStyles = (inactive, themeTokens, _ref7) => {
|
|
|
172
205
|
});
|
|
173
206
|
};
|
|
174
207
|
|
|
175
|
-
const selectItemIconTokens =
|
|
208
|
+
const selectItemIconTokens = _ref9 => {
|
|
176
209
|
let {
|
|
177
210
|
color,
|
|
178
211
|
iconColor,
|
|
179
212
|
iconSize
|
|
180
|
-
} =
|
|
213
|
+
} = _ref9;
|
|
181
214
|
return {
|
|
182
215
|
size: iconSize,
|
|
183
216
|
color: iconColor || color
|
|
184
217
|
};
|
|
185
218
|
};
|
|
186
219
|
|
|
187
|
-
const ButtonBase = /*#__PURE__*/forwardRef((
|
|
220
|
+
const ButtonBase = /*#__PURE__*/forwardRef((_ref10, ref) => {
|
|
188
221
|
let {
|
|
189
222
|
id,
|
|
190
223
|
href,
|
|
@@ -199,7 +232,7 @@ const ButtonBase = /*#__PURE__*/forwardRef((_ref9, ref) => {
|
|
|
199
232
|
iconPosition = icon ? 'left' : undefined,
|
|
200
233
|
iconProps,
|
|
201
234
|
...rawRest
|
|
202
|
-
} =
|
|
235
|
+
} = _ref10;
|
|
203
236
|
const {
|
|
204
237
|
onPress,
|
|
205
238
|
...rest
|
|
@@ -216,7 +249,7 @@ const ButtonBase = /*#__PURE__*/forwardRef((_ref9, ref) => {
|
|
|
216
249
|
|
|
217
250
|
const getPressableStyle = pressableState => {
|
|
218
251
|
const themeTokens = resolveButtonTokens(pressableState);
|
|
219
|
-
return [staticStyles.row, selectWebOnlyStyles(inactive, themeTokens, systemProps), selectOuterContainerStyles(themeTokens),
|
|
252
|
+
return [staticStyles.row, selectWebOnlyStyles(inactive, themeTokens, systemProps), selectOuterContainerStyles(themeTokens), selectOuterSizeStyles(themeTokens)];
|
|
220
253
|
};
|
|
221
254
|
|
|
222
255
|
const {
|
|
@@ -287,10 +320,7 @@ const staticStyles = StyleSheet.create({
|
|
|
287
320
|
// Apply all button alignment horizontally; no vertical stacking within a button
|
|
288
321
|
flexDirection: 'row'
|
|
289
322
|
},
|
|
290
|
-
text: {
|
|
291
|
-
flexGrow: 1,
|
|
292
|
-
// On native but not web, flexShrink here wraps text prematurely
|
|
293
|
-
...Platform.select({
|
|
323
|
+
text: { ...Platform.select({
|
|
294
324
|
// TODO: https://github.com/telus/universal-design-system/issues/487
|
|
295
325
|
web: {
|
|
296
326
|
transition: 'color 200ms'
|
|
@@ -11,8 +11,6 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
11
11
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
12
12
|
const [selectProps, selectedSystemPropTypes] = selectSystemProps([a11yProps, viewProps]); // just void functions for now, since there are no style tokens for a panel or control at this point
|
|
13
13
|
|
|
14
|
-
const selectGroupStyles = () => {};
|
|
15
|
-
|
|
16
14
|
const selectContainerStyles = _ref => {
|
|
17
15
|
let {
|
|
18
16
|
contentPaddingLeft,
|
|
@@ -89,13 +87,21 @@ const ExpandCollapsePanel = /*#__PURE__*/forwardRef((_ref2, ref) => {
|
|
|
89
87
|
const focusabilityProps = isExpanded ? {} : a11yProps.nonFocusableProps;
|
|
90
88
|
return /*#__PURE__*/_jsxs(View, {
|
|
91
89
|
ref: ref,
|
|
92
|
-
style:
|
|
90
|
+
style: themeTokens,
|
|
93
91
|
children: [/*#__PURE__*/_jsx(ExpandCollapseControl, { ...selectedProps,
|
|
94
92
|
isExpanded: isExpanded,
|
|
95
93
|
tokens: controlTokens,
|
|
94
|
+
variant: variant,
|
|
96
95
|
onPress: handleControlPress,
|
|
97
96
|
ref: controlRef,
|
|
98
97
|
children: control
|
|
98
|
+
}), isExpanded && /*#__PURE__*/_jsx(View, {
|
|
99
|
+
style: {
|
|
100
|
+
borderTopColor: themeTokens.expandDividerColor,
|
|
101
|
+
borderTopWidth: themeTokens.expanddDividerWidth,
|
|
102
|
+
marginLeft: themeTokens.contentPaddingLeft,
|
|
103
|
+
marginRight: themeTokens.contentPaddingRight
|
|
104
|
+
}
|
|
99
105
|
}), /*#__PURE__*/_jsx(Animated.View, {
|
|
100
106
|
ref: animatedRef,
|
|
101
107
|
style: animatedStyles,
|
|
@@ -35,7 +35,7 @@ const IconText = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
35
35
|
// See abandoned issue https://github.com/facebook/react-native/issues/6529
|
|
36
36
|
|
|
37
37
|
|
|
38
|
-
const size = iconProps === null || iconProps === void 0 ? void 0 : (_iconProps$tokens = iconProps.tokens) === null || _iconProps$tokens === void 0 ? void 0 : _iconProps$tokens.size;
|
|
38
|
+
const size = (iconProps === null || iconProps === void 0 ? void 0 : (_iconProps$tokens = iconProps.tokens) === null || _iconProps$tokens === void 0 ? void 0 : _iconProps$tokens.size) ?? 0;
|
|
39
39
|
|
|
40
40
|
const iconAdjustedAndriod = /*#__PURE__*/_jsx(View, {
|
|
41
41
|
style: {
|
|
@@ -15,6 +15,7 @@ const InputSupports = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
15
15
|
hint,
|
|
16
16
|
hintPosition = 'inline',
|
|
17
17
|
feedback,
|
|
18
|
+
feedbackTokens = {},
|
|
18
19
|
tooltip,
|
|
19
20
|
validation,
|
|
20
21
|
nativeID
|
|
@@ -48,11 +49,12 @@ const InputSupports = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
48
49
|
}), typeof children === 'function' ? children({
|
|
49
50
|
inputId,
|
|
50
51
|
...a11yProps
|
|
51
|
-
}) : children, feedback
|
|
52
|
+
}) : children, feedback ? /*#__PURE__*/_jsx(Feedback, {
|
|
52
53
|
id: feedbackId,
|
|
53
54
|
title: feedback,
|
|
54
|
-
validation: validation
|
|
55
|
-
|
|
55
|
+
validation: validation,
|
|
56
|
+
tokens: feedbackTokens
|
|
57
|
+
}) : null]
|
|
56
58
|
});
|
|
57
59
|
});
|
|
58
60
|
InputSupports.displayName = 'InputSupports';
|
|
@@ -85,6 +87,11 @@ InputSupports.propTypes = {
|
|
|
85
87
|
*/
|
|
86
88
|
feedback: PropTypes.string,
|
|
87
89
|
|
|
90
|
+
/**
|
|
91
|
+
* Additional tokens to override the default feedback tokens.
|
|
92
|
+
*/
|
|
93
|
+
feedbackTokens: PropTypes.objectOf(PropTypes.string),
|
|
94
|
+
|
|
88
95
|
/**
|
|
89
96
|
* Content of an optional `Tooltip`. If set, a tooltip button will be shown next to the label.
|
|
90
97
|
*/
|
|
@@ -4,9 +4,10 @@ import View from "react-native-web/dist/exports/View";
|
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
5
|
import { applyTextStyles, useTheme, useThemeTokens } from '../ThemeProvider';
|
|
6
6
|
import { a11yProps, getTokensPropType, selectSystemProps, selectTokens, variantProp, viewProps, wrapStringsInText, useResponsiveProp } from '../utils';
|
|
7
|
-
import
|
|
7
|
+
import IconButton from '../IconButton';
|
|
8
8
|
import useCopy from '../utils/useCopy';
|
|
9
9
|
import dictionary from './dictionary';
|
|
10
|
+
import { useViewport } from '../ViewportProvider';
|
|
10
11
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
12
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
12
13
|
const [selectProps, selectedSystemPropTypes] = selectSystemProps([a11yProps, viewProps]);
|
|
@@ -34,7 +35,8 @@ const selectIconContainerStyles = _ref2 => {
|
|
|
34
35
|
iconGap
|
|
35
36
|
} = _ref2;
|
|
36
37
|
return {
|
|
37
|
-
paddingRight: iconGap
|
|
38
|
+
paddingRight: iconGap,
|
|
39
|
+
placeContent: 'center'
|
|
38
40
|
};
|
|
39
41
|
};
|
|
40
42
|
|
|
@@ -54,7 +56,8 @@ const selectDismissButtonContainerStyles = _ref4 => {
|
|
|
54
56
|
dismissButtonGap
|
|
55
57
|
} = _ref4;
|
|
56
58
|
return {
|
|
57
|
-
paddingLeft: dismissButtonGap
|
|
59
|
+
paddingLeft: dismissButtonGap,
|
|
60
|
+
placeContent: 'center'
|
|
58
61
|
};
|
|
59
62
|
};
|
|
60
63
|
|
|
@@ -125,8 +128,10 @@ const Notification = /*#__PURE__*/forwardRef((_ref5, ref) => {
|
|
|
125
128
|
...rest
|
|
126
129
|
} = _ref5;
|
|
127
130
|
const [isDismissed, setIsDismissed] = useState(false);
|
|
131
|
+
const viewport = useViewport();
|
|
128
132
|
const themeTokens = useThemeTokens('Notification', tokens, variant, {
|
|
129
|
-
system
|
|
133
|
+
system,
|
|
134
|
+
viewport
|
|
130
135
|
});
|
|
131
136
|
const getCopy = useCopy({
|
|
132
137
|
dictionary,
|
|
@@ -150,11 +155,11 @@ const Notification = /*#__PURE__*/forwardRef((_ref5, ref) => {
|
|
|
150
155
|
});
|
|
151
156
|
const {
|
|
152
157
|
icon: IconComponent,
|
|
153
|
-
dismissIcon: DismissIconComponent
|
|
158
|
+
dismissIcon: DismissIconComponent,
|
|
159
|
+
dismissIconColor
|
|
154
160
|
} = themeTokens;
|
|
155
161
|
|
|
156
|
-
const onDismissPress = () => setIsDismissed(true);
|
|
157
|
-
|
|
162
|
+
const onDismissPress = () => setIsDismissed(true);
|
|
158
163
|
|
|
159
164
|
return /*#__PURE__*/_jsx(View, {
|
|
160
165
|
ref: ref,
|
|
@@ -174,10 +179,16 @@ const Notification = /*#__PURE__*/forwardRef((_ref5, ref) => {
|
|
|
174
179
|
}) : content]
|
|
175
180
|
}), dismissible && DismissIconComponent && /*#__PURE__*/_jsx(View, {
|
|
176
181
|
style: selectDismissButtonContainerStyles(themeTokens),
|
|
177
|
-
children: /*#__PURE__*/_jsx(
|
|
182
|
+
children: /*#__PURE__*/_jsx(IconButton, {
|
|
183
|
+
action: "close",
|
|
178
184
|
onPress: onDismissPress,
|
|
185
|
+
icon: DismissIconComponent,
|
|
179
186
|
accessibilityRole: "button",
|
|
180
187
|
accessibilityLabel: getCopy('dismiss'),
|
|
188
|
+
variant: {
|
|
189
|
+
inverse: dismissIconColor === '#ffffff',
|
|
190
|
+
size: 'small'
|
|
191
|
+
},
|
|
181
192
|
children: () => /*#__PURE__*/_jsx(DismissIconComponent, { ...selectDismissIconProps(themeTokens)
|
|
182
193
|
})
|
|
183
194
|
})
|
|
@@ -215,8 +226,7 @@ Notification.propTypes = { ...selectedSystemPropTypes,
|
|
|
215
226
|
export default Notification;
|
|
216
227
|
const staticStyles = StyleSheet.create({
|
|
217
228
|
container: {
|
|
218
|
-
flexDirection: 'row'
|
|
219
|
-
justifyContent: 'center'
|
|
229
|
+
flexDirection: 'row'
|
|
220
230
|
},
|
|
221
231
|
contentContainer: {
|
|
222
232
|
flexDirection: 'row',
|
|
@@ -54,6 +54,20 @@ const Pagination = /*#__PURE__*/forwardRef((_ref2, ref) => {
|
|
|
54
54
|
const {
|
|
55
55
|
themeOptions
|
|
56
56
|
} = useTheme();
|
|
57
|
+
const {
|
|
58
|
+
borderColor,
|
|
59
|
+
borderWidth,
|
|
60
|
+
borderLeftWidth,
|
|
61
|
+
borderRightWidth,
|
|
62
|
+
borderTopWidth,
|
|
63
|
+
borderBottomWidth,
|
|
64
|
+
ellipsisPadding,
|
|
65
|
+
ellipsisBorderRightWidth,
|
|
66
|
+
ellipsisBorderLeftWidth,
|
|
67
|
+
ellipsisBorderTopWidth,
|
|
68
|
+
ellipsisBorderBottomWidth,
|
|
69
|
+
ellipsisHeight
|
|
70
|
+
} = themeTokens;
|
|
57
71
|
const items = React.Children.toArray(children);
|
|
58
72
|
const {
|
|
59
73
|
isItemActive,
|
|
@@ -69,6 +83,17 @@ const Pagination = /*#__PURE__*/forwardRef((_ref2, ref) => {
|
|
|
69
83
|
truncateAbove
|
|
70
84
|
});
|
|
71
85
|
const ellipsisTextStyles = selectTextStyles(themeTokens, themeOptions);
|
|
86
|
+
const ellipisContainerStyles = StyleSheet.create({
|
|
87
|
+
container: {
|
|
88
|
+
height: ellipsisHeight,
|
|
89
|
+
padding: ellipsisPadding,
|
|
90
|
+
borderRightWidth: ellipsisBorderRightWidth,
|
|
91
|
+
borderLeftWidth: ellipsisBorderLeftWidth,
|
|
92
|
+
borderTopWidth: ellipsisBorderTopWidth,
|
|
93
|
+
borderBottomWidth: ellipsisBorderBottomWidth,
|
|
94
|
+
borderColor
|
|
95
|
+
}
|
|
96
|
+
});
|
|
72
97
|
|
|
73
98
|
if (items.length === 0) {
|
|
74
99
|
return null;
|
|
@@ -103,9 +128,14 @@ const Pagination = /*#__PURE__*/forwardRef((_ref2, ref) => {
|
|
|
103
128
|
}
|
|
104
129
|
|
|
105
130
|
if (shouldRenderEllipsis(itemIndex)) {
|
|
106
|
-
return /*#__PURE__*/_jsx(
|
|
107
|
-
style:
|
|
108
|
-
|
|
131
|
+
return /*#__PURE__*/_jsx(View, {
|
|
132
|
+
style: { ...ellipisContainerStyles.container
|
|
133
|
+
},
|
|
134
|
+
children: /*#__PURE__*/_jsx(Text, {
|
|
135
|
+
style: { ...ellipsisTextStyles
|
|
136
|
+
},
|
|
137
|
+
children: "..."
|
|
138
|
+
})
|
|
109
139
|
}, "...");
|
|
110
140
|
}
|
|
111
141
|
|
|
@@ -119,19 +149,31 @@ const Pagination = /*#__PURE__*/forwardRef((_ref2, ref) => {
|
|
|
119
149
|
linkRouterProps: linkRouterProps
|
|
120
150
|
})];
|
|
121
151
|
return /*#__PURE__*/_jsx(View, {
|
|
122
|
-
style: staticStyles.container
|
|
152
|
+
style: { ...staticStyles.container
|
|
153
|
+
},
|
|
123
154
|
ref: ref,
|
|
124
155
|
...selectProps(rest),
|
|
125
|
-
children:
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
},
|
|
156
|
+
children: /*#__PURE__*/_jsx(View, {
|
|
157
|
+
style: {
|
|
158
|
+
borderColor,
|
|
159
|
+
borderWidth,
|
|
160
|
+
borderLeftWidth,
|
|
161
|
+
borderRightWidth,
|
|
162
|
+
borderTopWidth,
|
|
163
|
+
borderBottomWidth,
|
|
164
|
+
...staticStyles.container
|
|
165
|
+
},
|
|
166
|
+
children: buttons // keep the keys in-line with the page numbers regardless of which buttons are actually rendered
|
|
167
|
+
.map((element, index) => [element, `page-${index + 1}`]).filter(_ref3 => {
|
|
168
|
+
let [element] = _ref3;
|
|
169
|
+
return element !== null;
|
|
170
|
+
}).map(_ref4 => {
|
|
171
|
+
let [element, key] = _ref4;
|
|
172
|
+
return /*#__PURE__*/_jsx(Box, {
|
|
173
|
+
right: gap,
|
|
174
|
+
children: element
|
|
175
|
+
}, key);
|
|
176
|
+
})
|
|
135
177
|
})
|
|
136
178
|
});
|
|
137
179
|
});
|
|
@@ -42,6 +42,8 @@ const selectDescriptionStyles = _ref2 => {
|
|
|
42
42
|
descriptionFontSize,
|
|
43
43
|
descriptionLineHeight,
|
|
44
44
|
descriptionMarginLeft,
|
|
45
|
+
descriptionFontName,
|
|
46
|
+
descriptionFontWeight,
|
|
45
47
|
inputSize,
|
|
46
48
|
fontColor,
|
|
47
49
|
labelMarginLeft = 0
|
|
@@ -51,7 +53,9 @@ const selectDescriptionStyles = _ref2 => {
|
|
|
51
53
|
color: fontColor,
|
|
52
54
|
...applyTextStyles({
|
|
53
55
|
fontSize: descriptionFontSize,
|
|
54
|
-
lineHeight: descriptionLineHeight
|
|
56
|
+
lineHeight: descriptionLineHeight,
|
|
57
|
+
fontName: descriptionFontName,
|
|
58
|
+
fontWeight: descriptionFontWeight
|
|
55
59
|
})
|
|
56
60
|
};
|
|
57
61
|
};
|
|
@@ -150,6 +150,15 @@ const selectValidationIconContainerStyles = _ref6 => {
|
|
|
150
150
|
})
|
|
151
151
|
};
|
|
152
152
|
};
|
|
153
|
+
|
|
154
|
+
const selectCustomFeedbackStyles = _ref7 => {
|
|
155
|
+
let {
|
|
156
|
+
feedbackBackgroundColor
|
|
157
|
+
} = _ref7;
|
|
158
|
+
return {
|
|
159
|
+
backgroundColor: feedbackBackgroundColor
|
|
160
|
+
};
|
|
161
|
+
};
|
|
153
162
|
/**
|
|
154
163
|
* A basic form single-choice select component. Use in forms or individually to receive user's input.
|
|
155
164
|
*
|
|
@@ -184,7 +193,7 @@ const selectValidationIconContainerStyles = _ref6 => {
|
|
|
184
193
|
*/
|
|
185
194
|
|
|
186
195
|
|
|
187
|
-
const Select = /*#__PURE__*/forwardRef((
|
|
196
|
+
const Select = /*#__PURE__*/forwardRef((_ref8, ref) => {
|
|
188
197
|
let {
|
|
189
198
|
value,
|
|
190
199
|
initialValue,
|
|
@@ -198,7 +207,7 @@ const Select = /*#__PURE__*/forwardRef((_ref7, ref) => {
|
|
|
198
207
|
variant,
|
|
199
208
|
testID,
|
|
200
209
|
...rest
|
|
201
|
-
} =
|
|
210
|
+
} = _ref8;
|
|
202
211
|
const {
|
|
203
212
|
currentValue,
|
|
204
213
|
setValue
|
|
@@ -240,11 +249,12 @@ const Select = /*#__PURE__*/forwardRef((_ref7, ref) => {
|
|
|
240
249
|
return /*#__PURE__*/_jsx(InputSupports, { ...supportsProps,
|
|
241
250
|
...selectedProps,
|
|
242
251
|
validation: validation,
|
|
243
|
-
|
|
252
|
+
feedbackTokens: selectCustomFeedbackStyles(themeTokens),
|
|
253
|
+
children: _ref9 => {
|
|
244
254
|
let {
|
|
245
255
|
inputId,
|
|
246
256
|
...props
|
|
247
|
-
} =
|
|
257
|
+
} = _ref9;
|
|
248
258
|
return /*#__PURE__*/_jsxs(View, {
|
|
249
259
|
style: selectOuterBorderStyles(themeTokens),
|
|
250
260
|
children: [/*#__PURE__*/_jsx(Picker, {
|
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.2.0",
|
|
14
|
-
"@telus-uds/system-theme-tokens": "^2.
|
|
14
|
+
"@telus-uds/system-theme-tokens": "^2.26.0",
|
|
15
15
|
"airbnb-prop-types": "^2.16.0",
|
|
16
16
|
"lodash.debounce": "^4.0.8",
|
|
17
17
|
"lodash.merge": "^4.6.2",
|
|
@@ -72,5 +72,5 @@
|
|
|
72
72
|
"standard-engine": {
|
|
73
73
|
"skip": true
|
|
74
74
|
},
|
|
75
|
-
"version": "1.
|
|
75
|
+
"version": "1.41.0"
|
|
76
76
|
}
|