@ringcentral/spring-ui 1.9.3 → 1.11.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/Alert.js +1 -1
- package/Announcement.js +4 -2
- package/Autocomplete.js +40 -7
- package/Avatar.js +42 -27
- package/DatePicker.js +45 -38
- package/DateUtilsContext.js +18 -1
- package/Dialer.js +1 -1
- package/Dialog.js +24 -15
- package/NestedMenuContext.js +3 -2
- package/Option.js +5 -5
- package/PickerTextField.js +2 -2
- package/Popper.js +1 -1
- package/Snackbar.js +7 -5
- package/SortableListDndContext.js +3 -3
- package/SortableListItem.js +21 -9
- package/SplitButton.js +1 -1
- package/SubMenu.js +204 -63
- package/SwipeableDrawer.js +1 -9
- package/Switch.js +15 -5
- package/TablePagination.js +11 -21
- package/TableRow.js +1 -1
- package/Text.js +2 -2
- package/Textarea.js +1 -1
- package/TimePicker.js +1 -1
- package/chunks/Alert.js +1 -1
- package/chunks/Drawer.js +1 -1
- package/chunks/Menu.js +25 -6
- package/chunks/Modal.js +7 -3
- package/chunks/PickerTextField.js +18 -7
- package/chunks/TextField.js +0 -1
- package/chunks/Tooltip.js +1 -1
- package/chunks/VirtualizedMenu.js +1 -1
- package/chunks/useMenuItemSelect.js +44 -16
- package/chunks/useNestedMenuItem.js +16 -5
- package/chunks/useNestedParentMenu.js +77 -5
- package/chunks/useTrayNavigate.js +1 -1
- package/index.css +543 -398
- package/index.js +1 -1
- package/package.json +4 -4
- package/src/Accordion/Accordion.classes.d.ts +3 -3
- package/src/Accordion/Accordion.d.ts +1 -1
- package/src/Accordion/Accordion.type.d.ts +1 -1
- package/src/Accordion/AccordionContext.d.ts +1 -1
- package/src/AccordionHeader/AccordionHeader.classes.d.ts +3 -3
- package/src/AccordionHeader/AccordionHeader.d.ts +1 -1
- package/src/AccordionHeader/AccordionHeader.type.d.ts +1 -1
- package/src/Alert/Alert.classes.d.ts +3 -3
- package/src/Alert/Alert.d.ts +3 -3
- package/src/Alert/Alert.type.d.ts +7 -7
- package/src/Alert/AlertTitle.classes.d.ts +3 -3
- package/src/Animation/components/ExpandCollapseCaret/ExpandCollapseCaret.classes.d.ts +3 -3
- package/src/Animation/components/ExpandCollapseCaret/ExpandCollapseCaret.d.ts +2 -2
- package/src/Animation/components/Fade/Fade.d.ts +1 -1
- package/src/Animation/components/Fade/getFade.d.ts +1 -1
- package/src/Animation/components/Grow/Grow.d.ts +1 -1
- package/src/Animation/components/Grow/getGrow.d.ts +4 -4
- package/src/Animation/components/ShowHideEye/ShowHideEye.classes.d.ts +3 -3
- package/src/Animation/components/ShowHideEye/ShowHideEye.d.ts +1 -1
- package/src/Animation/components/SlideIn/SlideIn.d.ts +1 -1
- package/src/Animation/components/SlideIn/getSlideIn.d.ts +2 -2
- package/src/Animation/components/SortableArrow/SortableArrow.classes.d.ts +3 -3
- package/src/Animation/components/SortableArrow/SortableArrow.d.ts +1 -1
- package/src/Animation/components/types.d.ts +2 -2
- package/src/Announcement/Announcement.classes.d.ts +3 -3
- package/src/Announcement/Announcement.type.d.ts +1 -1
- package/src/Autocomplete/Autocomplete.classes.d.ts +6 -6
- package/src/Autocomplete/Autocomplete.type.d.ts +6 -5
- package/src/Autocomplete/SuggestionList/SuggestionList.classes.d.ts +3 -3
- package/src/Autocomplete/SuggestionList/SuggestionList.d.ts +3 -3
- package/src/Autocomplete/SuggestionList/SuggestionListItem.d.ts +2 -2
- package/src/Autocomplete/SuggestionList/utils/SuggestionListItem.d.ts +1 -1
- package/src/Autocomplete/SuggestionList/utils/useDynamicHeight.d.ts +1 -1
- package/src/Autocomplete/SuggestionList/utils/useHighlightScroll.d.ts +1 -1
- package/src/Autocomplete/SuggestionList/utils/useSuggestionList.d.ts +11 -11
- package/src/Autocomplete/SuggestionList/utils/useSuggestionListGroup.d.ts +2 -2
- package/src/Autocomplete/useAutocomplete.d.ts +20 -20
- package/src/Autocomplete/useAutocompleteTag.d.ts +12 -12
- package/src/Avatar/Avatar.classes.d.ts +5 -5
- package/src/Avatar/Avatar.type.d.ts +7 -7
- package/src/AvatarGroup/AvatarGroup.classes.d.ts +3 -3
- package/src/AvatarGroup/AvatarGroup.type.d.ts +6 -6
- package/src/Backdrop/Backdrop.classes.d.ts +3 -3
- package/src/Backdrop/Backdrop.type.d.ts +1 -1
- package/src/Badge/Badge.classes.d.ts +5 -5
- package/src/Badge/Badge.type.d.ts +7 -7
- package/src/Block/Block.classes.d.ts +3 -3
- package/src/Block/Block.type.d.ts +6 -6
- package/src/BlockHeader/BlockHeader.classes.d.ts +3 -3
- package/src/BlockHeader/BlockHeader.type.d.ts +4 -4
- package/src/BottomNavigation/BottomNavigation.classes.d.ts +3 -3
- package/src/BottomNavigation/BottomNavigation.type.d.ts +2 -2
- package/src/BottomNavigation/BottomNavigationContext.d.ts +1 -1
- package/src/BottomNavigation/BottomNavigationGroup/BottomNavigationGroup.classes.d.ts +3 -3
- package/src/BottomNavigation/BottomNavigationGroup/BottomNavigationGroup.type.d.ts +1 -1
- package/src/BottomNavigationItem/BottomNavigationItem.classes.d.ts +3 -3
- package/src/BottomNavigationItem/BottomNavigationItem.type.d.ts +1 -1
- package/src/Button/Button.classes.d.ts +3 -3
- package/src/Button/Button.type.d.ts +8 -8
- package/src/CallButton/CallButton.classes.d.ts +3 -3
- package/src/CallButton/CallButton.type.d.ts +5 -5
- package/src/Checkbox/Checkbox.classes.d.ts +3 -3
- package/src/Checkbox/Checkbox.d.ts +2 -2
- package/src/Checkbox/Checkbox.type.d.ts +2 -2
- package/src/Chip/Chip.classes.d.ts +3 -3
- package/src/Chip/Chip.type.d.ts +5 -5
- package/src/CircularProgressIndicator/CircularProgressIndicator.classes.d.ts +4 -4
- package/src/CircularProgressIndicator/CircularProgressIndicator.d.ts +1 -1
- package/src/CircularProgressIndicator/CircularProgressIndicator.type.d.ts +4 -4
- package/src/ComponentsProps.d.ts +1 -1
- package/src/DatePicker/Calendar.d.ts +1 -1
- package/src/DatePicker/DatePicker.classes.d.ts +3 -3
- package/src/DatePicker/DatePicker.d.ts +1 -1
- package/src/DatePicker/DatePicker.type.d.ts +3 -3
- package/src/DatePicker/DatePickerHeader.d.ts +3 -2
- package/src/DatePicker/Day.d.ts +2 -2
- package/src/DatePicker/SlideDirection.d.ts +1 -1
- package/src/DatePicker/Year.d.ts +2 -2
- package/src/DatePicker/Years.d.ts +1 -1
- package/src/DatePicker/utils/DatePickerAriaLabelUtils.d.ts +12 -4
- package/src/DatePicker/utils/DatePickerUtils.d.ts +1 -1
- package/src/DatePicker/utils/findClosestEnabledDate.d.ts +1 -1
- package/src/DateUtilsContext/DateUtilsContext.d.ts +8 -2
- package/src/Dialer/DialDelete/DialDelete.d.ts +1 -1
- package/src/Dialer/DialPad/DialPad.classes.d.ts +3 -3
- package/src/Dialer/DialPad/DialPad.d.ts +2 -2
- package/src/Dialer/DialPad/utils/DialPadUtils.d.ts +3 -3
- package/src/Dialer/DialPad/utils/types.d.ts +2 -2
- package/src/Dialer/DialPad/utils/useDialKeyboard.d.ts +1 -1
- package/src/Dialer/DialPad/utils/useKeyAudio.d.ts +1 -1
- package/src/Dialer/DialPadButton/DialPadButton.classes.d.ts +3 -3
- package/src/Dialer/DialPadButton/DialPadButton.d.ts +1 -1
- package/src/Dialer/DialTextField/DialTextField.d.ts +2 -2
- package/src/Dialer/Dialer.d.ts +1 -1
- package/src/Dialer/utils/DialerContext.d.ts +1 -1
- package/src/Dialog/Dialog.classes.d.ts +14 -14
- package/src/Dialog/Dialog.d.ts +1 -1
- package/src/Dialog/Dialog.type.d.ts +5 -4
- package/src/Divider/Divider.classes.d.ts +4 -4
- package/src/Divider/Divider.type.d.ts +7 -7
- package/src/DragHandle/DragHandle.classes.d.ts +3 -3
- package/src/DragHandle/DragHandle.type.d.ts +5 -5
- package/src/Drawer/Drawer.classes.d.ts +5 -5
- package/src/Drawer/Drawer.d.ts +1 -1
- package/src/Drawer/Drawer.type.d.ts +4 -4
- package/src/Dropdown/Dropdown.classes.d.ts +3 -3
- package/src/Dropdown/Dropdown.type.d.ts +1 -1
- package/src/EmptyState/EmptyState.classes.d.ts +3 -3
- package/src/EmptyState/EmptyState.d.ts +1 -1
- package/src/EmptyState/EmptyState.type.d.ts +1 -1
- package/src/FabButton/FabButton.classes.d.ts +3 -3
- package/src/FabButton/FabButton.type.d.ts +5 -5
- package/src/FocusTrap/FocusTrap.d.ts +2 -2
- package/src/FormField/FormField.classes.d.ts +4 -4
- package/src/FormField/FormField.type.d.ts +3 -3
- package/src/FormLabel/FormLabel.classes.d.ts +4 -4
- package/src/FormLabel/FormLabel.d.ts +1 -1
- package/src/FormLabel/FormLabel.type.d.ts +2 -2
- package/src/FormLabel/FormLabelContext.d.ts +1 -1
- package/src/Icon/Icon.classes.d.ts +3 -3
- package/src/Icon/Icon.d.ts +1 -1
- package/src/Icon/Icon.type.d.ts +2 -2
- package/src/IconButton/IconButton.classes.d.ts +3 -3
- package/src/IconButton/IconButton.type.d.ts +9 -9
- package/src/IconButton/IconButtonLabel.classes.d.ts +3 -3
- package/src/IconButton/IconButtonLabel.d.ts +1 -1
- package/src/IconButton/IconButtonLabel.type.d.ts +1 -1
- package/src/IconButtonGroup/IconButtonGroup.classes.d.ts +3 -3
- package/src/IconButtonGroup/IconButtonGroup.type.d.ts +4 -4
- package/src/InlineEditable/InlineEditable.classes.d.ts +4 -4
- package/src/InlineEditable/InlineEditable.type.d.ts +5 -5
- package/src/LinearProgressIndicator/LinearProgressIndicator.classes.d.ts +4 -4
- package/src/LinearProgressIndicator/LinearProgressIndicator.type.d.ts +2 -2
- package/src/Link/Link.classes.d.ts +4 -4
- package/src/Link/Link.type.d.ts +4 -4
- package/src/List/List.classes.d.ts +3 -3
- package/src/List/List.type.d.ts +1 -1
- package/src/ListItem/HoverActions.d.ts +1 -1
- package/src/ListItem/ListItem.classes.d.ts +3 -3
- package/src/ListItem/ListItem.d.ts +1 -1
- package/src/ListItem/ListItem.type.d.ts +1 -1
- package/src/ListItemText/ListItemText.classes.d.ts +4 -4
- package/src/ListItemText/ListItemText.d.ts +1 -1
- package/src/ListItemText/ListItemText.type.d.ts +2 -2
- package/src/ListNavigation/ListNavigationContext.d.ts +1 -1
- package/src/ListNavigation/useListNavigation.d.ts +6 -6
- package/src/Menu/Menu.classes.d.ts +3 -3
- package/src/Menu/Menu.d.ts +1 -1
- package/src/Menu/Menu.type.d.ts +1 -1
- package/src/Menu/MenuContext.d.ts +1 -1
- package/src/MenuActions/MenuActions.classes.d.ts +6 -6
- package/src/MenuActions/MenuActions.type.d.ts +1 -1
- package/src/MenuDivider/MenuDivider.classes.d.ts +3 -3
- package/src/MenuDivider/MenuDivider.type.d.ts +1 -1
- package/src/MenuFooter/MenuFooter.classes.d.ts +3 -3
- package/src/MenuFooter/MenuFooter.type.d.ts +1 -1
- package/src/MenuHeader/MenuHeader.classes.d.ts +3 -3
- package/src/MenuHeader/MenuHeader.type.d.ts +1 -1
- package/src/MenuItem/MenuItem.classes.d.ts +3 -3
- package/src/MenuItem/MenuItem.d.ts +1 -1
- package/src/MenuItem/MenuItem.type.d.ts +1 -1
- package/src/MenuItem/MenuItemSelectContext.d.ts +1 -1
- package/src/MenuItem/useMenuItem.d.ts +1 -1
- package/src/MenuItem/useMenuItemSelect.d.ts +5 -5
- package/src/MenuItem/useVirtualizedMenuItem.d.ts +2 -1
- package/src/MenuItemText/MenuItemText.classes.d.ts +3 -3
- package/src/MenuItemText/MenuItemText.d.ts +1 -1
- package/src/MenuItemText/MenuItemText.type.d.ts +1 -1
- package/src/MenuList/MenuList.classes.d.ts +3 -3
- package/src/MenuList/MenuList.type.d.ts +1 -1
- package/src/MenuList/MenuListContext.d.ts +1 -1
- package/src/Modal/InnerModal.d.ts +1 -1
- package/src/Modal/InnerModal.type.d.ts +2 -2
- package/src/Modal/Modal.classes.d.ts +3 -3
- package/src/Modal/Modal.d.ts +1 -1
- package/src/Modal/Modal.type.d.ts +1 -1
- package/src/Modal/ModalContext.d.ts +1 -1
- package/src/NestedMenuContext/MenuOverlayGroupContext.d.ts +15 -0
- package/src/NestedMenuContext/NestedMenuContext.d.ts +19 -5
- package/src/NestedMenuContext/pointerGrace.d.ts +8 -0
- package/src/NestedMenuContext/useNestedChildMenu.d.ts +2 -1
- package/src/NestedMenuContext/useNestedMenuItem.d.ts +8 -3
- package/src/NestedMenuContext/useNestedParentMenu.d.ts +8 -1
- package/src/Option/Option.d.ts +1 -1
- package/src/Option/Option.type.d.ts +1 -1
- package/src/Overlap/Overlap.classes.d.ts +3 -3
- package/src/Overlap/Overlap.type.d.ts +8 -8
- package/src/PageHeader/PageHeader.classes.d.ts +15 -15
- package/src/PageHeader/PageHeader.type.d.ts +6 -6
- package/src/PickerTextField/PickerTextField.classes.d.ts +3 -3
- package/src/PickerTextField/PickerTextField.d.ts +1 -1
- package/src/PickerTextField/PickerTextField.type.d.ts +2 -2
- package/src/Popover/Popover.classes.d.ts +3 -3
- package/src/Popover/Popover.d.ts +1 -1
- package/src/Popover/Popover.type.d.ts +2 -2
- package/src/Popper/Popper.d.ts +1 -1
- package/src/Popper/Popper.type.d.ts +4 -4
- package/src/PopperPaper/PopperPaper.classes.d.ts +3 -3
- package/src/PopperPaper/PopperPaper.d.ts +1 -1
- package/src/PopperPaper/PopperPaper.type.d.ts +1 -1
- package/src/Radio/Radio.classes.d.ts +3 -3
- package/src/Radio/Radio.d.ts +2 -2
- package/src/Radio/Radio.type.d.ts +1 -1
- package/src/RadioGroup/RadioGroup.classes.d.ts +3 -3
- package/src/RadioGroup/RadioGroup.context.d.ts +1 -1
- package/src/RadioGroup/RadioGroup.d.ts +1 -1
- package/src/RadioGroup/RadioGroup.type.d.ts +1 -1
- package/src/Rating/Rating.classes.d.ts +3 -3
- package/src/Rating/Rating.d.ts +1 -1
- package/src/Rating/Rating.type.d.ts +2 -2
- package/src/Rating/RatingItem.d.ts +1 -1
- package/src/Select/Select.classes.d.ts +4 -4
- package/src/Select/Select.type.d.ts +5 -5
- package/src/Select/useSelect.d.ts +1 -1
- package/src/SingleFilter/FilterButton/FilterButton.classes.d.ts +3 -3
- package/src/SingleFilter/FilterButton/FilterButton.d.ts +1 -1
- package/src/SingleFilter/FilterButton/FilterButton.type.d.ts +2 -2
- package/src/SingleFilter/SingleFilter.classes.d.ts +3 -3
- package/src/SingleFilter/SingleFilter.d.ts +1 -1
- package/src/SingleFilter/SingleFilter.type.d.ts +2 -2
- package/src/Skeleton/Skeleton.classes.d.ts +3 -3
- package/src/Skeleton/Skeleton.type.d.ts +1 -1
- package/src/Skeleton/SkeletonContainer/SkeletonContainer.classes.d.ts +3 -3
- package/src/Skeleton/SkeletonContainer/SkeletonContainer.type.d.ts +5 -5
- package/src/Slider/Slider.classes.d.ts +4 -4
- package/src/Slider/Slider.d.ts +3 -3
- package/src/Slider/Slider.type.d.ts +2 -2
- package/src/Slider/SliderThumb.d.ts +1 -1
- package/src/Snackbar/Snackbar.classes.d.ts +3 -3
- package/src/Snackbar/Snackbar.d.ts +1 -1
- package/src/Snackbar/Snackbar.type.d.ts +1 -1
- package/src/Snackbar/SnackbarContent/SnackbarContent.classes.d.ts +3 -3
- package/src/Snackbar/SnackbarContent/SnackbarContent.type.d.ts +1 -1
- package/src/SortableList/SortableList.type.d.ts +1 -1
- package/src/SortableListDndContext/SortableListDndContext.type.d.ts +2 -2
- package/src/SortableListItem/SortableListItem.d.ts +1 -1
- package/src/SortableListItem/SortableListItem.type.d.ts +2 -2
- package/src/SortableListItem/SortableListItemOverlay.d.ts +1 -1
- package/src/SortableListItem/SortableListItemOverlay.type.d.ts +1 -1
- package/src/SortableVirtualizedList/SortableVirtualizedList.type.d.ts +1 -1
- package/src/SplitButton/SplitButton.classes.d.ts +3 -3
- package/src/SplitButton/SplitButton.d.ts +1 -1
- package/src/SplitButton/SplitButton.type.d.ts +1 -1
- package/src/Squircle/Squircle.type.d.ts +5 -5
- package/src/Squircle/squircle.classes.d.ts +3 -3
- package/src/StatusIndicator/StatusIndicator.classes.d.ts +3 -3
- package/src/StatusIndicator/StatusIndicator.type.d.ts +1 -1
- package/src/Step/Step.classes.d.ts +3 -3
- package/src/Step/Step.type.d.ts +5 -5
- package/src/Step/StepContext.d.ts +1 -1
- package/src/StepButton/StepButton.classes.d.ts +3 -3
- package/src/StepButton/StepButton.type.d.ts +5 -5
- package/src/StepConnector/StepConnector.classes.d.ts +3 -3
- package/src/StepConnector/StepConnector.type.d.ts +1 -1
- package/src/StepContent/StepContent.classes.d.ts +3 -3
- package/src/StepContent/StepContent.d.ts +1 -1
- package/src/StepContent/StepContent.type.d.ts +1 -1
- package/src/StepIcon/StepIcon.classes.d.ts +3 -3
- package/src/StepIcon/StepIcon.type.d.ts +1 -1
- package/src/StepLabel/StepLabel.classes.d.ts +4 -4
- package/src/StepLabel/StepLabel.d.ts +1 -1
- package/src/StepLabel/StepLabel.type.d.ts +1 -1
- package/src/Stepper/Stepper.classes.d.ts +3 -3
- package/src/Stepper/Stepper.type.d.ts +6 -6
- package/src/Stepper/StepperContext.d.ts +1 -1
- package/src/SubMenu/PopperMenu.classes.d.ts +3 -3
- package/src/SubMenu/PopperMenu.d.ts +1 -1
- package/src/SubMenu/PopperMenu.type.d.ts +1 -1
- package/src/SubMenu/SubMenu.d.ts +1 -1
- package/src/SubMenu/SubMenu.type.d.ts +1 -1
- package/src/SubMenu/useSubMenuInteractionState.d.ts +13 -0
- package/src/SubMenu/useSubMenuPointerGrace.d.ts +15 -0
- package/src/SwipeableDrawer/SwipeableDrawer.classes.d.ts +3 -3
- package/src/SwipeableDrawer/SwipeableDrawer.d.ts +1 -1
- package/src/SwipeableDrawer/SwipeableDrawer.types.d.ts +2 -2
- package/src/SwipeableDrawer/hooks/useSnapPoints.d.ts +1 -1
- package/src/Switch/Switch.classes.d.ts +3 -3
- package/src/Switch/Switch.d.ts +4 -2
- package/src/Switch/Switch.type.d.ts +4 -1
- package/src/Tab/Tab.classes.d.ts +4 -4
- package/src/Tab/Tab.d.ts +1 -1
- package/src/Tab/Tab.type.d.ts +4 -4
- package/src/TabContext/TabContext.type.d.ts +1 -1
- package/src/TabPanel/TabPanel.classes.d.ts +3 -3
- package/src/TabPanel/TabPanel.d.ts +1 -1
- package/src/TabPanel/TabPanel.type.d.ts +1 -1
- package/src/Table/Table.classes.d.ts +3 -3
- package/src/Table/Table.type.d.ts +5 -5
- package/src/Table/TableContext.d.ts +1 -1
- package/src/Table/Tablelvl2Context.d.ts +1 -1
- package/src/TableBody/TableBody.classes.d.ts +3 -3
- package/src/TableBody/TableBody.type.d.ts +5 -5
- package/src/TableCell/TableCell.classes.d.ts +3 -3
- package/src/TableCell/TableCell.type.d.ts +7 -7
- package/src/TableContainer/TableContainer.classes.d.ts +3 -3
- package/src/TableContainer/TableContainer.type.d.ts +6 -6
- package/src/TableFooter/TableFooter.classes.d.ts +3 -3
- package/src/TableFooter/TableFooter.d.ts +1 -1
- package/src/TableFooter/TableFooter.type.d.ts +1 -1
- package/src/TableHead/TableHead.classes.d.ts +3 -3
- package/src/TableHead/TableHead.type.d.ts +5 -5
- package/src/TablePagination/TablePagination.classes.d.ts +3 -3
- package/src/TablePagination/TablePagination.type.d.ts +8 -6
- package/src/TableRow/TableRow.classes.d.ts +3 -3
- package/src/TableRow/TableRow.type.d.ts +5 -5
- package/src/Tabs/TabMoreMenu.d.ts +2 -2
- package/src/Tabs/TabScrollButton.d.ts +2 -2
- package/src/Tabs/Tabs.classes.d.ts +9 -9
- package/src/Tabs/Tabs.d.ts +1 -1
- package/src/Tabs/Tabs.type.d.ts +2 -2
- package/src/Tabs/TabsContext.d.ts +1 -1
- package/src/Tabs/hooks/useTabsScroller.d.ts +3 -3
- package/src/Tag/Tag.classes.d.ts +3 -3
- package/src/Tag/Tag.d.ts +1 -1
- package/src/Tag/Tag.type.d.ts +2 -2
- package/src/Text/Text.classes.d.ts +3 -3
- package/src/Text/Text.type.d.ts +5 -5
- package/src/TextField/TextField.classes.d.ts +3 -3
- package/src/TextField/TextField.d.ts +1 -1
- package/src/TextField/TextField.type.d.ts +9 -9
- package/src/Textarea/Textarea.classes.d.ts +4 -4
- package/src/Textarea/Textarea.d.ts +1 -1
- package/src/Textarea/Textarea.type.d.ts +3 -3
- package/src/TimePicker/NumberPicker.d.ts +1 -1
- package/src/TimePicker/NumberPicker.type.d.ts +3 -3
- package/src/TimePicker/PickerView.type.d.ts +3 -3
- package/src/TimePicker/SelectionView.d.ts +1 -1
- package/src/TimePicker/TimeButton.d.ts +1 -1
- package/src/TimePicker/TimePicker.classes.d.ts +3 -3
- package/src/TimePicker/TimePicker.type.d.ts +1 -1
- package/src/TimePicker/ToggleText.d.ts +1 -1
- package/src/TimePicker/ToggleText.type.d.ts +2 -2
- package/src/TimePicker/utils/TimeBoundary.d.ts +3 -3
- package/src/TimePicker/utils/TimePickerHelper.d.ts +5 -5
- package/src/TimePicker/utils/getNumberPickerBoundary.d.ts +1 -1
- package/src/TimePicker/utils/runKeyHandler.d.ts +1 -1
- package/src/Tooltip/Tooltip.type.d.ts +1 -1
- package/src/Tooltip/TooltipTrigger.a11y.d.ts +4 -4
- package/src/Tooltip/TooltipTrigger.type.d.ts +1 -1
- package/src/Tooltip/TooltipView.classes.d.ts +3 -3
- package/src/Tooltip/TooltipView.type.d.ts +2 -2
- package/src/Tooltip/withTooltip/withTooltip.d.ts +1 -1
- package/src/Tray/Tray.classes.d.ts +6 -6
- package/src/Tray/Tray.d.ts +1 -1
- package/src/Tray/Tray.type.d.ts +2 -2
- package/src/Tray/TrayContext.d.ts +1 -1
- package/src/Tray/TrayPanel.d.ts +1 -1
- package/src/Tray/hooks/useTray.d.ts +2 -2
- package/src/Tray/hooks/useTrayPanel.d.ts +2 -2
- package/src/Tray/types.d.ts +2 -2
- package/src/TrayMenu/TrayMenu.d.ts +1 -1
- package/src/TrayMenu/TrayMenu.type.d.ts +1 -1
- package/src/TrayMenu/TrayMenuItem.d.ts +2 -2
- package/src/VirtualizedList/VirtualizedItemPropsContext.d.ts +1 -1
- package/src/VirtualizedList/VirtualizedList.type.d.ts +2 -2
- package/src/VirtualizedList/VirtuosoContextType.d.ts +1 -1
- package/src/VirtualizedMenu/VirtualizedMenu.classes.d.ts +3 -3
- package/src/VirtualizedMenu/VirtualizedMenu.context.d.ts +1 -1
- package/src/VirtualizedMenu/VirtualizedMenu.type.d.ts +1 -1
- package/src/VirtualizedMenu/VirtualizedMenuList.d.ts +1 -1
- package/src/VisuallyHidden/VisuallyHidden.classes.d.ts +3 -3
- package/src/VisuallyHidden/VisuallyHidden.type.d.ts +1 -1
- package/src/internal/utils/composeEventHandlers.d.ts +7 -0
- package/src/internal/utils/index.d.ts +1 -0
- package/src/Animation/hooks/useMotionSafeTransition/useMotionSafeTransition.d.ts +0 -6
package/NestedMenuContext.js
CHANGED
|
@@ -5,7 +5,7 @@ import { useEffect } from 'react';
|
|
|
5
5
|
export { u as useNestedMenuItem } from './chunks/useNestedMenuItem.js';
|
|
6
6
|
|
|
7
7
|
const useNestedChildMenu = (props) => {
|
|
8
|
-
const { open, closeMenu, id } = props;
|
|
8
|
+
const { open, closeMenu, getAnchorElement, id } = props;
|
|
9
9
|
const context = useNestedMenuContext();
|
|
10
10
|
const { registOpenedSubMenu } = context ?? {};
|
|
11
11
|
const closeMenuMemo = useEventCallback((options) => closeMenu(options));
|
|
@@ -13,11 +13,12 @@ const useNestedChildMenu = (props) => {
|
|
|
13
13
|
if (open) {
|
|
14
14
|
return registOpenedSubMenu?.({
|
|
15
15
|
anchorId: id,
|
|
16
|
+
getAnchorElement,
|
|
16
17
|
closeSubMenu: closeMenuMemo,
|
|
17
18
|
});
|
|
18
19
|
}
|
|
19
20
|
return undefined;
|
|
20
|
-
}, [closeMenuMemo, id, open, registOpenedSubMenu]);
|
|
21
|
+
}, [closeMenuMemo, getAnchorElement, id, open, registOpenedSubMenu]);
|
|
21
22
|
};
|
|
22
23
|
|
|
23
24
|
export { useNestedChildMenu, useNestedMenuContext };
|
package/Option.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { forwardRef } from 'react';
|
|
3
3
|
import { useThemeProps } from '@ringcentral/spring-theme';
|
|
4
|
-
import { u as useMenuItemSelectContext, M as MenuItem } from './chunks/useMenuItemSelect.js';
|
|
4
|
+
import { u as useMenuItemSelectContext, M as MenuItem, g as composeEventHandlers } from './chunks/useMenuItemSelect.js';
|
|
5
5
|
import '@ringcentral/spring-base';
|
|
6
6
|
import 'tabbable';
|
|
7
7
|
import './chunks/useListNavigation.js';
|
|
@@ -36,10 +36,10 @@ const Option = forwardRef((inProps, ref) => {
|
|
|
36
36
|
}
|
|
37
37
|
const { handleSelect, getMenuItemProps } = selectContextValue;
|
|
38
38
|
const autoClose = autoCloseProp ?? selectContextValue.selectMode === 'single';
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
39
|
+
const onClick = composeEventHandlers(onClickProp, () => {
|
|
40
|
+
handleSelect(value);
|
|
41
|
+
});
|
|
42
|
+
return (jsx(MenuItem, { ...getMenuItemProps(value), ...rest, onClick: onClick, ref: ref, autoClose: autoClose, children: children }));
|
|
43
43
|
});
|
|
44
44
|
Option.displayName = 'SuiOption';
|
|
45
45
|
|
package/PickerTextField.js
CHANGED
|
@@ -16,12 +16,12 @@ import './chunks/useFocusTrapStack.js';
|
|
|
16
16
|
import './chunks/Backdrop.js';
|
|
17
17
|
import './Popper.js';
|
|
18
18
|
import './chunks/PopperPaper.js';
|
|
19
|
+
import './chunks/useHelperTextId.js';
|
|
20
|
+
import 'clsx';
|
|
19
21
|
import './chunks/TextField.js';
|
|
20
22
|
import '@ringcentral/spring-icon';
|
|
21
23
|
import './chunks/ShowHideEye.js';
|
|
22
24
|
import './chunks/useMotionSafeTransition.js';
|
|
23
|
-
import './chunks/useHelperTextId.js';
|
|
24
|
-
import 'clsx';
|
|
25
25
|
import './chunks/IconButtonLabel.js';
|
|
26
26
|
import './chunks/Squircle.js';
|
|
27
27
|
import './chunks/withTooltip.js';
|
package/Popper.js
CHANGED
|
@@ -17,7 +17,7 @@ const getArrowSide = (placement) => ({
|
|
|
17
17
|
right: 'left',
|
|
18
18
|
bottom: 'top',
|
|
19
19
|
left: 'right',
|
|
20
|
-
}[placement.split('-')[0]]
|
|
20
|
+
})[placement.split('-')[0]];
|
|
21
21
|
const Popper = forwardRef((inProps, ref) => {
|
|
22
22
|
const props = useThemeProps({ props: inProps, name: 'Popper' });
|
|
23
23
|
const { children: childrenProp, middlewares: middlewaresProp = [], placement: placementProp, anchorEl, arrowHeight = 0, offset: offset$1 = 0, padding = 0, arrowPadding = 0, style, actions, autoUpdate: autoUpdate$1 = true, whileElementsMounted, matchAnchorWidth, container: containerProp, disablePortal, ...rest } = props;
|
package/Snackbar.js
CHANGED
|
@@ -3,7 +3,7 @@ import { useTheme, useThemeProps } from '@ringcentral/spring-theme';
|
|
|
3
3
|
import { useMemo, forwardRef, isValidElement, cloneElement } from 'react';
|
|
4
4
|
import { jsx } from 'react/jsx-runtime';
|
|
5
5
|
import { Portal } from '@mui/base';
|
|
6
|
-
import {
|
|
6
|
+
import { a as Alert } from './chunks/Alert.js';
|
|
7
7
|
import '@ringcentral/spring-icon';
|
|
8
8
|
import 'clsx';
|
|
9
9
|
import './chunks/Icon.js';
|
|
@@ -78,18 +78,20 @@ const Snackbar = forwardRef((inProps, ref) => {
|
|
|
78
78
|
const content = useMemo(() => {
|
|
79
79
|
if (!children)
|
|
80
80
|
return null;
|
|
81
|
-
const isSnackbarContent = isValidElement(children) &&
|
|
81
|
+
const isSnackbarContent = isValidElement(children) &&
|
|
82
|
+
children.type === SnackbarContent;
|
|
82
83
|
if (!isSnackbarContent) {
|
|
83
84
|
return (jsx(SnackbarContent, { ...rest, classes: classes, className: className, ref: ref, onClose: closeButton ? onClose : undefined, children: children }));
|
|
84
85
|
}
|
|
86
|
+
const childProps = children.props;
|
|
85
87
|
return cloneElement(children, {
|
|
86
88
|
...rest,
|
|
87
89
|
classes,
|
|
88
90
|
className,
|
|
89
|
-
...
|
|
91
|
+
...childProps,
|
|
90
92
|
ref,
|
|
91
|
-
onClose: 'onClose' in
|
|
92
|
-
?
|
|
93
|
+
onClose: 'onClose' in childProps
|
|
94
|
+
? childProps.onClose
|
|
93
95
|
: closeButton
|
|
94
96
|
? onClose
|
|
95
97
|
: undefined,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useDndContext, KeyboardCode, useSensors, useSensor, PointerSensor, KeyboardSensor, DndContext } from '@dnd-kit/core';
|
|
1
|
+
import { useDndContext, KeyboardCode, useSensors, useSensor, PointerSensor, KeyboardSensor, DndContext, closestCenter } from '@dnd-kit/core';
|
|
2
2
|
import { ownerDocument } from '@ringcentral/spring-base';
|
|
3
3
|
import { useEffect } from 'react';
|
|
4
4
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
@@ -38,9 +38,9 @@ const SortableListDndContext = (inProps) => {
|
|
|
38
38
|
props: inProps,
|
|
39
39
|
name: 'SortableListDndContext',
|
|
40
40
|
});
|
|
41
|
-
const { children, ...rest } = props;
|
|
41
|
+
const { children, collisionDetection = closestCenter, ...rest } = props;
|
|
42
42
|
const sensors = useSensors(useSensor(PointerSensor, pointerSensorOpts), useSensor(KeyboardSensor, keyboardSensorOpts));
|
|
43
|
-
return (jsxs(DndContext, { sensors: sensors, ...rest, children: [jsx(DndKeyboardBlocker, {}), children] }));
|
|
43
|
+
return (jsxs(DndContext, { sensors: sensors, collisionDetection: collisionDetection, ...rest, children: [jsx(DndKeyboardBlocker, {}), children] }));
|
|
44
44
|
};
|
|
45
45
|
SortableListDndContext.displayName = 'SortableListDndContext';
|
|
46
46
|
|
package/SortableListItem.js
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { useSortable } from '@dnd-kit/sortable';
|
|
3
3
|
import { CSS } from '@dnd-kit/utilities';
|
|
4
|
-
import { useForkRef, combineProps } from '@ringcentral/spring-base';
|
|
4
|
+
import { useForkRef, combineProps, useWindowContext } from '@ringcentral/spring-base';
|
|
5
5
|
import { forwardRef } from 'react';
|
|
6
|
-
import '@ringcentral/spring-theme';
|
|
6
|
+
import { useTheme } from '@ringcentral/spring-theme';
|
|
7
7
|
import 'framer-motion';
|
|
8
8
|
import './chunks/Icon.js';
|
|
9
9
|
import { L as ListItem } from './chunks/ListItem.js';
|
|
10
10
|
import { useDndContext, DragOverlay } from '@dnd-kit/core';
|
|
11
|
+
import { Portal } from '@mui/base';
|
|
11
12
|
import './chunks/Divider.js';
|
|
12
13
|
import './ListNavigation.js';
|
|
13
14
|
import './chunks/useListNavigation.js';
|
|
@@ -52,16 +53,27 @@ const SortableListItem = forwardRef((props, ref) => {
|
|
|
52
53
|
});
|
|
53
54
|
SortableListItem.displayName = 'SuiSortableListItem';
|
|
54
55
|
|
|
56
|
+
const overlayVisualOnlyProps = {
|
|
57
|
+
'aria-hidden': true,
|
|
58
|
+
inert: '',
|
|
59
|
+
};
|
|
60
|
+
const SORTABLE_LIST_ITEM_OVERLAY_Z_INDEX = 1500;
|
|
55
61
|
const SortableListItemOverlay = forwardRef((props, ref) => {
|
|
56
62
|
const { children, OverlayProps, ...rest } = props;
|
|
63
|
+
const { style: overlayStyle, zIndex: overlayZIndex, ...overlayProps } = OverlayProps ?? {};
|
|
57
64
|
const { active, activatorEvent } = useDndContext();
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
+
const { document } = useWindowContext();
|
|
66
|
+
const { scopeProps } = useTheme();
|
|
67
|
+
const isMousePointerActivator = activatorEvent != null &&
|
|
68
|
+
'pointerType' in activatorEvent &&
|
|
69
|
+
activatorEvent.pointerType === 'mouse';
|
|
70
|
+
return (jsx(Portal, { container: document?.body, children: jsx("div", { ...scopeProps, style: { display: 'contents' }, children: jsx(DragOverlay, { ...overlayProps, zIndex: overlayZIndex ?? SORTABLE_LIST_ITEM_OVERLAY_Z_INDEX, style: {
|
|
71
|
+
...overlayStyle,
|
|
72
|
+
pointerEvents: isMousePointerActivator ? 'none' : 'auto',
|
|
73
|
+
touchAction: 'none',
|
|
74
|
+
}, children: active && (jsx(ListItem, { ...rest, ref: ref, dragged: true, ...overlayVisualOnlyProps, tabIndex: undefined, children: typeof children === 'function'
|
|
75
|
+
? children(active.id)
|
|
76
|
+
: children })) }) }) }));
|
|
65
77
|
});
|
|
66
78
|
SortableListItemOverlay.displayName = 'SortableListItemOverlay';
|
|
67
79
|
|
package/SplitButton.js
CHANGED
package/SubMenu.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
|
-
import { forwardRef, useState,
|
|
3
|
-
import { useClasses, useForkRef,
|
|
2
|
+
import { forwardRef, useState, useCallback, useEffect, useRef } from 'react';
|
|
3
|
+
import { useClasses, useWindowContext, useForkRef, useId, useFocusVisible, useEventCallback } from '@ringcentral/spring-base';
|
|
4
4
|
import { a as useNestedParentMenu, N as NestedMenuContext } from './chunks/useNestedParentMenu.js';
|
|
5
5
|
import { Popper } from './Popper.js';
|
|
6
6
|
import { CaretRightMd } from '@ringcentral/spring-icon';
|
|
@@ -9,7 +9,7 @@ import { I as Icon } from './chunks/Icon.js';
|
|
|
9
9
|
import { S as SubMenuTriggerNestedIdContext, M as MenuItem } from './chunks/useMenuItemSelect.js';
|
|
10
10
|
import 'tabbable';
|
|
11
11
|
import './chunks/useListNavigation.js';
|
|
12
|
-
import './chunks/Menu.js';
|
|
12
|
+
import { b as useMenuOverlayGroupContext } from './chunks/Menu.js';
|
|
13
13
|
import './VirtualizedList.js';
|
|
14
14
|
import { useNestedChildMenu } from './NestedMenuContext.js';
|
|
15
15
|
import { u as useNestedMenuItem } from './chunks/useNestedMenuItem.js';
|
|
@@ -32,96 +32,237 @@ import './chunks/List.js';
|
|
|
32
32
|
var PopperMenu$1 = {"sui-popper-menu-root":"sui-popper-menu-root","sui-popper-menu-paper":"sui-popper-menu-paper"};
|
|
33
33
|
|
|
34
34
|
const PopperMenu = forwardRef((props, ref) => {
|
|
35
|
-
const { classes, children, actions, className, ...rest } = props;
|
|
35
|
+
const { classes, children, actions, className, onClickCapture, onPointerMove, ...rest } = props;
|
|
36
36
|
const cls = useClasses('popper-menu', classes, className);
|
|
37
|
-
const { contextValue } = useNestedParentMenu({
|
|
37
|
+
const { contentClickHandlers, contentPointerHandlers, contextValue } = useNestedParentMenu({
|
|
38
38
|
open: true,
|
|
39
39
|
});
|
|
40
|
-
return (jsx(Popper, { className: cls('root'), ...rest,
|
|
40
|
+
return (jsx(Popper, { className: cls('root'), ...rest, onClickCapture: (event) => {
|
|
41
|
+
onClickCapture?.(event);
|
|
42
|
+
contentClickHandlers.onClickCapture(event);
|
|
43
|
+
}, onPointerMove: (event) => {
|
|
44
|
+
onPointerMove?.(event);
|
|
45
|
+
contentPointerHandlers.onPointerMove(event);
|
|
46
|
+
}, ref: ref, children: jsx("div", { className: cls('paper'), children: jsx(NestedMenuContext.Provider, { value: contextValue, children: children }) }) }));
|
|
41
47
|
});
|
|
42
48
|
PopperMenu.displayName = 'SuiPopperMenu';
|
|
43
49
|
|
|
50
|
+
const useSubMenuInteractionState = ({ open, focusVisibleWithin, isPointerGraceActive, clearPointerGrace, }) => {
|
|
51
|
+
const [hasEnteredMenuContent, setHasEnteredMenuContent] = useState(false);
|
|
52
|
+
const [isPointerInsideTrigger, setIsPointerInsideTrigger] = useState(false);
|
|
53
|
+
const resetInteractionState = useCallback(() => {
|
|
54
|
+
setHasEnteredMenuContent(false);
|
|
55
|
+
setIsPointerInsideTrigger(false);
|
|
56
|
+
}, []);
|
|
57
|
+
const markTriggerPointerMoved = useCallback(() => {
|
|
58
|
+
setIsPointerInsideTrigger(true);
|
|
59
|
+
setHasEnteredMenuContent(false);
|
|
60
|
+
}, []);
|
|
61
|
+
const markTriggerPointerLeft = useCallback(() => {
|
|
62
|
+
setIsPointerInsideTrigger(false);
|
|
63
|
+
setHasEnteredMenuContent(false);
|
|
64
|
+
}, []);
|
|
65
|
+
const markMenuContentEntered = useCallback(() => {
|
|
66
|
+
setHasEnteredMenuContent(true);
|
|
67
|
+
clearPointerGrace();
|
|
68
|
+
}, [clearPointerGrace]);
|
|
69
|
+
const shouldKeepSubMenuOpen = isPointerInsideTrigger ||
|
|
70
|
+
hasEnteredMenuContent ||
|
|
71
|
+
focusVisibleWithin ||
|
|
72
|
+
isPointerGraceActive;
|
|
73
|
+
useEffect(() => {
|
|
74
|
+
if (!open) {
|
|
75
|
+
resetInteractionState();
|
|
76
|
+
}
|
|
77
|
+
}, [open, resetInteractionState]);
|
|
78
|
+
return {
|
|
79
|
+
markTriggerPointerLeft,
|
|
80
|
+
markTriggerPointerMoved,
|
|
81
|
+
markMenuContentEntered,
|
|
82
|
+
resetInteractionState,
|
|
83
|
+
shouldKeepSubMenuOpen,
|
|
84
|
+
};
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
const POINTER_GRACE_TIMEOUT = 300;
|
|
88
|
+
const POINTER_GRACE_BLEED = 5;
|
|
89
|
+
const getSubMenuSide = (anchorRect, menuRect) => {
|
|
90
|
+
const anchorCenterX = anchorRect.left + anchorRect.width / 2;
|
|
91
|
+
const menuCenterX = menuRect.left + menuRect.width / 2;
|
|
92
|
+
return menuCenterX >= anchorCenterX ? 'right' : 'left';
|
|
93
|
+
};
|
|
94
|
+
const getPointerGraceIntent = (event, menuRect, side) => {
|
|
95
|
+
const bleed = side === 'right' ? -POINTER_GRACE_BLEED : POINTER_GRACE_BLEED;
|
|
96
|
+
const contentNearEdge = menuRect[side === 'right' ? 'left' : 'right'];
|
|
97
|
+
const contentFarEdge = menuRect[side === 'right' ? 'right' : 'left'];
|
|
98
|
+
return {
|
|
99
|
+
area: [
|
|
100
|
+
{ x: event.clientX + bleed, y: event.clientY },
|
|
101
|
+
{ x: contentNearEdge, y: menuRect.top },
|
|
102
|
+
{ x: contentFarEdge, y: menuRect.top },
|
|
103
|
+
{ x: contentFarEdge, y: menuRect.bottom },
|
|
104
|
+
{ x: contentNearEdge, y: menuRect.bottom },
|
|
105
|
+
],
|
|
106
|
+
side,
|
|
107
|
+
};
|
|
108
|
+
};
|
|
109
|
+
const useSubMenuPointerGrace = (props) => {
|
|
110
|
+
const { isPointerMovingToSubMenu, onPointerGraceIntentChange } = props;
|
|
111
|
+
const { externalWindow, globalThis: contextGlobal } = useWindowContext();
|
|
112
|
+
const contextWindow = externalWindow ?? contextGlobal;
|
|
113
|
+
const [isPointerGraceActive, setIsPointerGraceActive] = useState(false);
|
|
114
|
+
const timerRef = useRef();
|
|
115
|
+
const clearPointerGrace = useCallback(() => {
|
|
116
|
+
contextWindow.clearTimeout(timerRef.current);
|
|
117
|
+
timerRef.current = undefined;
|
|
118
|
+
setIsPointerGraceActive(false);
|
|
119
|
+
onPointerGraceIntentChange?.(null);
|
|
120
|
+
}, [contextWindow, onPointerGraceIntentChange]);
|
|
121
|
+
const startPointerGrace = useCallback((event, anchorElement, menuElement) => {
|
|
122
|
+
if (!anchorElement || !menuElement) {
|
|
123
|
+
clearPointerGrace();
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
126
|
+
const menuRect = menuElement.getBoundingClientRect();
|
|
127
|
+
if (menuRect.width === 0 || menuRect.height === 0) {
|
|
128
|
+
clearPointerGrace();
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
const side = getSubMenuSide(anchorElement.getBoundingClientRect(), menuRect);
|
|
132
|
+
const intent = getPointerGraceIntent(event, menuRect, side);
|
|
133
|
+
const shouldActivateGrace = isPointerMovingToSubMenu?.(event, intent) ?? true;
|
|
134
|
+
contextWindow.clearTimeout(timerRef.current);
|
|
135
|
+
timerRef.current = undefined;
|
|
136
|
+
if (!shouldActivateGrace) {
|
|
137
|
+
clearPointerGrace();
|
|
138
|
+
return;
|
|
139
|
+
}
|
|
140
|
+
onPointerGraceIntentChange?.(intent);
|
|
141
|
+
setIsPointerGraceActive(true);
|
|
142
|
+
timerRef.current = contextWindow.setTimeout(clearPointerGrace, POINTER_GRACE_TIMEOUT);
|
|
143
|
+
}, [
|
|
144
|
+
clearPointerGrace,
|
|
145
|
+
contextWindow,
|
|
146
|
+
isPointerMovingToSubMenu,
|
|
147
|
+
onPointerGraceIntentChange,
|
|
148
|
+
]);
|
|
149
|
+
useEffect(() => {
|
|
150
|
+
return clearPointerGrace;
|
|
151
|
+
}, [clearPointerGrace]);
|
|
152
|
+
return {
|
|
153
|
+
isPointerGraceActive,
|
|
154
|
+
clearPointerGrace,
|
|
155
|
+
startPointerGrace,
|
|
156
|
+
};
|
|
157
|
+
};
|
|
158
|
+
|
|
159
|
+
const isSubMenuNavigationOpenEvent = (event) => ['ArrowRight'].includes(event.key);
|
|
160
|
+
const isSubMenuKeyboardActivationEvent = (event) => (event.type === 'keydown' && event.key === 'Enter') ||
|
|
161
|
+
(event.type === 'keyup' && event.key === ' ');
|
|
44
162
|
const SubMenu = forwardRef((inProps, ref) => {
|
|
45
163
|
const props = useThemeProps({ props: inProps, name: 'SubMenu' });
|
|
46
|
-
const { classes, children, itemContent, onKeyDown: onKeyDownProp, ...rest } = props;
|
|
47
|
-
const [menuMounted, setMenuMounted] = useState(false);
|
|
164
|
+
const { classes, children, itemContent, onClick: onClickProp, onKeyDown: onKeyDownProp, onPointerLeave: onPointerLeaveProp, onPointerMove: onPointerMoveProp, disabled, ...rest } = props;
|
|
48
165
|
const [anchor, setAnchor] = useState(null);
|
|
49
166
|
const itemRef = useRef(null);
|
|
50
167
|
const handleRef = useForkRef(itemRef, ref);
|
|
168
|
+
const menuRef = useRef(null);
|
|
51
169
|
const open = Boolean(anchor);
|
|
52
|
-
const
|
|
53
|
-
const
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
const { hover: anchorHover, hoverHandlers: anchorHoverHandlers } = useHover({
|
|
58
|
-
disableReactTree: false,
|
|
59
|
-
onMouseEnter: (e) => {
|
|
60
|
-
setAnchor(e.currentTarget);
|
|
61
|
-
},
|
|
170
|
+
const id = useId();
|
|
171
|
+
const { isPointerMovingToSubMenu, onPointerGraceIntentChange } = useNestedMenuItem({ id });
|
|
172
|
+
const { isPointerGraceActive, clearPointerGrace, startPointerGrace } = useSubMenuPointerGrace({
|
|
173
|
+
isPointerMovingToSubMenu,
|
|
174
|
+
onPointerGraceIntentChange,
|
|
62
175
|
});
|
|
63
|
-
const anchorHoverEverRef = useRef(false);
|
|
64
|
-
if (anchorHoverEverRef.current !== true) {
|
|
65
|
-
anchorHoverEverRef.current = anchorHover;
|
|
66
|
-
}
|
|
67
|
-
const { hover: menuHover, hoverHandlers: menuHoverHandlers } = useHover();
|
|
68
|
-
const menuHoverEverRef = useRef(false);
|
|
69
|
-
if (menuHoverEverRef.current !== true) {
|
|
70
|
-
menuHoverEverRef.current = menuHover;
|
|
71
|
-
}
|
|
72
176
|
const { focusVisibleWithin, focusVisibleHandlers } = useFocusVisible({
|
|
73
177
|
within: true,
|
|
74
178
|
});
|
|
75
|
-
const
|
|
76
|
-
|
|
179
|
+
const { markTriggerPointerLeft, markTriggerPointerMoved, markMenuContentEntered, resetInteractionState, shouldKeepSubMenuOpen, } = useSubMenuInteractionState({
|
|
180
|
+
open,
|
|
181
|
+
focusVisibleWithin,
|
|
182
|
+
isPointerGraceActive,
|
|
183
|
+
clearPointerGrace,
|
|
184
|
+
});
|
|
185
|
+
const closeSubMenu = useEventCallback((options) => {
|
|
186
|
+
if (options?.restoreFocus) {
|
|
187
|
+
itemRef.current?.focus();
|
|
188
|
+
}
|
|
189
|
+
clearPointerGrace();
|
|
190
|
+
resetInteractionState();
|
|
191
|
+
setAnchor(null);
|
|
192
|
+
});
|
|
193
|
+
const overlayGroupContext = useMenuOverlayGroupContext();
|
|
194
|
+
const overlayContainer = overlayGroupContext?.container;
|
|
195
|
+
const handleTriggerPointerMove = (event) => {
|
|
196
|
+
onPointerMoveProp?.(event);
|
|
197
|
+
if (event.pointerType !== 'mouse' || event.defaultPrevented || disabled) {
|
|
198
|
+
return;
|
|
199
|
+
}
|
|
200
|
+
if (open) {
|
|
201
|
+
markTriggerPointerMoved();
|
|
202
|
+
return;
|
|
203
|
+
}
|
|
204
|
+
markTriggerPointerMoved();
|
|
205
|
+
clearPointerGrace();
|
|
206
|
+
setAnchor(event.currentTarget);
|
|
207
|
+
};
|
|
208
|
+
const handleTriggerPointerLeave = (event) => {
|
|
209
|
+
onPointerLeaveProp?.(event);
|
|
210
|
+
if (event.pointerType === 'mouse') {
|
|
211
|
+
markTriggerPointerLeft();
|
|
212
|
+
startPointerGrace(event, itemRef.current, menuRef.current);
|
|
213
|
+
}
|
|
214
|
+
};
|
|
215
|
+
const openSubMenuFromTrigger = (trigger) => {
|
|
216
|
+
markMenuContentEntered();
|
|
217
|
+
setAnchor(trigger);
|
|
218
|
+
};
|
|
219
|
+
const getAnchorElement = useCallback(() => itemRef.current, []);
|
|
77
220
|
useNestedChildMenu({
|
|
78
221
|
open,
|
|
79
|
-
closeMenu:
|
|
222
|
+
closeMenu: closeSubMenu,
|
|
223
|
+
getAnchorElement,
|
|
80
224
|
id,
|
|
81
225
|
});
|
|
82
|
-
const shouldKeepMenu = (() => {
|
|
83
|
-
if (!open)
|
|
84
|
-
return false;
|
|
85
|
-
if (!menuMounted)
|
|
86
|
-
return true;
|
|
87
|
-
if (focusVisibleWithin)
|
|
88
|
-
return true;
|
|
89
|
-
return menuHover || anchorHover;
|
|
90
|
-
})();
|
|
91
226
|
useEffect(() => {
|
|
92
|
-
if (!
|
|
227
|
+
if (!open)
|
|
228
|
+
return;
|
|
229
|
+
if (!shouldKeepSubMenuOpen) {
|
|
93
230
|
closeSubMenu();
|
|
94
231
|
}
|
|
95
|
-
}, [
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
restoreFocusOnCloseRef.current = false;
|
|
101
|
-
}
|
|
102
|
-
}, [open]);
|
|
103
|
-
useEffect(() => {
|
|
104
|
-
if (!open) {
|
|
105
|
-
setMenuMounted(false);
|
|
106
|
-
menuHoverEverRef.current = false;
|
|
107
|
-
anchorHoverEverRef.current = false;
|
|
108
|
-
}
|
|
109
|
-
}, [open]);
|
|
110
|
-
return (jsxs(Fragment, { children: [jsx(SubMenuTriggerNestedIdContext.Provider, { value: id, children: jsxs(MenuItem, { autoClose: false, ...rest, onKeyDown: (e) => {
|
|
232
|
+
}, [closeSubMenu, open, shouldKeepSubMenuOpen]);
|
|
233
|
+
return (jsxs(Fragment, { children: [jsx(SubMenuTriggerNestedIdContext.Provider, { value: id, children: jsxs(MenuItem, { "aria-haspopup": "menu", ...rest, "aria-expanded": open, autoClose: false, disabled: disabled, onKeyDown: (e) => {
|
|
234
|
+
if (disabled) {
|
|
235
|
+
return;
|
|
236
|
+
}
|
|
111
237
|
onKeyDownProp?.(e);
|
|
112
|
-
if (e.
|
|
113
|
-
|
|
238
|
+
if (e.defaultPrevented) {
|
|
239
|
+
return;
|
|
114
240
|
}
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
241
|
+
if (isSubMenuNavigationOpenEvent(e)) {
|
|
242
|
+
openSubMenuFromTrigger(e.currentTarget);
|
|
243
|
+
}
|
|
244
|
+
}, onClick: (e) => {
|
|
245
|
+
if (disabled) {
|
|
246
|
+
return;
|
|
247
|
+
}
|
|
248
|
+
onClickProp?.(e);
|
|
249
|
+
if (e.defaultPrevented) {
|
|
250
|
+
return;
|
|
251
|
+
}
|
|
252
|
+
if (isSubMenuKeyboardActivationEvent(e)) {
|
|
253
|
+
openSubMenuFromTrigger(e.currentTarget);
|
|
254
|
+
}
|
|
255
|
+
}, onPointerMove: handleTriggerPointerMove, onPointerLeave: handleTriggerPointerLeave, ref: handleRef, children: [typeof itemContent === 'string' ? (jsx(MenuItemText, { children: itemContent })) : (itemContent), jsx(Icon, { symbol: CaretRightMd })] }) }), open && (jsx(PopperMenu, { anchorEl: anchor, container: overlayContainer ?? undefined, disablePortal: overlayContainer ? false : undefined, placement: "right-start", offset: -4, ref: menuRef, onKeyDown: (e) => {
|
|
119
256
|
if ((e.key === 'ArrowLeft' || e.key === 'Escape') &&
|
|
120
257
|
e.currentTarget.contains(e.target)) {
|
|
121
258
|
e.stopPropagation();
|
|
122
259
|
closeSubMenu({ restoreFocus: true });
|
|
123
260
|
}
|
|
124
|
-
},
|
|
261
|
+
}, onPointerMove: (event) => {
|
|
262
|
+
if (event.pointerType === 'mouse') {
|
|
263
|
+
markMenuContentEntered();
|
|
264
|
+
}
|
|
265
|
+
}, ...focusVisibleHandlers, children: children }))] }));
|
|
125
266
|
});
|
|
126
267
|
SubMenu.displayName = 'SuiSubMenu';
|
|
127
268
|
|
package/SwipeableDrawer.js
CHANGED
|
@@ -392,15 +392,7 @@ function useDrawerGestures(options) {
|
|
|
392
392
|
heightRef.current = safeInitial;
|
|
393
393
|
animationRef.current = animate(heightMotionValue, safeInitial, SPRING_CONFIG);
|
|
394
394
|
didInitRef.current = true;
|
|
395
|
-
}, [
|
|
396
|
-
open,
|
|
397
|
-
ready,
|
|
398
|
-
isContentPresent,
|
|
399
|
-
defaultSnap,
|
|
400
|
-
minSnap,
|
|
401
|
-
heightMotionValue,
|
|
402
|
-
lastSnapRef.current,
|
|
403
|
-
]);
|
|
395
|
+
}, [open, ready, isContentPresent, defaultSnap, minSnap, heightMotionValue]);
|
|
404
396
|
useLayoutEffect(() => {
|
|
405
397
|
if (!open || !ready || !isContentPresent)
|
|
406
398
|
return;
|
package/Switch.js
CHANGED
|
@@ -1,18 +1,21 @@
|
|
|
1
1
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { forwardRef, useRef, useLayoutEffect } from 'react';
|
|
3
3
|
import { useSwitch } from '@mui/base';
|
|
4
|
-
import { useClasses, useForkRef } from '@ringcentral/spring-base';
|
|
4
|
+
import { useClasses, useForkRef, combineProps } from '@ringcentral/spring-base';
|
|
5
5
|
import { useThemeProps } from '@ringcentral/spring-theme';
|
|
6
6
|
import { u as useFormLabel } from './chunks/FormLabel.js';
|
|
7
|
+
import { C as CircularProgressIndicator } from './chunks/CircularProgressIndicator.js';
|
|
8
|
+
import 'clsx';
|
|
7
9
|
|
|
8
10
|
var Switch$1 = {"sui-switch-root":"sui-switch-root","sui-focus-visible":"sui-focus-visible","sui-switch-track":"sui-switch-track","sui-switch-dot":"sui-switch-dot","sui-switch-input":"sui-switch-input","sui-checked":"sui-checked"};
|
|
9
11
|
|
|
10
12
|
const Switch = forwardRef((inProps, ref) => {
|
|
11
13
|
const props = useThemeProps({ props: inProps, name: 'Switch' });
|
|
12
|
-
const { classes, className, inputRef: inputRefProp, inputProps: inputPropsProp, rootProps, checked: checkedProp, defaultChecked, disabled: disabledProp, autoFocus = false, onBlur, onChange, onFocus, onFocusVisible, required, ...rest } = props;
|
|
14
|
+
const { classes, className, inputRef: inputRefProp, inputProps: inputPropsProp, rootProps, checked: checkedProp, defaultChecked, disabled: disabledProp, autoFocus = false, onBlur, onChange, onFocus, onFocusVisible, required, loading = false, loadingProps, ...rest } = props;
|
|
13
15
|
const cls = useClasses('switch', classes, className);
|
|
16
|
+
const isDisabled = loading ? true : disabledProp;
|
|
14
17
|
const { disabled, id } = useFormLabel({
|
|
15
|
-
disabled:
|
|
18
|
+
disabled: isDisabled,
|
|
16
19
|
id: inputPropsProp?.id,
|
|
17
20
|
});
|
|
18
21
|
const { getInputProps, focusVisible, checked } = useSwitch({
|
|
@@ -25,7 +28,10 @@ const Switch = forwardRef((inProps, ref) => {
|
|
|
25
28
|
onFocusVisible,
|
|
26
29
|
required,
|
|
27
30
|
});
|
|
28
|
-
const inputProps = getInputProps({
|
|
31
|
+
const inputProps = getInputProps({
|
|
32
|
+
role: 'switch',
|
|
33
|
+
...inputPropsProp,
|
|
34
|
+
});
|
|
29
35
|
const inputRef = useRef();
|
|
30
36
|
const forkRef = useForkRef(inputRefProp, inputProps.ref, inputRef);
|
|
31
37
|
useLayoutEffect(() => {
|
|
@@ -33,7 +39,11 @@ const Switch = forwardRef((inProps, ref) => {
|
|
|
33
39
|
inputRef.current?.focus();
|
|
34
40
|
}
|
|
35
41
|
}, []);
|
|
36
|
-
return (jsxs("span", { ...rootProps, ...rest, className: cls('root', { focusVisible }), ref: ref, children: [jsx("input", { ...inputProps, id: id, className: cls('input', { checked }), ref: forkRef }), jsx("span", { className: cls('track') }), jsx("span", { className: cls('dot')
|
|
42
|
+
return (jsxs("span", { ...rootProps, ...rest, className: cls('root', { focusVisible }), ref: ref, children: [jsx("input", { ...inputProps, id: id, className: cls('input', { checked }), ref: forkRef }), jsx("span", { className: cls('track') }), jsx("span", { className: cls('dot'), children: loading && (jsx(CircularProgressIndicator, { ...combineProps({
|
|
43
|
+
variant: 'indeterminate',
|
|
44
|
+
size: 'small',
|
|
45
|
+
color: 'primary',
|
|
46
|
+
}, loadingProps) })) })] }));
|
|
37
47
|
});
|
|
38
48
|
Switch.displayName = 'SuiSwitch';
|
|
39
49
|
|
package/TablePagination.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
-
import { useClasses, useEventCallback
|
|
2
|
+
import { combineProps, useClasses, useEventCallback } from '@ringcentral/spring-base';
|
|
3
3
|
import { CaretLeftMd, CaretRightMd } from '@ringcentral/spring-icon';
|
|
4
4
|
import { useThemeProps } from '@ringcentral/spring-theme';
|
|
5
5
|
import { forwardRef } from 'react';
|
|
@@ -40,13 +40,17 @@ import './chunks/useHelperTextId.js';
|
|
|
40
40
|
import './chunks/MenuList.js';
|
|
41
41
|
import './chunks/VirtualizedMenu.js';
|
|
42
42
|
|
|
43
|
-
var TablePagination$1 = {"sui-table-pagination-content":"sui-table-pagination-content","sui-table-pagination-rows-per-page-controls":"sui-table-pagination-rows-per-page-controls","sui-table-pagination-rows-per-page-label":"sui-table-pagination-rows-per-page-label","sui-table-pagination-current-page-controls":"sui-table-pagination-current-page-controls","sui-table-pagination-range-container":"sui-table-pagination-range-container"};
|
|
43
|
+
var TablePagination$1 = {"sui-table-pagination-content":"sui-table-pagination-content","sui-table-pagination-selector":"sui-table-pagination-selector","sui-table-pagination-rows-per-page-controls":"sui-table-pagination-rows-per-page-controls","sui-table-pagination-rows-per-page-label":"sui-table-pagination-rows-per-page-label","sui-table-pagination-current-page-controls":"sui-table-pagination-current-page-controls","sui-table-pagination-range-container":"sui-table-pagination-range-container"};
|
|
44
44
|
|
|
45
45
|
const TablePagination = forwardRef((inProps, ref) => {
|
|
46
|
-
const { classes, className, component: Root = 'td', colSpan = 1000, page, variant = 'range', count = -1, rowsPerPage = 10, rowsPerPageLabel = 'Rows per page', rowsPerPageOptions = [10, 25, 50, 100], onRowsPerPageChange, rangeSeparatorLabel = 'of', previousPageButtonProps, nextPageButtonProps, onPageChange, ...rest } = useThemeProps({
|
|
46
|
+
const { classes, className, component: Root = 'td', colSpan = 1000, page, variant = 'range', count = -1, rowsPerPage = 10, rowsPerPageLabel = 'Rows per page', rowsPerPageOptions = [10, 25, 50, 100], onRowsPerPageChange, rangeSeparatorLabel = 'of', previousPageButtonProps, nextPageButtonProps, selectorProps, MenuProps, onPageChange, ...rest } = useThemeProps({
|
|
47
47
|
props: inProps,
|
|
48
48
|
name: 'TablePagination',
|
|
49
49
|
});
|
|
50
|
+
const mergedSelectMenuProps = combineProps({
|
|
51
|
+
PopperProps: { matchAnchorWidth: false },
|
|
52
|
+
classes: { paper: 'min-w-16' },
|
|
53
|
+
}, MenuProps);
|
|
50
54
|
const rootProps = {
|
|
51
55
|
...rest,
|
|
52
56
|
};
|
|
@@ -89,25 +93,11 @@ const TablePagination = forwardRef((inProps, ref) => {
|
|
|
89
93
|
onRowsPerPageChange?.(e, child);
|
|
90
94
|
});
|
|
91
95
|
return (jsx(Root, { className: cls('root'), ...rootProps, ref: ref, children: jsxs("div", { className: cls('content'), children: [variant === 'page-size' && (jsxs("div", { className: cls('rows-per-page-controls'), children: [jsx("span", { className: cls('rows-per-page-label'), children: rowsPerPageLabel }), jsx(Select, { value: rowsPerPage, variant: "outlined", size: "medium", classes: {
|
|
92
|
-
selector: '
|
|
93
|
-
}, MenuProps: {
|
|
94
|
-
PopperProps: {
|
|
95
|
-
matchAnchorWidth: false,
|
|
96
|
-
},
|
|
97
|
-
classes: {
|
|
98
|
-
paper: 'min-w-16',
|
|
99
|
-
},
|
|
100
|
-
}, onChange: handleRowsPerPageChange, children: rowsPerPageOptions?.map((option) => (jsx(Option, { value: option, children: jsx(MenuItemText, { children: option }) }, option))) })] })), jsxs("div", { className: cls('range-container'), children: [variant === 'select-page' && (jsx(Select, { value: page, variant: "outlined", size: "medium", classes: {
|
|
96
|
+
selector: cls('selector'),
|
|
97
|
+
}, selectorProps: selectorProps, MenuProps: mergedSelectMenuProps, onChange: handleRowsPerPageChange, children: rowsPerPageOptions?.map((option) => (jsx(Option, { value: option, children: jsx(MenuItemText, { children: option }) }, option))) })] })), jsxs("div", { className: cls('range-container'), children: [variant === 'select-page' && (jsx(Select, { value: page, variant: "outlined", size: "medium", classes: {
|
|
101
98
|
content: 'mr-0.5',
|
|
102
|
-
selector: '
|
|
103
|
-
}, MenuProps:
|
|
104
|
-
PopperProps: {
|
|
105
|
-
matchAnchorWidth: false,
|
|
106
|
-
},
|
|
107
|
-
classes: {
|
|
108
|
-
paper: 'min-w-16',
|
|
109
|
-
},
|
|
110
|
-
}, renderValue: (value) => value + 1, onChange: handleSelectPageChange, children: Array(totalPages)
|
|
99
|
+
selector: cls('selector'),
|
|
100
|
+
}, selectorProps: selectorProps, MenuProps: mergedSelectMenuProps, renderValue: (value) => value + 1, onChange: handleSelectPageChange, children: Array(totalPages)
|
|
111
101
|
.fill(totalPages)
|
|
112
102
|
.map((_, i) => (jsx(Option, { value: i, children: jsx(MenuItemText, { children: i + 1 }) }, i))) })), showRowRange && jsx("span", { children: `${startOfRange}-${endOfRange}` }), jsx("span", { children: rangeSeparatorLabel }), jsx("span", { children: total })] }), jsxs("div", { className: cls('current-page-controls'), children: [jsx(IconButton, { shape: "squircle", color: "secondary", variant: "contained", size: "small", symbol: CaretLeftMd, background: false, disabled: !hasPreviousPage, ...combineProps({
|
|
113
103
|
onClick: handlePreviousPageButtonClick,
|
package/TableRow.js
CHANGED
|
@@ -13,7 +13,7 @@ const TableRow = forwardRef((inProps, ref) => {
|
|
|
13
13
|
const cls = useClasses('table-row', classes, className);
|
|
14
14
|
const tablelvl2 = useTablelvl2Context();
|
|
15
15
|
const variant = (tablelvl2 && tablelvl2.variant) || 'body';
|
|
16
|
-
const clickable = clickableProp !== false && rest.onClick ? true : clickableProp ?? false;
|
|
16
|
+
const clickable = clickableProp !== false && rest.onClick ? true : (clickableProp ?? false);
|
|
17
17
|
const { getRootProps, focusVisible, active } = useButton({
|
|
18
18
|
...props,
|
|
19
19
|
disabled: !clickable,
|