@ringcentral/spring-ui 1.12.0 → 1.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Accordion.js +90 -34
- package/AccordionHeader.js +71 -21
- package/Alert.js +120 -28
- package/Animation.js +2 -46
- package/Announcement.js +46 -35
- package/Autocomplete.js +1011 -583
- package/Avatar.js +134 -73
- package/AvatarGroup.js +50 -7
- package/Backdrop.js +45 -7
- package/Badge.js +77 -15
- package/Block.js +34 -12
- package/BlockHeader.js +57 -15
- package/BottomNavigation.js +181 -65
- package/BottomNavigationItem.js +93 -30
- package/Button.js +160 -24
- package/CallButton.js +53 -31
- package/Checkbox.js +88 -26
- package/Chip.js +126 -26
- package/CircularProgressIndicator.js +80 -8
- package/ClickAwayListener.js +4 -1
- package/ComponentsProps.js +1 -0
- package/DatePicker.js +611 -192
- package/DateUtilsContext.js +43 -25
- package/Dialer.js +564 -253
- package/Dialog.js +99 -45
- package/Divider.js +43 -7
- package/DragHandle.js +32 -6
- package/Drawer.js +117 -19
- package/Dropdown.js +154 -77
- package/EmptyState.js +65 -15
- package/FabButton.js +51 -17
- package/FocusTrap.js +109 -12
- package/FormField.js +108 -12
- package/FormLabel.js +81 -7
- package/Icon.js +1 -8
- package/IconButton.js +142 -26
- package/IconButtonGroup.js +35 -12
- package/InlineEditable.js +98 -44
- package/LinearProgressIndicator.js +73 -24
- package/Link.js +40 -11
- package/List.js +54 -9
- package/ListItem.js +152 -23
- package/ListItemText.js +44 -17
- package/ListNavigation.js +272 -20
- package/Menu.js +139 -23
- package/MenuActions.js +37 -12
- package/MenuDivider.js +34 -8
- package/MenuFooter.js +36 -12
- package/MenuHeader.js +54 -16
- package/MenuItem.js +402 -35
- package/MenuItemText.js +51 -9
- package/MenuList.js +87 -36
- package/Modal.js +345 -16
- package/NestedMenuContext.js +183 -11
- package/Option.js +32 -36
- package/Overlap.js +54 -7
- package/PageHeader.js +62 -24
- package/PickerTextField.js +156 -35
- package/Popover.js +262 -21
- package/Popper.js +112 -62
- package/PopperPaper.js +54 -8
- package/Portal.js +6 -1
- package/Radio.js +65 -21
- package/RadioGroup.js +56 -17
- package/Rating.js +223 -87
- package/Select.js +387 -44
- package/SingleFilter.js +148 -79
- package/Skeleton.js +68 -17
- package/Slider.js +167 -69
- package/Snackbar.js +122 -59
- package/SortableList.js +32 -12
- package/SortableListDndContext.js +69 -22
- package/SortableListItem.js +92 -47
- package/SortableVirtualizedList.js +44 -20
- package/SplitButton.js +124 -89
- package/Squircle.js +4 -7
- package/StatusIndicator.js +51 -9
- package/Step.js +63 -38
- package/StepButton.js +51 -23
- package/StepConnector.js +48 -8
- package/StepContent.js +67 -24
- package/StepIcon.js +90 -9
- package/StepLabel.js +90 -14
- package/Stepper.js +65 -23
- package/SubMenu.js +203 -101
- package/SwipeableDrawer.js +439 -194
- package/Switch.js +70 -23
- package/Tab.js +120 -57
- package/TabContext.js +59 -15
- package/TabPanel.js +40 -13
- package/Table.js +60 -17
- package/TableBody.js +42 -12
- package/TableCell.js +84 -50
- package/TableContainer.js +32 -10
- package/TableFooter.js +38 -10
- package/TableHead.js +49 -15
- package/TablePagination.js +153 -79
- package/TableRow.js +60 -21
- package/Tabs.js +592 -271
- package/Tag.js +51 -16
- package/Text.js +68 -37
- package/TextField.js +209 -31
- package/Textarea.js +51 -42
- package/TimePicker.js +490 -232
- package/Tooltip.js +48 -23
- package/Tray.js +237 -13
- package/TrayMenu.js +62 -43
- package/VirtualizedList.js +205 -107
- package/VirtualizedMenu.js +359 -29
- package/VisuallyHidden.js +29 -6
- package/chunks/1250.js +98 -0
- package/chunks/1294.js +126 -0
- package/chunks/2956.js +18 -0
- package/chunks/4476.js +460 -0
- package/chunks/4491.js +10 -0
- package/chunks/4535.js +364 -0
- package/chunks/5047.js +3 -0
- package/chunks/6335.js +24 -0
- package/chunks/7279.js +10 -0
- package/chunks/8011.js +8 -0
- package/chunks/8307.js +56 -0
- package/chunks/8467.js +8 -0
- package/chunks/8809.js +8 -0
- package/chunks/{RadioGroup.context.js → 9551.js} +12 -6
- package/chunks/987.js +8 -0
- package/index.css +2436 -2261
- package/index.js +245 -195
- package/internal/utils/setRef.d.ts +2 -1
- package/package.json +4 -4
- package/src/Animation/hooks/useMotionSafeTransition/useMotionSafeTransition.d.ts +2 -0
- package/src/Autocomplete/SuggestionList/SuggestionList.d.ts +1 -1
- package/src/Button/Button.classes.d.ts +1 -1
- package/src/ComponentsProps.d.ts +111 -110
- package/src/DatePicker/DatePickerDataAttributes.d.ts +11 -0
- package/src/DatePicker/utils/DatePickerUtils.d.ts +1 -1
- package/src/MenuItem/MenuItem.type.d.ts +1 -0
- package/src/MenuList/MenuListContext.d.ts +2 -3
- package/src/Modal/Modal.type.d.ts +1 -0
- package/src/Popover/Popover.classes.d.ts +1 -1
- package/src/Popover/Popover.internal.d.ts +8 -0
- package/src/Popover/Popover.type.d.ts +1 -0
- package/src/Select/Select.type.d.ts +6 -4
- package/src/Table/Table.type.d.ts +3 -0
- package/src/Table/TableContext.d.ts +3 -0
- package/src/Table/TableRowContext.d.ts +7 -0
- package/src/Table/index.d.ts +1 -0
- package/src/TableCell/TableCell.classes.d.ts +1 -1
- package/src/TableFooter/TableFooter.classes.d.ts +1 -1
- package/src/TableFooter/TableFooter.type.d.ts +1 -0
- package/src/TableHead/TableHead.classes.d.ts +1 -1
- package/src/TableHead/TableHead.type.d.ts +1 -0
- package/src/TableRow/TableRow.type.d.ts +2 -0
- package/chunks/AccordionContext.js +0 -6
- package/chunks/Alert.js +0 -48
- package/chunks/AvatarGroup.js +0 -22
- package/chunks/Backdrop.js +0 -18
- package/chunks/Badge.js +0 -32
- package/chunks/BottomNavigationItem.js +0 -36
- package/chunks/Button.js +0 -88
- package/chunks/Chip.js +0 -73
- package/chunks/CircularProgressIndicator.js +0 -36
- package/chunks/Divider.js +0 -19
- package/chunks/DragHandle.js +0 -11
- package/chunks/Drawer.js +0 -33
- package/chunks/ExpandCollapseCaret.js +0 -24
- package/chunks/FormLabel.js +0 -27
- package/chunks/Icon.js +0 -25
- package/chunks/IconButtonLabel.js +0 -68
- package/chunks/List.js +0 -22
- package/chunks/ListItem.js +0 -83
- package/chunks/Menu.js +0 -61
- package/chunks/MenuDivider.js +0 -14
- package/chunks/MenuItemText.js +0 -18
- package/chunks/MenuList.js +0 -47
- package/chunks/Modal.js +0 -211
- package/chunks/Overlap.js +0 -25
- package/chunks/PickerTextField.js +0 -85
- package/chunks/Popover.js +0 -61
- package/chunks/PopperPaper.js +0 -15
- package/chunks/Select.js +0 -225
- package/chunks/ShowHideEye.js +0 -56
- package/chunks/SlideIn.js +0 -20
- package/chunks/SortableArrow.js +0 -73
- package/chunks/Squircle.js +0 -31
- package/chunks/StatusIndicator.js +0 -20
- package/chunks/StepConnector.js +0 -21
- package/chunks/StepIcon.js +0 -43
- package/chunks/StepLabel.js +0 -29
- package/chunks/StepperContext.js +0 -9
- package/chunks/TableContext.js +0 -6
- package/chunks/Tablelvl2Context.js +0 -6
- package/chunks/TabsContext.js +0 -6
- package/chunks/TextField.js +0 -110
- package/chunks/Tooltip.js +0 -217
- package/chunks/VirtualizedMenu.js +0 -162
- package/chunks/VisuallyHidden.js +0 -12
- package/chunks/composeEventHandlers.js +0 -10
- package/chunks/getFade.js +0 -27
- package/chunks/getGrow.js +0 -70
- package/chunks/getSlideIn.js +0 -30
- package/chunks/hasContent.js +0 -3
- package/chunks/useAnimationFrame.js +0 -15
- package/chunks/useFocusTrapStack.js +0 -38
- package/chunks/useHelperTextId.js +0 -24
- package/chunks/useListNavigation.js +0 -199
- package/chunks/useMenuItemSelect.js +0 -282
- package/chunks/useMotionSafeTransition.js +0 -9
- package/chunks/useNestedMenuItem.js +0 -27
- package/chunks/useNestedParentMenu.js +0 -113
- package/chunks/usePrefersReducedMotion.js +0 -36
- package/chunks/useTooltipForceHide.js +0 -27
- package/chunks/useTrayNavigate.js +0 -150
- package/chunks/withTooltip.js +0 -15
package/src/ComponentsProps.d.ts
CHANGED
|
@@ -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
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
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: () =>
|
|
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;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
|
|
3
|
-
|
|
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
|
|
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
|
|
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
|
-
<
|
|
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;
|
package/src/Table/index.d.ts
CHANGED
|
@@ -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<{
|
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 };
|
package/chunks/AvatarGroup.js
DELETED
|
@@ -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 };
|
package/chunks/Backdrop.js
DELETED
|
@@ -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 };
|