@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/chunks/ShowHideEye.js
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
-
import { useClasses } from '@ringcentral/spring-base';
|
|
3
|
-
import { motionTransition } from '@ringcentral/spring-theme';
|
|
4
|
-
import { motion } from 'framer-motion';
|
|
5
|
-
import { I as Icon } from './Icon.js';
|
|
6
|
-
import 'react';
|
|
7
|
-
import { u as useMotionSafeTransition } from './useMotionSafeTransition.js';
|
|
8
|
-
|
|
9
|
-
const topEyelidVariants = {
|
|
10
|
-
show: {
|
|
11
|
-
d: 'M 17.5 12.25 C 16.75 10.25 13.8 7 10 7 C 6.2 7 3.25 10.25 2.5 12.25',
|
|
12
|
-
},
|
|
13
|
-
hide: {
|
|
14
|
-
d: 'M 17.5 6.75 C 16.75 8.75 14 12.2 10 12.2 C 6 12.2 3.25 8.75 2.5 6.75',
|
|
15
|
-
},
|
|
16
|
-
};
|
|
17
|
-
const bottomEyelidVariants = {
|
|
18
|
-
show: {
|
|
19
|
-
d: 'M 17.5 11.75 C 16.75 13.75 13.8 17 10 17 C 6.2 17 3.25 13.75 2.5 11.75',
|
|
20
|
-
},
|
|
21
|
-
hide: {
|
|
22
|
-
d: 'M 17.5 6.75 C 16.75 8.75 14 12.2 10 12.2 C 6 12.2 3.25 8.75 2.5 6.75',
|
|
23
|
-
},
|
|
24
|
-
};
|
|
25
|
-
const eyelashVariants = {
|
|
26
|
-
show: {
|
|
27
|
-
d: 'M 10 4.5 L 10 1.5 M 4 6.35 L 2.5 3.7 M 16 6.35 L 17.5 3.7',
|
|
28
|
-
},
|
|
29
|
-
hide: {
|
|
30
|
-
d: 'M 10 15.5 L 10 18.5 M 16 13.75 L 17.5 16.4 M 4 13.75 L 2.5 16.4',
|
|
31
|
-
},
|
|
32
|
-
};
|
|
33
|
-
const ShowHideEye = (props) => {
|
|
34
|
-
const { classes, size = 'medium', hide = false, className, ...rest } = props;
|
|
35
|
-
const cls = useClasses('show-hide-eye', classes, className);
|
|
36
|
-
const transition = useMotionSafeTransition(motionTransition['spring-01-fast']);
|
|
37
|
-
const pupilShowTransition = useMotionSafeTransition({
|
|
38
|
-
delay: 0.05,
|
|
39
|
-
});
|
|
40
|
-
const pupilHideTransition = useMotionSafeTransition({
|
|
41
|
-
duration: 0.1,
|
|
42
|
-
});
|
|
43
|
-
const pupilVariants = {
|
|
44
|
-
show: {
|
|
45
|
-
ry: 3.75,
|
|
46
|
-
transition: pupilShowTransition,
|
|
47
|
-
},
|
|
48
|
-
hide: {
|
|
49
|
-
ry: 0,
|
|
50
|
-
transition: pupilHideTransition,
|
|
51
|
-
},
|
|
52
|
-
};
|
|
53
|
-
return (jsx(Icon, { ...rest, size: size, className: cls('root'), children: jsxs(motion.svg, { xmlns: "http://www.w3.org/2000/svg", viewBox: '0 0 20 20', animate: hide ? 'hide' : 'show', transition: transition, children: [jsx(motion.path, { initial: false, stroke: "currentColor", strokeWidth: 1.5, strokeMiterlimit: 1.5, strokeLinejoin: 'miter', strokeLinecap: 'butt', variants: topEyelidVariants, transition: transition, fill: "transparent" }), jsx(motion.path, { initial: false, stroke: "currentColor", strokeWidth: 1.5, strokeMiterlimit: 1.5, strokeLinejoin: 'miter', strokeLinecap: 'butt', variants: bottomEyelidVariants, transition: transition, fill: "transparent" }), jsx(motion.ellipse, { initial: false, cx: 10, cy: 10.5, rx: 3.75, fill: "currentColor", variants: pupilVariants }), jsx(motion.path, { initial: false, stroke: "currentColor", strokeWidth: 1.5, strokeMiterlimit: 1.5, strokeLinejoin: 'miter', strokeLinecap: 'butt', variants: eyelashVariants, transition: transition, fill: "transparent" })] }) }));
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
export { ShowHideEye as S };
|
package/chunks/SlideIn.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { motion } from 'framer-motion';
|
|
3
|
-
import { u as usePrefersReducedMotion } from './usePrefersReducedMotion.js';
|
|
4
|
-
import '@ringcentral/spring-theme';
|
|
5
|
-
import { g as getSlideIn } from './getSlideIn.js';
|
|
6
|
-
|
|
7
|
-
const SlideIn = (props) => {
|
|
8
|
-
const { toggle, toggleOnTransition, toggleOffTransition, transition, children, from = 'right', ...rest } = props;
|
|
9
|
-
const prefersReducedMotion = usePrefersReducedMotion();
|
|
10
|
-
return (jsx(motion.div, { ...getSlideIn({
|
|
11
|
-
toggle,
|
|
12
|
-
from,
|
|
13
|
-
prefersReducedMotion,
|
|
14
|
-
toggleOnTransition,
|
|
15
|
-
toggleOffTransition,
|
|
16
|
-
transition,
|
|
17
|
-
}), ...rest, children: children }));
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
export { SlideIn as S };
|
package/chunks/SortableArrow.js
DELETED
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
-
import { useClasses } from '@ringcentral/spring-base';
|
|
3
|
-
import { motion } from 'framer-motion';
|
|
4
|
-
import { motionTransition } from '@ringcentral/spring-theme';
|
|
5
|
-
import { I as Icon } from './Icon.js';
|
|
6
|
-
import 'react';
|
|
7
|
-
import { u as useMotionSafeTransition } from './useMotionSafeTransition.js';
|
|
8
|
-
|
|
9
|
-
const topCaretVariants = {
|
|
10
|
-
initial: {
|
|
11
|
-
d: 'M 5 7.5 L 10 2.5 L 15 7.5',
|
|
12
|
-
opacity: 1,
|
|
13
|
-
},
|
|
14
|
-
asc: {
|
|
15
|
-
d: 'M 4.75 9.5 L 10 4 L 15.25 9.5',
|
|
16
|
-
opacity: 1,
|
|
17
|
-
},
|
|
18
|
-
desc: {
|
|
19
|
-
d: 'M 10 9.5 L 10 4.5 L 10 9.5',
|
|
20
|
-
opacity: 0,
|
|
21
|
-
transition: {
|
|
22
|
-
ease: 'easeOut',
|
|
23
|
-
duration: 0.15,
|
|
24
|
-
},
|
|
25
|
-
},
|
|
26
|
-
};
|
|
27
|
-
const topLineVariants = {
|
|
28
|
-
initial: {
|
|
29
|
-
d: 'M 10 2.5 L 10 2.5',
|
|
30
|
-
opacity: 0,
|
|
31
|
-
},
|
|
32
|
-
asc: {
|
|
33
|
-
d: 'M 10 4.5 L 10 15.5',
|
|
34
|
-
opacity: 1,
|
|
35
|
-
},
|
|
36
|
-
};
|
|
37
|
-
const bottomLineVariants = {
|
|
38
|
-
initial: {
|
|
39
|
-
d: 'M 10 17.5 L 10 17.5',
|
|
40
|
-
opacity: 0,
|
|
41
|
-
},
|
|
42
|
-
desc: {
|
|
43
|
-
d: 'M 10 15.5 L 10 4.5',
|
|
44
|
-
opacity: 1,
|
|
45
|
-
},
|
|
46
|
-
};
|
|
47
|
-
const bottomCaretVariants = {
|
|
48
|
-
initial: {
|
|
49
|
-
d: 'M 5 12.5 L 10 17.5 L 15 12.5',
|
|
50
|
-
opacity: 1,
|
|
51
|
-
},
|
|
52
|
-
asc: {
|
|
53
|
-
d: 'M 10 10.5 L 10 15.5 L 10 10.5',
|
|
54
|
-
opacity: 0,
|
|
55
|
-
transition: {
|
|
56
|
-
ease: 'easeOut',
|
|
57
|
-
duration: 0.15,
|
|
58
|
-
},
|
|
59
|
-
},
|
|
60
|
-
desc: {
|
|
61
|
-
d: 'M 4.75 10.5 L 10 16 L 15.25 10.5',
|
|
62
|
-
opacity: 1,
|
|
63
|
-
},
|
|
64
|
-
};
|
|
65
|
-
const SortableArrow = (props) => {
|
|
66
|
-
const { classes, size = 'medium', direction = false, className, ...rest } = props;
|
|
67
|
-
const cls = useClasses('sortable-arrow', classes, className);
|
|
68
|
-
const caretTransition = useMotionSafeTransition(motionTransition['spring-01-fast']);
|
|
69
|
-
const lineTransition = useMotionSafeTransition(motionTransition['neutral-01-fast']);
|
|
70
|
-
return (jsx(Icon, { ...rest, size: size, className: cls('root'), children: jsxs(motion.svg, { xmlns: "http://www.w3.org/2000/svg", viewBox: '0 0 20 20', animate: direction || 'initial', children: [jsx(motion.path, { initial: false, stroke: "currentColor", strokeWidth: 1.5, strokeMiterlimit: 1.5, strokeLinejoin: 'miter', variants: topCaretVariants, transition: caretTransition, fill: "transparent" }), direction !== 'desc' && (jsx(motion.path, { initial: false, stroke: "currentColor", strokeWidth: 1.5, strokeLinecap: 'square', variants: topLineVariants, transition: lineTransition, fill: "transparent" })), direction !== 'asc' && (jsx(motion.path, { initial: false, stroke: "currentColor", strokeWidth: 1.5, strokeLinecap: 'square', variants: bottomLineVariants, transition: lineTransition, fill: "transparent" })), jsx(motion.path, { initial: false, stroke: "currentColor", strokeWidth: 1.5, strokeMiterlimit: 1.5, strokeLinejoin: 'miter', variants: bottomCaretVariants, transition: caretTransition, fill: "transparent" })] }) }));
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
export { SortableArrow as S };
|
package/chunks/Squircle.js
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
-
import React, { forwardRef, isValidElement, cloneElement } from 'react';
|
|
3
|
-
import { useClasses, useId } from '@ringcentral/spring-base';
|
|
4
|
-
import { useThemeProps } from '@ringcentral/spring-theme';
|
|
5
|
-
|
|
6
|
-
const SQUIRCLE_PATH = 'M 0.5 0 C 0.879 0 1 0.121 1 0.5 C 1 0.879 0.879 1 0.5 1 C 0.121 1 0 0.879 0 0.5 C 0 0.121 0.121 0 0.5 0 Z';
|
|
7
|
-
const Squircle = forwardRef((inProps, ref) => {
|
|
8
|
-
const props = useThemeProps({ props: inProps, name: 'Squircle' });
|
|
9
|
-
const { component = 'div', focusVisible, active, children: childrenProp, className, classes, interactive = true, fillShape: fillShapeProp = false, ...rest } = props;
|
|
10
|
-
const children = React.Children.toArray(childrenProp);
|
|
11
|
-
const firstChild = children[0];
|
|
12
|
-
const fillShape = fillShapeProp &&
|
|
13
|
-
firstChild &&
|
|
14
|
-
isValidElement(firstChild);
|
|
15
|
-
const cls = useClasses('squircle', classes, className);
|
|
16
|
-
const clipId = useId('sui-squircle-clip', true);
|
|
17
|
-
const showFocusRing = interactive && focusVisible;
|
|
18
|
-
const Root = component;
|
|
19
|
-
return (jsxs(Root, { className: cls('root', { active, interactive }), ...rest, ref: ref, children: [jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "0", height: "0", viewBox: "0 0 1 1", style: { position: 'absolute' }, "aria-hidden": true, children: jsx("defs", { children: jsx("clipPath", { id: clipId, clipPathUnits: "objectBoundingBox", children: jsx("path", { d: SQUIRCLE_PATH }) }) }) }), !fillShape && (jsx("svg", { className: cls('content'), xmlns: "http://www.w3.org/2000/svg", viewBox: '0 0 1 1', children: jsx("path", { clipPath: `url(#${clipId})`, d: SQUIRCLE_PATH, vectorEffect: "non-scaling-stroke" }) })), showFocusRing && (jsx("svg", { className: cls('ring'), xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1 1", overflow: "visible", children: jsx("path", { d: SQUIRCLE_PATH, fillOpacity: 0, vectorEffect: "non-scaling-stroke" }) })), fillShape
|
|
20
|
-
? cloneElement(firstChild, {
|
|
21
|
-
style: {
|
|
22
|
-
...firstChild.props.style,
|
|
23
|
-
width: '100%',
|
|
24
|
-
height: '100%',
|
|
25
|
-
clipPath: `url(#${clipId})`,
|
|
26
|
-
},
|
|
27
|
-
})
|
|
28
|
-
: children] }));
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
export { Squircle as S };
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { useClasses } from '@ringcentral/spring-base';
|
|
3
|
-
import { MinusBoldMd, CheckBoldSm } from '@ringcentral/spring-icon';
|
|
4
|
-
import { useThemeProps } from '@ringcentral/spring-theme';
|
|
5
|
-
import { I as Icon } from './Icon.js';
|
|
6
|
-
|
|
7
|
-
const IconSizeMap = {
|
|
8
|
-
large: 'small',
|
|
9
|
-
medium: 'xsmall',
|
|
10
|
-
small: 'xsmall',
|
|
11
|
-
};
|
|
12
|
-
const StatusIndicator = (inProps) => {
|
|
13
|
-
const props = useThemeProps({ props: inProps, name: 'StatusIndicator' });
|
|
14
|
-
const { classes, className, size = 'medium', variant = 'available', ...rest } = props;
|
|
15
|
-
const cls = useClasses('status-indicator', classes, className);
|
|
16
|
-
return (jsxs("div", { className: cls('root', size, variant), ...rest, children: [variant === 'dnd' && (jsx(Icon, { symbol: MinusBoldMd, size: IconSizeMap[size] })), variant === 'available' && (jsx(Icon, { symbol: CheckBoldSm, size: IconSizeMap[size] }))] }));
|
|
17
|
-
};
|
|
18
|
-
StatusIndicator.displayName = 'SuiStatusIndicator';
|
|
19
|
-
|
|
20
|
-
export { StatusIndicator as S };
|
package/chunks/StepConnector.js
DELETED
|
@@ -1,21 +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
|
-
import { b as useStepperContext, u as useStepContext } from './StepperContext.js';
|
|
6
|
-
|
|
7
|
-
const StepConnector = forwardRef((inProps, ref) => {
|
|
8
|
-
const props = useThemeProps({ props: inProps, name: 'StepConnector' });
|
|
9
|
-
const { classes, className, children, ...rest } = props;
|
|
10
|
-
const cls = useClasses('step-connector', classes, className);
|
|
11
|
-
const { orientation = 'horizontal' } = useStepperContext();
|
|
12
|
-
const { active, disabled, completed } = useStepContext();
|
|
13
|
-
return (jsx("div", { "aria-hidden": true, className: cls('root', orientation, {
|
|
14
|
-
active,
|
|
15
|
-
completed,
|
|
16
|
-
disabled,
|
|
17
|
-
}), ...rest, ref: ref, children: jsx("span", { className: cls('line', `line-${orientation}`) }) }));
|
|
18
|
-
});
|
|
19
|
-
StepConnector.displayName = 'SuiStepConnector';
|
|
20
|
-
|
|
21
|
-
export { StepConnector as S };
|
package/chunks/StepIcon.js
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { forwardRef } from 'react';
|
|
3
|
-
import { useClasses } from '@ringcentral/spring-base';
|
|
4
|
-
import { AlertFilledMd, AlertMd, CheckBoldMd, CheckMd } from '@ringcentral/spring-icon';
|
|
5
|
-
import { useThemeProps } from '@ringcentral/spring-theme';
|
|
6
|
-
import { I as Icon } from './Icon.js';
|
|
7
|
-
|
|
8
|
-
const StepIcon = forwardRef((inProps, ref) => {
|
|
9
|
-
const props = useThemeProps({ props: inProps, name: 'StepIcon' });
|
|
10
|
-
const { classes, className, children, active = false, completed = false, error = false, disabled = false, variant = 'contained', icon, symbol, ...rest } = props;
|
|
11
|
-
const cls = useClasses('step-icon', classes, className);
|
|
12
|
-
if (symbol) {
|
|
13
|
-
return (jsx("span", { className: cls('root', variant, error && `${variant}-error`, active && `${variant}-current`, {
|
|
14
|
-
current: active,
|
|
15
|
-
completed,
|
|
16
|
-
error,
|
|
17
|
-
disabled,
|
|
18
|
-
}), ...rest, ref: ref, children: jsx(Icon, { className: cls('icon'), size: "xsmall", symbol: symbol }) }));
|
|
19
|
-
}
|
|
20
|
-
if (typeof icon === 'number' || typeof icon === 'string') {
|
|
21
|
-
let content;
|
|
22
|
-
if (error) {
|
|
23
|
-
content = (jsx(Icon, { className: cls('icon'), size: "large", symbol: variant === 'contained' ? AlertFilledMd : AlertMd }));
|
|
24
|
-
}
|
|
25
|
-
else if (completed) {
|
|
26
|
-
content =
|
|
27
|
-
variant === 'contained' ? (jsx(Icon, { className: cls('icon'), size: "xsmall", symbol: CheckBoldMd })) : (jsx(Icon, { className: cls('icon'), size: "large", symbol: CheckMd }));
|
|
28
|
-
}
|
|
29
|
-
else {
|
|
30
|
-
content = (jsx("span", { className: cls('text', active && 'text-current'), children: icon }));
|
|
31
|
-
}
|
|
32
|
-
return (jsx("span", { className: cls('root', variant, error && `${variant}-error`, active && `${variant}-current`, {
|
|
33
|
-
current: active,
|
|
34
|
-
completed,
|
|
35
|
-
error,
|
|
36
|
-
disabled,
|
|
37
|
-
}), ...rest, ref: ref, children: content }));
|
|
38
|
-
}
|
|
39
|
-
return icon;
|
|
40
|
-
});
|
|
41
|
-
StepIcon.displayName = 'SuiStepIcon';
|
|
42
|
-
|
|
43
|
-
export { StepIcon as S };
|
package/chunks/StepLabel.js
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { jsxs, 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
|
-
import clsx from 'clsx';
|
|
6
|
-
import { b as useStepperContext, u as useStepContext } from './StepperContext.js';
|
|
7
|
-
import { S as StepIcon } from './StepIcon.js';
|
|
8
|
-
|
|
9
|
-
const StepLabel = forwardRef((inProps, ref) => {
|
|
10
|
-
const props = useThemeProps({ props: inProps, name: 'StepLabel' });
|
|
11
|
-
const { classes, className, children, error = false, icon: iconProp, optional, labelProps = {}, StepIconComponent: StepIconComponentProp, StepIconProps, ...rest } = props;
|
|
12
|
-
const cls = useClasses('step-label', classes, className);
|
|
13
|
-
const { orientation = 'horizontal' } = useStepperContext();
|
|
14
|
-
const { active, disabled, completed, icon: iconContext, id, connector, index, last, variant, } = useStepContext();
|
|
15
|
-
const icon = iconProp || iconContext;
|
|
16
|
-
let StepIconComponent = StepIconComponentProp;
|
|
17
|
-
if (icon && !StepIconComponent) {
|
|
18
|
-
StepIconComponent = StepIcon;
|
|
19
|
-
}
|
|
20
|
-
return (jsxs("span", { id: id, className: cls('root', orientation, {
|
|
21
|
-
current: active,
|
|
22
|
-
completed,
|
|
23
|
-
disabled,
|
|
24
|
-
error,
|
|
25
|
-
}), ...rest, ref: ref, children: [index !== 0 ? connector : null, StepIconComponent ? (jsx("span", { className: cls('icon-container', `${orientation}-icon-container`), children: jsx(StepIconComponent, { completed: completed, active: active, error: error, disabled: disabled, icon: icon, variant: variant, ...StepIconProps }) })) : null, jsxs("span", { className: cls('label-container', `${orientation}-label-container`, error && 'error-label-container', { disabled }), children: [children ? (jsx("span", { ...labelProps, className: clsx(cls('label', `${orientation}-label`, active && 'current-label', error && 'error-label', { disabled, completed }), labelProps?.className), children: children })) : null, optional] }), !last ? connector : null] }));
|
|
26
|
-
});
|
|
27
|
-
StepLabel.displayName = 'SuiStepLabel';
|
|
28
|
-
|
|
29
|
-
export { StepLabel as S };
|
package/chunks/StepperContext.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { createContext, useContext } from 'react';
|
|
2
|
-
|
|
3
|
-
const StepContext = createContext({});
|
|
4
|
-
const useStepContext = () => useContext(StepContext);
|
|
5
|
-
|
|
6
|
-
const StepperContext = createContext({});
|
|
7
|
-
const useStepperContext = () => useContext(StepperContext);
|
|
8
|
-
|
|
9
|
-
export { StepContext as S, StepperContext as a, useStepperContext as b, useStepContext as u };
|
package/chunks/TableContext.js
DELETED
package/chunks/TabsContext.js
DELETED
package/chunks/TextField.js
DELETED
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { forwardRef, useRef } from 'react';
|
|
3
|
-
import { useInput } from '@mui/base';
|
|
4
|
-
import { useId, useClasses, useControlled, useEventCallback, combineProps, useForkRef } from '@ringcentral/spring-base';
|
|
5
|
-
import { Xmd } from '@ringcentral/spring-icon';
|
|
6
|
-
import { useThemeProps } from '@ringcentral/spring-theme';
|
|
7
|
-
import 'framer-motion';
|
|
8
|
-
import './Icon.js';
|
|
9
|
-
import { S as ShowHideEye } from './ShowHideEye.js';
|
|
10
|
-
import { u as useHelperTextId, F as FormField } from './useHelperTextId.js';
|
|
11
|
-
import { I as IconButton } from './IconButtonLabel.js';
|
|
12
|
-
|
|
13
|
-
const TextFieldComponent = (inProps, ref) => {
|
|
14
|
-
const props = useThemeProps({ props: inProps, name: 'TextField' });
|
|
15
|
-
const { classes, className, clearBtn = true, clearText = 'clear', showCharacterCount = false, useNativeClearBtn = false, size, endAdornment, fullWidth, helperText: helperTextProp, inputProps, label, onClear, placeholder: placeholderProp, RootProps, startAdornment, type, variant = 'outlined', inputComponent: InputComponent = 'input', autoFocus, ClearButtonProps, id: idProp, onKeyDown, onKeyUp, readOnly, onClick, focused, FormHelperTextProps, showMaskValueToggleButton = type === 'password', maskValue: maskValueProps, MaskValueButtonProps, ShowHideEyeIconProps, } = props;
|
|
16
|
-
const placeholder = placeholderProp || ' ';
|
|
17
|
-
const defaultId = useId();
|
|
18
|
-
const id = idProp ?? inputProps?.id ?? defaultId;
|
|
19
|
-
const cls = useClasses('text-field', classes, className);
|
|
20
|
-
const { disabled, required, error, getInputProps } = useInput(props);
|
|
21
|
-
const states = { disabled, required, error, focused };
|
|
22
|
-
const idForHelperText = useHelperTextId({
|
|
23
|
-
helperText: helperTextProp,
|
|
24
|
-
id,
|
|
25
|
-
FormHelperTextProps,
|
|
26
|
-
});
|
|
27
|
-
const widgetProps = getInputProps({
|
|
28
|
-
'aria-describedby': idForHelperText,
|
|
29
|
-
...inputProps,
|
|
30
|
-
placeholder,
|
|
31
|
-
id,
|
|
32
|
-
type,
|
|
33
|
-
});
|
|
34
|
-
const inputRef = useRef();
|
|
35
|
-
const handlerClear = (e) => {
|
|
36
|
-
if (disabled)
|
|
37
|
-
return;
|
|
38
|
-
const el = inputRef.current;
|
|
39
|
-
if (el) {
|
|
40
|
-
onClear?.(e);
|
|
41
|
-
const host = Object.getPrototypeOf(el);
|
|
42
|
-
Object.getOwnPropertyDescriptor(host, 'value')?.set?.call(el, '');
|
|
43
|
-
el.focus();
|
|
44
|
-
el.dispatchEvent(new InputEvent('input', { bubbles: true }));
|
|
45
|
-
}
|
|
46
|
-
};
|
|
47
|
-
let helperText = helperTextProp;
|
|
48
|
-
if (showCharacterCount &&
|
|
49
|
-
inputProps?.maxLength !== undefined &&
|
|
50
|
-
props.value !== undefined) {
|
|
51
|
-
helperText = (jsxs("div", { className: cls('helper-text'), children: [jsx("span", { children: helperText }), jsxs("span", { children: [props.value?.length ?? 0, "/", inputProps.maxLength] })] }));
|
|
52
|
-
}
|
|
53
|
-
const [maskValue, setMaskValue] = useControlled({
|
|
54
|
-
controlled: maskValueProps,
|
|
55
|
-
default: false,
|
|
56
|
-
name: 'TextField',
|
|
57
|
-
state: 'showPassword',
|
|
58
|
-
});
|
|
59
|
-
let inputType = type;
|
|
60
|
-
const shouldShowMaskToggleButton = showMaskValueToggleButton && type === 'password';
|
|
61
|
-
const isSearchInput = type === 'search';
|
|
62
|
-
const shouldHideNativeClear = isSearchInput && !useNativeClearBtn;
|
|
63
|
-
if (shouldShowMaskToggleButton) {
|
|
64
|
-
if (maskValue) {
|
|
65
|
-
inputType = 'text';
|
|
66
|
-
}
|
|
67
|
-
else {
|
|
68
|
-
inputType = 'password';
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
const handleMaskValueChange = useEventCallback(() => {
|
|
72
|
-
setMaskValue(!maskValue);
|
|
73
|
-
if (props.onMaskValueChange) {
|
|
74
|
-
props.onMaskValueChange(!maskValue);
|
|
75
|
-
}
|
|
76
|
-
});
|
|
77
|
-
return (jsxs(FormField, { ...combineProps({
|
|
78
|
-
classes: {
|
|
79
|
-
root: cls('root', {
|
|
80
|
-
'full-width': fullWidth,
|
|
81
|
-
'hide-native-clear': shouldHideNativeClear,
|
|
82
|
-
}),
|
|
83
|
-
content: cls('form-field-content'),
|
|
84
|
-
outlined: cls('outlined'),
|
|
85
|
-
standard: cls('standard'),
|
|
86
|
-
quiet: cls('quiet'),
|
|
87
|
-
},
|
|
88
|
-
contentProps: {
|
|
89
|
-
onClick: (e) => {
|
|
90
|
-
onClick?.(e);
|
|
91
|
-
if (e.target === e.currentTarget && !disabled) {
|
|
92
|
-
inputRef.current?.focus();
|
|
93
|
-
}
|
|
94
|
-
},
|
|
95
|
-
},
|
|
96
|
-
}, RootProps), ...states, htmlFor: id, label: label, ref: ref, helperText: helperText, variant: variant, size: size, FormHelperTextProps: { id: idForHelperText, ...FormHelperTextProps }, children: [startAdornment && (jsx("div", { className: cls('start-adornment'), children: startAdornment })), jsx(InputComponent, { readOnly: readOnly, autoComplete: "off", autoFocus: autoFocus, onKeyDown: onKeyDown, onKeyUp: onKeyUp, ...widgetProps, className: cls('input'), ref: useForkRef(widgetProps.ref, inputRef), type: inputType }), clearBtn && (jsx(IconButton, { symbol: Xmd, shape: 'squircle', background: false, color: 'secondary', variant: "contained", size: "small", title: clearText, "aria-label": clearText, disabled: disabled, ...combineProps({
|
|
97
|
-
className: cls('clear'),
|
|
98
|
-
onClick: handlerClear,
|
|
99
|
-
}, ClearButtonProps) })), shouldShowMaskToggleButton && (jsx(IconButton, { disabled: disabled, shape: 'squircle', background: false, color: 'neutral', variant: "icon", size: "small", ...combineProps({
|
|
100
|
-
className: cls('mask-value-button'),
|
|
101
|
-
onClick: handleMaskValueChange,
|
|
102
|
-
'aria-label': maskValue ? 'eye-visible' : 'eye',
|
|
103
|
-
}, MaskValueButtonProps), children: jsx(ShowHideEye, { hide: !maskValue, size: ShowHideEyeIconProps?.size ??
|
|
104
|
-
MaskValueButtonProps?.iconSize ??
|
|
105
|
-
'small', ...ShowHideEyeIconProps }) })), endAdornment && (jsx("div", { className: cls('end-adornment'), children: endAdornment }))] }));
|
|
106
|
-
};
|
|
107
|
-
const TextField = forwardRef(TextFieldComponent);
|
|
108
|
-
TextField.displayName = 'SuiTextField';
|
|
109
|
-
|
|
110
|
-
export { TextField as T };
|