@ozen-ui/kit 0.0.1 → 0.1.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/README.md +3 -4
- package/__inner__/cjs/components/Avatar/Avatar.css +1 -1
- package/__inner__/cjs/components/List/components/ListItemButton/ListItemButton.js +2 -0
- package/__inner__/cjs/components/Select/Select.js +2 -4
- package/__inner__/cjs/components/Skeleton/Skeleton.css +7 -5
- package/__inner__/cjs/components/Skeleton/Skeleton.d.ts +7 -2
- package/__inner__/cjs/components/Skeleton/Skeleton.js +6 -4
- package/__inner__/cjs/components/Skeleton/SkeletonRectangular/SkeletonRectangular.js +2 -2
- package/__inner__/cjs/components/Skeleton/SkeletonTypography/SkeletonTypography.js +4 -6
- package/__inner__/cjs/components/Snackbar/components/SnackbarItem/SnackbarItem.d.ts +2 -0
- package/__inner__/cjs/components/Snackbar/components/SnackbarItem/SnackbarItem.js +8 -10
- package/__inner__/cjs/components/Snackbar/components/SnackbarItem/types.d.ts +2 -0
- package/__inner__/cjs/components/ThemeProvider/_zIndex/Theme_zIndex_ozenDefault.css +1 -2
- package/__inner__/cjs/components/ThemeProvider/themes/helper.d.ts +1 -1
- package/__inner__/cjs/components/ThemeProvider/themes/helper.js +0 -1
- package/__inner__/esm/components/Avatar/Avatar.css +1 -1
- package/__inner__/esm/components/List/components/ListItemButton/ListItemButton.js +2 -0
- package/__inner__/esm/components/Select/Select.js +2 -4
- package/__inner__/esm/components/Skeleton/Skeleton.css +7 -5
- package/__inner__/esm/components/Skeleton/Skeleton.d.ts +7 -2
- package/__inner__/esm/components/Skeleton/Skeleton.js +6 -4
- package/__inner__/esm/components/Skeleton/SkeletonRectangular/SkeletonRectangular.js +2 -2
- package/__inner__/esm/components/Skeleton/SkeletonTypography/SkeletonTypography.js +4 -6
- package/__inner__/esm/components/Snackbar/components/SnackbarItem/SnackbarItem.d.ts +2 -0
- package/__inner__/esm/components/Snackbar/components/SnackbarItem/SnackbarItem.js +8 -10
- package/__inner__/esm/components/Snackbar/components/SnackbarItem/types.d.ts +2 -0
- package/__inner__/esm/components/ThemeProvider/_zIndex/Theme_zIndex_ozenDefault.css +1 -2
- package/__inner__/esm/components/ThemeProvider/themes/helper.d.ts +1 -1
- package/__inner__/esm/components/ThemeProvider/themes/helper.js +0 -1
- package/package.json +1 -1
- package/DocViewer/package.json +0 -5
package/README.md
CHANGED
|
@@ -21,10 +21,9 @@ pnpm add @ozen-ui/kit
|
|
|
21
21
|
|
|
22
22
|
Разделы для знакомства с библиотекой:
|
|
23
23
|
|
|
24
|
-
- [Быстрый старт]()
|
|
25
|
-
- [Дизайн-токены]()
|
|
26
|
-
- [Обзор компонентов]()
|
|
27
|
-
- [Внести свой вклад]()
|
|
24
|
+
- [Быстрый старт](https://ozen-ui.netlify.app/?path=/docs/%D0%B4%D0%BE%D0%BA%D1%83%D0%BC%D0%B5%D0%BD%D1%82%D0%B0%D1%86%D0%B8%D1%8F-%D0%B4%D0%BE%D0%B1%D1%80%D0%BE-%D0%BF%D0%BE%D0%B6%D0%B0%D0%BB%D0%BE%D0%B2%D0%B0%D1%82%D1%8C--%D0%B4%D0%BE%D0%BA%D1%83%D0%BC%D0%B5%D0%BD%D1%82%D0%B0%D1%86%D0%B8%D1%8F)
|
|
25
|
+
- [Дизайн-токены](https://ozen-ui.netlify.app/?path=/docs/%D0%BE%D1%81%D0%BD%D0%BE%D0%B2%D0%BD%D0%BE%D0%B5-%D0%B4%D0%B8%D0%B7%D0%B0%D0%B9%D0%BD-%D1%82%D0%BE%D0%BA%D0%B5%D0%BD%D1%8B--%D0%B4%D0%BE%D0%BA%D1%83%D0%BC%D0%B5%D0%BD%D1%82%D0%B0%D1%86%D0%B8%D1%8F)
|
|
26
|
+
- [Обзор компонентов](https://ozen-ui.netlify.app/?path=/docs/%D0%B4%D0%BE%D0%BA%D1%83%D0%BC%D0%B5%D0%BD%D1%82%D0%B0%D1%86%D0%B8%D1%8F-%D0%BE%D0%B1%D0%B7%D0%BE%D1%80--%D0%B4%D0%BE%D0%BA%D1%83%D0%BC%D0%B5%D0%BD%D1%82%D0%B0%D1%86%D0%B8%D1%8F)
|
|
28
27
|
|
|
29
28
|
## О нас
|
|
30
29
|
|
|
@@ -29,10 +29,12 @@ exports.ListItemButton = (0, polymorphicComponentWithRef_1.polymorphicComponentW
|
|
|
29
29
|
var additionalTagProps = (0, react_1.useMemo)(function () {
|
|
30
30
|
if (Tag === 'button')
|
|
31
31
|
return {
|
|
32
|
+
disabled: disabled,
|
|
32
33
|
onKeyDown: onKeyDownProp
|
|
33
34
|
};
|
|
34
35
|
var commonAdditionalProps = {
|
|
35
36
|
role: 'button',
|
|
37
|
+
'aria-disabled': disabled,
|
|
36
38
|
onKeyDown: onKeyDownProp
|
|
37
39
|
};
|
|
38
40
|
if (Tag === 'div') {
|
|
@@ -112,13 +112,11 @@ exports.Select = (0, react_1.forwardRef)(function (inProps, ref) {
|
|
|
112
112
|
? child.props.children || child.props.label
|
|
113
113
|
: child.props.label;
|
|
114
114
|
var selected = valueState === child.props.value;
|
|
115
|
-
var props = {
|
|
116
|
-
onClick: function (event) {
|
|
115
|
+
var props = tslib_1.__assign(tslib_1.__assign({}, child.props), { onClick: function (event) {
|
|
117
116
|
var _a, _b;
|
|
118
117
|
handleChange(event, child.props.value || '');
|
|
119
118
|
(_b = (_a = child.props).onClick) === null || _b === void 0 ? void 0 : _b.call(_a, event);
|
|
120
|
-
}
|
|
121
|
-
};
|
|
119
|
+
} });
|
|
122
120
|
if (selected) {
|
|
123
121
|
currentOption = {
|
|
124
122
|
label: label,
|
|
@@ -4,17 +4,19 @@
|
|
|
4
4
|
/* l >= 1280px */
|
|
5
5
|
.Skeleton {
|
|
6
6
|
--skeleton-loader-width: 100px;
|
|
7
|
+
--skeleton-bg-color: var(--color-background-secondary);
|
|
8
|
+
--skeleton-wave-color: var(--color-background-secondary-hover);
|
|
7
9
|
display: flex;
|
|
8
10
|
visibility: initial;
|
|
9
|
-
background-color: var(--
|
|
11
|
+
background-color: var(--skeleton-bg-color);
|
|
10
12
|
background-image: linear-gradient(
|
|
11
13
|
to right,
|
|
12
|
-
var(--
|
|
13
|
-
var(--color-
|
|
14
|
-
|
|
15
|
-
var(--color-background-secondary) var(--skeleton-loader-width)
|
|
14
|
+
var(--skeleton-bg-color) 0%,
|
|
15
|
+
var(--skeleton-wave-color) calc(var(--skeleton-loader-width) / 2),
|
|
16
|
+
var(--skeleton-bg-color) var(--skeleton-loader-width)
|
|
16
17
|
);
|
|
17
18
|
animation: skeleton-wave 1.5s linear infinite;
|
|
19
|
+
|
|
18
20
|
background-repeat: no-repeat;
|
|
19
21
|
background-attachment: fixed;
|
|
20
22
|
}
|
|
@@ -3,11 +3,16 @@ import './Skeleton.css';
|
|
|
3
3
|
import { type SkeletonCircularProps } from './SkeletonCircular';
|
|
4
4
|
import { type SkeletonRectangularProps } from './SkeletonRectangular';
|
|
5
5
|
import { type SkeletonTypographyProps } from './SkeletonTypography';
|
|
6
|
-
export type SkeletonProps = ({
|
|
6
|
+
export type SkeletonProps = (({
|
|
7
7
|
variant: 'rectangular';
|
|
8
8
|
} & SkeletonRectangularProps) | ({
|
|
9
9
|
variant: 'circular';
|
|
10
10
|
} & SkeletonCircularProps) | ({
|
|
11
11
|
variant: 'typography';
|
|
12
|
-
} & SkeletonTypographyProps)
|
|
12
|
+
} & SkeletonTypographyProps)) & {
|
|
13
|
+
/** Цвет волны */
|
|
14
|
+
waveColor?: string;
|
|
15
|
+
/** Цвет фона */
|
|
16
|
+
bgColor?: string;
|
|
17
|
+
};
|
|
13
18
|
export declare const Skeleton: React.FC<SkeletonProps>;
|
|
@@ -8,13 +8,15 @@ var SkeletonCircular_1 = require("./SkeletonCircular");
|
|
|
8
8
|
var SkeletonRectangular_1 = require("./SkeletonRectangular");
|
|
9
9
|
var SkeletonTypography_1 = require("./SkeletonTypography");
|
|
10
10
|
exports.Skeleton = (0, react_1.forwardRef)(function (props, ref) {
|
|
11
|
-
var variant = props.variant, children = props.children, other = tslib_1.__rest(props, ["variant", "children"]);
|
|
11
|
+
var variant = props.variant, children = props.children, waveColor = props.waveColor, bgColor = props.bgColor, styleProp = props.style, other = tslib_1.__rest(props, ["variant", "children", "waveColor", "bgColor", "style"]);
|
|
12
|
+
var style = tslib_1.__assign({ '--skeleton-wave-color': waveColor, '--skeleton-bg-color': bgColor }, styleProp);
|
|
13
|
+
var commonProps = tslib_1.__assign(tslib_1.__assign({}, other), { style: style, ref: ref });
|
|
12
14
|
if (variant === 'circular') {
|
|
13
|
-
return
|
|
15
|
+
return react_1["default"].createElement(SkeletonCircular_1.SkeletonCircular, tslib_1.__assign({}, commonProps), children);
|
|
14
16
|
}
|
|
15
17
|
if (variant === 'typography') {
|
|
16
|
-
return react_1["default"].createElement(SkeletonTypography_1.SkeletonTypography, tslib_1.__assign({},
|
|
18
|
+
return react_1["default"].createElement(SkeletonTypography_1.SkeletonTypography, tslib_1.__assign({}, commonProps));
|
|
17
19
|
}
|
|
18
|
-
return
|
|
20
|
+
return react_1["default"].createElement(SkeletonRectangular_1.SkeletonRectangular, tslib_1.__assign({}, commonProps), children);
|
|
19
21
|
});
|
|
20
22
|
exports.Skeleton.displayName = 'Skeleton';
|
|
@@ -7,7 +7,7 @@ var classname_1 = require("../../../utils/classname");
|
|
|
7
7
|
require("../Skeleton.css");
|
|
8
8
|
exports.cnSkeleton = (0, classname_1.cn)('Skeleton');
|
|
9
9
|
exports.SkeletonRectangular = (0, react_1.forwardRef)(function (_a, ref) {
|
|
10
|
-
var children = _a.children, _b = _a.width, width = _b === void 0 ? '100%' : _b, height = _a.height, className = _a.className, other = tslib_1.__rest(_a, ["children", "width", "height", "className"]);
|
|
11
|
-
return (react_1["default"].createElement("span", tslib_1.__assign({ className: (0, exports.cnSkeleton)({ hasChildren: !!children }, [className]), style: { width: width, height: height } }, other, { ref: ref }), children));
|
|
10
|
+
var children = _a.children, _b = _a.width, width = _b === void 0 ? '100%' : _b, height = _a.height, style = _a.style, className = _a.className, other = tslib_1.__rest(_a, ["children", "width", "height", "style", "className"]);
|
|
11
|
+
return (react_1["default"].createElement("span", tslib_1.__assign({ className: (0, exports.cnSkeleton)({ hasChildren: !!children }, [className]), style: tslib_1.__assign({ width: width, height: height }, style) }, other, { ref: ref }), children));
|
|
12
12
|
});
|
|
13
13
|
exports.SkeletonRectangular.displayName = 'SkeletonRectangular';
|
|
@@ -9,12 +9,10 @@ var SkeletonRectangular_1 = require("../SkeletonRectangular");
|
|
|
9
9
|
require("./SkeletonTypography.css");
|
|
10
10
|
exports.cnSkeletonTypography = (0, classname_1.cn)('SkeletonTypography');
|
|
11
11
|
exports.SkeletonTypography = (0, react_1.forwardRef)(function (_a, ref) {
|
|
12
|
-
var className = _a.className, typographyVariant = _a.typographyVariant, width = _a.width, rows = _a.rows, other = tslib_1.__rest(_a, ["className", "typographyVariant", "width", "rows"]);
|
|
13
|
-
return (react_1["default"].createElement("span", { className: (0, exports.cnSkeletonTypography)('', [className]), style: { width: width }, ref: ref }, new Array(rows).fill(null).map(function (_, index) { return (react_1["default"].createElement("span",
|
|
12
|
+
var className = _a.className, typographyVariant = _a.typographyVariant, width = _a.width, style = _a.style, rows = _a.rows, other = tslib_1.__rest(_a, ["className", "typographyVariant", "width", "style", "rows"]);
|
|
13
|
+
return (react_1["default"].createElement("span", tslib_1.__assign({ className: (0, exports.cnSkeletonTypography)('', [className]), style: { width: width } }, other, { ref: ref }), new Array(rows).fill(null).map(function (_, index) { return (react_1["default"].createElement("span", { className: (0, exports.cnSkeletonTypography)('Row', [
|
|
14
14
|
(0, Typography_1.cnTypography)({ variant: typographyVariant }),
|
|
15
|
-
])
|
|
16
|
-
react_1["default"].createElement(SkeletonRectangular_1.SkeletonRectangular, { style: {
|
|
17
|
-
width: rows && rows > 1 && index === rows - 1 ? '50%' : '100%'
|
|
18
|
-
} }))); })));
|
|
15
|
+
]), key: index },
|
|
16
|
+
react_1["default"].createElement(SkeletonRectangular_1.SkeletonRectangular, { style: tslib_1.__assign({ width: rows && rows > 1 && index === rows - 1 ? '50%' : '100%' }, style) }))); })));
|
|
19
17
|
});
|
|
20
18
|
exports.SkeletonTypography.displayName = 'SkeletonTypography';
|
|
@@ -19,4 +19,6 @@ export declare const SnackbarItem: React.ForwardRefExoticComponent<{
|
|
|
19
19
|
onEnter?: ((messageId: import("../..").SnackbarMessageId) => void) | undefined;
|
|
20
20
|
onEntered?: ((messageId: import("../..").SnackbarMessageId) => void) | undefined;
|
|
21
21
|
renderContent?: ((props: import("./types").SnackbarItemRenderContentProps) => React.ReactNode) | undefined;
|
|
22
|
+
collapseTransitionTimeout?: number | undefined;
|
|
23
|
+
contentTransitionTimeout?: number | undefined;
|
|
22
24
|
} & Required<import("../..").SnackbarCommonProps> & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -14,8 +14,8 @@ var Collapse_1 = require("../../../Collapse");
|
|
|
14
14
|
var constants_1 = require("../../constants");
|
|
15
15
|
exports.cnSnackbarItem = (0, classname_1.cn)('SnackbarItem');
|
|
16
16
|
exports.SnackbarItem = (0, react_1.forwardRef)(function (_a, ref) {
|
|
17
|
-
var title = _a.title, status = _a.status, description = _a.description, rootProps = _a.rootProps, messageId = _a.messageId, renderContentProp = _a.renderContent, open = _a.open, opening = _a.opening, disableWindowBlurListener = _a.disableWindowBlurListener, lifetime = _a.lifetime, anchorOrigin = _a.anchorOrigin, onClose = _a.onClose, onExited = _a.onExited, onEntered = _a.onEntered, onEnter = _a.onEnter, onExit = _a.onExit;
|
|
18
|
-
var
|
|
17
|
+
var title = _a.title, status = _a.status, description = _a.description, rootProps = _a.rootProps, messageId = _a.messageId, renderContentProp = _a.renderContent, open = _a.open, opening = _a.opening, disableWindowBlurListener = _a.disableWindowBlurListener, lifetime = _a.lifetime, anchorOrigin = _a.anchorOrigin, onClose = _a.onClose, onExited = _a.onExited, onEntered = _a.onEntered, onEnter = _a.onEnter, onExit = _a.onExit, _b = _a.collapseTransitionTimeout, collapseTransitionTimeout = _b === void 0 ? constants_1.SNACKBAR_ITEM_COLLAPSE_TRANSITION_TIMEOUT : _b, _c = _a.contentTransitionTimeout, contentTransitionTimeout = _c === void 0 ? constants_1.SNACKBAR_ITEM_CONTENT_TRANSITION_TIMEOUT : _c;
|
|
18
|
+
var _d = tslib_1.__read((0, useBoolean_1.useBoolean)(true), 2), expanded = _d[0], collapseItem = _d[1].off;
|
|
19
19
|
var horizontal = anchorOrigin.horizontal, vertical = anchorOrigin.vertical;
|
|
20
20
|
var handleClose = function () {
|
|
21
21
|
onClose === null || onClose === void 0 ? void 0 : onClose(messageId);
|
|
@@ -73,21 +73,19 @@ exports.SnackbarItem = (0, react_1.forwardRef)(function (_a, ref) {
|
|
|
73
73
|
handler: pauseTimer,
|
|
74
74
|
active: !disableWindowBlurListener && open
|
|
75
75
|
});
|
|
76
|
-
return (react_1["default"].createElement(Collapse_1.Collapse, tslib_1.__assign({ ref: ref }, rootProps, { className: (0, exports.cnSnackbarItem)('Collapse', [rootProps === null || rootProps === void 0 ? void 0 : rootProps.className]), timeout:
|
|
76
|
+
return (react_1["default"].createElement(Collapse_1.Collapse, tslib_1.__assign({ ref: ref }, rootProps, { className: (0, exports.cnSnackbarItem)('Collapse', [rootProps === null || rootProps === void 0 ? void 0 : rootProps.className]), timeout: collapseTransitionTimeout, expanded: expanded, onExited: handleCollapseExited, onEntered:
|
|
77
77
|
// У кого дольше анимация тот и вызывает
|
|
78
|
-
|
|
79
|
-
constants_1.SNACKBAR_ITEM_CONTENT_TRANSITION_TIMEOUT
|
|
78
|
+
collapseTransitionTimeout > contentTransitionTimeout
|
|
80
79
|
? handleEntered
|
|
81
80
|
: undefined, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, appear: true }),
|
|
82
|
-
react_1["default"].createElement(react_transition_group_1.CSSTransition, { "in": open, classNames: (0, exports.cnSnackbarItem)({ animation: true }), timeout:
|
|
81
|
+
react_1["default"].createElement(react_transition_group_1.CSSTransition, { "in": open, classNames: (0, exports.cnSnackbarItem)({ animation: true }), timeout: contentTransitionTimeout, onEnter: function () { return onEnter === null || onEnter === void 0 ? void 0 : onEnter(messageId); }, onExit: function () { return onExit === null || onExit === void 0 ? void 0 : onExit(messageId); }, onExited: collapseItem, onEntered:
|
|
83
82
|
// У кого дольше анимация тот и вызывает
|
|
84
|
-
|
|
85
|
-
constants_1.SNACKBAR_ITEM_CONTENT_TRANSITION_TIMEOUT
|
|
83
|
+
collapseTransitionTimeout <= contentTransitionTimeout
|
|
86
84
|
? handleEntered
|
|
87
85
|
: undefined, appear: true },
|
|
88
86
|
react_1["default"].createElement("div", { style: {
|
|
89
|
-
'--snackbar-item-transform-transition': "".concat(
|
|
90
|
-
'--snackbar-item-opacity-transition': "".concat(
|
|
87
|
+
'--snackbar-item-transform-transition': "".concat(collapseTransitionTimeout, "ms"),
|
|
88
|
+
'--snackbar-item-opacity-transition': "".concat(contentTransitionTimeout, "ms")
|
|
91
89
|
}, className: (0, exports.cnSnackbarItem)({
|
|
92
90
|
anchorHorizontal: horizontal,
|
|
93
91
|
anchorVertical: vertical
|
|
@@ -48,4 +48,6 @@ export type SnackbarItemProps = {
|
|
|
48
48
|
onEntered?: (messageId: SnackbarMessageId) => void;
|
|
49
49
|
/** Render-функция для кастомизации сообщения */
|
|
50
50
|
renderContent?: (props: SnackbarItemRenderContentProps) => ReactNode;
|
|
51
|
+
collapseTransitionTimeout?: number;
|
|
52
|
+
contentTransitionTimeout?: number;
|
|
51
53
|
} & Required<SnackbarCommonProps>;
|
|
@@ -3,7 +3,7 @@ export declare const borderRadius: readonly ["--border-radius-l", "--border-radi
|
|
|
3
3
|
export declare const borderWidth: readonly ["--border-width-s", "--border-width-m"];
|
|
4
4
|
export declare const shadow: readonly ["--shadow-l", "--shadow-m", "--shadow-s"];
|
|
5
5
|
export declare const breakpoint: readonly ["--breakpoint-xs", "--breakpoint-s", "--breakpoint-m", "--breakpoint-l"];
|
|
6
|
-
export declare const zIndex: readonly ["--z-index-default", "--z-index-absolute", "--z-index-header", "--z-index-sidebar", "--z-index-modal", "--z-index-popover", "--z-index-snackbar", "--z-index-
|
|
6
|
+
export declare const zIndex: readonly ["--z-index-default", "--z-index-absolute", "--z-index-header", "--z-index-sidebar", "--z-index-modal", "--z-index-popover", "--z-index-snackbar", "--z-index-chat"];
|
|
7
7
|
export declare const space: readonly ["--space-8xl", "--space-7xl", "--space-6xl", "--space-5xl", "--space-4xl", "--space-3xl", "--space-2xl", "--space-xl", "--space-l", "--space-m", "--space-s", "--space-xs"];
|
|
8
8
|
export declare const typography: readonly ["--typography-text-4xl_1-font", "--typography-text-3xl_1-font", "--typography-text-2xl_1-font", "--typography-text-xl_1-font", "--typography-heading-4xl-font", "--typography-text-4xl-font", "--typography-heading-3xl-font", "--typography-text-3xl-font", "--typography-heading-2xl-font", "--typography-text-2xl-font", "--typography-heading-xl-font", "--typography-text-xl-font", "--typography-text-l-font", "--typography-text-l_1-font", "--typography-text-m-font", "--typography-text-m_1-font", "--typography-text-s-font", "--typography-text-s_1-font", "--typography-text-xs-font", "--typography-text-xs_1-font", "--typography-text-2xs-font", "--typography-text-2xs_1-font", "--typography-text-3xs-font", "--typography-caption-3xs-font", "--typography-caption-3xs-text_transform", "--typography-caption-3xs-letter_spacing", "--typography-text-3xs_1-font", "--typography-caption-3xs_1-font", "--typography-caption-3xs_1-text_transform", "--typography-caption-3xs_1-letter_spacing"];
|
|
9
9
|
export declare const transition: readonly ["--transition-default", "--transition-slow"];
|
|
@@ -26,10 +26,12 @@ export var ListItemButton = polymorphicComponentWithRef(function (inProps, ref)
|
|
|
26
26
|
var additionalTagProps = useMemo(function () {
|
|
27
27
|
if (Tag === 'button')
|
|
28
28
|
return {
|
|
29
|
+
disabled: disabled,
|
|
29
30
|
onKeyDown: onKeyDownProp
|
|
30
31
|
};
|
|
31
32
|
var commonAdditionalProps = {
|
|
32
33
|
role: 'button',
|
|
34
|
+
'aria-disabled': disabled,
|
|
33
35
|
onKeyDown: onKeyDownProp
|
|
34
36
|
};
|
|
35
37
|
if (Tag === 'div') {
|
|
@@ -109,13 +109,11 @@ export var Select = forwardRef(function (inProps, ref) {
|
|
|
109
109
|
? child.props.children || child.props.label
|
|
110
110
|
: child.props.label;
|
|
111
111
|
var selected = valueState === child.props.value;
|
|
112
|
-
var props = {
|
|
113
|
-
onClick: function (event) {
|
|
112
|
+
var props = __assign(__assign({}, child.props), { onClick: function (event) {
|
|
114
113
|
var _a, _b;
|
|
115
114
|
handleChange(event, child.props.value || '');
|
|
116
115
|
(_b = (_a = child.props).onClick) === null || _b === void 0 ? void 0 : _b.call(_a, event);
|
|
117
|
-
}
|
|
118
|
-
};
|
|
116
|
+
} });
|
|
119
117
|
if (selected) {
|
|
120
118
|
currentOption = {
|
|
121
119
|
label: label,
|
|
@@ -4,17 +4,19 @@
|
|
|
4
4
|
/* l >= 1280px */
|
|
5
5
|
.Skeleton {
|
|
6
6
|
--skeleton-loader-width: 100px;
|
|
7
|
+
--skeleton-bg-color: var(--color-background-secondary);
|
|
8
|
+
--skeleton-wave-color: var(--color-background-secondary-hover);
|
|
7
9
|
display: flex;
|
|
8
10
|
visibility: initial;
|
|
9
|
-
background-color: var(--
|
|
11
|
+
background-color: var(--skeleton-bg-color);
|
|
10
12
|
background-image: linear-gradient(
|
|
11
13
|
to right,
|
|
12
|
-
var(--
|
|
13
|
-
var(--color-
|
|
14
|
-
|
|
15
|
-
var(--color-background-secondary) var(--skeleton-loader-width)
|
|
14
|
+
var(--skeleton-bg-color) 0%,
|
|
15
|
+
var(--skeleton-wave-color) calc(var(--skeleton-loader-width) / 2),
|
|
16
|
+
var(--skeleton-bg-color) var(--skeleton-loader-width)
|
|
16
17
|
);
|
|
17
18
|
animation: skeleton-wave 1.5s linear infinite;
|
|
19
|
+
|
|
18
20
|
background-repeat: no-repeat;
|
|
19
21
|
background-attachment: fixed;
|
|
20
22
|
}
|
|
@@ -3,11 +3,16 @@ import './Skeleton.css';
|
|
|
3
3
|
import { type SkeletonCircularProps } from './SkeletonCircular';
|
|
4
4
|
import { type SkeletonRectangularProps } from './SkeletonRectangular';
|
|
5
5
|
import { type SkeletonTypographyProps } from './SkeletonTypography';
|
|
6
|
-
export type SkeletonProps = ({
|
|
6
|
+
export type SkeletonProps = (({
|
|
7
7
|
variant: 'rectangular';
|
|
8
8
|
} & SkeletonRectangularProps) | ({
|
|
9
9
|
variant: 'circular';
|
|
10
10
|
} & SkeletonCircularProps) | ({
|
|
11
11
|
variant: 'typography';
|
|
12
|
-
} & SkeletonTypographyProps)
|
|
12
|
+
} & SkeletonTypographyProps)) & {
|
|
13
|
+
/** Цвет волны */
|
|
14
|
+
waveColor?: string;
|
|
15
|
+
/** Цвет фона */
|
|
16
|
+
bgColor?: string;
|
|
17
|
+
};
|
|
13
18
|
export declare const Skeleton: React.FC<SkeletonProps>;
|
|
@@ -5,13 +5,15 @@ import { SkeletonCircular, } from './SkeletonCircular';
|
|
|
5
5
|
import { SkeletonRectangular, } from './SkeletonRectangular';
|
|
6
6
|
import { SkeletonTypography, } from './SkeletonTypography';
|
|
7
7
|
export var Skeleton = forwardRef(function (props, ref) {
|
|
8
|
-
var variant = props.variant, children = props.children, other = __rest(props, ["variant", "children"]);
|
|
8
|
+
var variant = props.variant, children = props.children, waveColor = props.waveColor, bgColor = props.bgColor, styleProp = props.style, other = __rest(props, ["variant", "children", "waveColor", "bgColor", "style"]);
|
|
9
|
+
var style = __assign({ '--skeleton-wave-color': waveColor, '--skeleton-bg-color': bgColor }, styleProp);
|
|
10
|
+
var commonProps = __assign(__assign({}, other), { style: style, ref: ref });
|
|
9
11
|
if (variant === 'circular') {
|
|
10
|
-
return
|
|
12
|
+
return React.createElement(SkeletonCircular, __assign({}, commonProps), children);
|
|
11
13
|
}
|
|
12
14
|
if (variant === 'typography') {
|
|
13
|
-
return React.createElement(SkeletonTypography, __assign({},
|
|
15
|
+
return React.createElement(SkeletonTypography, __assign({}, commonProps));
|
|
14
16
|
}
|
|
15
|
-
return
|
|
17
|
+
return React.createElement(SkeletonRectangular, __assign({}, commonProps), children);
|
|
16
18
|
});
|
|
17
19
|
Skeleton.displayName = 'Skeleton';
|
|
@@ -4,7 +4,7 @@ import { cn } from '../../../utils/classname';
|
|
|
4
4
|
import '../Skeleton.css';
|
|
5
5
|
export var cnSkeleton = cn('Skeleton');
|
|
6
6
|
export var SkeletonRectangular = forwardRef(function (_a, ref) {
|
|
7
|
-
var children = _a.children, _b = _a.width, width = _b === void 0 ? '100%' : _b, height = _a.height, className = _a.className, other = __rest(_a, ["children", "width", "height", "className"]);
|
|
8
|
-
return (React.createElement("span", __assign({ className: cnSkeleton({ hasChildren: !!children }, [className]), style: { width: width, height: height } }, other, { ref: ref }), children));
|
|
7
|
+
var children = _a.children, _b = _a.width, width = _b === void 0 ? '100%' : _b, height = _a.height, style = _a.style, className = _a.className, other = __rest(_a, ["children", "width", "height", "style", "className"]);
|
|
8
|
+
return (React.createElement("span", __assign({ className: cnSkeleton({ hasChildren: !!children }, [className]), style: __assign({ width: width, height: height }, style) }, other, { ref: ref }), children));
|
|
9
9
|
});
|
|
10
10
|
SkeletonRectangular.displayName = 'SkeletonRectangular';
|
|
@@ -6,12 +6,10 @@ import { SkeletonRectangular } from '../SkeletonRectangular';
|
|
|
6
6
|
import './SkeletonTypography.css';
|
|
7
7
|
export var cnSkeletonTypography = cn('SkeletonTypography');
|
|
8
8
|
export var SkeletonTypography = forwardRef(function (_a, ref) {
|
|
9
|
-
var className = _a.className, typographyVariant = _a.typographyVariant, width = _a.width, rows = _a.rows, other = __rest(_a, ["className", "typographyVariant", "width", "rows"]);
|
|
10
|
-
return (React.createElement("span", { className: cnSkeletonTypography('', [className]), style: { width: width }, ref: ref }, new Array(rows).fill(null).map(function (_, index) { return (React.createElement("span",
|
|
9
|
+
var className = _a.className, typographyVariant = _a.typographyVariant, width = _a.width, style = _a.style, rows = _a.rows, other = __rest(_a, ["className", "typographyVariant", "width", "style", "rows"]);
|
|
10
|
+
return (React.createElement("span", __assign({ className: cnSkeletonTypography('', [className]), style: { width: width } }, other, { ref: ref }), new Array(rows).fill(null).map(function (_, index) { return (React.createElement("span", { className: cnSkeletonTypography('Row', [
|
|
11
11
|
cnTypography({ variant: typographyVariant }),
|
|
12
|
-
])
|
|
13
|
-
React.createElement(SkeletonRectangular, { style: {
|
|
14
|
-
width: rows && rows > 1 && index === rows - 1 ? '50%' : '100%'
|
|
15
|
-
} }))); })));
|
|
12
|
+
]), key: index },
|
|
13
|
+
React.createElement(SkeletonRectangular, { style: __assign({ width: rows && rows > 1 && index === rows - 1 ? '50%' : '100%' }, style) }))); })));
|
|
16
14
|
});
|
|
17
15
|
SkeletonTypography.displayName = 'SkeletonTypography';
|
|
@@ -19,4 +19,6 @@ export declare const SnackbarItem: React.ForwardRefExoticComponent<{
|
|
|
19
19
|
onEnter?: ((messageId: import("../..").SnackbarMessageId) => void) | undefined;
|
|
20
20
|
onEntered?: ((messageId: import("../..").SnackbarMessageId) => void) | undefined;
|
|
21
21
|
renderContent?: ((props: import("./types").SnackbarItemRenderContentProps) => React.ReactNode) | undefined;
|
|
22
|
+
collapseTransitionTimeout?: number | undefined;
|
|
23
|
+
contentTransitionTimeout?: number | undefined;
|
|
22
24
|
} & Required<import("../..").SnackbarCommonProps> & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -11,8 +11,8 @@ import { Collapse } from '../../../Collapse';
|
|
|
11
11
|
import { SNACKBAR_ITEM_COLLAPSE_TRANSITION_TIMEOUT, SNACKBAR_ITEM_CONTENT_TRANSITION_TIMEOUT, } from '../../constants';
|
|
12
12
|
export var cnSnackbarItem = cn('SnackbarItem');
|
|
13
13
|
export var SnackbarItem = forwardRef(function (_a, ref) {
|
|
14
|
-
var title = _a.title, status = _a.status, description = _a.description, rootProps = _a.rootProps, messageId = _a.messageId, renderContentProp = _a.renderContent, open = _a.open, opening = _a.opening, disableWindowBlurListener = _a.disableWindowBlurListener, lifetime = _a.lifetime, anchorOrigin = _a.anchorOrigin, onClose = _a.onClose, onExited = _a.onExited, onEntered = _a.onEntered, onEnter = _a.onEnter, onExit = _a.onExit;
|
|
15
|
-
var
|
|
14
|
+
var title = _a.title, status = _a.status, description = _a.description, rootProps = _a.rootProps, messageId = _a.messageId, renderContentProp = _a.renderContent, open = _a.open, opening = _a.opening, disableWindowBlurListener = _a.disableWindowBlurListener, lifetime = _a.lifetime, anchorOrigin = _a.anchorOrigin, onClose = _a.onClose, onExited = _a.onExited, onEntered = _a.onEntered, onEnter = _a.onEnter, onExit = _a.onExit, _b = _a.collapseTransitionTimeout, collapseTransitionTimeout = _b === void 0 ? SNACKBAR_ITEM_COLLAPSE_TRANSITION_TIMEOUT : _b, _c = _a.contentTransitionTimeout, contentTransitionTimeout = _c === void 0 ? SNACKBAR_ITEM_CONTENT_TRANSITION_TIMEOUT : _c;
|
|
15
|
+
var _d = __read(useBoolean(true), 2), expanded = _d[0], collapseItem = _d[1].off;
|
|
16
16
|
var horizontal = anchorOrigin.horizontal, vertical = anchorOrigin.vertical;
|
|
17
17
|
var handleClose = function () {
|
|
18
18
|
onClose === null || onClose === void 0 ? void 0 : onClose(messageId);
|
|
@@ -70,21 +70,19 @@ export var SnackbarItem = forwardRef(function (_a, ref) {
|
|
|
70
70
|
handler: pauseTimer,
|
|
71
71
|
active: !disableWindowBlurListener && open
|
|
72
72
|
});
|
|
73
|
-
return (React.createElement(Collapse, __assign({ ref: ref }, rootProps, { className: cnSnackbarItem('Collapse', [rootProps === null || rootProps === void 0 ? void 0 : rootProps.className]), timeout:
|
|
73
|
+
return (React.createElement(Collapse, __assign({ ref: ref }, rootProps, { className: cnSnackbarItem('Collapse', [rootProps === null || rootProps === void 0 ? void 0 : rootProps.className]), timeout: collapseTransitionTimeout, expanded: expanded, onExited: handleCollapseExited, onEntered:
|
|
74
74
|
// У кого дольше анимация тот и вызывает
|
|
75
|
-
|
|
76
|
-
SNACKBAR_ITEM_CONTENT_TRANSITION_TIMEOUT
|
|
75
|
+
collapseTransitionTimeout > contentTransitionTimeout
|
|
77
76
|
? handleEntered
|
|
78
77
|
: undefined, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, appear: true }),
|
|
79
|
-
React.createElement(CSSTransition, { "in": open, classNames: cnSnackbarItem({ animation: true }), timeout:
|
|
78
|
+
React.createElement(CSSTransition, { "in": open, classNames: cnSnackbarItem({ animation: true }), timeout: contentTransitionTimeout, onEnter: function () { return onEnter === null || onEnter === void 0 ? void 0 : onEnter(messageId); }, onExit: function () { return onExit === null || onExit === void 0 ? void 0 : onExit(messageId); }, onExited: collapseItem, onEntered:
|
|
80
79
|
// У кого дольше анимация тот и вызывает
|
|
81
|
-
|
|
82
|
-
SNACKBAR_ITEM_CONTENT_TRANSITION_TIMEOUT
|
|
80
|
+
collapseTransitionTimeout <= contentTransitionTimeout
|
|
83
81
|
? handleEntered
|
|
84
82
|
: undefined, appear: true },
|
|
85
83
|
React.createElement("div", { style: {
|
|
86
|
-
'--snackbar-item-transform-transition': "".concat(
|
|
87
|
-
'--snackbar-item-opacity-transition': "".concat(
|
|
84
|
+
'--snackbar-item-transform-transition': "".concat(collapseTransitionTimeout, "ms"),
|
|
85
|
+
'--snackbar-item-opacity-transition': "".concat(contentTransitionTimeout, "ms")
|
|
88
86
|
}, className: cnSnackbarItem({
|
|
89
87
|
anchorHorizontal: horizontal,
|
|
90
88
|
anchorVertical: vertical
|
|
@@ -48,4 +48,6 @@ export type SnackbarItemProps = {
|
|
|
48
48
|
onEntered?: (messageId: SnackbarMessageId) => void;
|
|
49
49
|
/** Render-функция для кастомизации сообщения */
|
|
50
50
|
renderContent?: (props: SnackbarItemRenderContentProps) => ReactNode;
|
|
51
|
+
collapseTransitionTimeout?: number;
|
|
52
|
+
contentTransitionTimeout?: number;
|
|
51
53
|
} & Required<SnackbarCommonProps>;
|
|
@@ -3,7 +3,7 @@ export declare const borderRadius: readonly ["--border-radius-l", "--border-radi
|
|
|
3
3
|
export declare const borderWidth: readonly ["--border-width-s", "--border-width-m"];
|
|
4
4
|
export declare const shadow: readonly ["--shadow-l", "--shadow-m", "--shadow-s"];
|
|
5
5
|
export declare const breakpoint: readonly ["--breakpoint-xs", "--breakpoint-s", "--breakpoint-m", "--breakpoint-l"];
|
|
6
|
-
export declare const zIndex: readonly ["--z-index-default", "--z-index-absolute", "--z-index-header", "--z-index-sidebar", "--z-index-modal", "--z-index-popover", "--z-index-snackbar", "--z-index-
|
|
6
|
+
export declare const zIndex: readonly ["--z-index-default", "--z-index-absolute", "--z-index-header", "--z-index-sidebar", "--z-index-modal", "--z-index-popover", "--z-index-snackbar", "--z-index-chat"];
|
|
7
7
|
export declare const space: readonly ["--space-8xl", "--space-7xl", "--space-6xl", "--space-5xl", "--space-4xl", "--space-3xl", "--space-2xl", "--space-xl", "--space-l", "--space-m", "--space-s", "--space-xs"];
|
|
8
8
|
export declare const typography: readonly ["--typography-text-4xl_1-font", "--typography-text-3xl_1-font", "--typography-text-2xl_1-font", "--typography-text-xl_1-font", "--typography-heading-4xl-font", "--typography-text-4xl-font", "--typography-heading-3xl-font", "--typography-text-3xl-font", "--typography-heading-2xl-font", "--typography-text-2xl-font", "--typography-heading-xl-font", "--typography-text-xl-font", "--typography-text-l-font", "--typography-text-l_1-font", "--typography-text-m-font", "--typography-text-m_1-font", "--typography-text-s-font", "--typography-text-s_1-font", "--typography-text-xs-font", "--typography-text-xs_1-font", "--typography-text-2xs-font", "--typography-text-2xs_1-font", "--typography-text-3xs-font", "--typography-caption-3xs-font", "--typography-caption-3xs-text_transform", "--typography-caption-3xs-letter_spacing", "--typography-text-3xs_1-font", "--typography-caption-3xs_1-font", "--typography-caption-3xs_1-text_transform", "--typography-caption-3xs_1-letter_spacing"];
|
|
9
9
|
export declare const transition: readonly ["--transition-default", "--transition-slow"];
|
package/package.json
CHANGED