@razorpay/blade 10.7.0 → 10.8.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/build/components/index.d.ts +3508 -4658
- package/build/components/index.development.web.js +2232 -2178
- package/build/components/index.development.web.js.map +1 -1
- package/build/components/index.native.d.ts +3081 -4228
- package/build/components/index.native.js +144 -122
- package/build/components/index.native.js.map +1 -1
- package/build/components/index.production.web.js +1767 -1706
- package/build/components/index.production.web.js.map +1 -1
- package/build/css/bankingThemeDarkDesktop.css +1 -1
- package/build/css/bankingThemeDarkMobile.css +1 -1
- package/build/css/bankingThemeLightDesktop.css +1 -1
- package/build/css/bankingThemeLightMobile.css +1 -1
- package/build/css/paymentThemeDarkDesktop.css +1 -1
- package/build/css/paymentThemeDarkMobile.css +1 -1
- package/build/css/paymentThemeLightDesktop.css +1 -1
- package/build/css/paymentThemeLightMobile.css +1 -1
- package/build/tokens/index.d.ts +190 -680
- package/build/tokens/index.development.web.js +127 -103
- package/build/tokens/index.development.web.js.map +1 -1
- package/build/tokens/index.native.d.ts +190 -680
- package/build/tokens/index.native.js +126 -102
- package/build/tokens/index.native.js.map +1 -1
- package/build/tokens/index.production.web.js +196 -113
- package/build/tokens/index.production.web.js.map +1 -1
- package/build/utils/index.d.ts +488 -593
- package/build/utils/index.development.web.js.map +1 -1
- package/build/utils/index.native.d.ts +488 -593
- package/build/utils/index.native.js.map +1 -1
- package/build/utils/index.production.web.js.map +1 -1
- package/package.json +12 -10
|
@@ -1,1575 +1,974 @@
|
|
|
1
1
|
import _defineProperty$1 from '@babel/runtime/helpers/defineProperty';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import React__default, { useMemo, useCallback, useState, useEffect, useRef, useContext, createContext, Fragment as Fragment$1, Children, cloneElement, forwardRef } from 'react';
|
|
4
|
-
import _toConsumableArray$1 from '@babel/runtime/helpers/toConsumableArray';
|
|
5
|
-
import _objectWithoutProperties$1 from '@babel/runtime/helpers/objectWithoutProperties';
|
|
6
4
|
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
7
5
|
import styled, { ThemeProvider, css, keyframes } from 'styled-components';
|
|
6
|
+
import _objectWithoutProperties$1 from '@babel/runtime/helpers/objectWithoutProperties';
|
|
8
7
|
import { FloatingDelayGroup, useFloating, offset, flip, size as size$1, autoUpdate, useTransitionStyles, FloatingOverlay, FloatingPortal, FloatingFocusManager, shift, arrow, useDelayGroup, useDelayGroupContext, useHover, useFocus, useRole, useInteractions, FloatingArrow } from '@floating-ui/react';
|
|
9
8
|
import '@babel/runtime/helpers/typeof';
|
|
9
|
+
import _toConsumableArray$1 from '@babel/runtime/helpers/toConsumableArray';
|
|
10
10
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
11
11
|
import _classCallCheck from '@babel/runtime/helpers/classCallCheck';
|
|
12
12
|
import _createClass from '@babel/runtime/helpers/createClass';
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
DropdownButton: 'DropdownButton',
|
|
29
|
-
DropdownLink: 'DropdownLink'
|
|
14
|
+
var getColorScheme = function getColorScheme() {
|
|
15
|
+
var colorScheme = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'light';
|
|
16
|
+
// @TODO: create a useMediaQuery hook with an event listener which will subscribe to changes and move all this logic there
|
|
17
|
+
var colorSchemeMediaQueryMap = {
|
|
18
|
+
light: '(prefers-color-scheme: light)',
|
|
19
|
+
dark: '(prefers-color-scheme: dark)',
|
|
20
|
+
system: 'default'
|
|
21
|
+
};
|
|
22
|
+
var supportsMatchMedia = typeof window !== 'undefined' && typeof window.matchMedia === 'function';
|
|
23
|
+
if (colorScheme === 'light' || colorScheme === 'dark') {
|
|
24
|
+
return colorScheme;
|
|
25
|
+
}
|
|
26
|
+
if (colorScheme === 'system' && supportsMatchMedia && window.matchMedia(colorSchemeMediaQueryMap.dark).matches) {
|
|
27
|
+
return 'dark';
|
|
30
28
|
}
|
|
29
|
+
return 'light';
|
|
31
30
|
};
|
|
32
31
|
|
|
33
|
-
|
|
34
|
-
var
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
First: 'First',
|
|
38
|
-
Last: 'Last',
|
|
39
|
-
Next: 'Next',
|
|
40
|
-
Open: 'Open',
|
|
41
|
-
PageDown: 'PageDown',
|
|
42
|
-
PageUp: 'PageUp',
|
|
43
|
-
Previous: 'Previous',
|
|
44
|
-
Select: 'Select',
|
|
45
|
-
Type: 'Type'
|
|
32
|
+
var getMediaQuery = function getMediaQuery(_ref) {
|
|
33
|
+
var min = _ref.min,
|
|
34
|
+
max = _ref.max;
|
|
35
|
+
return "screen and (min-width: ".concat(min, "px)").concat(max ? " and (max-width: ".concat(max, "px)") : '');
|
|
46
36
|
};
|
|
47
37
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
*
|
|
52
|
-
*/
|
|
53
|
-
function filterOptions() {
|
|
54
|
-
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
55
|
-
var filter = arguments.length > 1 ? arguments[1] : undefined;
|
|
56
|
-
var exclude = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
|
|
57
|
-
return options.filter(function (option) {
|
|
58
|
-
var matches = option.toLowerCase().startsWith(filter.toLowerCase());
|
|
59
|
-
return matches && !exclude.includes(option);
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
/**
|
|
64
|
-
* Map a keypress to action
|
|
65
|
-
*/
|
|
66
|
-
function getActionFromKey(e, isOpen) {
|
|
67
|
-
if (!e) {
|
|
68
|
-
return undefined;
|
|
69
|
-
}
|
|
70
|
-
var altKey = e.altKey,
|
|
71
|
-
ctrlKey = e.ctrlKey,
|
|
72
|
-
metaKey = e.metaKey;
|
|
73
|
-
var key = '';
|
|
74
|
-
if ('key' in e) {
|
|
75
|
-
key = e.key;
|
|
76
|
-
}
|
|
77
|
-
var openKeys = ['ArrowDown', 'ArrowUp', 'Enter', ' ']; // all keys that will do the default open action
|
|
78
|
-
if (!key) return undefined;
|
|
79
|
-
// handle opening when closed
|
|
80
|
-
if (!isOpen && key && openKeys.includes(key)) {
|
|
81
|
-
return SelectActions.Open;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
// home and end move the selected option when open or closed
|
|
85
|
-
if (key === 'Home') {
|
|
86
|
-
return SelectActions.First;
|
|
38
|
+
var getPlatformType = function getPlatformType() {
|
|
39
|
+
if (typeof navigator !== 'undefined' && navigator.product === 'ReactNative') {
|
|
40
|
+
return 'react-native';
|
|
87
41
|
}
|
|
88
|
-
if (
|
|
89
|
-
return
|
|
42
|
+
if (typeof document !== 'undefined') {
|
|
43
|
+
return 'browser';
|
|
90
44
|
}
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
if (key === 'Backspace' || key === 'Clear' || key.length === 1 && key !== ' ' && !altKey && !ctrlKey && !metaKey) {
|
|
94
|
-
return SelectActions.Type;
|
|
45
|
+
if (typeof process !== 'undefined') {
|
|
46
|
+
return 'node';
|
|
95
47
|
}
|
|
48
|
+
return 'unknown';
|
|
49
|
+
};
|
|
96
50
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
51
|
+
var deviceType = {
|
|
52
|
+
desktop: 'desktop',
|
|
53
|
+
mobile: 'mobile'
|
|
54
|
+
};
|
|
55
|
+
var useBreakpoint = function useBreakpoint(_ref) {
|
|
56
|
+
var _window;
|
|
57
|
+
var breakpoints = _ref.breakpoints;
|
|
58
|
+
var supportsMatchMedia = typeof document !== 'undefined' && typeof window !== 'undefined' && typeof ((_window = window) === null || _window === void 0 ? void 0 : _window.matchMedia) === 'function';
|
|
59
|
+
var breakpointsTokenAndQueryCollection = useMemo(function () {
|
|
60
|
+
return supportsMatchMedia ? Object.entries(breakpoints).map(function (_ref2, index, breakpointsArray) {
|
|
61
|
+
var _breakpointsArray;
|
|
62
|
+
var _ref3 = _slicedToArray(_ref2, 2),
|
|
63
|
+
token = _ref3[0],
|
|
64
|
+
screenSize = _ref3[1];
|
|
65
|
+
var min = screenSize;
|
|
66
|
+
var maxValue = (_breakpointsArray = breakpointsArray[index + 1]) === null || _breakpointsArray === void 0 ? void 0 : _breakpointsArray[1];
|
|
67
|
+
var mediaQuery = getMediaQuery({
|
|
68
|
+
min: min,
|
|
69
|
+
max: maxValue ? maxValue - 1 : undefined
|
|
70
|
+
});
|
|
71
|
+
return {
|
|
72
|
+
token: token,
|
|
73
|
+
screenSize: screenSize,
|
|
74
|
+
mediaQuery: mediaQuery
|
|
75
|
+
};
|
|
76
|
+
}) : [];
|
|
77
|
+
}, [breakpoints, supportsMatchMedia]);
|
|
78
|
+
var getMatchedDeviceType = useCallback(function (matchedBreakpoint) {
|
|
79
|
+
var matchedDeviceType = deviceType.mobile;
|
|
80
|
+
var platform = getPlatformType();
|
|
81
|
+
if (platform === 'react-native') {
|
|
82
|
+
matchedDeviceType = deviceType.mobile;
|
|
83
|
+
} else if (platform === 'browser') {
|
|
84
|
+
if (matchedBreakpoint && ['base', 'xs', 's'].includes(matchedBreakpoint)) {
|
|
85
|
+
// tablet is also categorised as mobile
|
|
86
|
+
matchedDeviceType = deviceType.mobile;
|
|
87
|
+
} else {
|
|
88
|
+
matchedDeviceType = deviceType.desktop;
|
|
89
|
+
}
|
|
90
|
+
} else if (platform === 'node') {
|
|
91
|
+
//@TODO: Check for useragent for node
|
|
92
|
+
matchedDeviceType = deviceType.desktop;
|
|
113
93
|
}
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
return
|
|
94
|
+
return matchedDeviceType;
|
|
95
|
+
}, []);
|
|
96
|
+
var getMatchedBreakpoint = useCallback(function (event) {
|
|
97
|
+
var _breakpointsTokenAndQ, _breakpointsTokenAndQ2;
|
|
98
|
+
var matchedBreakpoint = (_breakpointsTokenAndQ = (_breakpointsTokenAndQ2 = breakpointsTokenAndQueryCollection.find(function (_ref4) {
|
|
99
|
+
var _ref4$mediaQuery = _ref4.mediaQuery,
|
|
100
|
+
mediaQuery = _ref4$mediaQuery === void 0 ? '' : _ref4$mediaQuery;
|
|
101
|
+
// this will run whenever mediaQuery change event is triggered
|
|
102
|
+
if ((event === null || event === void 0 ? void 0 : event.media) === mediaQuery) {
|
|
103
|
+
return true;
|
|
104
|
+
}
|
|
105
|
+
// this will run when the state is initialised for the first time and hence the event object will be empty so we'll fallback to browser's window object
|
|
106
|
+
if (window.matchMedia(mediaQuery).matches) {
|
|
107
|
+
return true;
|
|
108
|
+
}
|
|
109
|
+
return false;
|
|
110
|
+
})) === null || _breakpointsTokenAndQ2 === void 0 ? void 0 : _breakpointsTokenAndQ2.token) !== null && _breakpointsTokenAndQ !== void 0 ? _breakpointsTokenAndQ : undefined;
|
|
111
|
+
return matchedBreakpoint;
|
|
112
|
+
}, [breakpointsTokenAndQueryCollection]);
|
|
113
|
+
var _useState = useState(function () {
|
|
114
|
+
var matchedBreakpoint = getMatchedBreakpoint();
|
|
115
|
+
var matchedDeviceType = getMatchedDeviceType(matchedBreakpoint);
|
|
116
|
+
return {
|
|
117
|
+
matchedBreakpoint: matchedBreakpoint,
|
|
118
|
+
matchedDeviceType: matchedDeviceType
|
|
119
|
+
};
|
|
120
|
+
}),
|
|
121
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
122
|
+
breakpointAndDevice = _useState2[0],
|
|
123
|
+
setBreakpointAndDevice = _useState2[1];
|
|
124
|
+
useEffect(function () {
|
|
125
|
+
if (!supportsMatchMedia) {
|
|
126
|
+
return undefined;
|
|
127
|
+
}
|
|
128
|
+
var handleMediaQueryChange = function handleMediaQueryChange(event) {
|
|
129
|
+
setBreakpointAndDevice(function () {
|
|
130
|
+
var matchedBreakpoint = getMatchedBreakpoint(event);
|
|
131
|
+
var matchedDeviceType = getMatchedDeviceType(matchedBreakpoint);
|
|
132
|
+
return {
|
|
133
|
+
matchedBreakpoint: matchedBreakpoint,
|
|
134
|
+
matchedDeviceType: matchedDeviceType
|
|
135
|
+
};
|
|
136
|
+
});
|
|
137
|
+
};
|
|
138
|
+
var mediaQueryInstances = breakpointsTokenAndQueryCollection.map(function (_ref5) {
|
|
139
|
+
var _ref5$mediaQuery = _ref5.mediaQuery,
|
|
140
|
+
mediaQuery = _ref5$mediaQuery === void 0 ? '' : _ref5$mediaQuery;
|
|
141
|
+
var mediaQueryInstance = window.matchMedia(mediaQuery);
|
|
142
|
+
/**
|
|
143
|
+
* the mediaquery event listener is available on mediaQuery instances and not `window`
|
|
144
|
+
* we iterate over all the breakpoints we have, register each instance and store them as `mediaQueryInstances` so we can later unregister all of them.
|
|
145
|
+
*/
|
|
146
|
+
if (mediaQueryInstance.addEventListener) {
|
|
147
|
+
mediaQueryInstance.addEventListener('change', handleMediaQueryChange);
|
|
148
|
+
} else {
|
|
149
|
+
// In older browsers MediaQueryList do not yet inherit from EventTarget, So using addListener as fallback - https://developer.mozilla.org/en-US/docs/Web/API/MediaQueryList/addListener
|
|
150
|
+
mediaQueryInstance.addListener(handleMediaQueryChange);
|
|
151
|
+
}
|
|
152
|
+
return mediaQueryInstance;
|
|
130
153
|
});
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
154
|
+
return function () {
|
|
155
|
+
mediaQueryInstances.forEach(function (mediaQueryInstance) {
|
|
156
|
+
if (mediaQueryInstance.removeEventListener) {
|
|
157
|
+
mediaQueryInstance.removeEventListener('change', handleMediaQueryChange);
|
|
158
|
+
} else {
|
|
159
|
+
// In older browsers MediaQueryList do not yet inherit from EventTarget, So using removeListener as fallback - https://developer.mozilla.org/en-US/docs/Web/API/MediaQueryList/removeListener
|
|
160
|
+
mediaQueryInstance.removeListener(handleMediaQueryChange);
|
|
161
|
+
}
|
|
162
|
+
});
|
|
163
|
+
};
|
|
164
|
+
}, [breakpointsTokenAndQueryCollection, getMatchedBreakpoint, getMatchedDeviceType, supportsMatchMedia]);
|
|
137
165
|
|
|
138
|
-
//
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
return options.indexOf(matches[0]);
|
|
142
|
-
}
|
|
166
|
+
// @TODO: handle SSR scenarios
|
|
167
|
+
return breakpointAndDevice;
|
|
168
|
+
};
|
|
143
169
|
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
170
|
+
var throwBladeError = function throwBladeError(_ref) {
|
|
171
|
+
_ref.message;
|
|
172
|
+
_ref.moduleName;
|
|
173
|
+
};
|
|
174
|
+
var logger = function logger(_ref2) {
|
|
175
|
+
_ref2.message;
|
|
176
|
+
_ref2.moduleName;
|
|
177
|
+
_ref2.type;
|
|
178
|
+
};
|
|
149
179
|
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
function
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
return Math.max(0, currentIndex - pageSize);
|
|
168
|
-
case SelectActions.PageDown:
|
|
169
|
-
return Math.min(maxIndex, currentIndex + pageSize);
|
|
170
|
-
default:
|
|
171
|
-
return currentIndex;
|
|
172
|
-
}
|
|
173
|
-
}
|
|
180
|
+
var useColorScheme = function useColorScheme() {
|
|
181
|
+
var initialColorScheme = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'light';
|
|
182
|
+
// if colorScheme defined use that else fallback to 'light'
|
|
183
|
+
var _useState = useState(function () {
|
|
184
|
+
return getColorScheme(initialColorScheme);
|
|
185
|
+
}),
|
|
186
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
187
|
+
colorSchemeState = _useState2[0],
|
|
188
|
+
setColorSchemeState = _useState2[1];
|
|
189
|
+
var setColorScheme = useCallback(function setThemeMode(colorScheme) {
|
|
190
|
+
setColorSchemeState(getColorScheme(colorScheme));
|
|
191
|
+
}, []);
|
|
192
|
+
return {
|
|
193
|
+
colorScheme: colorSchemeState,
|
|
194
|
+
setColorScheme: setColorScheme
|
|
195
|
+
};
|
|
196
|
+
};
|
|
174
197
|
|
|
175
|
-
|
|
176
|
-
* Checks if the given HTML element is visible on screen
|
|
177
|
-
*/
|
|
178
|
-
function isElementVisibleOnScreen(element) {
|
|
179
|
-
var bounding = element.getBoundingClientRect();
|
|
180
|
-
return bounding.top >= 0 && bounding.left >= 0 && bounding.bottom <= (window.innerHeight || document.documentElement.clientHeight) && bounding.right <= (window.innerWidth || document.documentElement.clientWidth);
|
|
181
|
-
}
|
|
198
|
+
var isBrowser$1 = getPlatformType() == 'browser';
|
|
182
199
|
|
|
183
200
|
/**
|
|
184
|
-
*
|
|
185
|
-
|
|
186
|
-
function isScrollable(element) {
|
|
187
|
-
return element && element.clientHeight < element.scrollHeight;
|
|
188
|
-
}
|
|
189
|
-
/**
|
|
190
|
-
* Performs the action when actionType is passed
|
|
201
|
+
* useIsomorphicLayoutEffect enables us to safely call `useLayoutEffect` on the browser
|
|
202
|
+
* (for SSR reasons)
|
|
191
203
|
*
|
|
192
|
-
*
|
|
204
|
+
* React currently throws a warning when using useLayoutEffect on the server.
|
|
205
|
+
* To get around it, we can conditionally useEffect on the server (no-op) and
|
|
206
|
+
* useLayoutEffect in the browser.
|
|
207
|
+
*
|
|
208
|
+
* @see https://gist.github.com/gaearon/e7d97cdf38a2907924ea12e4ebdf3c85
|
|
193
209
|
*/
|
|
194
|
-
var
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
return
|
|
210
|
+
var useIsomorphicLayoutEffect = isBrowser$1 ? React.useLayoutEffect : React.useEffect;
|
|
211
|
+
|
|
212
|
+
/* eslint-disable consistent-return */
|
|
213
|
+
function useInterval(callback, _ref) {
|
|
214
|
+
var delay = _ref.delay,
|
|
215
|
+
enable = _ref.enable;
|
|
216
|
+
var intervalRef = React__default.useRef(null);
|
|
217
|
+
var savedCallback = React__default.useRef(callback);
|
|
218
|
+
|
|
219
|
+
// keep the callback updated
|
|
220
|
+
useIsomorphicLayoutEffect(function () {
|
|
221
|
+
savedCallback.current = callback;
|
|
222
|
+
}, [callback]);
|
|
223
|
+
React__default.useEffect(function () {
|
|
224
|
+
var tick = function tick() {
|
|
225
|
+
return savedCallback.current();
|
|
226
|
+
};
|
|
227
|
+
if (enable) {
|
|
228
|
+
intervalRef.current = window.setInterval(tick, delay);
|
|
229
|
+
return function () {
|
|
230
|
+
return window.clearInterval(intervalRef.current);
|
|
231
|
+
};
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
235
|
+
return function () {};
|
|
236
|
+
}, [delay, enable]);
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
/* eslint-disable @typescript-eslint/no-namespace */
|
|
240
|
+
var isReactNative$4 = function isReactNative() {
|
|
241
|
+
return getPlatformType() === 'react-native';
|
|
226
242
|
};
|
|
227
243
|
|
|
228
244
|
/**
|
|
229
|
-
*
|
|
245
|
+
* @description
|
|
230
246
|
*
|
|
231
|
-
*
|
|
247
|
+
* Casts a Platform.Select<> type to web type
|
|
248
|
+
*
|
|
249
|
+
* @example
|
|
250
|
+
*
|
|
251
|
+
* ```ts
|
|
252
|
+
* type Example = Platform.Select<{ web: string; native: number }>;
|
|
253
|
+
*
|
|
254
|
+
* const extractedWebType = castWebType('' as Example);
|
|
255
|
+
* // ^ string
|
|
256
|
+
* ```
|
|
232
257
|
*/
|
|
233
|
-
var
|
|
234
|
-
|
|
235
|
-
if (containerElement) {
|
|
236
|
-
if (isScrollable(containerElement)) {
|
|
237
|
-
var optionEl = containerElement.querySelectorAll('[role="option"]');
|
|
238
|
-
// Making sure its the same element as the one from options state
|
|
239
|
-
if (newActiveIndex >= 0 && optionEl[newActiveIndex].dataset.value === options[newActiveIndex]) {
|
|
240
|
-
var activeElement = optionEl[newActiveIndex];
|
|
241
|
-
var bodyRect = containerElement.getBoundingClientRect().top;
|
|
242
|
-
var elementRect = activeElement.getBoundingClientRect().top;
|
|
243
|
-
var elementPosition = elementRect - bodyRect;
|
|
244
|
-
var offsetPosition = elementPosition;
|
|
245
|
-
containerElement.scrollTo({
|
|
246
|
-
top: offsetPosition
|
|
247
|
-
});
|
|
248
|
-
if (!isElementVisibleOnScreen(optionEl[newActiveIndex])) {
|
|
249
|
-
activeElement.scrollIntoView({
|
|
250
|
-
behavior: 'smooth'
|
|
251
|
-
});
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
}
|
|
255
|
-
}
|
|
258
|
+
var castWebType = function castWebType(value) {
|
|
259
|
+
return value;
|
|
256
260
|
};
|
|
257
261
|
|
|
258
262
|
/**
|
|
259
|
-
*
|
|
263
|
+
* @description
|
|
264
|
+
*
|
|
265
|
+
* Casts a Platform.Select<> type to native type
|
|
266
|
+
*
|
|
267
|
+
* @example
|
|
268
|
+
*
|
|
269
|
+
* ```ts
|
|
270
|
+
* type Example = Platform.Select<{ web: string; native: number }>;
|
|
271
|
+
*
|
|
272
|
+
* const extractedNativeType = castNativeType('' as Example);
|
|
273
|
+
* // ^ number
|
|
274
|
+
* ```
|
|
260
275
|
*/
|
|
261
|
-
var
|
|
262
|
-
|
|
263
|
-
return '';
|
|
264
|
-
}
|
|
265
|
-
return selectedIndices.map(function (selectedIndex) {
|
|
266
|
-
var _options$selectedInde;
|
|
267
|
-
return (_options$selectedInde = options[selectedIndex]) === null || _options$selectedInde === void 0 ? void 0 : _options$selectedInde.value;
|
|
268
|
-
}).join(', ');
|
|
276
|
+
var castNativeType = function castNativeType(value) {
|
|
277
|
+
return value;
|
|
269
278
|
};
|
|
270
279
|
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
var makeInputDisplayValue = function makeInputDisplayValue(selectedIndices, options) {
|
|
275
|
-
// When no item is selected or no item is present
|
|
276
|
-
if (options.length === 0 || selectedIndices.length === 0) {
|
|
277
|
-
return '';
|
|
280
|
+
function makeBorderSize(size) {
|
|
281
|
+
if (typeof size === 'number') {
|
|
282
|
+
return "".concat(size, "px");
|
|
278
283
|
}
|
|
284
|
+
return size;
|
|
285
|
+
}
|
|
279
286
|
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
}
|
|
287
|
+
var makeMotionTime = function makeMotionTime(time) {
|
|
288
|
+
return "".concat(time, "ms");
|
|
289
|
+
};
|
|
284
290
|
|
|
285
|
-
|
|
286
|
-
return "".concat(
|
|
291
|
+
var makeSpace = function makeSpace(size) {
|
|
292
|
+
return "".concat(size, "px");
|
|
287
293
|
};
|
|
288
294
|
|
|
289
|
-
var
|
|
290
|
-
var
|
|
291
|
-
|
|
292
|
-
var colorSchemeMediaQueryMap = {
|
|
293
|
-
light: '(prefers-color-scheme: light)',
|
|
294
|
-
dark: '(prefers-color-scheme: dark)',
|
|
295
|
-
system: 'default'
|
|
296
|
-
};
|
|
297
|
-
var supportsMatchMedia = typeof window !== 'undefined' && typeof window.matchMedia === 'function';
|
|
298
|
-
if (colorScheme === 'light' || colorScheme === 'dark') {
|
|
299
|
-
return colorScheme;
|
|
300
|
-
}
|
|
301
|
-
if (colorScheme === 'system' && supportsMatchMedia && window.matchMedia(colorSchemeMediaQueryMap.dark).matches) {
|
|
302
|
-
return 'dark';
|
|
303
|
-
}
|
|
304
|
-
return 'light';
|
|
295
|
+
var makeTypographySize = function makeTypographySize(size) {
|
|
296
|
+
var remValue = size / 16;
|
|
297
|
+
return "".concat(remValue, "rem");
|
|
305
298
|
};
|
|
306
299
|
|
|
307
|
-
var
|
|
308
|
-
|
|
309
|
-
max = _ref.max;
|
|
310
|
-
return "screen and (min-width: ".concat(min, "px)").concat(max ? " and (max-width: ".concat(max, "px)") : '');
|
|
311
|
-
};
|
|
312
|
-
|
|
313
|
-
var getPlatformType = function getPlatformType() {
|
|
314
|
-
if (typeof navigator !== 'undefined' && navigator.product === 'ReactNative') {
|
|
315
|
-
return 'react-native';
|
|
316
|
-
}
|
|
317
|
-
if (typeof document !== 'undefined') {
|
|
318
|
-
return 'browser';
|
|
319
|
-
}
|
|
320
|
-
if (typeof process !== 'undefined') {
|
|
321
|
-
return 'node';
|
|
322
|
-
}
|
|
323
|
-
return 'unknown';
|
|
324
|
-
};
|
|
325
|
-
|
|
326
|
-
var deviceType = {
|
|
327
|
-
desktop: 'desktop',
|
|
328
|
-
mobile: 'mobile'
|
|
329
|
-
};
|
|
330
|
-
var useBreakpoint = function useBreakpoint(_ref) {
|
|
331
|
-
var _window;
|
|
332
|
-
var breakpoints = _ref.breakpoints;
|
|
333
|
-
var supportsMatchMedia = typeof document !== 'undefined' && typeof window !== 'undefined' && typeof ((_window = window) === null || _window === void 0 ? void 0 : _window.matchMedia) === 'function';
|
|
334
|
-
var breakpointsTokenAndQueryCollection = useMemo(function () {
|
|
335
|
-
return supportsMatchMedia ? Object.entries(breakpoints).map(function (_ref2, index, breakpointsArray) {
|
|
336
|
-
var _breakpointsArray;
|
|
337
|
-
var _ref3 = _slicedToArray(_ref2, 2),
|
|
338
|
-
token = _ref3[0],
|
|
339
|
-
screenSize = _ref3[1];
|
|
340
|
-
var min = screenSize;
|
|
341
|
-
var maxValue = (_breakpointsArray = breakpointsArray[index + 1]) === null || _breakpointsArray === void 0 ? void 0 : _breakpointsArray[1];
|
|
342
|
-
var mediaQuery = getMediaQuery({
|
|
343
|
-
min: min,
|
|
344
|
-
max: maxValue ? maxValue - 1 : undefined
|
|
345
|
-
});
|
|
346
|
-
return {
|
|
347
|
-
token: token,
|
|
348
|
-
screenSize: screenSize,
|
|
349
|
-
mediaQuery: mediaQuery
|
|
350
|
-
};
|
|
351
|
-
}) : [];
|
|
352
|
-
}, [breakpoints, supportsMatchMedia]);
|
|
353
|
-
var getMatchedDeviceType = useCallback(function (matchedBreakpoint) {
|
|
354
|
-
var matchedDeviceType = deviceType.mobile;
|
|
355
|
-
var platform = getPlatformType();
|
|
356
|
-
if (platform === 'react-native') {
|
|
357
|
-
matchedDeviceType = deviceType.mobile;
|
|
358
|
-
} else if (platform === 'browser') {
|
|
359
|
-
if (matchedBreakpoint && ['base', 'xs', 's'].includes(matchedBreakpoint)) {
|
|
360
|
-
// tablet is also categorised as mobile
|
|
361
|
-
matchedDeviceType = deviceType.mobile;
|
|
362
|
-
} else {
|
|
363
|
-
matchedDeviceType = deviceType.desktop;
|
|
364
|
-
}
|
|
365
|
-
} else if (platform === 'node') {
|
|
366
|
-
//@TODO: Check for useragent for node
|
|
367
|
-
matchedDeviceType = deviceType.desktop;
|
|
368
|
-
}
|
|
369
|
-
return matchedDeviceType;
|
|
370
|
-
}, []);
|
|
371
|
-
var getMatchedBreakpoint = useCallback(function (event) {
|
|
372
|
-
var _breakpointsTokenAndQ, _breakpointsTokenAndQ2;
|
|
373
|
-
var matchedBreakpoint = (_breakpointsTokenAndQ = (_breakpointsTokenAndQ2 = breakpointsTokenAndQueryCollection.find(function (_ref4) {
|
|
374
|
-
var _ref4$mediaQuery = _ref4.mediaQuery,
|
|
375
|
-
mediaQuery = _ref4$mediaQuery === void 0 ? '' : _ref4$mediaQuery;
|
|
376
|
-
// this will run whenever mediaQuery change event is triggered
|
|
377
|
-
if ((event === null || event === void 0 ? void 0 : event.media) === mediaQuery) {
|
|
378
|
-
return true;
|
|
379
|
-
}
|
|
380
|
-
// this will run when the state is initialised for the first time and hence the event object will be empty so we'll fallback to browser's window object
|
|
381
|
-
if (window.matchMedia(mediaQuery).matches) {
|
|
382
|
-
return true;
|
|
383
|
-
}
|
|
384
|
-
return false;
|
|
385
|
-
})) === null || _breakpointsTokenAndQ2 === void 0 ? void 0 : _breakpointsTokenAndQ2.token) !== null && _breakpointsTokenAndQ !== void 0 ? _breakpointsTokenAndQ : undefined;
|
|
386
|
-
return matchedBreakpoint;
|
|
387
|
-
}, [breakpointsTokenAndQueryCollection]);
|
|
388
|
-
var _useState = useState(function () {
|
|
389
|
-
var matchedBreakpoint = getMatchedBreakpoint();
|
|
390
|
-
var matchedDeviceType = getMatchedDeviceType(matchedBreakpoint);
|
|
391
|
-
return {
|
|
392
|
-
matchedBreakpoint: matchedBreakpoint,
|
|
393
|
-
matchedDeviceType: matchedDeviceType
|
|
394
|
-
};
|
|
395
|
-
}),
|
|
396
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
397
|
-
breakpointAndDevice = _useState2[0],
|
|
398
|
-
setBreakpointAndDevice = _useState2[1];
|
|
399
|
-
useEffect(function () {
|
|
400
|
-
if (!supportsMatchMedia) {
|
|
401
|
-
return undefined;
|
|
402
|
-
}
|
|
403
|
-
var handleMediaQueryChange = function handleMediaQueryChange(event) {
|
|
404
|
-
setBreakpointAndDevice(function () {
|
|
405
|
-
var matchedBreakpoint = getMatchedBreakpoint(event);
|
|
406
|
-
var matchedDeviceType = getMatchedDeviceType(matchedBreakpoint);
|
|
407
|
-
return {
|
|
408
|
-
matchedBreakpoint: matchedBreakpoint,
|
|
409
|
-
matchedDeviceType: matchedDeviceType
|
|
410
|
-
};
|
|
411
|
-
});
|
|
412
|
-
};
|
|
413
|
-
var mediaQueryInstances = breakpointsTokenAndQueryCollection.map(function (_ref5) {
|
|
414
|
-
var _ref5$mediaQuery = _ref5.mediaQuery,
|
|
415
|
-
mediaQuery = _ref5$mediaQuery === void 0 ? '' : _ref5$mediaQuery;
|
|
416
|
-
var mediaQueryInstance = window.matchMedia(mediaQuery);
|
|
417
|
-
/**
|
|
418
|
-
* the mediaquery event listener is available on mediaQuery instances and not `window`
|
|
419
|
-
* we iterate over all the breakpoints we have, register each instance and store them as `mediaQueryInstances` so we can later unregister all of them.
|
|
420
|
-
*/
|
|
421
|
-
if (mediaQueryInstance.addEventListener) {
|
|
422
|
-
mediaQueryInstance.addEventListener('change', handleMediaQueryChange);
|
|
423
|
-
} else {
|
|
424
|
-
// In older browsers MediaQueryList do not yet inherit from EventTarget, So using addListener as fallback - https://developer.mozilla.org/en-US/docs/Web/API/MediaQueryList/addListener
|
|
425
|
-
mediaQueryInstance.addListener(handleMediaQueryChange);
|
|
426
|
-
}
|
|
427
|
-
return mediaQueryInstance;
|
|
428
|
-
});
|
|
429
|
-
return function () {
|
|
430
|
-
mediaQueryInstances.forEach(function (mediaQueryInstance) {
|
|
431
|
-
if (mediaQueryInstance.removeEventListener) {
|
|
432
|
-
mediaQueryInstance.removeEventListener('change', handleMediaQueryChange);
|
|
433
|
-
} else {
|
|
434
|
-
// In older browsers MediaQueryList do not yet inherit from EventTarget, So using removeListener as fallback - https://developer.mozilla.org/en-US/docs/Web/API/MediaQueryList/removeListener
|
|
435
|
-
mediaQueryInstance.removeListener(handleMediaQueryChange);
|
|
436
|
-
}
|
|
437
|
-
});
|
|
438
|
-
};
|
|
439
|
-
}, [breakpointsTokenAndQueryCollection, getMatchedBreakpoint, getMatchedDeviceType, supportsMatchMedia]);
|
|
440
|
-
|
|
441
|
-
// @TODO: handle SSR scenarios
|
|
442
|
-
return breakpointAndDevice;
|
|
443
|
-
};
|
|
444
|
-
|
|
445
|
-
var throwBladeError = function throwBladeError(_ref) {
|
|
446
|
-
_ref.message;
|
|
447
|
-
_ref.moduleName;
|
|
448
|
-
};
|
|
449
|
-
var logger = function logger(_ref2) {
|
|
450
|
-
_ref2.message;
|
|
451
|
-
_ref2.moduleName;
|
|
452
|
-
_ref2.type;
|
|
300
|
+
var makeSize = function makeSize(size) {
|
|
301
|
+
return "".concat(size, "px");
|
|
453
302
|
};
|
|
454
303
|
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
colorSchemeState = _useState2[0],
|
|
463
|
-
setColorSchemeState = _useState2[1];
|
|
464
|
-
var setColorScheme = useCallback(function setThemeMode(colorScheme) {
|
|
465
|
-
setColorSchemeState(getColorScheme(colorScheme));
|
|
466
|
-
}, []);
|
|
467
|
-
return {
|
|
468
|
-
colorScheme: colorSchemeState,
|
|
469
|
-
setColorScheme: setColorScheme
|
|
470
|
-
};
|
|
304
|
+
/**
|
|
305
|
+
* @deprecated This utility will be deprecated in subsequent version.
|
|
306
|
+
*/
|
|
307
|
+
var toTitleCase = function toTitleCase(inputString) {
|
|
308
|
+
return inputString.toLowerCase().split(' ').map(function (word) {
|
|
309
|
+
return word.charAt(0).toUpperCase() + word.slice(1);
|
|
310
|
+
}).join(' ');
|
|
471
311
|
};
|
|
472
312
|
|
|
473
|
-
var isBrowser$1 = getPlatformType() == 'browser';
|
|
474
|
-
|
|
475
313
|
/**
|
|
476
|
-
*
|
|
477
|
-
*
|
|
478
|
-
*
|
|
479
|
-
* React currently throws a warning when using useLayoutEffect on the server.
|
|
480
|
-
* To get around it, we can conditionally useEffect on the server (no-op) and
|
|
481
|
-
* useLayoutEffect in the browser.
|
|
482
|
-
*
|
|
483
|
-
* @see https://gist.github.com/gaearon/e7d97cdf38a2907924ea12e4ebdf3c85
|
|
314
|
+
* a type-safe version of the `usePrevious` hook described here:
|
|
315
|
+
* @see {@link https://reactjs.org/docs/hooks-faq.html#how-to-get-the-previous-props-or-state}
|
|
316
|
+
* @deprecated This utility will be deprecated in subsequent version.
|
|
484
317
|
*/
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
var intervalRef = React__default.useRef(null);
|
|
492
|
-
var savedCallback = React__default.useRef(callback);
|
|
493
|
-
|
|
494
|
-
// keep the callback updated
|
|
495
|
-
useIsomorphicLayoutEffect(function () {
|
|
496
|
-
savedCallback.current = callback;
|
|
497
|
-
}, [callback]);
|
|
498
|
-
React__default.useEffect(function () {
|
|
499
|
-
var tick = function tick() {
|
|
500
|
-
return savedCallback.current();
|
|
501
|
-
};
|
|
502
|
-
if (enable) {
|
|
503
|
-
intervalRef.current = window.setInterval(tick, delay);
|
|
504
|
-
return function () {
|
|
505
|
-
return window.clearInterval(intervalRef.current);
|
|
506
|
-
};
|
|
507
|
-
}
|
|
508
|
-
|
|
509
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
510
|
-
return function () {};
|
|
511
|
-
}, [delay, enable]);
|
|
318
|
+
function usePrevious(value) {
|
|
319
|
+
var ref = useRef();
|
|
320
|
+
useEffect(function () {
|
|
321
|
+
ref.current = value;
|
|
322
|
+
}, [value]);
|
|
323
|
+
return ref.current;
|
|
512
324
|
}
|
|
513
325
|
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
326
|
+
var ThemeContext = /*#__PURE__*/createContext({
|
|
327
|
+
// @ts-expect-error set null
|
|
328
|
+
theme: null,
|
|
329
|
+
colorScheme: 'light',
|
|
330
|
+
platform: 'onDesktop',
|
|
331
|
+
setColorScheme: function setColorScheme() {
|
|
332
|
+
return null;
|
|
333
|
+
}
|
|
334
|
+
});
|
|
335
|
+
var useTheme = function useTheme() {
|
|
336
|
+
var themeContext = useContext(ThemeContext);
|
|
337
|
+
return themeContext;
|
|
517
338
|
};
|
|
518
339
|
|
|
519
340
|
/**
|
|
520
|
-
*
|
|
521
|
-
*
|
|
522
|
-
* Casts a Platform.Select<> type to web type
|
|
523
|
-
*
|
|
524
|
-
* @example
|
|
525
|
-
*
|
|
526
|
-
* ```ts
|
|
527
|
-
* type Example = Platform.Select<{ web: string; native: number }>;
|
|
528
|
-
*
|
|
529
|
-
* const extractedWebType = castWebType('' as Example);
|
|
530
|
-
* // ^ string
|
|
531
|
-
* ```
|
|
341
|
+
* is the role supposed to be `menu`
|
|
532
342
|
*/
|
|
533
|
-
var
|
|
534
|
-
return
|
|
343
|
+
var isRoleMenu = function isRoleMenu(dropdownTriggerer) {
|
|
344
|
+
return isReactNative$4() || dropdownTriggerer !== 'SelectInput';
|
|
535
345
|
};
|
|
536
346
|
|
|
537
347
|
/**
|
|
538
|
-
*
|
|
539
|
-
*
|
|
540
|
-
* Casts a Platform.Select<> type to native type
|
|
348
|
+
* We switch between accessibility of `dialog` with `listbox` and buttons as a child and just `listbox` when there are action items on footer
|
|
541
349
|
*
|
|
542
|
-
*
|
|
350
|
+
* Not announcing `dialog` helps not throw users off for simple dropdowns.
|
|
543
351
|
*
|
|
544
|
-
*
|
|
545
|
-
* type Example = Platform.Select<{ web: string; native: number }>;
|
|
352
|
+
* and having `dialog` is neccessary when there are buttons on footer
|
|
546
353
|
*
|
|
547
|
-
*
|
|
548
|
-
* // ^ number
|
|
549
|
-
* ```
|
|
354
|
+
* `menu` role is required for react native.
|
|
550
355
|
*/
|
|
551
|
-
var
|
|
552
|
-
|
|
356
|
+
var getActionListContainerRole = function getActionListContainerRole(hasFooterAction, dropdownTriggerer) {
|
|
357
|
+
if (hasFooterAction) {
|
|
358
|
+
return 'dialog';
|
|
359
|
+
}
|
|
360
|
+
if (isRoleMenu(dropdownTriggerer)) {
|
|
361
|
+
return 'menu';
|
|
362
|
+
}
|
|
363
|
+
return 'listbox';
|
|
553
364
|
};
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
return "".concat(size, "px");
|
|
365
|
+
var getActionListSectionRole = function getActionListSectionRole() {
|
|
366
|
+
if (isReactNative$4()) {
|
|
367
|
+
return undefined;
|
|
558
368
|
}
|
|
559
|
-
return
|
|
560
|
-
}
|
|
561
|
-
|
|
562
|
-
var makeMotionTime = function makeMotionTime(time) {
|
|
563
|
-
return "".concat(time, "ms");
|
|
369
|
+
return 'group';
|
|
564
370
|
};
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
371
|
+
var getSeparatorRole = function getSeparatorRole() {
|
|
372
|
+
if (isReactNative$4()) {
|
|
373
|
+
// Its not really announced so ignoring it in native.
|
|
374
|
+
return undefined;
|
|
375
|
+
}
|
|
376
|
+
return 'separator';
|
|
568
377
|
};
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
378
|
+
var getActionListItemWrapperRole = function getActionListItemWrapperRole(hasFooterAction, dropdownTriggerer) {
|
|
379
|
+
if (isRoleMenu(dropdownTriggerer)) {
|
|
380
|
+
return undefined;
|
|
381
|
+
}
|
|
382
|
+
if (hasFooterAction) {
|
|
383
|
+
return 'listbox';
|
|
384
|
+
}
|
|
385
|
+
return undefined;
|
|
573
386
|
};
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
387
|
+
var getActionListItemRole = function getActionListItemRole(dropdownTriggerer, href, selectionType) {
|
|
388
|
+
if (href) {
|
|
389
|
+
return 'link';
|
|
390
|
+
}
|
|
391
|
+
if (isRoleMenu(dropdownTriggerer)) {
|
|
392
|
+
if (selectionType === 'multiple') {
|
|
393
|
+
return 'menuitemcheckbox';
|
|
394
|
+
}
|
|
395
|
+
return 'menuitem';
|
|
396
|
+
}
|
|
397
|
+
return 'option';
|
|
577
398
|
};
|
|
578
399
|
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
400
|
+
var componentIds$1 = {
|
|
401
|
+
ActionList: 'ActionList',
|
|
402
|
+
ActionListItem: 'ActionListItem',
|
|
403
|
+
ActionListItemAsset: 'ActionListItemAsset',
|
|
404
|
+
ActionListItemIcon: 'ActionListItemIcon',
|
|
405
|
+
ActionListItemText: 'ActionListItemText',
|
|
406
|
+
ActionListSection: 'ActionListSection'
|
|
586
407
|
};
|
|
587
408
|
|
|
409
|
+
/* eslint-disable no-restricted-properties */
|
|
410
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
411
|
+
|
|
588
412
|
/**
|
|
589
|
-
*
|
|
590
|
-
* @see {@link https://reactjs.org/docs/hooks-faq.html#how-to-get-the-previous-props-or-state}
|
|
591
|
-
* @deprecated This utility will be deprecated in subsequent version.
|
|
413
|
+
* Gets the `componentId` prop of React component if it exists.
|
|
592
414
|
*/
|
|
593
|
-
function
|
|
594
|
-
var
|
|
595
|
-
|
|
596
|
-
ref.current = value;
|
|
597
|
-
}, [value]);
|
|
598
|
-
return ref.current;
|
|
599
|
-
}
|
|
600
|
-
|
|
601
|
-
var ThemeContext = /*#__PURE__*/createContext({
|
|
602
|
-
// @ts-expect-error set null
|
|
603
|
-
theme: null,
|
|
604
|
-
colorScheme: 'light',
|
|
605
|
-
platform: 'onDesktop',
|
|
606
|
-
setColorScheme: function setColorScheme() {
|
|
607
|
-
return null;
|
|
608
|
-
}
|
|
609
|
-
});
|
|
610
|
-
var useTheme = function useTheme() {
|
|
611
|
-
var themeContext = useContext(ThemeContext);
|
|
612
|
-
return themeContext;
|
|
613
|
-
};
|
|
415
|
+
var getComponentId = function getComponentId(component) {
|
|
416
|
+
var _component$props, _component$props2, _component$props2$ori, _component$type;
|
|
417
|
+
if (! /*#__PURE__*/React__default.isValidElement(component)) return null;
|
|
614
418
|
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
contentHeight: 0,
|
|
619
|
-
footerHeight: 0,
|
|
620
|
-
isHeaderFloating: false,
|
|
621
|
-
setContentHeight: function setContentHeight() {},
|
|
622
|
-
setHeaderHeight: function setHeaderHeight() {},
|
|
623
|
-
setFooterHeight: function setFooterHeight() {},
|
|
624
|
-
setHasBodyPadding: function setHasBodyPadding() {},
|
|
625
|
-
setIsHeaderEmpty: function setIsHeaderEmpty() {},
|
|
626
|
-
close: function close() {},
|
|
627
|
-
scrollRef: null,
|
|
628
|
-
bind: null,
|
|
629
|
-
isOpen: false,
|
|
630
|
-
positionY: 0,
|
|
631
|
-
isInBottomSheet: false,
|
|
632
|
-
defaultInitialFocusRef: {
|
|
633
|
-
current: null
|
|
419
|
+
// Storybook wraps MDX components in a wrapper component, so we need to get componentId from originalType
|
|
420
|
+
if (component !== null && component !== void 0 && (_component$props = component.props) !== null && _component$props !== void 0 && _component$props.mdxType && component !== null && component !== void 0 && (_component$props2 = component.props) !== null && _component$props2 !== void 0 && (_component$props2$ori = _component$props2.originalType) !== null && _component$props2$ori !== void 0 && _component$props2$ori.componentId) {
|
|
421
|
+
return component.props.originalType.componentId;
|
|
634
422
|
}
|
|
635
|
-
|
|
636
|
-
var useBottomSheetContext = function useBottomSheetContext() {
|
|
637
|
-
var state = React__default.useContext(BottomSheetContext);
|
|
638
|
-
return state;
|
|
423
|
+
return (_component$type = component.type) === null || _component$type === void 0 ? void 0 : _component$type.componentId;
|
|
639
424
|
};
|
|
640
|
-
var BottomSheetAndDropdownGlueContext = /*#__PURE__*/React__default.createContext(null);
|
|
641
425
|
|
|
642
426
|
/**
|
|
643
|
-
*
|
|
644
|
-
*
|
|
645
|
-
* You can hover over the return types to get jsdoc and more information about each
|
|
427
|
+
* Checks if the `component` matches the `componentId`
|
|
646
428
|
*/
|
|
647
|
-
var
|
|
648
|
-
|
|
649
|
-
return state;
|
|
429
|
+
var isValidAllowedChildren = function isValidAllowedChildren(component, id) {
|
|
430
|
+
return getComponentId(component) === id;
|
|
650
431
|
};
|
|
651
432
|
|
|
652
|
-
var _excluded$51 = ["isOpen", "setIsOpen", "close", "selectedIndices", "setSelectedIndices", "activeIndex", "setActiveIndex", "shouldIgnoreBlur", "setShouldIgnoreBlur", "isKeydownPressed", "setIsKeydownPressed", "options", "selectionType", "changeCallbackTriggerer", "setChangeCallbackTriggerer", "isControlled", "setControlledValueIndices"];
|
|
653
433
|
function ownKeys$6f(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
654
434
|
function _objectSpread$6e(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$6f(Object(source), !0).forEach(function (key) { _defineProperty$1(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$6f(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
655
435
|
|
|
656
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
657
|
-
var noop$1 = function noop() {};
|
|
658
|
-
var DropdownContext = /*#__PURE__*/React__default.createContext({
|
|
659
|
-
isOpen: false,
|
|
660
|
-
setIsOpen: noop$1,
|
|
661
|
-
close: noop$1,
|
|
662
|
-
selectedIndices: [],
|
|
663
|
-
setSelectedIndices: noop$1,
|
|
664
|
-
controlledValueIndices: [],
|
|
665
|
-
setControlledValueIndices: noop$1,
|
|
666
|
-
options: [],
|
|
667
|
-
setOptions: noop$1,
|
|
668
|
-
activeIndex: -1,
|
|
669
|
-
setActiveIndex: noop$1,
|
|
670
|
-
shouldIgnoreBlur: false,
|
|
671
|
-
setShouldIgnoreBlur: noop$1,
|
|
672
|
-
shouldIgnoreBlurAnimation: false,
|
|
673
|
-
setShouldIgnoreBlurAnimation: noop$1,
|
|
674
|
-
hasFooterAction: false,
|
|
675
|
-
setHasFooterAction: noop$1,
|
|
676
|
-
hasLabelOnLeft: false,
|
|
677
|
-
setHasLabelOnLeft: noop$1,
|
|
678
|
-
isKeydownPressed: false,
|
|
679
|
-
setIsKeydownPressed: noop$1,
|
|
680
|
-
changeCallbackTriggerer: 0,
|
|
681
|
-
setChangeCallbackTriggerer: noop$1,
|
|
682
|
-
isControlled: false,
|
|
683
|
-
setIsControlled: noop$1,
|
|
684
|
-
dropdownBaseId: '',
|
|
685
|
-
actionListItemRef: {
|
|
686
|
-
current: null
|
|
687
|
-
},
|
|
688
|
-
triggererRef: {
|
|
689
|
-
current: null
|
|
690
|
-
},
|
|
691
|
-
triggererWrapperRef: {
|
|
692
|
-
current: null
|
|
693
|
-
}
|
|
694
|
-
});
|
|
695
|
-
var searchTimeout;
|
|
696
|
-
var searchString = '';
|
|
697
436
|
/**
|
|
698
|
-
*
|
|
699
|
-
*
|
|
700
|
-
* Returns the values from DropdownContext along with some helper functions and event handlers
|
|
437
|
+
* Returns if there is ActionListItem after ActionListSection
|
|
438
|
+
* and an index of last ActionListSection
|
|
701
439
|
*
|
|
440
|
+
* It is used to decide if ActionListSection add divider at the end
|
|
702
441
|
*/
|
|
703
|
-
var
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
selectedIndices = _React$useContext.selectedIndices,
|
|
709
|
-
setSelectedIndices = _React$useContext.setSelectedIndices,
|
|
710
|
-
activeIndex = _React$useContext.activeIndex,
|
|
711
|
-
setActiveIndex = _React$useContext.setActiveIndex,
|
|
712
|
-
shouldIgnoreBlur = _React$useContext.shouldIgnoreBlur,
|
|
713
|
-
setShouldIgnoreBlur = _React$useContext.setShouldIgnoreBlur,
|
|
714
|
-
isKeydownPressed = _React$useContext.isKeydownPressed,
|
|
715
|
-
setIsKeydownPressed = _React$useContext.setIsKeydownPressed,
|
|
716
|
-
options = _React$useContext.options,
|
|
717
|
-
selectionType = _React$useContext.selectionType,
|
|
718
|
-
changeCallbackTriggerer = _React$useContext.changeCallbackTriggerer,
|
|
719
|
-
setChangeCallbackTriggerer = _React$useContext.setChangeCallbackTriggerer,
|
|
720
|
-
isControlled = _React$useContext.isControlled,
|
|
721
|
-
setControlledValueIndices = _React$useContext.setControlledValueIndices,
|
|
722
|
-
rest = _objectWithoutProperties$1(_React$useContext, _excluded$51);
|
|
723
|
-
var bottomSheetAndDropdownGlue = useBottomSheetAndDropdownGlue();
|
|
724
|
-
var setIndices = function setIndices(indices) {
|
|
725
|
-
if (isControlled) {
|
|
726
|
-
setControlledValueIndices(indices);
|
|
727
|
-
} else {
|
|
728
|
-
setSelectedIndices(indices);
|
|
729
|
-
}
|
|
730
|
-
};
|
|
731
|
-
/**
|
|
732
|
-
* Marks the given index as selected.
|
|
733
|
-
*
|
|
734
|
-
* In single select, it also closes the menu.
|
|
735
|
-
* In multiselect, it keeps the menu open for more selections
|
|
736
|
-
*/
|
|
737
|
-
var selectOption = function selectOption(index) {
|
|
738
|
-
var properties = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
|
|
739
|
-
closeOnSelection: true
|
|
740
|
-
};
|
|
741
|
-
var isSelected = false;
|
|
742
|
-
if (index < 0 || index > options.length - 1) {
|
|
743
|
-
return isSelected;
|
|
744
|
-
}
|
|
745
|
-
if (selectionType === 'multiple') {
|
|
746
|
-
if (selectedIndices.includes(index)) {
|
|
747
|
-
// remove existing item
|
|
748
|
-
var existingItemIndex = selectedIndices.indexOf(index);
|
|
749
|
-
setIndices([].concat(_toConsumableArray$1(selectedIndices.slice(0, existingItemIndex)), _toConsumableArray$1(selectedIndices.slice(existingItemIndex + 1))));
|
|
750
|
-
isSelected = false;
|
|
751
|
-
} else {
|
|
752
|
-
setIndices([].concat(_toConsumableArray$1(selectedIndices), [index]));
|
|
753
|
-
isSelected = true;
|
|
754
|
-
}
|
|
755
|
-
} else {
|
|
756
|
-
setIndices([index]);
|
|
757
|
-
isSelected = true;
|
|
758
|
-
}
|
|
442
|
+
var getActionListSectionPosition = function getActionListSectionPosition(children) {
|
|
443
|
+
// Creating an array of componentIds
|
|
444
|
+
var childComponentIdArray = React__default.Children.toArray(children).map(function (child) {
|
|
445
|
+
return getComponentId(child);
|
|
446
|
+
});
|
|
759
447
|
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
if (activeIndex !== index) {
|
|
763
|
-
setActiveIndex(index);
|
|
764
|
-
}
|
|
765
|
-
if (properties !== null && properties !== void 0 && properties.closeOnSelection && selectionType !== 'multiple') {
|
|
766
|
-
close();
|
|
767
|
-
}
|
|
768
|
-
return isSelected;
|
|
769
|
-
};
|
|
448
|
+
// Reading the last `ActionListSection` component's index
|
|
449
|
+
var lastActionListSectionIndex = childComponentIdArray.lastIndexOf(componentIds$1.ActionListSection);
|
|
770
450
|
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
451
|
+
// Checking if there is any `ActionListItem` present after `ActionListSection`
|
|
452
|
+
var isActionListItemPresentAfterSection = childComponentIdArray.slice(lastActionListSectionIndex).includes(componentIds$1.ActionListItem);
|
|
453
|
+
return {
|
|
454
|
+
isActionListItemPresentAfterSection: isActionListItemPresentAfterSection,
|
|
455
|
+
lastActionListSectionIndex: lastActionListSectionIndex
|
|
456
|
+
};
|
|
457
|
+
};
|
|
458
|
+
/**
|
|
459
|
+
* Loops over action list items and returns different properties from children like option values, header and footer child, etc
|
|
460
|
+
*/
|
|
461
|
+
var getActionListProperties = function getActionListProperties(children) {
|
|
462
|
+
var sectionData = [];
|
|
463
|
+
var currentSection = null;
|
|
464
|
+
var actionListOptions = [];
|
|
465
|
+
var getActionListItemWithId = function getActionListItemWithId(child, hideDivider) {
|
|
466
|
+
if ( /*#__PURE__*/React__default.isValidElement(child) && !child.props.isDisabled) {
|
|
467
|
+
actionListOptions.push({
|
|
468
|
+
title: child.props.title,
|
|
469
|
+
value: child.props.value,
|
|
470
|
+
onClickTrigger: function onClickTrigger(value) {
|
|
471
|
+
var _child$props$onClick, _child$props, _child$props$isSelect;
|
|
472
|
+
var anchorLink = child.props.href;
|
|
473
|
+
(_child$props$onClick = (_child$props = child.props).onClick) === null || _child$props$onClick === void 0 ? void 0 : _child$props$onClick.call(_child$props, {
|
|
474
|
+
name: child.props.value,
|
|
475
|
+
value: (_child$props$isSelect = child.props.isSelected) !== null && _child$props$isSelect !== void 0 ? _child$props$isSelect : value
|
|
476
|
+
});
|
|
477
|
+
if (anchorLink && !isReactNative$4()) {
|
|
478
|
+
var _child$props$target;
|
|
479
|
+
var target = (_child$props$target = child.props.target) !== null && _child$props$target !== void 0 ? _child$props$target : '_self';
|
|
480
|
+
window.open(anchorLink, target);
|
|
481
|
+
if (window.top) {
|
|
482
|
+
window.top.open(anchorLink, target);
|
|
483
|
+
}
|
|
484
|
+
}
|
|
485
|
+
}
|
|
486
|
+
});
|
|
487
|
+
var currentIndex = actionListOptions.length - 1;
|
|
488
|
+
var foundSection = sectionData.find(function (v) {
|
|
489
|
+
return v.title === currentSection;
|
|
490
|
+
});
|
|
491
|
+
// push the item in the appropriate bucket
|
|
492
|
+
if (foundSection) {
|
|
493
|
+
foundSection === null || foundSection === void 0 ? void 0 : foundSection.data.push(_objectSpread$6e(_objectSpread$6e({}, child.props), {}, {
|
|
494
|
+
_index: currentIndex
|
|
495
|
+
}));
|
|
496
|
+
} else {
|
|
497
|
+
// create a new bucket
|
|
498
|
+
sectionData.push({
|
|
499
|
+
title: currentSection,
|
|
500
|
+
hideDivider: hideDivider,
|
|
501
|
+
data: [_objectSpread$6e(_objectSpread$6e({}, child.props), {}, {
|
|
502
|
+
_index: currentIndex
|
|
503
|
+
})]
|
|
504
|
+
});
|
|
505
|
+
}
|
|
506
|
+
var clonedChild = /*#__PURE__*/React__default.cloneElement(child, {
|
|
507
|
+
// @ts-expect-error: TS doesn't understand the child's props
|
|
508
|
+
_index: currentIndex
|
|
509
|
+
});
|
|
510
|
+
return clonedChild;
|
|
779
511
|
}
|
|
512
|
+
return child;
|
|
780
513
|
};
|
|
514
|
+
var isActionListItemPresentAfterSection;
|
|
515
|
+
// eslint-disable-next-line one-var
|
|
516
|
+
var lastActionListSectionIndex;
|
|
517
|
+
if (isReactNative$4()) {
|
|
518
|
+
// We're reading this so that we can decide whether to show the divider or not.
|
|
519
|
+
// If ActionListSection is final item and no ActionListItem is present after that, we hide the divider
|
|
520
|
+
// On web, we do it using descendant styling
|
|
521
|
+
var _getActionListSection = getActionListSectionPosition(children);
|
|
522
|
+
isActionListItemPresentAfterSection = _getActionListSection.isActionListItemPresentAfterSection;
|
|
523
|
+
lastActionListSectionIndex = _getActionListSection.lastActionListSectionIndex;
|
|
524
|
+
}
|
|
781
525
|
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
setShouldIgnoreBlur(false);
|
|
800
|
-
return;
|
|
801
|
-
}
|
|
802
|
-
onBlurCallback === null || onBlurCallback === void 0 ? void 0 : onBlurCallback({
|
|
803
|
-
name: name,
|
|
804
|
-
value: value
|
|
805
|
-
});
|
|
806
|
-
if (isOpen) {
|
|
807
|
-
if (selectionType !== 'multiple') {
|
|
808
|
-
selectOption(activeIndex);
|
|
526
|
+
// Looping through ActionListItems to add index to them and get an options array for moving focus between items
|
|
527
|
+
var childrenWithId = React__default.Children.map(children, function (child, index) {
|
|
528
|
+
if ( /*#__PURE__*/React__default.isValidElement(child)) {
|
|
529
|
+
if (isValidAllowedChildren(child, componentIds$1.ActionListSection)) {
|
|
530
|
+
var shouldHideDivider = index === lastActionListSectionIndex && !isActionListItemPresentAfterSection;
|
|
531
|
+
return /*#__PURE__*/React__default.cloneElement(child, {
|
|
532
|
+
// @ts-expect-error: TS doesn't understand the child's props
|
|
533
|
+
children: React__default.Children.map(child.props.children, function (childInSection) {
|
|
534
|
+
currentSection = child.props.title;
|
|
535
|
+
if (isValidAllowedChildren(childInSection, componentIds$1.ActionListItem)) {
|
|
536
|
+
return getActionListItemWithId(childInSection, shouldHideDivider);
|
|
537
|
+
}
|
|
538
|
+
return childInSection;
|
|
539
|
+
}),
|
|
540
|
+
// On web, we handle it with descendant styling in css so no need of JS there
|
|
541
|
+
_hideDivider: isReactNative$4() ? shouldHideDivider : undefined
|
|
542
|
+
});
|
|
809
543
|
}
|
|
810
|
-
if (
|
|
811
|
-
|
|
544
|
+
if (isValidAllowedChildren(child, componentIds$1.ActionListItem)) {
|
|
545
|
+
return getActionListItemWithId(child, true);
|
|
812
546
|
}
|
|
813
547
|
}
|
|
548
|
+
return child;
|
|
549
|
+
});
|
|
550
|
+
return {
|
|
551
|
+
sectionData: sectionData,
|
|
552
|
+
childrenWithId: childrenWithId,
|
|
553
|
+
actionListOptions: actionListOptions
|
|
814
554
|
};
|
|
555
|
+
};
|
|
556
|
+
var validateActionListItemProps = function validateActionListItemProps(_ref) {
|
|
557
|
+
_ref.leading;
|
|
558
|
+
_ref.trailing;
|
|
559
|
+
};
|
|
560
|
+
var getNormalTextColor = function getNormalTextColor(isDisabled) {
|
|
561
|
+
var _ref2 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
|
|
562
|
+
isMuted = _ref2.isMuted;
|
|
563
|
+
if (isDisabled) {
|
|
564
|
+
return 'surface.text.placeholder.lowContrast';
|
|
565
|
+
}
|
|
566
|
+
if (isMuted) {
|
|
567
|
+
return 'surface.text.muted.lowContrast';
|
|
568
|
+
}
|
|
569
|
+
return 'surface.text.normal.lowContrast';
|
|
570
|
+
};
|
|
815
571
|
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
return option.value;
|
|
825
|
-
});
|
|
826
|
-
ensureScrollVisiblity(newIndex, rest.actionListItemRef.current, optionValues);
|
|
827
|
-
};
|
|
828
|
-
|
|
829
|
-
/**
|
|
830
|
-
* Click handler when user clicks on any particular option.
|
|
831
|
-
*
|
|
832
|
-
* It
|
|
833
|
-
* - changes the option focus
|
|
834
|
-
* - selects that option
|
|
835
|
-
* - moves focus to combobox
|
|
836
|
-
*/
|
|
837
|
-
var onOptionClick = function onOptionClick(e, index) {
|
|
838
|
-
var actionType = getActionFromKey(e, isOpen);
|
|
839
|
-
if (typeof actionType === 'number') {
|
|
840
|
-
onOptionChange(actionType, index);
|
|
841
|
-
}
|
|
842
|
-
selectOption(index);
|
|
843
|
-
if (!isReactNative$4()) {
|
|
844
|
-
var _rest$triggererRef$cu;
|
|
845
|
-
(_rest$triggererRef$cu = rest.triggererRef.current) === null || _rest$triggererRef$cu === void 0 ? void 0 : _rest$triggererRef$cu.focus();
|
|
846
|
-
}
|
|
847
|
-
};
|
|
572
|
+
var breakpoints = {
|
|
573
|
+
base: 0,
|
|
574
|
+
xs: 320,
|
|
575
|
+
s: 480,
|
|
576
|
+
m: 768,
|
|
577
|
+
l: 1024,
|
|
578
|
+
xl: 1200
|
|
579
|
+
};
|
|
848
580
|
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
*
|
|
854
|
-
* Then searches for that word in options and moves focus there.
|
|
855
|
-
*/
|
|
856
|
-
var onComboType = function onComboType(letter, actionType) {
|
|
857
|
-
// open the listbox if it is closed
|
|
858
|
-
setIsOpen(true);
|
|
859
|
-
if (typeof searchTimeout === 'number') {
|
|
860
|
-
window.clearTimeout(searchTimeout);
|
|
861
|
-
}
|
|
862
|
-
searchTimeout = window.setTimeout(function () {
|
|
863
|
-
searchString = '';
|
|
864
|
-
}, 500);
|
|
865
|
-
// eslint-disable-next-line @typescript-eslint/restrict-plus-operands
|
|
866
|
-
searchString = searchString + letter;
|
|
867
|
-
var optionTitles = options.map(function (option) {
|
|
868
|
-
return option.title;
|
|
869
|
-
});
|
|
870
|
-
var searchIndex = getIndexByLetter(optionTitles, searchString, activeIndex + 1);
|
|
581
|
+
var fontFamily = {
|
|
582
|
+
text: 'Lato, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',
|
|
583
|
+
code: 'monospace'
|
|
584
|
+
};
|
|
871
585
|
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
onOptionChange(actionType, searchIndex);
|
|
875
|
-
}
|
|
876
|
-
// if no matches, clear the timeout and search string
|
|
877
|
-
else {
|
|
878
|
-
window.clearTimeout(searchTimeout);
|
|
879
|
-
searchString = '';
|
|
880
|
-
}
|
|
881
|
-
};
|
|
586
|
+
function ownKeys$6e(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
587
|
+
function _objectSpread$6d(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$6e(Object(source), !0).forEach(function (key) { _defineProperty$1(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$6e(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
882
588
|
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
setShouldIgnoreBlur(true);
|
|
890
|
-
}
|
|
589
|
+
/**
|
|
590
|
+
* For font size and line-heights we can’t say from xl to 2xl the value will necessary increase.
|
|
591
|
+
* it might decrease or remain same because these are alias tokens and we need aliases for cross platform.
|
|
592
|
+
* so for example xl on mobile can be 32px and on desktop xl can be 34px,
|
|
593
|
+
* similarly 2xl on mobile can be 34px but on desktop doesn’t necessarily mean 2xl will be more than xl(34px) it can be 32 as well since visually they make better hierarchy.
|
|
594
|
+
*/
|
|
891
595
|
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
}
|
|
896
|
-
if (!isKeydownPressed && ![' ', 'Enter', 'Escape', 'Meta'].includes(e.event.key)) {
|
|
897
|
-
// When keydown is not already pressed and its not Enter, Space, Command, or Escape key (those are generic keys and we only want to handle arrow keys or home buttons etc)
|
|
898
|
-
setIsKeydownPressed(true);
|
|
899
|
-
}
|
|
900
|
-
var actionType = getActionFromKey(e.event, isOpen);
|
|
901
|
-
if (actionType) {
|
|
902
|
-
performAction(actionType, e, {
|
|
903
|
-
setIsOpen: setIsOpen,
|
|
904
|
-
close: close,
|
|
905
|
-
onOptionChange: onOptionChange,
|
|
906
|
-
onComboType: onComboType,
|
|
907
|
-
selectCurrentOption: function selectCurrentOption() {
|
|
908
|
-
var _options$activeIndex$, _options$activeIndex;
|
|
909
|
-
var isSelected = selectOption(activeIndex);
|
|
910
|
-
if (rest.hasFooterAction && !isReactNative$4()) {
|
|
911
|
-
var _rest$triggererRef$cu2;
|
|
912
|
-
(_rest$triggererRef$cu2 = rest.triggererRef.current) === null || _rest$triggererRef$cu2 === void 0 ? void 0 : _rest$triggererRef$cu2.focus();
|
|
913
|
-
}
|
|
914
|
-
(_options$activeIndex$ = (_options$activeIndex = options[activeIndex]).onClickTrigger) === null || _options$activeIndex$ === void 0 ? void 0 : _options$activeIndex$.call(_options$activeIndex, isSelected);
|
|
915
|
-
}
|
|
916
|
-
});
|
|
917
|
-
}
|
|
918
|
-
};
|
|
919
|
-
return _objectSpread$6e({
|
|
920
|
-
isOpen: isOpen,
|
|
921
|
-
setIsOpen: setIsOpen,
|
|
922
|
-
close: close,
|
|
923
|
-
selectedIndices: selectedIndices,
|
|
924
|
-
setSelectedIndices: setSelectedIndices,
|
|
925
|
-
setControlledValueIndices: setControlledValueIndices,
|
|
926
|
-
onTriggerClick: onTriggerClick,
|
|
927
|
-
onTriggerKeydown: onTriggerKeydown,
|
|
928
|
-
onTriggerBlur: onTriggerBlur,
|
|
929
|
-
onOptionClick: onOptionClick,
|
|
930
|
-
activeIndex: activeIndex,
|
|
931
|
-
setActiveIndex: setActiveIndex,
|
|
932
|
-
shouldIgnoreBlur: shouldIgnoreBlur,
|
|
933
|
-
setShouldIgnoreBlur: setShouldIgnoreBlur,
|
|
934
|
-
isKeydownPressed: isKeydownPressed,
|
|
935
|
-
setIsKeydownPressed: setIsKeydownPressed,
|
|
936
|
-
changeCallbackTriggerer: changeCallbackTriggerer,
|
|
937
|
-
setChangeCallbackTriggerer: setChangeCallbackTriggerer,
|
|
938
|
-
isControlled: isControlled,
|
|
939
|
-
options: options,
|
|
940
|
-
value: makeInputValue(selectedIndices, options),
|
|
941
|
-
displayValue: makeInputDisplayValue(selectedIndices, options),
|
|
942
|
-
selectionType: selectionType
|
|
943
|
-
}, rest);
|
|
596
|
+
var fontWeight = {
|
|
597
|
+
regular: 400,
|
|
598
|
+
bold: 700
|
|
944
599
|
};
|
|
600
|
+
({
|
|
601
|
+
onDesktop: {
|
|
602
|
+
fonts: {
|
|
603
|
+
family: _objectSpread$6d({}, fontFamily),
|
|
604
|
+
size: {
|
|
605
|
+
10: 9,
|
|
606
|
+
25: 10,
|
|
607
|
+
50: 11,
|
|
608
|
+
75: 12,
|
|
609
|
+
100: 14,
|
|
610
|
+
200: 16,
|
|
611
|
+
300: 18,
|
|
612
|
+
400: 20,
|
|
613
|
+
500: 22,
|
|
614
|
+
600: 24,
|
|
615
|
+
700: 28,
|
|
616
|
+
800: 32,
|
|
617
|
+
900: 36,
|
|
618
|
+
1000: 40,
|
|
619
|
+
1100: 48,
|
|
620
|
+
1200: 56,
|
|
621
|
+
1300: 64,
|
|
622
|
+
1600: 88
|
|
623
|
+
},
|
|
624
|
+
weight: _objectSpread$6d({}, fontWeight)
|
|
625
|
+
},
|
|
626
|
+
lineHeights: {
|
|
627
|
+
0: 0,
|
|
628
|
+
25: 14,
|
|
629
|
+
50: 16,
|
|
630
|
+
75: 18,
|
|
631
|
+
100: 20,
|
|
632
|
+
200: 24,
|
|
633
|
+
300: 24,
|
|
634
|
+
400: 28,
|
|
635
|
+
500: 32,
|
|
636
|
+
600: 40,
|
|
637
|
+
700: 40,
|
|
638
|
+
800: 48,
|
|
639
|
+
900: 56,
|
|
640
|
+
1000: 64,
|
|
641
|
+
1100: 72,
|
|
642
|
+
1500: 104
|
|
643
|
+
}
|
|
644
|
+
// letterSpacings: {},
|
|
645
|
+
},
|
|
646
|
+
|
|
647
|
+
onMobile: {
|
|
648
|
+
fonts: {
|
|
649
|
+
family: _objectSpread$6d({}, fontFamily),
|
|
650
|
+
size: {
|
|
651
|
+
10: 9,
|
|
652
|
+
25: 10,
|
|
653
|
+
50: 11,
|
|
654
|
+
75: 12,
|
|
655
|
+
100: 14,
|
|
656
|
+
200: 16,
|
|
657
|
+
300: 16,
|
|
658
|
+
400: 18,
|
|
659
|
+
500: 20,
|
|
660
|
+
600: 20,
|
|
661
|
+
700: 24,
|
|
662
|
+
800: 28,
|
|
663
|
+
900: 32,
|
|
664
|
+
1000: 32,
|
|
665
|
+
1100: 40,
|
|
666
|
+
1200: 48,
|
|
667
|
+
1300: 56,
|
|
668
|
+
1600: 64
|
|
669
|
+
},
|
|
670
|
+
weight: _objectSpread$6d({}, fontWeight)
|
|
671
|
+
},
|
|
672
|
+
lineHeights: {
|
|
673
|
+
0: 0,
|
|
674
|
+
25: 14,
|
|
675
|
+
50: 16,
|
|
676
|
+
75: 18,
|
|
677
|
+
100: 20,
|
|
678
|
+
200: 20,
|
|
679
|
+
300: 24,
|
|
680
|
+
400: 24,
|
|
681
|
+
500: 28,
|
|
682
|
+
600: 32,
|
|
683
|
+
700: 40,
|
|
684
|
+
800: 40,
|
|
685
|
+
900: 48,
|
|
686
|
+
1000: 56,
|
|
687
|
+
1100: 64,
|
|
688
|
+
1500: 72
|
|
689
|
+
}
|
|
690
|
+
// letterSpacings: {},
|
|
691
|
+
}
|
|
692
|
+
});
|
|
945
693
|
|
|
946
694
|
/**
|
|
947
|
-
*
|
|
695
|
+
* Size tokens are currently not exposed for users (therefore not available in theme)
|
|
948
696
|
*/
|
|
949
|
-
var
|
|
950
|
-
|
|
697
|
+
var size = {
|
|
698
|
+
/** 0 px */
|
|
699
|
+
0: 0,
|
|
700
|
+
/** 1 px */
|
|
701
|
+
1: 1,
|
|
702
|
+
/** 2 px */
|
|
703
|
+
2: 2,
|
|
704
|
+
/** 3 px */
|
|
705
|
+
3: 3,
|
|
706
|
+
/** 4 px */
|
|
707
|
+
4: 4,
|
|
708
|
+
/** 5 px */
|
|
709
|
+
5: 5,
|
|
710
|
+
/** 6 px */
|
|
711
|
+
6: 6,
|
|
712
|
+
/** 8 px */
|
|
713
|
+
8: 8,
|
|
714
|
+
/** 10 px */
|
|
715
|
+
10: 10,
|
|
716
|
+
/** 12 px */
|
|
717
|
+
12: 12,
|
|
718
|
+
/** 16 px */
|
|
719
|
+
16: 16,
|
|
720
|
+
/** 18 px */
|
|
721
|
+
18: 18,
|
|
722
|
+
/** 20 px */
|
|
723
|
+
20: 20,
|
|
724
|
+
/** 24 px */
|
|
725
|
+
24: 24,
|
|
726
|
+
/** 28 px */
|
|
727
|
+
28: 28,
|
|
728
|
+
/** 32 px */
|
|
729
|
+
32: 32,
|
|
730
|
+
/** 36 px */
|
|
731
|
+
36: 36,
|
|
732
|
+
/** 40 px */
|
|
733
|
+
40: 40,
|
|
734
|
+
/** 44 px */
|
|
735
|
+
44: 44,
|
|
736
|
+
/** 48 px */
|
|
737
|
+
48: 48,
|
|
738
|
+
/** 60 px */
|
|
739
|
+
56: 56,
|
|
740
|
+
/** 100 px */
|
|
741
|
+
100: 100,
|
|
742
|
+
/** 120 px */
|
|
743
|
+
120: 120,
|
|
744
|
+
/** 140 px */
|
|
745
|
+
140: 140,
|
|
746
|
+
/** 160 px */
|
|
747
|
+
160: 160,
|
|
748
|
+
/** 200 px */
|
|
749
|
+
200: 200,
|
|
750
|
+
/** 240 px */
|
|
751
|
+
240: 240,
|
|
752
|
+
/** 300 px */
|
|
753
|
+
300: 300,
|
|
754
|
+
/** 360 px */
|
|
755
|
+
360: 360,
|
|
756
|
+
/** 400 px */
|
|
757
|
+
400: 400,
|
|
758
|
+
/** 584 px */
|
|
759
|
+
584: 584,
|
|
760
|
+
/** 640 px */
|
|
761
|
+
640: 640,
|
|
762
|
+
/** 760 px */
|
|
763
|
+
760: 760,
|
|
764
|
+
/** 800 px */
|
|
765
|
+
800: 800,
|
|
766
|
+
/** 1024 px */
|
|
767
|
+
1024: 1024,
|
|
768
|
+
/** 1136 px */
|
|
769
|
+
1136: 1136
|
|
770
|
+
};
|
|
771
|
+
|
|
772
|
+
var getBaseListBoxWrapperStyles = function getBaseListBoxWrapperStyles(props) {
|
|
773
|
+
return {
|
|
774
|
+
maxHeight: props.isInBottomSheet ? undefined : makeSize(size[300]),
|
|
775
|
+
padding: props.isInBottomSheet ? undefined : makeSize(props.theme.spacing[3])
|
|
776
|
+
};
|
|
951
777
|
};
|
|
952
778
|
|
|
779
|
+
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
780
|
+
|
|
781
|
+
function getDefaultExportFromCjs (x) {
|
|
782
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
783
|
+
}
|
|
784
|
+
|
|
953
785
|
/**
|
|
954
|
-
*
|
|
786
|
+
* Checks if `value` is classified as an `Array` object.
|
|
955
787
|
*
|
|
956
|
-
*
|
|
788
|
+
* @static
|
|
789
|
+
* @memberOf _
|
|
790
|
+
* @since 0.1.0
|
|
791
|
+
* @category Lang
|
|
792
|
+
* @param {*} value The value to check.
|
|
793
|
+
* @returns {boolean} Returns `true` if `value` is an array, else `false`.
|
|
794
|
+
* @example
|
|
957
795
|
*
|
|
958
|
-
*
|
|
796
|
+
* _.isArray([1, 2, 3]);
|
|
797
|
+
* // => true
|
|
959
798
|
*
|
|
960
|
-
*
|
|
799
|
+
* _.isArray(document.body.children);
|
|
800
|
+
* // => false
|
|
801
|
+
*
|
|
802
|
+
* _.isArray('abc');
|
|
803
|
+
* // => false
|
|
804
|
+
*
|
|
805
|
+
* _.isArray(_.noop);
|
|
806
|
+
* // => false
|
|
961
807
|
*/
|
|
962
|
-
var getActionListContainerRole = function getActionListContainerRole(hasFooterAction, dropdownTriggerer) {
|
|
963
|
-
if (hasFooterAction) {
|
|
964
|
-
return 'dialog';
|
|
965
|
-
}
|
|
966
|
-
if (isRoleMenu(dropdownTriggerer)) {
|
|
967
|
-
return 'menu';
|
|
968
|
-
}
|
|
969
|
-
return 'listbox';
|
|
970
|
-
};
|
|
971
|
-
var getActionListSectionRole = function getActionListSectionRole() {
|
|
972
|
-
if (isReactNative$4()) {
|
|
973
|
-
return undefined;
|
|
974
|
-
}
|
|
975
|
-
return 'group';
|
|
976
|
-
};
|
|
977
|
-
var getSeparatorRole = function getSeparatorRole() {
|
|
978
|
-
if (isReactNative$4()) {
|
|
979
|
-
// Its not really announced so ignoring it in native.
|
|
980
|
-
return undefined;
|
|
981
|
-
}
|
|
982
|
-
return 'separator';
|
|
983
|
-
};
|
|
984
|
-
var getActionListItemWrapperRole = function getActionListItemWrapperRole(hasFooterAction, dropdownTriggerer) {
|
|
985
|
-
if (isRoleMenu(dropdownTriggerer)) {
|
|
986
|
-
return undefined;
|
|
987
|
-
}
|
|
988
|
-
if (hasFooterAction) {
|
|
989
|
-
return 'listbox';
|
|
990
|
-
}
|
|
991
|
-
return undefined;
|
|
992
|
-
};
|
|
993
|
-
var getActionListItemRole = function getActionListItemRole(dropdownTriggerer, href, selectionType) {
|
|
994
|
-
if (href) {
|
|
995
|
-
return 'link';
|
|
996
|
-
}
|
|
997
|
-
if (isRoleMenu(dropdownTriggerer)) {
|
|
998
|
-
if (selectionType === 'multiple') {
|
|
999
|
-
return 'menuitemcheckbox';
|
|
1000
|
-
}
|
|
1001
|
-
return 'menuitem';
|
|
1002
|
-
}
|
|
1003
|
-
return 'option';
|
|
1004
|
-
};
|
|
1005
808
|
|
|
1006
|
-
var
|
|
1007
|
-
ActionList: 'ActionList',
|
|
1008
|
-
ActionListItem: 'ActionListItem',
|
|
1009
|
-
ActionListItemAsset: 'ActionListItemAsset',
|
|
1010
|
-
ActionListItemIcon: 'ActionListItemIcon',
|
|
1011
|
-
ActionListItemText: 'ActionListItemText',
|
|
1012
|
-
ActionListSection: 'ActionListSection'
|
|
1013
|
-
};
|
|
809
|
+
var isArray$4 = Array.isArray;
|
|
1014
810
|
|
|
1015
|
-
|
|
811
|
+
var isArray_1 = isArray$4;
|
|
1016
812
|
|
|
1017
|
-
/**
|
|
1018
|
-
* Gets the `componentId` prop of React component if it exists.
|
|
1019
|
-
*/
|
|
1020
|
-
var getComponentId = function getComponentId(component) {
|
|
1021
|
-
var _component$props, _component$props2, _component$props2$ori, _component$type;
|
|
1022
|
-
if (! /*#__PURE__*/React__default.isValidElement(component)) return null;
|
|
813
|
+
/** Detect free variable `global` from Node.js. */
|
|
1023
814
|
|
|
1024
|
-
|
|
1025
|
-
if (component !== null && component !== void 0 && (_component$props = component.props) !== null && _component$props !== void 0 && _component$props.mdxType && component !== null && component !== void 0 && (_component$props2 = component.props) !== null && _component$props2 !== void 0 && (_component$props2$ori = _component$props2.originalType) !== null && _component$props2$ori !== void 0 && _component$props2$ori.componentId) {
|
|
1026
|
-
return component.props.originalType.componentId;
|
|
1027
|
-
}
|
|
1028
|
-
return (_component$type = component.type) === null || _component$type === void 0 ? void 0 : _component$type.componentId;
|
|
1029
|
-
};
|
|
815
|
+
var freeGlobal$1 = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
|
|
1030
816
|
|
|
1031
|
-
|
|
1032
|
-
* Checks if the `component` matches the `componentId`
|
|
1033
|
-
*/
|
|
1034
|
-
var isValidAllowedChildren = function isValidAllowedChildren(component, id) {
|
|
1035
|
-
return getComponentId(component) === id;
|
|
1036
|
-
};
|
|
817
|
+
var _freeGlobal = freeGlobal$1;
|
|
1037
818
|
|
|
1038
|
-
|
|
1039
|
-
|
|
819
|
+
var freeGlobal = _freeGlobal;
|
|
820
|
+
|
|
821
|
+
/** Detect free variable `self`. */
|
|
822
|
+
var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
|
|
823
|
+
|
|
824
|
+
/** Used as a reference to the global object. */
|
|
825
|
+
var root$8 = freeGlobal || freeSelf || Function('return this')();
|
|
826
|
+
|
|
827
|
+
var _root = root$8;
|
|
828
|
+
|
|
829
|
+
var root$7 = _root;
|
|
830
|
+
|
|
831
|
+
/** Built-in value references. */
|
|
832
|
+
var Symbol$4 = root$7.Symbol;
|
|
833
|
+
|
|
834
|
+
var _Symbol = Symbol$4;
|
|
835
|
+
|
|
836
|
+
var Symbol$3 = _Symbol;
|
|
837
|
+
|
|
838
|
+
/** Used for built-in method references. */
|
|
839
|
+
var objectProto$8 = Object.prototype;
|
|
840
|
+
|
|
841
|
+
/** Used to check objects for own properties. */
|
|
842
|
+
var hasOwnProperty$6 = objectProto$8.hasOwnProperty;
|
|
1040
843
|
|
|
1041
844
|
/**
|
|
1042
|
-
*
|
|
1043
|
-
*
|
|
1044
|
-
*
|
|
1045
|
-
* It is used to decide if ActionListSection add divider at the end
|
|
845
|
+
* Used to resolve the
|
|
846
|
+
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
|
847
|
+
* of values.
|
|
1046
848
|
*/
|
|
1047
|
-
var
|
|
1048
|
-
// Creating an array of componentIds
|
|
1049
|
-
var childComponentIdArray = React__default.Children.toArray(children).map(function (child) {
|
|
1050
|
-
return getComponentId(child);
|
|
1051
|
-
});
|
|
849
|
+
var nativeObjectToString$1 = objectProto$8.toString;
|
|
1052
850
|
|
|
1053
|
-
|
|
1054
|
-
|
|
851
|
+
/** Built-in value references. */
|
|
852
|
+
var symToStringTag$1 = Symbol$3 ? Symbol$3.toStringTag : undefined;
|
|
1055
853
|
|
|
1056
|
-
// Checking if there is any `ActionListItem` present after `ActionListSection`
|
|
1057
|
-
var isActionListItemPresentAfterSection = childComponentIdArray.slice(lastActionListSectionIndex).includes(componentIds.ActionListItem);
|
|
1058
|
-
return {
|
|
1059
|
-
isActionListItemPresentAfterSection: isActionListItemPresentAfterSection,
|
|
1060
|
-
lastActionListSectionIndex: lastActionListSectionIndex
|
|
1061
|
-
};
|
|
1062
|
-
};
|
|
1063
854
|
/**
|
|
1064
|
-
*
|
|
855
|
+
* A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
|
|
856
|
+
*
|
|
857
|
+
* @private
|
|
858
|
+
* @param {*} value The value to query.
|
|
859
|
+
* @returns {string} Returns the raw `toStringTag`.
|
|
1065
860
|
*/
|
|
1066
|
-
|
|
1067
|
-
var
|
|
1068
|
-
|
|
1069
|
-
var actionListOptions = [];
|
|
1070
|
-
var getActionListItemWithId = function getActionListItemWithId(child, hideDivider) {
|
|
1071
|
-
if ( /*#__PURE__*/React__default.isValidElement(child) && !child.props.isDisabled) {
|
|
1072
|
-
actionListOptions.push({
|
|
1073
|
-
title: child.props.title,
|
|
1074
|
-
value: child.props.value,
|
|
1075
|
-
onClickTrigger: function onClickTrigger(value) {
|
|
1076
|
-
var _child$props$onClick, _child$props, _child$props$isSelect;
|
|
1077
|
-
var anchorLink = child.props.href;
|
|
1078
|
-
(_child$props$onClick = (_child$props = child.props).onClick) === null || _child$props$onClick === void 0 ? void 0 : _child$props$onClick.call(_child$props, {
|
|
1079
|
-
name: child.props.value,
|
|
1080
|
-
value: (_child$props$isSelect = child.props.isSelected) !== null && _child$props$isSelect !== void 0 ? _child$props$isSelect : value
|
|
1081
|
-
});
|
|
1082
|
-
if (anchorLink && !isReactNative$4()) {
|
|
1083
|
-
var _child$props$target;
|
|
1084
|
-
var target = (_child$props$target = child.props.target) !== null && _child$props$target !== void 0 ? _child$props$target : '_self';
|
|
1085
|
-
window.open(anchorLink, target);
|
|
1086
|
-
if (window.top) {
|
|
1087
|
-
window.top.open(anchorLink, target);
|
|
1088
|
-
}
|
|
1089
|
-
}
|
|
1090
|
-
}
|
|
1091
|
-
});
|
|
1092
|
-
var currentIndex = actionListOptions.length - 1;
|
|
1093
|
-
var foundSection = sectionData.find(function (v) {
|
|
1094
|
-
return v.title === currentSection;
|
|
1095
|
-
});
|
|
1096
|
-
// push the item in the appropriate bucket
|
|
1097
|
-
if (foundSection) {
|
|
1098
|
-
foundSection === null || foundSection === void 0 ? void 0 : foundSection.data.push(_objectSpread$6d(_objectSpread$6d({}, child.props), {}, {
|
|
1099
|
-
_index: currentIndex
|
|
1100
|
-
}));
|
|
1101
|
-
} else {
|
|
1102
|
-
// create a new bucket
|
|
1103
|
-
sectionData.push({
|
|
1104
|
-
title: currentSection,
|
|
1105
|
-
hideDivider: hideDivider,
|
|
1106
|
-
data: [_objectSpread$6d(_objectSpread$6d({}, child.props), {}, {
|
|
1107
|
-
_index: currentIndex
|
|
1108
|
-
})]
|
|
1109
|
-
});
|
|
1110
|
-
}
|
|
1111
|
-
var clonedChild = /*#__PURE__*/React__default.cloneElement(child, {
|
|
1112
|
-
// @ts-expect-error: TS doesn't understand the child's props
|
|
1113
|
-
_index: currentIndex
|
|
1114
|
-
});
|
|
1115
|
-
return clonedChild;
|
|
1116
|
-
}
|
|
1117
|
-
return child;
|
|
1118
|
-
};
|
|
1119
|
-
var isActionListItemPresentAfterSection;
|
|
1120
|
-
// eslint-disable-next-line one-var
|
|
1121
|
-
var lastActionListSectionIndex;
|
|
1122
|
-
if (isReactNative$4()) {
|
|
1123
|
-
// We're reading this so that we can decide whether to show the divider or not.
|
|
1124
|
-
// If ActionListSection is final item and no ActionListItem is present after that, we hide the divider
|
|
1125
|
-
// On web, we do it using descendant styling
|
|
1126
|
-
var _getActionListSection = getActionListSectionPosition(children);
|
|
1127
|
-
isActionListItemPresentAfterSection = _getActionListSection.isActionListItemPresentAfterSection;
|
|
1128
|
-
lastActionListSectionIndex = _getActionListSection.lastActionListSectionIndex;
|
|
1129
|
-
}
|
|
861
|
+
function getRawTag$1(value) {
|
|
862
|
+
var isOwn = hasOwnProperty$6.call(value, symToStringTag$1),
|
|
863
|
+
tag = value[symToStringTag$1];
|
|
1130
864
|
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
}
|
|
1143
|
-
return childInSection;
|
|
1144
|
-
}),
|
|
1145
|
-
// On web, we handle it with descendant styling in css so no need of JS there
|
|
1146
|
-
_hideDivider: isReactNative$4() ? shouldHideDivider : undefined
|
|
1147
|
-
});
|
|
1148
|
-
}
|
|
1149
|
-
if (isValidAllowedChildren(child, componentIds.ActionListItem)) {
|
|
1150
|
-
return getActionListItemWithId(child, true);
|
|
1151
|
-
}
|
|
865
|
+
try {
|
|
866
|
+
value[symToStringTag$1] = undefined;
|
|
867
|
+
var unmasked = true;
|
|
868
|
+
} catch (e) {}
|
|
869
|
+
|
|
870
|
+
var result = nativeObjectToString$1.call(value);
|
|
871
|
+
if (unmasked) {
|
|
872
|
+
if (isOwn) {
|
|
873
|
+
value[symToStringTag$1] = tag;
|
|
874
|
+
} else {
|
|
875
|
+
delete value[symToStringTag$1];
|
|
1152
876
|
}
|
|
1153
|
-
return child;
|
|
1154
|
-
});
|
|
1155
|
-
return {
|
|
1156
|
-
sectionData: sectionData,
|
|
1157
|
-
childrenWithId: childrenWithId,
|
|
1158
|
-
actionListOptions: actionListOptions
|
|
1159
|
-
};
|
|
1160
|
-
};
|
|
1161
|
-
var validateActionListItemProps = function validateActionListItemProps(_ref) {
|
|
1162
|
-
_ref.leading;
|
|
1163
|
-
_ref.trailing;
|
|
1164
|
-
};
|
|
1165
|
-
var getNormalTextColor = function getNormalTextColor(isDisabled) {
|
|
1166
|
-
var _ref2 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
|
|
1167
|
-
isMuted = _ref2.isMuted;
|
|
1168
|
-
if (isDisabled) {
|
|
1169
|
-
return 'surface.text.placeholder.lowContrast';
|
|
1170
|
-
}
|
|
1171
|
-
if (isMuted) {
|
|
1172
|
-
return 'surface.text.muted.lowContrast';
|
|
1173
877
|
}
|
|
1174
|
-
return
|
|
1175
|
-
}
|
|
878
|
+
return result;
|
|
879
|
+
}
|
|
1176
880
|
|
|
1177
|
-
var
|
|
1178
|
-
base: 0,
|
|
1179
|
-
xs: 320,
|
|
1180
|
-
s: 480,
|
|
1181
|
-
m: 768,
|
|
1182
|
-
l: 1024,
|
|
1183
|
-
xl: 1200
|
|
1184
|
-
};
|
|
881
|
+
var _getRawTag = getRawTag$1;
|
|
1185
882
|
|
|
1186
|
-
|
|
1187
|
-
text: 'Lato, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',
|
|
1188
|
-
code: 'monospace'
|
|
1189
|
-
};
|
|
883
|
+
/** Used for built-in method references. */
|
|
1190
884
|
|
|
1191
|
-
|
|
1192
|
-
function _objectSpread$6c(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$6d(Object(source), !0).forEach(function (key) { _defineProperty$1(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$6d(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
885
|
+
var objectProto$7 = Object.prototype;
|
|
1193
886
|
|
|
1194
887
|
/**
|
|
1195
|
-
*
|
|
1196
|
-
*
|
|
1197
|
-
*
|
|
1198
|
-
* similarly 2xl on mobile can be 34px but on desktop doesn’t necessarily mean 2xl will be more than xl(34px) it can be 32 as well since visually they make better hierarchy.
|
|
888
|
+
* Used to resolve the
|
|
889
|
+
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
|
890
|
+
* of values.
|
|
1199
891
|
*/
|
|
892
|
+
var nativeObjectToString = objectProto$7.toString;
|
|
1200
893
|
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
25: 10,
|
|
1212
|
-
50: 11,
|
|
1213
|
-
75: 12,
|
|
1214
|
-
100: 14,
|
|
1215
|
-
200: 16,
|
|
1216
|
-
300: 18,
|
|
1217
|
-
400: 20,
|
|
1218
|
-
500: 22,
|
|
1219
|
-
600: 24,
|
|
1220
|
-
700: 28,
|
|
1221
|
-
800: 32,
|
|
1222
|
-
900: 36,
|
|
1223
|
-
1000: 40,
|
|
1224
|
-
1100: 48,
|
|
1225
|
-
1200: 56,
|
|
1226
|
-
1300: 64,
|
|
1227
|
-
1600: 88
|
|
1228
|
-
},
|
|
1229
|
-
weight: _objectSpread$6c({}, fontWeight)
|
|
1230
|
-
},
|
|
1231
|
-
lineHeights: {
|
|
1232
|
-
0: 0,
|
|
1233
|
-
25: 14,
|
|
1234
|
-
50: 16,
|
|
1235
|
-
75: 18,
|
|
1236
|
-
100: 20,
|
|
1237
|
-
200: 24,
|
|
1238
|
-
300: 24,
|
|
1239
|
-
400: 28,
|
|
1240
|
-
500: 32,
|
|
1241
|
-
600: 40,
|
|
1242
|
-
700: 40,
|
|
1243
|
-
800: 48,
|
|
1244
|
-
900: 56,
|
|
1245
|
-
1000: 64,
|
|
1246
|
-
1100: 72,
|
|
1247
|
-
1500: 104
|
|
1248
|
-
}
|
|
1249
|
-
// letterSpacings: {},
|
|
1250
|
-
},
|
|
894
|
+
/**
|
|
895
|
+
* Converts `value` to a string using `Object.prototype.toString`.
|
|
896
|
+
*
|
|
897
|
+
* @private
|
|
898
|
+
* @param {*} value The value to convert.
|
|
899
|
+
* @returns {string} Returns the converted string.
|
|
900
|
+
*/
|
|
901
|
+
function objectToString$1(value) {
|
|
902
|
+
return nativeObjectToString.call(value);
|
|
903
|
+
}
|
|
1251
904
|
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
500: 20,
|
|
1265
|
-
600: 20,
|
|
1266
|
-
700: 24,
|
|
1267
|
-
800: 28,
|
|
1268
|
-
900: 32,
|
|
1269
|
-
1000: 32,
|
|
1270
|
-
1100: 40,
|
|
1271
|
-
1200: 48,
|
|
1272
|
-
1300: 56,
|
|
1273
|
-
1600: 64
|
|
1274
|
-
},
|
|
1275
|
-
weight: _objectSpread$6c({}, fontWeight)
|
|
1276
|
-
},
|
|
1277
|
-
lineHeights: {
|
|
1278
|
-
0: 0,
|
|
1279
|
-
25: 14,
|
|
1280
|
-
50: 16,
|
|
1281
|
-
75: 18,
|
|
1282
|
-
100: 20,
|
|
1283
|
-
200: 20,
|
|
1284
|
-
300: 24,
|
|
1285
|
-
400: 24,
|
|
1286
|
-
500: 28,
|
|
1287
|
-
600: 32,
|
|
1288
|
-
700: 40,
|
|
1289
|
-
800: 40,
|
|
1290
|
-
900: 48,
|
|
1291
|
-
1000: 56,
|
|
1292
|
-
1100: 64,
|
|
1293
|
-
1500: 72
|
|
1294
|
-
}
|
|
1295
|
-
// letterSpacings: {},
|
|
1296
|
-
}
|
|
1297
|
-
});
|
|
905
|
+
var _objectToString = objectToString$1;
|
|
906
|
+
|
|
907
|
+
var Symbol$2 = _Symbol,
|
|
908
|
+
getRawTag = _getRawTag,
|
|
909
|
+
objectToString = _objectToString;
|
|
910
|
+
|
|
911
|
+
/** `Object#toString` result references. */
|
|
912
|
+
var nullTag = '[object Null]',
|
|
913
|
+
undefinedTag = '[object Undefined]';
|
|
914
|
+
|
|
915
|
+
/** Built-in value references. */
|
|
916
|
+
var symToStringTag = Symbol$2 ? Symbol$2.toStringTag : undefined;
|
|
1298
917
|
|
|
1299
918
|
/**
|
|
1300
|
-
*
|
|
919
|
+
* The base implementation of `getTag` without fallbacks for buggy environments.
|
|
920
|
+
*
|
|
921
|
+
* @private
|
|
922
|
+
* @param {*} value The value to query.
|
|
923
|
+
* @returns {string} Returns the `toStringTag`.
|
|
1301
924
|
*/
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
3: 3,
|
|
1311
|
-
/** 4 px */
|
|
1312
|
-
4: 4,
|
|
1313
|
-
/** 5 px */
|
|
1314
|
-
5: 5,
|
|
1315
|
-
/** 6 px */
|
|
1316
|
-
6: 6,
|
|
1317
|
-
/** 8 px */
|
|
1318
|
-
8: 8,
|
|
1319
|
-
/** 10 px */
|
|
1320
|
-
10: 10,
|
|
1321
|
-
/** 12 px */
|
|
1322
|
-
12: 12,
|
|
1323
|
-
/** 16 px */
|
|
1324
|
-
16: 16,
|
|
1325
|
-
/** 18 px */
|
|
1326
|
-
18: 18,
|
|
1327
|
-
/** 20 px */
|
|
1328
|
-
20: 20,
|
|
1329
|
-
/** 24 px */
|
|
1330
|
-
24: 24,
|
|
1331
|
-
/** 28 px */
|
|
1332
|
-
28: 28,
|
|
1333
|
-
/** 32 px */
|
|
1334
|
-
32: 32,
|
|
1335
|
-
/** 36 px */
|
|
1336
|
-
36: 36,
|
|
1337
|
-
/** 40 px */
|
|
1338
|
-
40: 40,
|
|
1339
|
-
/** 44 px */
|
|
1340
|
-
44: 44,
|
|
1341
|
-
/** 48 px */
|
|
1342
|
-
48: 48,
|
|
1343
|
-
/** 60 px */
|
|
1344
|
-
56: 56,
|
|
1345
|
-
/** 100 px */
|
|
1346
|
-
100: 100,
|
|
1347
|
-
/** 120 px */
|
|
1348
|
-
120: 120,
|
|
1349
|
-
/** 140 px */
|
|
1350
|
-
140: 140,
|
|
1351
|
-
/** 160 px */
|
|
1352
|
-
160: 160,
|
|
1353
|
-
/** 200 px */
|
|
1354
|
-
200: 200,
|
|
1355
|
-
/** 240 px */
|
|
1356
|
-
240: 240,
|
|
1357
|
-
/** 300 px */
|
|
1358
|
-
300: 300,
|
|
1359
|
-
/** 360 px */
|
|
1360
|
-
360: 360,
|
|
1361
|
-
/** 400 px */
|
|
1362
|
-
400: 400,
|
|
1363
|
-
/** 584 px */
|
|
1364
|
-
584: 584,
|
|
1365
|
-
/** 640 px */
|
|
1366
|
-
640: 640,
|
|
1367
|
-
/** 760 px */
|
|
1368
|
-
760: 760,
|
|
1369
|
-
/** 800 px */
|
|
1370
|
-
800: 800,
|
|
1371
|
-
/** 1024 px */
|
|
1372
|
-
1024: 1024,
|
|
1373
|
-
/** 1136 px */
|
|
1374
|
-
1136: 1136
|
|
1375
|
-
};
|
|
1376
|
-
|
|
1377
|
-
var getBaseListBoxWrapperStyles = function getBaseListBoxWrapperStyles(props) {
|
|
1378
|
-
return {
|
|
1379
|
-
maxHeight: props.isInBottomSheet ? undefined : makeSize(size[300]),
|
|
1380
|
-
padding: props.isInBottomSheet ? undefined : makeSize(props.theme.spacing[3])
|
|
1381
|
-
};
|
|
1382
|
-
};
|
|
925
|
+
function baseGetTag$6(value) {
|
|
926
|
+
if (value == null) {
|
|
927
|
+
return value === undefined ? undefinedTag : nullTag;
|
|
928
|
+
}
|
|
929
|
+
return (symToStringTag && symToStringTag in Object(value))
|
|
930
|
+
? getRawTag(value)
|
|
931
|
+
: objectToString(value);
|
|
932
|
+
}
|
|
1383
933
|
|
|
1384
|
-
var
|
|
934
|
+
var _baseGetTag = baseGetTag$6;
|
|
1385
935
|
|
|
1386
936
|
/**
|
|
1387
|
-
* Checks if `value` is
|
|
937
|
+
* Checks if `value` is object-like. A value is object-like if it's not `null`
|
|
938
|
+
* and has a `typeof` result of "object".
|
|
1388
939
|
*
|
|
1389
940
|
* @static
|
|
1390
941
|
* @memberOf _
|
|
1391
|
-
* @since 0.
|
|
942
|
+
* @since 4.0.0
|
|
1392
943
|
* @category Lang
|
|
1393
944
|
* @param {*} value The value to check.
|
|
1394
|
-
* @returns {boolean} Returns `true` if `value` is
|
|
945
|
+
* @returns {boolean} Returns `true` if `value` is object-like, else `false`.
|
|
1395
946
|
* @example
|
|
1396
947
|
*
|
|
1397
|
-
* _.
|
|
948
|
+
* _.isObjectLike({});
|
|
1398
949
|
* // => true
|
|
1399
950
|
*
|
|
1400
|
-
* _.
|
|
1401
|
-
* // =>
|
|
951
|
+
* _.isObjectLike([1, 2, 3]);
|
|
952
|
+
* // => true
|
|
1402
953
|
*
|
|
1403
|
-
* _.
|
|
954
|
+
* _.isObjectLike(_.noop);
|
|
1404
955
|
* // => false
|
|
1405
956
|
*
|
|
1406
|
-
* _.
|
|
957
|
+
* _.isObjectLike(null);
|
|
1407
958
|
* // => false
|
|
1408
959
|
*/
|
|
1409
960
|
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
/** Detect free variable `global` from Node.js. */
|
|
1415
|
-
|
|
1416
|
-
var freeGlobal$1 = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
|
|
1417
|
-
|
|
1418
|
-
var _freeGlobal = freeGlobal$1;
|
|
1419
|
-
|
|
1420
|
-
var freeGlobal = _freeGlobal;
|
|
1421
|
-
|
|
1422
|
-
/** Detect free variable `self`. */
|
|
1423
|
-
var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
|
|
1424
|
-
|
|
1425
|
-
/** Used as a reference to the global object. */
|
|
1426
|
-
var root$8 = freeGlobal || freeSelf || Function('return this')();
|
|
961
|
+
function isObjectLike$5(value) {
|
|
962
|
+
return value != null && typeof value == 'object';
|
|
963
|
+
}
|
|
1427
964
|
|
|
1428
|
-
var
|
|
965
|
+
var isObjectLike_1 = isObjectLike$5;
|
|
1429
966
|
|
|
1430
|
-
var
|
|
967
|
+
var baseGetTag$5 = _baseGetTag,
|
|
968
|
+
isObjectLike$4 = isObjectLike_1;
|
|
1431
969
|
|
|
1432
|
-
/**
|
|
1433
|
-
var
|
|
1434
|
-
|
|
1435
|
-
var _Symbol = Symbol$4;
|
|
1436
|
-
|
|
1437
|
-
var Symbol$3 = _Symbol;
|
|
1438
|
-
|
|
1439
|
-
/** Used for built-in method references. */
|
|
1440
|
-
var objectProto$8 = Object.prototype;
|
|
1441
|
-
|
|
1442
|
-
/** Used to check objects for own properties. */
|
|
1443
|
-
var hasOwnProperty$6 = objectProto$8.hasOwnProperty;
|
|
1444
|
-
|
|
1445
|
-
/**
|
|
1446
|
-
* Used to resolve the
|
|
1447
|
-
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
|
1448
|
-
* of values.
|
|
1449
|
-
*/
|
|
1450
|
-
var nativeObjectToString$1 = objectProto$8.toString;
|
|
1451
|
-
|
|
1452
|
-
/** Built-in value references. */
|
|
1453
|
-
var symToStringTag$1 = Symbol$3 ? Symbol$3.toStringTag : undefined;
|
|
1454
|
-
|
|
1455
|
-
/**
|
|
1456
|
-
* A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
|
|
1457
|
-
*
|
|
1458
|
-
* @private
|
|
1459
|
-
* @param {*} value The value to query.
|
|
1460
|
-
* @returns {string} Returns the raw `toStringTag`.
|
|
1461
|
-
*/
|
|
1462
|
-
function getRawTag$1(value) {
|
|
1463
|
-
var isOwn = hasOwnProperty$6.call(value, symToStringTag$1),
|
|
1464
|
-
tag = value[symToStringTag$1];
|
|
1465
|
-
|
|
1466
|
-
try {
|
|
1467
|
-
value[symToStringTag$1] = undefined;
|
|
1468
|
-
var unmasked = true;
|
|
1469
|
-
} catch (e) {}
|
|
1470
|
-
|
|
1471
|
-
var result = nativeObjectToString$1.call(value);
|
|
1472
|
-
if (unmasked) {
|
|
1473
|
-
if (isOwn) {
|
|
1474
|
-
value[symToStringTag$1] = tag;
|
|
1475
|
-
} else {
|
|
1476
|
-
delete value[symToStringTag$1];
|
|
1477
|
-
}
|
|
1478
|
-
}
|
|
1479
|
-
return result;
|
|
1480
|
-
}
|
|
1481
|
-
|
|
1482
|
-
var _getRawTag = getRawTag$1;
|
|
1483
|
-
|
|
1484
|
-
/** Used for built-in method references. */
|
|
1485
|
-
|
|
1486
|
-
var objectProto$7 = Object.prototype;
|
|
1487
|
-
|
|
1488
|
-
/**
|
|
1489
|
-
* Used to resolve the
|
|
1490
|
-
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
|
1491
|
-
* of values.
|
|
1492
|
-
*/
|
|
1493
|
-
var nativeObjectToString = objectProto$7.toString;
|
|
1494
|
-
|
|
1495
|
-
/**
|
|
1496
|
-
* Converts `value` to a string using `Object.prototype.toString`.
|
|
1497
|
-
*
|
|
1498
|
-
* @private
|
|
1499
|
-
* @param {*} value The value to convert.
|
|
1500
|
-
* @returns {string} Returns the converted string.
|
|
1501
|
-
*/
|
|
1502
|
-
function objectToString$1(value) {
|
|
1503
|
-
return nativeObjectToString.call(value);
|
|
1504
|
-
}
|
|
1505
|
-
|
|
1506
|
-
var _objectToString = objectToString$1;
|
|
1507
|
-
|
|
1508
|
-
var Symbol$2 = _Symbol,
|
|
1509
|
-
getRawTag = _getRawTag,
|
|
1510
|
-
objectToString = _objectToString;
|
|
1511
|
-
|
|
1512
|
-
/** `Object#toString` result references. */
|
|
1513
|
-
var nullTag = '[object Null]',
|
|
1514
|
-
undefinedTag = '[object Undefined]';
|
|
1515
|
-
|
|
1516
|
-
/** Built-in value references. */
|
|
1517
|
-
var symToStringTag = Symbol$2 ? Symbol$2.toStringTag : undefined;
|
|
1518
|
-
|
|
1519
|
-
/**
|
|
1520
|
-
* The base implementation of `getTag` without fallbacks for buggy environments.
|
|
1521
|
-
*
|
|
1522
|
-
* @private
|
|
1523
|
-
* @param {*} value The value to query.
|
|
1524
|
-
* @returns {string} Returns the `toStringTag`.
|
|
1525
|
-
*/
|
|
1526
|
-
function baseGetTag$6(value) {
|
|
1527
|
-
if (value == null) {
|
|
1528
|
-
return value === undefined ? undefinedTag : nullTag;
|
|
1529
|
-
}
|
|
1530
|
-
return (symToStringTag && symToStringTag in Object(value))
|
|
1531
|
-
? getRawTag(value)
|
|
1532
|
-
: objectToString(value);
|
|
1533
|
-
}
|
|
1534
|
-
|
|
1535
|
-
var _baseGetTag = baseGetTag$6;
|
|
1536
|
-
|
|
1537
|
-
/**
|
|
1538
|
-
* Checks if `value` is object-like. A value is object-like if it's not `null`
|
|
1539
|
-
* and has a `typeof` result of "object".
|
|
1540
|
-
*
|
|
1541
|
-
* @static
|
|
1542
|
-
* @memberOf _
|
|
1543
|
-
* @since 4.0.0
|
|
1544
|
-
* @category Lang
|
|
1545
|
-
* @param {*} value The value to check.
|
|
1546
|
-
* @returns {boolean} Returns `true` if `value` is object-like, else `false`.
|
|
1547
|
-
* @example
|
|
1548
|
-
*
|
|
1549
|
-
* _.isObjectLike({});
|
|
1550
|
-
* // => true
|
|
1551
|
-
*
|
|
1552
|
-
* _.isObjectLike([1, 2, 3]);
|
|
1553
|
-
* // => true
|
|
1554
|
-
*
|
|
1555
|
-
* _.isObjectLike(_.noop);
|
|
1556
|
-
* // => false
|
|
1557
|
-
*
|
|
1558
|
-
* _.isObjectLike(null);
|
|
1559
|
-
* // => false
|
|
1560
|
-
*/
|
|
1561
|
-
|
|
1562
|
-
function isObjectLike$5(value) {
|
|
1563
|
-
return value != null && typeof value == 'object';
|
|
1564
|
-
}
|
|
1565
|
-
|
|
1566
|
-
var isObjectLike_1 = isObjectLike$5;
|
|
1567
|
-
|
|
1568
|
-
var baseGetTag$5 = _baseGetTag,
|
|
1569
|
-
isObjectLike$4 = isObjectLike_1;
|
|
1570
|
-
|
|
1571
|
-
/** `Object#toString` result references. */
|
|
1572
|
-
var symbolTag = '[object Symbol]';
|
|
970
|
+
/** `Object#toString` result references. */
|
|
971
|
+
var symbolTag = '[object Symbol]';
|
|
1573
972
|
|
|
1574
973
|
/**
|
|
1575
974
|
* Checks if `value` is classified as a `Symbol` primitive or object.
|
|
@@ -2693,6 +2092,8 @@ function get(object, path, defaultValue) {
|
|
|
2693
2092
|
|
|
2694
2093
|
var get_1 = get;
|
|
2695
2094
|
|
|
2095
|
+
var getIn = /*@__PURE__*/getDefaultExportFromCjs(get_1);
|
|
2096
|
+
|
|
2696
2097
|
/** Used for built-in method references. */
|
|
2697
2098
|
|
|
2698
2099
|
var objectProto$3 = Object.prototype;
|
|
@@ -3008,46 +2409,50 @@ function stubFalse() {
|
|
|
3008
2409
|
|
|
3009
2410
|
var stubFalse_1 = stubFalse;
|
|
3010
2411
|
|
|
3011
|
-
|
|
3012
|
-
var root = _root,
|
|
3013
|
-
stubFalse = stubFalse_1;
|
|
3014
|
-
|
|
3015
|
-
/** Detect free variable `exports`. */
|
|
3016
|
-
var freeExports = exports && !exports.nodeType && exports;
|
|
3017
|
-
|
|
3018
|
-
/** Detect free variable `module`. */
|
|
3019
|
-
var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module;
|
|
3020
|
-
|
|
3021
|
-
/** Detect the popular CommonJS extension `module.exports`. */
|
|
3022
|
-
var moduleExports = freeModule && freeModule.exports === freeExports;
|
|
3023
|
-
|
|
3024
|
-
/** Built-in value references. */
|
|
3025
|
-
var Buffer = moduleExports ? root.Buffer : undefined;
|
|
3026
|
-
|
|
3027
|
-
/* Built-in method references for those with the same name as other `lodash` methods. */
|
|
3028
|
-
var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;
|
|
3029
|
-
|
|
3030
|
-
/**
|
|
3031
|
-
* Checks if `value` is a buffer.
|
|
3032
|
-
*
|
|
3033
|
-
* @static
|
|
3034
|
-
* @memberOf _
|
|
3035
|
-
* @since 4.3.0
|
|
3036
|
-
* @category Lang
|
|
3037
|
-
* @param {*} value The value to check.
|
|
3038
|
-
* @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
|
|
3039
|
-
* @example
|
|
3040
|
-
*
|
|
3041
|
-
* _.isBuffer(new Buffer(2));
|
|
3042
|
-
* // => true
|
|
3043
|
-
*
|
|
3044
|
-
* _.isBuffer(new Uint8Array(2));
|
|
3045
|
-
* // => false
|
|
3046
|
-
*/
|
|
3047
|
-
var isBuffer = nativeIsBuffer || stubFalse;
|
|
2412
|
+
isBuffer$1.exports;
|
|
3048
2413
|
|
|
3049
|
-
module
|
|
3050
|
-
|
|
2414
|
+
(function (module, exports) {
|
|
2415
|
+
var root = _root,
|
|
2416
|
+
stubFalse = stubFalse_1;
|
|
2417
|
+
|
|
2418
|
+
/** Detect free variable `exports`. */
|
|
2419
|
+
var freeExports = exports && !exports.nodeType && exports;
|
|
2420
|
+
|
|
2421
|
+
/** Detect free variable `module`. */
|
|
2422
|
+
var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module;
|
|
2423
|
+
|
|
2424
|
+
/** Detect the popular CommonJS extension `module.exports`. */
|
|
2425
|
+
var moduleExports = freeModule && freeModule.exports === freeExports;
|
|
2426
|
+
|
|
2427
|
+
/** Built-in value references. */
|
|
2428
|
+
var Buffer = moduleExports ? root.Buffer : undefined;
|
|
2429
|
+
|
|
2430
|
+
/* Built-in method references for those with the same name as other `lodash` methods. */
|
|
2431
|
+
var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;
|
|
2432
|
+
|
|
2433
|
+
/**
|
|
2434
|
+
* Checks if `value` is a buffer.
|
|
2435
|
+
*
|
|
2436
|
+
* @static
|
|
2437
|
+
* @memberOf _
|
|
2438
|
+
* @since 4.3.0
|
|
2439
|
+
* @category Lang
|
|
2440
|
+
* @param {*} value The value to check.
|
|
2441
|
+
* @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
|
|
2442
|
+
* @example
|
|
2443
|
+
*
|
|
2444
|
+
* _.isBuffer(new Buffer(2));
|
|
2445
|
+
* // => true
|
|
2446
|
+
*
|
|
2447
|
+
* _.isBuffer(new Uint8Array(2));
|
|
2448
|
+
* // => false
|
|
2449
|
+
*/
|
|
2450
|
+
var isBuffer = nativeIsBuffer || stubFalse;
|
|
2451
|
+
|
|
2452
|
+
module.exports = isBuffer;
|
|
2453
|
+
} (isBuffer$1, isBuffer$1.exports));
|
|
2454
|
+
|
|
2455
|
+
var isBufferExports = isBuffer$1.exports;
|
|
3051
2456
|
|
|
3052
2457
|
var baseGetTag$1 = _baseGetTag,
|
|
3053
2458
|
isLength = isLength_1,
|
|
@@ -3128,42 +2533,46 @@ var _baseUnary = baseUnary$1;
|
|
|
3128
2533
|
|
|
3129
2534
|
var _nodeUtil = {exports: {}};
|
|
3130
2535
|
|
|
2536
|
+
_nodeUtil.exports;
|
|
2537
|
+
|
|
3131
2538
|
(function (module, exports) {
|
|
3132
|
-
var freeGlobal = _freeGlobal;
|
|
2539
|
+
var freeGlobal = _freeGlobal;
|
|
3133
2540
|
|
|
3134
|
-
/** Detect free variable `exports`. */
|
|
3135
|
-
var freeExports = exports && !exports.nodeType && exports;
|
|
2541
|
+
/** Detect free variable `exports`. */
|
|
2542
|
+
var freeExports = exports && !exports.nodeType && exports;
|
|
3136
2543
|
|
|
3137
|
-
/** Detect free variable `module`. */
|
|
3138
|
-
var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module;
|
|
2544
|
+
/** Detect free variable `module`. */
|
|
2545
|
+
var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module;
|
|
3139
2546
|
|
|
3140
|
-
/** Detect the popular CommonJS extension `module.exports`. */
|
|
3141
|
-
var moduleExports = freeModule && freeModule.exports === freeExports;
|
|
2547
|
+
/** Detect the popular CommonJS extension `module.exports`. */
|
|
2548
|
+
var moduleExports = freeModule && freeModule.exports === freeExports;
|
|
3142
2549
|
|
|
3143
|
-
/** Detect free variable `process` from Node.js. */
|
|
3144
|
-
var freeProcess = moduleExports && freeGlobal.process;
|
|
2550
|
+
/** Detect free variable `process` from Node.js. */
|
|
2551
|
+
var freeProcess = moduleExports && freeGlobal.process;
|
|
3145
2552
|
|
|
3146
|
-
/** Used to access faster Node.js helpers. */
|
|
3147
|
-
var nodeUtil = (function() {
|
|
3148
|
-
|
|
3149
|
-
|
|
3150
|
-
|
|
2553
|
+
/** Used to access faster Node.js helpers. */
|
|
2554
|
+
var nodeUtil = (function() {
|
|
2555
|
+
try {
|
|
2556
|
+
// Use `util.types` for Node.js 10+.
|
|
2557
|
+
var types = freeModule && freeModule.require && freeModule.require('util').types;
|
|
3151
2558
|
|
|
3152
|
-
|
|
3153
|
-
|
|
3154
|
-
|
|
2559
|
+
if (types) {
|
|
2560
|
+
return types;
|
|
2561
|
+
}
|
|
3155
2562
|
|
|
3156
|
-
|
|
3157
|
-
|
|
3158
|
-
|
|
3159
|
-
}());
|
|
2563
|
+
// Legacy `process.binding('util')` for Node.js < 10.
|
|
2564
|
+
return freeProcess && freeProcess.binding && freeProcess.binding('util');
|
|
2565
|
+
} catch (e) {}
|
|
2566
|
+
}());
|
|
2567
|
+
|
|
2568
|
+
module.exports = nodeUtil;
|
|
2569
|
+
} (_nodeUtil, _nodeUtil.exports));
|
|
3160
2570
|
|
|
3161
|
-
|
|
3162
|
-
}(_nodeUtil, _nodeUtil.exports));
|
|
2571
|
+
var _nodeUtilExports = _nodeUtil.exports;
|
|
3163
2572
|
|
|
3164
2573
|
var baseIsTypedArray = _baseIsTypedArray,
|
|
3165
2574
|
baseUnary = _baseUnary,
|
|
3166
|
-
nodeUtil =
|
|
2575
|
+
nodeUtil = _nodeUtilExports;
|
|
3167
2576
|
|
|
3168
2577
|
/* Node.js helper references. */
|
|
3169
2578
|
var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
|
|
@@ -3194,7 +2603,7 @@ var baseKeys = _baseKeys,
|
|
|
3194
2603
|
isArguments = isArguments_1,
|
|
3195
2604
|
isArray = isArray_1,
|
|
3196
2605
|
isArrayLike = isArrayLike_1,
|
|
3197
|
-
isBuffer =
|
|
2606
|
+
isBuffer = isBufferExports,
|
|
3198
2607
|
isPrototype = _isPrototype,
|
|
3199
2608
|
isTypedArray = isTypedArray_1;
|
|
3200
2609
|
|
|
@@ -3267,6 +2676,8 @@ function isEmpty(value) {
|
|
|
3267
2676
|
|
|
3268
2677
|
var isEmpty_1 = isEmpty;
|
|
3269
2678
|
|
|
2679
|
+
var isEmpty$1 = /*@__PURE__*/getDefaultExportFromCjs(isEmpty_1);
|
|
2680
|
+
|
|
3270
2681
|
/**
|
|
3271
2682
|
* A helper function that returns the exact value for that breakpoint on passing the prop and breakpoint
|
|
3272
2683
|
*
|
|
@@ -3322,21 +2733,21 @@ var getResponsiveValue = function getResponsiveValue(value) {
|
|
|
3322
2733
|
}
|
|
3323
2734
|
return undefined;
|
|
3324
2735
|
}
|
|
3325
|
-
if (
|
|
2736
|
+
if (isEmpty$1(value)) {
|
|
3326
2737
|
return undefined;
|
|
3327
2738
|
}
|
|
3328
2739
|
return value[breakpoint];
|
|
3329
2740
|
};
|
|
3330
2741
|
|
|
3331
|
-
var _excluded$
|
|
3332
|
-
function ownKeys$
|
|
3333
|
-
function _objectSpread$
|
|
2742
|
+
var _excluded$51 = ["base"];
|
|
2743
|
+
function ownKeys$6d(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
2744
|
+
function _objectSpread$6c(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$6d(Object(source), !0).forEach(function (key) { _defineProperty$1(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$6d(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
3334
2745
|
var getSpacingValue = function getSpacingValue(spacingValue, theme, breakpoint) {
|
|
3335
|
-
if (
|
|
2746
|
+
if (isEmpty$1(spacingValue)) {
|
|
3336
2747
|
return undefined;
|
|
3337
2748
|
}
|
|
3338
2749
|
var responsiveSpacingValue = getResponsiveValue(spacingValue, breakpoint);
|
|
3339
|
-
if (
|
|
2750
|
+
if (isEmpty$1(responsiveSpacingValue)) {
|
|
3340
2751
|
return undefined;
|
|
3341
2752
|
}
|
|
3342
2753
|
if (responsiveSpacingValue === 'auto') {
|
|
@@ -3348,8 +2759,8 @@ var getSpacingValue = function getSpacingValue(spacingValue, theme, breakpoint)
|
|
|
3348
2759
|
}).join(' ');
|
|
3349
2760
|
}
|
|
3350
2761
|
if (typeof responsiveSpacingValue === 'string' && responsiveSpacingValue.startsWith('spacing.')) {
|
|
3351
|
-
var spacingReturnValue =
|
|
3352
|
-
return
|
|
2762
|
+
var spacingReturnValue = getIn(theme, responsiveSpacingValue);
|
|
2763
|
+
return isEmpty$1(spacingReturnValue) ? makeSpace(spacingReturnValue) : undefined;
|
|
3353
2764
|
}
|
|
3354
2765
|
|
|
3355
2766
|
// pixel or with unit values
|
|
@@ -3357,25 +2768,25 @@ var getSpacingValue = function getSpacingValue(spacingValue, theme, breakpoint)
|
|
|
3357
2768
|
};
|
|
3358
2769
|
var getColorValue = function getColorValue(color, theme, breakpoint) {
|
|
3359
2770
|
var responsiveBackgroundValue = getResponsiveValue(color, breakpoint);
|
|
3360
|
-
var tokenValue =
|
|
2771
|
+
var tokenValue = getIn(theme, "colors.".concat(responsiveBackgroundValue));
|
|
3361
2772
|
return tokenValue !== null && tokenValue !== void 0 ? tokenValue : responsiveBackgroundValue;
|
|
3362
2773
|
};
|
|
3363
2774
|
var getBorderRadiusValue = function getBorderRadiusValue(borderRadius, theme, breakpoint) {
|
|
3364
2775
|
var responsiveBorderRadiusValue = getResponsiveValue(borderRadius, breakpoint);
|
|
3365
|
-
return
|
|
2776
|
+
return isEmpty$1(responsiveBorderRadiusValue) ? undefined : makeBorderSize(getIn(theme, "border.radius.".concat(responsiveBorderRadiusValue)));
|
|
3366
2777
|
};
|
|
3367
2778
|
var getBorderWidthValue = function getBorderWidthValue(borderWidth, theme, breakpoint) {
|
|
3368
2779
|
var responsiveBorderWidthValue = getResponsiveValue(borderWidth, breakpoint);
|
|
3369
|
-
return
|
|
2780
|
+
return isEmpty$1(responsiveBorderWidthValue) ? undefined : makeBorderSize(getIn(theme, "border.width.".concat(responsiveBorderWidthValue)));
|
|
3370
2781
|
};
|
|
3371
2782
|
var getElevationValue = function getElevationValue(elevation, theme, breakpoint) {
|
|
3372
2783
|
var responsiveElevationValue = getResponsiveValue(elevation, breakpoint);
|
|
3373
|
-
return
|
|
2784
|
+
return isEmpty$1(responsiveElevationValue) ? undefined : getIn(theme, "elevation.".concat(responsiveElevationValue));
|
|
3374
2785
|
};
|
|
3375
2786
|
var getAllProps = function getAllProps(props, breakpoint) {
|
|
3376
2787
|
var _props$paddingTop, _props$paddingBottom, _props$paddingRight, _props$paddingLeft, _props$marginBottom, _props$marginTop, _props$marginRight, _props$marginLeft;
|
|
3377
2788
|
var hasBorder = props.borderBottom || props.borderTop || props.borderLeft || props.borderRight || props.borderBottomColor || props.borderTopColor || props.borderLeftColor || props.borderRightColor || props.borderBottomWidth || props.borderTopWidth || props.borderLeftWidth || props.borderRightWidth || props.borderWidth || props.borderColor;
|
|
3378
|
-
return _objectSpread$
|
|
2789
|
+
return _objectSpread$6c({
|
|
3379
2790
|
display: getResponsiveValue(props.display, breakpoint),
|
|
3380
2791
|
overflow: getResponsiveValue(props.overflow, breakpoint),
|
|
3381
2792
|
overflowX: getResponsiveValue(props.overflowX, breakpoint),
|
|
@@ -3487,7 +2898,7 @@ var getAllMediaQueries = function getAllMediaQueries(props) {
|
|
|
3487
2898
|
return {};
|
|
3488
2899
|
}
|
|
3489
2900
|
breakpoints.base;
|
|
3490
|
-
var breakpointsWithoutBase = _objectWithoutProperties$1(breakpoints, _excluded$
|
|
2901
|
+
var breakpointsWithoutBase = _objectWithoutProperties$1(breakpoints, _excluded$51);
|
|
3491
2902
|
return Object.fromEntries(Object.entries(breakpointsWithoutBase).map(function (_ref) {
|
|
3492
2903
|
var _ref2 = _slicedToArray(_ref, 2),
|
|
3493
2904
|
breakpointKey = _ref2[0],
|
|
@@ -3503,11 +2914,11 @@ var getAllMediaQueries = function getAllMediaQueries(props) {
|
|
|
3503
2914
|
}));
|
|
3504
2915
|
};
|
|
3505
2916
|
var getBaseBoxStyles = function getBaseBoxStyles(props) {
|
|
3506
|
-
return _objectSpread$
|
|
2917
|
+
return _objectSpread$6c(_objectSpread$6c({}, getAllProps(props)), getAllMediaQueries(props));
|
|
3507
2918
|
};
|
|
3508
2919
|
|
|
3509
|
-
function ownKeys$
|
|
3510
|
-
function _objectSpread$
|
|
2920
|
+
function ownKeys$6c(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
2921
|
+
function _objectSpread$6b(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$6c(Object(source), !0).forEach(function (key) { _defineProperty$1(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$6c(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
3511
2922
|
/**
|
|
3512
2923
|
* Reusable hook to be used in BladeProvider.native & BladeProvider.web file
|
|
3513
2924
|
*
|
|
@@ -3526,7 +2937,7 @@ var useBladeProvider = function useBladeProvider(_ref) {
|
|
|
3526
2937
|
matchedDeviceType = _useBreakpoint.matchedDeviceType;
|
|
3527
2938
|
var onColorMode = "on".concat(toTitleCase(colorScheme));
|
|
3528
2939
|
var onDeviceType = "on".concat(toTitleCase(matchedDeviceType));
|
|
3529
|
-
var theme = _objectSpread$
|
|
2940
|
+
var theme = _objectSpread$6b(_objectSpread$6b({}, themeTokens), {}, {
|
|
3530
2941
|
colors: themeTokens.colors[onColorMode],
|
|
3531
2942
|
elevation: themeTokens.elevation[onColorMode],
|
|
3532
2943
|
typography: themeTokens.typography[onDeviceType]
|
|
@@ -3629,9 +3040,9 @@ var BladeProvider = function BladeProvider(_ref) {
|
|
|
3629
3040
|
});
|
|
3630
3041
|
};
|
|
3631
3042
|
|
|
3632
|
-
var _excluded$
|
|
3633
|
-
function ownKeys$
|
|
3634
|
-
function _objectSpread$
|
|
3043
|
+
var _excluded$50 = ["theme", "colorScheme", "children", "className", "id"];
|
|
3044
|
+
function ownKeys$6b(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3045
|
+
function _objectSpread$6a(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$6b(Object(source), !0).forEach(function (key) { _defineProperty$1(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$6b(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
3635
3046
|
var getMemoDependency = function getMemoDependency(props) {
|
|
3636
3047
|
// These are the props that change nothing in the getBaseBoxStyles calculations
|
|
3637
3048
|
var theme = props.theme,
|
|
@@ -3639,7 +3050,7 @@ var getMemoDependency = function getMemoDependency(props) {
|
|
|
3639
3050
|
props.children;
|
|
3640
3051
|
props.className;
|
|
3641
3052
|
props.id;
|
|
3642
|
-
var rest = _objectWithoutProperties$1(props, _excluded$
|
|
3053
|
+
var rest = _objectWithoutProperties$1(props, _excluded$50);
|
|
3643
3054
|
var dependencyPropString = '';
|
|
3644
3055
|
try {
|
|
3645
3056
|
// I know this looks illegal but Dan approves it - https://twitter.com/dan_abramov/status/1104414272753487872?s=20
|
|
@@ -3665,11 +3076,11 @@ var getMemoDependency = function getMemoDependency(props) {
|
|
|
3665
3076
|
var useMemoizedStyles = function useMemoizedStyles(boxProps) {
|
|
3666
3077
|
var _useTheme = useTheme(),
|
|
3667
3078
|
colorScheme = _useTheme.colorScheme;
|
|
3668
|
-
var boxPropsMemoDependency = getMemoDependency(_objectSpread$
|
|
3079
|
+
var boxPropsMemoDependency = getMemoDependency(_objectSpread$6a(_objectSpread$6a({}, boxProps), {}, {
|
|
3669
3080
|
colorScheme: colorScheme
|
|
3670
3081
|
}));
|
|
3671
3082
|
var boxPropsCSSObject = React__default.useMemo(function () {
|
|
3672
|
-
return getBaseBoxStyles(_objectSpread$
|
|
3083
|
+
return getBaseBoxStyles(_objectSpread$6a(_objectSpread$6a({}, boxProps), {}, {
|
|
3673
3084
|
theme: boxProps.theme
|
|
3674
3085
|
}));
|
|
3675
3086
|
},
|
|
@@ -3771,18 +3182,18 @@ var MetaConstants = {
|
|
|
3771
3182
|
Skeleton: 'skeleton'
|
|
3772
3183
|
};
|
|
3773
3184
|
|
|
3774
|
-
function ownKeys$
|
|
3775
|
-
function _objectSpread$
|
|
3185
|
+
function ownKeys$6a(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3186
|
+
function _objectSpread$69(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$6a(Object(source), !0).forEach(function (key) { _defineProperty$1(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$6a(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
3776
3187
|
var metaAttribute = function metaAttribute(_ref) {
|
|
3777
3188
|
var name = _ref.name,
|
|
3778
3189
|
testID = _ref.testID;
|
|
3779
|
-
return _objectSpread$
|
|
3190
|
+
return _objectSpread$69(_objectSpread$69({}, name ? _defineProperty$1({}, "data-".concat(MetaConstants.Component), name) : {}), testID ? _defineProperty$1({}, "data-testid", testID) : {});
|
|
3780
3191
|
};
|
|
3781
3192
|
|
|
3782
|
-
function ownKeys$
|
|
3783
|
-
function _objectSpread$
|
|
3193
|
+
function ownKeys$69(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3194
|
+
function _objectSpread$68(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$69(Object(source), !0).forEach(function (key) { _defineProperty$1(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$69(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
3784
3195
|
var BaseBox = /*#__PURE__*/styled.div.attrs(function (props) {
|
|
3785
|
-
return _objectSpread$
|
|
3196
|
+
return _objectSpread$68({}, metaAttribute({
|
|
3786
3197
|
name: props['data-blade-component'] || MetaConstants.BaseBox,
|
|
3787
3198
|
testID: props['data-testid'] || props.testID
|
|
3788
3199
|
}));
|
|
@@ -3794,14 +3205,14 @@ var BaseBox = /*#__PURE__*/styled.div.attrs(function (props) {
|
|
|
3794
3205
|
return cssObject;
|
|
3795
3206
|
});
|
|
3796
3207
|
|
|
3797
|
-
function ownKeys$
|
|
3798
|
-
function _objectSpread$
|
|
3208
|
+
function ownKeys$68(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3209
|
+
function _objectSpread$67(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$68(Object(source), !0).forEach(function (key) { _defineProperty$1(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$68(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
3799
3210
|
var StyledListBoxWrapper = /*#__PURE__*/styled(BaseBox).withConfig({
|
|
3800
3211
|
displayName: "StyledListBoxWrapperweb__StyledListBoxWrapper",
|
|
3801
3212
|
componentId: "sc-1eo4pr6-0"
|
|
3802
3213
|
})(function (props) {
|
|
3803
3214
|
var _objectSpread2;
|
|
3804
|
-
return _objectSpread$
|
|
3215
|
+
return _objectSpread$67((_objectSpread2 = {}, _defineProperty$1(_objectSpread2, "& [role=group]:last-child > [role=separator]:last-child", {
|
|
3805
3216
|
display: 'none'
|
|
3806
3217
|
}), _defineProperty$1(_objectSpread2, "overflowY", 'auto'), _objectSpread2), getBaseListBoxWrapperStyles({
|
|
3807
3218
|
theme: props.theme,
|
|
@@ -3809,6 +3220,45 @@ var StyledListBoxWrapper = /*#__PURE__*/styled(BaseBox).withConfig({
|
|
|
3809
3220
|
}));
|
|
3810
3221
|
});
|
|
3811
3222
|
|
|
3223
|
+
/* eslint-disable @typescript-eslint/no-empty-function */
|
|
3224
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
3225
|
+
|
|
3226
|
+
var BottomSheetContext = /*#__PURE__*/React__default.createContext({
|
|
3227
|
+
headerHeight: 0,
|
|
3228
|
+
contentHeight: 0,
|
|
3229
|
+
footerHeight: 0,
|
|
3230
|
+
isHeaderFloating: false,
|
|
3231
|
+
setContentHeight: function setContentHeight() {},
|
|
3232
|
+
setHeaderHeight: function setHeaderHeight() {},
|
|
3233
|
+
setFooterHeight: function setFooterHeight() {},
|
|
3234
|
+
setHasBodyPadding: function setHasBodyPadding() {},
|
|
3235
|
+
setIsHeaderEmpty: function setIsHeaderEmpty() {},
|
|
3236
|
+
close: function close() {},
|
|
3237
|
+
scrollRef: null,
|
|
3238
|
+
bind: null,
|
|
3239
|
+
isOpen: false,
|
|
3240
|
+
positionY: 0,
|
|
3241
|
+
isInBottomSheet: false,
|
|
3242
|
+
defaultInitialFocusRef: {
|
|
3243
|
+
current: null
|
|
3244
|
+
}
|
|
3245
|
+
});
|
|
3246
|
+
var useBottomSheetContext = function useBottomSheetContext() {
|
|
3247
|
+
var state = React__default.useContext(BottomSheetContext);
|
|
3248
|
+
return state;
|
|
3249
|
+
};
|
|
3250
|
+
var BottomSheetAndDropdownGlueContext = /*#__PURE__*/React__default.createContext(null);
|
|
3251
|
+
|
|
3252
|
+
/**
|
|
3253
|
+
* This hook provides the bridge between Dropdown And BottomSheet
|
|
3254
|
+
*
|
|
3255
|
+
* You can hover over the return types to get jsdoc and more information about each
|
|
3256
|
+
*/
|
|
3257
|
+
var useBottomSheetAndDropdownGlue = function useBottomSheetAndDropdownGlue() {
|
|
3258
|
+
var state = React__default.useContext(BottomSheetAndDropdownGlueContext);
|
|
3259
|
+
return state;
|
|
3260
|
+
};
|
|
3261
|
+
|
|
3812
3262
|
/**
|
|
3813
3263
|
* Do you want to define `displayName` or `componentId` on your component? Use this instead to make sure treeshaking doesn't break.
|
|
3814
3264
|
*
|
|
@@ -3847,104 +3297,673 @@ var assignWithoutSideEffects = function assignWithoutSideEffects(component, sour
|
|
|
3847
3297
|
return /*#__PURE__*/Object.assign(component, sourceObj);
|
|
3848
3298
|
};
|
|
3849
3299
|
|
|
3850
|
-
function ownKeys$
|
|
3851
|
-
function _objectSpread$
|
|
3852
|
-
var accessibilityValue = {
|
|
3853
|
-
valueMax: 'aria-valuemax',
|
|
3854
|
-
valueMin: 'aria-valuemin',
|
|
3855
|
-
valueNow: 'aria-valuenow',
|
|
3856
|
-
valueText: 'aria-valuetext'
|
|
3857
|
-
};
|
|
3858
|
-
var accessibilityState = {
|
|
3859
|
-
selected: 'aria-selected',
|
|
3860
|
-
disabled: 'aria-disabled',
|
|
3861
|
-
expanded: 'aria-expanded',
|
|
3862
|
-
busy: 'aria-busy',
|
|
3863
|
-
checked: 'aria-checked'
|
|
3864
|
-
};
|
|
3300
|
+
function ownKeys$67(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3301
|
+
function _objectSpread$66(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$67(Object(source), !0).forEach(function (key) { _defineProperty$1(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$67(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
3302
|
+
var accessibilityValue = {
|
|
3303
|
+
valueMax: 'aria-valuemax',
|
|
3304
|
+
valueMin: 'aria-valuemin',
|
|
3305
|
+
valueNow: 'aria-valuenow',
|
|
3306
|
+
valueText: 'aria-valuetext'
|
|
3307
|
+
};
|
|
3308
|
+
var accessibilityState = {
|
|
3309
|
+
selected: 'aria-selected',
|
|
3310
|
+
disabled: 'aria-disabled',
|
|
3311
|
+
expanded: 'aria-expanded',
|
|
3312
|
+
busy: 'aria-busy',
|
|
3313
|
+
checked: 'aria-checked'
|
|
3314
|
+
};
|
|
3315
|
+
|
|
3316
|
+
// TODO:
|
|
3317
|
+
// accessibilityViewIsModal
|
|
3318
|
+
var accessibilityMap = _objectSpread$66(_objectSpread$66(_objectSpread$66({}, accessibilityState), accessibilityValue), {}, {
|
|
3319
|
+
activeDescendant: 'aria-activedescendant',
|
|
3320
|
+
atomic: 'aria-atomic',
|
|
3321
|
+
autoComplete: 'aria-autocomplete',
|
|
3322
|
+
colCount: 'aria-colcount',
|
|
3323
|
+
colIndex: 'aria-colindex',
|
|
3324
|
+
colSpan: 'aria-colspan',
|
|
3325
|
+
controls: 'aria-controls',
|
|
3326
|
+
describedBy: 'aria-describedby',
|
|
3327
|
+
details: 'aria-details',
|
|
3328
|
+
errorMessage: 'aria-errormessage',
|
|
3329
|
+
flowTo: 'aria-flowto',
|
|
3330
|
+
hasPopup: 'aria-haspopup',
|
|
3331
|
+
hidden: 'aria-hidden',
|
|
3332
|
+
invalid: 'aria-invalid',
|
|
3333
|
+
keyShortcuts: 'aria-keyshortcuts',
|
|
3334
|
+
label: 'aria-label',
|
|
3335
|
+
labelledBy: 'aria-labelledby',
|
|
3336
|
+
liveRegion: 'aria-live',
|
|
3337
|
+
modal: 'aria-modal',
|
|
3338
|
+
multiline: 'aria-multiline',
|
|
3339
|
+
multiSelectable: 'aria-multiselectable',
|
|
3340
|
+
orientation: 'aria-orientation',
|
|
3341
|
+
owns: 'aria-owns',
|
|
3342
|
+
placeholder: 'aria-placeholder',
|
|
3343
|
+
posInSet: 'aria-posinset',
|
|
3344
|
+
pressed: 'aria-pressed',
|
|
3345
|
+
readOnly: 'aria-readonly',
|
|
3346
|
+
required: 'aria-required',
|
|
3347
|
+
role: 'role',
|
|
3348
|
+
roleDescription: 'aria-roledescription',
|
|
3349
|
+
rowCount: 'aria-rowcount',
|
|
3350
|
+
rowIndex: 'aria-rowindex',
|
|
3351
|
+
rowSpan: 'aria-rowspan',
|
|
3352
|
+
setSize: 'aria-setsize',
|
|
3353
|
+
sort: 'aria-sort',
|
|
3354
|
+
current: 'aria-current',
|
|
3355
|
+
dropEffect: 'aria-dropeffect',
|
|
3356
|
+
grabbed: 'aria-grabbed',
|
|
3357
|
+
level: 'aria-level',
|
|
3358
|
+
relevant: 'aria-relevant'
|
|
3359
|
+
});
|
|
3360
|
+
|
|
3361
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
3362
|
+
var makeAccessible = function makeAccessible(props) {
|
|
3363
|
+
var newProps = {};
|
|
3364
|
+
|
|
3365
|
+
// eslint-disable-next-line guard-for-in
|
|
3366
|
+
for (var key in props) {
|
|
3367
|
+
var propKey = key;
|
|
3368
|
+
var propValue = props[propKey];
|
|
3369
|
+
var accessibilityAttribute = accessibilityMap[propKey];
|
|
3370
|
+
if (accessibilityAttribute) {
|
|
3371
|
+
newProps[accessibilityAttribute] = propValue;
|
|
3372
|
+
}
|
|
3373
|
+
}
|
|
3374
|
+
return newProps;
|
|
3375
|
+
};
|
|
3376
|
+
|
|
3377
|
+
function ownKeys$66(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3378
|
+
function _objectSpread$65(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$66(Object(source), !0).forEach(function (key) { _defineProperty$1(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$66(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
3379
|
+
var _ActionListBox = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
|
|
3380
|
+
var childrenWithId = _ref.childrenWithId,
|
|
3381
|
+
actionListItemWrapperRole = _ref.actionListItemWrapperRole,
|
|
3382
|
+
isMultiSelectable = _ref.isMultiSelectable;
|
|
3383
|
+
var _useBottomSheetContex = useBottomSheetContext(),
|
|
3384
|
+
isInBottomSheet = _useBottomSheetContex.isInBottomSheet;
|
|
3385
|
+
return /*#__PURE__*/jsx(StyledListBoxWrapper, _objectSpread$65(_objectSpread$65({
|
|
3386
|
+
isInBottomSheet: isInBottomSheet,
|
|
3387
|
+
ref: ref
|
|
3388
|
+
}, makeAccessible({
|
|
3389
|
+
role: actionListItemWrapperRole,
|
|
3390
|
+
multiSelectable: actionListItemWrapperRole === 'listbox' ? isMultiSelectable : undefined
|
|
3391
|
+
})), {}, {
|
|
3392
|
+
children: childrenWithId
|
|
3393
|
+
}));
|
|
3394
|
+
});
|
|
3395
|
+
var ActionListBox = /*#__PURE__*/assignWithoutSideEffects(_ActionListBox, {
|
|
3396
|
+
displayName: 'ActionListBox'
|
|
3397
|
+
});
|
|
3398
|
+
|
|
3399
|
+
/*
|
|
3400
|
+
* This content is licensed according to the W3C Software License at
|
|
3401
|
+
* https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
|
|
3402
|
+
*
|
|
3403
|
+
* This software or document includes material copied from or derived from
|
|
3404
|
+
* https://www.w3.org/WAI/ARIA/apg/example-index/combobox/combobox-select-only.html.
|
|
3405
|
+
* Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang)
|
|
3406
|
+
*/
|
|
3407
|
+
|
|
3408
|
+
var componentIds = {
|
|
3409
|
+
DropdownOverlay: 'DropdownOverlay',
|
|
3410
|
+
Dropdown: 'Dropdown',
|
|
3411
|
+
triggers: {
|
|
3412
|
+
SelectInput: 'SelectInput',
|
|
3413
|
+
DropdownButton: 'DropdownButton',
|
|
3414
|
+
DropdownLink: 'DropdownLink'
|
|
3415
|
+
}
|
|
3416
|
+
};
|
|
3417
|
+
|
|
3418
|
+
// Save a list of named combobox actions, for future readability
|
|
3419
|
+
var SelectActions = {
|
|
3420
|
+
Close: 'Close',
|
|
3421
|
+
CloseSelect: 'CloseSelect',
|
|
3422
|
+
First: 'First',
|
|
3423
|
+
Last: 'Last',
|
|
3424
|
+
Next: 'Next',
|
|
3425
|
+
Open: 'Open',
|
|
3426
|
+
PageDown: 'PageDown',
|
|
3427
|
+
PageUp: 'PageUp',
|
|
3428
|
+
Previous: 'Previous',
|
|
3429
|
+
Select: 'Select',
|
|
3430
|
+
Type: 'Type'
|
|
3431
|
+
};
|
|
3432
|
+
|
|
3433
|
+
/**
|
|
3434
|
+
* Filter an array of options against an input string
|
|
3435
|
+
* returns an array of options that begin with the filter string, case-independent
|
|
3436
|
+
*
|
|
3437
|
+
*/
|
|
3438
|
+
function filterOptions() {
|
|
3439
|
+
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
3440
|
+
var filter = arguments.length > 1 ? arguments[1] : undefined;
|
|
3441
|
+
var exclude = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
|
|
3442
|
+
return options.filter(function (option) {
|
|
3443
|
+
var matches = option.toLowerCase().startsWith(filter.toLowerCase());
|
|
3444
|
+
return matches && !exclude.includes(option);
|
|
3445
|
+
});
|
|
3446
|
+
}
|
|
3447
|
+
|
|
3448
|
+
/**
|
|
3449
|
+
* Map a keypress to action
|
|
3450
|
+
*/
|
|
3451
|
+
function getActionFromKey(e, isOpen) {
|
|
3452
|
+
if (!e) {
|
|
3453
|
+
return undefined;
|
|
3454
|
+
}
|
|
3455
|
+
var altKey = e.altKey,
|
|
3456
|
+
ctrlKey = e.ctrlKey,
|
|
3457
|
+
metaKey = e.metaKey;
|
|
3458
|
+
var key = '';
|
|
3459
|
+
if ('key' in e) {
|
|
3460
|
+
key = e.key;
|
|
3461
|
+
}
|
|
3462
|
+
var openKeys = ['ArrowDown', 'ArrowUp', 'Enter', ' ']; // all keys that will do the default open action
|
|
3463
|
+
if (!key) return undefined;
|
|
3464
|
+
// handle opening when closed
|
|
3465
|
+
if (!isOpen && key && openKeys.includes(key)) {
|
|
3466
|
+
return SelectActions.Open;
|
|
3467
|
+
}
|
|
3468
|
+
|
|
3469
|
+
// home and end move the selected option when open or closed
|
|
3470
|
+
if (key === 'Home') {
|
|
3471
|
+
return SelectActions.First;
|
|
3472
|
+
}
|
|
3473
|
+
if (key === 'End') {
|
|
3474
|
+
return SelectActions.Last;
|
|
3475
|
+
}
|
|
3476
|
+
|
|
3477
|
+
// handle typing characters when open or closed
|
|
3478
|
+
if (key === 'Backspace' || key === 'Clear' || key.length === 1 && key !== ' ' && !altKey && !ctrlKey && !metaKey) {
|
|
3479
|
+
return SelectActions.Type;
|
|
3480
|
+
}
|
|
3481
|
+
|
|
3482
|
+
// handle keys when open
|
|
3483
|
+
if (isOpen) {
|
|
3484
|
+
if (key === 'ArrowUp' && altKey) {
|
|
3485
|
+
return SelectActions.CloseSelect;
|
|
3486
|
+
} else if (key === 'ArrowDown' && !altKey) {
|
|
3487
|
+
return SelectActions.Next;
|
|
3488
|
+
} else if (key === 'ArrowUp') {
|
|
3489
|
+
return SelectActions.Previous;
|
|
3490
|
+
} else if (key === 'PageUp') {
|
|
3491
|
+
return SelectActions.PageUp;
|
|
3492
|
+
} else if (key === 'PageDown') {
|
|
3493
|
+
return SelectActions.PageDown;
|
|
3494
|
+
} else if (key === 'Escape') {
|
|
3495
|
+
return SelectActions.Close;
|
|
3496
|
+
} else if (key === 'Enter' || key === ' ') {
|
|
3497
|
+
return SelectActions.CloseSelect;
|
|
3498
|
+
}
|
|
3499
|
+
}
|
|
3500
|
+
return undefined;
|
|
3501
|
+
}
|
|
3502
|
+
|
|
3503
|
+
/**
|
|
3504
|
+
* Return the index of an option from an array of options, based on a search string
|
|
3505
|
+
*
|
|
3506
|
+
* if the filter is multiple iterations of the same letter (e.g "aaa"), then cycle through first-letter matches
|
|
3507
|
+
**/
|
|
3508
|
+
function getIndexByLetter(options, filter) {
|
|
3509
|
+
var startIndex = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
3510
|
+
var orderedOptions = [].concat(_toConsumableArray$1(options.slice(startIndex)), _toConsumableArray$1(options.slice(0, startIndex)));
|
|
3511
|
+
var firstMatch = filterOptions(orderedOptions, filter)[0];
|
|
3512
|
+
var allSameLetter = function allSameLetter(array) {
|
|
3513
|
+
return array.every(function (letter) {
|
|
3514
|
+
return letter === array[0];
|
|
3515
|
+
});
|
|
3516
|
+
};
|
|
3517
|
+
|
|
3518
|
+
// first check if there is an exact match for the typed string
|
|
3519
|
+
if (firstMatch) {
|
|
3520
|
+
return options.indexOf(firstMatch);
|
|
3521
|
+
}
|
|
3522
|
+
|
|
3523
|
+
// if the same letter is being repeated, cycle through first-letter matches
|
|
3524
|
+
else if (allSameLetter(filter.split(''))) {
|
|
3525
|
+
var matches = filterOptions(orderedOptions, filter[0]);
|
|
3526
|
+
return options.indexOf(matches[0]);
|
|
3527
|
+
}
|
|
3528
|
+
|
|
3529
|
+
// if no matches, return -1
|
|
3530
|
+
else {
|
|
3531
|
+
return -1;
|
|
3532
|
+
}
|
|
3533
|
+
}
|
|
3534
|
+
|
|
3535
|
+
/**
|
|
3536
|
+
* This functions makes sure the optionsIndex is not going out of possible options
|
|
3537
|
+
*/
|
|
3538
|
+
function getUpdatedIndex(currentIndex, maxIndex, action) {
|
|
3539
|
+
// On PageUP or PageDown, we jump focus by 10 items or to the first or last element
|
|
3540
|
+
// Details: https://www.w3.org/WAI/ARIA/apg/example-index/combobox/combobox-select-only.html#:~:text=PageUp,to%20last%20option).
|
|
3541
|
+
var pageSize = 10;
|
|
3542
|
+
switch (action) {
|
|
3543
|
+
case SelectActions.First:
|
|
3544
|
+
return 0;
|
|
3545
|
+
case SelectActions.Last:
|
|
3546
|
+
return maxIndex;
|
|
3547
|
+
case SelectActions.Previous:
|
|
3548
|
+
return Math.max(0, currentIndex - 1);
|
|
3549
|
+
case SelectActions.Next:
|
|
3550
|
+
return Math.min(maxIndex, currentIndex + 1);
|
|
3551
|
+
case SelectActions.PageUp:
|
|
3552
|
+
return Math.max(0, currentIndex - pageSize);
|
|
3553
|
+
case SelectActions.PageDown:
|
|
3554
|
+
return Math.min(maxIndex, currentIndex + pageSize);
|
|
3555
|
+
default:
|
|
3556
|
+
return currentIndex;
|
|
3557
|
+
}
|
|
3558
|
+
}
|
|
3559
|
+
|
|
3560
|
+
/**
|
|
3561
|
+
* Checks if the given HTML element is visible on screen
|
|
3562
|
+
*/
|
|
3563
|
+
function isElementVisibleOnScreen(element) {
|
|
3564
|
+
var bounding = element.getBoundingClientRect();
|
|
3565
|
+
return bounding.top >= 0 && bounding.left >= 0 && bounding.bottom <= (window.innerHeight || document.documentElement.clientHeight) && bounding.right <= (window.innerWidth || document.documentElement.clientWidth);
|
|
3566
|
+
}
|
|
3567
|
+
|
|
3568
|
+
/**
|
|
3569
|
+
* Checks if the dropdown is scrollable
|
|
3570
|
+
*/
|
|
3571
|
+
function isScrollable(element) {
|
|
3572
|
+
return element && element.clientHeight < element.scrollHeight;
|
|
3573
|
+
}
|
|
3574
|
+
/**
|
|
3575
|
+
* Performs the action when actionType is passed
|
|
3576
|
+
*
|
|
3577
|
+
* This function handles all the keydown actions.
|
|
3578
|
+
*/
|
|
3579
|
+
var performAction = function performAction(action, payload, actions) {
|
|
3580
|
+
var event = payload.event;
|
|
3581
|
+
switch (action) {
|
|
3582
|
+
case SelectActions.Last:
|
|
3583
|
+
// @ts-expect-error: intentional fallthrough, ignoring the warning
|
|
3584
|
+
case SelectActions.First:
|
|
3585
|
+
actions.setIsOpen(true);
|
|
3586
|
+
// intentional fallthrough
|
|
3587
|
+
case SelectActions.Next:
|
|
3588
|
+
case SelectActions.Previous:
|
|
3589
|
+
case SelectActions.PageUp:
|
|
3590
|
+
case SelectActions.PageDown:
|
|
3591
|
+
event.preventDefault();
|
|
3592
|
+
actions.onOptionChange(action);
|
|
3593
|
+
return true;
|
|
3594
|
+
case SelectActions.CloseSelect:
|
|
3595
|
+
event.preventDefault();
|
|
3596
|
+
actions.selectCurrentOption();
|
|
3597
|
+
return true;
|
|
3598
|
+
case SelectActions.Close:
|
|
3599
|
+
event.preventDefault();
|
|
3600
|
+
actions.close();
|
|
3601
|
+
return true;
|
|
3602
|
+
case SelectActions.Type:
|
|
3603
|
+
actions.onComboType(event.key, action);
|
|
3604
|
+
return true;
|
|
3605
|
+
case SelectActions.Open:
|
|
3606
|
+
event.preventDefault();
|
|
3607
|
+
actions.setIsOpen(true);
|
|
3608
|
+
return true;
|
|
3609
|
+
}
|
|
3610
|
+
return false;
|
|
3611
|
+
};
|
|
3612
|
+
|
|
3613
|
+
/**
|
|
3614
|
+
* When options list is large, it can have a scrollbar.
|
|
3615
|
+
*
|
|
3616
|
+
* This function ensures the active option is always in the viewport
|
|
3617
|
+
*/
|
|
3618
|
+
var ensureScrollVisiblity = function ensureScrollVisiblity(newActiveIndex, containerElement, options) {
|
|
3619
|
+
// ensure the new option is in view
|
|
3620
|
+
if (containerElement) {
|
|
3621
|
+
if (isScrollable(containerElement)) {
|
|
3622
|
+
var optionEl = containerElement.querySelectorAll('[role="option"]');
|
|
3623
|
+
// Making sure its the same element as the one from options state
|
|
3624
|
+
if (newActiveIndex >= 0 && optionEl[newActiveIndex].dataset.value === options[newActiveIndex]) {
|
|
3625
|
+
var activeElement = optionEl[newActiveIndex];
|
|
3626
|
+
var bodyRect = containerElement.getBoundingClientRect().top;
|
|
3627
|
+
var elementRect = activeElement.getBoundingClientRect().top;
|
|
3628
|
+
var elementPosition = elementRect - bodyRect;
|
|
3629
|
+
var offsetPosition = elementPosition;
|
|
3630
|
+
containerElement.scrollTo({
|
|
3631
|
+
top: offsetPosition
|
|
3632
|
+
});
|
|
3633
|
+
if (!isElementVisibleOnScreen(optionEl[newActiveIndex])) {
|
|
3634
|
+
activeElement.scrollIntoView({
|
|
3635
|
+
behavior: 'smooth'
|
|
3636
|
+
});
|
|
3637
|
+
}
|
|
3638
|
+
}
|
|
3639
|
+
}
|
|
3640
|
+
}
|
|
3641
|
+
};
|
|
3642
|
+
|
|
3643
|
+
/**
|
|
3644
|
+
* value that is set in the actual form input
|
|
3645
|
+
*/
|
|
3646
|
+
var makeInputValue = function makeInputValue(selectedIndices, options) {
|
|
3647
|
+
if (options.length === 0) {
|
|
3648
|
+
return '';
|
|
3649
|
+
}
|
|
3650
|
+
return selectedIndices.map(function (selectedIndex) {
|
|
3651
|
+
var _options$selectedInde;
|
|
3652
|
+
return (_options$selectedInde = options[selectedIndex]) === null || _options$selectedInde === void 0 ? void 0 : _options$selectedInde.value;
|
|
3653
|
+
}).join(', ');
|
|
3654
|
+
};
|
|
3655
|
+
|
|
3656
|
+
/**
|
|
3657
|
+
* Value that is displayed inside the select field
|
|
3658
|
+
*/
|
|
3659
|
+
var makeInputDisplayValue = function makeInputDisplayValue(selectedIndices, options) {
|
|
3660
|
+
// When no item is selected or no item is present
|
|
3661
|
+
if (options.length === 0 || selectedIndices.length === 0) {
|
|
3662
|
+
return '';
|
|
3663
|
+
}
|
|
3664
|
+
|
|
3665
|
+
// When one item is selected, we display that item's title in input
|
|
3666
|
+
if (selectedIndices.length === 1) {
|
|
3667
|
+
return options[selectedIndices[0]].title;
|
|
3668
|
+
}
|
|
3669
|
+
|
|
3670
|
+
// When more than one item is selected, we display the count of items
|
|
3671
|
+
return "".concat(selectedIndices.length, " items selected");
|
|
3672
|
+
};
|
|
3673
|
+
|
|
3674
|
+
var _excluded$4$ = ["isOpen", "setIsOpen", "close", "selectedIndices", "setSelectedIndices", "activeIndex", "setActiveIndex", "shouldIgnoreBlur", "setShouldIgnoreBlur", "isKeydownPressed", "setIsKeydownPressed", "options", "selectionType", "changeCallbackTriggerer", "setChangeCallbackTriggerer", "isControlled", "setControlledValueIndices"];
|
|
3675
|
+
function ownKeys$65(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3676
|
+
function _objectSpread$64(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$65(Object(source), !0).forEach(function (key) { _defineProperty$1(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$65(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
3677
|
+
|
|
3678
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
3679
|
+
var noop$1 = function noop() {};
|
|
3680
|
+
var DropdownContext = /*#__PURE__*/React__default.createContext({
|
|
3681
|
+
isOpen: false,
|
|
3682
|
+
setIsOpen: noop$1,
|
|
3683
|
+
close: noop$1,
|
|
3684
|
+
selectedIndices: [],
|
|
3685
|
+
setSelectedIndices: noop$1,
|
|
3686
|
+
controlledValueIndices: [],
|
|
3687
|
+
setControlledValueIndices: noop$1,
|
|
3688
|
+
options: [],
|
|
3689
|
+
setOptions: noop$1,
|
|
3690
|
+
activeIndex: -1,
|
|
3691
|
+
setActiveIndex: noop$1,
|
|
3692
|
+
shouldIgnoreBlur: false,
|
|
3693
|
+
setShouldIgnoreBlur: noop$1,
|
|
3694
|
+
shouldIgnoreBlurAnimation: false,
|
|
3695
|
+
setShouldIgnoreBlurAnimation: noop$1,
|
|
3696
|
+
hasFooterAction: false,
|
|
3697
|
+
setHasFooterAction: noop$1,
|
|
3698
|
+
hasLabelOnLeft: false,
|
|
3699
|
+
setHasLabelOnLeft: noop$1,
|
|
3700
|
+
isKeydownPressed: false,
|
|
3701
|
+
setIsKeydownPressed: noop$1,
|
|
3702
|
+
changeCallbackTriggerer: 0,
|
|
3703
|
+
setChangeCallbackTriggerer: noop$1,
|
|
3704
|
+
isControlled: false,
|
|
3705
|
+
setIsControlled: noop$1,
|
|
3706
|
+
dropdownBaseId: '',
|
|
3707
|
+
actionListItemRef: {
|
|
3708
|
+
current: null
|
|
3709
|
+
},
|
|
3710
|
+
triggererRef: {
|
|
3711
|
+
current: null
|
|
3712
|
+
},
|
|
3713
|
+
triggererWrapperRef: {
|
|
3714
|
+
current: null
|
|
3715
|
+
}
|
|
3716
|
+
});
|
|
3717
|
+
var searchTimeout;
|
|
3718
|
+
var searchString = '';
|
|
3719
|
+
/**
|
|
3720
|
+
* Handles almost all the functionality of dropdown.
|
|
3721
|
+
*
|
|
3722
|
+
* Returns the values from DropdownContext along with some helper functions and event handlers
|
|
3723
|
+
*
|
|
3724
|
+
*/
|
|
3725
|
+
var useDropdown = function useDropdown() {
|
|
3726
|
+
var _React$useContext = React__default.useContext(DropdownContext),
|
|
3727
|
+
isOpen = _React$useContext.isOpen,
|
|
3728
|
+
setIsOpen = _React$useContext.setIsOpen,
|
|
3729
|
+
close = _React$useContext.close,
|
|
3730
|
+
selectedIndices = _React$useContext.selectedIndices,
|
|
3731
|
+
setSelectedIndices = _React$useContext.setSelectedIndices,
|
|
3732
|
+
activeIndex = _React$useContext.activeIndex,
|
|
3733
|
+
setActiveIndex = _React$useContext.setActiveIndex,
|
|
3734
|
+
shouldIgnoreBlur = _React$useContext.shouldIgnoreBlur,
|
|
3735
|
+
setShouldIgnoreBlur = _React$useContext.setShouldIgnoreBlur,
|
|
3736
|
+
isKeydownPressed = _React$useContext.isKeydownPressed,
|
|
3737
|
+
setIsKeydownPressed = _React$useContext.setIsKeydownPressed,
|
|
3738
|
+
options = _React$useContext.options,
|
|
3739
|
+
selectionType = _React$useContext.selectionType,
|
|
3740
|
+
changeCallbackTriggerer = _React$useContext.changeCallbackTriggerer,
|
|
3741
|
+
setChangeCallbackTriggerer = _React$useContext.setChangeCallbackTriggerer,
|
|
3742
|
+
isControlled = _React$useContext.isControlled,
|
|
3743
|
+
setControlledValueIndices = _React$useContext.setControlledValueIndices,
|
|
3744
|
+
rest = _objectWithoutProperties$1(_React$useContext, _excluded$4$);
|
|
3745
|
+
var bottomSheetAndDropdownGlue = useBottomSheetAndDropdownGlue();
|
|
3746
|
+
var setIndices = function setIndices(indices) {
|
|
3747
|
+
if (isControlled) {
|
|
3748
|
+
setControlledValueIndices(indices);
|
|
3749
|
+
} else {
|
|
3750
|
+
setSelectedIndices(indices);
|
|
3751
|
+
}
|
|
3752
|
+
};
|
|
3753
|
+
/**
|
|
3754
|
+
* Marks the given index as selected.
|
|
3755
|
+
*
|
|
3756
|
+
* In single select, it also closes the menu.
|
|
3757
|
+
* In multiselect, it keeps the menu open for more selections
|
|
3758
|
+
*/
|
|
3759
|
+
var selectOption = function selectOption(index) {
|
|
3760
|
+
var properties = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
|
|
3761
|
+
closeOnSelection: true
|
|
3762
|
+
};
|
|
3763
|
+
var isSelected = false;
|
|
3764
|
+
if (index < 0 || index > options.length - 1) {
|
|
3765
|
+
return isSelected;
|
|
3766
|
+
}
|
|
3767
|
+
if (selectionType === 'multiple') {
|
|
3768
|
+
if (selectedIndices.includes(index)) {
|
|
3769
|
+
// remove existing item
|
|
3770
|
+
var existingItemIndex = selectedIndices.indexOf(index);
|
|
3771
|
+
setIndices([].concat(_toConsumableArray$1(selectedIndices.slice(0, existingItemIndex)), _toConsumableArray$1(selectedIndices.slice(existingItemIndex + 1))));
|
|
3772
|
+
isSelected = false;
|
|
3773
|
+
} else {
|
|
3774
|
+
setIndices([].concat(_toConsumableArray$1(selectedIndices), [index]));
|
|
3775
|
+
isSelected = true;
|
|
3776
|
+
}
|
|
3777
|
+
} else {
|
|
3778
|
+
setIndices([index]);
|
|
3779
|
+
isSelected = true;
|
|
3780
|
+
}
|
|
3781
|
+
|
|
3782
|
+
// Triggers `onChange` on SelectInput
|
|
3783
|
+
setChangeCallbackTriggerer(changeCallbackTriggerer + 1);
|
|
3784
|
+
if (activeIndex !== index) {
|
|
3785
|
+
setActiveIndex(index);
|
|
3786
|
+
}
|
|
3787
|
+
if (properties !== null && properties !== void 0 && properties.closeOnSelection && selectionType !== 'multiple') {
|
|
3788
|
+
close();
|
|
3789
|
+
}
|
|
3790
|
+
return isSelected;
|
|
3791
|
+
};
|
|
3792
|
+
|
|
3793
|
+
/**
|
|
3794
|
+
* Click listener for combobox (or any triggerer of the dropdown)
|
|
3795
|
+
*/
|
|
3796
|
+
var onTriggerClick = function onTriggerClick() {
|
|
3797
|
+
if (isOpen) {
|
|
3798
|
+
close();
|
|
3799
|
+
} else {
|
|
3800
|
+
setIsOpen(true);
|
|
3801
|
+
}
|
|
3802
|
+
};
|
|
3803
|
+
|
|
3804
|
+
/**
|
|
3805
|
+
* Blur handler on combobox. Also handles the selection logic when user moves focus
|
|
3806
|
+
*/
|
|
3807
|
+
var onTriggerBlur = function onTriggerBlur(_ref) {
|
|
3808
|
+
var name = _ref.name,
|
|
3809
|
+
value = _ref.value,
|
|
3810
|
+
onBlurCallback = _ref.onBlurCallback;
|
|
3811
|
+
if (rest.hasFooterAction) {
|
|
3812
|
+
// When Footer has action buttons, we ignore the blur (by setting shouldIgnoreBlur to true in onTriggerKeyDown)
|
|
3813
|
+
// And we remove the active item (by setting it to -1) so that we can shift focus on action buttons
|
|
3814
|
+
setActiveIndex(-1);
|
|
3815
|
+
}
|
|
3816
|
+
if (bottomSheetAndDropdownGlue !== null && bottomSheetAndDropdownGlue !== void 0 && bottomSheetAndDropdownGlue.dropdownHasBottomSheet) {
|
|
3817
|
+
setShouldIgnoreBlur(true);
|
|
3818
|
+
return;
|
|
3819
|
+
}
|
|
3820
|
+
if (shouldIgnoreBlur) {
|
|
3821
|
+
setShouldIgnoreBlur(false);
|
|
3822
|
+
return;
|
|
3823
|
+
}
|
|
3824
|
+
onBlurCallback === null || onBlurCallback === void 0 ? void 0 : onBlurCallback({
|
|
3825
|
+
name: name,
|
|
3826
|
+
value: value
|
|
3827
|
+
});
|
|
3828
|
+
if (isOpen) {
|
|
3829
|
+
if (selectionType !== 'multiple') {
|
|
3830
|
+
selectOption(activeIndex);
|
|
3831
|
+
}
|
|
3832
|
+
if (!(bottomSheetAndDropdownGlue !== null && bottomSheetAndDropdownGlue !== void 0 && bottomSheetAndDropdownGlue.dropdownHasBottomSheet)) {
|
|
3833
|
+
close();
|
|
3834
|
+
}
|
|
3835
|
+
}
|
|
3836
|
+
};
|
|
3837
|
+
|
|
3838
|
+
/**
|
|
3839
|
+
* Function that we call when we want to move focus from one option to other
|
|
3840
|
+
*/
|
|
3841
|
+
var onOptionChange = function onOptionChange(actionType, index) {
|
|
3842
|
+
var max = options.length - 1;
|
|
3843
|
+
var newIndex = index !== null && index !== void 0 ? index : activeIndex;
|
|
3844
|
+
setActiveIndex(getUpdatedIndex(newIndex, max, actionType));
|
|
3845
|
+
var optionValues = options.map(function (option) {
|
|
3846
|
+
return option.value;
|
|
3847
|
+
});
|
|
3848
|
+
ensureScrollVisiblity(newIndex, rest.actionListItemRef.current, optionValues);
|
|
3849
|
+
};
|
|
3865
3850
|
|
|
3866
|
-
|
|
3867
|
-
|
|
3868
|
-
|
|
3869
|
-
|
|
3870
|
-
|
|
3871
|
-
|
|
3872
|
-
|
|
3873
|
-
|
|
3874
|
-
|
|
3875
|
-
|
|
3876
|
-
|
|
3877
|
-
|
|
3878
|
-
|
|
3879
|
-
|
|
3880
|
-
|
|
3881
|
-
|
|
3882
|
-
|
|
3883
|
-
|
|
3884
|
-
|
|
3885
|
-
labelledBy: 'aria-labelledby',
|
|
3886
|
-
liveRegion: 'aria-live',
|
|
3887
|
-
modal: 'aria-modal',
|
|
3888
|
-
multiline: 'aria-multiline',
|
|
3889
|
-
multiSelectable: 'aria-multiselectable',
|
|
3890
|
-
orientation: 'aria-orientation',
|
|
3891
|
-
owns: 'aria-owns',
|
|
3892
|
-
placeholder: 'aria-placeholder',
|
|
3893
|
-
posInSet: 'aria-posinset',
|
|
3894
|
-
pressed: 'aria-pressed',
|
|
3895
|
-
readOnly: 'aria-readonly',
|
|
3896
|
-
required: 'aria-required',
|
|
3897
|
-
role: 'role',
|
|
3898
|
-
roleDescription: 'aria-roledescription',
|
|
3899
|
-
rowCount: 'aria-rowcount',
|
|
3900
|
-
rowIndex: 'aria-rowindex',
|
|
3901
|
-
rowSpan: 'aria-rowspan',
|
|
3902
|
-
setSize: 'aria-setsize',
|
|
3903
|
-
sort: 'aria-sort',
|
|
3904
|
-
current: 'aria-current',
|
|
3905
|
-
dropEffect: 'aria-dropeffect',
|
|
3906
|
-
grabbed: 'aria-grabbed',
|
|
3907
|
-
level: 'aria-level',
|
|
3908
|
-
relevant: 'aria-relevant'
|
|
3909
|
-
});
|
|
3851
|
+
/**
|
|
3852
|
+
* Click handler when user clicks on any particular option.
|
|
3853
|
+
*
|
|
3854
|
+
* It
|
|
3855
|
+
* - changes the option focus
|
|
3856
|
+
* - selects that option
|
|
3857
|
+
* - moves focus to combobox
|
|
3858
|
+
*/
|
|
3859
|
+
var onOptionClick = function onOptionClick(e, index) {
|
|
3860
|
+
var actionType = getActionFromKey(e, isOpen);
|
|
3861
|
+
if (typeof actionType === 'number') {
|
|
3862
|
+
onOptionChange(actionType, index);
|
|
3863
|
+
}
|
|
3864
|
+
selectOption(index);
|
|
3865
|
+
if (!isReactNative$4()) {
|
|
3866
|
+
var _rest$triggererRef$cu;
|
|
3867
|
+
(_rest$triggererRef$cu = rest.triggererRef.current) === null || _rest$triggererRef$cu === void 0 ? void 0 : _rest$triggererRef$cu.focus();
|
|
3868
|
+
}
|
|
3869
|
+
};
|
|
3910
3870
|
|
|
3911
|
-
|
|
3912
|
-
|
|
3913
|
-
|
|
3871
|
+
/**
|
|
3872
|
+
* Function we call to handle the typeahead.
|
|
3873
|
+
*
|
|
3874
|
+
* It takes a letter, stores that letter in searchString (and clears it after timeout) to maintain a word
|
|
3875
|
+
*
|
|
3876
|
+
* Then searches for that word in options and moves focus there.
|
|
3877
|
+
*/
|
|
3878
|
+
var onComboType = function onComboType(letter, actionType) {
|
|
3879
|
+
// open the listbox if it is closed
|
|
3880
|
+
setIsOpen(true);
|
|
3881
|
+
if (typeof searchTimeout === 'number') {
|
|
3882
|
+
window.clearTimeout(searchTimeout);
|
|
3883
|
+
}
|
|
3884
|
+
searchTimeout = window.setTimeout(function () {
|
|
3885
|
+
searchString = '';
|
|
3886
|
+
}, 500);
|
|
3887
|
+
// eslint-disable-next-line @typescript-eslint/restrict-plus-operands
|
|
3888
|
+
searchString = searchString + letter;
|
|
3889
|
+
var optionTitles = options.map(function (option) {
|
|
3890
|
+
return option.title;
|
|
3891
|
+
});
|
|
3892
|
+
var searchIndex = getIndexByLetter(optionTitles, searchString, activeIndex + 1);
|
|
3914
3893
|
|
|
3915
|
-
|
|
3916
|
-
|
|
3917
|
-
|
|
3918
|
-
var propValue = props[propKey];
|
|
3919
|
-
var accessibilityAttribute = accessibilityMap[propKey];
|
|
3920
|
-
if (accessibilityAttribute) {
|
|
3921
|
-
newProps[accessibilityAttribute] = propValue;
|
|
3894
|
+
// if a match was found, go to it
|
|
3895
|
+
if (searchIndex >= 0) {
|
|
3896
|
+
onOptionChange(actionType, searchIndex);
|
|
3922
3897
|
}
|
|
3923
|
-
|
|
3924
|
-
|
|
3925
|
-
|
|
3898
|
+
// if no matches, clear the timeout and search string
|
|
3899
|
+
else {
|
|
3900
|
+
window.clearTimeout(searchTimeout);
|
|
3901
|
+
searchString = '';
|
|
3902
|
+
}
|
|
3903
|
+
};
|
|
3926
3904
|
|
|
3927
|
-
|
|
3928
|
-
|
|
3929
|
-
|
|
3930
|
-
var
|
|
3931
|
-
|
|
3932
|
-
|
|
3933
|
-
|
|
3934
|
-
|
|
3935
|
-
|
|
3936
|
-
|
|
3937
|
-
|
|
3938
|
-
|
|
3939
|
-
|
|
3940
|
-
|
|
3941
|
-
|
|
3942
|
-
|
|
3943
|
-
|
|
3944
|
-
|
|
3945
|
-
|
|
3946
|
-
|
|
3947
|
-
|
|
3905
|
+
/**
|
|
3906
|
+
* Keydown event of combobox. Handles most of the keyboard accessibility of dropdown
|
|
3907
|
+
*/
|
|
3908
|
+
var onTriggerKeydown = function onTriggerKeydown(e) {
|
|
3909
|
+
if (e.event.key === 'Tab' && rest.hasFooterAction) {
|
|
3910
|
+
// When footer has Action Buttons, we ignore the blur event so that we can move focus to action item than bluring out of dropdown
|
|
3911
|
+
setShouldIgnoreBlur(true);
|
|
3912
|
+
}
|
|
3913
|
+
|
|
3914
|
+
// disable closing the select on blur events if we are using a bottomsheet
|
|
3915
|
+
if (bottomSheetAndDropdownGlue !== null && bottomSheetAndDropdownGlue !== void 0 && bottomSheetAndDropdownGlue.dropdownHasBottomSheet) {
|
|
3916
|
+
setShouldIgnoreBlur(true);
|
|
3917
|
+
}
|
|
3918
|
+
if (!isKeydownPressed && ![' ', 'Enter', 'Escape', 'Meta'].includes(e.event.key)) {
|
|
3919
|
+
// When keydown is not already pressed and its not Enter, Space, Command, or Escape key (those are generic keys and we only want to handle arrow keys or home buttons etc)
|
|
3920
|
+
setIsKeydownPressed(true);
|
|
3921
|
+
}
|
|
3922
|
+
var actionType = getActionFromKey(e.event, isOpen);
|
|
3923
|
+
if (actionType) {
|
|
3924
|
+
performAction(actionType, e, {
|
|
3925
|
+
setIsOpen: setIsOpen,
|
|
3926
|
+
close: close,
|
|
3927
|
+
onOptionChange: onOptionChange,
|
|
3928
|
+
onComboType: onComboType,
|
|
3929
|
+
selectCurrentOption: function selectCurrentOption() {
|
|
3930
|
+
var _options$activeIndex$, _options$activeIndex;
|
|
3931
|
+
var isSelected = selectOption(activeIndex);
|
|
3932
|
+
if (rest.hasFooterAction && !isReactNative$4()) {
|
|
3933
|
+
var _rest$triggererRef$cu2;
|
|
3934
|
+
(_rest$triggererRef$cu2 = rest.triggererRef.current) === null || _rest$triggererRef$cu2 === void 0 ? void 0 : _rest$triggererRef$cu2.focus();
|
|
3935
|
+
}
|
|
3936
|
+
(_options$activeIndex$ = (_options$activeIndex = options[activeIndex]).onClickTrigger) === null || _options$activeIndex$ === void 0 ? void 0 : _options$activeIndex$.call(_options$activeIndex, isSelected);
|
|
3937
|
+
}
|
|
3938
|
+
});
|
|
3939
|
+
}
|
|
3940
|
+
};
|
|
3941
|
+
return _objectSpread$64({
|
|
3942
|
+
isOpen: isOpen,
|
|
3943
|
+
setIsOpen: setIsOpen,
|
|
3944
|
+
close: close,
|
|
3945
|
+
selectedIndices: selectedIndices,
|
|
3946
|
+
setSelectedIndices: setSelectedIndices,
|
|
3947
|
+
setControlledValueIndices: setControlledValueIndices,
|
|
3948
|
+
onTriggerClick: onTriggerClick,
|
|
3949
|
+
onTriggerKeydown: onTriggerKeydown,
|
|
3950
|
+
onTriggerBlur: onTriggerBlur,
|
|
3951
|
+
onOptionClick: onOptionClick,
|
|
3952
|
+
activeIndex: activeIndex,
|
|
3953
|
+
setActiveIndex: setActiveIndex,
|
|
3954
|
+
shouldIgnoreBlur: shouldIgnoreBlur,
|
|
3955
|
+
setShouldIgnoreBlur: setShouldIgnoreBlur,
|
|
3956
|
+
isKeydownPressed: isKeydownPressed,
|
|
3957
|
+
setIsKeydownPressed: setIsKeydownPressed,
|
|
3958
|
+
changeCallbackTriggerer: changeCallbackTriggerer,
|
|
3959
|
+
setChangeCallbackTriggerer: setChangeCallbackTriggerer,
|
|
3960
|
+
isControlled: isControlled,
|
|
3961
|
+
options: options,
|
|
3962
|
+
value: makeInputValue(selectedIndices, options),
|
|
3963
|
+
displayValue: makeInputDisplayValue(selectedIndices, options),
|
|
3964
|
+
selectionType: selectionType
|
|
3965
|
+
}, rest);
|
|
3966
|
+
};
|
|
3948
3967
|
|
|
3949
3968
|
function ownKeys$64(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3950
3969
|
function _objectSpread$63(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$64(Object(source), !0).forEach(function (key) { _defineProperty$1(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$64(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
@@ -4055,8 +4074,8 @@ var _ActionList = function _ActionList(_ref) {
|
|
|
4055
4074
|
});
|
|
4056
4075
|
};
|
|
4057
4076
|
var ActionList = /*#__PURE__*/assignWithoutSideEffects( /*#__PURE__*/React__default.memo(_ActionList), {
|
|
4058
|
-
displayName: componentIds.ActionList,
|
|
4059
|
-
componentId: componentIds.ActionList
|
|
4077
|
+
displayName: componentIds$1.ActionList,
|
|
4078
|
+
componentId: componentIds$1.ActionList
|
|
4060
4079
|
});
|
|
4061
4080
|
|
|
4062
4081
|
var getBaseActionListItemStyles = function getBaseActionListItemStyles(props) {
|
|
@@ -4261,7 +4280,8 @@ var _Box = function _Box(props, ref) {
|
|
|
4261
4280
|
return /*#__PURE__*/jsx(BaseBox
|
|
4262
4281
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4263
4282
|
, _objectSpread$61(_objectSpread$61({
|
|
4264
|
-
ref: ref
|
|
4283
|
+
ref: ref,
|
|
4284
|
+
id: props.id
|
|
4265
4285
|
}, metaAttribute({
|
|
4266
4286
|
name: MetaConstants.Box,
|
|
4267
4287
|
testID: props.testID
|
|
@@ -4557,7 +4577,7 @@ var getBaseTextStyles = function getBaseTextStyles(_ref) {
|
|
|
4557
4577
|
lineHeight = _ref$lineHeight === void 0 ? 100 : _ref$lineHeight,
|
|
4558
4578
|
textAlign = _ref.textAlign,
|
|
4559
4579
|
theme = _ref.theme;
|
|
4560
|
-
var textColor =
|
|
4580
|
+
var textColor = getIn(theme.colors, color);
|
|
4561
4581
|
var themeFontFamily = theme.typography.fonts.family[fontFamily];
|
|
4562
4582
|
var themeFontSize = makeTypographySize(theme.typography.fonts.size[fontSize]);
|
|
4563
4583
|
var themeFontWeight = theme.typography.fonts.weight[fontWeight];
|
|
@@ -5177,7 +5197,10 @@ function isUndefined(value) {
|
|
|
5177
5197
|
|
|
5178
5198
|
var isUndefined_1 = isUndefined;
|
|
5179
5199
|
|
|
5200
|
+
var isUndefined$1 = /*@__PURE__*/getDefaultExportFromCjs(isUndefined_1);
|
|
5201
|
+
|
|
5180
5202
|
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
|
|
5203
|
+
/* eslint-disable @typescript-eslint/explicit-function-return-type */
|
|
5181
5204
|
var CheckboxGroupContext = /*#__PURE__*/React__default.createContext({});
|
|
5182
5205
|
var CheckboxGroupProvider = CheckboxGroupContext.Provider;
|
|
5183
5206
|
var useCheckboxGroupContext = function useCheckboxGroupContext() {
|
|
@@ -5268,8 +5291,8 @@ var getCheckboxIconWrapperStyles = function getCheckboxIconWrapperStyles(_ref) {
|
|
|
5268
5291
|
var checked = isChecked ? 'checked' : 'unchecked';
|
|
5269
5292
|
var background = checkboxIconColors.variants[variant].background[checked];
|
|
5270
5293
|
var border = checkboxIconColors.variants[variant].border[checked];
|
|
5271
|
-
var backgroundColor = background === 'transparent' ? background :
|
|
5272
|
-
var borderColor = border === 'transparent' ? border :
|
|
5294
|
+
var backgroundColor = background === 'transparent' ? background : getIn(theme, background);
|
|
5295
|
+
var borderColor = border === 'transparent' ? border : getIn(theme, border);
|
|
5273
5296
|
return {
|
|
5274
5297
|
position: 'relative',
|
|
5275
5298
|
display: 'flex',
|
|
@@ -5549,8 +5572,8 @@ var CheckboxIcon = function CheckboxIcon(_ref3) {
|
|
|
5549
5572
|
size = _ref3.size;
|
|
5550
5573
|
var _useTheme = useTheme(),
|
|
5551
5574
|
theme = _useTheme.theme;
|
|
5552
|
-
var defaultIconColor =
|
|
5553
|
-
var disabledIconColor =
|
|
5575
|
+
var defaultIconColor = getIn(theme, 'colors.brand.gray.200.lowContrast');
|
|
5576
|
+
var disabledIconColor = getIn(theme, 'colors.brand.gray.500.lowContrast');
|
|
5554
5577
|
var iconColor = isDisabled ? disabledIconColor : defaultIconColor;
|
|
5555
5578
|
return /*#__PURE__*/jsxs(CheckboxIconWrapper, _objectSpread$5L(_objectSpread$5L({
|
|
5556
5579
|
size: size,
|
|
@@ -5626,6 +5649,7 @@ var useId = function useId(prefix, idProp) {
|
|
|
5626
5649
|
};
|
|
5627
5650
|
|
|
5628
5651
|
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
|
|
5652
|
+
/* eslint-disable @typescript-eslint/explicit-function-return-type */
|
|
5629
5653
|
|
|
5630
5654
|
/**
|
|
5631
5655
|
* hook to generate unique ids for a form element
|
|
@@ -5816,7 +5840,7 @@ function useIconProps(_ref) {
|
|
|
5816
5840
|
theme = _useTheme.theme;
|
|
5817
5841
|
var height = makeSize(iconSize$1[size]);
|
|
5818
5842
|
var width = makeSize(iconSize$1[size]);
|
|
5819
|
-
var iconColor = color === 'currentColor' ? 'currentColor' :
|
|
5843
|
+
var iconColor = color === 'currentColor' ? 'currentColor' : getIn(theme.colors, color, '');
|
|
5820
5844
|
return {
|
|
5821
5845
|
height: height,
|
|
5822
5846
|
width: width,
|
|
@@ -14545,6 +14569,7 @@ var BulkPayoutsIcon = function BulkPayoutsIcon(_ref) {
|
|
|
14545
14569
|
};
|
|
14546
14570
|
|
|
14547
14571
|
/* eslint-disable react/display-name */
|
|
14572
|
+
|
|
14548
14573
|
var HintText = function HintText(_ref) {
|
|
14549
14574
|
var Icon = _ref.icon,
|
|
14550
14575
|
children = _ref.children,
|
|
@@ -14847,6 +14872,7 @@ var SelectorSupportText = function SelectorSupportText(_ref) {
|
|
|
14847
14872
|
};
|
|
14848
14873
|
|
|
14849
14874
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
14875
|
+
/* eslint-disable @typescript-eslint/explicit-function-return-type */
|
|
14850
14876
|
function assignRef(ref, value) {
|
|
14851
14877
|
if (ref == null) return;
|
|
14852
14878
|
if (typeof ref === 'function') {
|
|
@@ -14910,8 +14936,8 @@ var getHoverStyles = function getHoverStyles(_ref) {
|
|
|
14910
14936
|
var backgroundColor = hoverTokens["default"].background[checked];
|
|
14911
14937
|
var borderColor = (_hoverTokens$default$ = hoverTokens["default"].border) === null || _hoverTokens$default$ === void 0 ? void 0 : _hoverTokens$default$[checked];
|
|
14912
14938
|
return {
|
|
14913
|
-
borderColor: borderColor ?
|
|
14914
|
-
backgroundColor:
|
|
14939
|
+
borderColor: borderColor ? getIn(theme, borderColor) : undefined,
|
|
14940
|
+
backgroundColor: getIn(theme, backgroundColor),
|
|
14915
14941
|
transitionTimingFunction: theme.motion.easing.standard.effective,
|
|
14916
14942
|
transitionDuration: castWebType(makeMotionTime(theme.motion.duration['2xquick']))
|
|
14917
14943
|
};
|
|
@@ -14993,6 +15019,13 @@ var _Checkbox = function _Checkbox(_ref, ref) {
|
|
|
14993
15019
|
testID = _ref.testID,
|
|
14994
15020
|
styledProps = _objectWithoutProperties$1(_ref, _excluded$D);
|
|
14995
15021
|
var groupProps = useCheckboxGroupContext();
|
|
15022
|
+
|
|
15023
|
+
// ban certain props in checkbox while inside group
|
|
15024
|
+
!isUndefined$1(validationState);
|
|
15025
|
+
!isUndefined$1(name);
|
|
15026
|
+
!isUndefined$1(defaultChecked);
|
|
15027
|
+
!isUndefined$1(isChecked);
|
|
15028
|
+
!isUndefined$1(onChange);
|
|
14996
15029
|
var _validationState = validationState !== null && validationState !== void 0 ? validationState : groupProps === null || groupProps === void 0 ? void 0 : groupProps.validationState;
|
|
14997
15030
|
var _hasError = _validationState === 'error';
|
|
14998
15031
|
var _isDisabled = isDisabled !== null && isDisabled !== void 0 ? isDisabled : groupProps === null || groupProps === void 0 ? void 0 : groupProps.isDisabled;
|
|
@@ -15356,7 +15389,7 @@ var _ActionListSection = function _ActionListSection(_ref) {
|
|
|
15356
15389
|
}));
|
|
15357
15390
|
};
|
|
15358
15391
|
var ActionListSection = /*#__PURE__*/assignWithoutSideEffects(_ActionListSection, {
|
|
15359
|
-
componentId: componentIds.ActionListSection
|
|
15392
|
+
componentId: componentIds$1.ActionListSection
|
|
15360
15393
|
});
|
|
15361
15394
|
var _ActionListItemIcon = function _ActionListItemIcon(_ref2) {
|
|
15362
15395
|
var icon = _ref2.icon;
|
|
@@ -15372,7 +15405,7 @@ var _ActionListItemIcon = function _ActionListItemIcon(_ref2) {
|
|
|
15372
15405
|
});
|
|
15373
15406
|
};
|
|
15374
15407
|
var ActionListItemIcon = /*#__PURE__*/assignWithoutSideEffects(_ActionListItemIcon, {
|
|
15375
|
-
componentId: componentIds.ActionListItemIcon
|
|
15408
|
+
componentId: componentIds$1.ActionListItemIcon
|
|
15376
15409
|
});
|
|
15377
15410
|
var _ActionListItemText = function _ActionListItemText(_ref3) {
|
|
15378
15411
|
var children = _ref3.children;
|
|
@@ -15387,7 +15420,7 @@ var _ActionListItemText = function _ActionListItemText(_ref3) {
|
|
|
15387
15420
|
});
|
|
15388
15421
|
};
|
|
15389
15422
|
var ActionListItemText = /*#__PURE__*/assignWithoutSideEffects(_ActionListItemText, {
|
|
15390
|
-
componentId: componentIds.ActionListItemText
|
|
15423
|
+
componentId: componentIds$1.ActionListItemText
|
|
15391
15424
|
});
|
|
15392
15425
|
var ActionListCheckboxWrapper = /*#__PURE__*/styled(BaseBox).withConfig({
|
|
15393
15426
|
displayName: "ActionListItem__ActionListCheckboxWrapper",
|
|
@@ -15593,8 +15626,8 @@ var _ActionListItem = function _ActionListItem(props) {
|
|
|
15593
15626
|
});
|
|
15594
15627
|
};
|
|
15595
15628
|
var ActionListItem = /*#__PURE__*/assignWithoutSideEffects( /*#__PURE__*/React__default.memo(_ActionListItem), {
|
|
15596
|
-
componentId: componentIds.ActionListItem,
|
|
15597
|
-
displayName: componentIds.ActionListItem
|
|
15629
|
+
componentId: componentIds$1.ActionListItem,
|
|
15630
|
+
displayName: componentIds$1.ActionListItem
|
|
15598
15631
|
});
|
|
15599
15632
|
|
|
15600
15633
|
var _ActionListItemAsset = function _ActionListItemAsset(props) {
|
|
@@ -15606,7 +15639,7 @@ var _ActionListItemAsset = function _ActionListItemAsset(props) {
|
|
|
15606
15639
|
});
|
|
15607
15640
|
};
|
|
15608
15641
|
var ActionListItemAsset = /*#__PURE__*/assignWithoutSideEffects(_ActionListItemAsset, {
|
|
15609
|
-
componentId: componentIds.ActionListItemAsset
|
|
15642
|
+
componentId: componentIds$1.ActionListItemAsset
|
|
15610
15643
|
});
|
|
15611
15644
|
|
|
15612
15645
|
var MAX_WIDTH$2 = size[584];
|
|
@@ -15719,6 +15752,7 @@ var StyledIconButton = /*#__PURE__*/React__default.forwardRef(function (_ref, re
|
|
|
15719
15752
|
});
|
|
15720
15753
|
|
|
15721
15754
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
15755
|
+
/* eslint-disable react/display-name */
|
|
15722
15756
|
/**
|
|
15723
15757
|
* Component for making clickable icons with transparent background.
|
|
15724
15758
|
* For other cases please use `Button` component with `icon` prop.
|
|
@@ -15806,8 +15840,8 @@ var StyledBaseButton = /*#__PURE__*/styled.button.withConfig({
|
|
|
15806
15840
|
return _objectSpread$1l(_objectSpread$1l({}, getBaseButtonStyles(props)), {}, {
|
|
15807
15841
|
display: 'inline-flex',
|
|
15808
15842
|
transitionProperty: 'background-color, border-color, box-shadow',
|
|
15809
|
-
transitionTimingFunction:
|
|
15810
|
-
transitionDuration: castWebType(makeMotionTime(
|
|
15843
|
+
transitionTimingFunction: getIn(props.theme.motion, props.motionEasing),
|
|
15844
|
+
transitionDuration: castWebType(makeMotionTime(getIn(props.theme.motion, props.motionDuration))),
|
|
15811
15845
|
position: 'relative',
|
|
15812
15846
|
'&:hover': {
|
|
15813
15847
|
backgroundColor: props.hoverBackgroundColor,
|
|
@@ -15825,8 +15859,8 @@ var StyledBaseButton = /*#__PURE__*/styled.button.withConfig({
|
|
|
15825
15859
|
},
|
|
15826
15860
|
'*': {
|
|
15827
15861
|
transitionProperty: 'color, fill',
|
|
15828
|
-
transitionDuration: castWebType(makeMotionTime(
|
|
15829
|
-
transitionTimingFunction:
|
|
15862
|
+
transitionDuration: castWebType(makeMotionTime(getIn(props.theme.motion, props.motionDuration))),
|
|
15863
|
+
transitionTimingFunction: getIn(props.theme.motion, props.motionEasing)
|
|
15830
15864
|
}
|
|
15831
15865
|
}, styledPropsCSSObject);
|
|
15832
15866
|
});
|
|
@@ -16069,7 +16103,7 @@ var SpinningBox = /*#__PURE__*/styled(BaseBox).withConfig({
|
|
|
16069
16103
|
componentId: "zswieh-0"
|
|
16070
16104
|
})(function (_ref) {
|
|
16071
16105
|
var theme = _ref.theme;
|
|
16072
|
-
return css(["padding:1px;width:max-content;display:inline-flex;animation:", " ", " ", " infinite;"], rotate, makeMotionTime(
|
|
16106
|
+
return css(["padding:1px;width:max-content;display:inline-flex;animation:", " ", " ", " infinite;"], rotate, makeMotionTime(getIn(theme.motion, motion.duration)), getIn(theme.motion, motion.easing));
|
|
16073
16107
|
});
|
|
16074
16108
|
|
|
16075
16109
|
var _excluded$B = ["label", "labelPosition", "accessibilityLabel", "contrast", "intent", "size", "testID"];
|
|
@@ -16080,11 +16114,11 @@ var getColor = function getColor(_ref) {
|
|
|
16080
16114
|
intent = _ref.intent,
|
|
16081
16115
|
theme = _ref.theme;
|
|
16082
16116
|
if (intent) {
|
|
16083
|
-
return
|
|
16117
|
+
return getIn(theme.colors, "feedback.".concat(intent, ".action.icon.primary.disabled.").concat(contrast, "Contrast"));
|
|
16084
16118
|
} else if (contrast == 'low') {
|
|
16085
|
-
return
|
|
16119
|
+
return getIn(theme.colors, 'brand.gray.700.lowContrast');
|
|
16086
16120
|
} else {
|
|
16087
|
-
return
|
|
16121
|
+
return getIn(theme.colors, 'brand.gray.700.highContrast');
|
|
16088
16122
|
}
|
|
16089
16123
|
};
|
|
16090
16124
|
var BaseSpinner = function BaseSpinner(_ref2) {
|
|
@@ -16139,7 +16173,7 @@ var BaseSpinner = function BaseSpinner(_ref2) {
|
|
|
16139
16173
|
};
|
|
16140
16174
|
|
|
16141
16175
|
var getStringFromReactText = function getStringFromReactText(childReactText) {
|
|
16142
|
-
if (
|
|
16176
|
+
if (isEmpty$1(childReactText)) {
|
|
16143
16177
|
return undefined;
|
|
16144
16178
|
}
|
|
16145
16179
|
if (Array.isArray(childReactText)) {
|
|
@@ -16210,77 +16244,77 @@ var getProps$1 = function getProps(_ref2) {
|
|
|
16210
16244
|
buttonPaddingLeft: isIconOnly ? makeSpace(theme.spacing[buttonIconOnlyPadding[size].left]) : makeSpace(theme.spacing[buttonPadding[size].left]),
|
|
16211
16245
|
buttonPaddingRight: isIconOnly ? makeSpace(theme.spacing[buttonIconOnlyPadding[size].right]) : makeSpace(theme.spacing[buttonPadding[size].right]),
|
|
16212
16246
|
text: size === 'xsmall' ? children === null || children === void 0 ? void 0 : children.trim().toUpperCase() : children === null || children === void 0 ? void 0 : children.trim(),
|
|
16213
|
-
defaultBackgroundColor:
|
|
16247
|
+
defaultBackgroundColor: getIn(theme.colors, getColorToken$1({
|
|
16214
16248
|
property: 'background',
|
|
16215
16249
|
variant: variant,
|
|
16216
16250
|
contrast: contrast,
|
|
16217
16251
|
intent: intent,
|
|
16218
16252
|
state: 'default'
|
|
16219
16253
|
})),
|
|
16220
|
-
defaultBorderColor:
|
|
16254
|
+
defaultBorderColor: getIn(theme.colors, getColorToken$1({
|
|
16221
16255
|
property: 'border',
|
|
16222
16256
|
variant: variant,
|
|
16223
16257
|
contrast: contrast,
|
|
16224
16258
|
intent: intent,
|
|
16225
16259
|
state: 'default'
|
|
16226
16260
|
})),
|
|
16227
|
-
hoverBackgroundColor:
|
|
16261
|
+
hoverBackgroundColor: getIn(theme.colors, getColorToken$1({
|
|
16228
16262
|
property: 'background',
|
|
16229
16263
|
variant: variant,
|
|
16230
16264
|
contrast: contrast,
|
|
16231
16265
|
intent: intent,
|
|
16232
16266
|
state: 'hover'
|
|
16233
16267
|
})),
|
|
16234
|
-
hoverBorderColor:
|
|
16268
|
+
hoverBorderColor: getIn(theme.colors, getColorToken$1({
|
|
16235
16269
|
property: 'border',
|
|
16236
16270
|
variant: variant,
|
|
16237
16271
|
contrast: contrast,
|
|
16238
16272
|
intent: intent,
|
|
16239
16273
|
state: 'hover'
|
|
16240
16274
|
})),
|
|
16241
|
-
activeBackgroundColor:
|
|
16275
|
+
activeBackgroundColor: getIn(theme.colors, getColorToken$1({
|
|
16242
16276
|
property: 'background',
|
|
16243
16277
|
variant: variant,
|
|
16244
16278
|
contrast: contrast,
|
|
16245
16279
|
intent: intent,
|
|
16246
16280
|
state: 'active'
|
|
16247
16281
|
})),
|
|
16248
|
-
activeBorderColor:
|
|
16282
|
+
activeBorderColor: getIn(theme.colors, getColorToken$1({
|
|
16249
16283
|
property: 'border',
|
|
16250
16284
|
variant: variant,
|
|
16251
16285
|
contrast: contrast,
|
|
16252
16286
|
intent: intent,
|
|
16253
16287
|
state: 'active'
|
|
16254
16288
|
})),
|
|
16255
|
-
focusBackgroundColor:
|
|
16289
|
+
focusBackgroundColor: getIn(theme.colors, getColorToken$1({
|
|
16256
16290
|
property: 'background',
|
|
16257
16291
|
variant: variant,
|
|
16258
16292
|
contrast: contrast,
|
|
16259
16293
|
intent: intent,
|
|
16260
16294
|
state: 'focus'
|
|
16261
16295
|
})),
|
|
16262
|
-
focusBorderColor:
|
|
16296
|
+
focusBorderColor: getIn(theme.colors, getColorToken$1({
|
|
16263
16297
|
property: 'border',
|
|
16264
16298
|
variant: variant,
|
|
16265
16299
|
contrast: contrast,
|
|
16266
16300
|
intent: intent,
|
|
16267
16301
|
state: 'focus'
|
|
16268
16302
|
})),
|
|
16269
|
-
focusRingColor:
|
|
16303
|
+
focusRingColor: getIn(theme.colors, 'brand.primary.400'),
|
|
16270
16304
|
borderWidth: makeBorderSize(theme.border.width.thin),
|
|
16271
16305
|
borderRadius: makeBorderSize(theme.border.radius.small),
|
|
16272
16306
|
motionDuration: 'duration.xquick',
|
|
16273
16307
|
motionEasing: 'easing.standard.effective'
|
|
16274
16308
|
};
|
|
16275
16309
|
if (isDisabled) {
|
|
16276
|
-
var disabledBackgroundColor =
|
|
16310
|
+
var disabledBackgroundColor = getIn(theme.colors, getColorToken$1({
|
|
16277
16311
|
property: 'background',
|
|
16278
16312
|
variant: variant,
|
|
16279
16313
|
contrast: contrast,
|
|
16280
16314
|
intent: intent,
|
|
16281
16315
|
state: 'disabled'
|
|
16282
16316
|
}));
|
|
16283
|
-
var disabledBorderColor =
|
|
16317
|
+
var disabledBorderColor = getIn(theme.colors, getColorToken$1({
|
|
16284
16318
|
property: 'border',
|
|
16285
16319
|
variant: variant,
|
|
16286
16320
|
contrast: contrast,
|
|
@@ -16540,8 +16574,8 @@ var StyledLink$1 = /*#__PURE__*/styled.button.withConfig({
|
|
|
16540
16574
|
display: 'inline-block',
|
|
16541
16575
|
borderRadius: makeBorderSize(props.theme.border.radius.small),
|
|
16542
16576
|
transitionProperty: 'box-shadow',
|
|
16543
|
-
transitionTimingFunction:
|
|
16544
|
-
transitionDuration: castWebType(makeMotionTime(
|
|
16577
|
+
transitionTimingFunction: getIn(props.theme.motion, props.motionEasing),
|
|
16578
|
+
transitionDuration: castWebType(makeMotionTime(getIn(props.theme.motion, props.motionDuration))),
|
|
16545
16579
|
'.content-container': {
|
|
16546
16580
|
width: 'max-content',
|
|
16547
16581
|
borderRadius: makeBorderSize(props.theme.border.radius.small)
|
|
@@ -16553,8 +16587,8 @@ var StyledLink$1 = /*#__PURE__*/styled.button.withConfig({
|
|
|
16553
16587
|
},
|
|
16554
16588
|
'*': {
|
|
16555
16589
|
transitionProperty: 'color, fill',
|
|
16556
|
-
transitionTimingFunction:
|
|
16557
|
-
transitionDuration: castWebType(makeMotionTime(
|
|
16590
|
+
transitionTimingFunction: getIn(props.theme.motion, props.motionEasing),
|
|
16591
|
+
transitionDuration: castWebType(makeMotionTime(getIn(props.theme.motion, props.motionDuration)))
|
|
16558
16592
|
}
|
|
16559
16593
|
}, styledPropsCSSObject);
|
|
16560
16594
|
});
|
|
@@ -16662,7 +16696,7 @@ var getProps = function getProps(_ref2) {
|
|
|
16662
16696
|
isDisabled: isDisabled,
|
|
16663
16697
|
isVisited: isVisited
|
|
16664
16698
|
}),
|
|
16665
|
-
focusRingColor:
|
|
16699
|
+
focusRingColor: getIn(theme.colors, 'brand.primary.400'),
|
|
16666
16700
|
motionDuration: 'duration.2xquick',
|
|
16667
16701
|
motionEasing: 'easing.standard.effective',
|
|
16668
16702
|
cursor: isButton && isDisabled ? 'not-allowed' : 'pointer',
|
|
@@ -17043,7 +17077,7 @@ var getStyledBadgeStyles = function getStyledBadgeStyles(_ref) {
|
|
|
17043
17077
|
var theme = _ref.theme,
|
|
17044
17078
|
backgroundColor = _ref.backgroundColor;
|
|
17045
17079
|
return {
|
|
17046
|
-
backgroundColor:
|
|
17080
|
+
backgroundColor: getIn(theme.colors, backgroundColor),
|
|
17047
17081
|
borderRadius: makeBorderSize(theme.border.radius.max),
|
|
17048
17082
|
display: 'flex',
|
|
17049
17083
|
flexWrap: 'nowrap'
|
|
@@ -17624,7 +17658,7 @@ var getStyledCounterStyles = function getStyledCounterStyles(_ref) {
|
|
|
17624
17658
|
platform = _ref.platform,
|
|
17625
17659
|
backgroundColor = _ref.backgroundColor;
|
|
17626
17660
|
return {
|
|
17627
|
-
backgroundColor:
|
|
17661
|
+
backgroundColor: getIn(theme.colors, backgroundColor),
|
|
17628
17662
|
borderRadius: makeBorderSize(theme.border.radius.max),
|
|
17629
17663
|
maxWidth: makeSize(maxWidth[platform]),
|
|
17630
17664
|
display: 'flex',
|
|
@@ -18294,6 +18328,8 @@ function debounce$1(func, wait, options) {
|
|
|
18294
18328
|
|
|
18295
18329
|
var debounce_1 = debounce$1;
|
|
18296
18330
|
|
|
18331
|
+
var debounce$2 = /*@__PURE__*/getDefaultExportFromCjs(debounce_1);
|
|
18332
|
+
|
|
18297
18333
|
var debounce = debounce_1,
|
|
18298
18334
|
isObject = isObject_1;
|
|
18299
18335
|
|
|
@@ -18364,6 +18400,8 @@ function throttle(func, wait, options) {
|
|
|
18364
18400
|
|
|
18365
18401
|
var throttle_1 = throttle;
|
|
18366
18402
|
|
|
18403
|
+
var throttle$1 = /*@__PURE__*/getDefaultExportFromCjs(throttle_1);
|
|
18404
|
+
|
|
18367
18405
|
var CarouselContext = /*#__PURE__*/React__default.createContext(null);
|
|
18368
18406
|
var useCarouselContext = function useCarouselContext() {
|
|
18369
18407
|
var state = React__default.useContext(CarouselContext);
|
|
@@ -18704,7 +18742,7 @@ var CarouselContainer = /*#__PURE__*/styled(BaseBox).withConfig({
|
|
|
18704
18742
|
scrollOverlayColor = _ref2.scrollOverlayColor,
|
|
18705
18743
|
isScrollAtStart = _ref2.isScrollAtStart,
|
|
18706
18744
|
isScrollAtEnd = _ref2.isScrollAtEnd;
|
|
18707
|
-
var gradientStop1 =
|
|
18745
|
+
var gradientStop1 = getIn(theme.colors, scrollOverlayColor);
|
|
18708
18746
|
var gradientStop2 = 'hsla(0, 0%, 100%, 0)';
|
|
18709
18747
|
var overlayCommonStyle = {
|
|
18710
18748
|
content: "''",
|
|
@@ -18758,7 +18796,8 @@ var CarouselBody = /*#__PURE__*/React__default.forwardRef(function (_ref3, ref)
|
|
|
18758
18796
|
isScrollAtStart = _ref3.isScrollAtStart,
|
|
18759
18797
|
isScrollAtEnd = _ref3.isScrollAtEnd,
|
|
18760
18798
|
carouselItemAlignment = _ref3.carouselItemAlignment,
|
|
18761
|
-
accessibilityLabel = _ref3.accessibilityLabel
|
|
18799
|
+
accessibilityLabel = _ref3.accessibilityLabel,
|
|
18800
|
+
startEndMargin = _ref3.startEndMargin;
|
|
18762
18801
|
return /*#__PURE__*/jsx(CarouselContainer, _objectSpread$10(_objectSpread$10({
|
|
18763
18802
|
tabIndex: 0,
|
|
18764
18803
|
ref: ref,
|
|
@@ -18777,12 +18816,26 @@ var CarouselBody = /*#__PURE__*/React__default.forwardRef(function (_ref3, ref)
|
|
|
18777
18816
|
label: accessibilityLabel
|
|
18778
18817
|
})), {}, {
|
|
18779
18818
|
children: React__default.Children.map(children, function (child, index) {
|
|
18780
|
-
|
|
18819
|
+
var shouldHaveStartSpacing = shouldAddStartEndSpacing && index === 0;
|
|
18820
|
+
var shouldHaveEndSpacing = shouldAddStartEndSpacing && index === totalSlides - 1;
|
|
18821
|
+
var carouselItemNode = /*#__PURE__*/React__default.cloneElement(child, {
|
|
18781
18822
|
index: index,
|
|
18782
18823
|
id: "".concat(idPrefix, "-carousel-item-").concat(index),
|
|
18783
|
-
shouldHaveStartSpacing:
|
|
18784
|
-
shouldHaveEndSpacing:
|
|
18824
|
+
shouldHaveStartSpacing: shouldHaveStartSpacing,
|
|
18825
|
+
shouldHaveEndSpacing: shouldHaveEndSpacing
|
|
18785
18826
|
});
|
|
18827
|
+
|
|
18828
|
+
// Safari doesn't include the margin in the bounding box calculation
|
|
18829
|
+
// Thus have to add an additional box to the end of the carousel to ensure we can scroll past the last item
|
|
18830
|
+
// https://stackoverflow.com/questions/75509058/safari-does-not-include-margins-to-the-scroll-width
|
|
18831
|
+
if (shouldHaveEndSpacing) {
|
|
18832
|
+
return /*#__PURE__*/jsxs(Fragment, {
|
|
18833
|
+
children: [carouselItemNode, /*#__PURE__*/jsx(BaseBox, {
|
|
18834
|
+
minWidth: "".concat(startEndMargin, "px")
|
|
18835
|
+
})]
|
|
18836
|
+
});
|
|
18837
|
+
}
|
|
18838
|
+
return carouselItemNode;
|
|
18786
18839
|
})
|
|
18787
18840
|
}));
|
|
18788
18841
|
});
|
|
@@ -18930,7 +18983,7 @@ var Carousel = function Carousel(_ref4) {
|
|
|
18930
18983
|
if (isMobile) return;
|
|
18931
18984
|
var carouselContainer = containerRef.current;
|
|
18932
18985
|
if (!carouselContainer) return;
|
|
18933
|
-
var handleScroll =
|
|
18986
|
+
var handleScroll = throttle$1(function () {
|
|
18934
18987
|
var scrollWidth = (carouselContainer === null || carouselContainer === void 0 ? void 0 : carouselContainer.scrollWidth) - carouselContainer.offsetWidth;
|
|
18935
18988
|
setScrollStart((carouselContainer === null || carouselContainer === void 0 ? void 0 : carouselContainer.scrollLeft) === 0);
|
|
18936
18989
|
setScrollEnd((carouselContainer === null || carouselContainer === void 0 ? void 0 : carouselContainer.scrollLeft) === scrollWidth);
|
|
@@ -18947,7 +19000,7 @@ var Carousel = function Carousel(_ref4) {
|
|
|
18947
19000
|
if (!isMobile) return;
|
|
18948
19001
|
var carouselContainer = containerRef.current;
|
|
18949
19002
|
if (!carouselContainer) return;
|
|
18950
|
-
var handleScroll =
|
|
19003
|
+
var handleScroll = debounce$2(function () {
|
|
18951
19004
|
// carousel bounding box
|
|
18952
19005
|
var carouselBB = carouselContainer.getBoundingClientRect();
|
|
18953
19006
|
// By default we check the far left side of the screen
|
|
@@ -19055,6 +19108,7 @@ var Carousel = function Carousel(_ref4) {
|
|
|
19055
19108
|
onClick: goToPreviousSlide
|
|
19056
19109
|
}) : null, /*#__PURE__*/jsx(CarouselBody, {
|
|
19057
19110
|
idPrefix: id,
|
|
19111
|
+
startEndMargin: startEndMargin,
|
|
19058
19112
|
totalSlides: totalNumberOfSlides,
|
|
19059
19113
|
shouldAddStartEndSpacing: shouldAddStartEndSpacing,
|
|
19060
19114
|
scrollOverlayColor: scrollOverlayColor,
|
|
@@ -19103,7 +19157,6 @@ var StyledCarouselItem = /*#__PURE__*/styled(BaseBox).withConfig({
|
|
|
19103
19157
|
isResponsive = _ref.isResponsive,
|
|
19104
19158
|
shouldAddStartEndSpacing = _ref.shouldAddStartEndSpacing,
|
|
19105
19159
|
shouldHaveStartSpacing = _ref.shouldHaveStartSpacing,
|
|
19106
|
-
shouldHaveEndSpacing = _ref.shouldHaveEndSpacing,
|
|
19107
19160
|
theme = _ref.theme;
|
|
19108
19161
|
var _useBreakpoint = useBreakpoint({
|
|
19109
19162
|
breakpoints: theme.breakpoints
|
|
@@ -19121,8 +19174,7 @@ var StyledCarouselItem = /*#__PURE__*/styled(BaseBox).withConfig({
|
|
|
19121
19174
|
}, isResponsive && {
|
|
19122
19175
|
width: '100%',
|
|
19123
19176
|
scrollSnapAlign: isMobile || !shouldAddStartEndSpacing ? 'start' : 'center',
|
|
19124
|
-
marginLeft: shouldHaveStartSpacing ? '100%' : 0
|
|
19125
|
-
marginRight: shouldHaveEndSpacing ? '100%' : 0
|
|
19177
|
+
marginLeft: shouldHaveStartSpacing ? '100%' : 0
|
|
19126
19178
|
});
|
|
19127
19179
|
});
|
|
19128
19180
|
var CarouselItem = function CarouselItem(_ref2) {
|
|
@@ -19329,10 +19381,10 @@ var getAnimatedChipStyles = function getAnimatedChipStyles(_ref) {
|
|
|
19329
19381
|
isDisabled = _ref.isDisabled,
|
|
19330
19382
|
borderColor = _ref.borderColor;
|
|
19331
19383
|
return {
|
|
19332
|
-
backgroundColor: isDisabled ? 'transparent' :
|
|
19384
|
+
backgroundColor: isDisabled ? 'transparent' : getIn(theme.colors, 'surface.background.level2.lowContrast'),
|
|
19333
19385
|
borderRadius: makeBorderSize(theme.border.radius.max),
|
|
19334
|
-
borderColor:
|
|
19335
|
-
borderWidth:
|
|
19386
|
+
borderColor: getIn(theme.colors, borderColor),
|
|
19387
|
+
borderWidth: getIn(theme, 'border.width.thin'),
|
|
19336
19388
|
display: 'flex',
|
|
19337
19389
|
flexWrap: 'nowrap',
|
|
19338
19390
|
flexDirection: 'row',
|
|
@@ -19350,8 +19402,8 @@ var AnimatedChip = /*#__PURE__*/styled(BaseBox).withConfig({
|
|
|
19350
19402
|
displayName: "AnimatedChipweb__AnimatedChip",
|
|
19351
19403
|
componentId: "sc-1xiynj1-0"
|
|
19352
19404
|
})(function (props) {
|
|
19353
|
-
var easing =
|
|
19354
|
-
var duration = castWebType(makeMotionTime(
|
|
19405
|
+
var easing = getIn(props.theme, chipMotionTokens.easing);
|
|
19406
|
+
var duration = castWebType(makeMotionTime(getIn(props.theme, chipMotionTokens.duration)));
|
|
19355
19407
|
return _objectSpread$_(_objectSpread$_({}, getAnimatedChipStyles(props)), {}, {
|
|
19356
19408
|
width: 'fit-content',
|
|
19357
19409
|
transform: "scale(".concat(props.isPressed ? '0.92' : '1', ")"),
|
|
@@ -19371,14 +19423,14 @@ var StyledChipWrapper = /*#__PURE__*/styled(BaseBox).withConfig({
|
|
|
19371
19423
|
isChecked = _ref.isChecked,
|
|
19372
19424
|
isDisabled = _ref.isDisabled,
|
|
19373
19425
|
intent = _ref.intent;
|
|
19374
|
-
var easing =
|
|
19375
|
-
var duration = castWebType(makeMotionTime(
|
|
19426
|
+
var easing = getIn(theme, chipMotionTokens.easing);
|
|
19427
|
+
var duration = castWebType(makeMotionTime(getIn(theme, chipMotionTokens.duration)));
|
|
19376
19428
|
return _objectSpread$Z({
|
|
19377
19429
|
display: 'flex',
|
|
19378
|
-
borderColor: isChecked ?
|
|
19430
|
+
borderColor: isChecked ? getIn(theme.colors, borderColor) : 'transparent'
|
|
19379
19431
|
}, !isDisabled && {
|
|
19380
19432
|
'&:hover': {
|
|
19381
|
-
backgroundColor:
|
|
19433
|
+
backgroundColor: getIn(theme.colors, chipColorTokens.background[isChecked && intent ? intent : 'unchecked'].hover),
|
|
19382
19434
|
transitionTimingFunction: easing,
|
|
19383
19435
|
transitionDuration: duration
|
|
19384
19436
|
}
|
|
@@ -19486,7 +19538,7 @@ var _Chip = function _Chip(_ref, ref) {
|
|
|
19486
19538
|
}),
|
|
19487
19539
|
matchedDeviceType = _useBreakpoint.matchedDeviceType;
|
|
19488
19540
|
var groupProps = useChipGroupContext();
|
|
19489
|
-
!
|
|
19541
|
+
!isEmpty$1(groupProps);
|
|
19490
19542
|
var _React$useState = React__default.useState(false),
|
|
19491
19543
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
19492
19544
|
isPressed = _React$useState2[0],
|
|
@@ -19665,7 +19717,7 @@ var useChipGroup = function useChipGroup(_ref) {
|
|
|
19665
19717
|
value: checkedValues,
|
|
19666
19718
|
isChecked: function isChecked(value) {
|
|
19667
19719
|
if (selectionType === 'single') {
|
|
19668
|
-
if (
|
|
19720
|
+
if (isUndefined$1(value) || isUndefined$1(checkedValues)) return false;
|
|
19669
19721
|
return checkedValues[0] === value;
|
|
19670
19722
|
}
|
|
19671
19723
|
return checkedValues.includes(value);
|
|
@@ -19909,10 +19961,10 @@ var _Dropdown = function _Dropdown(_ref) {
|
|
|
19909
19961
|
}, [onDismiss]);
|
|
19910
19962
|
React__default.Children.map(children, function (child) {
|
|
19911
19963
|
if ( /*#__PURE__*/React__default.isValidElement(child)) {
|
|
19912
|
-
if (isValidAllowedChildren(child, componentIds
|
|
19964
|
+
if (isValidAllowedChildren(child, componentIds.triggers.SelectInput)) {
|
|
19913
19965
|
dropdownTriggerer.current = 'SelectInput';
|
|
19914
19966
|
}
|
|
19915
|
-
if (isValidAllowedChildren(child, componentIds
|
|
19967
|
+
if (isValidAllowedChildren(child, componentIds.triggers.DropdownButton)) {
|
|
19916
19968
|
dropdownTriggerer.current = 'DropdownButton';
|
|
19917
19969
|
}
|
|
19918
19970
|
}
|
|
@@ -19982,7 +20034,7 @@ var _Dropdown = function _Dropdown(_ref) {
|
|
|
19982
20034
|
});
|
|
19983
20035
|
};
|
|
19984
20036
|
var Dropdown = /*#__PURE__*/assignWithoutSideEffects(_Dropdown, {
|
|
19985
|
-
componentId: componentIds
|
|
20037
|
+
componentId: componentIds.Dropdown
|
|
19986
20038
|
});
|
|
19987
20039
|
|
|
19988
20040
|
var StyledDropdownOverlay = /*#__PURE__*/styled(BaseBox).withConfig({
|
|
@@ -20100,7 +20152,7 @@ var _DropdownOverlay = function _DropdownOverlay(_ref) {
|
|
|
20100
20152
|
});
|
|
20101
20153
|
};
|
|
20102
20154
|
var DropdownOverlay = /*#__PURE__*/assignWithoutSideEffects(_DropdownOverlay, {
|
|
20103
|
-
componentId: componentIds
|
|
20155
|
+
componentId: componentIds.DropdownOverlay
|
|
20104
20156
|
});
|
|
20105
20157
|
|
|
20106
20158
|
var _excluded$n = ["children", "icon", "iconPosition", "isDisabled", "isFullWidth", "isLoading", "onClick", "onBlur", "onKeyDown", "size", "type", "variant", "accessibilityLabel", "testID"];
|
|
@@ -20195,7 +20247,7 @@ var _DropdownButton = function _DropdownButton(_ref) {
|
|
|
20195
20247
|
);
|
|
20196
20248
|
};
|
|
20197
20249
|
var DropdownButton = /*#__PURE__*/assignWithoutSideEffects(_DropdownButton, {
|
|
20198
|
-
componentId: componentIds
|
|
20250
|
+
componentId: componentIds.triggers.DropdownButton
|
|
20199
20251
|
});
|
|
20200
20252
|
|
|
20201
20253
|
var _excluded$m = ["children", "icon", "iconPosition", "onClick", "onBlur", "onKeyDown", "isDisabled", "href", "target", "rel", "accessibilityLabel", "size", "testID", "hitSlop", "htmlTitle"];
|
|
@@ -20286,7 +20338,7 @@ var _DropdownLink = function _DropdownLink(_ref) {
|
|
|
20286
20338
|
);
|
|
20287
20339
|
};
|
|
20288
20340
|
var DropdownLink = /*#__PURE__*/assignWithoutSideEffects(_DropdownLink, {
|
|
20289
|
-
componentId: componentIds
|
|
20341
|
+
componentId: componentIds.triggers.DropdownLink
|
|
20290
20342
|
});
|
|
20291
20343
|
|
|
20292
20344
|
function ownKeys$S(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
@@ -21694,7 +21746,7 @@ var _TextInput = function _TextInput(_ref2, ref) {
|
|
|
21694
21746
|
icon: CloseIcon,
|
|
21695
21747
|
onClick: function onClick() {
|
|
21696
21748
|
var _textInputRef$current;
|
|
21697
|
-
if (
|
|
21749
|
+
if (isEmpty$1(value) && textInputRef.current) {
|
|
21698
21750
|
// when the input field is uncontrolled take the ref and clear the input and then call the onClearButtonClick function
|
|
21699
21751
|
if (isReactNative$2(textInputRef.current)) {
|
|
21700
21752
|
textInputRef.current.clear();
|
|
@@ -21948,7 +22000,7 @@ var _TextArea = function _TextArea(_ref, ref) {
|
|
|
21948
22000
|
accessibilityLabel: "Clear textarea content",
|
|
21949
22001
|
onClick: function onClick() {
|
|
21950
22002
|
var _inputRef$current;
|
|
21951
|
-
if (
|
|
22003
|
+
if (isEmpty$1(value) && inputRef.current) {
|
|
21952
22004
|
// when the input field is uncontrolled take the ref and clear the input and then call the onClearButtonClick function
|
|
21953
22005
|
if (isReactNative$1(inputRef.current)) {
|
|
21954
22006
|
inputRef.current.clear();
|
|
@@ -22121,13 +22173,13 @@ var OTPInput = function OTPInput(_ref) {
|
|
|
22121
22173
|
*/
|
|
22122
22174
|
otpValue.forEach(function (otp, index) {
|
|
22123
22175
|
// Set inputType as 'password' only when a value is entered when isMasked is set
|
|
22124
|
-
if (!
|
|
22176
|
+
if (!isEmpty$1(otp) && !inputType[index] && isMasked) {
|
|
22125
22177
|
var newInputType = Array.from(inputType);
|
|
22126
22178
|
newInputType[index] = 'password';
|
|
22127
22179
|
setInputType(newInputType);
|
|
22128
22180
|
}
|
|
22129
22181
|
// Cleanup the inputType array whenever the value is empty but inputType[index] is set
|
|
22130
|
-
if (
|
|
22182
|
+
if (isEmpty$1(otp) && inputType[index]) {
|
|
22131
22183
|
var _newInputType = Array.from(inputType);
|
|
22132
22184
|
_newInputType[index] = undefined;
|
|
22133
22185
|
setInputType(_newInputType);
|
|
@@ -22425,7 +22477,7 @@ var _SelectInput = function _SelectInput(props, ref) {
|
|
|
22425
22477
|
var selectValues = function selectValues(valuesToSelect) {
|
|
22426
22478
|
if (options.length > 0) {
|
|
22427
22479
|
// we use empty `''` for clearing the input
|
|
22428
|
-
if (
|
|
22480
|
+
if (isEmpty$1(valuesToSelect)) {
|
|
22429
22481
|
setSelectedIndices([]);
|
|
22430
22482
|
} else if (typeof valuesToSelect === 'string') {
|
|
22431
22483
|
// single select control
|
|
@@ -22591,7 +22643,7 @@ var _SelectInput = function _SelectInput(props, ref) {
|
|
|
22591
22643
|
*/
|
|
22592
22644
|
|
|
22593
22645
|
var SelectInput = /*#__PURE__*/assignWithoutSideEffects( /*#__PURE__*/React__default.forwardRef(_SelectInput), {
|
|
22594
|
-
componentId: componentIds
|
|
22646
|
+
componentId: componentIds.triggers.SelectInput
|
|
22595
22647
|
});
|
|
22596
22648
|
|
|
22597
22649
|
var _excluded$c = ["accessibilityLabel", "children", "size", "intent", "testID"];
|
|
@@ -22717,7 +22769,7 @@ var StyledOrderedList = /*#__PURE__*/styled(OrderedList).withConfig({
|
|
|
22717
22769
|
var marginTop = _ref.marginTop,
|
|
22718
22770
|
theme = _ref.theme;
|
|
22719
22771
|
return {
|
|
22720
|
-
marginTop: marginTop ? makeSpace(
|
|
22772
|
+
marginTop: marginTop ? makeSpace(getIn(theme, marginTop)) : undefined
|
|
22721
22773
|
};
|
|
22722
22774
|
});
|
|
22723
22775
|
var StyledUnorderedList = /*#__PURE__*/styled(UnorderedList).withConfig({
|
|
@@ -22727,7 +22779,7 @@ var StyledUnorderedList = /*#__PURE__*/styled(UnorderedList).withConfig({
|
|
|
22727
22779
|
var marginTop = _ref2.marginTop,
|
|
22728
22780
|
theme = _ref2.theme;
|
|
22729
22781
|
return {
|
|
22730
|
-
marginTop: marginTop ? makeSpace(
|
|
22782
|
+
marginTop: marginTop ? makeSpace(getIn(theme, marginTop)) : undefined
|
|
22731
22783
|
};
|
|
22732
22784
|
});
|
|
22733
22785
|
|
|
@@ -23089,7 +23141,7 @@ var StyledListItem = /*#__PURE__*/styled(ListItemElement).withConfig({
|
|
|
23089
23141
|
variant = _ref.variant,
|
|
23090
23142
|
hasIcon = _ref.hasIcon;
|
|
23091
23143
|
return {
|
|
23092
|
-
marginLeft: level ?
|
|
23144
|
+
marginLeft: level ? getIn(theme, listItemMarginLeft["".concat(variant).concat(variant === 'unordered' && hasIcon ? 'WithIcon' : '')][level]) : 0
|
|
23093
23145
|
};
|
|
23094
23146
|
});
|
|
23095
23147
|
var ListItemContentChildren = function ListItemContentChildren(_ref2) {
|
|
@@ -23182,7 +23234,7 @@ var _ListItem = function _ListItem(_ref3) {
|
|
|
23182
23234
|
alignSelf: "flex-start",
|
|
23183
23235
|
alignItems: "center",
|
|
23184
23236
|
borderRadius: variant === 'ordered-filled' ? 'max' : undefined,
|
|
23185
|
-
backgroundColor: variant === 'ordered-filled' ?
|
|
23237
|
+
backgroundColor: variant === 'ordered-filled' ? getIn(theme, 'colors.brand.gray.a100.lowContrast') : undefined,
|
|
23186
23238
|
children: /*#__PURE__*/jsx(Text, {
|
|
23187
23239
|
variant: "body",
|
|
23188
23240
|
type: "subtle",
|
|
@@ -23667,6 +23719,8 @@ function clamp$1(number, lower, upper) {
|
|
|
23667
23719
|
|
|
23668
23720
|
var clamp_1 = clamp$1;
|
|
23669
23721
|
|
|
23722
|
+
var clamp$2 = /*@__PURE__*/getDefaultExportFromCjs(clamp_1);
|
|
23723
|
+
|
|
23670
23724
|
var indeterminateAnimation = {
|
|
23671
23725
|
scaleXInitial: 1,
|
|
23672
23726
|
scaleXMid: 5,
|
|
@@ -23697,7 +23751,7 @@ var BoxWithIndeterminateAnimation = /*#__PURE__*/styled(BaseBox).withConfig({
|
|
|
23697
23751
|
})(function (_ref2) {
|
|
23698
23752
|
var theme = _ref2.theme,
|
|
23699
23753
|
indeterminateMotionDuration = _ref2.indeterminateMotionDuration;
|
|
23700
|
-
var duration = castWebType(makeMotionTime(
|
|
23754
|
+
var duration = castWebType(makeMotionTime(getIn(theme.motion, indeterminateMotionDuration)));
|
|
23701
23755
|
var easing = 'linear'; // TODO: Add this in motion tokens
|
|
23702
23756
|
|
|
23703
23757
|
return css(["animation:", " ", " ", " infinite;position:absolute;width:", ";height:100%;"], slideAndScaleKeyframes, duration, easing, indeterminateAnimation.fillWidth);
|
|
@@ -23720,9 +23774,9 @@ var IndeterminatePulseAnimation = /*#__PURE__*/styled(BoxWithIndeterminateAnimat
|
|
|
23720
23774
|
pulseMotionDelay = _ref4.pulseMotionDelay,
|
|
23721
23775
|
motionEasing = _ref4.motionEasing,
|
|
23722
23776
|
variant = _ref4.variant;
|
|
23723
|
-
var duration = castWebType(makeMotionTime(
|
|
23724
|
-
var easing = castWebType(
|
|
23725
|
-
var delay = castWebType(makeMotionTime(
|
|
23777
|
+
var duration = castWebType(makeMotionTime(getIn(theme.motion, pulseMotionDuration)));
|
|
23778
|
+
var easing = castWebType(getIn(theme.motion, motionEasing));
|
|
23779
|
+
var delay = castWebType(makeMotionTime(getIn(theme.motion, pulseMotionDelay)));
|
|
23726
23780
|
return variant === 'progress' ? getPulseAnimationStyles({
|
|
23727
23781
|
duration: duration,
|
|
23728
23782
|
easing: easing,
|
|
@@ -23738,8 +23792,8 @@ var BoxWithProgressFillTransition = /*#__PURE__*/styled(BaseBox).withConfig({
|
|
|
23738
23792
|
motionEasing = _ref5.motionEasing;
|
|
23739
23793
|
return {
|
|
23740
23794
|
transitionProperty: 'width',
|
|
23741
|
-
transitionDuration: castWebType(makeMotionTime(
|
|
23742
|
-
transitionTimingFunction: castWebType(
|
|
23795
|
+
transitionDuration: castWebType(makeMotionTime(getIn(theme.motion, fillMotionDuration))),
|
|
23796
|
+
transitionTimingFunction: castWebType(getIn(theme.motion, motionEasing))
|
|
23743
23797
|
};
|
|
23744
23798
|
});
|
|
23745
23799
|
var DeterminateFilledContainer = /*#__PURE__*/styled(BoxWithProgressFillTransition).withConfig({
|
|
@@ -23763,9 +23817,9 @@ var DeterminatePulseAnimation = /*#__PURE__*/styled(BoxWithProgressFillTransitio
|
|
|
23763
23817
|
pulseMotionDelay = _ref7.pulseMotionDelay,
|
|
23764
23818
|
motionEasing = _ref7.motionEasing,
|
|
23765
23819
|
variant = _ref7.variant;
|
|
23766
|
-
var duration = castWebType(makeMotionTime(
|
|
23767
|
-
var easing = castWebType(
|
|
23768
|
-
var delay = castWebType(makeMotionTime(
|
|
23820
|
+
var duration = castWebType(makeMotionTime(getIn(theme.motion, pulseMotionDuration)));
|
|
23821
|
+
var easing = castWebType(getIn(theme.motion, motionEasing));
|
|
23822
|
+
var delay = castWebType(makeMotionTime(getIn(theme.motion, pulseMotionDelay)));
|
|
23769
23823
|
return variant === 'progress' ? getPulseAnimationStyles({
|
|
23770
23824
|
duration: duration,
|
|
23771
23825
|
easing: easing,
|
|
@@ -23836,7 +23890,7 @@ var ProgressBar = function ProgressBar(_ref) {
|
|
|
23836
23890
|
var filledBackgroundColor = intent ? theme.colors.feedback.background[intent].highContrast : theme.colors.brand.primary[500];
|
|
23837
23891
|
var hasLabel = label && ((_label$trim = label.trim()) === null || _label$trim === void 0 ? void 0 : _label$trim.length) > 0;
|
|
23838
23892
|
var isMeter = variant === 'meter';
|
|
23839
|
-
var progressValue =
|
|
23893
|
+
var progressValue = clamp$2(value, min, max);
|
|
23840
23894
|
var percentageProgressValue = Math.floor((progressValue - min) * 100 / (max - min));
|
|
23841
23895
|
var shouldShowPercentage = showPercentage && !isMeter && !isIndeterminate;
|
|
23842
23896
|
var accessibilityProps = {
|
|
@@ -24017,8 +24071,8 @@ var getRadioIconWrapperStyles = function getRadioIconWrapperStyles(_ref) {
|
|
|
24017
24071
|
var checked = isChecked ? 'checked' : 'unchecked';
|
|
24018
24072
|
var background = radioIconColors.variants[variant].background[checked];
|
|
24019
24073
|
var border = radioIconColors.variants[variant].border[checked];
|
|
24020
|
-
var backgroundColor = background === 'transparent' ? background :
|
|
24021
|
-
var borderColor = border === 'transparent' ? border :
|
|
24074
|
+
var backgroundColor = background === 'transparent' ? background : getIn(theme, background);
|
|
24075
|
+
var borderColor = border === 'transparent' ? border : getIn(theme, border);
|
|
24022
24076
|
return _objectSpread$t({
|
|
24023
24077
|
position: 'relative',
|
|
24024
24078
|
display: 'flex',
|
|
@@ -24046,6 +24100,8 @@ var RadioIconWrapper = /*#__PURE__*/styled.div.withConfig({
|
|
|
24046
24100
|
});
|
|
24047
24101
|
|
|
24048
24102
|
/* eslint-disable react/jsx-no-useless-fragment */
|
|
24103
|
+
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
|
|
24104
|
+
/* eslint-disable @typescript-eslint/explicit-function-return-type */
|
|
24049
24105
|
var scaleIn = /*#__PURE__*/keyframes(["from{transform:scale(.3);opacity:0;}to{transform:scale(1);opacity:1;}"]);
|
|
24050
24106
|
var fadeOut = /*#__PURE__*/keyframes(["from{transform:scale(1);opacity:1;}to{transform:scale(1);opacity:0;}"]);
|
|
24051
24107
|
var AnimatedFade = /*#__PURE__*/styled.div.withConfig({
|
|
@@ -24119,7 +24175,7 @@ var RadioIcon = function RadioIcon(_ref2) {
|
|
|
24119
24175
|
var variant = 'default';
|
|
24120
24176
|
if (isDisabled) variant = 'disabled';
|
|
24121
24177
|
if (isNegative) variant = 'negative';
|
|
24122
|
-
var dotColor =
|
|
24178
|
+
var dotColor = getIn(theme, radioIconColors.variants[variant].dot[state]);
|
|
24123
24179
|
return /*#__PURE__*/jsx(RadioIconWrapper, _objectSpread$s(_objectSpread$s({
|
|
24124
24180
|
size: size,
|
|
24125
24181
|
isDisabled: isDisabled,
|
|
@@ -24143,6 +24199,7 @@ var RadioIcon = function RadioIcon(_ref2) {
|
|
|
24143
24199
|
};
|
|
24144
24200
|
|
|
24145
24201
|
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
|
|
24202
|
+
/* eslint-disable @typescript-eslint/explicit-function-return-type */
|
|
24146
24203
|
var RadioGroupContext = /*#__PURE__*/React__default.createContext({});
|
|
24147
24204
|
var RadioGroupProvider = RadioGroupContext.Provider;
|
|
24148
24205
|
var useRadioGroupContext = function useRadioGroupContext() {
|
|
@@ -24164,7 +24221,7 @@ var _Radio = function _Radio(_ref, ref) {
|
|
|
24164
24221
|
testID = _ref.testID,
|
|
24165
24222
|
styledProps = _objectWithoutProperties$1(_ref, _excluded$8);
|
|
24166
24223
|
var groupProps = useRadioGroupContext();
|
|
24167
|
-
!
|
|
24224
|
+
!isEmpty$1(groupProps);
|
|
24168
24225
|
var isChecked = groupProps === null || groupProps === void 0 ? void 0 : (_groupProps$state = groupProps.state) === null || _groupProps$state === void 0 ? void 0 : _groupProps$state.isChecked(value);
|
|
24169
24226
|
var defaultChecked = (groupProps === null || groupProps === void 0 ? void 0 : groupProps.defaultValue) === undefined ? undefined : (groupProps === null || groupProps === void 0 ? void 0 : groupProps.defaultValue) === value;
|
|
24170
24227
|
var validationState = groupProps === null || groupProps === void 0 ? void 0 : groupProps.validationState;
|
|
@@ -24299,7 +24356,7 @@ var useRadioGroup = function useRadioGroup(_ref) {
|
|
|
24299
24356
|
setValue(undefined);
|
|
24300
24357
|
},
|
|
24301
24358
|
isChecked: function isChecked(v) {
|
|
24302
|
-
if (
|
|
24359
|
+
if (isUndefined$1(v) || isUndefined$1(checkedValue)) return false;
|
|
24303
24360
|
return checkedValue === v;
|
|
24304
24361
|
}
|
|
24305
24362
|
};
|
|
@@ -24499,6 +24556,8 @@ function isNumber(value) {
|
|
|
24499
24556
|
|
|
24500
24557
|
var isNumber_1 = isNumber;
|
|
24501
24558
|
|
|
24559
|
+
var isNumber$1 = /*@__PURE__*/getDefaultExportFromCjs(isNumber_1);
|
|
24560
|
+
|
|
24502
24561
|
var switchSizes = {
|
|
24503
24562
|
track: {
|
|
24504
24563
|
desktop: {
|
|
@@ -24604,8 +24663,8 @@ var AnimatedThumbIcon = /*#__PURE__*/styled(Svg).withConfig({
|
|
|
24604
24663
|
})(function (_ref) {
|
|
24605
24664
|
var isChecked = _ref.isChecked,
|
|
24606
24665
|
theme = _ref.theme;
|
|
24607
|
-
var easing =
|
|
24608
|
-
var duration =
|
|
24666
|
+
var easing = getIn(theme, switchMotion.easing.thumbIcon);
|
|
24667
|
+
var duration = getIn(theme, switchMotion.duration.thumbIcon);
|
|
24609
24668
|
return {
|
|
24610
24669
|
transitionDuration: "".concat(makeMotionTime(duration)),
|
|
24611
24670
|
transitionTimingFunction: easing,
|
|
@@ -24637,10 +24696,10 @@ var ThumbIcon = function ThumbIcon(_ref) {
|
|
|
24637
24696
|
matchedDeviceType = _useBreakpoint.matchedDeviceType;
|
|
24638
24697
|
var width = switchIconSize[matchedDeviceType][size];
|
|
24639
24698
|
var height = switchIconSize[matchedDeviceType][size];
|
|
24640
|
-
var finalWidth =
|
|
24641
|
-
var finalHeight =
|
|
24699
|
+
var finalWidth = isNumber$1(width) ? makeSize(width) : makeSpace(getIn(theme, width));
|
|
24700
|
+
var finalHeight = isNumber$1(height) ? makeSize(height) : makeSpace(getIn(theme, height));
|
|
24642
24701
|
var variant = isDisabled ? 'disabled' : 'default';
|
|
24643
|
-
var fillColor =
|
|
24702
|
+
var fillColor = getIn(theme, switchColors.thumbIcon[variant].fill);
|
|
24644
24703
|
return /*#__PURE__*/jsx(AnimatedThumbIcon, {
|
|
24645
24704
|
isChecked: Boolean(isChecked),
|
|
24646
24705
|
width: finalWidth,
|
|
@@ -24670,8 +24729,8 @@ var Thumb = /*#__PURE__*/styled(BaseBox).withConfig({
|
|
|
24670
24729
|
deviceType = _ref.deviceType;
|
|
24671
24730
|
var width = switchSizes.thumb[deviceType][size].width;
|
|
24672
24731
|
var height = switchSizes.thumb[deviceType][size].height;
|
|
24673
|
-
var finalWidth =
|
|
24674
|
-
var finalHeight =
|
|
24732
|
+
var finalWidth = isNumber$1(width) ? makeSize(width) : makeSpace(getIn(theme, width));
|
|
24733
|
+
var finalHeight = isNumber$1(height) ? makeSize(height) : makeSpace(getIn(theme, height));
|
|
24675
24734
|
var reactNativeStyles = {
|
|
24676
24735
|
left: 0,
|
|
24677
24736
|
margin: makeSpace(theme.spacing[1])
|
|
@@ -24695,8 +24754,8 @@ var AnimatedThumb = /*#__PURE__*/styled(BaseBox).withConfig({
|
|
|
24695
24754
|
isDisabled = _ref.isDisabled,
|
|
24696
24755
|
isPressed = _ref.isPressed;
|
|
24697
24756
|
var variant = isDisabled ? 'disabled' : 'default';
|
|
24698
|
-
var backgroundColor =
|
|
24699
|
-
var duration = makeMotionTime(
|
|
24757
|
+
var backgroundColor = getIn(theme, switchColors.thumb[variant].background);
|
|
24758
|
+
var duration = makeMotionTime(getIn(theme, switchMotion.duration.thumb));
|
|
24700
24759
|
// offset the thumb x% left because we change the width and width changes from the center origin of thumb
|
|
24701
24760
|
var offset = isChecked ? '-39%' : '12.5%';
|
|
24702
24761
|
return css(["display:flex;align-items:center;justify-content:center;flex-shrink:0;height:100%;position:relative;will-change:transform,left;width:", ";left:", ";transform:translateX(", ");transition:", ";border-radius:", ";animation-duration:", ";background-color:", ";"], isPressed ? '125%' : '100%', isPressed ? offset : '0%', isChecked ? '100%' : '0%', duration, makeBorderSize(theme.border.radius.max), duration, backgroundColor);
|
|
@@ -24712,11 +24771,11 @@ var getTrackStyles = function getTrackStyles(_ref) {
|
|
|
24712
24771
|
if (isDisabled) variant = 'disabled';
|
|
24713
24772
|
var checked = isChecked ? 'checked' : 'unchecked';
|
|
24714
24773
|
var background = switchColors.track[variant].background[checked];
|
|
24715
|
-
var backgroundColor =
|
|
24774
|
+
var backgroundColor = getIn(theme, background);
|
|
24716
24775
|
var widthToken = switchSizes.track[deviceType][size].width;
|
|
24717
24776
|
var heightToken = switchSizes.track[deviceType][size].height;
|
|
24718
|
-
var width =
|
|
24719
|
-
var height =
|
|
24777
|
+
var width = isNumber$1(widthToken) ? makeSize(widthToken) : makeSpace(getIn(theme, widthToken));
|
|
24778
|
+
var height = isNumber$1(heightToken) ? makeSize(heightToken) : makeSpace(getIn(theme, heightToken));
|
|
24720
24779
|
return {
|
|
24721
24780
|
pointerEvents: 'none',
|
|
24722
24781
|
position: 'relative',
|
|
@@ -25002,6 +25061,7 @@ var Tag = function Tag(_ref) {
|
|
|
25002
25061
|
};
|
|
25003
25062
|
|
|
25004
25063
|
/* eslint-disable @typescript-eslint/restrict-plus-operands */
|
|
25064
|
+
|
|
25005
25065
|
var pulseKeyframes = function pulseKeyframes(_ref) {
|
|
25006
25066
|
var theme = _ref.theme,
|
|
25007
25067
|
contrast = _ref.contrast;
|
|
@@ -27542,7 +27602,7 @@ var _BottomSheetBody = function _BottomSheetBody(_ref) {
|
|
|
27542
27602
|
React__default.useEffect(function () {
|
|
27543
27603
|
setBottomSheetHasActionList(false);
|
|
27544
27604
|
React__default.Children.forEach(children, function (child) {
|
|
27545
|
-
if (isValidAllowedChildren(child, componentIds.ActionList)) {
|
|
27605
|
+
if (isValidAllowedChildren(child, componentIds$1.ActionList)) {
|
|
27546
27606
|
setBottomSheetHasActionList(true);
|
|
27547
27607
|
}
|
|
27548
27608
|
});
|
|
@@ -27708,6 +27768,7 @@ var BottomSheetGrabHandle = /*#__PURE__*/styled.div.withConfig({
|
|
|
27708
27768
|
});
|
|
27709
27769
|
|
|
27710
27770
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
27771
|
+
/* eslint-disable @typescript-eslint/no-empty-function */
|
|
27711
27772
|
/**
|
|
27712
27773
|
* Modified from: https://github.com/stipsan/react-spring-bottom-sheet/blob/main/src/hooks/useScrollLock.tsx
|
|
27713
27774
|
* Handle scroll locking to ensure a good dragging experience on Android and iOS.
|