@ringcentral/spring-ui 1.7.0 → 1.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Alert.js +3 -3
- package/Announcement.js +1 -1
- package/Autocomplete.js +174 -236
- package/Avatar.js +27 -13
- package/BottomNavigation.js +0 -3
- package/Checkbox.js +0 -2
- package/DatePicker.js +5 -13
- package/DateUtilsContext.js +0 -1
- package/Dialer.js +2 -50
- package/Dialog.js +4 -4
- package/Dropdown.js +0 -7
- package/FocusTrap.js +0 -32
- package/InlineEditable.js +0 -4
- package/Link.js +1 -1
- package/ListItem.js +1 -1
- package/ListNavigation.js +0 -6
- package/Menu.js +1 -1
- package/MenuDivider.js +2 -2
- package/MenuFooter.js +4 -4
- package/MenuHeader.js +4 -4
- package/MenuItem.js +1 -1
- package/MenuItemText.js +1 -1
- package/PageHeader.js +6 -4
- package/Popper.js +0 -1
- package/Rating.js +0 -5
- package/SingleFilter.js +0 -1
- package/Slider.js +1 -4
- package/Snackbar.js +0 -14
- package/SortableListItem.js +0 -1
- package/SplitButton.js +1 -3
- package/StatusIndicator.js +1 -1
- package/SubMenu.js +0 -4
- package/SwipeableDrawer.js +8 -146
- package/Switch.js +1 -4
- package/Tab.js +7 -8
- package/TabContext.js +0 -5
- package/TableBody.js +1 -1
- package/TableCell.js +0 -6
- package/TableRow.js +0 -1
- package/Tabs.js +20 -118
- package/Text.js +2 -4
- package/TimePicker.js +7 -46
- package/VirtualizedList.js +2 -30
- package/chunks/Alert.js +8 -7
- package/chunks/BottomNavigationItem.js +0 -1
- package/chunks/Button.js +0 -1
- package/chunks/Chip.js +0 -5
- package/chunks/Drawer.js +1 -30
- package/chunks/ListItem.js +3 -6
- package/chunks/Menu.js +3 -3
- package/chunks/MenuDivider.js +2 -3
- package/chunks/MenuItemText.js +3 -3
- package/chunks/MenuList.js +0 -3
- package/chunks/PickerTextField.js +0 -1
- package/chunks/Popover.js +0 -5
- package/chunks/Select.js +2 -39
- package/chunks/Squircle.js +0 -7
- package/chunks/StatusIndicator.js +1 -0
- package/chunks/StepIcon.js +1 -3
- package/chunks/StepperContext.js +0 -7
- package/chunks/Tooltip.js +0 -36
- package/chunks/VirtualizedMenu.js +2 -78
- package/chunks/getFade.js +2 -0
- package/chunks/useFocusTrapStack.js +0 -8
- package/chunks/useHelperTextId.js +0 -24
- package/chunks/useListNavigation.js +2 -17
- package/chunks/useMenuItemSelect.js +6 -19
- package/chunks/useMotionSafeTransition.js +0 -4
- package/chunks/useNestedParentMenu.js +0 -2
- package/chunks/usePrefersReducedMotion.js +0 -10
- package/chunks/useTooltipForceHide.js +0 -4
- package/chunks/useTrayNavigate.js +0 -1
- package/index.css +392 -120
- package/index.js +1 -1
- package/package.json +4 -4
- package/src/Accordion/Accordion.type.d.ts +0 -21
- package/src/AccordionHeader/AccordionHeader.type.d.ts +0 -14
- package/src/Alert/Alert.type.d.ts +0 -32
- package/src/Animation/components/ExpandCollapseCaret/ExpandCollapseCaret.d.ts +0 -4
- package/src/Animation/components/ShowHideEye/ShowHideEye.d.ts +0 -4
- package/src/Animation/hooks/useMotionSafeTransition/useMotionSafeTransition.d.ts +0 -4
- package/src/Autocomplete/Autocomplete.d.ts +0 -5
- package/src/Autocomplete/Autocomplete.type.d.ts +0 -84
- package/src/Autocomplete/SuggestionList/SuggestionList.d.ts +5 -89
- package/src/Autocomplete/SuggestionList/SuggestionListItem.d.ts +0 -2
- package/src/Autocomplete/SuggestionList/utils/SuggestionListItem.d.ts +1 -13
- package/src/Autocomplete/SuggestionList/utils/useDynamicHeight.d.ts +0 -6
- package/src/Autocomplete/SuggestionList/utils/useHighlightScroll.d.ts +0 -20
- package/src/Autocomplete/SuggestionList/utils/useSuggestionList.d.ts +3 -41
- package/src/Autocomplete/SuggestionList/utils/useSuggestionListGroup.d.ts +0 -49
- package/src/Autocomplete/useAutocomplete.d.ts +1 -62
- package/src/Autocomplete/useAutocompleteTag.d.ts +0 -33
- package/src/Avatar/Avatar.type.d.ts +0 -58
- package/src/AvatarGroup/AvatarGroup.type.d.ts +0 -3
- package/src/Backdrop/Backdrop.type.d.ts +0 -4
- package/src/Badge/Badge.type.d.ts +0 -33
- package/src/Block/Block.type.d.ts +0 -24
- package/src/BlockHeader/BlockHeader.type.d.ts +0 -5
- package/src/BottomNavigation/BottomNavigation.type.d.ts +0 -34
- package/src/BottomNavigationItem/BottomNavigationItem.type.d.ts +0 -39
- package/src/Button/Button.type.d.ts +0 -30
- package/src/CallButton/CallButton.type.d.ts +0 -4
- package/src/Checkbox/Checkbox.type.d.ts +0 -17
- package/src/Chip/Chip.type.d.ts +0 -41
- package/src/CircularProgressIndicator/CircularProgressIndicator.type.d.ts +0 -19
- package/src/DatePicker/Calendar.d.ts +1 -20
- package/src/DatePicker/DatePicker.type.d.ts +0 -18
- package/src/DatePicker/DatePickerHeader.d.ts +1 -12
- package/src/DatePicker/Day.d.ts +0 -7
- package/src/DatePicker/Year.d.ts +0 -6
- package/src/DatePicker/Years.d.ts +0 -7
- package/src/Dialer/DialDelete/DialDelete.d.ts +0 -3
- package/src/Dialer/DialPad/DialPad.d.ts +0 -106
- package/src/Dialer/DialPad/utils/types.d.ts +0 -5
- package/src/Dialer/DialPad/utils/useDialKeyboard.d.ts +0 -5
- package/src/Dialer/DialPad/utils/useKeyAudio.d.ts +0 -9
- package/src/Dialer/DialPadButton/DialPadButton.d.ts +0 -14
- package/src/Dialer/DialTextField/DialTextField.d.ts +0 -23
- package/src/Dialer/DialTextField/utils/getDialPadValueOnlyRegex.d.ts +0 -3
- package/src/Dialer/DialTextField/utils/useFixedEndSelection.d.ts +0 -3
- package/src/Dialog/Dialog.type.d.ts +0 -11
- package/src/Divider/Divider.type.d.ts +0 -17
- package/src/DragHandle/DragHandle.type.d.ts +0 -4
- package/src/Drawer/Drawer.d.ts +0 -28
- package/src/Drawer/Drawer.type.d.ts +0 -84
- package/src/Dropdown/Dropdown.type.d.ts +0 -64
- package/src/EmptyState/EmptyState.type.d.ts +0 -12
- package/src/FabButton/FabButton.type.d.ts +0 -5
- package/src/FocusTrap/FocusTrap.d.ts +0 -38
- package/src/FocusTrap/useFocusTrapStack.d.ts +0 -9
- package/src/FormField/FormField.type.d.ts +0 -26
- package/src/FormField/useHelperTextId.d.ts +0 -25
- package/src/FormLabel/FormLabel.type.d.ts +0 -14
- package/src/Icon/Icon.type.d.ts +0 -15
- package/src/IconButton/IconButton.type.d.ts +0 -30
- package/src/IconButton/IconButtonLabel.type.d.ts +0 -3
- package/src/IconButtonGroup/IconButtonGroup.type.d.ts +0 -8
- package/src/InlineEditable/InlineEditable.type.d.ts +0 -75
- package/src/LinearProgressIndicator/LinearProgressIndicator.type.d.ts +0 -31
- package/src/Link/Link.classes.d.ts +1 -1
- package/src/Link/Link.type.d.ts +1 -10
- package/src/ListItem/ListItem.type.d.ts +0 -41
- package/src/ListItemText/ListItemText.type.d.ts +0 -21
- package/src/ListNavigation/useListNavigation.d.ts +0 -16
- package/src/Menu/Menu.type.d.ts +0 -10
- package/src/MenuFooter/MenuFooter.type.d.ts +0 -4
- package/src/MenuHeader/MenuHeader.type.d.ts +0 -10
- package/src/MenuItem/MenuItem.type.d.ts +0 -19
- package/src/MenuItem/MenuItemSelectContext.d.ts +0 -3
- package/src/MenuItem/useMenuItemSelect.d.ts +0 -21
- package/src/MenuItemText/MenuItemText.type.d.ts +0 -17
- package/src/MenuList/MenuList.type.d.ts +0 -4
- package/src/MenuList/MenuListContext.d.ts +0 -6
- package/src/Modal/InnerModal.type.d.ts +0 -5
- package/src/Modal/Modal.type.d.ts +0 -11
- package/src/Modal/ModalContext.d.ts +0 -4
- package/src/Option/Option.type.d.ts +0 -3
- package/src/Overlap/Overlap.type.d.ts +0 -11
- package/src/PageHeader/PageHeader.type.d.ts +0 -4
- package/src/PickerTextField/PickerTextField.type.d.ts +0 -10
- package/src/Popover/Popover.type.d.ts +0 -29
- package/src/Popper/Popper.type.d.ts +0 -61
- package/src/Radio/Radio.type.d.ts +0 -5
- package/src/RadioGroup/RadioGroup.type.d.ts +0 -4
- package/src/Rating/Rating.type.d.ts +0 -74
- package/src/Select/Select.type.d.ts +0 -84
- package/src/SingleFilter/FilterButton/FilterButton.type.d.ts +0 -16
- package/src/SingleFilter/SingleFilter.type.d.ts +0 -26
- package/src/Skeleton/Skeleton.type.d.ts +0 -1
- package/src/Skeleton/SkeletonContainer/SkeletonContainer.classes.d.ts +1 -1
- package/src/Slider/Slider.classes.d.ts +1 -5
- package/src/Slider/Slider.type.d.ts +0 -104
- package/src/Snackbar/Snackbar.type.d.ts +0 -18
- package/src/SplitButton/SplitButton.type.d.ts +0 -21
- package/src/Squircle/Squircle.type.d.ts +0 -3
- package/src/StatusIndicator/StatusIndicator.classes.d.ts +1 -1
- package/src/StatusIndicator/StatusIndicator.type.d.ts +1 -9
- package/src/Step/Step.type.d.ts +0 -29
- package/src/Step/StepContext.d.ts +0 -7
- package/src/StepButton/StepButton.type.d.ts +0 -15
- package/src/StepContent/StepContent.type.d.ts +0 -7
- package/src/StepIcon/StepIcon.type.d.ts +0 -26
- package/src/StepLabel/StepLabel.type.d.ts +0 -23
- package/src/Stepper/Stepper.type.d.ts +0 -27
- package/src/SwipeableDrawer/SwipeableDrawer.d.ts +0 -26
- package/src/SwipeableDrawer/SwipeableDrawer.types.d.ts +0 -67
- package/src/SwipeableDrawer/hooks/useDrawerGestures.d.ts +0 -110
- package/src/SwipeableDrawer/hooks/useElementSizeObserver.d.ts +0 -5
- package/src/SwipeableDrawer/hooks/useSnapPoints.d.ts +0 -60
- package/src/Switch/Switch.type.d.ts +0 -9
- package/src/Tab/Tab.classes.d.ts +3 -2
- package/src/Tab/Tab.type.d.ts +0 -29
- package/src/TabContext/TabContext.d.ts +0 -4
- package/src/TabContext/TabContext.type.d.ts +0 -7
- package/src/TabPanel/TabPanel.type.d.ts +0 -10
- package/src/Table/Table.type.d.ts +0 -19
- package/src/TableBody/TableBody.type.d.ts +0 -3
- package/src/TableCell/TableCell.d.ts +0 -4
- package/src/TableCell/TableCell.type.d.ts +0 -35
- package/src/TableContainer/TableContainer.type.d.ts +0 -7
- package/src/TableFooter/TableFooter.type.d.ts +0 -3
- package/src/TableHead/TableHead.type.d.ts +0 -6
- package/src/TablePagination/TablePagination.type.d.ts +0 -47
- package/src/TableRow/TableRow.type.d.ts +0 -17
- package/src/Tabs/TabMoreMenu.d.ts +0 -16
- package/src/Tabs/TabScrollButton.d.ts +0 -10
- package/src/Tabs/Tabs.classes.d.ts +1 -1
- package/src/Tabs/Tabs.d.ts +1 -1
- package/src/Tabs/Tabs.type.d.ts +2 -36
- package/src/Tabs/TabsContext.d.ts +2 -0
- package/src/Tabs/hooks/useTabsScroller.d.ts +0 -30
- package/src/Tag/Tag.type.d.ts +0 -12
- package/src/Text/Text.type.d.ts +0 -13
- package/src/TextField/TextField.type.d.ts +0 -64
- package/src/Textarea/Textarea.type.d.ts +0 -13
- package/src/TimePicker/NumberPicker.type.d.ts +0 -12
- package/src/TimePicker/SelectionView.d.ts +0 -6
- package/src/TimePicker/TimeButton.d.ts +0 -3
- package/src/TimePicker/TimePicker.type.d.ts +0 -11
- package/src/TimePicker/ToggleText.type.d.ts +0 -3
- package/src/TimePicker/utils/TimeBoundary.d.ts +0 -3
- package/src/TimePicker/utils/TimePickerHelper.d.ts +0 -19
- package/src/TimePicker/utils/getNumberPickerBoundary.d.ts +0 -3
- package/src/Tooltip/TooltipTrigger.a11y.d.ts +0 -9
- package/src/Tooltip/TooltipTrigger.type.d.ts +0 -44
- package/src/Tooltip/TooltipView.type.d.ts +0 -25
- package/src/Tooltip/useTooltipForceHide.d.ts +0 -4
- package/src/Tray/Tray.type.d.ts +0 -13
- package/src/Tray/TrayContext.d.ts +0 -4
- package/src/Tray/hooks/useTray.d.ts +0 -16
- package/src/Tray/hooks/useTrayPanel.d.ts +0 -3
- package/src/VirtualizedList/VirtualizedList.type.d.ts +0 -27
- package/src/VirtualizedMenu/VirtualizedMenu.type.d.ts +0 -17
package/MenuItem.js
CHANGED
|
@@ -27,6 +27,6 @@ import './chunks/Backdrop.js';
|
|
|
27
27
|
import './Popper.js';
|
|
28
28
|
import './chunks/PopperPaper.js';
|
|
29
29
|
|
|
30
|
-
var MenuItem = {"sui-menu-item-container":"sui-menu-item-container","sui-menu-item-select-indicator":"sui-menu-item-select-indicator","sui-menu-item-select-dot":"sui-menu-item-select-dot","sui-menu-item-root":"sui-menu-item-root","sui-selected":"sui-selected","sui-disabled":"sui-disabled","sui-spruno":"sui-spruno","sui-list-item-text":"sui-list-item-text","sui-focus-visible":"sui-focus-visible","sui-focused":"sui-focused","sui-active":"sui-active","sui-menu-item-nowrap":"sui-menu-item-nowrap","sui-menu-item-text":"sui-menu-item-text","sui-menu-item-selectable":"sui-menu-item-selectable","sui-menu-item-highlighted":"sui-menu-item-highlighted"};
|
|
30
|
+
var MenuItem = {"sui-menu-item-container":"sui-menu-item-container","sui-menu-item-select-indicator":"sui-menu-item-select-indicator","sui-menu-item-select-dot":"sui-menu-item-select-dot","sui-menu-item-root":"sui-menu-item-root","sui-selected":"sui-selected","sui-disabled":"sui-disabled","sui-spruno":"sui-spruno","sui-list-item-text":"sui-list-item-text","sui-focus-visible":"sui-focus-visible","sui-focused":"sui-focused","sui-active":"sui-active","sui-menu-item-nowrap":"sui-menu-item-nowrap","sui-menu-item-text":"sui-menu-item-text","sui-menu-item-selectable":"sui-menu-item-selectable","sui-menu-item-highlighted":"sui-menu-item-highlighted","sui-compact":"sui-compact","sui-menu-item":"sui-menu-item"};
|
|
31
31
|
|
|
32
32
|
export { MenuItem as menuItemStyle };
|
package/MenuItemText.js
CHANGED
|
@@ -4,6 +4,6 @@ import 'react';
|
|
|
4
4
|
import '@ringcentral/spring-base';
|
|
5
5
|
import '@ringcentral/spring-theme';
|
|
6
6
|
|
|
7
|
-
var MenuItemText = {"sui-menu-item-text-root":"sui-menu-item-text-root","sui-menu-item-text-primary-text":"sui-menu-item-text-primary-text","sui-menu-item-text-info-text":"sui-menu-item-text-info-text"};
|
|
7
|
+
var MenuItemText = {"sui-menu-item-text-root":"sui-menu-item-text-root","sui-menu-item-text-primary-text":"sui-menu-item-text-primary-text","sui-menu-item-text-info-text":"sui-menu-item-text-info-text","sui-compact":"sui-compact"};
|
|
8
8
|
|
|
9
9
|
export { MenuItemText as menuItemTextStyle };
|
package/PageHeader.js
CHANGED
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { forwardRef } from 'react';
|
|
3
3
|
import { useClasses } from '@ringcentral/spring-base';
|
|
4
|
-
import { useThemeProps } from '@ringcentral/spring-theme';
|
|
4
|
+
import { useThemeProps, useClassesWithMode } from '@ringcentral/spring-theme';
|
|
5
5
|
|
|
6
|
-
var PageHeader$1 = {"sui-page-header-root":"sui-page-header-root","sui-page-header-left-root":"sui-page-header-left-root","sui-page-header-right-root":"sui-page-header-right-root","sui-page-header-center-root":"sui-page-header-center-root","sui-page-header-title-root":"sui-page-header-title-root","sui-page-header-integrated":"sui-page-header-integrated","sui-page-header-detached":"sui-page-header-detached"};
|
|
6
|
+
var PageHeader$1 = {"sui-page-header-root":"sui-page-header-root","sui-page-header-left-root":"sui-page-header-left-root","sui-page-header-right-root":"sui-page-header-right-root","sui-page-header-center-root":"sui-page-header-center-root","sui-page-header-title-root":"sui-page-header-title-root","sui-page-header-integrated":"sui-page-header-integrated","sui-page-header-detached":"sui-page-header-detached","sui-compact":"sui-compact"};
|
|
7
7
|
|
|
8
8
|
const PageHeader = forwardRef((inProps, ref) => {
|
|
9
9
|
const props = useThemeProps({ props: inProps, name: 'PageHeader' });
|
|
10
10
|
const { classes, className, children, variant = 'integrated', ...rest } = props;
|
|
11
|
-
const cls =
|
|
12
|
-
return (jsx("header", { className: cls('root',
|
|
11
|
+
const cls = useClassesWithMode('page-header', classes, className);
|
|
12
|
+
return (jsx("header", { className: cls('root', {
|
|
13
|
+
[variant]: true,
|
|
14
|
+
}), ...rest, ref: ref, children: children }));
|
|
13
15
|
});
|
|
14
16
|
PageHeader.displayName = 'SuiPageHeader';
|
|
15
17
|
const PageHeaderLeft = forwardRef((inProps, ref) => {
|
package/Popper.js
CHANGED
|
@@ -110,7 +110,6 @@ const Popper = forwardRef((inProps, ref) => {
|
|
|
110
110
|
const fixedX = Math.round(Number(x ?? 0) * dpr) / dpr;
|
|
111
111
|
const fixedY = Math.round(Number(y ?? 0) * dpr) / dpr;
|
|
112
112
|
return (jsx(Portal, { container: container, disablePortal: finalDisablePortal, children: jsx("div", { ...scopeProps, style: { display: 'contents' }, children: jsx("div", { ...rest, "data-sui-popper-placement": placement, ref: handleRootRef, style: {
|
|
113
|
-
/* prevent arrow overflow when content too small */
|
|
114
113
|
...(arrowHeight
|
|
115
114
|
? { minWidth: (arrowHeight + arrowPadding) * 2 }
|
|
116
115
|
: undefined),
|
package/Rating.js
CHANGED
|
@@ -89,7 +89,6 @@ const Rating = forwardRef((inProps, ref) => {
|
|
|
89
89
|
if (onMouseMove) {
|
|
90
90
|
onMouseMove(event);
|
|
91
91
|
}
|
|
92
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
93
92
|
const rootNode = rootRef.current;
|
|
94
93
|
const { right, left, width: containerWidth, } = rootNode.getBoundingClientRect();
|
|
95
94
|
let percent;
|
|
@@ -124,8 +123,6 @@ const Rating = forwardRef((inProps, ref) => {
|
|
|
124
123
|
};
|
|
125
124
|
const handleChange = (event) => {
|
|
126
125
|
let newValue = event.target.value === '' ? null : parseFloat(event.target.value);
|
|
127
|
-
// Give mouse priority over keyboard
|
|
128
|
-
// Fix https://github.com/mui/material-ui/issues/22827
|
|
129
126
|
if (hover !== -1) {
|
|
130
127
|
newValue = hover;
|
|
131
128
|
}
|
|
@@ -135,8 +132,6 @@ const Rating = forwardRef((inProps, ref) => {
|
|
|
135
132
|
}
|
|
136
133
|
};
|
|
137
134
|
const handleClear = (event) => {
|
|
138
|
-
// Ignore keyboard events
|
|
139
|
-
// https://github.com/facebook/react/issues/7407
|
|
140
135
|
if (event.clientX === 0 && event.clientY === 0) {
|
|
141
136
|
return;
|
|
142
137
|
}
|
package/SingleFilter.js
CHANGED
|
@@ -107,7 +107,6 @@ const SingleFilter = forwardRef((inProps, ref) => {
|
|
|
107
107
|
if (menuIndex >= 0) {
|
|
108
108
|
updateFilterItemsOrder(menuIndex);
|
|
109
109
|
}
|
|
110
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
111
110
|
}, [currentValue, data, visibleCount]);
|
|
112
111
|
return (jsxs("div", { className: cls('root'), ...rest, ref: ref, children: [buttonsData.map(({ label, value, ...rest }) => {
|
|
113
112
|
return (jsx(FilterButton, { value: value, selected: currentValue === value, onClick: () => {
|
package/Slider.js
CHANGED
|
@@ -28,13 +28,11 @@ const SliderThumb = (props) => {
|
|
|
28
28
|
const percent = valueToPercent(value, min, max);
|
|
29
29
|
const style = axisProps[axis].offset(percent);
|
|
30
30
|
const scaledValue = scale(value);
|
|
31
|
-
// Format value label for tooltip display
|
|
32
31
|
const valueLabel = typeof valueLabelFormat === 'function'
|
|
33
32
|
? valueLabelFormat(scaledValue)
|
|
34
33
|
: typeof valueLabelFormat === 'string'
|
|
35
34
|
? valueLabelFormat
|
|
36
35
|
: scaledValue;
|
|
37
|
-
// Calculate aria-valuetext
|
|
38
36
|
const ariaValueText = getAriaValueText
|
|
39
37
|
? getAriaValueText(scaledValue)
|
|
40
38
|
: typeof valueLabelFormat === 'function' ||
|
|
@@ -47,7 +45,7 @@ const SliderThumb = (props) => {
|
|
|
47
45
|
(valueLabelDisplay === 'auto' && (hover || focusVisible || dragging)), title: valueLabel, ...combineProps({
|
|
48
46
|
placement: orientation === 'vertical' ? 'left' : 'top',
|
|
49
47
|
className: cls('value-label', {
|
|
50
|
-
'show-on-hover-only': valueLabelDisplay === 'auto',
|
|
48
|
+
'show-on-hover-only': valueLabelDisplay === 'auto',
|
|
51
49
|
}),
|
|
52
50
|
classes: {
|
|
53
51
|
paper: cls('value-label-paper'),
|
|
@@ -103,7 +101,6 @@ const InnerSlider = (inProps, ref) => {
|
|
|
103
101
|
(typeof mark.label === 'string' ? (jsx("span", { className: cls('mark-label'), children: mark.label })) : (mark.label))] }, `${mark.value}`));
|
|
104
102
|
}) }))] }));
|
|
105
103
|
};
|
|
106
|
-
// forwardRef doesn't handle generic types well, so we need to cast through an intermediate variable
|
|
107
104
|
const Slider = forwardRef(InnerSlider);
|
|
108
105
|
Slider.displayName = 'SuiSlider';
|
|
109
106
|
|
package/Snackbar.js
CHANGED
|
@@ -25,11 +25,6 @@ const WRAPPER_ID = 'sui-snackbar-wrapper';
|
|
|
25
25
|
const useSnackbarWrapper = (className) => {
|
|
26
26
|
const { document } = useWindowContext();
|
|
27
27
|
const { scopeProps } = useTheme();
|
|
28
|
-
/**
|
|
29
|
-
* We must memoize the container otherwise other components that
|
|
30
|
-
* are a child of the wrapper which are conditionally rendered
|
|
31
|
-
* can throw a "Cannot update a component while rendering a different component" error.
|
|
32
|
-
*/
|
|
33
28
|
return useMemo(() => {
|
|
34
29
|
const container = document?.getElementById(WRAPPER_ID) ?? document?.createElement('div');
|
|
35
30
|
if (container) {
|
|
@@ -37,19 +32,11 @@ const useSnackbarWrapper = (className) => {
|
|
|
37
32
|
class: className,
|
|
38
33
|
id: WRAPPER_ID,
|
|
39
34
|
}).forEach(([key, value]) => container.setAttribute(key, value));
|
|
40
|
-
// create one more div wrapper to wrap the container
|
|
41
35
|
if (document) {
|
|
42
36
|
const wrapper = document.createElement('div');
|
|
43
|
-
// Apply the scope props directly to the wrapper
|
|
44
37
|
Object.entries({
|
|
45
38
|
...scopeProps,
|
|
46
39
|
}).forEach(([key, value]) => {
|
|
47
|
-
/**
|
|
48
|
-
* Map the key to an attribute. scopeProps is set on a ReactElement so
|
|
49
|
-
* setting a key like className will automatically be set to class,
|
|
50
|
-
* but as we're mutating the DOM element directly we need to manually
|
|
51
|
-
* map the key name to the DOM attribute name.
|
|
52
|
-
*/
|
|
53
40
|
let attribute = key;
|
|
54
41
|
if (attribute === 'className') {
|
|
55
42
|
attribute = 'class';
|
|
@@ -61,7 +48,6 @@ const useSnackbarWrapper = (className) => {
|
|
|
61
48
|
}
|
|
62
49
|
}
|
|
63
50
|
return container;
|
|
64
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
65
51
|
}, [className, scopeProps]);
|
|
66
52
|
};
|
|
67
53
|
|
package/SortableListItem.js
CHANGED
|
@@ -32,7 +32,6 @@ const SortableListItem = forwardRef((props, ref) => {
|
|
|
32
32
|
const handleRef = useForkRef(ref, setNodeRef, setActivatorNodeRef);
|
|
33
33
|
return (jsx(ListItem, { ...combineProps(combineProps(rest, {
|
|
34
34
|
onKeyDown: (e) => {
|
|
35
|
-
// prevent trigger keyboard navigation
|
|
36
35
|
if (isSorting &&
|
|
37
36
|
['End', 'Home', 'ArrowUp', 'ArrowDown'].includes(e.key)) {
|
|
38
37
|
e.preventDefault();
|
package/SplitButton.js
CHANGED
|
@@ -121,9 +121,7 @@ const SplitButton = withTooltip(forwardRef((inProps, ref) => {
|
|
|
121
121
|
children: actionButtonContent,
|
|
122
122
|
onClick: childProps.onClick,
|
|
123
123
|
classes: {
|
|
124
|
-
root: clsx(cls('action-button-root'),
|
|
125
|
-
// Reduces the padding when only an icon is provided
|
|
126
|
-
actionButtonCls(hasIconChild && 'has-start-slot', hasIconChild && 'has-end-slot')),
|
|
124
|
+
root: clsx(cls('action-button-root'), actionButtonCls(hasIconChild && 'has-start-slot', hasIconChild && 'has-end-slot')),
|
|
127
125
|
},
|
|
128
126
|
}, actionButtonPropsProp);
|
|
129
127
|
if (process.env.NODE_ENV !== 'production' &&
|
package/StatusIndicator.js
CHANGED
|
@@ -6,6 +6,6 @@ import '@ringcentral/spring-theme';
|
|
|
6
6
|
import './chunks/Icon.js';
|
|
7
7
|
import 'react';
|
|
8
8
|
|
|
9
|
-
var StatusIndicator = {"sui-status-indicator-root":"sui-status-indicator-root","sui-status-indicator-large":"sui-status-indicator-large","sui-status-indicator-medium":"sui-status-indicator-medium","sui-status-indicator-dnd":"sui-status-indicator-dnd","sui-status-indicator-busy":"sui-status-indicator-busy","sui-status-indicator-available":"sui-status-indicator-available","sui-status-indicator-unavailable":"sui-status-indicator-unavailable"};
|
|
9
|
+
var StatusIndicator = {"sui-status-indicator-root":"sui-status-indicator-root","sui-status-indicator-large":"sui-status-indicator-large","sui-status-indicator-medium":"sui-status-indicator-medium","sui-status-indicator-small":"sui-status-indicator-small","sui-icon":"sui-icon","sui-status-indicator-dnd":"sui-status-indicator-dnd","sui-status-indicator-busy":"sui-status-indicator-busy","sui-status-indicator-available":"sui-status-indicator-available","sui-status-indicator-unavailable":"sui-status-indicator-unavailable"};
|
|
10
10
|
|
|
11
11
|
export { StatusIndicator as statusIndicatorStyle };
|
package/SubMenu.js
CHANGED
|
@@ -82,7 +82,6 @@ const SubMenu = forwardRef((inProps, ref) => {
|
|
|
82
82
|
const shouldKeepMenu = (() => {
|
|
83
83
|
if (!open)
|
|
84
84
|
return false;
|
|
85
|
-
// Check `menuMounted` to ensure the state of menu is correct
|
|
86
85
|
if (open && !menuMounted)
|
|
87
86
|
return true;
|
|
88
87
|
let shouldKeepMenu = false;
|
|
@@ -123,13 +122,10 @@ const SubMenu = forwardRef((inProps, ref) => {
|
|
|
123
122
|
}
|
|
124
123
|
}, ...anchorHoverHandlers, ref: handleRef, children: [typeof itemContent === 'string' ? (jsx(MenuItemText, { children: itemContent })) : (itemContent), jsx(Icon, { symbol: CaretRightMd })] }), open && (jsx(PopperMenu, { anchorEl: anchor, placement: "right-start", offset: -4, whileElementsMounted: () => {
|
|
125
124
|
setMenuMounted(true);
|
|
126
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
127
125
|
return () => { };
|
|
128
126
|
}, onKeyDown: (e) => {
|
|
129
127
|
if ((e.key === 'ArrowLeft' || e.key === 'Escape') &&
|
|
130
|
-
// make sure target is real dom child
|
|
131
128
|
e.currentTarget.contains(e.target)) {
|
|
132
|
-
// If Escape key is pressed, stop propagation to prevent parent menus from closing
|
|
133
129
|
if (e.key === 'Escape') {
|
|
134
130
|
e.stopPropagation();
|
|
135
131
|
}
|