@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.
Files changed (213) hide show
  1. package/Accordion.js +90 -34
  2. package/AccordionHeader.js +71 -21
  3. package/Alert.js +120 -28
  4. package/Animation.js +2 -46
  5. package/Announcement.js +46 -35
  6. package/Autocomplete.js +1011 -583
  7. package/Avatar.js +134 -73
  8. package/AvatarGroup.js +50 -7
  9. package/Backdrop.js +45 -7
  10. package/Badge.js +77 -15
  11. package/Block.js +34 -12
  12. package/BlockHeader.js +57 -15
  13. package/BottomNavigation.js +181 -65
  14. package/BottomNavigationItem.js +93 -30
  15. package/Button.js +160 -24
  16. package/CallButton.js +53 -31
  17. package/Checkbox.js +88 -26
  18. package/Chip.js +126 -26
  19. package/CircularProgressIndicator.js +80 -8
  20. package/ClickAwayListener.js +4 -1
  21. package/ComponentsProps.js +1 -0
  22. package/DatePicker.js +611 -192
  23. package/DateUtilsContext.js +43 -25
  24. package/Dialer.js +564 -253
  25. package/Dialog.js +99 -45
  26. package/Divider.js +43 -7
  27. package/DragHandle.js +32 -6
  28. package/Drawer.js +117 -19
  29. package/Dropdown.js +154 -77
  30. package/EmptyState.js +65 -15
  31. package/FabButton.js +51 -17
  32. package/FocusTrap.js +109 -12
  33. package/FormField.js +108 -12
  34. package/FormLabel.js +81 -7
  35. package/Icon.js +1 -8
  36. package/IconButton.js +142 -26
  37. package/IconButtonGroup.js +35 -12
  38. package/InlineEditable.js +98 -44
  39. package/LinearProgressIndicator.js +73 -24
  40. package/Link.js +40 -11
  41. package/List.js +54 -9
  42. package/ListItem.js +152 -23
  43. package/ListItemText.js +44 -17
  44. package/ListNavigation.js +272 -20
  45. package/Menu.js +139 -23
  46. package/MenuActions.js +37 -12
  47. package/MenuDivider.js +34 -8
  48. package/MenuFooter.js +36 -12
  49. package/MenuHeader.js +54 -16
  50. package/MenuItem.js +402 -35
  51. package/MenuItemText.js +51 -9
  52. package/MenuList.js +87 -36
  53. package/Modal.js +345 -16
  54. package/NestedMenuContext.js +183 -11
  55. package/Option.js +32 -36
  56. package/Overlap.js +54 -7
  57. package/PageHeader.js +62 -24
  58. package/PickerTextField.js +156 -35
  59. package/Popover.js +262 -21
  60. package/Popper.js +112 -62
  61. package/PopperPaper.js +54 -8
  62. package/Portal.js +6 -1
  63. package/Radio.js +65 -21
  64. package/RadioGroup.js +56 -17
  65. package/Rating.js +223 -87
  66. package/Select.js +387 -44
  67. package/SingleFilter.js +148 -79
  68. package/Skeleton.js +68 -17
  69. package/Slider.js +167 -69
  70. package/Snackbar.js +122 -59
  71. package/SortableList.js +32 -12
  72. package/SortableListDndContext.js +69 -22
  73. package/SortableListItem.js +92 -47
  74. package/SortableVirtualizedList.js +44 -20
  75. package/SplitButton.js +124 -89
  76. package/Squircle.js +4 -7
  77. package/StatusIndicator.js +51 -9
  78. package/Step.js +63 -38
  79. package/StepButton.js +51 -23
  80. package/StepConnector.js +48 -8
  81. package/StepContent.js +67 -24
  82. package/StepIcon.js +90 -9
  83. package/StepLabel.js +90 -14
  84. package/Stepper.js +65 -23
  85. package/SubMenu.js +203 -101
  86. package/SwipeableDrawer.js +439 -194
  87. package/Switch.js +70 -23
  88. package/Tab.js +120 -57
  89. package/TabContext.js +59 -15
  90. package/TabPanel.js +40 -13
  91. package/Table.js +60 -17
  92. package/TableBody.js +42 -12
  93. package/TableCell.js +84 -50
  94. package/TableContainer.js +32 -10
  95. package/TableFooter.js +38 -10
  96. package/TableHead.js +49 -15
  97. package/TablePagination.js +153 -79
  98. package/TableRow.js +60 -21
  99. package/Tabs.js +592 -271
  100. package/Tag.js +51 -16
  101. package/Text.js +68 -37
  102. package/TextField.js +209 -31
  103. package/Textarea.js +51 -42
  104. package/TimePicker.js +490 -232
  105. package/Tooltip.js +48 -23
  106. package/Tray.js +237 -13
  107. package/TrayMenu.js +62 -43
  108. package/VirtualizedList.js +205 -107
  109. package/VirtualizedMenu.js +359 -29
  110. package/VisuallyHidden.js +29 -6
  111. package/chunks/1250.js +98 -0
  112. package/chunks/1294.js +126 -0
  113. package/chunks/2956.js +18 -0
  114. package/chunks/4476.js +460 -0
  115. package/chunks/4491.js +10 -0
  116. package/chunks/4535.js +364 -0
  117. package/chunks/5047.js +3 -0
  118. package/chunks/6335.js +24 -0
  119. package/chunks/7279.js +10 -0
  120. package/chunks/8011.js +8 -0
  121. package/chunks/8307.js +56 -0
  122. package/chunks/8467.js +8 -0
  123. package/chunks/8809.js +8 -0
  124. package/chunks/{RadioGroup.context.js → 9551.js} +12 -6
  125. package/chunks/987.js +8 -0
  126. package/index.css +2436 -2261
  127. package/index.js +245 -195
  128. package/internal/utils/setRef.d.ts +2 -1
  129. package/package.json +4 -4
  130. package/src/Animation/hooks/useMotionSafeTransition/useMotionSafeTransition.d.ts +2 -0
  131. package/src/Autocomplete/SuggestionList/SuggestionList.d.ts +1 -1
  132. package/src/Button/Button.classes.d.ts +1 -1
  133. package/src/ComponentsProps.d.ts +111 -110
  134. package/src/DatePicker/DatePickerDataAttributes.d.ts +11 -0
  135. package/src/DatePicker/utils/DatePickerUtils.d.ts +1 -1
  136. package/src/MenuItem/MenuItem.type.d.ts +1 -0
  137. package/src/MenuList/MenuListContext.d.ts +2 -3
  138. package/src/Modal/Modal.type.d.ts +1 -0
  139. package/src/Popover/Popover.classes.d.ts +1 -1
  140. package/src/Popover/Popover.internal.d.ts +8 -0
  141. package/src/Popover/Popover.type.d.ts +1 -0
  142. package/src/Select/Select.type.d.ts +6 -4
  143. package/src/Table/Table.type.d.ts +3 -0
  144. package/src/Table/TableContext.d.ts +3 -0
  145. package/src/Table/TableRowContext.d.ts +7 -0
  146. package/src/Table/index.d.ts +1 -0
  147. package/src/TableCell/TableCell.classes.d.ts +1 -1
  148. package/src/TableFooter/TableFooter.classes.d.ts +1 -1
  149. package/src/TableFooter/TableFooter.type.d.ts +1 -0
  150. package/src/TableHead/TableHead.classes.d.ts +1 -1
  151. package/src/TableHead/TableHead.type.d.ts +1 -0
  152. package/src/TableRow/TableRow.type.d.ts +2 -0
  153. package/chunks/AccordionContext.js +0 -6
  154. package/chunks/Alert.js +0 -48
  155. package/chunks/AvatarGroup.js +0 -22
  156. package/chunks/Backdrop.js +0 -18
  157. package/chunks/Badge.js +0 -32
  158. package/chunks/BottomNavigationItem.js +0 -36
  159. package/chunks/Button.js +0 -88
  160. package/chunks/Chip.js +0 -73
  161. package/chunks/CircularProgressIndicator.js +0 -36
  162. package/chunks/Divider.js +0 -19
  163. package/chunks/DragHandle.js +0 -11
  164. package/chunks/Drawer.js +0 -33
  165. package/chunks/ExpandCollapseCaret.js +0 -24
  166. package/chunks/FormLabel.js +0 -27
  167. package/chunks/Icon.js +0 -25
  168. package/chunks/IconButtonLabel.js +0 -68
  169. package/chunks/List.js +0 -22
  170. package/chunks/ListItem.js +0 -83
  171. package/chunks/Menu.js +0 -61
  172. package/chunks/MenuDivider.js +0 -14
  173. package/chunks/MenuItemText.js +0 -18
  174. package/chunks/MenuList.js +0 -47
  175. package/chunks/Modal.js +0 -211
  176. package/chunks/Overlap.js +0 -25
  177. package/chunks/PickerTextField.js +0 -85
  178. package/chunks/Popover.js +0 -61
  179. package/chunks/PopperPaper.js +0 -15
  180. package/chunks/Select.js +0 -225
  181. package/chunks/ShowHideEye.js +0 -56
  182. package/chunks/SlideIn.js +0 -20
  183. package/chunks/SortableArrow.js +0 -73
  184. package/chunks/Squircle.js +0 -31
  185. package/chunks/StatusIndicator.js +0 -20
  186. package/chunks/StepConnector.js +0 -21
  187. package/chunks/StepIcon.js +0 -43
  188. package/chunks/StepLabel.js +0 -29
  189. package/chunks/StepperContext.js +0 -9
  190. package/chunks/TableContext.js +0 -6
  191. package/chunks/Tablelvl2Context.js +0 -6
  192. package/chunks/TabsContext.js +0 -6
  193. package/chunks/TextField.js +0 -110
  194. package/chunks/Tooltip.js +0 -217
  195. package/chunks/VirtualizedMenu.js +0 -162
  196. package/chunks/VisuallyHidden.js +0 -12
  197. package/chunks/composeEventHandlers.js +0 -10
  198. package/chunks/getFade.js +0 -27
  199. package/chunks/getGrow.js +0 -70
  200. package/chunks/getSlideIn.js +0 -30
  201. package/chunks/hasContent.js +0 -3
  202. package/chunks/useAnimationFrame.js +0 -15
  203. package/chunks/useFocusTrapStack.js +0 -38
  204. package/chunks/useHelperTextId.js +0 -24
  205. package/chunks/useListNavigation.js +0 -199
  206. package/chunks/useMenuItemSelect.js +0 -282
  207. package/chunks/useMotionSafeTransition.js +0 -9
  208. package/chunks/useNestedMenuItem.js +0 -27
  209. package/chunks/useNestedParentMenu.js +0 -113
  210. package/chunks/usePrefersReducedMotion.js +0 -36
  211. package/chunks/useTooltipForceHide.js +0 -27
  212. package/chunks/useTrayNavigate.js +0 -150
  213. package/chunks/withTooltip.js +0 -15
