@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/Modal.js
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
+
import { createContext, useContext, forwardRef, useState, useRef, useEffect } from 'react';
|
|
3
|
+
import { useAriaHideOutside, useForkRef, useClasses, useEventCallback, useBodyScrollLock, useWindowContext } from '@ringcentral/spring-base';
|
|
4
|
+
import { useThemeProps, useTheme } from '@ringcentral/spring-theme';
|
|
5
|
+
import { FocusTrap, Portal } from '@mui/base';
|
|
6
|
+
import { motion } from 'framer-motion';
|
|
7
|
+
import './Icon.js';
|
|
8
|
+
import { u as usePrefersReducedMotion } from './usePrefersReducedMotion.js';
|
|
9
|
+
import { g as getFade } from './getFade.js';
|
|
10
|
+
import { u as useFocusTrapStack } from './useFocusTrapStack.js';
|
|
11
|
+
import { B as Backdrop } from './Backdrop.js';
|
|
12
|
+
|
|
13
|
+
const ModalContext = createContext(null);
|
|
14
|
+
const useModalContext = () => useContext(ModalContext);
|
|
15
|
+
|
|
16
|
+
const InnerModal = forwardRef((props, ref) => {
|
|
17
|
+
const { hideBackdrop, children, motionProps, disableBackdropClick = false, onBackdropClick, disableEscapeKeyDown = false, onEscapeKeyDown, onClose, onKeyDown, disableAutoFocus, disableEnforceFocus, disableRestoreFocus, classes, className, backdropProps, open, isEnabled, blocking = true, ...rest } = props;
|
|
18
|
+
const { ariaHideOutsideRef, ariaHideEnabled } = useAriaHideOutside({
|
|
19
|
+
enable: blocking,
|
|
20
|
+
});
|
|
21
|
+
const handleRef = useForkRef(ref, ariaHideOutsideRef);
|
|
22
|
+
const cls = useClasses('modal', classes, className);
|
|
23
|
+
const { onClick: externalOnClick, ...restBackdropProps } = backdropProps || {};
|
|
24
|
+
const handleBackdropClick = useEventCallback((event) => {
|
|
25
|
+
if (disableBackdropClick)
|
|
26
|
+
return;
|
|
27
|
+
if (event.target !== event.currentTarget) {
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
externalOnClick?.(event);
|
|
31
|
+
onBackdropClick?.(event);
|
|
32
|
+
onClose?.(event, 'backdropClick');
|
|
33
|
+
});
|
|
34
|
+
return (jsx(ModalContext.Provider, { value: { ariaHideEnabled }, children: jsxs(motion.div, { ...rest, ...motionProps, role: "presentation", className: cls('root'), onKeyDown: (e) => {
|
|
35
|
+
onKeyDown?.(e);
|
|
36
|
+
if (!disableEscapeKeyDown &&
|
|
37
|
+
e.key === 'Escape' &&
|
|
38
|
+
(isEnabled?.() ?? true)) {
|
|
39
|
+
onEscapeKeyDown?.(e);
|
|
40
|
+
onClose?.(e, 'escapeKeyDown');
|
|
41
|
+
}
|
|
42
|
+
}, ref: handleRef, children: [jsx(Backdrop, { ...restBackdropProps, isTransparent: hideBackdrop, onClick: handleBackdropClick }), jsx(FocusTrap, { open: open, isEnabled: isEnabled, disableAutoFocus: disableAutoFocus || !blocking, disableEnforceFocus: disableEnforceFocus || !blocking, disableRestoreFocus: disableRestoreFocus || !blocking, children: children })] }) }));
|
|
43
|
+
});
|
|
44
|
+
InnerModal.displayName = 'SuiInnerModal';
|
|
45
|
+
|
|
46
|
+
const Modal = forwardRef((inProps, ref) => {
|
|
47
|
+
const props = useThemeProps({ props: inProps, name: 'Modal' });
|
|
48
|
+
const { children, open, container: containerProp, disablePortal, onExitComplete, disableBackdropAnimation, motionProps, disableScrollLock = false, ...rest } = props;
|
|
49
|
+
const [shouldRender, setShouldRender] = useState(open);
|
|
50
|
+
const modalRef = useRef(null);
|
|
51
|
+
const handleRef = useForkRef(modalRef, ref);
|
|
52
|
+
const prefersReducedMotion = usePrefersReducedMotion();
|
|
53
|
+
const { isEnabled } = useFocusTrapStack({ open });
|
|
54
|
+
useBodyScrollLock(open, modalRef.current, {
|
|
55
|
+
disabled: disableScrollLock,
|
|
56
|
+
reserveScrollBarGap: true,
|
|
57
|
+
allowTouchMove: (el) => {
|
|
58
|
+
return modalRef.current?.contains(el) ?? false;
|
|
59
|
+
},
|
|
60
|
+
});
|
|
61
|
+
useEffect(() => {
|
|
62
|
+
if (open) {
|
|
63
|
+
setShouldRender(true);
|
|
64
|
+
}
|
|
65
|
+
else {
|
|
66
|
+
if (disableBackdropAnimation) {
|
|
67
|
+
setShouldRender(false);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}, [open, disableBackdropAnimation]);
|
|
71
|
+
const { document } = useWindowContext();
|
|
72
|
+
const container = containerProp ?? document?.body;
|
|
73
|
+
const { scopeProps } = useTheme();
|
|
74
|
+
const onAnimationComplete = (e) => {
|
|
75
|
+
motionProps?.onAnimationComplete?.(e);
|
|
76
|
+
if (!open) {
|
|
77
|
+
onExitComplete?.();
|
|
78
|
+
setShouldRender(false);
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
return shouldRender ? (jsx(Portal, { disablePortal: disablePortal, container: container, children: jsx("div", { ...scopeProps, children: jsx(InnerModal, { ...rest, ref: handleRef, open: open, isEnabled: isEnabled, motionProps: {
|
|
82
|
+
...(motionProps ?? getFade({ prefersReducedMotion, toggle: open })),
|
|
83
|
+
onAnimationComplete,
|
|
84
|
+
}, children: children }) }) })) : null;
|
|
85
|
+
});
|
|
86
|
+
Modal.displayName = 'SuiModal';
|
|
87
|
+
|
|
88
|
+
export { InnerModal as I, Modal as M, ModalContext as a, useModalContext as u };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { jsx, jsxs } 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
|
+
function isKeyPosition(position) {
|
|
7
|
+
return typeof position === 'string';
|
|
8
|
+
}
|
|
9
|
+
const Overlap = forwardRef((inProps, ref) => {
|
|
10
|
+
const props = useThemeProps({ props: inProps, name: 'Overlap' });
|
|
11
|
+
const { classes, floater, position, children, className, showFloaterOnHoverOnly = false, component: OverlapRoot = 'div', ...rest } = props;
|
|
12
|
+
const cls = useClasses('overlap', classes, className);
|
|
13
|
+
let widget = null;
|
|
14
|
+
if (floater) {
|
|
15
|
+
const style = !isKeyPosition(position) ? position : undefined;
|
|
16
|
+
const classes = cls('floater', isKeyPosition(position) && position);
|
|
17
|
+
widget = jsx("div", { style: style, className: classes, children: floater });
|
|
18
|
+
}
|
|
19
|
+
return (jsxs(OverlapRoot, { ...rest, ref: ref, className: cls('root', {
|
|
20
|
+
'show-floater-on-hover-only': showFloaterOnHoverOnly,
|
|
21
|
+
}), children: [children, widget] }));
|
|
22
|
+
});
|
|
23
|
+
Overlap.displayName = 'SuiOverlap';
|
|
24
|
+
|
|
25
|
+
export { Overlap as O };
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { forwardRef, useState, useRef, useImperativeHandle, useMemo } from 'react';
|
|
3
|
+
import { useId, useClasses, useForkRef, useA11yKeyEvent, useEventCallback, combineClasses } from '@ringcentral/spring-base';
|
|
4
|
+
import { I as Icon } from './Icon.js';
|
|
5
|
+
import { P as Popover } from './Popover.js';
|
|
6
|
+
import { T as TextField } from './TextField.js';
|
|
7
|
+
import { V as VisuallyHidden } from './VisuallyHidden.js';
|
|
8
|
+
|
|
9
|
+
const PICKER_DISPLAY_NAME = 'SuiPickerTextField';
|
|
10
|
+
const PickerTextField = forwardRef((props, ref) => {
|
|
11
|
+
const { disabled, value, defaultValue, onClear, action, inputProps = {}, announcementText, PopoverProps, children, endIconSymbol, clearText, clearBtn, ClearButtonProps, onKeyDown, onClick, onClose, classes, textInputClasses, className, ...rest } = props;
|
|
12
|
+
const idForInput = useId(PICKER_DISPLAY_NAME, true);
|
|
13
|
+
const [open, setOpen] = useState(false);
|
|
14
|
+
const [isPopoverExited, setIsPopoverExited] = useState(!open);
|
|
15
|
+
const cls = useClasses('picker-text-field', classes, className);
|
|
16
|
+
const anchorRef = useRef(null);
|
|
17
|
+
const handleRef = useForkRef(ref, anchorRef);
|
|
18
|
+
const idForHelperText = `${idForInput}-helper-text`;
|
|
19
|
+
const idForInstruction = `${idForInput}-instruction`;
|
|
20
|
+
const handleA11yKeydown = useA11yKeyEvent(() => {
|
|
21
|
+
handleOpen(true);
|
|
22
|
+
});
|
|
23
|
+
const handleOpen = useEventCallback((open) => {
|
|
24
|
+
if (disabled && open) {
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
if (open) {
|
|
28
|
+
setIsPopoverExited(false);
|
|
29
|
+
}
|
|
30
|
+
setOpen(open);
|
|
31
|
+
});
|
|
32
|
+
useImperativeHandle(action, () => ({
|
|
33
|
+
close: () => {
|
|
34
|
+
handleOpen(false);
|
|
35
|
+
},
|
|
36
|
+
}), [handleOpen]);
|
|
37
|
+
const toClasses = useMemo(() => combineClasses(textInputClasses, {
|
|
38
|
+
formFieldContent: cls('form-field-content', {
|
|
39
|
+
'has-value': Boolean(value),
|
|
40
|
+
}),
|
|
41
|
+
root: cls('root', {
|
|
42
|
+
'has-value': Boolean(value),
|
|
43
|
+
}),
|
|
44
|
+
input: cls('input'),
|
|
45
|
+
}), [cls, textInputClasses, value]);
|
|
46
|
+
return (jsxs(Fragment, { children: [jsx(TextField, { classes: toClasses, value: value, defaultValue: defaultValue, endAdornment: endIconSymbol && (jsx(Icon, { className: cls('end-icon'), symbol: endIconSymbol })), id: idForInput, ref: handleRef, focused: open || (!open && !isPopoverExited), disabled: disabled, clearBtn: clearBtn, onClick: (e) => {
|
|
47
|
+
handleOpen(true);
|
|
48
|
+
onClick?.(e);
|
|
49
|
+
}, onKeyDown: (e) => {
|
|
50
|
+
if (disabled)
|
|
51
|
+
return;
|
|
52
|
+
handleA11yKeydown(e);
|
|
53
|
+
onKeyDown?.(e);
|
|
54
|
+
}, inputProps: {
|
|
55
|
+
'aria-describedby': `${idForHelperText} ${idForInstruction}`,
|
|
56
|
+
'aria-haspopup': true,
|
|
57
|
+
...inputProps,
|
|
58
|
+
}, ...rest, readOnly: true, onClear: (e) => {
|
|
59
|
+
onClear?.(e);
|
|
60
|
+
// prevent open popover
|
|
61
|
+
e.stopPropagation();
|
|
62
|
+
} }), jsx(Popover, { bordered: true, open: open, anchorEl: anchorRef.current, onClose: (...args) => {
|
|
63
|
+
handleOpen(false);
|
|
64
|
+
onClose?.(...args);
|
|
65
|
+
}, placement: "bottom-start", transformOrigin: {
|
|
66
|
+
vertical: 'top',
|
|
67
|
+
horizontal: 'left',
|
|
68
|
+
}, ...PopoverProps, onExitComplete: () => {
|
|
69
|
+
PopoverProps?.onExitComplete?.();
|
|
70
|
+
setIsPopoverExited(true);
|
|
71
|
+
}, children: children }), jsx(VisuallyHidden, { id: idForInstruction, children: announcementText })] }));
|
|
72
|
+
});
|
|
73
|
+
PickerTextField.displayName = PICKER_DISPLAY_NAME;
|
|
74
|
+
|
|
75
|
+
export { PickerTextField as P };
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { forwardRef, useRef } from 'react';
|
|
3
|
+
import { size } from '@floating-ui/react-dom';
|
|
4
|
+
import { useClasses, useForkRef, combineProps } from '@ringcentral/spring-base';
|
|
5
|
+
import { useThemeProps } from '@ringcentral/spring-theme';
|
|
6
|
+
import 'framer-motion';
|
|
7
|
+
import './Icon.js';
|
|
8
|
+
import { u as usePrefersReducedMotion } from './usePrefersReducedMotion.js';
|
|
9
|
+
import { g as getGrow, a as getTransformOriginStringForPlacement } from './getGrow.js';
|
|
10
|
+
import { M as Modal } from './Modal.js';
|
|
11
|
+
import { Popper } from '../Popper.js';
|
|
12
|
+
import { P as PopperPaper } from './PopperPaper.js';
|
|
13
|
+
|
|
14
|
+
const Popover = forwardRef((inProps, ref) => {
|
|
15
|
+
const props = useThemeProps({ props: inProps, name: 'Popover' });
|
|
16
|
+
const { classes, className, children, PopperProps, variant = 'standard', bordered = false, shadow = true, transformOrigin, motionProps: motionPropsProp, popperRef, placement, anchorEl, actions, onAvailableHeightChange, PopperPaperProps: popperPaperPropsProp, ...rest } = props;
|
|
17
|
+
const cls = useClasses('popover', classes, className);
|
|
18
|
+
const paperContentRef = useRef(null);
|
|
19
|
+
const handlePaperContentRef = useForkRef(popperPaperPropsProp?.contentRef, paperContentRef);
|
|
20
|
+
const prefersReducedMotion = usePrefersReducedMotion();
|
|
21
|
+
return (jsx(Modal, { disableScrollLock: true, ...rest, className: cls('root', 'popper'), ref: ref, motionProps: null, hideBackdrop: true, children: jsx(Popper, { arrowHeight: variant === 'standard' ? 0 : 10, arrowPadding: 12, offset: variant === 'standard' ? 2 : 4, ...combineProps({
|
|
22
|
+
middlewares: [
|
|
23
|
+
size({
|
|
24
|
+
padding: PopperProps?.padding,
|
|
25
|
+
apply({ availableHeight, availableWidth, }) {
|
|
26
|
+
onAvailableHeightChange?.(availableHeight);
|
|
27
|
+
if (paperContentRef.current) {
|
|
28
|
+
paperContentRef.current.style.maxHeight = `${availableHeight}px`;
|
|
29
|
+
paperContentRef.current.style.maxWidth = `${availableWidth}px`;
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
}),
|
|
33
|
+
],
|
|
34
|
+
}, PopperProps), className: cls('popper'), disablePortal: true, tabIndex: -1, ref: popperRef, placement: placement, anchorEl: anchorEl, actions: actions, children: ({ arrowStyle, arrowRef, placement: computedPlacement }) => {
|
|
35
|
+
const motionProps = motionPropsProp ??
|
|
36
|
+
getGrow({ transformOrigin, prefersReducedMotion });
|
|
37
|
+
const popperPaperProps = {
|
|
38
|
+
className: cls('paper', { bordered, shadow }),
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* If no transform origin is set, determine the transform origin using
|
|
42
|
+
* the computed placement. This ensures the transition used for the
|
|
43
|
+
* grow animation is always faithful to where the Popover is positioned.
|
|
44
|
+
*/
|
|
45
|
+
if (!transformOrigin) {
|
|
46
|
+
popperPaperProps.style = {
|
|
47
|
+
...popperPaperProps.style,
|
|
48
|
+
transformOrigin: getTransformOriginStringForPlacement({
|
|
49
|
+
placement: computedPlacement,
|
|
50
|
+
}),
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
return (jsx(PopperPaper, { contentRef: handlePaperContentRef, arrowRef: arrowRef, arrowStyle: arrowStyle, ...combineProps(combineProps(motionProps, popperPaperProps), popperPaperPropsProp), children: children }));
|
|
54
|
+
} }) }));
|
|
55
|
+
});
|
|
56
|
+
Popover.displayName = 'SuiPopover';
|
|
57
|
+
|
|
58
|
+
export { Popover as P };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsxs, jsx } 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 } from '@ringcentral/spring-theme';
|
|
6
|
+
|
|
7
|
+
const PopperPaper = forwardRef((inProps, ref) => {
|
|
8
|
+
const props = useThemeProps({ props: inProps, name: 'PopperPaper' });
|
|
9
|
+
const { classes, className, children, arrowRef, arrowStyle, contentRef, ...rest } = props;
|
|
10
|
+
const cls = useClasses('popper-paper', classes, className);
|
|
11
|
+
return (jsxs(motion.div, { className: cls('root'), ...rest, ref: ref, children: [jsx("div", { ref: contentRef, className: cls('content'), children: children }), jsx("div", { className: cls('arrow'), ref: arrowRef, style: arrowStyle })] }));
|
|
12
|
+
});
|
|
13
|
+
PopperPaper.displayName = 'SuiPopperPaper';
|
|
14
|
+
|
|
15
|
+
export { PopperPaper as P };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { createContext, useContext } from 'react';
|
|
2
|
+
|
|
3
|
+
const RadioGroupContext = createContext({});
|
|
4
|
+
function callbacksInSeries(...callbacks) {
|
|
5
|
+
return function (...params) {
|
|
6
|
+
callbacks.forEach((cb) => cb?.(...params));
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
function useRadioGroup({ name, value, checked, onChange, }) {
|
|
10
|
+
const context = useContext(RadioGroupContext);
|
|
11
|
+
if (context.onChange) {
|
|
12
|
+
name = context.name ?? name;
|
|
13
|
+
checked = value === context.value;
|
|
14
|
+
onChange = callbacksInSeries(onChange, context.onChange);
|
|
15
|
+
}
|
|
16
|
+
return { name, checked, onChange };
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export { RadioGroupContext as R, callbacksInSeries as c, useRadioGroup as u };
|
package/chunks/Select.js
ADDED
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
|
+
import { forwardRef, useState, useRef, useEffect, useMemo } from 'react';
|
|
3
|
+
import { combineProps, useControlled, useClasses, useId, useEventCallback, combineClasses, getTitle } from '@ringcentral/spring-base';
|
|
4
|
+
import { useThemeProps } from '@ringcentral/spring-theme';
|
|
5
|
+
import { E as ExpandCollapseCaret } from './ExpandCollapseCaret.js';
|
|
6
|
+
import 'framer-motion';
|
|
7
|
+
import { u as usePrefersReducedMotion } from './usePrefersReducedMotion.js';
|
|
8
|
+
import { g as getGrow } from './getGrow.js';
|
|
9
|
+
import './Icon.js';
|
|
10
|
+
import { u as useHelperTextId, F as FormField } from './useHelperTextId.js';
|
|
11
|
+
import { M as Menu, a as MenuContext } from './Menu.js';
|
|
12
|
+
import { c as useMenuItemSelect, a as MenuItemSelectContext } from './useMenuItemSelect.js';
|
|
13
|
+
import 'tabbable';
|
|
14
|
+
import './useListNavigation.js';
|
|
15
|
+
import '../VirtualizedList.js';
|
|
16
|
+
import { M as MenuList } from './MenuList.js';
|
|
17
|
+
import { S as Squircle } from './Squircle.js';
|
|
18
|
+
import { a as VirtualizedMenu } from './VirtualizedMenu.js';
|
|
19
|
+
|
|
20
|
+
const useSelect = (props) => {
|
|
21
|
+
const { open, handleOpen } = props;
|
|
22
|
+
const getButtonProps = (otherHandlers = {}) => {
|
|
23
|
+
const eventHandlers = combineProps({
|
|
24
|
+
onClick: () => {
|
|
25
|
+
handleOpen(!open);
|
|
26
|
+
},
|
|
27
|
+
onKeyDown: (e) => {
|
|
28
|
+
if (e.key === 'ArrowUp' || e.key === 'ArrowDown') {
|
|
29
|
+
// prevent scroll
|
|
30
|
+
e.preventDefault();
|
|
31
|
+
handleOpen(true);
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
}, otherHandlers);
|
|
35
|
+
return {
|
|
36
|
+
'aria-expanded': open,
|
|
37
|
+
'aria-haspopup': 'listbox',
|
|
38
|
+
...eventHandlers,
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
const getListboxProps = () => ({
|
|
42
|
+
role: 'listbox',
|
|
43
|
+
});
|
|
44
|
+
return {
|
|
45
|
+
getButtonProps,
|
|
46
|
+
getListboxProps,
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
const DEFAULT_PLACEMENT = 'bottom';
|
|
51
|
+
const Select = forwardRef((inProps, ref) => {
|
|
52
|
+
const props = useThemeProps({ props: inProps, name: 'Select' });
|
|
53
|
+
const { classes, className, children, name, id: idProp, value: valueProp, selectMode = 'single', defaultValue = selectMode === 'multiple' ? [] : null, onChange: onChangeProp, renderValue = (value) => Array.isArray(value) ? value.join(', ') : String(value), label, helperText, disabled, required, error, displayEmpty, placeholder, open: openProp, defaultOpen, onOpen, onClose, selectorProps: selectorPropsProp, MenuProps, variant = 'standard', inputProps, size = 'xlarge', virtualize = false, VirtualizedMenuProps: virtualizedMenuPropsProp, data, getSelectedIndex, FormHelperTextProps, ...rest } = props;
|
|
54
|
+
const [anchorEl, setAnchorEl] = useState(null);
|
|
55
|
+
const [open, setOpen] = useControlled({
|
|
56
|
+
controlled: openProp,
|
|
57
|
+
default: defaultOpen,
|
|
58
|
+
name: 'SuiSelect',
|
|
59
|
+
state: 'open',
|
|
60
|
+
});
|
|
61
|
+
const [didMenuExit, setDidMenuExit] = useState(!open);
|
|
62
|
+
const inputRef = useRef(null);
|
|
63
|
+
const prefersReducedMotion = usePrefersReducedMotion();
|
|
64
|
+
const cls = useClasses('select', classes, className);
|
|
65
|
+
const id = useId(idProp);
|
|
66
|
+
const helperTextId = useHelperTextId({
|
|
67
|
+
helperText,
|
|
68
|
+
id,
|
|
69
|
+
FormHelperTextProps,
|
|
70
|
+
});
|
|
71
|
+
const formFieldContentRef = useRef(null);
|
|
72
|
+
useEffect(() => {
|
|
73
|
+
setAnchorEl(formFieldContentRef.current);
|
|
74
|
+
}, []);
|
|
75
|
+
const handleOpen = useEventCallback((newOpen) => {
|
|
76
|
+
if (disabled && newOpen)
|
|
77
|
+
return;
|
|
78
|
+
if (newOpen)
|
|
79
|
+
setDidMenuExit(false);
|
|
80
|
+
setOpen(newOpen);
|
|
81
|
+
if (newOpen) {
|
|
82
|
+
onOpen?.();
|
|
83
|
+
}
|
|
84
|
+
else {
|
|
85
|
+
onClose?.();
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
useEffect(() => {
|
|
89
|
+
// close menu when disabled
|
|
90
|
+
if (disabled) {
|
|
91
|
+
handleOpen(false);
|
|
92
|
+
}
|
|
93
|
+
}, [disabled, handleOpen]);
|
|
94
|
+
const [value, setValue] = useControlled({
|
|
95
|
+
controlled: valueProp,
|
|
96
|
+
default: defaultValue,
|
|
97
|
+
name: 'SuiSelect',
|
|
98
|
+
state: 'value',
|
|
99
|
+
});
|
|
100
|
+
const handleInputChange = useEventCallback((e) => {
|
|
101
|
+
onChangeProp?.(e, inputRef.current);
|
|
102
|
+
});
|
|
103
|
+
const handleClose = useEventCallback(() => {
|
|
104
|
+
handleOpen(false);
|
|
105
|
+
});
|
|
106
|
+
const handleInitialFocus = useEventCallback(() => {
|
|
107
|
+
if (data && value !== null) {
|
|
108
|
+
if (getSelectedIndex)
|
|
109
|
+
return getSelectedIndex(value);
|
|
110
|
+
if (Array.isArray(value)) {
|
|
111
|
+
// For multiple selection, focus on the last selected item
|
|
112
|
+
const lastSelectedItem = value.at(-1);
|
|
113
|
+
return lastSelectedItem ? data.indexOf(lastSelectedItem) : -1;
|
|
114
|
+
}
|
|
115
|
+
return data.findIndex((v) => v === value);
|
|
116
|
+
}
|
|
117
|
+
return true;
|
|
118
|
+
});
|
|
119
|
+
const handleMenuListChange = useEventCallback((newValue) => {
|
|
120
|
+
// for uncontrolled mode
|
|
121
|
+
setValue(newValue);
|
|
122
|
+
if (inputRef.current) {
|
|
123
|
+
/**
|
|
124
|
+
* Programatically trigger the onChange event of the native input element.
|
|
125
|
+
* Doing this means we can avoid cloning another event to mimic the ChangeEvent.
|
|
126
|
+
*/
|
|
127
|
+
/**
|
|
128
|
+
* Set the value property of the input element, avoiding React's overridden setter.
|
|
129
|
+
* This will cause the input element to update its value and fire the onChange event,
|
|
130
|
+
* `handleInputChange` will then call onChange
|
|
131
|
+
*/
|
|
132
|
+
Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype, 'value')?.set?.call(inputRef.current, newValue);
|
|
133
|
+
const event = new Event('input', { bubbles: true });
|
|
134
|
+
/**
|
|
135
|
+
* When `selectMode` is `multiple`, the default `event.target.value` type is `string`,
|
|
136
|
+
* but it should actually be `string[]`. Since browsers do not natively support this,
|
|
137
|
+
* we need to override the `value` property to ensure it correctly reflects an array.
|
|
138
|
+
*
|
|
139
|
+
* Why do we need `Object.defineProperty` to override `event.target.value`?
|
|
140
|
+
* - The `target` property of an event object is read-only, so we cannot modify it directly.
|
|
141
|
+
* - `Object.defineProperty` allows us to override `event.target`, but it requires returning
|
|
142
|
+
* an object from the getter.
|
|
143
|
+
* - To dynamically override only the `value` property while preserving all other properties
|
|
144
|
+
* and methods of the input element, we use a `Proxy`.
|
|
145
|
+
*
|
|
146
|
+
* How does this approach help?
|
|
147
|
+
* - Ensures `event.target.value` correctly returns a `string[]` instead of a `string`.
|
|
148
|
+
* - Keeps the event object behaving as expected when accessed by event handlers.
|
|
149
|
+
* - Preserves other native properties (`name`, `id`, `type`, etc.) and methods
|
|
150
|
+
* (`focus()`, `blur()`, etc.), preventing potential "Illegal Invocation" errors.
|
|
151
|
+
*/
|
|
152
|
+
Object.defineProperty(event, 'target', {
|
|
153
|
+
configurable: true,
|
|
154
|
+
get: () => {
|
|
155
|
+
return new Proxy(inputRef.current, {
|
|
156
|
+
get(obj, prop) {
|
|
157
|
+
if (prop === 'value') {
|
|
158
|
+
return newValue; // override 'value'
|
|
159
|
+
}
|
|
160
|
+
return obj[prop];
|
|
161
|
+
},
|
|
162
|
+
});
|
|
163
|
+
},
|
|
164
|
+
});
|
|
165
|
+
inputRef.current?.dispatchEvent(event);
|
|
166
|
+
}
|
|
167
|
+
});
|
|
168
|
+
const { getButtonProps, getListboxProps } = useSelect({
|
|
169
|
+
open,
|
|
170
|
+
handleOpen,
|
|
171
|
+
});
|
|
172
|
+
/**
|
|
173
|
+
* The non-virtualized Menu/MenuList components have the necessary contexts
|
|
174
|
+
* baked in. For the virtualized Menu, we need to provide the context values.
|
|
175
|
+
*/
|
|
176
|
+
const { contextValue: virtualizedContextValue } = useMenuItemSelect({
|
|
177
|
+
value,
|
|
178
|
+
onChange: handleMenuListChange,
|
|
179
|
+
onClose: handleClose,
|
|
180
|
+
selectMode,
|
|
181
|
+
});
|
|
182
|
+
const virtualizedMenuContextValue = useMemo(() => ({
|
|
183
|
+
close: handleClose,
|
|
184
|
+
autoFocus: true,
|
|
185
|
+
}), [handleClose]);
|
|
186
|
+
const selectorProps = getButtonProps(selectorPropsProp);
|
|
187
|
+
const selectedValue = value !== null || displayEmpty ? renderValue(value) : null;
|
|
188
|
+
const valueId = `${id}-value`;
|
|
189
|
+
const labelId = `${id}-label`;
|
|
190
|
+
let menu = null;
|
|
191
|
+
const baseMenuProps = {
|
|
192
|
+
onExitComplete: () => {
|
|
193
|
+
setDidMenuExit(true);
|
|
194
|
+
},
|
|
195
|
+
placement: DEFAULT_PLACEMENT,
|
|
196
|
+
open,
|
|
197
|
+
anchorEl,
|
|
198
|
+
PopperProps: {
|
|
199
|
+
offset: 4,
|
|
200
|
+
matchAnchorWidth: true,
|
|
201
|
+
},
|
|
202
|
+
classes: {
|
|
203
|
+
paper: cls('menu'),
|
|
204
|
+
},
|
|
205
|
+
onClose: handleClose,
|
|
206
|
+
};
|
|
207
|
+
const popperProps = combineProps(baseMenuProps.PopperProps, !virtualize
|
|
208
|
+
? MenuProps?.PopperProps
|
|
209
|
+
: virtualizedMenuPropsProp?.PopperProps);
|
|
210
|
+
if (popperProps.matchAnchorWidth) {
|
|
211
|
+
baseMenuProps.classes = combineClasses(baseMenuProps.classes, {
|
|
212
|
+
paper: 'min-w-0',
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
if (!virtualize) {
|
|
216
|
+
menu = (jsx(Menu, { ...baseMenuProps, ...MenuProps, PopperProps: popperProps, classes: combineClasses(baseMenuProps.classes, MenuProps?.classes), motionProps: getYAxisGrowMotion({
|
|
217
|
+
placement: MenuProps?.placement,
|
|
218
|
+
prefersReducedMotion: prefersReducedMotion,
|
|
219
|
+
}), children: jsx(MenuList, { value: value, onChange: handleMenuListChange, nowrap: false, widget: "select", selectMode: selectMode, ...getListboxProps(), children: children }) }));
|
|
220
|
+
}
|
|
221
|
+
else {
|
|
222
|
+
menu = (jsx(MenuContext.Provider, { value: virtualizedMenuContextValue, children: jsx(MenuItemSelectContext.Provider, { value: virtualizedContextValue, children: jsx(VirtualizedMenu, { ...baseMenuProps, ...virtualizedMenuPropsProp, PopperProps: popperProps, classes: combineClasses(baseMenuProps.classes, virtualizedMenuPropsProp?.classes), initialFocus: handleInitialFocus, data: data, motionProps: getYAxisGrowMotion({
|
|
223
|
+
placement: virtualizedMenuPropsProp?.placement,
|
|
224
|
+
prefersReducedMotion: prefersReducedMotion,
|
|
225
|
+
}), children: children }) }) }));
|
|
226
|
+
}
|
|
227
|
+
return (jsxs(Fragment, { children: [jsxs(FormField, { disabled: disabled, required: required, variant: variant, error: error,
|
|
228
|
+
// Make sure the focus style doesn't disappear when the Menu is in its close transition
|
|
229
|
+
focused: open || (!open && !didMenuExit), htmlFor: id, label: label, labelProps: {
|
|
230
|
+
id: labelId,
|
|
231
|
+
}, ref: ref, contentRef: formFieldContentRef, helperText: helperText, FormHelperTextProps: { id: helperTextId, ...FormHelperTextProps }, className: cls('root', { error }), classes: {
|
|
232
|
+
outlined: cls('outlined'),
|
|
233
|
+
standard: cls('standard'),
|
|
234
|
+
contained: cls('contained'),
|
|
235
|
+
content: cls('content'),
|
|
236
|
+
}, size: size, ...rest, children: [jsxs("button", { className: cls('selector', `${variant}-selector`, `${variant}-selector-${size}`, {
|
|
237
|
+
expanded: open,
|
|
238
|
+
}), type: 'button', disabled: disabled, "aria-labelledby": label ? `${labelId} ${valueId}` : valueId, "aria-describedby": helperTextId, ...selectorProps, id: id, children: [selectedValue ? (jsx("span", { id: valueId, "aria-live": "polite", className: cls('value'), title: getTitle(selectedValue), children: selectedValue })) : (jsx("span", { id: valueId, className: cls('placeholder'), title: getTitle(placeholder), children: placeholder })), jsx(Squircle, { className: cls('chevron'), interactive: false, children: jsx(ExpandCollapseCaret, { size: 'small', expanded: open }) })] }), jsx("input", { ref: inputRef, name: name, value: `${value}`, disabled: disabled, className: cls('native-input'), tabIndex: -1, "aria-hidden": true, "aria-invalid": error, onChange: handleInputChange, ...inputProps })] }), anchorEl && menu] }));
|
|
239
|
+
});
|
|
240
|
+
Select.displayName = 'SuiSelect';
|
|
241
|
+
function getYAxisGrowMotion(params) {
|
|
242
|
+
const { placement = DEFAULT_PLACEMENT, ...rest } = params;
|
|
243
|
+
let verticalTransformOrigin = 'top';
|
|
244
|
+
if (placement === 'top') {
|
|
245
|
+
verticalTransformOrigin = 'bottom';
|
|
246
|
+
}
|
|
247
|
+
return getGrow({
|
|
248
|
+
...rest,
|
|
249
|
+
direction: 'y',
|
|
250
|
+
transformOrigin: {
|
|
251
|
+
vertical: verticalTransformOrigin,
|
|
252
|
+
horizontal: 'center',
|
|
253
|
+
},
|
|
254
|
+
});
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
export { Select as S, useSelect as u };
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
+
import { useClasses } from '@ringcentral/spring-base';
|
|
3
|
+
import { motionTransition } from '@ringcentral/spring-theme';
|
|
4
|
+
import { motion } from 'framer-motion';
|
|
5
|
+
import { I as Icon } from './Icon.js';
|
|
6
|
+
import 'react';
|
|
7
|
+
import { u as useMotionSafeTransition } from './useMotionSafeTransition.js';
|
|
8
|
+
|
|
9
|
+
const topEyelidVariants = {
|
|
10
|
+
show: {
|
|
11
|
+
d: 'M 17.5 12.25 C 16.75 10.25 13.8 7 10 7 C 6.2 7 3.25 10.25 2.5 12.25',
|
|
12
|
+
},
|
|
13
|
+
hide: {
|
|
14
|
+
d: 'M 17.5 6.75 C 16.75 8.75 14 12.2 10 12.2 C 6 12.2 3.25 8.75 2.5 6.75',
|
|
15
|
+
},
|
|
16
|
+
};
|
|
17
|
+
const bottomEyelidVariants = {
|
|
18
|
+
show: {
|
|
19
|
+
d: 'M 17.5 11.75 C 16.75 13.75 13.8 17 10 17 C 6.2 17 3.25 13.75 2.5 11.75',
|
|
20
|
+
},
|
|
21
|
+
hide: {
|
|
22
|
+
d: 'M 17.5 6.75 C 16.75 8.75 14 12.2 10 12.2 C 6 12.2 3.25 8.75 2.5 6.75',
|
|
23
|
+
},
|
|
24
|
+
};
|
|
25
|
+
const eyelashVariants = {
|
|
26
|
+
show: {
|
|
27
|
+
d: 'M 10 4.5 L 10 1.5 M 4 6.35 L 2.5 3.7 M 16 6.35 L 17.5 3.7',
|
|
28
|
+
},
|
|
29
|
+
hide: {
|
|
30
|
+
d: 'M 10 15.5 L 10 18.5 M 16 13.75 L 17.5 16.4 M 4 13.75 L 2.5 16.4',
|
|
31
|
+
},
|
|
32
|
+
};
|
|
33
|
+
const ShowHideEye = (props) => {
|
|
34
|
+
const { classes, size = 'medium', hide = false, className, ...rest } = props;
|
|
35
|
+
const cls = useClasses('show-hide-eye', classes, className);
|
|
36
|
+
const transition = useMotionSafeTransition(motionTransition['spring-01-fast']);
|
|
37
|
+
const pupilShowTransition = useMotionSafeTransition({
|
|
38
|
+
delay: 0.05,
|
|
39
|
+
});
|
|
40
|
+
const pupilHideTransition = useMotionSafeTransition({
|
|
41
|
+
duration: 0.1,
|
|
42
|
+
});
|
|
43
|
+
const pupilVariants = {
|
|
44
|
+
show: {
|
|
45
|
+
ry: 3.75,
|
|
46
|
+
transition: pupilShowTransition,
|
|
47
|
+
},
|
|
48
|
+
hide: {
|
|
49
|
+
ry: 0,
|
|
50
|
+
transition: pupilHideTransition,
|
|
51
|
+
},
|
|
52
|
+
};
|
|
53
|
+
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: hide ? 'hide' : 'show', transition: transition, children: [jsx(motion.path, { initial: false, stroke: "currentColor", strokeWidth: 1.5, strokeMiterlimit: 1.5, strokeLinejoin: 'miter', strokeLinecap: 'butt', variants: topEyelidVariants, transition: transition, fill: "transparent" }), jsx(motion.path, { initial: false, stroke: "currentColor", strokeWidth: 1.5, strokeMiterlimit: 1.5, strokeLinejoin: 'miter', strokeLinecap: 'butt', variants: bottomEyelidVariants, transition: transition, fill: "transparent" }), jsx(motion.ellipse, { initial: false, cx: 10, cy: 10.5, rx: 3.75, fill: "currentColor", variants: pupilVariants }), jsx(motion.path, { initial: false, stroke: "currentColor", strokeWidth: 1.5, strokeMiterlimit: 1.5, strokeLinejoin: 'miter', strokeLinecap: 'butt', variants: eyelashVariants, transition: transition, fill: "transparent" })] }) }));
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
export { ShowHideEye as S };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { motion } from 'framer-motion';
|
|
3
|
+
import { u as usePrefersReducedMotion } from './usePrefersReducedMotion.js';
|
|
4
|
+
import '@ringcentral/spring-theme';
|
|
5
|
+
import { g as getSlideIn } from './getSlideIn.js';
|
|
6
|
+
|
|
7
|
+
const SlideIn = (props) => {
|
|
8
|
+
const { toggle, toggleOnTransition, toggleOffTransition, children, from = 'right', ...rest } = props;
|
|
9
|
+
const prefersReducedMotion = usePrefersReducedMotion();
|
|
10
|
+
return (jsx(motion.div, { ...getSlideIn({
|
|
11
|
+
toggle,
|
|
12
|
+
from,
|
|
13
|
+
prefersReducedMotion,
|
|
14
|
+
toggleOnTransition,
|
|
15
|
+
toggleOffTransition,
|
|
16
|
+
}), ...rest, children: children }));
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export { SlideIn as S };
|