@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/Accordion.js CHANGED
@@ -1,64 +1,120 @@
1
- import { jsxs, jsx } from 'react/jsx-runtime';
2
- import { forwardRef, useCallback, useMemo } from 'react';
3
- import { AnimatePresence, motion } from 'framer-motion';
4
- import { useClasses, useControlled, useId, useEver } from '@ringcentral/spring-base';
5
- import { useThemeProps, motionTransition } from '@ringcentral/spring-theme';
6
- import './chunks/Icon.js';
7
- import { u as useMotionSafeTransition } from './chunks/useMotionSafeTransition.js';
8
- import { A as AccordionContext } from './chunks/AccordionContext.js';
9
- export { u as useAccordionContext } from './chunks/AccordionContext.js';
10
- import './chunks/usePrefersReducedMotion.js';
11
-
12
- var Accordion$1 = {"sui-accordion-root":"sui-accordion-root","sui-accordion-panel-wrapper":"sui-accordion-panel-wrapper","sui-accordion-panel-inner-wrapper":"sui-accordion-panel-inner-wrapper"};
13
-
14
- const Accordion = forwardRef((inProps, ref) => {
15
- const props = useThemeProps({ props: inProps, name: 'Accordion' });
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { forwardRef, useCallback, useMemo } from "react";
3
+ import { AnimatePresence, motion } from "framer-motion";
4
+ import { useClasses, useControlled, useEver, useId } from "@ringcentral/spring-base";
5
+ import { motionTransition, useThemeProps } from "@ringcentral/spring-theme";
6
+ import "./chunks/4476.js";
7
+ import { AccordionContext } from "./chunks/8467.js";
8
+ import { useMotionSafeTransition } from "./chunks/1294.js";
9
+
10
+
11
+
12
+
13
+
14
+
15
+ // extracted by css-extract-rspack-plugin
16
+ /* export default */ var Accordion = ({"sui-accordion-root":"sui-accordion-root","sui-accordion-panel-wrapper":"sui-accordion-panel-wrapper","sui-accordion-panel-inner-wrapper":"sui-accordion-panel-inner-wrapper"});
17
+
18
+
19
+
20
+
21
+
22
+
23
+
24
+
25
+ const Accordion_Accordion = /*#__PURE__*/ forwardRef((inProps, ref)=>{
26
+ const props = useThemeProps({
27
+ props: inProps,
28
+ name: 'Accordion'
29
+ });
16
30
  const { header, classes, className, children, defaultExpanded = false, expanded: expandedProp, onChange, keepMounted, ...rest } = props;
17
31
  const cls = useClasses('accordion', classes, className);
18
32
  const [expanded, setExpandedState] = useControlled({
19
33
  controlled: expandedProp,
20
34
  default: defaultExpanded,
21
35
  name: 'SuiAccordion',
22
- state: 'expanded',
36
+ state: 'expanded'
23
37
  });
24
- const handleChange = useCallback((event) => {
25
- setExpandedState((expanded) => !expanded);
38
+ const handleChange = useCallback((event)=>{
39
+ setExpandedState((expanded)=>!expanded);
26
40
  if (onChange) {
27
41
  onChange(event, !expanded);
28
42
  }
29
- }, [expanded, onChange, setExpandedState]);
30
- const expandedTransition = useMotionSafeTransition(motionTransition['spring-01-fast']);
31
- const collapsedTransition = useMotionSafeTransition(motionTransition['spring-01-slow']);
32
- const collapsedHeightTransition = useMotionSafeTransition(motionTransition['haste-01-slow']);
43
+ }, [
44
+ expanded,
45
+ onChange,
46
+ setExpandedState
47
+ ]);
48
+ const expandedTransition = useMotionSafeTransition(motionTransition["spring-01-fast"]);
49
+ const collapsedTransition = useMotionSafeTransition(motionTransition["spring-01-slow"]);
50
+ const collapsedHeightTransition = useMotionSafeTransition(motionTransition["haste-01-slow"]);
33
51
  const ARIA_CONTROLS = 'aria-controls';
34
52
  const accordionHeader = header;
35
53
  const accordionHeaderId = useId(accordionHeader.props?.id);
36
54
  const accordionPanelId = useId(accordionHeader.props?.[ARIA_CONTROLS]);
37
- const contextValue = useMemo(() => ({
38
- id: accordionHeaderId,
39
- ariaControls: accordionPanelId,
55
+ const contextValue = useMemo(()=>({
56
+ id: accordionHeaderId,
57
+ ariaControls: accordionPanelId,
58
+ expanded,
59
+ toggle: handleChange
60
+ }), [
61
+ accordionHeaderId,
62
+ accordionPanelId,
40
63
  expanded,
41
- toggle: handleChange,
42
- }), [accordionHeaderId, accordionPanelId, expanded, handleChange]);
64
+ handleChange
65
+ ]);
43
66
  const isEverShown = useEver(expanded);
44
67
  const keepAlive = keepMounted && isEverShown;
45
68
  const motionVariants = {
46
69
  expanded: {
47
70
  transition: expandedTransition,
48
71
  opacity: 1,
49
- height: 'auto',
72
+ height: 'auto'
50
73
  },
51
74
  collapsed: {
52
75
  transition: {
53
76
  ...collapsedTransition,
54
- height: collapsedHeightTransition,
77
+ height: collapsedHeightTransition
55
78
  },
56
79
  opacity: 0,
57
- height: 0,
58
- },
80
+ height: 0
81
+ }
59
82
  };
60
- return (jsxs("div", { className: cls('root'), ...rest, ref: ref, children: [jsx(AccordionContext.Provider, { value: contextValue, children: header }), jsx(AnimatePresence, { initial: false, children: (expanded || keepAlive) && (jsx(motion.div, { "aria-labelledby": accordionHeaderId, id: accordionPanelId, className: cls('panel-wrapper'), initial: "collapsed", animate: expanded ? 'expanded' : 'collapsed', exit: "collapsed", variants: motionVariants, children: jsx("div", { className: cls('panel-inner-wrapper'), children: children }) })) })] }));
83
+ return /*#__PURE__*/ jsxs("div", {
84
+ className: cls('root'),
85
+ ...rest,
86
+ ref: ref,
87
+ children: [
88
+ /*#__PURE__*/ jsx(AccordionContext.Provider, {
89
+ value: contextValue,
90
+ children: header
91
+ }),
92
+ /*#__PURE__*/ jsx(AnimatePresence, {
93
+ initial: false,
94
+ children: (expanded || keepAlive) && /*#__PURE__*/ jsx(motion.div, {
95
+ "aria-labelledby": accordionHeaderId,
96
+ id: accordionPanelId,
97
+ className: cls('panel-wrapper'),
98
+ initial: "collapsed",
99
+ animate: expanded ? 'expanded' : 'collapsed',
100
+ exit: "collapsed",
101
+ variants: motionVariants,
102
+ children: /*#__PURE__*/ jsx("div", {
103
+ className: cls('panel-inner-wrapper'),
104
+ children: children
105
+ })
106
+ })
107
+ })
108
+ ]
109
+ });
61
110
  });
62
- Accordion.displayName = 'SuiAccordion';
111
+ Accordion_Accordion.displayName = 'SuiAccordion';
112
+
113
+
114
+
115
+
116
+
117
+
63
118
 
64
- export { Accordion, AccordionContext, Accordion$1 as accordionStyles };
119
+ export { Accordion as accordionStyles, Accordion_Accordion as Accordion };
120
+ export { AccordionContext, useAccordionContext } from "./chunks/8467.js";
@@ -1,23 +1,33 @@
1
- import { jsxs, jsx } from 'react/jsx-runtime';
2
- import { forwardRef } from 'react';
3
- import { useClasses, useFocusVisible, useForkRef, getTitle } from '@ringcentral/spring-base';
4
- import { useThemeProps } from '@ringcentral/spring-theme';
5
- import { h as hasContent } from './chunks/hasContent.js';
6
- import '@mui/utils';
7
- import { u as useAccordionContext } from './chunks/AccordionContext.js';
8
- import { E as ExpandCollapseCaret } from './chunks/ExpandCollapseCaret.js';
9
- import 'framer-motion';
10
- import './chunks/Icon.js';
11
- import './chunks/useMotionSafeTransition.js';
12
- import './chunks/usePrefersReducedMotion.js';
13
-
14
- var AccordionHeader$1 = {"sui-accordion-header-root":"sui-accordion-header-root","sui-focus-visible":"sui-focus-visible","sui-disabled":"sui-disabled","sui-accordion-header-content":"sui-accordion-header-content","sui-accordion-header-primary-text":"sui-accordion-header-primary-text","sui-accordion-header-secondary-slot":"sui-accordion-header-secondary-slot","sui-accordion-header-expand-icon":"sui-accordion-header-expand-icon"};
15
-
16
- const AccordionHeader = forwardRef((inProps, ref) => {
17
- const props = useThemeProps({ props: inProps, name: 'AccordionHeader' });
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { forwardRef } from "react";
3
+ import { getTitle, useClasses, useFocusVisible, useForkRef } from "@ringcentral/spring-base";
4
+ import { useThemeProps } from "@ringcentral/spring-theme";
5
+ import { useAccordionContext } from "./chunks/8467.js";
6
+ import { ExpandCollapseCaret as ExpandCollapseCaret_ExpandCollapseCaret } from "./chunks/1294.js";
7
+ import { hasContent } from "./chunks/5047.js";
8
+
9
+
10
+
11
+
12
+
13
+ // extracted by css-extract-rspack-plugin
14
+ /* export default */ var AccordionHeader = ({"sui-accordion-header-root":"sui-accordion-header-root","sui-focus-visible":"sui-focus-visible","sui-disabled":"sui-disabled","sui-accordion-header-content":"sui-accordion-header-content","sui-accordion-header-primary-text":"sui-accordion-header-primary-text","sui-accordion-header-secondary-slot":"sui-accordion-header-secondary-slot","sui-accordion-header-expand-icon":"sui-accordion-header-expand-icon"});
15
+
16
+
17
+
18
+
19
+
20
+
21
+
22
+
23
+ const AccordionHeader_AccordionHeader = /*#__PURE__*/ forwardRef((inProps, ref)=>{
24
+ const props = useThemeProps({
25
+ props: inProps,
26
+ name: 'AccordionHeader'
27
+ });
18
28
  const { classes, className, children, onClick, secondarySlot, disabled, expandIcon = true, ExpandCollapseCaretProps, id: idProp, 'aria-controls': ariaControlsProp, ...rest } = props;
19
29
  const { id, ariaControls, expanded, toggle } = useAccordionContext();
20
- const handleChange = (event) => {
30
+ const handleChange = (event)=>{
21
31
  if (toggle) {
22
32
  toggle(event);
23
33
  }
@@ -28,8 +38,48 @@ const AccordionHeader = forwardRef((inProps, ref) => {
28
38
  const cls = useClasses('accordion-header', classes, className);
29
39
  const { focusVisible, focusVisibleRef, focusVisibleHandlers } = useFocusVisible(props);
30
40
  const buttonRef = useForkRef(ref, focusVisibleRef);
31
- return (jsxs("button", { className: cls('root', { focusVisible, disabled }), "aria-expanded": expanded, disabled: disabled, ...rest, type: "button", id: id ?? idProp, "aria-controls": ariaControls ?? ariaControlsProp, ref: buttonRef, onClick: handleChange, ...focusVisibleHandlers, children: [jsxs("span", { className: cls('content'), children: [jsx("span", { className: cls('primary-text'), title: getTitle(children), children: children }), hasContent(secondarySlot) && (jsx("span", { className: cls('secondary-slot'), children: secondarySlot }))] }), expandIcon && (jsx(ExpandCollapseCaret, { expanded: !!expanded, orientation: 'vertical', ...ExpandCollapseCaretProps }))] }));
41
+ return /*#__PURE__*/ jsxs("button", {
42
+ className: cls('root', {
43
+ focusVisible,
44
+ disabled
45
+ }),
46
+ "aria-expanded": expanded,
47
+ disabled: disabled,
48
+ ...rest,
49
+ type: "button",
50
+ id: id ?? idProp,
51
+ "aria-controls": ariaControls ?? ariaControlsProp,
52
+ ref: buttonRef,
53
+ onClick: handleChange,
54
+ ...focusVisibleHandlers,
55
+ children: [
56
+ /*#__PURE__*/ jsxs("span", {
57
+ className: cls('content'),
58
+ children: [
59
+ /*#__PURE__*/ jsx("span", {
60
+ className: cls('primary-text'),
61
+ title: getTitle(children),
62
+ children: children
63
+ }),
64
+ hasContent(secondarySlot) && /*#__PURE__*/ jsx("span", {
65
+ className: cls('secondary-slot'),
66
+ children: secondarySlot
67
+ })
68
+ ]
69
+ }),
70
+ expandIcon && /*#__PURE__*/ jsx(ExpandCollapseCaret_ExpandCollapseCaret, {
71
+ expanded: !!expanded,
72
+ orientation: 'vertical',
73
+ ...ExpandCollapseCaretProps
74
+ })
75
+ ]
76
+ });
32
77
  });
33
- AccordionHeader.displayName = 'SuiAccordionHeader';
78
+ AccordionHeader_AccordionHeader.displayName = 'SuiAccordionHeader';
79
+
80
+
81
+
82
+
83
+
34
84
 
35
- export { AccordionHeader, AccordionHeader$1 as accordionHeaderStyles };
85
+ export { AccordionHeader as accordionHeaderStyles, AccordionHeader_AccordionHeader as AccordionHeader };
package/Alert.js CHANGED
@@ -1,28 +1,120 @@
1
- export { a as Alert, A as AlertTitle } from './chunks/Alert.js';
2
- import 'react/jsx-runtime';
3
- import 'react';
4
- import '@ringcentral/spring-icon';
5
- import '@ringcentral/spring-theme';
6
- import 'clsx';
7
- import './chunks/Icon.js';
8
- import '@ringcentral/spring-base';
9
- import './chunks/IconButtonLabel.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
-
24
- var Alert = {"sui-alert-root":"sui-alert-root","sui-alert-icon":"sui-alert-icon","sui-alert-body":"sui-alert-body","sui-alert-content":"sui-alert-content","sui-alert-action":"sui-alert-action","sui-alert-close":"sui-alert-close","sui-alert-info":"sui-alert-info","sui-alert-info-icon":"sui-alert-info-icon","sui-alert-error":"sui-alert-error","sui-alert-error-icon":"sui-alert-error-icon","sui-alert-warning":"sui-alert-warning","sui-alert-warning-icon":"sui-alert-warning-icon","sui-alert-success":"sui-alert-success","sui-alert-success-icon":"sui-alert-success-icon","sui-alert-neutral":"sui-alert-neutral","sui-alert-neutral-icon":"sui-alert-neutral-icon","sui-compact":"sui-compact"};
25
-
26
- var AlertTitle = {"sui-alert-title-root":"sui-alert-title-root","sui-compact":"sui-compact"};
27
-
28
- export { Alert as alertStyles, AlertTitle as alertTitleStyles };
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { forwardRef, isValidElement, useMemo } from "react";
3
+ import { AlertMd, InfoMd, SuccessMd, Xmd } from "@ringcentral/spring-icon";
4
+ import { useClassesWithMode, useMode, useThemeProps } from "@ringcentral/spring-theme";
5
+ import clsx from "clsx";
6
+ import { Icon as Icon_Icon } from "./chunks/8307.js";
7
+ import { IconButton as IconButton_IconButton } from "./IconButton.js";
8
+
9
+
10
+
11
+
12
+
13
+
14
+ // extracted by css-extract-rspack-plugin
15
+ /* export default */ var Alert = ({"sui-alert-root":"sui-alert-root","sui-alert-icon":"sui-alert-icon","sui-alert-body":"sui-alert-body","sui-alert-content":"sui-alert-content","sui-alert-action":"sui-alert-action","sui-alert-close":"sui-alert-close","sui-alert-info":"sui-alert-info","sui-alert-info-icon":"sui-alert-info-icon","sui-alert-error":"sui-alert-error","sui-alert-error-icon":"sui-alert-error-icon","sui-alert-warning":"sui-alert-warning","sui-alert-warning-icon":"sui-alert-warning-icon","sui-alert-success":"sui-alert-success","sui-alert-success-icon":"sui-alert-success-icon","sui-alert-neutral":"sui-alert-neutral","sui-alert-neutral-icon":"sui-alert-neutral-icon","sui-compact":"sui-compact"});
16
+ // extracted by css-extract-rspack-plugin
17
+ /* export default */ var AlertTitle = ({"sui-alert-title-root":"sui-alert-title-root","sui-compact":"sui-compact"});
18
+
19
+
20
+
21
+
22
+
23
+
24
+
25
+
26
+
27
+ const DEFAULT_ICON_MAP = {
28
+ info: InfoMd,
29
+ error: AlertMd,
30
+ success: SuccessMd,
31
+ warning: AlertMd,
32
+ neutral: InfoMd
33
+ };
34
+ const Alert_Alert = /*#__PURE__*/ forwardRef((inProps, ref)=>{
35
+ const props = useThemeProps({
36
+ props: inProps,
37
+ name: 'Alert'
38
+ });
39
+ const { action, classes, className, component: AlertRoot = 'div', closeText = 'close', children, icon: iconProp, startSlot, onClose, severity = 'info', CloseButtonProps, contentProps, ...rest } = props;
40
+ const cls = useClassesWithMode('alert', classes, className);
41
+ const { mode } = useMode();
42
+ const iconSize = useMemo(()=>mode === 'compact' ? 'small' : 'medium', [
43
+ mode
44
+ ]);
45
+ const renderIcon = (icon, severity)=>{
46
+ return /*#__PURE__*/ jsx("div", {
47
+ className: cls('icon', `${severity}-icon`),
48
+ children: /*#__PURE__*/ isValidElement(icon) ? icon : /*#__PURE__*/ jsx(Icon_Icon, {
49
+ size: iconSize,
50
+ symbol: icon
51
+ })
52
+ });
53
+ };
54
+ let startSlotContent = null;
55
+ if (startSlot) {
56
+ startSlotContent = renderIcon(startSlot, severity);
57
+ } else if (iconProp) {
58
+ const iconComponent = iconProp === true ? DEFAULT_ICON_MAP[severity] : iconProp;
59
+ startSlotContent = renderIcon(iconComponent, severity);
60
+ }
61
+ let closeSlot = null;
62
+ if (onClose) {
63
+ closeSlot = /*#__PURE__*/ jsx(IconButton_IconButton, {
64
+ symbol: Xmd,
65
+ variant: "icon",
66
+ shape: 'squircle',
67
+ color: 'secondary',
68
+ size: iconSize,
69
+ background: false,
70
+ title: closeText,
71
+ "aria-label": closeText,
72
+ onClick: onClose,
73
+ ...CloseButtonProps,
74
+ className: clsx(cls('close'), CloseButtonProps?.className)
75
+ });
76
+ }
77
+ let actionSlot = null;
78
+ if (action) {
79
+ actionSlot = /*#__PURE__*/ jsx("div", {
80
+ className: cls('action'),
81
+ children: action
82
+ });
83
+ }
84
+ return /*#__PURE__*/ jsxs(AlertRoot, {
85
+ ...rest,
86
+ ref: ref,
87
+ className: cls('root', severity),
88
+ children: [
89
+ startSlotContent,
90
+ /*#__PURE__*/ jsxs("div", {
91
+ className: cls('body'),
92
+ children: [
93
+ /*#__PURE__*/ jsx("div", {
94
+ className: cls('content'),
95
+ role: "alert",
96
+ ...contentProps,
97
+ children: children
98
+ }),
99
+ actionSlot
100
+ ]
101
+ }),
102
+ closeSlot
103
+ ]
104
+ });
105
+ });
106
+ const Alert_AlertTitle = ({ className, classes, ...rest })=>{
107
+ const cls = useClassesWithMode('alert-title', classes, className);
108
+ return /*#__PURE__*/ jsx("div", {
109
+ className: cls('root'),
110
+ ...rest
111
+ });
112
+ };
113
+
114
+
115
+
116
+
117
+
118
+
119
+
120
+ export { Alert as alertStyles, AlertTitle as alertTitleStyles, Alert_Alert as Alert, Alert_AlertTitle as AlertTitle };
package/Animation.js CHANGED
@@ -1,47 +1,3 @@
1
- export { E as ExpandCollapseCaret } from './chunks/ExpandCollapseCaret.js';
2
- import { jsx } from 'react/jsx-runtime';
3
- import { motion } from 'framer-motion';
4
- import { u as usePrefersReducedMotion } from './chunks/usePrefersReducedMotion.js';
5
- import '@ringcentral/spring-theme';
6
- import { g as getFade } from './chunks/getFade.js';
7
- import { g as getGrow } from './chunks/getGrow.js';
8
- export { a as getTransformOriginStringForPlacement } from './chunks/getGrow.js';
9
- export { S as ShowHideEye } from './chunks/ShowHideEye.js';
10
- export { S as SlideIn } from './chunks/SlideIn.js';
11
- export { g as getSlideIn } from './chunks/getSlideIn.js';
12
- export { S as SortableArrow } from './chunks/SortableArrow.js';
13
- export { u as useMotionSafeTransition } from './chunks/useMotionSafeTransition.js';
14
- import '@ringcentral/spring-base';
15
- import './chunks/Icon.js';
16
- import 'react';
17
1
 
18
- var ExpandCollapseCaret = {"sui-expand-collapse-caret-root":"sui-expand-collapse-caret-root","sui-expand-collapse-caret-vertical":"sui-expand-collapse-caret-vertical","sui-expand-collapse-caret-horizontal":"sui-expand-collapse-caret-horizontal"};
19
-
20
- const Fade = (props) => {
21
- const { toggle, toggleOffTransition, toggleOnTransition, children, ...rest } = props;
22
- const prefersReducedMotion = usePrefersReducedMotion();
23
- return (jsx(motion.div, { ...getFade({
24
- toggle,
25
- toggleOffTransition,
26
- toggleOnTransition,
27
- prefersReducedMotion,
28
- }), ...rest, children: children }));
29
- };
30
-
31
- const Grow = (props) => {
32
- const { toggle, toggleOffTransition, toggleOnTransition, children, transformOrigin, direction = 'both', style, ...rest } = props;
33
- const prefersReducedMotion = usePrefersReducedMotion();
34
- const growProps = getGrow({
35
- toggle,
36
- direction,
37
- prefersReducedMotion,
38
- toggleOffTransition,
39
- toggleOnTransition,
40
- transformOrigin,
41
- });
42
- return (jsx(motion.div, { ...growProps, ...rest, style: { ...growProps.style, ...style }, children: children }));
43
- };
44
-
45
- var ShowHideEye = {"sui-show-hide-eye-root":"sui-show-hide-eye-root"};
46
-
47
- export { Fade, Grow, ExpandCollapseCaret as expandCollapseCaretStyles, getFade, getGrow, ShowHideEye as showHideEyeStyles, usePrefersReducedMotion };
2
+ export { ExpandCollapseCaret, expandCollapseCaretStyles, useMotionSafeTransition, usePrefersReducedMotion } from "./chunks/1294.js";
3
+ export { Fade, Grow, ShowHideEye, SlideIn, SortableArrow, getFade, getGrow, getSlideIn, getTransformOriginStringForPlacement, showHideEyeStyles } from "./chunks/4476.js";
package/Announcement.js CHANGED
@@ -1,50 +1,61 @@
1
- import { jsx } from 'react/jsx-runtime';
2
- import { forwardRef } from 'react';
3
- import { useClasses } from '@ringcentral/spring-base';
4
- import { InfoMd, AlertMd, SuccessMd } from '@ringcentral/spring-icon';
5
- import { useThemeProps } from '@ringcentral/spring-theme';
6
- import { a as Alert } from './chunks/Alert.js';
7
- import 'clsx';
8
- import './chunks/Icon.js';
9
- import './chunks/IconButtonLabel.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
-
24
- var Announcement$1 = {"sui-announcement-icon":"sui-announcement-icon","sui-announcement-close":"sui-announcement-close","sui-announcement-action":"sui-announcement-action","sui-announcement-root":"sui-announcement-root","sui-announcement-neutral":"sui-announcement-neutral","sui-announcement-info":"sui-announcement-info","sui-announcement-error":"sui-announcement-error","sui-announcement-success":"sui-announcement-success","sui-announcement-warning":"sui-announcement-warning","sui-announcement-body":"sui-announcement-body","sui-announcement-content":"sui-announcement-content","sui-compact":"sui-compact"};
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { forwardRef } from "react";
3
+ import { useClasses } from "@ringcentral/spring-base";
4
+ import { AlertMd, InfoMd, SuccessMd } from "@ringcentral/spring-icon";
5
+ import { useThemeProps } from "@ringcentral/spring-theme";
6
+ import { Alert as Alert_Alert } from "./Alert.js";
7
+
8
+
9
+
10
+
11
+
12
+
13
+ // extracted by css-extract-rspack-plugin
14
+ /* export default */ var Announcement = ({"sui-announcement-icon":"sui-announcement-icon","sui-announcement-close":"sui-announcement-close","sui-announcement-action":"sui-announcement-action","sui-announcement-root":"sui-announcement-root","sui-announcement-neutral":"sui-announcement-neutral","sui-announcement-info":"sui-announcement-info","sui-announcement-error":"sui-announcement-error","sui-announcement-success":"sui-announcement-success","sui-announcement-warning":"sui-announcement-warning","sui-announcement-body":"sui-announcement-body","sui-announcement-content":"sui-announcement-content","sui-compact":"sui-compact"});
15
+
16
+
17
+
18
+
19
+
20
+
25
21
 
26
22
  const DEFAULT_ICON_MAP = {
27
23
  info: InfoMd,
28
24
  error: AlertMd,
29
25
  success: SuccessMd,
30
26
  warning: AlertMd,
31
- neutral: InfoMd,
27
+ neutral: InfoMd
32
28
  };
33
- const Announcement = forwardRef((inProps, ref) => {
34
- const props = useThemeProps({ props: inProps, name: 'Announcement' });
35
- const { classes, className, severity = 'neutral', icon, startSlot = icon === undefined || icon === true
36
- ? DEFAULT_ICON_MAP[severity]
37
- : icon || null, CloseButtonProps, ...rest } = props;
29
+ const Announcement_Announcement = /*#__PURE__*/ forwardRef((inProps, ref)=>{
30
+ const props = useThemeProps({
31
+ props: inProps,
32
+ name: 'Announcement'
33
+ });
34
+ const { classes, className, severity = 'neutral', icon, startSlot = icon === undefined || icon === true ? DEFAULT_ICON_MAP[severity] : icon || null, CloseButtonProps, ...rest } = props;
38
35
  const cls = useClasses('announcement', classes, className);
39
- return (jsx(Alert, { ref: ref, ...rest, startSlot: startSlot, CloseButtonProps: { variant: 'inverted', ...CloseButtonProps }, classes: {
36
+ return /*#__PURE__*/ jsx(Alert_Alert, {
37
+ ref: ref,
38
+ ...rest,
39
+ startSlot: startSlot,
40
+ CloseButtonProps: {
41
+ variant: 'inverted',
42
+ ...CloseButtonProps
43
+ },
44
+ classes: {
40
45
  root: cls('root', severity),
41
46
  body: cls('body'),
42
47
  icon: cls('icon'),
43
48
  close: cls('close'),
44
49
  action: cls('action'),
45
- content: cls('content'),
46
- } }));
50
+ content: cls('content')
51
+ }
52
+ });
47
53
  });
48
- Announcement.displayName = 'SuiAnnouncement';
54
+ Announcement_Announcement.displayName = 'SuiAnnouncement';
55
+
56
+
57
+
58
+
59
+
49
60
 
50
- export { Announcement, Announcement$1 as announcementStyles };
61
+ export { Announcement as announcementStyles, Announcement_Announcement as Announcement };