package/Dialog.js CHANGED
@@ -1,73 +1,123 @@
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 { useEventCallback, useForkRef, combineProps, useClasses } from '@ringcentral/spring-base';
7
- import { Xsm } from '@ringcentral/spring-icon';
8
- import { useThemeProps, useClassesWithMode, motionTransition } from '@ringcentral/spring-theme';
9
- import './chunks/Icon.js';
10
- import { u as usePrefersReducedMotion } from './chunks/usePrefersReducedMotion.js';
11
- import { g as getSlideIn } from './chunks/getSlideIn.js';
12
- import { I as IconButton } from './chunks/IconButtonLabel.js';
13
- import { M as Modal } from './chunks/Modal.js';
14
- import '@mui/base';
15
- import './chunks/Squircle.js';
16
- import './chunks/withTooltip.js';
17
- import './chunks/Tooltip.js';
18
- import './chunks/getFade.js';
19
- import './Popper.js';
20
- import '@floating-ui/react-dom';
21
- import './chunks/PopperPaper.js';
22
- import './chunks/useFocusTrapStack.js';
23
- import './chunks/Backdrop.js';
24
-
25
- var Dialog$1 = {"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"};
26
-
27
- const Dialog = forwardRef((inProps, ref) => {
28
- const props = useThemeProps({ props: inProps, name: 'Dialog' });
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['haste-01-fast'],
43
- toggleOffTransition: motionTransition['neutral-01-fast'],
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 (jsx(Modal, { open: open, onClose: onClose, blocking: blocking, className: cls('root', { 'non-blocking': !blocking }), ...rest, children: jsxs(motion.div, { role: "dialog", "aria-modal": blocking, ...(isFullHeight && slideInProps), ...bodyProps, ref: handleBodyRef, tabIndex: bodyProps?.tabIndex ?? (blocking ? -1 : undefined), className: clsx(cls('body', toSize, isFullHeight && placement), bodyProps?.className), children: [children, closeButtonClassName && (jsx(IconButton, { size: 'large', color: 'secondary', symbol: Xsm, variant: "contained", ...combineProps({
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
- Dialog.displayName = 'SuiDialog';
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", { ref: ref, className: cls('root'), ...rest });
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", { ref: ref, className: cls('root'), ...rest });
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", { ref: ref, className: cls('root'), ...rest });
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
- export { Dialog, DialogActions, DialogContent, DialogTitle, Dialog$1 as dialogStyle };
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
- export { D as Divider } from './chunks/Divider.js';
2
- import 'react/jsx-runtime';
3
- import 'react';
4
- import '@ringcentral/spring-base';
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
- export { Divider as dividerStyle };
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
- export { D as DragHandle } from './chunks/DragHandle.js';
2
- import 'react/jsx-runtime';
3
- import 'react';
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
- export { DragHandle as dragHandleStyle };
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
- export { D as Drawer } from './chunks/Drawer.js';
2
- import 'react/jsx-runtime';
3
- import 'react';
4
- import 'framer-motion';
5
- import '@ringcentral/spring-base';
6
- import '@ringcentral/spring-theme';
7
- import 'clsx';
8
- import './chunks/Icon.js';
9
- import './chunks/usePrefersReducedMotion.js';
10
- import './chunks/getSlideIn.js';
11
- import './chunks/Modal.js';
12
- import '@mui/base';
13
- import './chunks/getFade.js';
14
- import './chunks/useFocusTrapStack.js';
15
- import './chunks/Backdrop.js';
16
-
17
- 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"};
18
-
19
- export { Drawer as drawerStyles };
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 };