@qualtrics/ui-react 2.20.0 → 2.22.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 +17 -33
- package/dist/__shared/cjs/{index-90d4069b.js → index-025620bf.js} +718 -673
- package/dist/__shared/cjs/{index-579c4690.js → index-41a013d2.js} +4 -4
- package/dist/components/Accordion/Accordion.js +1 -1
- package/dist/components/Accordion/Accordion2.js +3 -3
- package/dist/components/Accordion/AccordionHeader.js +4 -4
- package/dist/components/Accordion/AccordionPanel.js +3 -3
- package/dist/components/Button/Button.js +3 -3
- package/dist/components/Button/Button2.js +2 -2
- package/dist/components/ButtonGroup/ButtonGroup.js +1 -1
- package/dist/components/ButtonGroup/ButtonGroup2.js +3 -3
- package/dist/components/Checkbox/Checkbox.js +11 -11
- package/dist/components/Checkbox/Checkbox2.js +3 -3
- package/dist/components/Checkbox/VisualCheckbox2.js +3 -3
- package/dist/components/ColorPicker/Alpha.js +12 -16
- package/dist/components/ColorPicker/ColorPicker.js +15 -9
- package/dist/components/ColorPicker/ColorPicker2.js +3 -3
- package/dist/components/ColorPicker/ColorPickerFlyout.js +9 -4
- package/dist/components/ColorPicker/ColorPickerFlyoutInputs.js +8 -6
- package/dist/components/ColorPicker/Hue.js +3 -9
- package/dist/components/ColorPicker/Palette.js +13 -9
- package/dist/components/ColorPicker/Saturation.js +9 -17
- package/dist/components/ColorPicker/utils/hexToRgbaString.js +3 -2
- package/dist/components/ColorPicker/utils/rgbToHex.js +1 -1
- package/dist/components/ColorPicker/utils/validateHex.js +10 -9
- package/dist/components/Combobox/Combobox.js +54 -31
- package/dist/components/Combobox/Combobox2.js +3 -3
- package/dist/components/Combobox/ComboboxHeader.js +1 -1
- package/dist/components/Combobox/ComboboxIcon.js +3 -2
- package/dist/components/Combobox/ComboboxInput.js +4 -4
- package/dist/components/Combobox/ComboboxList.js +2 -2
- package/dist/components/ConfigPane/ConfigPane2.js +3 -3
- package/dist/components/Divider/Divider2.js +3 -3
- package/dist/components/Dropdown/ChildIndexContext/reach-descendants.js +5 -2
- package/dist/components/Dropdown/Dropdown.js +14 -14
- package/dist/components/Dropdown/Dropdown2.js +3 -3
- package/dist/components/Dropdown/DropdownButton.js +23 -19
- package/dist/components/Dropdown/DropdownList.js +4 -4
- package/dist/components/Dropdown/DropdownOption.js +5 -7
- package/dist/components/Dropdown/DropdownSearch.js +12 -9
- package/dist/components/FilePicker/FilePicker.js +13 -13
- package/dist/components/FilePicker/FilePicker2.js +3 -3
- package/dist/components/FormField/Caption.js +3 -3
- package/dist/components/FormField/FormField.js +2 -2
- package/dist/components/FormField/FormField2.js +3 -3
- package/dist/components/FormField/FormFieldContext.js +3 -3
- package/dist/components/FullScreenTakeover/FullScreenTakeover.js +5 -3
- package/dist/components/FullScreenTakeover/FullScreenTakeover2.js +3 -3
- package/dist/components/Icon/Icon.js +2 -2
- package/dist/components/IconButton/IconButton2.js +3 -3
- package/dist/components/InlineInput/InlineInput.js +12 -9
- package/dist/components/InlineInput/InlineInput2.js +3 -3
- package/dist/components/Input/Input.js +1 -1
- package/dist/components/Input/Input2.js +3 -3
- package/dist/components/Input/InputField.js +2 -2
- 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 +5 -5
- package/dist/components/LogicEditor/LogicEditor.js +1 -1
- package/dist/components/LogicEditor/LogicEditor2.js +3 -3
- package/dist/components/LogicEditor/utils.js +2 -1
- package/dist/components/Modal/Modal.js +14 -13
- package/dist/components/Modal/Modal2.js +3 -3
- package/dist/components/NewMenu/BaseMenu.js +41 -30
- package/dist/components/NewMenu/NewMenu.js +3 -3
- package/dist/components/NewMenu/SelectMenu/SelectMenu.js +2 -2
- package/dist/components/NewMenu/parts/ArrowNav/ArrowNav.js +19 -15
- package/dist/components/NewMenu/parts/MenuItem.js +1 -1
- package/dist/components/NumberStepper/NumberStepper.js +7 -6
- package/dist/components/NumberStepper/NumberStepper2.js +3 -3
- package/dist/components/NumberStepper/NumberStepperDecrement.js +1 -1
- package/dist/components/NumberStepper/NumberStepperIncrement.js +1 -1
- package/dist/components/NumberStepper/NumberStepperInput.js +3 -3
- package/dist/components/PageLayout/PageLayout.js +3 -3
- package/dist/components/Pagination/Pagination.js +1 -1
- package/dist/components/Pagination/Pagination2.js +3 -3
- package/dist/components/Pagination/PaginationNextButton.js +5 -5
- package/dist/components/Pagination/PaginationPageInput.js +11 -9
- package/dist/components/Pagination/PaginationPreviousButton.js +5 -5
- package/dist/components/Popover/Popover.js +9 -7
- package/dist/components/Popover/Popover2.js +3 -3
- package/dist/components/QuickSearch/QuickSearch.js +4 -3
- package/dist/components/QuickSearch/QuickSearch2.js +3 -3
- package/dist/components/QuickSearch/QuickSearchInput.js +4 -4
- package/dist/components/Radio/Radio.js +12 -11
- package/dist/components/Radio/Radio2.js +3 -3
- package/dist/components/SearchInput/SearchInput.js +4 -3
- package/dist/components/SearchInput/SearchInput2.js +3 -3
- package/dist/components/SidebarNav/SidebarNav.js +2 -1
- package/dist/components/SidebarNav/SidebarNav2.js +3 -3
- package/dist/components/SidebarNav/SidebarNavLink.js +1 -1
- package/dist/components/Slider/RangeSlider.js +2 -2
- package/dist/components/Slider/Slider.js +1 -1
- package/dist/components/Slider/Slider2.js +3 -3
- package/dist/components/Slider/SliderButton.js +1 -1
- package/dist/components/Switch/Switch.js +11 -11
- package/dist/components/Switch/Switch2.js +3 -3
- package/dist/components/Table/Table2.js +3 -3
- package/dist/components/Tabs/Tab.js +3 -3
- package/dist/components/Tabs/TabList.js +6 -5
- package/dist/components/Tabs/TabPanel.js +3 -3
- package/dist/components/Tabs/Tabs2.js +3 -3
- package/dist/components/Tooltip/Tooltip.js +15 -7
- package/dist/components/Tooltip/Tooltip2.js +3 -3
- package/dist/components/UIProvider/UIProvider.js +2 -2
- package/dist/components/deprecated_ColorPicker/Alpha.js +4 -4
- package/dist/components/deprecated_ColorPicker/Color.js +6 -6
- package/dist/components/deprecated_ColorPicker/ColorPicker.js +2 -2
- package/dist/components/deprecated_ColorPicker/ColorPicker2.js +3 -3
- package/dist/components/deprecated_ColorPicker/HexInput.js +1 -1
- package/dist/components/deprecated_ColorPicker/Hue.js +3 -3
- package/dist/components/deprecated_ColorPicker/Saturation.js +5 -5
- package/dist/components/deprecated_ColorPicker/Swatch.js +2 -2
- package/dist/components/deprecated_NumberStepper/NumberStepper2.js +3 -3
- package/dist/components/deprecated_NumberStepper/NumberStepperDecrement.js +2 -2
- package/dist/components/deprecated_NumberStepper/NumberStepperIncrement.js +2 -2
- package/dist/components/deprecated_NumberStepper/NumberStepperInput.js +8 -8
- package/dist/components/deprecated_Tabs/Tabs.js +11 -7
- package/dist/components/deprecated_Tabs/Tabs2.js +3 -3
- package/dist/components/deprecated_Toolbar/Toolbar2.js +3 -3
- package/dist/components/deprecated_Toolbar/ToolbarPanel.js +3 -3
- package/dist/components/deprecated_Toolbar/ToolbarPanels.js +4 -29
- package/dist/components/deprecated_Toolbar/ToolbarTab.js +8 -8
- package/dist/components/deprecated_Toolbar/ToolbarTabs.js +6 -3
- package/dist/hooks/useBreakpoints/useBreakpoints.js +1 -1
- package/dist/hooks/useClickOutside/useClickOutside.js +2 -1
- package/dist/hooks/useControllableState/useControllableState.js +2 -1
- package/dist/hooks/useEventListener/useEventListener.js +4 -1
- package/dist/hooks/useId/useId.js +1 -1
- package/dist/hooks/useOverlay/useOverlay.js +11 -6
- package/dist/hooks/useOverlay/useOverlay2.js +3 -3
- package/dist/hooks/useResponsiveValue/useResponsiveValue.js +2 -1
- package/dist/hooks/useScreenReaderAnnouncement/useScreenReaderAnnouncement.js +4 -2
- package/dist/hooks/useScreenReaderAnnouncement/useScreenReaderAnnouncement2.js +3 -3
- package/dist/icons/Icon.js +3 -3
- package/dist/icons/createIconComponent.js +1 -1
- package/dist/icons/index.js +1 -1
- package/dist/index.d.ts +17 -8
- package/dist/index.es.js +1 -7
- package/dist/index.js +4 -7
- package/dist/next/AdvancedTable/AdvancedTable.js +86 -87
- package/dist/next/AdvancedTable/AdvancedTable2.js +3 -3
- package/dist/next/AdvancedTable/AdvancedTableCell.js +6 -4
- package/dist/next/AdvancedTable/AdvancedTableColumnHeader.js +18 -10
- package/dist/next/AdvancedTable/AdvancedTableColumnHeaderMenu.js +7 -6
- package/dist/next/AdvancedTable/AdvancedTableDragPreview.js +5 -4
- package/dist/next/AdvancedTable/AdvancedTablePagination.js +1 -1
- package/dist/next/AdvancedTable/useAdvancedTableDragAndDrop.js +3 -2
- package/dist/next/AdvancedTable/useComputedWidth.js +1 -1
- package/dist/next/CollapsibleSearchInput/CollapsibleSearchInput.js +6 -5
- package/dist/next/CollapsibleSearchInput/CollapsibleSearchInput2.js +3 -3
- package/dist/next/CollapsibleSearchInput/CollapsibleSearchInputIconButton.js +1 -1
- package/dist/next/Combobox/Combobox2.js +3 -3
- package/dist/next/Combobox/ComboboxFlyout.js +2 -2
- package/dist/next/Combobox/ComboboxGroup.js +1 -1
- package/dist/next/Combobox/ComboboxInput.js +2 -2
- package/dist/next/Combobox/ComboboxOption.js +1 -1
- package/dist/next/Combobox/hooks/useComboboxFilteredGroup/useComboboxFilteredGroup.js +1 -1
- package/dist/next/Combobox/hooks/useComboboxFocusSequence/useComboboxFocusSequence.js +12 -8
- package/dist/next/Combobox/hooks/useComboboxValue/useComboboxValue.js +1 -1
- package/dist/next/Combobox/hooks/useListboxFlyoutDimensions/useListboxFlyoutDimensions.js +3 -2
- package/dist/next/Combobox/hooks/useSelectedOptionScroll/useSelectedOptionScroll.js +2 -1
- package/dist/next/Combobox/hooks/useShouldRenderGroupHeader/useShouldRenderGroupHeader.js +2 -1
- package/dist/next/Combobox/utils/nodeRegistration/nodeRegistration.js +1 -1
- package/dist/next/Drawer/Drawer.js +7 -4
- package/dist/next/Drawer/Drawer2.js +3 -3
- package/dist/next/FilterAnchor/FilterAnchor.js +3 -3
- package/dist/next/FilterAnchor/FilterAnchor2.js +3 -3
- package/dist/next/Input/Input.js +2 -2
- package/dist/next/Input/Input2.js +3 -3
- package/dist/next/Menu/Menu.js +11 -5
- package/dist/next/Menu/Menu2.js +3 -3
- package/dist/next/Menu/MenuItem.js +19 -11
- package/dist/next/Menu/MenuPane.js +70 -40
- package/dist/next/Menu/MenuSearch.js +16 -71
- package/dist/next/Menu/SubMenu.js +63 -46
- package/dist/next/Menu/constants.js +5 -1
- package/dist/next/Menu/useMutationObserver.js +17 -0
- package/dist/next/Menu/usePaneSearch.js +109 -7
- package/dist/next/PhoneNumberInput/PhoneNumberInput.js +7 -6
- package/dist/next/PhoneNumberInput/PhoneNumberInput2.js +3 -3
- package/dist/next/SplitButton/SplitButton.js +8 -2
- package/dist/next/SplitButton/SplitButton2.js +3 -3
- package/dist/next/TimePicker/TimeDropdown.js +4 -4
- package/dist/next/TimePicker/TimeInput.js +2 -2
- package/dist/next/TimePicker/TimePicker.js +4 -4
- package/dist/next/TimePicker/TimePicker2.js +3 -3
- package/dist/next/TimePicker/TimePickerIcon.js +2 -1
- package/dist/next/TimePicker/utils.js +10 -9
- package/dist/next/ToggleButton/styles.js +3 -3
- package/dist/next/index.d.ts +2 -1
- package/dist/next/index.js +601 -432
- package/dist/utils/Flyout/Flyout.js +1 -1
- package/dist/utils/Flyout/Flyout2.js +3 -3
- package/dist/utils/Popper/Popper.js +9 -5
- package/dist/utils/TextOverflowTooltip/TextOverflowTooltip.js +2 -1
- package/dist/utils/Translation/useTranslation.js +4 -5
- package/dist/utils/filterChildren/filterChildren.js +2 -1
- package/dist/utils/getSubDataTestId/getSubDataTestId.js +1 -1
- package/dist/utils/index.js +0 -1
- package/dist/utils/mediaQueryManager/mediaQueryManager.js +1 -1
- package/dist/utils/mergeRefs/mergeRefs.js +1 -1
- package/dist/utils/wrapEvent/wrapEvent.js +2 -2
- package/icons/package.json +1 -0
- package/next/package.json +2 -1
- package/package.json +4 -4
- package/dist/utils/keyboardUser/index.js +0 -1
- package/dist/utils/keyboardUser/keyboardUser.js +0 -30
|
@@ -24,8 +24,8 @@ const TabsList = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
|
24
24
|
isTabListFocused,
|
|
25
25
|
setIsTabListFocused
|
|
26
26
|
} = useTabContext();
|
|
27
|
-
const tabListId = getSubDataTestId(rootId,
|
|
28
|
-
const tabListTestId = getSubDataTestId(rootTestId,
|
|
27
|
+
const tabListId = getSubDataTestId(rootId, "tablist");
|
|
28
|
+
const tabListTestId = getSubDataTestId(rootTestId, "tablist");
|
|
29
29
|
const tabListRef = useRef(null);
|
|
30
30
|
// We use this map of tab element to index to allow constant time index
|
|
31
31
|
// lookup when we handle an event from a child tab
|
|
@@ -87,10 +87,11 @@ const TabsList = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
|
87
87
|
ref: mergeRefs(ref, tabListRef),
|
|
88
88
|
tabIndex: -1 // Needed to satisfy the jsx-a11y/interactive-supports-focus rule
|
|
89
89
|
}), React__default.Children.map(children, (child, index) => {
|
|
90
|
-
if (child
|
|
90
|
+
if ((child === null || child === void 0 ? void 0 : child.type) === Tab) {
|
|
91
|
+
var _child$props$value;
|
|
91
92
|
return /*#__PURE__*/React__default.cloneElement(child, {
|
|
92
|
-
value: child.props.value
|
|
93
|
-
ref: mergeRefs(child
|
|
93
|
+
value: (_child$props$value = child.props.value) !== null && _child$props$value !== void 0 ? _child$props$value : index,
|
|
94
|
+
ref: mergeRefs(child === null || child === void 0 ? void 0 : child.ref, node => {
|
|
94
95
|
// Store a reverse node/index map for
|
|
95
96
|
// constant time index lookups from event handlers
|
|
96
97
|
if (node) {
|
|
@@ -18,14 +18,14 @@ const TabPanel = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
|
18
18
|
rootId,
|
|
19
19
|
rootTestId
|
|
20
20
|
} = useTabContext();
|
|
21
|
-
const tabPanelId = getSubDataTestId(rootId,
|
|
22
|
-
const tabPanelTestId = getSubDataTestId(rootTestId,
|
|
21
|
+
const tabPanelId = getSubDataTestId(rootId, "tabpanel-".concat(value));
|
|
22
|
+
const tabPanelTestId = getSubDataTestId(rootTestId, "tabpanel-".concat(value));
|
|
23
23
|
return /*#__PURE__*/React__default.createElement("div", _extends({}, rest, {
|
|
24
24
|
ref: ref,
|
|
25
25
|
"data-testid": tabPanelTestId,
|
|
26
26
|
id: tabPanelId,
|
|
27
27
|
role: "tabpanel",
|
|
28
|
-
"aria-labelledby":
|
|
28
|
+
"aria-labelledby": "".concat(rootId, "-tab-").concat(value),
|
|
29
29
|
className: classNames(styles.tabpanel, className, {
|
|
30
30
|
[styles.inactive]: value !== activeTab
|
|
31
31
|
})
|
|
@@ -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 = {"tablist":"
|
|
5
|
-
var stylesheet=".
|
|
3
|
+
var css_248z = "._YBYEv{display:flex;justify-content:left;border-bottom:1px solid #e5e5e5;height:52px}._YBYEv._m0zX- ._uHVG4{flex:1 1 0px;max-width:none}._uHVG4{background:inherit;font-family:inherit;font-size:100%;line-height:1.15;margin:0;-webkit-appearance:button;-moz-appearance:button;appearance:button;text-transform:none;text-align:center;color:#6a6d70;height:52px;padding:16px 12px;max-width:200px;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;border:none;border-bottom:2px solid transparent;border-radius:1px;display:block;outline:none;cursor:pointer}._uHVG4:hover{color:#32363a}._uHVG4._pQ79r{border-bottom-color:#0b6ed0;color:#32363a;font-family:\"72Duplex\",\"72\",\"Helvetica Neue\",Helvetica,Arial,sans-serif;font-weight:500}._HaA-r{padding-top:32px}._HaA-r._vQmhw{display:none}._uHVG4.focus-visible,._uHVG4:focus-visible{box-shadow:0 0 0 2px #fff,0 0 0 4px #0a3f88}";
|
|
4
|
+
var styles = {"tablist":"_YBYEv","grow":"_m0zX-","tab":"_uHVG4","selected":"_pQ79r","tabpanel":"_HaA-r","inactive":"_vQmhw"};
|
|
5
|
+
var stylesheet="._YBYEv{display:flex;justify-content:left;border-bottom:1px solid #e5e5e5;height:52px}._YBYEv._m0zX- ._uHVG4{flex:1 1 0px;max-width:none}._uHVG4{background:inherit;font-family:inherit;font-size:100%;line-height:1.15;margin:0;-webkit-appearance:button;-moz-appearance:button;appearance:button;text-transform:none;text-align:center;color:#6a6d70;height:52px;padding:16px 12px;max-width:200px;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;border:none;border-bottom:2px solid transparent;border-radius:1px;display:block;outline:none;cursor:pointer}._uHVG4:hover{color:#32363a}._uHVG4._pQ79r{border-bottom-color:#0b6ed0;color:#32363a;font-family:\"72Duplex\",\"72\",\"Helvetica Neue\",Helvetica,Arial,sans-serif;font-weight:500}._HaA-r{padding-top:32px}._HaA-r._vQmhw{display:none}._uHVG4.focus-visible,._uHVG4:focus-visible{box-shadow:0 0 0 2px #fff,0 0 0 4px #0a3f88}";
|
|
6
6
|
styleInject(css_248z);
|
|
7
7
|
|
|
8
8
|
export { styles as default, stylesheet };
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import _extends from '@babel/runtime-corejs3/helpers/extends';
|
|
2
2
|
import React__default, { useState, useRef, useEffect } from 'react';
|
|
3
3
|
import classNames from 'classnames';
|
|
4
|
+
import { useFocusVisible } from '@react-aria/interactions';
|
|
4
5
|
import styles from './Tooltip2.js';
|
|
5
6
|
import { TOOLTIP_POPPER_OFFSET } from '../../utils/constants.js';
|
|
6
7
|
import '../../utils/Popper/index.js';
|
|
7
8
|
import '../../utils/mergeRefs/index.js';
|
|
8
|
-
import '../../utils/keyboardUser/index.js';
|
|
9
9
|
import '../../hooks/index.js';
|
|
10
10
|
import useControllableState from '../../hooks/useControllableState/useControllableState.js';
|
|
11
11
|
import useId from '../../hooks/useId/useId.js';
|
|
12
|
-
import { getIsKeyboardUser } from '../../utils/keyboardUser/keyboardUser.js';
|
|
13
12
|
import useEventListener from '../../hooks/useEventListener/useEventListener.js';
|
|
14
13
|
import Popper from '../../utils/Popper/Popper.js';
|
|
15
14
|
import mergeRefs from '../../utils/mergeRefs/mergeRefs.js';
|
|
16
15
|
|
|
17
16
|
const Tooltip = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
17
|
+
var _children$ref;
|
|
18
18
|
let {
|
|
19
19
|
content,
|
|
20
20
|
unstable_contentKey: contentKey,
|
|
@@ -46,10 +46,17 @@ const Tooltip = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
|
46
46
|
const flyoutOffsetBackplateRef = useRef(null);
|
|
47
47
|
const timer = useRef();
|
|
48
48
|
const flyoutContainerId = useId(id);
|
|
49
|
-
const
|
|
49
|
+
const {
|
|
50
|
+
isFocusVisible
|
|
51
|
+
} = useFocusVisible();
|
|
52
|
+
const getIsAnchorKeyboardFocused = () => {
|
|
53
|
+
var _anchorRef$current;
|
|
54
|
+
return (showOnDescendantFocus ? (_anchorRef$current = anchorRef.current) === null || _anchorRef$current === void 0 ? void 0 : _anchorRef$current.contains(document.activeElement) : document.activeElement === anchorRef.current) && isFocusVisible;
|
|
55
|
+
};
|
|
50
56
|
const addAriaDescribedByToTrigger = triggeringTarget => {
|
|
51
57
|
if (!ariaHidden && triggeringTarget instanceof Element) {
|
|
52
|
-
|
|
58
|
+
var _triggeringTarget$get;
|
|
59
|
+
const describedBy = new Set((_triggeringTarget$get = triggeringTarget.getAttribute('aria-describedby')) === null || _triggeringTarget$get === void 0 ? void 0 : _triggeringTarget$get.split(' '));
|
|
53
60
|
describedBy.add(flyoutContainerId);
|
|
54
61
|
triggeringTarget.setAttribute('aria-describedby', Array.from(describedBy).join(' '));
|
|
55
62
|
setTriggerElements(prev => new Set(prev).add(triggeringTarget));
|
|
@@ -57,7 +64,8 @@ const Tooltip = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
|
57
64
|
};
|
|
58
65
|
const removeAriaDescribedByFromAllTriggers = () => {
|
|
59
66
|
triggerElements.forEach(triggeringTarget => {
|
|
60
|
-
|
|
67
|
+
var _triggeringTarget$get2;
|
|
68
|
+
const describedBy = new Set((_triggeringTarget$get2 = triggeringTarget.getAttribute('aria-describedby')) === null || _triggeringTarget$get2 === void 0 ? void 0 : _triggeringTarget$get2.split(' '));
|
|
61
69
|
describedBy.delete(flyoutContainerId);
|
|
62
70
|
if (describedBy.size > 0) {
|
|
63
71
|
triggeringTarget.setAttribute('aria-describedby', Array.from(describedBy).join(' '));
|
|
@@ -129,7 +137,7 @@ const Tooltip = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
|
129
137
|
};
|
|
130
138
|
const handleFocus = e => {
|
|
131
139
|
// Prevents the tooltip from showing for mouse users when the tooltip's anchor element is programmatically focused
|
|
132
|
-
if (
|
|
140
|
+
if (isFocusVisible && (showOnDescendantFocus || e.target === e.currentTarget)) {
|
|
133
141
|
triggerShowTooltip(e.target);
|
|
134
142
|
}
|
|
135
143
|
};
|
|
@@ -186,7 +194,7 @@ const Tooltip = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
|
186
194
|
open: isInDOM,
|
|
187
195
|
placement: placement,
|
|
188
196
|
anchor: /*#__PURE__*/React__default.cloneElement(children, {
|
|
189
|
-
ref: mergeRefs(anchorRef, children.ref
|
|
197
|
+
ref: mergeRefs(anchorRef, (_children$ref = children.ref) !== null && _children$ref !== void 0 ? _children$ref : null)
|
|
190
198
|
}),
|
|
191
199
|
popper: /*#__PURE__*/React__default.createElement("div", _extends({}, rest, {
|
|
192
200
|
id: flyoutContainerId,
|
|
@@ -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 = {"tooltip":"
|
|
5
|
-
var stylesheet=".
|
|
3
|
+
var css_248z = "._-ydim{position:absolute;z-index:2000;max-width:240px;padding:8px 16px;color:#fff;text-align:center;text-decoration:none;background-color:#222;border-radius:4px;box-shadow:0 3px 4px 0 rgba(0,0,0,.05),0 6px 10px 0 rgba(0,0,0,.05);font-size:14px;opacity:0;pointer-events:none;overflow-wrap:break-word;border:1px solid #898989}._-ydim._Wm8-X{color:#32363a;background-color:#fff}._yulUt{opacity:1;pointer-events:all}._8U5fJ,._8U5fJ>div{position:absolute;width:8px;height:8px;background:inherit}._8U5fJ{visibility:hidden;z-index:2000}._8U5fJ>div{visibility:visible;border:1px solid #898989;transform:rotate(45deg)}[data-popper-placement^=top]>._8U5fJ{bottom:-4px}[data-popper-placement^=top]>._8U5fJ>div{border-top-color:transparent;border-left-color:transparent}[data-popper-placement^=right]>._8U5fJ{left:-5px}[data-popper-placement^=right]>._8U5fJ>div{border-top-color:transparent;border-right-color:transparent}[data-popper-placement^=bottom]>._8U5fJ{top:-5px}[data-popper-placement^=bottom]>._8U5fJ>div{border-bottom-color:transparent;border-right-color:transparent}[data-popper-placement^=left]>._8U5fJ{right:-4px}[data-popper-placement^=left]>._8U5fJ>div{border-bottom-color:transparent;border-left-color:transparent}._k-mSf{position:absolute}[data-popper-placement^=top]>._k-mSf{bottom:-13px;left:0;width:100%;height:17px}[data-popper-placement^=right]>._k-mSf{top:0;left:-13px;width:17px;height:100%}[data-popper-placement^=bottom]>._k-mSf{top:-13px;left:0;width:100%;height:17px}[data-popper-placement^=left]>._k-mSf{top:0;right:-13px;width:17px;height:100%}";
|
|
4
|
+
var styles = {"tooltip":"_-ydim","lightTheme":"_Wm8-X","visible":"_yulUt","arrow":"_8U5fJ","offsetBackplate":"_k-mSf"};
|
|
5
|
+
var stylesheet="._-ydim{position:absolute;z-index:2000;max-width:240px;padding:8px 16px;color:#fff;text-align:center;text-decoration:none;background-color:#222;border-radius:4px;box-shadow:0 3px 4px 0 rgba(0,0,0,.05),0 6px 10px 0 rgba(0,0,0,.05);font-size:14px;opacity:0;pointer-events:none;overflow-wrap:break-word;border:1px solid #898989}._-ydim._Wm8-X{color:#32363a;background-color:#fff}._yulUt{opacity:1;pointer-events:all}._8U5fJ,._8U5fJ>div{position:absolute;width:8px;height:8px;background:inherit}._8U5fJ{visibility:hidden;z-index:2000}._8U5fJ>div{visibility:visible;border:1px solid #898989;transform:rotate(45deg)}[data-popper-placement^=top]>._8U5fJ{bottom:-4px}[data-popper-placement^=top]>._8U5fJ>div{border-top-color:transparent;border-left-color:transparent}[data-popper-placement^=right]>._8U5fJ{left:-5px}[data-popper-placement^=right]>._8U5fJ>div{border-top-color:transparent;border-right-color:transparent}[data-popper-placement^=bottom]>._8U5fJ{top:-5px}[data-popper-placement^=bottom]>._8U5fJ>div{border-bottom-color:transparent;border-right-color:transparent}[data-popper-placement^=left]>._8U5fJ{right:-4px}[data-popper-placement^=left]>._8U5fJ>div{border-bottom-color:transparent;border-left-color:transparent}._k-mSf{position:absolute}[data-popper-placement^=top]>._k-mSf{bottom:-13px;left:0;width:100%;height:17px}[data-popper-placement^=right]>._k-mSf{top:0;left:-13px;width:17px;height:100%}[data-popper-placement^=bottom]>._k-mSf{top:-13px;left:0;width:100%;height:17px}[data-popper-placement^=left]>._k-mSf{top:0;right:-13px;width:17px;height:100%}";
|
|
6
6
|
styleInject(css_248z);
|
|
7
7
|
|
|
8
8
|
export { styles as default, stylesheet };
|
|
@@ -10,9 +10,9 @@ const UIProvider = _ref => {
|
|
|
10
10
|
config = {}
|
|
11
11
|
} = _ref;
|
|
12
12
|
return /*#__PURE__*/React__default.createElement(TranslationProvider, {
|
|
13
|
-
localizedText: config
|
|
13
|
+
localizedText: config === null || config === void 0 ? void 0 : config.localizedText
|
|
14
14
|
}, /*#__PURE__*/React__default.createElement(PortalTargetProvider, {
|
|
15
|
-
target: portalTarget
|
|
15
|
+
target: portalTarget !== null && portalTarget !== void 0 ? portalTarget : null
|
|
16
16
|
}, children));
|
|
17
17
|
};
|
|
18
18
|
|
|
@@ -51,13 +51,13 @@ const Alpha = function Alpha(_ref) {
|
|
|
51
51
|
const containerRef = React__default.useRef(null);
|
|
52
52
|
const handleChange = useEventCallback(e => {
|
|
53
53
|
const change = getMouseChange(e, hsl, alpha, containerRef.current);
|
|
54
|
-
onChange
|
|
54
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(change, e);
|
|
55
55
|
});
|
|
56
56
|
const handleMouseDown = useMouseDrag(handleChange);
|
|
57
57
|
function handleKeyDown(e) {
|
|
58
58
|
if (Object.keys(KEY_CHANGES).indexOf(e.key) > -1) {
|
|
59
59
|
const change = getKeyChange(e, hsl);
|
|
60
|
-
onChange
|
|
60
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(change, e);
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
63
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
@@ -72,7 +72,7 @@ const Alpha = function Alpha(_ref) {
|
|
|
72
72
|
onTouchMove: handleChange,
|
|
73
73
|
onTouchStart: handleChange,
|
|
74
74
|
style: {
|
|
75
|
-
background:
|
|
75
|
+
background: "linear-gradient(to top, hsla(".concat(hsl.h, ", ").concat(hsl.s * 100, "%, ").concat(hsl.l * 100, "%, 0) 0%, hsla(").concat(hsl.h, ", ").concat(hsl.s * 100, "%, ").concat(hsl.l * 100, "%, 1) 100%)")
|
|
76
76
|
},
|
|
77
77
|
role: "slider",
|
|
78
78
|
"aria-valuemin": 0,
|
|
@@ -82,7 +82,7 @@ const Alpha = function Alpha(_ref) {
|
|
|
82
82
|
}), /*#__PURE__*/React__default.createElement("div", {
|
|
83
83
|
className: styles.alphaSlider,
|
|
84
84
|
style: {
|
|
85
|
-
bottom:
|
|
85
|
+
bottom: "".concat(alpha * 100, "%")
|
|
86
86
|
}
|
|
87
87
|
})));
|
|
88
88
|
};
|
|
@@ -91,7 +91,7 @@ class Color {
|
|
|
91
91
|
setColor(strVal) {
|
|
92
92
|
strVal = strVal.toLowerCase();
|
|
93
93
|
if (strVal.charAt(0) !== '#') {
|
|
94
|
-
strVal =
|
|
94
|
+
strVal = "#".concat(strVal);
|
|
95
95
|
}
|
|
96
96
|
this.value = this.stringToHSB(strVal) || {
|
|
97
97
|
h: 0,
|
|
@@ -148,7 +148,7 @@ class Color {
|
|
|
148
148
|
}
|
|
149
149
|
toHex(h, s, b, a) {
|
|
150
150
|
const rgb = this.toRGB(Number(h), Number(s), Number(b), Number(a));
|
|
151
|
-
return
|
|
151
|
+
return "#".concat((1 << 24 | parseInt(String(rgb.r), 10) << 16 | parseInt(String(rgb.g), 10) << 8 | parseInt(String(rgb.b), 10)).toString(16).substr(1));
|
|
152
152
|
}
|
|
153
153
|
toHSL(h, s, b, a) {
|
|
154
154
|
h = h || this.value.h;
|
|
@@ -254,16 +254,16 @@ class Color {
|
|
|
254
254
|
switch (format) {
|
|
255
255
|
case 'rgb':
|
|
256
256
|
rgb = this.toRGB();
|
|
257
|
-
return
|
|
257
|
+
return "rgb(".concat(rgb.r, ",").concat(rgb.g, ",").concat(rgb.b, ")");
|
|
258
258
|
case 'rgba':
|
|
259
259
|
rgb = this.toRGB();
|
|
260
|
-
return
|
|
260
|
+
return "rgba(".concat(rgb.r, ",").concat(rgb.g, ",").concat(rgb.b, ",").concat(rgb.a, ")");
|
|
261
261
|
case 'hsl':
|
|
262
262
|
hsl = this.toHSL();
|
|
263
|
-
return
|
|
263
|
+
return "hsl(".concat(Math.round(hsl.h), ",").concat(Math.round(hsl.s * 100), "%,").concat(Math.round(hsl.l * 100), "%)");
|
|
264
264
|
case 'hsla':
|
|
265
265
|
hsl = this.toHSL();
|
|
266
|
-
return
|
|
266
|
+
return "hsla(".concat(Math.round(hsl.h), ",").concat(Math.round(hsl.s * 100), "%,").concat(Math.round(hsl.l * 100), "%,").concat(hsl.a, ")");
|
|
267
267
|
case 'hex':
|
|
268
268
|
return this.toHex();
|
|
269
269
|
default:
|
|
@@ -39,14 +39,14 @@ const ColorPicker = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
|
39
39
|
...rest
|
|
40
40
|
} = _ref;
|
|
41
41
|
const [show, setShow] = React__default.useState(false);
|
|
42
|
-
const [color, setColor] = React__default.useState(new Color(externalColor
|
|
42
|
+
const [color, setColor] = React__default.useState(new Color(externalColor !== null && externalColor !== void 0 ? externalColor : defaultColor));
|
|
43
43
|
useEffect(() => {
|
|
44
44
|
if (externalColor) setColor(new Color(externalColor));
|
|
45
45
|
}, [externalColor]);
|
|
46
46
|
function handleChange(rawColor, e) {
|
|
47
47
|
const nextColor = new Color(rawColor);
|
|
48
48
|
setColor(nextColor);
|
|
49
|
-
onChange
|
|
49
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(nextColor.getValue(), e);
|
|
50
50
|
}
|
|
51
51
|
let alpha;
|
|
52
52
|
let width = 136;
|
|
@@ -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 = {"colorPickerBtnColor":"
|
|
5
|
-
var stylesheet=".
|
|
3
|
+
var css_248z = "._v5e6-{margin-left:-6px;height:16px;width:16px;border-radius:2px;box-shadow:inset 0 0 0 1px rgba(0,0,0,.15)}._Vj6hg{margin-right:-12px;margin-left:4px}._0rF0N{background-color:#fff;border-radius:4px;box-shadow:0 4px 24px -4px rgba(0,0,0,.5);width:156px}._nXRmT{margin:8px 8px 0;display:flex}._9Qm8U,._pD1Vi{margin-left:4px}._kHIiz{margin:8px 4px 0 8px;display:flex;flex-wrap:wrap}._dJTaJ{margin:0 4px 4px 0}._dJTaJ:hover{width:18px;height:18px;margin:-1px 3px 3px -1px}._igKAB{margin:4px 8px 8px}._1Bfmq{position:relative;width:96px;height:96px;outline:0}._1Bfmq.focus-visible ._-Wj5R,._1Bfmq:focus-visible ._-Wj5R{box-shadow:0 0 0 2px #fff,0 0 0 4px #0a3f88}._VQsAf{background:linear-gradient(90deg,#fff,transparent)}._MZcWR,._VQsAf{position:absolute;top:0;right:0;bottom:0;left:0}._MZcWR{background:linear-gradient(0deg,#000,transparent)}._-Wj5R{position:absolute;border:2px solid #fff;border-radius:5px;height:8px;width:8px;margin:0 0 -4px -4px;box-shadow:0 0 1px 1px rgba(0,0,0,.4),inset 0 0 1px #000}._kHcvZ{position:relative;background:linear-gradient(0deg,red,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red);width:16px;height:96px;outline:0}._kHcvZ.focus-visible ._FTVt-,._kHcvZ:focus-visible ._FTVt-{box-shadow:0 0 0 2px #fff,0 0 0 4px #0a3f88}._FTVt-{width:16px;height:4px;background:#fff;border-radius:50%;position:absolute;box-shadow:0 0 4px 1px rgba(0,0,0,.4);transform:translateY(2px)}._gciko{position:relative;width:16px;height:96px}._k-XIk{width:16px;height:4px;background:#fff;border-radius:50%;box-shadow:0 0 4px 1px rgba(0,0,0,.4);transform:translateY(2px)}._k-XIk,._Vox9e{position:absolute}._Vox9e{top:0;right:0;bottom:0;left:0;outline:0}._Vox9e.focus-visible ._k-XIk,._Vox9e:focus-visible ._k-XIk{box-shadow:0 0 0 2px #fff,0 0 0 4px #0a3f88}._DvbNT{position:absolute;top:0;right:0;bottom:0;left:0;background-image:linear-gradient(45deg,#d9dadb 25%,transparent 0),linear-gradient(-45deg,#d9dadb 25%,transparent 0),linear-gradient(45deg,transparent 75%,#d9dadb 0),linear-gradient(-45deg,transparent 75%,#d9dadb 0);background-size:16px 16px;background-position:0 0,0 8px,8px -8px,-8px 0}._FRHtS{border-radius:2px;height:16px;width:16px;cursor:pointer;box-shadow:inset 0 0 0 1px rgba(0,0,0,.15)}._FRHtS.focus-visible,._FRHtS:focus-visible{outline:none}._FRHtS.focus-visible,._FRHtS:focus-visible{box-shadow:0 0 0 2px #fff,0 0 0 4px #0a3f88}._E3RIk{display:flex}._E3RIk ._hveoR{position:relative;flex-shrink:0;width:26px;height:26px}._E3RIk ._CSvzS{position:absolute;top:0;right:0;bottom:0;left:0;border-top-left-radius:4px;border-bottom-left-radius:4px;border:1px solid #c6c6c6}._E3RIk ._LJNQL{flex-basis:100%;min-width:0;border-top-left-radius:0;border-bottom-left-radius:0}";
|
|
4
|
+
var styles = {"colorPickerBtnColor":"_v5e6-","colorPickerBtnIcon":"_Vj6hg","colorPicker":"_0rF0N","colorPickerSliderContainer":"_nXRmT","colorPickerHue":"_9Qm8U","colorPickerAlpha":"_pD1Vi","colorPickerSwatches":"_kHIiz","colorPickerSwatch":"_dJTaJ","colorPickerHex":"_igKAB","saturation":"_1Bfmq","saturationCircle":"_-Wj5R","saturationWhite":"_VQsAf","saturationBlack":"_MZcWR","hue":"_kHcvZ","hueSlider":"_FTVt-","alpha":"_gciko","alphaSlider":"_k-XIk","alphaGradient":"_Vox9e","alphaCheckerboard":"_DvbNT","swatch":"_FRHtS","hex":"_E3RIk","hexSwatch":"_hveoR","hexSwatchColor":"_CSvzS","hexInput":"_LJNQL"};
|
|
5
|
+
var stylesheet="._v5e6-{margin-left:-6px;height:16px;width:16px;border-radius:2px;box-shadow:inset 0 0 0 1px rgba(0,0,0,.15)}._Vj6hg{margin-right:-12px;margin-left:4px}._0rF0N{background-color:#fff;border-radius:4px;box-shadow:0 4px 24px -4px rgba(0,0,0,.5);width:156px}._nXRmT{margin:8px 8px 0;display:flex}._9Qm8U,._pD1Vi{margin-left:4px}._kHIiz{margin:8px 4px 0 8px;display:flex;flex-wrap:wrap}._dJTaJ{margin:0 4px 4px 0}._dJTaJ:hover{width:18px;height:18px;margin:-1px 3px 3px -1px}._igKAB{margin:4px 8px 8px}._1Bfmq{position:relative;width:96px;height:96px;outline:0}._1Bfmq.focus-visible ._-Wj5R,._1Bfmq:focus-visible ._-Wj5R{box-shadow:0 0 0 2px #fff,0 0 0 4px #0a3f88}._VQsAf{background:linear-gradient(90deg,#fff,transparent)}._MZcWR,._VQsAf{position:absolute;top:0;right:0;bottom:0;left:0}._MZcWR{background:linear-gradient(0deg,#000,transparent)}._-Wj5R{position:absolute;border:2px solid #fff;border-radius:5px;height:8px;width:8px;margin:0 0 -4px -4px;box-shadow:0 0 1px 1px rgba(0,0,0,.4),inset 0 0 1px #000}._kHcvZ{position:relative;background:linear-gradient(0deg,red,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red);width:16px;height:96px;outline:0}._kHcvZ.focus-visible ._FTVt-,._kHcvZ:focus-visible ._FTVt-{box-shadow:0 0 0 2px #fff,0 0 0 4px #0a3f88}._FTVt-{width:16px;height:4px;background:#fff;border-radius:50%;position:absolute;box-shadow:0 0 4px 1px rgba(0,0,0,.4);transform:translateY(2px)}._gciko{position:relative;width:16px;height:96px}._k-XIk{width:16px;height:4px;background:#fff;border-radius:50%;box-shadow:0 0 4px 1px rgba(0,0,0,.4);transform:translateY(2px)}._k-XIk,._Vox9e{position:absolute}._Vox9e{top:0;right:0;bottom:0;left:0;outline:0}._Vox9e.focus-visible ._k-XIk,._Vox9e:focus-visible ._k-XIk{box-shadow:0 0 0 2px #fff,0 0 0 4px #0a3f88}._DvbNT{position:absolute;top:0;right:0;bottom:0;left:0;background-image:linear-gradient(45deg,#d9dadb 25%,transparent 0),linear-gradient(-45deg,#d9dadb 25%,transparent 0),linear-gradient(45deg,transparent 75%,#d9dadb 0),linear-gradient(-45deg,transparent 75%,#d9dadb 0);background-size:16px 16px;background-position:0 0,0 8px,8px -8px,-8px 0}._FRHtS{border-radius:2px;height:16px;width:16px;cursor:pointer;box-shadow:inset 0 0 0 1px rgba(0,0,0,.15)}._FRHtS.focus-visible,._FRHtS:focus-visible{outline:none}._FRHtS.focus-visible,._FRHtS:focus-visible{box-shadow:0 0 0 2px #fff,0 0 0 4px #0a3f88}._E3RIk{display:flex}._E3RIk ._hveoR{position:relative;flex-shrink:0;width:26px;height:26px}._E3RIk ._CSvzS{position:absolute;top:0;right:0;bottom:0;left:0;border-top-left-radius:4px;border-bottom-left-radius:4px;border:1px solid #c6c6c6}._E3RIk ._LJNQL{flex-basis:100%;min-width:0;border-top-left-radius:0;border-bottom-left-radius:0}";
|
|
6
6
|
styleInject(css_248z);
|
|
7
7
|
|
|
8
8
|
export { styles as default, stylesheet };
|
|
@@ -33,7 +33,7 @@ const HexInput = function HexInput(_ref) {
|
|
|
33
33
|
function handleChange(e) {
|
|
34
34
|
setValue(e.target.value);
|
|
35
35
|
if (isValid(e.target.value)) {
|
|
36
|
-
onChange
|
|
36
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(e.target.value, e);
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
39
|
function handleBlur() {
|
|
@@ -51,13 +51,13 @@ const Hue = function Hue(_ref) {
|
|
|
51
51
|
const containerRef = React__default.useRef(null);
|
|
52
52
|
const handleChange = useEventCallback(e => {
|
|
53
53
|
const change = getMouseChange(e, hsb, containerRef.current);
|
|
54
|
-
onChange
|
|
54
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(change, e);
|
|
55
55
|
});
|
|
56
56
|
const handleMouseDown = useMouseDrag(handleChange);
|
|
57
57
|
function handleKeyDown(e) {
|
|
58
58
|
if (Object.keys(KEY_CHANGES).indexOf(e.key) > -1) {
|
|
59
59
|
const change = getKeyChange(e, hsb);
|
|
60
|
-
onChange
|
|
60
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(change, e);
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
63
|
return (
|
|
@@ -78,7 +78,7 @@ const Hue = function Hue(_ref) {
|
|
|
78
78
|
}), /*#__PURE__*/React__default.createElement("div", {
|
|
79
79
|
className: styles.hueSlider,
|
|
80
80
|
style: {
|
|
81
|
-
bottom:
|
|
81
|
+
bottom: "".concat(hsb.h / 360 * 100, "%")
|
|
82
82
|
}
|
|
83
83
|
}))
|
|
84
84
|
);
|
|
@@ -78,13 +78,13 @@ const Saturation = function Saturation(_ref) {
|
|
|
78
78
|
} = _ref;
|
|
79
79
|
const containerRef = React__default.useRef(null);
|
|
80
80
|
const handleChange = useEventCallback(e => {
|
|
81
|
-
onChange
|
|
81
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(getMouseChange(e, hsb, containerRef.current), e);
|
|
82
82
|
});
|
|
83
83
|
const handleMouseDown = useMouseDrag(handleChange);
|
|
84
84
|
function handleKeyDown(e) {
|
|
85
85
|
if (Object.keys(KEY_CHANGES).indexOf(e.key) > -1) {
|
|
86
86
|
const change = getKeyChange(e, hsb);
|
|
87
|
-
onChange
|
|
87
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(change, e);
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
90
|
return (
|
|
@@ -93,7 +93,7 @@ const Saturation = function Saturation(_ref) {
|
|
|
93
93
|
React__default.createElement("div", _extends({}, rest, {
|
|
94
94
|
ref: containerRef,
|
|
95
95
|
style: {
|
|
96
|
-
backgroundColor:
|
|
96
|
+
backgroundColor: "hsl(".concat(hsb.h, ", 100%, 50%)")
|
|
97
97
|
},
|
|
98
98
|
className: classNames(styles.saturation, className),
|
|
99
99
|
onMouseDown: handleMouseDown,
|
|
@@ -110,8 +110,8 @@ const Saturation = function Saturation(_ref) {
|
|
|
110
110
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
111
111
|
className: styles.saturationCircle,
|
|
112
112
|
style: {
|
|
113
|
-
bottom:
|
|
114
|
-
left:
|
|
113
|
+
bottom: "".concat(hsb.b * 100, "%"),
|
|
114
|
+
left: "".concat(hsb.s * 100, "%")
|
|
115
115
|
}
|
|
116
116
|
}))))
|
|
117
117
|
);
|
|
@@ -12,9 +12,9 @@ const Swatch = function Swatch(_ref) {
|
|
|
12
12
|
...rest
|
|
13
13
|
} = _ref;
|
|
14
14
|
function handleClick(e) {
|
|
15
|
-
onClick
|
|
15
|
+
onClick === null || onClick === void 0 ? void 0 : onClick(color, e);
|
|
16
16
|
}
|
|
17
|
-
const handleKeyDown = e => e.keyCode === ENTER && onClick
|
|
17
|
+
const handleKeyDown = e => e.keyCode === ENTER && (onClick === null || onClick === void 0 ? void 0 : onClick(color, e));
|
|
18
18
|
return /*#__PURE__*/React__default.createElement("span", _extends({}, rest, {
|
|
19
19
|
role: "button",
|
|
20
20
|
tabIndex: 0,
|
|
@@ -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 = {"numberStepperContainer":"
|
|
5
|
-
var stylesheet=".
|
|
3
|
+
var css_248z = "._GidcL{display:inline-flex}._K2MhI{color:#32363a;background:#fafafa;outline:none;text-align:center;padding:0 12px;min-width:55px;width:100%;font-size:14px;border:1px solid #898989;border-radius:0;-moz-appearance:textfield}._K2MhI:hover:not(._YCfBM){cursor:pointer;background:#f5f5f5}._K2MhI._zhyPg{box-shadow:0 0 0 2px #fff,0 0 0 4px #900000}._K2MhI._YCfBM{cursor:not-allowed;fill:#74777a;color:#74777a;border-color:#e5e5e5}._K2MhI._YCfBM>svg{opacity:.4}._K2MhI::-webkit-inner-spin-button,._K2MhI::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}._K2MhI:focus{z-index:0;border:none;border-radius:4px}._K2MhI:focus:not(._zhyPg){box-shadow:0 0 0 2px #fff,0 0 0 4px #0a3f88}._K2MhI:focus:not(._YCfBM),._rEFWh{background:#fafafa}._rEFWh{padding:0;display:flex;justify-content:center;align-items:center;flex-shrink:0;width:36px;height:36px;fill:#515559;outline:none;border-radius:4px 0 0 4px;border:1px solid #898989;border-right-width:0}._rEFWh:hover:not(._YCfBM){cursor:pointer;background:#f5f5f5}._rEFWh:active:not(._YCfBM){background:#e5e5e5}._rEFWh._YCfBM{cursor:not-allowed;fill:#74777a;color:#74777a;border-color:#e5e5e5}._rEFWh._YCfBM>svg{opacity:.4}._Gf4NH{padding:0;display:flex;justify-content:center;align-items:center;flex-shrink:0;width:36px;height:36px;background:#fafafa;fill:#515559;outline:none;border-radius:0 4px 4px 0;border:1px solid #898989;border-left-width:0}._Gf4NH:hover:not(._YCfBM){cursor:pointer;background:#f5f5f5}._Gf4NH:active:not(._YCfBM){background:#e5e5e5}._Gf4NH._YCfBM{cursor:not-allowed;fill:#74777a;color:#74777a;border-color:#e5e5e5}._Gf4NH._YCfBM>svg{opacity:.4}._2V-z2{position:absolute;top:0;left:0;width:0;height:0;margin:0;overflow:hidden}";
|
|
4
|
+
var styles = {"numberStepperContainer":"_GidcL","numberStepperInput":"_K2MhI","disabled":"_YCfBM","invalid":"_zhyPg","decrementBtn":"_rEFWh","incrementBtn":"_Gf4NH","inputValueAlert":"_2V-z2"};
|
|
5
|
+
var stylesheet="._GidcL{display:inline-flex}._K2MhI{color:#32363a;background:#fafafa;outline:none;text-align:center;padding:0 12px;min-width:55px;width:100%;font-size:14px;border:1px solid #898989;border-radius:0;-moz-appearance:textfield}._K2MhI:hover:not(._YCfBM){cursor:pointer;background:#f5f5f5}._K2MhI._zhyPg{box-shadow:0 0 0 2px #fff,0 0 0 4px #900000}._K2MhI._YCfBM{cursor:not-allowed;fill:#74777a;color:#74777a;border-color:#e5e5e5}._K2MhI._YCfBM>svg{opacity:.4}._K2MhI::-webkit-inner-spin-button,._K2MhI::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}._K2MhI:focus{z-index:0;border:none;border-radius:4px}._K2MhI:focus:not(._zhyPg){box-shadow:0 0 0 2px #fff,0 0 0 4px #0a3f88}._K2MhI:focus:not(._YCfBM),._rEFWh{background:#fafafa}._rEFWh{padding:0;display:flex;justify-content:center;align-items:center;flex-shrink:0;width:36px;height:36px;fill:#515559;outline:none;border-radius:4px 0 0 4px;border:1px solid #898989;border-right-width:0}._rEFWh:hover:not(._YCfBM){cursor:pointer;background:#f5f5f5}._rEFWh:active:not(._YCfBM){background:#e5e5e5}._rEFWh._YCfBM{cursor:not-allowed;fill:#74777a;color:#74777a;border-color:#e5e5e5}._rEFWh._YCfBM>svg{opacity:.4}._Gf4NH{padding:0;display:flex;justify-content:center;align-items:center;flex-shrink:0;width:36px;height:36px;background:#fafafa;fill:#515559;outline:none;border-radius:0 4px 4px 0;border:1px solid #898989;border-left-width:0}._Gf4NH:hover:not(._YCfBM){cursor:pointer;background:#f5f5f5}._Gf4NH:active:not(._YCfBM){background:#e5e5e5}._Gf4NH._YCfBM{cursor:not-allowed;fill:#74777a;color:#74777a;border-color:#e5e5e5}._Gf4NH._YCfBM>svg{opacity:.4}._2V-z2{position:absolute;top:0;left:0;width:0;height:0;margin:0;overflow:hidden}";
|
|
6
6
|
styleInject(css_248z);
|
|
7
7
|
|
|
8
8
|
export { styles as default, stylesheet };
|
|
@@ -47,12 +47,12 @@ const NumberStepperDecrement = /*#__PURE__*/React__default.forwardRef((_ref, ref
|
|
|
47
47
|
*/
|
|
48
48
|
const handleClick = e => {
|
|
49
49
|
if (!isDisabled) {
|
|
50
|
-
onClick
|
|
50
|
+
onClick === null || onClick === void 0 ? void 0 : onClick(e);
|
|
51
51
|
decrement(true);
|
|
52
52
|
}
|
|
53
53
|
};
|
|
54
54
|
return /*#__PURE__*/React__default.createElement("button", _extends({}, rest, {
|
|
55
|
-
"data-testid": dataTestIdFromProps
|
|
55
|
+
"data-testid": dataTestIdFromProps !== null && dataTestIdFromProps !== void 0 ? dataTestIdFromProps : getSubDataTestId(dataTestId, 'Decrement'),
|
|
56
56
|
ref: ref,
|
|
57
57
|
type: "button",
|
|
58
58
|
className: classNames(className, styles.decrementBtn, {
|
|
@@ -47,12 +47,12 @@ const NumberStepperIncrement = /*#__PURE__*/React__default.forwardRef((_ref, ref
|
|
|
47
47
|
*/
|
|
48
48
|
const handleClick = e => {
|
|
49
49
|
if (!isDisabled) {
|
|
50
|
-
onClick
|
|
50
|
+
onClick === null || onClick === void 0 ? void 0 : onClick(e);
|
|
51
51
|
increment(true);
|
|
52
52
|
}
|
|
53
53
|
};
|
|
54
54
|
return /*#__PURE__*/React__default.createElement("button", _extends({}, rest, {
|
|
55
|
-
"data-testid": dataTestIdFromProps
|
|
55
|
+
"data-testid": dataTestIdFromProps !== null && dataTestIdFromProps !== void 0 ? dataTestIdFromProps : getSubDataTestId(dataTestId, 'Increment'),
|
|
56
56
|
ref: ref,
|
|
57
57
|
type: "button",
|
|
58
58
|
className: classNames(className, styles.incrementBtn, {
|
|
@@ -55,7 +55,7 @@ const NumberStepperInput = /*#__PURE__*/React__default.forwardRef((_ref, ref) =>
|
|
|
55
55
|
helperTextId: formFieldHelperTextId,
|
|
56
56
|
errorTextId: formFieldErrorTextId
|
|
57
57
|
} = useFormFieldControl();
|
|
58
|
-
const internalAriaDescribedby = concatIds(ariaDescribedByFromProps
|
|
58
|
+
const internalAriaDescribedby = concatIds(ariaDescribedByFromProps !== null && ariaDescribedByFromProps !== void 0 ? ariaDescribedByFromProps : ariaDescribedBy, formFieldHelperTextId, formFieldErrorTextId);
|
|
59
59
|
|
|
60
60
|
// Indicates if the `inputValue` is invalid
|
|
61
61
|
const isInputValueInvalid = typeof inputValue === 'number' && (inputValue > inputMax || inputValue < inputMin);
|
|
@@ -66,7 +66,7 @@ const NumberStepperInput = /*#__PURE__*/React__default.forwardRef((_ref, ref) =>
|
|
|
66
66
|
* depending on the key that was pressed.
|
|
67
67
|
*/
|
|
68
68
|
const handleKeyDown = e => {
|
|
69
|
-
onKeyDown
|
|
69
|
+
onKeyDown === null || onKeyDown === void 0 ? void 0 : onKeyDown(e);
|
|
70
70
|
if (isExternallyDisabled) return;
|
|
71
71
|
if (e.key === 'ArrowUp') {
|
|
72
72
|
// Prevents browser's default increment
|
|
@@ -101,7 +101,7 @@ const NumberStepperInput = /*#__PURE__*/React__default.forwardRef((_ref, ref) =>
|
|
|
101
101
|
* Selects the DOM element
|
|
102
102
|
*/
|
|
103
103
|
const handleFocus = e => {
|
|
104
|
-
onFocus
|
|
104
|
+
onFocus === null || onFocus === void 0 ? void 0 : onFocus(e);
|
|
105
105
|
if (isExternallyDisabled) return;
|
|
106
106
|
e.target.select();
|
|
107
107
|
};
|
|
@@ -111,15 +111,15 @@ const NumberStepperInput = /*#__PURE__*/React__default.forwardRef((_ref, ref) =>
|
|
|
111
111
|
* Calls `handleInputBlur`
|
|
112
112
|
*/
|
|
113
113
|
const handleBlur = e => {
|
|
114
|
-
onBlur
|
|
114
|
+
onBlur === null || onBlur === void 0 ? void 0 : onBlur(e);
|
|
115
115
|
if (isExternallyDisabled) return;
|
|
116
116
|
handleInputBlur(e);
|
|
117
117
|
};
|
|
118
118
|
return /*#__PURE__*/React__default.createElement("input", _extends({}, rest, {
|
|
119
119
|
// `type`, `step`, `min`, `max`, `onChange`, and `value` are purposely overwritten
|
|
120
120
|
ref: ref,
|
|
121
|
-
"data-testid": dataTestIdFromProps
|
|
122
|
-
id: idFromProps
|
|
121
|
+
"data-testid": dataTestIdFromProps !== null && dataTestIdFromProps !== void 0 ? dataTestIdFromProps : getSubDataTestId(dataTestId, 'Input'),
|
|
122
|
+
id: idFromProps !== null && idFromProps !== void 0 ? idFromProps : inputId,
|
|
123
123
|
className: classNames(className, styles.numberStepperInput, {
|
|
124
124
|
[styles.invalid]: isInputValueInvalid,
|
|
125
125
|
[styles.disabled]: isExternallyDisabled
|
|
@@ -132,8 +132,8 @@ const NumberStepperInput = /*#__PURE__*/React__default.forwardRef((_ref, ref) =>
|
|
|
132
132
|
"aria-valuemin": inputMin,
|
|
133
133
|
"aria-valuemax": inputMax,
|
|
134
134
|
"aria-valuenow": Number(inputValue),
|
|
135
|
-
"aria-label": ariaLabelFromProps
|
|
136
|
-
"aria-labelledby": ariaLabelledByFromProps
|
|
135
|
+
"aria-label": ariaLabelFromProps !== null && ariaLabelFromProps !== void 0 ? ariaLabelFromProps : ariaLabel,
|
|
136
|
+
"aria-labelledby": ariaLabelledByFromProps !== null && ariaLabelledByFromProps !== void 0 ? ariaLabelledByFromProps : ariaLabelledBy,
|
|
137
137
|
"aria-describedby": internalAriaDescribedby,
|
|
138
138
|
"aria-invalid": isInputValueInvalid,
|
|
139
139
|
"aria-disabled": isExternallyDisabled,
|
|
@@ -25,8 +25,8 @@ const Tabs = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
|
25
25
|
...rest
|
|
26
26
|
} = _ref;
|
|
27
27
|
const tabsId = useId(externalId);
|
|
28
|
-
const tabIdPrefix =
|
|
29
|
-
const tabPanelIdPrefix =
|
|
28
|
+
const tabIdPrefix = "".concat(tabsId, "-tab-");
|
|
29
|
+
const tabPanelIdPrefix = "".concat(tabsId, "-tab-panel-");
|
|
30
30
|
const tabRefs = useRef({});
|
|
31
31
|
const [tabIndexOfActiveTab, setTabIndexOfActiveTab] = useState(0);
|
|
32
32
|
const focusOnIndex = index => {
|
|
@@ -41,7 +41,7 @@ const Tabs = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
|
41
41
|
setTabIndexOfActiveTab(0);
|
|
42
42
|
};
|
|
43
43
|
const handleSelect = key => {
|
|
44
|
-
onChange
|
|
44
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(key);
|
|
45
45
|
};
|
|
46
46
|
const handleKeyDown = (event, tabElementKey, index) => {
|
|
47
47
|
if (event.key === 'Enter' || event.key === ' ') {
|
|
@@ -63,6 +63,7 @@ const Tabs = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
|
63
63
|
const tabs = [];
|
|
64
64
|
React__default.Children.forEach(children, (child, index) => {
|
|
65
65
|
if (child) {
|
|
66
|
+
var _child$props$id;
|
|
66
67
|
const key = child.key || String(index);
|
|
67
68
|
const active = key === activeKey;
|
|
68
69
|
const context = {
|
|
@@ -74,17 +75,19 @@ const Tabs = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
|
74
75
|
value: context
|
|
75
76
|
}, /*#__PURE__*/React__default.cloneElement(child, {
|
|
76
77
|
key,
|
|
77
|
-
id: child.props.id
|
|
78
|
+
id: (_child$props$id = child.props.id) !== null && _child$props$id !== void 0 ? _child$props$id : tabIdPrefix + key,
|
|
78
79
|
children: child.props.children,
|
|
79
80
|
ref: mergeRefs(child.ref, node => {
|
|
80
81
|
tabRefs.current[index] = node;
|
|
81
82
|
}),
|
|
82
83
|
onKeyDown: event => {
|
|
83
|
-
|
|
84
|
+
var _child$props$onKeyDow, _child$props;
|
|
85
|
+
(_child$props$onKeyDow = (_child$props = child.props).onKeyDown) === null || _child$props$onKeyDow === void 0 ? void 0 : _child$props$onKeyDow.call(_child$props);
|
|
84
86
|
handleKeyDown(event, key, index);
|
|
85
87
|
},
|
|
86
88
|
onClick: () => {
|
|
87
|
-
|
|
89
|
+
var _child$props$onClick, _child$props2;
|
|
90
|
+
(_child$props$onClick = (_child$props2 = child.props).onClick) === null || _child$props$onClick === void 0 ? void 0 : _child$props$onClick.call(_child$props2);
|
|
88
91
|
handleSelect(key);
|
|
89
92
|
},
|
|
90
93
|
'aria-controls': tabPanelIdPrefix + key
|
|
@@ -97,6 +100,7 @@ const Tabs = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
|
97
100
|
const panels = [];
|
|
98
101
|
React__default.Children.forEach(children, (child, index) => {
|
|
99
102
|
if (child) {
|
|
103
|
+
var _child$props$id2;
|
|
100
104
|
const key = child.key || String(index);
|
|
101
105
|
const isActive = key === activeKey;
|
|
102
106
|
const panelClasses = classNames(styles.panel, {
|
|
@@ -105,7 +109,7 @@ const Tabs = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
|
105
109
|
panels.push( /*#__PURE__*/React__default.createElement("div", {
|
|
106
110
|
key: key,
|
|
107
111
|
role: "tabpanel",
|
|
108
|
-
"aria-labelledby": child.props.id
|
|
112
|
+
"aria-labelledby": (_child$props$id2 = child.props.id) !== null && _child$props$id2 !== void 0 ? _child$props$id2 : tabIdPrefix + key,
|
|
109
113
|
className: panelClasses,
|
|
110
114
|
id: tabPanelIdPrefix + key
|
|
111
115
|
}, isActive ? child.props.children : null));
|
|
@@ -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 = {"tabs":"
|
|
5
|
-
var stylesheet=".
|
|
3
|
+
var css_248z = "._2RhG4{display:block}._hBCPj{display:flex;justify-content:left;border-bottom:1px solid #e5e5e5;height:52px}._Sv870{color:#6a6d70;cursor:pointer;height:52px;padding:16px 12px;max-width:200px;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;border-bottom:1px solid transparent;border-radius:1px}._Sv870:hover{color:#32363a}._Sv870:focus{outline:none}._Sv870._OMkgT{margin-bottom:-1px;border-bottom:2px solid #0b6ed0;color:#32363a;font-family:\"72Duplex\",\"72\",\"Helvetica Neue\",Helvetica,Arial,sans-serif;font-weight:500}._oyqMP{padding-top:32px}._oyqMP._HdD4M{display:none}._Sv870.focus-visible,._Sv870:focus-visible{box-shadow:0 0 0 2px #fff,0 0 0 4px #0a3f88}";
|
|
4
|
+
var styles = {"tabs":"_2RhG4","bar":"_hBCPj","tab":"_Sv870","active":"_OMkgT","panel":"_oyqMP","inactive":"_HdD4M"};
|
|
5
|
+
var stylesheet="._2RhG4{display:block}._hBCPj{display:flex;justify-content:left;border-bottom:1px solid #e5e5e5;height:52px}._Sv870{color:#6a6d70;cursor:pointer;height:52px;padding:16px 12px;max-width:200px;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;border-bottom:1px solid transparent;border-radius:1px}._Sv870:hover{color:#32363a}._Sv870:focus{outline:none}._Sv870._OMkgT{margin-bottom:-1px;border-bottom:2px solid #0b6ed0;color:#32363a;font-family:\"72Duplex\",\"72\",\"Helvetica Neue\",Helvetica,Arial,sans-serif;font-weight:500}._oyqMP{padding-top:32px}._oyqMP._HdD4M{display:none}._Sv870.focus-visible,._Sv870:focus-visible{box-shadow:0 0 0 2px #fff,0 0 0 4px #0a3f88}";
|
|
6
6
|
styleInject(css_248z);
|
|
7
7
|
|
|
8
8
|
export { styles as default, stylesheet };
|