@ringcentral/spring-ui 1.12.0 → 1.13.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 +90 -34
- package/AccordionHeader.js +71 -21
- package/Alert.js +120 -28
- package/Animation.js +2 -46
- package/Announcement.js +46 -35
- package/Autocomplete.js +1011 -583
- package/Avatar.js +134 -73
- package/AvatarGroup.js +50 -7
- package/Backdrop.js +45 -7
- package/Badge.js +77 -15
- package/Block.js +34 -12
- package/BlockHeader.js +57 -15
- package/BottomNavigation.js +181 -65
- package/BottomNavigationItem.js +93 -30
- package/Button.js +160 -24
- package/CallButton.js +53 -31
- package/Checkbox.js +88 -26
- package/Chip.js +126 -26
- package/CircularProgressIndicator.js +80 -8
- package/ClickAwayListener.js +4 -1
- package/ComponentsProps.js +1 -0
- package/DatePicker.js +611 -192
- package/DateUtilsContext.js +43 -25
- package/Dialer.js +564 -253
- package/Dialog.js +99 -45
- package/Divider.js +43 -7
- package/DragHandle.js +32 -6
- package/Drawer.js +117 -19
- package/Dropdown.js +154 -77
- package/EmptyState.js +65 -15
- package/FabButton.js +51 -17
- package/FocusTrap.js +109 -12
- package/FormField.js +108 -12
- package/FormLabel.js +81 -7
- package/Icon.js +1 -8
- package/IconButton.js +142 -26
- package/IconButtonGroup.js +35 -12
- package/InlineEditable.js +98 -44
- package/LinearProgressIndicator.js +73 -24
- package/Link.js +40 -11
- package/List.js +54 -9
- package/ListItem.js +152 -23
- package/ListItemText.js +44 -17
- package/ListNavigation.js +272 -20
- package/Menu.js +139 -23
- package/MenuActions.js +37 -12
- package/MenuDivider.js +34 -8
- package/MenuFooter.js +36 -12
- package/MenuHeader.js +54 -16
- package/MenuItem.js +402 -35
- package/MenuItemText.js +51 -9
- package/MenuList.js +87 -36
- package/Modal.js +345 -16
- package/NestedMenuContext.js +183 -11
- package/Option.js +32 -36
- package/Overlap.js +54 -7
- package/PageHeader.js +62 -24
- package/PickerTextField.js +156 -35
- package/Popover.js +262 -21
- package/Popper.js +112 -62
- package/PopperPaper.js +54 -8
- package/Portal.js +6 -1
- package/Radio.js +65 -21
- package/RadioGroup.js +56 -17
- package/Rating.js +223 -87
- package/Select.js +387 -44
- package/SingleFilter.js +148 -79
- package/Skeleton.js +68 -17
- package/Slider.js +167 -69
- package/Snackbar.js +122 -59
- package/SortableList.js +32 -12
- package/SortableListDndContext.js +69 -22
- package/SortableListItem.js +92 -47
- package/SortableVirtualizedList.js +44 -20
- package/SplitButton.js +124 -89
- package/Squircle.js +4 -7
- package/StatusIndicator.js +51 -9
- package/Step.js +63 -38
- package/StepButton.js +51 -23
- package/StepConnector.js +48 -8
- package/StepContent.js +67 -24
- package/StepIcon.js +90 -9
- package/StepLabel.js +90 -14
- package/Stepper.js +65 -23
- package/SubMenu.js +203 -101
- package/SwipeableDrawer.js +439 -194
- package/Switch.js +70 -23
- package/Tab.js +120 -57
- package/TabContext.js +59 -15
- package/TabPanel.js +40 -13
- package/Table.js +60 -17
- package/TableBody.js +42 -12
- package/TableCell.js +84 -50
- package/TableContainer.js +32 -10
- package/TableFooter.js +38 -10
- package/TableHead.js +49 -15
- package/TablePagination.js +153 -79
- package/TableRow.js +60 -21
- package/Tabs.js +592 -271
- package/Tag.js +51 -16
- package/Text.js +68 -37
- package/TextField.js +209 -31
- package/Textarea.js +51 -42
- package/TimePicker.js +490 -232
- package/Tooltip.js +48 -23
- package/Tray.js +237 -13
- package/TrayMenu.js +62 -43
- package/VirtualizedList.js +205 -107
- package/VirtualizedMenu.js +359 -29
- package/VisuallyHidden.js +29 -6
- package/chunks/1250.js +98 -0
- package/chunks/1294.js +126 -0
- package/chunks/2956.js +18 -0
- package/chunks/4476.js +460 -0
- package/chunks/4491.js +10 -0
- package/chunks/4535.js +364 -0
- package/chunks/5047.js +3 -0
- package/chunks/6335.js +24 -0
- package/chunks/7279.js +10 -0
- package/chunks/8011.js +8 -0
- package/chunks/8307.js +56 -0
- package/chunks/8467.js +8 -0
- package/chunks/8809.js +8 -0
- package/chunks/{RadioGroup.context.js → 9551.js} +12 -6
- package/chunks/987.js +8 -0
- package/index.css +2436 -2261
- package/index.js +245 -195
- package/internal/utils/setRef.d.ts +2 -1
- package/package.json +4 -4
- package/src/Animation/hooks/useMotionSafeTransition/useMotionSafeTransition.d.ts +2 -0
- package/src/Autocomplete/SuggestionList/SuggestionList.d.ts +1 -1
- package/src/Button/Button.classes.d.ts +1 -1
- package/src/ComponentsProps.d.ts +111 -110
- package/src/DatePicker/DatePickerDataAttributes.d.ts +11 -0
- package/src/DatePicker/utils/DatePickerUtils.d.ts +1 -1
- package/src/MenuItem/MenuItem.type.d.ts +1 -0
- package/src/MenuList/MenuListContext.d.ts +2 -3
- package/src/Modal/Modal.type.d.ts +1 -0
- package/src/Popover/Popover.classes.d.ts +1 -1
- package/src/Popover/Popover.internal.d.ts +8 -0
- package/src/Popover/Popover.type.d.ts +1 -0
- package/src/Select/Select.type.d.ts +6 -4
- package/src/Table/Table.type.d.ts +3 -0
- package/src/Table/TableContext.d.ts +3 -0
- package/src/Table/TableRowContext.d.ts +7 -0
- package/src/Table/index.d.ts +1 -0
- package/src/TableCell/TableCell.classes.d.ts +1 -1
- package/src/TableFooter/TableFooter.classes.d.ts +1 -1
- package/src/TableFooter/TableFooter.type.d.ts +1 -0
- package/src/TableHead/TableHead.classes.d.ts +1 -1
- package/src/TableHead/TableHead.type.d.ts +1 -0
- package/src/TableRow/TableRow.type.d.ts +2 -0
- package/chunks/AccordionContext.js +0 -6
- package/chunks/Alert.js +0 -48
- package/chunks/AvatarGroup.js +0 -22
- package/chunks/Backdrop.js +0 -18
- package/chunks/Badge.js +0 -32
- package/chunks/BottomNavigationItem.js +0 -36
- package/chunks/Button.js +0 -88
- package/chunks/Chip.js +0 -73
- package/chunks/CircularProgressIndicator.js +0 -36
- package/chunks/Divider.js +0 -19
- package/chunks/DragHandle.js +0 -11
- package/chunks/Drawer.js +0 -33
- package/chunks/ExpandCollapseCaret.js +0 -24
- package/chunks/FormLabel.js +0 -27
- package/chunks/Icon.js +0 -25
- package/chunks/IconButtonLabel.js +0 -68
- package/chunks/List.js +0 -22
- package/chunks/ListItem.js +0 -83
- package/chunks/Menu.js +0 -61
- package/chunks/MenuDivider.js +0 -14
- package/chunks/MenuItemText.js +0 -18
- package/chunks/MenuList.js +0 -47
- package/chunks/Modal.js +0 -211
- package/chunks/Overlap.js +0 -25
- package/chunks/PickerTextField.js +0 -85
- package/chunks/Popover.js +0 -61
- package/chunks/PopperPaper.js +0 -15
- package/chunks/Select.js +0 -225
- package/chunks/ShowHideEye.js +0 -56
- package/chunks/SlideIn.js +0 -20
- package/chunks/SortableArrow.js +0 -73
- package/chunks/Squircle.js +0 -31
- package/chunks/StatusIndicator.js +0 -20
- package/chunks/StepConnector.js +0 -21
- package/chunks/StepIcon.js +0 -43
- package/chunks/StepLabel.js +0 -29
- package/chunks/StepperContext.js +0 -9
- package/chunks/TableContext.js +0 -6
- package/chunks/Tablelvl2Context.js +0 -6
- package/chunks/TabsContext.js +0 -6
- package/chunks/TextField.js +0 -110
- package/chunks/Tooltip.js +0 -217
- package/chunks/VirtualizedMenu.js +0 -162
- package/chunks/VisuallyHidden.js +0 -12
- package/chunks/composeEventHandlers.js +0 -10
- package/chunks/getFade.js +0 -27
- package/chunks/getGrow.js +0 -70
- package/chunks/getSlideIn.js +0 -30
- package/chunks/hasContent.js +0 -3
- package/chunks/useAnimationFrame.js +0 -15
- package/chunks/useFocusTrapStack.js +0 -38
- package/chunks/useHelperTextId.js +0 -24
- package/chunks/useListNavigation.js +0 -199
- package/chunks/useMenuItemSelect.js +0 -282
- package/chunks/useMotionSafeTransition.js +0 -9
- package/chunks/useNestedMenuItem.js +0 -27
- package/chunks/useNestedParentMenu.js +0 -113
- package/chunks/usePrefersReducedMotion.js +0 -36
- package/chunks/useTooltipForceHide.js +0 -27
- package/chunks/useTrayNavigate.js +0 -150
- package/chunks/withTooltip.js +0 -15
package/Dialog.js
CHANGED
|
@@ -1,73 +1,123 @@
|
|
|
1
|
-
import { jsx, jsxs } from
|
|
2
|
-
import { forwardRef } from
|
|
3
|
-
import { motion } from
|
|
4
|
-
import clsx from
|
|
5
|
-
import kebabCase from
|
|
6
|
-
import {
|
|
7
|
-
import { Xsm } from
|
|
8
|
-
import {
|
|
9
|
-
import
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
import { motion } from "framer-motion";
|
|
4
|
+
import clsx from "clsx";
|
|
5
|
+
import kebabCase from "lodash/kebabCase";
|
|
6
|
+
import { combineProps, useClasses, useEventCallback, useForkRef } from "@ringcentral/spring-base";
|
|
7
|
+
import { Xsm } from "@ringcentral/spring-icon";
|
|
8
|
+
import { motionTransition, useClassesWithMode, useThemeProps } from "@ringcentral/spring-theme";
|
|
9
|
+
import { getSlideIn } from "./chunks/4476.js";
|
|
10
|
+
import { IconButton as IconButton_IconButton } from "./IconButton.js";
|
|
11
|
+
import { Modal as Modal_Modal } from "./Modal.js";
|
|
12
|
+
import { usePrefersReducedMotion } from "./chunks/1294.js";
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
// extracted by css-extract-rspack-plugin
|
|
23
|
+
/* export default */ var Dialog = ({"sui-dialog-body":"sui-dialog-body","sui-dialog-root":"sui-dialog-root","sui-dialog-non-blocking":"sui-dialog-non-blocking","sui-dialog-small":"sui-dialog-small","sui-dialog-close-button":"sui-dialog-close-button","sui-dialog-medium":"sui-dialog-medium","sui-dialog-large":"sui-dialog-large","sui-dialog-title-root":"sui-dialog-title-root","sui-dialog-content-root":"sui-dialog-content-root","sui-dialog-actions-root":"sui-dialog-actions-root","sui-dialog-right":"sui-dialog-right","sui-dialog-right-close-button":"sui-dialog-right-close-button","sui-dialog-left":"sui-dialog-left","sui-dialog-left-close-button":"sui-dialog-left-close-button","sui-dialog-full-height":"sui-dialog-full-height","sui-dialog-full-screen":"sui-dialog-full-screen","sui-compact":"sui-compact"});
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
const Dialog_Dialog = /*#__PURE__*/ forwardRef((inProps, ref)=>{
|
|
37
|
+
const props = useThemeProps({
|
|
38
|
+
props: inProps,
|
|
39
|
+
name: 'Dialog'
|
|
40
|
+
});
|
|
29
41
|
const { bodyProps, classes, className, children, size = 'medium', placement = 'right', open, onClose, blocking = true, closeButton, CloseButtonProps, ...rest } = props;
|
|
30
42
|
const cls = useClassesWithMode('dialog', classes, className);
|
|
31
43
|
const toSize = kebabCase(size);
|
|
32
44
|
const isFullHeight = size === 'fullHeight';
|
|
33
45
|
const prefersReducedMotion = usePrefersReducedMotion();
|
|
34
46
|
const showCloseButton = shouldShowDialogCloseButton(closeButton, size);
|
|
35
|
-
const closeButtonClassName = showCloseButton
|
|
36
|
-
? cls('close-button', size === 'fullHeight' && `${placement}-close-button`)
|
|
37
|
-
: undefined;
|
|
47
|
+
const closeButtonClassName = showCloseButton ? cls('close-button', size === 'fullHeight' && `${placement}-close-button`) : undefined;
|
|
38
48
|
const slideInProps = getSlideIn({
|
|
39
49
|
toggle: open,
|
|
40
50
|
from: placement,
|
|
41
51
|
prefersReducedMotion,
|
|
42
|
-
toggleOnTransition: motionTransition[
|
|
43
|
-
toggleOffTransition: motionTransition[
|
|
52
|
+
toggleOnTransition: motionTransition["haste-01-fast"],
|
|
53
|
+
toggleOffTransition: motionTransition["neutral-01-fast"]
|
|
44
54
|
});
|
|
45
|
-
const handleCloseButtonClick = useEventCallback((e)
|
|
55
|
+
const handleCloseButtonClick = useEventCallback((e)=>{
|
|
46
56
|
onClose?.(e, 'closeButtonClick');
|
|
47
57
|
});
|
|
48
58
|
const handleBodyRef = useForkRef(ref, bodyProps?.ref);
|
|
49
|
-
return
|
|
59
|
+
return /*#__PURE__*/ jsx(Modal_Modal, {
|
|
60
|
+
open: open,
|
|
61
|
+
onClose: onClose,
|
|
62
|
+
blocking: blocking,
|
|
63
|
+
className: cls('root', {
|
|
64
|
+
'non-blocking': !blocking
|
|
65
|
+
}),
|
|
66
|
+
...rest,
|
|
67
|
+
children: /*#__PURE__*/ jsxs(motion.div, {
|
|
68
|
+
role: "dialog",
|
|
69
|
+
"aria-modal": blocking,
|
|
70
|
+
...isFullHeight && slideInProps,
|
|
71
|
+
...bodyProps,
|
|
72
|
+
ref: handleBodyRef,
|
|
73
|
+
tabIndex: bodyProps?.tabIndex ?? (blocking ? -1 : undefined),
|
|
74
|
+
className: clsx(cls('body', toSize, isFullHeight && placement), bodyProps?.className),
|
|
75
|
+
children: [
|
|
76
|
+
children,
|
|
77
|
+
closeButtonClassName && /*#__PURE__*/ jsx(IconButton_IconButton, {
|
|
78
|
+
size: 'large',
|
|
79
|
+
color: 'secondary',
|
|
80
|
+
symbol: Xsm,
|
|
81
|
+
variant: "contained",
|
|
82
|
+
...combineProps({
|
|
50
83
|
className: closeButtonClassName,
|
|
51
84
|
onClick: handleCloseButtonClick,
|
|
52
|
-
'aria-label': 'Close'
|
|
53
|
-
}, CloseButtonProps)
|
|
85
|
+
'aria-label': 'Close'
|
|
86
|
+
}, CloseButtonProps)
|
|
87
|
+
})
|
|
88
|
+
]
|
|
89
|
+
})
|
|
90
|
+
});
|
|
54
91
|
});
|
|
55
|
-
|
|
56
|
-
const DialogTitle = forwardRef(({ className, ...rest }, ref)
|
|
92
|
+
Dialog_Dialog.displayName = 'SuiDialog';
|
|
93
|
+
const DialogTitle = /*#__PURE__*/ forwardRef(({ className, ...rest }, ref)=>{
|
|
57
94
|
const cls = useClasses('dialog-title', undefined, className);
|
|
58
|
-
return jsx("div", {
|
|
95
|
+
return /*#__PURE__*/ jsx("div", {
|
|
96
|
+
ref: ref,
|
|
97
|
+
className: cls('root'),
|
|
98
|
+
...rest
|
|
99
|
+
});
|
|
59
100
|
});
|
|
60
101
|
DialogTitle.displayName = 'SuiDialogTitle';
|
|
61
|
-
const DialogContent = forwardRef(({ className, ...rest }, ref)
|
|
102
|
+
const DialogContent = /*#__PURE__*/ forwardRef(({ className, ...rest }, ref)=>{
|
|
62
103
|
const cls = useClasses('dialog-content', undefined, className);
|
|
63
|
-
return jsx("div", {
|
|
104
|
+
return /*#__PURE__*/ jsx("div", {
|
|
105
|
+
ref: ref,
|
|
106
|
+
className: cls('root'),
|
|
107
|
+
...rest
|
|
108
|
+
});
|
|
64
109
|
});
|
|
65
110
|
DialogContent.displayName = 'SuiDialogContent';
|
|
66
|
-
const DialogActions = forwardRef(({ className, ...rest }, ref)
|
|
111
|
+
const DialogActions = /*#__PURE__*/ forwardRef(({ className, ...rest }, ref)=>{
|
|
67
112
|
const cls = useClasses('dialog-actions', undefined, className);
|
|
68
|
-
return jsx("div", {
|
|
113
|
+
return /*#__PURE__*/ jsx("div", {
|
|
114
|
+
ref: ref,
|
|
115
|
+
className: cls('root'),
|
|
116
|
+
...rest
|
|
117
|
+
});
|
|
69
118
|
});
|
|
70
119
|
DialogActions.displayName = 'SuiDialogActions';
|
|
120
|
+
|
|
71
121
|
function shouldShowDialogCloseButton(closeButton, size) {
|
|
72
122
|
if (size === 'fullScreen') {
|
|
73
123
|
return false;
|
|
@@ -81,4 +131,8 @@ function shouldShowDialogCloseButton(closeButton, size) {
|
|
|
81
131
|
return size === 'fullHeight';
|
|
82
132
|
}
|
|
83
133
|
|
|
84
|
-
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
export { Dialog as dialogStyle, DialogActions, DialogContent, DialogTitle, Dialog_Dialog as Dialog };
|
package/Divider.js
CHANGED
|
@@ -1,9 +1,45 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import '@ringcentral/spring-theme';
|
|
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";
|
|
6
5
|
|
|
7
|
-
var Divider = {"sui-divider-root":"sui-divider-root","sui-divider-horizontal":"sui-divider-horizontal","sui-divider-horizontal-has-title":"sui-divider-horizontal-has-title","sui-divider-vertical":"sui-divider-vertical","sui-divider-flex-item":"sui-divider-flex-item","sui-divider-full":"sui-divider-full","sui-divider-middle-horizontal":"sui-divider-middle-horizontal","sui-divider-middle-vertical":"sui-divider-middle-vertical"};
|
|
8
6
|
|
|
9
|
-
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
// extracted by css-extract-rspack-plugin
|
|
11
|
+
/* export default */ var Divider = ({"sui-divider-root":"sui-divider-root","sui-divider-horizontal":"sui-divider-horizontal","sui-divider-horizontal-has-title":"sui-divider-horizontal-has-title","sui-divider-vertical":"sui-divider-vertical","sui-divider-flex-item":"sui-divider-flex-item","sui-divider-full":"sui-divider-full","sui-divider-middle-horizontal":"sui-divider-middle-horizontal","sui-divider-middle-vertical":"sui-divider-middle-vertical"});
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
const Divider_Divider = /*#__PURE__*/ forwardRef((inProps, ref)=>{
|
|
18
|
+
const props = useThemeProps({
|
|
19
|
+
props: inProps,
|
|
20
|
+
name: 'Divider'
|
|
21
|
+
});
|
|
22
|
+
const { component: DividerRoot = 'hr', variant = 'full', orientation = 'horizontal', classes, className, children, flexItem = false, title, ...rest } = props;
|
|
23
|
+
const cls = useClasses('divider', classes, className);
|
|
24
|
+
const role = DividerRoot !== 'hr' ? 'separator' : undefined;
|
|
25
|
+
const hasTitle = title !== undefined;
|
|
26
|
+
return /*#__PURE__*/ jsx(DividerRoot, {
|
|
27
|
+
role: role,
|
|
28
|
+
className: cls('root', variant, orientation, {
|
|
29
|
+
'flex-item': flexItem,
|
|
30
|
+
'has-title': hasTitle
|
|
31
|
+
}, `${variant}-${orientation}`, hasTitle && `${orientation}-has-title`),
|
|
32
|
+
"data-title": title,
|
|
33
|
+
ref: ref,
|
|
34
|
+
...rest,
|
|
35
|
+
children: children
|
|
36
|
+
});
|
|
37
|
+
});
|
|
38
|
+
Divider_Divider.displayName = 'SuiDivider';
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
export { Divider as dividerStyle, Divider_Divider as Divider };
|
package/DragHandle.js
CHANGED
|
@@ -1,8 +1,34 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import '@ringcentral/spring-base';
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
import { useClasses } from "@ringcentral/spring-base";
|
|
5
4
|
|
|
6
|
-
var DragHandle = {"sui-drag-handle-root":"sui-drag-handle-root","sui-drag-handle-top":"sui-drag-handle-top","sui-drag-handle-bottom":"sui-drag-handle-bottom","sui-drag-handle-bar":"sui-drag-handle-bar"};
|
|
7
5
|
|
|
8
|
-
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
// extracted by css-extract-rspack-plugin
|
|
9
|
+
/* export default */ var DragHandle = ({"sui-drag-handle-root":"sui-drag-handle-root","sui-drag-handle-top":"sui-drag-handle-top","sui-drag-handle-bottom":"sui-drag-handle-bottom","sui-drag-handle-bar":"sui-drag-handle-bar"});
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
const DragHandle_DragHandle = /*#__PURE__*/ forwardRef((props, ref)=>{
|
|
15
|
+
const { component: DragHandleRoot = 'div', anchor = 'top', classes, className, ...rest } = props;
|
|
16
|
+
const cls = useClasses('drag-handle', classes, className);
|
|
17
|
+
return /*#__PURE__*/ jsx(DragHandleRoot, {
|
|
18
|
+
ref: ref,
|
|
19
|
+
className: cls('root', anchor),
|
|
20
|
+
role: "presentation",
|
|
21
|
+
"aria-hidden": "true",
|
|
22
|
+
...rest,
|
|
23
|
+
children: /*#__PURE__*/ jsx("div", {
|
|
24
|
+
className: cls('bar')
|
|
25
|
+
})
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
export { DragHandle as dragHandleStyle, DragHandle_DragHandle as DragHandle };
|
package/Drawer.js
CHANGED
|
@@ -1,19 +1,117 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
import { motion } from "framer-motion";
|
|
4
|
+
import { useClasses, useForkRef } from "@ringcentral/spring-base";
|
|
5
|
+
import { motionTransition, useThemeProps } from "@ringcentral/spring-theme";
|
|
6
|
+
import clsx from "clsx";
|
|
7
|
+
import { getSlideIn } from "./chunks/4476.js";
|
|
8
|
+
import { Modal as Modal_Modal } from "./Modal.js";
|
|
9
|
+
import { usePrefersReducedMotion } from "./chunks/1294.js";
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
// extracted by css-extract-rspack-plugin
|
|
18
|
+
/* export default */ var Drawer = ({"sui-drawer-root":"sui-drawer-root","sui-drawer-anchor-left":"sui-drawer-anchor-left","sui-drawer-anchor-right":"sui-drawer-anchor-right","sui-drawer-anchor-top":"sui-drawer-anchor-top","sui-drawer-anchor-bottom":"sui-drawer-anchor-bottom","sui-drawer-persistent-left":"sui-drawer-persistent-left","sui-drawer-persistent-right":"sui-drawer-persistent-right","sui-drawer-persistent-top":"sui-drawer-persistent-top","sui-drawer-persistent-bottom":"sui-drawer-persistent-bottom","sui-drawer-body":"sui-drawer-body","sui-drawer-body-left":"sui-drawer-body-left","sui-drawer-body-right":"sui-drawer-body-right","sui-drawer-body-top":"sui-drawer-body-top","sui-drawer-body-bottom":"sui-drawer-body-bottom","sui-drawer-content":"sui-drawer-content","sui-drawer-non-blocking":"sui-drawer-non-blocking","sui-drawer-header":"sui-drawer-header"});
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Drawer Component - Base drawer without gesture support
|
|
30
|
+
*
|
|
31
|
+
* A clean, lightweight drawer component that provides basic modal/slide functionality.
|
|
32
|
+
* For gesture support, use SwipeableDrawer which builds on top of this component.
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```tsx
|
|
36
|
+
* // Simple navigation drawer
|
|
37
|
+
* <Drawer
|
|
38
|
+
* open={open}
|
|
39
|
+
* onClose={onClose}
|
|
40
|
+
* anchor="left"
|
|
41
|
+
* variant="temporary"
|
|
42
|
+
* >
|
|
43
|
+
* <Navigation />
|
|
44
|
+
* </Drawer>
|
|
45
|
+
*
|
|
46
|
+
* // Bottom sheet without gestures
|
|
47
|
+
* <Drawer
|
|
48
|
+
* open={open}
|
|
49
|
+
* onClose={onClose}
|
|
50
|
+
* anchor="bottom"
|
|
51
|
+
* >
|
|
52
|
+
* <Content />
|
|
53
|
+
* </Drawer>
|
|
54
|
+
* ```
|
|
55
|
+
*/ const Drawer_Drawer = /*#__PURE__*/ forwardRef((inProps, ref)=>{
|
|
56
|
+
const props = useThemeProps({
|
|
57
|
+
props: inProps,
|
|
58
|
+
name: 'Drawer'
|
|
59
|
+
});
|
|
60
|
+
const { anchor = 'left', bodyProps, classes, className, children, header, footer, open, onClose, variant = 'temporary', blocking = true, measurementRefs, headerProps, ...rest } = props;
|
|
61
|
+
const headerRef = measurementRefs?.header;
|
|
62
|
+
const footerRef = measurementRefs?.footer;
|
|
63
|
+
const contentRef = measurementRefs?.content;
|
|
64
|
+
const cls = useClasses('drawer', classes, className);
|
|
65
|
+
const slideInProps = getSlideIn({
|
|
66
|
+
toggle: open,
|
|
67
|
+
from: anchor,
|
|
68
|
+
prefersReducedMotion: usePrefersReducedMotion(),
|
|
69
|
+
toggleOnTransition: motionTransition["neutral-01-fast"],
|
|
70
|
+
toggleOffTransition: motionTransition["neutral-01-fast"]
|
|
71
|
+
});
|
|
72
|
+
const handleBodyRef = useForkRef(ref, bodyProps?.ref);
|
|
73
|
+
return /*#__PURE__*/ jsx(Modal_Modal, {
|
|
74
|
+
open: open,
|
|
75
|
+
onClose: onClose,
|
|
76
|
+
blocking: blocking,
|
|
77
|
+
className: clsx(cls('root', `anchor-${anchor}`, {
|
|
78
|
+
'non-blocking': !blocking
|
|
79
|
+
})),
|
|
80
|
+
...rest,
|
|
81
|
+
children: /*#__PURE__*/ jsxs(motion.div, {
|
|
82
|
+
role: "dialog",
|
|
83
|
+
"aria-modal": blocking,
|
|
84
|
+
...slideInProps,
|
|
85
|
+
...bodyProps,
|
|
86
|
+
ref: handleBodyRef,
|
|
87
|
+
className: clsx(cls('body', `body-${anchor}`), bodyProps?.className),
|
|
88
|
+
tabIndex: bodyProps?.tabIndex ?? (blocking ? -1 : undefined),
|
|
89
|
+
children: [
|
|
90
|
+
header && /*#__PURE__*/ jsx("div", {
|
|
91
|
+
ref: headerRef,
|
|
92
|
+
...headerProps,
|
|
93
|
+
className: clsx(cls('header'), headerProps?.className),
|
|
94
|
+
children: header
|
|
95
|
+
}),
|
|
96
|
+
/*#__PURE__*/ jsx("div", {
|
|
97
|
+
ref: contentRef,
|
|
98
|
+
className: cls('content'),
|
|
99
|
+
children: children
|
|
100
|
+
}),
|
|
101
|
+
footer && /*#__PURE__*/ jsx("div", {
|
|
102
|
+
ref: footerRef,
|
|
103
|
+
className: cls('footer'),
|
|
104
|
+
children: footer
|
|
105
|
+
})
|
|
106
|
+
]
|
|
107
|
+
})
|
|
108
|
+
});
|
|
109
|
+
});
|
|
110
|
+
Drawer_Drawer.displayName = 'SuiDrawer';
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
export { Drawer as drawerStyles, Drawer_Drawer as Drawer };
|