@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
@@ -1,4 +1,3 @@
1
- import type { PartialDeep } from 'type-fest';
2
1
  import type { AccordionProps } from './Accordion';
3
2
  import type { AccordionHeaderProps } from './AccordionHeader';
4
3
  import type { AlertProps } from './Alert';
@@ -96,112 +95,114 @@ import type { StepIconProps } from './StepIcon';
96
95
  import type { StepButtonProps } from './StepButton';
97
96
  import type { StepContentProps } from './StepContent';
98
97
  import type { RatingProps } from './Rating';
99
- export type ComponentsProps = PartialDeep<{
100
- Accordion?: AccordionProps;
101
- AccordionHeader?: AccordionHeaderProps;
102
- Alert?: AlertProps;
103
- Announcement?: AnnouncementProps;
104
- Avatar?: AvatarProps;
105
- AvatarGroup?: AvatarGroupProps;
106
- Badge?: BadgeProps;
107
- Block?: BlockProps;
108
- BlockHeader?: BlockHeaderProps;
109
- BottomNavigation?: BottomNavigationProps;
110
- BottomNavigationItem?: BottomNavigationItemProps;
111
- Button?: ButtonProps;
112
- CallButton?: CallButtonProps;
113
- Checkbox?: CheckboxProps;
114
- Chip?: ChipProps;
115
- CircularProgressIndicator?: CircularProgressIndicatorProps;
116
- Dialog?: DialogProps;
117
- Drawer?: DrawerProps;
118
- SwipeableDrawer?: SwipeableDrawerProps;
119
- DialDelete?: DialDeleteProps;
120
- DialPad?: DialPadProps;
121
- DialTextField?: DialTextFieldProps;
122
- Divider?: DividerProps;
123
- Dropdown?: DropdownProps;
124
- EmptyState?: EmptyStateProps;
125
- FabButton?: FabButtonProps;
126
- FormField?: FormFieldProps;
127
- FormLabel?: FormLabelProps;
128
- Icon?: IconProps;
129
- IconButton?: IconButtonProps;
130
- IconButtonLabel?: IconButtonLabelProps;
131
- LinearProgressIndicator?: LinearProgressIndicatorProps;
132
- Link?: LinkProps;
133
- List?: ListProps;
134
- ListItem?: ListItemProps;
135
- ListItemText?: ListItemTextProps;
136
- Menu?: MenuProps;
137
- MenuActions?: MenuActionsProps;
138
- MenuDivider?: MenuDividerProps;
139
- MenuFooter?: MenuFooterProps;
140
- MenuHeader?: MenuHeaderProps;
141
- MenuItem?: MenuItemProps;
142
- MenuItemText?: MenuItemTextProps;
143
- MenuList?: MenuListProps;
144
- Option?: OptionProps;
145
- Overlap?: OverlapProps;
146
- PageHeader?: PageHeaderProps;
147
- Popover?: PopoverProps;
148
- Popper?: PopperProps;
149
- Radio?: RadioProps;
150
- RadioGroup?: RadioGroupProps;
151
- Select?: SelectProps;
152
- SingleFilter?: SingleFilterProps;
153
- Skeleton?: SkeletonProps;
154
- SkeletonContainer?: SkeletonContainerProps;
155
- Slider?: SliderProps;
156
- Snackbar?: SnackbarProps;
157
- SplitButton?: SplitButtonProps;
158
- Squircle?: SquircleProps;
159
- StatusIndicator?: StatusIndicatorProps;
160
- SubMenu?: SubMenuProps;
161
- Switch?: SwitchProps;
162
- Tab?: TabProps;
163
- Tabs?: TabsProps;
164
- TabPanel?: TabPanelProps;
165
- Tag?: TagProps;
166
- TextField?: TextFieldProps;
167
- Textarea?: TextareaProps;
168
- Tooltip?: TooltipProps;
169
- Tray?: TrayProps;
170
- TrayPanel?: TrayPanelProps;
171
- TrayMenu?: TrayMenuProps;
172
- TrayMenuItem?: TrayMenuItemProps;
173
- Backdrop?: BackdropProps;
174
- VirtualizedList?: VirtualizedListProps;
175
- VirtualizedMenu?: VirtualizedMenuProps;
176
- SortableListDndContext?: SortableListDndContextProps;
177
- SortableList?: SortableListProps;
178
- SortableVirtualizedList?: SortableVirtualizedListProps;
179
- InlineEditable?: InlineEditableProps;
180
- Autocomplete?: AutocompleteProps;
181
- SuggestionList?: SuggestionListProps;
182
- DatePicker?: DatePickerProps;
183
- TimePicker?: TimePickerProps;
184
- PopperPaper?: PopperPaperProps;
185
- Modal?: ModalProps;
186
- Text?: TextProps;
187
- Table?: TableProps;
188
- TableBody?: TableBodyProps;
189
- TableCell?: TableCellProps;
190
- TableHead?: TableHeadProps;
191
- TableRow?: TableRowProps;
192
- TableContainer?: TableContainerProps;
193
- Step?: StepProps;
194
- Stepper?: StepperProps;
195
- StepConnector?: StepConnectorProps;
196
- StepLabel?: StepLabelProps;
197
- StepIcon?: StepIconProps;
198
- StepButton?: StepButtonProps;
199
- StepContent?: StepContentProps;
200
- Rating?: RatingProps;
201
- PageHeaderLeft?: PageHeaderLeftProps;
202
- PageHeaderCenter?: PageHeaderCenterProps;
203
- PageHeaderRight?: PageHeaderRightProps;
204
- PageHeaderTitle?: PageHeaderTitleProps;
205
- TablePagination?: TablePaginationProps;
206
- IconButtonGroup?: IconButtonGroupProps;
207
- }>;
98
+ declare module '@ringcentral/spring-theme' {
99
+ interface ComponentsPropsRegistry {
100
+ Accordion?: AccordionProps;
101
+ AccordionHeader?: AccordionHeaderProps;
102
+ Alert?: AlertProps;
103
+ Announcement?: AnnouncementProps;
104
+ Avatar?: AvatarProps;
105
+ AvatarGroup?: AvatarGroupProps;
106
+ Badge?: BadgeProps;
107
+ Block?: BlockProps;
108
+ BlockHeader?: BlockHeaderProps;
109
+ BottomNavigation?: BottomNavigationProps;
110
+ BottomNavigationItem?: BottomNavigationItemProps;
111
+ Button?: ButtonProps;
112
+ CallButton?: CallButtonProps;
113
+ Checkbox?: CheckboxProps;
114
+ Chip?: ChipProps;
115
+ CircularProgressIndicator?: CircularProgressIndicatorProps;
116
+ Dialog?: DialogProps;
117
+ Drawer?: DrawerProps;
118
+ SwipeableDrawer?: SwipeableDrawerProps;
119
+ DialDelete?: DialDeleteProps;
120
+ DialPad?: DialPadProps;
121
+ DialTextField?: DialTextFieldProps;
122
+ Divider?: DividerProps;
123
+ Dropdown?: DropdownProps;
124
+ EmptyState?: EmptyStateProps;
125
+ FabButton?: FabButtonProps;
126
+ FormField?: FormFieldProps;
127
+ FormLabel?: FormLabelProps;
128
+ Icon?: IconProps;
129
+ IconButton?: IconButtonProps;
130
+ IconButtonLabel?: IconButtonLabelProps;
131
+ LinearProgressIndicator?: LinearProgressIndicatorProps;
132
+ Link?: LinkProps;
133
+ List?: ListProps;
134
+ ListItem?: ListItemProps;
135
+ ListItemText?: ListItemTextProps;
136
+ Menu?: MenuProps;
137
+ MenuActions?: MenuActionsProps;
138
+ MenuDivider?: MenuDividerProps;
139
+ MenuFooter?: MenuFooterProps;
140
+ MenuHeader?: MenuHeaderProps;
141
+ MenuItem?: MenuItemProps;
142
+ MenuItemText?: MenuItemTextProps;
143
+ MenuList?: MenuListProps;
144
+ Option?: OptionProps;
145
+ Overlap?: OverlapProps;
146
+ PageHeader?: PageHeaderProps;
147
+ Popover?: PopoverProps;
148
+ Popper?: PopperProps;
149
+ Radio?: RadioProps;
150
+ RadioGroup?: RadioGroupProps;
151
+ Select?: SelectProps;
152
+ SingleFilter?: SingleFilterProps;
153
+ Skeleton?: SkeletonProps;
154
+ SkeletonContainer?: SkeletonContainerProps;
155
+ Slider?: SliderProps;
156
+ Snackbar?: SnackbarProps;
157
+ SplitButton?: SplitButtonProps;
158
+ Squircle?: SquircleProps;
159
+ StatusIndicator?: StatusIndicatorProps;
160
+ SubMenu?: SubMenuProps;
161
+ Switch?: SwitchProps;
162
+ Tab?: TabProps;
163
+ Tabs?: TabsProps;
164
+ TabPanel?: TabPanelProps;
165
+ Tag?: TagProps;
166
+ TextField?: TextFieldProps;
167
+ Textarea?: TextareaProps;
168
+ Tooltip?: TooltipProps;
169
+ Tray?: TrayProps;
170
+ TrayPanel?: TrayPanelProps;
171
+ TrayMenu?: TrayMenuProps;
172
+ TrayMenuItem?: TrayMenuItemProps;
173
+ Backdrop?: BackdropProps;
174
+ VirtualizedList?: VirtualizedListProps;
175
+ VirtualizedMenu?: VirtualizedMenuProps;
176
+ SortableListDndContext?: SortableListDndContextProps;
177
+ SortableList?: SortableListProps;
178
+ SortableVirtualizedList?: SortableVirtualizedListProps;
179
+ InlineEditable?: InlineEditableProps;
180
+ Autocomplete?: AutocompleteProps;
181
+ SuggestionList?: SuggestionListProps;
182
+ DatePicker?: DatePickerProps;
183
+ TimePicker?: TimePickerProps;
184
+ PopperPaper?: PopperPaperProps;
185
+ Modal?: ModalProps;
186
+ Text?: TextProps;
187
+ Table?: TableProps;
188
+ TableBody?: TableBodyProps;
189
+ TableCell?: TableCellProps;
190
+ TableHead?: TableHeadProps;
191
+ TableRow?: TableRowProps;
192
+ TableContainer?: TableContainerProps;
193
+ Step?: StepProps;
194
+ Stepper?: StepperProps;
195
+ StepConnector?: StepConnectorProps;
196
+ StepLabel?: StepLabelProps;
197
+ StepIcon?: StepIconProps;
198
+ StepButton?: StepButtonProps;
199
+ StepContent?: StepContentProps;
200
+ Rating?: RatingProps;
201
+ PageHeaderLeft?: PageHeaderLeftProps;
202
+ PageHeaderCenter?: PageHeaderCenterProps;
203
+ PageHeaderRight?: PageHeaderRightProps;
204
+ PageHeaderTitle?: PageHeaderTitleProps;
205
+ TablePagination?: TablePaginationProps;
206
+ IconButtonGroup?: IconButtonGroupProps;
207
+ }
208
+ }
@@ -0,0 +1,11 @@
1
+ declare const DATE_PICKER_HEADER_DATA_ATTRIBUTES: {
2
+ readonly previousMonth: "data-sui-picker-previous-month";
3
+ readonly nextMonth: "data-sui-picker-next-month";
4
+ readonly switchYearAction: "data-sui-picker-switch-year-action";
5
+ };
6
+ declare const DATE_PICKER_HEADER_SELECTORS: {
7
+ readonly previousMonth: "[data-sui-picker-previous-month]";
8
+ readonly nextMonth: "[data-sui-picker-next-month]";
9
+ readonly switchYearAction: "[data-sui-picker-switch-year-action]";
10
+ };
11
+ export { DATE_PICKER_HEADER_DATA_ATTRIBUTES, DATE_PICKER_HEADER_SELECTORS };
@@ -1,7 +1,7 @@
1
1
  import DateUtils from '@date-io/dayjs';
2
2
  import { CalendarProps } from '../Calendar';
3
3
  import { DateType } from '../DatePicker.type';
4
- export declare const focusDayElement: () => void;
4
+ export declare const focusDayElement: (root?: ParentNode | null) => HTMLElement | null | undefined;
5
5
  export declare const isSameYearAndMonth: ({ source, comparing }: {
6
6
  source: DateType;
7
7
  comparing: DateType;
@@ -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'>;
@@ -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,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;
@@ -6,6 +6,7 @@ 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;
@@ -18,17 +19,18 @@ export type SelectProps<T = unknown> = StandardProps<{
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,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, contentProps, ...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", ...contentProps, 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 = Boolean(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 };