@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/Option.js
CHANGED
|
@@ -1,35 +1,22 @@
|
|
|
1
|
-
import { jsx } from
|
|
2
|
-
import { forwardRef } from
|
|
3
|
-
import { useThemeProps } from
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
import './chunks/getGrow.js';
|
|
21
|
-
import './chunks/Modal.js';
|
|
22
|
-
import '@mui/base';
|
|
23
|
-
import './chunks/getFade.js';
|
|
24
|
-
import './chunks/useFocusTrapStack.js';
|
|
25
|
-
import './chunks/Backdrop.js';
|
|
26
|
-
import './Popper.js';
|
|
27
|
-
import './chunks/PopperPaper.js';
|
|
28
|
-
import 'react-virtuoso';
|
|
29
|
-
import './chunks/List.js';
|
|
30
|
-
|
|
31
|
-
const Option = forwardRef((inProps, ref) => {
|
|
32
|
-
const props = useThemeProps({ props: inProps, name: 'Option' });
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
import { useThemeProps } from "@ringcentral/spring-theme";
|
|
4
|
+
import { MenuItem as MenuItem_MenuItem, useMenuItemSelectContext } from "./MenuItem.js";
|
|
5
|
+
import { composeEventHandlers } from "./chunks/4491.js";
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
const Option = /*#__PURE__*/ forwardRef((inProps, ref)=>{
|
|
16
|
+
const props = useThemeProps({
|
|
17
|
+
props: inProps,
|
|
18
|
+
name: 'Option'
|
|
19
|
+
});
|
|
33
20
|
const { children, value, onClick: onClickProp, autoClose: autoCloseProp, ...rest } = props;
|
|
34
21
|
const selectContextValue = useMenuItemSelectContext();
|
|
35
22
|
if (selectContextValue === null) {
|
|
@@ -37,11 +24,22 @@ const Option = forwardRef((inProps, ref) => {
|
|
|
37
24
|
}
|
|
38
25
|
const { handleSelect, getMenuItemProps } = selectContextValue;
|
|
39
26
|
const autoClose = autoCloseProp ?? selectContextValue.selectMode === 'single';
|
|
40
|
-
const onClick = composeEventHandlers(onClickProp, ()
|
|
27
|
+
const onClick = composeEventHandlers(onClickProp, ()=>{
|
|
41
28
|
handleSelect(value);
|
|
42
29
|
});
|
|
43
|
-
return
|
|
30
|
+
return /*#__PURE__*/ jsx(MenuItem_MenuItem, {
|
|
31
|
+
...getMenuItemProps(value),
|
|
32
|
+
...rest,
|
|
33
|
+
onClick: onClick,
|
|
34
|
+
ref: ref,
|
|
35
|
+
autoClose: autoClose,
|
|
36
|
+
children: children
|
|
37
|
+
});
|
|
44
38
|
});
|
|
45
39
|
Option.displayName = 'SuiOption';
|
|
46
40
|
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
47
45
|
export { Option };
|
package/Overlap.js
CHANGED
|
@@ -1,9 +1,56 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import '@ringcentral/spring-theme';
|
|
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";
|
|
6
5
|
|
|
7
|
-
var Overlap = {"sui-overlap-root":"sui-overlap-root","sui-overlap-floater":"sui-overlap-floater","sui-overlap-top-left":"sui-overlap-top-left","sui-overlap-top-right":"sui-overlap-top-right","sui-overlap-bottom-left":"sui-overlap-bottom-left","sui-overlap-bottom-right":"sui-overlap-bottom-right","sui-overlap-show-floater-on-hover-only":"sui-overlap-show-floater-on-hover-only"};
|
|
8
6
|
|
|
9
|
-
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
// extracted by css-extract-rspack-plugin
|
|
11
|
+
/* export default */ var Overlap = ({"sui-overlap-root":"sui-overlap-root","sui-overlap-floater":"sui-overlap-floater","sui-overlap-top-left":"sui-overlap-top-left","sui-overlap-top-right":"sui-overlap-top-right","sui-overlap-bottom-left":"sui-overlap-bottom-left","sui-overlap-bottom-right":"sui-overlap-bottom-right","sui-overlap-show-floater-on-hover-only":"sui-overlap-show-floater-on-hover-only"});
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
function isKeyPosition(position) {
|
|
18
|
+
return typeof position === 'string';
|
|
19
|
+
}
|
|
20
|
+
const Overlap_Overlap = /*#__PURE__*/ forwardRef((inProps, ref)=>{
|
|
21
|
+
const props = useThemeProps({
|
|
22
|
+
props: inProps,
|
|
23
|
+
name: 'Overlap'
|
|
24
|
+
});
|
|
25
|
+
const { classes, floater, position, children, className, showFloaterOnHoverOnly = false, component: OverlapRoot = 'div', ...rest } = props;
|
|
26
|
+
const cls = useClasses('overlap', classes, className);
|
|
27
|
+
let widget = null;
|
|
28
|
+
if (floater) {
|
|
29
|
+
const style = !isKeyPosition(position) ? position : undefined;
|
|
30
|
+
const classes = cls('floater', isKeyPosition(position) && position);
|
|
31
|
+
widget = /*#__PURE__*/ jsx("div", {
|
|
32
|
+
style: style,
|
|
33
|
+
className: classes,
|
|
34
|
+
children: floater
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
return /*#__PURE__*/ jsxs(OverlapRoot, {
|
|
38
|
+
...rest,
|
|
39
|
+
ref: ref,
|
|
40
|
+
className: cls('root', {
|
|
41
|
+
'show-floater-on-hover-only': showFloaterOnHoverOnly
|
|
42
|
+
}),
|
|
43
|
+
children: [
|
|
44
|
+
children,
|
|
45
|
+
widget
|
|
46
|
+
]
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
Overlap_Overlap.displayName = 'SuiOverlap';
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
export { Overlap as overlapStyle, Overlap_Overlap as Overlap };
|
package/PageHeader.js
CHANGED
|
@@ -1,58 +1,96 @@
|
|
|
1
|
-
import { jsx } from
|
|
2
|
-
import { forwardRef } from
|
|
3
|
-
import { useClasses } from
|
|
4
|
-
import {
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
import { useClasses } from "@ringcentral/spring-base";
|
|
4
|
+
import { useClassesWithMode, useThemeProps } from "@ringcentral/spring-theme";
|
|
5
5
|
|
|
6
|
-
var PageHeader$1 = {"sui-page-header-root":"sui-page-header-root","sui-page-header-left-root":"sui-page-header-left-root","sui-page-header-right-root":"sui-page-header-right-root","sui-page-header-center-root":"sui-page-header-center-root","sui-page-header-title-root":"sui-page-header-title-root","sui-page-header-integrated":"sui-page-header-integrated","sui-page-header-detached":"sui-page-header-detached","sui-compact":"sui-compact"};
|
|
7
6
|
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
// extracted by css-extract-rspack-plugin
|
|
11
|
+
/* export default */ var PageHeader = ({"sui-page-header-root":"sui-page-header-root","sui-page-header-left-root":"sui-page-header-left-root","sui-page-header-right-root":"sui-page-header-right-root","sui-page-header-center-root":"sui-page-header-center-root","sui-page-header-title-root":"sui-page-header-title-root","sui-page-header-integrated":"sui-page-header-integrated","sui-page-header-detached":"sui-page-header-detached","sui-compact":"sui-compact"});
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
const PageHeader_PageHeader = /*#__PURE__*/ forwardRef((inProps, ref)=>{
|
|
18
|
+
const props = useThemeProps({
|
|
19
|
+
props: inProps,
|
|
20
|
+
name: 'PageHeader'
|
|
21
|
+
});
|
|
10
22
|
const { classes, className, children, variant = 'integrated', ...rest } = props;
|
|
11
23
|
const cls = useClassesWithMode('page-header', classes, className);
|
|
12
|
-
return
|
|
13
|
-
|
|
14
|
-
|
|
24
|
+
return /*#__PURE__*/ jsx("header", {
|
|
25
|
+
className: cls('root', {
|
|
26
|
+
[variant]: true
|
|
27
|
+
}),
|
|
28
|
+
...rest,
|
|
29
|
+
ref: ref,
|
|
30
|
+
children: children
|
|
31
|
+
});
|
|
15
32
|
});
|
|
16
|
-
|
|
17
|
-
const PageHeaderLeft = forwardRef((inProps, ref)
|
|
33
|
+
PageHeader_PageHeader.displayName = 'SuiPageHeader';
|
|
34
|
+
const PageHeaderLeft = /*#__PURE__*/ forwardRef((inProps, ref)=>{
|
|
18
35
|
const props = useThemeProps({
|
|
19
36
|
props: inProps,
|
|
20
|
-
name: 'PageHeaderLeft'
|
|
37
|
+
name: 'PageHeaderLeft'
|
|
21
38
|
});
|
|
22
39
|
const { className, ...rest } = props;
|
|
23
40
|
const cls = useClasses('page-header-left', undefined, className);
|
|
24
|
-
return jsx("div", {
|
|
41
|
+
return /*#__PURE__*/ jsx("div", {
|
|
42
|
+
className: cls('root'),
|
|
43
|
+
...rest,
|
|
44
|
+
ref: ref
|
|
45
|
+
});
|
|
25
46
|
});
|
|
26
47
|
PageHeaderLeft.displayName = 'SuiPageHeaderLeft';
|
|
27
|
-
const PageHeaderCenter = forwardRef((inProps, ref)
|
|
48
|
+
const PageHeaderCenter = /*#__PURE__*/ forwardRef((inProps, ref)=>{
|
|
28
49
|
const props = useThemeProps({
|
|
29
50
|
props: inProps,
|
|
30
|
-
name: 'PageHeaderCenter'
|
|
51
|
+
name: 'PageHeaderCenter'
|
|
31
52
|
});
|
|
32
53
|
const { className, ...rest } = props;
|
|
33
54
|
const cls = useClasses('page-header-center', undefined, className);
|
|
34
|
-
return jsx("div", {
|
|
55
|
+
return /*#__PURE__*/ jsx("div", {
|
|
56
|
+
className: cls('root'),
|
|
57
|
+
...rest,
|
|
58
|
+
ref: ref
|
|
59
|
+
});
|
|
35
60
|
});
|
|
36
61
|
PageHeaderCenter.displayName = 'SuiPageHeaderCenter';
|
|
37
|
-
const PageHeaderTitle = forwardRef((inProps, ref)
|
|
62
|
+
const PageHeaderTitle = /*#__PURE__*/ forwardRef((inProps, ref)=>{
|
|
38
63
|
const props = useThemeProps({
|
|
39
64
|
props: inProps,
|
|
40
|
-
name: 'PageHeaderTitle'
|
|
65
|
+
name: 'PageHeaderTitle'
|
|
41
66
|
});
|
|
42
67
|
const { className, ...rest } = props;
|
|
43
68
|
const cls = useClasses('page-header-title', undefined, className);
|
|
44
|
-
return jsx("div", {
|
|
69
|
+
return /*#__PURE__*/ jsx("div", {
|
|
70
|
+
className: cls('root'),
|
|
71
|
+
...rest,
|
|
72
|
+
ref: ref
|
|
73
|
+
});
|
|
45
74
|
});
|
|
46
75
|
PageHeaderTitle.displayName = 'SuiPageHeaderTitle';
|
|
47
|
-
const PageHeaderRight = forwardRef((inProps, ref)
|
|
76
|
+
const PageHeaderRight = /*#__PURE__*/ forwardRef((inProps, ref)=>{
|
|
48
77
|
const props = useThemeProps({
|
|
49
78
|
props: inProps,
|
|
50
|
-
name: 'PageHeaderRight'
|
|
79
|
+
name: 'PageHeaderRight'
|
|
51
80
|
});
|
|
52
81
|
const { className, ...rest } = props;
|
|
53
82
|
const cls = useClasses('page-header-right', undefined, className);
|
|
54
|
-
return jsx("div", {
|
|
83
|
+
return /*#__PURE__*/ jsx("div", {
|
|
84
|
+
className: cls('root'),
|
|
85
|
+
...rest,
|
|
86
|
+
ref: ref
|
|
87
|
+
});
|
|
55
88
|
});
|
|
56
89
|
PageHeaderRight.displayName = 'SuiPageHeaderRight';
|
|
57
90
|
|
|
58
|
-
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
export { PageHeader as pageHeaderStyle, PageHeaderCenter, PageHeaderLeft, PageHeaderRight, PageHeaderTitle, PageHeader_PageHeader as PageHeader };
|
package/PickerTextField.js
CHANGED
|
@@ -1,33 +1,156 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
1
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef, useImperativeHandle, useMemo, useRef, useState } from "react";
|
|
3
|
+
import { combineClasses, useA11yKeyEvent, useClasses, useEventCallback, useForkRef, useId } from "@ringcentral/spring-base";
|
|
4
|
+
import { Icon as Icon_Icon } from "./chunks/8307.js";
|
|
5
|
+
import { Popover as Popover_Popover } from "./Popover.js";
|
|
6
|
+
import { useHelperTextId } from "./FormField.js";
|
|
7
|
+
import { TextField as TextField_TextField } from "./TextField.js";
|
|
8
|
+
import { VisuallyHidden as VisuallyHidden_VisuallyHidden } from "./VisuallyHidden.js";
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
// extracted by css-extract-rspack-plugin
|
|
14
|
+
/* export default */ var PickerTextField = ({"sui-picker-text-field-root":"sui-picker-text-field-root","sui-disabled":"sui-disabled","sui-picker-text-field-form-field-content":"sui-picker-text-field-form-field-content","sui-picker-text-field-input":"sui-picker-text-field-input","sui-picker-text-field-has-value":"sui-picker-text-field-has-value","sui-text-field-clear":"sui-text-field-clear","sui-picker-text-field-end-icon":"sui-picker-text-field-end-icon","sui-focused":"sui-focused"});
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
const PICKER_DISPLAY_NAME = 'SuiPickerTextField';
|
|
25
|
+
const PickerTextField_PickerTextField = /*#__PURE__*/ forwardRef((props, ref)=>{
|
|
26
|
+
const { disabled, value, defaultValue, onClear, action, inputProps = {}, announcementText, PopoverProps, children, endIconSymbol, clearText, clearBtn, ClearButtonProps, onKeyDown, onClick, onClose, classes, textInputClasses, className, id: idProp, RootProps, ...rest } = props;
|
|
27
|
+
const generatedId = useId(PICKER_DISPLAY_NAME, true);
|
|
28
|
+
const idForInput = idProp ?? inputProps.id ?? generatedId;
|
|
29
|
+
const [open, setOpen] = useState(false);
|
|
30
|
+
const [isPopoverExited, setIsPopoverExited] = useState(!open);
|
|
31
|
+
const cls = useClasses('picker-text-field', classes, className);
|
|
32
|
+
// Anchor on the field content instead of the FormField root so the popover
|
|
33
|
+
// aligns with the input rather than below the helperText, matching
|
|
34
|
+
// Select and Autocomplete.
|
|
35
|
+
const anchorRef = useRef(null);
|
|
36
|
+
const handleContentRef = useForkRef(RootProps?.contentRef, anchorRef);
|
|
37
|
+
const idForHelperText = useHelperTextId({
|
|
38
|
+
helperText: rest.helperText,
|
|
39
|
+
id: idForInput,
|
|
40
|
+
FormHelperTextProps: rest.FormHelperTextProps
|
|
41
|
+
});
|
|
42
|
+
const idForInstruction = announcementText ? `${idForInput}-instruction` : undefined;
|
|
43
|
+
const ariaDescribedBy = Array.from(new Set([
|
|
44
|
+
inputProps['aria-describedby'],
|
|
45
|
+
idForHelperText,
|
|
46
|
+
idForInstruction
|
|
47
|
+
].filter(Boolean).flatMap((value)=>`${value}`.split(/\s+/).filter(Boolean)))).join(' ');
|
|
48
|
+
const handleA11yKeydown = useA11yKeyEvent(()=>{
|
|
49
|
+
handleOpen(true);
|
|
50
|
+
});
|
|
51
|
+
const handleOpen = useEventCallback((open)=>{
|
|
52
|
+
if (disabled && open) {
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
if (open) {
|
|
56
|
+
setIsPopoverExited(false);
|
|
57
|
+
}
|
|
58
|
+
setOpen(open);
|
|
59
|
+
});
|
|
60
|
+
useImperativeHandle(action, ()=>({
|
|
61
|
+
close: ()=>{
|
|
62
|
+
handleOpen(false);
|
|
63
|
+
}
|
|
64
|
+
}), [
|
|
65
|
+
handleOpen
|
|
66
|
+
]);
|
|
67
|
+
const toClasses = useMemo(()=>combineClasses(textInputClasses, {
|
|
68
|
+
formFieldContent: cls('form-field-content', {
|
|
69
|
+
'has-value': Boolean(value)
|
|
70
|
+
}),
|
|
71
|
+
root: cls('root', {
|
|
72
|
+
'has-value': Boolean(value)
|
|
73
|
+
}),
|
|
74
|
+
input: cls('input')
|
|
75
|
+
}), [
|
|
76
|
+
cls,
|
|
77
|
+
textInputClasses,
|
|
78
|
+
value
|
|
79
|
+
]);
|
|
80
|
+
return /*#__PURE__*/ jsxs(Fragment, {
|
|
81
|
+
children: [
|
|
82
|
+
/*#__PURE__*/ jsx(TextField_TextField, {
|
|
83
|
+
classes: toClasses,
|
|
84
|
+
value: value,
|
|
85
|
+
defaultValue: defaultValue,
|
|
86
|
+
endAdornment: endIconSymbol && /*#__PURE__*/ jsx(Icon_Icon, {
|
|
87
|
+
className: cls('end-icon'),
|
|
88
|
+
symbol: endIconSymbol
|
|
89
|
+
}),
|
|
90
|
+
id: idForInput,
|
|
91
|
+
ref: ref,
|
|
92
|
+
RootProps: {
|
|
93
|
+
...RootProps,
|
|
94
|
+
contentRef: handleContentRef
|
|
95
|
+
},
|
|
96
|
+
focused: open || !open && !isPopoverExited,
|
|
97
|
+
disabled: disabled,
|
|
98
|
+
clearBtn: clearBtn,
|
|
99
|
+
clearText: clearText,
|
|
100
|
+
ClearButtonProps: ClearButtonProps,
|
|
101
|
+
onClick: (e)=>{
|
|
102
|
+
handleOpen(true);
|
|
103
|
+
onClick?.(e);
|
|
104
|
+
},
|
|
105
|
+
onKeyDown: (e)=>{
|
|
106
|
+
if (disabled) return;
|
|
107
|
+
handleA11yKeydown(e);
|
|
108
|
+
onKeyDown?.(e);
|
|
109
|
+
},
|
|
110
|
+
inputProps: {
|
|
111
|
+
'aria-haspopup': true,
|
|
112
|
+
...inputProps,
|
|
113
|
+
'aria-describedby': ariaDescribedBy || undefined
|
|
114
|
+
},
|
|
115
|
+
...rest,
|
|
116
|
+
readOnly: true,
|
|
117
|
+
onClear: (e)=>{
|
|
118
|
+
onClear?.(e);
|
|
119
|
+
// prevent open popover
|
|
120
|
+
e.stopPropagation();
|
|
121
|
+
}
|
|
122
|
+
}),
|
|
123
|
+
/*#__PURE__*/ jsx(Popover_Popover, {
|
|
124
|
+
bordered: true,
|
|
125
|
+
open: open,
|
|
126
|
+
anchorEl: anchorRef.current,
|
|
127
|
+
onClose: (...args)=>{
|
|
128
|
+
handleOpen(false);
|
|
129
|
+
onClose?.(...args);
|
|
130
|
+
},
|
|
131
|
+
placement: "bottom-start",
|
|
132
|
+
...PopoverProps,
|
|
133
|
+
onExitComplete: ()=>{
|
|
134
|
+
PopoverProps?.onExitComplete?.();
|
|
135
|
+
setIsPopoverExited(true);
|
|
136
|
+
},
|
|
137
|
+
children: children
|
|
138
|
+
}),
|
|
139
|
+
idForInstruction && /*#__PURE__*/ jsx(VisuallyHidden_VisuallyHidden, {
|
|
140
|
+
id: idForInstruction,
|
|
141
|
+
children: announcementText
|
|
142
|
+
})
|
|
143
|
+
]
|
|
144
|
+
});
|
|
145
|
+
});
|
|
146
|
+
PickerTextField_PickerTextField.displayName = PICKER_DISPLAY_NAME;
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
export { PickerTextField as pickerTextFieldStyle, PickerTextField_PickerTextField as PickerTextField };
|