@qualtrics/ui-react 2.16.0 → 2.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +40 -0
- package/dist/__shared/cjs/{index-74e60b70.js → index-00992312.js} +203 -157
- package/dist/__shared/cjs/{index-8f2648af.js → index-615ed9b2.js} +11 -3
- package/dist/components/Accordion/Accordion2.js +3 -3
- package/dist/components/Button/Button.js +6 -54
- package/dist/components/Button/Button2.js +54 -6
- package/dist/components/Button/index.js +1 -1
- package/dist/components/ButtonGroup/ButtonGroup2.js +3 -3
- package/dist/components/Checkbox/Checkbox2.js +3 -3
- package/dist/components/Checkbox/VisualCheckbox2.js +3 -3
- package/dist/components/ColorPicker/ColorPicker2.js +3 -3
- package/dist/components/Combobox/Combobox2.js +3 -3
- package/dist/components/ConfigPane/ConfigPane2.js +3 -3
- package/dist/components/Divider/Divider2.js +3 -3
- package/dist/components/Dropdown/Dropdown2.js +3 -3
- package/dist/components/FilePicker/FilePicker.js +2 -2
- package/dist/components/FilePicker/FilePicker2.js +3 -3
- package/dist/components/FormField/Caption.js +3 -3
- package/dist/components/FormField/FormField2.js +3 -3
- package/dist/components/FullScreenTakeover/FullScreenTakeover2.js +3 -3
- package/dist/components/Icon/IconTypes.js +2 -0
- package/dist/components/IconButton/IconButton2.js +3 -3
- package/dist/components/InlineInput/InlineInput2.js +3 -3
- package/dist/components/Input/Input2.js +3 -3
- package/dist/components/InputGroup/InputGroup2.js +3 -3
- package/dist/components/Label/Label2.js +3 -3
- package/dist/components/Link/Link2.js +3 -3
- package/dist/components/LoadingSpinner/LoadingSpinner.js +1 -1
- package/dist/components/LoadingSpinner/LoadingSpinner2.js +3 -3
- package/dist/components/LogicEditor/ConditionSet.js +4 -5
- package/dist/components/LogicEditor/Controls.js +19 -4
- package/dist/components/LogicEditor/LogicEditor.js +9 -3
- package/dist/components/LogicEditor/LogicEditor2.js +3 -3
- package/dist/components/LogicEditor/utils.js +20 -1
- package/dist/components/Modal/Modal2.js +3 -3
- package/dist/components/NewMenu/NewMenu.js +3 -3
- package/dist/components/NewMenu/parts/ArrowNav/ArrowNav.js +9 -7
- package/dist/components/NumberStepper/NumberStepper2.js +3 -3
- package/dist/components/PageLayout/PageLayout.js +3 -3
- package/dist/components/Pagination/Pagination2.js +3 -3
- package/dist/components/Pagination/PaginationNextButton.js +1 -1
- package/dist/components/Pagination/PaginationPreviousButton.js +1 -1
- package/dist/components/Popover/Popover2.js +3 -3
- package/dist/components/QuickSearch/QuickSearch2.js +3 -3
- package/dist/components/Radio/Radio2.js +3 -3
- package/dist/components/SearchInput/SearchInput2.js +3 -3
- package/dist/components/SidebarNav/SidebarNav2.js +3 -3
- package/dist/components/Slider/Slider2.js +3 -3
- package/dist/components/Switch/Switch2.js +3 -3
- package/dist/components/Table/Table2.js +3 -3
- package/dist/components/Tabs/Tabs2.js +3 -3
- package/dist/components/Tooltip/Tooltip.js +8 -6
- package/dist/components/Tooltip/Tooltip2.js +3 -3
- package/dist/components/deprecated_ColorPicker/ColorPicker.js +1 -1
- package/dist/components/deprecated_ColorPicker/ColorPicker2.js +3 -3
- package/dist/components/deprecated_NumberStepper/NumberStepper2.js +3 -3
- package/dist/components/deprecated_Tabs/Tabs2.js +3 -3
- package/dist/components/deprecated_Toolbar/Toolbar2.js +3 -3
- package/dist/hooks/useOverlay/useOverlay2.js +3 -3
- package/dist/hooks/useScreenReaderAnnouncement/useScreenReaderAnnouncement2.js +3 -3
- package/dist/icons/Icon.js +3 -3
- package/dist/icons/components/RecordIcon.js +6 -0
- package/dist/icons/components/StopRecordingIcon.js +6 -0
- package/dist/icons/index.d.ts +4 -0
- package/dist/icons/index.es.js +2 -0
- package/dist/icons/index.js +3 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.es.js +2 -2
- package/dist/index.js +3 -3
- package/dist/next/AdvancedTable/AdvancedTable2.js +3 -3
- package/dist/next/CollapsibleSearchInput/CollapsibleSearchInput2.js +3 -3
- package/dist/next/Combobox/Combobox2.js +3 -3
- package/dist/next/Drawer/Drawer2.js +3 -3
- package/dist/next/FilterAnchor/FilterAnchor2.js +3 -3
- package/dist/next/Input/Input2.js +3 -3
- package/dist/next/Menu/Menu.js +29 -3
- package/dist/next/Menu/Menu2.js +3 -3
- package/dist/next/Menu/MenuButton.js +7 -4
- package/dist/next/Menu/MenuContext.js +2 -2
- package/dist/next/Menu/MenuItem.js +36 -5
- package/dist/next/Menu/MenuPane.js +111 -21
- package/dist/next/Menu/MenuSearch.js +29 -35
- package/dist/next/Menu/SubMenu.js +165 -31
- package/dist/next/Menu/constants.js +8 -2
- package/dist/next/Menu/index.js +5 -5
- package/dist/next/Menu/usePaneSearch.js +25 -0
- package/dist/next/PhoneNumberInput/PhoneNumberInput2.js +3 -3
- package/dist/next/SplitButton/SplitButton.js +1 -1
- package/dist/next/SplitButton/SplitButton2.js +3 -3
- package/dist/next/TimePicker/TimePicker2.js +3 -3
- package/dist/next/ToggleButton/ToggleButton.js +79 -0
- package/dist/next/ToggleButton/ToggleButtonGroup.js +39 -0
- package/dist/next/ToggleButton/ToggleButtonGroupContext.js +9 -0
- package/dist/next/ToggleButton/index.js +2 -0
- package/dist/next/ToggleButton/styles.js +8 -0
- package/dist/next/index.d.ts +28 -0
- package/dist/next/index.es.js +8 -5
- package/dist/next/index.js +651 -250
- package/dist/utils/Flyout/Flyout2.js +3 -3
- package/icons/package.json +2 -2
- package/next/package.json +2 -2
- package/package.json +4 -4
|
@@ -1,15 +1,20 @@
|
|
|
1
1
|
import _extends from '@babel/runtime-corejs3/helpers/extends';
|
|
2
|
-
import
|
|
2
|
+
import _includesInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/includes';
|
|
3
|
+
import React__default, { useState, useRef, useMemo } from 'react';
|
|
3
4
|
import { Portal, Content } from '@radix-ui/react-dropdown-menu';
|
|
5
|
+
import classNames from 'classnames';
|
|
4
6
|
import styles from './Menu2.js';
|
|
5
7
|
import { usePortalTarget } from '../../components/UIProvider/PortalTargetContext.js';
|
|
6
8
|
import { useMenuContext, PaneContextProvider } from './MenuContext.js';
|
|
7
9
|
import '../../utils/index.js';
|
|
8
|
-
import { DATA_TESTID_SUFFIXES } from './constants.js';
|
|
9
|
-
import
|
|
10
|
+
import { DATA_TESTID_SUFFIXES, KEYS } from './constants.js';
|
|
11
|
+
import MenuSearch from './MenuSearch.js';
|
|
12
|
+
import usePaneSearch from './usePaneSearch.js';
|
|
10
13
|
import '../../hooks/index.js';
|
|
11
|
-
import
|
|
14
|
+
import { useDidUpdate } from '../../hooks/useDidUpdate/useDidUpdate.js';
|
|
12
15
|
import getSubDataTestId from '../../utils/getSubDataTestId/getSubDataTestId.js';
|
|
16
|
+
import useEventListener from '../../hooks/useEventListener/useEventListener.js';
|
|
17
|
+
import { setIsKeyboardUser } from '../../utils/keyboardUser/keyboardUser.js';
|
|
13
18
|
import mergeRefs from '../../utils/mergeRefs/mergeRefs.js';
|
|
14
19
|
|
|
15
20
|
const MenuPane = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
@@ -20,45 +25,130 @@ const MenuPane = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
|
20
25
|
searchValue: externalSearchValue,
|
|
21
26
|
onSearchValueChange,
|
|
22
27
|
isSearchFilteringDisabled = false,
|
|
28
|
+
className,
|
|
29
|
+
style,
|
|
23
30
|
...rest
|
|
24
31
|
} = _ref;
|
|
25
|
-
const [
|
|
32
|
+
const [items, setItems] = useState([]);
|
|
33
|
+
const flyoutRef = useRef(null);
|
|
34
|
+
const {
|
|
35
|
+
internalSearchValue,
|
|
36
|
+
setSearchValue,
|
|
37
|
+
zeroSearchResults,
|
|
38
|
+
noMatchesText
|
|
39
|
+
} = usePaneSearch(externalSearchValue, onSearchValueChange, items);
|
|
26
40
|
const portalTarget = usePortalTarget();
|
|
27
41
|
const [side, align] = useMemo(() => {
|
|
28
42
|
var _placement$split, _placement$split2;
|
|
29
43
|
|
|
30
44
|
return (_placement$split = placement === null || placement === void 0 ? void 0 : (_placement$split2 = placement.split) === null || _placement$split2 === void 0 ? void 0 : _placement$split2.call(placement, '-')) !== null && _placement$split !== void 0 ? _placement$split : [];
|
|
31
45
|
}, [placement]);
|
|
32
|
-
const [items, setItems] = useState([]);
|
|
33
46
|
const {
|
|
34
|
-
dataTestId: rootDataTestId
|
|
35
|
-
|
|
47
|
+
dataTestId: rootDataTestId,
|
|
48
|
+
openPaneDepth,
|
|
49
|
+
setMaskHeight,
|
|
50
|
+
maskHeight,
|
|
51
|
+
open,
|
|
52
|
+
triggerRef
|
|
53
|
+
} = useMenuContext(); // In order to preseve the css animation for vertical resizing, we cannot set the height of this pane to `auto`. It must be a pixel value.
|
|
54
|
+
// We cache the pixel value here, to use it later if the user returns to this pane from a submenu.
|
|
55
|
+
|
|
56
|
+
const initialHeightOfThisPane = useRef(null);
|
|
57
|
+
useDidUpdate(() => {
|
|
58
|
+
if (openPaneDepth === 1) {
|
|
59
|
+
if (initialHeightOfThisPane.current === null) {
|
|
60
|
+
window.requestAnimationFrame(() => {
|
|
61
|
+
var _flyoutRef$current$cl, _flyoutRef$current;
|
|
62
|
+
|
|
63
|
+
initialHeightOfThisPane.current = (_flyoutRef$current$cl = (_flyoutRef$current = flyoutRef.current) === null || _flyoutRef$current === void 0 ? void 0 : _flyoutRef$current.clientHeight) !== null && _flyoutRef$current$cl !== void 0 ? _flyoutRef$current$cl : null;
|
|
64
|
+
setMaskHeight(initialHeightOfThisPane.current);
|
|
65
|
+
});
|
|
66
|
+
} else {
|
|
67
|
+
setMaskHeight(initialHeightOfThisPane.current);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}, [openPaneDepth]);
|
|
36
71
|
const dataTestId = getSubDataTestId(rootDataTestId, DATA_TESTID_SUFFIXES.MENU_PANE);
|
|
37
|
-
const
|
|
72
|
+
const animatedLeft = useMemo(() => openPaneDepth > 1, [openPaneDepth]);
|
|
73
|
+
useEventListener(flyoutRef, 'keydown', e => {
|
|
74
|
+
var _context;
|
|
75
|
+
|
|
76
|
+
return _includesInstanceProperty(_context = Object.values(KEYS).flat()).call(_context, e.key) && setIsKeyboardUser(true);
|
|
77
|
+
}, {
|
|
78
|
+
additionalDependencies: [openPaneDepth]
|
|
79
|
+
});
|
|
80
|
+
useEventListener(flyoutRef, 'pointerenter', () => setIsKeyboardUser(false), {
|
|
81
|
+
additionalDependencies: [openPaneDepth]
|
|
82
|
+
});
|
|
83
|
+
const defaultSide = useMemo(() => {
|
|
84
|
+
var _triggerRef$current;
|
|
85
|
+
|
|
86
|
+
const rect = triggerRef === null || triggerRef === void 0 ? void 0 : (_triggerRef$current = triggerRef.current) === null || _triggerRef$current === void 0 ? void 0 : _triggerRef$current.getBoundingClientRect();
|
|
87
|
+
|
|
88
|
+
if (!rect) {
|
|
89
|
+
return 'bottom';
|
|
90
|
+
} // hard coded in Menu.less
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
let maxHeight = 350;
|
|
94
|
+
|
|
95
|
+
if (flyoutRef.current) {
|
|
96
|
+
const computedString = window.getComputedStyle(flyoutRef.current).maxHeight.slice(0, -2);
|
|
97
|
+
|
|
98
|
+
if (computedString !== '' && !Number.isNaN(+computedString)) {
|
|
99
|
+
maxHeight = +computedString;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
const distanceToBottom = window.innerHeight - rect.bottom;
|
|
104
|
+
const distanceToTop = rect.top;
|
|
105
|
+
|
|
106
|
+
if (distanceToBottom > maxHeight) {
|
|
107
|
+
return 'bottom';
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
if (distanceToTop > maxHeight) {
|
|
111
|
+
return 'top';
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
return 'bottom';
|
|
115
|
+
}, [open, triggerRef]);
|
|
38
116
|
return /*#__PURE__*/React__default.createElement(PaneContextProvider, {
|
|
39
117
|
items: items,
|
|
40
118
|
setItems: setItems,
|
|
41
119
|
value: {
|
|
42
120
|
dataTestId,
|
|
43
121
|
searchValue: internalSearchValue,
|
|
44
|
-
|
|
45
|
-
|
|
122
|
+
isSearchFilteringDisabled,
|
|
123
|
+
isInteractive: !animatedLeft,
|
|
124
|
+
flyoutRef
|
|
46
125
|
}
|
|
47
126
|
}, /*#__PURE__*/React__default.createElement(Portal, {
|
|
48
127
|
container: portalTarget || undefined
|
|
128
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
129
|
+
className: styles.maskContainer
|
|
49
130
|
}, /*#__PURE__*/React__default.createElement(Content, _extends({}, rest, {
|
|
50
131
|
sideOffset: 6,
|
|
51
132
|
loop: true,
|
|
52
|
-
side: side ||
|
|
133
|
+
side: side || defaultSide,
|
|
53
134
|
align: align || 'start',
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
135
|
+
ref: mergeRefs(ref, flyoutRef),
|
|
136
|
+
"data-testid": dataTestId,
|
|
137
|
+
className: classNames(className, {
|
|
138
|
+
[styles.animatedLeft]: animatedLeft,
|
|
139
|
+
[styles.containsStickyBox]: isSearchable
|
|
140
|
+
}, styles.flyout),
|
|
141
|
+
style: { ...style,
|
|
142
|
+
height: internalSearchValue && openPaneDepth === 1 ? undefined : maskHeight !== null && maskHeight !== void 0 ? maskHeight : undefined
|
|
143
|
+
}
|
|
144
|
+
}), isSearchable && /*#__PURE__*/React__default.createElement("div", {
|
|
145
|
+
className: styles.stickyBox
|
|
146
|
+
}, /*#__PURE__*/React__default.createElement(MenuSearch, {
|
|
147
|
+
setSearchValue: setSearchValue
|
|
148
|
+
})), zeroSearchResults && /*#__PURE__*/React__default.createElement("div", {
|
|
149
|
+
className: classNames(styles.menuItem, styles.noItems),
|
|
150
|
+
"aria-live": "assertive"
|
|
151
|
+
}, noMatchesText), children))));
|
|
62
152
|
});
|
|
63
153
|
|
|
64
|
-
export { MenuPane
|
|
154
|
+
export { MenuPane as default };
|
|
@@ -1,46 +1,43 @@
|
|
|
1
1
|
import _includesInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/includes';
|
|
2
|
-
import React__default, { useRef,
|
|
2
|
+
import React__default, { useRef, useEffect, useState } from 'react';
|
|
3
3
|
import { Item } from '@radix-ui/react-dropdown-menu';
|
|
4
|
+
import classNames from 'classnames';
|
|
4
5
|
import styles from './Menu2.js';
|
|
5
6
|
import '../Input/index.js';
|
|
6
7
|
import '../../icons/index.es.js';
|
|
7
8
|
import '../../utils/index.js';
|
|
8
9
|
import { usePaneContext } from './MenuContext.js';
|
|
9
|
-
import { DATA_TESTID_SUFFIXES } from './constants.js';
|
|
10
|
+
import { DATA_TESTID_SUFFIXES, KEYS } from './constants.js';
|
|
10
11
|
import '../../hooks/index.js';
|
|
11
12
|
import useTranslation from '../../utils/Translation/useTranslation.js';
|
|
12
13
|
import useEventListener from '../../hooks/useEventListener/useEventListener.js';
|
|
14
|
+
import mergeRefs from '../../utils/mergeRefs/mergeRefs.js';
|
|
13
15
|
import Input from '../Input/Input.js';
|
|
14
16
|
import SearchIcon from '../../icons/components/SearchIcon.js';
|
|
15
17
|
|
|
16
|
-
const MenuSearch = _ref => {
|
|
18
|
+
const MenuSearch = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
17
19
|
let {
|
|
18
|
-
setSearchValue
|
|
19
|
-
items,
|
|
20
|
-
paneRef
|
|
20
|
+
setSearchValue
|
|
21
21
|
} = _ref;
|
|
22
22
|
const itemRef = useRef(null);
|
|
23
23
|
const inputRef = useRef(null);
|
|
24
24
|
const {
|
|
25
25
|
translate
|
|
26
26
|
} = useTranslation();
|
|
27
|
-
const noMatchesText = translate('menu.noItemsToDisplay');
|
|
28
27
|
const searchText = translate('searchText');
|
|
29
28
|
const {
|
|
30
29
|
dataTestId: menuParentDataTestId,
|
|
31
|
-
searchValue = ''
|
|
30
|
+
searchValue = '',
|
|
31
|
+
isInteractive,
|
|
32
|
+
closeSubmenu,
|
|
33
|
+
flyoutRef
|
|
32
34
|
} = usePaneContext();
|
|
33
|
-
const dataTestId = menuParentDataTestId === null || menuParentDataTestId === void 0 ? void 0 : menuParentDataTestId.replace(DATA_TESTID_SUFFIXES.MENU_PANE, DATA_TESTID_SUFFIXES.MENU_SEARCH);
|
|
34
|
-
|
|
35
|
-
const [zeroSearchResults, setZeroSearchResults] = useState();
|
|
36
|
-
useEffect(() => {
|
|
37
|
-
setZeroSearchResults((items === null || items === void 0 ? void 0 : items.filter(item => item.element.current).length) === 0);
|
|
38
|
-
}, [items, searchValue]);
|
|
35
|
+
const dataTestId = menuParentDataTestId === null || menuParentDataTestId === void 0 ? void 0 : menuParentDataTestId.replace(DATA_TESTID_SUFFIXES.MENU_PANE, DATA_TESTID_SUFFIXES.MENU_SEARCH);
|
|
39
36
|
useEffect(() => () => setSearchValue(''), [setSearchValue]);
|
|
40
|
-
const [previouslyFocusedElement, setPreviouslyFocusedElement] = useState(); //
|
|
37
|
+
const [previouslyFocusedElement, setPreviouslyFocusedElement] = useState(); // hack to keep focus on search input on mouse leave
|
|
41
38
|
|
|
42
|
-
useEventListener(
|
|
43
|
-
if (e.target === e.currentTarget && previouslyFocusedElement === itemRef.current) {
|
|
39
|
+
useEventListener(flyoutRef, 'focus', e => {
|
|
40
|
+
if (e.target === e.currentTarget && previouslyFocusedElement === itemRef.current && isInteractive) {
|
|
44
41
|
var _inputRef$current;
|
|
45
42
|
|
|
46
43
|
(_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : _inputRef$current.focus();
|
|
@@ -51,7 +48,9 @@ const MenuSearch = _ref => {
|
|
|
51
48
|
isCaptureEvent: true
|
|
52
49
|
});
|
|
53
50
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(Item, {
|
|
54
|
-
className: styles.searchBox
|
|
51
|
+
className: classNames(styles.searchBox, {
|
|
52
|
+
[styles.unresponsive]: !isInteractive
|
|
53
|
+
}) // prevents dropdown from closing
|
|
55
54
|
,
|
|
56
55
|
onSelect: e => e.preventDefault(),
|
|
57
56
|
onFocus: () => {
|
|
@@ -60,7 +59,7 @@ const MenuSearch = _ref => {
|
|
|
60
59
|
return (_inputRef$current2 = inputRef.current) === null || _inputRef$current2 === void 0 ? void 0 : _inputRef$current2.focus();
|
|
61
60
|
},
|
|
62
61
|
role: undefined,
|
|
63
|
-
ref: itemRef
|
|
62
|
+
ref: mergeRefs(itemRef, ref)
|
|
64
63
|
}, /*#__PURE__*/React__default.createElement(Input, {
|
|
65
64
|
"data-testid": dataTestId,
|
|
66
65
|
role: "searchbox",
|
|
@@ -68,18 +67,18 @@ const MenuSearch = _ref => {
|
|
|
68
67
|
onChange: e => setSearchValue(e.target.value),
|
|
69
68
|
placeholder: searchText,
|
|
70
69
|
onKeyDown: e => {
|
|
71
|
-
var _e$target;
|
|
70
|
+
var _e$target, _context, _context2;
|
|
72
71
|
|
|
73
72
|
// stop propagation to prevent typeAhead
|
|
74
|
-
e.stopPropagation();
|
|
75
|
-
const keysToForward = ['Escape', 'ArrowUp', 'ArrowDown', 'PageUp', 'PageDown', 'Home', 'End']; // allow caret movement through text entry, but close searchable submenu if on the very left
|
|
73
|
+
e.stopPropagation(); // allow caret movement through text entry, but close searchable submenu if on the very left
|
|
76
74
|
|
|
77
|
-
if (((_e$target = e.target) === null || _e$target === void 0 ? void 0 : _e$target.selectionStart) === 0) {
|
|
78
|
-
|
|
75
|
+
if (((_e$target = e.target) === null || _e$target === void 0 ? void 0 : _e$target.selectionStart) === 0 && _includesInstanceProperty(_context = KEYS.CLOSE_SUBMENU).call(_context, e.key)) {
|
|
76
|
+
closeSubmenu === null || closeSubmenu === void 0 ? void 0 : closeSubmenu(e);
|
|
77
|
+
return;
|
|
79
78
|
} // forward keypress directly to `Item` to let Radix handle keyboard navigation
|
|
80
79
|
|
|
81
80
|
|
|
82
|
-
if (_includesInstanceProperty(
|
|
81
|
+
if (_includesInstanceProperty(_context2 = KEYS.IGNORED_BY_SEARCH_INPUT).call(_context2, e.key)) {
|
|
83
82
|
var _itemRef$current;
|
|
84
83
|
|
|
85
84
|
// `view` types are incompatible
|
|
@@ -92,14 +91,9 @@ const MenuSearch = _ref => {
|
|
|
92
91
|
}
|
|
93
92
|
},
|
|
94
93
|
leftAddOn: /*#__PURE__*/React__default.createElement(SearchIcon, null),
|
|
95
|
-
ref: inputRef
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
role: "option" // `aria-selected` is omitted because this option is not selectable
|
|
100
|
-
,
|
|
101
|
-
"aria-live": "assertive"
|
|
102
|
-
}, noMatchesText));
|
|
103
|
-
};
|
|
94
|
+
ref: inputRef,
|
|
95
|
+
className: styles.searchInput
|
|
96
|
+
})));
|
|
97
|
+
});
|
|
104
98
|
|
|
105
|
-
export { MenuSearch
|
|
99
|
+
export { MenuSearch as default };
|
|
@@ -1,19 +1,23 @@
|
|
|
1
1
|
import _extends from '@babel/runtime-corejs3/helpers/extends';
|
|
2
2
|
import _includesInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/includes';
|
|
3
|
-
import React__default, {
|
|
4
|
-
import { Sub, SubTrigger, SubContent } from '@radix-ui/react-dropdown-menu';
|
|
3
|
+
import React__default, { useState, useRef, useMemo, useEffect } from 'react';
|
|
4
|
+
import { Sub, SubTrigger, SubContent, Item } from '@radix-ui/react-dropdown-menu';
|
|
5
5
|
import classNames from 'classnames';
|
|
6
6
|
import styles from './Menu2.js';
|
|
7
7
|
import '../../icons/index.es.js';
|
|
8
|
-
import { usePaneContext, PaneContextProvider } from './MenuContext.js';
|
|
8
|
+
import { usePaneContext, useMenuContext, PaneContextProvider } from './MenuContext.js';
|
|
9
9
|
import '../../utils/index.js';
|
|
10
|
-
import { DATA_TESTID_SUFFIXES } from './constants.js';
|
|
11
|
-
import
|
|
10
|
+
import { DATA_TESTID_SUFFIXES, KEYS } from './constants.js';
|
|
11
|
+
import MenuSearch from './MenuSearch.js';
|
|
12
12
|
import '../../hooks/index.js';
|
|
13
|
-
import
|
|
13
|
+
import usePaneSearch from './usePaneSearch.js';
|
|
14
|
+
import useId from '../../hooks/useId/useId.js';
|
|
14
15
|
import getSubDataTestId from '../../utils/getSubDataTestId/getSubDataTestId.js';
|
|
16
|
+
import { useDidUpdate } from '../../hooks/useDidUpdate/useDidUpdate.js';
|
|
17
|
+
import { getIsKeyboardUser } from '../../utils/keyboardUser/keyboardUser.js';
|
|
15
18
|
import ChevronRightIcon from '../../icons/components/ChevronRightIcon.js';
|
|
16
19
|
import mergeRefs from '../../utils/mergeRefs/mergeRefs.js';
|
|
20
|
+
import ArrowLeftIcon from '../../icons/components/ArrowLeftIcon.js';
|
|
17
21
|
|
|
18
22
|
const SubMenu = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
19
23
|
let {
|
|
@@ -24,31 +28,130 @@ const SubMenu = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
|
24
28
|
searchValue: externalSearchValue,
|
|
25
29
|
onSearchValueChange,
|
|
26
30
|
isSearchFilteringDisabled: isSearchFilteringDisabledForChildren = false,
|
|
31
|
+
className,
|
|
32
|
+
style,
|
|
27
33
|
...rest
|
|
28
34
|
} = _ref;
|
|
29
|
-
const
|
|
30
|
-
const
|
|
35
|
+
const [items, setItems] = useState([]);
|
|
36
|
+
const {
|
|
37
|
+
internalSearchValue,
|
|
38
|
+
setSearchValue,
|
|
39
|
+
zeroSearchResults,
|
|
40
|
+
noMatchesText
|
|
41
|
+
} = usePaneSearch(externalSearchValue, onSearchValueChange, items);
|
|
42
|
+
const internalId = useId();
|
|
43
|
+
const triggerRef = useRef(null);
|
|
44
|
+
const flyoutRef = useRef(null);
|
|
45
|
+
const searchItemRef = useRef(null);
|
|
46
|
+
const backButtonRef = useRef(null);
|
|
31
47
|
const {
|
|
32
|
-
dataTestId:
|
|
33
|
-
childIndex:
|
|
34
|
-
searchValue:
|
|
35
|
-
isSearchFilteringDisabled:
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
48
|
+
dataTestId: paneContainingTriggerDataTestId,
|
|
49
|
+
childIndex: triggerIndex,
|
|
50
|
+
searchValue: paneContainingTriggerSearchValue,
|
|
51
|
+
isSearchFilteringDisabled: isSearchFilteringDisabledForPaneContainingTrigger,
|
|
52
|
+
isInteractive: paneContainingTriggerIsInteractive,
|
|
53
|
+
closeSubmenu: closeSubmenuContainingTrigger
|
|
54
|
+
} = usePaneContext(triggerRef);
|
|
55
|
+
const {
|
|
56
|
+
openPaneDepth: totalOpenPaneDepth,
|
|
57
|
+
registerSubmenu,
|
|
58
|
+
setMaskHeight
|
|
59
|
+
} = useMenuContext();
|
|
60
|
+
const thisPanesDepth = useRef(totalOpenPaneDepth + 1).current;
|
|
61
|
+
const paneDataTestId = getSubDataTestId(paneContainingTriggerDataTestId, String(triggerIndex));
|
|
62
|
+
const backButtonDataTestId = paneDataTestId === null || paneDataTestId === void 0 ? void 0 : paneDataTestId.replace(DATA_TESTID_SUFFIXES.MENU_PANE, DATA_TESTID_SUFFIXES.MENU_BACK);
|
|
39
63
|
const triggerDataTestId = paneDataTestId === null || paneDataTestId === void 0 ? void 0 : paneDataTestId.replace(DATA_TESTID_SUFFIXES.MENU_PANE, DATA_TESTID_SUFFIXES.MENU_ITEM);
|
|
40
|
-
const
|
|
41
|
-
const isVisible = useMemo(() => {
|
|
64
|
+
const triggerIsVisible = useMemo(() => {
|
|
42
65
|
var _context;
|
|
43
66
|
|
|
44
|
-
return
|
|
45
|
-
}, [
|
|
46
|
-
|
|
47
|
-
|
|
67
|
+
return isSearchFilteringDisabledForPaneContainingTrigger || !paneContainingTriggerSearchValue || typeof label === 'string' && _includesInstanceProperty(_context = label.toLowerCase()).call(_context, paneContainingTriggerSearchValue.toLowerCase());
|
|
68
|
+
}, [paneContainingTriggerSearchValue, label, isSearchFilteringDisabledForPaneContainingTrigger]);
|
|
69
|
+
const [isPaneInDOM, setIsPaneInDOM] = useState(false);
|
|
70
|
+
const [isFrameAfterPaneAddedToDOM, setIsFrameAfterPaneAddedToDOM] = useState(false);
|
|
71
|
+
const [isTransitioningFromRight, setIsTransitioningFromRight] = useState(false);
|
|
72
|
+
useDidUpdate(() => {
|
|
73
|
+
if (isPaneInDOM) {
|
|
74
|
+
setIsTransitioningFromRight(true); // trigger css transition
|
|
75
|
+
|
|
76
|
+
setIsFrameAfterPaneAddedToDOM(true);
|
|
77
|
+
window.requestAnimationFrame(() => setIsFrameAfterPaneAddedToDOM(false));
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
registerSubmenu(internalId, isPaneInDOM);
|
|
81
|
+
}, [isPaneInDOM]);
|
|
82
|
+
useEffect(() => () => registerSubmenu(internalId, false), []);
|
|
83
|
+
|
|
84
|
+
const closeThisSubmenu = e => {
|
|
85
|
+
// prevent closing the entire menu, and Radix keyboard navigation
|
|
86
|
+
e.preventDefault();
|
|
87
|
+
registerSubmenu(internalId, false);
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
useDidUpdate(() => {
|
|
91
|
+
if (thisPanesDepth === totalOpenPaneDepth) {
|
|
92
|
+
window.requestAnimationFrame(() => {
|
|
93
|
+
var _flyoutRef$current$cl, _flyoutRef$current;
|
|
94
|
+
|
|
95
|
+
setMaskHeight((_flyoutRef$current$cl = (_flyoutRef$current = flyoutRef.current) === null || _flyoutRef$current === void 0 ? void 0 : _flyoutRef$current.clientHeight) !== null && _flyoutRef$current$cl !== void 0 ? _flyoutRef$current$cl : null);
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
}, [totalOpenPaneDepth, internalSearchValue]);
|
|
99
|
+
const animatedLeft = useMemo(() => thisPanesDepth < totalOpenPaneDepth, [totalOpenPaneDepth]);
|
|
100
|
+
const animatedRight = useMemo(() => thisPanesDepth > totalOpenPaneDepth || isFrameAfterPaneAddedToDOM, [totalOpenPaneDepth, isFrameAfterPaneAddedToDOM]);
|
|
101
|
+
|
|
102
|
+
const handlePaneTransitionEnd = () => {
|
|
103
|
+
if (animatedLeft) {
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
if (animatedRight) {
|
|
108
|
+
setIsPaneInDOM(false);
|
|
109
|
+
|
|
110
|
+
if (getIsKeyboardUser()) {
|
|
111
|
+
var _triggerRef$current;
|
|
112
|
+
|
|
113
|
+
(_triggerRef$current = triggerRef.current) === null || _triggerRef$current === void 0 ? void 0 : _triggerRef$current.focus();
|
|
114
|
+
}
|
|
115
|
+
} else {
|
|
116
|
+
var _flyoutRef$current2;
|
|
117
|
+
|
|
118
|
+
// if the newly closed submenu doesn't place the focus on its trigger
|
|
119
|
+
if (!((_flyoutRef$current2 = flyoutRef.current) !== null && _flyoutRef$current2 !== void 0 && _flyoutRef$current2.contains(document.activeElement)) && getIsKeyboardUser()) {
|
|
120
|
+
if (searchItemRef.current) {
|
|
121
|
+
searchItemRef.current.focus();
|
|
122
|
+
} else if (backButtonRef.current) {
|
|
123
|
+
backButtonRef.current.focus();
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
setIsTransitioningFromRight(false);
|
|
128
|
+
}
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
return triggerIsVisible ? /*#__PURE__*/React__default.createElement(Sub, {
|
|
132
|
+
open: isPaneInDOM
|
|
133
|
+
}, /*#__PURE__*/React__default.createElement(SubTrigger, {
|
|
134
|
+
className: classNames(styles.menuItem, styles.subMenu, {
|
|
135
|
+
[styles.unresponsive]: !paneContainingTriggerIsInteractive
|
|
136
|
+
}),
|
|
48
137
|
"data-testid": triggerDataTestId,
|
|
49
138
|
"aria-disabled": isDisabled,
|
|
50
|
-
|
|
51
|
-
|
|
139
|
+
ref: triggerRef,
|
|
140
|
+
onClick: () => !isDisabled && setIsPaneInDOM(true),
|
|
141
|
+
onKeyDown: e => {
|
|
142
|
+
var _context2, _context3;
|
|
143
|
+
|
|
144
|
+
if (!paneContainingTriggerIsInteractive) {
|
|
145
|
+
e.preventDefault();
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
if (!isDisabled && _includesInstanceProperty(_context2 = KEYS.OPEN_SUBMENU).call(_context2, e.key)) {
|
|
150
|
+
setIsPaneInDOM(true);
|
|
151
|
+
} else if (_includesInstanceProperty(_context3 = KEYS.CLOSE_SUBMENU).call(_context3, e.key)) {
|
|
152
|
+
closeSubmenuContainingTrigger === null || closeSubmenuContainingTrigger === void 0 ? void 0 : closeSubmenuContainingTrigger(e);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
52
155
|
}, label, /*#__PURE__*/React__default.createElement(ChevronRightIcon, {
|
|
53
156
|
className: styles.rightIcon
|
|
54
157
|
})), /*#__PURE__*/React__default.createElement(PaneContextProvider, {
|
|
@@ -57,18 +160,49 @@ const SubMenu = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
|
57
160
|
value: {
|
|
58
161
|
dataTestId: paneDataTestId,
|
|
59
162
|
searchValue: internalSearchValue,
|
|
60
|
-
isSearchFilteringDisabled: isSearchFilteringDisabledForChildren
|
|
163
|
+
isSearchFilteringDisabled: isSearchFilteringDisabledForChildren,
|
|
164
|
+
isInteractive: !isTransitioningFromRight && !animatedLeft && !animatedRight,
|
|
165
|
+
closeSubmenu: closeThisSubmenu,
|
|
166
|
+
flyoutRef
|
|
61
167
|
}
|
|
62
168
|
}, /*#__PURE__*/React__default.createElement(SubContent, _extends({}, rest, {
|
|
63
|
-
className: styles.flyout,
|
|
64
169
|
loop: true,
|
|
65
170
|
"data-testid": paneDataTestId,
|
|
66
|
-
ref: mergeRefs(ref,
|
|
67
|
-
|
|
171
|
+
ref: mergeRefs(ref, flyoutRef),
|
|
172
|
+
className: classNames(className, styles.flyout, styles.containsStickyBox, {
|
|
173
|
+
[styles.animatedRight]: animatedRight,
|
|
174
|
+
[styles.animatedLeft]: animatedLeft
|
|
175
|
+
}),
|
|
176
|
+
onTransitionEnd: handlePaneTransitionEnd,
|
|
177
|
+
style: { ...style,
|
|
178
|
+
zIndex: thisPanesDepth
|
|
179
|
+
}
|
|
180
|
+
}), /*#__PURE__*/React__default.createElement("div", {
|
|
181
|
+
className: styles.stickyBox
|
|
182
|
+
}, isSearchable && /*#__PURE__*/React__default.createElement(MenuSearch, {
|
|
68
183
|
setSearchValue: setSearchValue,
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
184
|
+
ref: searchItemRef
|
|
185
|
+
}), /*#__PURE__*/React__default.createElement(Item, {
|
|
186
|
+
className: classNames(styles.menuItem, {
|
|
187
|
+
[styles.unresponsive]: isTransitioningFromRight || animatedLeft || animatedRight
|
|
188
|
+
}),
|
|
189
|
+
"data-testid": backButtonDataTestId,
|
|
190
|
+
onSelect: closeThisSubmenu,
|
|
191
|
+
ref: backButtonRef,
|
|
192
|
+
onKeyDown: e => {
|
|
193
|
+
var _context4;
|
|
194
|
+
|
|
195
|
+
if (_includesInstanceProperty(_context4 = KEYS.CLOSE_SUBMENU).call(_context4, e.key)) {
|
|
196
|
+
closeThisSubmenu(e);
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
}, /*#__PURE__*/React__default.createElement(ArrowLeftIcon, {
|
|
200
|
+
size: "small",
|
|
201
|
+
className: styles.backIcon
|
|
202
|
+
}), label)), zeroSearchResults && /*#__PURE__*/React__default.createElement("div", {
|
|
203
|
+
className: classNames(styles.menuItem, styles.noItems),
|
|
204
|
+
"aria-live": "assertive"
|
|
205
|
+
}, noMatchesText), children))) : null;
|
|
72
206
|
});
|
|
73
207
|
|
|
74
|
-
export { SubMenu
|
|
208
|
+
export { SubMenu as default };
|
|
@@ -3,7 +3,13 @@ const DATA_TESTID_SUFFIXES = {
|
|
|
3
3
|
MENU_PANE: 'menupane',
|
|
4
4
|
MENU_ITEM: 'menuitem',
|
|
5
5
|
MENU_BUTTON: 'menubutton',
|
|
6
|
-
MENU_SEARCH: 'menusearch'
|
|
6
|
+
MENU_SEARCH: 'menusearch',
|
|
7
|
+
MENU_BACK: 'menuback'
|
|
8
|
+
};
|
|
9
|
+
const KEYS = {
|
|
10
|
+
OPEN_SUBMENU: ['ArrowRight', 'Enter', ' '],
|
|
11
|
+
CLOSE_SUBMENU: ['ArrowLeft'],
|
|
12
|
+
IGNORED_BY_SEARCH_INPUT: ['Escape', 'ArrowUp', 'ArrowDown', 'PageUp', 'PageDown', 'Home', 'End']
|
|
7
13
|
};
|
|
8
14
|
|
|
9
|
-
export { DATA_TESTID_SUFFIXES };
|
|
15
|
+
export { DATA_TESTID_SUFFIXES, KEYS };
|
package/dist/next/Menu/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { Menu } from './Menu.js';
|
|
2
|
-
export { MenuButton } from './MenuButton.js';
|
|
3
|
-
export { MenuPane } from './MenuPane.js';
|
|
4
|
-
export { MenuItem } from './MenuItem.js';
|
|
5
|
-
export { SubMenu } from './SubMenu.js';
|
|
1
|
+
export { default as Menu } from './Menu.js';
|
|
2
|
+
export { default as MenuButton } from './MenuButton.js';
|
|
3
|
+
export { default as MenuPane } from './MenuPane.js';
|
|
4
|
+
export { default as MenuItem } from './MenuItem.js';
|
|
5
|
+
export { default as SubMenu } from './SubMenu.js';
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { useState, useEffect } from 'react';
|
|
2
|
+
import '../../hooks/index.js';
|
|
3
|
+
import '../../utils/index.js';
|
|
4
|
+
import useControllableState from '../../hooks/useControllableState/useControllableState.js';
|
|
5
|
+
import useTranslation from '../../utils/Translation/useTranslation.js';
|
|
6
|
+
|
|
7
|
+
function usePaneSearch(externalSearchValue, onSearchValueChange, items) {
|
|
8
|
+
const [internalSearchValue, setSearchValue] = useControllableState(externalSearchValue, onSearchValueChange, externalSearchValue);
|
|
9
|
+
const [zeroSearchResults, setZeroSearchResults] = useState();
|
|
10
|
+
const {
|
|
11
|
+
translate
|
|
12
|
+
} = useTranslation();
|
|
13
|
+
const noMatchesText = translate('menu.noItemsToDisplay');
|
|
14
|
+
useEffect(() => {
|
|
15
|
+
setZeroSearchResults((items === null || items === void 0 ? void 0 : items.filter(item => item.element.current).length) === 0);
|
|
16
|
+
}, [items, internalSearchValue]);
|
|
17
|
+
return {
|
|
18
|
+
internalSearchValue,
|
|
19
|
+
setSearchValue,
|
|
20
|
+
zeroSearchResults,
|
|
21
|
+
noMatchesText
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export { usePaneSearch as default };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import styleInject from './../../__node_modules/style-inject/dist/style-inject.es.js';
|
|
2
2
|
|
|
3
|
-
var css_248z = ".
|
|
4
|
-
var styles = {"input":"
|
|
5
|
-
var stylesheet=".
|
|
3
|
+
var css_248z = "._kNu6_ input{padding-left:76px!important}._3gbyC input{background-color:#e5e5e5!important;color:#9d9fa1!important;cursor:not-allowed!important;-webkit-text-fill-color:#9d9fa1}._3gbyC input::-moz-placeholder{color:#aaabad;-webkit-text-fill-color:#aaabad}._3gbyC input::placeholder{color:#aaabad;-webkit-text-fill-color:#aaabad}._3b6vP{position:absolute!important;left:4px;right:4px;bottom:4px;z-index:100;width:67px;height:28px!important;border-radius:4px}._3b6vP,._3b6vP._3gbyC:hover{background-color:transparent!important}._3b6vP:hover{background-color:rgba(50,54,58,.08)!important}._3b6vP:active{background-color:rgba(50,54,58,.11)!important}._3b6vP svg{top:2px!important}._2drG7{position:relative}._1x_bk{position:absolute;top:18px;left:12px;line-height:0;font-size:14px;color:#32363a;z-index:101;pointer-events:none}";
|
|
4
|
+
var styles = {"input":"_kNu6_","disabled":"_3gbyC","dropdown":"_3b6vP","container":"_2drG7","countryCode":"_1x_bk"};
|
|
5
|
+
var stylesheet="._kNu6_ input{padding-left:76px!important}._3gbyC input{background-color:#e5e5e5!important;color:#9d9fa1!important;cursor:not-allowed!important;-webkit-text-fill-color:#9d9fa1}._3gbyC input::-moz-placeholder{color:#aaabad;-webkit-text-fill-color:#aaabad}._3gbyC input::placeholder{color:#aaabad;-webkit-text-fill-color:#aaabad}._3b6vP{position:absolute!important;left:4px;right:4px;bottom:4px;z-index:100;width:67px;height:28px!important;border-radius:4px}._3b6vP,._3b6vP._3gbyC:hover{background-color:transparent!important}._3b6vP:hover{background-color:rgba(50,54,58,.08)!important}._3b6vP:active{background-color:rgba(50,54,58,.11)!important}._3b6vP svg{top:2px!important}._2drG7{position:relative}._1x_bk{position:absolute;top:18px;left:12px;line-height:0;font-size:14px;color:#32363a;z-index:101;pointer-events:none}";
|
|
6
6
|
styleInject(css_248z);
|
|
7
7
|
|
|
8
8
|
export { styles as default, stylesheet };
|
|
@@ -6,7 +6,7 @@ import styles from './SplitButton2.js';
|
|
|
6
6
|
import '../../hooks/index.js';
|
|
7
7
|
import '../../utils/index.js';
|
|
8
8
|
import useEventListener from '../../hooks/useEventListener/useEventListener.js';
|
|
9
|
-
import { Button } from '../../components/Button/
|
|
9
|
+
import { Button } from '../../components/Button/Button2.js';
|
|
10
10
|
import getSubDataTestId from '../../utils/getSubDataTestId/getSubDataTestId.js';
|
|
11
11
|
import Dropdown from '../../components/Dropdown/Dropdown.js';
|
|
12
12
|
import DropdownButton from '../../components/Dropdown/DropdownButton.js';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import styleInject from './../../__node_modules/style-inject/dist/style-inject.es.js';
|
|
2
2
|
|
|
3
|
-
var css_248z = ".
|
|
4
|
-
var styles = {"container":"
|
|
5
|
-
var stylesheet=".
|
|
3
|
+
var css_248z = "._1M_49{display:flex}._Jxwjj{z-index:2;width:1px;margin-left:-1px;margin-right:-1px}._Jxwjj._3zBXt{background-color:#fff}._Jxwjj._3LuEh,._Jxwjj._3zBXt._2zzNe:not(._Jxwjj._3zBXt._1brLq),body.keyboard-user ._Jxwjj._3zBXt._39458:not(._1M3QF){background-color:#0b6ed0}._Jxwjj._3LuEh._1brLq._2zzNe,._Jxwjj._3LuEh._1M3QF._1brLq,._Jxwjj._3LuEh._1M3QF._39458{opacity:.4}._3VMBW{border-radius:4px 0 0 4px;border-right:none;padding-right:17px}._3VMBW:focus{z-index:1}._3WrqK{border-radius:0 4px 4px 0;transition:border .2s,background .2s,color .2s;border-left:none;min-width:35px!important;padding:0!important;justify-content:center!important}._3WrqK svg{margin-left:1px}._3WrqK._3zBXt{background-color:#0b6ed0;border-color:transparent}._3WrqK._3zBXt svg{fill:#fff!important}._3WrqK._3zBXt:not(._3BOLL):hover{background-color:#085caf!important}._3WrqK._3zBXt:not(._3BOLL):active{background-color:#0854a1!important}._3WrqK._3zBXt._3BOLL{opacity:.4}._3WrqK._3zBXt._3BOLL svg{background-color:transparent}._3WrqK._3LuEh{border-color:#0b6ed0;background-color:#fff}._3WrqK._3LuEh svg{fill:#0b6ed0!important}._3WrqK._3LuEh:not(._3BOLL):hover{background-color:#eef5fc!important}._3WrqK._3LuEh:not(._3BOLL):active{background-color:#e1edf9!important}._3WrqK._3LuEh._3BOLL{opacity:.4}._3WrqK._3LuEh._3BOLL svg{background-color:transparent}._2coMa{width:260px}";
|
|
4
|
+
var styles = {"container":"_1M_49","divider":"_Jxwjj","primary":"_3zBXt","mainButtonFocus":"_39458","mainButtonDisabled":"_1M3QF","dropdownButtonFocus":"_2zzNe","dropdownButtonDisabled":"_1brLq","secondary":"_3LuEh","mainButton":"_3VMBW","dropdownButton":"_3WrqK","disabled":"_3BOLL","dropdownOption":"_2coMa"};
|
|
5
|
+
var stylesheet="._1M_49{display:flex}._Jxwjj{z-index:2;width:1px;margin-left:-1px;margin-right:-1px}._Jxwjj._3zBXt{background-color:#fff}._Jxwjj._3LuEh,._Jxwjj._3zBXt._2zzNe:not(._Jxwjj._3zBXt._1brLq),body.keyboard-user ._Jxwjj._3zBXt._39458:not(._1M3QF){background-color:#0b6ed0}._Jxwjj._3LuEh._1brLq._2zzNe,._Jxwjj._3LuEh._1M3QF._1brLq,._Jxwjj._3LuEh._1M3QF._39458{opacity:.4}._3VMBW{border-radius:4px 0 0 4px;border-right:none;padding-right:17px}._3VMBW:focus{z-index:1}._3WrqK{border-radius:0 4px 4px 0;transition:border .2s,background .2s,color .2s;border-left:none;min-width:35px!important;padding:0!important;justify-content:center!important}._3WrqK svg{margin-left:1px}._3WrqK._3zBXt{background-color:#0b6ed0;border-color:transparent}._3WrqK._3zBXt svg{fill:#fff!important}._3WrqK._3zBXt:not(._3BOLL):hover{background-color:#085caf!important}._3WrqK._3zBXt:not(._3BOLL):active{background-color:#0854a1!important}._3WrqK._3zBXt._3BOLL{opacity:.4}._3WrqK._3zBXt._3BOLL svg{background-color:transparent}._3WrqK._3LuEh{border-color:#0b6ed0;background-color:#fff}._3WrqK._3LuEh svg{fill:#0b6ed0!important}._3WrqK._3LuEh:not(._3BOLL):hover{background-color:#eef5fc!important}._3WrqK._3LuEh:not(._3BOLL):active{background-color:#e1edf9!important}._3WrqK._3LuEh._3BOLL{opacity:.4}._3WrqK._3LuEh._3BOLL svg{background-color:transparent}._2coMa{width:260px}";
|
|
6
6
|
styleInject(css_248z);
|
|
7
7
|
|
|
8
8
|
export { styles as default, stylesheet };
|