@qualtrics/ui-react 2.9.0 → 2.10.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 +25 -1
- package/dist/__shared/cjs/{index-3e5149c9.js → index-0ef0b03a.js} +3 -3
- package/dist/__shared/cjs/{index-38a79098.js → index-74ef768b.js} +67 -193
- package/dist/components/Accordion/Accordion2.js +3 -3
- package/dist/components/Button/Button2.js +3 -3
- 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/Combobox.js +21 -43
- package/dist/components/Combobox/Combobox2.js +3 -3
- package/dist/components/Combobox/ComboboxInput.js +0 -2
- 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/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/IconButton/IconButton2.js +3 -3
- package/dist/components/InlineInput/InlineInput.js +7 -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/LoadingSpinner2.js +3 -3
- package/dist/components/LogicEditor/LogicEditor2.js +3 -3
- package/dist/components/Modal/Modal.js +2 -1
- package/dist/components/Modal/Modal2.js +3 -3
- package/dist/components/NewMenu/BaseMenu.js +2 -3
- package/dist/components/NewMenu/NewMenu.js +3 -3
- package/dist/components/NewMenu/parts/ArrowNav/ArrowNav.js +7 -2
- 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/Popover/Popover.js +5 -0
- 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 +5 -0
- package/dist/components/Tooltip/Tooltip2.js +3 -3
- 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/useScreenReaderAnnouncement/useScreenReaderAnnouncement2.js +3 -3
- package/dist/icons/Icon.js +3 -3
- package/dist/icons/index.js +1 -1
- package/dist/index.es.js +1 -1
- package/dist/index.js +261 -136
- 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/FilterAnchor/FilterAnchor2.js +3 -3
- package/dist/next/Input/Input2.js +3 -3
- package/dist/next/Menu/Menu.js +71 -0
- package/dist/next/Menu/Menu2.js +8 -0
- package/dist/next/Menu/MenuButton.js +41 -0
- package/dist/next/Menu/MenuContext.js +41 -0
- package/dist/next/Menu/MenuItem.js +49 -0
- package/dist/next/Menu/MenuPane.js +64 -0
- package/dist/next/Menu/MenuSearch.js +105 -0
- package/dist/next/Menu/SubMenu.js +74 -0
- package/dist/next/Menu/constants.js +9 -0
- package/dist/next/Menu/index.js +5 -0
- package/dist/next/PhoneNumberInput/PhoneNumberInput2.js +3 -3
- package/dist/next/SplitButton/SplitButton2.js +3 -3
- package/dist/next/index.d.ts +52 -0
- package/dist/next/index.es.js +6 -1
- package/dist/next/index.js +506 -132
- package/dist/utils/Flyout/Flyout2.js +3 -3
- package/package.json +1 -1
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import _extends from '@babel/runtime-corejs3/helpers/extends';
|
|
2
|
+
import _includesInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/includes';
|
|
3
|
+
import React__default, { useRef, useState, useMemo } from 'react';
|
|
4
|
+
import { Sub, SubTrigger, SubContent } from '@radix-ui/react-dropdown-menu';
|
|
5
|
+
import classNames from 'classnames';
|
|
6
|
+
import styles from './Menu2.js';
|
|
7
|
+
import '../../icons/index.es.js';
|
|
8
|
+
import { usePaneContext, PaneContextProvider } from './MenuContext.js';
|
|
9
|
+
import '../../utils/index.js';
|
|
10
|
+
import { DATA_TESTID_SUFFIXES } from './constants.js';
|
|
11
|
+
import { MenuSearch } from './MenuSearch.js';
|
|
12
|
+
import '../../hooks/index.js';
|
|
13
|
+
import useControllableState from '../../hooks/useControllableState/useControllableState.js';
|
|
14
|
+
import getSubDataTestId from '../../utils/getSubDataTestId/getSubDataTestId.js';
|
|
15
|
+
import ChevronRightIcon from '../../icons/components/ChevronRightIcon.js';
|
|
16
|
+
import mergeRefs from '../../utils/mergeRefs/mergeRefs.js';
|
|
17
|
+
|
|
18
|
+
const SubMenu = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
19
|
+
let {
|
|
20
|
+
children,
|
|
21
|
+
label,
|
|
22
|
+
isDisabled,
|
|
23
|
+
isSearchable,
|
|
24
|
+
searchValue: externalSearchValue,
|
|
25
|
+
onSearchValueChange,
|
|
26
|
+
isSearchFilteringDisabled: isSearchFilteringDisabledForChildren = false,
|
|
27
|
+
...rest
|
|
28
|
+
} = _ref;
|
|
29
|
+
const itemRef = useRef(null);
|
|
30
|
+
const paneRef = useRef(null);
|
|
31
|
+
const {
|
|
32
|
+
dataTestId: menuParentDataTestId,
|
|
33
|
+
childIndex: index,
|
|
34
|
+
searchValue: triggerMenuParentSearchValue,
|
|
35
|
+
isSearchFilteringDisabled: isSearchFilteringDisabledForTrigger
|
|
36
|
+
} = usePaneContext(itemRef);
|
|
37
|
+
const [internalSearchValue, setSearchValue] = useControllableState(externalSearchValue, onSearchValueChange, externalSearchValue);
|
|
38
|
+
const paneDataTestId = getSubDataTestId(menuParentDataTestId, String(index));
|
|
39
|
+
const triggerDataTestId = paneDataTestId === null || paneDataTestId === void 0 ? void 0 : paneDataTestId.replace(DATA_TESTID_SUFFIXES.MENU_PANE, DATA_TESTID_SUFFIXES.MENU_ITEM);
|
|
40
|
+
const [items, setItems] = useState([]);
|
|
41
|
+
const isVisible = useMemo(() => {
|
|
42
|
+
var _context;
|
|
43
|
+
|
|
44
|
+
return isSearchFilteringDisabledForTrigger || !triggerMenuParentSearchValue || typeof label === 'string' && _includesInstanceProperty(_context = label.toLowerCase()).call(_context, triggerMenuParentSearchValue.toLowerCase());
|
|
45
|
+
}, [triggerMenuParentSearchValue, label, isSearchFilteringDisabledForTrigger]);
|
|
46
|
+
return isVisible ? /*#__PURE__*/React__default.createElement(Sub, null, /*#__PURE__*/React__default.createElement(SubTrigger, {
|
|
47
|
+
className: classNames(styles.menuItem, styles.subMenu),
|
|
48
|
+
"data-testid": triggerDataTestId,
|
|
49
|
+
"aria-disabled": isDisabled,
|
|
50
|
+
disabled: isDisabled,
|
|
51
|
+
ref: itemRef
|
|
52
|
+
}, label, /*#__PURE__*/React__default.createElement(ChevronRightIcon, {
|
|
53
|
+
className: styles.rightIcon
|
|
54
|
+
})), /*#__PURE__*/React__default.createElement(PaneContextProvider, {
|
|
55
|
+
items: items,
|
|
56
|
+
setItems: setItems,
|
|
57
|
+
value: {
|
|
58
|
+
dataTestId: paneDataTestId,
|
|
59
|
+
searchValue: internalSearchValue,
|
|
60
|
+
isSearchFilteringDisabled: isSearchFilteringDisabledForChildren
|
|
61
|
+
}
|
|
62
|
+
}, /*#__PURE__*/React__default.createElement(SubContent, _extends({}, rest, {
|
|
63
|
+
className: styles.flyout,
|
|
64
|
+
loop: true,
|
|
65
|
+
"data-testid": paneDataTestId,
|
|
66
|
+
ref: mergeRefs(ref, paneRef)
|
|
67
|
+
}), isSearchable && /*#__PURE__*/React__default.createElement(MenuSearch, {
|
|
68
|
+
setSearchValue: setSearchValue,
|
|
69
|
+
items: items,
|
|
70
|
+
paneRef: paneRef
|
|
71
|
+
}), children))) : null;
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
export { SubMenu, SubMenu 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 = "._OdFaS input{padding-left:76px!important}._W1VkX input{background-color:#e5e5e5!important;color:#9d9fa1!important;cursor:not-allowed!important;-webkit-text-fill-color:#9d9fa1}._W1VkX input::-moz-placeholder{color:#aaabad;-webkit-text-fill-color:#aaabad}._W1VkX input::placeholder{color:#aaabad;-webkit-text-fill-color:#aaabad}._38MMe{position:absolute!important;left:4px;right:4px;bottom:4px;z-index:100;width:67px;height:28px!important;border-radius:4px}._38MMe,._38MMe._W1VkX:hover{background-color:transparent!important}._38MMe:hover{background-color:rgba(50,54,58,.08)!important}._38MMe:active{background-color:rgba(50,54,58,.11)!important}._38MMe svg{top:2px!important}._1_MSL{position:relative}._tcSMK{position:absolute;top:18px;left:12px;line-height:0;font-size:14px;color:#32363a;z-index:101;pointer-events:none}";
|
|
4
|
+
var styles = {"input":"_OdFaS","disabled":"_W1VkX","dropdown":"_38MMe","container":"_1_MSL","countryCode":"_tcSMK"};
|
|
5
|
+
var stylesheet="._OdFaS input{padding-left:76px!important}._W1VkX input{background-color:#e5e5e5!important;color:#9d9fa1!important;cursor:not-allowed!important;-webkit-text-fill-color:#9d9fa1}._W1VkX input::-moz-placeholder{color:#aaabad;-webkit-text-fill-color:#aaabad}._W1VkX input::placeholder{color:#aaabad;-webkit-text-fill-color:#aaabad}._38MMe{position:absolute!important;left:4px;right:4px;bottom:4px;z-index:100;width:67px;height:28px!important;border-radius:4px}._38MMe,._38MMe._W1VkX:hover{background-color:transparent!important}._38MMe:hover{background-color:rgba(50,54,58,.08)!important}._38MMe:active{background-color:rgba(50,54,58,.11)!important}._38MMe svg{top:2px!important}._1_MSL{position:relative}._tcSMK{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 };
|
|
@@ -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 = "._2udwO{display:flex}._1C5AH{z-index:2;width:1px;margin-left:-1px;margin-right:-1px}._1C5AH._2495F{background-color:#fff}._1C5AH._2495F._3hltw:not(._1C5AH._2495F._3qKAB),._1C5AH._PEaC8,body.keyboard-user ._1C5AH._2495F._3dOBx:not(._plw8F){background-color:#0b6ed0}._1C5AH._PEaC8._3qKAB._3hltw,._1C5AH._PEaC8._plw8F._3dOBx,._1C5AH._PEaC8._plw8F._3qKAB{opacity:.4}._1HrYl{border-radius:4px 0 0 4px;border-right:none;padding-right:17px}._1HrYl:focus{z-index:1}._1uPLq{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}._1uPLq svg{margin-left:1px}._1uPLq._2495F{background-color:#0b6ed0;border-color:transparent}._1uPLq._2495F svg{fill:#fff!important}._1uPLq._2495F:not(._19Qwi):hover{background-color:#085caf!important}._1uPLq._2495F:not(._19Qwi):active{background-color:#0854a1!important}._1uPLq._2495F._19Qwi{opacity:.4}._1uPLq._2495F._19Qwi svg{background-color:transparent}._1uPLq._PEaC8{border-color:#0b6ed0;background-color:#fff}._1uPLq._PEaC8 svg{fill:#0b6ed0!important}._1uPLq._PEaC8:not(._19Qwi):hover{background-color:#eef5fc!important}._1uPLq._PEaC8:not(._19Qwi):active{background-color:#e1edf9!important}._1uPLq._PEaC8._19Qwi{opacity:.4}._1uPLq._PEaC8._19Qwi svg{background-color:transparent}._3V2sW{width:260px}";
|
|
4
|
+
var styles = {"container":"_2udwO","divider":"_1C5AH","primary":"_2495F","mainButtonFocus":"_3dOBx","mainButtonDisabled":"_plw8F","dropdownButtonFocus":"_3hltw","dropdownButtonDisabled":"_3qKAB","secondary":"_PEaC8","mainButton":"_1HrYl","dropdownButton":"_1uPLq","disabled":"_19Qwi","dropdownOption":"_3V2sW"};
|
|
5
|
+
var stylesheet="._2udwO{display:flex}._1C5AH{z-index:2;width:1px;margin-left:-1px;margin-right:-1px}._1C5AH._2495F{background-color:#fff}._1C5AH._2495F._3hltw:not(._1C5AH._2495F._3qKAB),._1C5AH._PEaC8,body.keyboard-user ._1C5AH._2495F._3dOBx:not(._plw8F){background-color:#0b6ed0}._1C5AH._PEaC8._3qKAB._3hltw,._1C5AH._PEaC8._plw8F._3dOBx,._1C5AH._PEaC8._plw8F._3qKAB{opacity:.4}._1HrYl{border-radius:4px 0 0 4px;border-right:none;padding-right:17px}._1HrYl:focus{z-index:1}._1uPLq{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}._1uPLq svg{margin-left:1px}._1uPLq._2495F{background-color:#0b6ed0;border-color:transparent}._1uPLq._2495F svg{fill:#fff!important}._1uPLq._2495F:not(._19Qwi):hover{background-color:#085caf!important}._1uPLq._2495F:not(._19Qwi):active{background-color:#0854a1!important}._1uPLq._2495F._19Qwi{opacity:.4}._1uPLq._2495F._19Qwi svg{background-color:transparent}._1uPLq._PEaC8{border-color:#0b6ed0;background-color:#fff}._1uPLq._PEaC8 svg{fill:#0b6ed0!important}._1uPLq._PEaC8:not(._19Qwi):hover{background-color:#eef5fc!important}._1uPLq._PEaC8:not(._19Qwi):active{background-color:#e1edf9!important}._1uPLq._PEaC8._19Qwi{opacity:.4}._1uPLq._PEaC8._19Qwi svg{background-color:transparent}._3V2sW{width:260px}";
|
|
6
6
|
styleInject(css_248z);
|
|
7
7
|
|
|
8
8
|
export { styles as default, stylesheet };
|
package/dist/next/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import { AllHTMLAttributes } from 'react';
|
|
4
4
|
import type { ChangeEvent } from 'react';
|
|
5
|
+
import type { ComputedPlacement } from '@popperjs/core';
|
|
5
6
|
import { CountryCode } from 'libphonenumber-js';
|
|
6
7
|
import { CSSProperties } from 'react';
|
|
7
8
|
import { E164Number } from 'libphonenumber-js';
|
|
@@ -228,6 +229,45 @@ export declare interface InputProps extends InputHTMLAttributes<HTMLInputElement
|
|
|
228
229
|
style?: CSSProperties;
|
|
229
230
|
}
|
|
230
231
|
|
|
232
|
+
export declare const Menu: ({ "data-testid": dataTestId, isOpen, onIsOpenChange, isDisabled, children, }: MenuProps) => JSX.Element;
|
|
233
|
+
|
|
234
|
+
export declare const MenuButton: React_2.ForwardRefExoticComponent<MenuButtonProps & React_2.RefAttributes<HTMLButtonElement>>;
|
|
235
|
+
|
|
236
|
+
export declare interface MenuButtonProps extends Omit<AllHTMLAttributes<HTMLButtonElement>, 'type'> {
|
|
237
|
+
asChild?: boolean;
|
|
238
|
+
children: React_2.ReactNode;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
export declare const MenuItem: React_2.ForwardRefExoticComponent<MenuItemProps & React_2.RefAttributes<HTMLDivElement>>;
|
|
242
|
+
|
|
243
|
+
export declare interface MenuItemProps extends AllHTMLAttributes<HTMLDivElement> {
|
|
244
|
+
isDisabled?: boolean;
|
|
245
|
+
asChild?: boolean;
|
|
246
|
+
children?: React_2.ReactNode;
|
|
247
|
+
className?: string;
|
|
248
|
+
onSelect?: () => void;
|
|
249
|
+
label?: string;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
export declare const MenuPane: React_2.ForwardRefExoticComponent<MenuPaneProps & React_2.RefAttributes<HTMLDivElement>>;
|
|
253
|
+
|
|
254
|
+
export declare interface MenuPaneProps extends AllHTMLAttributes<HTMLDivElement> {
|
|
255
|
+
placement?: ComputedPlacement;
|
|
256
|
+
children: React_2.ReactNode;
|
|
257
|
+
isSearchable?: boolean;
|
|
258
|
+
searchValue?: string;
|
|
259
|
+
onSearchValueChange?: (newValue: string) => void;
|
|
260
|
+
isSearchFilteringDisabled?: boolean;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
export declare interface MenuProps {
|
|
264
|
+
'data-testid'?: string;
|
|
265
|
+
isOpen?: boolean;
|
|
266
|
+
onIsOpenChange?: (shouldOpen: boolean) => void;
|
|
267
|
+
isDisabled?: boolean;
|
|
268
|
+
children: React_2.ReactNode;
|
|
269
|
+
}
|
|
270
|
+
|
|
231
271
|
export declare const PhoneNumberInput: React_2.ForwardRefExoticComponent<PhoneNumberInputProps & React_2.RefAttributes<HTMLInputElement>>;
|
|
232
272
|
|
|
233
273
|
export declare interface PhoneNumberInputProps {
|
|
@@ -270,4 +310,16 @@ export declare interface SplitButtonProps {
|
|
|
270
310
|
children?: React_2.ReactNode;
|
|
271
311
|
}
|
|
272
312
|
|
|
313
|
+
export declare const SubMenu: React_2.ForwardRefExoticComponent<SubMenuProps & React_2.RefAttributes<HTMLDivElement>>;
|
|
314
|
+
|
|
315
|
+
export declare interface SubMenuProps extends Omit<AllHTMLAttributes<HTMLDivElement>, 'label'> {
|
|
316
|
+
children?: React_2.ReactNode;
|
|
317
|
+
label?: React_2.ReactNode;
|
|
318
|
+
isDisabled?: boolean;
|
|
319
|
+
isSearchable?: boolean;
|
|
320
|
+
searchValue?: string;
|
|
321
|
+
onSearchValueChange?: (newValue: string) => void;
|
|
322
|
+
isSearchFilteringDisabled?: boolean;
|
|
323
|
+
}
|
|
324
|
+
|
|
273
325
|
export { }
|
package/dist/next/index.es.js
CHANGED
|
@@ -5,6 +5,7 @@ import './PhoneNumberInput/index.js';
|
|
|
5
5
|
import './Combobox/index.js';
|
|
6
6
|
import './SplitButton/index.js';
|
|
7
7
|
import './FilterAnchor/index.js';
|
|
8
|
+
import './Menu/index.js';
|
|
8
9
|
export { AdvancedTable } from './AdvancedTable/AdvancedTable.js';
|
|
9
10
|
export { default as CollapsibleSearchInput } from './CollapsibleSearchInput/CollapsibleSearchInput.js';
|
|
10
11
|
export { default as Input } from './Input/Input.js';
|
|
@@ -17,6 +18,10 @@ export { default as ComboboxOption } from './Combobox/ComboboxOption.js';
|
|
|
17
18
|
export { default as SplitButton } from './SplitButton/SplitButton.js';
|
|
18
19
|
export { default as SplitButtonOption } from './SplitButton/SplitButtonOption.js';
|
|
19
20
|
export { default as FilterAnchor } from './FilterAnchor/FilterAnchor.js';
|
|
21
|
+
export { Menu } from './Menu/Menu.js';
|
|
22
|
+
export { MenuButton } from './Menu/MenuButton.js';
|
|
23
|
+
export { MenuPane } from './Menu/MenuPane.js';
|
|
24
|
+
export { MenuItem } from './Menu/MenuItem.js';
|
|
25
|
+
export { SubMenu } from './Menu/SubMenu.js';
|
|
20
26
|
|
|
21
27
|
/* eslint-disable camelcase */
|
|
22
|
-
// export * from './Menu';
|