@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/StepContent.js
CHANGED
|
@@ -1,30 +1,46 @@
|
|
|
1
|
-
import { jsx, jsxs } from
|
|
2
|
-
import { forwardRef } from
|
|
3
|
-
import { AnimatePresence, motion } from
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
import { AnimatePresence, motion } from "framer-motion";
|
|
4
|
+
import { logInDev, useClasses, useEver } from "@ringcentral/spring-base";
|
|
5
|
+
import { motionTransition, useThemeProps } from "@ringcentral/spring-theme";
|
|
6
|
+
import "./chunks/4476.js";
|
|
7
|
+
import { useStepContext, useStepperContext } from "./chunks/2956.js";
|
|
8
|
+
import { useMotionSafeTransition } from "./chunks/1294.js";
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
// extracted by css-extract-rspack-plugin
|
|
16
|
+
/* export default */ var StepContent = ({"sui-step-content-root":"sui-step-content-root","sui-step-content-wrapper":"sui-step-content-wrapper","sui-step-connector-root":"sui-step-connector-root","sui-step-content-last":"sui-step-content-last"});
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
const StepContent_StepContent = /*#__PURE__*/ forwardRef((inProps, ref)=>{
|
|
27
|
+
const props = useThemeProps({
|
|
28
|
+
props: inProps,
|
|
29
|
+
name: 'StepContent'
|
|
30
|
+
});
|
|
15
31
|
const { classes, className, children, keepMounted, ...rest } = props;
|
|
16
32
|
const cls = useClasses('step-content', classes, className);
|
|
17
33
|
const { orientation } = useStepperContext();
|
|
18
|
-
const { disabled, active, last, expanded: expandedProp, connector, id
|
|
19
|
-
const transition = useMotionSafeTransition(motionTransition[
|
|
34
|
+
const { disabled, active, last, expanded: expandedProp, connector, id } = useStepContext();
|
|
35
|
+
const transition = useMotionSafeTransition(motionTransition["haste-01-fast"]);
|
|
20
36
|
if (process.env.NODE_ENV !== 'production' && orientation !== 'vertical') {
|
|
21
37
|
logInDev({
|
|
22
|
-
scope: '
|
|
38
|
+
scope: 'StepContent',
|
|
23
39
|
level: 'error',
|
|
24
|
-
message: '<StepContent /> is only designed for use with the vertical stepper.'
|
|
40
|
+
message: '<StepContent /> is only designed for use with the vertical stepper.'
|
|
25
41
|
});
|
|
26
42
|
}
|
|
27
|
-
const expanded = expandedProp ||
|
|
43
|
+
const expanded = expandedProp || active && !disabled;
|
|
28
44
|
const isEverShown = useEver(expanded);
|
|
29
45
|
const keepAlive = keepMounted && isEverShown;
|
|
30
46
|
const motionVariants = {
|
|
@@ -32,17 +48,44 @@ const StepContent = forwardRef((inProps, ref) => {
|
|
|
32
48
|
transition,
|
|
33
49
|
opacity: 1,
|
|
34
50
|
height: 'auto',
|
|
35
|
-
paddingTop: 12
|
|
51
|
+
paddingTop: 12
|
|
36
52
|
},
|
|
37
53
|
collapsed: {
|
|
38
54
|
transition,
|
|
39
55
|
opacity: 0,
|
|
40
56
|
height: 0,
|
|
41
|
-
paddingTop: 0
|
|
42
|
-
}
|
|
57
|
+
paddingTop: 0
|
|
58
|
+
}
|
|
43
59
|
};
|
|
44
|
-
return
|
|
60
|
+
return /*#__PURE__*/ jsx("div", {
|
|
61
|
+
className: cls('root', {
|
|
62
|
+
expanded,
|
|
63
|
+
last
|
|
64
|
+
}),
|
|
65
|
+
...rest,
|
|
66
|
+
ref: ref,
|
|
67
|
+
children: /*#__PURE__*/ jsx(AnimatePresence, {
|
|
68
|
+
initial: false,
|
|
69
|
+
children: (expanded || keepAlive) && /*#__PURE__*/ jsxs(motion.div, {
|
|
70
|
+
className: cls('wrapper'),
|
|
71
|
+
"aria-labelledby": id,
|
|
72
|
+
initial: "collapsed",
|
|
73
|
+
animate: expanded ? 'expanded' : 'collapsed',
|
|
74
|
+
exit: "collapsed",
|
|
75
|
+
variants: motionVariants,
|
|
76
|
+
children: [
|
|
77
|
+
children,
|
|
78
|
+
connector
|
|
79
|
+
]
|
|
80
|
+
})
|
|
81
|
+
})
|
|
82
|
+
});
|
|
45
83
|
});
|
|
46
|
-
|
|
84
|
+
StepContent_StepContent.displayName = 'SuiStepContent';
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
|
|
47
90
|
|
|
48
|
-
export { StepContent,
|
|
91
|
+
export { StepContent as stepContentStyle, StepContent_StepContent as StepContent };
|
package/StepIcon.js
CHANGED
|
@@ -1,11 +1,92 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import './chunks/Icon.js';
|
|
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 { Icon as Icon_Icon } from "./chunks/8307.js";
|
|
8
7
|
|
|
9
|
-
var StepIcon = {"sui-step-icon-root":"sui-step-icon-root","sui-completed":"sui-completed","sui-step-icon-current":"sui-step-icon-current","sui-disabled":"sui-disabled","sui-step-icon-error":"sui-step-icon-error","sui-step-icon-outlined":"sui-step-icon-outlined","sui-step-icon-outlined-current":"sui-step-icon-outlined-current","sui-step-icon-outlined-error":"sui-step-icon-outlined-error","sui-step-icon-text":"sui-step-icon-text","sui-step-icon-text-current":"sui-step-icon-text-current"};
|
|
10
8
|
|
|
11
|
-
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
// extracted by css-extract-rspack-plugin
|
|
14
|
+
/* export default */ var StepIcon = ({"sui-step-icon-root":"sui-step-icon-root","sui-completed":"sui-completed","sui-step-icon-current":"sui-step-icon-current","sui-disabled":"sui-disabled","sui-step-icon-error":"sui-step-icon-error","sui-step-icon-outlined":"sui-step-icon-outlined","sui-step-icon-outlined-current":"sui-step-icon-outlined-current","sui-step-icon-outlined-error":"sui-step-icon-outlined-error","sui-step-icon-text":"sui-step-icon-text","sui-step-icon-text-current":"sui-step-icon-text-current"});
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
const StepIcon_StepIcon = /*#__PURE__*/ forwardRef(// @ts-ignore
|
|
23
|
+
(inProps, ref)=>{
|
|
24
|
+
const props = useThemeProps({
|
|
25
|
+
props: inProps,
|
|
26
|
+
name: 'StepIcon'
|
|
27
|
+
});
|
|
28
|
+
const { classes, className, children, active = false, completed = false, error = false, disabled = false, variant = 'contained', icon, symbol, ...rest } = props;
|
|
29
|
+
const cls = useClasses('step-icon', classes, className);
|
|
30
|
+
if (symbol) {
|
|
31
|
+
return /*#__PURE__*/ jsx("span", {
|
|
32
|
+
className: cls('root', variant, error && `${variant}-error`, active && `${variant}-current`, {
|
|
33
|
+
current: active,
|
|
34
|
+
completed,
|
|
35
|
+
error,
|
|
36
|
+
disabled
|
|
37
|
+
}),
|
|
38
|
+
...rest,
|
|
39
|
+
ref: ref,
|
|
40
|
+
children: /*#__PURE__*/ jsx(Icon_Icon, {
|
|
41
|
+
className: cls('icon'),
|
|
42
|
+
size: "xsmall",
|
|
43
|
+
symbol: symbol
|
|
44
|
+
})
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
if (typeof icon === 'number' || typeof icon === 'string') {
|
|
48
|
+
let content;
|
|
49
|
+
if (error) {
|
|
50
|
+
content = /*#__PURE__*/ jsx(Icon_Icon, {
|
|
51
|
+
className: cls('icon'),
|
|
52
|
+
size: "large",
|
|
53
|
+
symbol: variant === 'contained' ? AlertFilledMd : AlertMd
|
|
54
|
+
});
|
|
55
|
+
} else if (completed) {
|
|
56
|
+
content = variant === 'contained' ? /*#__PURE__*/ jsx(Icon_Icon, {
|
|
57
|
+
className: cls('icon'),
|
|
58
|
+
size: "xsmall",
|
|
59
|
+
symbol: CheckBoldMd
|
|
60
|
+
}) : /*#__PURE__*/ jsx(Icon_Icon, {
|
|
61
|
+
className: cls('icon'),
|
|
62
|
+
size: "large",
|
|
63
|
+
symbol: CheckMd
|
|
64
|
+
});
|
|
65
|
+
} else {
|
|
66
|
+
content = /*#__PURE__*/ jsx("span", {
|
|
67
|
+
className: cls('text', active && 'text-current'),
|
|
68
|
+
children: icon
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
return /*#__PURE__*/ jsx("span", {
|
|
72
|
+
className: cls('root', variant, error && `${variant}-error`, active && `${variant}-current`, {
|
|
73
|
+
current: active,
|
|
74
|
+
completed,
|
|
75
|
+
error,
|
|
76
|
+
disabled
|
|
77
|
+
}),
|
|
78
|
+
...rest,
|
|
79
|
+
ref: ref,
|
|
80
|
+
children: content
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
return icon;
|
|
84
|
+
});
|
|
85
|
+
StepIcon_StepIcon.displayName = 'SuiStepIcon';
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
export { StepIcon as stepIconStyle, StepIcon_StepIcon as StepIcon };
|
package/StepLabel.js
CHANGED
|
@@ -1,14 +1,90 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
1
|
+
import { 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 clsx from "clsx";
|
|
6
|
+
import { useStepContext, useStepperContext } from "./chunks/2956.js";
|
|
7
|
+
import { StepIcon as StepIcon_StepIcon } from "./StepIcon.js";
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
// extracted by css-extract-rspack-plugin
|
|
15
|
+
/* export default */ var StepLabel = ({"sui-step-label-root":"sui-step-label-root","sui-step-label-label":"sui-step-label-label","sui-completed":"sui-completed","sui-disabled":"sui-disabled","sui-step-label-icon-container":"sui-step-label-icon-container","sui-step-label-label-container":"sui-step-label-label-container","sui-step-label-horizontal":"sui-step-label-horizontal","sui-step-label-horizontal-label":"sui-step-label-horizontal-label","sui-step-label-horizontal-label-container":"sui-step-label-horizontal-label-container","sui-step-label-vertical":"sui-step-label-vertical","sui-step-label-vertical-icon-container":"sui-step-label-vertical-icon-container","sui-step-label-current-label":"sui-step-label-current-label","sui-step-label-error-label":"sui-step-label-error-label","sui-step-label-error-label-container":"sui-step-label-error-label-container","sui-step-label":"sui-step-label"});
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
const StepLabel_StepLabel = /*#__PURE__*/ forwardRef((inProps, ref)=>{
|
|
26
|
+
const props = useThemeProps({
|
|
27
|
+
props: inProps,
|
|
28
|
+
name: 'StepLabel'
|
|
29
|
+
});
|
|
30
|
+
const { classes, className, children, error = false, icon: iconProp, optional, labelProps = {}, StepIconComponent: StepIconComponentProp, StepIconProps, ...rest } = props;
|
|
31
|
+
const cls = useClasses('step-label', classes, className);
|
|
32
|
+
const { orientation = 'horizontal' } = useStepperContext();
|
|
33
|
+
const { active, disabled, completed, icon: iconContext, id, connector, index, last, variant } = useStepContext();
|
|
34
|
+
const icon = iconProp || iconContext;
|
|
35
|
+
let StepIconComponent = StepIconComponentProp;
|
|
36
|
+
if (icon && !StepIconComponent) {
|
|
37
|
+
StepIconComponent = StepIcon_StepIcon;
|
|
38
|
+
}
|
|
39
|
+
return /*#__PURE__*/ jsxs("span", {
|
|
40
|
+
id: id,
|
|
41
|
+
className: cls('root', orientation, {
|
|
42
|
+
current: active,
|
|
43
|
+
completed,
|
|
44
|
+
disabled,
|
|
45
|
+
error
|
|
46
|
+
}),
|
|
47
|
+
...rest,
|
|
48
|
+
ref: ref,
|
|
49
|
+
children: [
|
|
50
|
+
index !== 0 ? connector : null,
|
|
51
|
+
StepIconComponent ? /*#__PURE__*/ jsx("span", {
|
|
52
|
+
className: cls('icon-container', `${orientation}-icon-container`),
|
|
53
|
+
children: /*#__PURE__*/ jsx(StepIconComponent, {
|
|
54
|
+
completed: completed,
|
|
55
|
+
active: active,
|
|
56
|
+
error: error,
|
|
57
|
+
disabled: disabled,
|
|
58
|
+
icon: icon,
|
|
59
|
+
variant: variant,
|
|
60
|
+
...StepIconProps
|
|
61
|
+
})
|
|
62
|
+
}) : null,
|
|
63
|
+
/*#__PURE__*/ jsxs("span", {
|
|
64
|
+
className: cls('label-container', `${orientation}-label-container`, error && 'error-label-container', {
|
|
65
|
+
disabled
|
|
66
|
+
}),
|
|
67
|
+
children: [
|
|
68
|
+
children ? /*#__PURE__*/ jsx("span", {
|
|
69
|
+
...labelProps,
|
|
70
|
+
className: clsx(cls('label', `${orientation}-label`, active && 'current-label', error && 'error-label', {
|
|
71
|
+
disabled,
|
|
72
|
+
completed
|
|
73
|
+
}), labelProps?.className),
|
|
74
|
+
children: children
|
|
75
|
+
}) : null,
|
|
76
|
+
optional
|
|
77
|
+
]
|
|
78
|
+
}),
|
|
79
|
+
!last ? connector : null
|
|
80
|
+
]
|
|
81
|
+
});
|
|
82
|
+
});
|
|
83
|
+
StepLabel_StepLabel.displayName = 'SuiStepLabel';
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
export { StepLabel as stepLabelStyle, StepLabel_StepLabel as StepLabel };
|
package/Stepper.js
CHANGED
|
@@ -1,37 +1,79 @@
|
|
|
1
|
-
import { jsx } from
|
|
2
|
-
import {
|
|
3
|
-
import { useClasses } from
|
|
4
|
-
import { useThemeProps } from
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Children, cloneElement, forwardRef, useMemo } from "react";
|
|
3
|
+
import { useClasses } from "@ringcentral/spring-base";
|
|
4
|
+
import { useThemeProps } from "@ringcentral/spring-theme";
|
|
5
|
+
import { StepConnector as StepConnector_StepConnector } from "./StepConnector.js";
|
|
6
|
+
import { StepperContext } from "./chunks/2956.js";
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
// extracted by css-extract-rspack-plugin
|
|
13
|
+
/* export default */ var Stepper = ({"sui-stepper-root":"sui-stepper-root","sui-stepper-horizontal":"sui-stepper-horizontal","sui-stepper-vertical":"sui-stepper-vertical","sui-stepper-fixed-step-width":"sui-stepper-fixed-step-width"});
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
const defaultConnector = /*#__PURE__*/ jsx(StepConnector_StepConnector, {});
|
|
22
|
+
const Stepper_Stepper = /*#__PURE__*/ forwardRef((inProps, ref)=>{
|
|
23
|
+
const props = useThemeProps({
|
|
24
|
+
props: inProps,
|
|
25
|
+
name: 'Stepper'
|
|
26
|
+
});
|
|
14
27
|
const { component, classes, className, children, activeStep = 0, connector = defaultConnector, nonLinear = false, orientation = 'horizontal', fixedStepWidth = true, ...rest } = props;
|
|
15
28
|
const cls = useClasses('stepper', classes, className);
|
|
16
29
|
const defaultComponent = nonLinear ? 'ul' : 'ol';
|
|
17
|
-
const [StepperRoot = defaultComponent] = [
|
|
30
|
+
const [StepperRoot = defaultComponent] = [
|
|
31
|
+
component
|
|
32
|
+
];
|
|
18
33
|
const childrenArray = Children.toArray(children).filter(Boolean);
|
|
19
|
-
const steps = childrenArray.map((step, index)
|
|
34
|
+
const steps = childrenArray.map((step, index)=>{
|
|
20
35
|
if (typeof step === 'string') {
|
|
21
36
|
return step;
|
|
22
37
|
}
|
|
23
38
|
const stepElement = step;
|
|
24
|
-
return cloneElement(stepElement, {
|
|
39
|
+
return /*#__PURE__*/ cloneElement(stepElement, {
|
|
25
40
|
index,
|
|
26
41
|
last: index + 1 === childrenArray.length,
|
|
27
|
-
...stepElement.props
|
|
42
|
+
...stepElement.props
|
|
28
43
|
});
|
|
29
44
|
});
|
|
30
|
-
const contextValue = useMemo(()
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
45
|
+
const contextValue = useMemo(()=>({
|
|
46
|
+
activeStep,
|
|
47
|
+
connector,
|
|
48
|
+
nonLinear,
|
|
49
|
+
orientation,
|
|
50
|
+
fixedStepWidth
|
|
51
|
+
}), [
|
|
52
|
+
activeStep,
|
|
53
|
+
connector,
|
|
54
|
+
fixedStepWidth,
|
|
55
|
+
nonLinear,
|
|
56
|
+
orientation
|
|
57
|
+
]);
|
|
58
|
+
return /*#__PURE__*/ jsx(StepperContext.Provider, {
|
|
59
|
+
value: contextValue,
|
|
60
|
+
children: /*#__PURE__*/ jsx(StepperRoot, {
|
|
61
|
+
className: cls('root', orientation, {
|
|
62
|
+
'fixed-step-width': fixedStepWidth
|
|
63
|
+
}),
|
|
64
|
+
...rest,
|
|
65
|
+
ref: ref,
|
|
66
|
+
children: steps
|
|
67
|
+
})
|
|
68
|
+
});
|
|
34
69
|
});
|
|
35
|
-
|
|
70
|
+
Stepper_Stepper.displayName = 'SuiStepper';
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
|
|
36
77
|
|
|
37
|
-
export { Stepper
|
|
78
|
+
export { Stepper as stepperStyle, Stepper_Stepper as Stepper };
|
|
79
|
+
export { StepperContext, useStepperContext } from "./chunks/2956.js";
|