@ringcentral/spring-ui 1.11.2 → 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 (241) hide show
  1. package/Accordion.js +90 -34
  2. package/AccordionHeader.js +72 -20
  3. package/Alert.js +120 -28
  4. package/Animation.js +2 -45
  5. package/Announcement.js +46 -35
  6. package/Autocomplete.js +1011 -580
  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 +55 -11
  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 -190
  23. package/DateUtilsContext.js +43 -25
  24. package/Dialer.js +576 -250
  25. package/Dialog.js +100 -45
  26. package/Divider.js +43 -7
  27. package/DragHandle.js +32 -6
  28. package/Drawer.js +117 -19
  29. package/Dropdown.js +154 -74
  30. package/EmptyState.js +63 -11
  31. package/FabButton.js +51 -17
  32. package/FocusTrap.js +109 -12
  33. package/FormField.js +106 -8
  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 -16
  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 -15
  50. package/MenuItem.js +402 -33
  51. package/MenuItemText.js +51 -8
  52. package/MenuList.js +87 -34
  53. package/Modal.js +345 -16
  54. package/NestedMenuContext.js +183 -11
  55. package/Option.js +32 -34
  56. package/Overlap.js +54 -7
  57. package/PageHeader.js +62 -24
  58. package/PickerTextField.js +156 -33
  59. package/Popover.js +262 -21
  60. package/Popper.js +130 -77
  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 -41
  67. package/SingleFilter.js +148 -77
  68. package/Skeleton.js +68 -17
  69. package/Slider.js +168 -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 +52 -28
  75. package/SplitButton.js +124 -86
  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 +68 -25
  82. package/StepIcon.js +90 -9
  83. package/StepLabel.js +90 -14
  84. package/Stepper.js +65 -23
  85. package/SubMenu.js +203 -99
  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 -77
  98. package/TableRow.js +60 -21
  99. package/Tabs.js +593 -268
  100. package/Tag.js +51 -16
  101. package/Text.js +68 -37
  102. package/TextField.js +209 -29
  103. package/Textarea.js +51 -40
  104. package/TimePicker.js +490 -230
  105. package/Tooltip.js +48 -23
  106. package/Tray.js +237 -13
  107. package/TrayMenu.js +62 -41
  108. package/VirtualizedList.js +208 -109
  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 +2624 -2416
  127. package/index.js +245 -193
  128. package/internal/utils/index.d.ts +1 -0
  129. package/internal/utils/setRef.d.ts +2 -0
  130. package/package.json +8 -8
  131. package/src/Alert/Alert.type.d.ts +2 -1
  132. package/src/Animation/components/Fade/Fade.d.ts +4 -2
  133. package/src/Animation/components/Grow/Grow.d.ts +4 -2
  134. package/src/Animation/components/ShowHideEye/ShowHideEye.d.ts +1 -1
  135. package/src/Animation/components/SlideIn/SlideIn.d.ts +4 -2
  136. package/src/Animation/components/SlideIn/getSlideIn.d.ts +1 -1
  137. package/src/Animation/hooks/useMotionSafeTransition/useMotionSafeTransition.d.ts +2 -0
  138. package/src/Autocomplete/SuggestionList/SuggestionList.d.ts +1 -1
  139. package/src/Autocomplete/useAutocomplete.d.ts +18 -18
  140. package/src/Autocomplete/useAutocompleteTag.d.ts +18 -18
  141. package/src/Badge/Badge.d.ts +2 -1
  142. package/src/Button/Button.classes.d.ts +1 -1
  143. package/src/ComponentsProps.d.ts +111 -110
  144. package/src/DatePicker/DatePickerDataAttributes.d.ts +11 -0
  145. package/src/DatePicker/utils/DatePickerAriaLabelUtils.d.ts +2 -1
  146. package/src/DatePicker/utils/DatePickerUtils.d.ts +1 -1
  147. package/src/Dialer/DialDelete/DialDelete.d.ts +2 -2
  148. package/src/Dialer/DialPad/DialPad.d.ts +2 -2
  149. package/src/Dialer/Dialer.d.ts +4 -2
  150. package/src/Dropdown/Dropdown.type.d.ts +2 -2
  151. package/src/InlineEditable/InlineEditable.type.d.ts +2 -1
  152. package/src/ListNavigation/useListNavigation.d.ts +3 -3
  153. package/src/MenuActions/MenuActions.d.ts +2 -2
  154. package/src/MenuItem/MenuItem.type.d.ts +1 -0
  155. package/src/MenuItem/useMenuItem.d.ts +1 -1
  156. package/src/MenuItem/useVirtualizedMenuItem.d.ts +1 -1
  157. package/src/MenuList/MenuList.type.d.ts +1 -1
  158. package/src/MenuList/MenuListContext.d.ts +2 -3
  159. package/src/Modal/Modal.type.d.ts +1 -0
  160. package/src/NestedMenuContext/MenuOverlayGroupContext.d.ts +2 -2
  161. package/src/Popover/Popover.classes.d.ts +1 -1
  162. package/src/Popover/Popover.internal.d.ts +8 -0
  163. package/src/Popover/Popover.type.d.ts +1 -0
  164. package/src/Popper/Popper.type.d.ts +10 -7
  165. package/src/Rating/utils.d.ts +3 -2
  166. package/src/Select/Select.type.d.ts +7 -5
  167. package/src/Slider/Slider.d.ts +2 -2
  168. package/src/Slider/SliderThumb.d.ts +2 -1
  169. package/src/Squircle/Squircle.d.ts +1 -1
  170. package/src/StatusIndicator/StatusIndicator.d.ts +2 -1
  171. package/src/SubMenu/PopperMenu.type.d.ts +4 -1
  172. package/src/Table/Table.type.d.ts +3 -0
  173. package/src/Table/TableContext.d.ts +3 -0
  174. package/src/Table/TableRowContext.d.ts +7 -0
  175. package/src/Table/index.d.ts +1 -0
  176. package/src/TableCell/TableCell.classes.d.ts +1 -1
  177. package/src/TableFooter/TableFooter.classes.d.ts +1 -1
  178. package/src/TableFooter/TableFooter.type.d.ts +1 -0
  179. package/src/TableHead/TableHead.classes.d.ts +1 -1
  180. package/src/TableHead/TableHead.type.d.ts +1 -0
  181. package/src/TableRow/TableRow.type.d.ts +2 -0
  182. package/chunks/AccordionContext.js +0 -6
  183. package/chunks/Alert.js +0 -48
  184. package/chunks/AvatarGroup.js +0 -22
  185. package/chunks/Backdrop.js +0 -18
  186. package/chunks/Badge.js +0 -32
  187. package/chunks/BottomNavigationItem.js +0 -36
  188. package/chunks/Button.js +0 -88
  189. package/chunks/Chip.js +0 -73
  190. package/chunks/CircularProgressIndicator.js +0 -36
  191. package/chunks/Divider.js +0 -19
  192. package/chunks/DragHandle.js +0 -11
  193. package/chunks/Drawer.js +0 -32
  194. package/chunks/ExpandCollapseCaret.js +0 -24
  195. package/chunks/FormLabel.js +0 -27
  196. package/chunks/Icon.js +0 -25
  197. package/chunks/IconButtonLabel.js +0 -68
  198. package/chunks/List.js +0 -22
  199. package/chunks/ListItem.js +0 -83
  200. package/chunks/Menu.js +0 -61
  201. package/chunks/MenuDivider.js +0 -14
  202. package/chunks/MenuItemText.js +0 -17
  203. package/chunks/MenuList.js +0 -46
  204. package/chunks/Modal.js +0 -212
  205. package/chunks/Overlap.js +0 -25
  206. package/chunks/PickerTextField.js +0 -85
  207. package/chunks/Popover.js +0 -53
  208. package/chunks/PopperPaper.js +0 -15
  209. package/chunks/Select.js +0 -220
  210. package/chunks/ShowHideEye.js +0 -56
  211. package/chunks/SlideIn.js +0 -19
  212. package/chunks/SortableArrow.js +0 -73
  213. package/chunks/Squircle.js +0 -31
  214. package/chunks/StatusIndicator.js +0 -20
  215. package/chunks/StepConnector.js +0 -21
  216. package/chunks/StepIcon.js +0 -43
  217. package/chunks/StepLabel.js +0 -29
  218. package/chunks/StepperContext.js +0 -9
  219. package/chunks/TableContext.js +0 -6
  220. package/chunks/Tablelvl2Context.js +0 -6
  221. package/chunks/TabsContext.js +0 -6
  222. package/chunks/TextField.js +0 -110
  223. package/chunks/Tooltip.js +0 -217
  224. package/chunks/VirtualizedMenu.js +0 -164
  225. package/chunks/VisuallyHidden.js +0 -12
  226. package/chunks/getFade.js +0 -27
  227. package/chunks/getGrow.js +0 -70
  228. package/chunks/getSlideIn.js +0 -30
  229. package/chunks/hasContent.js +0 -3
  230. package/chunks/useAnimationFrame.js +0 -15
  231. package/chunks/useFocusTrapStack.js +0 -36
  232. package/chunks/useHelperTextId.js +0 -22
  233. package/chunks/useListNavigation.js +0 -199
  234. package/chunks/useMenuItemSelect.js +0 -273
  235. package/chunks/useMotionSafeTransition.js +0 -9
  236. package/chunks/useNestedMenuItem.js +0 -27
  237. package/chunks/useNestedParentMenu.js +0 -113
  238. package/chunks/usePrefersReducedMotion.js +0 -36
  239. package/chunks/useTooltipForceHide.js +0 -27
  240. package/chunks/useTrayNavigate.js +0 -150
  241. package/chunks/withTooltip.js +0 -15
