@telus-uds/components-base 1.25.0 → 1.27.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 +46 -2
- package/component-docs.json +57 -2
- package/lib/Button/ButtonBase.js +2 -1
- package/lib/Carousel/Carousel.js +19 -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-module/Button/ButtonBase.js +2 -1
- package/lib-module/Carousel/Carousel.js +16 -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/package.json +2 -2
- package/src/Button/ButtonBase.jsx +1 -1
- package/src/Carousel/Carousel.jsx +16 -2
- package/src/Carousel/CarouselStepTracker/CarouselStepTracker.jsx +7 -1
- package/src/MultiSelectFilter/ModalOverlay.jsx +86 -0
- package/src/MultiSelectFilter/MultiSelectFilter.jsx +73 -49
- package/.eslintrc.js +0 -9
- package/__tests17__/A11yText/A11yText.test.jsx +0 -34
- package/__tests17__/ActivityIndicator/ActivityIndicator.test.jsx +0 -68
- package/__tests17__/ActivityIndicator/__snapshots__/ActivityIndicator.test.jsx.snap +0 -299
- package/__tests17__/Box/Box.test.jsx +0 -111
- package/__tests17__/Button/Button.test.jsx +0 -86
- package/__tests17__/Button/ButtonBase.test.jsx +0 -82
- package/__tests17__/Button/ButtonGroup.test.jsx +0 -347
- package/__tests17__/Button/ButtonLink.test.jsx +0 -61
- package/__tests17__/Card/Card.test.jsx +0 -63
- package/__tests17__/Carousel/Carousel.test.jsx +0 -128
- package/__tests17__/Carousel/CarouselTabs.test.jsx +0 -142
- package/__tests17__/Checkbox/Checkbox.test.jsx +0 -94
- package/__tests17__/Checkbox/CheckboxGroup.test.jsx +0 -246
- package/__tests17__/Divider/Divider.test.jsx +0 -91
- package/__tests17__/ExpandCollapse/ExpandCollapse.test.jsx +0 -109
- package/__tests17__/Feedback/Feedback.test.jsx +0 -42
- package/__tests17__/FlexGrid/Col.test.jsx +0 -261
- package/__tests17__/FlexGrid/FlexGrid.test.jsx +0 -136
- package/__tests17__/FlexGrid/Row.test.jsx +0 -273
- package/__tests17__/HorizontalScroll/HorizontalScroll.test.jsx +0 -165
- package/__tests17__/Icon/Icon.test.jsx +0 -61
- package/__tests17__/IconButton/IconButton.test.jsx +0 -52
- package/__tests17__/InputLabel/InputLabel.test.jsx +0 -28
- package/__tests17__/InputLabel/__snapshots__/InputLabel.test.jsx.snap +0 -3
- package/__tests17__/InputSupports/InputSupports.test.jsx +0 -60
- package/__tests17__/Link/Link.test.jsx +0 -63
- package/__tests17__/Link/TextButton.test.jsx +0 -35
- package/__tests17__/List/List.test.jsx +0 -82
- package/__tests17__/Modal/Modal.test.jsx +0 -47
- package/__tests17__/Notification/Notification.test.jsx +0 -20
- package/__tests17__/Pagination/Pagination.test.jsx +0 -160
- package/__tests17__/Progress/Progress.test.jsx +0 -79
- package/__tests17__/Radio/Radio.test.jsx +0 -87
- package/__tests17__/Radio/RadioGroup.test.jsx +0 -220
- package/__tests17__/RadioCard/RadioCard.test.jsx +0 -87
- package/__tests17__/RadioCard/RadioCardGroup.test.jsx +0 -246
- package/__tests17__/Search/Search.test.jsx +0 -87
- package/__tests17__/Select/Select.test.jsx +0 -94
- package/__tests17__/SideNav/SideNav.test.jsx +0 -110
- package/__tests17__/Skeleton/Skeleton.test.jsx +0 -61
- package/__tests17__/SkipLink/SkipLink.test.jsx +0 -61
- package/__tests17__/Spacer/Spacer.test.jsx +0 -63
- package/__tests17__/StackView/StackView.test.jsx +0 -211
- package/__tests17__/StackView/StackWrap.test.jsx +0 -47
- package/__tests17__/StackView/getStackedContent.test.jsx +0 -295
- package/__tests17__/StepTracker/StepTracker.test.jsx +0 -108
- package/__tests17__/Tabs/Tabs.test.jsx +0 -49
- package/__tests17__/Tags/Tags.test.jsx +0 -327
- package/__tests17__/TextInput/TextArea.test.jsx +0 -35
- package/__tests17__/TextInput/TextInputBase.test.jsx +0 -125
- package/__tests17__/ThemeProvider/ThemeProvider.test.jsx +0 -82
- package/__tests17__/ThemeProvider/useThemeTokens.test.jsx +0 -514
- package/__tests17__/ThemeProvider/utils/theme-tokens.test.js +0 -41
- package/__tests17__/ToggleSwitch/ToggleSwitch.test.jsx +0 -82
- package/__tests17__/ToggleSwitch/ToggleSwitchGroup.test.jsx +0 -192
- package/__tests17__/Tooltip/Tooltip.test.jsx +0 -65
- package/__tests17__/Tooltip/getTooltipPosition.test.js +0 -79
- package/__tests17__/Typography/typography.test.jsx +0 -90
- package/__tests17__/utils/children.test.jsx +0 -128
- package/__tests17__/utils/containUniqueFields.test.js +0 -25
- package/__tests17__/utils/input.test.js +0 -375
- package/__tests17__/utils/props.test.js +0 -36
- package/__tests17__/utils/semantics.test.jsx +0 -34
- package/__tests17__/utils/useCopy.test.js +0 -42
- package/__tests17__/utils/useResponsiveProp.test.jsx +0 -202
- package/__tests17__/utils/useSpacingScale.test.jsx +0 -273
- package/__tests17__/utils/useUniqueId.test.js +0 -31
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,56 @@
|
|
|
1
1
|
# Change Log - @telus-uds/components-base
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Thu, 23 Feb 2023 17:20:42 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## 1.27.0
|
|
8
|
+
|
|
9
|
+
Thu, 23 Feb 2023 17:20:42 GMT
|
|
10
|
+
|
|
11
|
+
### Minor changes
|
|
12
|
+
|
|
13
|
+
- update public mobile themes (evander.owusu@telus.com)
|
|
14
|
+
- Bump @telus-uds/system-theme-tokens to v2.11.0
|
|
15
|
+
|
|
16
|
+
### Patches
|
|
17
|
+
|
|
18
|
+
- ignore unwanted files (evander.owusu@telus.com)
|
|
19
|
+
- Updated snapshots based on the SVG changes (101351850+nadaltelus@users.noreply.github.com)
|
|
20
|
+
|
|
21
|
+
## 1.26.0
|
|
22
|
+
|
|
23
|
+
Fri, 10 Feb 2023 17:40:05 GMT
|
|
24
|
+
|
|
25
|
+
### Minor changes
|
|
26
|
+
|
|
27
|
+
- chore: new modal overlay component for multiselectfilter (mauricio.batresmontejo@telus.com)
|
|
28
|
+
|
|
29
|
+
### Patches
|
|
30
|
+
|
|
31
|
+
- fixing icon gap to the right side (evander.owusu@telus.com)
|
|
32
|
+
- Fix carousel content not centering when resizing screen (tiagohldb@gmail.com)
|
|
33
|
+
- Fixing carousel StepTracker variant for mobile (tiagohldb@gmail.com)
|
|
34
|
+
- Tooltip implementation is separated into web and native for a fix on smaller screen size (akshay.pandey@telus.com)
|
|
35
|
+
|
|
36
|
+
## 2.0.0
|
|
37
|
+
|
|
38
|
+
Thu, 09 Feb 2023 23:38:35 GMT
|
|
39
|
+
|
|
40
|
+
### Major changes
|
|
41
|
+
|
|
42
|
+
- chore: new modal overlay component for multiselectfilter (mauricio.batresmontejo@telus.com)
|
|
43
|
+
- Bump @telus-uds/system-theme-tokens to v2.10.0
|
|
44
|
+
|
|
45
|
+
### Patches
|
|
46
|
+
|
|
47
|
+
- fixing icon gap to the right side (evander.owusu@telus.com)
|
|
48
|
+
- Fixing carousel StepTracker variant for mobile (tiagohldb@gmail.com)
|
|
49
|
+
- Tooltip implementation is separated into web and native for a fix on smaller screen size (akshay.pandey@telus.com)
|
|
50
|
+
|
|
7
51
|
## 1.25.0
|
|
8
52
|
|
|
9
|
-
Wed, 01 Feb 2023 20:
|
|
53
|
+
Wed, 01 Feb 2023 20:56:49 GMT
|
|
10
54
|
|
|
11
55
|
### Minor changes
|
|
12
56
|
|
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",
|
|
@@ -1814,7 +1817,8 @@
|
|
|
1814
1817
|
8,
|
|
1815
1818
|
9,
|
|
1816
1819
|
10,
|
|
1817
|
-
11
|
|
1820
|
+
11,
|
|
1821
|
+
12
|
|
1818
1822
|
],
|
|
1819
1823
|
"type": "state"
|
|
1820
1824
|
}
|
|
@@ -5867,6 +5871,13 @@
|
|
|
5867
5871
|
"required": true,
|
|
5868
5872
|
"description": "The text displayed to the user in a ButtonDropdown."
|
|
5869
5873
|
},
|
|
5874
|
+
"subtitle": {
|
|
5875
|
+
"type": {
|
|
5876
|
+
"name": "string"
|
|
5877
|
+
},
|
|
5878
|
+
"required": false,
|
|
5879
|
+
"description": "The text for the subtitle"
|
|
5880
|
+
},
|
|
5870
5881
|
"variant": {
|
|
5871
5882
|
"type": {
|
|
5872
5883
|
"name": "objectOf",
|
|
@@ -5909,6 +5920,8 @@
|
|
|
5909
5920
|
"shadow": "shadow",
|
|
5910
5921
|
"fontSize": "fontSize",
|
|
5911
5922
|
"color": "color",
|
|
5923
|
+
"dividerColor": "color",
|
|
5924
|
+
"subtitleColor": "color",
|
|
5912
5925
|
"lineHeight": "lineHeight",
|
|
5913
5926
|
"textAlign": "flexJustifyContent",
|
|
5914
5927
|
"alignSelf": "flexAlign",
|
|
@@ -10672,7 +10685,7 @@
|
|
|
10672
10685
|
},
|
|
10673
10686
|
"panelNavigation": {
|
|
10674
10687
|
"defaultValue": {
|
|
10675
|
-
"value": "thumbnails ? (\n <CarouselThumbnailNavigation thumbnails={thumbnails} />\n) : (\n <CarouselStepTracker />\n)",
|
|
10688
|
+
"value": "thumbnails ? (\n <CarouselThumbnailNavigation thumbnails={thumbnails} />\n) : (\n <CarouselStepTracker variant={stepTrackerVariant} />\n)",
|
|
10676
10689
|
"computed": false
|
|
10677
10690
|
},
|
|
10678
10691
|
"type": {
|
|
@@ -10824,6 +10837,27 @@
|
|
|
10824
10837
|
"required": false,
|
|
10825
10838
|
"description": ""
|
|
10826
10839
|
},
|
|
10840
|
+
"stepTrackerVariant": {
|
|
10841
|
+
"type": {
|
|
10842
|
+
"name": "objectOf",
|
|
10843
|
+
"value": {
|
|
10844
|
+
"name": "union",
|
|
10845
|
+
"value": [
|
|
10846
|
+
{
|
|
10847
|
+
"name": "string"
|
|
10848
|
+
},
|
|
10849
|
+
{
|
|
10850
|
+
"name": "number"
|
|
10851
|
+
},
|
|
10852
|
+
{
|
|
10853
|
+
"name": "bool"
|
|
10854
|
+
}
|
|
10855
|
+
]
|
|
10856
|
+
}
|
|
10857
|
+
},
|
|
10858
|
+
"required": false,
|
|
10859
|
+
"description": "Prop related to StepTracker Variants"
|
|
10860
|
+
},
|
|
10827
10861
|
"children": {
|
|
10828
10862
|
"type": {
|
|
10829
10863
|
"name": "union",
|
|
@@ -11172,6 +11206,27 @@
|
|
|
11172
11206
|
"required": false,
|
|
11173
11207
|
"description": ""
|
|
11174
11208
|
},
|
|
11209
|
+
"stepTrackerVariant": {
|
|
11210
|
+
"type": {
|
|
11211
|
+
"name": "objectOf",
|
|
11212
|
+
"value": {
|
|
11213
|
+
"name": "union",
|
|
11214
|
+
"value": [
|
|
11215
|
+
{
|
|
11216
|
+
"name": "string"
|
|
11217
|
+
},
|
|
11218
|
+
{
|
|
11219
|
+
"name": "number"
|
|
11220
|
+
},
|
|
11221
|
+
{
|
|
11222
|
+
"name": "bool"
|
|
11223
|
+
}
|
|
11224
|
+
]
|
|
11225
|
+
}
|
|
11226
|
+
},
|
|
11227
|
+
"required": false,
|
|
11228
|
+
"description": "Prop related to StepTracker Variants"
|
|
11229
|
+
},
|
|
11175
11230
|
"children": {
|
|
11176
11231
|
"type": {
|
|
11177
11232
|
"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
|
@@ -17,6 +17,8 @@ var _StyleSheet = _interopRequireDefault(require("react-native-web/dist/cjs/expo
|
|
|
17
17
|
|
|
18
18
|
var _Platform = _interopRequireDefault(require("react-native-web/dist/cjs/exports/Platform"));
|
|
19
19
|
|
|
20
|
+
var _Dimensions = _interopRequireDefault(require("react-native-web/dist/cjs/exports/Dimensions"));
|
|
21
|
+
|
|
20
22
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
21
23
|
|
|
22
24
|
var _ThemeProvider = require("../ThemeProvider");
|
|
@@ -165,6 +167,7 @@ const Carousel = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
|
|
|
165
167
|
children,
|
|
166
168
|
itemLabel = 'item',
|
|
167
169
|
previousNextNavigationPosition = 'inside',
|
|
170
|
+
stepTrackerVariant,
|
|
168
171
|
previousNextIconSize = 'default',
|
|
169
172
|
minDistanceToCapture = 5,
|
|
170
173
|
minDistanceForAction = 0.2,
|
|
@@ -179,7 +182,9 @@ const Carousel = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
|
|
|
179
182
|
thumbnails = undefined,
|
|
180
183
|
panelNavigation = thumbnails ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_CarouselThumbnailNavigation.default, {
|
|
181
184
|
thumbnails: thumbnails
|
|
182
|
-
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_CarouselStepTracker.default, {
|
|
185
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_CarouselStepTracker.default, {
|
|
186
|
+
variant: stepTrackerVariant
|
|
187
|
+
}),
|
|
183
188
|
tag = 'ul',
|
|
184
189
|
accessibilityRole,
|
|
185
190
|
accessibilityLabel,
|
|
@@ -419,6 +424,14 @@ const Carousel = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
|
|
|
419
424
|
};
|
|
420
425
|
}, [pan.x, pan.y]);
|
|
421
426
|
|
|
427
|
+
_react.default.useEffect(() => {
|
|
428
|
+
const subscription = _Dimensions.default.addEventListener('change', () => {
|
|
429
|
+
updateOffset();
|
|
430
|
+
});
|
|
431
|
+
|
|
432
|
+
return () => subscription === null || subscription === void 0 ? void 0 : subscription.remove();
|
|
433
|
+
});
|
|
434
|
+
|
|
422
435
|
const goToNext = _react.default.useCallback(() => {
|
|
423
436
|
goToNeighboring();
|
|
424
437
|
}, [goToNeighboring]);
|
|
@@ -562,6 +575,11 @@ Carousel.propTypes = { ...selectedSystemPropTypes,
|
|
|
562
575
|
tokens: (0, _utils.getTokensPropType)('Carousel'),
|
|
563
576
|
variant: _utils.variantProp.propType,
|
|
564
577
|
|
|
578
|
+
/**
|
|
579
|
+
* Prop related to StepTracker Variants
|
|
580
|
+
*/
|
|
581
|
+
stepTrackerVariant: _utils.variantProp.propType,
|
|
582
|
+
|
|
565
583
|
/**
|
|
566
584
|
* Slides to render in Carousel. Wrap individual slides in `Carousel.Item`
|
|
567
585
|
*/
|
|
@@ -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.
|
|
@@ -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);
|
|
@@ -4,6 +4,7 @@ import Animated from "react-native-web/dist/exports/Animated";
|
|
|
4
4
|
import PanResponder from "react-native-web/dist/exports/PanResponder";
|
|
5
5
|
import StyleSheet from "react-native-web/dist/exports/StyleSheet";
|
|
6
6
|
import Platform from "react-native-web/dist/exports/Platform";
|
|
7
|
+
import Dimensions from "react-native-web/dist/exports/Dimensions";
|
|
7
8
|
import PropTypes from 'prop-types';
|
|
8
9
|
import { useThemeTokens } from '../ThemeProvider';
|
|
9
10
|
import { useViewport } from '../ViewportProvider';
|
|
@@ -135,6 +136,7 @@ const Carousel = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
135
136
|
children,
|
|
136
137
|
itemLabel = 'item',
|
|
137
138
|
previousNextNavigationPosition = 'inside',
|
|
139
|
+
stepTrackerVariant,
|
|
138
140
|
previousNextIconSize = 'default',
|
|
139
141
|
minDistanceToCapture = 5,
|
|
140
142
|
minDistanceForAction = 0.2,
|
|
@@ -149,7 +151,9 @@ const Carousel = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
149
151
|
thumbnails = undefined,
|
|
150
152
|
panelNavigation = thumbnails ? /*#__PURE__*/_jsx(CarouselThumbnailNavigation, {
|
|
151
153
|
thumbnails: thumbnails
|
|
152
|
-
}) : /*#__PURE__*/_jsx(CarouselStepTracker, {
|
|
154
|
+
}) : /*#__PURE__*/_jsx(CarouselStepTracker, {
|
|
155
|
+
variant: stepTrackerVariant
|
|
156
|
+
}),
|
|
153
157
|
tag = 'ul',
|
|
154
158
|
accessibilityRole,
|
|
155
159
|
accessibilityLabel,
|
|
@@ -369,6 +373,12 @@ const Carousel = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
369
373
|
pan.y.removeAllListeners();
|
|
370
374
|
};
|
|
371
375
|
}, [pan.x, pan.y]);
|
|
376
|
+
React.useEffect(() => {
|
|
377
|
+
const subscription = Dimensions.addEventListener('change', () => {
|
|
378
|
+
updateOffset();
|
|
379
|
+
});
|
|
380
|
+
return () => subscription === null || subscription === void 0 ? void 0 : subscription.remove();
|
|
381
|
+
});
|
|
372
382
|
const goToNext = React.useCallback(() => {
|
|
373
383
|
goToNeighboring();
|
|
374
384
|
}, [goToNeighboring]);
|
|
@@ -504,6 +514,11 @@ Carousel.propTypes = { ...selectedSystemPropTypes,
|
|
|
504
514
|
tokens: getTokensPropType('Carousel'),
|
|
505
515
|
variant: variantProp.propType,
|
|
506
516
|
|
|
517
|
+
/**
|
|
518
|
+
* Prop related to StepTracker Variants
|
|
519
|
+
*/
|
|
520
|
+
stepTrackerVariant: variantProp.propType,
|
|
521
|
+
|
|
507
522
|
/**
|
|
508
523
|
* Slides to render in Carousel. Wrap individual slides in `Carousel.Item`
|
|
509
524
|
*/
|
|
@@ -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;
|