@telus-uds/components-base 3.27.0 → 3.28.1
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 +30 -5
- package/lib/cjs/Card/CardBase.js +12 -3
- package/lib/cjs/Carousel/Carousel.js +16 -15
- package/lib/cjs/Carousel/CarouselItem/CarouselItem.js +3 -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/MultiSelectFilter/MultiSelectFilter.js +5 -1
- 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/Carousel/Carousel.js +16 -15
- package/lib/esm/Carousel/CarouselItem/CarouselItem.js +3 -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/MultiSelectFilter/MultiSelectFilter.js +5 -1
- 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/Carousel/Carousel.jsx +16 -15
- package/src/Carousel/CarouselItem/CarouselItem.jsx +3 -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/MultiSelectFilter/MultiSelectFilter.jsx +6 -1
- 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,44 @@
|
|
|
1
1
|
# Change Log - @telus-uds/components-base
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Fri, 20 Feb 2026 23:53:11 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## 3.28.1
|
|
8
|
+
|
|
9
|
+
Fri, 20 Feb 2026 23:53:11 GMT
|
|
10
|
+
|
|
11
|
+
### Patches
|
|
12
|
+
|
|
13
|
+
- `MultiSelectFilter`: onOpen callback now triggers when filter opens instead of when it closes (josue.higueroscalderon@telus.com)
|
|
14
|
+
- `Carousel`: fix peeking when using a larger maxWidth (guillermo.peitzner@telus.com)
|
|
15
|
+
|
|
16
|
+
## 3.28.0
|
|
17
|
+
|
|
18
|
+
Wed, 18 Feb 2026 02:50:19 GMT
|
|
19
|
+
|
|
20
|
+
### Minor changes
|
|
21
|
+
|
|
22
|
+
- `SideNav`: Update code logic to support top and bottom borders (david.melara1@telus.com)
|
|
23
|
+
- `ProgressBar`: add layers variant for controlling bar positioning (sergio.ramirez@telus.com)
|
|
24
|
+
- `Modal`: Add `backgroundDismissible` prop to control backdrop dismissal behavior with dynamic cursor styling (josue.higueroscalderon@telus.com)
|
|
25
|
+
- Bump @telus-uds/system-theme-tokens to v4.20.0
|
|
26
|
+
|
|
27
|
+
### Patches
|
|
28
|
+
|
|
29
|
+
- `Card`: background image hidden behind the default background color issue fixed (josue.higueroscalderon@telus.com)
|
|
30
|
+
- `IconButton`: Fix wrong specific padding calculation (david.melara1@telus.com)
|
|
31
|
+
|
|
7
32
|
## 3.27.0
|
|
8
33
|
|
|
9
|
-
Thu, 29 Jan 2026
|
|
34
|
+
Thu, 29 Jan 2026 15:50:16 GMT
|
|
10
35
|
|
|
11
36
|
### Minor changes
|
|
12
37
|
|
|
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
38
|
- `Card`: Add full-bleed content support to Card component allowing content to extend to card edges (josue.higueroscalderon@telus.com)
|
|
39
|
+
- `List`: new feature alignment for the icons added (josue.higueroscalderon@telus.com)
|
|
40
|
+
- `Card`: Add inputPosition prop to InteractiveCard (david.melara1@telus.com)
|
|
41
|
+
- `Checkbox`: Add padding token (david.melara1@telus.com)
|
|
17
42
|
- Bump @telus-uds/system-theme-tokens to v4.19.0
|
|
18
43
|
|
|
19
44
|
### 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: {
|
|
@@ -91,7 +91,7 @@ const selectControlButtonPositionStyles = _ref => {
|
|
|
91
91
|
isAutoPlayEnabled,
|
|
92
92
|
viewport,
|
|
93
93
|
maxWidth,
|
|
94
|
-
|
|
94
|
+
containerWidth
|
|
95
95
|
} = _ref;
|
|
96
96
|
const styles = {};
|
|
97
97
|
let positionOffset = 0;
|
|
@@ -107,18 +107,19 @@ const selectControlButtonPositionStyles = _ref => {
|
|
|
107
107
|
}
|
|
108
108
|
}
|
|
109
109
|
if (enablePeeking) {
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
110
|
+
const {
|
|
111
|
+
peekingMiddleSpace,
|
|
112
|
+
peekingGap
|
|
113
|
+
} = getPeekingProps(viewport);
|
|
114
|
+
const clampedMaxWidth = Math.min(maxWidth || containerWidth, containerWidth);
|
|
115
|
+
const slideRightEdge = (containerWidth + clampedMaxWidth) / 2 - peekingMiddleSpace;
|
|
116
|
+
const buttonCenter = slideRightEdge + peekingGap / 2;
|
|
117
|
+
positionOffset = containerWidth - buttonCenter - buttonWidth / 2;
|
|
117
118
|
}
|
|
118
119
|
styles[positionProperty] = positionOffset;
|
|
119
120
|
return styles;
|
|
120
121
|
};
|
|
121
|
-
const selectPreviousNextNavigationButtonStyles = (previousNextNavigationButtonWidth, previousNextNavigationPosition, spaceBetweenSlideAndPreviousNextNavigation, isFirstSlide, isLastSlide, areStylesAppliedOnPreviousButton, enablePeeking, enableDisplayMultipleItemsPerSlide, isAutoPlayEnabled, viewport, maxWidth,
|
|
122
|
+
const selectPreviousNextNavigationButtonStyles = (previousNextNavigationButtonWidth, previousNextNavigationPosition, spaceBetweenSlideAndPreviousNextNavigation, isFirstSlide, isLastSlide, areStylesAppliedOnPreviousButton, enablePeeking, enableDisplayMultipleItemsPerSlide, isAutoPlayEnabled, viewport, maxWidth, containerWidth) => {
|
|
122
123
|
const styles = {
|
|
123
124
|
zIndex: 1,
|
|
124
125
|
position: 'absolute'
|
|
@@ -142,7 +143,7 @@ const selectPreviousNextNavigationButtonStyles = (previousNextNavigationButtonWi
|
|
|
142
143
|
isAutoPlayEnabled,
|
|
143
144
|
viewport,
|
|
144
145
|
maxWidth,
|
|
145
|
-
|
|
146
|
+
containerWidth
|
|
146
147
|
})
|
|
147
148
|
};
|
|
148
149
|
};
|
|
@@ -279,7 +280,7 @@ const calculateFinalWidth = (containerWidth, enablePeeking, viewport, maxWidth)
|
|
|
279
280
|
peekingGap,
|
|
280
281
|
peekingMiddleSpace
|
|
281
282
|
} = getPeekingProps(viewport);
|
|
282
|
-
const baseWidth = maxWidth || containerWidth;
|
|
283
|
+
const baseWidth = Math.min(maxWidth || containerWidth, containerWidth);
|
|
283
284
|
finalWidth = baseWidth - peekingMiddleSpace * _Constants.PEEKING_MULTIPLIER + peekingGap;
|
|
284
285
|
}
|
|
285
286
|
return finalWidth;
|
|
@@ -499,7 +500,7 @@ const Carousel = /*#__PURE__*/_react.default.forwardRef((_ref3, ref) => {
|
|
|
499
500
|
peekingMiddleSpace
|
|
500
501
|
} = getPeekingProps(viewport);
|
|
501
502
|
let finalWidth;
|
|
502
|
-
const baseWidth = maxWidth || containerLayoutRef.current.width;
|
|
503
|
+
const baseWidth = Math.min(maxWidth || containerLayoutRef.current.width, containerLayoutRef.current.width);
|
|
503
504
|
const slideWide = baseWidth - peekingMiddleSpace * _Constants.PEEKING_MULTIPLIER;
|
|
504
505
|
if (activeIndexRef.current === 0) {
|
|
505
506
|
finalWidth = 0;
|
|
@@ -1021,7 +1022,7 @@ const Carousel = /*#__PURE__*/_react.default.forwardRef((_ref3, ref) => {
|
|
|
1021
1022
|
isAutoPlayEnabled,
|
|
1022
1023
|
viewport,
|
|
1023
1024
|
maxWidth,
|
|
1024
|
-
|
|
1025
|
+
containerWidth: containerLayout.width
|
|
1025
1026
|
})],
|
|
1026
1027
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_IconButton.default, {
|
|
1027
1028
|
icon: isCarouselPlaying ? pauseIcon : playIcon,
|
|
@@ -1030,7 +1031,7 @@ const Carousel = /*#__PURE__*/_react.default.forwardRef((_ref3, ref) => {
|
|
|
1030
1031
|
onPress: onAnimationControlButtonPress
|
|
1031
1032
|
})
|
|
1032
1033
|
}) : null, showPreviousNextNavigation && totalItems > 1 ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, {
|
|
1033
|
-
style: selectPreviousNextNavigationButtonStyles(previousNextNavigationButtonWidth, previousNextNavigationPosition, spaceBetweenSlideAndPreviousNextNavigation, isFirstSlide, isLastSlide, true, enablePeeking, enableDisplayMultipleItemsPerSlide, isAutoPlayEnabled, viewport, maxWidth,
|
|
1034
|
+
style: selectPreviousNextNavigationButtonStyles(previousNextNavigationButtonWidth, previousNextNavigationPosition, spaceBetweenSlideAndPreviousNextNavigation, isFirstSlide, isLastSlide, true, enablePeeking, enableDisplayMultipleItemsPerSlide, isAutoPlayEnabled, viewport, maxWidth, containerLayout.width),
|
|
1034
1035
|
testID: "previous-button-container",
|
|
1035
1036
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_IconButton.default, {
|
|
1036
1037
|
onLayout: onPreviousNextNavigationButtonLayout,
|
|
@@ -1090,7 +1091,7 @@ const Carousel = /*#__PURE__*/_react.default.forwardRef((_ref3, ref) => {
|
|
|
1090
1091
|
})
|
|
1091
1092
|
})
|
|
1092
1093
|
}), showPreviousNextNavigation && totalItems > 1 ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, {
|
|
1093
|
-
style: selectPreviousNextNavigationButtonStyles(previousNextNavigationButtonWidth, previousNextNavigationPosition, spaceBetweenSlideAndPreviousNextNavigation, isFirstSlide, isLastSlide, false, enablePeeking, enableDisplayMultipleItemsPerSlide, isAutoPlayEnabled, viewport, maxWidth,
|
|
1094
|
+
style: selectPreviousNextNavigationButtonStyles(previousNextNavigationButtonWidth, previousNextNavigationPosition, spaceBetweenSlideAndPreviousNextNavigation, isFirstSlide, isLastSlide, false, enablePeeking, enableDisplayMultipleItemsPerSlide, isAutoPlayEnabled, viewport, maxWidth, containerLayout.width),
|
|
1094
1095
|
testID: "next-button-container",
|
|
1095
1096
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_IconButton.default, {
|
|
1096
1097
|
onLayout: onPreviousNextNavigationButtonLayout,
|
|
@@ -31,10 +31,10 @@ const selectContainerStyle = _ref => {
|
|
|
31
31
|
let marginLeft = 0;
|
|
32
32
|
if (enablePeeking) {
|
|
33
33
|
const isFirst = elementIndex === 0;
|
|
34
|
-
const
|
|
35
|
-
adjustedWidth =
|
|
34
|
+
const clampedMaxWidth = Math.min(maxWidth || width, width);
|
|
35
|
+
adjustedWidth = clampedMaxWidth - peekingMiddleSpace * 2;
|
|
36
36
|
if (isFirst) {
|
|
37
|
-
marginLeft = peekingMiddleSpace + (viewportWidth -
|
|
37
|
+
marginLeft = peekingMiddleSpace + (viewportWidth - clampedMaxWidth) / 2;
|
|
38
38
|
} else {
|
|
39
39
|
marginLeft = peekingGap;
|
|
40
40
|
}
|
|
@@ -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%',
|
|
@@ -185,6 +185,11 @@ const MultiSelectFilter = /*#__PURE__*/_react.default.forwardRef((_ref3, ref) =>
|
|
|
185
185
|
setMaxWidth(items.length >= rowLimit);
|
|
186
186
|
}, [items.length, rowLimit]);
|
|
187
187
|
_react.default.useEffect(() => setCheckedIds(currentValues ?? []), [currentValues]);
|
|
188
|
+
_react.default.useEffect(() => {
|
|
189
|
+
if (isOpen && onOpen) {
|
|
190
|
+
onOpen();
|
|
191
|
+
}
|
|
192
|
+
}, [isOpen, onOpen]);
|
|
188
193
|
const uniqueFields = ['id', 'label'];
|
|
189
194
|
if (!(0, _utils.containUniqueFields)(items, uniqueFields)) {
|
|
190
195
|
throw new Error(`MultiSelectFilter items must have unique ${uniqueFields.join(', ')}`);
|
|
@@ -197,7 +202,6 @@ const MultiSelectFilter = /*#__PURE__*/_react.default.forwardRef((_ref3, ref) =>
|
|
|
197
202
|
}]);
|
|
198
203
|
const handleChange = event => {
|
|
199
204
|
if (pressHandlers.onPress) pressHandlers?.onPress(event);
|
|
200
|
-
if (isOpen) onOpen();
|
|
201
205
|
setIsOpen(!isOpen);
|
|
202
206
|
};
|
|
203
207
|
const onApply = e => {
|
|
@@ -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
|
/**
|