@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
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
+
import { useClasses } from '@ringcentral/spring-base';
|
|
3
|
+
import { motion } from 'framer-motion';
|
|
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 topCaretVariants = {
|
|
10
|
+
initial: {
|
|
11
|
+
d: 'M 5 7.5 L 10 2.5 L 15 7.5',
|
|
12
|
+
opacity: 1,
|
|
13
|
+
},
|
|
14
|
+
asc: {
|
|
15
|
+
d: 'M 4.75 9.5 L 10 4 L 15.25 9.5',
|
|
16
|
+
opacity: 1,
|
|
17
|
+
},
|
|
18
|
+
desc: {
|
|
19
|
+
d: 'M 10 9.5 L 10 4.5 L 10 9.5',
|
|
20
|
+
opacity: 0,
|
|
21
|
+
transition: {
|
|
22
|
+
ease: 'easeOut',
|
|
23
|
+
duration: 0.15,
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
const topLineVariants = {
|
|
28
|
+
initial: {
|
|
29
|
+
d: 'M 10 2.5 L 10 2.5',
|
|
30
|
+
opacity: 0,
|
|
31
|
+
},
|
|
32
|
+
asc: {
|
|
33
|
+
d: 'M 10 4.5 L 10 15.5',
|
|
34
|
+
opacity: 1,
|
|
35
|
+
},
|
|
36
|
+
};
|
|
37
|
+
const bottomLineVariants = {
|
|
38
|
+
initial: {
|
|
39
|
+
d: 'M 10 17.5 L 10 17.5',
|
|
40
|
+
opacity: 0,
|
|
41
|
+
},
|
|
42
|
+
desc: {
|
|
43
|
+
d: 'M 10 15.5 L 10 4.5',
|
|
44
|
+
opacity: 1,
|
|
45
|
+
},
|
|
46
|
+
};
|
|
47
|
+
const bottomCaretVariants = {
|
|
48
|
+
initial: {
|
|
49
|
+
d: 'M 5 12.5 L 10 17.5 L 15 12.5',
|
|
50
|
+
opacity: 1,
|
|
51
|
+
},
|
|
52
|
+
asc: {
|
|
53
|
+
d: 'M 10 10.5 L 10 15.5 L 10 10.5',
|
|
54
|
+
opacity: 0,
|
|
55
|
+
transition: {
|
|
56
|
+
ease: 'easeOut',
|
|
57
|
+
duration: 0.15,
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
desc: {
|
|
61
|
+
d: 'M 4.75 10.5 L 10 16 L 15.25 10.5',
|
|
62
|
+
opacity: 1,
|
|
63
|
+
},
|
|
64
|
+
};
|
|
65
|
+
const SortableArrow = (props) => {
|
|
66
|
+
const { classes, size = 'medium', direction = false, className, ...rest } = props;
|
|
67
|
+
const cls = useClasses('sortable-arrow', classes, className);
|
|
68
|
+
const caretTransition = useMotionSafeTransition(motionTransition['spring-01-fast']);
|
|
69
|
+
const lineTransition = useMotionSafeTransition(motionTransition['neutral-01-fast']);
|
|
70
|
+
return (jsx(Icon, { ...rest, size: size, className: cls('root'), children: jsxs(motion.svg, { xmlns: "http://www.w3.org/2000/svg", viewBox: '0 0 20 20', animate: direction || 'initial', children: [jsx(motion.path, { initial: false, stroke: "currentColor", strokeWidth: 1.5, strokeMiterlimit: 1.5, strokeLinejoin: 'miter', variants: topCaretVariants, transition: caretTransition, fill: "transparent" }), direction !== 'desc' && (jsx(motion.path, { initial: false, stroke: "currentColor", strokeWidth: 1.5, strokeLinecap: 'square', variants: topLineVariants, transition: lineTransition, fill: "transparent" })), direction !== 'asc' && (jsx(motion.path, { initial: false, stroke: "currentColor", strokeWidth: 1.5, strokeLinecap: 'square', variants: bottomLineVariants, transition: lineTransition, fill: "transparent" })), jsx(motion.path, { initial: false, stroke: "currentColor", strokeWidth: 1.5, strokeMiterlimit: 1.5, strokeLinejoin: 'miter', variants: bottomCaretVariants, transition: caretTransition, fill: "transparent" })] }) }));
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
export { SortableArrow as S };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import React, { forwardRef, isValidElement, cloneElement } from 'react';
|
|
3
|
+
import { useClasses, useId } from '@ringcentral/spring-base';
|
|
4
|
+
import { useThemeProps } from '@ringcentral/spring-theme';
|
|
5
|
+
|
|
6
|
+
const SQUIRCLE_PATH = 'M 0.5 0 C 0.879 0 1 0.121 1 0.5 C 1 0.879 0.879 1 0.5 1 C 0.121 1 0 0.879 0 0.5 C 0 0.121 0.121 0 0.5 0 Z';
|
|
7
|
+
const Squircle = forwardRef((inProps, ref) => {
|
|
8
|
+
const props = useThemeProps({ props: inProps, name: 'Squircle' });
|
|
9
|
+
const { component = 'div', focusVisible, active, children: childrenProp, className, classes, interactive = true, fillShape: fillShapeProp = false, ...rest } = props;
|
|
10
|
+
/**
|
|
11
|
+
* If the children passed to this component have a conditionally rendered
|
|
12
|
+
* element, using toArray will ensure that any falsy children are removed.
|
|
13
|
+
* Otherwise fillShape will always be false even if only 1 truthy child
|
|
14
|
+
* is passed to this component.
|
|
15
|
+
*/
|
|
16
|
+
const children = React.Children.toArray(childrenProp);
|
|
17
|
+
const firstChild = children[0];
|
|
18
|
+
const fillShape = fillShapeProp &&
|
|
19
|
+
firstChild &&
|
|
20
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
21
|
+
isValidElement(firstChild);
|
|
22
|
+
const cls = useClasses('squircle', classes, className);
|
|
23
|
+
const clipId = useId('sui-squircle-clip', true);
|
|
24
|
+
const showFocusRing = interactive && focusVisible;
|
|
25
|
+
const Root = component;
|
|
26
|
+
return (jsxs(Root, { className: cls('root', { active, interactive }), ...rest, ref: ref, children: [jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "0", height: "0", viewBox: "0 0 1 1", children: jsx("defs", { children: jsx("clipPath", { id: clipId, clipPathUnits: "objectBoundingBox", children: jsx("path", { d: SQUIRCLE_PATH }) }) }) }), !fillShape && (jsx("svg", { className: cls('content'), xmlns: "http://www.w3.org/2000/svg", viewBox: '0 0 1 1', children: jsx("path", { clipPath: `url(#${clipId})`, d: SQUIRCLE_PATH, vectorEffect: "non-scaling-stroke" }) })), showFocusRing && (jsx("svg", { className: cls('ring'), xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1 1", overflow: "visible", children: jsx("path", { d: SQUIRCLE_PATH, fillOpacity: 0, vectorEffect: "non-scaling-stroke" }) })), fillShape
|
|
27
|
+
? cloneElement(firstChild, {
|
|
28
|
+
style: {
|
|
29
|
+
...firstChild.props.style,
|
|
30
|
+
with: '100%',
|
|
31
|
+
height: '100%',
|
|
32
|
+
clipPath: `url(#${clipId})`,
|
|
33
|
+
},
|
|
34
|
+
})
|
|
35
|
+
: children] }));
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
export { Squircle as S };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { useClasses } from '@ringcentral/spring-base';
|
|
3
|
+
import { MinusBoldMd, CheckBoldSm } from '@ringcentral/spring-icon';
|
|
4
|
+
import { useThemeProps } from '@ringcentral/spring-theme';
|
|
5
|
+
import { I as Icon } from './Icon.js';
|
|
6
|
+
|
|
7
|
+
const IconSizeMap = {
|
|
8
|
+
large: 'small',
|
|
9
|
+
medium: 'xsmall',
|
|
10
|
+
};
|
|
11
|
+
const StatusIndicator = (inProps) => {
|
|
12
|
+
const props = useThemeProps({ props: inProps, name: 'StatusIndicator' });
|
|
13
|
+
const { classes, className, size = 'medium', variant = 'available', ...rest } = props;
|
|
14
|
+
const cls = useClasses('status-indicator', classes, className);
|
|
15
|
+
return (jsxs("div", { className: cls('root', size, variant), ...rest, children: [variant === 'dnd' && (jsx(Icon, { symbol: MinusBoldMd, size: IconSizeMap[size] })), variant === 'available' && (jsx(Icon, { symbol: CheckBoldSm, size: IconSizeMap[size] }))] }));
|
|
16
|
+
};
|
|
17
|
+
StatusIndicator.displayName = 'SuiStatusIndicator';
|
|
18
|
+
|
|
19
|
+
export { StatusIndicator as S };
|
|
@@ -0,0 +1,21 @@
|
|
|
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 { b as useStepperContext, u as useStepContext } from './StepperContext.js';
|
|
6
|
+
|
|
7
|
+
const StepConnector = forwardRef((inProps, ref) => {
|
|
8
|
+
const props = useThemeProps({ props: inProps, name: 'StepConnector' });
|
|
9
|
+
const { classes, className, children, ...rest } = props;
|
|
10
|
+
const cls = useClasses('step-connector', classes, className);
|
|
11
|
+
const { orientation = 'horizontal' } = useStepperContext();
|
|
12
|
+
const { active, disabled, completed } = useStepContext();
|
|
13
|
+
return (jsx("div", { "aria-hidden": true, className: cls('root', orientation, {
|
|
14
|
+
active,
|
|
15
|
+
completed,
|
|
16
|
+
disabled,
|
|
17
|
+
}), ...rest, ref: ref, children: jsx("span", { className: cls('line', `line-${orientation}`) }) }));
|
|
18
|
+
});
|
|
19
|
+
StepConnector.displayName = 'SuiStepConnector';
|
|
20
|
+
|
|
21
|
+
export { StepConnector as S };
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { forwardRef } from 'react';
|
|
3
|
+
import { useClasses } from '@ringcentral/spring-base';
|
|
4
|
+
import { AlertFilledMd, AlertMd, CheckBoldMd, CheckMd } from '@ringcentral/spring-icon';
|
|
5
|
+
import { useThemeProps } from '@ringcentral/spring-theme';
|
|
6
|
+
import { I as Icon } from './Icon.js';
|
|
7
|
+
|
|
8
|
+
const StepIcon = forwardRef(
|
|
9
|
+
// @ts-ignore
|
|
10
|
+
(inProps, ref) => {
|
|
11
|
+
const props = useThemeProps({ props: inProps, name: 'StepIcon' });
|
|
12
|
+
const { classes, className, children, active = false, completed = false, error = false, disabled = false, variant = 'contained', icon, symbol, ...rest } = props;
|
|
13
|
+
const cls = useClasses('step-icon', classes, className);
|
|
14
|
+
if (symbol) {
|
|
15
|
+
return (jsx("span", { className: cls('root', variant, error && `${variant}-error`, active && `${variant}-current`, {
|
|
16
|
+
current: active,
|
|
17
|
+
completed,
|
|
18
|
+
error,
|
|
19
|
+
disabled,
|
|
20
|
+
}), ...rest, ref: ref, children: jsx(Icon, { className: cls('icon'), size: "xsmall", symbol: symbol }) }));
|
|
21
|
+
}
|
|
22
|
+
if (typeof icon === 'number' || typeof icon === 'string') {
|
|
23
|
+
let content;
|
|
24
|
+
if (error) {
|
|
25
|
+
content = (jsx(Icon, { className: cls('icon'), size: "large", symbol: variant === 'contained' ? AlertFilledMd : AlertMd }));
|
|
26
|
+
}
|
|
27
|
+
else if (completed) {
|
|
28
|
+
content =
|
|
29
|
+
variant === 'contained' ? (jsx(Icon, { className: cls('icon'), size: "xsmall", symbol: CheckBoldMd })) : (jsx(Icon, { className: cls('icon'), size: "large", symbol: CheckMd }));
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
content = (jsx("span", { className: cls('text', active && 'text-current'), children: icon }));
|
|
33
|
+
}
|
|
34
|
+
return (jsx("span", { className: cls('root', variant, error && `${variant}-error`, active && `${variant}-current`, {
|
|
35
|
+
current: active,
|
|
36
|
+
completed,
|
|
37
|
+
error,
|
|
38
|
+
disabled,
|
|
39
|
+
}), ...rest, ref: ref, children: content }));
|
|
40
|
+
}
|
|
41
|
+
return icon;
|
|
42
|
+
});
|
|
43
|
+
StepIcon.displayName = 'SuiStepIcon';
|
|
44
|
+
|
|
45
|
+
export { StepIcon as S };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { jsxs, 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 clsx from 'clsx';
|
|
6
|
+
import { b as useStepperContext, u as useStepContext } from './StepperContext.js';
|
|
7
|
+
import { S as StepIcon } from './StepIcon.js';
|
|
8
|
+
|
|
9
|
+
const StepLabel = forwardRef((inProps, ref) => {
|
|
10
|
+
const props = useThemeProps({ props: inProps, name: 'StepLabel' });
|
|
11
|
+
const { classes, className, children, error = false, icon: iconProp, optional, labelProps = {}, StepIconComponent: StepIconComponentProp, StepIconProps, ...rest } = props;
|
|
12
|
+
const cls = useClasses('step-label', classes, className);
|
|
13
|
+
const { orientation = 'horizontal' } = useStepperContext();
|
|
14
|
+
const { active, disabled, completed, icon: iconContext, id, connector, index, last, variant, } = useStepContext();
|
|
15
|
+
const icon = iconProp || iconContext;
|
|
16
|
+
let StepIconComponent = StepIconComponentProp;
|
|
17
|
+
if (icon && !StepIconComponent) {
|
|
18
|
+
StepIconComponent = StepIcon;
|
|
19
|
+
}
|
|
20
|
+
return (jsxs("span", { id: id, className: cls('root', orientation, {
|
|
21
|
+
current: active,
|
|
22
|
+
completed,
|
|
23
|
+
disabled,
|
|
24
|
+
error,
|
|
25
|
+
}), ...rest, ref: ref, children: [index !== 0 ? connector : null, StepIconComponent ? (jsx("span", { className: cls('icon-container', `${orientation}-icon-container`), children: jsx(StepIconComponent, { completed: completed, active: active, error: error, disabled: disabled, icon: icon, variant: variant, ...StepIconProps }) })) : null, jsxs("span", { className: cls('label-container', `${orientation}-label-container`, error && 'error-label-container', { disabled }), children: [children ? (jsx("span", { ...labelProps, className: clsx(cls('label', `${orientation}-label`, active && 'current-label', error && 'error-label', { disabled, completed }), labelProps?.className), children: children })) : null, optional] }), !last ? connector : null] }));
|
|
26
|
+
});
|
|
27
|
+
StepLabel.displayName = 'SuiStepLabel';
|
|
28
|
+
|
|
29
|
+
export { StepLabel as S };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { createContext, useContext } from 'react';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Provides information about the current step in Stepper.
|
|
5
|
+
*/
|
|
6
|
+
const StepContext = createContext({});
|
|
7
|
+
/**
|
|
8
|
+
* Returns the current StepContext or an empty object if no StepContext
|
|
9
|
+
* has been defined in the component tree.
|
|
10
|
+
*/
|
|
11
|
+
const useStepContext = () => useContext(StepContext);
|
|
12
|
+
|
|
13
|
+
const StepperContext = createContext({});
|
|
14
|
+
const useStepperContext = () => useContext(StepperContext);
|
|
15
|
+
|
|
16
|
+
export { StepContext as S, StepperContext as a, useStepperContext as b, useStepContext as u };
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { forwardRef, useRef } from 'react';
|
|
3
|
+
import { useInput } from '@mui/base';
|
|
4
|
+
import { useId, useClasses, useControlled, useEventCallback, combineProps, useForkRef } from '@ringcentral/spring-base';
|
|
5
|
+
import { Xmd } from '@ringcentral/spring-icon';
|
|
6
|
+
import { useThemeProps } from '@ringcentral/spring-theme';
|
|
7
|
+
import 'framer-motion';
|
|
8
|
+
import './Icon.js';
|
|
9
|
+
import { S as ShowHideEye } from './ShowHideEye.js';
|
|
10
|
+
import { u as useHelperTextId, F as FormField } from './useHelperTextId.js';
|
|
11
|
+
import { I as IconButton } from './IconButtonLabel.js';
|
|
12
|
+
|
|
13
|
+
const TextFieldComponent = (inProps, ref) => {
|
|
14
|
+
const props = useThemeProps({ props: inProps, name: 'TextField' });
|
|
15
|
+
const { classes, className, clearBtn = true, clearText = 'clear', showCharacterCount = false, useNativeClearBtn = false, size, endAdornment, fullWidth, helperText: helperTextProp, inputProps, label, onClear, placeholder: placeholderProp, RootProps, startAdornment, type, variant = 'outlined', inputComponent: InputComponent = 'input', autoFocus, ClearButtonProps, id: idProp, onKeyDown, onKeyUp, readOnly, onClick, focused, FormHelperTextProps, showMaskValueToggleButton = type === 'password', maskValue: maskValueProps, MaskValueButtonProps, ShowHideEyeIconProps, } = props;
|
|
16
|
+
const placeholder = placeholderProp || ' ';
|
|
17
|
+
const defaultId = useId();
|
|
18
|
+
const id = idProp ?? inputProps?.id ?? defaultId;
|
|
19
|
+
const cls = useClasses('text-field', classes, className);
|
|
20
|
+
const { disabled, required, error, getInputProps } = useInput(props);
|
|
21
|
+
const states = { disabled, required, error, focused };
|
|
22
|
+
const idForHelperText = useHelperTextId({
|
|
23
|
+
helperText: helperTextProp,
|
|
24
|
+
id,
|
|
25
|
+
FormHelperTextProps,
|
|
26
|
+
});
|
|
27
|
+
const widgetProps = getInputProps({
|
|
28
|
+
'aria-describedby': idForHelperText,
|
|
29
|
+
...inputProps,
|
|
30
|
+
placeholder,
|
|
31
|
+
id,
|
|
32
|
+
type,
|
|
33
|
+
});
|
|
34
|
+
const inputRef = useRef();
|
|
35
|
+
const handlerClear = (e) => {
|
|
36
|
+
if (disabled)
|
|
37
|
+
return;
|
|
38
|
+
const el = inputRef.current;
|
|
39
|
+
if (el) {
|
|
40
|
+
onClear?.(e);
|
|
41
|
+
const host = Object.getPrototypeOf(el);
|
|
42
|
+
Object.getOwnPropertyDescriptor(host, 'value')?.set?.call(el, '');
|
|
43
|
+
el.focus();
|
|
44
|
+
el.dispatchEvent(new InputEvent('input', { bubbles: true }));
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
let helperText = helperTextProp;
|
|
48
|
+
if (showCharacterCount &&
|
|
49
|
+
inputProps?.maxLength !== undefined &&
|
|
50
|
+
props.onChange &&
|
|
51
|
+
props.value !== undefined) {
|
|
52
|
+
helperText = (jsxs("div", { className: cls('helper-text'), children: [jsx("span", { children: helperText }), jsxs("span", { children: [props.value?.length ?? 0, "/", inputProps.maxLength] })] }));
|
|
53
|
+
}
|
|
54
|
+
const [maskValue, setMaskValue] = useControlled({
|
|
55
|
+
controlled: maskValueProps,
|
|
56
|
+
default: false,
|
|
57
|
+
name: 'TextField',
|
|
58
|
+
state: 'showPassword',
|
|
59
|
+
});
|
|
60
|
+
let inputType = type;
|
|
61
|
+
const shouldShowMaskToggleButton = showMaskValueToggleButton && type === 'password';
|
|
62
|
+
const isSearchInput = type === 'search';
|
|
63
|
+
const shouldHideNativeClear = isSearchInput && !useNativeClearBtn;
|
|
64
|
+
if (shouldShowMaskToggleButton) {
|
|
65
|
+
if (maskValue) {
|
|
66
|
+
inputType = 'text';
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
inputType = 'password';
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
const handleMaskValueChange = useEventCallback(() => {
|
|
73
|
+
setMaskValue(!maskValue);
|
|
74
|
+
if (props.onMaskValueChange) {
|
|
75
|
+
props.onMaskValueChange(!maskValue);
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
return (jsxs(FormField, { ...combineProps({
|
|
79
|
+
classes: {
|
|
80
|
+
root: cls('root', {
|
|
81
|
+
'full-width': fullWidth,
|
|
82
|
+
'hide-native-clear': shouldHideNativeClear,
|
|
83
|
+
}),
|
|
84
|
+
content: cls('form-field-content'),
|
|
85
|
+
outlined: cls('outlined'),
|
|
86
|
+
standard: cls('standard'),
|
|
87
|
+
quiet: cls('quiet'),
|
|
88
|
+
},
|
|
89
|
+
contentProps: {
|
|
90
|
+
onClick: (e) => {
|
|
91
|
+
onClick?.(e);
|
|
92
|
+
if (e.target === e.currentTarget && !disabled) {
|
|
93
|
+
inputRef.current?.focus();
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
}, RootProps), ...states, htmlFor: id, label: label, ref: ref, helperText: helperText, variant: variant, size: size, FormHelperTextProps: { id: idForHelperText, ...FormHelperTextProps }, children: [startAdornment && (jsx("div", { className: cls('start-adornment'), children: startAdornment })), jsx(InputComponent, { readOnly: readOnly, autoComplete: "off", autoFocus: autoFocus, onKeyDown: onKeyDown, onKeyUp: onKeyUp, ...widgetProps, className: cls('input'), ref: useForkRef(widgetProps.ref, inputRef), type: inputType }), clearBtn && (jsx(IconButton, { symbol: Xmd, shape: 'squircle', background: false, color: 'secondary', variant: "contained", size: "small", title: clearText, "aria-label": clearText, disabled: disabled, ...combineProps({
|
|
98
|
+
className: cls('clear'),
|
|
99
|
+
onClick: handlerClear,
|
|
100
|
+
}, ClearButtonProps) })), shouldShowMaskToggleButton && (jsx(IconButton, { disabled: disabled, shape: 'squircle', background: false, color: 'neutral', variant: "icon", size: "small", ...combineProps({
|
|
101
|
+
className: cls('mask-value-button'),
|
|
102
|
+
onClick: handleMaskValueChange,
|
|
103
|
+
'aria-label': maskValue ? 'eye-visible' : 'eye',
|
|
104
|
+
}, MaskValueButtonProps), children: jsx(ShowHideEye, { hide: !maskValue, size: ShowHideEyeIconProps?.size ??
|
|
105
|
+
MaskValueButtonProps?.iconSize ??
|
|
106
|
+
'small', ...ShowHideEyeIconProps }) })), endAdornment && (jsx("div", { className: cls('end-adornment'), children: endAdornment }))] }));
|
|
107
|
+
};
|
|
108
|
+
const TextField = forwardRef(TextFieldComponent);
|
|
109
|
+
TextField.displayName = 'SuiTextField';
|
|
110
|
+
|
|
111
|
+
export { TextField as T };
|
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { useThemeProps } from '@ringcentral/spring-theme';
|
|
3
|
+
import { AnimatePresence } from 'framer-motion';
|
|
4
|
+
import { useRef, useEffect, cloneElement, forwardRef } from 'react';
|
|
5
|
+
import { logInDev, useWindowContext, useId, useControlled, useIsFocusVisible, useForkRef, useEventListener, useClasses, combineProps } from '@ringcentral/spring-base';
|
|
6
|
+
import clsx from 'clsx';
|
|
7
|
+
import { I as Icon } from './Icon.js';
|
|
8
|
+
import { u as usePrefersReducedMotion } from './usePrefersReducedMotion.js';
|
|
9
|
+
import { g as getFade } from './getFade.js';
|
|
10
|
+
import { Popper } from '../Popper.js';
|
|
11
|
+
import { P as PopperPaper } from './PopperPaper.js';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Accessibility naming strategy:
|
|
15
|
+
* - Default (label mode): `title` is treated as an accessible label
|
|
16
|
+
* - string `title` → `aria-label`
|
|
17
|
+
* - React element `title` → `aria-labelledby` while the tooltip is open
|
|
18
|
+
* - Description mode (`describeChild = true`): `title` is treated as an accessible description
|
|
19
|
+
* - when closed → native `title` attribute
|
|
20
|
+
* - when open → `aria-describedby` pointing to the tooltip id
|
|
21
|
+
*/
|
|
22
|
+
const ARIA_DESCRIBEDBY = 'aria-describedby';
|
|
23
|
+
const ARIA_LABEL = 'aria-label';
|
|
24
|
+
const ARIA_LABELLEDBY = 'aria-labelledby';
|
|
25
|
+
const HTML_TITLE = 'title';
|
|
26
|
+
let hasWarnedTriggerWhenDisabledNonStringTitle = false;
|
|
27
|
+
function computeTooltipA11y({ title, describeChild, triggerWhenDisabled, open, tooltipId, child, }) {
|
|
28
|
+
const nameOrDescProps = {};
|
|
29
|
+
const disabledOverrides = {};
|
|
30
|
+
const titleIsString = typeof title === 'string';
|
|
31
|
+
const childProps = child.props;
|
|
32
|
+
const hasAriaDescribedBy = ARIA_DESCRIBEDBY in childProps;
|
|
33
|
+
const hasAriaLabel = ARIA_LABEL in childProps;
|
|
34
|
+
const hasAriaLabelledBy = ARIA_LABELLEDBY in childProps;
|
|
35
|
+
const hasUserTitle = HTML_TITLE in childProps;
|
|
36
|
+
if (process.env.NODE_ENV !== 'production' &&
|
|
37
|
+
triggerWhenDisabled &&
|
|
38
|
+
!titleIsString &&
|
|
39
|
+
title != null &&
|
|
40
|
+
!hasUserTitle &&
|
|
41
|
+
!hasWarnedTriggerWhenDisabledNonStringTitle) {
|
|
42
|
+
hasWarnedTriggerWhenDisabledNonStringTitle = true;
|
|
43
|
+
logInDev({
|
|
44
|
+
scope: 'Tooltip',
|
|
45
|
+
level: 'warn',
|
|
46
|
+
message: 'Using Tooltip with `triggerWhenDisabled` and a non-string `title` is not fully accessible. Use a string `title` when explaining why a control is disabled.',
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
if (describeChild) {
|
|
50
|
+
// Description mode: tooltip acts as an accessible description
|
|
51
|
+
// When closed: add title attribute (unless user provided their own)
|
|
52
|
+
// When open: swap to aria-describedby
|
|
53
|
+
if (!hasAriaDescribedBy) {
|
|
54
|
+
if (!hasUserTitle) {
|
|
55
|
+
// Only set tooltip title if user hasn't provided one
|
|
56
|
+
nameOrDescProps.title =
|
|
57
|
+
!open && titleIsString ? title : null;
|
|
58
|
+
}
|
|
59
|
+
else if (open) {
|
|
60
|
+
// If user provided a title and tooltip is open, remove native title to prevent duplicate
|
|
61
|
+
nameOrDescProps.title = null;
|
|
62
|
+
}
|
|
63
|
+
nameOrDescProps[ARIA_DESCRIBEDBY] = open ? tooltipId : null;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
else {
|
|
67
|
+
// Label mode (default): tooltip acts as an accessible label
|
|
68
|
+
// Use aria-label for strings, aria-labelledby for React elements
|
|
69
|
+
if (titleIsString && !hasAriaLabel) {
|
|
70
|
+
nameOrDescProps[ARIA_LABEL] = title;
|
|
71
|
+
// For string titles, Tooltip fully owns the label; always remove native title
|
|
72
|
+
nameOrDescProps.title = null;
|
|
73
|
+
}
|
|
74
|
+
else if (!titleIsString && !hasAriaLabelledBy && title) {
|
|
75
|
+
// Only set aria-labelledby if title is truthy (React element exists)
|
|
76
|
+
nameOrDescProps[ARIA_LABELLEDBY] = open ? tooltipId : null;
|
|
77
|
+
// Only remove native title when tooltip is open to prevent duplicate tooltips.
|
|
78
|
+
// When closed, leave existing title as a fallback accessible name.
|
|
79
|
+
if (open) {
|
|
80
|
+
nameOrDescProps.title = null;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
else if (open) {
|
|
84
|
+
// Tooltip is open but we're not providing a label (e.g. child already has aria-label);
|
|
85
|
+
// still remove native title to avoid double tooltips.
|
|
86
|
+
nameOrDescProps.title = null;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
if (triggerWhenDisabled) {
|
|
90
|
+
// When open and child does not already have aria-describedby: use tooltip id,
|
|
91
|
+
// and always remove native title on the disabled control to avoid double tooltips.
|
|
92
|
+
// When closed and title is a string: use native title as a fallback for SR on disabled.
|
|
93
|
+
if (open) {
|
|
94
|
+
if (!hasAriaDescribedBy) {
|
|
95
|
+
disabledOverrides[ARIA_DESCRIBEDBY] = tooltipId;
|
|
96
|
+
}
|
|
97
|
+
disabledOverrides.title = null;
|
|
98
|
+
}
|
|
99
|
+
else if (titleIsString) {
|
|
100
|
+
disabledOverrides.title = title;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
return { nameOrDescProps, disabledOverrides };
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
const getDelayTime = (delay) => {
|
|
107
|
+
if (!delay)
|
|
108
|
+
return null;
|
|
109
|
+
if (delay === true)
|
|
110
|
+
return 1500;
|
|
111
|
+
return delay;
|
|
112
|
+
};
|
|
113
|
+
const TooltipTrigger = (props, ref) => {
|
|
114
|
+
const { renderTooltip, children, open: openProp, delay = false, onOpenStateChange, triggerWhenDisabled, triggerWrapperProps, disableFocusListener, tooltipId: tooltipIdProp, title, describeChild = false, } = props;
|
|
115
|
+
const anchorRef = useRef(null);
|
|
116
|
+
const didInitiateWithTouch = useRef(false);
|
|
117
|
+
const { document } = useWindowContext();
|
|
118
|
+
const generatedId = useId();
|
|
119
|
+
const tooltipId = tooltipIdProp ?? generatedId;
|
|
120
|
+
const [open, setOpen] = useControlled({
|
|
121
|
+
controlled: openProp,
|
|
122
|
+
default: false,
|
|
123
|
+
name: 'Tooltip',
|
|
124
|
+
state: 'open',
|
|
125
|
+
});
|
|
126
|
+
const { isFocusVisibleRef, onFocus: handleFocusVisible, onBlur: handleBlurVisible, ref: focusVisibleRef, } = useIsFocusVisible();
|
|
127
|
+
const handleAnchorRef = useForkRef(anchorRef, focusVisibleRef, children.ref);
|
|
128
|
+
const delayTimerRef = useRef();
|
|
129
|
+
useEffect(() => () => {
|
|
130
|
+
clearTimeout(delayTimerRef.current);
|
|
131
|
+
}, []);
|
|
132
|
+
const handleOpen = (e) => {
|
|
133
|
+
const delayTime = getDelayTime(delay);
|
|
134
|
+
if (delayTime) {
|
|
135
|
+
delayTimerRef.current = setTimeout(() => {
|
|
136
|
+
setOpen(true);
|
|
137
|
+
onOpenStateChange?.(e, true);
|
|
138
|
+
}, delayTime);
|
|
139
|
+
}
|
|
140
|
+
else {
|
|
141
|
+
setOpen(true);
|
|
142
|
+
onOpenStateChange?.(e, true);
|
|
143
|
+
}
|
|
144
|
+
};
|
|
145
|
+
const handleClose = (e) => {
|
|
146
|
+
clearTimeout(delayTimerRef.current);
|
|
147
|
+
delayTimerRef.current = undefined;
|
|
148
|
+
setOpen(false);
|
|
149
|
+
onOpenStateChange?.(e, false);
|
|
150
|
+
};
|
|
151
|
+
useEventListener(anchorRef, 'mouseenter', (e) => {
|
|
152
|
+
// Ensures touch devices do not trigger the tooltip, mouseleave will never be fired and the tooltip will be stuck open
|
|
153
|
+
if (didInitiateWithTouch.current) {
|
|
154
|
+
// Immediately reset the flag, touchstart will fire again on the next tap and will set the flag back to true
|
|
155
|
+
didInitiateWithTouch.current = false;
|
|
156
|
+
return;
|
|
157
|
+
}
|
|
158
|
+
// Remove the title ahead of time from the trigger.
|
|
159
|
+
// We don't want to wait for the next render commit.
|
|
160
|
+
// We would risk displaying two tooltips at the same time (native + this one).
|
|
161
|
+
if (anchorRef.current) {
|
|
162
|
+
anchorRef.current.removeAttribute('title');
|
|
163
|
+
}
|
|
164
|
+
handleOpen(e);
|
|
165
|
+
});
|
|
166
|
+
useEventListener(anchorRef, 'mouseleave', (e) => {
|
|
167
|
+
handleClose(e);
|
|
168
|
+
});
|
|
169
|
+
useEventListener(anchorRef, 'touchstart', (e) => {
|
|
170
|
+
didInitiateWithTouch.current = true;
|
|
171
|
+
}, {
|
|
172
|
+
passive: true,
|
|
173
|
+
});
|
|
174
|
+
useEventListener(anchorRef, 'focus', (e) => {
|
|
175
|
+
if (disableFocusListener)
|
|
176
|
+
return;
|
|
177
|
+
// handleFocusVisible only support react event type, but it only need target event
|
|
178
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
179
|
+
handleFocusVisible(e);
|
|
180
|
+
if (isFocusVisibleRef.current === true) {
|
|
181
|
+
handleOpen(e);
|
|
182
|
+
}
|
|
183
|
+
});
|
|
184
|
+
useEventListener(anchorRef, 'blur', (e) => {
|
|
185
|
+
// handleBlurVisible only support react event type, but this param is useless
|
|
186
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
187
|
+
handleBlurVisible(e);
|
|
188
|
+
if (isFocusVisibleRef.current === false) {
|
|
189
|
+
handleClose(e);
|
|
190
|
+
}
|
|
191
|
+
});
|
|
192
|
+
// Handle Escape key to close tooltip
|
|
193
|
+
useEventListener(open ? document : null, 'keydown', (e) => {
|
|
194
|
+
if (e.key === 'Escape') {
|
|
195
|
+
handleClose(e);
|
|
196
|
+
}
|
|
197
|
+
});
|
|
198
|
+
const { nameOrDescProps, disabledOverrides } = computeTooltipA11y({
|
|
199
|
+
title,
|
|
200
|
+
describeChild,
|
|
201
|
+
triggerWhenDisabled,
|
|
202
|
+
open,
|
|
203
|
+
tooltipId,
|
|
204
|
+
child: children,
|
|
205
|
+
});
|
|
206
|
+
return (jsxs(Fragment, { children: [triggerWhenDisabled ? (jsx("span", { ...triggerWrapperProps, className: clsx('sui-tooltip-trigger-wrapper', triggerWrapperProps?.className), ref: handleAnchorRef, children: cloneElement(children, disabledOverrides) })) : (cloneElement(children, {
|
|
207
|
+
ref: handleAnchorRef,
|
|
208
|
+
...nameOrDescProps,
|
|
209
|
+
})), renderTooltip(open, () => anchorRef.current, tooltipId)] }));
|
|
210
|
+
};
|
|
211
|
+
TooltipTrigger.displayName = 'SuiTooltipTrigger';
|
|
212
|
+
|
|
213
|
+
const TooltipView = forwardRef((props, ref) => {
|
|
214
|
+
const { className, icon, size = 'small', classes, children, placement = 'bottom', PopperProps, color = 'neutral', anchorEl, motionProps, tooltipForceHide = false, disableInteractions = true, PopperPaperProps: popperPaperPropsProp, } = props;
|
|
215
|
+
const prefersReducedMotion = usePrefersReducedMotion();
|
|
216
|
+
const cls = useClasses('tooltip-view', classes, className);
|
|
217
|
+
const padding = PopperProps?.padding;
|
|
218
|
+
const popperPadding = typeof padding === 'object'
|
|
219
|
+
? {
|
|
220
|
+
top: padding.top ?? 16,
|
|
221
|
+
right: padding.right ?? 16,
|
|
222
|
+
bottom: padding.bottom ?? 16,
|
|
223
|
+
left: padding.left ?? 16,
|
|
224
|
+
}
|
|
225
|
+
: padding ?? 16;
|
|
226
|
+
return (jsx(Popper, { role: "tooltip", placement: placement, offset: 4, ...PopperProps, padding: popperPadding, className: cls('root', {
|
|
227
|
+
'force-hide': tooltipForceHide,
|
|
228
|
+
'disable-interactions': disableInteractions,
|
|
229
|
+
}), anchorEl: anchorEl, arrowHeight: 6, arrowPadding: 8, ref: ref, children: ({ arrowRef, arrowStyle }) => (jsxs(PopperPaper, { ...(motionProps ?? getFade({ prefersReducedMotion })), ...combineProps({
|
|
230
|
+
arrowRef,
|
|
231
|
+
arrowStyle,
|
|
232
|
+
classes: {
|
|
233
|
+
root: cls('paper', color),
|
|
234
|
+
content: cls('paper-content', size),
|
|
235
|
+
},
|
|
236
|
+
}, popperPaperPropsProp), children: [icon && jsx(Icon, { symbol: icon, size: "small", className: cls('icon') }), jsx("div", { className: cls('content', `content-${size}`), children: children })] })) }));
|
|
237
|
+
});
|
|
238
|
+
TooltipView.displayName = 'SuiTooltipView';
|
|
239
|
+
|
|
240
|
+
const Tooltip = forwardRef((inProps, ref) => {
|
|
241
|
+
const props = useThemeProps({ props: inProps, name: 'Tooltip' });
|
|
242
|
+
const { children, open: openProp, delay, onOpenStateChange, title, disableFocusListener, disableBackdropAnimation, triggerWhenDisabled, triggerWrapperProps, PopperProps, describeChild = false, ...rest } = props;
|
|
243
|
+
const renderTooltip = (open, getAnchorEl, tooltipId) => {
|
|
244
|
+
// hides '', null/undefined, false, NaN)
|
|
245
|
+
const effectiveOpen = open && !(!title && title !== 0);
|
|
246
|
+
const content = effectiveOpen ? (jsx(TooltipView, { disableInteractions: openProp === undefined, ...rest, PopperProps: { ...PopperProps, id: tooltipId }, anchorEl: getAnchorEl, ref: ref, children: title })) : null;
|
|
247
|
+
return disableBackdropAnimation ? (jsx(Fragment, { children: content })) : (jsx(AnimatePresence, { children: content }));
|
|
248
|
+
};
|
|
249
|
+
return (jsx(TooltipTrigger, { disableFocusListener: disableFocusListener, open: openProp, delay: delay, onOpenStateChange: onOpenStateChange, renderTooltip: renderTooltip, triggerWhenDisabled: triggerWhenDisabled, triggerWrapperProps: triggerWrapperProps, tooltipId: PopperProps?.id, title: title, describeChild: describeChild, children: children }));
|
|
250
|
+
});
|
|
251
|
+
Tooltip.displayName = 'SuiTooltip';
|
|
252
|
+
|
|
253
|
+
export { Tooltip as T, TooltipTrigger as a, TooltipView as b };
|