@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/Switch.js
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { forwardRef, useRef, useLayoutEffect } from 'react';
|
|
3
|
+
import { useSwitch } from '@mui/base';
|
|
4
|
+
import { useClasses, useForkRef } from '@ringcentral/spring-base';
|
|
5
|
+
import { useThemeProps } from '@ringcentral/spring-theme';
|
|
6
|
+
import { u as useFormLabel } from './chunks/FormLabel.js';
|
|
7
|
+
|
|
8
|
+
var Switch$1 = {"sui-switch-root":"sui-switch-root","sui-focus-visible":"sui-focus-visible","sui-switch-track":"sui-switch-track","sui-switch-dot":"sui-switch-dot","sui-switch-input":"sui-switch-input","sui-checked":"sui-checked"};
|
|
9
|
+
|
|
10
|
+
const Switch = forwardRef((inProps, ref) => {
|
|
11
|
+
const props = useThemeProps({ props: inProps, name: 'Switch' });
|
|
12
|
+
const { classes, className, inputRef: inputRefProp, inputProps: inputPropsProp,
|
|
13
|
+
/* ⬇️ for input */
|
|
14
|
+
checked: checkedProp, defaultChecked, disabled: disabledProp, autoFocus = false, onBlur, onChange, onFocus, onFocusVisible, required, ...rest } = props;
|
|
15
|
+
const cls = useClasses('switch', classes, className);
|
|
16
|
+
const { disabled, id } = useFormLabel({
|
|
17
|
+
disabled: disabledProp,
|
|
18
|
+
id: inputPropsProp?.id,
|
|
19
|
+
});
|
|
20
|
+
const { getInputProps, focusVisible, checked } = useSwitch({
|
|
21
|
+
checked: checkedProp,
|
|
22
|
+
defaultChecked,
|
|
23
|
+
disabled,
|
|
24
|
+
onBlur,
|
|
25
|
+
onChange,
|
|
26
|
+
onFocus,
|
|
27
|
+
onFocusVisible,
|
|
28
|
+
required,
|
|
29
|
+
});
|
|
30
|
+
const inputProps = getInputProps({ role: undefined, ...inputPropsProp });
|
|
31
|
+
const inputRef = useRef();
|
|
32
|
+
const forkRef = useForkRef(inputRefProp, inputProps.ref, inputRef);
|
|
33
|
+
useLayoutEffect(() => {
|
|
34
|
+
if (autoFocus) {
|
|
35
|
+
inputRef.current?.focus();
|
|
36
|
+
}
|
|
37
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
38
|
+
}, []);
|
|
39
|
+
return (jsxs("span", { className: cls('root', { focusVisible }), ...rest, ref: ref, children: [jsx("input", { ...inputProps, id: id, className: cls('input', { checked }), ref: forkRef }), jsx("span", { className: cls('track') }), jsx("span", { className: cls('dot') })] }));
|
|
40
|
+
});
|
|
41
|
+
Switch.displayName = 'SuiSwitch';
|
|
42
|
+
|
|
43
|
+
export { Switch, Switch$1 as switchStyle };
|
package/Tab.js
ADDED
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
+
import { forwardRef, useRef, useEffect, useImperativeHandle } from 'react';
|
|
3
|
+
import { useTab } from '@mui/base';
|
|
4
|
+
import { useForkRef, useClasses, combineClasses } from '@ringcentral/spring-base';
|
|
5
|
+
import { useThemeProps } from '@ringcentral/spring-theme';
|
|
6
|
+
import { B as Badge } from './chunks/Badge.js';
|
|
7
|
+
import { I as Icon } from './chunks/Icon.js';
|
|
8
|
+
import { u as useTabsContext } from './chunks/TabsContext.js';
|
|
9
|
+
import { T as Tooltip } from './chunks/Tooltip.js';
|
|
10
|
+
import 'framer-motion';
|
|
11
|
+
import 'lodash/isNumber';
|
|
12
|
+
import 'lodash/kebabCase';
|
|
13
|
+
import './chunks/useMotionSafeTransition.js';
|
|
14
|
+
import './chunks/usePrefersReducedMotion.js';
|
|
15
|
+
import 'clsx';
|
|
16
|
+
import './chunks/getFade.js';
|
|
17
|
+
import './Popper.js';
|
|
18
|
+
import '@floating-ui/react-dom';
|
|
19
|
+
import './chunks/Modal.js';
|
|
20
|
+
import './chunks/useFocusTrapStack.js';
|
|
21
|
+
import './chunks/Backdrop.js';
|
|
22
|
+
import './chunks/PopperPaper.js';
|
|
23
|
+
|
|
24
|
+
var Tab$1 = {"sui-tab-container":"sui-tab-container","sui-tab-pill-badge":"sui-tab-pill-badge","sui-tab-badge-root":"sui-tab-badge-root","sui-tab-root":"sui-tab-root","sui-selected":"sui-selected","sui-focus-visible":"sui-focus-visible","sui-tab-badge":"sui-tab-badge","sui-active":"sui-active","sui-tab-label":"sui-tab-label","sui-tab-label-container":"sui-tab-label-container","sui-tab-label-text":"sui-tab-label-text","sui-tab-label-badge-root":"sui-tab-label-badge-root","sui-tab-icon":"sui-tab-icon","sui-tab-icon-container":"sui-tab-icon-container","sui-tab-icon-pill":"sui-tab-icon-pill","sui-tab-icon-badge-root":"sui-tab-icon-badge-root","sui-tab-pill":"sui-tab-pill","sui-tab-label-pill-cobranding":"sui-tab-label-pill-cobranding","sui-tab-icon-pill-cobranding":"sui-tab-icon-pill-cobranding"};
|
|
25
|
+
|
|
26
|
+
const Tab = forwardRef((inProps, ref) => {
|
|
27
|
+
const props = useThemeProps({ props: inProps, name: 'Tab' });
|
|
28
|
+
const { classes, className, children: childrenProp, action, onChange, variant = 'label', color: colorProp, label, symbol, TooltipProps, BadgeProps: badgePropsProp, title, style, value, ...rest } = props;
|
|
29
|
+
const tabRef = useRef(null);
|
|
30
|
+
const handleRef = useForkRef(tabRef, ref);
|
|
31
|
+
const { pill, pillGap, color: contextColor, setFloatingUnderlineVisibility, } = useTabsContext();
|
|
32
|
+
const color = colorProp ?? contextColor ?? 'default';
|
|
33
|
+
const { active, focusVisible, setFocusVisible, selected, getRootProps, index, } = useTab({
|
|
34
|
+
...rest,
|
|
35
|
+
value,
|
|
36
|
+
rootRef: handleRef,
|
|
37
|
+
});
|
|
38
|
+
useEffect(() => {
|
|
39
|
+
if (!setFloatingUnderlineVisibility)
|
|
40
|
+
return;
|
|
41
|
+
if (focusVisible && selected) {
|
|
42
|
+
// Hide the floating underline when the currently selected tab is also focused
|
|
43
|
+
setFloatingUnderlineVisibility(false);
|
|
44
|
+
}
|
|
45
|
+
else if (selected) {
|
|
46
|
+
// Show the floating underline when this tab is selected but not focused
|
|
47
|
+
setFloatingUnderlineVisibility(true);
|
|
48
|
+
}
|
|
49
|
+
}, [focusVisible, selected, setFloatingUnderlineVisibility]);
|
|
50
|
+
useImperativeHandle(action, () => ({
|
|
51
|
+
focusVisible: () => {
|
|
52
|
+
setFocusVisible(true);
|
|
53
|
+
tabRef.current?.focus();
|
|
54
|
+
},
|
|
55
|
+
}), [setFocusVisible]);
|
|
56
|
+
const cls = useClasses('tab', classes, className);
|
|
57
|
+
let children = null;
|
|
58
|
+
if (childrenProp) {
|
|
59
|
+
children = childrenProp;
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
let badgeClasses = {
|
|
63
|
+
root: cls('badge-root', `${variant}-badge-root`, pill && 'pill-badge', pill && `${variant}-pill-badge`),
|
|
64
|
+
content: cls('badge', `${variant}-badge`),
|
|
65
|
+
};
|
|
66
|
+
if (badgePropsProp?.classes) {
|
|
67
|
+
badgeClasses = combineClasses(badgeClasses, badgePropsProp.classes);
|
|
68
|
+
}
|
|
69
|
+
let content = null;
|
|
70
|
+
if (variant === 'label' && label) {
|
|
71
|
+
content = (jsx("span", { className: cls('text', `${variant}-text`), children: label }));
|
|
72
|
+
}
|
|
73
|
+
if (variant === 'icon' && symbol) {
|
|
74
|
+
content = jsx(Icon, { size: "small", symbol: symbol });
|
|
75
|
+
}
|
|
76
|
+
const badgeProps = badgePropsProp && {
|
|
77
|
+
color: selected ? 'primary' : 'secondary',
|
|
78
|
+
variant: pill ? 'outlined' : 'contained',
|
|
79
|
+
size: badgePropsProp?.type === 'dot' ? 'medium' : badgePropsProp?.size,
|
|
80
|
+
...badgePropsProp,
|
|
81
|
+
classes: badgeClasses,
|
|
82
|
+
};
|
|
83
|
+
children = (jsxs("div", { className: cls('container', `${variant}-container`), children: [content, badgeProps && jsx(Badge, { ...badgeProps })] }));
|
|
84
|
+
}
|
|
85
|
+
const tooltipTitle = title || (typeof label === 'string' ? label : undefined);
|
|
86
|
+
const nativeTitle = variant === 'label' ? tooltipTitle : undefined;
|
|
87
|
+
const tab = (jsx("button", { className: cls('root', variant, {
|
|
88
|
+
pill,
|
|
89
|
+
active,
|
|
90
|
+
focusVisible,
|
|
91
|
+
selected,
|
|
92
|
+
}, pill && `${variant}-pill`, pill && color !== 'default' && `${variant}-pill-${color}`), title: nativeTitle, tabIndex: selected ? 0 : -1, style: {
|
|
93
|
+
...style,
|
|
94
|
+
...(pill && index !== 0 ? { marginLeft: `${pillGap}px` } : {}),
|
|
95
|
+
}, ...getRootProps(rest), onChange: onChange, children: children }));
|
|
96
|
+
if (variant === 'label') {
|
|
97
|
+
return tab;
|
|
98
|
+
}
|
|
99
|
+
return (jsx(Tooltip, { ...TooltipProps, title: tooltipTitle, children: tab }));
|
|
100
|
+
});
|
|
101
|
+
Tab.displayName = 'SuiTab';
|
|
102
|
+
|
|
103
|
+
export { Tab, Tab$1 as tabStyle };
|
package/TabContext.js
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { useTabs, TabsProvider } from '@mui/base';
|
|
3
|
+
export { useTabsContext as useTabContext } from '@mui/base';
|
|
4
|
+
import { createContext, useContext, useMemo } from 'react';
|
|
5
|
+
import { useId } from '@ringcentral/spring-base';
|
|
6
|
+
|
|
7
|
+
// Create a separate context for internal use that both Tab and TabPanel can access
|
|
8
|
+
const InternalTabsContext = createContext({ tabsInstanceId: undefined });
|
|
9
|
+
const useInternalTabsContext = () => useContext(InternalTabsContext);
|
|
10
|
+
/**
|
|
11
|
+
* Generate stable IDs for tab and tabpanel pairs
|
|
12
|
+
* This ensures consistent IDs regardless of whether the tab is visible or in more menu
|
|
13
|
+
*/
|
|
14
|
+
const generateTabStableIds = (tabsInstanceId, identifier) => {
|
|
15
|
+
const prefix = tabsInstanceId || 'Tabs';
|
|
16
|
+
return {
|
|
17
|
+
tabId: `${prefix}-tab-${identifier}`,
|
|
18
|
+
panelId: `${prefix}-tabpanel-${identifier}`,
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
const useTabStableIds = (identifier) => {
|
|
22
|
+
const { tabsInstanceId } = useInternalTabsContext();
|
|
23
|
+
return generateTabStableIds(tabsInstanceId, identifier);
|
|
24
|
+
};
|
|
25
|
+
const TabContext = (props) => {
|
|
26
|
+
const { children } = props;
|
|
27
|
+
const { contextValue } = useTabs(props);
|
|
28
|
+
const generatedTabsInstanceId = useId('Tabs', true);
|
|
29
|
+
const internalContextValue = useMemo(() => ({ tabsInstanceId: generatedTabsInstanceId }), [generatedTabsInstanceId]);
|
|
30
|
+
return (jsx(TabsProvider, { value: contextValue, children: jsx(InternalTabsContext.Provider, { value: internalContextValue, children: children }) }));
|
|
31
|
+
};
|
|
32
|
+
TabContext.displayName = 'SuiTabContext';
|
|
33
|
+
|
|
34
|
+
export { TabContext, generateTabStableIds, useInternalTabsContext, useTabStableIds };
|
package/TabPanel.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { forwardRef } from 'react';
|
|
3
|
+
import { useTabPanel } from '@mui/base';
|
|
4
|
+
import { useEver, useClasses } from '@ringcentral/spring-base';
|
|
5
|
+
import { useThemeProps } from '@ringcentral/spring-theme';
|
|
6
|
+
import { useTabStableIds } from './TabContext.js';
|
|
7
|
+
|
|
8
|
+
var TabPanel$1 = {};
|
|
9
|
+
|
|
10
|
+
const TabPanel = forwardRef((inProps, ref) => {
|
|
11
|
+
const props = useThemeProps({ props: inProps, name: 'TabPanel' });
|
|
12
|
+
const { classes, className, children, value, keepMounted, id, ...rest } = props;
|
|
13
|
+
const { panelId } = useTabStableIds(value);
|
|
14
|
+
const { hidden, getRootProps } = useTabPanel({
|
|
15
|
+
...props,
|
|
16
|
+
id: id ?? panelId,
|
|
17
|
+
});
|
|
18
|
+
const isEverShown = useEver(!hidden);
|
|
19
|
+
const keepAlive = keepMounted && isEverShown;
|
|
20
|
+
const unmount = hidden && !keepAlive;
|
|
21
|
+
const cls = useClasses('tab-panel', classes, className);
|
|
22
|
+
return (jsx("div", { role: "tabpanel", className: cls('root'), ...rest, ...getRootProps(), ref: ref, children: !unmount && children }));
|
|
23
|
+
});
|
|
24
|
+
TabPanel.displayName = 'SuiTabPanel';
|
|
25
|
+
|
|
26
|
+
export { TabPanel, TabPanel$1 as tabPanelStyle };
|
package/Table.js
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { forwardRef, useMemo } from 'react';
|
|
3
|
+
import { useClasses } from '@ringcentral/spring-base';
|
|
4
|
+
import { useThemeProps } from '@ringcentral/spring-theme';
|
|
5
|
+
import { T as TableContext } from './chunks/TableContext.js';
|
|
6
|
+
export { u as useTableContext } from './chunks/TableContext.js';
|
|
7
|
+
export { T as Tablelvl2Context, u as useTablelvl2Context } from './chunks/Tablelvl2Context.js';
|
|
8
|
+
|
|
9
|
+
var Table$1 = {"sui-table-root":"sui-table-root","sui-table-sticky-header":"sui-table-sticky-header","sui-table-sticky-footer":"sui-table-sticky-footer"};
|
|
10
|
+
|
|
11
|
+
const defaultComponent = 'table';
|
|
12
|
+
const Table = forwardRef((inProps, ref) => {
|
|
13
|
+
const props = useThemeProps({ props: inProps, name: 'Table' });
|
|
14
|
+
const { component: TableRoot = defaultComponent, classes, className, children, stickyHeader = false, stickyFooter = false, columnDivider = false, ...rest } = props;
|
|
15
|
+
const cls = useClasses('table', classes, className);
|
|
16
|
+
const table = useMemo(() => ({ stickyHeader, stickyFooter, columnDivider }), [stickyHeader, stickyFooter, columnDivider]);
|
|
17
|
+
return (jsx(TableContext.Provider, { value: table, children: jsx(TableRoot, { role: TableRoot === defaultComponent ? undefined : 'table', className: cls('root', {
|
|
18
|
+
'sticky-header': stickyHeader,
|
|
19
|
+
'sticky-footer': stickyFooter,
|
|
20
|
+
}), ...rest, ref: ref, children: children }) }));
|
|
21
|
+
});
|
|
22
|
+
Table.displayName = 'SuiTable';
|
|
23
|
+
|
|
24
|
+
export { Table, TableContext, Table$1 as tableStyle };
|
package/TableBody.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
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
|
+
import { u as useTableContext } from './chunks/TableContext.js';
|
|
6
|
+
|
|
7
|
+
var TableBody$1 = {"sui-table-body-root":"sui-table-body-root"};
|
|
8
|
+
|
|
9
|
+
const defaultComponent = 'tbody';
|
|
10
|
+
const TableBody = forwardRef((inProps, ref) => {
|
|
11
|
+
const props = useThemeProps({ props: inProps, name: 'TableBody' });
|
|
12
|
+
const { component: TableBodyRoot = defaultComponent, classes, className, children, ...rest } = props;
|
|
13
|
+
const cls = useClasses('table-body', classes, className);
|
|
14
|
+
const table = useTableContext();
|
|
15
|
+
const fillerRowForStickyFooter = table && table.stickyFooter ? (jsx("tr", { "aria-hidden": true, className: "invisible" })) : null; // If the table has a sticky footer, we need to add an empty row to prevent any row from stretching vertically.
|
|
16
|
+
return (jsxs(TableBodyRoot, { role: TableBodyRoot === defaultComponent ? undefined : 'rowgroup', className: cls('root'), ...rest, ref: ref, children: [children, fillerRowForStickyFooter] }));
|
|
17
|
+
});
|
|
18
|
+
TableBody.displayName = 'SuiTableBody';
|
|
19
|
+
|
|
20
|
+
export { TableBody, TableBody$1 as tableBodyStyle };
|
package/TableCell.js
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
+
import { forwardRef } from 'react';
|
|
3
|
+
import { useClasses, useHover, useFocusVisible } from '@ringcentral/spring-base';
|
|
4
|
+
import { useThemeProps } from '@ringcentral/spring-theme';
|
|
5
|
+
import clsx from 'clsx';
|
|
6
|
+
import 'framer-motion';
|
|
7
|
+
import './chunks/Icon.js';
|
|
8
|
+
import { S as SortableArrow } from './chunks/SortableArrow.js';
|
|
9
|
+
import { u as useTableContext } from './chunks/TableContext.js';
|
|
10
|
+
import { u as useTablelvl2Context } from './chunks/Tablelvl2Context.js';
|
|
11
|
+
import './chunks/useMotionSafeTransition.js';
|
|
12
|
+
import './chunks/usePrefersReducedMotion.js';
|
|
13
|
+
|
|
14
|
+
var TableCell$1 = {"sui-table-cell-root":"sui-table-cell-root","sui-table-cell-padding-checkbox":"sui-table-cell-padding-checkbox","sui-table-cell-content":"sui-table-cell-content","sui-table-cell-head":"sui-table-cell-head","sui-table-cell-sortable":"sui-table-cell-sortable","sui-table-cell-content-sortable":"sui-table-cell-content-sortable","sui-table-cell-sort-icon":"sui-table-cell-sort-icon","sui-focus-visible":"sui-focus-visible","sui-table-cell-padding-none":"sui-table-cell-padding-none","sui-table-cell-align-left":"sui-table-cell-align-left","sui-table-cell-align-center":"sui-table-cell-align-center","sui-table-cell-align-right":"sui-table-cell-align-right","sui-table-cell-align-justify":"sui-table-cell-align-justify","sui-table-cell-sticky-header-default-bg":"sui-table-cell-sticky-header-default-bg","sui-table-cell-content-padding-checkbox":"sui-table-cell-content-padding-checkbox","sui-table-cell-content-align-center":"sui-table-cell-content-align-center","sui-table-cell-content-align-right":"sui-table-cell-content-align-right","sui-table-cell-content-align-justify":"sui-table-cell-content-align-justify","sui-table-cell-sorted":"sui-table-cell-sorted","sui-table-cell-sort-indicator":"sui-table-cell-sort-indicator","sui-table-cell-sort-icon-sorted":"sui-table-cell-sort-icon-sorted","sui-table-cell-column-divider":"sui-table-cell-column-divider"};
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* The component renders a `<th>` element when the parent context is a header
|
|
18
|
+
* or otherwise a `<td>` element.
|
|
19
|
+
*/
|
|
20
|
+
const TableCell = forwardRef((inProps, ref) => {
|
|
21
|
+
const props = useThemeProps({ props: inProps, name: 'TableCell' });
|
|
22
|
+
const { component: componentProp, variant: variantProp, padding = 'normal', align = 'inherit', scope: scopeProp, sortDirection, showSortIndicator = false, initialSortIconDirection = 'asc', classes, className, children, SortIconProps, ...rest } = props;
|
|
23
|
+
const cls = useClasses('table-cell', classes, className);
|
|
24
|
+
const sortable = sortDirection !== undefined;
|
|
25
|
+
const sorted = !!sortDirection;
|
|
26
|
+
const table = useTableContext();
|
|
27
|
+
const tablelvl2 = useTablelvl2Context();
|
|
28
|
+
const { hover, hoverHandlers } = useHover();
|
|
29
|
+
const isHeadCell = tablelvl2 && tablelvl2.variant === 'head';
|
|
30
|
+
let TableCellRoot = 'td';
|
|
31
|
+
if (componentProp) {
|
|
32
|
+
TableCellRoot = componentProp;
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
TableCellRoot = isHeadCell ? 'th' : 'td';
|
|
36
|
+
}
|
|
37
|
+
const { focusVisible, focusVisibleRef, focusVisibleHandlers } = useFocusVisible();
|
|
38
|
+
let scope = scopeProp;
|
|
39
|
+
// scope is not a valid attribute for <td/> elements.
|
|
40
|
+
// source: https://html.spec.whatwg.org/multipage/tables.html#the-td-element
|
|
41
|
+
if (TableCellRoot === 'td') {
|
|
42
|
+
scope = undefined;
|
|
43
|
+
}
|
|
44
|
+
else if (!scope && isHeadCell) {
|
|
45
|
+
scope = 'col';
|
|
46
|
+
}
|
|
47
|
+
const variant = variantProp || (tablelvl2 && tablelvl2.variant);
|
|
48
|
+
let ariaSort = undefined;
|
|
49
|
+
let sortIcon = null;
|
|
50
|
+
const sortIconDirection = sorted
|
|
51
|
+
? sortDirection
|
|
52
|
+
: (showSortIndicator && (hover || focusVisible)) || !showSortIndicator
|
|
53
|
+
? initialSortIconDirection
|
|
54
|
+
: false;
|
|
55
|
+
if (sorted)
|
|
56
|
+
ariaSort = sortDirection === 'asc' ? 'ascending' : 'descending';
|
|
57
|
+
if (sortable) {
|
|
58
|
+
sortIcon = (jsx(SortableArrow, { direction: sortIconDirection, size: "small", className: clsx(cls('sort-icon', sorted && 'sort-icon-sorted', showSortIndicator && 'sort-indicator'), SortIconProps?.className), ...SortIconProps }));
|
|
59
|
+
}
|
|
60
|
+
const ContentElement = sortable ? 'button' : 'div';
|
|
61
|
+
const sortableProps = sortable
|
|
62
|
+
? {
|
|
63
|
+
ref: focusVisibleRef,
|
|
64
|
+
type: 'button',
|
|
65
|
+
...focusVisibleHandlers,
|
|
66
|
+
...hoverHandlers,
|
|
67
|
+
}
|
|
68
|
+
: {};
|
|
69
|
+
return (jsx(TableCellRoot, { className: cls('root', variant, align !== 'inherit' && `align-${align}`, padding !== 'normal' && `padding-${padding}`, {
|
|
70
|
+
sortable,
|
|
71
|
+
sorted,
|
|
72
|
+
'sticky-header-default-bg': variant === 'head' &&
|
|
73
|
+
table &&
|
|
74
|
+
table.stickyHeader &&
|
|
75
|
+
tablelvl2?.useDefaultBgColor,
|
|
76
|
+
'column-divider': table.columnDivider,
|
|
77
|
+
}), "aria-sort": ariaSort, scope: scope, ...rest, ref: ref, children: jsxs(ContentElement, { ...sortableProps, className: cls('content', padding !== 'normal' &&
|
|
78
|
+
padding !== 'none' &&
|
|
79
|
+
`content-padding-${padding}`, align !== 'inherit' && align !== 'left' && `content-align-${align}`, {
|
|
80
|
+
'content-sortable': sortable,
|
|
81
|
+
focusVisible: sortable && focusVisible,
|
|
82
|
+
}), children: [children, sortIcon] }) }));
|
|
83
|
+
});
|
|
84
|
+
TableCell.displayName = 'SuiTableCell';
|
|
85
|
+
|
|
86
|
+
export { TableCell, TableCell$1 as tableCellStyle };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { forwardRef } from 'react';
|
|
3
|
+
import { useClasses } from '@ringcentral/spring-base';
|
|
4
|
+
import { useThemeProps } from '@ringcentral/spring-theme';
|
|
5
|
+
|
|
6
|
+
var TableContainer$1 = {"sui-table-container":"sui-table-container","sui-table-container-root":"sui-table-container-root","sui-table-container-standard-border":"sui-table-container-standard-border","sui-table-container-rounded-border":"sui-table-container-rounded-border"};
|
|
7
|
+
|
|
8
|
+
const TableContainer = forwardRef((inProps, ref) => {
|
|
9
|
+
const props = useThemeProps({ props: inProps, name: 'TableContainer' });
|
|
10
|
+
const { component: TableContainerRoot = 'div', classes, className, children, border = 'standard', ...rest } = props;
|
|
11
|
+
const cls = useClasses('table-container', classes, className);
|
|
12
|
+
return (jsx(TableContainerRoot, { className: cls('root', border, `${border}-border`), ...rest, ref: ref, children: children }));
|
|
13
|
+
});
|
|
14
|
+
TableContainer.displayName = 'SuiTableContainer';
|
|
15
|
+
|
|
16
|
+
export { TableContainer, TableContainer$1 as tableContainerStyle };
|
package/TableFooter.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { useClasses } from '@ringcentral/spring-base';
|
|
3
|
+
import { forwardRef } from 'react';
|
|
4
|
+
import { u as useTableContext } from './chunks/TableContext.js';
|
|
5
|
+
|
|
6
|
+
var TableFooter$1 = {"sui-table-footer-root":"sui-table-footer-root","sui-table-footer-content":"sui-table-footer-content","sui-table-footer-padding-none":"sui-table-footer-padding-none","sui-table-footer-padding-checkbox":"sui-table-footer-padding-checkbox","sui-table-footer-sticky":"sui-table-footer-sticky"};
|
|
7
|
+
|
|
8
|
+
const TableFooter = forwardRef((inProps, ref) => {
|
|
9
|
+
const { classes, colSpan, children, className, padding = 'normal', ...rest } = inProps;
|
|
10
|
+
const cls = useClasses('table-footer', classes, className);
|
|
11
|
+
const table = useTableContext();
|
|
12
|
+
return (jsx("tfoot", { ...rest, className: cls('root', { sticky: table.stickyFooter }), ref: ref, children: jsx("tr", { children: jsx("td", { colSpan: colSpan || 1000, children: jsx("div", { className: cls('content', padding !== 'normal' && `padding-${padding}`), children: children }) }) }) }));
|
|
13
|
+
});
|
|
14
|
+
TableFooter.displayName = 'SuiTableFooter';
|
|
15
|
+
|
|
16
|
+
export { TableFooter, TableFooter$1 as tableFooterStyles };
|
package/TableHead.js
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { forwardRef, useMemo } from 'react';
|
|
3
|
+
import { useClasses } from '@ringcentral/spring-base';
|
|
4
|
+
import { useThemeProps } from '@ringcentral/spring-theme';
|
|
5
|
+
import { u as useTableContext } from './chunks/TableContext.js';
|
|
6
|
+
import { T as Tablelvl2Context } from './chunks/Tablelvl2Context.js';
|
|
7
|
+
|
|
8
|
+
var TableHead$1 = {"sui-table-head-root":"sui-table-head-root","sui-table-head-background":"sui-table-head-background","sui-table-head-sticky":"sui-table-head-sticky"};
|
|
9
|
+
|
|
10
|
+
const defaultComponent = 'thead';
|
|
11
|
+
const TableHead = forwardRef((inProps, ref) => {
|
|
12
|
+
const props = useThemeProps({ props: inProps, name: 'TableHead' });
|
|
13
|
+
const { component: TableHeadRoot = defaultComponent, classes, className, children, useDefaultBgColor, ...rest } = props;
|
|
14
|
+
const cls = useClasses('table-head', classes, className);
|
|
15
|
+
const table = useTableContext();
|
|
16
|
+
const tablelvl2 = useMemo(() => ({ variant: 'head', useDefaultBgColor }), [useDefaultBgColor]);
|
|
17
|
+
return (jsx(Tablelvl2Context.Provider, { value: tablelvl2, children: jsx(TableHeadRoot, { className: cls('root', {
|
|
18
|
+
background: !useDefaultBgColor,
|
|
19
|
+
sticky: table && table.stickyHeader,
|
|
20
|
+
}), role: TableHeadRoot === defaultComponent ? undefined : 'rowgroup', ...rest, ref: ref, children: children }) }));
|
|
21
|
+
});
|
|
22
|
+
TableHead.displayName = 'SuiTableHead';
|
|
23
|
+
|
|
24
|
+
export { TableHead, TableHead$1 as tableHeadStyle };
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
+
import { useClasses, useEventCallback, combineProps } from '@ringcentral/spring-base';
|
|
3
|
+
import { CaretLeftMd, CaretRightMd } from '@ringcentral/spring-icon';
|
|
4
|
+
import { useThemeProps } from '@ringcentral/spring-theme';
|
|
5
|
+
import { forwardRef } from 'react';
|
|
6
|
+
import { I as IconButton } from './chunks/IconButtonLabel.js';
|
|
7
|
+
import { M as MenuItemText } from './chunks/MenuItemText.js';
|
|
8
|
+
import { Option } from './Option.js';
|
|
9
|
+
import { S as Select } from './chunks/Select.js';
|
|
10
|
+
import '@mui/base';
|
|
11
|
+
import './chunks/Icon.js';
|
|
12
|
+
import './chunks/Squircle.js';
|
|
13
|
+
import './chunks/withTooltip.js';
|
|
14
|
+
import './chunks/Tooltip.js';
|
|
15
|
+
import 'framer-motion';
|
|
16
|
+
import 'clsx';
|
|
17
|
+
import './chunks/usePrefersReducedMotion.js';
|
|
18
|
+
import './chunks/getFade.js';
|
|
19
|
+
import './Popper.js';
|
|
20
|
+
import '@floating-ui/react-dom';
|
|
21
|
+
import './chunks/Modal.js';
|
|
22
|
+
import './chunks/useFocusTrapStack.js';
|
|
23
|
+
import './chunks/Backdrop.js';
|
|
24
|
+
import './chunks/PopperPaper.js';
|
|
25
|
+
import './chunks/useMenuItemSelect.js';
|
|
26
|
+
import './chunks/useNestedParentMenu.js';
|
|
27
|
+
import './chunks/useNestedMenuItem.js';
|
|
28
|
+
import './VirtualizedList.js';
|
|
29
|
+
import 'react-virtuoso';
|
|
30
|
+
import './chunks/List.js';
|
|
31
|
+
import './chunks/useListNavigation.js';
|
|
32
|
+
import 'tabbable';
|
|
33
|
+
import './ListNavigation.js';
|
|
34
|
+
import './chunks/Menu.js';
|
|
35
|
+
import './chunks/Popover.js';
|
|
36
|
+
import './chunks/getGrow.js';
|
|
37
|
+
import './chunks/ExpandCollapseCaret.js';
|
|
38
|
+
import './chunks/useMotionSafeTransition.js';
|
|
39
|
+
import './chunks/useHelperTextId.js';
|
|
40
|
+
import './chunks/MenuList.js';
|
|
41
|
+
import './chunks/VirtualizedMenu.js';
|
|
42
|
+
|
|
43
|
+
var TablePagination$1 = {"sui-table-pagination-content":"sui-table-pagination-content","sui-table-pagination-rows-per-page-controls":"sui-table-pagination-rows-per-page-controls","sui-table-pagination-rows-per-page-label":"sui-table-pagination-rows-per-page-label","sui-table-pagination-current-page-controls":"sui-table-pagination-current-page-controls","sui-table-pagination-range-container":"sui-table-pagination-range-container"};
|
|
44
|
+
|
|
45
|
+
const TablePagination = forwardRef((inProps, ref) => {
|
|
46
|
+
const { classes, className, component: Root = 'td', colSpan = 1000, page, variant = 'range', count = -1, rowsPerPage = 10, rowsPerPageLabel = 'Rows per page', rowsPerPageOptions = [10, 25, 50, 100], onRowsPerPageChange, rangeSeparatorLabel = 'of', previousPageButtonProps, nextPageButtonProps, onPageChange, ...rest } = useThemeProps({
|
|
47
|
+
props: inProps,
|
|
48
|
+
name: 'TablePagination',
|
|
49
|
+
});
|
|
50
|
+
const rootProps = {
|
|
51
|
+
...rest,
|
|
52
|
+
};
|
|
53
|
+
if (Root === 'td') {
|
|
54
|
+
rootProps.colSpan = colSpan;
|
|
55
|
+
}
|
|
56
|
+
const cls = useClasses('table-pagination', classes, className);
|
|
57
|
+
const totalPages = Math.ceil(count / rowsPerPage);
|
|
58
|
+
const hasPreviousPage = page > 0;
|
|
59
|
+
const hasNextPage = page < totalPages - 1;
|
|
60
|
+
const startOfRange = page * rowsPerPage + 1;
|
|
61
|
+
let total = count;
|
|
62
|
+
let endOfRange;
|
|
63
|
+
let showRowRange = true;
|
|
64
|
+
if (variant === 'select-page') {
|
|
65
|
+
endOfRange = totalPages;
|
|
66
|
+
showRowRange = false;
|
|
67
|
+
total = totalPages;
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
endOfRange = page * rowsPerPage + rowsPerPage;
|
|
71
|
+
if (endOfRange > count)
|
|
72
|
+
endOfRange = count;
|
|
73
|
+
}
|
|
74
|
+
const handlePreviousPageButtonClick = useEventCallback((e) => {
|
|
75
|
+
if (!hasPreviousPage)
|
|
76
|
+
return;
|
|
77
|
+
onPageChange?.(e, page - 1);
|
|
78
|
+
});
|
|
79
|
+
const handleNextPageButtonClick = useEventCallback((e) => {
|
|
80
|
+
if (!hasNextPage)
|
|
81
|
+
return;
|
|
82
|
+
onPageChange?.(e, page + 1);
|
|
83
|
+
});
|
|
84
|
+
const handleSelectPageChange = useEventCallback((e) => {
|
|
85
|
+
onPageChange?.(e, parseInt(e.target.value, 10));
|
|
86
|
+
});
|
|
87
|
+
const handleRowsPerPageChange = useEventCallback((e, child) => {
|
|
88
|
+
onPageChange?.(e, 0);
|
|
89
|
+
onRowsPerPageChange?.(e, child);
|
|
90
|
+
});
|
|
91
|
+
return (jsx(Root, { className: cls('root'), ...rootProps, ref: ref, children: jsxs("div", { className: cls('content'), children: [variant === 'page-size' && (jsxs("div", { className: cls('rows-per-page-controls'), children: [jsx("span", { className: cls('rows-per-page-label'), children: rowsPerPageLabel }), jsx(Select, { value: rowsPerPage, variant: "outlined", size: "medium", classes: {
|
|
92
|
+
selector: 'min-w-16',
|
|
93
|
+
}, MenuProps: {
|
|
94
|
+
PopperProps: {
|
|
95
|
+
matchAnchorWidth: false,
|
|
96
|
+
},
|
|
97
|
+
classes: {
|
|
98
|
+
paper: 'min-w-16',
|
|
99
|
+
},
|
|
100
|
+
}, onChange: handleRowsPerPageChange, children: rowsPerPageOptions?.map((option) => (jsx(Option, { value: option, children: jsx(MenuItemText, { children: option }) }, option))) })] })), jsxs("div", { className: cls('range-container'), children: [variant === 'select-page' && (jsx(Select, { value: page, variant: "outlined", size: "medium", classes: {
|
|
101
|
+
content: 'mr-0.5',
|
|
102
|
+
selector: 'min-w-16',
|
|
103
|
+
}, MenuProps: {
|
|
104
|
+
PopperProps: {
|
|
105
|
+
matchAnchorWidth: false,
|
|
106
|
+
},
|
|
107
|
+
classes: {
|
|
108
|
+
paper: 'min-w-16',
|
|
109
|
+
},
|
|
110
|
+
}, renderValue: (value) => value + 1, onChange: handleSelectPageChange, children: Array(totalPages)
|
|
111
|
+
.fill(totalPages)
|
|
112
|
+
.map((_, i) => (jsx(Option, { value: i, children: jsx(MenuItemText, { children: i + 1 }) }, i))) })), showRowRange && jsx("span", { children: `${startOfRange}-${endOfRange}` }), jsx("span", { children: rangeSeparatorLabel }), jsx("span", { children: total })] }), jsxs("div", { className: cls('current-page-controls'), children: [jsx(IconButton, { shape: "squircle", color: "secondary", variant: "contained", size: "small", symbol: CaretLeftMd, background: false, disabled: !hasPreviousPage, ...combineProps({
|
|
113
|
+
onClick: handlePreviousPageButtonClick,
|
|
114
|
+
'aria-label': 'Go to previous page',
|
|
115
|
+
}, previousPageButtonProps) }), jsx(IconButton, { shape: "squircle", color: "secondary", variant: "contained", size: "small", symbol: CaretRightMd, background: false, disabled: !hasNextPage, ...combineProps({
|
|
116
|
+
onClick: handleNextPageButtonClick,
|
|
117
|
+
'aria-label': 'Go to next page',
|
|
118
|
+
}, nextPageButtonProps) })] })] }) }));
|
|
119
|
+
});
|
|
120
|
+
TablePagination.displayName = 'SuiTablePagination';
|
|
121
|
+
|
|
122
|
+
export { TablePagination, TablePagination$1 as tablePaginationStyles };
|
package/TableRow.js
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { forwardRef } from 'react';
|
|
3
|
+
import { useButton } from '@mui/base';
|
|
4
|
+
import { useClasses } from '@ringcentral/spring-base';
|
|
5
|
+
import { useThemeProps } from '@ringcentral/spring-theme';
|
|
6
|
+
import { u as useTablelvl2Context } from './chunks/Tablelvl2Context.js';
|
|
7
|
+
|
|
8
|
+
var TableRow$1 = {"sui-table-row-root":"sui-table-row-root","sui-table-row-clickable":"sui-table-row-clickable","sui-table-row-hoverable":"sui-table-row-hoverable","sui-focus-visible":"sui-focus-visible","sui-active":"sui-active","sui-table-row-body":"sui-table-row-body","sui-selected":"sui-selected","sui-table-cell":"sui-table-cell"};
|
|
9
|
+
|
|
10
|
+
const defaultComponent = 'tr';
|
|
11
|
+
const TableRow = forwardRef((inProps, ref) => {
|
|
12
|
+
const props = useThemeProps({ props: inProps, name: 'TableRow' });
|
|
13
|
+
const { component: TableRowRoot = defaultComponent, classes, className, children, hoverable = false, clickable: clickableProp, selected, role: roleProp, ...rest } = props;
|
|
14
|
+
const cls = useClasses('table-row', classes, className);
|
|
15
|
+
const tablelvl2 = useTablelvl2Context();
|
|
16
|
+
const variant = (tablelvl2 && tablelvl2.variant) || 'body';
|
|
17
|
+
const clickable = clickableProp !== false && rest.onClick ? true : clickableProp ?? false;
|
|
18
|
+
const { getRootProps, focusVisible, active } = useButton({
|
|
19
|
+
...props,
|
|
20
|
+
disabled: !clickable,
|
|
21
|
+
rootElementName: TableRowRoot,
|
|
22
|
+
rootRef: ref,
|
|
23
|
+
});
|
|
24
|
+
const rootProps = getRootProps();
|
|
25
|
+
// Determine the appropriate role
|
|
26
|
+
const role = roleProp ?? (TableRowRoot !== defaultComponent ? 'row' : undefined);
|
|
27
|
+
return (jsx(TableRowRoot, { className: cls('root', variant, {
|
|
28
|
+
hoverable,
|
|
29
|
+
clickable,
|
|
30
|
+
selected,
|
|
31
|
+
focusVisible: clickable && focusVisible,
|
|
32
|
+
active: clickable && active,
|
|
33
|
+
}), ...rest, ...(clickable && rootProps), role: role, ref: ref, children: children }));
|
|
34
|
+
});
|
|
35
|
+
TableRow.displayName = 'SuiTableRow';
|
|
36
|
+
|
|
37
|
+
export { TableRow, TableRow$1 as tableRowStyle };
|