@telus-uds/components-base 3.27.0 → 3.28.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 +21 -5
- package/lib/cjs/Card/CardBase.js +12 -3
- package/lib/cjs/ExpandCollapse/Control.js +5 -1
- package/lib/cjs/ExpandCollapse/ExpandCollapse.js +17 -8
- package/lib/cjs/ExpandCollapse/Panel.js +7 -2
- package/lib/cjs/IconButton/IconButton.js +10 -5
- package/lib/cjs/Modal/Modal.js +21 -11
- package/lib/cjs/Progress/Progress.js +19 -5
- package/lib/cjs/Progress/ProgressBar.js +22 -4
- package/lib/cjs/Progress/ProgressContext.js +11 -0
- package/lib/cjs/SideNav/Item.js +3 -3
- package/lib/cjs/SideNav/ItemsGroup.js +46 -19
- package/lib/cjs/SideNav/SideNav.js +29 -13
- package/lib/esm/Card/CardBase.js +12 -3
- package/lib/esm/ExpandCollapse/Control.js +5 -1
- package/lib/esm/ExpandCollapse/ExpandCollapse.js +17 -8
- package/lib/esm/ExpandCollapse/Panel.js +7 -2
- package/lib/esm/IconButton/IconButton.js +10 -5
- package/lib/esm/Modal/Modal.js +21 -11
- package/lib/esm/Progress/Progress.js +19 -5
- package/lib/esm/Progress/ProgressBar.js +22 -4
- package/lib/esm/Progress/ProgressContext.js +5 -0
- package/lib/esm/SideNav/Item.js +3 -3
- package/lib/esm/SideNav/ItemsGroup.js +45 -20
- package/lib/esm/SideNav/SideNav.js +29 -13
- package/lib/package.json +2 -2
- package/package.json +2 -2
- package/src/Card/CardBase.jsx +9 -3
- package/src/ExpandCollapse/Control.jsx +1 -1
- package/src/ExpandCollapse/ExpandCollapse.jsx +9 -8
- package/src/ExpandCollapse/Panel.jsx +10 -2
- package/src/IconButton/IconButton.jsx +40 -28
- package/src/Modal/Modal.jsx +23 -11
- package/src/Progress/Progress.jsx +18 -7
- package/src/Progress/ProgressBar.jsx +19 -14
- package/src/Progress/ProgressContext.js +5 -0
- package/src/SideNav/Item.jsx +3 -3
- package/src/SideNav/ItemsGroup.jsx +36 -16
- package/src/SideNav/SideNav.jsx +22 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,19 +1,35 @@
|
|
|
1
1
|
# Change Log - @telus-uds/components-base
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Wed, 18 Feb 2026 02:50:19 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## 3.28.0
|
|
8
|
+
|
|
9
|
+
Wed, 18 Feb 2026 02:50:19 GMT
|
|
10
|
+
|
|
11
|
+
### Minor changes
|
|
12
|
+
|
|
13
|
+
- `SideNav`: Update code logic to support top and bottom borders (david.melara1@telus.com)
|
|
14
|
+
- `ProgressBar`: add layers variant for controlling bar positioning (sergio.ramirez@telus.com)
|
|
15
|
+
- `Modal`: Add `backgroundDismissible` prop to control backdrop dismissal behavior with dynamic cursor styling (josue.higueroscalderon@telus.com)
|
|
16
|
+
- Bump @telus-uds/system-theme-tokens to v4.20.0
|
|
17
|
+
|
|
18
|
+
### Patches
|
|
19
|
+
|
|
20
|
+
- `Card`: background image hidden behind the default background color issue fixed (josue.higueroscalderon@telus.com)
|
|
21
|
+
- `IconButton`: Fix wrong specific padding calculation (david.melara1@telus.com)
|
|
22
|
+
|
|
7
23
|
## 3.27.0
|
|
8
24
|
|
|
9
|
-
Thu, 29 Jan 2026
|
|
25
|
+
Thu, 29 Jan 2026 15:50:16 GMT
|
|
10
26
|
|
|
11
27
|
### Minor changes
|
|
12
28
|
|
|
13
|
-
- `Checkbox`: Add padding token (david.melara1@telus.com)
|
|
14
|
-
- `Card`: Add inputPosition prop to InteractiveCard (david.melara1@telus.com)
|
|
15
|
-
- `List`: new feature alignment for the icons added (josue.higueroscalderon@telus.com)
|
|
16
29
|
- `Card`: Add full-bleed content support to Card component allowing content to extend to card edges (josue.higueroscalderon@telus.com)
|
|
30
|
+
- `List`: new feature alignment for the icons added (josue.higueroscalderon@telus.com)
|
|
31
|
+
- `Card`: Add inputPosition prop to InteractiveCard (david.melara1@telus.com)
|
|
32
|
+
- `Checkbox`: Add padding token (david.melara1@telus.com)
|
|
17
33
|
- Bump @telus-uds/system-theme-tokens to v4.19.0
|
|
18
34
|
|
|
19
35
|
### Patches
|
package/lib/cjs/Card/CardBase.js
CHANGED
|
@@ -236,7 +236,13 @@ const CardBase = /*#__PURE__*/_react.default.forwardRef((_ref5, ref) => {
|
|
|
236
236
|
cardState,
|
|
237
237
|
...rest
|
|
238
238
|
} = _ref5;
|
|
239
|
-
const
|
|
239
|
+
const resolvedTokens = typeof tokens === 'function' ? tokens(cardState) : tokens;
|
|
240
|
+
const tokensToUse = backgroundImage && backgroundImage.src ? {
|
|
241
|
+
...resolvedTokens,
|
|
242
|
+
gradient: undefined,
|
|
243
|
+
backgroundGradient: undefined
|
|
244
|
+
} : resolvedTokens;
|
|
245
|
+
const cardStyle = selectStyles(tokensToUse);
|
|
240
246
|
const props = selectProps(rest);
|
|
241
247
|
let content = children;
|
|
242
248
|
const {
|
|
@@ -309,7 +315,10 @@ const CardBase = /*#__PURE__*/_react.default.forwardRef((_ref5, ref) => {
|
|
|
309
315
|
}
|
|
310
316
|
});
|
|
311
317
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, {
|
|
312
|
-
style:
|
|
318
|
+
style: {
|
|
319
|
+
...containerStyle,
|
|
320
|
+
borderRadius
|
|
321
|
+
},
|
|
313
322
|
dataSet: dataSet,
|
|
314
323
|
ref: ref,
|
|
315
324
|
...props,
|
|
@@ -387,7 +396,7 @@ const staticStyles = _StyleSheet.default.create({
|
|
|
387
396
|
contentOverlay: {
|
|
388
397
|
position: 'relative',
|
|
389
398
|
width: '100%',
|
|
390
|
-
|
|
399
|
+
minHeight: '100%',
|
|
391
400
|
zIndex: 2
|
|
392
401
|
},
|
|
393
402
|
containContainer: {
|
|
@@ -64,7 +64,11 @@ function selectIconContainerStyles(_ref2) {
|
|
|
64
64
|
const paddingSide = iconPosition === 'right' ? 'paddingLeft' : 'paddingRight';
|
|
65
65
|
return {
|
|
66
66
|
[paddingSide]: iconGap,
|
|
67
|
-
|
|
67
|
+
...(iconPaddingTop && {
|
|
68
|
+
transform: [{
|
|
69
|
+
translateY: iconPaddingTop
|
|
70
|
+
}]
|
|
71
|
+
})
|
|
68
72
|
};
|
|
69
73
|
}
|
|
70
74
|
function selectTextContainerStyles(_ref3) {
|
|
@@ -13,13 +13,22 @@ var _utils = require("../utils");
|
|
|
13
13
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
14
14
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
15
15
|
const [selectProps, selectedSystemPropTypes] = (0, _utils.selectSystemProps)([_utils.a11yProps, _utils.viewProps, _utils.contentfulProps]);
|
|
16
|
-
|
|
16
|
+
const selectWrapperStyles = _ref => {
|
|
17
|
+
let {
|
|
18
|
+
borderWidth,
|
|
19
|
+
borderTopWidth,
|
|
20
|
+
borderStyle,
|
|
21
|
+
borderColor
|
|
22
|
+
} = _ref;
|
|
17
23
|
return {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
24
|
+
borderStyle,
|
|
25
|
+
borderColor,
|
|
26
|
+
borderTopWidth,
|
|
27
|
+
borderBottomWidth: borderWidth,
|
|
28
|
+
borderBottomStyle: borderStyle,
|
|
29
|
+
borderBottomColor: borderColor
|
|
21
30
|
};
|
|
22
|
-
}
|
|
31
|
+
};
|
|
23
32
|
|
|
24
33
|
/**
|
|
25
34
|
* Flexible base component for lists where some or all items are collapsible headers.
|
|
@@ -28,7 +37,7 @@ function selectBorderStyles(tokens) {
|
|
|
28
37
|
* <ExpandCollapse.Panel> children, and assign the panels explicit `panelId` props. The panels may be
|
|
29
38
|
* nested (they do not need to be direct children), and non-interactive items may be included too.
|
|
30
39
|
*/
|
|
31
|
-
const ExpandCollapse = /*#__PURE__*/_react.default.forwardRef((
|
|
40
|
+
const ExpandCollapse = /*#__PURE__*/_react.default.forwardRef((_ref2, ref) => {
|
|
32
41
|
let {
|
|
33
42
|
children,
|
|
34
43
|
tokens,
|
|
@@ -39,7 +48,7 @@ const ExpandCollapse = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
|
|
|
39
48
|
onChange,
|
|
40
49
|
dataSet,
|
|
41
50
|
...rest
|
|
42
|
-
} =
|
|
51
|
+
} = _ref2;
|
|
43
52
|
const instanceId = (0, _utils.useUniqueId)('ExpandCollapse');
|
|
44
53
|
const {
|
|
45
54
|
currentValues: openIds,
|
|
@@ -60,7 +69,7 @@ const ExpandCollapse = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
|
|
|
60
69
|
...selectProps(rest),
|
|
61
70
|
dataSet: dataSet,
|
|
62
71
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, {
|
|
63
|
-
style:
|
|
72
|
+
style: selectWrapperStyles(themeTokens),
|
|
64
73
|
children: typeof children === 'function' ? children({
|
|
65
74
|
openIds,
|
|
66
75
|
onToggle,
|
|
@@ -110,6 +110,7 @@ const ExpandCollapsePanel = /*#__PURE__*/_react.default.forwardRef((_ref5, ref)
|
|
|
110
110
|
controlRef,
|
|
111
111
|
content,
|
|
112
112
|
copy = 'en',
|
|
113
|
+
disableMobileScrollBuffer = false,
|
|
113
114
|
...rest
|
|
114
115
|
} = _ref5;
|
|
115
116
|
const [containerHeight, setContainerHeight] = _react.default.useState(null);
|
|
@@ -131,7 +132,7 @@ const ExpandCollapsePanel = /*#__PURE__*/_react.default.forwardRef((_ref5, ref)
|
|
|
131
132
|
|
|
132
133
|
// on mobile devices we require a scroll buffer equal to the font size
|
|
133
134
|
// to avoid triggering scrolling unnecessarily
|
|
134
|
-
const mobileScrollBuffer = _Platform.default.OS === 'web' ? 0 : selectTextStyles(themeTokens)?.fontSize;
|
|
135
|
+
const mobileScrollBuffer = _Platform.default.OS === 'web' || disableMobileScrollBuffer ? 0 : selectTextStyles(themeTokens)?.fontSize;
|
|
135
136
|
const handleControlPress = event => {
|
|
136
137
|
onToggle?.(panelId, event);
|
|
137
138
|
if (onPress) onPress(panelId, event);
|
|
@@ -278,6 +279,10 @@ ExpandCollapsePanel.propTypes = {
|
|
|
278
279
|
/**
|
|
279
280
|
* A boolean prop to determine if the panel is a content panel or not. If true, the panel will not have a control
|
|
280
281
|
*/
|
|
281
|
-
content: _propTypes.default.bool
|
|
282
|
+
content: _propTypes.default.bool,
|
|
283
|
+
/**
|
|
284
|
+
* A boolean prop to disable the extra scroll buffer on mobile devices (only applicable on iOS/Android, ignored on web)
|
|
285
|
+
*/
|
|
286
|
+
disableMobileScrollBuffer: _propTypes.default.bool
|
|
282
287
|
};
|
|
283
288
|
var _default = exports.default = ExpandCollapsePanel;
|
|
@@ -85,6 +85,11 @@ const selectInnerStyle = (_ref2, password) => {
|
|
|
85
85
|
width,
|
|
86
86
|
height
|
|
87
87
|
} = _ref2;
|
|
88
|
+
const basePadding = calculatePadding(padding, borderWidth);
|
|
89
|
+
const calculateSpecificPadding = (specificPadding, specificBorderWidth) => {
|
|
90
|
+
const calculated = calculatePadding(specificPadding ?? padding, specificBorderWidth ?? borderWidth);
|
|
91
|
+
return calculated !== basePadding && calculated !== undefined ? calculated : undefined;
|
|
92
|
+
};
|
|
88
93
|
return {
|
|
89
94
|
// Inner borders animate with the icon and should be treated like a themable feature of the icon
|
|
90
95
|
borderColor,
|
|
@@ -98,11 +103,11 @@ const selectInnerStyle = (_ref2, password) => {
|
|
|
98
103
|
borderRightWidth,
|
|
99
104
|
borderBottomWidth,
|
|
100
105
|
borderLeftWidth,
|
|
101
|
-
padding:
|
|
102
|
-
paddingLeft:
|
|
103
|
-
paddingRight:
|
|
104
|
-
paddingTop:
|
|
105
|
-
paddingBottom:
|
|
106
|
+
padding: basePadding,
|
|
107
|
+
paddingLeft: calculateSpecificPadding(paddingLeft, borderLeftWidth),
|
|
108
|
+
paddingRight: calculateSpecificPadding(paddingRight, borderRightWidth),
|
|
109
|
+
paddingTop: calculateSpecificPadding(paddingTop, borderTopWidth),
|
|
110
|
+
paddingBottom: calculateSpecificPadding(paddingBottom, borderBottomWidth),
|
|
106
111
|
..._Platform.default.select({
|
|
107
112
|
web: {
|
|
108
113
|
pointerEvents: 'none',
|
package/lib/cjs/Modal/Modal.js
CHANGED
|
@@ -71,11 +71,15 @@ const selectModalStyles = _ref2 => {
|
|
|
71
71
|
const selectBackdropStyles = _ref3 => {
|
|
72
72
|
let {
|
|
73
73
|
backdropColor,
|
|
74
|
-
backdropOpacity
|
|
74
|
+
backdropOpacity,
|
|
75
|
+
backdropCursor
|
|
75
76
|
} = _ref3;
|
|
76
77
|
return {
|
|
77
78
|
backgroundColor: backdropColor,
|
|
78
|
-
opacity: backdropOpacity
|
|
79
|
+
opacity: backdropOpacity,
|
|
80
|
+
...(_Platform.default.OS === 'web' && backdropCursor ? {
|
|
81
|
+
cursor: backdropCursor
|
|
82
|
+
} : {})
|
|
79
83
|
};
|
|
80
84
|
};
|
|
81
85
|
const selectCloseButtonContainerStyles = _ref4 => {
|
|
@@ -128,12 +132,15 @@ const Modal = /*#__PURE__*/_react.default.forwardRef((_ref5, ref) => {
|
|
|
128
132
|
cancelButtonText,
|
|
129
133
|
cancelButtonType,
|
|
130
134
|
footer,
|
|
135
|
+
backgroundDismissible = true,
|
|
131
136
|
...rest
|
|
132
137
|
} = _ref5;
|
|
133
138
|
const viewport = (0, _ViewportProvider.useViewport)();
|
|
139
|
+
const isBackdropClickable = onClose && backgroundDismissible;
|
|
134
140
|
const themeTokens = (0, _ThemeProvider.useThemeTokens)('Modal', tokens, variant, {
|
|
135
141
|
viewport,
|
|
136
|
-
maxWidth
|
|
142
|
+
maxWidth,
|
|
143
|
+
backdropCursor: isBackdropClickable ? 'pointer' : 'default'
|
|
137
144
|
});
|
|
138
145
|
const modalRef = (0, _useScrollBlocking.default)(isOpen);
|
|
139
146
|
const modalBodyRef = _react.default.useRef(ref);
|
|
@@ -239,7 +246,7 @@ const Modal = /*#__PURE__*/_react.default.forwardRef((_ref5, ref) => {
|
|
|
239
246
|
})]
|
|
240
247
|
})
|
|
241
248
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_TouchableWithoutFeedback.default, {
|
|
242
|
-
onPress: handleClose,
|
|
249
|
+
onPress: isBackdropClickable && handleClose,
|
|
243
250
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, {
|
|
244
251
|
style: [staticStyles.backdrop, selectBackdropStyles(themeTokens)]
|
|
245
252
|
})
|
|
@@ -336,7 +343,15 @@ Modal.propTypes = {
|
|
|
336
343
|
/**
|
|
337
344
|
* Receive a react node or an array of nodes to render at the bottom of the modal, above the action buttons.
|
|
338
345
|
*/
|
|
339
|
-
footer: _propTypes.default.oneOfType([_propTypes.default.node, _propTypes.default.arrayOf(_propTypes.default.node)])
|
|
346
|
+
footer: _propTypes.default.oneOfType([_propTypes.default.node, _propTypes.default.arrayOf(_propTypes.default.node)]),
|
|
347
|
+
/**
|
|
348
|
+
* Controls whether the modal can be dismissed by clicking on the backdrop.
|
|
349
|
+
* When set to `false`, clicking the backdrop will not close the modal.
|
|
350
|
+
* The backdrop cursor automatically changes to 'default' to indicate it's not clickable.
|
|
351
|
+
* Note: Backdrop dismissal requires `onClose` to be defined.
|
|
352
|
+
* @default true
|
|
353
|
+
*/
|
|
354
|
+
backgroundDismissible: _propTypes.default.bool
|
|
340
355
|
};
|
|
341
356
|
var _default = exports.default = Modal;
|
|
342
357
|
const staticStyles = _StyleSheet.default.create({
|
|
@@ -346,12 +361,7 @@ const staticStyles = _StyleSheet.default.create({
|
|
|
346
361
|
left: 0,
|
|
347
362
|
right: 0,
|
|
348
363
|
bottom: 0,
|
|
349
|
-
zIndex: -1
|
|
350
|
-
..._Platform.default.select({
|
|
351
|
-
web: {
|
|
352
|
-
cursor: 'pointer'
|
|
353
|
-
}
|
|
354
|
-
})
|
|
364
|
+
zIndex: -1
|
|
355
365
|
},
|
|
356
366
|
positioningContainer: {
|
|
357
367
|
flexBasis: '100%',
|
|
@@ -10,6 +10,7 @@ var _View = _interopRequireDefault(require("react-native-web/dist/cjs/exports/Vi
|
|
|
10
10
|
var _StyleSheet = _interopRequireDefault(require("react-native-web/dist/cjs/exports/StyleSheet"));
|
|
11
11
|
var _ThemeProvider = require("../ThemeProvider");
|
|
12
12
|
var _utils = require("../utils");
|
|
13
|
+
var _ProgressContext = _interopRequireDefault(require("./ProgressContext"));
|
|
13
14
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
14
15
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
15
16
|
const [selectProps, selectedSystemPropTypes] = (0, _utils.selectSystemProps)([_utils.a11yProps, _utils.viewProps]);
|
|
@@ -54,6 +55,12 @@ const selectProgressStyles = _ref => {
|
|
|
54
55
|
*
|
|
55
56
|
* - Use the `size` variant to control the height of your progress bars: passing `'mini'` will make your
|
|
56
57
|
* progress bar container narrower.
|
|
58
|
+
* - Use the `layers` variant to control how multiple progress bars are positioned:
|
|
59
|
+
* - `false` (default): bars are positioned vertically one below the other.
|
|
60
|
+
* - `true`: bars overlay on top of each other (layered/stacked on z-axis).
|
|
61
|
+
* Note: The `layers` prop is deprecated. After August 2026, `layers: true` will become the permanent
|
|
62
|
+
* default behavior and the `layers` prop will be removed. To maintain vertical layout after removal,
|
|
63
|
+
* use separate individual Progress components.
|
|
57
64
|
*
|
|
58
65
|
* ## Usability and A11y guidelines
|
|
59
66
|
*
|
|
@@ -70,11 +77,18 @@ const Progress = /*#__PURE__*/_react.default.forwardRef((_ref2, ref) => {
|
|
|
70
77
|
...rest
|
|
71
78
|
} = _ref2;
|
|
72
79
|
const themeTokens = (0, _ThemeProvider.useThemeTokens)('Progress', tokens, variant);
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
80
|
+
// Default to false (vertical layout) to preserve existing behavior and avoid breaking changes
|
|
81
|
+
const layers = variant?.layers ?? false;
|
|
82
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ProgressContext.default.Provider, {
|
|
83
|
+
value: {
|
|
84
|
+
layers
|
|
85
|
+
},
|
|
86
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, {
|
|
87
|
+
ref: ref,
|
|
88
|
+
style: [staticStyles.progressContainer, selectProgressStyles(themeTokens)],
|
|
89
|
+
...selectProps(rest),
|
|
90
|
+
children: children
|
|
91
|
+
})
|
|
78
92
|
});
|
|
79
93
|
});
|
|
80
94
|
Progress.displayName = 'Progress';
|
|
@@ -13,17 +13,24 @@ var _ProgressBarBackground = _interopRequireDefault(require("./ProgressBarBackgr
|
|
|
13
13
|
var _ThemeProvider = require("../ThemeProvider");
|
|
14
14
|
var _utils = require("../utils");
|
|
15
15
|
var _constants = require("./constants");
|
|
16
|
+
var _ProgressContext = _interopRequireDefault(require("./ProgressContext"));
|
|
16
17
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
17
18
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
18
19
|
const [selectProps, selectedSystemPropTypes] = (0, _utils.selectSystemProps)([_utils.a11yProps, _utils.viewProps]);
|
|
19
|
-
const selectBarStyles =
|
|
20
|
+
const selectBarStyles = _ref => {
|
|
20
21
|
let {
|
|
22
|
+
themeTokens,
|
|
23
|
+
calculatedPercentage,
|
|
24
|
+
barPosition,
|
|
25
|
+
layers
|
|
26
|
+
} = _ref;
|
|
27
|
+
const {
|
|
21
28
|
backgroundColor,
|
|
22
29
|
borderRadius,
|
|
23
30
|
outlineWidth,
|
|
24
31
|
outlineColor,
|
|
25
32
|
shadow
|
|
26
|
-
} =
|
|
33
|
+
} = themeTokens;
|
|
27
34
|
return {
|
|
28
35
|
backgroundColor,
|
|
29
36
|
borderRadius,
|
|
@@ -31,7 +38,10 @@ const selectBarStyles = (_ref, calculatedPercentage, barPosition) => {
|
|
|
31
38
|
outlineColor,
|
|
32
39
|
...(0, _ThemeProvider.applyShadowToken)(shadow),
|
|
33
40
|
width: `${calculatedPercentage}%`,
|
|
34
|
-
left: `${barPosition}
|
|
41
|
+
left: `${barPosition}%`,
|
|
42
|
+
...(layers ? {
|
|
43
|
+
position: 'absolute'
|
|
44
|
+
} : {})
|
|
35
45
|
};
|
|
36
46
|
};
|
|
37
47
|
|
|
@@ -82,6 +92,9 @@ const ProgressBar = /*#__PURE__*/_react.default.forwardRef((_ref2, ref) => {
|
|
|
82
92
|
},
|
|
83
93
|
...rest
|
|
84
94
|
} = _ref2;
|
|
95
|
+
const {
|
|
96
|
+
layers
|
|
97
|
+
} = _react.default.useContext(_ProgressContext.default);
|
|
85
98
|
const {
|
|
86
99
|
items,
|
|
87
100
|
current
|
|
@@ -114,7 +127,12 @@ const ProgressBar = /*#__PURE__*/_react.default.forwardRef((_ref2, ref) => {
|
|
|
114
127
|
});
|
|
115
128
|
return percentage > _constants.MIN_PERCENT_VALUE || items ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, {
|
|
116
129
|
ref: ref,
|
|
117
|
-
style: [staticStyles.bar, selectBarStyles(
|
|
130
|
+
style: [staticStyles.bar, selectBarStyles({
|
|
131
|
+
themeTokens,
|
|
132
|
+
calculatedPercentage,
|
|
133
|
+
barPosition,
|
|
134
|
+
layers
|
|
135
|
+
})],
|
|
118
136
|
...selectedProps,
|
|
119
137
|
children: children ?? /*#__PURE__*/(0, _jsxRuntime.jsx)(_ProgressBarBackground.default, {
|
|
120
138
|
variant: variant
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
const ProgressContext = /*#__PURE__*/(0, _react.createContext)({
|
|
9
|
+
layers: false
|
|
10
|
+
});
|
|
11
|
+
var _default = exports.default = ProgressContext;
|
package/lib/cjs/SideNav/Item.js
CHANGED
|
@@ -29,9 +29,9 @@ function selectItemStyles(_ref) {
|
|
|
29
29
|
} = _ref;
|
|
30
30
|
return {
|
|
31
31
|
backgroundColor,
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
borderBottomColor: borderColor,
|
|
33
|
+
borderBottomWidth: borderWidth,
|
|
34
|
+
borderBottomStyle: borderStyle,
|
|
35
35
|
paddingLeft,
|
|
36
36
|
paddingRight,
|
|
37
37
|
paddingTop,
|
|
@@ -12,6 +12,19 @@ var _utils = require("../utils");
|
|
|
12
12
|
var _ThemeProvider = require("../ThemeProvider");
|
|
13
13
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
14
14
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
15
|
+
const selectPanelTokens = _ref => {
|
|
16
|
+
let {
|
|
17
|
+
borderWidth,
|
|
18
|
+
borderColor,
|
|
19
|
+
backgroundColor
|
|
20
|
+
} = _ref;
|
|
21
|
+
return {
|
|
22
|
+
contentPanelBackgroundColor: backgroundColor,
|
|
23
|
+
borderBottomWidth: borderWidth,
|
|
24
|
+
borderColor
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
|
|
15
28
|
/**
|
|
16
29
|
Expandable content areas for use within `SideNav`.
|
|
17
30
|
|
|
@@ -21,7 +34,8 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
|
|
|
21
34
|
|
|
22
35
|
## Usage Criteria
|
|
23
36
|
- Use `SideNav.ItemsGroup` with large pages that have multiple sections
|
|
24
|
-
*/
|
|
37
|
+
*/
|
|
38
|
+
const ItemsGroup = /*#__PURE__*/_react.default.forwardRef((_ref2, ref) => {
|
|
25
39
|
let {
|
|
26
40
|
children,
|
|
27
41
|
label,
|
|
@@ -32,7 +46,7 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
|
|
|
32
46
|
tokens,
|
|
33
47
|
itemTokens,
|
|
34
48
|
onToggle
|
|
35
|
-
} =
|
|
49
|
+
} = _ref2;
|
|
36
50
|
// A SideNav control uses the same style and theme as SideNavItem, with a 'parent' variant,
|
|
37
51
|
// plus control-specific tokens from the SideNavItemsGroup theme (e.g. open/close icon, etc).
|
|
38
52
|
const getAppearance = appearance => ({
|
|
@@ -45,28 +59,27 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
|
|
|
45
59
|
type: 'parent'
|
|
46
60
|
});
|
|
47
61
|
const getGroupTokens = (0, _ThemeProvider.useThemeTokensCallback)('SideNavItemsGroup', tokens, variant);
|
|
48
|
-
const getPanelTokens = appearance => {
|
|
49
|
-
const {
|
|
50
|
-
panelBorderColor,
|
|
51
|
-
...itemsGroupTokens
|
|
52
|
-
} = getGroupTokens(getAppearance(appearance));
|
|
53
|
-
const groupTokens = {
|
|
54
|
-
...itemsGroupTokens,
|
|
55
|
-
borderWidth: 0,
|
|
56
|
-
marginBottom: 0
|
|
57
|
-
};
|
|
58
|
-
return (0, _utils.selectTokens)('ExpandCollapsePanel', groupTokens);
|
|
59
|
-
};
|
|
60
62
|
const getItemTokens = (0, _ThemeProvider.useThemeTokensCallback)('SideNavItem', itemTokens, variant);
|
|
61
|
-
const
|
|
62
|
-
...
|
|
63
|
-
|
|
64
|
-
...
|
|
63
|
+
const getPanelTokens = appearance => (0, _utils.selectTokens)('ExpandCollapsePanel', {
|
|
64
|
+
...staticTokens.panel,
|
|
65
|
+
...getGroupTokens(getAppearance(appearance)),
|
|
66
|
+
...selectPanelTokens(getItemTokens(getItemAppearance(appearance)))
|
|
67
|
+
});
|
|
68
|
+
const getControlTokens = appearance => ({
|
|
69
|
+
...(0, _utils.selectTokens)('ExpandCollapseControl', {
|
|
70
|
+
...getItemTokens(getItemAppearance(appearance)),
|
|
71
|
+
// main style from SideNavItem
|
|
72
|
+
...getGroupTokens(getAppearance(appearance)) // control-specific tokens like icon etc,
|
|
73
|
+
}),
|
|
74
|
+
...staticTokens.control
|
|
65
75
|
});
|
|
66
76
|
const controlContent = controlState => {
|
|
67
77
|
const currentItemTokens = getItemTokens(getItemAppearance(controlState));
|
|
68
78
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ItemContent.default, {
|
|
69
|
-
tokens:
|
|
79
|
+
tokens: {
|
|
80
|
+
...currentItemTokens,
|
|
81
|
+
...staticTokens.content
|
|
82
|
+
},
|
|
70
83
|
children: label
|
|
71
84
|
});
|
|
72
85
|
};
|
|
@@ -82,9 +95,23 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
|
|
|
82
95
|
active: isActive
|
|
83
96
|
} // ExpandCollapse.Panel handles expanded state
|
|
84
97
|
,
|
|
98
|
+
disableMobileScrollBuffer: true,
|
|
85
99
|
children: children
|
|
86
100
|
});
|
|
87
101
|
});
|
|
102
|
+
const staticTokens = {
|
|
103
|
+
panel: {
|
|
104
|
+
borderWidth: 0,
|
|
105
|
+
marginBottom: 0
|
|
106
|
+
},
|
|
107
|
+
control: {
|
|
108
|
+
borderWidth: 0,
|
|
109
|
+
textLine: null
|
|
110
|
+
},
|
|
111
|
+
content: {
|
|
112
|
+
accentWidth: 0
|
|
113
|
+
}
|
|
114
|
+
};
|
|
88
115
|
ItemsGroup.displayName = 'ItemsGroup';
|
|
89
116
|
ItemsGroup.propTypes = {
|
|
90
117
|
/**
|
|
@@ -15,13 +15,28 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
15
15
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
16
16
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
17
17
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
18
|
-
|
|
18
|
+
const selectContainerTokens = _ref => {
|
|
19
|
+
let {
|
|
20
|
+
borderWidth,
|
|
21
|
+
borderStyle,
|
|
22
|
+
borderColor
|
|
23
|
+
} = _ref;
|
|
19
24
|
return {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
25
|
+
borderTopWidth: borderWidth,
|
|
26
|
+
borderStyle,
|
|
27
|
+
borderColor
|
|
23
28
|
};
|
|
24
|
-
}
|
|
29
|
+
};
|
|
30
|
+
const selectItemTokens = function () {
|
|
31
|
+
let tokens = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
32
|
+
let isLastItem = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
33
|
+
return {
|
|
34
|
+
...tokens,
|
|
35
|
+
...(isLastItem ? {
|
|
36
|
+
borderWidth: 0
|
|
37
|
+
} : {})
|
|
38
|
+
};
|
|
39
|
+
};
|
|
25
40
|
const [selectProps, selectedSystemPropTypes] = (0, _utils.selectSystemProps)([_utils.a11yProps, _utils.viewProps]);
|
|
26
41
|
|
|
27
42
|
/**
|
|
@@ -29,7 +44,7 @@ const [selectProps, selectedSystemPropTypes] = (0, _utils.selectSystemProps)([_u
|
|
|
29
44
|
- Use in conjunction with a large amount of educational / informational content
|
|
30
45
|
- Allow the user to navigate between options frequently and efficiently
|
|
31
46
|
*/
|
|
32
|
-
const SideNav = /*#__PURE__*/_react.default.forwardRef((
|
|
47
|
+
const SideNav = /*#__PURE__*/_react.default.forwardRef((_ref2, ref) => {
|
|
33
48
|
let {
|
|
34
49
|
children,
|
|
35
50
|
variant = {},
|
|
@@ -38,7 +53,7 @@ const SideNav = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
|
|
|
38
53
|
itemTokens,
|
|
39
54
|
groupTokens,
|
|
40
55
|
...rest
|
|
41
|
-
} =
|
|
56
|
+
} = _ref2;
|
|
42
57
|
const themeTokens = (0, _ThemeProvider.useThemeTokens)('SideNav', tokens, variant);
|
|
43
58
|
const [active, setActive] = _react.default.useState({
|
|
44
59
|
groupId: undefined,
|
|
@@ -56,14 +71,15 @@ const SideNav = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
|
|
|
56
71
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ExpandCollapse.default, {
|
|
57
72
|
ref: ref,
|
|
58
73
|
maxOpen: accordion ? 1 : null,
|
|
59
|
-
|
|
74
|
+
tokens: selectContainerTokens(themeTokens),
|
|
60
75
|
...selectProps(rest),
|
|
61
|
-
children:
|
|
76
|
+
children: _ref3 => {
|
|
62
77
|
let {
|
|
63
78
|
openIds,
|
|
64
79
|
onToggle
|
|
65
|
-
} =
|
|
66
|
-
const renderItem = (item, index, groupId)
|
|
80
|
+
} = _ref3;
|
|
81
|
+
const renderItem = function (item, index, groupId) {
|
|
82
|
+
let isLastItem = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
|
67
83
|
const {
|
|
68
84
|
itemId = `item-${index}`,
|
|
69
85
|
onPress
|
|
@@ -81,7 +97,7 @@ const SideNav = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
|
|
|
81
97
|
...variant,
|
|
82
98
|
type: 'child'
|
|
83
99
|
} : variant,
|
|
84
|
-
tokens: itemTokens,
|
|
100
|
+
tokens: selectItemTokens(itemTokens, isLastItem),
|
|
85
101
|
isActive: isItemActive(itemId, groupId),
|
|
86
102
|
onPress: handlePress
|
|
87
103
|
});
|
|
@@ -105,7 +121,7 @@ const SideNav = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
|
|
|
105
121
|
openGroups: openIds,
|
|
106
122
|
isActive: isGroupActive,
|
|
107
123
|
onToggle: handleToggle
|
|
108
|
-
}, _react.default.Children.map(child.props.children, (item, itemIndex) => renderItem(item, itemIndex, groupId)));
|
|
124
|
+
}, _react.default.Children.map(child.props.children, (item, itemIndex) => renderItem(item, itemIndex, groupId, itemIndex === child.props.children.length - 1)));
|
|
109
125
|
}
|
|
110
126
|
return null;
|
|
111
127
|
});
|
package/lib/esm/Card/CardBase.js
CHANGED
|
@@ -228,7 +228,13 @@ const CardBase = /*#__PURE__*/React.forwardRef((_ref5, ref) => {
|
|
|
228
228
|
cardState,
|
|
229
229
|
...rest
|
|
230
230
|
} = _ref5;
|
|
231
|
-
const
|
|
231
|
+
const resolvedTokens = typeof tokens === 'function' ? tokens(cardState) : tokens;
|
|
232
|
+
const tokensToUse = backgroundImage && backgroundImage.src ? {
|
|
233
|
+
...resolvedTokens,
|
|
234
|
+
gradient: undefined,
|
|
235
|
+
backgroundGradient: undefined
|
|
236
|
+
} : resolvedTokens;
|
|
237
|
+
const cardStyle = selectStyles(tokensToUse);
|
|
232
238
|
const props = selectProps(rest);
|
|
233
239
|
let content = children;
|
|
234
240
|
const {
|
|
@@ -301,7 +307,10 @@ const CardBase = /*#__PURE__*/React.forwardRef((_ref5, ref) => {
|
|
|
301
307
|
}
|
|
302
308
|
});
|
|
303
309
|
return /*#__PURE__*/_jsx(View, {
|
|
304
|
-
style:
|
|
310
|
+
style: {
|
|
311
|
+
...containerStyle,
|
|
312
|
+
borderRadius
|
|
313
|
+
},
|
|
305
314
|
dataSet: dataSet,
|
|
306
315
|
ref: ref,
|
|
307
316
|
...props,
|
|
@@ -379,7 +388,7 @@ const staticStyles = StyleSheet.create({
|
|
|
379
388
|
contentOverlay: {
|
|
380
389
|
position: 'relative',
|
|
381
390
|
width: '100%',
|
|
382
|
-
|
|
391
|
+
minHeight: '100%',
|
|
383
392
|
zIndex: 2
|
|
384
393
|
},
|
|
385
394
|
containContainer: {
|
|
@@ -57,7 +57,11 @@ function selectIconContainerStyles(_ref2) {
|
|
|
57
57
|
const paddingSide = iconPosition === 'right' ? 'paddingLeft' : 'paddingRight';
|
|
58
58
|
return {
|
|
59
59
|
[paddingSide]: iconGap,
|
|
60
|
-
|
|
60
|
+
...(iconPaddingTop && {
|
|
61
|
+
transform: [{
|
|
62
|
+
translateY: iconPaddingTop
|
|
63
|
+
}]
|
|
64
|
+
})
|
|
61
65
|
};
|
|
62
66
|
}
|
|
63
67
|
function selectTextContainerStyles(_ref3) {
|