@ozen-ui/kit 0.0.2 → 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 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
 
@@ -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(--color-background-secondary);
11
+ background-color: var(--skeleton-bg-color);
10
12
  background-image: linear-gradient(
11
13
  to right,
12
- var(--color-background-secondary) 0%,
13
- var(--color-background-secondary-hover)
14
- calc(var(--skeleton-loader-width) / 2),
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 (react_1["default"].createElement(SkeletonCircular_1.SkeletonCircular, tslib_1.__assign({}, other, { ref: ref }), children));
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({}, other, { ref: ref }));
18
+ return react_1["default"].createElement(SkeletonTypography_1.SkeletonTypography, tslib_1.__assign({}, commonProps));
17
19
  }
18
- return (react_1["default"].createElement(SkeletonRectangular_1.SkeletonRectangular, tslib_1.__assign({}, other, { ref: ref }), children));
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", tslib_1.__assign({ className: (0, exports.cnSkeletonTypography)('Row', [
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
- ]) }, other, { key: index }),
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 _b = tslib_1.__read((0, useBoolean_1.useBoolean)(true), 2), expanded = _b[0], collapseItem = _b[1].off;
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: constants_1.SNACKBAR_ITEM_COLLAPSE_TRANSITION_TIMEOUT, expanded: expanded, onExited: handleCollapseExited, onEntered:
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
- constants_1.SNACKBAR_ITEM_COLLAPSE_TRANSITION_TIMEOUT >
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: constants_1.SNACKBAR_ITEM_CONTENT_TRANSITION_TIMEOUT, 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:
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
- constants_1.SNACKBAR_ITEM_COLLAPSE_TRANSITION_TIMEOUT <=
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(constants_1.SNACKBAR_ITEM_COLLAPSE_TRANSITION_TIMEOUT, "ms"),
90
- '--snackbar-item-opacity-transition': "".concat(constants_1.SNACKBAR_ITEM_CONTENT_TRANSITION_TIMEOUT, "ms")
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>;
@@ -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(--color-background-secondary);
11
+ background-color: var(--skeleton-bg-color);
10
12
  background-image: linear-gradient(
11
13
  to right,
12
- var(--color-background-secondary) 0%,
13
- var(--color-background-secondary-hover)
14
- calc(var(--skeleton-loader-width) / 2),
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 (React.createElement(SkeletonCircular, __assign({}, other, { ref: ref }), children));
12
+ return React.createElement(SkeletonCircular, __assign({}, commonProps), children);
11
13
  }
12
14
  if (variant === 'typography') {
13
- return React.createElement(SkeletonTypography, __assign({}, other, { ref: ref }));
15
+ return React.createElement(SkeletonTypography, __assign({}, commonProps));
14
16
  }
15
- return (React.createElement(SkeletonRectangular, __assign({}, other, { ref: ref }), children));
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", __assign({ className: cnSkeletonTypography('Row', [
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
- ]) }, other, { key: index }),
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 _b = __read(useBoolean(true), 2), expanded = _b[0], collapseItem = _b[1].off;
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: SNACKBAR_ITEM_COLLAPSE_TRANSITION_TIMEOUT, expanded: expanded, onExited: handleCollapseExited, onEntered:
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
- SNACKBAR_ITEM_COLLAPSE_TRANSITION_TIMEOUT >
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: SNACKBAR_ITEM_CONTENT_TRANSITION_TIMEOUT, 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:
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
- SNACKBAR_ITEM_COLLAPSE_TRANSITION_TIMEOUT <=
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(SNACKBAR_ITEM_COLLAPSE_TRANSITION_TIMEOUT, "ms"),
87
- '--snackbar-item-opacity-transition': "".concat(SNACKBAR_ITEM_CONTENT_TRANSITION_TIMEOUT, "ms")
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>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ozen-ui/kit",
3
- "version": "0.0.2",
3
+ "version": "0.1.0",
4
4
  "description": "React component library",
5
5
  "files": [
6
6
  "*"
@@ -1,5 +0,0 @@
1
- {
2
- "main": "../__inner__/cjs/components/DocViewer/index.js",
3
- "module": "../__inner__/esm/components/DocViewer/index.js",
4
- "types": "../__inner__/esm/components/DocViewer/index.d.ts"
5
- }