@ringcentral/spring-ui 1.7.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/Accordion.js +64 -0
- package/AccordionHeader.js +33 -0
- package/Alert.js +28 -0
- package/Animation.js +46 -0
- package/Announcement.js +48 -0
- package/Autocomplete.js +1767 -0
- package/Avatar.js +105 -0
- package/AvatarGroup.js +9 -0
- package/Backdrop.js +9 -0
- package/Badge.js +15 -0
- package/Block.js +20 -0
- package/BlockHeader.js +18 -0
- package/BottomNavigation.js +145 -0
- package/BottomNavigationItem.js +30 -0
- package/Button.js +24 -0
- package/CallButton.js +39 -0
- package/Checkbox.js +55 -0
- package/Chip.js +26 -0
- package/CircularProgressIndicator.js +10 -0
- package/ClickAwayListener.js +1 -0
- package/ComponentsProps.js +1 -0
- package/DatePicker.js +485 -0
- package/DateUtilsContext.js +56 -0
- package/Dialer.js +587 -0
- package/Dialog.js +62 -0
- package/Divider.js +9 -0
- package/DragHandle.js +8 -0
- package/Drawer.js +19 -0
- package/Dropdown.js +132 -0
- package/EmptyState.js +17 -0
- package/FabButton.js +32 -0
- package/FocusTrap.js +48 -0
- package/FormField.js +10 -0
- package/FormLabel.js +9 -0
- package/Icon.js +9 -0
- package/IconButton.js +26 -0
- package/IconButtonGroup.js +18 -0
- package/InlineEditable.js +98 -0
- package/LICENSE +22 -0
- package/LinearProgressIndicator.js +44 -0
- package/Link.js +18 -0
- package/List.js +11 -0
- package/ListItem.js +22 -0
- package/ListItemText.js +18 -0
- package/ListNavigation.js +57 -0
- package/Menu.js +23 -0
- package/MenuActions.js +21 -0
- package/MenuDivider.js +10 -0
- package/MenuFooter.js +18 -0
- package/MenuHeader.js +18 -0
- package/MenuItem.js +32 -0
- package/MenuItemText.js +9 -0
- package/MenuList.js +33 -0
- package/Modal.js +16 -0
- package/NestedMenuContext.js +23 -0
- package/Option.js +46 -0
- package/Overlap.js +9 -0
- package/PageHeader.js +56 -0
- package/PickerTextField.js +33 -0
- package/Popover.js +21 -0
- package/Popper.js +127 -0
- package/PopperPaper.js +10 -0
- package/Portal.js +1 -0
- package/README.md +76 -0
- package/Radio.js +34 -0
- package/RadioGroup.js +29 -0
- package/Rating.js +235 -0
- package/Select.js +40 -0
- package/SingleFilter.js +130 -0
- package/Skeleton.js +32 -0
- package/Slider.js +110 -0
- package/Snackbar.js +118 -0
- package/SortableList.js +17 -0
- package/SortableListDndContext.js +49 -0
- package/SortableListItem.js +69 -0
- package/SortableVirtualizedList.js +36 -0
- package/SplitButton.js +173 -0
- package/Squircle.js +9 -0
- package/StatusIndicator.js +11 -0
- package/Step.js +65 -0
- package/StepButton.js +41 -0
- package/StepConnector.js +10 -0
- package/StepContent.js +53 -0
- package/StepIcon.js +11 -0
- package/StepLabel.js +14 -0
- package/Stepper.js +37 -0
- package/SubMenu.js +142 -0
- package/SwipeableDrawer.js +742 -0
- package/Switch.js +43 -0
- package/Tab.js +103 -0
- package/TabContext.js +34 -0
- package/TabPanel.js +26 -0
- package/Table.js +24 -0
- package/TableBody.js +20 -0
- package/TableCell.js +86 -0
- package/TableContainer.js +16 -0
- package/TableFooter.js +16 -0
- package/TableHead.js +24 -0
- package/TablePagination.js +122 -0
- package/TableRow.js +37 -0
- package/Tabs.js +827 -0
- package/Tag.js +28 -0
- package/Text.js +61 -0
- package/TextField.js +29 -0
- package/Textarea.js +67 -0
- package/TimePicker.js +600 -0
- package/Tooltip.js +23 -0
- package/Tray.js +13 -0
- package/TrayMenu.js +60 -0
- package/VirtualizedList.js +291 -0
- package/VirtualizedMenu.js +28 -0
- package/VisuallyHidden.js +8 -0
- package/chunks/AccordionContext.js +6 -0
- package/chunks/Alert.js +47 -0
- package/chunks/AvatarGroup.js +22 -0
- package/chunks/Backdrop.js +18 -0
- package/chunks/Badge.js +32 -0
- package/chunks/BottomNavigationItem.js +37 -0
- package/chunks/Button.js +89 -0
- package/chunks/Chip.js +78 -0
- package/chunks/CircularProgressIndicator.js +62 -0
- package/chunks/Divider.js +19 -0
- package/chunks/DragHandle.js +11 -0
- package/chunks/Drawer.js +61 -0
- package/chunks/ExpandCollapseCaret.js +24 -0
- package/chunks/FormLabel.js +27 -0
- package/chunks/Icon.js +25 -0
- package/chunks/IconButtonLabel.js +69 -0
- package/chunks/List.js +22 -0
- package/chunks/ListItem.js +86 -0
- package/chunks/Menu.js +41 -0
- package/chunks/MenuDivider.js +15 -0
- package/chunks/MenuItemText.js +16 -0
- package/chunks/MenuList.js +49 -0
- package/chunks/Modal.js +88 -0
- package/chunks/Overlap.js +25 -0
- package/chunks/PickerTextField.js +75 -0
- package/chunks/Popover.js +58 -0
- package/chunks/PopperPaper.js +15 -0
- package/chunks/RadioGroup.context.js +19 -0
- package/chunks/Select.js +257 -0
- package/chunks/ShowHideEye.js +56 -0
- package/chunks/SlideIn.js +19 -0
- package/chunks/SortableArrow.js +73 -0
- package/chunks/Squircle.js +38 -0
- package/chunks/StatusIndicator.js +19 -0
- package/chunks/StepConnector.js +21 -0
- package/chunks/StepIcon.js +45 -0
- package/chunks/StepLabel.js +29 -0
- package/chunks/StepperContext.js +16 -0
- package/chunks/TableContext.js +6 -0
- package/chunks/Tablelvl2Context.js +6 -0
- package/chunks/TabsContext.js +6 -0
- package/chunks/TextField.js +111 -0
- package/chunks/Tooltip.js +253 -0
- package/chunks/VirtualizedMenu.js +216 -0
- package/chunks/VisuallyHidden.js +12 -0
- package/chunks/getFade.js +23 -0
- package/chunks/getGrow.js +70 -0
- package/chunks/getSlideIn.js +30 -0
- package/chunks/useFocusTrapStack.js +44 -0
- package/chunks/useHelperTextId.js +46 -0
- package/chunks/useListNavigation.js +211 -0
- package/chunks/useMenuItemSelect.js +252 -0
- package/chunks/useMotionSafeTransition.js +13 -0
- package/chunks/useNestedMenuItem.js +16 -0
- package/chunks/useNestedParentMenu.js +54 -0
- package/chunks/usePrefersReducedMotion.js +42 -0
- package/chunks/useTooltipForceHide.js +31 -0
- package/chunks/useTrayNavigate.js +151 -0
- package/chunks/withTooltip.js +15 -0
- package/index.css +10891 -0
- package/index.d.ts +1 -0
- package/index.js +191 -0
- package/package.json +41 -0
- package/src/Accordion/Accordion.classes.d.ts +7 -0
- package/src/Accordion/Accordion.d.ts +5 -0
- package/src/Accordion/Accordion.type.d.ts +31 -0
- package/src/Accordion/AccordionContext.d.ts +9 -0
- package/src/Accordion/index.d.ts +4 -0
- package/src/AccordionHeader/AccordionHeader.classes.d.ts +7 -0
- package/src/AccordionHeader/AccordionHeader.d.ts +5 -0
- package/src/AccordionHeader/AccordionHeader.type.d.ts +25 -0
- package/src/AccordionHeader/index.d.ts +3 -0
- package/src/Alert/Alert.classes.d.ts +8 -0
- package/src/Alert/Alert.d.ts +7 -0
- package/src/Alert/Alert.type.d.ts +56 -0
- package/src/Alert/AlertTitle.classes.d.ts +7 -0
- package/src/Alert/index.d.ts +4 -0
- package/src/Animation/components/ExpandCollapseCaret/ExpandCollapseCaret.classes.d.ts +7 -0
- package/src/Animation/components/ExpandCollapseCaret/ExpandCollapseCaret.d.ts +17 -0
- package/src/Animation/components/ExpandCollapseCaret/index.d.ts +2 -0
- package/src/Animation/components/Fade/Fade.d.ts +5 -0
- package/src/Animation/components/Fade/getFade.d.ts +4 -0
- package/src/Animation/components/Fade/index.d.ts +2 -0
- package/src/Animation/components/Grow/Grow.d.ts +5 -0
- package/src/Animation/components/Grow/getGrow.d.ts +19 -0
- package/src/Animation/components/Grow/index.d.ts +2 -0
- package/src/Animation/components/ShowHideEye/ShowHideEye.classes.d.ts +7 -0
- package/src/Animation/components/ShowHideEye/ShowHideEye.d.ts +14 -0
- package/src/Animation/components/ShowHideEye/index.d.ts +2 -0
- package/src/Animation/components/SlideIn/SlideIn.d.ts +5 -0
- package/src/Animation/components/SlideIn/getSlideIn.d.ts +9 -0
- package/src/Animation/components/SlideIn/index.d.ts +2 -0
- package/src/Animation/components/SortableArrow/SortableArrow.classes.d.ts +7 -0
- package/src/Animation/components/SortableArrow/SortableArrow.d.ts +9 -0
- package/src/Animation/components/SortableArrow/index.d.ts +2 -0
- package/src/Animation/components/index.d.ts +7 -0
- package/src/Animation/components/types.d.ts +9 -0
- package/src/Animation/hooks/__mocks__/MatchMedia.mock.d.ts +12 -0
- package/src/Animation/hooks/index.d.ts +2 -0
- package/src/Animation/hooks/useMotionSafeTransition/index.d.ts +1 -0
- package/src/Animation/hooks/useMotionSafeTransition/useMotionSafeTransition.d.ts +10 -0
- package/src/Animation/hooks/usePrefersReducedMotion/index.d.ts +1 -0
- package/src/Animation/hooks/usePrefersReducedMotion/usePrefersReducedMotion.d.ts +1 -0
- package/src/Animation/index.d.ts +2 -0
- package/src/Announcement/Announcement.classes.d.ts +8 -0
- package/src/Announcement/Announcement.d.ts +5 -0
- package/src/Announcement/Announcement.type.d.ts +4 -0
- package/src/Announcement/index.d.ts +3 -0
- package/src/Autocomplete/Autocomplete.classes.d.ts +14 -0
- package/src/Autocomplete/Autocomplete.d.ts +11 -0
- package/src/Autocomplete/Autocomplete.type.d.ts +141 -0
- package/src/Autocomplete/SuggestionList/SuggestionList.classes.d.ts +7 -0
- package/src/Autocomplete/SuggestionList/SuggestionList.d.ts +144 -0
- package/src/Autocomplete/SuggestionList/SuggestionListItem.d.ts +28 -0
- package/src/Autocomplete/SuggestionList/index.d.ts +4 -0
- package/src/Autocomplete/SuggestionList/utils/SuggestionListItem.d.ts +33 -0
- package/src/Autocomplete/SuggestionList/utils/index.d.ts +5 -0
- package/src/Autocomplete/SuggestionList/utils/useDynamicHeight.d.ts +20 -0
- package/src/Autocomplete/SuggestionList/utils/useHighlightScroll.d.ts +33 -0
- package/src/Autocomplete/SuggestionList/utils/useSuggestionList.d.ts +101 -0
- package/src/Autocomplete/SuggestionList/utils/useSuggestionListGroup.d.ts +71 -0
- package/src/Autocomplete/index.d.ts +6 -0
- package/src/Autocomplete/useAutocomplete.d.ts +640 -0
- package/src/Autocomplete/useAutocompleteTag.d.ts +599 -0
- package/src/Avatar/Avatar.classes.d.ts +10 -0
- package/src/Avatar/Avatar.d.ts +4 -0
- package/src/Avatar/Avatar.type.d.ts +91 -0
- package/src/Avatar/index.d.ts +3 -0
- package/src/AvatarGroup/AvatarGroup.classes.d.ts +7 -0
- package/src/AvatarGroup/AvatarGroup.d.ts +6 -0
- package/src/AvatarGroup/AvatarGroup.type.d.ts +21 -0
- package/src/AvatarGroup/index.d.ts +3 -0
- package/src/Backdrop/Backdrop.classes.d.ts +7 -0
- package/src/Backdrop/Backdrop.d.ts +5 -0
- package/src/Backdrop/Backdrop.type.d.ts +9 -0
- package/src/Backdrop/index.d.ts +3 -0
- package/src/Badge/Badge.classes.d.ts +11 -0
- package/src/Badge/Badge.d.ts +8 -0
- package/src/Badge/Badge.type.d.ts +52 -0
- package/src/Badge/index.d.ts +3 -0
- package/src/Block/Block.classes.d.ts +8 -0
- package/src/Block/Block.d.ts +4 -0
- package/src/Block/Block.type.d.ts +44 -0
- package/src/Block/index.d.ts +3 -0
- package/src/BlockHeader/BlockHeader.classes.d.ts +7 -0
- package/src/BlockHeader/BlockHeader.d.ts +4 -0
- package/src/BlockHeader/BlockHeader.type.d.ts +19 -0
- package/src/BlockHeader/index.d.ts +3 -0
- package/src/BottomNavigation/BottomNavigation.classes.d.ts +7 -0
- package/src/BottomNavigation/BottomNavigation.d.ts +4 -0
- package/src/BottomNavigation/BottomNavigation.type.d.ts +62 -0
- package/src/BottomNavigation/BottomNavigationContext.d.ts +9 -0
- package/src/BottomNavigation/BottomNavigationGroup/BottomNavigationGroup.classes.d.ts +7 -0
- package/src/BottomNavigation/BottomNavigationGroup/BottomNavigationGroup.d.ts +5 -0
- package/src/BottomNavigation/BottomNavigationGroup/BottomNavigationGroup.type.d.ts +3 -0
- package/src/BottomNavigation/BottomNavigationGroup/index.d.ts +3 -0
- package/src/BottomNavigation/index.d.ts +5 -0
- package/src/BottomNavigationItem/BottomNavigationItem.classes.d.ts +7 -0
- package/src/BottomNavigationItem/BottomNavigationItem.d.ts +4 -0
- package/src/BottomNavigationItem/BottomNavigationItem.type.d.ts +63 -0
- package/src/BottomNavigationItem/index.d.ts +3 -0
- package/src/Button/Button.classes.d.ts +8 -0
- package/src/Button/Button.d.ts +6 -0
- package/src/Button/Button.type.d.ts +57 -0
- package/src/Button/index.d.ts +3 -0
- package/src/CallButton/CallButton.classes.d.ts +7 -0
- package/src/CallButton/CallButton.d.ts +4 -0
- package/src/CallButton/CallButton.type.d.ts +19 -0
- package/src/CallButton/index.d.ts +3 -0
- package/src/Checkbox/Checkbox.classes.d.ts +8 -0
- package/src/Checkbox/Checkbox.d.ts +13 -0
- package/src/Checkbox/Checkbox.type.d.ts +30 -0
- package/src/Checkbox/index.d.ts +3 -0
- package/src/Chip/Chip.classes.d.ts +7 -0
- package/src/Chip/Chip.d.ts +4 -0
- package/src/Chip/Chip.type.d.ts +65 -0
- package/src/Chip/index.d.ts +3 -0
- package/src/CircularProgressIndicator/CircularProgressIndicator.classes.d.ts +10 -0
- package/src/CircularProgressIndicator/CircularProgressIndicator.d.ts +5 -0
- package/src/CircularProgressIndicator/CircularProgressIndicator.type.d.ts +32 -0
- package/src/CircularProgressIndicator/index.d.ts +3 -0
- package/src/ClickAwayListener/index.d.ts +2 -0
- package/src/ComponentsProps.d.ts +207 -0
- package/src/DatePicker/Calendar.d.ts +41 -0
- package/src/DatePicker/DatePicker.classes.d.ts +7 -0
- package/src/DatePicker/DatePicker.context.d.ts +6 -0
- package/src/DatePicker/DatePicker.d.ts +6 -0
- package/src/DatePicker/DatePicker.type.d.ts +36 -0
- package/src/DatePicker/DatePickerHeader.d.ts +27 -0
- package/src/DatePicker/Day.d.ts +23 -0
- package/src/DatePicker/HearderAction.d.ts +3 -0
- package/src/DatePicker/SlideDirection.d.ts +1 -0
- package/src/DatePicker/Year.d.ts +21 -0
- package/src/DatePicker/Years.d.ts +21 -0
- package/src/DatePicker/index.d.ts +12 -0
- package/src/DatePicker/utils/DatePickerAriaLabelUtils.d.ts +16 -0
- package/src/DatePicker/utils/DatePickerUtils.d.ts +13 -0
- package/src/DatePicker/utils/findClosestEnabledDate.d.ts +13 -0
- package/src/DatePicker/utils/index.d.ts +3 -0
- package/src/DateUtilsContext/DateUtilsContext.d.ts +22 -0
- package/src/DateUtilsContext/index.d.ts +1 -0
- package/src/Dialer/DialDelete/DialDelete.d.ts +14 -0
- package/src/Dialer/DialDelete/index.d.ts +1 -0
- package/src/Dialer/DialPad/DialPad.classes.d.ts +7 -0
- package/src/Dialer/DialPad/DialPad.d.ts +143 -0
- package/src/Dialer/DialPad/assets/DialerPadSoundsMPEG.d.ts +15 -0
- package/src/Dialer/DialPad/assets/DialerPadSoundsOGG.d.ts +15 -0
- package/src/Dialer/DialPad/assets/index.d.ts +3 -0
- package/src/Dialer/DialPad/index.d.ts +4 -0
- package/src/Dialer/DialPad/utils/DialPadUtils.d.ts +16 -0
- package/src/Dialer/DialPad/utils/index.d.ts +4 -0
- package/src/Dialer/DialPad/utils/types.d.ts +11 -0
- package/src/Dialer/DialPad/utils/useDialKeyboard.d.ts +16 -0
- package/src/Dialer/DialPad/utils/useKeyAudio.d.ts +15 -0
- package/src/Dialer/DialPadButton/DialPadButton.classes.d.ts +7 -0
- package/src/Dialer/DialPadButton/DialPadButton.d.ts +27 -0
- package/src/Dialer/DialPadButton/index.d.ts +2 -0
- package/src/Dialer/DialTextField/DialTextField.d.ts +37 -0
- package/src/Dialer/DialTextField/index.d.ts +2 -0
- package/src/Dialer/DialTextField/utils/getDialPadValueOnlyRegex.d.ts +4 -0
- package/src/Dialer/DialTextField/utils/index.d.ts +2 -0
- package/src/Dialer/DialTextField/utils/useFixedEndSelection.d.ts +10 -0
- package/src/Dialer/Dialer.d.ts +5 -0
- package/src/Dialer/index.d.ts +6 -0
- package/src/Dialer/utils/DialerContext.d.ts +13 -0
- package/src/Dialer/utils/index.d.ts +1 -0
- package/src/Dialog/Dialog.classes.d.ts +29 -0
- package/src/Dialog/Dialog.d.ts +8 -0
- package/src/Dialog/Dialog.type.d.ts +26 -0
- package/src/Dialog/index.d.ts +3 -0
- package/src/Divider/Divider.classes.d.ts +10 -0
- package/src/Divider/Divider.d.ts +4 -0
- package/src/Divider/Divider.type.d.ts +35 -0
- package/src/Divider/index.d.ts +3 -0
- package/src/DragHandle/DragHandle.classes.d.ts +8 -0
- package/src/DragHandle/DragHandle.d.ts +4 -0
- package/src/DragHandle/DragHandle.type.d.ts +17 -0
- package/src/DragHandle/index.d.ts +3 -0
- package/src/Drawer/Drawer.classes.d.ts +10 -0
- package/src/Drawer/Drawer.d.ts +33 -0
- package/src/Drawer/Drawer.type.d.ts +107 -0
- package/src/Drawer/index.d.ts +3 -0
- package/src/Dropdown/Dropdown.classes.d.ts +7 -0
- package/src/Dropdown/Dropdown.d.ts +4 -0
- package/src/Dropdown/Dropdown.type.d.ts +96 -0
- package/src/Dropdown/index.d.ts +3 -0
- package/src/EmptyState/EmptyState.classes.d.ts +7 -0
- package/src/EmptyState/EmptyState.d.ts +5 -0
- package/src/EmptyState/EmptyState.type.d.ts +21 -0
- package/src/EmptyState/index.d.ts +3 -0
- package/src/FabButton/FabButton.classes.d.ts +7 -0
- package/src/FabButton/FabButton.d.ts +4 -0
- package/src/FabButton/FabButton.type.d.ts +22 -0
- package/src/FabButton/index.d.ts +3 -0
- package/src/FocusTrap/FocusTrap.d.ts +49 -0
- package/src/FocusTrap/index.d.ts +2 -0
- package/src/FocusTrap/useFocusTrapStack.d.ts +16 -0
- package/src/FormField/FormField.classes.d.ts +9 -0
- package/src/FormField/FormField.d.ts +5 -0
- package/src/FormField/FormField.type.d.ts +46 -0
- package/src/FormField/index.d.ts +4 -0
- package/src/FormField/useHelperTextId.d.ts +30 -0
- package/src/FormLabel/FormLabel.classes.d.ts +10 -0
- package/src/FormLabel/FormLabel.d.ts +5 -0
- package/src/FormLabel/FormLabel.type.d.ts +26 -0
- package/src/FormLabel/FormLabelContext.d.ts +8 -0
- package/src/FormLabel/index.d.ts +4 -0
- package/src/Icon/Icon.classes.d.ts +7 -0
- package/src/Icon/Icon.d.ts +5 -0
- package/src/Icon/Icon.type.d.ts +25 -0
- package/src/Icon/index.d.ts +3 -0
- package/src/IconButton/IconButton.classes.d.ts +8 -0
- package/src/IconButton/IconButton.d.ts +4 -0
- package/src/IconButton/IconButton.type.d.ts +58 -0
- package/src/IconButton/IconButtonLabel.classes.d.ts +7 -0
- package/src/IconButton/IconButtonLabel.d.ts +5 -0
- package/src/IconButton/IconButtonLabel.type.d.ts +12 -0
- package/src/IconButton/index.d.ts +6 -0
- package/src/IconButtonGroup/IconButtonGroup.classes.d.ts +7 -0
- package/src/IconButtonGroup/IconButtonGroup.d.ts +4 -0
- package/src/IconButtonGroup/IconButtonGroup.type.d.ts +22 -0
- package/src/IconButtonGroup/index.d.ts +3 -0
- package/src/InlineEditable/InlineEditable.classes.d.ts +9 -0
- package/src/InlineEditable/InlineEditable.d.ts +5 -0
- package/src/InlineEditable/InlineEditable.type.d.ts +116 -0
- package/src/InlineEditable/index.d.ts +3 -0
- package/src/LinearProgressIndicator/LinearProgressIndicator.classes.d.ts +9 -0
- package/src/LinearProgressIndicator/LinearProgressIndicator.d.ts +5 -0
- package/src/LinearProgressIndicator/LinearProgressIndicator.type.d.ts +46 -0
- package/src/LinearProgressIndicator/index.d.ts +3 -0
- package/src/Link/Link.classes.d.ts +8 -0
- package/src/Link/Link.d.ts +4 -0
- package/src/Link/Link.type.d.ts +22 -0
- package/src/Link/index.d.ts +3 -0
- package/src/List/List.classes.d.ts +7 -0
- package/src/List/List.d.ts +5 -0
- package/src/List/List.type.d.ts +4 -0
- package/src/List/index.d.ts +3 -0
- package/src/ListItem/HoverActions.d.ts +8 -0
- package/src/ListItem/ListItem.classes.d.ts +7 -0
- package/src/ListItem/ListItem.d.ts +5 -0
- package/src/ListItem/ListItem.type.d.ts +58 -0
- package/src/ListItem/index.d.ts +4 -0
- package/src/ListItemText/ListItemText.classes.d.ts +9 -0
- package/src/ListItemText/ListItemText.d.ts +5 -0
- package/src/ListItemText/ListItemText.type.d.ts +33 -0
- package/src/ListItemText/index.d.ts +3 -0
- package/src/ListNavigation/ListNavigationContext.d.ts +8 -0
- package/src/ListNavigation/index.d.ts +3 -0
- package/src/ListNavigation/useItemNavigation.d.ts +9 -0
- package/src/ListNavigation/useListNavigation.d.ts +49 -0
- package/src/Menu/Menu.classes.d.ts +7 -0
- package/src/Menu/Menu.d.ts +5 -0
- package/src/Menu/Menu.type.d.ts +19 -0
- package/src/Menu/MenuContext.d.ts +7 -0
- package/src/Menu/index.d.ts +4 -0
- package/src/MenuActions/MenuActions.classes.d.ts +13 -0
- package/src/MenuActions/MenuActions.d.ts +9 -0
- package/src/MenuActions/MenuActions.type.d.ts +3 -0
- package/src/MenuActions/index.d.ts +3 -0
- package/src/MenuDivider/MenuDivider.classes.d.ts +7 -0
- package/src/MenuDivider/MenuDivider.d.ts +5 -0
- package/src/MenuDivider/MenuDivider.type.d.ts +3 -0
- package/src/MenuDivider/index.d.ts +3 -0
- package/src/MenuFooter/MenuFooter.classes.d.ts +7 -0
- package/src/MenuFooter/MenuFooter.d.ts +5 -0
- package/src/MenuFooter/MenuFooter.type.d.ts +9 -0
- package/src/MenuFooter/index.d.ts +3 -0
- package/src/MenuHeader/MenuHeader.classes.d.ts +7 -0
- package/src/MenuHeader/MenuHeader.d.ts +5 -0
- package/src/MenuHeader/MenuHeader.type.d.ts +18 -0
- package/src/MenuHeader/index.d.ts +3 -0
- package/src/MenuItem/MenuItem.classes.d.ts +7 -0
- package/src/MenuItem/MenuItem.d.ts +5 -0
- package/src/MenuItem/MenuItem.type.d.ts +29 -0
- package/src/MenuItem/MenuItemSelectContext.d.ts +18 -0
- package/src/MenuItem/index.d.ts +7 -0
- package/src/MenuItem/useMenuItem.d.ts +16 -0
- package/src/MenuItem/useMenuItemSelect.d.ts +62 -0
- package/src/MenuItem/useVirtualizedMenuItem.d.ts +15 -0
- package/src/MenuItemText/MenuItemText.classes.d.ts +7 -0
- package/src/MenuItemText/MenuItemText.d.ts +5 -0
- package/src/MenuItemText/MenuItemText.type.d.ts +27 -0
- package/src/MenuItemText/index.d.ts +3 -0
- package/src/MenuList/MenuList.classes.d.ts +7 -0
- package/src/MenuList/MenuList.d.ts +4 -0
- package/src/MenuList/MenuList.type.d.ts +16 -0
- package/src/MenuList/MenuListContext.d.ts +12 -0
- package/src/MenuList/index.d.ts +4 -0
- package/src/Modal/InnerModal.d.ts +18 -0
- package/src/Modal/InnerModal.type.d.ts +23 -0
- package/src/Modal/Modal.classes.d.ts +7 -0
- package/src/Modal/Modal.d.ts +24 -0
- package/src/Modal/Modal.type.d.ts +19 -0
- package/src/Modal/ModalContext.d.ts +10 -0
- package/src/Modal/index.d.ts +6 -0
- package/src/NestedMenuContext/NestedMenuContext.d.ts +11 -0
- package/src/NestedMenuContext/index.d.ts +4 -0
- package/src/NestedMenuContext/useNestedChildMenu.d.ts +6 -0
- package/src/NestedMenuContext/useNestedMenuItem.d.ts +5 -0
- package/src/NestedMenuContext/useNestedParentMenu.d.ts +8 -0
- package/src/Option/Option.d.ts +4 -0
- package/src/Option/Option.type.d.ts +7 -0
- package/src/Option/index.d.ts +2 -0
- package/src/Overlap/Overlap.classes.d.ts +7 -0
- package/src/Overlap/Overlap.d.ts +4 -0
- package/src/Overlap/Overlap.type.d.ts +30 -0
- package/src/Overlap/index.d.ts +3 -0
- package/src/PageHeader/PageHeader.classes.d.ts +32 -0
- package/src/PageHeader/PageHeader.d.ts +9 -0
- package/src/PageHeader/PageHeader.type.d.ts +14 -0
- package/src/PageHeader/index.d.ts +3 -0
- package/src/PickerTextField/PickerTextField.classes.d.ts +7 -0
- package/src/PickerTextField/PickerTextField.d.ts +5 -0
- package/src/PickerTextField/PickerTextField.type.d.ts +30 -0
- package/src/PickerTextField/index.d.ts +3 -0
- package/src/Popover/Popover.classes.d.ts +7 -0
- package/src/Popover/Popover.d.ts +5 -0
- package/src/Popover/Popover.type.d.ts +50 -0
- package/src/Popover/index.d.ts +3 -0
- package/src/Popper/Popper.d.ts +4 -0
- package/src/Popper/Popper.type.d.ts +92 -0
- package/src/Popper/index.d.ts +2 -0
- package/src/PopperPaper/PopperPaper.classes.d.ts +7 -0
- package/src/PopperPaper/PopperPaper.d.ts +5 -0
- package/src/PopperPaper/PopperPaper.type.d.ts +8 -0
- package/src/PopperPaper/index.d.ts +3 -0
- package/src/Portal/Portal.d.ts +2 -0
- package/src/Portal/index.d.ts +1 -0
- package/src/Radio/Radio.classes.d.ts +7 -0
- package/src/Radio/Radio.d.ts +12 -0
- package/src/Radio/Radio.type.d.ts +16 -0
- package/src/Radio/index.d.ts +3 -0
- package/src/RadioGroup/RadioGroup.classes.d.ts +7 -0
- package/src/RadioGroup/RadioGroup.context.d.ts +15 -0
- package/src/RadioGroup/RadioGroup.d.ts +5 -0
- package/src/RadioGroup/RadioGroup.type.d.ts +14 -0
- package/src/RadioGroup/index.d.ts +4 -0
- package/src/Rating/Rating.classes.d.ts +7 -0
- package/src/Rating/Rating.d.ts +5 -0
- package/src/Rating/Rating.type.d.ts +106 -0
- package/src/Rating/RatingItem.d.ts +3 -0
- package/src/Rating/index.d.ts +5 -0
- package/src/Rating/utils.d.ts +5 -0
- package/src/Select/Select.classes.d.ts +11 -0
- package/src/Select/Select.d.ts +4 -0
- package/src/Select/Select.type.d.ts +118 -0
- package/src/Select/index.d.ts +4 -0
- package/src/Select/useSelect.d.ts +16 -0
- package/src/SingleFilter/FilterButton/FilterButton.classes.d.ts +7 -0
- package/src/SingleFilter/FilterButton/FilterButton.d.ts +5 -0
- package/src/SingleFilter/FilterButton/FilterButton.type.d.ts +27 -0
- package/src/SingleFilter/FilterButton/index.d.ts +3 -0
- package/src/SingleFilter/SingleFilter.classes.d.ts +7 -0
- package/src/SingleFilter/SingleFilter.d.ts +5 -0
- package/src/SingleFilter/SingleFilter.type.d.ts +44 -0
- package/src/SingleFilter/index.d.ts +4 -0
- package/src/Skeleton/Skeleton.classes.d.ts +7 -0
- package/src/Skeleton/Skeleton.d.ts +5 -0
- package/src/Skeleton/Skeleton.type.d.ts +6 -0
- package/src/Skeleton/SkeletonContainer/SkeletonContainer.classes.d.ts +7 -0
- package/src/Skeleton/SkeletonContainer/SkeletonContainer.d.ts +5 -0
- package/src/Skeleton/SkeletonContainer/SkeletonContainer.type.d.ts +11 -0
- package/src/Skeleton/SkeletonContainer/index.d.ts +3 -0
- package/src/Skeleton/index.d.ts +4 -0
- package/src/Slider/Slider.classes.d.ts +13 -0
- package/src/Slider/Slider.d.ts +10 -0
- package/src/Slider/Slider.type.d.ts +137 -0
- package/src/Slider/SliderThumb.d.ts +16 -0
- package/src/Slider/index.d.ts +3 -0
- package/src/Slider/utils.d.ts +1 -0
- package/src/Snackbar/Snackbar.classes.d.ts +7 -0
- package/src/Snackbar/Snackbar.d.ts +5 -0
- package/src/Snackbar/Snackbar.hook.d.ts +1 -0
- package/src/Snackbar/Snackbar.type.d.ts +27 -0
- package/src/Snackbar/SnackbarContent/SnackbarContent.classes.d.ts +8 -0
- package/src/Snackbar/SnackbarContent/SnackbarContent.d.ts +5 -0
- package/src/Snackbar/SnackbarContent/SnackbarContent.type.d.ts +4 -0
- package/src/Snackbar/SnackbarContent/index.d.ts +3 -0
- package/src/Snackbar/index.d.ts +5 -0
- package/src/SortableList/SortableList.d.ts +3 -0
- package/src/SortableList/SortableList.type.d.ts +20 -0
- package/src/SortableList/index.d.ts +2 -0
- package/src/SortableListDndContext/DndKeyboardBlocker.d.ts +2 -0
- package/src/SortableListDndContext/SortableListDndContext.d.ts +4 -0
- package/src/SortableListDndContext/SortableListDndContext.type.d.ts +5 -0
- package/src/SortableListDndContext/index.d.ts +5 -0
- package/src/SortableListDndContext/useSortableListDndContext.d.ts +2 -0
- package/src/SortableListDndContext/utils.d.ts +1 -0
- package/src/SortableListItem/SortableListItem.d.ts +4 -0
- package/src/SortableListItem/SortableListItem.type.d.ts +6 -0
- package/src/SortableListItem/SortableListItemOverlay.d.ts +4 -0
- package/src/SortableListItem/SortableListItemOverlay.type.d.ts +8 -0
- package/src/SortableListItem/index.d.ts +4 -0
- package/src/SortableVirtualizedList/SortableVirtualizedList.d.ts +3 -0
- package/src/SortableVirtualizedList/SortableVirtualizedList.type.d.ts +19 -0
- package/src/SortableVirtualizedList/index.d.ts +2 -0
- package/src/SplitButton/SplitButton.classes.d.ts +8 -0
- package/src/SplitButton/SplitButton.d.ts +5 -0
- package/src/SplitButton/SplitButton.type.d.ts +37 -0
- package/src/SplitButton/index.d.ts +3 -0
- package/src/Squircle/Squircle.d.ts +4 -0
- package/src/Squircle/Squircle.type.d.ts +19 -0
- package/src/Squircle/index.d.ts +3 -0
- package/src/Squircle/squircle.classes.d.ts +7 -0
- package/src/StatusIndicator/StatusIndicator.classes.d.ts +7 -0
- package/src/StatusIndicator/StatusIndicator.d.ts +8 -0
- package/src/StatusIndicator/StatusIndicator.type.d.ts +14 -0
- package/src/StatusIndicator/index.d.ts +3 -0
- package/src/Step/Step.classes.d.ts +7 -0
- package/src/Step/Step.d.ts +4 -0
- package/src/Step/Step.type.d.ts +50 -0
- package/src/Step/StepContext.d.ts +22 -0
- package/src/Step/index.d.ts +4 -0
- package/src/StepButton/StepButton.classes.d.ts +7 -0
- package/src/StepButton/StepButton.d.ts +4 -0
- package/src/StepButton/StepButton.type.d.ts +34 -0
- package/src/StepButton/index.d.ts +3 -0
- package/src/StepConnector/StepConnector.classes.d.ts +7 -0
- package/src/StepConnector/StepConnector.d.ts +5 -0
- package/src/StepConnector/StepConnector.type.d.ts +3 -0
- package/src/StepConnector/index.d.ts +3 -0
- package/src/StepContent/StepContent.classes.d.ts +7 -0
- package/src/StepContent/StepContent.d.ts +5 -0
- package/src/StepContent/StepContent.type.d.ts +14 -0
- package/src/StepContent/index.d.ts +3 -0
- package/src/StepIcon/StepIcon.classes.d.ts +7 -0
- package/src/StepIcon/StepIcon.d.ts +5 -0
- package/src/StepIcon/StepIcon.type.d.ts +38 -0
- package/src/StepIcon/index.d.ts +3 -0
- package/src/StepLabel/StepLabel.classes.d.ts +10 -0
- package/src/StepLabel/StepLabel.d.ts +5 -0
- package/src/StepLabel/StepLabel.type.d.ts +36 -0
- package/src/StepLabel/index.d.ts +3 -0
- package/src/Stepper/Stepper.classes.d.ts +7 -0
- package/src/Stepper/Stepper.d.ts +4 -0
- package/src/Stepper/Stepper.type.d.ts +47 -0
- package/src/Stepper/StepperContext.d.ts +11 -0
- package/src/Stepper/index.d.ts +4 -0
- package/src/SubMenu/PopperMenu.classes.d.ts +7 -0
- package/src/SubMenu/PopperMenu.d.ts +5 -0
- package/src/SubMenu/PopperMenu.type.d.ts +4 -0
- package/src/SubMenu/SubMenu.d.ts +4 -0
- package/src/SubMenu/SubMenu.type.d.ts +6 -0
- package/src/SubMenu/index.d.ts +5 -0
- package/src/SwipeableDrawer/SwipeableDrawer.classes.d.ts +7 -0
- package/src/SwipeableDrawer/SwipeableDrawer.d.ts +31 -0
- package/src/SwipeableDrawer/SwipeableDrawer.types.d.ts +82 -0
- package/src/SwipeableDrawer/hooks/index.d.ts +5 -0
- package/src/SwipeableDrawer/hooks/useDimensions.d.ts +17 -0
- package/src/SwipeableDrawer/hooks/useDrawerGestures.d.ts +151 -0
- package/src/SwipeableDrawer/hooks/useElementSizeObserver.d.ts +10 -0
- package/src/SwipeableDrawer/hooks/useReady.d.ts +4 -0
- package/src/SwipeableDrawer/hooks/useSnapPoints.d.ts +94 -0
- package/src/SwipeableDrawer/index.d.ts +3 -0
- package/src/Switch/Switch.classes.d.ts +7 -0
- package/src/Switch/Switch.d.ts +11 -0
- package/src/Switch/Switch.type.d.ts +19 -0
- package/src/Switch/index.d.ts +3 -0
- package/src/Tab/Tab.classes.d.ts +10 -0
- package/src/Tab/Tab.d.ts +5 -0
- package/src/Tab/Tab.type.d.ts +50 -0
- package/src/Tab/index.d.ts +3 -0
- package/src/TabContext/TabContext.d.ts +20 -0
- package/src/TabContext/TabContext.type.d.ts +13 -0
- package/src/TabContext/index.d.ts +2 -0
- package/src/TabPanel/TabPanel.classes.d.ts +7 -0
- package/src/TabPanel/TabPanel.d.ts +5 -0
- package/src/TabPanel/TabPanel.type.d.ts +18 -0
- package/src/TabPanel/index.d.ts +3 -0
- package/src/Table/Table.classes.d.ts +7 -0
- package/src/Table/Table.d.ts +4 -0
- package/src/Table/Table.type.d.ts +36 -0
- package/src/Table/TableContext.d.ts +8 -0
- package/src/Table/Tablelvl2Context.d.ts +7 -0
- package/src/Table/index.d.ts +5 -0
- package/src/TableBody/TableBody.classes.d.ts +7 -0
- package/src/TableBody/TableBody.d.ts +4 -0
- package/src/TableBody/TableBody.type.d.ts +17 -0
- package/src/TableBody/index.d.ts +3 -0
- package/src/TableCell/TableCell.classes.d.ts +7 -0
- package/src/TableCell/TableCell.d.ts +8 -0
- package/src/TableCell/TableCell.type.d.ts +59 -0
- package/src/TableCell/index.d.ts +3 -0
- package/src/TableContainer/TableContainer.classes.d.ts +8 -0
- package/src/TableContainer/TableContainer.d.ts +4 -0
- package/src/TableContainer/TableContainer.type.d.ts +23 -0
- package/src/TableContainer/index.d.ts +3 -0
- package/src/TableFooter/TableFooter.classes.d.ts +8 -0
- package/src/TableFooter/TableFooter.d.ts +5 -0
- package/src/TableFooter/TableFooter.type.d.ts +9 -0
- package/src/TableFooter/index.d.ts +2 -0
- package/src/TableHead/TableHead.classes.d.ts +7 -0
- package/src/TableHead/TableHead.d.ts +4 -0
- package/src/TableHead/TableHead.type.d.ts +21 -0
- package/src/TableHead/index.d.ts +3 -0
- package/src/TablePagination/TablePagination.classes.d.ts +8 -0
- package/src/TablePagination/TablePagination.d.ts +4 -0
- package/src/TablePagination/TablePagination.type.d.ts +73 -0
- package/src/TablePagination/index.d.ts +2 -0
- package/src/TableRow/TableRow.classes.d.ts +7 -0
- package/src/TableRow/TableRow.d.ts +4 -0
- package/src/TableRow/TableRow.type.d.ts +34 -0
- package/src/TableRow/index.d.ts +3 -0
- package/src/Tabs/TabMoreMenu.d.ts +36 -0
- package/src/Tabs/TabScrollButton.d.ts +21 -0
- package/src/Tabs/Tabs.classes.d.ts +19 -0
- package/src/Tabs/Tabs.d.ts +5 -0
- package/src/Tabs/Tabs.type.d.ts +54 -0
- package/src/Tabs/TabsContext.d.ts +9 -0
- package/src/Tabs/hooks/index.d.ts +2 -0
- package/src/Tabs/hooks/useComputedTabs.d.ts +20 -0
- package/src/Tabs/hooks/useTabsScroller.d.ts +48 -0
- package/src/Tabs/index.d.ts +7 -0
- package/src/Tag/Tag.classes.d.ts +8 -0
- package/src/Tag/Tag.d.ts +5 -0
- package/src/Tag/Tag.type.d.ts +23 -0
- package/src/Tag/index.d.ts +3 -0
- package/src/Text/Text.classes.d.ts +7 -0
- package/src/Text/Text.d.ts +4 -0
- package/src/Text/Text.type.d.ts +34 -0
- package/src/Text/index.d.ts +3 -0
- package/src/TextField/TextField.classes.d.ts +7 -0
- package/src/TextField/TextField.d.ts +5 -0
- package/src/TextField/TextField.type.d.ts +112 -0
- package/src/TextField/index.d.ts +3 -0
- package/src/Textarea/Textarea.classes.d.ts +10 -0
- package/src/Textarea/Textarea.d.ts +5 -0
- package/src/Textarea/Textarea.type.d.ts +26 -0
- package/src/Textarea/index.d.ts +3 -0
- package/src/TimePicker/NumberPicker.d.ts +5 -0
- package/src/TimePicker/NumberPicker.type.d.ts +36 -0
- package/src/TimePicker/PickerView.d.ts +4 -0
- package/src/TimePicker/PickerView.type.d.ts +25 -0
- package/src/TimePicker/SelectionView.d.ts +19 -0
- package/src/TimePicker/TimeButton.d.ts +11 -0
- package/src/TimePicker/TimePicker.classes.d.ts +7 -0
- package/src/TimePicker/TimePicker.context.d.ts +6 -0
- package/src/TimePicker/TimePicker.d.ts +5 -0
- package/src/TimePicker/TimePicker.type.d.ts +30 -0
- package/src/TimePicker/ToggleText.d.ts +5 -0
- package/src/TimePicker/ToggleText.type.d.ts +14 -0
- package/src/TimePicker/constant.d.ts +7 -0
- package/src/TimePicker/index.d.ts +14 -0
- package/src/TimePicker/utils/A11yUtils.d.ts +2 -0
- package/src/TimePicker/utils/TimeBoundary.d.ts +27 -0
- package/src/TimePicker/utils/TimePickerHelper.d.ts +52 -0
- package/src/TimePicker/utils/getNumberPickerBoundary.d.ts +22 -0
- package/src/TimePicker/utils/index.d.ts +4 -0
- package/src/TimePicker/utils/runKeyHandler.d.ts +4 -0
- package/src/Tooltip/Tooltip.d.ts +5 -0
- package/src/Tooltip/Tooltip.type.d.ts +5 -0
- package/src/Tooltip/TooltipTrigger.a11y.d.ts +38 -0
- package/src/Tooltip/TooltipTrigger.d.ts +4 -0
- package/src/Tooltip/TooltipTrigger.type.d.ts +59 -0
- package/src/Tooltip/TooltipView.classes.d.ts +8 -0
- package/src/Tooltip/TooltipView.d.ts +16 -0
- package/src/Tooltip/TooltipView.type.d.ts +44 -0
- package/src/Tooltip/index.d.ts +9 -0
- package/src/Tooltip/useTooltipForceHide.d.ts +8 -0
- package/src/Tooltip/withTooltip/index.d.ts +1 -0
- package/src/Tooltip/withTooltip/withTooltip.d.ts +6 -0
- package/src/Tray/Tray.classes.d.ts +13 -0
- package/src/Tray/Tray.d.ts +5 -0
- package/src/Tray/Tray.type.d.ts +26 -0
- package/src/Tray/TrayContext.d.ts +14 -0
- package/src/Tray/TrayPanel.d.ts +7 -0
- package/src/Tray/hooks/index.d.ts +3 -0
- package/src/Tray/hooks/useTray.d.ts +33 -0
- package/src/Tray/hooks/useTrayNavigate.d.ts +5 -0
- package/src/Tray/hooks/useTrayPanel.d.ts +14 -0
- package/src/Tray/index.d.ts +7 -0
- package/src/Tray/types.d.ts +2 -0
- package/src/TrayMenu/TrayMenu.d.ts +4 -0
- package/src/TrayMenu/TrayMenu.type.d.ts +3 -0
- package/src/TrayMenu/TrayMenuItem.d.ts +9 -0
- package/src/TrayMenu/index.d.ts +3 -0
- package/src/VirtualizedList/VirtualizedItemPropsContext.d.ts +5 -0
- package/src/VirtualizedList/VirtualizedList.d.ts +3 -0
- package/src/VirtualizedList/VirtualizedList.type.d.ts +51 -0
- package/src/VirtualizedList/VirtuosoComponents.d.ts +16 -0
- package/src/VirtualizedList/VirtuosoContextType.d.ts +14 -0
- package/src/VirtualizedList/index.d.ts +5 -0
- package/src/VirtualizedMenu/VirtualizedMenu.classes.d.ts +7 -0
- package/src/VirtualizedMenu/VirtualizedMenu.context.d.ts +6 -0
- package/src/VirtualizedMenu/VirtualizedMenu.d.ts +4 -0
- package/src/VirtualizedMenu/VirtualizedMenu.type.d.ts +35 -0
- package/src/VirtualizedMenu/VirtualizedMenuList.d.ts +6 -0
- package/src/VirtualizedMenu/index.d.ts +5 -0
- package/src/VisuallyHidden/VisuallyHidden.classes.d.ts +7 -0
- package/src/VisuallyHidden/VisuallyHidden.d.ts +5 -0
- package/src/VisuallyHidden/VisuallyHidden.type.d.ts +3 -0
- package/src/VisuallyHidden/index.d.ts +3 -0
- package/src/index.d.ts +112 -0
package/chunks/Chip.js
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
+
import { forwardRef } from 'react';
|
|
3
|
+
import { useButton } from '@mui/base';
|
|
4
|
+
import { useClasses, useId, getTitle, isDeleteKeyboardEvent } from '@ringcentral/spring-base';
|
|
5
|
+
import { Xmd } from '@ringcentral/spring-icon';
|
|
6
|
+
import { useThemeProps } from '@ringcentral/spring-theme';
|
|
7
|
+
import { I as IconButton } from './IconButtonLabel.js';
|
|
8
|
+
|
|
9
|
+
const Chip = forwardRef((inProps, ref) => {
|
|
10
|
+
const props = useThemeProps({ props: inProps, name: 'Chip' });
|
|
11
|
+
const { component: ChipRoot = 'div', classes, className, children, label, startSlot, size = 'large', clickable: clickableProp, truncate = true, color = 'default', DeleteIconProps = {}, disabled, onClick, onDelete, onKeyDown, onKeyUp, ...rest } = props;
|
|
12
|
+
const cls = useClasses('chip', classes, className);
|
|
13
|
+
const handleDeleteIconClick = (event) => {
|
|
14
|
+
// Stop the event from bubbling up to the `Chip`
|
|
15
|
+
event.stopPropagation();
|
|
16
|
+
if (onDelete) {
|
|
17
|
+
onDelete(event);
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
const handleKeyDown = (event) => {
|
|
21
|
+
// Ignore events from children of `Chip`.
|
|
22
|
+
if (event.currentTarget === event.target &&
|
|
23
|
+
isDeleteKeyboardEvent(event)) {
|
|
24
|
+
// Will be handled in keyUp, otherwise some browsers
|
|
25
|
+
// might init navigation
|
|
26
|
+
event.preventDefault();
|
|
27
|
+
}
|
|
28
|
+
if (onKeyDown) {
|
|
29
|
+
onKeyDown(event);
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
const handleKeyUp = (event) => {
|
|
33
|
+
// Ignore events from children of `Chip`.
|
|
34
|
+
if (event.currentTarget === event.target &&
|
|
35
|
+
onDelete &&
|
|
36
|
+
isDeleteKeyboardEvent(event)) {
|
|
37
|
+
onDelete(event);
|
|
38
|
+
}
|
|
39
|
+
if (onKeyUp) {
|
|
40
|
+
onKeyUp(event);
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
const clickable = clickableProp !== false && onClick ? true : clickableProp;
|
|
44
|
+
const deleteIconButtonVariant = !clickable && color === 'default' ? 'contained' : 'inverted';
|
|
45
|
+
const deleteIconButtonColor = !clickable && color === 'error' ? 'danger' : 'secondary';
|
|
46
|
+
const deleteIconButtonSize = size === 'small' ? 'xsmall' : 'small';
|
|
47
|
+
const { onDelete: _, ...buttonProps } = props;
|
|
48
|
+
const { getRootProps } = useButton({
|
|
49
|
+
...buttonProps,
|
|
50
|
+
rootRef: ref,
|
|
51
|
+
});
|
|
52
|
+
const rootProps = clickable
|
|
53
|
+
? {
|
|
54
|
+
className: cls('root', color, size, {
|
|
55
|
+
clickable,
|
|
56
|
+
disabled,
|
|
57
|
+
truncate,
|
|
58
|
+
}),
|
|
59
|
+
...rest,
|
|
60
|
+
...getRootProps({ onKeyDown: handleKeyDown, onKeyUp: handleKeyUp }),
|
|
61
|
+
}
|
|
62
|
+
: {
|
|
63
|
+
className: cls('root', color, size, { disabled, truncate }),
|
|
64
|
+
...rest,
|
|
65
|
+
ref,
|
|
66
|
+
};
|
|
67
|
+
const labelId = useId();
|
|
68
|
+
const nonInteractiveDeleteProps = {
|
|
69
|
+
tabIndex: -1,
|
|
70
|
+
component: 'span',
|
|
71
|
+
role: 'presentation',
|
|
72
|
+
};
|
|
73
|
+
const deleteIcon = onDelete ? (jsx(IconButton, { background: false, className: cls('delete-icon'), variant: deleteIconButtonVariant, color: deleteIconButtonColor, size: deleteIconButtonSize, symbol: Xmd, onClick: handleDeleteIconClick, "aria-describedby": labelId, ...(clickable ? nonInteractiveDeleteProps : {}), ...DeleteIconProps })) : null;
|
|
74
|
+
return (jsxs(ChipRoot, { ...rootProps, children: [startSlot, jsx("span", { id: labelId, className: cls('label'), title: getTitle(label), children: label }), deleteIcon] }));
|
|
75
|
+
});
|
|
76
|
+
Chip.displayName = 'SuiChip';
|
|
77
|
+
|
|
78
|
+
export { Chip as C };
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { forwardRef } from 'react';
|
|
3
|
+
import { MotionConfig, motion } from 'framer-motion';
|
|
4
|
+
import { useClasses } from '@ringcentral/spring-base';
|
|
5
|
+
import { useThemeProps } from '@ringcentral/spring-theme';
|
|
6
|
+
|
|
7
|
+
const indeterminateTransition = {
|
|
8
|
+
type: 'tween',
|
|
9
|
+
duration: 1,
|
|
10
|
+
ease: 'easeInOut',
|
|
11
|
+
};
|
|
12
|
+
const radialGradientScaleMultiplier = {
|
|
13
|
+
xlarge: [2.7, 3],
|
|
14
|
+
large: [3, 3.5],
|
|
15
|
+
medium: [2.7, 3],
|
|
16
|
+
small: [3.5, 3],
|
|
17
|
+
xsmall: [3.5, 3],
|
|
18
|
+
};
|
|
19
|
+
const CircularProgressIndicator = forwardRef((inProps, ref) => {
|
|
20
|
+
const props = useThemeProps({
|
|
21
|
+
props: inProps,
|
|
22
|
+
name: 'CircularProgressIndicator',
|
|
23
|
+
});
|
|
24
|
+
const { classes, className, children, variant = 'indeterminate', size = 'large', color = 'primary', value, progressBarProps: progressBarPropsProp, ...rest } = props;
|
|
25
|
+
const cls = useClasses('circular-progress-indicator', classes, className);
|
|
26
|
+
const progressBarProps = progressBarPropsProp || {};
|
|
27
|
+
let content = null;
|
|
28
|
+
if (variant === 'indeterminate') {
|
|
29
|
+
const [scale, scaleMultiplier] = radialGradientScaleMultiplier[size];
|
|
30
|
+
content = (jsx(MotionConfig, { reducedMotion: "never", children: jsx(motion.span, { className: cls('outer-circle', `${variant}-outer-circle`), animate: {
|
|
31
|
+
rotate: 360,
|
|
32
|
+
transition: {
|
|
33
|
+
repeat: Infinity,
|
|
34
|
+
...indeterminateTransition,
|
|
35
|
+
},
|
|
36
|
+
}, children: jsx(motion.span, { className: cls('inner-circle', `${variant}-inner-circle`), animate: {
|
|
37
|
+
scale: [scale, scale * scaleMultiplier, scale],
|
|
38
|
+
opacity: [0.5, 1, 0.5],
|
|
39
|
+
transition: {
|
|
40
|
+
repeat: Infinity,
|
|
41
|
+
repeatType: 'loop',
|
|
42
|
+
...indeterminateTransition,
|
|
43
|
+
},
|
|
44
|
+
} }) }) }));
|
|
45
|
+
}
|
|
46
|
+
else if (variant === 'determinate') {
|
|
47
|
+
if (value === undefined) {
|
|
48
|
+
throw new Error('The value prop is required for a determinate CircularProgressIndicator');
|
|
49
|
+
}
|
|
50
|
+
progressBarProps['aria-valuenow'] = value;
|
|
51
|
+
progressBarProps['aria-valuemin'] = 0;
|
|
52
|
+
progressBarProps['aria-valuemax'] = 100;
|
|
53
|
+
const radius = 28;
|
|
54
|
+
const circumference = 2 * Math.PI * radius;
|
|
55
|
+
const offset = circumference - (value / 100) * circumference;
|
|
56
|
+
content = (jsx("svg", { width: '100%', height: '100%', viewBox: "0 0 56 56", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: jsx("circle", { className: cls('progress-circle', `${variant}-progress-circle`), cx: "28", cy: "28", r: radius, fill: "none", strokeWidth: 18, strokeDasharray: circumference, strokeDashoffset: offset, transform: "rotate(-90 28 28)" }) }));
|
|
57
|
+
}
|
|
58
|
+
return (jsx("span", { className: cls('root', variant, size, color, `${variant}-${size}`, `${variant}-${color}`), ...rest, ...progressBarProps, role: "progressbar", ref: ref, children: content }));
|
|
59
|
+
});
|
|
60
|
+
CircularProgressIndicator.displayName = 'SuiProgressIndicator';
|
|
61
|
+
|
|
62
|
+
export { CircularProgressIndicator as C };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { forwardRef } from 'react';
|
|
3
|
+
import { useClasses } from '@ringcentral/spring-base';
|
|
4
|
+
import { useThemeProps } from '@ringcentral/spring-theme';
|
|
5
|
+
|
|
6
|
+
const Divider = forwardRef((inProps, ref) => {
|
|
7
|
+
const props = useThemeProps({ props: inProps, name: 'Divider' });
|
|
8
|
+
const { component: DividerRoot = 'hr', variant = 'full', orientation = 'horizontal', classes, className, children, flexItem = false, title, ...rest } = props;
|
|
9
|
+
const cls = useClasses('divider', classes, className);
|
|
10
|
+
const role = DividerRoot !== 'hr' ? 'separator' : undefined;
|
|
11
|
+
const hasTitle = title !== undefined;
|
|
12
|
+
return (jsx(DividerRoot, { role: role, className: cls('root', variant, orientation, {
|
|
13
|
+
'flex-item': flexItem,
|
|
14
|
+
'has-title': hasTitle,
|
|
15
|
+
}, `${variant}-${orientation}`, hasTitle && `${orientation}-has-title`), "data-title": title, ref: ref, ...rest, children: children }));
|
|
16
|
+
});
|
|
17
|
+
Divider.displayName = 'SuiDivider';
|
|
18
|
+
|
|
19
|
+
export { Divider as D };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { forwardRef } from 'react';
|
|
3
|
+
import { useClasses } from '@ringcentral/spring-base';
|
|
4
|
+
|
|
5
|
+
const DragHandle = forwardRef((props, ref) => {
|
|
6
|
+
const { component: DragHandleRoot = 'div', anchor = 'top', classes, className, ...rest } = props;
|
|
7
|
+
const cls = useClasses('drag-handle', classes, className);
|
|
8
|
+
return (jsx(DragHandleRoot, { ref: ref, className: cls('root', anchor), role: "presentation", "aria-hidden": "true", ...rest, children: jsx("div", { className: cls('bar') }) }));
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
export { DragHandle as D };
|
package/chunks/Drawer.js
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
+
import { forwardRef } from 'react';
|
|
3
|
+
import { motion } from 'framer-motion';
|
|
4
|
+
import { useClasses } from '@ringcentral/spring-base';
|
|
5
|
+
import { useThemeProps, motionTransition } from '@ringcentral/spring-theme';
|
|
6
|
+
import clsx from 'clsx';
|
|
7
|
+
import './Icon.js';
|
|
8
|
+
import { u as usePrefersReducedMotion } from './usePrefersReducedMotion.js';
|
|
9
|
+
import { g as getSlideIn } from './getSlideIn.js';
|
|
10
|
+
import { M as Modal } from './Modal.js';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Drawer Component - Base drawer without gesture support
|
|
14
|
+
*
|
|
15
|
+
* A clean, lightweight drawer component that provides basic modal/slide functionality.
|
|
16
|
+
* For gesture support, use SwipeableDrawer which builds on top of this component.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```tsx
|
|
20
|
+
* // Simple navigation drawer
|
|
21
|
+
* <Drawer
|
|
22
|
+
* open={open}
|
|
23
|
+
* onClose={onClose}
|
|
24
|
+
* anchor="left"
|
|
25
|
+
* variant="temporary"
|
|
26
|
+
* >
|
|
27
|
+
* <Navigation />
|
|
28
|
+
* </Drawer>
|
|
29
|
+
*
|
|
30
|
+
* // Bottom sheet without gestures
|
|
31
|
+
* <Drawer
|
|
32
|
+
* open={open}
|
|
33
|
+
* onClose={onClose}
|
|
34
|
+
* anchor="bottom"
|
|
35
|
+
* >
|
|
36
|
+
* <Content />
|
|
37
|
+
* </Drawer>
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
const Drawer = forwardRef((inProps, ref) => {
|
|
41
|
+
const props = useThemeProps({ props: inProps, name: 'Drawer' });
|
|
42
|
+
const { anchor = 'left', bodyProps, classes, className, children, header, footer, open, onClose, variant = 'temporary', // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
43
|
+
blocking = true, measurementRefs, headerProps, ...rest } = props;
|
|
44
|
+
const headerRef = measurementRefs?.header;
|
|
45
|
+
const footerRef = measurementRefs?.footer;
|
|
46
|
+
const contentRef = measurementRefs?.content;
|
|
47
|
+
const cls = useClasses('drawer', classes, className);
|
|
48
|
+
const slideInProps = getSlideIn({
|
|
49
|
+
toggle: open,
|
|
50
|
+
from: anchor,
|
|
51
|
+
prefersReducedMotion: usePrefersReducedMotion(),
|
|
52
|
+
toggleOnTransition: motionTransition['neutral-01-fast'],
|
|
53
|
+
toggleOffTransition: motionTransition['neutral-01-fast'],
|
|
54
|
+
});
|
|
55
|
+
return (jsx(Modal, { open: open, onClose: onClose, blocking: blocking, disableScrollLock: !blocking, disableBackdropClick: !blocking, disableEscapeKeyDown: !blocking, hideBackdrop: !blocking, className: clsx(cls('root', `anchor-${anchor}`, {
|
|
56
|
+
'non-blocking': !blocking,
|
|
57
|
+
})), ...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 }))] }) }));
|
|
58
|
+
});
|
|
59
|
+
Drawer.displayName = 'SuiDrawer';
|
|
60
|
+
|
|
61
|
+
export { Drawer as D };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { motion } from 'framer-motion';
|
|
3
|
+
import { useClasses } from '@ringcentral/spring-base';
|
|
4
|
+
import { motionTransition } from '@ringcentral/spring-theme';
|
|
5
|
+
import { I as Icon } from './Icon.js';
|
|
6
|
+
import 'react';
|
|
7
|
+
import { u as useMotionSafeTransition } from './useMotionSafeTransition.js';
|
|
8
|
+
|
|
9
|
+
const motionVariants = {
|
|
10
|
+
expanded: {
|
|
11
|
+
d: 'M 4.5 12.8 L 9.85 7.525 L 15.1 12.8',
|
|
12
|
+
},
|
|
13
|
+
collapsed: {
|
|
14
|
+
d: 'M 4.5 7.5 L 9.85 12.9 L 15.15 7.55',
|
|
15
|
+
},
|
|
16
|
+
};
|
|
17
|
+
const ExpandCollapseCaret = (props) => {
|
|
18
|
+
const { size = 'small', orientation = 'vertical', expanded, classes, className, ...rest } = props;
|
|
19
|
+
const cls = useClasses('expand-collapse-caret', classes, className);
|
|
20
|
+
const transition = useMotionSafeTransition(motionTransition['spring-01-fast']);
|
|
21
|
+
return (jsx(Icon, { ...rest, size: size, className: cls('root', orientation), children: jsx(motion.svg, { xmlns: "http://www.w3.org/2000/svg", viewBox: '0 0 20 20', children: jsx(motion.path, { initial: false, stroke: "currentColor", strokeWidth: 1.5, variants: motionVariants, animate: expanded ? 'expanded' : 'collapsed', transition: transition, fill: "transparent" }) }) }));
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export { ExpandCollapseCaret as E };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { createContext, useContext, forwardRef, useMemo } from 'react';
|
|
3
|
+
import { useClasses, useId } from '@ringcentral/spring-base';
|
|
4
|
+
import { useThemeProps } from '@ringcentral/spring-theme';
|
|
5
|
+
|
|
6
|
+
const FormLabelContext = createContext({});
|
|
7
|
+
const useFormLabel = (props) => {
|
|
8
|
+
const { disabled: disabledProp, id: idProp, value: valueProp } = props;
|
|
9
|
+
const { disabled: innerDisabled, id: innerId, value: innerValue, } = useContext(FormLabelContext);
|
|
10
|
+
const disabled = disabledProp ?? innerDisabled;
|
|
11
|
+
const id = idProp ?? innerId;
|
|
12
|
+
const value = valueProp ?? innerValue;
|
|
13
|
+
return { id, disabled, value };
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
const FormLabel = forwardRef((inProps, ref) => {
|
|
17
|
+
const props = useThemeProps({ props: inProps, name: 'FormLabel' });
|
|
18
|
+
const { classes, className, children, label, value, labelRef, id: idProp, disabled = false, fullWidth = false, placement = 'end', rootProps, ...rest } = props;
|
|
19
|
+
const cls = useClasses('form-label', classes, className);
|
|
20
|
+
const innerId = useId();
|
|
21
|
+
const id = idProp || innerId;
|
|
22
|
+
const formLabelContextValue = useMemo(() => ({ id, disabled, value }), [disabled, id, value]);
|
|
23
|
+
return (jsxs("div", { className: cls('root', placement, { 'full-width': fullWidth }), ref: ref, ...rootProps, children: [jsx(FormLabelContext.Provider, { value: formLabelContextValue, children: children }), jsx("label", { className: cls('label', `${placement}-label`, { disabled }), ...rest, ref: labelRef, htmlFor: id, children: label })] }));
|
|
24
|
+
});
|
|
25
|
+
FormLabel.displayName = 'SuiFormLabel';
|
|
26
|
+
|
|
27
|
+
export { FormLabel as F, FormLabelContext as a, useFormLabel as u };
|
package/chunks/Icon.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { forwardRef, useMemo, cloneElement } from 'react';
|
|
3
|
+
import { useClasses } from '@ringcentral/spring-base';
|
|
4
|
+
import { useThemeProps } from '@ringcentral/spring-theme';
|
|
5
|
+
|
|
6
|
+
const Icon = forwardRef((inProps, ref) => {
|
|
7
|
+
const props = useThemeProps({ props: inProps, name: 'Icon' });
|
|
8
|
+
const { size = 'medium', symbol, children: childrenProp, className, classes, ...rest } = props;
|
|
9
|
+
const cls = useClasses('icon', classes, className);
|
|
10
|
+
const svgClassName = cls('svg');
|
|
11
|
+
const children = useMemo(() => {
|
|
12
|
+
if (symbol) {
|
|
13
|
+
const Comp = symbol;
|
|
14
|
+
return jsx(Comp, { className: svgClassName });
|
|
15
|
+
}
|
|
16
|
+
else if (childrenProp) {
|
|
17
|
+
return cloneElement(childrenProp, { className: svgClassName });
|
|
18
|
+
}
|
|
19
|
+
return null;
|
|
20
|
+
}, [childrenProp, svgClassName, symbol]);
|
|
21
|
+
return (jsx("span", { className: cls('root', size), ...rest, ref: ref, children: children }));
|
|
22
|
+
});
|
|
23
|
+
Icon.displayName = 'SuiIcon';
|
|
24
|
+
|
|
25
|
+
export { Icon as I };
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { forwardRef, cloneElement } from 'react';
|
|
3
|
+
import { useButton } from '@mui/base';
|
|
4
|
+
import { useClasses } from '@ringcentral/spring-base';
|
|
5
|
+
import { useThemeProps } from '@ringcentral/spring-theme';
|
|
6
|
+
import { I as Icon } from './Icon.js';
|
|
7
|
+
import { S as Squircle } from './Squircle.js';
|
|
8
|
+
import { w as withTooltip } from './withTooltip.js';
|
|
9
|
+
|
|
10
|
+
const IconSizeMap = {
|
|
11
|
+
xxxlarge: 'medium',
|
|
12
|
+
xxlarge: 'medium',
|
|
13
|
+
xlarge: 'large',
|
|
14
|
+
large: 'medium',
|
|
15
|
+
medium: 'small',
|
|
16
|
+
small: 'small',
|
|
17
|
+
xsmall: 'xsmall',
|
|
18
|
+
};
|
|
19
|
+
function sizeSupportsLabel(size) {
|
|
20
|
+
switch (size) {
|
|
21
|
+
case 'xxxlarge':
|
|
22
|
+
case 'xxlarge':
|
|
23
|
+
return true;
|
|
24
|
+
default:
|
|
25
|
+
return false;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
const IconButton = withTooltip(forwardRef((inProps, ref) => {
|
|
29
|
+
const props = useThemeProps({ props: inProps, name: 'IconButton' });
|
|
30
|
+
const { component = 'button', color = 'primary', shape = 'circular', size = 'large', background = true, variant = 'outlined', label, symbol, classes, iconSize, className, children, disabled, ...rest } = props;
|
|
31
|
+
const cls = useClasses('icon-button', classes, className);
|
|
32
|
+
const { getRootProps, focusVisible } = useButton({
|
|
33
|
+
...props,
|
|
34
|
+
rootRef: ref,
|
|
35
|
+
});
|
|
36
|
+
const rootProps = {
|
|
37
|
+
className: cls('root', size, variant, color, shape, `${size}-${shape}`, `${size}-${variant}`, `${variant}-${color}`, `${variant}-${shape}`, ...(!background
|
|
38
|
+
? [
|
|
39
|
+
'hide-background',
|
|
40
|
+
`${variant}-hide-background`,
|
|
41
|
+
`${shape}-hide-background`,
|
|
42
|
+
]
|
|
43
|
+
: []), {
|
|
44
|
+
disabled,
|
|
45
|
+
focusVisible,
|
|
46
|
+
}),
|
|
47
|
+
'aria-label': label,
|
|
48
|
+
...getRootProps(),
|
|
49
|
+
...rest,
|
|
50
|
+
};
|
|
51
|
+
const content = (jsxs(Fragment, { children: [children || (jsx(Icon, { symbol: symbol, size: iconSize ?? IconSizeMap[size] })), sizeSupportsLabel(size) && label && (jsx("span", { className: cls('label', `${size}-label`, shape === 'squircle' && `${shape}-label`, `${size}-${shape}-label`), children: label }))] }));
|
|
52
|
+
if (shape === 'squircle') {
|
|
53
|
+
return (jsx(Squircle, { ...rootProps, component: component, interactive: !disabled, focusVisible: focusVisible, children: content }));
|
|
54
|
+
}
|
|
55
|
+
const IconButtonRoot = component;
|
|
56
|
+
return jsx(IconButtonRoot, { ...rootProps, children: content });
|
|
57
|
+
}));
|
|
58
|
+
IconButton.displayName = 'SuiIconButton';
|
|
59
|
+
|
|
60
|
+
const IconButtonLabel = forwardRef((inProps, ref) => {
|
|
61
|
+
const props = useThemeProps({ props: inProps, name: 'IconButtonLabel' });
|
|
62
|
+
const { label, className, classes, children, ...rest } = props;
|
|
63
|
+
const cls = useClasses('icon-button-outer-label', classes, className);
|
|
64
|
+
const ariaLabel = children.props['aria-label'] || children.props.label || label;
|
|
65
|
+
return (jsxs("div", { className: cls('root'), ...rest, ref: ref, children: [cloneElement(children, { 'aria-label': ariaLabel }), label && jsx("span", { className: cls('text'), children: label })] }));
|
|
66
|
+
});
|
|
67
|
+
IconButtonLabel.displayName = 'SuiIconButtonLabel';
|
|
68
|
+
|
|
69
|
+
export { IconButton as I, IconButtonLabel as a };
|
package/chunks/List.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { forwardRef } from 'react';
|
|
3
|
+
import { useClasses, useForkRef } from '@ringcentral/spring-base';
|
|
4
|
+
import { useThemeProps } from '@ringcentral/spring-theme';
|
|
5
|
+
import { a as useListNavigation } from './useListNavigation.js';
|
|
6
|
+
import 'tabbable';
|
|
7
|
+
|
|
8
|
+
const List = forwardRef((inProps, ref) => {
|
|
9
|
+
const props = useThemeProps({ props: inProps, name: 'List' });
|
|
10
|
+
const { classes, className, children, onKeyDown, onFocus, preventContainerScroll, searchAndFocusItemHandler, actions, ...rest } = props;
|
|
11
|
+
const cls = useClasses('list', classes, className);
|
|
12
|
+
const { renderItems, renderTabBoundary, getListProps, listRef } = useListNavigation({
|
|
13
|
+
preventContainerScroll,
|
|
14
|
+
searchAndFocusItemHandler,
|
|
15
|
+
actions,
|
|
16
|
+
});
|
|
17
|
+
const handleRef = useForkRef(ref, listRef);
|
|
18
|
+
return (jsxs(Fragment, { children: [jsx("div", { role: "list", className: cls('root'), ...rest, ...getListProps({ onFocus, onKeyDown }), ref: handleRef, children: renderItems(children) }), renderTabBoundary()] }));
|
|
19
|
+
});
|
|
20
|
+
List.displayName = 'SuiList';
|
|
21
|
+
|
|
22
|
+
export { List as L };
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
+
import { forwardRef, useEffect } from 'react';
|
|
3
|
+
import { useClasses, useFocusVisible, useActive, useHover, combineProps, useForkRef } from '@ringcentral/spring-base';
|
|
4
|
+
import { motionTransition, useThemeProps } from '@ringcentral/spring-theme';
|
|
5
|
+
import { D as Divider } from './Divider.js';
|
|
6
|
+
import { useItemNavigation } from '../ListNavigation.js';
|
|
7
|
+
import { useVirtualizedItemPropsContext } from '../VirtualizedList.js';
|
|
8
|
+
import { AnimatePresence } from 'framer-motion';
|
|
9
|
+
import './Icon.js';
|
|
10
|
+
import { u as useMotionSafeTransition } from './useMotionSafeTransition.js';
|
|
11
|
+
import { S as SlideIn } from './SlideIn.js';
|
|
12
|
+
|
|
13
|
+
const HoverActions = (props) => {
|
|
14
|
+
const { show, children, className, instantTransition } = props;
|
|
15
|
+
const toggleOnTransition = useMotionSafeTransition(motionTransition['spring-01-fast']);
|
|
16
|
+
const toggleOffTransition = useMotionSafeTransition(motionTransition['neutral-01-fast']);
|
|
17
|
+
const slideInProps = {
|
|
18
|
+
toggle: show,
|
|
19
|
+
children,
|
|
20
|
+
className,
|
|
21
|
+
toggleOffTransition: instantTransition
|
|
22
|
+
? motionTransition['instant']
|
|
23
|
+
: toggleOffTransition,
|
|
24
|
+
toggleOnTransition: instantTransition
|
|
25
|
+
? motionTransition['instant']
|
|
26
|
+
: toggleOnTransition,
|
|
27
|
+
onClick: (e) => {
|
|
28
|
+
e.stopPropagation();
|
|
29
|
+
},
|
|
30
|
+
};
|
|
31
|
+
return (jsx(AnimatePresence, { children: show && jsx(SlideIn, { ...slideInProps, children: children }) }));
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
const ListItem = forwardRef((inProps, ref) => {
|
|
35
|
+
const props = useThemeProps({ props: inProps, name: 'ListItem' });
|
|
36
|
+
const { classes, className, children, hoverActions, size = 'small', tabIndex = -1, role = 'listitem', divider = true, onClick, clickable = Boolean(onClick), hoverable = true, focused = false, highlighted = false, autoFocus, selected, dragged, alwaysShowHoverActions = false, instantHoverActions = false, style: styleProp, ...rest } = props;
|
|
37
|
+
const cls = useClasses('list-item', classes, className);
|
|
38
|
+
const { itemRef, keyboardNavHandlers } = useItemNavigation() ?? {};
|
|
39
|
+
const virtualizedItemProps = useVirtualizedItemPropsContext();
|
|
40
|
+
const { focusVisible, focusVisibleWithin, focusVisibleRef, focusVisibleHandlers, } = useFocusVisible({ ...props, within: true });
|
|
41
|
+
const { active, activeHandlers } = useActive({
|
|
42
|
+
...props,
|
|
43
|
+
disabled: !clickable,
|
|
44
|
+
});
|
|
45
|
+
const { hover, hoverHandlers } = useHover({
|
|
46
|
+
...props,
|
|
47
|
+
// useHover only used for hover actions,
|
|
48
|
+
// so disabled when no hover actions or always show
|
|
49
|
+
disabled: !hoverable || !hoverActions,
|
|
50
|
+
});
|
|
51
|
+
const enhancedEventHandlers = (() => {
|
|
52
|
+
const handlers = {
|
|
53
|
+
...focusVisibleHandlers,
|
|
54
|
+
...activeHandlers,
|
|
55
|
+
...hoverHandlers,
|
|
56
|
+
};
|
|
57
|
+
if (keyboardNavHandlers) {
|
|
58
|
+
return combineProps(handlers, keyboardNavHandlers);
|
|
59
|
+
}
|
|
60
|
+
return handlers;
|
|
61
|
+
})();
|
|
62
|
+
const rootRef = useForkRef(itemRef, ref, focusVisibleRef);
|
|
63
|
+
useEffect(() => {
|
|
64
|
+
if (autoFocus) {
|
|
65
|
+
itemRef?.current?.focus();
|
|
66
|
+
}
|
|
67
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
68
|
+
}, []);
|
|
69
|
+
const isShowHoverAction = hover || focusVisibleWithin || alwaysShowHoverActions;
|
|
70
|
+
return (jsxs("div", { className: cls('root', size, {
|
|
71
|
+
focusVisibleWithin,
|
|
72
|
+
focusVisible,
|
|
73
|
+
active,
|
|
74
|
+
clickable,
|
|
75
|
+
hoverable,
|
|
76
|
+
selected,
|
|
77
|
+
dragged,
|
|
78
|
+
focused,
|
|
79
|
+
highlighted,
|
|
80
|
+
}), tabIndex: tabIndex, ...rest, ...enhancedEventHandlers, ...virtualizedItemProps, style: virtualizedItemProps
|
|
81
|
+
? { ...styleProp, ...virtualizedItemProps.style }
|
|
82
|
+
: styleProp, role: role, ref: rootRef, children: [jsxs("div", { className: cls('container'), children: [jsx("div", { className: cls('content'), children: children }), hoverActions && (jsx(HoverActions, { show: isShowHoverAction, className: cls('hover-actions'), instantTransition: instantHoverActions, children: hoverActions }))] }), divider && (jsx(Divider, { className: cls('divider'), orientation: "horizontal", flexItem: true }))] }));
|
|
83
|
+
});
|
|
84
|
+
ListItem.displayName = 'SuiListItem';
|
|
85
|
+
|
|
86
|
+
export { HoverActions as H, ListItem as L };
|
package/chunks/Menu.js
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { createContext, useContext, forwardRef, useMemo } from 'react';
|
|
3
|
+
import { useClasses, useEventCallback } from '@ringcentral/spring-base';
|
|
4
|
+
import { useThemeProps } from '@ringcentral/spring-theme';
|
|
5
|
+
import { a as useNestedParentMenu, N as NestedMenuContext } from './useNestedParentMenu.js';
|
|
6
|
+
import { P as Popover } from './Popover.js';
|
|
7
|
+
|
|
8
|
+
const MenuContext = createContext(null);
|
|
9
|
+
const useMenuContext = () => {
|
|
10
|
+
return useContext(MenuContext);
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
const Menu = forwardRef((inProps, ref) => {
|
|
14
|
+
const props = useThemeProps({ props: inProps, name: 'Menu' });
|
|
15
|
+
const { classes, children, open = false, onClose, autoFocus = true, className, PopperProps, ...rest } = props;
|
|
16
|
+
const cls = useClasses('menu', classes, className);
|
|
17
|
+
const padding = PopperProps?.padding;
|
|
18
|
+
const popperPadding = typeof padding === 'object'
|
|
19
|
+
? {
|
|
20
|
+
top: padding.top ?? 16,
|
|
21
|
+
right: padding.right ?? 16,
|
|
22
|
+
bottom: padding.bottom ?? 16,
|
|
23
|
+
left: padding.left ?? 16,
|
|
24
|
+
}
|
|
25
|
+
: padding ?? 16;
|
|
26
|
+
const { contextValue } = useNestedParentMenu({
|
|
27
|
+
open,
|
|
28
|
+
});
|
|
29
|
+
const closeHandler = useEventCallback(() => {
|
|
30
|
+
onClose?.(undefined, 'Other');
|
|
31
|
+
});
|
|
32
|
+
const menuContextValue = useMemo(() => {
|
|
33
|
+
return { close: closeHandler, autoFocus };
|
|
34
|
+
}, [autoFocus, closeHandler]);
|
|
35
|
+
return (jsx(Popover, { bordered: true, className: cls('root'), PopperProps: { ...PopperProps, padding: popperPadding }, ...rest, open: open, onClose: (e, reason) => {
|
|
36
|
+
onClose?.(e, reason);
|
|
37
|
+
}, ref: ref, children: jsx("div", { className: cls('paper'), children: jsx(MenuContext.Provider, { value: menuContextValue, children: jsx(NestedMenuContext.Provider, { value: contextValue, children: children }) }) }) }));
|
|
38
|
+
});
|
|
39
|
+
Menu.displayName = 'SuiMenu';
|
|
40
|
+
|
|
41
|
+
export { Menu as M, MenuContext as a, useMenuContext as u };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { forwardRef } from 'react';
|
|
3
|
+
import { useClasses } from '@ringcentral/spring-base';
|
|
4
|
+
import { useThemeProps } from '@ringcentral/spring-theme';
|
|
5
|
+
import { D as Divider } from './Divider.js';
|
|
6
|
+
|
|
7
|
+
const MenuDivider = forwardRef((inProps, ref) => {
|
|
8
|
+
const props = useThemeProps({ props: inProps, name: 'MenuDivider' });
|
|
9
|
+
const { classes, className, ...rest } = props;
|
|
10
|
+
const cls = useClasses('menu-divider', classes, className);
|
|
11
|
+
return jsx(Divider, { className: cls('root'), ...rest, ref: ref });
|
|
12
|
+
});
|
|
13
|
+
MenuDivider.displayName = 'SuiMenuDivider';
|
|
14
|
+
|
|
15
|
+
export { MenuDivider as M };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { forwardRef } from 'react';
|
|
3
|
+
import { useClasses, getTitle } from '@ringcentral/spring-base';
|
|
4
|
+
import { useThemeProps } from '@ringcentral/spring-theme';
|
|
5
|
+
|
|
6
|
+
const MenuItemText = forwardRef((inProps, ref) => {
|
|
7
|
+
const props = useThemeProps({ props: inProps, name: 'MenuItemText' });
|
|
8
|
+
const { classes, className, primary, primaryText, infoText, info, children, ...rest } = props;
|
|
9
|
+
const cls = useClasses('menu-item-text', classes, className);
|
|
10
|
+
const primaryContent = primary ?? primaryText ?? children;
|
|
11
|
+
const secondaryContent = info ?? infoText;
|
|
12
|
+
return (jsxs("div", { className: cls('root'), ...rest, ref: ref, children: [jsx("span", { className: cls('primary-text'), title: getTitle(primaryContent), children: primaryContent }), secondaryContent && (jsx("span", { className: cls('info-text'), title: getTitle(secondaryContent), children: secondaryContent }))] }));
|
|
13
|
+
});
|
|
14
|
+
MenuItemText.displayName = 'SuiMenuItemText';
|
|
15
|
+
|
|
16
|
+
export { MenuItemText as M };
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { forwardRef, useMemo, useRef, useEffect } from 'react';
|
|
3
|
+
import { useClasses, useForkRef, useWindowContext } from '@ringcentral/spring-base';
|
|
4
|
+
import { useThemeProps } from '@ringcentral/spring-theme';
|
|
5
|
+
import { L as List } from './List.js';
|
|
6
|
+
import { u as useMenuContext } from './Menu.js';
|
|
7
|
+
import { c as useMenuItemSelect, e as MenuListContext, a as MenuItemSelectContext } from './useMenuItemSelect.js';
|
|
8
|
+
import 'tabbable';
|
|
9
|
+
import './useListNavigation.js';
|
|
10
|
+
import '../VirtualizedList.js';
|
|
11
|
+
|
|
12
|
+
const MenuList = forwardRef((inProps, ref) => {
|
|
13
|
+
const props = useThemeProps({ props: inProps, name: 'MenuList' });
|
|
14
|
+
const { classes, className, children, widget, selectMode = 'single', nowrap, value: valueProp, onChange, autoFocus: autoFocusProp, ...rest } = props;
|
|
15
|
+
const menuContext = useMenuContext();
|
|
16
|
+
const autoFocus = Boolean(autoFocusProp || menuContext?.autoFocus);
|
|
17
|
+
const cls = useClasses('menu-list', classes, className);
|
|
18
|
+
const menuListContextValue = useMemo(() => ({
|
|
19
|
+
nowrap,
|
|
20
|
+
}), [nowrap]);
|
|
21
|
+
const { contextValue } = useMenuItemSelect({
|
|
22
|
+
widget,
|
|
23
|
+
selectMode,
|
|
24
|
+
value: valueProp,
|
|
25
|
+
onChange,
|
|
26
|
+
autoFocus,
|
|
27
|
+
});
|
|
28
|
+
const actions = useRef(null);
|
|
29
|
+
const listRef = useRef(null);
|
|
30
|
+
const handleListRef = useForkRef(listRef, ref);
|
|
31
|
+
const { document } = useWindowContext();
|
|
32
|
+
useEffect(() => {
|
|
33
|
+
if (autoFocus &&
|
|
34
|
+
// ensure item can auto focus correctly
|
|
35
|
+
!listRef.current?.contains(document?.activeElement ?? null)) {
|
|
36
|
+
actions.current?.focus();
|
|
37
|
+
}
|
|
38
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
39
|
+
}, []);
|
|
40
|
+
// Use appropriate role and ARIA attributes based on widget type
|
|
41
|
+
const listRole = widget === 'select' ? 'listbox' : 'menu';
|
|
42
|
+
const listboxProps = widget === 'select'
|
|
43
|
+
? { 'aria-multiselectable': selectMode === 'multiple' }
|
|
44
|
+
: {};
|
|
45
|
+
return (jsx(List, { className: cls('root'), role: listRole, ...listboxProps, ...rest, ref: handleListRef, actions: actions, children: jsx(MenuListContext.Provider, { value: menuListContextValue, children: jsx(MenuItemSelectContext.Provider, { value: contextValue, children: children }) }) }));
|
|
46
|
+
});
|
|
47
|
+
MenuList.displayName = 'SuiMenuList';
|
|
48
|
+
|
|
49
|
+
export { MenuList as M };
|