@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/FormField.js
CHANGED
|
@@ -1,10 +1,108 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
import clsx from "clsx";
|
|
4
|
+
import { useClasses } from "@ringcentral/spring-base";
|
|
5
|
+
import { useThemeProps } from "@ringcentral/spring-theme";
|
|
6
|
+
import { hasContent } from "./chunks/5047.js";
|
|
7
7
|
|
|
8
|
-
var FormField = {"sui-form-field-label":"sui-form-field-label","sui-form-field-helper-text":"sui-form-field-helper-text","sui-form-field-content":"sui-form-field-content","sui-form-field-container":"sui-form-field-container","sui-form-field-focus-effect":"sui-form-field-focus-effect","sui-form-field-outlined":"sui-form-field-outlined","sui-form-field-contained":"sui-form-field-contained","sui-form-field-outlined-label":"sui-form-field-outlined-label","sui-form-field-contained-label":"sui-form-field-contained-label","sui-form-field-outlined-xlarge":"sui-form-field-outlined-xlarge","sui-form-field-contained-xlarge":"sui-form-field-contained-xlarge","sui-form-field-outlined-large":"sui-form-field-outlined-large","sui-form-field-contained-large":"sui-form-field-contained-large","sui-form-field-outlined-medium":"sui-form-field-outlined-medium","sui-form-field-contained-medium":"sui-form-field-contained-medium","sui-form-field-outlined-content":"sui-form-field-outlined-content","sui-form-field-contained-content":"sui-form-field-contained-content","sui-disabled":"sui-disabled","sui-focused":"sui-focused","sui-form-field-standard-content":"sui-form-field-standard-content","sui-form-field-standard-focus-effect":"sui-form-field-standard-focus-effect","sui-form-field-standard":"sui-form-field-standard","sui-form-field-quiet-content":"sui-form-field-quiet-content","sui-form-field-xlarge-content":"sui-form-field-xlarge-content","sui-form-field-large-content":"sui-form-field-large-content","sui-form-field-medium-content":"sui-form-field-medium-content","sui-form-field-error-helper-text":"sui-form-field-error-helper-text","sui-form-field-error-label":"sui-form-field-error-label","sui-form-field-error-focus-effect":"sui-form-field-error-focus-effect","sui-form-field-error-content":"sui-form-field-error-content","sui-form-field-error-standard-content":"sui-form-field-error-standard-content","sui-form-field-error-contained-content":"sui-form-field-error-contained-content","sui-form-field":"sui-form-field"};
|
|
9
8
|
|
|
10
|
-
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
// extracted by css-extract-rspack-plugin
|
|
14
|
+
/* export default */ var FormField = ({"sui-form-field-label":"sui-form-field-label","sui-form-field-helper-text":"sui-form-field-helper-text","sui-form-field-content":"sui-form-field-content","sui-form-field-container":"sui-form-field-container","sui-form-field-focus-effect":"sui-form-field-focus-effect","sui-form-field-outlined":"sui-form-field-outlined","sui-form-field-contained":"sui-form-field-contained","sui-form-field-outlined-label":"sui-form-field-outlined-label","sui-form-field-contained-label":"sui-form-field-contained-label","sui-form-field-outlined-xlarge":"sui-form-field-outlined-xlarge","sui-form-field-contained-xlarge":"sui-form-field-contained-xlarge","sui-form-field-outlined-large":"sui-form-field-outlined-large","sui-form-field-contained-large":"sui-form-field-contained-large","sui-form-field-outlined-medium":"sui-form-field-outlined-medium","sui-form-field-contained-medium":"sui-form-field-contained-medium","sui-form-field-outlined-content":"sui-form-field-outlined-content","sui-form-field-contained-content":"sui-form-field-contained-content","sui-disabled":"sui-disabled","sui-focused":"sui-focused","sui-form-field-standard-content":"sui-form-field-standard-content","sui-form-field-standard-focus-effect":"sui-form-field-standard-focus-effect","sui-form-field-standard":"sui-form-field-standard","sui-form-field-quiet-content":"sui-form-field-quiet-content","sui-form-field-xlarge-content":"sui-form-field-xlarge-content","sui-form-field-large-content":"sui-form-field-large-content","sui-form-field-medium-content":"sui-form-field-medium-content","sui-form-field-error-helper-text":"sui-form-field-error-helper-text","sui-form-field-error-label":"sui-form-field-error-label","sui-form-field-error-focus-effect":"sui-form-field-error-focus-effect","sui-form-field-error-content":"sui-form-field-error-content","sui-form-field-error-standard-content":"sui-form-field-error-standard-content","sui-form-field-error-contained-content":"sui-form-field-error-contained-content","sui-form-field":"sui-form-field"});
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
const FormField_FormField = /*#__PURE__*/ forwardRef((inProps, ref)=>{
|
|
23
|
+
const props = useThemeProps({
|
|
24
|
+
props: inProps,
|
|
25
|
+
name: 'FormField'
|
|
26
|
+
});
|
|
27
|
+
const { classes, className, children, htmlFor, label, labelProps, helperText, required, disabled, error, variant = 'standard', size = 'xlarge', contentRef, contentProps, focused, FormHelperTextProps, ...rest } = props;
|
|
28
|
+
const cls = useClasses('form-field', classes, className);
|
|
29
|
+
return /*#__PURE__*/ jsxs("div", {
|
|
30
|
+
...rest,
|
|
31
|
+
ref: ref,
|
|
32
|
+
className: cls('root', variant, {
|
|
33
|
+
disabled,
|
|
34
|
+
error,
|
|
35
|
+
focused
|
|
36
|
+
}),
|
|
37
|
+
"aria-disabled": disabled,
|
|
38
|
+
children: [
|
|
39
|
+
hasContent(label) && /*#__PURE__*/ jsxs("label", {
|
|
40
|
+
htmlFor: htmlFor,
|
|
41
|
+
...labelProps,
|
|
42
|
+
className: clsx(cls('label', `${variant}-label`, error && 'error-label'), labelProps?.className),
|
|
43
|
+
children: [
|
|
44
|
+
label,
|
|
45
|
+
required ? ' *' : ''
|
|
46
|
+
]
|
|
47
|
+
}),
|
|
48
|
+
/*#__PURE__*/ jsxs("div", {
|
|
49
|
+
className: cls('container', error && 'error-container'),
|
|
50
|
+
children: [
|
|
51
|
+
/*#__PURE__*/ jsx("div", {
|
|
52
|
+
className: cls('content', size, `${size}-content`, `${variant}-${size}`, `${variant}-content`, error && 'error-content', error && `error-${variant}-content`),
|
|
53
|
+
ref: contentRef,
|
|
54
|
+
...contentProps,
|
|
55
|
+
children: children
|
|
56
|
+
}),
|
|
57
|
+
/*#__PURE__*/ jsx("div", {
|
|
58
|
+
className: cls('focus-effect', `${variant}-focus-effect`, error && 'error-focus-effect')
|
|
59
|
+
})
|
|
60
|
+
]
|
|
61
|
+
}),
|
|
62
|
+
hasContent(helperText) && /*#__PURE__*/ jsx("div", {
|
|
63
|
+
...FormHelperTextProps,
|
|
64
|
+
className: clsx(cls('helper-text', error && 'error-helper-text'), FormHelperTextProps?.className),
|
|
65
|
+
children: helperText
|
|
66
|
+
})
|
|
67
|
+
]
|
|
68
|
+
});
|
|
69
|
+
});
|
|
70
|
+
FormField_FormField.displayName = 'SuiFormField';
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Hook to generate consistent helper text IDs for form field accessibility
|
|
76
|
+
*
|
|
77
|
+
* Follows the pattern: `${id}-helper-text`
|
|
78
|
+
*
|
|
79
|
+
* @param options Configuration options
|
|
80
|
+
* @returns Generated helper text ID or undefined if no helper text
|
|
81
|
+
*
|
|
82
|
+
* @example
|
|
83
|
+
* ```tsx
|
|
84
|
+
* const Select = ({ helperText, FormHelperTextProps, ...props }) => {
|
|
85
|
+
* const id = useId(idProp);
|
|
86
|
+
* const helperTextId = useHelperTextId({ helperText, id, FormHelperTextProps });
|
|
87
|
+
*
|
|
88
|
+
* return (
|
|
89
|
+
* <FormField FormHelperTextProps={{ id: helperTextId, ...FormHelperTextProps }}>
|
|
90
|
+
* <button aria-describedby={helperTextId}>
|
|
91
|
+
* </FormField>
|
|
92
|
+
* );
|
|
93
|
+
* };
|
|
94
|
+
* ```
|
|
95
|
+
*/ const useHelperTextId = ({ helperText, id, FormHelperTextProps })=>{
|
|
96
|
+
if (!hasContent(helperText)) {
|
|
97
|
+
return undefined;
|
|
98
|
+
}
|
|
99
|
+
// Use existing ID if provided, otherwise generate standard pattern
|
|
100
|
+
return FormHelperTextProps?.id || `${id}-helper-text`;
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
export { FormField as formFieldStyle, FormField_FormField as FormField, useHelperTextId };
|
package/FormLabel.js
CHANGED
|
@@ -1,9 +1,83 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import '@ringcentral/spring-theme';
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { createContext, forwardRef, useContext, useMemo } from "react";
|
|
3
|
+
import { useClasses, useId } from "@ringcentral/spring-base";
|
|
4
|
+
import { useThemeProps } from "@ringcentral/spring-theme";
|
|
6
5
|
|
|
7
|
-
var FormLabel = {"sui-form-label-root":"sui-form-label-root","sui-form-label-label":"sui-form-label-label","sui-disabled":"sui-disabled","sui-form-label-end-label":"sui-form-label-end-label","sui-form-label-start":"sui-form-label-start","sui-form-label-start-label":"sui-form-label-start-label","sui-form-label-full-width":"sui-form-label-full-width"};
|
|
8
6
|
|
|
9
|
-
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
const FormLabelContext = createContext({});
|
|
13
|
+
const useFormLabel = (props)=>{
|
|
14
|
+
const { disabled: disabledProp, id: idProp, value: valueProp } = props;
|
|
15
|
+
const { disabled: innerDisabled, id: innerId, value: innerValue } = useContext(FormLabelContext);
|
|
16
|
+
const disabled = disabledProp ?? innerDisabled;
|
|
17
|
+
const id = idProp ?? innerId;
|
|
18
|
+
const value = valueProp ?? innerValue;
|
|
19
|
+
return {
|
|
20
|
+
id,
|
|
21
|
+
disabled,
|
|
22
|
+
value
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
// extracted by css-extract-rspack-plugin
|
|
27
|
+
/* export default */ var FormLabel = ({"sui-form-label-root":"sui-form-label-root","sui-form-label-label":"sui-form-label-label","sui-disabled":"sui-disabled","sui-form-label-end-label":"sui-form-label-end-label","sui-form-label-start":"sui-form-label-start","sui-form-label-start-label":"sui-form-label-start-label","sui-form-label-full-width":"sui-form-label-full-width"});
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
const FormLabel_FormLabel = /*#__PURE__*/ forwardRef((inProps, ref)=>{
|
|
35
|
+
const props = useThemeProps({
|
|
36
|
+
props: inProps,
|
|
37
|
+
name: 'FormLabel'
|
|
38
|
+
});
|
|
39
|
+
const { classes, className, children, label, value, labelRef, id: idProp, disabled = false, fullWidth = false, placement = 'end', rootProps, ...rest } = props;
|
|
40
|
+
const cls = useClasses('form-label', classes, className);
|
|
41
|
+
const innerId = useId();
|
|
42
|
+
const id = idProp || innerId;
|
|
43
|
+
const formLabelContextValue = useMemo(()=>({
|
|
44
|
+
id,
|
|
45
|
+
disabled,
|
|
46
|
+
value
|
|
47
|
+
}), [
|
|
48
|
+
disabled,
|
|
49
|
+
id,
|
|
50
|
+
value
|
|
51
|
+
]);
|
|
52
|
+
return /*#__PURE__*/ jsxs("div", {
|
|
53
|
+
className: cls('root', placement, {
|
|
54
|
+
'full-width': fullWidth
|
|
55
|
+
}),
|
|
56
|
+
ref: ref,
|
|
57
|
+
...rootProps,
|
|
58
|
+
children: [
|
|
59
|
+
/*#__PURE__*/ jsx(FormLabelContext.Provider, {
|
|
60
|
+
value: formLabelContextValue,
|
|
61
|
+
children: children
|
|
62
|
+
}),
|
|
63
|
+
/*#__PURE__*/ jsx("label", {
|
|
64
|
+
className: cls('label', `${placement}-label`, {
|
|
65
|
+
disabled
|
|
66
|
+
}),
|
|
67
|
+
...rest,
|
|
68
|
+
ref: labelRef,
|
|
69
|
+
htmlFor: id,
|
|
70
|
+
children: label
|
|
71
|
+
})
|
|
72
|
+
]
|
|
73
|
+
});
|
|
74
|
+
});
|
|
75
|
+
FormLabel_FormLabel.displayName = 'SuiFormLabel';
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
export { FormLabel as formLabelStyle, FormLabelContext, FormLabel_FormLabel as FormLabel, useFormLabel };
|
package/Icon.js
CHANGED
|
@@ -1,9 +1,2 @@
|
|
|
1
|
-
export { I as Icon } from './chunks/Icon.js';
|
|
2
|
-
import 'react/jsx-runtime';
|
|
3
|
-
import 'react';
|
|
4
|
-
import '@ringcentral/spring-base';
|
|
5
|
-
import '@ringcentral/spring-theme';
|
|
6
1
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
export { Icon as iconStyle };
|
|
2
|
+
export { Icon, iconStyle } from "./chunks/8307.js";
|
package/IconButton.js
CHANGED
|
@@ -1,26 +1,142 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
1
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cloneElement, forwardRef } from "react";
|
|
3
|
+
import { useButton } from "@mui/base";
|
|
4
|
+
import { useClasses } from "@ringcentral/spring-base";
|
|
5
|
+
import { useThemeProps } from "@ringcentral/spring-theme";
|
|
6
|
+
import { Icon as Icon_Icon } from "./chunks/8307.js";
|
|
7
|
+
import "./Squircle.js";
|
|
8
|
+
import { withTooltip } from "./chunks/4535.js";
|
|
9
|
+
import { Squircle as Squircle_Squircle } from "./chunks/1250.js";
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
// extracted by css-extract-rspack-plugin
|
|
17
|
+
/* export default */ var IconButton = ({"sui-icon-button-root":"sui-icon-button-root","sui-disabled":"sui-disabled","sui-icon-button-label":"sui-icon-button-label","sui-icon-button-circular":"sui-icon-button-circular","focus-visible":"focus-visible","sui-focus-visible":"sui-focus-visible","sui-icon-button-rectangular":"sui-icon-button-rectangular","sui-icon-button-contained":"sui-icon-button-contained","sui-active":"sui-active","sui-icon-button-contained-squircle":"sui-icon-button-contained-squircle","sui-icon-button-contained-primary":"sui-icon-button-contained-primary","sui-icon-button-contained-success":"sui-icon-button-contained-success","sui-icon-button-contained-danger":"sui-icon-button-contained-danger","sui-icon-button-contained-warning":"sui-icon-button-contained-warning","sui-icon-button-contained-secondary":"sui-icon-button-contained-secondary","sui-squircle":"sui-squircle","sui-icon-button-contained-neutral":"sui-icon-button-contained-neutral","sui-icon-button-contained-hide-background":"sui-icon-button-contained-hide-background","sui-icon-button-outlined":"sui-icon-button-outlined","sui-icon-button-outlined-primary":"sui-icon-button-outlined-primary","sui-icon-button-outlined-success":"sui-icon-button-outlined-success","sui-icon-button-outlined-danger":"sui-icon-button-outlined-danger","sui-icon-button-outlined-warning":"sui-icon-button-outlined-warning","sui-icon-button-outlined-secondary":"sui-icon-button-outlined-secondary","sui-icon-button-outlined-neutral":"sui-icon-button-outlined-neutral","sui-icon-button-outlined-squircle":"sui-icon-button-outlined-squircle","sui-icon-button-outlined-hide-background":"sui-icon-button-outlined-hide-background","sui-icon-button-icon":"sui-icon-button-icon","sui-icon-button-icon-primary":"sui-icon-button-icon-primary","sui-icon-button-icon-success":"sui-icon-button-icon-success","sui-icon-button-icon-danger":"sui-icon-button-icon-danger","sui-icon-button-icon-warning":"sui-icon-button-icon-warning","sui-icon-button-icon-secondary":"sui-icon-button-icon-secondary","sui-icon-button-icon-neutral":"sui-icon-button-icon-neutral","sui-icon-button-inverted":"sui-icon-button-inverted","sui-icon-button-inverted-primary":"sui-icon-button-inverted-primary","sui-icon-button-inverted-success":"sui-icon-button-inverted-success","sui-icon-button-inverted-danger":"sui-icon-button-inverted-danger","sui-icon-button-inverted-warning":"sui-icon-button-inverted-warning","sui-icon-button-inverted-secondary":"sui-icon-button-inverted-secondary","sui-icon-button-inverted-neutral":"sui-icon-button-inverted-neutral","sui-icon-button-inverted-squircle":"sui-icon-button-inverted-squircle","sui-icon-button-inverted-hide-background":"sui-icon-button-inverted-hide-background","sui-icon-button-squircle":"sui-icon-button-squircle","sui-icon-button-squircle-hide-background":"sui-icon-button-squircle-hide-background","sui-icon-button-squircle-label":"sui-icon-button-squircle-label","sui-icon-button-xsmall":"sui-icon-button-xsmall","sui-icon-button-xsmall-circular":"sui-icon-button-xsmall-circular","sui-icon-button-xsmall-inverted":"sui-icon-button-xsmall-inverted","sui-icon-button-xsmall-squircle":"sui-icon-button-xsmall-squircle","sui-icon-button-xsmall-rectangular":"sui-icon-button-xsmall-rectangular","sui-icon-button-small":"sui-icon-button-small","sui-icon-button-small-circular":"sui-icon-button-small-circular","sui-icon-button-small-inverted":"sui-icon-button-small-inverted","sui-icon-button-small-squircle":"sui-icon-button-small-squircle","sui-icon-button-small-rectangular":"sui-icon-button-small-rectangular","sui-icon-button-medium":"sui-icon-button-medium","sui-icon-button-medium-circular":"sui-icon-button-medium-circular","sui-icon-button-medium-inverted":"sui-icon-button-medium-inverted","sui-icon-button-medium-squircle":"sui-icon-button-medium-squircle","sui-icon-button-medium-rectangular":"sui-icon-button-medium-rectangular","sui-icon-button-large":"sui-icon-button-large","sui-icon-button-large-circular":"sui-icon-button-large-circular","sui-icon-button-large-inverted":"sui-icon-button-large-inverted","sui-icon-button-large-squircle":"sui-icon-button-large-squircle","sui-icon-button-large-rectangular":"sui-icon-button-large-rectangular","sui-icon-button-xlarge":"sui-icon-button-xlarge","sui-icon-button-xlarge-circular":"sui-icon-button-xlarge-circular","sui-icon-button-xlarge-inverted":"sui-icon-button-xlarge-inverted","sui-icon-button-xlarge-squircle":"sui-icon-button-xlarge-squircle","sui-icon-button-xlarge-rectangular":"sui-icon-button-xlarge-rectangular","sui-icon-button-xxlarge":"sui-icon-button-xxlarge","sui-icon-button-xxlarge-circular":"sui-icon-button-xxlarge-circular","sui-icon-button-xxlarge-inverted":"sui-icon-button-xxlarge-inverted","sui-icon-button-xxlarge-squircle":"sui-icon-button-xxlarge-squircle","sui-icon-button-xxlarge-label":"sui-icon-button-xxlarge-label","sui-icon-button-xxlarge-rectangular":"sui-icon-button-xxlarge-rectangular","sui-icon-button-xxlarge-rectangular-label":"sui-icon-button-xxlarge-rectangular-label","sui-icon-button-xxxlarge":"sui-icon-button-xxxlarge","sui-icon-button-xxxlarge-label":"sui-icon-button-xxxlarge-label","sui-icon-button-xxxlarge-circular":"sui-icon-button-xxxlarge-circular","sui-icon-button-xxxlarge-inverted":"sui-icon-button-xxxlarge-inverted","sui-icon-button-xxxlarge-squircle":"sui-icon-button-xxxlarge-squircle","sui-icon-button-xxxlarge-rectangular":"sui-icon-button-xxxlarge-rectangular","sui-icon-button-xxxlarge-rectangular-label":"sui-icon-button-xxxlarge-rectangular-label"});
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
const IconSizeMap = {
|
|
28
|
+
xxxlarge: 'medium',
|
|
29
|
+
xxlarge: 'medium',
|
|
30
|
+
xlarge: 'large',
|
|
31
|
+
large: 'medium',
|
|
32
|
+
medium: 'small',
|
|
33
|
+
small: 'small',
|
|
34
|
+
xsmall: 'xsmall'
|
|
35
|
+
};
|
|
36
|
+
function sizeSupportsLabel(size) {
|
|
37
|
+
switch(size){
|
|
38
|
+
case 'xxxlarge':
|
|
39
|
+
case 'xxlarge':
|
|
40
|
+
return true;
|
|
41
|
+
default:
|
|
42
|
+
return false;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
const IconButton_IconButton = withTooltip(/*#__PURE__*/ forwardRef((inProps, ref)=>{
|
|
46
|
+
const props = useThemeProps({
|
|
47
|
+
props: inProps,
|
|
48
|
+
name: 'IconButton'
|
|
49
|
+
});
|
|
50
|
+
const { component = 'button', color = 'primary', shape = 'circular', size = 'large', background = true, variant = 'outlined', label, symbol, classes, iconSize, className, children, disabled, ...rest } = props;
|
|
51
|
+
const cls = useClasses('icon-button', classes, className);
|
|
52
|
+
const { getRootProps, focusVisible } = useButton({
|
|
53
|
+
...props,
|
|
54
|
+
rootRef: ref
|
|
55
|
+
});
|
|
56
|
+
const rootProps = getRootProps({
|
|
57
|
+
className: cls('root', size, variant, color, shape, `${size}-${shape}`, `${size}-${variant}`, `${variant}-${color}`, `${variant}-${shape}`, ...!background ? [
|
|
58
|
+
'hide-background',
|
|
59
|
+
`${variant}-hide-background`,
|
|
60
|
+
`${shape}-hide-background`
|
|
61
|
+
] : [], {
|
|
62
|
+
disabled,
|
|
63
|
+
focusVisible
|
|
64
|
+
}),
|
|
65
|
+
'aria-label': label,
|
|
66
|
+
...rest
|
|
67
|
+
});
|
|
68
|
+
const content = /*#__PURE__*/ jsxs(Fragment, {
|
|
69
|
+
children: [
|
|
70
|
+
children || /*#__PURE__*/ jsx(Icon_Icon, {
|
|
71
|
+
symbol: symbol,
|
|
72
|
+
size: iconSize ?? IconSizeMap[size]
|
|
73
|
+
}),
|
|
74
|
+
sizeSupportsLabel(size) && label && /*#__PURE__*/ jsx("span", {
|
|
75
|
+
className: cls('label', `${size}-label`, shape === 'squircle' && `${shape}-label`, `${size}-${shape}-label`),
|
|
76
|
+
children: label
|
|
77
|
+
})
|
|
78
|
+
]
|
|
79
|
+
});
|
|
80
|
+
if (shape === 'squircle') {
|
|
81
|
+
return /*#__PURE__*/ jsx(Squircle_Squircle, {
|
|
82
|
+
...rootProps,
|
|
83
|
+
component: component,
|
|
84
|
+
interactive: !disabled,
|
|
85
|
+
focusVisible: focusVisible,
|
|
86
|
+
children: content
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
const IconButtonRoot = component;
|
|
90
|
+
return /*#__PURE__*/ jsx(IconButtonRoot, {
|
|
91
|
+
...rootProps,
|
|
92
|
+
children: content
|
|
93
|
+
});
|
|
94
|
+
}));
|
|
95
|
+
IconButton_IconButton.displayName = 'SuiIconButton';
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
// extracted by css-extract-rspack-plugin
|
|
103
|
+
/* export default */ var IconButtonLabel = ({"sui-icon-button-outer-label-root":"sui-icon-button-outer-label-root","sui-icon-button-outer-label-text":"sui-icon-button-outer-label-text"});
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
const IconButtonLabel_IconButtonLabel = /*#__PURE__*/ forwardRef((inProps, ref)=>{
|
|
110
|
+
const props = useThemeProps({
|
|
111
|
+
props: inProps,
|
|
112
|
+
name: 'IconButtonLabel'
|
|
113
|
+
});
|
|
114
|
+
const { label, className, classes, children, ...rest } = props;
|
|
115
|
+
const cls = useClasses('icon-button-outer-label', classes, className);
|
|
116
|
+
const ariaLabel = children.props['aria-label'] || children.props.label || label;
|
|
117
|
+
return /*#__PURE__*/ jsxs("div", {
|
|
118
|
+
className: cls('root'),
|
|
119
|
+
...rest,
|
|
120
|
+
ref: ref,
|
|
121
|
+
children: [
|
|
122
|
+
/*#__PURE__*/ cloneElement(children, {
|
|
123
|
+
'aria-label': ariaLabel
|
|
124
|
+
}),
|
|
125
|
+
label && /*#__PURE__*/ jsx("span", {
|
|
126
|
+
className: cls('text'),
|
|
127
|
+
children: label
|
|
128
|
+
})
|
|
129
|
+
]
|
|
130
|
+
});
|
|
131
|
+
});
|
|
132
|
+
IconButtonLabel_IconButtonLabel.displayName = 'SuiIconButtonLabel';
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
export { IconButton as iconButtonStyle, IconButtonLabel as iconButtonLabelStyle, IconButtonLabel_IconButtonLabel as IconButtonLabel, IconButton_IconButton as IconButton };
|
package/IconButtonGroup.js
CHANGED
|
@@ -1,18 +1,41 @@
|
|
|
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 IconButtonGroup$1 = {"sui-icon-button-group-root":"sui-icon-button-group-root","sui-icon-button-group-border":"sui-icon-button-group-border","sui-icon-button-group-horizontal":"sui-icon-button-group-horizontal","sui-icon-button-group-vertical":"sui-icon-button-group-vertical"};
|
|
7
6
|
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
// extracted by css-extract-rspack-plugin
|
|
11
|
+
/* export default */ var IconButtonGroup = ({"sui-icon-button-group-root":"sui-icon-button-group-root","sui-icon-button-group-border":"sui-icon-button-group-border","sui-icon-button-group-horizontal":"sui-icon-button-group-horizontal","sui-icon-button-group-vertical":"sui-icon-button-group-vertical"});
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
const IconButtonGroup_IconButtonGroup = /*#__PURE__*/ forwardRef((inProps, ref)=>{
|
|
18
|
+
const props = useThemeProps({
|
|
19
|
+
props: inProps,
|
|
20
|
+
name: 'IconButtonGroup'
|
|
21
|
+
});
|
|
10
22
|
const { component: ButtonGroupRoot = 'div', classes, className, children, orientation = 'horizontal', border = false, ...rest } = props;
|
|
11
23
|
const cls = useClasses('icon-button-group', classes, className);
|
|
12
|
-
return
|
|
13
|
-
|
|
14
|
-
|
|
24
|
+
return /*#__PURE__*/ jsx(ButtonGroupRoot, {
|
|
25
|
+
role: "group",
|
|
26
|
+
...rest,
|
|
27
|
+
ref: ref,
|
|
28
|
+
className: cls('root', orientation, {
|
|
29
|
+
border
|
|
30
|
+
}),
|
|
31
|
+
children: children
|
|
32
|
+
});
|
|
15
33
|
});
|
|
16
|
-
|
|
34
|
+
IconButtonGroup_IconButtonGroup.displayName = 'SuiIconButtonGroup';
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
17
40
|
|
|
18
|
-
export { IconButtonGroup,
|
|
41
|
+
export { IconButtonGroup as iconButtonGroupStyle, IconButtonGroup_IconButtonGroup as IconButtonGroup };
|