@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.
- package/Accordion.js +90 -34
- package/AccordionHeader.js +72 -20
- package/Alert.js +120 -28
- package/Animation.js +2 -45
- package/Announcement.js +46 -35
- package/Autocomplete.js +1011 -580
- 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 +55 -11
- 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 -190
- package/DateUtilsContext.js +43 -25
- package/Dialer.js +576 -250
- package/Dialog.js +100 -45
- package/Divider.js +43 -7
- package/DragHandle.js +32 -6
- package/Drawer.js +117 -19
- package/Dropdown.js +154 -74
- package/EmptyState.js +63 -11
- package/FabButton.js +51 -17
- package/FocusTrap.js +109 -12
- package/FormField.js +106 -8
- 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 -16
- 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 -15
- package/MenuItem.js +402 -33
- package/MenuItemText.js +51 -8
- package/MenuList.js +87 -34
- package/Modal.js +345 -16
- package/NestedMenuContext.js +183 -11
- package/Option.js +32 -34
- package/Overlap.js +54 -7
- package/PageHeader.js +62 -24
- package/PickerTextField.js +156 -33
- package/Popover.js +262 -21
- package/Popper.js +130 -77
- 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 -41
- package/SingleFilter.js +148 -77
- package/Skeleton.js +68 -17
- package/Slider.js +168 -69
- package/Snackbar.js +122 -59
- package/SortableList.js +32 -12
- package/SortableListDndContext.js +69 -22
- package/SortableListItem.js +92 -47
- package/SortableVirtualizedList.js +52 -28
- package/SplitButton.js +124 -86
- 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 +68 -25
- package/StepIcon.js +90 -9
- package/StepLabel.js +90 -14
- package/Stepper.js +65 -23
- package/SubMenu.js +203 -99
- 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 -77
- package/TableRow.js +60 -21
- package/Tabs.js +593 -268
- package/Tag.js +51 -16
- package/Text.js +68 -37
- package/TextField.js +209 -29
- package/Textarea.js +51 -40
- package/TimePicker.js +490 -230
- package/Tooltip.js +48 -23
- package/Tray.js +237 -13
- package/TrayMenu.js +62 -41
- package/VirtualizedList.js +208 -109
- 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 +2624 -2416
- package/index.js +245 -193
- package/internal/utils/index.d.ts +1 -0
- package/internal/utils/setRef.d.ts +2 -0
- package/package.json +8 -8
- package/src/Alert/Alert.type.d.ts +2 -1
- package/src/Animation/components/Fade/Fade.d.ts +4 -2
- package/src/Animation/components/Grow/Grow.d.ts +4 -2
- package/src/Animation/components/ShowHideEye/ShowHideEye.d.ts +1 -1
- package/src/Animation/components/SlideIn/SlideIn.d.ts +4 -2
- package/src/Animation/components/SlideIn/getSlideIn.d.ts +1 -1
- package/src/Animation/hooks/useMotionSafeTransition/useMotionSafeTransition.d.ts +2 -0
- package/src/Autocomplete/SuggestionList/SuggestionList.d.ts +1 -1
- package/src/Autocomplete/useAutocomplete.d.ts +18 -18
- package/src/Autocomplete/useAutocompleteTag.d.ts +18 -18
- package/src/Badge/Badge.d.ts +2 -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/DatePickerAriaLabelUtils.d.ts +2 -1
- package/src/DatePicker/utils/DatePickerUtils.d.ts +1 -1
- package/src/Dialer/DialDelete/DialDelete.d.ts +2 -2
- package/src/Dialer/DialPad/DialPad.d.ts +2 -2
- package/src/Dialer/Dialer.d.ts +4 -2
- package/src/Dropdown/Dropdown.type.d.ts +2 -2
- package/src/InlineEditable/InlineEditable.type.d.ts +2 -1
- package/src/ListNavigation/useListNavigation.d.ts +3 -3
- package/src/MenuActions/MenuActions.d.ts +2 -2
- package/src/MenuItem/MenuItem.type.d.ts +1 -0
- package/src/MenuItem/useMenuItem.d.ts +1 -1
- package/src/MenuItem/useVirtualizedMenuItem.d.ts +1 -1
- package/src/MenuList/MenuList.type.d.ts +1 -1
- package/src/MenuList/MenuListContext.d.ts +2 -3
- package/src/Modal/Modal.type.d.ts +1 -0
- package/src/NestedMenuContext/MenuOverlayGroupContext.d.ts +2 -2
- 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/Popper/Popper.type.d.ts +10 -7
- package/src/Rating/utils.d.ts +3 -2
- package/src/Select/Select.type.d.ts +7 -5
- package/src/Slider/Slider.d.ts +2 -2
- package/src/Slider/SliderThumb.d.ts +2 -1
- package/src/Squircle/Squircle.d.ts +1 -1
- package/src/StatusIndicator/StatusIndicator.d.ts +2 -1
- package/src/SubMenu/PopperMenu.type.d.ts +4 -1
- 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 -32
- 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 -17
- package/chunks/MenuList.js +0 -46
- package/chunks/Modal.js +0 -212
- package/chunks/Overlap.js +0 -25
- package/chunks/PickerTextField.js +0 -85
- package/chunks/Popover.js +0 -53
- package/chunks/PopperPaper.js +0 -15
- package/chunks/Select.js +0 -220
- package/chunks/ShowHideEye.js +0 -56
- package/chunks/SlideIn.js +0 -19
- 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 -164
- package/chunks/VisuallyHidden.js +0 -12
- 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 -36
- package/chunks/useHelperTextId.js +0 -22
- package/chunks/useListNavigation.js +0 -199
- package/chunks/useMenuItemSelect.js +0 -273
- 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/Avatar.js
CHANGED
|
@@ -1,16 +1,34 @@
|
|
|
1
|
-
import { jsx, jsxs
|
|
2
|
-
import { forwardRef, useContext
|
|
3
|
-
import clsx from
|
|
4
|
-
import {
|
|
5
|
-
import { ProfileMd } from
|
|
6
|
-
import { useThemeProps } from
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Children, forwardRef, useContext } from "react";
|
|
3
|
+
import clsx from "clsx";
|
|
4
|
+
import { useClasses, useFocusVisible, useForkRef, useImgLoaded } from "@ringcentral/spring-base";
|
|
5
|
+
import { ProfileMd } from "@ringcentral/spring-icon";
|
|
6
|
+
import { useThemeProps } from "@ringcentral/spring-theme";
|
|
7
|
+
import { AvatarGroupContext } from "./AvatarGroup.js";
|
|
8
|
+
import { Icon as Icon_Icon } from "./chunks/8307.js";
|
|
9
|
+
import { Overlap as Overlap_Overlap } from "./Overlap.js";
|
|
10
|
+
import { Squircle as Squircle_Squircle } from "./chunks/1250.js";
|
|
11
|
+
import { StatusIndicator as StatusIndicator_StatusIndicator } from "./StatusIndicator.js";
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
// extracted by css-extract-rspack-plugin
|
|
20
|
+
/* export default */ var Avatar = ({"sui-avatar-shape":"sui-avatar-shape","sui-avatar-content":"sui-avatar-content","sui-avatar-default":"sui-avatar-default","sui-avatar-primary":"sui-avatar-primary","sui-avatar-circle":"sui-avatar-circle","sui-avatar-circle-content":"sui-avatar-circle-content","sui-avatar-circle-default":"sui-avatar-circle-default","sui-avatar-circle-primary":"sui-avatar-circle-primary","sui-focus-visible":"sui-focus-visible","sui-avatar-img":"sui-avatar-img","sui-avatar-indicator":"sui-avatar-indicator","sui-avatar-root":"sui-avatar-root","sui-disabled":"sui-disabled","sui-avatar-xxlarge-content":"sui-avatar-xxlarge-content","sui-avatar-xlarge-content":"sui-avatar-xlarge-content","sui-avatar-xxlarge":"sui-avatar-xxlarge","sui-avatar-xlarge":"sui-avatar-xlarge","sui-avatar-large":"sui-avatar-large","sui-avatar-large-content":"sui-avatar-large-content","sui-avatar-medium":"sui-avatar-medium","sui-avatar-medium-content":"sui-avatar-medium-content","sui-avatar-small":"sui-avatar-small","sui-avatar-small-content":"sui-avatar-small-content","sui-avatar-xsmall-content":"sui-avatar-xsmall-content","sui-avatar-xxsmall-content":"sui-avatar-xxsmall-content","sui-avatar-xsmall":"sui-avatar-xsmall","sui-avatar-xxsmall":"sui-avatar-xxsmall","sui-avatar-clickable-shape":"sui-avatar-clickable-shape","sui-avatar-clickable-indicator":"sui-avatar-clickable-indicator","sui-avatar-clickable-hover-tint":"sui-avatar-clickable-hover-tint","sui-avatar-clickable-hover-tint-default-circle":"sui-avatar-clickable-hover-tint-default-circle","sui-avatar-clickable-hover-tint-primary-circle":"sui-avatar-clickable-hover-tint-primary-circle","sui-avatar-clickable":"sui-avatar-clickable","sui-avatar-hover-tint":"sui-avatar-hover-tint","sui-active":"sui-active"});
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
14
32
|
|
|
15
33
|
const IconSizeMap = {
|
|
16
34
|
xxlarge: 'large',
|
|
@@ -19,7 +37,7 @@ const IconSizeMap = {
|
|
|
19
37
|
medium: 'small',
|
|
20
38
|
small: 'xsmall',
|
|
21
39
|
xsmall: 'xsmall',
|
|
22
|
-
xxsmall: 'xsmall'
|
|
40
|
+
xxsmall: 'xsmall'
|
|
23
41
|
};
|
|
24
42
|
const StatusIndicatorSizeMap = {
|
|
25
43
|
xxlarge: 'large',
|
|
@@ -28,17 +46,20 @@ const StatusIndicatorSizeMap = {
|
|
|
28
46
|
medium: 'medium',
|
|
29
47
|
small: 'small',
|
|
30
48
|
xsmall: undefined,
|
|
31
|
-
xxsmall: undefined
|
|
49
|
+
xxsmall: undefined
|
|
32
50
|
};
|
|
33
|
-
const hasRenderableFallbackChildren = (children)
|
|
34
|
-
const
|
|
35
|
-
const props = useThemeProps({
|
|
51
|
+
const hasRenderableFallbackChildren = (children)=>Children.toArray(children).some((child)=>child !== '');
|
|
52
|
+
const Avatar_Avatar = /*#__PURE__*/ forwardRef((inProps, ref)=>{
|
|
53
|
+
const props = useThemeProps({
|
|
54
|
+
props: inProps,
|
|
55
|
+
name: 'Avatar'
|
|
56
|
+
});
|
|
36
57
|
const { component, classes, className, children: childrenProp, imgProps, alt, src, srcSet, size: sizeProp, color = 'default', variant = 'circle', clickable: clickableProp, symbol, avatarShapeRef, showStatusIndicator, IndicatorProps, rootProps, disabled, onClick, ...rest } = props;
|
|
37
58
|
let children = null;
|
|
38
59
|
const loaded = useImgLoaded({
|
|
39
60
|
...imgProps,
|
|
40
61
|
src,
|
|
41
|
-
srcSet
|
|
62
|
+
srcSet
|
|
42
63
|
});
|
|
43
64
|
const hasImg = Boolean(src || srcSet);
|
|
44
65
|
const shouldShowImage = hasImg && loaded === 'loaded';
|
|
@@ -51,10 +72,12 @@ const Avatar = forwardRef((inProps, ref) => {
|
|
|
51
72
|
srcSet,
|
|
52
73
|
...imgProps,
|
|
53
74
|
'aria-hidden': shouldShowFallback ? true : imgProps?.['aria-hidden'],
|
|
54
|
-
className: clsx(cls('img'), imgProps?.className, shouldShowFallback && 'sr-only')
|
|
75
|
+
className: clsx(cls('img'), imgProps?.className, shouldShowFallback && 'sr-only')
|
|
55
76
|
};
|
|
56
77
|
const AvatarImg = 'img';
|
|
57
|
-
const image = shouldMountImage ? jsx(AvatarImg, {
|
|
78
|
+
const image = shouldMountImage ? /*#__PURE__*/ jsx(AvatarImg, {
|
|
79
|
+
...imageProps
|
|
80
|
+
}) : null;
|
|
58
81
|
const groupContext = useContext(AvatarGroupContext);
|
|
59
82
|
const size = sizeProp || groupContext?.size || 'xlarge';
|
|
60
83
|
const groupClassName = groupContext?.className || '';
|
|
@@ -62,67 +85,62 @@ const Avatar = forwardRef((inProps, ref) => {
|
|
|
62
85
|
let fallback = null;
|
|
63
86
|
let fallbackFillShape = false;
|
|
64
87
|
if (symbol) {
|
|
65
|
-
fallback = jsx(
|
|
66
|
-
|
|
67
|
-
|
|
88
|
+
fallback = /*#__PURE__*/ jsx(Icon_Icon, {
|
|
89
|
+
size: IconSizeMap[size],
|
|
90
|
+
symbol: symbol
|
|
91
|
+
});
|
|
92
|
+
} else if (hasRenderableFallbackChildren(childrenProp)) {
|
|
68
93
|
fallback = childrenProp;
|
|
69
|
-
}
|
|
70
|
-
else if (hasImg && alt) {
|
|
94
|
+
} else if (hasImg && alt) {
|
|
71
95
|
fallback = alt[0];
|
|
72
96
|
fallbackFillShape = true;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
|
|
97
|
+
} else {
|
|
98
|
+
fallback = /*#__PURE__*/ jsx(Icon_Icon, {
|
|
99
|
+
size: IconSizeMap[size],
|
|
100
|
+
symbol: ProfileMd
|
|
101
|
+
});
|
|
76
102
|
}
|
|
77
103
|
if (shouldShowImage) {
|
|
78
104
|
children = image;
|
|
79
105
|
fillShape = true;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
|
|
106
|
+
} else {
|
|
107
|
+
children = /*#__PURE__*/ jsxs(Fragment, {
|
|
108
|
+
children: [
|
|
109
|
+
fallback,
|
|
110
|
+
image
|
|
111
|
+
]
|
|
112
|
+
});
|
|
83
113
|
fillShape = fallbackFillShape;
|
|
84
114
|
}
|
|
85
115
|
const { focusVisible, focusVisibleRef, focusVisibleHandlers } = useFocusVisible(props);
|
|
86
116
|
const avatarRef = useForkRef(avatarShapeRef, focusVisibleRef);
|
|
87
|
-
const clickable = clickableProp !== false && onClick ? true :
|
|
117
|
+
const clickable = clickableProp !== false && onClick ? true : clickableProp ?? false;
|
|
88
118
|
const interactive = clickable && !disabled;
|
|
89
119
|
const supportsStatusIndicator = size !== 'xxsmall' && size !== 'xsmall';
|
|
90
120
|
const shapeComponent = component ?? (clickable ? 'button' : 'div');
|
|
91
|
-
const AvatarShape = variant === 'squircle' ?
|
|
121
|
+
const AvatarShape = variant === 'squircle' ? Squircle_Squircle : shapeComponent;
|
|
92
122
|
const isButtonElement = shapeComponent === 'button';
|
|
93
123
|
const hasExplicitAccessibleName = rest['aria-label'] !== undefined || rest['aria-labelledby'] !== undefined;
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
alt
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
disabled,
|
|
113
|
-
}
|
|
114
|
-
: clickable && disabled
|
|
115
|
-
? {
|
|
116
|
-
'aria-disabled': true,
|
|
117
|
-
}
|
|
118
|
-
: {};
|
|
119
|
-
const nonInteractiveShapeProps = !isButtonElement && clickable && disabled
|
|
120
|
-
? {
|
|
121
|
-
tabIndex: -1,
|
|
122
|
-
}
|
|
123
|
-
: {};
|
|
124
|
+
// Keep interactive image avatars named by the image alt while fallback content is visible.
|
|
125
|
+
const accessibleNameProps = (clickable || isButtonElement) && hasImg && alt && !hasExplicitAccessibleName ? {
|
|
126
|
+
'aria-label': alt
|
|
127
|
+
} : {};
|
|
128
|
+
const shapeProps = variant === 'squircle' ? {
|
|
129
|
+
component: shapeComponent,
|
|
130
|
+
focusVisible: focusVisible && interactive,
|
|
131
|
+
fillShape,
|
|
132
|
+
interactive
|
|
133
|
+
} : {};
|
|
134
|
+
const ariaProps = isButtonElement ? {
|
|
135
|
+
disabled
|
|
136
|
+
} : clickable && disabled ? {
|
|
137
|
+
'aria-disabled': true
|
|
138
|
+
} : {};
|
|
139
|
+
const nonInteractiveShapeProps = !isButtonElement && clickable && disabled ? {
|
|
140
|
+
tabIndex: -1
|
|
141
|
+
} : {};
|
|
124
142
|
const rootClickHandler = onClick;
|
|
125
|
-
const handleClick = (event)
|
|
143
|
+
const handleClick = (event)=>{
|
|
126
144
|
if (disabled) {
|
|
127
145
|
event.preventDefault();
|
|
128
146
|
event.stopPropagation();
|
|
@@ -130,14 +148,57 @@ const Avatar = forwardRef((inProps, ref) => {
|
|
|
130
148
|
}
|
|
131
149
|
rootClickHandler?.(event);
|
|
132
150
|
};
|
|
133
|
-
return
|
|
151
|
+
return /*#__PURE__*/ jsx(Overlap_Overlap, {
|
|
152
|
+
position: {
|
|
134
153
|
bottom: '-1px',
|
|
135
|
-
right: '-1px'
|
|
136
|
-
},
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
154
|
+
right: '-1px'
|
|
155
|
+
},
|
|
156
|
+
floater: supportsStatusIndicator && showStatusIndicator ? /*#__PURE__*/ jsx(StatusIndicator_StatusIndicator, {
|
|
157
|
+
size: StatusIndicatorSizeMap[size],
|
|
158
|
+
...IndicatorProps
|
|
159
|
+
}) : undefined,
|
|
160
|
+
className: clsx(className, groupClassName),
|
|
161
|
+
classes: {
|
|
162
|
+
root: cls('root', size, {
|
|
163
|
+
disabled
|
|
164
|
+
}),
|
|
165
|
+
floater: cls('indicator', interactive && 'clickable-indicator')
|
|
166
|
+
},
|
|
167
|
+
...rootProps,
|
|
168
|
+
ref: ref,
|
|
169
|
+
children: /*#__PURE__*/ jsxs(AvatarShape, {
|
|
170
|
+
className: cls('shape', variant, color, {
|
|
171
|
+
clickable
|
|
172
|
+
}, interactive && 'clickable-shape', interactive && `clickable-${variant}`),
|
|
173
|
+
...focusVisibleHandlers,
|
|
174
|
+
...shapeProps,
|
|
175
|
+
...ariaProps,
|
|
176
|
+
...accessibleNameProps,
|
|
177
|
+
...nonInteractiveShapeProps,
|
|
178
|
+
...rest,
|
|
179
|
+
onClick: onClick ? handleClick : undefined,
|
|
180
|
+
ref: avatarRef,
|
|
181
|
+
children: [
|
|
182
|
+
/*#__PURE__*/ jsx("div", {
|
|
183
|
+
className: cls('content', `${variant}-content`, `${size}-content`, `${variant}-${color}`),
|
|
184
|
+
children: children
|
|
185
|
+
}),
|
|
186
|
+
variant === 'circle' && /*#__PURE__*/ jsx("div", {
|
|
187
|
+
className: cls('hover-tint', interactive && 'clickable-hover-tint', interactive && `clickable-hover-tint-${color}-${variant}`)
|
|
188
|
+
}),
|
|
189
|
+
variant === 'squircle' && interactive && /*#__PURE__*/ jsx(Squircle_Squircle, {
|
|
190
|
+
interactive: false,
|
|
191
|
+
className: cls('hover-tint', interactive && 'clickable-hover-tint', interactive && `clickable-hover-tint-${color}-${variant}`)
|
|
192
|
+
})
|
|
193
|
+
]
|
|
194
|
+
})
|
|
195
|
+
});
|
|
140
196
|
});
|
|
141
|
-
|
|
197
|
+
Avatar_Avatar.displayName = 'SuiAvatar';
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
|
|
201
|
+
|
|
202
|
+
|
|
142
203
|
|
|
143
|
-
export { Avatar,
|
|
204
|
+
export { Avatar as avatarStyles, Avatar_Avatar as Avatar };
|
package/AvatarGroup.js
CHANGED
|
@@ -1,9 +1,52 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import '@ringcentral/spring-theme';
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Children, createContext, forwardRef } from "react";
|
|
3
|
+
import { logInDev, useClasses } from "@ringcentral/spring-base";
|
|
4
|
+
import { useThemeProps } from "@ringcentral/spring-theme";
|
|
6
5
|
|
|
7
|
-
var AvatarGroup = {"sui-avatar-group-root":"sui-avatar-group-root","sui-avatar-group-item":"sui-avatar-group-item"};
|
|
8
6
|
|
|
9
|
-
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
// extracted by css-extract-rspack-plugin
|
|
11
|
+
/* export default */ var AvatarGroup = ({"sui-avatar-group-root":"sui-avatar-group-root","sui-avatar-group-item":"sui-avatar-group-item"});
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
const AvatarGroupContext = /*#__PURE__*/ createContext({});
|
|
18
|
+
const AvatarGroup_AvatarGroup = /*#__PURE__*/ forwardRef((inProps, ref)=>{
|
|
19
|
+
const props = useThemeProps({
|
|
20
|
+
props: inProps,
|
|
21
|
+
name: 'AvatarGroup'
|
|
22
|
+
});
|
|
23
|
+
const { component: AvatarGroupRoot = 'div', classes, className, children, ...rest } = props;
|
|
24
|
+
const cls = useClasses('avatar-group', classes, className);
|
|
25
|
+
const childrenLength = Children.toArray(children).filter(Boolean).length;
|
|
26
|
+
if (process.env.NODE_ENV !== 'production' && childrenLength !== 2) {
|
|
27
|
+
logInDev({
|
|
28
|
+
scope: 'AvatarGroup',
|
|
29
|
+
message: 'AvatarGroup only accept 2 valid child components as its children'
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
return /*#__PURE__*/ jsx(AvatarGroupContext.Provider, {
|
|
33
|
+
value: {
|
|
34
|
+
size: 'small',
|
|
35
|
+
className: cls('item')
|
|
36
|
+
},
|
|
37
|
+
children: /*#__PURE__*/ jsx(AvatarGroupRoot, {
|
|
38
|
+
className: cls('root'),
|
|
39
|
+
...rest,
|
|
40
|
+
ref: ref,
|
|
41
|
+
children: children
|
|
42
|
+
})
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
AvatarGroup_AvatarGroup.displayName = 'SuiAvatarGroup';
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
export { AvatarGroup as avatarGroupStyles, AvatarGroupContext, AvatarGroup_AvatarGroup as AvatarGroup };
|
package/Backdrop.js
CHANGED
|
@@ -1,9 +1,47 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import '@ringcentral/spring-theme';
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
import { useClasses } from "@ringcentral/spring-base";
|
|
4
|
+
import { useThemeProps } from "@ringcentral/spring-theme";
|
|
6
5
|
|
|
7
|
-
var Backdrop = {"sui-backdrop-root":"sui-backdrop-root","sui-backdrop-transparent":"sui-backdrop-transparent"};
|
|
8
6
|
|
|
9
|
-
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
// extracted by css-extract-rspack-plugin
|
|
11
|
+
/* export default */ var Backdrop = ({"sui-backdrop-root":"sui-backdrop-root","sui-backdrop-transparent":"sui-backdrop-transparent"});
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
const Backdrop_Backdrop = /*#__PURE__*/ forwardRef((inProps, ref)=>{
|
|
18
|
+
const props = useThemeProps({
|
|
19
|
+
props: inProps,
|
|
20
|
+
name: 'Backdrop'
|
|
21
|
+
});
|
|
22
|
+
const { classes, className, children, isTransparent = false, onClick, ...rest } = props;
|
|
23
|
+
const cls = useClasses('backdrop', classes, className);
|
|
24
|
+
const handleClick = (e)=>{
|
|
25
|
+
e.stopPropagation();
|
|
26
|
+
onClick?.(e);
|
|
27
|
+
};
|
|
28
|
+
return /*#__PURE__*/ jsx("div", {
|
|
29
|
+
className: cls('root', {
|
|
30
|
+
transparent: isTransparent
|
|
31
|
+
}),
|
|
32
|
+
"aria-hidden": true,
|
|
33
|
+
tabIndex: -1,
|
|
34
|
+
...rest,
|
|
35
|
+
ref: ref,
|
|
36
|
+
onClick: handleClick,
|
|
37
|
+
children: children
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
Backdrop_Backdrop.displayName = 'SuiBackdrop';
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
export { Backdrop as backdropStyles, Backdrop_Backdrop as Backdrop };
|
package/Badge.js
CHANGED
|
@@ -1,15 +1,77 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
import { jsx, jsxs } 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 { motionTransition, useThemeProps } from "@ringcentral/spring-theme";
|
|
8
|
+
import "./chunks/4476.js";
|
|
9
|
+
import { useMotionSafeTransition } from "./chunks/1294.js";
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
// extracted by css-extract-rspack-plugin
|
|
19
|
+
/* export default */ var Badge = ({"sui-badge-root":"sui-badge-root","sui-badge-content":"sui-badge-content","sui-badge-primary":"sui-badge-primary","sui-badge-danger":"sui-badge-danger","sui-badge-success":"sui-badge-success","sui-badge-warning":"sui-badge-warning","sui-badge-secondary":"sui-badge-secondary","sui-badge-absolute":"sui-badge-absolute","sui-badge-standard":"sui-badge-standard","sui-badge-standard-small":"sui-badge-standard-small","sui-badge-standard-medium":"sui-badge-standard-medium","sui-badge-standard-primary":"sui-badge-standard-primary","sui-badge-standard-contained":"sui-badge-standard-contained","sui-badge-standard-contained-small":"sui-badge-standard-contained-small","sui-badge-standard-contained-medium":"sui-badge-standard-contained-medium","sui-badge-standard-outlined":"sui-badge-standard-outlined","sui-badge-standard-outlined-small":"sui-badge-standard-outlined-small","sui-badge-standard-outlined-medium":"sui-badge-standard-outlined-medium","sui-badge-dot":"sui-badge-dot","sui-badge-dot-primary":"sui-badge-dot-primary","sui-badge-dot-danger":"sui-badge-dot-danger","sui-badge-dot-success":"sui-badge-dot-success","sui-badge-dot-warning":"sui-badge-dot-warning","sui-badge-dot-contained-small":"sui-badge-dot-contained-small","sui-badge-dot-contained-medium":"sui-badge-dot-contained-medium","sui-badge-dot-outlined":"sui-badge-dot-outlined","sui-badge-dot-outlined-small":"sui-badge-dot-outlined-small","sui-badge-dot-outlined-medium":"sui-badge-dot-outlined-medium","sui-badge-rectangular":"sui-badge-rectangular","sui-badge-circular":"sui-badge-circular","sui-badge-rectangular-top-right":"sui-badge-rectangular-top-right","sui-badge-rectangular-bottom-right":"sui-badge-rectangular-bottom-right","sui-badge-rectangular-top-left":"sui-badge-rectangular-top-left","sui-badge-rectangular-bottom-left":"sui-badge-rectangular-bottom-left","sui-badge-circular-top-right":"sui-badge-circular-top-right","sui-badge-circular-bottom-right":"sui-badge-circular-bottom-right","sui-badge-circular-top-left":"sui-badge-circular-top-left","sui-badge-circular-bottom-left":"sui-badge-circular-bottom-left"});
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
const Badge_Badge = (inProps)=>{
|
|
30
|
+
const props = useThemeProps({
|
|
31
|
+
props: inProps,
|
|
32
|
+
name: 'Badge'
|
|
33
|
+
});
|
|
34
|
+
const { count, classes, showZero, className, invisible, forceOverlap, type = 'standard', max = 999, size = 'small', color = 'primary', variant = 'contained', children, anchorOrigin = 'topRight', overlap = 'rectangular', ...rest } = props;
|
|
35
|
+
const cls = useClasses('badge', classes, className);
|
|
36
|
+
const transition = useMotionSafeTransition(motionTransition["haste-01-fast"]);
|
|
37
|
+
const numeric = isNumber(count);
|
|
38
|
+
const content = type === 'standard' ? numeric && count > max ? `${max}+` : count : undefined;
|
|
39
|
+
const toOrigin = useMemo(()=>kebabCase(anchorOrigin), [
|
|
40
|
+
anchorOrigin
|
|
41
|
+
]);
|
|
42
|
+
const overlapMode = Boolean(children || forceOverlap);
|
|
43
|
+
return /*#__PURE__*/ jsxs("span", {
|
|
44
|
+
className: cls('root', {
|
|
45
|
+
absolute: !children && forceOverlap
|
|
46
|
+
}),
|
|
47
|
+
...rest,
|
|
48
|
+
children: [
|
|
49
|
+
children,
|
|
50
|
+
/*#__PURE__*/ jsx(AnimatePresence, {
|
|
51
|
+
initial: false,
|
|
52
|
+
children: invisible || !showZero && count === 0 || content === undefined && type === 'standard' ? null : /*#__PURE__*/ jsx(motion.span, {
|
|
53
|
+
initial: {
|
|
54
|
+
opacity: 0
|
|
55
|
+
},
|
|
56
|
+
animate: {
|
|
57
|
+
opacity: 1
|
|
58
|
+
},
|
|
59
|
+
exit: {
|
|
60
|
+
opacity: 0
|
|
61
|
+
},
|
|
62
|
+
transition: transition,
|
|
63
|
+
className: cls('content', color, size, type, variant, toOrigin, `${type}-${size}`, `${type}-${color}`, `${type}-${variant}`, `${type}-${variant}-${size}`, overlapMode && overlap, overlapMode && `${overlap}-${toOrigin}`),
|
|
64
|
+
children: content
|
|
65
|
+
})
|
|
66
|
+
})
|
|
67
|
+
]
|
|
68
|
+
});
|
|
69
|
+
};
|
|
70
|
+
Badge_Badge.displayName = 'SuiBadge';
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
export { Badge as badgeStyles, Badge_Badge as Badge };
|
package/Block.js
CHANGED
|
@@ -1,20 +1,42 @@
|
|
|
1
|
-
import { jsx } from
|
|
2
|
-
import { forwardRef } from
|
|
3
|
-
import { useClasses } from
|
|
4
|
-
import { useThemeProps } from
|
|
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
5
|
|
|
6
|
-
var Block$1 = {"sui-block-root":"sui-block-root","sui-block-row":"sui-block-row","sui-block-padding":"sui-block-padding","sui-block-bordered":"sui-block-bordered","sui-block-border-radius-none":"sui-block-border-radius-none","sui-block-border-radius-xsmall":"sui-block-border-radius-xsmall","sui-block-border-radius-small":"sui-block-border-radius-small","sui-block-border-radius-medium":"sui-block-border-radius-medium","sui-block-default":"sui-block-default","sui-block-neutral":"sui-block-neutral","sui-block-hide-background":"sui-block-hide-background"};
|
|
7
6
|
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
// extracted by css-extract-rspack-plugin
|
|
11
|
+
/* export default */ var Block = ({"sui-block-root":"sui-block-root","sui-block-row":"sui-block-row","sui-block-padding":"sui-block-padding","sui-block-bordered":"sui-block-bordered","sui-block-border-radius-none":"sui-block-border-radius-none","sui-block-border-radius-xsmall":"sui-block-border-radius-xsmall","sui-block-border-radius-small":"sui-block-border-radius-small","sui-block-border-radius-medium":"sui-block-border-radius-medium","sui-block-default":"sui-block-default","sui-block-neutral":"sui-block-neutral","sui-block-hide-background":"sui-block-hide-background"});
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
const Block_Block = /*#__PURE__*/ forwardRef((inProps, ref)=>{
|
|
18
|
+
const props = useThemeProps({
|
|
19
|
+
props: inProps,
|
|
20
|
+
name: 'Block'
|
|
21
|
+
});
|
|
10
22
|
const { component: BlockRoot = 'div', classes, className, children, row = false, padding = true, bordered = true, borderRadius = 'medium', color = 'default', background = true, ...rest } = props;
|
|
11
23
|
const cls = useClasses('block', classes, className);
|
|
12
|
-
return
|
|
24
|
+
return /*#__PURE__*/ jsx(BlockRoot, {
|
|
25
|
+
className: cls('root', `border-radius-${borderRadius}`, background ? color : 'hide-background', {
|
|
13
26
|
row,
|
|
14
27
|
padding,
|
|
15
|
-
bordered
|
|
16
|
-
}),
|
|
28
|
+
bordered
|
|
29
|
+
}),
|
|
30
|
+
...rest,
|
|
31
|
+
ref: ref,
|
|
32
|
+
children: children
|
|
33
|
+
});
|
|
17
34
|
});
|
|
18
|
-
|
|
35
|
+
Block_Block.displayName = 'SuiBlock';
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
19
41
|
|
|
20
|
-
export { Block,
|
|
42
|
+
export { Block as blockStyles, Block_Block as Block };
|
package/BlockHeader.js
CHANGED
|
@@ -1,18 +1,62 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { forwardRef } from
|
|
3
|
-
import { useClasses } from
|
|
4
|
-
import { useThemeProps } from
|
|
5
|
-
import {
|
|
1
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
import { useClasses } from "@ringcentral/spring-base";
|
|
4
|
+
import { useThemeProps } from "@ringcentral/spring-theme";
|
|
5
|
+
import { Divider as Divider_Divider } from "./Divider.js";
|
|
6
|
+
import { hasContent } from "./chunks/5047.js";
|
|
6
7
|
|
|
7
|
-
var BlockHeader$1 = {"sui-block-header-root":"sui-block-header-root","sui-block-header-title":"sui-block-header-title","sui-block-header-end-slot":"sui-block-header-end-slot","sui-block-header-divider":"sui-block-header-divider"};
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
// extracted by css-extract-rspack-plugin
|
|
13
|
+
/* export default */ var BlockHeader = ({"sui-block-header-root":"sui-block-header-root","sui-block-header-title":"sui-block-header-title","sui-block-header-end-slot":"sui-block-header-end-slot","sui-block-header-divider":"sui-block-header-divider"});
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
const BlockHeader_BlockHeader = /*#__PURE__*/ forwardRef((inProps, ref)=>{
|
|
22
|
+
const props = useThemeProps({
|
|
23
|
+
props: inProps,
|
|
24
|
+
name: 'BlockHeader'
|
|
25
|
+
});
|
|
11
26
|
const { component: BlockHeaderRoot = 'div', classes, className, children, endSlot, divider = false, ...rest } = props;
|
|
12
27
|
const cls = useClasses('block-header', classes, className);
|
|
13
28
|
const title = typeof children === 'string' ? children : undefined;
|
|
14
|
-
return
|
|
29
|
+
return /*#__PURE__*/ jsxs(Fragment, {
|
|
30
|
+
children: [
|
|
31
|
+
/*#__PURE__*/ jsxs(BlockHeaderRoot, {
|
|
32
|
+
className: cls('root'),
|
|
33
|
+
...rest,
|
|
34
|
+
ref: ref,
|
|
35
|
+
children: [
|
|
36
|
+
/*#__PURE__*/ jsx("div", {
|
|
37
|
+
title: title,
|
|
38
|
+
className: cls('title'),
|
|
39
|
+
children: children
|
|
40
|
+
}),
|
|
41
|
+
hasContent(endSlot) && /*#__PURE__*/ jsx("div", {
|
|
42
|
+
className: cls('end-slot'),
|
|
43
|
+
children: endSlot
|
|
44
|
+
})
|
|
45
|
+
]
|
|
46
|
+
}),
|
|
47
|
+
divider && /*#__PURE__*/ jsx(Divider_Divider, {
|
|
48
|
+
className: cls('divider'),
|
|
49
|
+
orientation: "horizontal",
|
|
50
|
+
flexItem: true
|
|
51
|
+
})
|
|
52
|
+
]
|
|
53
|
+
});
|
|
15
54
|
});
|
|
16
|
-
|
|
55
|
+
BlockHeader_BlockHeader.displayName = 'SuiBlockHeader';
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
|
|
17
61
|
|
|
18
|
-
export { BlockHeader,
|
|
62
|
+
export { BlockHeader as blockHeaderStyles, BlockHeader_BlockHeader as BlockHeader };
|