@qualtrics/ui-react 2.18.0 → 2.19.1
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 +28 -0
- package/dist/__shared/cjs/{index-00992312.js → index-384184bd.js} +994 -1872
- package/dist/__shared/cjs/{index-615ed9b2.js → index-4a5425cc.js} +10 -7
- package/dist/components/Accordion/Accordion.js +1 -5
- package/dist/components/Accordion/Accordion2.js +3 -3
- package/dist/components/Accordion/AccordionHeader.js +4 -8
- package/dist/components/Accordion/AccordionPanel.js +3 -3
- package/dist/components/BreakpointSwitch/Breakpoint.js +0 -2
- package/dist/components/BreakpointSwitch/BreakpointSwitch.js +0 -3
- package/dist/components/Button/Button.js +3 -3
- package/dist/components/Button/Button2.js +2 -7
- package/dist/components/ButtonGroup/ButtonGroup.js +1 -2
- 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/VisualCheckbox.js +1 -1
- package/dist/components/Checkbox/VisualCheckbox2.js +3 -3
- package/dist/components/ColorPicker/Alpha.js +9 -30
- package/dist/components/ColorPicker/ColorPicker.js +33 -42
- package/dist/components/ColorPicker/ColorPicker2.js +3 -3
- package/dist/components/ColorPicker/ColorPickerFlyout.js +2 -1
- package/dist/components/ColorPicker/ColorPickerFlyoutInputs.js +20 -23
- package/dist/components/ColorPicker/Hue.js +2 -19
- package/dist/components/ColorPicker/Palette.js +7 -27
- package/dist/components/ColorPicker/Saturation.js +8 -29
- package/dist/components/ColorPicker/utils/calculateTargetId.js +10 -20
- package/dist/components/ColorPicker/utils/getMousePosition.js +4 -3
- package/dist/components/ColorPicker/utils/hexToHsv.js +0 -5
- package/dist/components/ColorPicker/utils/hexToRgbaString.js +2 -4
- package/dist/components/ColorPicker/utils/hsvToHex.js +0 -3
- package/dist/components/ColorPicker/utils/rgbToHex.js +1 -1
- package/dist/components/ColorPicker/utils/validateHex.js +12 -19
- package/dist/components/Combobox/Combobox.js +57 -127
- package/dist/components/Combobox/Combobox2.js +3 -3
- package/dist/components/Combobox/ComboboxHeader.js +1 -1
- package/dist/components/Combobox/ComboboxIcon.js +2 -4
- package/dist/components/Combobox/ComboboxInput.js +4 -5
- package/dist/components/Combobox/ComboboxList.js +2 -2
- package/dist/components/ConfigPane/ConfigPane.js +0 -7
- package/dist/components/ConfigPane/ConfigPane2.js +3 -3
- package/dist/components/Divider/Divider2.js +3 -3
- package/dist/components/Dropdown/ChildIndexContext/index.js +0 -1
- package/dist/components/Dropdown/ChildIndexContext/reach-descendants.js +34 -30
- package/dist/components/Dropdown/Dropdown.js +17 -68
- package/dist/components/Dropdown/Dropdown2.js +3 -3
- package/dist/components/Dropdown/DropdownButton.js +23 -33
- package/dist/components/Dropdown/DropdownHeader.js +2 -1
- package/dist/components/Dropdown/DropdownList.js +8 -7
- package/dist/components/Dropdown/DropdownOption.js +3 -10
- package/dist/components/Dropdown/DropdownSearch.js +6 -24
- package/dist/components/FilePicker/FilePicker.js +15 -26
- 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 -6
- package/dist/components/FormField/ReadOnlyText.js +2 -1
- package/dist/components/FullScreenTakeover/FullScreenTakeover.js +5 -11
- package/dist/components/FullScreenTakeover/FullScreenTakeover2.js +3 -3
- package/dist/components/Icon/Icon.js +3 -6
- package/dist/components/Icon/IconTypes.js +1 -0
- package/dist/components/IconButton/IconButton.js +1 -6
- package/dist/components/IconButton/IconButton2.js +3 -3
- package/dist/components/InlineInput/InlineInput.js +16 -33
- package/dist/components/InlineInput/InlineInput2.js +3 -3
- package/dist/components/Input/Input.js +3 -2
- package/dist/components/Input/Input2.js +3 -3
- package/dist/components/Input/InputField.js +2 -5
- package/dist/components/InputGroup/InputGroup2.js +3 -3
- package/dist/components/InputGroup/InputGroupProvider.js +0 -2
- 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/ConditionContainer.js +0 -2
- package/dist/components/LogicEditor/ConditionSet.js +8 -25
- package/dist/components/LogicEditor/Controls.js +2 -2
- package/dist/components/LogicEditor/LogicEditor.js +3 -12
- package/dist/components/LogicEditor/LogicEditor2.js +3 -3
- package/dist/components/LogicEditor/utils.js +9 -34
- package/dist/components/Modal/Modal.js +22 -35
- package/dist/components/Modal/Modal2.js +3 -3
- package/dist/components/NewMenu/BaseMenu.js +43 -108
- package/dist/components/NewMenu/NewMenu.js +3 -3
- package/dist/components/NewMenu/SelectMenu/SelectMenu.js +2 -3
- package/dist/components/NewMenu/parts/ArrowNav/ArrowNav.js +20 -32
- package/dist/components/NewMenu/parts/MenuItem.js +2 -3
- package/dist/components/NewMenu/parts/MenuSearchBox.js +2 -1
- package/dist/components/NumberStepper/NumberStepper.js +29 -44
- package/dist/components/NumberStepper/NumberStepper2.js +3 -3
- package/dist/components/NumberStepper/NumberStepperDecrement.js +6 -5
- package/dist/components/NumberStepper/NumberStepperIncrement.js +6 -5
- package/dist/components/NumberStepper/NumberStepperInput.js +10 -12
- package/dist/components/PageLayout/PageLayout.js +3 -3
- package/dist/components/Pagination/Pagination.js +10 -6
- package/dist/components/Pagination/Pagination2.js +3 -3
- package/dist/components/Pagination/PaginationNextButton.js +8 -8
- package/dist/components/Pagination/PaginationPageInput.js +17 -22
- package/dist/components/Pagination/PaginationPreviousButton.js +8 -8
- package/dist/components/Popover/Popover.js +9 -18
- package/dist/components/Popover/Popover2.js +3 -3
- package/dist/components/QuickSearch/QuickSearch.js +3 -5
- package/dist/components/QuickSearch/QuickSearch2.js +3 -3
- package/dist/components/QuickSearch/QuickSearchInput.js +6 -23
- package/dist/components/Radio/Radio.js +11 -13
- package/dist/components/Radio/Radio2.js +3 -3
- package/dist/components/SearchInput/SearchInput.js +5 -11
- package/dist/components/SearchInput/SearchInput2.js +3 -3
- package/dist/components/SidebarNav/ExpandCollapseButton.js +0 -2
- package/dist/components/SidebarNav/SidebarNav.js +5 -4
- package/dist/components/SidebarNav/SidebarNav2.js +3 -3
- package/dist/components/SidebarNav/SidebarNavLink.js +1 -4
- package/dist/components/Slider/RangeSlider.js +8 -22
- package/dist/components/Slider/Slider.js +7 -26
- package/dist/components/Slider/Slider2.js +3 -3
- package/dist/components/Slider/SliderButton.js +7 -9
- 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/TabContextProvider.js +1 -1
- package/dist/components/Tabs/TabList.js +9 -17
- package/dist/components/Tabs/TabPanel.js +3 -3
- package/dist/components/Tabs/TabPanels.js +0 -2
- package/dist/components/Tabs/Tabs2.js +3 -3
- package/dist/components/Tooltip/Tooltip.js +12 -41
- package/dist/components/Tooltip/Tooltip2.js +3 -3
- package/dist/components/UIProvider/PortalTargetContext.js +0 -1
- package/dist/components/UIProvider/UIProvider.js +2 -2
- package/dist/components/deprecated_ColorPicker/Alpha.js +4 -11
- package/dist/components/deprecated_ColorPicker/Color.js +9 -66
- package/dist/components/deprecated_ColorPicker/ColorPicker.js +2 -8
- package/dist/components/deprecated_ColorPicker/ColorPicker2.js +3 -3
- package/dist/components/deprecated_ColorPicker/HexInput.js +1 -7
- package/dist/components/deprecated_ColorPicker/Hue.js +3 -10
- package/dist/components/deprecated_ColorPicker/Saturation.js +7 -14
- package/dist/components/deprecated_ColorPicker/Swatch.js +2 -6
- package/dist/components/deprecated_ColorPicker/useMouseDrag.js +0 -3
- package/dist/components/deprecated_NumberStepper/NumberStepper.js +14 -20
- package/dist/components/deprecated_NumberStepper/NumberStepper2.js +3 -3
- package/dist/components/deprecated_NumberStepper/NumberStepperDecrement.js +7 -6
- package/dist/components/deprecated_NumberStepper/NumberStepperIncrement.js +7 -6
- package/dist/components/deprecated_NumberStepper/NumberStepperInput.js +16 -17
- package/dist/components/deprecated_Tabs/Tabs.js +9 -25
- 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 +3 -17
- package/dist/components/deprecated_Toolbar/ToolbarTab.js +10 -26
- package/dist/components/deprecated_Toolbar/ToolbarTabs.js +6 -18
- package/dist/hooks/useBreakpoints/useBreakpoints.js +3 -4
- package/dist/hooks/useClickOutside/useClickOutside.js +2 -7
- package/dist/hooks/useClickOutsidePortals/useClickOutsidePortals.js +3 -6
- package/dist/hooks/useControllableState/useControllableState.js +5 -10
- package/dist/hooks/useDidUpdate/useDidUpdate.js +2 -4
- package/dist/hooks/useEventCallback/useEventCallback.js +2 -1
- package/dist/hooks/useEventListener/useEventListener.js +1 -4
- package/dist/hooks/useFocusSequence/useFocusSequence.js +10 -17
- package/dist/hooks/useId/useId.js +1 -2
- package/dist/hooks/useIsFocused/useIsFocused.js +0 -1
- package/dist/hooks/useIsHovered/useIsHovered.js +0 -1
- package/dist/hooks/useIsTruncated/useIsTruncated.js +4 -3
- package/dist/hooks/useLatest/useLatest.js +0 -1
- package/dist/hooks/useMounted/useMounted.js +0 -1
- package/dist/hooks/useMouseDrag/useMouseDrag.js +0 -4
- package/dist/hooks/useOverlay/useOverlay.js +4 -10
- package/dist/hooks/useOverlay/useOverlay2.js +3 -3
- package/dist/hooks/usePrevious/usePrevious.js +0 -1
- package/dist/hooks/useResponsiveValue/useResponsiveValue.js +1 -4
- package/dist/hooks/useScreenReaderAnnouncement/useScreenReaderAnnouncement.js +11 -16
- package/dist/hooks/useScreenReaderAnnouncement/useScreenReaderAnnouncement2.js +3 -3
- package/dist/icons/Icon.js +3 -3
- package/dist/icons/components/HeadsetIcon.js +6 -0
- package/dist/icons/components/PauseCircleIcon.js +1 -1
- package/dist/icons/createIconComponent.js +2 -3
- package/dist/icons/index.d.ts +2 -0
- package/dist/icons/index.es.js +1 -0
- package/dist/icons/index.js +2 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.es.js +4 -3
- package/dist/index.js +6 -5
- package/dist/next/AdvancedTable/AdvancedTable.js +82 -188
- package/dist/next/AdvancedTable/AdvancedTable2.js +3 -3
- package/dist/next/AdvancedTable/AdvancedTableCell.js +4 -14
- package/dist/next/AdvancedTable/AdvancedTableCheckbox.js +0 -1
- package/dist/next/AdvancedTable/AdvancedTableColumnHeader.js +11 -41
- package/dist/next/AdvancedTable/AdvancedTableColumnHeaderMenu.js +8 -14
- package/dist/next/AdvancedTable/AdvancedTableDragPreview.js +4 -6
- package/dist/next/AdvancedTable/AdvancedTablePagination.js +1 -4
- package/dist/next/AdvancedTable/AdvancedTableRowExpandButton.js +0 -1
- package/dist/next/AdvancedTable/AdvancedTableTypes.js +1 -3
- package/dist/next/AdvancedTable/useAdvancedTableDragAndDrop.js +8 -13
- package/dist/next/AdvancedTable/useComputedWidth.js +1 -1
- package/dist/next/CollapsibleSearchInput/CollapsibleSearchInput.js +5 -20
- 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 +3 -3
- package/dist/next/Combobox/ComboboxGroup.js +1 -1
- package/dist/next/Combobox/ComboboxInput.js +7 -20
- package/dist/next/Combobox/ComboboxOption.js +5 -6
- package/dist/next/Combobox/hooks/useComboboxFilteredGroup/useComboboxFilteredGroup.js +4 -5
- package/dist/next/Combobox/hooks/useComboboxFocusSequence/useComboboxFocusSequence.js +37 -54
- package/dist/next/Combobox/hooks/useComboboxLoadingState/useComboboxLoadingState.js +4 -5
- package/dist/next/Combobox/hooks/useComboboxValue/useComboboxValue.js +5 -3
- package/dist/next/Combobox/hooks/useListboxFlyoutDimensions/useListboxFlyoutDimensions.js +10 -10
- package/dist/next/Combobox/hooks/useSelectedOptionScroll/useSelectedOptionScroll.js +1 -6
- package/dist/next/Combobox/hooks/useShouldRenderGroupHeader/useShouldRenderGroupHeader.js +6 -6
- package/dist/next/Combobox/utils/nodeRegistration/nodeRegistration.js +4 -6
- package/dist/next/Drawer/Drawer.js +5 -16
- package/dist/next/Drawer/Drawer2.js +3 -3
- package/dist/next/FilterAnchor/FilterAnchor.js +7 -5
- package/dist/next/FilterAnchor/FilterAnchor2.js +3 -3
- package/dist/next/Input/Input.js +5 -8
- package/dist/next/Input/Input2.js +3 -3
- package/dist/next/Menu/Menu.js +10 -23
- package/dist/next/Menu/Menu2.js +3 -3
- package/dist/next/Menu/MenuContext.js +0 -2
- package/dist/next/Menu/MenuItem.js +11 -15
- package/dist/next/Menu/MenuPane.js +11 -25
- package/dist/next/Menu/MenuSearch.js +15 -22
- package/dist/next/Menu/SubMenu.js +10 -27
- package/dist/next/Menu/usePaneSearch.js +2 -1
- package/dist/next/PhoneNumberInput/PhoneNumberInput.js +12 -19
- package/dist/next/PhoneNumberInput/PhoneNumberInput2.js +3 -3
- package/dist/next/SplitButton/SplitButton.js +6 -12
- package/dist/next/SplitButton/SplitButton2.js +3 -3
- package/dist/next/Stack/HStack.js +11 -0
- package/dist/next/Stack/Stack.js +95 -0
- package/dist/next/Stack/StackItem.js +37 -0
- package/dist/next/Stack/VStack.js +11 -0
- package/dist/next/Stack/index.js +3 -0
- package/dist/next/TimePicker/TimeDropdown.js +4 -5
- package/dist/next/TimePicker/TimeInput.js +4 -5
- package/dist/next/TimePicker/TimePicker.js +12 -30
- package/dist/next/TimePicker/TimePicker2.js +3 -3
- package/dist/next/TimePicker/TimePickerIcon.js +1 -3
- package/dist/next/TimePicker/utils.js +12 -52
- package/dist/next/ToggleButton/ToggleButton.js +0 -5
- package/dist/next/ToggleButton/ToggleButtonGroup.js +2 -1
- package/dist/next/ToggleButton/styles.js +3 -3
- package/dist/next/index.d.ts +82 -4
- package/dist/next/index.es.js +4 -0
- package/dist/next/index.js +514 -745
- package/dist/utils/Flyout/Flyout.js +4 -5
- package/dist/utils/Flyout/Flyout2.js +3 -3
- package/dist/utils/Popper/Popper.js +18 -25
- package/dist/utils/Portal/Portal.js +2 -1
- package/dist/utils/TextOverflowTooltip/TextOverflowTooltip.js +4 -4
- package/dist/utils/Translation/Translate.js +0 -4
- package/dist/utils/Translation/TranslationProvider.js +0 -1
- package/dist/utils/Translation/containsComponentOrElement.js +1 -5
- package/dist/utils/Translation/insertPlaceholders.js +0 -1
- package/dist/utils/Translation/useTranslation.js +7 -14
- package/dist/utils/concatIds/concatIds.js +0 -1
- package/dist/utils/constants.js +2 -2
- package/dist/utils/createContextUtilities/createContextUtilities.js +0 -4
- package/dist/utils/filterChildren/filterChildren.js +8 -17
- package/dist/utils/getSubDataTestId/getSubDataTestId.js +1 -2
- package/dist/utils/keyboardUser/keyboardUser.js +0 -1
- package/dist/utils/mediaQueryManager/mediaQueryManager.js +1 -12
- package/dist/utils/mergeRefs/mergeRefs.js +1 -2
- package/dist/utils/wrapAround/wrapAround.js +1 -2
- package/dist/utils/wrapEvent/wrapEvent.js +2 -4
- package/icons/package.json +3 -2
- package/next/package.json +6 -2
- package/package.json +10 -5
|
@@ -20,7 +20,6 @@ const ExpandCollapseButton = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
20
20
|
const {
|
|
21
21
|
isCollapsed
|
|
22
22
|
} = useSidebarNavContext();
|
|
23
|
-
|
|
24
23
|
if (isCollapsed) {
|
|
25
24
|
const expandSidebarLabel = translate('showLabels');
|
|
26
25
|
return /*#__PURE__*/React__default.createElement(Tooltip, {
|
|
@@ -37,7 +36,6 @@ const ExpandCollapseButton = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
37
36
|
className: styles.icon
|
|
38
37
|
})));
|
|
39
38
|
}
|
|
40
|
-
|
|
41
39
|
return /*#__PURE__*/React__default.createElement("button", _extends({}, props, {
|
|
42
40
|
type: "button",
|
|
43
41
|
className: classNames(styles.sidebarNavItem, styles.expandCollapseButton, styles.iconButtonWithLabel),
|
|
@@ -9,6 +9,9 @@ import ExpandCollapseButton from './ExpandCollapseButton.js';
|
|
|
9
9
|
import useControllableState from '../../hooks/useControllableState/useControllableState.js';
|
|
10
10
|
import getSubDataTestId from '../../utils/getSubDataTestId/getSubDataTestId.js';
|
|
11
11
|
|
|
12
|
+
// react component type comes with "defaultProps" attribute which
|
|
13
|
+
// which causes typescript failures but all we really care about
|
|
14
|
+
// is the render function
|
|
12
15
|
const SidebarNav = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
13
16
|
let {
|
|
14
17
|
isCollapsible = true,
|
|
@@ -24,16 +27,14 @@ const SidebarNav = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
24
27
|
const expandCollapseButtonRef = useRef(null);
|
|
25
28
|
const [isExpandCollapseButtonFocused, setIsExpandCollapseButtonFocused] = useState(false);
|
|
26
29
|
const [isCollapsed, setIsCollapsed] = useControllableState(false, isCollapsible ? onIsCollapsedChange : undefined, isCollapsible && externalIsCollapsed);
|
|
30
|
+
|
|
27
31
|
/*
|
|
28
32
|
* Focuses the new expand/collapse button when the tabs expand/collapse and the old expand/collapse button was focused.
|
|
29
33
|
* When the tabs expand/collapse, a different expand/collapse button is rendered, which is why the programmatic focus is needed.
|
|
30
34
|
*/
|
|
31
|
-
|
|
32
35
|
useEffect(() => {
|
|
33
36
|
if (isExpandCollapseButtonFocused) {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
(_expandCollapseButton = expandCollapseButtonRef.current) === null || _expandCollapseButton === void 0 ? void 0 : _expandCollapseButton.focus();
|
|
37
|
+
expandCollapseButtonRef.current?.focus();
|
|
37
38
|
}
|
|
38
39
|
}, [isCollapsed, isExpandCollapseButtonFocused]);
|
|
39
40
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
@@ -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 = {"sideBarNav":"
|
|
5
|
-
var stylesheet=".
|
|
3
|
+
var css_248z = "._rbT5f{grid-area:sidebarNav;height:100%;display:flex;flex-direction:column;align-items:center;min-width:165px;max-width:240px;background-color:#fff;border-right:1px solid #eee;overflow:hidden}._rbT5f._TFyJN{width:69px;min-width:auto;max-width:none}._qiBkp{margin:12px 0 28px;width:100%;overflow:auto;padding:4px 16px 0}._eeNWk{margin-bottom:12px;background-color:transparent!important}._eeNWk:hover{background-color:rgba(11,110,208,.08)!important}._eeNWk:hover ._udbsn{fill:#085caf}._eeNWk:hover ._HoEPv{color:#085caf}._eeNWk:active{background-color:rgba(11,110,208,.12)!important}._eeNWk:active ._udbsn{fill:#0854a1}._eeNWk:active ._HoEPv{color:#0854a1}._eeNWk._wymAu{background-color:rgba(11,110,208,.08)!important}._eeNWk._wymAu ._udbsn{fill:#0b6ed0}._eeNWk._wymAu ._HoEPv{color:#0b6ed0;font-family:\"72Duplex\",\"72\",\"Helvetica Neue\",Helvetica,Arial,sans-serif;font-weight:500}._eeNWk._wymAu:hover{background-color:rgba(11,110,208,.08)!important}._eeNWk._wymAu:hover ._udbsn{fill:#085caf}._eeNWk._wymAu:hover ._HoEPv{color:#085caf}._eeNWk._wymAu:active{background-color:rgba(11,110,208,.12)!important}._eeNWk._wymAu:active ._udbsn{fill:#0854a1}._eeNWk._wymAu:active ._HoEPv{color:#0854a1}._BQPrd{border-radius:6px}._BQPrd ._udbsn{display:block;fill:#515559}._rzE1c{width:100%;padding:0 16px;margin-top:auto;margin-bottom:0}._XqIVt,._XVRZc{width:100%;display:flex;align-items:start;border:1px solid transparent;border-radius:6px;outline:none;cursor:pointer;padding:5px 11px 5px 5px;text-decoration:none}._XqIVt ._udbsn,._XVRZc ._udbsn{fill:#515559}._XqIVt ._HoEPv,._XVRZc ._HoEPv{font-size:14px;line-height:19px;color:#515559;overflow:hidden;overflow-wrap:break-word;margin:2.5px 0 2.5px 6px}body.keyboard-user ._eeNWk:active:focus,body.keyboard-user ._eeNWk:focus{box-shadow:0 0 0 2px #fff,0 0 0 4px #0a3f88}";
|
|
4
|
+
var styles = {"sideBarNav":"_rbT5f","collapsed":"_TFyJN","navItems":"_qiBkp","sidebarNavItem":"_eeNWk","icon":"_udbsn","label":"_HoEPv","selected":"_wymAu","sidebarNavItemIconButton":"_BQPrd","expandCollapseButtonContainer":"_rzE1c","navLink":"_XqIVt","iconButtonWithLabel":"_XVRZc"};
|
|
5
|
+
var stylesheet="._rbT5f{grid-area:sidebarNav;height:100%;display:flex;flex-direction:column;align-items:center;min-width:165px;max-width:240px;background-color:#fff;border-right:1px solid #eee;overflow:hidden}._rbT5f._TFyJN{width:69px;min-width:auto;max-width:none}._qiBkp{margin:12px 0 28px;width:100%;overflow:auto;padding:4px 16px 0}._eeNWk{margin-bottom:12px;background-color:transparent!important}._eeNWk:hover{background-color:rgba(11,110,208,.08)!important}._eeNWk:hover ._udbsn{fill:#085caf}._eeNWk:hover ._HoEPv{color:#085caf}._eeNWk:active{background-color:rgba(11,110,208,.12)!important}._eeNWk:active ._udbsn{fill:#0854a1}._eeNWk:active ._HoEPv{color:#0854a1}._eeNWk._wymAu{background-color:rgba(11,110,208,.08)!important}._eeNWk._wymAu ._udbsn{fill:#0b6ed0}._eeNWk._wymAu ._HoEPv{color:#0b6ed0;font-family:\"72Duplex\",\"72\",\"Helvetica Neue\",Helvetica,Arial,sans-serif;font-weight:500}._eeNWk._wymAu:hover{background-color:rgba(11,110,208,.08)!important}._eeNWk._wymAu:hover ._udbsn{fill:#085caf}._eeNWk._wymAu:hover ._HoEPv{color:#085caf}._eeNWk._wymAu:active{background-color:rgba(11,110,208,.12)!important}._eeNWk._wymAu:active ._udbsn{fill:#0854a1}._eeNWk._wymAu:active ._HoEPv{color:#0854a1}._BQPrd{border-radius:6px}._BQPrd ._udbsn{display:block;fill:#515559}._rzE1c{width:100%;padding:0 16px;margin-top:auto;margin-bottom:0}._XqIVt,._XVRZc{width:100%;display:flex;align-items:start;border:1px solid transparent;border-radius:6px;outline:none;cursor:pointer;padding:5px 11px 5px 5px;text-decoration:none}._XqIVt ._udbsn,._XVRZc ._udbsn{fill:#515559}._XqIVt ._HoEPv,._XVRZc ._HoEPv{font-size:14px;line-height:19px;color:#515559;overflow:hidden;overflow-wrap:break-word;margin:2.5px 0 2.5px 6px}body.keyboard-user ._eeNWk:active:focus,body.keyboard-user ._eeNWk:focus{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 };
|
|
@@ -14,7 +14,6 @@ import Tooltip from '../Tooltip/Tooltip.js';
|
|
|
14
14
|
// v5 (isActive: boolean) => string
|
|
15
15
|
// v6 (props: { isActive: boolean }) => string
|
|
16
16
|
const resolveIsActiveValue = val => typeof val === 'boolean' ? val : val.isActive;
|
|
17
|
-
|
|
18
17
|
const SidebarNavLink = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
19
18
|
let {
|
|
20
19
|
icon,
|
|
@@ -26,7 +25,7 @@ const SidebarNavLink = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
26
25
|
isCollapsed,
|
|
27
26
|
NavLink
|
|
28
27
|
} = useSidebarNavContext();
|
|
29
|
-
const Icon = isCollapsed ? icon
|
|
28
|
+
const Icon = isCollapsed ? icon ?? ExcludeIcon : icon;
|
|
30
29
|
const link = /*#__PURE__*/React__default.createElement(NavLink, {
|
|
31
30
|
className: isActive => classNames(styles.sidebarNavItem, styles.navLink, {
|
|
32
31
|
[styles.noIcon]: !Icon,
|
|
@@ -45,7 +44,6 @@ const SidebarNavLink = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
45
44
|
className: styles.label,
|
|
46
45
|
"data-testid": getSubDataTestId(dataTestId, DATA_TESTID_SUFFIXES.LINK_TEXT)
|
|
47
46
|
}, label));
|
|
48
|
-
|
|
49
47
|
if (isCollapsed) {
|
|
50
48
|
return /*#__PURE__*/React__default.createElement(Tooltip, {
|
|
51
49
|
lightTheme: true,
|
|
@@ -55,7 +53,6 @@ const SidebarNavLink = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
55
53
|
"aria-hidden": true
|
|
56
54
|
}, link);
|
|
57
55
|
}
|
|
58
|
-
|
|
59
56
|
return link;
|
|
60
57
|
});
|
|
61
58
|
|
|
@@ -29,23 +29,19 @@ const RangeSlider = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
|
29
29
|
const trackRef = useRef(null);
|
|
30
30
|
const [values, setValues] = useControllableState(Array.isArray(defaultValues) && defaultValues.length === 2 ? defaultValues : [min, max], onChange, externalValues);
|
|
31
31
|
const [buttonPositions, setButtonPositions] = React__default.useState(values.map(value => valueToPercent(value, max, min)));
|
|
32
|
-
|
|
33
32
|
const updateValue = (newValue, index) => {
|
|
34
33
|
let roundedValue = roundToStep(newValue, max, min, step);
|
|
35
|
-
|
|
36
34
|
if (index === 0) {
|
|
37
35
|
roundedValue = Math.min(roundedValue, values[1]);
|
|
38
36
|
} else {
|
|
39
37
|
roundedValue = Math.max(roundedValue, values[0]);
|
|
40
38
|
}
|
|
41
|
-
|
|
42
39
|
if (values[index] !== roundedValue) {
|
|
43
40
|
const newValues = values.slice();
|
|
44
41
|
newValues[index] = roundedValue;
|
|
45
42
|
setValues(newValues);
|
|
46
43
|
}
|
|
47
44
|
};
|
|
48
|
-
|
|
49
45
|
const updateValueFromPoint = (point, index) => {
|
|
50
46
|
if (trackRef.current !== null) {
|
|
51
47
|
const {
|
|
@@ -54,11 +50,9 @@ const RangeSlider = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
|
54
50
|
} = trackRef.current.getBoundingClientRect();
|
|
55
51
|
const newPoint = Math.min(Math.max(0, point - trackStart), trackWidth);
|
|
56
52
|
const newValue = pointToValue(newPoint, max, min, trackWidth);
|
|
57
|
-
|
|
58
53
|
if (index === undefined) {
|
|
59
54
|
const lowDiff = Math.abs(newValue - values[0]);
|
|
60
55
|
const highDiff = Math.abs(newValue - values[1]);
|
|
61
|
-
|
|
62
56
|
if (lowDiff < highDiff) {
|
|
63
57
|
index = 0;
|
|
64
58
|
} else if (lowDiff > highDiff) {
|
|
@@ -69,52 +63,43 @@ const RangeSlider = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
|
69
63
|
index = 1;
|
|
70
64
|
}
|
|
71
65
|
}
|
|
72
|
-
|
|
73
66
|
updateValue(newValue, index);
|
|
74
67
|
}
|
|
75
|
-
};
|
|
76
|
-
|
|
68
|
+
};
|
|
77
69
|
|
|
70
|
+
// Update value when track is clicked
|
|
78
71
|
const handleTrackClick = e => {
|
|
79
72
|
updateValueFromPoint(e.clientX);
|
|
80
73
|
};
|
|
81
|
-
|
|
82
74
|
const handleMouseMove = (e, index) => {
|
|
83
75
|
const currentMouseX = e.clientX;
|
|
84
76
|
updateValueFromPoint(currentMouseX, index);
|
|
85
77
|
};
|
|
86
|
-
|
|
87
78
|
const handleKeyDown = (e, index) => {
|
|
88
79
|
let newValue;
|
|
89
|
-
|
|
90
80
|
switch (e.key) {
|
|
91
81
|
case 'ArrowRight':
|
|
92
82
|
case 'ArrowUp':
|
|
93
83
|
newValue = values[index] + step;
|
|
94
84
|
break;
|
|
95
|
-
|
|
96
85
|
case 'ArrowLeft':
|
|
97
86
|
case 'ArrowDown':
|
|
98
87
|
newValue = values[index] - step;
|
|
99
88
|
break;
|
|
100
|
-
|
|
101
89
|
case 'Home':
|
|
102
90
|
newValue = min;
|
|
103
91
|
break;
|
|
104
|
-
|
|
105
92
|
case 'End':
|
|
106
93
|
newValue = max;
|
|
107
94
|
break;
|
|
108
|
-
|
|
109
95
|
default:
|
|
110
96
|
return;
|
|
111
97
|
}
|
|
112
|
-
|
|
113
98
|
e.preventDefault();
|
|
114
99
|
updateValue(newValue, index);
|
|
115
|
-
};
|
|
116
|
-
|
|
100
|
+
};
|
|
117
101
|
|
|
102
|
+
// Update button positions when values change
|
|
118
103
|
useSSRLayoutEffect(() => {
|
|
119
104
|
setButtonPositions(values.map(value => valueToPercent(value, max, min)));
|
|
120
105
|
}, [max, min, values]);
|
|
@@ -128,8 +113,8 @@ const RangeSlider = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
|
128
113
|
}, /*#__PURE__*/React__default.createElement("span", {
|
|
129
114
|
className: styles.fill,
|
|
130
115
|
style: {
|
|
131
|
-
left:
|
|
132
|
-
right:
|
|
116
|
+
left: `${buttonPositions[0]}%`,
|
|
117
|
+
right: `${100 - buttonPositions[1]}%`
|
|
133
118
|
}
|
|
134
119
|
}), values.map((value, index) => /*#__PURE__*/React__default.createElement(SliderButton, {
|
|
135
120
|
key: index,
|
|
@@ -142,7 +127,8 @@ const RangeSlider = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
|
142
127
|
buttonPosition: buttonPositions[index],
|
|
143
128
|
onMouseMove: e => handleMouseMove(e, index),
|
|
144
129
|
onKeyDown: e => handleKeyDown(e, index),
|
|
145
|
-
value: typeof formatter === 'function' ? formatter(value) :
|
|
130
|
+
value: typeof formatter === 'function' ? formatter(value) :
|
|
131
|
+
// TODO: Add automatic localization of number
|
|
146
132
|
value.toLocaleString(undefined, {
|
|
147
133
|
minimumFractionDigits: countDecimals(step),
|
|
148
134
|
maximumFractionDigits: countDecimals(step)
|
|
@@ -8,36 +8,27 @@ import useControllableState from '../../hooks/useControllableState/useControllab
|
|
|
8
8
|
import useSSRLayoutEffect from '../../hooks/useSSRLayoutEffect/useSSRLayoutEffect.js';
|
|
9
9
|
|
|
10
10
|
const clamp = (value, max, min) => Math.min(Math.max(value, min), max);
|
|
11
|
-
|
|
12
11
|
const countDecimals = value => {
|
|
13
12
|
if (value % 1 !== 0) {
|
|
14
13
|
return value.toString().split('.')[1].length;
|
|
15
14
|
}
|
|
16
|
-
|
|
17
15
|
return 0;
|
|
18
16
|
};
|
|
19
|
-
|
|
20
17
|
const roundToStep = (value, max, min, step) => {
|
|
21
18
|
let newValue = value;
|
|
22
19
|
const mod = (value - min) % step;
|
|
23
20
|
newValue += mod > step / 2 ? step - mod : -mod;
|
|
24
|
-
|
|
25
21
|
if (value >= max) {
|
|
26
22
|
newValue = max;
|
|
27
23
|
}
|
|
28
|
-
|
|
29
24
|
if (value <= min) {
|
|
30
25
|
newValue = min;
|
|
31
26
|
}
|
|
32
|
-
|
|
33
27
|
newValue = clamp(newValue, max, min);
|
|
34
28
|
return parseFloat(newValue.toFixed(countDecimals(step)));
|
|
35
29
|
};
|
|
36
|
-
|
|
37
30
|
const valueToPercent = (value, max, min) => (value - min) * 100 / (max - min);
|
|
38
|
-
|
|
39
31
|
const pointToValue = (point, max, min, width) => point * (max - min) / width + min;
|
|
40
|
-
|
|
41
32
|
const Slider = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
42
33
|
let {
|
|
43
34
|
className,
|
|
@@ -56,15 +47,12 @@ const Slider = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
|
56
47
|
const trackRef = useRef(null);
|
|
57
48
|
const [value, setValue] = useControllableState(defaultValue !== undefined ? defaultValue : min, onChange, externalValue);
|
|
58
49
|
const [buttonPosition, setButtonPosition] = React__default.useState(valueToPercent(value, max, min));
|
|
59
|
-
|
|
60
50
|
const updateValue = newValue => {
|
|
61
51
|
const roundedValue = roundToStep(newValue, max, min, step);
|
|
62
|
-
|
|
63
52
|
if (roundedValue !== value) {
|
|
64
53
|
setValue(roundedValue);
|
|
65
54
|
}
|
|
66
55
|
};
|
|
67
|
-
|
|
68
56
|
const updateValueFromPoint = point => {
|
|
69
57
|
if (trackRef.current !== null) {
|
|
70
58
|
const {
|
|
@@ -75,54 +63,47 @@ const Slider = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
|
75
63
|
const newValue = pointToValue(newPoint, max, min, trackWidth);
|
|
76
64
|
updateValue(newValue);
|
|
77
65
|
}
|
|
78
|
-
};
|
|
79
|
-
|
|
66
|
+
};
|
|
80
67
|
|
|
68
|
+
// Update value when track is clicked
|
|
81
69
|
const handleTrackClick = e => {
|
|
82
70
|
updateValueFromPoint(e.clientX);
|
|
83
71
|
};
|
|
84
|
-
|
|
85
72
|
const handleMouseMove = e => {
|
|
86
73
|
const currentMouseX = e.clientX;
|
|
87
74
|
updateValueFromPoint(currentMouseX);
|
|
88
75
|
};
|
|
89
|
-
|
|
90
76
|
const handleKeyDown = e => {
|
|
91
77
|
let newValue;
|
|
92
|
-
|
|
93
78
|
switch (e.key) {
|
|
94
79
|
case 'ArrowRight':
|
|
95
80
|
case 'ArrowUp':
|
|
96
81
|
newValue = value + step;
|
|
97
82
|
break;
|
|
98
|
-
|
|
99
83
|
case 'ArrowLeft':
|
|
100
84
|
case 'ArrowDown':
|
|
101
85
|
newValue = value - step;
|
|
102
86
|
break;
|
|
103
|
-
|
|
104
87
|
case 'Home':
|
|
105
88
|
newValue = min;
|
|
106
89
|
break;
|
|
107
|
-
|
|
108
90
|
case 'End':
|
|
109
91
|
newValue = max;
|
|
110
92
|
break;
|
|
111
|
-
|
|
112
93
|
default:
|
|
113
94
|
return;
|
|
114
95
|
}
|
|
115
|
-
|
|
116
96
|
e.preventDefault();
|
|
117
97
|
updateValue(newValue);
|
|
118
98
|
};
|
|
119
|
-
|
|
120
|
-
|
|
99
|
+
const formattedValue = typeof formatter === 'function' ? formatter(value) :
|
|
100
|
+
// TODO: Add automatic localization of number
|
|
121
101
|
value.toLocaleString(undefined, {
|
|
122
102
|
minimumFractionDigits: countDecimals(step),
|
|
123
103
|
maximumFractionDigits: countDecimals(step)
|
|
124
|
-
});
|
|
104
|
+
});
|
|
125
105
|
|
|
106
|
+
// Update button position when value changes
|
|
126
107
|
useSSRLayoutEffect(() => {
|
|
127
108
|
setButtonPosition(valueToPercent(value, max, min));
|
|
128
109
|
}, [max, min, value]);
|
|
@@ -137,7 +118,7 @@ const Slider = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
|
137
118
|
className: styles.fill,
|
|
138
119
|
style: {
|
|
139
120
|
left: -1,
|
|
140
|
-
right:
|
|
121
|
+
right: `${100 - buttonPosition}%`
|
|
141
122
|
}
|
|
142
123
|
}), /*#__PURE__*/React__default.createElement(SliderButton, {
|
|
143
124
|
"aria-valuemin": min,
|
|
@@ -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 = {"slider":"
|
|
5
|
-
var stylesheet=".
|
|
3
|
+
var css_248z = "._OHqwk{height:auto;width:200px;padding:5px 10px}._YR4Om{position:relative;height:10px;border:1px solid #898989;border-radius:5px;background:#fafafa}._QASEj{top:-1px;bottom:-1px;background-color:#007ac0;border:1px solid #007ac0;border-radius:5px}._P9A6D,._QASEj{position:absolute}._P9A6D{top:-5px;left:-10px;border:1px solid #007ac0;overflow:visible;width:18px;height:18px;padding:0;margin:0;border-radius:9px;cursor:pointer;display:inline-block;text-align:center;background:#fff;text-decoration:none;outline:none}._P9A6D:before{content:\"\";position:absolute;top:4px;left:4px;background:#007ac0;width:8px;height:8px;border-radius:10px}body.keyboard-user ._P9A6D:active:focus,body.keyboard-user ._P9A6D:focus{box-shadow:0 0 0 2px #fff,0 0 0 4px #0a3f88}";
|
|
4
|
+
var styles = {"slider":"_OHqwk","track":"_YR4Om","fill":"_QASEj","button":"_P9A6D"};
|
|
5
|
+
var stylesheet="._OHqwk{height:auto;width:200px;padding:5px 10px}._YR4Om{position:relative;height:10px;border:1px solid #898989;border-radius:5px;background:#fafafa}._QASEj{top:-1px;bottom:-1px;background-color:#007ac0;border:1px solid #007ac0;border-radius:5px}._P9A6D,._QASEj{position:absolute}._P9A6D{top:-5px;left:-10px;border:1px solid #007ac0;overflow:visible;width:18px;height:18px;padding:0;margin:0;border-radius:9px;cursor:pointer;display:inline-block;text-align:center;background:#fff;text-decoration:none;outline:none}._P9A6D:before{content:\"\";position:absolute;top:4px;left:4px;background:#007ac0;width:8px;height:8px;border-radius:10px}body.keyboard-user ._P9A6D:active:focus,body.keyboard-user ._P9A6D:focus{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 };
|
|
@@ -8,7 +8,6 @@ import useEventListener from '../../hooks/useEventListener/useEventListener.js';
|
|
|
8
8
|
import Tooltip from '../Tooltip/Tooltip.js';
|
|
9
9
|
|
|
10
10
|
const buttonOffset = -10;
|
|
11
|
-
|
|
12
11
|
const SliderButton = _ref => {
|
|
13
12
|
let {
|
|
14
13
|
buttonPosition = 0,
|
|
@@ -25,27 +24,25 @@ const SliderButton = _ref => {
|
|
|
25
24
|
} = _ref;
|
|
26
25
|
const isMounted = useMounted();
|
|
27
26
|
const [isDragging, setIsDragging] = useState(false);
|
|
28
|
-
|
|
29
27
|
const handleMouseDown = e => {
|
|
30
28
|
if (e.button === 0) {
|
|
31
29
|
setIsDragging(true);
|
|
32
30
|
}
|
|
33
31
|
};
|
|
34
|
-
|
|
35
32
|
const handleMouseUp = e => {
|
|
36
33
|
if (isMounted.current && e.button === 0) {
|
|
37
34
|
setIsDragging(false);
|
|
38
35
|
}
|
|
39
|
-
};
|
|
40
|
-
|
|
36
|
+
};
|
|
41
37
|
|
|
38
|
+
// Update value when mouse moves
|
|
42
39
|
const handleMouseMove = e => {
|
|
43
40
|
if (isMounted.current && typeof onMouseMove === 'function') {
|
|
44
41
|
onMouseMove(e);
|
|
45
42
|
}
|
|
46
|
-
};
|
|
47
|
-
|
|
43
|
+
};
|
|
48
44
|
|
|
45
|
+
// Add/remove mouse handlers when dragging starts/stops
|
|
49
46
|
const options = {
|
|
50
47
|
isDisabled: !isDragging
|
|
51
48
|
};
|
|
@@ -54,7 +51,7 @@ const SliderButton = _ref => {
|
|
|
54
51
|
const anchorButton = /*#__PURE__*/React__default.createElement("div", _extends({}, rest, {
|
|
55
52
|
className: styles.button,
|
|
56
53
|
style: {
|
|
57
|
-
left:
|
|
54
|
+
left: `calc(${buttonPosition}% + ${buttonOffset}px`
|
|
58
55
|
},
|
|
59
56
|
onMouseDown: handleMouseDown,
|
|
60
57
|
onKeyDown: onKeyDown,
|
|
@@ -71,7 +68,8 @@ const SliderButton = _ref => {
|
|
|
71
68
|
const [showTooltip, setShowTooltip] = useState(false);
|
|
72
69
|
return /*#__PURE__*/React__default.createElement(Tooltip, {
|
|
73
70
|
show: showTooltip,
|
|
74
|
-
onShowChange: shouldShowTooltip => setShowTooltip(isDragging || shouldShowTooltip)
|
|
71
|
+
onShowChange: shouldShowTooltip => setShowTooltip(isDragging || shouldShowTooltip)
|
|
72
|
+
// forces rerender of popper on button position change
|
|
75
73
|
,
|
|
76
74
|
unstable_contentKey: String(buttonPosition),
|
|
77
75
|
placement: "bottom",
|
|
@@ -26,26 +26,26 @@ const Switch = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
|
26
26
|
helperTextId: formFieldHelperTextId,
|
|
27
27
|
errorTextId: formFieldErrorTextId
|
|
28
28
|
} = useFormFieldContext();
|
|
29
|
-
const internalAriaDescribedby = concatIds(externalAriaDescribedBy, formFieldHelperTextId, formFieldErrorTextId, inputProps
|
|
29
|
+
const internalAriaDescribedby = concatIds(externalAriaDescribedBy, formFieldHelperTextId, formFieldErrorTextId, inputProps?.['aria-describedby']);
|
|
30
30
|
return /*#__PURE__*/React__default.createElement("span", _extends({}, rest, {
|
|
31
31
|
ref: ref,
|
|
32
32
|
className: classNames(className, styles.switch, {
|
|
33
33
|
[styles.disabled]: disabled
|
|
34
34
|
})
|
|
35
35
|
}), /*#__PURE__*/React__default.createElement("input", _extends({}, inputProps, {
|
|
36
|
-
className: classNames(styles.input, inputProps
|
|
36
|
+
className: classNames(styles.input, inputProps?.className),
|
|
37
37
|
type: "checkbox",
|
|
38
38
|
role: "switch",
|
|
39
|
-
id: id
|
|
40
|
-
checked: checked
|
|
41
|
-
defaultChecked: defaultChecked
|
|
42
|
-
disabled: disabled
|
|
43
|
-
onChange: disabled ? undefined : onChange
|
|
44
|
-
value: value
|
|
45
|
-
"aria-label": ariaLabel
|
|
46
|
-
"aria-labelledby": ariaLabelledBy
|
|
39
|
+
id: id ?? inputProps?.id,
|
|
40
|
+
checked: checked ?? inputProps?.checked,
|
|
41
|
+
defaultChecked: defaultChecked ?? inputProps?.defaultChecked,
|
|
42
|
+
disabled: disabled ?? inputProps?.disabled,
|
|
43
|
+
onChange: disabled ? undefined : onChange ?? inputProps?.onChange,
|
|
44
|
+
value: value ?? inputProps?.value,
|
|
45
|
+
"aria-label": ariaLabel ?? inputProps?.['aria-label'],
|
|
46
|
+
"aria-labelledby": ariaLabelledBy ?? inputProps?.['aria-labelledby'],
|
|
47
47
|
"aria-describedby": internalAriaDescribedby,
|
|
48
|
-
tabIndex: tabIndex
|
|
48
|
+
tabIndex: tabIndex ?? inputProps?.tabIndex
|
|
49
49
|
})), /*#__PURE__*/React__default.createElement("span", {
|
|
50
50
|
className: styles.slider
|
|
51
51
|
}));
|
|
@@ -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 = {"switch":"
|
|
5
|
-
var stylesheet=".
|
|
3
|
+
var css_248z = "._ESmCw{cursor:pointer;display:inline-flex;position:relative;align-items:center;margin-top:6px;margin-bottom:6px}._ESmCw._5xdkr{cursor:not-allowed}._Ha2Qw{cursor:pointer;position:absolute;top:0;opacity:0;height:16px;width:32px;border-radius:34px;z-index:10}._Ha2Qw:disabled{cursor:not-allowed}._Ha2Qw:disabled~._zmAYv{opacity:.4}._Ha2Qw:checked~._zmAYv{background-color:#0b6ed0}._Ha2Qw:checked~._zmAYv:before{transform:translateX(16px);background-color:#fff;border-color:#0b6ed0}._Ha2Qw:hover:not(:disabled):not(:checked)~._zmAYv{background-color:#6a6a6a}._Ha2Qw:hover:not(:disabled):checked~._zmAYv{background-color:#085caf}._Ha2Qw:hover:not(:disabled):checked~._zmAYv:before{border-color:#085caf}._zmAYv{width:32px;background-color:#898989;border-radius:34px}._zmAYv,._zmAYv:before{height:16px;transition:.2s}._zmAYv:before{box-sizing:border-box;position:absolute;left:0;content:\"\";width:16px;background-color:#fff;border-radius:50%;border:1px solid #898989;z-index:0}._PV2mD{color:#32363a;display:flex;align-items:center;cursor:pointer}._SUZ2O{cursor:auto;color:hsla(0,0%,53.7%,.4)}._mhHC0{margin-right:12px;flex-shrink:0}body.keyboard-user ._ESmCw ._Ha2Qw:active:focus~._zmAYv,body.keyboard-user ._ESmCw ._Ha2Qw:focus~._zmAYv{box-shadow:0 0 0 2px #fff,0 0 0 4px #0a3f88}";
|
|
4
|
+
var styles = {"switch":"_ESmCw","disabled":"_5xdkr","input":"_Ha2Qw","slider":"_zmAYv","label":"_PV2mD","labelDisabled":"_SUZ2O","wrappedInput":"_mhHC0"};
|
|
5
|
+
var stylesheet="._ESmCw{cursor:pointer;display:inline-flex;position:relative;align-items:center;margin-top:6px;margin-bottom:6px}._ESmCw._5xdkr{cursor:not-allowed}._Ha2Qw{cursor:pointer;position:absolute;top:0;opacity:0;height:16px;width:32px;border-radius:34px;z-index:10}._Ha2Qw:disabled{cursor:not-allowed}._Ha2Qw:disabled~._zmAYv{opacity:.4}._Ha2Qw:checked~._zmAYv{background-color:#0b6ed0}._Ha2Qw:checked~._zmAYv:before{transform:translateX(16px);background-color:#fff;border-color:#0b6ed0}._Ha2Qw:hover:not(:disabled):not(:checked)~._zmAYv{background-color:#6a6a6a}._Ha2Qw:hover:not(:disabled):checked~._zmAYv{background-color:#085caf}._Ha2Qw:hover:not(:disabled):checked~._zmAYv:before{border-color:#085caf}._zmAYv{width:32px;background-color:#898989;border-radius:34px}._zmAYv,._zmAYv:before{height:16px;transition:.2s}._zmAYv:before{box-sizing:border-box;position:absolute;left:0;content:\"\";width:16px;background-color:#fff;border-radius:50%;border:1px solid #898989;z-index:0}._PV2mD{color:#32363a;display:flex;align-items:center;cursor:pointer}._SUZ2O{cursor:auto;color:hsla(0,0%,53.7%,.4)}._mhHC0{margin-right:12px;flex-shrink:0}body.keyboard-user ._ESmCw ._Ha2Qw:active:focus~._zmAYv,body.keyboard-user ._ESmCw ._Ha2Qw:focus~._zmAYv{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,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 = {"table":"
|
|
5
|
-
var stylesheet=".
|
|
3
|
+
var css_248z = "._SwP-c{font-size:14px;color:#32363a;width:100%;max-width:100%;border-collapse:collapse;background-color:#fff;border:none}._SwP-c ._6Qx-F:first-child,._SwP-c ._hmoMD:first-child{padding-left:16px}._50r56{font-size:12px}._6Qx-F{padding:12px 8px;text-align:left;font-weight:700}._JFFOG ._PNf2V{border-top:1px solid #ededed}._JFFOG ._PNf2V:hover{background-color:#fafafa}._PNf2V{transition:background-color 125ms ease-in;border-bottom:1px solid #ededed}._hmoMD{padding:16px 8px;word-break:break-word;text-align:left}";
|
|
4
|
+
var styles = {"table":"_SwP-c","tableCell":"_hmoMD","tableHeaderCell":"_6Qx-F","tableHead":"_50r56","tableBody":"_JFFOG","tableRow":"_PNf2V"};
|
|
5
|
+
var stylesheet="._SwP-c{font-size:14px;color:#32363a;width:100%;max-width:100%;border-collapse:collapse;background-color:#fff;border:none}._SwP-c ._6Qx-F:first-child,._SwP-c ._hmoMD:first-child{padding-left:16px}._50r56{font-size:12px}._6Qx-F{padding:12px 8px;text-align:left;font-weight:700}._JFFOG ._PNf2V{border-top:1px solid #ededed}._JFFOG ._PNf2V:hover{background-color:#fafafa}._PNf2V{transition:background-color 125ms ease-in;border-bottom:1px solid #ededed}._hmoMD{padding:16px 8px;word-break:break-word;text-align:left}";
|
|
6
6
|
styleInject(css_248z);
|
|
7
7
|
|
|
8
8
|
export { styles as default, stylesheet };
|
|
@@ -22,8 +22,8 @@ const Tab = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
|
22
22
|
rootTestId,
|
|
23
23
|
isTabListFocused
|
|
24
24
|
} = useTabContext();
|
|
25
|
-
const tabId = getSubDataTestId(rootId,
|
|
26
|
-
const tabTestId = getSubDataTestId(rootTestId,
|
|
25
|
+
const tabId = getSubDataTestId(rootId, `tab-${value}`);
|
|
26
|
+
const tabTestId = getSubDataTestId(rootTestId, `tab-${value}`);
|
|
27
27
|
const isSelected = activeTab === value;
|
|
28
28
|
const onClick = React__default.useCallback(() => {
|
|
29
29
|
setActiveTab(value);
|
|
@@ -39,7 +39,7 @@ const Tab = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
|
39
39
|
[styles.selected]: isSelected
|
|
40
40
|
}),
|
|
41
41
|
"aria-selected": isSelected,
|
|
42
|
-
"aria-controls":
|
|
42
|
+
"aria-controls": `${rootId}-tabpanel-${value}`,
|
|
43
43
|
"aria-label": ariaLabel,
|
|
44
44
|
onClick: onClick,
|
|
45
45
|
ref: ref,
|
|
@@ -24,11 +24,11 @@ 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,
|
|
29
|
-
const tabListRef = useRef(null);
|
|
27
|
+
const tabListId = getSubDataTestId(rootId, `tablist`);
|
|
28
|
+
const tabListTestId = getSubDataTestId(rootTestId, `tablist`);
|
|
29
|
+
const tabListRef = useRef(null);
|
|
30
|
+
// We use this map of tab element to index to allow constant time index
|
|
30
31
|
// lookup when we handle an event from a child tab
|
|
31
|
-
|
|
32
32
|
const tabButtonsElementToIndexMapRef = useRef(new Map());
|
|
33
33
|
const tabButtonsArrayRef = useRef([]);
|
|
34
34
|
const [focusedTabElement, setFocusedTabElement] = useState();
|
|
@@ -36,10 +36,8 @@ const TabsList = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
|
36
36
|
if (focusedTabElement) {
|
|
37
37
|
return tabButtonsElementToIndexMapRef.current.get(focusedTabElement);
|
|
38
38
|
}
|
|
39
|
-
|
|
40
39
|
return -1;
|
|
41
40
|
}, [focusedTabElement, tabButtonsElementToIndexMapRef]);
|
|
42
|
-
|
|
43
41
|
const focusTabAtIndex = index => {
|
|
44
42
|
const tabRefsLength = tabButtonsArrayRef.current.length;
|
|
45
43
|
const wrappedIndex = wrapAround(index, 0, tabRefsLength - 1);
|
|
@@ -47,16 +45,14 @@ const TabsList = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
|
47
45
|
newFocusedElement.focus();
|
|
48
46
|
setFocusedTabElement(newFocusedElement);
|
|
49
47
|
};
|
|
50
|
-
|
|
51
48
|
return /*#__PURE__*/React__default.createElement("div", _extends({}, rest, {
|
|
52
49
|
id: tabListId,
|
|
53
50
|
onFocus: e => {
|
|
54
51
|
setIsTabListFocused(true);
|
|
55
|
-
|
|
56
52
|
if (e.target.tagName === 'BUTTON') {
|
|
57
53
|
const event = e;
|
|
58
|
-
const role = event.target.getAttribute('role');
|
|
59
|
-
|
|
54
|
+
const role = event.target.getAttribute('role');
|
|
55
|
+
// Only handle focus events for immediate tab children
|
|
60
56
|
if (role === 'tab' && event.target.parentElement === tabListRef.current) {
|
|
61
57
|
setFocusedTabElement(event.target);
|
|
62
58
|
}
|
|
@@ -90,14 +86,11 @@ const TabsList = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
|
90
86
|
"aria-labelledby": ariaLabelledBy,
|
|
91
87
|
ref: mergeRefs(ref, tabListRef),
|
|
92
88
|
tabIndex: -1 // Needed to satisfy the jsx-a11y/interactive-supports-focus rule
|
|
93
|
-
|
|
94
89
|
}), React__default.Children.map(children, (child, index) => {
|
|
95
|
-
if (
|
|
96
|
-
var _child$props$value;
|
|
97
|
-
|
|
90
|
+
if (child?.type === Tab) {
|
|
98
91
|
return /*#__PURE__*/React__default.cloneElement(child, {
|
|
99
|
-
value:
|
|
100
|
-
ref: mergeRefs(child
|
|
92
|
+
value: child.props.value ?? index,
|
|
93
|
+
ref: mergeRefs(child?.ref, node => {
|
|
101
94
|
// Store a reverse node/index map for
|
|
102
95
|
// constant time index lookups from event handlers
|
|
103
96
|
if (node) {
|
|
@@ -107,7 +100,6 @@ const TabsList = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
|
107
100
|
})
|
|
108
101
|
});
|
|
109
102
|
}
|
|
110
|
-
|
|
111
103
|
return child;
|
|
112
104
|
}));
|
|
113
105
|
});
|
|
@@ -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-${value}`);
|
|
22
|
+
const tabPanelTestId = getSubDataTestId(rootTestId, `tabpanel-${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": `${rootId}-tab-${value}`,
|
|
29
29
|
className: classNames(styles.tabpanel, className, {
|
|
30
30
|
[styles.inactive]: value !== activeTab
|
|
31
31
|
})
|
|
@@ -7,13 +7,11 @@ const TabPanels = _ref => {
|
|
|
7
7
|
} = _ref;
|
|
8
8
|
return /*#__PURE__*/React.createElement(React.Fragment, null, React.Children.map(children, (c, index) => {
|
|
9
9
|
const child = c;
|
|
10
|
-
|
|
11
10
|
if (child && child.type === TabPanel) {
|
|
12
11
|
return /*#__PURE__*/React.cloneElement(child, {
|
|
13
12
|
value: child.props.value || index
|
|
14
13
|
});
|
|
15
14
|
}
|
|
16
|
-
|
|
17
15
|
return child;
|
|
18
16
|
}));
|
|
19
17
|
};
|