@ozen-ui/kit 0.6.0 → 0.7.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/Paper/package.json +5 -0
- package/__inner__/cjs/components/Alert/Alert.css +0 -5
- package/__inner__/cjs/components/Alert/Alert.js +3 -2
- package/__inner__/cjs/components/Breadcrumbs/Breadcrumbs.css +4 -0
- package/__inner__/cjs/components/Card/Card.css +9 -21
- package/__inner__/cjs/components/Card/Card.d.ts +3 -4
- package/__inner__/cjs/components/Card/Card.js +11 -1
- package/__inner__/cjs/components/Dialog/Dialog.css +0 -2
- package/__inner__/cjs/components/Dialog/Dialog.d.ts +21 -1
- package/__inner__/cjs/components/Drawer/Drawer.css +0 -1
- package/__inner__/cjs/components/Drawer/Drawer.d.ts +23 -1
- package/__inner__/cjs/components/Menu/components/MenuItem/MenuItem.js +3 -2
- package/__inner__/cjs/components/Modal/Modal.css +4 -3
- package/__inner__/cjs/components/Modal/Modal.d.ts +58 -5
- package/__inner__/cjs/components/Modal/Modal.js +2 -1
- package/__inner__/cjs/components/Paper/Paper.css +44 -0
- package/__inner__/cjs/components/Paper/Paper.d.ts +19 -0
- package/__inner__/cjs/components/Paper/Paper.js +25 -0
- package/__inner__/cjs/components/Paper/index.d.ts +1 -0
- package/__inner__/cjs/components/Paper/index.js +4 -0
- package/__inner__/cjs/components/Popover/Popover.css +1 -11
- package/__inner__/cjs/components/Popover/Popover.d.ts +2 -3
- package/__inner__/cjs/components/Popover/Popover.js +4 -3
- package/__inner__/cjs/components/Popover/components/PopoverArrow.js +2 -2
- package/__inner__/cjs/components/Popover/components/types.d.ts +0 -3
- package/__inner__/cjs/components/Popover/components/types.js +1 -2
- package/__inner__/cjs/components/Popover/constants.d.ts +1 -0
- package/__inner__/cjs/components/Popover/constants.js +3 -1
- package/__inner__/cjs/components/Popover/types.d.ts +8 -4
- package/__inner__/cjs/components/Portal/Portal.d.ts +8 -8
- package/__inner__/cjs/components/Portal/Portal.js +7 -6
- package/__inner__/cjs/components/Snackbar/SnackbarProvider.d.ts +4 -1
- package/__inner__/cjs/components/Snackbar/components/Snackbar/Snackbar.d.ts +6 -1
- package/__inner__/cjs/components/ThemeProvider/ThemeProvider.d.ts +2 -1
- package/__inner__/cjs/components/ThemeProvider/types.d.ts +2 -0
- package/__inner__/cjs/components/Tooltip/Tooltip.css +11 -16
- package/__inner__/cjs/components/Tooltip/Tooltip.js +1 -2
- package/__inner__/cjs/components/Tooltip/constants.d.ts +1 -0
- package/__inner__/cjs/components/Tooltip/constants.js +3 -1
- package/__inner__/cjs/components/Tooltip/types.d.ts +3 -2
- package/__inner__/cjs/components/Typography/Typography.css +36 -0
- package/__inner__/cjs/components/Typography/Typography.d.ts +1 -1
- package/__inner__/cjs/components/Typography/Typography.js +12 -0
- package/__inner__/esm/components/Alert/Alert.css +0 -5
- package/__inner__/esm/components/Alert/Alert.js +3 -2
- package/__inner__/esm/components/Breadcrumbs/Breadcrumbs.css +4 -0
- package/__inner__/esm/components/Card/Card.css +9 -21
- package/__inner__/esm/components/Card/Card.d.ts +3 -4
- package/__inner__/esm/components/Card/Card.js +11 -1
- package/__inner__/esm/components/Dialog/Dialog.css +0 -2
- package/__inner__/esm/components/Dialog/Dialog.d.ts +21 -1
- package/__inner__/esm/components/Drawer/Drawer.css +0 -1
- package/__inner__/esm/components/Drawer/Drawer.d.ts +23 -1
- package/__inner__/esm/components/Menu/components/MenuItem/MenuItem.js +3 -2
- package/__inner__/esm/components/Modal/Modal.css +4 -3
- package/__inner__/esm/components/Modal/Modal.d.ts +58 -5
- package/__inner__/esm/components/Modal/Modal.js +2 -1
- package/__inner__/esm/components/Paper/Paper.css +44 -0
- package/__inner__/esm/components/Paper/Paper.d.ts +19 -0
- package/__inner__/esm/components/Paper/Paper.js +22 -0
- package/__inner__/esm/components/Paper/index.d.ts +1 -0
- package/__inner__/esm/components/Paper/index.js +1 -0
- package/__inner__/esm/components/Popover/Popover.css +1 -11
- package/__inner__/esm/components/Popover/Popover.d.ts +2 -3
- package/__inner__/esm/components/Popover/Popover.js +6 -5
- package/__inner__/esm/components/Popover/components/PopoverArrow.js +2 -2
- package/__inner__/esm/components/Popover/components/types.d.ts +0 -3
- package/__inner__/esm/components/Popover/components/types.js +0 -1
- package/__inner__/esm/components/Popover/constants.d.ts +1 -0
- package/__inner__/esm/components/Popover/constants.js +2 -0
- package/__inner__/esm/components/Popover/types.d.ts +8 -4
- package/__inner__/esm/components/Portal/Portal.d.ts +8 -8
- package/__inner__/esm/components/Portal/Portal.js +7 -6
- package/__inner__/esm/components/Snackbar/SnackbarProvider.d.ts +4 -1
- package/__inner__/esm/components/Snackbar/components/Snackbar/Snackbar.d.ts +6 -1
- package/__inner__/esm/components/ThemeProvider/ThemeProvider.d.ts +2 -1
- package/__inner__/esm/components/ThemeProvider/types.d.ts +2 -0
- package/__inner__/esm/components/Tooltip/Tooltip.css +11 -16
- package/__inner__/esm/components/Tooltip/Tooltip.js +3 -4
- package/__inner__/esm/components/Tooltip/constants.d.ts +1 -0
- package/__inner__/esm/components/Tooltip/constants.js +2 -0
- package/__inner__/esm/components/Tooltip/types.d.ts +3 -2
- package/__inner__/esm/components/Typography/Typography.css +36 -0
- package/__inner__/esm/components/Typography/Typography.d.ts +1 -1
- package/__inner__/esm/components/Typography/Typography.js +12 -0
- package/package.json +1 -1
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
exports.__esModule = true;
|
|
3
|
-
exports.POPOVER_DEFAULT_PLACEMENT = exports.POPOVER_DEFAULT_DISABLE_RETURN_FOCUS = exports.POPOVER_DEFAULT_DISABLE_ENFORCE_FOCUS = exports.POPOVER_DEFAULT_DISABLE_INTERACTIVE = exports.POPOVER_DEFAULT_OPEN = exports.POPOVER_DEFAULT_ARROW = void 0;
|
|
3
|
+
exports.POPOVER_DEFAULT_PLACEMENT = exports.POPOVER_DEFAULT_DISABLE_RETURN_FOCUS = exports.POPOVER_DEFAULT_DISABLE_ENFORCE_FOCUS = exports.POPOVER_DEFAULT_DISABLE_INTERACTIVE = exports.POPOVER_DEFAULT_OPEN = exports.POPOVER_DEFAULT_ARROW = exports.POPOVER_DEFAULT_TAG = void 0;
|
|
4
|
+
var Paper_1 = require("../Paper");
|
|
5
|
+
exports.POPOVER_DEFAULT_TAG = Paper_1.Paper;
|
|
4
6
|
exports.POPOVER_DEFAULT_ARROW = false;
|
|
5
7
|
exports.POPOVER_DEFAULT_OPEN = false;
|
|
6
8
|
exports.POPOVER_DEFAULT_DISABLE_INTERACTIVE = false;
|
|
@@ -1,16 +1,18 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { RefObject
|
|
1
|
+
import React, { ComponentRef, ElementType } from 'react';
|
|
2
|
+
import type { RefObject } from 'react';
|
|
3
3
|
import PopperJS from '@popperjs/core';
|
|
4
4
|
import type { CSSTransitionProps } from 'react-transition-group/CSSTransition';
|
|
5
|
+
import type { PolymorphicComponentPropsWithRef } from '../../utils/polymorphicComponentWithRef';
|
|
5
6
|
import type { PortalProps } from '../Portal';
|
|
6
7
|
import type { PopoverArrowProps } from './components';
|
|
8
|
+
import { POPOVER_DEFAULT_TAG } from './constants';
|
|
7
9
|
export type VirtualElement = {
|
|
8
10
|
getBoundingClientRect: () => DOMRect;
|
|
9
11
|
contextElement?: Element;
|
|
10
12
|
};
|
|
11
13
|
export declare const popoverPlacementVariant: readonly ["top-start", "top-end", "bottom-start", "bottom-end", "right-start", "right-end", "left-start", "left-end", "auto", "auto-start", "auto-end", "top", "bottom", "right", "left"];
|
|
12
14
|
export type PopoverPlacementVariant = (typeof popoverPlacementVariant)[number];
|
|
13
|
-
export type
|
|
15
|
+
export type PopoverBaseProps = {
|
|
14
16
|
/** Признак по которому компонент будет представлен */
|
|
15
17
|
open?: boolean;
|
|
16
18
|
/** Ссылка на элемент, относительно которого будет позиционироваться поповер */
|
|
@@ -67,4 +69,6 @@ export type PopoverProps = {
|
|
|
67
69
|
setUpdate?: (update: PopperJS.Instance['update'] | null) => void;
|
|
68
70
|
/** Контейнер для монтирования всплывающего окна */
|
|
69
71
|
container?: PortalProps['container'];
|
|
70
|
-
}
|
|
72
|
+
};
|
|
73
|
+
export type PopoverRef = ComponentRef<typeof POPOVER_DEFAULT_TAG>;
|
|
74
|
+
export type PopoverProps<As extends ElementType = typeof POPOVER_DEFAULT_TAG> = PolymorphicComponentPropsWithRef<PopoverBaseProps, As>;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
declare const
|
|
4
|
-
export type PortalRef = ComponentRef<typeof
|
|
5
|
-
export type
|
|
1
|
+
import type { ComponentRef, ElementType } from 'react';
|
|
2
|
+
import { type PolymorphicComponentPropsWithoutRef } from '../../utils/polymorphicComponentWithRef';
|
|
3
|
+
export declare const PORTAL_DEFAULT_TAG = "div";
|
|
4
|
+
export type PortalRef = ComponentRef<typeof PORTAL_DEFAULT_TAG>;
|
|
5
|
+
export type PortalBaseProps = {
|
|
6
6
|
/** Контейнер для монтирования портала */
|
|
7
7
|
container?: Element | DocumentFragment | null;
|
|
8
|
-
}
|
|
9
|
-
export
|
|
10
|
-
export
|
|
8
|
+
};
|
|
9
|
+
export type PortalProps<As extends ElementType = typeof PORTAL_DEFAULT_TAG> = PolymorphicComponentPropsWithoutRef<PortalBaseProps, As>;
|
|
10
|
+
export declare const Portal: import("../../utils/polymorphicComponentWithRef").PolymorphicComponentWithRef<PortalBaseProps, "div">;
|
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
exports.__esModule = true;
|
|
3
|
-
exports.Portal = void 0;
|
|
3
|
+
exports.Portal = exports.PORTAL_DEFAULT_TAG = void 0;
|
|
4
4
|
var tslib_1 = require("tslib");
|
|
5
|
-
var react_1 = tslib_1.
|
|
5
|
+
var react_1 = tslib_1.__importDefault(require("react"));
|
|
6
6
|
var react_dom_1 = require("react-dom");
|
|
7
7
|
var useThemeProps_1 = require("../../hooks/useThemeProps");
|
|
8
|
+
var polymorphicComponentWithRef_1 = require("../../utils/polymorphicComponentWithRef");
|
|
8
9
|
var ThemeProvider_1 = require("../ThemeProvider");
|
|
9
|
-
|
|
10
|
-
exports.Portal = (0,
|
|
10
|
+
exports.PORTAL_DEFAULT_TAG = 'div';
|
|
11
|
+
exports.Portal = (0, polymorphicComponentWithRef_1.polymorphicComponentWithRef)(function (inProps, ref) {
|
|
11
12
|
var _a = (0, useThemeProps_1.useThemeProps)({
|
|
12
13
|
props: inProps,
|
|
13
14
|
name: 'Portal'
|
|
14
|
-
}), children = _a.children, container = _a.container, className = _a.className, other = tslib_1.__rest(_a, ["children", "container", "className"]);
|
|
15
|
+
}), children = _a.children, container = _a.container, className = _a.className, _b = _a.as, Tag = _b === void 0 ? exports.PORTAL_DEFAULT_TAG : _b, other = tslib_1.__rest(_a, ["children", "container", "className", "as"]);
|
|
15
16
|
var theme = (0, ThemeProvider_1.useTheme)();
|
|
16
17
|
var portalContainer = container || window.document.body;
|
|
17
|
-
return (0, react_dom_1.createPortal)(react_1["default"].createElement(ThemeProvider_1.ThemeProvider, tslib_1.__assign({ theme: theme, className: className }, other, { ref: ref }), children), portalContainer);
|
|
18
|
+
return (0, react_dom_1.createPortal)(react_1["default"].createElement(ThemeProvider_1.ThemeProvider, tslib_1.__assign({ theme: theme, className: className, as: Tag }, other, { ref: ref }), children), portalContainer);
|
|
18
19
|
});
|
|
19
20
|
exports.Portal.displayName = 'Portal';
|
|
@@ -7,4 +7,7 @@ export type SnackbarProviderProps = Partial<SnackbarProps> & SnackbarCommonProps
|
|
|
7
7
|
/** Максимальное количество одновременно отображенных сообщений */
|
|
8
8
|
maxMessages?: number;
|
|
9
9
|
};
|
|
10
|
-
export declare const SnackbarProvider: React.ForwardRefExoticComponent<
|
|
10
|
+
export declare const SnackbarProvider: React.ForwardRefExoticComponent<Partial<SnackbarProps> & SnackbarCommonProps & {
|
|
11
|
+
/** Максимальное количество одновременно отображенных сообщений */
|
|
12
|
+
maxMessages?: number | undefined;
|
|
13
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -8,4 +8,9 @@ export type SnackbarProps = PortalProps & {
|
|
|
8
8
|
/** Расположение сообщения относительно контейнера */
|
|
9
9
|
anchorOrigin: SnackbarAnchorOrigin;
|
|
10
10
|
};
|
|
11
|
-
export declare const Snackbar: React.ForwardRefExoticComponent<
|
|
11
|
+
export declare const Snackbar: React.ForwardRefExoticComponent<import("../../../Portal").PortalBaseProps & {
|
|
12
|
+
as?: "div" | undefined;
|
|
13
|
+
} & Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "container"> & {
|
|
14
|
+
/** Расположение сообщения относительно контейнера */
|
|
15
|
+
anchorOrigin: SnackbarAnchorOrigin;
|
|
16
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import './ThemeProvider.css';
|
|
2
|
-
import React, { ElementType } from 'react';
|
|
2
|
+
import React, { ComponentRef, ElementType } from 'react';
|
|
3
3
|
import { type PolymorphicComponentPropsWithoutRef } from '../../utils/polymorphicComponentWithRef';
|
|
4
4
|
import type { Theme } from './types';
|
|
5
5
|
export declare const THEME_DEFAULT_TAG = "div";
|
|
@@ -11,4 +11,5 @@ export type ThemeProviderBaseProps = {
|
|
|
11
11
|
};
|
|
12
12
|
export declare const cnThemeProvider: import("@bem-react/classname").ClassNameFormatter;
|
|
13
13
|
export type ThemeProviderProps<As extends ElementType = typeof THEME_DEFAULT_TAG> = PolymorphicComponentPropsWithoutRef<ThemeProviderBaseProps, As>;
|
|
14
|
+
export type ThemeProviderRef = ComponentRef<typeof THEME_DEFAULT_TAG>;
|
|
14
15
|
export declare const ThemeProvider: import("../../utils/polymorphicComponentWithRef").PolymorphicComponentWithRef<ThemeProviderBaseProps, "div">;
|
|
@@ -27,6 +27,7 @@ import type { LoaderProps } from '../Loader';
|
|
|
27
27
|
import type { MenuProps, MenuItemProps, MenuListProps } from '../Menu';
|
|
28
28
|
import type { ModalProps } from '../Modal';
|
|
29
29
|
import type { PaginationProps } from '../Pagination';
|
|
30
|
+
import type { PaperProps } from '../Paper';
|
|
30
31
|
import type { PopoverProps } from '../Popover';
|
|
31
32
|
import type { PortalProps } from '../Portal';
|
|
32
33
|
import type { RadioProps } from '../Radio';
|
|
@@ -91,6 +92,7 @@ export type Theme = {
|
|
|
91
92
|
MenuList?: Partial<MenuListProps>;
|
|
92
93
|
Modal?: Partial<ModalProps>;
|
|
93
94
|
Pagination?: Partial<PaginationProps>;
|
|
95
|
+
Paper?: Partial<PaperProps>;
|
|
94
96
|
Popover?: Partial<PopoverProps>;
|
|
95
97
|
Portal?: Partial<PortalProps>;
|
|
96
98
|
Radio?: Partial<RadioProps>;
|
|
@@ -1,33 +1,28 @@
|
|
|
1
1
|
/* stylelint-disable */
|
|
2
|
-
.
|
|
2
|
+
.Tooltip {
|
|
3
3
|
max-inline-size: 300px;
|
|
4
|
-
box-shadow: var(--shadow-m);
|
|
5
4
|
}
|
|
6
|
-
.
|
|
7
|
-
|
|
8
|
-
color: var(--color-content-primary-inverse);
|
|
9
|
-
}
|
|
10
|
-
.Popover.Tooltip_variant_light {
|
|
11
|
-
background: var(--color-background-main);
|
|
12
|
-
color: var(--color-content-primary);
|
|
13
|
-
}
|
|
14
|
-
.Popover.Tooltip_size_xs {
|
|
15
|
-
padding: 8px 12px;
|
|
5
|
+
.Tooltip_size_xs {
|
|
6
|
+
padding: var(--space-s) var(--space-m);
|
|
16
7
|
|
|
17
8
|
font: var(--typography-text-xs-font);
|
|
18
9
|
|
|
19
10
|
letter-spacing: var(--typography-text-xs-letter_spacing, 0);
|
|
20
11
|
|
|
21
12
|
text-transform: var(--typography-text-xs-text_transform, none);
|
|
22
|
-
border-radius: var(--border-radius-s);
|
|
23
13
|
}
|
|
24
|
-
.
|
|
25
|
-
padding:
|
|
14
|
+
.Tooltip_size_s {
|
|
15
|
+
padding: var(--space-m) var(--space-l);
|
|
26
16
|
|
|
27
17
|
font: var(--typography-text-s-font);
|
|
28
18
|
|
|
29
19
|
letter-spacing: var(--typography-text-s-letter_spacing, 0);
|
|
30
20
|
|
|
31
21
|
text-transform: var(--typography-text-s-text_transform, none);
|
|
32
|
-
|
|
22
|
+
}
|
|
23
|
+
.Tooltip_variant_light {
|
|
24
|
+
color: var(--color-content-primary);
|
|
25
|
+
}
|
|
26
|
+
.Tooltip_variant_dark {
|
|
27
|
+
color: var(--color-content-primary-inverse);
|
|
33
28
|
}
|
|
@@ -114,8 +114,7 @@ exports.Tooltip = (0, react_1.forwardRef)(function (inProps, ref) {
|
|
|
114
114
|
]);
|
|
115
115
|
return (react_1["default"].createElement(react_1["default"].Fragment, null,
|
|
116
116
|
react_1["default"].cloneElement(resolveChildren, composeChildrenProps),
|
|
117
|
-
react_1["default"].createElement(Popover_1.Popover, tslib_1.__assign({ anchorRef: anchorRef }, other, { ref: ref, offset: offset, placement: placement, open: openState && !disabled, onClose: handleClose, className: (0, exports.cnTooltip)({ size: size, variant: variant }, [className]), disableInteractive: disableInteractive, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, arrow: arrow, arrowProps: {
|
|
118
|
-
variant: variant,
|
|
117
|
+
react_1["default"].createElement(Popover_1.Popover, tslib_1.__assign({ anchorRef: anchorRef, as: constants_1.TOOLTIP_DEFAULT_TAG, background: variant === 'light' ? 'main' : 'main-inverse', radius: size }, other, { ref: ref, offset: offset, placement: placement, open: openState && !disabled, onClose: handleClose, className: (0, exports.cnTooltip)({ size: size, variant: variant }, [className]), disableInteractive: disableInteractive, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, arrow: arrow, arrowProps: {
|
|
119
118
|
size: size
|
|
120
119
|
}, disableEnforceFocus: true, disableReturnFocus: true }), label)));
|
|
121
120
|
});
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export declare const TOOLTIP_DEFAULT_TAG: import("../../utils/polymorphicComponentWithRef").PolymorphicComponentWithRef<import("../Paper").PaperBaseProps, "div">;
|
|
1
2
|
export declare const TOOLTIP_DEFAULT_TRIGGER = "hover";
|
|
2
3
|
export declare const TOOLTIP_DEFAULT_SIZE = "s";
|
|
3
4
|
export declare const TOOLTIP_DEFAULT_VARIANT = "dark";
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
exports.__esModule = true;
|
|
3
|
-
exports.TOOLTIP_DEFAULT_DISABLED = exports.TOOLTIP_DEFAULT_SHOULD_WRAP_CHILDREN = exports.TOOLTIP_DEFAULT_ARROW = exports.TOOLTIP_DEFAULT_DELAY_LEAVE = exports.TOOLTIP_DEFAULT_DELAY_ENTER = exports.TOOLTIP_DEFAULT_OFFSET = exports.TOOLTIP_DEFAULT_VARIANT = exports.TOOLTIP_DEFAULT_SIZE = exports.TOOLTIP_DEFAULT_TRIGGER = void 0;
|
|
3
|
+
exports.TOOLTIP_DEFAULT_DISABLED = exports.TOOLTIP_DEFAULT_SHOULD_WRAP_CHILDREN = exports.TOOLTIP_DEFAULT_ARROW = exports.TOOLTIP_DEFAULT_DELAY_LEAVE = exports.TOOLTIP_DEFAULT_DELAY_ENTER = exports.TOOLTIP_DEFAULT_OFFSET = exports.TOOLTIP_DEFAULT_VARIANT = exports.TOOLTIP_DEFAULT_SIZE = exports.TOOLTIP_DEFAULT_TRIGGER = exports.TOOLTIP_DEFAULT_TAG = void 0;
|
|
4
|
+
var Paper_1 = require("../Paper");
|
|
5
|
+
exports.TOOLTIP_DEFAULT_TAG = Paper_1.Paper;
|
|
4
6
|
exports.TOOLTIP_DEFAULT_TRIGGER = 'hover';
|
|
5
7
|
exports.TOOLTIP_DEFAULT_SIZE = 's';
|
|
6
8
|
exports.TOOLTIP_DEFAULT_VARIANT = 'dark';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Ref, ReactNode, ReactElement, ComponentPropsWithRef } from 'react';
|
|
2
|
-
import type {
|
|
2
|
+
import type { PopoverBaseProps } from '../Popover';
|
|
3
|
+
import { TOOLTIP_DEFAULT_TAG } from './constants';
|
|
3
4
|
export declare const tooltipSizeVariant: readonly ["xs", "s"];
|
|
4
5
|
export type TooltipSizeVariant = (typeof tooltipSizeVariant)[number];
|
|
5
6
|
export declare const tooltipVariant: readonly ["light", "dark"];
|
|
@@ -39,4 +40,4 @@ export type TooltipProps = {
|
|
|
39
40
|
'data-testid'?: string;
|
|
40
41
|
/** Дополнительные CSS-классы */
|
|
41
42
|
className?: string;
|
|
42
|
-
} & Pick<
|
|
43
|
+
} & Pick<PopoverBaseProps, 'offset' | 'placement' | 'arrow' | 'anchorRef' | 'ignoreClickOutsideRefs' | 'disableInteractive' | 'onEnter' | 'onEntered' | 'onExit' | 'onExited' | 'setUpdate'> & ComponentPropsWithRef<typeof TOOLTIP_DEFAULT_TAG>;
|
|
@@ -56,33 +56,69 @@
|
|
|
56
56
|
.Typography_color_actionDark {
|
|
57
57
|
color: var(--color-content-action-dark);
|
|
58
58
|
}
|
|
59
|
+
.Typography_color_actionPressed {
|
|
60
|
+
color: var(--color-content-action-pressed);
|
|
61
|
+
}
|
|
59
62
|
.Typography_color_actionOn {
|
|
60
63
|
color: var(--color-content-action-on);
|
|
61
64
|
}
|
|
62
65
|
.Typography_color_error {
|
|
63
66
|
color: var(--color-content-error);
|
|
64
67
|
}
|
|
68
|
+
.Typography_color_errorHover {
|
|
69
|
+
color: var(--color-content-error-hover);
|
|
70
|
+
}
|
|
71
|
+
.Typography_color_errorPressed {
|
|
72
|
+
color: var(--color-content-error-pressed);
|
|
73
|
+
}
|
|
65
74
|
.Typography_color_errorDark {
|
|
66
75
|
color: var(--color-content-error-dark);
|
|
67
76
|
}
|
|
68
77
|
.Typography_color_warning {
|
|
69
78
|
color: var(--color-content-warning);
|
|
70
79
|
}
|
|
80
|
+
.Typography_color_warningHover {
|
|
81
|
+
color: var(--color-content-warning-hover);
|
|
82
|
+
}
|
|
83
|
+
.Typography_color_warningPressed {
|
|
84
|
+
color: var(--color-content-warning-pressed);
|
|
85
|
+
}
|
|
71
86
|
.Typography_color_warningDark {
|
|
72
87
|
color: var(--color-content-warning-dark);
|
|
73
88
|
}
|
|
74
89
|
.Typography_color_success {
|
|
75
90
|
color: var(--color-content-success);
|
|
76
91
|
}
|
|
92
|
+
.Typography_color_successHover {
|
|
93
|
+
color: var(--color-content-success-hover);
|
|
94
|
+
}
|
|
95
|
+
.Typography_color_successPressed {
|
|
96
|
+
color: var(--color-content-success-pressed);
|
|
97
|
+
}
|
|
77
98
|
.Typography_color_successDark {
|
|
78
99
|
color: var(--color-content-success-dark);
|
|
79
100
|
}
|
|
80
101
|
.Typography_color_info {
|
|
81
102
|
color: var(--color-content-info);
|
|
82
103
|
}
|
|
104
|
+
.Typography_color_infoHover {
|
|
105
|
+
color: var(--color-content-info-hover);
|
|
106
|
+
}
|
|
107
|
+
.Typography_color_infoPressed {
|
|
108
|
+
color: var(--color-content-info-pressed);
|
|
109
|
+
}
|
|
83
110
|
.Typography_color_infoDark {
|
|
84
111
|
color: var(--color-content-info-dark);
|
|
85
112
|
}
|
|
113
|
+
.Typography_color_accentMain {
|
|
114
|
+
color: var(--color-content-accent-main);
|
|
115
|
+
}
|
|
116
|
+
.Typography_color_accentPrimary {
|
|
117
|
+
color: var(--color-content-accent-primary);
|
|
118
|
+
}
|
|
119
|
+
.Typography_color_accentDisabled {
|
|
120
|
+
color: var(--color-content-accent-disabled);
|
|
121
|
+
}
|
|
86
122
|
.Typography_variant_heading-4xl {
|
|
87
123
|
font: var(--typography-heading-4xl-font);
|
|
88
124
|
letter-spacing: var(--typography-heading-4xl-letter_spacing, 0);
|
|
@@ -7,7 +7,7 @@ export declare const typographyDisplayVariant: readonly ["block", "inline", "inl
|
|
|
7
7
|
export type TypographyDisplayVariant = (typeof typographyDisplayVariant)[number];
|
|
8
8
|
export declare const typographyAlignVariant: readonly ["left", "center", "right"];
|
|
9
9
|
export type TypographyAlignVariant = (typeof typographyAlignVariant)[number];
|
|
10
|
-
export declare const typographyColorVariant: readonly ["primary", "secondary", "tertiary", "disabled", "ghostDisabled", "action", "actionHover", "actionDark", "actionOn", "error", "errorDark", "warning", "warningDark", "success", "successDark", "info", "infoDark", "primaryInverse"];
|
|
10
|
+
export declare const typographyColorVariant: readonly ["primary", "secondary", "tertiary", "disabled", "ghostDisabled", "action", "actionPressed", "actionHover", "actionDark", "actionOn", "error", "errorHover", "errorPressed", "errorDark", "warning", "warningHover", "warningPressed", "warningDark", "success", "successHover", "successDark", "successPressed", "info", "infoHover", "infoPressed", "infoDark", "primaryInverse", "accentMain", "accentPrimary", "accentDisabled"];
|
|
11
11
|
export type TypographyColorVariant = (typeof typographyColorVariant)[number];
|
|
12
12
|
export type TypographyBaseProps = {
|
|
13
13
|
/** Вариант типографики */
|
|
@@ -50,18 +50,30 @@ exports.typographyColorVariant = [
|
|
|
50
50
|
'disabled',
|
|
51
51
|
'ghostDisabled',
|
|
52
52
|
'action',
|
|
53
|
+
'actionPressed',
|
|
53
54
|
'actionHover',
|
|
54
55
|
'actionDark',
|
|
55
56
|
'actionOn',
|
|
56
57
|
'error',
|
|
58
|
+
'errorHover',
|
|
59
|
+
'errorPressed',
|
|
57
60
|
'errorDark',
|
|
58
61
|
'warning',
|
|
62
|
+
'warningHover',
|
|
63
|
+
'warningPressed',
|
|
59
64
|
'warningDark',
|
|
60
65
|
'success',
|
|
66
|
+
'successHover',
|
|
61
67
|
'successDark',
|
|
68
|
+
'successPressed',
|
|
62
69
|
'info',
|
|
70
|
+
'infoHover',
|
|
71
|
+
'infoPressed',
|
|
63
72
|
'infoDark',
|
|
64
73
|
'primaryInverse',
|
|
74
|
+
'accentMain',
|
|
75
|
+
'accentPrimary',
|
|
76
|
+
'accentDisabled',
|
|
65
77
|
];
|
|
66
78
|
exports.cnTypography = (0, classname_1.cn)('Typography');
|
|
67
79
|
exports.Typography = (0, polymorphicComponentWithRef_1.polymorphicComponentWithRef)(function (inProps, ref) {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
/* stylelint-disable */
|
|
2
2
|
.Alert {
|
|
3
3
|
position: relative;
|
|
4
|
-
border-radius: var(--border-radius-xs);
|
|
5
4
|
display: flex;
|
|
6
5
|
-moz-column-gap: var(--space-s);
|
|
7
6
|
column-gap: var(--space-s);
|
|
@@ -11,8 +10,6 @@
|
|
|
11
10
|
box-sizing: border-box;
|
|
12
11
|
border-inline-start: 4px solid var(--alert-border-color);
|
|
13
12
|
padding: 16px;
|
|
14
|
-
box-shadow: var(--shadow-m);
|
|
15
|
-
background-color: var(--alert-background-color);
|
|
16
13
|
|
|
17
14
|
font: var(--typography-text-xs-font);
|
|
18
15
|
|
|
@@ -21,14 +18,12 @@
|
|
|
21
18
|
text-transform: var(--typography-text-xs-text_transform, none);
|
|
22
19
|
}
|
|
23
20
|
.Alert_color_light {
|
|
24
|
-
--alert-background-color: var(--color-background-main);
|
|
25
21
|
--alert-title-text-color: var(--color-content-primary);
|
|
26
22
|
--alert-body-text-color: var(--color-content-secondary);
|
|
27
23
|
--alert-icon-color: var(--color-content-primary);
|
|
28
24
|
--alert-close-button-color: var(--color-background-main-inverse);
|
|
29
25
|
}
|
|
30
26
|
.Alert_color_dark {
|
|
31
|
-
--alert-background-color: var(--color-background-main-inverse);
|
|
32
27
|
--alert-title-text-color: var(--color-content-primary-inverse);
|
|
33
28
|
--alert-body-text-color: var(--color-content-tertiary);
|
|
34
29
|
--alert-icon-color: var(--color-content-primary-inverse);
|
|
@@ -5,6 +5,7 @@ import { CloseIcon, InfoCircleFilledIcon, CheckCircleFilledIcon, WarningTriangle
|
|
|
5
5
|
import { useThemeProps } from '../../hooks/useThemeProps';
|
|
6
6
|
import { cn } from '../../utils/classname';
|
|
7
7
|
import { IconButton } from '../IconButton';
|
|
8
|
+
import { Paper } from '../Paper';
|
|
8
9
|
import { ALERT_DEFAULT_STATUS, ALERT_DEFAULT_SHOW_ICON, ALERT_DEFAULT_COLOR, } from './constants';
|
|
9
10
|
export var cnAlert = cn('Alert');
|
|
10
11
|
export var alertStatusVariant = [
|
|
@@ -40,9 +41,9 @@ export var Alert = forwardRef(function (inProps, ref) {
|
|
|
40
41
|
}
|
|
41
42
|
return React.cloneElement(actionProp, actionProps);
|
|
42
43
|
}, [actionProp]);
|
|
43
|
-
return (React.createElement(
|
|
44
|
+
return (React.createElement(Paper, __assign({ role: "alert", radius: "xs", shadow: "m", background: color === 'light' ? 'main' : 'main-inverse', className: cnAlert({ status: status, hasCloseButton: !!onClose, color: color }, [
|
|
44
45
|
className,
|
|
45
|
-
])
|
|
46
|
+
]) }, otherProps, { ref: ref }),
|
|
46
47
|
showIcon && (React.createElement("div", { className: cnAlert('Icon') }, matchStatusToIcon[status])),
|
|
47
48
|
React.createElement("div", { className: cnAlert('Content') },
|
|
48
49
|
React.createElement("div", { className: cnAlert('Title') }, title),
|
|
@@ -1,26 +1,21 @@
|
|
|
1
1
|
.Card {
|
|
2
2
|
position: relative;
|
|
3
|
-
background-color: var(--card-background-color);
|
|
4
3
|
padding: var(--card-padding);
|
|
5
4
|
cursor: var(--card-cursor-style);
|
|
6
|
-
border-radius: var(--card-border-radius);
|
|
7
5
|
transition: var(--transition-default);
|
|
8
6
|
box-sizing: border-box;
|
|
9
7
|
}
|
|
10
8
|
|
|
11
9
|
.Card_size_s {
|
|
12
10
|
--card-padding: var(--space-l);
|
|
13
|
-
--card-border-radius: var(--border-radius-xs);
|
|
14
11
|
}
|
|
15
12
|
|
|
16
13
|
.Card_size_m {
|
|
17
14
|
--card-padding: var(--space-xl);
|
|
18
|
-
--card-border-radius: var(--border-radius-m);
|
|
19
15
|
}
|
|
20
16
|
|
|
21
17
|
.Card_size_l {
|
|
22
18
|
--card-padding: var(--space-2xl);
|
|
23
|
-
--card-border-radius: var(--border-radius-l);
|
|
24
19
|
}
|
|
25
20
|
|
|
26
21
|
.Card_interactive {
|
|
@@ -32,8 +27,9 @@
|
|
|
32
27
|
position: absolute;
|
|
33
28
|
inset: 0;
|
|
34
29
|
pointer-events: none;
|
|
35
|
-
border: var(--card-border-width) var(--card-border-style)
|
|
36
|
-
|
|
30
|
+
border: var(--card-border-width) var(--card-border-style)
|
|
31
|
+
var(--card-border-color);
|
|
32
|
+
border-radius: var(--paper-border-radius);
|
|
37
33
|
transition: var(--transition-default);
|
|
38
34
|
}
|
|
39
35
|
|
|
@@ -61,14 +57,6 @@
|
|
|
61
57
|
--card-border-style: dashed;
|
|
62
58
|
}
|
|
63
59
|
|
|
64
|
-
.Card_backgroundColor_standard {
|
|
65
|
-
--card-background-color: var(--color-background-main);
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
.Card_backgroundColor_selected {
|
|
69
|
-
--card-background-color: var(--color-background-action-light);
|
|
70
|
-
}
|
|
71
|
-
|
|
72
60
|
.Card_interactive.Card_borderColor_standard:hover {
|
|
73
61
|
--card-border-color: var(--color-border-secondary-hover);
|
|
74
62
|
}
|
|
@@ -85,12 +73,6 @@
|
|
|
85
73
|
--card-border-color: var(--color-border-action-pressed);
|
|
86
74
|
}
|
|
87
75
|
|
|
88
|
-
.Card_disabled {
|
|
89
|
-
--card-background-color: var(--color-background-disabled);
|
|
90
|
-
--card-border-color: var(--color-border-disabled);
|
|
91
|
-
pointer-events: none;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
76
|
.Card:focus {
|
|
95
77
|
outline: 0;
|
|
96
78
|
box-shadow: var(--shadow-outline-focused);
|
|
@@ -99,3 +81,9 @@
|
|
|
99
81
|
.Card:focus:not(:focus-visible) {
|
|
100
82
|
box-shadow: none;
|
|
101
83
|
}
|
|
84
|
+
|
|
85
|
+
.Card[aria-disabled='true'] {
|
|
86
|
+
--card-border-color: var(--color-border-disabled);
|
|
87
|
+
background-color: var(--color-background-disabled);
|
|
88
|
+
pointer-events: none;
|
|
89
|
+
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import './Card.css';
|
|
2
|
-
import { ElementType } from 'react';
|
|
3
|
-
import type
|
|
4
|
-
import { type PolymorphicComponentPropsWithoutRef } from '../../utils/polymorphicComponentWithRef';
|
|
2
|
+
import type { ReactNode, ElementType } from 'react';
|
|
3
|
+
import { type PolymorphicComponentPropsWithRef } from '../../utils/polymorphicComponentWithRef';
|
|
5
4
|
export declare const cnCard: import("@bem-react/classname").ClassNameFormatter;
|
|
6
5
|
export declare const cardSizeVariant: readonly ["s", "m", "l"];
|
|
7
6
|
export declare const cardBorderWidthVariant: readonly ["none", "s", "m"];
|
|
@@ -34,5 +33,5 @@ export type CardBaseProps = {
|
|
|
34
33
|
className?: string;
|
|
35
34
|
'data-testid'?: string;
|
|
36
35
|
};
|
|
37
|
-
export type CardProps<As extends ElementType = 'div'> =
|
|
36
|
+
export type CardProps<As extends ElementType = 'div'> = PolymorphicComponentPropsWithRef<CardBaseProps, As>;
|
|
38
37
|
export declare const Card: import("../../utils/polymorphicComponentWithRef").PolymorphicComponentWithRef<CardBaseProps, "div">;
|
|
@@ -4,18 +4,28 @@ import React from 'react';
|
|
|
4
4
|
import { useThemeProps } from '../../hooks/useThemeProps';
|
|
5
5
|
import { cn } from '../../utils/classname';
|
|
6
6
|
import { polymorphicComponentWithRef, } from '../../utils/polymorphicComponentWithRef';
|
|
7
|
+
import { Paper, } from '../Paper';
|
|
7
8
|
export var cnCard = cn('Card');
|
|
8
9
|
export var cardSizeVariant = ['s', 'm', 'l'];
|
|
9
10
|
export var cardBorderWidthVariant = ['none', 's', 'm'];
|
|
10
11
|
export var cardBorderVariant = ['solid', 'dashed'];
|
|
11
12
|
export var cardBorderColorVariant = ['standard', 'selected'];
|
|
12
13
|
export var cardBackgroundColorVariant = ['standard', 'selected'];
|
|
14
|
+
var matchBorderRadiusPaperToCard = {
|
|
15
|
+
s: 'xs',
|
|
16
|
+
m: 's',
|
|
17
|
+
l: 'l'
|
|
18
|
+
};
|
|
19
|
+
var matchBackgroundColorPaperToCard = {
|
|
20
|
+
selected: 'action-light',
|
|
21
|
+
standard: 'main'
|
|
22
|
+
};
|
|
13
23
|
export var Card = polymorphicComponentWithRef(function (inProps, ref) {
|
|
14
24
|
var props = useThemeProps({ props: inProps, name: 'Card' });
|
|
15
25
|
var _a = props.size, size = _a === void 0 ? 'm' : _a, _b = props.disabled, disabled = _b === void 0 ? false : _b, _c = props.interactive, interactive = _c === void 0 ? false : _c, _d = props.borderWidth, borderWidth = _d === void 0 ? 's' : _d, _e = props.borderVariant, borderVariant = _e === void 0 ? 'solid' : _e, _f = props.borderColor, borderColor = _f === void 0 ? 'standard' : _f, _g = props.backgroundColor, backgroundColor = _g === void 0 ? 'standard' : _g, _h = props.as, Tag = _h === void 0 ? 'div' : _h, className = props.className, children = props.children, other = __rest(props, ["size", "disabled", "interactive", "borderWidth", "borderVariant", "borderColor", "backgroundColor", "as", "className", "children"]);
|
|
16
26
|
var shouldBeInteractive = !disabled && interactive;
|
|
17
27
|
var shouldShowBorder = borderWidth !== 'none';
|
|
18
|
-
return (React.createElement(
|
|
28
|
+
return (React.createElement(Paper, __assign({ as: Tag, radius: matchBorderRadiusPaperToCard[size], background: matchBackgroundColorPaperToCard[backgroundColor] }, other, { ref: ref, "aria-disabled": disabled }, (shouldBeInteractive && { tabIndex: 0 }), { className: cnCard(__assign({ size: size, disabled: disabled, interactive: shouldBeInteractive, backgroundColor: backgroundColor, borderWidth: borderWidth }, (shouldShowBorder && {
|
|
19
29
|
borderVariant: borderVariant,
|
|
20
30
|
borderColor: borderColor
|
|
21
31
|
})), [className]) }), children));
|
|
@@ -13,8 +13,6 @@
|
|
|
13
13
|
max-inline-size: var(--modal-width);
|
|
14
14
|
/* stylelint-disable-next-line plugin/use-logical-units */
|
|
15
15
|
max-block-size: calc(100vh - 64px);
|
|
16
|
-
border-radius: var(--border-radius-m);
|
|
17
|
-
box-shadow: var(--shadow-l);
|
|
18
16
|
}
|
|
19
17
|
.Dialog-InnerContainer {
|
|
20
18
|
display: flex;
|
|
@@ -28,4 +28,24 @@ export type DialogProps = {
|
|
|
28
28
|
/** Кастомный класс контейнера диалогового окна */
|
|
29
29
|
className?: string;
|
|
30
30
|
} & Omit<ModalProps, 'open' | 'onClose' | 'children' | 'className'>;
|
|
31
|
-
export declare const Dialog: React.ForwardRefExoticComponent<
|
|
31
|
+
export declare const Dialog: React.ForwardRefExoticComponent<{
|
|
32
|
+
/** Признак по которому компонент будет представлен */
|
|
33
|
+
open: boolean;
|
|
34
|
+
/** Содержимое диалогового окна */
|
|
35
|
+
children: React.ReactNode;
|
|
36
|
+
/** Устанавливает размер типографики и отступов в диалоговом окне */
|
|
37
|
+
size?: "s" | "l" | undefined;
|
|
38
|
+
/** Вариант диалогового окна */
|
|
39
|
+
variant?: "small" | "medium" | "large" | "fullsize" | undefined;
|
|
40
|
+
/** Функция обратного вызова которая будет вызвана когда компонент запрашивает
|
|
41
|
+
* закрытие (нажатие на клавишу {ESC}, клик по подложке Backdrop) */
|
|
42
|
+
onClose?: (() => void) | undefined;
|
|
43
|
+
/** Свойства кнопки закрытия диалогового окна */
|
|
44
|
+
closeButtonProps?: (Omit<IconButtonProps<"button">, "icon"> & {
|
|
45
|
+
'data-testid'?: string | undefined;
|
|
46
|
+
}) | undefined;
|
|
47
|
+
/** Признак по которому кнопка закрытия диалогового окна будет скрыта */
|
|
48
|
+
hideCloseButton?: boolean | undefined;
|
|
49
|
+
/** Кастомный класс контейнера диалогового окна */
|
|
50
|
+
className?: string | undefined;
|
|
51
|
+
} & Omit<ModalProps, "className" | "children" | "open" | "onClose"> & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -32,4 +32,26 @@ export type DrawerProps = {
|
|
|
32
32
|
/** Кастомный класс контейнера шторки */
|
|
33
33
|
className?: string;
|
|
34
34
|
} & Omit<ModalProps, 'open' | 'onClose' | 'children' | 'className'>;
|
|
35
|
-
export declare const Drawer: React.ForwardRefExoticComponent<
|
|
35
|
+
export declare const Drawer: React.ForwardRefExoticComponent<{
|
|
36
|
+
/** Признак по которому компонент будет представлен */
|
|
37
|
+
open?: boolean | undefined;
|
|
38
|
+
/** Вариант представления шторки */
|
|
39
|
+
variant?: "medium" | "large" | "little" | undefined;
|
|
40
|
+
/** Устанавливает размер типографики и отступов в шторке */
|
|
41
|
+
size?: "s" | "l" | undefined;
|
|
42
|
+
/** Функция обратного вызова которая будет вызвана когда компонент запрашивает
|
|
43
|
+
* закрытие (нажатие на клавишу {ESC}, клик по подложке Backdrop) */
|
|
44
|
+
onClose?: (() => void) | undefined;
|
|
45
|
+
/** Содержимое шторки */
|
|
46
|
+
children?: React.ReactNode;
|
|
47
|
+
/** Расположение шторки */
|
|
48
|
+
placement?: "left" | "right" | undefined;
|
|
49
|
+
/** Признак по которому кнопка закрытия шторки будет скрыта */
|
|
50
|
+
hideCloseButton?: boolean | undefined;
|
|
51
|
+
/** Свойства кнопки закрытия шторки */
|
|
52
|
+
closeButtonProps?: (Omit<IconButtonProps<"button">, "icon"> & {
|
|
53
|
+
'data-testid'?: string | undefined;
|
|
54
|
+
}) | undefined;
|
|
55
|
+
/** Кастомный класс контейнера шторки */
|
|
56
|
+
className?: string | undefined;
|
|
57
|
+
} & Omit<ModalProps, "className" | "children" | "open" | "onClose"> & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -5,10 +5,11 @@ import { useThemeProps } from '../../../../hooks/useThemeProps';
|
|
|
5
5
|
import { cn } from '../../../../utils/classname';
|
|
6
6
|
import { polymorphicComponentWithRef, } from '../../../../utils/polymorphicComponentWithRef';
|
|
7
7
|
import { cnListItemButton, ListItemButton, } from '../../../List';
|
|
8
|
+
import { LIST_ITEM_BUTTON_DEFAULT_TAG } from '../../../List/constants';
|
|
8
9
|
export var cnMenuItem = cn('MenuItem');
|
|
9
10
|
export var MenuItem = polymorphicComponentWithRef(function (inProps, ref) {
|
|
10
11
|
var props = useThemeProps({ props: inProps, name: 'MenuItem' });
|
|
11
|
-
var children = props.children, selected = props.selected, value = props.value, label = props.label, _a = props.autoFocus, autoFocus = _a === void 0 ? false : _a, className = props.className, other = __rest(props, ["children", "selected", "value", "label", "autoFocus", "className"]);
|
|
12
|
+
var children = props.children, selected = props.selected, value = props.value, label = props.label, _a = props.autoFocus, autoFocus = _a === void 0 ? false : _a, className = props.className, _b = props.as, Tag = _b === void 0 ? LIST_ITEM_BUTTON_DEFAULT_TAG : _b, other = __rest(props, ["children", "selected", "value", "label", "autoFocus", "className", "as"]);
|
|
12
13
|
var innerRef = useRef(null);
|
|
13
14
|
useEffect(function () {
|
|
14
15
|
var _a;
|
|
@@ -16,6 +17,6 @@ export var MenuItem = polymorphicComponentWithRef(function (inProps, ref) {
|
|
|
16
17
|
(_a = innerRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
17
18
|
}
|
|
18
19
|
}, [autoFocus]);
|
|
19
|
-
return (React.createElement(ListItemButton, __assign({ role: "menuitem" }, other, { ref: useMultiRef([ref, innerRef]), className: cnListItemButton({ selected: selected }, [className, cnMenuItem()]), "data-value": value, "data-label": label }), children));
|
|
20
|
+
return (React.createElement(ListItemButton, __assign({ role: "menuitem", as: Tag }, other, { ref: useMultiRef([ref, innerRef]), className: cnListItemButton({ selected: selected }, [className, cnMenuItem()]), "data-value": value, "data-label": label }), children));
|
|
20
21
|
});
|
|
21
22
|
MenuItem.displayName = 'MenuItem';
|