@@ -1,6 +1,6 @@
1
1
  import { TextareaAutosizeProps } from '@mui/base';
2
2
  import { HTMLDataAttribute, StandardProps } from '@ringcentral/spring-base';
3
- import { ComponentProps, ComponentPropsWithRef, FocusEvent, KeyboardEvent } from 'react';
3
+ import { ComponentProps, ComponentPropsWithRef, FocusEvent, KeyboardEvent, ReactNode } from 'react';
4
4
  import { TooltipProps } from '../Tooltip';
5
5
  import { InlineEditableClassesKey } from './InlineEditable.classes';
6
6
  export type TextareaEditHandler<T = EditCompleteReason> = (e: KeyboardEvent<HTMLTextAreaElement> | FocusEvent<HTMLTextAreaElement>, reason: T, value: {
@@ -38,4 +38,5 @@ export type InlineEditableProps = StandardProps<(({
38
38
  fullWidth?: boolean;
39
39
  TooltipProps?: Omit<TooltipProps, 'children' | 'open' | 'onOpenStateChange'>;
40
40
  rootProps?: ComponentProps<'div'> & HTMLDataAttribute;
41
+ children?: ReactNode;
41
42
  }, InlineEditableClassesKey>;
@@ -1,4 +1,4 @@
1
- import { FocusEventHandler, KeyboardEventHandler, ReactNode, Ref } from 'react';
1
+ import { FocusEventHandler, KeyboardEventHandler, type ReactElement, ReactNode, Ref } from 'react';
2
2
  export type SearchElementOption = {
3
3
  baseElement: HTMLElement;
4
4
  direction: 'up' | 'down';
@@ -19,8 +19,8 @@ export type UseListNavigationProps = {
19
19
  actions?: Ref<UseListNavigationActions>;
20
20
  };
21
21
  export declare const useListNavigation: (props: UseListNavigationProps) => {
22
- renderItems: (items: ReactNode) => import("react/jsx-runtime").JSX.Element;
23
- renderTabBoundary: () => import("react/jsx-runtime").JSX.Element;
22
+ renderItems: (items: ReactNode) => ReactElement;
23
+ renderTabBoundary: () => ReactElement;
24
24
  getListProps: (otherHandler: {
25
25
  onKeyDown?: KeyboardEventHandler;
26
26
  onFocus?: FocusEventHandler;
@@ -1,9 +1,9 @@
1
- import { ComponentProps } from 'react';
1
+ import { ComponentProps, type ReactElement } from 'react';
2
2
  import { MenuActionsProps } from './MenuActions.type';
3
3
  import menuActionsStyle from './styles/MenuActions.css';
4
4
  declare const MenuActions: import("react").ForwardRefExoticComponent<Omit<MenuActionsProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
5
5
  declare const MenuActionsGroup: {
6
- ({ className, ...rest }: ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
6
+ ({ className, ...rest }: ComponentProps<'div'>): ReactElement;
7
7
  displayName: string;
8
8
  };
9
9
  export { MenuActions, MenuActionsGroup, menuActionsStyle };
@@ -7,4 +7,5 @@ export type MenuItemProps = StandardProps<{
7
7
  focused?: boolean;
8
8
  autoFocus?: boolean;
9
9
  autoClose?: boolean;
10
+ nowrap?: boolean;
10
11
  } & Omit<UseMenuItemParameters, 'label' | 'rootRef'>, MenuItemClassesKey, 'div'>;
@@ -10,7 +10,7 @@ export type UseMenuItemProps = {
10
10
  autoClose?: boolean;
11
11
  };
12
12
  export declare const useMenuItem: (props: UseMenuItemProps) => {
13
- getRootProps: (otherProps: any) => any;
13
+ getRootProps: (otherProps?: any) => any;
14
14
  focusVisible: boolean;
15
15
  active: boolean;
16
16
  };
@@ -10,7 +10,7 @@ export type UseVirtualizedMenuItemProps = {
10
10
  autoClose?: boolean;
11
11
  };
12
12
  export declare const useVirtualizedMenuItem: (props: UseVirtualizedMenuItemProps) => {
13
- getRootProps: (otherProps: any) => any;
13
+ getRootProps: (otherProps?: any) => any;
14
14
  focusVisible: boolean;
15
15
  active: boolean;
16
16
  };
@@ -3,7 +3,7 @@ import { StandardProps } from '@ringcentral/spring-base';
3
3
  import { MenuItemSelectProps, SelectMode } from '../MenuItem';
4
4
  import { MenuListClassesKey } from './MenuList.classes';
5
5
  import { MenuListContextValue } from './MenuListContext';
6
- export type MenuListProps<M extends SelectMode = 'single', V = unknown> = StandardProps<MenuItemSelectProps<V, M> & {
6
+ export type MenuListProps<M extends SelectMode = 'single', V = unknown> = StandardProps<Omit<MenuItemSelectProps<V, M>, 'onClose'> & {
7
7
  autoFocus?: boolean;
8
8
  } & MenuListContextValue, MenuListClassesKey, 'div'>;
9
9
  export interface MenuListComponent {
@@ -1,6 +1,5 @@
1
1
  /// <reference types="react" />
2
- export type MenuListContextValue = {
3
- nowrap?: boolean;
4
- };
2
+ import type { MenuItemProps } from '../MenuItem/MenuItem.type';
3
+ export type MenuListContextValue = Pick<MenuItemProps, 'nowrap'>;
5
4
  export declare const MenuListContext: import("react").Context<MenuListContextValue>;
6
5
  export declare const useMenuListContext: () => MenuListContextValue;
@@ -2,6 +2,7 @@ import { PortalProps } from '../Portal';
2
2
  import { InnerModalProps, ModalCloseReason } from './InnerModal.type';
3
3
  export type ModalProps = InnerModalProps & {
4
4
  onExitComplete?: () => void;
5
+ onAfterClose?: () => void;
5
6
  disableBackdropAnimation?: boolean;
6
7
  disableScrollLock?: boolean;
7
8
  } & Omit<PortalProps, 'children'>;
@@ -1,4 +1,4 @@
1
- /// <reference types="react" />
1
+ import { type ReactElement } from 'react';
2
2
  export type MenuOverlayGroupContextValue = {
3
3
  container: HTMLElement | null;
4
4
  };
@@ -11,5 +11,5 @@ export declare const useMenuOverlayGroupValue: () => {
11
11
  setContainer: import("react").Dispatch<import("react").SetStateAction<HTMLDivElement | null>>;
12
12
  value: MenuOverlayGroupContextValue;
13
13
  };
14
- export declare const MenuOverlayGroupContainer: (props: MenuOverlayGroupContainerProps) => import("react/jsx-runtime").JSX.Element;
14
+ export declare const MenuOverlayGroupContainer: (props: MenuOverlayGroupContainerProps) => ReactElement;
15
15
  export { MenuOverlayGroupContext };
@@ -1,5 +1,5 @@
1
1
  import type { CamelCase } from 'type-fest';
2
- export type BasePopoverClassesKey = 'root' | 'popper' | 'paper' | 'bordered' | 'shadow';
2
+ export type BasePopoverClassesKey = 'root' | 'popper' | 'paper' | 'paper-content-no-vertical-scroll' | 'bordered' | 'shadow';
3
3
  export type PopoverClassesKey = CamelCase<BasePopoverClassesKey>;
4
4
  export type PopoverClasses = {
5
5
  name: 'popover';
@@ -0,0 +1,8 @@
1
+ import { ForwardRefExoticComponent, PropsWithoutRef, RefAttributes } from 'react';
2
+ import { PopoverProps } from './Popover.type';
3
+ export type InternalPopoverProps = PopoverProps & {
4
+ measureDesiredHeight?: () => number | void;
5
+ disableContentVerticalScroll?: boolean;
6
+ deferEnterAnimation?: boolean;
7
+ };
8
+ export type InternalPopoverComponent = ForwardRefExoticComponent<PropsWithoutRef<InternalPopoverProps> & RefAttributes<HTMLDivElement>>;
@@ -13,6 +13,7 @@ export type PopoverProps = StandardProps<{
13
13
  shadow?: boolean;
14
14
  variant?: 'standard' | 'pointed';
15
15
  PopperProps?: Omit<PopperProps, 'anchorEl' | 'className' | 'placement' | 'actions'> & HTMLDataAttribute;
16
+ maxHeight?: number;
16
17
  onAvailableHeightChange?: (height: number) => void;
17
18
  PopperPaperProps?: Partial<PopperPaperProps>;
18
19
  motionProps?: MotionProps | null;
@@ -3,6 +3,11 @@ import { PropsWithRoot } from '@ringcentral/spring-base';
3
3
  import { CSSProperties, ReactNode, Ref, RefObject } from 'react';
4
4
  import { PortalProps } from '../Portal';
5
5
  export type PopperPlacementType = Placement;
6
+ export type PopperChildrenRenderProps = {
7
+ placement: PopperPlacementType;
8
+ arrowRef: RefObject<HTMLDivElement>;
9
+ arrowStyle: CSSProperties;
10
+ };
6
11
  export type PopperProps = PropsWithRoot<{
7
12
  ref?: Ref<HTMLDivElement>;
8
13
  anchorEl?: ReferenceType | null | (() => ReferenceType | null);
@@ -14,18 +19,16 @@ export type PopperProps = PropsWithRoot<{
14
19
  actions?: Ref<PopperActions>;
15
20
  autoUpdate?: AutoUpdateOptions | boolean;
16
21
  matchAnchorWidth?: boolean;
17
- children?: ReactNode | ((props: {
18
- placement: PopperPlacementType;
19
- arrowRef: RefObject<HTMLDivElement>;
20
- arrowStyle: CSSProperties;
21
- }) => ReactNode);
22
+ tether?: boolean;
23
+ children?: ReactNode | ((props: PopperChildrenRenderProps) => ReactNode);
22
24
  } & Omit<UseFloatingOptions, 'middleware' | 'strategy'> & Omit<PortalProps, 'children'>, 'div'>;
23
- export type AutoUpdateOptions = {
25
+ export type AutoUpdateOptions = Partial<{
24
26
  ancestorScroll: boolean;
25
27
  ancestorResize: boolean;
26
28
  elementResize: boolean;
29
+ layoutShift: boolean;
27
30
  animationFrame: boolean;
28
- };
31
+ }>;
29
32
  export type PopperActions = {
30
33
  update: () => void;
31
34
  };
@@ -1,4 +1,5 @@
1
+ import type { ReactElement } from 'react';
1
2
  export declare function roundValueToPrecision<T extends number | null = number>(value: T, precision: number): number | T;
2
- export declare const defaultIcon: import("react/jsx-runtime").JSX.Element;
3
- export declare const defaultEmptyIcon: import("react/jsx-runtime").JSX.Element;
3
+ export declare const defaultIcon: ReactElement;
4
+ export declare const defaultEmptyIcon: ReactElement;
4
5
  export declare function defaultLabelText(value: number | null): string;
@@ -6,29 +6,31 @@ import type { VirtualizedMenuProps } from '../VirtualizedMenu';
6
6
  import type { SelectMode } from '../MenuItem';
7
7
  import type { SelectClassesKey } from './Select.classes';
8
8
  export type SelectVariant = UnionOmit<FormFieldVariant, 'quiet'>;
9
+ type SelectDataItem<T> = NonNullable<T> extends unknown[] ? NonNullable<T>[number] : NonNullable<T>;
9
10
  export type SelectProps<T = unknown> = StandardProps<{
10
11
  variant?: SelectVariant;
11
12
  selectMode?: SelectMode;
12
13
  defaultValue?: T;
13
14
  value?: T;
14
- onChange?: (e: React.ChangeEvent<HTMLInputElement>, child: React.ReactNode) => void;
15
+ onChange?: (e: React.ChangeEvent<HTMLInputElement>, input?: HTMLInputElement | null) => void;
15
16
  placeholder?: ReactNode;
16
17
  renderValue?: (value: T) => ReactNode;
17
18
  displayEmpty?: boolean;
18
19
  open?: boolean;
19
20
  defaultOpen?: boolean;
20
21
  virtualize?: boolean;
21
- data?: T extends unknown[] ? T : T[];
22
+ data?: SelectDataItem<T>[];
22
23
  getSelectedIndex?: (value: T) => number;
23
24
  onOpen?: () => void;
24
25
  onClose?: () => void;
25
26
  selectorProps?: SlotProps<'button'>;
26
27
  MenuProps?: Omit<MenuProps, 'open' | 'anchorEl' | 'onClose' | 'children'> & HTMLDataAttribute;
27
- VirtualizedMenuProps?: Omit<VirtualizedMenuProps, 'open' | 'onClose' | 'children'> & HTMLDataAttribute;
28
+ VirtualizedMenuProps?: Omit<VirtualizedMenuProps<SelectDataItem<T>>, 'open' | 'onClose' | 'children'> & HTMLDataAttribute;
28
29
  inputProps?: InputHTMLAttributes<HTMLInputElement>;
29
- children?: FormFieldProps['children'] | VirtualizedMenuProps['children'];
30
+ children?: FormFieldProps['children'] | VirtualizedMenuProps<SelectDataItem<T>>['children'];
30
31
  } & Omit<FormFieldProps, 'onChange' | 'classes' | 'variant' | 'children'> & Pick<InputHTMLAttributes<HTMLInputElement>, 'name'>, SelectClassesKey, 'div'>;
31
32
  export interface SelectComponent {
32
- <V = unknown>(props: SelectProps<V>): ReactElement;
33
+ <T = unknown>(props: SelectProps<T>): ReactElement;
33
34
  displayName?: string;
34
35
  }
36
+ export {};
@@ -1,7 +1,7 @@
1
- import { ForwardedRef, PropsWithoutRef } from 'react';
1
+ import { ForwardedRef, PropsWithoutRef, type ReactElement } from 'react';
2
2
  import { SliderProps } from './Slider.type';
3
3
  import sliderStyle from './styles/Slider.css';
4
- declare const InnerSlider: <V extends number | number[] = number>(inProps: PropsWithoutRef<SliderProps<V>>, ref: ForwardedRef<HTMLSpanElement>) => import("react/jsx-runtime").JSX.Element;
4
+ declare const InnerSlider: <V extends number | number[] = number>(inProps: PropsWithoutRef<SliderProps<V>>, ref: ForwardedRef<HTMLSpanElement>) => ReactElement;
5
5
  declare const Slider: (<V extends number | number[] = number>(props: PropsWithoutRef<SliderProps<V>> & {
6
6
  ref?: ForwardedRef<HTMLSpanElement>;
7
7
  }) => ReturnType<typeof InnerSlider>) & {
@@ -1,3 +1,4 @@
1
+ import type { ReactElement } from 'react';
1
2
  import { Transition } from 'framer-motion';
2
3
  import { UseSliderReturnValue } from '@mui/base';
3
4
  import { SliderProps } from './Slider.type';
@@ -9,7 +10,7 @@ type SliderThumbProps = Pick<SliderProps, 'classes' | 'valueLabelDisplay' | 'val
9
10
  dragging: boolean;
10
11
  };
11
12
  declare const SliderThumb: {
12
- (props: SliderThumbProps): import("react/jsx-runtime").JSX.Element;
13
+ (props: SliderThumbProps): ReactElement;
13
14
  displayName: string;
14
15
  };
15
16
  export { SliderThumb };
@@ -1,4 +1,4 @@
1
1
  import { SquircleComponent } from './Squircle.type';
2
- import squircleStyle from './styles/squircle.css';
2
+ import squircleStyle from './styles/Squircle.css';
3
3
  export declare const Squircle: SquircleComponent;
4
4
  export { squircleStyle };
@@ -1,7 +1,8 @@
1
+ import type { ReactElement } from 'react';
1
2
  import { StatusIndicatorProps } from './StatusIndicator.type';
2
3
  import statusIndicatorStyle from './styles/StatusIndicator.css';
3
4
  export declare const StatusIndicator: {
4
- (inProps: StatusIndicatorProps): import("react/jsx-runtime").JSX.Element;
5
+ (inProps: StatusIndicatorProps): ReactElement;
5
6
  displayName: string;
6
7
  };
7
8
  export { statusIndicatorStyle };
@@ -1,4 +1,7 @@
1
1
  import { StandardProps } from '@ringcentral/spring-base';
2
+ import { ReactNode } from 'react';
2
3
  import { Popper } from '../Popper';
3
4
  import { PopperMenuClassesKey } from './PopperMenu.classes';
4
- export type PopperMenuProps = StandardProps<{}, PopperMenuClassesKey, typeof Popper>;
5
+ export type PopperMenuProps = StandardProps<{
6
+ children?: ReactNode;
7
+ }, PopperMenuClassesKey, typeof Popper>;
@@ -1,6 +1,7 @@
1
1
  import { OverridableComponent, OverridableProps, WithClassesProps } from '@ringcentral/spring-base';
2
2
  import { ElementType, ReactNode } from 'react';
3
3
  import { TableClassesKey } from './Table.classes';
4
+ export type TableSize = 'small' | 'medium' | 'large';
4
5
  type DefaultElementType = 'table';
5
6
  type ExtendElementType = ElementType;
6
7
  type BaseTableProps = WithClassesProps<{
@@ -8,6 +9,8 @@ type BaseTableProps = WithClassesProps<{
8
9
  stickyHeader?: boolean;
9
10
  stickyFooter?: boolean;
10
11
  columnDivider?: boolean;
12
+ rowDivider?: boolean;
13
+ size?: TableSize;
11
14
  }, TableClassesKey>;
12
15
  export type TableProps<T extends ExtendElementType = DefaultElementType> = OverridableProps<BaseTableProps, T>;
13
16
  export type TableComponent = OverridableComponent<{
@@ -1,8 +1,11 @@
1
1
  /// <reference types="react" />
2
+ import { TableSize } from './Table.type';
2
3
  export type TableContextValue = {
3
4
  stickyHeader?: boolean;
4
5
  stickyFooter?: boolean;
5
6
  columnDivider?: boolean;
7
+ rowDivider?: boolean;
8
+ size?: TableSize;
6
9
  };
7
10
  export declare const TableContext: import("react").Context<TableContextValue>;
8
11
  export declare const useTableContext: () => TableContextValue;
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ import { TableSize } from './Table.type';
3
+ export type TableRowContextValue = {
4
+ size?: TableSize;
5
+ };
6
+ export declare const TableRowContext: import("react").Context<TableRowContextValue>;
7
+ export declare const useTableRowContext: () => TableRowContextValue;
@@ -3,3 +3,4 @@ export * from './Table';
3
3
  export * from './Table.type';
4
4
  export * from './TableContext';
5
5
  export * from './Tablelvl2Context';
6
+ export * from './TableRowContext';
@@ -1,5 +1,5 @@
1
1
  import type { CamelCase } from 'type-fest';
2
- export type BaseTableCellClassesKey = 'root' | 'head' | 'body' | 'sortable' | 'sorted' | 'footer' | 'padding-checkbox' | 'padding-none' | 'align-left' | 'align-center' | 'align-right' | 'align-justify' | 'sticky-header-default-bg' | 'content' | 'content-padding-checkbox' | 'content-align-right' | 'content-align-center' | 'content-align-justify' | 'content-sortable' | 'sort-icon' | 'sort-icon-sorted' | 'sort-indicator' | 'column-divider';
2
+ export type BaseTableCellClassesKey = 'root' | 'head' | 'body' | 'sortable' | 'sorted' | 'footer' | 'small' | 'large' | 'padding-checkbox' | 'padding-none' | 'align-left' | 'align-center' | 'align-right' | 'align-justify' | 'sticky-header-default-bg' | 'content' | 'content-padding-checkbox' | 'content-align-right' | 'content-align-center' | 'content-align-justify' | 'content-sortable' | 'sort-icon' | 'sort-icon-sorted' | 'sort-indicator' | 'column-divider' | 'hide-row-divider';
3
3
  export type TableCellClassesKey = CamelCase<BaseTableCellClassesKey>;
4
4
  export type TableCellClasses = {
5
5
  name: 'table-cell';
@@ -1,5 +1,5 @@
1
1
  import { CamelCase } from 'type-fest';
2
- type BaseTableFooterClassesKey = 'root' | 'content' | 'padding-checkbox' | 'padding-none' | 'sticky';
2
+ type BaseTableFooterClassesKey = 'root' | 'content' | 'padding-checkbox' | 'padding-none' | 'sticky' | 'hide-divider';
3
3
  export type TableFooterClassesKey = CamelCase<BaseTableFooterClassesKey>;
4
4
  export type TableFooterClasses = {
5
5
  name: 'table-footer';
@@ -3,4 +3,5 @@ import { TdHTMLAttributes } from 'react';
3
3
  import { TableFooterClassesKey } from './TableFooter.classes';
4
4
  export type TableFooterProps = StandardProps<{
5
5
  padding?: 'normal' | 'checkbox' | 'none';
6
+ divider?: boolean;
6
7
  } & Pick<TdHTMLAttributes<HTMLTableCellElement>, 'colSpan'>, TableFooterClassesKey, 'tfoot'>;
@@ -1,5 +1,5 @@
1
1
  import type { CamelCase } from 'type-fest';
2
- export type BaseTableHeadClassesKey = 'root' | 'background' | 'title' | 'end-slot' | 'sticky' | 'divider';
2
+ export type BaseTableHeadClassesKey = 'root' | 'background' | 'title' | 'end-slot' | 'sticky' | 'hide-divider';
3
3
  export type TableHeadClassesKey = CamelCase<BaseTableHeadClassesKey>;
4
4
  export type TableHeadClasses = {
5
5
  name: 'table-head';
@@ -6,6 +6,7 @@ type ExtendElementType = ElementType;
6
6
  type BaseTableHeadProps = WithClassesProps<{
7
7
  children?: React.ReactNode;
8
8
  useDefaultBgColor?: boolean;
9
+ divider?: boolean;
9
10
  }, TableHeadClassesKey>;
10
11
  export type TableHeadProps<T extends ExtendElementType = DefaultElementType> = OverridableProps<BaseTableHeadProps, T>;
11
12
  export type TableHeadComponent = OverridableComponent<{
@@ -1,5 +1,6 @@
1
1
  import { WithClassesProps, OverridableComponent, OverridableProps } from '@ringcentral/spring-base';
2
2
  import { ElementType } from 'react';
3
+ import { TableSize } from '../Table/Table.type';
3
4
  import { TableRowClassesKey } from './TableRow.classes';
4
5
  type DefaultElementType = 'tr';
5
6
  type ExtendElementType = ElementType;
@@ -8,6 +9,7 @@ type BaseTableRowProps = WithClassesProps<{
8
9
  hoverable?: boolean;
9
10
  clickable?: boolean;
10
11
  selected?: boolean;
12
+ size?: TableSize;
11
13
  }, TableRowClassesKey>;
12
14
  export type TableRowProps<T extends ExtendElementType = DefaultElementType> = OverridableProps<BaseTableRowProps, T>;
13
15
  export type TableRowComponent = OverridableComponent<{
@@ -1,6 +0,0 @@
1
- import { createContext, useContext } from 'react';
2
-
3
- const AccordionContext = createContext({});
4
- const useAccordionContext = () => useContext(AccordionContext);
5
-
6
- export { AccordionContext as A, useAccordionContext as u };
package/chunks/Alert.js DELETED
@@ -1,48 +0,0 @@
1
- import { jsx, jsxs } from 'react/jsx-runtime';
2
- import { forwardRef, useMemo, isValidElement } from 'react';
3
- import { Xmd, InfoMd, AlertMd, SuccessMd } from '@ringcentral/spring-icon';
4
- import { useThemeProps, useClassesWithMode, useMode } from '@ringcentral/spring-theme';
5
- import clsx from 'clsx';
6
- import { I as Icon } from './Icon.js';
7
- import { I as IconButton } from './IconButtonLabel.js';
8
-
9
- const DEFAULT_ICON_MAP = {
10
- info: InfoMd,
11
- error: AlertMd,
12
- success: SuccessMd,
13
- warning: AlertMd,
14
- neutral: InfoMd,
15
- };
16
- const Alert = forwardRef((inProps, ref) => {
17
- const props = useThemeProps({ props: inProps, name: 'Alert' });
18
- const { action, classes, className, component: AlertRoot = 'div', closeText = 'close', children, icon: iconProp, startSlot, onClose, severity = 'info', CloseButtonProps, ...rest } = props;
19
- const cls = useClassesWithMode('alert', classes, className);
20
- const { mode } = useMode();
21
- const iconSize = useMemo(() => (mode === 'compact' ? 'small' : 'medium'), [mode]);
22
- const renderIcon = (icon, severity) => {
23
- return (jsx("div", { className: cls('icon', `${severity}-icon`), children: isValidElement(icon) ? (icon) : (jsx(Icon, { size: iconSize, symbol: icon })) }));
24
- };
25
- let startSlotContent = null;
26
- if (startSlot) {
27
- startSlotContent = renderIcon(startSlot, severity);
28
- }
29
- else if (iconProp) {
30
- const iconComponent = iconProp === true ? DEFAULT_ICON_MAP[severity] : iconProp;
31
- startSlotContent = renderIcon(iconComponent, severity);
32
- }
33
- let closeSlot = null;
34
- if (onClose) {
35
- closeSlot = (jsx(IconButton, { symbol: Xmd, variant: "icon", shape: 'squircle', color: 'secondary', size: iconSize, background: false, title: closeText, "aria-label": closeText, onClick: onClose, ...CloseButtonProps, className: clsx(cls('close'), CloseButtonProps?.className) }));
36
- }
37
- let actionSlot = null;
38
- if (action) {
39
- actionSlot = jsx("div", { className: cls('action'), children: action });
40
- }
41
- return (jsxs(AlertRoot, { ...rest, ref: ref, className: cls('root', severity), children: [startSlotContent, jsxs("div", { className: cls('body'), children: [jsx("div", { className: cls('content'), role: "alert", children: children }), actionSlot] }), closeSlot] }));
42
- });
43
- const AlertTitle = ({ className, classes, ...rest }) => {
44
- const cls = useClassesWithMode('alert-title', classes, className);
45
- return jsx("div", { className: cls('root'), ...rest });
46
- };
47
-
48
- export { AlertTitle as A, Alert as a };
@@ -1,22 +0,0 @@
1
- import { jsx } from 'react/jsx-runtime';
2
- import { createContext, forwardRef, Children } from 'react';
3
- import { useClasses, logInDev } from '@ringcentral/spring-base';
4
- import { useThemeProps } from '@ringcentral/spring-theme';
5
-
6
- const AvatarGroupContext = createContext({});
7
- const AvatarGroup = forwardRef((inProps, ref) => {
8
- const props = useThemeProps({ props: inProps, name: 'AvatarGroup' });
9
- const { component: AvatarGroupRoot = 'div', classes, className, children, ...rest } = props;
10
- const cls = useClasses('avatar-group', classes, className);
11
- const childrenLength = Children.toArray(children).filter(Boolean).length;
12
- if (process.env.NODE_ENV !== 'production' && childrenLength !== 2) {
13
- logInDev({
14
- scope: 'AvatarGroup',
15
- message: 'AvatarGroup only accept 2 valid child components as its children',
16
- });
17
- }
18
- return (jsx(AvatarGroupContext.Provider, { value: { size: 'small', className: cls('item') }, children: jsx(AvatarGroupRoot, { className: cls('root'), ...rest, ref: ref, children: children }) }));
19
- });
20
- AvatarGroup.displayName = 'SuiAvatarGroup';
21
-
22
- export { AvatarGroupContext as A, AvatarGroup as a };
@@ -1,18 +0,0 @@
1
- import { jsx } from 'react/jsx-runtime';
2
- import { forwardRef } from 'react';
3
- import { useClasses } from '@ringcentral/spring-base';
4
- import { useThemeProps } from '@ringcentral/spring-theme';
5
-
6
- const Backdrop = forwardRef((inProps, ref) => {
7
- const props = useThemeProps({ props: inProps, name: 'Backdrop' });
8
- const { classes, className, children, isTransparent = false, onClick, ...rest } = props;
9
- const cls = useClasses('backdrop', classes, className);
10
- const handleClick = (e) => {
11
- e.stopPropagation();
12
- onClick?.(e);
13
- };
14
- return (jsx("div", { className: cls('root', { transparent: isTransparent }), "aria-hidden": true, tabIndex: -1, ...rest, ref: ref, onClick: handleClick, children: children }));
15
- });
16
- Backdrop.displayName = 'SuiBackdrop';
17
-
18
- export { Backdrop as B };
package/chunks/Badge.js DELETED
@@ -1,32 +0,0 @@
1
- import { jsxs, jsx } from 'react/jsx-runtime';
2
- import { useMemo } from 'react';
3
- import { AnimatePresence, motion } from 'framer-motion';
4
- import isNumber from 'lodash/isNumber';
5
- import kebabCase from 'lodash/kebabCase';
6
- import { useClasses } from '@ringcentral/spring-base';
7
- import { useThemeProps, motionTransition } from '@ringcentral/spring-theme';
8
- import './Icon.js';
9
- import { u as useMotionSafeTransition } from './useMotionSafeTransition.js';
10
-
11
- const Badge = (inProps) => {
12
- const props = useThemeProps({ props: inProps, name: 'Badge' });
13
- const { count, classes, showZero, className, invisible, forceOverlap, type = 'standard', max = 999, size = 'small', color = 'primary', variant = 'contained', children, anchorOrigin = 'topRight', overlap = 'rectangular', ...rest } = props;
14
- const cls = useClasses('badge', classes, className);
15
- const transition = useMotionSafeTransition(motionTransition['haste-01-fast']);
16
- const numeric = isNumber(count);
17
- const content = type === 'standard'
18
- ? numeric && count > max
19
- ? `${max}+`
20
- : count
21
- : undefined;
22
- const toOrigin = useMemo(() => kebabCase(anchorOrigin), [anchorOrigin]);
23
- const overlapMode = children || forceOverlap;
24
- return (jsxs("span", { className: cls('root', {
25
- absolute: !children && forceOverlap,
26
- }), ...rest, children: [children, jsx(AnimatePresence, { initial: false, children: invisible ||
27
- (!showZero && count === 0) ||
28
- (content === undefined && type === 'standard') ? null : (jsx(motion.span, { initial: { opacity: 0 }, animate: { opacity: 1 }, exit: { opacity: 0 }, transition: transition, className: cls('content', color, size, type, variant, toOrigin, `${type}-${size}`, `${type}-${color}`, `${type}-${variant}`, `${type}-${variant}-${size}`, overlapMode && overlap, overlapMode && `${overlap}-${toOrigin}`), children: content })) })] }));
29
- };
30
- Badge.displayName = 'SuiBadge';
31
-
32
- export { Badge as B };
@@ -1,36 +0,0 @@
1
- import { jsx } from 'react/jsx-runtime';
2
- import { createContext, useContext, forwardRef } from 'react';
3
- import { useClasses, combineClasses } from '@ringcentral/spring-base';
4
- import { useThemeProps } from '@ringcentral/spring-theme';
5
- import { B as Badge } from './Badge.js';
6
- import { I as IconButton } from './IconButtonLabel.js';
7
- import { T as Tooltip } from './Tooltip.js';
8
- import { u as useTooltipForceHide } from './useTooltipForceHide.js';
9
-
10
- const BottomNavigationContext = createContext(null);
11
- const useBottomNavigationContext = () => useContext(BottomNavigationContext);
12
-
13
- const BottomNavigationItem = forwardRef((inProps, ref) => {
14
- const props = useThemeProps({ props: inProps, name: 'BottomNavigationItem' });
15
- const { classes, symbol, activatedSymbol, count, value: valueProp, activated: activatedProp, expanded: expandedProp, onClick, BadgeProps = {}, TooltipProps = {}, ButtonProps = {}, label, className, } = props;
16
- const cls = useClasses('bottom-navigation-item', classes, className);
17
- const { value: selectedValue, expanded: isExpanded, onSelected, animationComplete, } = useBottomNavigationContext() || {};
18
- const tooltipOpenProps = useTooltipForceHide(animationComplete === false);
19
- const selected = selectedValue === valueProp;
20
- const activated = activatedProp !== undefined ? activatedProp : selected;
21
- const expanded = expandedProp !== undefined ? expandedProp : isExpanded;
22
- const handleClick = (event) => {
23
- if (valueProp !== undefined && !selected) {
24
- onSelected?.(event, valueProp);
25
- }
26
- onClick?.(event);
27
- };
28
- let buttonClasses = { root: cls('button', { activated, expanded }) };
29
- if (ButtonProps.classes) {
30
- buttonClasses = combineClasses(buttonClasses, ButtonProps.classes);
31
- }
32
- return (jsx(Badge, { variant: "outlined", count: count, className: cls('root'), ...BadgeProps, children: jsx(Tooltip, { ...TooltipProps, title: label, PopperProps: { offset: 8 }, motionProps: null, ...tooltipOpenProps, children: jsx(IconButton, { shape: 'squircle', variant: "contained", size: "small", color: 'secondary', symbol: activated && activatedSymbol ? activatedSymbol : symbol, onClick: handleClick, "aria-label": label, ...ButtonProps, classes: buttonClasses, ref: ref }) }) }));
33
- });
34
- BottomNavigationItem.displayName = 'SuiBottomNavigationItem';
35
-
36
- export { BottomNavigationItem as B, BottomNavigationContext as a, useBottomNavigationContext as u };