@ringcentral/spring-ui 1.9.2 → 1.11.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 +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 +4 -3
- 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 +208 -77
- 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 +49 -17
- 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 +22 -5
- package/src/NestedMenuContext/SubMenuTriggerNestedIdContext.d.ts +2 -0
- package/src/NestedMenuContext/pointerGrace.d.ts +8 -0
- package/src/NestedMenuContext/useNestedChildMenu.d.ts +4 -2
- 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/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,
|
package/Text.js
CHANGED
|
@@ -17,7 +17,7 @@ import './chunks/useFocusTrapStack.js';
|
|
|
17
17
|
import './chunks/Backdrop.js';
|
|
18
18
|
import './chunks/PopperPaper.js';
|
|
19
19
|
|
|
20
|
-
var Text$1 = {"sui-text-root":"sui-text-root","sui-text-no-wrap":"sui-text-no-wrap","sui-text-
|
|
20
|
+
var Text$1 = {"sui-text-root":"sui-text-root","sui-text-no-wrap":"sui-text-no-wrap","sui-text-highlight-term":"sui-text-highlight-term"};
|
|
21
21
|
|
|
22
22
|
const Text = forwardRef((inProps, ref) => {
|
|
23
23
|
const props = useThemeProps({ props: inProps, name: 'Text' });
|
|
@@ -31,7 +31,7 @@ const Text = forwardRef((inProps, ref) => {
|
|
|
31
31
|
const cls = useClasses('text', {}, className);
|
|
32
32
|
const title = isShowTitle || useTooltip
|
|
33
33
|
?
|
|
34
|
-
_title ?? (isString(children) ? children : undefined)
|
|
34
|
+
(_title ?? (isString(children) ? children : undefined))
|
|
35
35
|
: undefined;
|
|
36
36
|
const showTooltip = Boolean(useTooltip) && isShowTitle && !!title && !!children;
|
|
37
37
|
if (!showTooltip) {
|
package/Textarea.js
CHANGED
|
@@ -24,7 +24,7 @@ import './chunks/useFocusTrapStack.js';
|
|
|
24
24
|
import './chunks/Backdrop.js';
|
|
25
25
|
import './chunks/PopperPaper.js';
|
|
26
26
|
|
|
27
|
-
var Textarea$1 = {"sui-textarea-form-field-content":"sui-textarea-form-field-content","sui-textarea-form-field-content-xlarge":"sui-textarea-form-field-content-xlarge","sui-textarea-form-field-content-large":"sui-textarea-form-field-content-large","sui-textarea-form-field-content-medium":"sui-textarea-form-field-content-medium","sui-textarea-input":"sui-textarea-input","sui-textarea-input-xlarge":"sui-textarea-input-xlarge","sui-textarea-input-large":"sui-textarea-input-large","sui-textarea-input-medium":"sui-textarea-input-medium","sui-textarea-standard-input":"sui-textarea-standard-input","sui-textarea-clear
|
|
27
|
+
var Textarea$1 = {"sui-textarea-form-field-content":"sui-textarea-form-field-content","sui-textarea-form-field-content-xlarge":"sui-textarea-form-field-content-xlarge","sui-textarea-form-field-content-large":"sui-textarea-form-field-content-large","sui-textarea-form-field-content-medium":"sui-textarea-form-field-content-medium","sui-textarea-input":"sui-textarea-input","sui-textarea-clear":"sui-textarea-clear","sui-textarea-input-xlarge":"sui-textarea-input-xlarge","sui-textarea-input-large":"sui-textarea-input-large","sui-textarea-input-medium":"sui-textarea-input-medium","sui-textarea-standard-input":"sui-textarea-standard-input","sui-textarea-clear-xlarge":"sui-textarea-clear-xlarge","sui-textarea-clear-large":"sui-textarea-clear-large","sui-textarea-clear-medium":"sui-textarea-clear-medium","sui-textarea-clear-standard":"sui-textarea-clear-standard"};
|
|
28
28
|
|
|
29
29
|
const Textarea = forwardRef((inProps, ref) => {
|
|
30
30
|
const props = useThemeProps({ props: inProps, name: 'Textarea' });
|
package/TimePicker.js
CHANGED
|
@@ -22,10 +22,10 @@ import './chunks/Backdrop.js';
|
|
|
22
22
|
import './chunks/PopperPaper.js';
|
|
23
23
|
import './chunks/Popover.js';
|
|
24
24
|
import './chunks/getGrow.js';
|
|
25
|
+
import './chunks/useHelperTextId.js';
|
|
25
26
|
import './chunks/TextField.js';
|
|
26
27
|
import './chunks/ShowHideEye.js';
|
|
27
28
|
import './chunks/useMotionSafeTransition.js';
|
|
28
|
-
import './chunks/useHelperTextId.js';
|
|
29
29
|
import './chunks/VisuallyHidden.js';
|
|
30
30
|
|
|
31
31
|
const TimePickerClassesContext = createContext(() => '');
|
package/chunks/Alert.js
CHANGED
package/chunks/Drawer.js
CHANGED
|
@@ -23,7 +23,7 @@ const Drawer = forwardRef((inProps, ref) => {
|
|
|
23
23
|
toggleOnTransition: motionTransition['neutral-01-fast'],
|
|
24
24
|
toggleOffTransition: motionTransition['neutral-01-fast'],
|
|
25
25
|
});
|
|
26
|
-
return (jsx(Modal, { open: open, onClose: onClose, blocking: blocking,
|
|
26
|
+
return (jsx(Modal, { open: open, onClose: onClose, blocking: blocking, className: clsx(cls('root', `anchor-${anchor}`, {
|
|
27
27
|
'non-blocking': !blocking,
|
|
28
28
|
})), ...rest, children: jsxs(motion.div, { role: "dialog", "aria-modal": blocking, ...slideInProps, ...bodyProps, ref: ref, className: clsx(cls('body', `body-${anchor}`), bodyProps?.className), tabIndex: blocking ? -1 : undefined, children: [header && (jsx("div", { ref: headerRef, ...headerProps, className: clsx(cls('header'), headerProps?.className), children: header })), jsx("div", { ref: contentRef, className: cls('content'), children: children }), footer && (jsx("div", { ref: footerRef, className: cls('footer'), children: footer }))] }) }));
|
|
29
29
|
});
|
package/chunks/Menu.js
CHANGED
|
@@ -1,10 +1,28 @@
|
|
|
1
|
-
import { jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { createContext, useContext,
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
+
import { createContext, useContext, useState, useMemo, forwardRef } from 'react';
|
|
3
3
|
import { useEventCallback } from '@ringcentral/spring-base';
|
|
4
4
|
import { useThemeProps, useClassesWithMode } from '@ringcentral/spring-theme';
|
|
5
5
|
import { a as useNestedParentMenu, N as NestedMenuContext } from './useNestedParentMenu.js';
|
|
6
6
|
import { P as Popover } from './Popover.js';
|
|
7
7
|
|
|
8
|
+
const overlayContainerStyle = {
|
|
9
|
+
display: 'contents',
|
|
10
|
+
};
|
|
11
|
+
const MenuOverlayGroupContext = createContext(null);
|
|
12
|
+
const useMenuOverlayGroupContext = () => useContext(MenuOverlayGroupContext);
|
|
13
|
+
const useMenuOverlayGroupValue = () => {
|
|
14
|
+
const [container, setContainer] = useState(null);
|
|
15
|
+
const value = useMemo(() => ({ container }), [container]);
|
|
16
|
+
return {
|
|
17
|
+
setContainer,
|
|
18
|
+
value,
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
const MenuOverlayGroupContainer = (props) => {
|
|
22
|
+
const { setContainer } = props;
|
|
23
|
+
return (jsx("div", { "data-sui-menu-overlay-container": "", ref: setContainer, style: overlayContainerStyle }));
|
|
24
|
+
};
|
|
25
|
+
|
|
8
26
|
const MenuContext = createContext(null);
|
|
9
27
|
const useMenuContext = () => {
|
|
10
28
|
return useContext(MenuContext);
|
|
@@ -22,10 +40,11 @@ const Menu = forwardRef((inProps, ref) => {
|
|
|
22
40
|
bottom: padding.bottom ?? 16,
|
|
23
41
|
left: padding.left ?? 16,
|
|
24
42
|
}
|
|
25
|
-
: padding ?? 16;
|
|
26
|
-
const { contextValue } = useNestedParentMenu({
|
|
43
|
+
: (padding ?? 16);
|
|
44
|
+
const { contentClickHandlers, contentPointerHandlers, contextValue } = useNestedParentMenu({
|
|
27
45
|
open,
|
|
28
46
|
});
|
|
47
|
+
const { setContainer: setOverlayContainer, value: overlayGroupValue } = useMenuOverlayGroupValue();
|
|
29
48
|
const closeHandler = useEventCallback(() => {
|
|
30
49
|
onClose?.(undefined, 'Other');
|
|
31
50
|
});
|
|
@@ -35,8 +54,8 @@ const Menu = forwardRef((inProps, ref) => {
|
|
|
35
54
|
}, [autoFocus, closeHandler, open]);
|
|
36
55
|
return (jsx(Popover, { bordered: true, className: cls('root'), PopperProps: { ...PopperProps, padding: popperPadding }, ...rest, open: open, onClose: (e, reason) => {
|
|
37
56
|
onClose?.(e, reason);
|
|
38
|
-
}, ref: ref, children: jsx("div", { className: cls('paper'), children: jsx(MenuContext.Provider, { value: menuContextValue, children: jsx(NestedMenuContext.Provider, { value: contextValue, children: children }) }) }) }));
|
|
57
|
+
}, ref: ref, children: jsxs(MenuOverlayGroupContext.Provider, { value: overlayGroupValue, children: [jsx("div", { className: cls('paper'), onClickCapture: contentClickHandlers.onClickCapture, onPointerMove: contentPointerHandlers.onPointerMove, children: jsx(MenuContext.Provider, { value: menuContextValue, children: jsx(NestedMenuContext.Provider, { value: contextValue, children: children }) }) }), jsx(MenuOverlayGroupContainer, { setContainer: setOverlayContainer })] }) }));
|
|
39
58
|
});
|
|
40
59
|
Menu.displayName = 'SuiMenu';
|
|
41
60
|
|
|
42
|
-
export { Menu as M, MenuContext as a, useMenuContext as u };
|
|
61
|
+
export { Menu as M, MenuContext as a, useMenuOverlayGroupContext as b, useMenuContext as u };
|
package/chunks/Modal.js
CHANGED
|
@@ -14,7 +14,10 @@ const ModalContext = createContext(null);
|
|
|
14
14
|
const useModalContext = () => useContext(ModalContext);
|
|
15
15
|
|
|
16
16
|
const InnerModal = forwardRef((props, ref) => {
|
|
17
|
-
const { hideBackdrop, children, motionProps, disableBackdropClick
|
|
17
|
+
const { hideBackdrop: hideBackdropProp, children, motionProps, disableBackdropClick: disableBackdropClickProp, onBackdropClick, disableEscapeKeyDown: disableEscapeKeyDownProp, onEscapeKeyDown, onClose, onKeyDown, disableAutoFocus, disableEnforceFocus, disableRestoreFocus, classes, className, backdropProps, open, isEnabled, blocking = true, ...rest } = props;
|
|
18
|
+
const hideBackdrop = hideBackdropProp ?? !blocking;
|
|
19
|
+
const disableBackdropClick = disableBackdropClickProp ?? !blocking;
|
|
20
|
+
const disableEscapeKeyDown = disableEscapeKeyDownProp ?? !blocking;
|
|
18
21
|
const { ariaHideOutsideRef, ariaHideEnabled } = useAriaHideOutside({
|
|
19
22
|
enable: blocking,
|
|
20
23
|
});
|
|
@@ -45,7 +48,8 @@ InnerModal.displayName = 'SuiInnerModal';
|
|
|
45
48
|
|
|
46
49
|
const Modal = forwardRef((inProps, ref) => {
|
|
47
50
|
const props = useThemeProps({ props: inProps, name: 'Modal' });
|
|
48
|
-
const { children, open, container: containerProp, disablePortal, onExitComplete, disableBackdropAnimation, motionProps, disableScrollLock =
|
|
51
|
+
const { children, open, container: containerProp, disablePortal, onExitComplete, disableBackdropAnimation, motionProps, disableScrollLock: disableScrollLockProp, blocking = true, ...rest } = props;
|
|
52
|
+
const disableScrollLock = disableScrollLockProp ?? !blocking;
|
|
49
53
|
const [shouldRender, setShouldRender] = useState(open);
|
|
50
54
|
const [modalElement, setModalElement] = useState(null);
|
|
51
55
|
const handleRef = useForkRef(setModalElement, ref);
|
|
@@ -74,7 +78,7 @@ const Modal = forwardRef((inProps, ref) => {
|
|
|
74
78
|
setShouldRender(false);
|
|
75
79
|
}
|
|
76
80
|
};
|
|
77
|
-
return shouldRender ? (jsx(Portal, { disablePortal: disablePortal, container: container, children: jsx("div", { ...scopeProps, children: jsx(InnerModal, { ...rest, ref: handleRef, open: open, isEnabled: isEnabled, motionProps: {
|
|
81
|
+
return shouldRender ? (jsx(Portal, { disablePortal: disablePortal, container: container, children: jsx("div", { ...scopeProps, children: jsx(InnerModal, { ...rest, ref: handleRef, open: open, blocking: blocking, isEnabled: isEnabled, motionProps: {
|
|
78
82
|
...(motionProps ?? getFade({ prefersReducedMotion, toggle: open })),
|
|
79
83
|
onAnimationComplete,
|
|
80
84
|
}, children: children }) }) })) : null;
|
|
@@ -3,20 +3,31 @@ import { forwardRef, useState, useRef, useImperativeHandle, useMemo } from 'reac
|
|
|
3
3
|
import { useId, useClasses, useForkRef, useA11yKeyEvent, useEventCallback, combineClasses } from '@ringcentral/spring-base';
|
|
4
4
|
import { I as Icon } from './Icon.js';
|
|
5
5
|
import { P as Popover } from './Popover.js';
|
|
6
|
+
import { u as useHelperTextId } from './useHelperTextId.js';
|
|
6
7
|
import { T as TextField } from './TextField.js';
|
|
7
8
|
import { V as VisuallyHidden } from './VisuallyHidden.js';
|
|
8
9
|
|
|
9
10
|
const PICKER_DISPLAY_NAME = 'SuiPickerTextField';
|
|
10
11
|
const PickerTextField = forwardRef((props, ref) => {
|
|
11
|
-
const { disabled, value, defaultValue, onClear, action, inputProps = {}, announcementText, PopoverProps, children, endIconSymbol, clearText, clearBtn, ClearButtonProps, onKeyDown, onClick, onClose, classes, textInputClasses, className, ...rest } = props;
|
|
12
|
-
const
|
|
12
|
+
const { disabled, value, defaultValue, onClear, action, inputProps = {}, announcementText, PopoverProps, children, endIconSymbol, clearText, clearBtn, ClearButtonProps, onKeyDown, onClick, onClose, classes, textInputClasses, className, id: idProp, ...rest } = props;
|
|
13
|
+
const generatedId = useId(PICKER_DISPLAY_NAME, true);
|
|
14
|
+
const idForInput = idProp ?? inputProps.id ?? generatedId;
|
|
13
15
|
const [open, setOpen] = useState(false);
|
|
14
16
|
const [isPopoverExited, setIsPopoverExited] = useState(!open);
|
|
15
17
|
const cls = useClasses('picker-text-field', classes, className);
|
|
16
18
|
const anchorRef = useRef(null);
|
|
17
19
|
const handleRef = useForkRef(ref, anchorRef);
|
|
18
|
-
const idForHelperText =
|
|
19
|
-
|
|
20
|
+
const idForHelperText = useHelperTextId({
|
|
21
|
+
helperText: rest.helperText,
|
|
22
|
+
id: idForInput,
|
|
23
|
+
FormHelperTextProps: rest.FormHelperTextProps,
|
|
24
|
+
});
|
|
25
|
+
const idForInstruction = announcementText
|
|
26
|
+
? `${idForInput}-instruction`
|
|
27
|
+
: undefined;
|
|
28
|
+
const ariaDescribedBy = Array.from(new Set([inputProps['aria-describedby'], idForHelperText, idForInstruction]
|
|
29
|
+
.filter(Boolean)
|
|
30
|
+
.flatMap((value) => `${value}`.split(/\s+/).filter(Boolean)))).join(' ');
|
|
20
31
|
const handleA11yKeydown = useA11yKeyEvent(() => {
|
|
21
32
|
handleOpen(true);
|
|
22
33
|
});
|
|
@@ -43,7 +54,7 @@ const PickerTextField = forwardRef((props, ref) => {
|
|
|
43
54
|
}),
|
|
44
55
|
input: cls('input'),
|
|
45
56
|
}), [cls, textInputClasses, value]);
|
|
46
|
-
return (jsxs(Fragment, { children: [jsx(TextField, { classes: toClasses, value: value, defaultValue: defaultValue, endAdornment: endIconSymbol && (jsx(Icon, { className: cls('end-icon'), symbol: endIconSymbol })), id: idForInput, ref: handleRef, focused: open || (!open && !isPopoverExited), disabled: disabled, clearBtn: clearBtn, onClick: (e) => {
|
|
57
|
+
return (jsxs(Fragment, { children: [jsx(TextField, { classes: toClasses, value: value, defaultValue: defaultValue, endAdornment: endIconSymbol && (jsx(Icon, { className: cls('end-icon'), symbol: endIconSymbol })), id: idForInput, ref: handleRef, focused: open || (!open && !isPopoverExited), disabled: disabled, clearBtn: clearBtn, clearText: clearText, ClearButtonProps: ClearButtonProps, onClick: (e) => {
|
|
47
58
|
handleOpen(true);
|
|
48
59
|
onClick?.(e);
|
|
49
60
|
}, onKeyDown: (e) => {
|
|
@@ -52,9 +63,9 @@ const PickerTextField = forwardRef((props, ref) => {
|
|
|
52
63
|
handleA11yKeydown(e);
|
|
53
64
|
onKeyDown?.(e);
|
|
54
65
|
}, inputProps: {
|
|
55
|
-
'aria-describedby': `${idForHelperText} ${idForInstruction}`,
|
|
56
66
|
'aria-haspopup': true,
|
|
57
67
|
...inputProps,
|
|
68
|
+
'aria-describedby': ariaDescribedBy || undefined,
|
|
58
69
|
}, ...rest, readOnly: true, onClear: (e) => {
|
|
59
70
|
onClear?.(e);
|
|
60
71
|
e.stopPropagation();
|
|
@@ -67,7 +78,7 @@ const PickerTextField = forwardRef((props, ref) => {
|
|
|
67
78
|
}, ...PopoverProps, onExitComplete: () => {
|
|
68
79
|
PopoverProps?.onExitComplete?.();
|
|
69
80
|
setIsPopoverExited(true);
|
|
70
|
-
}, children: children }), jsx(VisuallyHidden, { id: idForInstruction, children: announcementText })] }));
|
|
81
|
+
}, children: children }), idForInstruction && (jsx(VisuallyHidden, { id: idForInstruction, children: announcementText }))] }));
|
|
71
82
|
});
|
|
72
83
|
PickerTextField.displayName = PICKER_DISPLAY_NAME;
|
|
73
84
|
|
package/chunks/TextField.js
CHANGED
|
@@ -47,7 +47,6 @@ const TextFieldComponent = (inProps, ref) => {
|
|
|
47
47
|
let helperText = helperTextProp;
|
|
48
48
|
if (showCharacterCount &&
|
|
49
49
|
inputProps?.maxLength !== undefined &&
|
|
50
|
-
props.onChange &&
|
|
51
50
|
props.value !== undefined) {
|
|
52
51
|
helperText = (jsxs("div", { className: cls('helper-text'), children: [jsx("span", { children: helperText }), jsxs("span", { children: [props.value?.length ?? 0, "/", inputProps.maxLength] })] }));
|
|
53
52
|
}
|
package/chunks/Tooltip.js
CHANGED
|
@@ -187,7 +187,7 @@ const TooltipView = forwardRef((props, ref) => {
|
|
|
187
187
|
bottom: padding.bottom ?? 16,
|
|
188
188
|
left: padding.left ?? 16,
|
|
189
189
|
}
|
|
190
|
-
: padding ?? 16;
|
|
190
|
+
: (padding ?? 16);
|
|
191
191
|
return (jsx(Popper, { role: "tooltip", placement: placement, offset: 4, ...PopperProps, padding: popperPadding, className: cls('root', {
|
|
192
192
|
'force-hide': tooltipForceHide,
|
|
193
193
|
'disable-interactions': disableInteractions,
|
|
@@ -55,7 +55,7 @@ const VirtualizedMenu = forwardRef((inProps, ref) => {
|
|
|
55
55
|
bottom: padding.bottom ?? 16,
|
|
56
56
|
left: padding.left ?? 16,
|
|
57
57
|
}
|
|
58
|
-
: padding ?? 16;
|
|
58
|
+
: (padding ?? 16);
|
|
59
59
|
const popperActions = useRef(null);
|
|
60
60
|
const handlePopperActions = useForkRef(popperActions, popperActionsProp);
|
|
61
61
|
const menuContextValue = useMemo(() => {
|
|
@@ -15,9 +15,20 @@ const MenuListContext = createContext({
|
|
|
15
15
|
});
|
|
16
16
|
const useMenuListContext = () => useContext(MenuListContext);
|
|
17
17
|
|
|
18
|
+
const SubMenuTriggerNestedIdContext = createContext(null);
|
|
19
|
+
|
|
18
20
|
const MenuItemSelectContext = createContext(null);
|
|
19
21
|
const useMenuItemSelectContext = () => useContext(MenuItemSelectContext);
|
|
20
22
|
|
|
23
|
+
const composeEventHandlers = (externalEventHandler, internalEventHandler, options = {}) => (event, ...args) => {
|
|
24
|
+
const { checkForDefaultPrevented = true } = options;
|
|
25
|
+
externalEventHandler?.(event, ...args);
|
|
26
|
+
if (checkForDefaultPrevented && event.defaultPrevented) {
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
internalEventHandler?.(event, ...args);
|
|
30
|
+
};
|
|
31
|
+
|
|
21
32
|
const useMenuItem = (props) => {
|
|
22
33
|
const { onBlur, onFocus, onKeyDown, onKeyUp, onClick, ref, disabled, autoClose, } = props;
|
|
23
34
|
const { keyboardNavHandlers, itemRef } = useItemNavigation() ?? {};
|
|
@@ -32,17 +43,20 @@ const useMenuItem = (props) => {
|
|
|
32
43
|
},
|
|
33
44
|
});
|
|
34
45
|
const { close: closeMenu } = useMenuContext() ?? {};
|
|
46
|
+
const handleClick = disabled
|
|
47
|
+
? undefined
|
|
48
|
+
: composeEventHandlers(onClick, () => {
|
|
49
|
+
if (autoClose)
|
|
50
|
+
closeMenu?.();
|
|
51
|
+
});
|
|
35
52
|
const { active, activeHandlers } = useActive({
|
|
53
|
+
disabled,
|
|
36
54
|
onKeyDown: (e) => {
|
|
37
55
|
onKeyDown?.(e);
|
|
38
56
|
keyboardNavHandlers?.onKeyDown(e);
|
|
39
57
|
},
|
|
40
58
|
onKeyUp,
|
|
41
|
-
onClick:
|
|
42
|
-
onClick?.(e);
|
|
43
|
-
if (autoClose)
|
|
44
|
-
closeMenu?.();
|
|
45
|
-
},
|
|
59
|
+
onClick: handleClick,
|
|
46
60
|
});
|
|
47
61
|
const handleItemRef = useForkRef(ref, focusVisibleRef, itemRef);
|
|
48
62
|
const getRootProps = (otherProps) => {
|
|
@@ -60,7 +74,7 @@ const useMenuItem = (props) => {
|
|
|
60
74
|
};
|
|
61
75
|
|
|
62
76
|
const useVirtualizedMenuItem = (props) => {
|
|
63
|
-
const { onBlur, onFocus, onKeyDown, onKeyUp, onClick, autoClose, ref } = props;
|
|
77
|
+
const { onBlur, onFocus, onKeyDown, onKeyUp, onClick, disabled, autoClose, ref, } = props;
|
|
64
78
|
const { keyboardNavHandlers, itemRef } = useItemNavigation() ?? {};
|
|
65
79
|
const vlItemProps = useVirtualizedItemPropsContext();
|
|
66
80
|
const { focusVisible, focusVisibleRef, focusVisibleHandlers } = useFocusVisible({
|
|
@@ -74,17 +88,20 @@ const useVirtualizedMenuItem = (props) => {
|
|
|
74
88
|
},
|
|
75
89
|
});
|
|
76
90
|
const { close: closeMenu } = useMenuContext() ?? {};
|
|
91
|
+
const handleClick = disabled
|
|
92
|
+
? undefined
|
|
93
|
+
: composeEventHandlers(onClick, () => {
|
|
94
|
+
if (autoClose)
|
|
95
|
+
closeMenu?.();
|
|
96
|
+
});
|
|
77
97
|
const { active, activeHandlers } = useActive({
|
|
98
|
+
disabled,
|
|
78
99
|
onKeyDown: (e) => {
|
|
79
100
|
onKeyDown?.(e);
|
|
80
101
|
keyboardNavHandlers?.onKeyDown(e);
|
|
81
102
|
},
|
|
82
103
|
onKeyUp,
|
|
83
|
-
onClick:
|
|
84
|
-
onClick?.(e);
|
|
85
|
-
if (autoClose)
|
|
86
|
-
closeMenu?.();
|
|
87
|
-
},
|
|
104
|
+
onClick: handleClick,
|
|
88
105
|
});
|
|
89
106
|
const handleItemRef = useForkRef(ref, focusVisibleRef, itemRef);
|
|
90
107
|
const getRootProps = (otherProps) => {
|
|
@@ -103,7 +120,7 @@ const useVirtualizedMenuItem = (props) => {
|
|
|
103
120
|
|
|
104
121
|
const MenuItem = forwardRef((inProps, ref) => {
|
|
105
122
|
const props = useThemeProps({ props: inProps, name: 'MenuItem' });
|
|
106
|
-
const { classes, className, children, selected, disabled, onMouseEnter, onMouseLeave, highlighted = false, focused = false, autoClose = true, autoFocus, ...rest } = props;
|
|
123
|
+
const { classes, className, children, selected, disabled, onMouseEnter, onMouseLeave, onPointerMove, highlighted = false, focused = false, autoClose = true, autoFocus, ...rest } = props;
|
|
107
124
|
const cls = useClassesWithMode('menu-item', classes, className);
|
|
108
125
|
const vlItemProps = useVirtualizedItemPropsContext();
|
|
109
126
|
const isInVlRef = useRef(Boolean(vlItemProps));
|
|
@@ -128,9 +145,24 @@ const MenuItem = forwardRef((inProps, ref) => {
|
|
|
128
145
|
const selectMode = selectContextValue
|
|
129
146
|
? selectContextValue.selectMode
|
|
130
147
|
: 'single';
|
|
131
|
-
const
|
|
132
|
-
const
|
|
133
|
-
|
|
148
|
+
const subMenuTriggerNestedId = useContext(SubMenuTriggerNestedIdContext);
|
|
149
|
+
const generatedId = useId();
|
|
150
|
+
const id = subMenuTriggerNestedId ?? generatedId;
|
|
151
|
+
const isSubMenuTrigger = Boolean(subMenuTriggerNestedId);
|
|
152
|
+
const { requestItemHover } = useNestedMenuItem({ id });
|
|
153
|
+
const { hoverHandlers } = useHover({
|
|
154
|
+
onMouseEnter,
|
|
155
|
+
onMouseLeave,
|
|
156
|
+
});
|
|
157
|
+
const handlePointerMove = (event) => {
|
|
158
|
+
if (event.pointerType === 'mouse' &&
|
|
159
|
+
!requestItemHover(event, {
|
|
160
|
+
closeOpenedSubMenu: !isSubMenuTrigger,
|
|
161
|
+
})) {
|
|
162
|
+
event.preventDefault();
|
|
163
|
+
}
|
|
164
|
+
onPointerMove?.(event);
|
|
165
|
+
};
|
|
134
166
|
useLayoutEffect(() => {
|
|
135
167
|
if (autoFocus) {
|
|
136
168
|
itemRef.current?.focus();
|
|
@@ -155,7 +187,7 @@ const MenuItem = forwardRef((inProps, ref) => {
|
|
|
155
187
|
highlighted,
|
|
156
188
|
focused,
|
|
157
189
|
nowrap: menuListContextValue.nowrap,
|
|
158
|
-
}), ...getRootProps(rest), ...hoverHandlers, children: jsxs("div", { className: cls('container'), children: [selectable && (jsx("div", { className: cls('select-indicator'), children: selectMode === 'single' ? (jsx("span", { className: cls('select-dot') })) : (jsx(Icon, { symbol: CheckBoldMd, size: "small" })) })), children] }) }));
|
|
190
|
+
}), ...getRootProps(rest), ...hoverHandlers, onPointerMove: handlePointerMove, children: jsxs("div", { className: cls('container'), children: [selectable && (jsx("div", { className: cls('select-indicator'), children: selectMode === 'single' ? (jsx("span", { className: cls('select-dot') })) : (jsx(Icon, { symbol: CheckBoldMd, size: "small" })) })), children] }) }));
|
|
159
191
|
});
|
|
160
192
|
MenuItem.displayName = 'SuiMenuItem';
|
|
161
193
|
|
|
@@ -236,4 +268,4 @@ const useMenuItemSelect = (props) => {
|
|
|
236
268
|
};
|
|
237
269
|
};
|
|
238
270
|
|
|
239
|
-
export { Action as A, MenuItem as M, MenuItemSelectContext as a, useMenuItem as b, useMenuItemSelect as c, useVirtualizedMenuItem as d, MenuListContext as e, useMenuListContext as f, useMenuItemSelectContext as u };
|
|
271
|
+
export { Action as A, MenuItem as M, SubMenuTriggerNestedIdContext as S, MenuItemSelectContext as a, useMenuItem as b, useMenuItemSelect as c, useVirtualizedMenuItem as d, MenuListContext as e, useMenuListContext as f, composeEventHandlers as g, useMenuItemSelectContext as u };
|
|
@@ -1,16 +1,27 @@
|
|
|
1
|
-
import { useEffect } from 'react';
|
|
1
|
+
import { useCallback, useEffect } from 'react';
|
|
2
2
|
import { u as useNestedMenuContext } from './useNestedParentMenu.js';
|
|
3
3
|
|
|
4
4
|
const useNestedMenuItem = (props) => {
|
|
5
5
|
const context = useNestedMenuContext();
|
|
6
6
|
const { hovered, id } = props;
|
|
7
|
-
const { registHoveredItem } = context ?? {};
|
|
7
|
+
const { isPointerMovingToSubMenu: isPointerMovingToSubMenuContext, onPointerGraceIntentChange, registHoveredItem, } = context ?? {};
|
|
8
|
+
const requestItemHover = useCallback((event, options) => {
|
|
9
|
+
const canApplyHover = registHoveredItem?.(id, event, options);
|
|
10
|
+
return canApplyHover ?? true;
|
|
11
|
+
}, [id, registHoveredItem]);
|
|
8
12
|
useEffect(() => {
|
|
9
13
|
if (hovered) {
|
|
10
|
-
|
|
14
|
+
requestItemHover();
|
|
11
15
|
}
|
|
12
|
-
|
|
13
|
-
|
|
16
|
+
}, [hovered, requestItemHover]);
|
|
17
|
+
const isPointerMovingToSubMenu = useCallback((event, intent) => {
|
|
18
|
+
return isPointerMovingToSubMenuContext?.(event, intent) ?? false;
|
|
19
|
+
}, [isPointerMovingToSubMenuContext]);
|
|
20
|
+
return {
|
|
21
|
+
isPointerMovingToSubMenu,
|
|
22
|
+
onPointerGraceIntentChange,
|
|
23
|
+
requestItemHover,
|
|
24
|
+
};
|
|
14
25
|
};
|
|
15
26
|
|
|
16
27
|
export { useNestedMenuItem as u };
|
|
@@ -1,20 +1,82 @@
|
|
|
1
|
-
import { createContext, useContext, useRef, useMemo, useLayoutEffect } from 'react';
|
|
1
|
+
import { createContext, useContext, useRef, useCallback, useMemo, useLayoutEffect } from 'react';
|
|
2
2
|
|
|
3
3
|
const NestedMenuContext = createContext(null);
|
|
4
4
|
const useNestedMenuContext = () => {
|
|
5
5
|
return useContext(NestedMenuContext);
|
|
6
6
|
};
|
|
7
7
|
|
|
8
|
+
const getPointFromPointerEvent = (event) => ({
|
|
9
|
+
x: event.clientX,
|
|
10
|
+
y: event.clientY,
|
|
11
|
+
});
|
|
12
|
+
const isPointInPolygon = (point, polygon) => {
|
|
13
|
+
let inside = false;
|
|
14
|
+
for (let i = 0, j = polygon.length - 1; i < polygon.length; j = i++) {
|
|
15
|
+
const pointI = polygon[i];
|
|
16
|
+
const pointJ = polygon[j];
|
|
17
|
+
const intersects = pointI.y > point.y !== pointJ.y > point.y &&
|
|
18
|
+
point.x <
|
|
19
|
+
((pointJ.x - pointI.x) * (point.y - pointI.y)) / (pointJ.y - pointI.y) +
|
|
20
|
+
pointI.x;
|
|
21
|
+
if (intersects) {
|
|
22
|
+
inside = !inside;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
return inside;
|
|
26
|
+
};
|
|
27
|
+
const isPointerInGraceArea = (event, area) => {
|
|
28
|
+
if (!area)
|
|
29
|
+
return false;
|
|
30
|
+
return isPointInPolygon(getPointFromPointerEvent(event), area);
|
|
31
|
+
};
|
|
32
|
+
|
|
8
33
|
const useNestedParentMenu = (props) => {
|
|
9
34
|
const openedSubMenuSymbolRef = useRef(null);
|
|
35
|
+
const pointerGraceIntentRef = useRef(null);
|
|
36
|
+
const pointerDirRef = useRef('right');
|
|
37
|
+
const lastPointerXRef = useRef(0);
|
|
10
38
|
const { open } = props;
|
|
39
|
+
const onPointerGraceIntentChange = useCallback((intent) => {
|
|
40
|
+
pointerGraceIntentRef.current = intent;
|
|
41
|
+
}, []);
|
|
42
|
+
const isPointerMovingToSubMenu = useCallback((event, intentArg) => {
|
|
43
|
+
const intent = intentArg === undefined ? pointerGraceIntentRef.current : intentArg;
|
|
44
|
+
const isMovingTowards = pointerDirRef.current === intent?.side;
|
|
45
|
+
return isMovingTowards && isPointerInGraceArea(event, intent?.area);
|
|
46
|
+
}, []);
|
|
47
|
+
const onContentPointerMove = useCallback((event) => {
|
|
48
|
+
const pointerXHasChanged = lastPointerXRef.current !== event.clientX;
|
|
49
|
+
if (pointerXHasChanged) {
|
|
50
|
+
pointerDirRef.current =
|
|
51
|
+
event.clientX > lastPointerXRef.current ? 'right' : 'left';
|
|
52
|
+
lastPointerXRef.current = event.clientX;
|
|
53
|
+
}
|
|
54
|
+
}, []);
|
|
55
|
+
const onContentClickCapture = useCallback((event) => {
|
|
56
|
+
const target = event.target;
|
|
57
|
+
const openedSubMenu = openedSubMenuSymbolRef.current;
|
|
58
|
+
if (!target || !event.currentTarget.contains(target)) {
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
if (openedSubMenu?.getAnchorElement?.()?.contains(target)) {
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
openedSubMenu?.closeSubMenu();
|
|
65
|
+
}, []);
|
|
11
66
|
const contextValue = useMemo(() => {
|
|
12
67
|
return {
|
|
13
|
-
registHoveredItem: (id) => {
|
|
68
|
+
registHoveredItem: (id, event, options) => {
|
|
14
69
|
const symbol = openedSubMenuSymbolRef.current;
|
|
15
|
-
if (symbol
|
|
70
|
+
if (!symbol || id === symbol.anchorId) {
|
|
71
|
+
return true;
|
|
72
|
+
}
|
|
73
|
+
if (event && isPointerMovingToSubMenu(event)) {
|
|
74
|
+
return false;
|
|
75
|
+
}
|
|
76
|
+
if (options?.closeOpenedSubMenu ?? true) {
|
|
16
77
|
symbol.closeSubMenu();
|
|
17
78
|
}
|
|
79
|
+
return true;
|
|
18
80
|
},
|
|
19
81
|
registOpenedSubMenu: (menuItemSymbol) => {
|
|
20
82
|
openedSubMenuSymbolRef.current?.closeSubMenu();
|
|
@@ -25,14 +87,24 @@ const useNestedParentMenu = (props) => {
|
|
|
25
87
|
}
|
|
26
88
|
};
|
|
27
89
|
},
|
|
90
|
+
isPointerMovingToSubMenu,
|
|
91
|
+
onPointerGraceIntentChange,
|
|
28
92
|
};
|
|
29
|
-
}, []);
|
|
93
|
+
}, [isPointerMovingToSubMenu, onPointerGraceIntentChange]);
|
|
30
94
|
useLayoutEffect(() => {
|
|
31
95
|
if (!open) {
|
|
32
96
|
openedSubMenuSymbolRef.current?.closeSubMenu();
|
|
97
|
+
openedSubMenuSymbolRef.current = null;
|
|
98
|
+
onPointerGraceIntentChange(null);
|
|
33
99
|
}
|
|
34
|
-
}, [open]);
|
|
100
|
+
}, [onPointerGraceIntentChange, open]);
|
|
35
101
|
return {
|
|
102
|
+
contentClickHandlers: {
|
|
103
|
+
onClickCapture: onContentClickCapture,
|
|
104
|
+
},
|
|
105
|
+
contentPointerHandlers: {
|
|
106
|
+
onPointerMove: onContentPointerMove,
|
|
107
|
+
},
|
|
36
108
|
contextValue,
|
|
37
109
|
getHaveOpenedSubMenu: () => Boolean(openedSubMenuSymbolRef.current),
|
|
38
110
|
};
|
|
@@ -23,7 +23,7 @@ const useTray = (parameters) => {
|
|
|
23
23
|
setValue(newValue);
|
|
24
24
|
onChange?.(e, newValue);
|
|
25
25
|
if (stack.includes(newValue)) {
|
|
26
|
-
setStack(
|
|
26
|
+
setStack(stack.slice(0, stack.indexOf(newValue) + 1));
|
|
27
27
|
setDirection('left');
|
|
28
28
|
}
|
|
29
29
|
else {
|