@telus-uds/components-base 1.24.2 → 2.0.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 +29 -2
- package/component-docs.json +55 -1
- package/lib/Button/ButtonBase.js +2 -1
- package/lib/Carousel/Carousel.js +9 -1
- package/lib/Carousel/CarouselStepTracker/CarouselStepTracker.js +11 -2
- package/lib/MultiSelectFilter/ModalOverlay.js +136 -0
- package/lib/MultiSelectFilter/MultiSelectFilter.js +64 -26
- package/lib/Typography/Typography.js +27 -2
- package/lib-module/Button/ButtonBase.js +2 -1
- package/lib-module/Carousel/Carousel.js +9 -1
- package/lib-module/Carousel/CarouselStepTracker/CarouselStepTracker.js +10 -2
- package/lib-module/MultiSelectFilter/ModalOverlay.js +112 -0
- package/lib-module/MultiSelectFilter/MultiSelectFilter.js +65 -27
- package/lib-module/Typography/Typography.js +26 -2
- package/package.json +2 -2
- package/src/Button/ButtonBase.jsx +1 -1
- package/src/Carousel/Carousel.jsx +6 -1
- package/src/Carousel/CarouselStepTracker/CarouselStepTracker.jsx +7 -1
- package/src/MultiSelectFilter/ModalOverlay.jsx +86 -0
- package/src/MultiSelectFilter/MultiSelectFilter.jsx +73 -49
- package/src/Typography/Typography.jsx +26 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,39 @@
|
|
|
1
1
|
# Change Log - @telus-uds/components-base
|
|
2
2
|
|
|
3
|
-
This log was last generated on Thu,
|
|
3
|
+
This log was last generated on Thu, 09 Feb 2023 23:34:12 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## 2.0.0
|
|
8
|
+
|
|
9
|
+
Thu, 09 Feb 2023 23:34:12 GMT
|
|
10
|
+
|
|
11
|
+
### Major changes
|
|
12
|
+
|
|
13
|
+
- chore: new modal overlay component for multiselectfilter (mauricio.batresmontejo@telus.com)
|
|
14
|
+
- Bump @telus-uds/system-theme-tokens to v2.10.0
|
|
15
|
+
|
|
16
|
+
### Patches
|
|
17
|
+
|
|
18
|
+
- fixing icon gap to the right side (evander.owusu@telus.com)
|
|
19
|
+
- Fixing carousel StepTracker variant for mobile (tiagohldb@gmail.com)
|
|
20
|
+
- Tooltip implementation is separated into web and native for a fix on smaller screen size (akshay.pandey@telus.com)
|
|
21
|
+
|
|
22
|
+
## 1.25.0
|
|
23
|
+
|
|
24
|
+
Wed, 01 Feb 2023 20:56:49 GMT
|
|
25
|
+
|
|
26
|
+
### Minor changes
|
|
27
|
+
|
|
28
|
+
- Floating ui integration for Tooltip component (tiagohldb@gmail.com)
|
|
29
|
+
|
|
30
|
+
### Patches
|
|
31
|
+
|
|
32
|
+
- Fixing sub and sup elements line height (tiagohldb@gmail.com)
|
|
33
|
+
|
|
7
34
|
## 1.24.2
|
|
8
35
|
|
|
9
|
-
Thu, 19 Jan 2023 21:
|
|
36
|
+
Thu, 19 Jan 2023 21:39:36 GMT
|
|
10
37
|
|
|
11
38
|
### Patches
|
|
12
39
|
|
package/component-docs.json
CHANGED
|
@@ -58,6 +58,8 @@
|
|
|
58
58
|
"shadow": "shadow",
|
|
59
59
|
"fontSize": "fontSize",
|
|
60
60
|
"color": "color",
|
|
61
|
+
"dividerColor": "color",
|
|
62
|
+
"subtitleColor": "color",
|
|
61
63
|
"lineHeight": "lineHeight",
|
|
62
64
|
"textAlign": "flexJustifyContent",
|
|
63
65
|
"alignSelf": "flexAlign",
|
|
@@ -103,6 +105,7 @@
|
|
|
103
105
|
"paddingRight": "size",
|
|
104
106
|
"paddingTop": "size",
|
|
105
107
|
"paddingBottom": "size",
|
|
108
|
+
"height": "size",
|
|
106
109
|
"width": "size",
|
|
107
110
|
"minWidth": "size",
|
|
108
111
|
"outerBorderColor": "color",
|
|
@@ -5867,6 +5870,13 @@
|
|
|
5867
5870
|
"required": true,
|
|
5868
5871
|
"description": "The text displayed to the user in a ButtonDropdown."
|
|
5869
5872
|
},
|
|
5873
|
+
"subtitle": {
|
|
5874
|
+
"type": {
|
|
5875
|
+
"name": "string"
|
|
5876
|
+
},
|
|
5877
|
+
"required": false,
|
|
5878
|
+
"description": "The text for the subtitle"
|
|
5879
|
+
},
|
|
5870
5880
|
"variant": {
|
|
5871
5881
|
"type": {
|
|
5872
5882
|
"name": "objectOf",
|
|
@@ -5909,6 +5919,8 @@
|
|
|
5909
5919
|
"shadow": "shadow",
|
|
5910
5920
|
"fontSize": "fontSize",
|
|
5911
5921
|
"color": "color",
|
|
5922
|
+
"dividerColor": "color",
|
|
5923
|
+
"subtitleColor": "color",
|
|
5912
5924
|
"lineHeight": "lineHeight",
|
|
5913
5925
|
"textAlign": "flexJustifyContent",
|
|
5914
5926
|
"alignSelf": "flexAlign",
|
|
@@ -10672,7 +10684,7 @@
|
|
|
10672
10684
|
},
|
|
10673
10685
|
"panelNavigation": {
|
|
10674
10686
|
"defaultValue": {
|
|
10675
|
-
"value": "thumbnails ? (\n <CarouselThumbnailNavigation thumbnails={thumbnails} />\n) : (\n <CarouselStepTracker />\n)",
|
|
10687
|
+
"value": "thumbnails ? (\n <CarouselThumbnailNavigation thumbnails={thumbnails} />\n) : (\n <CarouselStepTracker variant={stepTrackerVariant} />\n)",
|
|
10676
10688
|
"computed": false
|
|
10677
10689
|
},
|
|
10678
10690
|
"type": {
|
|
@@ -10824,6 +10836,27 @@
|
|
|
10824
10836
|
"required": false,
|
|
10825
10837
|
"description": ""
|
|
10826
10838
|
},
|
|
10839
|
+
"stepTrackerVariant": {
|
|
10840
|
+
"type": {
|
|
10841
|
+
"name": "objectOf",
|
|
10842
|
+
"value": {
|
|
10843
|
+
"name": "union",
|
|
10844
|
+
"value": [
|
|
10845
|
+
{
|
|
10846
|
+
"name": "string"
|
|
10847
|
+
},
|
|
10848
|
+
{
|
|
10849
|
+
"name": "number"
|
|
10850
|
+
},
|
|
10851
|
+
{
|
|
10852
|
+
"name": "bool"
|
|
10853
|
+
}
|
|
10854
|
+
]
|
|
10855
|
+
}
|
|
10856
|
+
},
|
|
10857
|
+
"required": false,
|
|
10858
|
+
"description": "Prop related to StepTracker Variants"
|
|
10859
|
+
},
|
|
10827
10860
|
"children": {
|
|
10828
10861
|
"type": {
|
|
10829
10862
|
"name": "union",
|
|
@@ -11172,6 +11205,27 @@
|
|
|
11172
11205
|
"required": false,
|
|
11173
11206
|
"description": ""
|
|
11174
11207
|
},
|
|
11208
|
+
"stepTrackerVariant": {
|
|
11209
|
+
"type": {
|
|
11210
|
+
"name": "objectOf",
|
|
11211
|
+
"value": {
|
|
11212
|
+
"name": "union",
|
|
11213
|
+
"value": [
|
|
11214
|
+
{
|
|
11215
|
+
"name": "string"
|
|
11216
|
+
},
|
|
11217
|
+
{
|
|
11218
|
+
"name": "number"
|
|
11219
|
+
},
|
|
11220
|
+
{
|
|
11221
|
+
"name": "bool"
|
|
11222
|
+
}
|
|
11223
|
+
]
|
|
11224
|
+
}
|
|
11225
|
+
},
|
|
11226
|
+
"required": false,
|
|
11227
|
+
"description": "Prop related to StepTracker Variants"
|
|
11228
|
+
},
|
|
11175
11229
|
"children": {
|
|
11176
11230
|
"type": {
|
|
11177
11231
|
"name": "union",
|
package/lib/Button/ButtonBase.js
CHANGED
|
@@ -232,7 +232,8 @@ const ButtonBase = /*#__PURE__*/(0, _react.forwardRef)((_ref9, ref) => {
|
|
|
232
232
|
|
|
233
233
|
const extraButtonState = {
|
|
234
234
|
inactive,
|
|
235
|
-
selected
|
|
235
|
+
selected,
|
|
236
|
+
iconPosition
|
|
236
237
|
};
|
|
237
238
|
|
|
238
239
|
const resolveButtonTokens = pressableState => (0, _utils.resolvePressableTokens)(tokens, pressableState, extraButtonState);
|
package/lib/Carousel/Carousel.js
CHANGED
|
@@ -165,6 +165,7 @@ const Carousel = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
|
|
|
165
165
|
children,
|
|
166
166
|
itemLabel = 'item',
|
|
167
167
|
previousNextNavigationPosition = 'inside',
|
|
168
|
+
stepTrackerVariant,
|
|
168
169
|
previousNextIconSize = 'default',
|
|
169
170
|
minDistanceToCapture = 5,
|
|
170
171
|
minDistanceForAction = 0.2,
|
|
@@ -179,7 +180,9 @@ const Carousel = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
|
|
|
179
180
|
thumbnails = undefined,
|
|
180
181
|
panelNavigation = thumbnails ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_CarouselThumbnailNavigation.default, {
|
|
181
182
|
thumbnails: thumbnails
|
|
182
|
-
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_CarouselStepTracker.default, {
|
|
183
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_CarouselStepTracker.default, {
|
|
184
|
+
variant: stepTrackerVariant
|
|
185
|
+
}),
|
|
183
186
|
tag = 'ul',
|
|
184
187
|
accessibilityRole,
|
|
185
188
|
accessibilityLabel,
|
|
@@ -562,6 +565,11 @@ Carousel.propTypes = { ...selectedSystemPropTypes,
|
|
|
562
565
|
tokens: (0, _utils.getTokensPropType)('Carousel'),
|
|
563
566
|
variant: _utils.variantProp.propType,
|
|
564
567
|
|
|
568
|
+
/**
|
|
569
|
+
* Prop related to StepTracker Variants
|
|
570
|
+
*/
|
|
571
|
+
stepTrackerVariant: _utils.variantProp.propType,
|
|
572
|
+
|
|
565
573
|
/**
|
|
566
574
|
* Slides to render in Carousel. Wrap individual slides in `Carousel.Item`
|
|
567
575
|
*/
|
|
@@ -13,11 +13,16 @@ var _StepTracker = _interopRequireDefault(require("../../StepTracker"));
|
|
|
13
13
|
|
|
14
14
|
var _StackView = _interopRequireDefault(require("../../StackView"));
|
|
15
15
|
|
|
16
|
+
var _utils = require("../../utils");
|
|
17
|
+
|
|
16
18
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
17
19
|
|
|
18
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
21
|
|
|
20
|
-
const CarouselStepTracker =
|
|
22
|
+
const CarouselStepTracker = _ref => {
|
|
23
|
+
let {
|
|
24
|
+
variant
|
|
25
|
+
} = _ref;
|
|
21
26
|
const {
|
|
22
27
|
activeIndex,
|
|
23
28
|
totalItems,
|
|
@@ -47,10 +52,14 @@ const CarouselStepTracker = () => {
|
|
|
47
52
|
stepLabel: getCopyWithPlaceholders('stepLabel'),
|
|
48
53
|
stepTrackerLabel: getCopyWithPlaceholders('stepTrackerLabel')
|
|
49
54
|
},
|
|
50
|
-
tokens: stepTrackerTokens
|
|
55
|
+
tokens: stepTrackerTokens,
|
|
56
|
+
variant: variant
|
|
51
57
|
})
|
|
52
58
|
});
|
|
53
59
|
};
|
|
54
60
|
|
|
61
|
+
CarouselStepTracker.propTypes = {
|
|
62
|
+
variant: _utils.variantProp.propType
|
|
63
|
+
};
|
|
55
64
|
var _default = CarouselStepTracker;
|
|
56
65
|
exports.default = _default;
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
|
|
10
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
+
|
|
12
|
+
var _View = _interopRequireDefault(require("react-native-web/dist/cjs/exports/View"));
|
|
13
|
+
|
|
14
|
+
var _StyleSheet = _interopRequireDefault(require("react-native-web/dist/cjs/exports/StyleSheet"));
|
|
15
|
+
|
|
16
|
+
var _portal = require("@gorhom/portal");
|
|
17
|
+
|
|
18
|
+
var _utils = require("../utils");
|
|
19
|
+
|
|
20
|
+
var _ViewportProvider = require("../ViewportProvider");
|
|
21
|
+
|
|
22
|
+
var _ThemeProvider = require("../ThemeProvider");
|
|
23
|
+
|
|
24
|
+
var _dictionary = _interopRequireDefault(require("./dictionary"));
|
|
25
|
+
|
|
26
|
+
var _Card = _interopRequireDefault(require("../Card"));
|
|
27
|
+
|
|
28
|
+
var _IconButton = _interopRequireDefault(require("../IconButton"));
|
|
29
|
+
|
|
30
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
31
|
+
|
|
32
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
33
|
+
|
|
34
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
35
|
+
|
|
36
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
37
|
+
|
|
38
|
+
const staticStyles = _StyleSheet.default.create({
|
|
39
|
+
positioner: {
|
|
40
|
+
flex: 1,
|
|
41
|
+
// Grow to maxWidth when possible, shrink when not possible
|
|
42
|
+
position: 'absolute',
|
|
43
|
+
height: 330,
|
|
44
|
+
paddingTop: 5,
|
|
45
|
+
zIndex: 10000 // Position on top of all the other overlays, including backdrops and modals
|
|
46
|
+
|
|
47
|
+
},
|
|
48
|
+
closeButtonContainer: {
|
|
49
|
+
position: 'absolute',
|
|
50
|
+
top: 0,
|
|
51
|
+
right: 0,
|
|
52
|
+
zIndex: 1
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
const selectCloseButtonContainerStyles = _ref => {
|
|
57
|
+
let {
|
|
58
|
+
paddingRight,
|
|
59
|
+
paddingTop
|
|
60
|
+
} = _ref;
|
|
61
|
+
return {
|
|
62
|
+
paddingRight,
|
|
63
|
+
paddingTop
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
const selectPaddingContainerStyles = _ref2 => {
|
|
68
|
+
let {
|
|
69
|
+
paddingTop,
|
|
70
|
+
paddingLeft,
|
|
71
|
+
paddingRight
|
|
72
|
+
} = _ref2;
|
|
73
|
+
return {
|
|
74
|
+
paddingBottom: 35,
|
|
75
|
+
paddingTop,
|
|
76
|
+
paddingLeft,
|
|
77
|
+
paddingRight
|
|
78
|
+
};
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
const ModalOverlay = /*#__PURE__*/(0, _react.forwardRef)((_ref3, ref) => {
|
|
82
|
+
let {
|
|
83
|
+
children,
|
|
84
|
+
tokens,
|
|
85
|
+
variant,
|
|
86
|
+
copy,
|
|
87
|
+
onClose
|
|
88
|
+
} = _ref3;
|
|
89
|
+
const viewport = (0, _ViewportProvider.useViewport)();
|
|
90
|
+
const themeTokens = (0, _ThemeProvider.useThemeTokens)('Modal', tokens, variant, {
|
|
91
|
+
viewport,
|
|
92
|
+
maxWidth: false
|
|
93
|
+
});
|
|
94
|
+
const {
|
|
95
|
+
closeIcon: CloseIconComponent,
|
|
96
|
+
maxWidth
|
|
97
|
+
} = themeTokens;
|
|
98
|
+
const getCopy = (0, _utils.useCopy)({
|
|
99
|
+
dictionary: _dictionary.default,
|
|
100
|
+
copy
|
|
101
|
+
});
|
|
102
|
+
const closeLabel = getCopy('closeButton');
|
|
103
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
|
|
104
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_portal.Portal, {
|
|
105
|
+
ref: ref,
|
|
106
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, {
|
|
107
|
+
style: [{
|
|
108
|
+
minWidth: maxWidth
|
|
109
|
+
}, staticStyles.positioner],
|
|
110
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Card.default, {
|
|
111
|
+
tokens: selectPaddingContainerStyles(themeTokens),
|
|
112
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, {
|
|
113
|
+
style: [staticStyles.closeButtonContainer, selectCloseButtonContainerStyles(themeTokens)],
|
|
114
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_IconButton.default, {
|
|
115
|
+
onPress: onClose,
|
|
116
|
+
icon: CloseIconComponent,
|
|
117
|
+
accessibilityRole: "button",
|
|
118
|
+
accessibilityLabel: closeLabel,
|
|
119
|
+
tokens: (0, _utils.selectTokens)('IconButton', themeTokens, 'close')
|
|
120
|
+
})
|
|
121
|
+
}), children]
|
|
122
|
+
})
|
|
123
|
+
})
|
|
124
|
+
})
|
|
125
|
+
});
|
|
126
|
+
});
|
|
127
|
+
ModalOverlay.displayName = 'ModalOverlay';
|
|
128
|
+
ModalOverlay.propTypes = {
|
|
129
|
+
children: _propTypes.default.node.isRequired,
|
|
130
|
+
variant: _utils.variantProp.propType,
|
|
131
|
+
tokens: (0, _utils.getTokensPropType)('Modal'),
|
|
132
|
+
copy: _utils.copyPropTypes,
|
|
133
|
+
onClose: _propTypes.default.func
|
|
134
|
+
};
|
|
135
|
+
var _default = ModalOverlay;
|
|
136
|
+
exports.default = _default;
|
|
@@ -25,8 +25,6 @@ var _Divider = _interopRequireDefault(require("../Divider"));
|
|
|
25
25
|
|
|
26
26
|
var _FlexGrid = _interopRequireDefault(require("../FlexGrid"));
|
|
27
27
|
|
|
28
|
-
var _Modal = _interopRequireDefault(require("../Modal"));
|
|
29
|
-
|
|
30
28
|
var _Spacer = _interopRequireDefault(require("../Spacer"));
|
|
31
29
|
|
|
32
30
|
var _StackView = _interopRequireDefault(require("../StackView"));
|
|
@@ -35,6 +33,8 @@ var _Typography = _interopRequireDefault(require("../Typography"));
|
|
|
35
33
|
|
|
36
34
|
var _Link = require("../Link");
|
|
37
35
|
|
|
36
|
+
var _ModalOverlay = _interopRequireDefault(require("./ModalOverlay"));
|
|
37
|
+
|
|
38
38
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
39
39
|
|
|
40
40
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -47,9 +47,35 @@ const {
|
|
|
47
47
|
Col,
|
|
48
48
|
Row
|
|
49
49
|
} = _FlexGrid.default;
|
|
50
|
-
|
|
50
|
+
|
|
51
|
+
const selectSubTitleTokens = _ref => {
|
|
52
|
+
let {
|
|
53
|
+
subtitleColor
|
|
54
|
+
} = _ref;
|
|
55
|
+
return {
|
|
56
|
+
color: subtitleColor
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
const selectDividerToknes = _ref2 => {
|
|
61
|
+
let {
|
|
62
|
+
dividerColor,
|
|
63
|
+
width,
|
|
64
|
+
decorative = true,
|
|
65
|
+
weight = 'thin'
|
|
66
|
+
} = _ref2;
|
|
67
|
+
return {
|
|
68
|
+
color: dividerColor,
|
|
69
|
+
width,
|
|
70
|
+
decorative,
|
|
71
|
+
weight
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
const MultiSelectFilter = /*#__PURE__*/(0, _react.forwardRef)((_ref3, ref) => {
|
|
51
76
|
let {
|
|
52
77
|
label,
|
|
78
|
+
subtitle,
|
|
53
79
|
id = label,
|
|
54
80
|
variant,
|
|
55
81
|
tokens,
|
|
@@ -63,7 +89,7 @@ const MultiSelectFilter = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
|
63
89
|
inactive = false,
|
|
64
90
|
rowLimit = 12,
|
|
65
91
|
...rest
|
|
66
|
-
} =
|
|
92
|
+
} = _ref3;
|
|
67
93
|
const {
|
|
68
94
|
currentValues,
|
|
69
95
|
setValues
|
|
@@ -74,6 +100,7 @@ const MultiSelectFilter = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
|
74
100
|
onChange,
|
|
75
101
|
readOnly
|
|
76
102
|
});
|
|
103
|
+
const themeTokens = (0, _ThemeProvider.useThemeTokens)('ButtonDropdown', tokens, variant);
|
|
77
104
|
const getItemTokens = (0, _ThemeProvider.useThemeTokensCallback)('ButtonDropdown', tokens, variant);
|
|
78
105
|
|
|
79
106
|
const getButtonTokens = buttonState => (0, _utils.selectTokens)('Button', getItemTokens(buttonState));
|
|
@@ -101,7 +128,7 @@ const MultiSelectFilter = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
|
101
128
|
|
|
102
129
|
const handleChange = event => {
|
|
103
130
|
if (pressHandlers.onPress) pressHandlers === null || pressHandlers === void 0 ? void 0 : pressHandlers.onPress(event);
|
|
104
|
-
setIsOpen(
|
|
131
|
+
setIsOpen(!isOpen);
|
|
105
132
|
};
|
|
106
133
|
|
|
107
134
|
const onApply = e => {
|
|
@@ -110,12 +137,20 @@ const MultiSelectFilter = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
|
110
137
|
};
|
|
111
138
|
|
|
112
139
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
113
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.
|
|
114
|
-
|
|
115
|
-
|
|
140
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.ButtonDropdown, {
|
|
141
|
+
ref: ref,
|
|
142
|
+
...pressHandlers,
|
|
143
|
+
value: isOpen,
|
|
144
|
+
selected: isSelected,
|
|
145
|
+
label: label,
|
|
146
|
+
onChange: handleChange,
|
|
147
|
+
tokens: getButtonTokens,
|
|
148
|
+
inactive: inactive
|
|
149
|
+
}, id), isOpen && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_ModalOverlay.default, {
|
|
116
150
|
variant: {
|
|
117
151
|
width: colSize > 1 ? 'size576' : 's'
|
|
118
152
|
},
|
|
153
|
+
onClose: () => setIsOpen(false),
|
|
119
154
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(Row, {
|
|
120
155
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Typography.default, {
|
|
121
156
|
variant: {
|
|
@@ -123,10 +158,20 @@ const MultiSelectFilter = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
|
123
158
|
},
|
|
124
159
|
children: getCopy('filterByLabel').replace(/%\{filterCategory\}/g, label.toLowerCase())
|
|
125
160
|
})
|
|
161
|
+
}), subtitle && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
162
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Spacer.default, {
|
|
163
|
+
space: 5
|
|
164
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(Row, {
|
|
165
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Typography.default, {
|
|
166
|
+
variant: {
|
|
167
|
+
size: 'h5'
|
|
168
|
+
},
|
|
169
|
+
tokens: selectSubTitleTokens(themeTokens),
|
|
170
|
+
children: subtitle
|
|
171
|
+
})
|
|
172
|
+
})]
|
|
126
173
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Spacer.default, {
|
|
127
174
|
space: 4
|
|
128
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Spacer.default, {
|
|
129
|
-
space: 1
|
|
130
175
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
|
|
131
176
|
scroll: true,
|
|
132
177
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(Row, {
|
|
@@ -143,12 +188,9 @@ const MultiSelectFilter = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
|
143
188
|
}, i))
|
|
144
189
|
})
|
|
145
190
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Divider.default, {
|
|
146
|
-
variant: {
|
|
147
|
-
width: 'full'
|
|
148
|
-
|
|
149
|
-
decorative: true,
|
|
150
|
-
weight: 'thin'
|
|
151
|
-
},
|
|
191
|
+
variant: selectDividerToknes({ ...themeTokens,
|
|
192
|
+
width: 'full'
|
|
193
|
+
}),
|
|
152
194
|
space: 4
|
|
153
195
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(Row, {
|
|
154
196
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_StackView.default, {
|
|
@@ -172,16 +214,7 @@ const MultiSelectFilter = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
|
172
214
|
})]
|
|
173
215
|
})
|
|
174
216
|
})]
|
|
175
|
-
})
|
|
176
|
-
ref: ref,
|
|
177
|
-
...pressHandlers,
|
|
178
|
-
value: isOpen,
|
|
179
|
-
selected: isSelected,
|
|
180
|
-
label: label,
|
|
181
|
-
onChange: handleChange,
|
|
182
|
-
tokens: getButtonTokens,
|
|
183
|
-
inactive: inactive
|
|
184
|
-
}, id)]
|
|
217
|
+
})]
|
|
185
218
|
});
|
|
186
219
|
});
|
|
187
220
|
MultiSelectFilter.displayName = 'MultiSelectFilter';
|
|
@@ -191,6 +224,11 @@ MultiSelectFilter.propTypes = {
|
|
|
191
224
|
*/
|
|
192
225
|
label: _propTypes.default.string.isRequired,
|
|
193
226
|
|
|
227
|
+
/**
|
|
228
|
+
* The text for the subtitle
|
|
229
|
+
*/
|
|
230
|
+
subtitle: _propTypes.default.string,
|
|
231
|
+
|
|
194
232
|
/**
|
|
195
233
|
* An optional unique string may be provided to identify the ButtonDropdown.
|
|
196
234
|
* If not provided, the label is used.
|
|
@@ -92,17 +92,42 @@ const Typography = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) => {
|
|
|
92
92
|
...(0, _utils2.getA11yPropsFromHtmlTag)(tag, accessibilityRole),
|
|
93
93
|
...selectContainerProps(rest)
|
|
94
94
|
};
|
|
95
|
+
|
|
96
|
+
const resetTagStyling = child => {
|
|
97
|
+
if (typeof child === 'object' && ((child === null || child === void 0 ? void 0 : child.type) === 'sub' || (child === null || child === void 0 ? void 0 : child.type) === 'sup')) {
|
|
98
|
+
var _child$props;
|
|
99
|
+
|
|
100
|
+
const sanitizedChild = /*#__PURE__*/_react.default.cloneElement(child, {
|
|
101
|
+
style: { ...(child === null || child === void 0 ? void 0 : (_child$props = child.props) === null || _child$props === void 0 ? void 0 : _child$props.style),
|
|
102
|
+
lineHeight: 0
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
return sanitizedChild;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
return child;
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
const sanitizeChildren = () => {
|
|
113
|
+
if (Array.isArray(children)) {
|
|
114
|
+
return children.map(resetTagStyling);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
return resetTagStyling(children);
|
|
118
|
+
};
|
|
119
|
+
|
|
95
120
|
return block ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, {
|
|
96
121
|
ref: ref,
|
|
97
122
|
...containerProps,
|
|
98
123
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Text.default, { ...resolvedTextProps,
|
|
99
|
-
children: children
|
|
124
|
+
children: sanitizeChildren(children)
|
|
100
125
|
})
|
|
101
126
|
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_Text.default, {
|
|
102
127
|
ref: ref,
|
|
103
128
|
...containerProps,
|
|
104
129
|
...resolvedTextProps,
|
|
105
|
-
children: children
|
|
130
|
+
children: sanitizeChildren(children)
|
|
106
131
|
});
|
|
107
132
|
});
|
|
108
133
|
Typography.displayName = 'Typography';
|
|
@@ -206,7 +206,8 @@ const ButtonBase = /*#__PURE__*/forwardRef((_ref9, ref) => {
|
|
|
206
206
|
} = clickProps.toPressProps(rawRest);
|
|
207
207
|
const extraButtonState = {
|
|
208
208
|
inactive,
|
|
209
|
-
selected
|
|
209
|
+
selected,
|
|
210
|
+
iconPosition
|
|
210
211
|
};
|
|
211
212
|
|
|
212
213
|
const resolveButtonTokens = pressableState => resolvePressableTokens(tokens, pressableState, extraButtonState);
|
|
@@ -135,6 +135,7 @@ const Carousel = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
135
135
|
children,
|
|
136
136
|
itemLabel = 'item',
|
|
137
137
|
previousNextNavigationPosition = 'inside',
|
|
138
|
+
stepTrackerVariant,
|
|
138
139
|
previousNextIconSize = 'default',
|
|
139
140
|
minDistanceToCapture = 5,
|
|
140
141
|
minDistanceForAction = 0.2,
|
|
@@ -149,7 +150,9 @@ const Carousel = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
149
150
|
thumbnails = undefined,
|
|
150
151
|
panelNavigation = thumbnails ? /*#__PURE__*/_jsx(CarouselThumbnailNavigation, {
|
|
151
152
|
thumbnails: thumbnails
|
|
152
|
-
}) : /*#__PURE__*/_jsx(CarouselStepTracker, {
|
|
153
|
+
}) : /*#__PURE__*/_jsx(CarouselStepTracker, {
|
|
154
|
+
variant: stepTrackerVariant
|
|
155
|
+
}),
|
|
153
156
|
tag = 'ul',
|
|
154
157
|
accessibilityRole,
|
|
155
158
|
accessibilityLabel,
|
|
@@ -504,6 +507,11 @@ Carousel.propTypes = { ...selectedSystemPropTypes,
|
|
|
504
507
|
tokens: getTokensPropType('Carousel'),
|
|
505
508
|
variant: variantProp.propType,
|
|
506
509
|
|
|
510
|
+
/**
|
|
511
|
+
* Prop related to StepTracker Variants
|
|
512
|
+
*/
|
|
513
|
+
stepTrackerVariant: variantProp.propType,
|
|
514
|
+
|
|
507
515
|
/**
|
|
508
516
|
* Slides to render in Carousel. Wrap individual slides in `Carousel.Item`
|
|
509
517
|
*/
|
|
@@ -2,9 +2,13 @@ import React from 'react';
|
|
|
2
2
|
import { useCarousel } from '../CarouselContext';
|
|
3
3
|
import StepTracker from '../../StepTracker';
|
|
4
4
|
import StackView from '../../StackView';
|
|
5
|
+
import { variantProp } from '../../utils';
|
|
5
6
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
7
|
|
|
7
|
-
const CarouselStepTracker =
|
|
8
|
+
const CarouselStepTracker = _ref => {
|
|
9
|
+
let {
|
|
10
|
+
variant
|
|
11
|
+
} = _ref;
|
|
8
12
|
const {
|
|
9
13
|
activeIndex,
|
|
10
14
|
totalItems,
|
|
@@ -34,9 +38,13 @@ const CarouselStepTracker = () => {
|
|
|
34
38
|
stepLabel: getCopyWithPlaceholders('stepLabel'),
|
|
35
39
|
stepTrackerLabel: getCopyWithPlaceholders('stepTrackerLabel')
|
|
36
40
|
},
|
|
37
|
-
tokens: stepTrackerTokens
|
|
41
|
+
tokens: stepTrackerTokens,
|
|
42
|
+
variant: variant
|
|
38
43
|
})
|
|
39
44
|
});
|
|
40
45
|
};
|
|
41
46
|
|
|
47
|
+
CarouselStepTracker.propTypes = {
|
|
48
|
+
variant: variantProp.propType
|
|
49
|
+
};
|
|
42
50
|
export default CarouselStepTracker;
|