@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/TimePicker.js
ADDED
|
@@ -0,0 +1,600 @@
|
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
+
import { createContext, useContext, forwardRef, useRef, useLayoutEffect, useState, useMemo } from 'react';
|
|
3
|
+
import { useFocusVisible, useForkRef, combineProps, runKeyHandler, useEventCallback, useClasses } from '@ringcentral/spring-base';
|
|
4
|
+
import { CaretUpMd, CaretDownMd, RecentMd } from '@ringcentral/spring-icon';
|
|
5
|
+
import { I as Icon } from './chunks/Icon.js';
|
|
6
|
+
import { I as IconButton } from './chunks/IconButtonLabel.js';
|
|
7
|
+
import clsx from 'clsx';
|
|
8
|
+
import { useThemeProps } from '@ringcentral/spring-theme';
|
|
9
|
+
import { P as PickerTextField } from './chunks/PickerTextField.js';
|
|
10
|
+
import '@mui/base';
|
|
11
|
+
import './chunks/Squircle.js';
|
|
12
|
+
import './chunks/withTooltip.js';
|
|
13
|
+
import './chunks/Tooltip.js';
|
|
14
|
+
import 'framer-motion';
|
|
15
|
+
import './chunks/usePrefersReducedMotion.js';
|
|
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
|
+
import './chunks/Popover.js';
|
|
24
|
+
import './chunks/getGrow.js';
|
|
25
|
+
import './chunks/TextField.js';
|
|
26
|
+
import './chunks/ShowHideEye.js';
|
|
27
|
+
import './chunks/useMotionSafeTransition.js';
|
|
28
|
+
import './chunks/useHelperTextId.js';
|
|
29
|
+
import './chunks/VisuallyHidden.js';
|
|
30
|
+
|
|
31
|
+
const TimePickerClassesContext = createContext(() => '');
|
|
32
|
+
const useTimePickerClasses = () => useContext(TimePickerClassesContext);
|
|
33
|
+
|
|
34
|
+
const TimeButton = forwardRef((props, ref) => {
|
|
35
|
+
const { value, selected, disabled, children, onFocus, onBlur, className, ...rest } = props;
|
|
36
|
+
const cls = useTimePickerClasses();
|
|
37
|
+
const { focusVisible, focusVisibleHandlers, focusVisibleRef } = useFocusVisible();
|
|
38
|
+
const handleRef = useForkRef(ref, focusVisibleRef);
|
|
39
|
+
return (jsx("button", { ref: handleRef, className: clsx(className, cls('time-button', {
|
|
40
|
+
selected,
|
|
41
|
+
disabled,
|
|
42
|
+
focusVisible,
|
|
43
|
+
})), ...rest, ...combineProps({ onBlur, onFocus }, focusVisibleHandlers), children: children }));
|
|
44
|
+
});
|
|
45
|
+
TimeButton.displayName = 'SuiTimeButton';
|
|
46
|
+
|
|
47
|
+
function isClick(event) {
|
|
48
|
+
return event.type === 'click';
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
var TIME_SYSTEM_TEXT;
|
|
52
|
+
(function (TIME_SYSTEM_TEXT) {
|
|
53
|
+
TIME_SYSTEM_TEXT["PM"] = "PM";
|
|
54
|
+
TIME_SYSTEM_TEXT["AM"] = "AM";
|
|
55
|
+
})(TIME_SYSTEM_TEXT || (TIME_SYSTEM_TEXT = {}));
|
|
56
|
+
const K_ENTER = 'Enter';
|
|
57
|
+
const K_SPACE = ' ';
|
|
58
|
+
|
|
59
|
+
const parseNumber = (value, isTwelveHourSystem) => {
|
|
60
|
+
const count = isTwelveHourSystem ? value % 12 : value;
|
|
61
|
+
if (isTwelveHourSystem && count === 0)
|
|
62
|
+
return 12;
|
|
63
|
+
return count;
|
|
64
|
+
};
|
|
65
|
+
const parseNumberToString = (value, isTwelveHourSystem) => {
|
|
66
|
+
const count = parseNumber(value, isTwelveHourSystem);
|
|
67
|
+
return pad(count);
|
|
68
|
+
};
|
|
69
|
+
/** add miss zero */
|
|
70
|
+
const pad = (num, size = 2) => {
|
|
71
|
+
let s = `${num}`;
|
|
72
|
+
while (s.length < size) {
|
|
73
|
+
s = `0${s}`;
|
|
74
|
+
}
|
|
75
|
+
return s;
|
|
76
|
+
};
|
|
77
|
+
/**
|
|
78
|
+
* get formatted time hh:mm
|
|
79
|
+
* @param option `{hour, min, period}`
|
|
80
|
+
* @param isTwelveHourSystem boolean
|
|
81
|
+
* @returns `hh:mm AM` or `hh:mm PM` or `hh:mm`
|
|
82
|
+
*/
|
|
83
|
+
const getFormattedTime = ({ hour, minute, period }, isTwelveHourSystem) => {
|
|
84
|
+
const formattedHour = parseNumberToString(hour, isTwelveHourSystem);
|
|
85
|
+
const formattedMinute = parseNumberToString(minute);
|
|
86
|
+
const periodText = isTwelveHourSystem ? ` ${period}` : '';
|
|
87
|
+
return `${formattedHour}:${formattedMinute}${periodText}`;
|
|
88
|
+
};
|
|
89
|
+
const HALF_DAY_HOURS = 12;
|
|
90
|
+
const HOUR_MINUTES = 60;
|
|
91
|
+
const TIME_GAP = 15;
|
|
92
|
+
const ONE_HOUR = HOUR_MINUTES * HOUR_MINUTES * 1000;
|
|
93
|
+
const ONE_MINUTE = HOUR_MINUTES * 1000;
|
|
94
|
+
const buildConsecutiveNumberToArray = (min, max) => {
|
|
95
|
+
const array = [];
|
|
96
|
+
if (min > max)
|
|
97
|
+
return array;
|
|
98
|
+
let count = min;
|
|
99
|
+
while (count <= max) {
|
|
100
|
+
array.push(count);
|
|
101
|
+
count++;
|
|
102
|
+
}
|
|
103
|
+
return array;
|
|
104
|
+
};
|
|
105
|
+
const twelveHourSystemSource = buildConsecutiveNumberToArray(0, 11);
|
|
106
|
+
const twentyFourHourSystemSource = buildConsecutiveNumberToArray(0, 23);
|
|
107
|
+
const minuteSource = [0, 15, 30, 45];
|
|
108
|
+
const lastMinute = 45;
|
|
109
|
+
/**
|
|
110
|
+
* hour and minute timestamp
|
|
111
|
+
*/
|
|
112
|
+
const getTimestampFromDate = (date) => {
|
|
113
|
+
return date.getHours() * ONE_HOUR + date.getMinutes() * ONE_MINUTE;
|
|
114
|
+
};
|
|
115
|
+
/**
|
|
116
|
+
* hour and minute number
|
|
117
|
+
*/
|
|
118
|
+
const getHourAndMinute = (times) => {
|
|
119
|
+
if (times === null) {
|
|
120
|
+
return {
|
|
121
|
+
hour: 0,
|
|
122
|
+
minute: 0,
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
const minute = times % ONE_HOUR;
|
|
126
|
+
const hour = (times - minute) / ONE_HOUR;
|
|
127
|
+
return {
|
|
128
|
+
hour,
|
|
129
|
+
minute: Math.floor(minute / ONE_MINUTE),
|
|
130
|
+
};
|
|
131
|
+
};
|
|
132
|
+
/**
|
|
133
|
+
* get timestamp from date or timestamp
|
|
134
|
+
*
|
|
135
|
+
* if nowTime is number, it must be hour and minute timestamp
|
|
136
|
+
*/
|
|
137
|
+
function getTimestamp(nowTime) {
|
|
138
|
+
return nowTime instanceof Date ? getTimestampFromDate(nowTime) : nowTime;
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* hour and min object to timestamp
|
|
142
|
+
*/
|
|
143
|
+
const getTimestampFromHourAndMin = (option) => {
|
|
144
|
+
return option.hour * ONE_HOUR + option.minute * ONE_MINUTE;
|
|
145
|
+
};
|
|
146
|
+
/**
|
|
147
|
+
* get period, `PM` or `AM`
|
|
148
|
+
*/
|
|
149
|
+
function getPeriod(currHour) {
|
|
150
|
+
return currHour >= HALF_DAY_HOURS ? TIME_SYSTEM_TEXT.PM : TIME_SYSTEM_TEXT.AM;
|
|
151
|
+
}
|
|
152
|
+
const getRecoupHour = (currHour, period) => {
|
|
153
|
+
switch (period) {
|
|
154
|
+
case TIME_SYSTEM_TEXT.PM:
|
|
155
|
+
if (currHour < HALF_DAY_HOURS) {
|
|
156
|
+
return HALF_DAY_HOURS;
|
|
157
|
+
}
|
|
158
|
+
break;
|
|
159
|
+
case TIME_SYSTEM_TEXT.AM:
|
|
160
|
+
// FIXME
|
|
161
|
+
// eslint-disable-next-line sonarjs/no-collapsible-if
|
|
162
|
+
if (currHour < HALF_DAY_HOURS) {
|
|
163
|
+
if (currHour >= HALF_DAY_HOURS) {
|
|
164
|
+
return -HALF_DAY_HOURS;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
break;
|
|
168
|
+
}
|
|
169
|
+
return 0;
|
|
170
|
+
};
|
|
171
|
+
|
|
172
|
+
const getDateBeginning = () => {
|
|
173
|
+
const date = new Date();
|
|
174
|
+
date.setHours(0, 0, 0, 0);
|
|
175
|
+
return date;
|
|
176
|
+
};
|
|
177
|
+
/**
|
|
178
|
+
* get target time boundary, what time is nearest time with that timeGap
|
|
179
|
+
*/
|
|
180
|
+
class TimeBoundary {
|
|
181
|
+
_hour = undefined;
|
|
182
|
+
value;
|
|
183
|
+
timeGap;
|
|
184
|
+
get hour() {
|
|
185
|
+
return this._hour;
|
|
186
|
+
}
|
|
187
|
+
_minute = undefined;
|
|
188
|
+
get minute() {
|
|
189
|
+
return this._minute;
|
|
190
|
+
}
|
|
191
|
+
_date = undefined;
|
|
192
|
+
get date() {
|
|
193
|
+
return this._date;
|
|
194
|
+
}
|
|
195
|
+
set date(value) {
|
|
196
|
+
if (value) {
|
|
197
|
+
this.timestamp = getTimestampFromDate(value);
|
|
198
|
+
}
|
|
199
|
+
this._date = value;
|
|
200
|
+
}
|
|
201
|
+
timestamp = 0;
|
|
202
|
+
constructor(value, direction, timeGap) {
|
|
203
|
+
this.value = value;
|
|
204
|
+
this.timeGap = timeGap;
|
|
205
|
+
if (value) {
|
|
206
|
+
if (direction === 'after') {
|
|
207
|
+
this.getAfterNearTime();
|
|
208
|
+
}
|
|
209
|
+
else {
|
|
210
|
+
this.getBeforeNearTime();
|
|
211
|
+
}
|
|
212
|
+
this.date = new Date(getDateBeginning().setHours(this.hour, this.minute, 0, 0));
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
getAfterNearTime() {
|
|
216
|
+
const time = this.getDateTime();
|
|
217
|
+
let hour = time.getHours();
|
|
218
|
+
let minute = time.getMinutes();
|
|
219
|
+
const partCount = Math.ceil(minute / this.timeGap);
|
|
220
|
+
// when time is the latest or more, add one hour
|
|
221
|
+
if (partCount >= HOUR_MINUTES / this.timeGap) {
|
|
222
|
+
hour++;
|
|
223
|
+
minute = 0;
|
|
224
|
+
}
|
|
225
|
+
this._hour = hour;
|
|
226
|
+
this._minute = (partCount * this.timeGap) % HOUR_MINUTES;
|
|
227
|
+
}
|
|
228
|
+
getBeforeNearTime() {
|
|
229
|
+
const time = this.getDateTime();
|
|
230
|
+
this._hour = time.getHours();
|
|
231
|
+
this._minute = Math.floor(time.getMinutes() / this.timeGap) * this.timeGap;
|
|
232
|
+
}
|
|
233
|
+
getDateTime() {
|
|
234
|
+
if (this.value instanceof Date) {
|
|
235
|
+
return this.value;
|
|
236
|
+
}
|
|
237
|
+
const { hour, minute } = getHourAndMinute(this.value ?? 0);
|
|
238
|
+
const date = new Date();
|
|
239
|
+
date.setHours(hour, minute, 0, 0);
|
|
240
|
+
return date;
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
const getRangeBoundary = ({ min, max, gap = TIME_GAP, }) => {
|
|
244
|
+
if (min !== undefined && max !== undefined) {
|
|
245
|
+
const minTimestamp = getTimestamp(min);
|
|
246
|
+
const maxTimestamp = getTimestamp(max);
|
|
247
|
+
if (minTimestamp > maxTimestamp) {
|
|
248
|
+
throw new Error(`SPRING [TimePicker]: That boundary min ${minTimestamp} is bigger than max ${maxTimestamp}, please confirm your min and max range props`);
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
return {
|
|
252
|
+
min: new TimeBoundary(min, 'after', gap),
|
|
253
|
+
max: new TimeBoundary(max, 'before', gap),
|
|
254
|
+
};
|
|
255
|
+
};
|
|
256
|
+
|
|
257
|
+
/**
|
|
258
|
+
* get range from current hour
|
|
259
|
+
*/
|
|
260
|
+
function getNumberPickerBoundary(currentHour, { range, isTwelveHourSystem }) {
|
|
261
|
+
const currentIsPM = currentHour >= HALF_DAY_HOURS;
|
|
262
|
+
let maxHour = range.max.hour ?? 23;
|
|
263
|
+
let maxMinute = range.max.minute ?? lastMinute;
|
|
264
|
+
let minHour = range.min.hour ?? 0;
|
|
265
|
+
let minMinute = range.min.minute ?? 0;
|
|
266
|
+
if (isTwelveHourSystem) {
|
|
267
|
+
if (currentIsPM) {
|
|
268
|
+
if (minHour < HALF_DAY_HOURS) {
|
|
269
|
+
minHour = 0;
|
|
270
|
+
minMinute = 0;
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
else if (maxHour >= HALF_DAY_HOURS) {
|
|
274
|
+
maxHour = 11;
|
|
275
|
+
maxMinute = lastMinute;
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
if (maxMinute !== lastMinute && currentHour < maxHour) {
|
|
279
|
+
maxMinute = lastMinute;
|
|
280
|
+
}
|
|
281
|
+
if (minMinute !== 0 && currentHour > minHour) {
|
|
282
|
+
minMinute = 0;
|
|
283
|
+
}
|
|
284
|
+
if (isTwelveHourSystem) {
|
|
285
|
+
maxHour = maxHour % HALF_DAY_HOURS;
|
|
286
|
+
minHour = minHour % HALF_DAY_HOURS;
|
|
287
|
+
}
|
|
288
|
+
return {
|
|
289
|
+
hour: {
|
|
290
|
+
min: minHour,
|
|
291
|
+
max: maxHour,
|
|
292
|
+
},
|
|
293
|
+
minute: {
|
|
294
|
+
min: minMinute,
|
|
295
|
+
max: maxMinute,
|
|
296
|
+
},
|
|
297
|
+
};
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
const NumberPicker = forwardRef((props, ref) => {
|
|
301
|
+
const { onClick, value, onChange: onUpdate, onKeyDown, source, min, max, step, renderValue, getScreenReaderLabel, autoFocus, ...rest } = props;
|
|
302
|
+
const { focusVisible, focusVisibleHandlers, focusVisibleRef } = useFocusVisible();
|
|
303
|
+
const pickerRef = useRef(null);
|
|
304
|
+
const handlePickerRef = useForkRef(pickerRef, focusVisibleRef);
|
|
305
|
+
useLayoutEffect(() => {
|
|
306
|
+
if (autoFocus) {
|
|
307
|
+
pickerRef.current?.focus();
|
|
308
|
+
}
|
|
309
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
310
|
+
}, []);
|
|
311
|
+
const index = Math.floor(value / step);
|
|
312
|
+
const isFirst = index === 0;
|
|
313
|
+
const isLatest = index === source.length - 1;
|
|
314
|
+
const firstValue = source[0];
|
|
315
|
+
const latestValue = source[source.length - 1];
|
|
316
|
+
const decreaseValue = isFirst ? latestValue : source[index - 1];
|
|
317
|
+
const increaseValue = isLatest ? firstValue : source[index + 1];
|
|
318
|
+
const decreaseDisabled = isFirst
|
|
319
|
+
? !!(max !== undefined && latestValue > max)
|
|
320
|
+
: !!(min !== undefined && decreaseValue < min);
|
|
321
|
+
const increaseDisabled = isLatest
|
|
322
|
+
? !!(min !== undefined && firstValue < min)
|
|
323
|
+
: !!(max !== undefined && increaseValue > max);
|
|
324
|
+
const showValue = (() => {
|
|
325
|
+
if (renderValue) {
|
|
326
|
+
return renderValue(value);
|
|
327
|
+
}
|
|
328
|
+
return pad(value);
|
|
329
|
+
})();
|
|
330
|
+
const label = getScreenReaderLabel?.(showValue);
|
|
331
|
+
const handleKeyDown = (event) => {
|
|
332
|
+
runKeyHandler(event, {
|
|
333
|
+
ArrowUp: () => {
|
|
334
|
+
if (increaseDisabled) {
|
|
335
|
+
return;
|
|
336
|
+
}
|
|
337
|
+
onUpdate(increaseValue, 'arrowKey');
|
|
338
|
+
},
|
|
339
|
+
ArrowDown: () => {
|
|
340
|
+
if (decreaseDisabled) {
|
|
341
|
+
return;
|
|
342
|
+
}
|
|
343
|
+
onUpdate(decreaseValue, 'arrowKey');
|
|
344
|
+
},
|
|
345
|
+
});
|
|
346
|
+
onKeyDown?.(event);
|
|
347
|
+
};
|
|
348
|
+
const cls = useTimePickerClasses();
|
|
349
|
+
return (jsxs("div", { tabIndex: 0, className: cls('number-picker', { focusVisible }), onKeyDown: handleKeyDown, "aria-live": "assertive", "aria-label": label, ref: handlePickerRef, ...focusVisibleHandlers, ...rest, children: [jsx(IconButton, { shape: 'squircle', variant: 'contained', background: false, color: 'secondary', size: "small", tabIndex: -1, disabled: increaseDisabled, onClick: () => {
|
|
350
|
+
onUpdate(increaseValue, 'arrowButton');
|
|
351
|
+
}, "data-sui-number-picker-previous": true, "aria-label": "Arrow Up", children: jsx(Icon, { size: "medium", symbol: CaretUpMd }) }), jsx(TimeButton, { tabIndex: -1, onClick: onClick, "data-sui-number-picker-text": true, children: showValue }), jsx(IconButton, { shape: 'squircle', variant: 'contained', background: false, color: 'secondary', size: "small", tabIndex: -1, disabled: decreaseDisabled, onClick: () => {
|
|
352
|
+
onUpdate(decreaseValue, 'arrowButton');
|
|
353
|
+
}, "data-sui-number-picker-next": true, "aria-label": "Arrow Down", children: jsx(Icon, { size: "medium", symbol: CaretDownMd }) })] }));
|
|
354
|
+
});
|
|
355
|
+
NumberPicker.displayName = 'SuiNumberPicker';
|
|
356
|
+
|
|
357
|
+
const SelectionView = (props) => {
|
|
358
|
+
const { source, onConfirm, value, min: minProp, max: maxProp, isTwelveHourSystem, viewType, } = props;
|
|
359
|
+
const min = minProp !== undefined && isTwelveHourSystem
|
|
360
|
+
? minProp % HALF_DAY_HOURS
|
|
361
|
+
: minProp;
|
|
362
|
+
const max = maxProp !== undefined && isTwelveHourSystem
|
|
363
|
+
? maxProp % HALF_DAY_HOURS
|
|
364
|
+
: maxProp;
|
|
365
|
+
const showValue = parseNumberToString(value, isTwelveHourSystem);
|
|
366
|
+
const cls = useTimePickerClasses();
|
|
367
|
+
return (jsx("div", { className: cls(`${viewType}-selection-view`, 'picker-view'), children: source.map((v) => {
|
|
368
|
+
const disabled = !!((max !== undefined && v > max) ||
|
|
369
|
+
(min !== undefined && v < min));
|
|
370
|
+
const itemShowValue = parseNumberToString(v, isTwelveHourSystem);
|
|
371
|
+
const confirm = () => {
|
|
372
|
+
if (disabled)
|
|
373
|
+
return;
|
|
374
|
+
onConfirm(v);
|
|
375
|
+
};
|
|
376
|
+
return (jsx(TimeButton, { disabled: disabled, onClick: confirm, selected: itemShowValue === showValue, "data-sui-time-button": itemShowValue, children: itemShowValue }, v));
|
|
377
|
+
}) }));
|
|
378
|
+
};
|
|
379
|
+
SelectionView.displayName = 'SuiSelectionView';
|
|
380
|
+
|
|
381
|
+
const ToggleText = forwardRef(({ onChange: onUpdate, value, disabled, getScreenReaderLabel, ...rest }, ref) => {
|
|
382
|
+
const label = getScreenReaderLabel?.(value);
|
|
383
|
+
const nextValue = value === TIME_SYSTEM_TEXT.AM ? TIME_SYSTEM_TEXT.PM : TIME_SYSTEM_TEXT.AM;
|
|
384
|
+
const handleClick = useEventCallback((event) => {
|
|
385
|
+
if (disabled || !isClick(event))
|
|
386
|
+
return;
|
|
387
|
+
onUpdate(nextValue, 'arrowButton');
|
|
388
|
+
});
|
|
389
|
+
const handleToggleKeyDown = useEventCallback((event) => {
|
|
390
|
+
if (disabled) {
|
|
391
|
+
return;
|
|
392
|
+
}
|
|
393
|
+
const togglePeriod = () => {
|
|
394
|
+
onUpdate(nextValue, 'arrowKey');
|
|
395
|
+
};
|
|
396
|
+
runKeyHandler(event, {
|
|
397
|
+
ArrowUp: togglePeriod,
|
|
398
|
+
ArrowDown: togglePeriod,
|
|
399
|
+
});
|
|
400
|
+
});
|
|
401
|
+
return (jsx(TimeButton, { onClick: handleClick, onKeyDown: handleToggleKeyDown, disabled: disabled, "aria-live": "assertive", "aria-label": label, ...rest, children: value }));
|
|
402
|
+
});
|
|
403
|
+
ToggleText.displayName = 'SuiToggleText';
|
|
404
|
+
|
|
405
|
+
const PickerView = (props) => {
|
|
406
|
+
const { isTwelveHourSystem, selectionShowType, onSelectionShowTypeChange, screenReaderProps, defaultValue, onChange, range, afterDraftConfirm, } = props;
|
|
407
|
+
const [value, setValue] = useState(defaultValue);
|
|
408
|
+
const handleChange = (toValue, onlyInnerState) => {
|
|
409
|
+
const resultValue = {
|
|
410
|
+
hour: toValue.hour ?? value.hour,
|
|
411
|
+
minute: toValue.minute ?? value.minute,
|
|
412
|
+
period: toValue.period ?? value.period,
|
|
413
|
+
};
|
|
414
|
+
setValue(resultValue);
|
|
415
|
+
if (!onlyInnerState) {
|
|
416
|
+
onChange(resultValue);
|
|
417
|
+
}
|
|
418
|
+
};
|
|
419
|
+
// get boundary must use current show value
|
|
420
|
+
const boundary = useMemo(() => {
|
|
421
|
+
const originHour = value.hour +
|
|
422
|
+
(isTwelveHourSystem && value.period === TIME_SYSTEM_TEXT.PM ? 12 : 0);
|
|
423
|
+
return getNumberPickerBoundary(originHour, {
|
|
424
|
+
range,
|
|
425
|
+
isTwelveHourSystem,
|
|
426
|
+
});
|
|
427
|
+
}, [range, value, isTwelveHourSystem]);
|
|
428
|
+
// reset pickerValue if pickerValue is out of range
|
|
429
|
+
useLayoutEffect(() => {
|
|
430
|
+
const { hour, minute, period } = value;
|
|
431
|
+
if (hour > boundary.hour.max || minute > boundary.minute.max) {
|
|
432
|
+
handleChange({
|
|
433
|
+
hour: boundary.hour.max,
|
|
434
|
+
minute: boundary.minute.max,
|
|
435
|
+
period,
|
|
436
|
+
}, true);
|
|
437
|
+
}
|
|
438
|
+
else if (hour < boundary.hour.min || minute < boundary.minute.min) {
|
|
439
|
+
handleChange({
|
|
440
|
+
hour: boundary.hour.min,
|
|
441
|
+
minute: boundary.minute.min,
|
|
442
|
+
period,
|
|
443
|
+
}, true);
|
|
444
|
+
}
|
|
445
|
+
// ignore `handleChange`
|
|
446
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
447
|
+
}, [boundary, value]);
|
|
448
|
+
const isHourView = selectionShowType === 'hour';
|
|
449
|
+
const { getHourPickerAriaLabel, getMinutePickerAriaLabel, getPeriodToggleAriaLabel, } = screenReaderProps;
|
|
450
|
+
const toggleTextDisabled = useMemo(() => {
|
|
451
|
+
return Boolean(range.min.hour &&
|
|
452
|
+
// * min is pm time
|
|
453
|
+
(range.min.hour >= HALF_DAY_HOURS ||
|
|
454
|
+
(range.max.hour &&
|
|
455
|
+
// * min and max in same AM period
|
|
456
|
+
range.min.hour < HALF_DAY_HOURS &&
|
|
457
|
+
range.max.hour < HALF_DAY_HOURS)));
|
|
458
|
+
}, [range.max.hour, range.min.hour]);
|
|
459
|
+
const cls = useTimePickerClasses();
|
|
460
|
+
return selectionShowType === 'none' ? (jsxs("div", { className: cls('main-view', 'picker-view', {
|
|
461
|
+
'twelve-hour': isTwelveHourSystem,
|
|
462
|
+
}), onKeyDown: (event) => {
|
|
463
|
+
const confirm = () => {
|
|
464
|
+
onChange(value);
|
|
465
|
+
afterDraftConfirm();
|
|
466
|
+
};
|
|
467
|
+
runKeyHandler(event, {
|
|
468
|
+
Enter: confirm,
|
|
469
|
+
' ': confirm,
|
|
470
|
+
});
|
|
471
|
+
}, children: [jsx(NumberPicker, { onClick: () => onSelectionShowTypeChange('hour'), value: value.hour, ...boundary.hour, onChange: (hour, reason) => {
|
|
472
|
+
handleChange({ hour }, reason === 'arrowKey');
|
|
473
|
+
}, step: 1, source: isTwelveHourSystem
|
|
474
|
+
? twelveHourSystemSource
|
|
475
|
+
: twentyFourHourSystemSource, renderValue: (hourValue) => {
|
|
476
|
+
return parseNumberToString(hourValue, isTwelveHourSystem);
|
|
477
|
+
}, "data-sui-picker-hour": true, autoFocus: true, getScreenReaderLabel: getHourPickerAriaLabel }), jsx("div", { children: ":" }), jsx(NumberPicker, { ...boundary.minute, onChange: (minute, reason) => handleChange({ minute }, reason === 'arrowKey'), onClick: () => onSelectionShowTypeChange('minute'), value: value.minute, source: minuteSource, step: TIME_GAP, "data-sui-picker-minute": true, getScreenReaderLabel: getMinutePickerAriaLabel }), isTwelveHourSystem && (jsx(ToggleText, { disabled: toggleTextDisabled, onChange: (period, reason) => handleChange({ period }, reason === 'arrowKey'), value: value.period, getScreenReaderLabel: getPeriodToggleAriaLabel }))] })) : (jsx(SelectionView, { ...(isHourView ? boundary.hour : boundary.minute), viewType: selectionShowType, source: isHourView
|
|
478
|
+
? isTwelveHourSystem
|
|
479
|
+
? twelveHourSystemSource
|
|
480
|
+
: twentyFourHourSystemSource
|
|
481
|
+
: minuteSource, isTwelveHourSystem: isHourView && isTwelveHourSystem, value: isHourView ? value.hour : value.minute, onConfirm: (toValue) => {
|
|
482
|
+
handleChange(isHourView ? { hour: toValue } : { minute: toValue }, false);
|
|
483
|
+
onSelectionShowTypeChange('none');
|
|
484
|
+
}, "data-sui-picker-selection-view": selectionShowType }));
|
|
485
|
+
};
|
|
486
|
+
|
|
487
|
+
var TimePicker$1 = {"sui-time-picker-picker-root":"sui-time-picker-picker-root","sui-time-picker-time-button":"sui-time-picker-time-button","sui-focus-visible":"sui-focus-visible","sui-selected":"sui-selected","sui-disabled":"sui-disabled","sui-time-picker-number-picker":"sui-time-picker-number-picker","sui-time-picker-picker-view":"sui-time-picker-picker-view","sui-time-picker-main-view":"sui-time-picker-main-view","sui-time-picker-twelve-hour":"sui-time-picker-twelve-hour","sui-time-picker-minute-selection-view":"sui-time-picker-minute-selection-view","sui-time-picker-hour-selection-view":"sui-time-picker-hour-selection-view"};
|
|
488
|
+
|
|
489
|
+
const TimePicker = forwardRef((inProps, ref) => {
|
|
490
|
+
const props = useThemeProps({ props: inProps, name: 'TimePicker' });
|
|
491
|
+
const { isTwelveHourSystem = false, value, onChange, disabled, min, max, onKeyDown, onClear, PopoverProps, classes, defaultPickerValue = null, clearBtn = true, dateMode = false, screenReaderProps = {
|
|
492
|
+
getHourPickerAriaLabel: (hour) => `Hour: ${hour}, use up and down arrow keys to change hour time by 1`,
|
|
493
|
+
getMinutePickerAriaLabel: (minute) => `Minute: ${minute}, use up and down arrow keys to change minutes time by 15 minutes`,
|
|
494
|
+
getPeriodToggleAriaLabel: (period) => `${period}, use up or down arrow keys to switch between AM or PM`,
|
|
495
|
+
}, className, ...rest } = props;
|
|
496
|
+
const cls = useClasses('time-picker', classes, className);
|
|
497
|
+
const actionRef = useRef(null);
|
|
498
|
+
const [selectionShowType, setSelectionType] = useState('none');
|
|
499
|
+
const pickerValue = value ?? defaultPickerValue;
|
|
500
|
+
const isDateMode = value instanceof Date || dateMode;
|
|
501
|
+
const textFieldTimestamp = getTimestamp(value);
|
|
502
|
+
const { hour: textFieldHour } = getHourAndMinute(textFieldTimestamp);
|
|
503
|
+
const textFieldPeriod = getPeriod(textFieldHour);
|
|
504
|
+
const formattedTime = textFieldTimestamp === null
|
|
505
|
+
? ''
|
|
506
|
+
: getFormattedTime({
|
|
507
|
+
...getHourAndMinute(textFieldTimestamp),
|
|
508
|
+
period: textFieldPeriod,
|
|
509
|
+
}, isTwelveHourSystem);
|
|
510
|
+
const pickerTimestamp = getTimestamp(pickerValue);
|
|
511
|
+
const { hour: originPickerHour, minute: originPickerMinute } = getHourAndMinute(pickerTimestamp);
|
|
512
|
+
const pickerPeriod = getPeriod(originPickerHour);
|
|
513
|
+
const pickerHour = isTwelveHourSystem
|
|
514
|
+
? originPickerHour % HALF_DAY_HOURS
|
|
515
|
+
: originPickerHour;
|
|
516
|
+
const pickerMinute = originPickerMinute;
|
|
517
|
+
const range = useMemo(() => {
|
|
518
|
+
return getRangeBoundary({ min, max });
|
|
519
|
+
}, [max, min]);
|
|
520
|
+
const handleChange = useEventCallback((toValue) => {
|
|
521
|
+
const update = (toValue) => {
|
|
522
|
+
onChange?.(toValue);
|
|
523
|
+
};
|
|
524
|
+
if (isDateMode) {
|
|
525
|
+
update(toValue);
|
|
526
|
+
}
|
|
527
|
+
else {
|
|
528
|
+
// * when time is zero emit null
|
|
529
|
+
update(toValue ? getTimestamp(toValue) : null);
|
|
530
|
+
}
|
|
531
|
+
});
|
|
532
|
+
const getInitialDate = useEventCallback(() => {
|
|
533
|
+
const date = value !== null ? new Date(value) : new Date();
|
|
534
|
+
date.setHours(originPickerHour, originPickerMinute, 0, 0);
|
|
535
|
+
return date;
|
|
536
|
+
});
|
|
537
|
+
const updateTime = (option) => {
|
|
538
|
+
const { hour = originPickerHour, minute = originPickerMinute, period = pickerPeriod, } = option;
|
|
539
|
+
const recoupHour = isTwelveHourSystem && pickerPeriod === TIME_SYSTEM_TEXT.PM
|
|
540
|
+
? HALF_DAY_HOURS
|
|
541
|
+
: 0;
|
|
542
|
+
const time = getInitialDate();
|
|
543
|
+
time.setMinutes(minute);
|
|
544
|
+
time.setHours(hour + recoupHour);
|
|
545
|
+
if (isTwelveHourSystem) {
|
|
546
|
+
const currHour = time.getHours();
|
|
547
|
+
if (period === TIME_SYSTEM_TEXT.PM) {
|
|
548
|
+
if (currHour < HALF_DAY_HOURS) {
|
|
549
|
+
time.setHours(currHour + HALF_DAY_HOURS);
|
|
550
|
+
}
|
|
551
|
+
}
|
|
552
|
+
else if (currHour >= HALF_DAY_HOURS) {
|
|
553
|
+
time.setHours(currHour - HALF_DAY_HOURS);
|
|
554
|
+
}
|
|
555
|
+
}
|
|
556
|
+
const toTimestamp = getTimestamp(time);
|
|
557
|
+
if (range.max.date && toTimestamp > range.max.timestamp) {
|
|
558
|
+
time.setHours(range.max.hour);
|
|
559
|
+
time.setMinutes(range.max.minute);
|
|
560
|
+
}
|
|
561
|
+
else if (range.min.date && toTimestamp < range.min.timestamp) {
|
|
562
|
+
time.setHours(range.min.hour);
|
|
563
|
+
time.setMinutes(range.min.minute);
|
|
564
|
+
}
|
|
565
|
+
handleChange(time);
|
|
566
|
+
};
|
|
567
|
+
// reset value if value is out of range
|
|
568
|
+
useLayoutEffect(() => {
|
|
569
|
+
if (textFieldTimestamp === null)
|
|
570
|
+
return;
|
|
571
|
+
const time = getInitialDate();
|
|
572
|
+
if (range.max.date && textFieldTimestamp > range.max.timestamp) {
|
|
573
|
+
time.setHours(range.max.hour);
|
|
574
|
+
time.setMinutes(range.max.minute);
|
|
575
|
+
handleChange(time);
|
|
576
|
+
}
|
|
577
|
+
else if (range.min.date && textFieldTimestamp < range.min.timestamp) {
|
|
578
|
+
time.setHours(range.min.hour);
|
|
579
|
+
time.setMinutes(range.min.minute);
|
|
580
|
+
handleChange(time);
|
|
581
|
+
}
|
|
582
|
+
}, [range, handleChange, getInitialDate, textFieldTimestamp]);
|
|
583
|
+
return (jsx(TimePickerClassesContext.Provider, { value: cls, children: jsx(PickerTextField, { ref: ref, variant: "standard", className: cls('root'), action: actionRef, onClear: (e) => {
|
|
584
|
+
onClear?.(e);
|
|
585
|
+
handleChange(null);
|
|
586
|
+
}, value: formattedTime, disabled: disabled, PopoverProps: combineProps({
|
|
587
|
+
onExitComplete: () => {
|
|
588
|
+
setSelectionType('none');
|
|
589
|
+
},
|
|
590
|
+
}, PopoverProps), endIconSymbol: RecentMd, clearBtn: clearBtn, ...rest, children: jsx(PickerView, { isTwelveHourSystem: isTwelveHourSystem, onChange: updateTime, afterDraftConfirm: () => {
|
|
591
|
+
actionRef.current?.close();
|
|
592
|
+
}, defaultValue: {
|
|
593
|
+
hour: pickerHour,
|
|
594
|
+
minute: pickerMinute,
|
|
595
|
+
period: pickerPeriod,
|
|
596
|
+
}, onSelectionShowTypeChange: setSelectionType, range: range, screenReaderProps: screenReaderProps, selectionShowType: selectionShowType }) }) }));
|
|
597
|
+
});
|
|
598
|
+
TimePicker.displayName = 'SuiTimePicker';
|
|
599
|
+
|
|
600
|
+
export { HALF_DAY_HOURS, HOUR_MINUTES, K_ENTER, K_SPACE, NumberPicker, ONE_HOUR, PickerView, SelectionView, TIME_GAP, TIME_SYSTEM_TEXT, TimeBoundary, TimeButton, TimePicker, TimePickerClassesContext, ToggleText, getFormattedTime, getHourAndMinute, getNumberPickerBoundary, getPeriod, getRangeBoundary, getRecoupHour, getTimestamp, getTimestampFromDate, getTimestampFromHourAndMin, isClick, lastMinute, minuteSource, pad, parseNumber, parseNumberToString, TimePicker$1 as timePickerStyle, twelveHourSystemSource, twentyFourHourSystemSource, useTimePickerClasses };
|
package/Tooltip.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export { T as Tooltip, a as TooltipTrigger, b as TooltipView } from './chunks/Tooltip.js';
|
|
2
|
+
export { u as useTooltipForceHide } from './chunks/useTooltipForceHide.js';
|
|
3
|
+
export { w as withTooltip } from './chunks/withTooltip.js';
|
|
4
|
+
import 'react/jsx-runtime';
|
|
5
|
+
import '@ringcentral/spring-theme';
|
|
6
|
+
import 'framer-motion';
|
|
7
|
+
import 'react';
|
|
8
|
+
import '@ringcentral/spring-base';
|
|
9
|
+
import 'clsx';
|
|
10
|
+
import './chunks/Icon.js';
|
|
11
|
+
import './chunks/usePrefersReducedMotion.js';
|
|
12
|
+
import './chunks/getFade.js';
|
|
13
|
+
import './Popper.js';
|
|
14
|
+
import '@floating-ui/react-dom';
|
|
15
|
+
import './chunks/Modal.js';
|
|
16
|
+
import '@mui/base';
|
|
17
|
+
import './chunks/useFocusTrapStack.js';
|
|
18
|
+
import './chunks/Backdrop.js';
|
|
19
|
+
import './chunks/PopperPaper.js';
|
|
20
|
+
|
|
21
|
+
var TooltipView = {"sui-tooltip-view-root":"sui-tooltip-view-root","sui-tooltip-view-disable-interactions":"sui-tooltip-view-disable-interactions","sui-tooltip-trigger-wrapper":"sui-tooltip-trigger-wrapper","sui-tooltip-view-paper":"sui-tooltip-view-paper","sui-tooltip-view-paper-content":"sui-tooltip-view-paper-content","sui-tooltip-view-paper-content-medium":"sui-tooltip-view-paper-content-medium","sui-tooltip-view-icon":"sui-tooltip-view-icon","sui-tooltip-view-content":"sui-tooltip-view-content","sui-tooltip-view-content-medium":"sui-tooltip-view-content-medium","sui-tooltip-view-neutral":"sui-tooltip-view-neutral","sui-tooltip-view-success":"sui-tooltip-view-success","sui-tooltip-view-danger":"sui-tooltip-view-danger","sui-tooltip-view-inverted":"sui-tooltip-view-inverted","sui-tooltip-view-force-hide":"sui-tooltip-view-force-hide"};
|
|
22
|
+
|
|
23
|
+
export { TooltipView as tooltipViewStyle };
|
package/Tray.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export { T as Tray, a as TrayContext, b as TrayPanel, c as useTray, u as useTrayContext, d as useTrayNavigate, e as useTrayPanel } from './chunks/useTrayNavigate.js';
|
|
2
|
+
import 'react/jsx-runtime';
|
|
3
|
+
import 'react';
|
|
4
|
+
import '@ringcentral/spring-base';
|
|
5
|
+
import '@ringcentral/spring-theme';
|
|
6
|
+
import 'framer-motion';
|
|
7
|
+
import './chunks/Icon.js';
|
|
8
|
+
import './chunks/useMotionSafeTransition.js';
|
|
9
|
+
import './chunks/usePrefersReducedMotion.js';
|
|
10
|
+
|
|
11
|
+
var Tray = {"sui-tray-root":"sui-tray-root","sui-tray-panel-root":"sui-tray-panel-root","sui-tray-panel-activated":"sui-tray-panel-activated"};
|
|
12
|
+
|
|
13
|
+
export { Tray as trayStyle };
|