@telus-uds/components-base 1.86.0 → 1.87.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/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/Radio/Radio.js +4 -0
- package/lib/Tabs/Tabs.js +4 -1
- package/lib/Tabs/TabsItem.js +7 -1
- 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/Radio/Radio.js +4 -0
- package/lib-module/Tabs/Tabs.js +4 -1
- package/lib-module/Tabs/TabsItem.js +7 -1
- 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/Radio/Radio.jsx +3 -1
- package/src/Tabs/Tabs.jsx +4 -1
- package/src/Tabs/TabsItem.jsx +5 -1
- package/src/index.js +1 -0
- package/src/utils/animation/useVerticalExpandAnimation.js +3 -3
- package/src/utils/props/tokens.js +4 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,30 @@
|
|
|
1
1
|
# Change Log - @telus-uds/components-base
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Mon, 24 Jun 2024 16:19:28 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## 1.87.0
|
|
8
|
+
|
|
9
|
+
Mon, 24 Jun 2024 16:19:28 GMT
|
|
10
|
+
|
|
11
|
+
### Minor changes
|
|
12
|
+
|
|
13
|
+
- `ActionCard`: add component (guillermo.peitzner@telus.com)
|
|
14
|
+
- `StickyNavigationBar`: add render prop to `TabItem` component (guillermo.peitzner@telus.com)
|
|
15
|
+
- Bump @telus-uds/system-theme-tokens to v2.58.0
|
|
16
|
+
|
|
17
|
+
### Patches
|
|
18
|
+
|
|
19
|
+
- `Modal`: fix overflow scrolling (guillermo.peitzner@telus.com)
|
|
20
|
+
- remove default focus outline on Radio and Checkbox components (evander.owusu@telus.com)
|
|
21
|
+
- `Notification`: fix alignment of the `system` variant for `Koodo` and `Public Mobile` (35577399+JoshHC@users.noreply.github.com)
|
|
22
|
+
- ExpandCollapse: issue that creates extra space at the bottom of the page fixed. (35577399+JoshHC@users.noreply.github.com)
|
|
23
|
+
- List: misalignment issue fixed when the text was too long and the container has display: 'flex' (35577399+JoshHC@users.noreply.github.com)
|
|
24
|
+
|
|
7
25
|
## 1.86.0
|
|
8
26
|
|
|
9
|
-
Fri, 07 Jun 2024 22:
|
|
27
|
+
Fri, 07 Jun 2024 22:42:09 GMT
|
|
10
28
|
|
|
11
29
|
### Minor changes
|
|
12
30
|
|
|
@@ -0,0 +1,350 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _Animated = _interopRequireDefault(require("react-native-web/dist/cjs/exports/Animated"));
|
|
9
|
+
var _View = _interopRequireDefault(require("react-native-web/dist/cjs/exports/View"));
|
|
10
|
+
var _StyleSheet = _interopRequireDefault(require("react-native-web/dist/cjs/exports/StyleSheet"));
|
|
11
|
+
var _Text = _interopRequireDefault(require("react-native-web/dist/cjs/exports/Text"));
|
|
12
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
|
+
var _ThemeProvider = require("../ThemeProvider");
|
|
14
|
+
var _utils = require("../utils");
|
|
15
|
+
var _Icon = _interopRequireDefault(require("../Icon"));
|
|
16
|
+
var _Card = _interopRequireDefault(require("../Card"));
|
|
17
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
18
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
|
+
const [selectProps, selectedSystemPropTypes] = (0, _utils.selectSystemProps)([_utils.a11yProps, _utils.linkProps, _utils.viewProps]);
|
|
20
|
+
const selectCardStyles = styles => ['borderColor', 'borderRadius', 'borderWidth'].reduce((acc, key) => {
|
|
21
|
+
if (styles[key]) acc[key] = styles[key];
|
|
22
|
+
return acc;
|
|
23
|
+
}, {});
|
|
24
|
+
const selectInteractiveCardStyles = _ref => {
|
|
25
|
+
let {
|
|
26
|
+
backgroundColor,
|
|
27
|
+
paddingBottom,
|
|
28
|
+
paddingLeft,
|
|
29
|
+
paddingRight,
|
|
30
|
+
paddingTop
|
|
31
|
+
} = _ref;
|
|
32
|
+
return {
|
|
33
|
+
...(backgroundColor && {
|
|
34
|
+
backgroundColor
|
|
35
|
+
}),
|
|
36
|
+
paddingBottom,
|
|
37
|
+
paddingLeft,
|
|
38
|
+
paddingRight,
|
|
39
|
+
paddingTop
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
const selectIconStyles = _ref2 => {
|
|
43
|
+
let {
|
|
44
|
+
iconMarginBottom,
|
|
45
|
+
iconMarginLeft,
|
|
46
|
+
iconMarginRight,
|
|
47
|
+
iconMarginTop
|
|
48
|
+
} = _ref2;
|
|
49
|
+
return {
|
|
50
|
+
marginBottom: iconMarginBottom,
|
|
51
|
+
marginLeft: iconMarginLeft,
|
|
52
|
+
marginRight: iconMarginRight,
|
|
53
|
+
marginTop: iconMarginTop
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
const selectIconProps = _ref3 => {
|
|
57
|
+
let {
|
|
58
|
+
icon,
|
|
59
|
+
iconBackgroundColor,
|
|
60
|
+
iconColor
|
|
61
|
+
} = _ref3;
|
|
62
|
+
return {
|
|
63
|
+
icon,
|
|
64
|
+
variant: {
|
|
65
|
+
background: true,
|
|
66
|
+
padding: 'small'
|
|
67
|
+
},
|
|
68
|
+
tokens: {
|
|
69
|
+
backgroundColor: iconBackgroundColor,
|
|
70
|
+
color: iconColor
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
const selectTitleStyles = _ref4 => {
|
|
75
|
+
let {
|
|
76
|
+
titleMarginBottom,
|
|
77
|
+
titleMarginLeft,
|
|
78
|
+
titleMarginRight,
|
|
79
|
+
titleMarginTop
|
|
80
|
+
} = _ref4;
|
|
81
|
+
return {
|
|
82
|
+
marginBottom: titleMarginBottom,
|
|
83
|
+
marginLeft: titleMarginLeft,
|
|
84
|
+
marginRight: titleMarginRight,
|
|
85
|
+
marginTop: titleMarginTop
|
|
86
|
+
};
|
|
87
|
+
};
|
|
88
|
+
const selectTitleTextStyles = _ref5 => {
|
|
89
|
+
let {
|
|
90
|
+
titleFontColor,
|
|
91
|
+
titleFontName,
|
|
92
|
+
titleFontSize,
|
|
93
|
+
titleFontWeight,
|
|
94
|
+
titleLineHeight
|
|
95
|
+
} = _ref5;
|
|
96
|
+
return (0, _ThemeProvider.applyTextStyles)({
|
|
97
|
+
fontColor: titleFontColor,
|
|
98
|
+
fontName: titleFontName,
|
|
99
|
+
fontSize: titleFontSize,
|
|
100
|
+
fontWeight: titleFontWeight,
|
|
101
|
+
lineHeight: titleLineHeight
|
|
102
|
+
});
|
|
103
|
+
};
|
|
104
|
+
const selectContentStyles = _ref6 => {
|
|
105
|
+
let {
|
|
106
|
+
contentMarginBottom,
|
|
107
|
+
contentMarginLeft,
|
|
108
|
+
contentMarginRight,
|
|
109
|
+
contentMarginTop
|
|
110
|
+
} = _ref6;
|
|
111
|
+
return {
|
|
112
|
+
marginBottom: contentMarginBottom,
|
|
113
|
+
marginLeft: contentMarginLeft,
|
|
114
|
+
marginRight: contentMarginRight,
|
|
115
|
+
marginTop: contentMarginTop
|
|
116
|
+
};
|
|
117
|
+
};
|
|
118
|
+
const selectContentTextStyles = _ref7 => {
|
|
119
|
+
let {
|
|
120
|
+
contentFontColor,
|
|
121
|
+
contentFontName,
|
|
122
|
+
contentFontSize,
|
|
123
|
+
contentFontWeight,
|
|
124
|
+
contentLineHeight
|
|
125
|
+
} = _ref7;
|
|
126
|
+
return (0, _ThemeProvider.applyTextStyles)({
|
|
127
|
+
fontColor: contentFontColor,
|
|
128
|
+
fontName: contentFontName,
|
|
129
|
+
fontSize: contentFontSize,
|
|
130
|
+
fontWeight: contentFontWeight,
|
|
131
|
+
lineHeight: contentLineHeight
|
|
132
|
+
});
|
|
133
|
+
};
|
|
134
|
+
const selectStatusIconProps = _ref8 => {
|
|
135
|
+
let {
|
|
136
|
+
statusIcon,
|
|
137
|
+
statusIconColor
|
|
138
|
+
} = _ref8;
|
|
139
|
+
return {
|
|
140
|
+
icon: statusIcon,
|
|
141
|
+
tokens: {
|
|
142
|
+
color: statusIconColor
|
|
143
|
+
},
|
|
144
|
+
variant: {
|
|
145
|
+
size: 'micro'
|
|
146
|
+
}
|
|
147
|
+
};
|
|
148
|
+
};
|
|
149
|
+
const selectActionIconStyles = _ref9 => {
|
|
150
|
+
let {
|
|
151
|
+
actionIconMarginBottom,
|
|
152
|
+
actionIconMarginLeft,
|
|
153
|
+
actionIconMarginRight,
|
|
154
|
+
actionIconMarginTop
|
|
155
|
+
} = _ref9;
|
|
156
|
+
return {
|
|
157
|
+
marginBottom: actionIconMarginBottom,
|
|
158
|
+
marginLeft: actionIconMarginLeft,
|
|
159
|
+
marginRight: actionIconMarginRight,
|
|
160
|
+
marginTop: actionIconMarginTop
|
|
161
|
+
};
|
|
162
|
+
};
|
|
163
|
+
const selectActionIconProps = _ref10 => {
|
|
164
|
+
let {
|
|
165
|
+
actionIcon,
|
|
166
|
+
actionIconColor
|
|
167
|
+
} = _ref10;
|
|
168
|
+
return {
|
|
169
|
+
icon: actionIcon,
|
|
170
|
+
tokens: {
|
|
171
|
+
color: actionIconColor
|
|
172
|
+
}
|
|
173
|
+
};
|
|
174
|
+
};
|
|
175
|
+
const ACTION_ICON_ANIMATION_DURATION = 100;
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* ActionCard component represents a card with an action that can be triggered by the user.
|
|
179
|
+
*
|
|
180
|
+
* @component
|
|
181
|
+
* @example
|
|
182
|
+
* return (
|
|
183
|
+
* <ActionCard
|
|
184
|
+
* icon={<Icon icon={Icons.EyeMasked} />}
|
|
185
|
+
* title="Like"
|
|
186
|
+
* href="/like"
|
|
187
|
+
* accessibilityRole="link"
|
|
188
|
+
* tokens={themeTokens}
|
|
189
|
+
* variant={{validation: 'warning'}}
|
|
190
|
+
* onPress={() => handleLike()}
|
|
191
|
+
* >
|
|
192
|
+
* Click here to like the post
|
|
193
|
+
* </ActionCard>
|
|
194
|
+
* )
|
|
195
|
+
*/
|
|
196
|
+
const ActionCard = /*#__PURE__*/_react.default.forwardRef((_ref11, ref) => {
|
|
197
|
+
let {
|
|
198
|
+
icon,
|
|
199
|
+
title,
|
|
200
|
+
children,
|
|
201
|
+
href,
|
|
202
|
+
direction = true,
|
|
203
|
+
accessibilityRole,
|
|
204
|
+
tokens,
|
|
205
|
+
variant,
|
|
206
|
+
...rest
|
|
207
|
+
} = _ref11;
|
|
208
|
+
const themeTokens = (0, _ThemeProvider.useThemeTokens)('ActionCard', tokens, variant);
|
|
209
|
+
const actionIconAnimation = _react.default.useRef(new _Animated.default.Value(0)).current;
|
|
210
|
+
const {
|
|
211
|
+
onPress,
|
|
212
|
+
...props
|
|
213
|
+
} = _utils.clickProps.toPressProps(rest);
|
|
214
|
+
const {
|
|
215
|
+
hrefAttrs,
|
|
216
|
+
rawRest
|
|
217
|
+
} = _utils.hrefAttrsProp.bundle(props);
|
|
218
|
+
const selectedProps = selectProps({
|
|
219
|
+
accessibilityRole,
|
|
220
|
+
href,
|
|
221
|
+
onPress: _utils.linkProps.handleHref({
|
|
222
|
+
href,
|
|
223
|
+
onPress
|
|
224
|
+
}),
|
|
225
|
+
hrefAttrs,
|
|
226
|
+
...rawRest
|
|
227
|
+
});
|
|
228
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Card.default, {
|
|
229
|
+
ref: ref,
|
|
230
|
+
interactiveCard: {
|
|
231
|
+
body: pressableState => {
|
|
232
|
+
const animate = pressableState.pressed || pressableState.hover || pressableState.focus;
|
|
233
|
+
_Animated.default.timing(actionIconAnimation, {
|
|
234
|
+
toValue: animate ? themeTokens.actionIconTranslate : 0,
|
|
235
|
+
duration: ACTION_ICON_ANIMATION_DURATION,
|
|
236
|
+
useNativeDriver: false
|
|
237
|
+
}).start();
|
|
238
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_View.default, {
|
|
239
|
+
style: staticStyles.container,
|
|
240
|
+
children: [icon && /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, {
|
|
241
|
+
style: selectIconStyles(themeTokens),
|
|
242
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.default, {
|
|
243
|
+
...selectIconProps({
|
|
244
|
+
icon,
|
|
245
|
+
...themeTokens
|
|
246
|
+
})
|
|
247
|
+
})
|
|
248
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_View.default, {
|
|
249
|
+
style: staticStyles.content,
|
|
250
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_View.default, {
|
|
251
|
+
style: staticStyles.header,
|
|
252
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, {
|
|
253
|
+
style: [selectTitleStyles(themeTokens), staticStyles.title],
|
|
254
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Text.default, {
|
|
255
|
+
children: [(0, _utils.wrapStringsInText)(title, {
|
|
256
|
+
style: selectTitleTextStyles(themeTokens)
|
|
257
|
+
}), themeTokens.statusIcon && /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, {
|
|
258
|
+
style: staticStyles.statusIcon,
|
|
259
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.default, {
|
|
260
|
+
...selectStatusIconProps(themeTokens)
|
|
261
|
+
})
|
|
262
|
+
})]
|
|
263
|
+
})
|
|
264
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, {
|
|
265
|
+
style: staticStyles.icons,
|
|
266
|
+
children: direction && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Animated.default.View, {
|
|
267
|
+
style: [selectActionIconStyles(themeTokens), {
|
|
268
|
+
transform: [{
|
|
269
|
+
translateX: actionIconAnimation
|
|
270
|
+
}]
|
|
271
|
+
}],
|
|
272
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.default, {
|
|
273
|
+
...selectActionIconProps(themeTokens)
|
|
274
|
+
})
|
|
275
|
+
})
|
|
276
|
+
})]
|
|
277
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, {
|
|
278
|
+
style: [staticStyles.body, selectContentStyles(themeTokens)],
|
|
279
|
+
children: typeof children === 'string' ? (0, _utils.wrapStringsInText)(children, {
|
|
280
|
+
style: selectContentTextStyles(themeTokens)
|
|
281
|
+
}) : children
|
|
282
|
+
})]
|
|
283
|
+
})]
|
|
284
|
+
});
|
|
285
|
+
},
|
|
286
|
+
tokens: selectInteractiveCardStyles(themeTokens)
|
|
287
|
+
},
|
|
288
|
+
tokens: selectCardStyles(themeTokens),
|
|
289
|
+
...selectedProps
|
|
290
|
+
});
|
|
291
|
+
});
|
|
292
|
+
ActionCard.displayName = 'ActionCard';
|
|
293
|
+
ActionCard.propTypes = {
|
|
294
|
+
...selectedSystemPropTypes,
|
|
295
|
+
tokens: (0, _utils.getTokensPropType)('ActionCard'),
|
|
296
|
+
variant: _utils.variantProp.propType,
|
|
297
|
+
/**
|
|
298
|
+
* Icon for the ActionCard
|
|
299
|
+
*/
|
|
300
|
+
icon: _propTypes.default.elementType,
|
|
301
|
+
/**
|
|
302
|
+
* Title for the ActionCard
|
|
303
|
+
*/
|
|
304
|
+
title: _propTypes.default.string,
|
|
305
|
+
/**
|
|
306
|
+
* Children for the ActionCard
|
|
307
|
+
*/
|
|
308
|
+
children: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.elementType]),
|
|
309
|
+
/**
|
|
310
|
+
* href for the ActionCard
|
|
311
|
+
*/
|
|
312
|
+
href: _propTypes.default.string,
|
|
313
|
+
/**
|
|
314
|
+
* Enable or disable the direction of the ActionCard
|
|
315
|
+
*/
|
|
316
|
+
direction: _propTypes.default.bool,
|
|
317
|
+
/**
|
|
318
|
+
* AccesibilityRole for the ActionCard
|
|
319
|
+
*/
|
|
320
|
+
accessibilityRole: _propTypes.default.string
|
|
321
|
+
};
|
|
322
|
+
const staticStyles = _StyleSheet.default.create({
|
|
323
|
+
body: {
|
|
324
|
+
flexDirection: 'column'
|
|
325
|
+
},
|
|
326
|
+
container: {
|
|
327
|
+
flex: 1,
|
|
328
|
+
flexDirection: 'row'
|
|
329
|
+
},
|
|
330
|
+
content: {
|
|
331
|
+
flex: 1,
|
|
332
|
+
flexDirection: 'column'
|
|
333
|
+
},
|
|
334
|
+
icons: {
|
|
335
|
+
flexDirection: 'row',
|
|
336
|
+
alignItems: 'center'
|
|
337
|
+
},
|
|
338
|
+
header: {
|
|
339
|
+
flexDirection: 'row',
|
|
340
|
+
justifyContent: 'space-between'
|
|
341
|
+
},
|
|
342
|
+
title: {
|
|
343
|
+
flexShrink: 1
|
|
344
|
+
},
|
|
345
|
+
statusIcon: {
|
|
346
|
+
marginLeft: 4
|
|
347
|
+
}
|
|
348
|
+
});
|
|
349
|
+
var _default = ActionCard;
|
|
350
|
+
exports.default = _default;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _ActionCard = _interopRequireDefault(require("./ActionCard"));
|
|
8
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
9
|
+
var _default = _ActionCard.default;
|
|
10
|
+
exports.default = _default;
|
package/lib/Card/Card.js
CHANGED
|
@@ -17,7 +17,7 @@ var _CheckboxButton = _interopRequireDefault(require("../Checkbox/CheckboxButton
|
|
|
17
17
|
var _RadioButton = _interopRequireDefault(require("../Radio/RadioButton"));
|
|
18
18
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
19
19
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
20
|
-
const [selectProps, selectedSystemPropTypes] = (0, _props.selectSystemProps)([_props.a11yProps, _props.viewProps]);
|
|
20
|
+
const [selectProps, selectedSystemPropTypes] = (0, _props.selectSystemProps)([_props.a11yProps, _props.viewProps, _props.linkProps]);
|
|
21
21
|
const SelectionType = {
|
|
22
22
|
Checkbox: 'checkbox',
|
|
23
23
|
Radio: 'radiogroup',
|
|
@@ -272,7 +272,7 @@ const Card = /*#__PURE__*/_react.default.forwardRef((_ref3, ref) => {
|
|
|
272
272
|
isChecked: selected || (cardState === null || cardState === void 0 ? void 0 : cardState.hover),
|
|
273
273
|
isInactive: inactive,
|
|
274
274
|
onPress
|
|
275
|
-
})), interactiveCard === null || interactiveCard === void 0 ? void 0 : interactiveCard.body]
|
|
275
|
+
})), typeof (interactiveCard === null || interactiveCard === void 0 ? void 0 : interactiveCard.body) === 'function' ? interactiveCard.body(cardState) : interactiveCard.body]
|
|
276
276
|
});
|
|
277
277
|
}
|
|
278
278
|
}), children && selectionType !== SelectionType.None ? renderNoSelectionView() : null]
|
|
@@ -314,7 +314,7 @@ Card.propTypes = {
|
|
|
314
314
|
* - variant: The variant to be used for the interactive card
|
|
315
315
|
*/
|
|
316
316
|
interactiveCard: _propTypes.default.shape({
|
|
317
|
-
body: _propTypes.default.node,
|
|
317
|
+
body: _propTypes.default.oneOfType([_propTypes.default.node, _propTypes.default.func]),
|
|
318
318
|
tokens: (0, _utils.getTokensPropType)('Card'),
|
|
319
319
|
selectionType: _propTypes.default.oneOf(Object.values(SelectionType)),
|
|
320
320
|
variant: _utils.variantProp.propType
|
|
@@ -112,7 +112,7 @@ PressableCardBase.propTypes = {
|
|
|
112
112
|
...selectedSystemPropTypes,
|
|
113
113
|
children: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.node]),
|
|
114
114
|
tokens: (0, _utils.getTokensSetPropType)(tokenKeys, {
|
|
115
|
-
|
|
115
|
+
partial: true,
|
|
116
116
|
allowFunction: true
|
|
117
117
|
}),
|
|
118
118
|
variant: _utils.variantProp.propType
|
package/lib/Checkbox/Checkbox.js
CHANGED
|
@@ -210,6 +210,7 @@ const Checkbox = /*#__PURE__*/_react.default.forwardRef((_ref5, ref) => {
|
|
|
210
210
|
onKeyDown: handleKeyDown,
|
|
211
211
|
onPress: handleChange,
|
|
212
212
|
...selectedProps,
|
|
213
|
+
style: staticStyles.removeOutline,
|
|
213
214
|
children: _ref6 => {
|
|
214
215
|
let {
|
|
215
216
|
focused: focus,
|
|
@@ -342,5 +343,8 @@ const staticStyles = _StyleSheet.default.create({
|
|
|
342
343
|
alignWithLabel: {
|
|
343
344
|
alignSelf: 'flex-start',
|
|
344
345
|
justifyContent: 'center'
|
|
346
|
+
},
|
|
347
|
+
removeOutline: {
|
|
348
|
+
outlineStyle: 'none'
|
|
345
349
|
}
|
|
346
350
|
});
|
package/lib/List/List.js
CHANGED
|
@@ -49,15 +49,22 @@ const List = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
|
|
|
49
49
|
}
|
|
50
50
|
return child;
|
|
51
51
|
});
|
|
52
|
-
|
|
53
|
-
ref: ref,
|
|
52
|
+
const content = /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, {
|
|
54
53
|
style: styles.list,
|
|
55
54
|
accessibilityRole: accessibilityRole,
|
|
55
|
+
ref: ref,
|
|
56
56
|
...selectProps(rest),
|
|
57
57
|
children: items
|
|
58
58
|
});
|
|
59
|
+
return _Platform.default.OS === 'web' ? /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
60
|
+
style: styles.container,
|
|
61
|
+
children: content
|
|
62
|
+
}) : content;
|
|
59
63
|
});
|
|
60
64
|
const styles = _StyleSheet.default.create({
|
|
65
|
+
container: {
|
|
66
|
+
display: 'block'
|
|
67
|
+
},
|
|
61
68
|
list: {
|
|
62
69
|
flex: 1,
|
|
63
70
|
flexShrink: 1
|
package/lib/Modal/WebModal.js
CHANGED
|
@@ -66,13 +66,17 @@ const selectDismissButtonContainerStyles = _ref4 => {
|
|
|
66
66
|
} = _ref4;
|
|
67
67
|
return {
|
|
68
68
|
paddingLeft: dismissButtonGap,
|
|
69
|
-
placeContent: '
|
|
69
|
+
placeContent: 'start'
|
|
70
70
|
};
|
|
71
71
|
};
|
|
72
|
-
const selectContentContainerStyle = maxWidth => ({
|
|
73
|
-
maxWidth: maxWidth
|
|
72
|
+
const selectContentContainerStyle = (themeTokens, maxWidth, viewport, system) => ({
|
|
73
|
+
maxWidth: viewport === 'xl' && system === true ? maxWidth : 'auto',
|
|
74
|
+
minWidth: viewport === 'xl' && system === true ? maxWidth : 'auto',
|
|
75
|
+
paddingRight: themeTokens === null || themeTokens === void 0 ? void 0 : themeTokens.containerPaddingRight,
|
|
76
|
+
paddingLeft: themeTokens === null || themeTokens === void 0 ? void 0 : themeTokens.containerPaddingLeft
|
|
74
77
|
});
|
|
75
|
-
const getMediaQueryStyles = (themeTokens, themeOptions,
|
|
78
|
+
const getMediaQueryStyles = (themeTokens, themeOptions, mediaIdsRef, dismissible, viewport, system) => {
|
|
79
|
+
var _themeOptions$content, _themeOptions$content2, _themeOptions$content3, _themeOptions$content4, _themeOptions$content5;
|
|
76
80
|
const transformedSelectContainerStyles = Object.entries(themeTokens).reduce((acc, _ref5) => {
|
|
77
81
|
let [vp, viewportTokens] = _ref5;
|
|
78
82
|
acc[vp] = selectContainerStyles({
|
|
@@ -86,7 +90,7 @@ const getMediaQueryStyles = (themeTokens, themeOptions, viewport, mediaIdsRef, d
|
|
|
86
90
|
styles: containerStyles
|
|
87
91
|
} = _utils.StyleSheet.create({
|
|
88
92
|
container: {
|
|
89
|
-
flexDirection: 'row',
|
|
93
|
+
flexDirection: system === true && viewport === 'xl' ? 'row' : 'inherit',
|
|
90
94
|
...selectContainerMediaQueryStyles
|
|
91
95
|
}
|
|
92
96
|
});
|
|
@@ -100,19 +104,19 @@ const getMediaQueryStyles = (themeTokens, themeOptions, viewport, mediaIdsRef, d
|
|
|
100
104
|
justifyContent: 'space-between',
|
|
101
105
|
...(0, _utils.createMediaQueryStyles)({
|
|
102
106
|
xs: {
|
|
103
|
-
width: (themeOptions === null || themeOptions === void 0 ? void 0 : themeOptions.contentMaxWidth.xs) || '100%'
|
|
107
|
+
width: (themeOptions === null || themeOptions === void 0 ? void 0 : (_themeOptions$content = themeOptions.contentMaxWidth) === null || _themeOptions$content === void 0 ? void 0 : _themeOptions$content.xs) || '100%'
|
|
104
108
|
},
|
|
105
109
|
md: {
|
|
106
|
-
width: (themeOptions === null || themeOptions === void 0 ? void 0 : themeOptions.contentMaxWidth.md) || '100%'
|
|
110
|
+
width: (themeOptions === null || themeOptions === void 0 ? void 0 : (_themeOptions$content2 = themeOptions.contentMaxWidth) === null || _themeOptions$content2 === void 0 ? void 0 : _themeOptions$content2.md) || '100%'
|
|
107
111
|
},
|
|
108
112
|
lg: {
|
|
109
|
-
width: (themeOptions === null || themeOptions === void 0 ? void 0 : themeOptions.contentMaxWidth.lg) || '100%'
|
|
113
|
+
width: (themeOptions === null || themeOptions === void 0 ? void 0 : (_themeOptions$content3 = themeOptions.contentMaxWidth) === null || _themeOptions$content3 === void 0 ? void 0 : _themeOptions$content3.lg) || '100%'
|
|
110
114
|
},
|
|
111
115
|
sm: {
|
|
112
|
-
width: (themeOptions === null || themeOptions === void 0 ? void 0 : themeOptions.contentMaxWidth.sm) || '100%'
|
|
116
|
+
width: (themeOptions === null || themeOptions === void 0 ? void 0 : (_themeOptions$content4 = themeOptions.contentMaxWidth) === null || _themeOptions$content4 === void 0 ? void 0 : _themeOptions$content4.sm) || '100%'
|
|
113
117
|
},
|
|
114
118
|
xl: {
|
|
115
|
-
width: (themeOptions === null || themeOptions === void 0 ? void 0 : themeOptions.contentMaxWidth.xl) || '100%'
|
|
119
|
+
width: (themeOptions === null || themeOptions === void 0 ? void 0 : (_themeOptions$content5 = themeOptions.contentMaxWidth) === null || _themeOptions$content5 === void 0 ? void 0 : _themeOptions$content5.xl) || '100%'
|
|
116
120
|
}
|
|
117
121
|
})
|
|
118
122
|
}
|
|
@@ -175,19 +179,20 @@ const getMediaQueryStyles = (themeTokens, themeOptions, viewport, mediaIdsRef, d
|
|
|
175
179
|
selectDismissIconPropsStyles
|
|
176
180
|
};
|
|
177
181
|
};
|
|
178
|
-
const getDefaultStyles = (themeTokens, themeOptions, maxWidth, dismissible) => ({
|
|
182
|
+
const getDefaultStyles = (themeTokens, themeOptions, maxWidth, dismissible, viewport, system) => ({
|
|
179
183
|
containerStyles: {
|
|
180
184
|
container: {
|
|
181
|
-
flexDirection: 'row',
|
|
185
|
+
flexDirection: system === true && viewport === 'xl' ? 'row' : 'inherit',
|
|
182
186
|
...selectContainerStyles(themeTokens)
|
|
183
187
|
}
|
|
184
188
|
},
|
|
185
189
|
contentContainerStyles: {
|
|
186
190
|
contentContainer: {
|
|
191
|
+
flex: 1,
|
|
187
192
|
flexDirection: 'row',
|
|
188
193
|
flexShrink: 1,
|
|
189
194
|
justifyContent: 'space-between',
|
|
190
|
-
...selectContentContainerStyle(maxWidth)
|
|
195
|
+
...selectContentContainerStyle(themeTokens, maxWidth, viewport, system)
|
|
191
196
|
}
|
|
192
197
|
},
|
|
193
198
|
staticContentContainerStyles: {
|
|
@@ -323,9 +328,9 @@ const Notification = /*#__PURE__*/_react.default.forwardRef((_ref6, ref) => {
|
|
|
323
328
|
selectDismissIconPropsIds: {}
|
|
324
329
|
});
|
|
325
330
|
if (enableMediaQueryStyleSheet) {
|
|
326
|
-
notificationComponentRef.current = getMediaQueryStyles(themeTokens, themeOptions,
|
|
331
|
+
notificationComponentRef.current = getMediaQueryStyles(themeTokens, themeOptions, mediaIdsRef, dismissible, viewport, system);
|
|
327
332
|
} else {
|
|
328
|
-
notificationComponentRef.current = getDefaultStyles(themeTokens, themeOptions, maxWidth, dismissible);
|
|
333
|
+
notificationComponentRef.current = getDefaultStyles(themeTokens, themeOptions, maxWidth, dismissible, viewport, system);
|
|
329
334
|
}
|
|
330
335
|
if (isDismissed) {
|
|
331
336
|
return null;
|
package/lib/Radio/Radio.js
CHANGED
|
@@ -172,6 +172,7 @@ const Radio = /*#__PURE__*/_react.default.forwardRef((_ref4, ref) => {
|
|
|
172
172
|
onKeyDown: handleKeyDown,
|
|
173
173
|
onPress: handleChange,
|
|
174
174
|
...selectedProps,
|
|
175
|
+
style: staticStyles.removeOutline,
|
|
175
176
|
children: _ref5 => {
|
|
176
177
|
let {
|
|
177
178
|
focused: focus,
|
|
@@ -284,5 +285,8 @@ const staticStyles = _StyleSheet.default.create({
|
|
|
284
285
|
alignWithLabel: {
|
|
285
286
|
alignSelf: 'flex-start',
|
|
286
287
|
justifyContent: 'center'
|
|
288
|
+
},
|
|
289
|
+
removeOutline: {
|
|
290
|
+
outlineStyle: 'none'
|
|
287
291
|
}
|
|
288
292
|
});
|
package/lib/Tabs/Tabs.js
CHANGED
|
@@ -115,6 +115,7 @@ const Tabs = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
|
|
|
115
115
|
ref: itemRef,
|
|
116
116
|
LinkRouter: ItemLinkRouter = LinkRouter,
|
|
117
117
|
linkRouterProps: itemLinkRouterProps,
|
|
118
|
+
render,
|
|
118
119
|
...itemRest
|
|
119
120
|
} = _ref3;
|
|
120
121
|
const itemId = id ?? label;
|
|
@@ -140,6 +141,7 @@ const Tabs = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
|
|
|
140
141
|
...linkRouterProps,
|
|
141
142
|
...itemLinkRouterProps
|
|
142
143
|
},
|
|
144
|
+
render: render,
|
|
143
145
|
...itemProps,
|
|
144
146
|
children: label
|
|
145
147
|
}, itemId);
|
|
@@ -160,7 +162,8 @@ Tabs.propTypes = {
|
|
|
160
162
|
href: _propTypes.default.string,
|
|
161
163
|
label: _propTypes.default.string,
|
|
162
164
|
id: _propTypes.default.string,
|
|
163
|
-
ref: _airbnbPropTypes.default.ref()
|
|
165
|
+
ref: _airbnbPropTypes.default.ref(),
|
|
166
|
+
render: _propTypes.default.func
|
|
164
167
|
})),
|
|
165
168
|
/**
|
|
166
169
|
* `id` property of the current tab in the items array
|
package/lib/Tabs/TabsItem.js
CHANGED
|
@@ -101,6 +101,7 @@ const TabsItem = /*#__PURE__*/_react.default.forwardRef((_ref4, ref) => {
|
|
|
101
101
|
selected
|
|
102
102
|
} : undefined,
|
|
103
103
|
id,
|
|
104
|
+
render,
|
|
104
105
|
...rawRest
|
|
105
106
|
} = _ref4;
|
|
106
107
|
// Convert onClick etc to onPress etc if used in an integration
|
|
@@ -156,6 +157,10 @@ const TabsItem = /*#__PURE__*/_react.default.forwardRef((_ref4, ref) => {
|
|
|
156
157
|
}
|
|
157
158
|
// itemPositions is a ref object so this should only re-run when `selected` (or `index`) change
|
|
158
159
|
}, [selected, index, itemPositions]);
|
|
160
|
+
if (render) return render({
|
|
161
|
+
selected,
|
|
162
|
+
handlePress
|
|
163
|
+
});
|
|
159
164
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Pressable.default, {
|
|
160
165
|
ref: ref,
|
|
161
166
|
onPress: handlePress,
|
|
@@ -213,7 +218,8 @@ TabsItem.propTypes = {
|
|
|
213
218
|
selected: _propTypes.default.bool,
|
|
214
219
|
itemPositions: itemPositionsPropType,
|
|
215
220
|
children: _propTypes.default.string,
|
|
216
|
-
id: _propTypes.default.string
|
|
221
|
+
id: _propTypes.default.string,
|
|
222
|
+
render: _propTypes.default.func
|
|
217
223
|
};
|
|
218
224
|
const staticStyles = _StyleSheet.default.create({
|
|
219
225
|
center: {
|
package/lib/index.js
CHANGED
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
var _exportNames = {
|
|
7
7
|
A11yText: true,
|
|
8
|
+
ActionCard: true,
|
|
8
9
|
ActivityIndicator: true,
|
|
9
10
|
Autocomplete: true,
|
|
10
11
|
Box: true,
|
|
@@ -97,6 +98,12 @@ Object.defineProperty(exports, "Accordion", {
|
|
|
97
98
|
return _ExpandCollapse.Accordion;
|
|
98
99
|
}
|
|
99
100
|
});
|
|
101
|
+
Object.defineProperty(exports, "ActionCard", {
|
|
102
|
+
enumerable: true,
|
|
103
|
+
get: function () {
|
|
104
|
+
return _ActionCard.default;
|
|
105
|
+
}
|
|
106
|
+
});
|
|
100
107
|
Object.defineProperty(exports, "ActivityIndicator", {
|
|
101
108
|
enumerable: true,
|
|
102
109
|
get: function () {
|
|
@@ -524,6 +531,7 @@ Object.defineProperty(exports, "useViewport", {
|
|
|
524
531
|
}
|
|
525
532
|
});
|
|
526
533
|
var _A11yText = _interopRequireDefault(require("./A11yText"));
|
|
534
|
+
var _ActionCard = _interopRequireDefault(require("./ActionCard"));
|
|
527
535
|
var _ActivityIndicator = _interopRequireDefault(require("./ActivityIndicator"));
|
|
528
536
|
var _Autocomplete = _interopRequireDefault(require("./Autocomplete"));
|
|
529
537
|
var _Box = _interopRequireDefault(require("./Box"));
|