@ozen-ui/kit 0.6.0 → 0.8.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 +8 -11
- package/__inner__/cjs/components/Modal/Modal.d.ts +74 -5
- package/__inner__/cjs/components/Modal/Modal.js +13 -20
- package/__inner__/cjs/components/Modal/components/ModalConsumer.d.ts +5 -0
- package/__inner__/cjs/components/Modal/components/ModalConsumer.js +15 -0
- package/__inner__/cjs/components/Modal/components/index.d.ts +1 -0
- package/__inner__/cjs/components/Modal/components/index.js +4 -0
- 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__/cjs/hooks/useLockBodyScroll/index.d.ts +1 -0
- package/__inner__/cjs/hooks/useLockBodyScroll/index.js +4 -0
- package/__inner__/cjs/hooks/useLockBodyScroll/useLockBodyScroll.d.ts +1 -0
- package/__inner__/cjs/hooks/useLockBodyScroll/useLockBodyScroll.js +18 -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 +8 -11
- package/__inner__/esm/components/Modal/Modal.d.ts +74 -5
- package/__inner__/esm/components/Modal/Modal.js +13 -20
- package/__inner__/esm/components/Modal/components/ModalConsumer.d.ts +5 -0
- package/__inner__/esm/components/Modal/components/ModalConsumer.js +12 -0
- package/__inner__/esm/components/Modal/components/index.d.ts +1 -0
- package/__inner__/esm/components/Modal/components/index.js +1 -0
- 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/__inner__/esm/hooks/useLockBodyScroll/index.d.ts +1 -0
- package/__inner__/esm/hooks/useLockBodyScroll/index.js +1 -0
- package/__inner__/esm/hooks/useLockBodyScroll/useLockBodyScroll.d.ts +1 -0
- package/__inner__/esm/hooks/useLockBodyScroll/useLockBodyScroll.js +14 -0
- package/package.json +1 -1
- package/useLockBodyScroll/package.json +5 -0
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
exports.__esModule = true;
|
|
3
|
+
exports.Paper = exports.cnPaper = exports.paperShadowVariant = exports.paperBackgroundVariant = exports.paperRadiusVariant = exports.PAPER_DEFAULT_TAG = void 0;
|
|
4
|
+
var tslib_1 = require("tslib");
|
|
5
|
+
require("./Paper.css");
|
|
6
|
+
var react_1 = tslib_1.__importDefault(require("react"));
|
|
7
|
+
var useThemeProps_1 = require("../../hooks/useThemeProps");
|
|
8
|
+
var classname_1 = require("../../utils/classname");
|
|
9
|
+
var polymorphicComponentWithRef_1 = require("../../utils/polymorphicComponentWithRef");
|
|
10
|
+
exports.PAPER_DEFAULT_TAG = 'div';
|
|
11
|
+
exports.paperRadiusVariant = ['xs', 's', 'l'];
|
|
12
|
+
exports.paperBackgroundVariant = [
|
|
13
|
+
'main',
|
|
14
|
+
'main-inverse',
|
|
15
|
+
'action-light',
|
|
16
|
+
'accent',
|
|
17
|
+
];
|
|
18
|
+
exports.paperShadowVariant = ['m', 'l'];
|
|
19
|
+
exports.cnPaper = (0, classname_1.cn)('Paper');
|
|
20
|
+
exports.Paper = (0, polymorphicComponentWithRef_1.polymorphicComponentWithRef)(function (inProps, ref) {
|
|
21
|
+
var props = (0, useThemeProps_1.useThemeProps)({ props: inProps, name: 'Paper' });
|
|
22
|
+
var _a = props.as, Tag = _a === void 0 ? exports.PAPER_DEFAULT_TAG : _a, children = props.children, radius = props.radius, background = props.background, shadow = props.shadow, className = props.className, other = tslib_1.__rest(props, ["as", "children", "radius", "background", "shadow", "className"]);
|
|
23
|
+
return (react_1["default"].createElement(Tag, tslib_1.__assign({}, other, { className: (0, exports.cnPaper)({ radius: radius, background: background, shadow: shadow }, [className]), ref: ref }), children));
|
|
24
|
+
});
|
|
25
|
+
exports.Paper.displayName = 'Paper';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Paper';
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
.Popover {
|
|
2
|
-
box-shadow: var(--shadow-l);
|
|
3
|
-
border-radius: var(--border-radius-xs);
|
|
4
|
-
background-color: var(--color-background-main);
|
|
5
2
|
z-index: var(--z-index-popover);
|
|
6
3
|
inline-size: auto;
|
|
7
4
|
box-sizing: border-box;
|
|
@@ -10,16 +7,9 @@
|
|
|
10
7
|
|
|
11
8
|
.Popover-Arrow {
|
|
12
9
|
display: flex;
|
|
10
|
+
color: var(--paper-background-color);
|
|
13
11
|
}
|
|
14
12
|
|
|
15
|
-
.Popover-Arrow_variant_light {
|
|
16
|
-
color: var(--color-background-main);
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
.Popover-Arrow_variant_dark {
|
|
20
|
-
color: var(--color-background-main-inverse);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
13
|
.Popover[data-popper-placement^='top'] > .Popover-Arrow_size_xs {
|
|
24
14
|
inset-block-end: -9px;
|
|
25
15
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import './Popover.css';
|
|
3
|
-
import type {
|
|
2
|
+
import type { PopoverBaseProps } from './types';
|
|
4
3
|
export declare const cnPopover: import("@bem-react/classname").ClassNameFormatter;
|
|
5
|
-
export declare const Popover:
|
|
4
|
+
export declare const Popover: import("../../utils/polymorphicComponentWithRef").PolymorphicComponentWithRef<PopoverBaseProps, import("../../utils/polymorphicComponentWithRef").PolymorphicComponentWithRef<import("../Paper").PaperBaseProps, "div">>;
|
|
@@ -13,13 +13,14 @@ var useMultiRef_1 = require("../../hooks/useMultiRef");
|
|
|
13
13
|
var useThemeProps_1 = require("../../hooks/useThemeProps");
|
|
14
14
|
var classname_1 = require("../../utils/classname");
|
|
15
15
|
var isKey_1 = require("../../utils/isKey");
|
|
16
|
+
var polymorphicComponentWithRef_1 = require("../../utils/polymorphicComponentWithRef");
|
|
16
17
|
var Portal_1 = require("../Portal");
|
|
17
18
|
var components_1 = require("./components");
|
|
18
19
|
var constants_1 = require("./constants");
|
|
19
20
|
var index_1 = require("./index");
|
|
20
21
|
var PopoverContext_1 = require("./PopoverContext");
|
|
21
22
|
exports.cnPopover = (0, classname_1.cn)('Popover');
|
|
22
|
-
exports.Popover = (0,
|
|
23
|
+
exports.Popover = (0, polymorphicComponentWithRef_1.polymorphicComponentWithRef)(function (inProps, ref) {
|
|
23
24
|
var props = (0, useThemeProps_1.useThemeProps)({ props: inProps, name: 'Popover' });
|
|
24
25
|
var _a = props.arrow, arrow = _a === void 0 ? constants_1.POPOVER_DEFAULT_ARROW : _a, _b = props.open, open = _b === void 0 ? constants_1.POPOVER_DEFAULT_OPEN : _b, _c = props.disableInteractive, disableInteractive = _c === void 0 ? constants_1.POPOVER_DEFAULT_DISABLE_INTERACTIVE : _c, _d = props.disableEnforceFocus, disableEnforceFocus = _d === void 0 ? constants_1.POPOVER_DEFAULT_DISABLE_ENFORCE_FOCUS : _d, _e = props.disableReturnFocus, disableReturnFocus = _e === void 0 ? constants_1.POPOVER_DEFAULT_DISABLE_RETURN_FOCUS : _e, _f = props.placement, placement = _f === void 0 ? constants_1.POPOVER_DEFAULT_PLACEMENT : _f, ignoreClickOutsideRefs = props.ignoreClickOutsideRefs, arrowProps = props.arrowProps, anchorRef = props.anchorRef, equalAnchorWidth = props.equalAnchorWidth, offset = props.offset, children = props.children, transitionProps = props.transitionProps, onClose = props.onClose, onEnter = props.onEnter, onEntered = props.onEntered, onExit = props.onExit, onExitedProp = props.onExited, className = props.className, position = props.position, style = props.style, setUpdate = props.setUpdate, other = tslib_1.__rest(props, ["arrow", "open", "disableInteractive", "disableEnforceFocus", "disableReturnFocus", "placement", "ignoreClickOutsideRefs", "arrowProps", "anchorRef", "equalAnchorWidth", "offset", "children", "transitionProps", "onClose", "onEnter", "onEntered", "onExit", "onExited", "className", "position", "style", "setUpdate"]);
|
|
25
26
|
var isClickOutSide = (0, react_1.useRef)(null);
|
|
@@ -143,8 +144,8 @@ exports.Popover = (0, react_1.forwardRef)(function (inProps, ref) {
|
|
|
143
144
|
var portalRef = (0, useMultiRef_1.useMultiRef)([ref, popoverRef, trapRef, setPopperElement]);
|
|
144
145
|
return (react_1["default"].createElement(PopoverContext_1.PopoverContext.Provider, { value: { isTop: isTop } },
|
|
145
146
|
react_1["default"].createElement(react_transition_group_1.CSSTransition, tslib_1.__assign({ classNames: (0, exports.cnPopover)({ animation: true }), timeout: 120 }, transitionProps, { "in": openState, onEnter: onEnter, onEntered: onEntered, onExit: onExit, onExited: onExited, unmountOnExit: true }),
|
|
146
|
-
react_1["default"].createElement(Portal_1.Portal, tslib_1.__assign({}, other, { style: tslib_1.__assign(tslib_1.__assign({}, style), styles.popper), ref: portalRef, className: (0, exports.cnPopover)({ disableInteractive: disableInteractive }, [className]) }, attributes.popper),
|
|
147
|
+
react_1["default"].createElement(Portal_1.Portal, tslib_1.__assign({ as: constants_1.POPOVER_DEFAULT_TAG, radius: "xs", shadow: "l", background: "main" }, other, { style: tslib_1.__assign(tslib_1.__assign({}, style), styles.popper), ref: portalRef, className: (0, exports.cnPopover)({ disableInteractive: disableInteractive }, [className]) }, attributes.popper),
|
|
147
148
|
children,
|
|
148
|
-
arrow && (react_1["default"].createElement(components_1.PopoverArrow, tslib_1.__assign({
|
|
149
|
+
arrow && (react_1["default"].createElement(components_1.PopoverArrow, tslib_1.__assign({}, arrowProps, { style: tslib_1.__assign(tslib_1.__assign({}, arrowProps === null || arrowProps === void 0 ? void 0 : arrowProps.style), styles.arrow), "data-popper-arrow": true })))))));
|
|
149
150
|
});
|
|
150
151
|
exports.Popover.displayName = 'Popover';
|
|
@@ -5,8 +5,8 @@ var tslib_1 = require("tslib");
|
|
|
5
5
|
var react_1 = tslib_1.__importStar(require("react"));
|
|
6
6
|
var Popover_1 = require("../Popover");
|
|
7
7
|
exports.PopoverArrow = (0, react_1.forwardRef)(function (_a, ref) {
|
|
8
|
-
var _b = _a.size, size = _b === void 0 ? 's' : _b, className = _a.className, style = _a.style,
|
|
9
|
-
return (react_1["default"].createElement("div", tslib_1.__assign({ className: (0, Popover_1.cnPopover)('Arrow', {
|
|
8
|
+
var _b = _a.size, size = _b === void 0 ? 's' : _b, className = _a.className, style = _a.style, other = tslib_1.__rest(_a, ["size", "className", "style"]);
|
|
9
|
+
return (react_1["default"].createElement("div", tslib_1.__assign({ className: (0, Popover_1.cnPopover)('Arrow', { size: size }, [className]), style: style }, other, { ref: ref }), size === 'xs' ? (react_1["default"].createElement("svg", { width: "6", height: "12", viewBox: "0 0 6 12", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
10
10
|
react_1["default"].createElement("path", { d: "M6 12L6 0C6 0 6 1.5 4 3L1.06594 5.20054C0.532609 5.60054 0.532609 6.39946 1.06594 6.79946L4 9C6 10.5 6 12 6 12Z", fill: "currentColor" }))) : (react_1["default"].createElement("svg", { width: "8", height: "16", viewBox: "0 0 8 16", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
11
11
|
react_1["default"].createElement("path", { d: "M8 16L8 0C8 0 8 2 5.33333 4L2.13256 6.40058C1.06589 7.20058 1.06589 8.79942 2.13256 9.59942L5.33333 12C8 14 8 16 8 16Z", fill: "currentColor" })))));
|
|
12
12
|
});
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
import type { HTMLAttributes, Ref } from 'react';
|
|
2
2
|
export declare const popoverArrowSizeVariant: readonly ["xs", "s"];
|
|
3
3
|
export type PopoverArrowSizeVariant = (typeof popoverArrowSizeVariant)[number];
|
|
4
|
-
export declare const popoverArrowVariant: readonly ["light", "dark"];
|
|
5
|
-
export type PopoverArrowVariant = (typeof popoverArrowVariant)[number];
|
|
6
4
|
export type PopoverArrowProps = {
|
|
7
5
|
size?: PopoverArrowSizeVariant;
|
|
8
|
-
variant?: PopoverArrowVariant;
|
|
9
6
|
className?: string;
|
|
10
7
|
ref?: Ref<HTMLDivElement>;
|
|
11
8
|
} & HTMLAttributes<HTMLDivElement> & {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export declare const POPOVER_DEFAULT_TAG: import("../../utils/polymorphicComponentWithRef").PolymorphicComponentWithRef<import("../Paper").PaperBaseProps, "div">;
|
|
1
2
|
export declare const POPOVER_DEFAULT_ARROW = false;
|
|
2
3
|
export declare const POPOVER_DEFAULT_OPEN = false;
|
|
3
4
|
export declare const POPOVER_DEFAULT_DISABLE_INTERACTIVE = false;
|
|
@@ -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) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './useLockBodyScroll';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useLockBodyScroll(active?: boolean): void;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
exports.__esModule = true;
|
|
3
|
+
exports.useLockBodyScroll = void 0;
|
|
4
|
+
var useIsomorphicEffect_1 = require("../useIsomorphicEffect");
|
|
5
|
+
function useLockBodyScroll(active) {
|
|
6
|
+
if (active === void 0) { active = false; }
|
|
7
|
+
(0, useIsomorphicEffect_1.useIsomorphicEffect)(function () {
|
|
8
|
+
if (!active) {
|
|
9
|
+
return undefined;
|
|
10
|
+
}
|
|
11
|
+
var originalStyle = window.getComputedStyle(document.body).overflow;
|
|
12
|
+
document.body.style.overflow = 'hidden';
|
|
13
|
+
return function () {
|
|
14
|
+
document.body.style.overflow = originalStyle;
|
|
15
|
+
};
|
|
16
|
+
}, [active]);
|
|
17
|
+
}
|
|
18
|
+
exports.useLockBodyScroll = useLockBodyScroll;
|
|
@@ -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),
|