@alfalab/core-components-notification 8.0.0 → 8.1.0-snapshot-92b8690

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.
@@ -0,0 +1,86 @@
1
+ import React, { MouseEvent } from 'react';
2
+ import { ToastPlateDesktopProps } from '@alfalab/core-components-toast-plate/desktop';
3
+ export declare type NotificationProps = ToastPlateDesktopProps & {
4
+ /**
5
+ * Управление видимостью компонента
6
+ */
7
+ visible?: boolean;
8
+ /**
9
+ * Отступ от верхнего края
10
+ */
11
+ offset?: number;
12
+ /**
13
+ * Время до закрытия компонента
14
+ */
15
+ autoCloseDelay?: number | null;
16
+ /**
17
+ * Использовать портал
18
+ */
19
+ usePortal?: boolean;
20
+ /**
21
+ * z-index компонента
22
+ */
23
+ zIndex?: number;
24
+ /**
25
+ * Позиционирование компонента от верхнего или нижнего края экрана
26
+ */
27
+ position?: 'top' | 'bottom';
28
+ /**
29
+ * Обработчик события истечения времени до закрытия компонента
30
+ */
31
+ onCloseTimeout?: () => void;
32
+ /**
33
+ * Обработчик события наведения курсора на компонент
34
+ */
35
+ onMouseEnter?: (event?: MouseEvent<HTMLDivElement>) => void;
36
+ /**
37
+ * Обработчик события снятия курсора с компонента
38
+ */
39
+ onMouseLeave?: (event?: MouseEvent<HTMLDivElement>) => void;
40
+ /**
41
+ * Обработчик клика вне компонента
42
+ */
43
+ onClickOutside?: (event?: MouseEvent<any>) => void;
44
+ };
45
+ export declare const Notification: React.ForwardRefExoticComponent<ToastPlateDesktopProps & {
46
+ /**
47
+ * Управление видимостью компонента
48
+ */
49
+ visible?: boolean | undefined;
50
+ /**
51
+ * Отступ от верхнего края
52
+ */
53
+ offset?: number | undefined;
54
+ /**
55
+ * Время до закрытия компонента
56
+ */
57
+ autoCloseDelay?: number | null | undefined;
58
+ /**
59
+ * Использовать портал
60
+ */
61
+ usePortal?: boolean | undefined;
62
+ /**
63
+ * z-index компонента
64
+ */
65
+ zIndex?: number | undefined;
66
+ /**
67
+ * Позиционирование компонента от верхнего или нижнего края экрана
68
+ */
69
+ position?: "top" | "bottom" | undefined;
70
+ /**
71
+ * Обработчик события истечения времени до закрытия компонента
72
+ */
73
+ onCloseTimeout?: (() => void) | undefined;
74
+ /**
75
+ * Обработчик события наведения курсора на компонент
76
+ */
77
+ onMouseEnter?: ((event?: MouseEvent<HTMLDivElement>) => void) | undefined;
78
+ /**
79
+ * Обработчик события снятия курсора с компонента
80
+ */
81
+ onMouseLeave?: ((event?: MouseEvent<HTMLDivElement>) => void) | undefined;
82
+ /**
83
+ * Обработчик клика вне компонента
84
+ */
85
+ onClickOutside?: ((event?: MouseEvent<any>) => void) | undefined;
86
+ } & React.RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,109 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var tslib = require('tslib');
6
+ var React = require('react');
7
+ var mergeRefs = require('react-merge-refs');
8
+ var reactSwipeable = require('react-swipeable');
9
+ var cn = require('classnames');
10
+ var elementClosest = require('element-closest');
11
+ var dynamicMixins$2 = require('@alfalab/core-components-portal/dynamic-mixins');
12
+ var dynamicMixins$1 = require('@alfalab/core-components-stack/dynamic-mixins');
13
+ var dynamicMixins = require('@alfalab/core-components-stack-context/dynamic-mixins');
14
+ var desktop = require('@alfalab/core-components-toast-plate/dynamic-mixins/desktop');
15
+ var index = require('./utils/index.js');
16
+ var index_module = require('./index.module.css.js');
17
+
18
+ function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
19
+
20
+ var React__default = /*#__PURE__*/_interopDefaultCompat(React);
21
+ var mergeRefs__default = /*#__PURE__*/_interopDefaultCompat(mergeRefs);
22
+ var cn__default = /*#__PURE__*/_interopDefaultCompat(cn);
23
+ var elementClosest__default = /*#__PURE__*/_interopDefaultCompat(elementClosest);
24
+
25
+ var notificationClassNameSelector = ".".concat(index_module.notificationComponent);
26
+ var Notification = React.forwardRef(function (_a, ref) {
27
+ var className = _a.className, actionSectionClassName = _a.actionSectionClassName, children = _a.children, visible = _a.visible, _b = _a.offset, offset = _b === void 0 ? 108 : _b, _c = _a.hasCloser, hasCloser = _c === void 0 ? true : _c, _d = _a.autoCloseDelay, autoCloseDelay = _d === void 0 ? 5000 : _d, _e = _a.usePortal, usePortal = _e === void 0 ? true : _e, _f = _a.zIndex, zIndex = _f === void 0 ? dynamicMixins.stackingOrder.TOAST : _f, style = _a.style, _g = _a.position, position = _g === void 0 ? 'top' : _g, onClose = _a.onClose, onCloseTimeout = _a.onCloseTimeout, onMouseEnter = _a.onMouseEnter, onMouseLeave = _a.onMouseLeave, onClickOutside = _a.onClickOutside, restProps = tslib.__rest(_a, ["className", "actionSectionClassName", "children", "visible", "offset", "hasCloser", "autoCloseDelay", "usePortal", "zIndex", "style", "position", "onClose", "onCloseTimeout", "onMouseEnter", "onMouseLeave", "onClickOutside"]);
28
+ var notificationRef = React.useRef(null);
29
+ var autoCloseTimeoutRef = React.useRef(0);
30
+ var closeTimeoutRef = React.useRef(0);
31
+ var _h = React.useState(false), isClosing = _h[0], setIsClosing = _h[1];
32
+ var startAutoCloseTimer = React.useCallback(function () {
33
+ if (autoCloseDelay !== null) {
34
+ autoCloseTimeoutRef.current = window.setTimeout(function () {
35
+ if (onCloseTimeout) {
36
+ onCloseTimeout();
37
+ }
38
+ }, autoCloseDelay);
39
+ }
40
+ }, [autoCloseDelay, onCloseTimeout]);
41
+ var stopAutoCloseTimer = React.useCallback(function () {
42
+ clearTimeout(autoCloseTimeoutRef.current);
43
+ }, []);
44
+ React.useEffect(function () { return function () {
45
+ clearTimeout(closeTimeoutRef.current);
46
+ }; }, []);
47
+ React.useEffect(function () {
48
+ elementClosest__default.default(window);
49
+ }, []);
50
+ React.useEffect(function () {
51
+ if (visible) {
52
+ startAutoCloseTimer();
53
+ }
54
+ return function () {
55
+ stopAutoCloseTimer();
56
+ };
57
+ }, [startAutoCloseTimer, stopAutoCloseTimer, visible]);
58
+ var handleMouseEnter = React.useCallback(function (event) {
59
+ stopAutoCloseTimer();
60
+ if (onMouseEnter) {
61
+ onMouseEnter(event);
62
+ }
63
+ }, [onMouseEnter, stopAutoCloseTimer]);
64
+ var handleMouseLeave = React.useCallback(function (event) {
65
+ stopAutoCloseTimer();
66
+ startAutoCloseTimer();
67
+ if (onMouseLeave) {
68
+ onMouseLeave(event);
69
+ }
70
+ }, [onMouseLeave, startAutoCloseTimer, stopAutoCloseTimer]);
71
+ var handleOutsideClick = React.useCallback(function (event) {
72
+ var isTargetNotification = !!event.target.closest(notificationClassNameSelector);
73
+ /*
74
+ * проверка isTargetNotification нужна для предотвращения срабатывания handleOutsideClick
75
+ * при клике на другие нотификации, если их несколько на странице
76
+ */
77
+ if (onClickOutside && visible && !isTargetNotification) {
78
+ onClickOutside(event);
79
+ }
80
+ }, [onClickOutside, visible]);
81
+ index.useClickOutside(notificationRef, handleOutsideClick);
82
+ var swipeableHandlers = reactSwipeable.useSwipeable({
83
+ onSwiped: function (_a) {
84
+ var dir = _a.dir;
85
+ if (onClose && ['Left', 'Right', 'Up'].includes(dir)) {
86
+ setIsClosing(true);
87
+ closeTimeoutRef.current = window.setTimeout(function () {
88
+ setIsClosing(false);
89
+ onClose();
90
+ }, 100);
91
+ }
92
+ },
93
+ delta: 100,
94
+ });
95
+ var Wrapper = usePortal ? dynamicMixins$2.Portal : React.Fragment;
96
+ return (React__default.default.createElement(dynamicMixins$1.Stack, { value: zIndex }, function (computedZIndex) {
97
+ var _a, _b;
98
+ return (React__default.default.createElement(Wrapper, null,
99
+ React__default.default.createElement("div", tslib.__assign({}, swipeableHandlers),
100
+ React__default.default.createElement(desktop.ToastPlateDesktop, tslib.__assign({ className: cn__default.default(index_module.notificationComponent, (_a = {},
101
+ _a[index_module.isVisible] = visible,
102
+ _a[index_module.isClosing] = isClosing,
103
+ _a), className), contentClassName: index_module.toastContent, actionSectionClassName: cn__default.default(actionSectionClassName, index_module.actionSection), style: tslib.__assign((_b = {}, _b[position] = offset, _b.zIndex = computedZIndex, _b), style), onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, ref: mergeRefs__default.default([ref, notificationRef]), role: visible ? 'alert' : undefined, hasCloser: hasCloser, onClose: onClose }, restProps), children))));
104
+ }));
105
+ });
106
+ Notification.displayName = 'Notification';
107
+
108
+ exports.Notification = Notification;
109
+ //# sourceMappingURL=Component.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Component.js","sources":["../src/Component.tsx"],"sourcesContent":["import React, {\n forwardRef,\n Fragment,\n MouseEvent,\n useCallback,\n useEffect,\n useRef,\n useState,\n} from 'react';\nimport mergeRefs from 'react-merge-refs';\nimport { useSwipeable } from 'react-swipeable';\nimport cn from 'classnames';\nimport elementClosest from 'element-closest';\n\nimport { Portal } from '@alfalab/core-components-portal';\nimport { Stack } from '@alfalab/core-components-stack';\nimport { stackingOrder } from '@alfalab/core-components-stack-context';\nimport {\n ToastPlateDesktop,\n ToastPlateDesktopProps,\n} from '@alfalab/core-components-toast-plate/desktop';\n\nimport { useClickOutside } from './utils';\n\nimport styles from './index.module.css';\n\nexport type NotificationProps = ToastPlateDesktopProps & {\n /**\n * Управление видимостью компонента\n */\n visible?: boolean;\n\n /**\n * Отступ от верхнего края\n */\n offset?: number;\n\n /**\n * Время до закрытия компонента\n */\n autoCloseDelay?: number | null;\n\n /**\n * Использовать портал\n */\n usePortal?: boolean;\n\n /**\n * z-index компонента\n */\n zIndex?: number;\n\n /**\n * Позиционирование компонента от верхнего или нижнего края экрана\n */\n position?: 'top' | 'bottom';\n\n /**\n * Обработчик события истечения времени до закрытия компонента\n */\n onCloseTimeout?: () => void;\n\n /**\n * Обработчик события наведения курсора на компонент\n */\n onMouseEnter?: (event?: MouseEvent<HTMLDivElement>) => void;\n\n /**\n * Обработчик события снятия курсора с компонента\n */\n onMouseLeave?: (event?: MouseEvent<HTMLDivElement>) => void;\n\n /**\n * Обработчик клика вне компонента\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n onClickOutside?: (event?: MouseEvent<any>) => void;\n};\n\nconst notificationClassNameSelector = `.${styles.notificationComponent}`;\n\nexport const Notification = forwardRef<HTMLDivElement, NotificationProps>(\n (\n {\n className,\n actionSectionClassName,\n children,\n visible,\n offset = 108,\n hasCloser = true,\n autoCloseDelay = 5000,\n usePortal = true,\n zIndex = stackingOrder.TOAST,\n style,\n position = 'top',\n onClose,\n onCloseTimeout,\n onMouseEnter,\n onMouseLeave,\n onClickOutside,\n ...restProps\n },\n ref,\n ) => {\n const notificationRef = useRef<HTMLDivElement>(null);\n const autoCloseTimeoutRef = useRef(0);\n const closeTimeoutRef = useRef(0);\n\n const [isClosing, setIsClosing] = useState(false);\n\n const startAutoCloseTimer = useCallback(() => {\n if (autoCloseDelay !== null) {\n autoCloseTimeoutRef.current = window.setTimeout(() => {\n if (onCloseTimeout) {\n onCloseTimeout();\n }\n }, autoCloseDelay);\n }\n }, [autoCloseDelay, onCloseTimeout]);\n\n const stopAutoCloseTimer = useCallback(() => {\n clearTimeout(autoCloseTimeoutRef.current);\n }, []);\n\n useEffect(\n () => () => {\n clearTimeout(closeTimeoutRef.current);\n },\n [],\n );\n\n useEffect(() => {\n elementClosest(window);\n }, []);\n\n useEffect(() => {\n if (visible) {\n startAutoCloseTimer();\n }\n\n return () => {\n stopAutoCloseTimer();\n };\n }, [startAutoCloseTimer, stopAutoCloseTimer, visible]);\n\n const handleMouseEnter = useCallback(\n (event: React.MouseEvent<HTMLDivElement>) => {\n stopAutoCloseTimer();\n\n if (onMouseEnter) {\n onMouseEnter(event);\n }\n },\n [onMouseEnter, stopAutoCloseTimer],\n );\n\n const handleMouseLeave = useCallback(\n (event: React.MouseEvent<HTMLDivElement>) => {\n stopAutoCloseTimer();\n startAutoCloseTimer();\n\n if (onMouseLeave) {\n onMouseLeave(event);\n }\n },\n [onMouseLeave, startAutoCloseTimer, stopAutoCloseTimer],\n );\n\n const handleOutsideClick = useCallback(\n (event: React.MouseEvent | React.TouchEvent) => {\n const isTargetNotification = !!(event.target as Element).closest(\n notificationClassNameSelector,\n );\n\n /*\n * проверка isTargetNotification нужна для предотвращения срабатывания handleOutsideClick\n * при клике на другие нотификации, если их несколько на странице\n */\n if (onClickOutside && visible && !isTargetNotification) {\n onClickOutside(event as React.MouseEvent);\n }\n },\n [onClickOutside, visible],\n );\n\n useClickOutside(notificationRef, handleOutsideClick);\n\n const swipeableHandlers = useSwipeable({\n onSwiped: ({ dir }) => {\n if (onClose && ['Left', 'Right', 'Up'].includes(dir)) {\n setIsClosing(true);\n\n closeTimeoutRef.current = window.setTimeout(() => {\n setIsClosing(false);\n onClose();\n }, 100);\n }\n },\n delta: 100,\n });\n\n const Wrapper = usePortal ? Portal : Fragment;\n\n return (\n <Stack value={zIndex}>\n {(computedZIndex) => (\n <Wrapper>\n <div {...swipeableHandlers}>\n <ToastPlateDesktop\n className={cn(\n styles.notificationComponent,\n {\n [styles.isVisible]: visible,\n [styles.isClosing]: isClosing,\n },\n className,\n )}\n contentClassName={styles.toastContent}\n actionSectionClassName={cn(\n actionSectionClassName,\n styles.actionSection,\n )}\n style={{\n [position]: offset,\n zIndex: computedZIndex,\n ...style,\n }}\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n ref={mergeRefs([ref, notificationRef])}\n role={visible ? 'alert' : undefined}\n hasCloser={hasCloser}\n onClose={onClose}\n {...restProps}\n >\n {children}\n </ToastPlateDesktop>\n </div>\n </Wrapper>\n )}\n </Stack>\n );\n },\n);\n\nNotification.displayName = 'Notification';\n"],"names":["styles","forwardRef","stackingOrder","__rest","useRef","useState","useCallback","useEffect","elementClosest","useClickOutside","useSwipeable","Portal","Fragment","React","Stack","__assign","ToastPlateDesktop","cn","mergeRefs"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AA+EA,IAAM,6BAA6B,GAAG,GAAA,CAAA,MAAA,CAAIA,YAAM,CAAC,qBAAqB,CAAE;IAE3D,YAAY,GAAGC,gBAAU,CAClC,UACI,EAkBC,EAC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,CAAAG,yBAAiB,mBACd,SAAS,EAAEC,mBAAE,CACTjB,YAAM,CAAC,qBAAqB,GAAA,EAAA,GAAA,EAAA;AAExB,wBAAA,EAAA,CAACA,YAAM,CAAC,SAAS,CAAA,GAAG,OAAO;AAC3B,wBAAA,EAAA,CAACA,YAAM,CAAC,SAAS,CAAA,GAAG,SAAS;AAEjC,wBAAA,EAAA,GAAA,SAAS,CACZ,EACD,gBAAgB,EAAEA,YAAM,CAAC,YAAY,EACrC,sBAAsB,EAAEiB,mBAAE,CACtB,sBAAsB,EACtBjB,YAAM,CAAC,aAAa,CACvB,EACD,KAAK,8BACA,QAAQ,CAAA,GAAG,MAAM,EAClB,SAAM,GAAE,cAAc,EACnB,EAAA,GAAA,KAAK,GAEZ,YAAY,EAAE,gBAAgB,EAC9B,YAAY,EAAE,gBAAgB,EAC9B,GAAG,EAAEkB,0BAAS,CAAC,CAAC,GAAG,EAAE,eAAe,CAAC,CAAC,EACtC,IAAI,EAAE,OAAO,GAAG,OAAO,GAAG,SAAS,EACnC,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,OAAO,EAAA,EACZ,SAAS,CAEZ,EAAA,QAAQ,CACO,CAClB,CACA;KACb,CACG;AAEhB,CAAC;AAGL,YAAY,CAAC,WAAW,GAAG,cAAc;;;;"}
@@ -0,0 +1,49 @@
1
+ :root {
2
+ --gap-xs: 8px;
3
+ --gap-s: 12px;
4
+ --gap-xl: 24px;
5
+ --gap-4xl: 48px;
6
+ --gap-s-neg: -12px;
7
+ --gap-0: 0px;
8
+ --gap-8: var(--gap-xs);
9
+ --gap-12: var(--gap-s);
10
+ --gap-24: var(--gap-xl);
11
+ --gap-48: var(--gap-4xl);
12
+ --gap-12-neg: var(--gap-s-neg);
13
+ } :root {
14
+ --notification-desktop-content-width: 278px;
15
+ } .notification__notificationComponent_1wz1k {
16
+ visibility: hidden;
17
+ right: var(--gap-12);
18
+ transform: translate(0, -500px);
19
+ width: calc(100% - var(--gap-24));
20
+ max-width: calc(100vw - var(--gap-24));
21
+ -webkit-user-select: none;
22
+ -moz-user-select: none;
23
+ user-select: none;
24
+ transition: transform 0.4s ease-out
25
+ } @media screen and (min-width: 600px) { .notification__notificationComponent_1wz1k {
26
+ right: var(--gap-48);
27
+ width: auto;
28
+ transform: translate(calc(100% + var(--gap-48)), 0)
29
+ }
30
+ } .notification__notificationComponent_1wz1k.notification__isVisible_1wz1k {
31
+ visibility: visible;
32
+ transform: translate(0, 0);
33
+ } .notification__notificationComponent_1wz1k.notification__isClosing_1wz1k {
34
+ transition: transform 0.1s ease-out;
35
+ transform: translate(100vw, 0)
36
+ } @media screen and (min-width: 600px) { .notification__notificationComponent_1wz1k.notification__isClosing_1wz1k {
37
+ transform: translate(calc(100% + var(--gap-48)), 0)
38
+ }
39
+ } .notification__notificationComponent_1wz1k.notification__notificationComponent_1wz1k {
40
+ position: fixed;
41
+ } @media screen and (min-width: 600px) { .notification__toastContent_1wz1k {
42
+ width: var(--notification-desktop-content-width)
43
+ }
44
+ } .notification__actionSection_1wz1k {
45
+ min-width: 104px;
46
+ min-height: 48px;
47
+ padding: var(--gap-0) var(--gap-8);
48
+ margin: var(--gap-12-neg) var(--gap-0);
49
+ }
@@ -0,0 +1 @@
1
+ export * from './Component';
@@ -0,0 +1,10 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var Component = require('./Component.js');
6
+
7
+
8
+
9
+ exports.Notification = Component.Notification;
10
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
@@ -0,0 +1,8 @@
1
+ 'use strict';
2
+
3
+ require('./index.css');
4
+
5
+ var styles = {"notificationComponent":"notification__notificationComponent_1wz1k","isVisible":"notification__isVisible_1wz1k","isClosing":"notification__isClosing_1wz1k","toastContent":"notification__toastContent_1wz1k","actionSection":"notification__actionSection_1wz1k"};
6
+
7
+ module.exports = styles;
8
+ //# sourceMappingURL=index.module.css.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.module.css.js","sources":["src/index.module.css"],"sourcesContent":["@import '@alfalab/core-components-vars/src/no-dynamic-mixins-index.css';\n\n:root {\n --notification-desktop-content-width: 278px;\n}\n\n.notificationComponent {\n visibility: hidden;\n right: var(--gap-12);\n transform: translate(0, -500px);\n width: calc(100% - var(--gap-24));\n max-width: calc(100vw - var(--gap-24));\n user-select: none;\n transition: transform 0.4s ease-out;\n\n @media screen and (min-width: 600px) {\n right: var(--gap-48);\n width: auto;\n transform: translate(calc(100% + var(--gap-48)), 0);\n }\n\n &.isVisible {\n visibility: visible;\n transform: translate(0, 0);\n }\n\n &.isClosing {\n transition: transform 0.1s ease-out;\n transform: translate(100vw, 0);\n\n @media screen and (min-width: 600px) {\n transform: translate(calc(100% + var(--gap-48)), 0);\n }\n }\n}\n\n.notificationComponent.notificationComponent {\n position: fixed;\n}\n\n.toastContent {\n @media screen and (min-width: 600px) {\n width: var(--notification-desktop-content-width);\n }\n}\n\n.actionSection {\n min-width: 104px;\n min-height: 48px;\n padding: var(--gap-0) var(--gap-8);\n margin: var(--gap-12-neg) var(--gap-0);\n}\n"],"names":[],"mappings":";;;;AAEgB,aAAe,CAAC,uBAAuB,CAAC,2CAA2C,CAAC,WAAW,CAAC,+BAA+B,CAAC,WAAW,CAAC,+BAA+B,CAAC,cAAc,CAAC,kCAAkC,CAAC,eAAe,CAAC,mCAAmC,CAAC;;;;"}
@@ -0,0 +1 @@
1
+ export { getNotificationTestIds } from '../utils/getNotificationTestIds';
@@ -0,0 +1,10 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var getNotificationTestIds = require('../utils/getNotificationTestIds.js');
6
+
7
+
8
+
9
+ exports.getNotificationTestIds = getNotificationTestIds.getNotificationTestIds;
10
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
@@ -0,0 +1,4 @@
1
+ export declare function getNotificationTestIds(dataTestId: string): {
2
+ badge: string;
3
+ component: string;
4
+ };
@@ -0,0 +1,15 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var dynamicMixins = require('@alfalab/core-components-shared/dynamic-mixins');
6
+
7
+ function getNotificationTestIds(dataTestId) {
8
+ return {
9
+ badge: dynamicMixins.getDataTestId(dataTestId, 'badge'),
10
+ component: dynamicMixins.getDataTestId(dataTestId, 'component'),
11
+ };
12
+ }
13
+
14
+ exports.getNotificationTestIds = getNotificationTestIds;
15
+ //# sourceMappingURL=getNotificationTestIds.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getNotificationTestIds.js","sources":["../../src/utils/getNotificationTestIds.ts"],"sourcesContent":["import { getDataTestId } from '@alfalab/core-components-shared';\n\nexport function getNotificationTestIds(dataTestId: string) {\n return {\n badge: getDataTestId(dataTestId, 'badge'),\n component: getDataTestId(dataTestId, 'component'),\n };\n}\n"],"names":["getDataTestId"],"mappings":";;;;;;AAEM,SAAU,sBAAsB,CAAC,UAAkB,EAAA;IACrD,OAAO;AACH,QAAA,KAAK,EAAEA,2BAAa,CAAC,UAAU,EAAE,OAAO,CAAC;AACzC,QAAA,SAAS,EAAEA,2BAAa,CAAC,UAAU,EAAE,WAAW,CAAC;KACpD;AACL;;;;"}
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare function useClickOutside(ref: React.RefObject<HTMLElement>, cb: (e: React.MouseEvent | React.TouchEvent) => void): void;
@@ -0,0 +1,36 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var React = require('react');
6
+
7
+ function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
8
+
9
+ var React__default = /*#__PURE__*/_interopDefaultCompat(React);
10
+
11
+ /*
12
+ * Дублирую хук из @alfalab/hooks, так как не подходят названия событий
13
+ * https://github.com/core-ds/utils/blob/develop/packages/hooks/src/useClickOutside/hook.ts
14
+ * issue завел, когда изменения будут реализованы, отсюда можно будет удалить
15
+ * https://github.com/core-ds/utils/issues/35
16
+ */
17
+ function useClickOutside(ref, cb) {
18
+ React__default.default.useEffect(function () {
19
+ // eslint-disable-next-line
20
+ var handler = function (event) {
21
+ if (!ref.current || ref.current.contains(event.target)) {
22
+ return;
23
+ }
24
+ cb(event);
25
+ };
26
+ document.addEventListener('click', handler);
27
+ document.addEventListener('touchend', handler);
28
+ return function () {
29
+ document.removeEventListener('click', handler);
30
+ document.removeEventListener('touchend', handler);
31
+ };
32
+ }, [ref, cb]);
33
+ }
34
+
35
+ exports.useClickOutside = useClickOutside;
36
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../src/utils/index.ts"],"sourcesContent":["import React from 'react';\n\n/*\n * Дублирую хук из @alfalab/hooks, так как не подходят названия событий\n * https://github.com/core-ds/utils/blob/develop/packages/hooks/src/useClickOutside/hook.ts\n * issue завел, когда изменения будут реализованы, отсюда можно будет удалить\n * https://github.com/core-ds/utils/issues/35\n */\nexport function useClickOutside(\n ref: React.RefObject<HTMLElement>,\n cb: (e: React.MouseEvent | React.TouchEvent) => void,\n): void {\n React.useEffect(() => {\n // eslint-disable-next-line\n const handler = (event: any) => {\n if (!ref.current || ref.current.contains(event.target)) {\n return;\n }\n\n cb(event);\n };\n\n document.addEventListener('click', handler);\n document.addEventListener('touchend', handler);\n\n return () => {\n document.removeEventListener('click', handler);\n document.removeEventListener('touchend', handler);\n };\n }, [ref, cb]);\n}\n"],"names":["React"],"mappings":";;;;;;;;;;AAEA;;;;;AAKG;AACa,SAAA,eAAe,CAC3B,GAAiC,EACjC,EAAoD,EAAA;IAEpDA,sBAAK,CAAC,SAAS,CAAC,YAAA;;QAEZ,IAAM,OAAO,GAAG,UAAC,KAAU,EAAA;AACvB,YAAA,IAAI,CAAC,GAAG,CAAC,OAAO,IAAI,GAAG,CAAC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE;gBACpD;AACH;YAED,EAAE,CAAC,KAAK,CAAC;AACb,SAAC;AAED,QAAA,QAAQ,CAAC,gBAAgB,CAAC,OAAO,EAAE,OAAO,CAAC;AAC3C,QAAA,QAAQ,CAAC,gBAAgB,CAAC,UAAU,EAAE,OAAO,CAAC;QAE9C,OAAO,YAAA;AACH,YAAA,QAAQ,CAAC,mBAAmB,CAAC,OAAO,EAAE,OAAO,CAAC;AAC9C,YAAA,QAAQ,CAAC,mBAAmB,CAAC,UAAU,EAAE,OAAO,CAAC;AACrD,SAAC;AACL,KAAC,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;AACjB;;;;"}
package/esm/index.css CHANGED
@@ -12,7 +12,7 @@
12
12
  --gap-12-neg: var(--gap-s-neg);
13
13
  } :root {
14
14
  --notification-desktop-content-width: 278px;
15
- } .notification__notificationComponent_ue7qy {
15
+ } .notification__notificationComponent_1wz1k {
16
16
  visibility: hidden;
17
17
  right: var(--gap-12);
18
18
  transform: translate(0, -500px);
@@ -22,26 +22,26 @@
22
22
  -moz-user-select: none;
23
23
  user-select: none;
24
24
  transition: transform 0.4s ease-out
25
- } @media screen and (min-width: 600px) { .notification__notificationComponent_ue7qy {
25
+ } @media screen and (min-width: 600px) { .notification__notificationComponent_1wz1k {
26
26
  right: var(--gap-48);
27
27
  width: auto;
28
28
  transform: translate(calc(100% + var(--gap-48)), 0)
29
29
  }
30
- } .notification__notificationComponent_ue7qy.notification__isVisible_ue7qy {
30
+ } .notification__notificationComponent_1wz1k.notification__isVisible_1wz1k {
31
31
  visibility: visible;
32
32
  transform: translate(0, 0);
33
- } .notification__notificationComponent_ue7qy.notification__isClosing_ue7qy {
33
+ } .notification__notificationComponent_1wz1k.notification__isClosing_1wz1k {
34
34
  transition: transform 0.1s ease-out;
35
35
  transform: translate(100vw, 0)
36
- } @media screen and (min-width: 600px) { .notification__notificationComponent_ue7qy.notification__isClosing_ue7qy {
36
+ } @media screen and (min-width: 600px) { .notification__notificationComponent_1wz1k.notification__isClosing_1wz1k {
37
37
  transform: translate(calc(100% + var(--gap-48)), 0)
38
38
  }
39
- } .notification__notificationComponent_ue7qy.notification__notificationComponent_ue7qy {
39
+ } .notification__notificationComponent_1wz1k.notification__notificationComponent_1wz1k {
40
40
  position: fixed;
41
- } @media screen and (min-width: 600px) { .notification__toastContent_ue7qy {
41
+ } @media screen and (min-width: 600px) { .notification__toastContent_1wz1k {
42
42
  width: var(--notification-desktop-content-width)
43
43
  }
44
- } .notification__actionSection_ue7qy {
44
+ } .notification__actionSection_1wz1k {
45
45
  min-width: 104px;
46
46
  min-height: 48px;
47
47
  padding: var(--gap-0) var(--gap-8);
@@ -1,6 +1,6 @@
1
1
  import './index.css';
2
2
 
3
- var styles = {"notificationComponent":"notification__notificationComponent_ue7qy","isVisible":"notification__isVisible_ue7qy","isClosing":"notification__isClosing_ue7qy","toastContent":"notification__toastContent_ue7qy","actionSection":"notification__actionSection_ue7qy"};
3
+ var styles = {"notificationComponent":"notification__notificationComponent_1wz1k","isVisible":"notification__isVisible_1wz1k","isClosing":"notification__isClosing_1wz1k","toastContent":"notification__toastContent_1wz1k","actionSection":"notification__actionSection_1wz1k"};
4
4
 
5
5
  export { styles as default };
6
6
  //# sourceMappingURL=index.module.css.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.module.css.js","sources":["src/index.module.css"],"sourcesContent":["@import '@alfalab/core-components-vars/src/index.css';\n\n:root {\n --notification-desktop-content-width: 278px;\n}\n\n.notificationComponent {\n visibility: hidden;\n right: var(--gap-12);\n transform: translate(0, -500px);\n width: calc(100% - var(--gap-24));\n max-width: calc(100vw - var(--gap-24));\n user-select: none;\n transition: transform 0.4s ease-out;\n\n @media screen and (min-width: 600px) {\n right: var(--gap-48);\n width: auto;\n transform: translate(calc(100% + var(--gap-48)), 0);\n }\n\n &.isVisible {\n visibility: visible;\n transform: translate(0, 0);\n }\n\n &.isClosing {\n transition: transform 0.1s ease-out;\n transform: translate(100vw, 0);\n\n @media screen and (min-width: 600px) {\n transform: translate(calc(100% + var(--gap-48)), 0);\n }\n }\n}\n\n.notificationComponent.notificationComponent {\n position: fixed;\n}\n\n.toastContent {\n @media screen and (min-width: 600px) {\n width: var(--notification-desktop-content-width);\n }\n}\n\n.actionSection {\n min-width: 104px;\n min-height: 48px;\n padding: var(--gap-0) var(--gap-8);\n margin: var(--gap-12-neg) var(--gap-0);\n}\n"],"names":[],"mappings":";;AAEgB,aAAe,CAAC,uBAAuB,CAAC,2CAA2C,CAAC,WAAW,CAAC,+BAA+B,CAAC,WAAW,CAAC,+BAA+B,CAAC,cAAc,CAAC,kCAAkC,CAAC,eAAe,CAAC,mCAAmC,CAAC;;;;"}
1
+ {"version":3,"file":"index.module.css.js","sources":["src/index.module.css"],"sourcesContent":["@import '@alfalab/core-components-vars/src/no-dynamic-mixins-index.css';\n\n:root {\n --notification-desktop-content-width: 278px;\n}\n\n.notificationComponent {\n visibility: hidden;\n right: var(--gap-12);\n transform: translate(0, -500px);\n width: calc(100% - var(--gap-24));\n max-width: calc(100vw - var(--gap-24));\n user-select: none;\n transition: transform 0.4s ease-out;\n\n @media screen and (min-width: 600px) {\n right: var(--gap-48);\n width: auto;\n transform: translate(calc(100% + var(--gap-48)), 0);\n }\n\n &.isVisible {\n visibility: visible;\n transform: translate(0, 0);\n }\n\n &.isClosing {\n transition: transform 0.1s ease-out;\n transform: translate(100vw, 0);\n\n @media screen and (min-width: 600px) {\n transform: translate(calc(100% + var(--gap-48)), 0);\n }\n }\n}\n\n.notificationComponent.notificationComponent {\n position: fixed;\n}\n\n.toastContent {\n @media screen and (min-width: 600px) {\n width: var(--notification-desktop-content-width);\n }\n}\n\n.actionSection {\n min-width: 104px;\n min-height: 48px;\n padding: var(--gap-0) var(--gap-8);\n margin: var(--gap-12-neg) var(--gap-0);\n}\n"],"names":[],"mappings":";;AAEgB,aAAe,CAAC,uBAAuB,CAAC,2CAA2C,CAAC,WAAW,CAAC,+BAA+B,CAAC,WAAW,CAAC,+BAA+B,CAAC,cAAc,CAAC,kCAAkC,CAAC,eAAe,CAAC,mCAAmC,CAAC;;;;"}
package/index.css CHANGED
@@ -12,7 +12,7 @@
12
12
  --gap-12-neg: var(--gap-s-neg);
13
13
  } :root {
14
14
  --notification-desktop-content-width: 278px;
15
- } .notification__notificationComponent_ue7qy {
15
+ } .notification__notificationComponent_1wz1k {
16
16
  visibility: hidden;
17
17
  right: var(--gap-12);
18
18
  transform: translate(0, -500px);
@@ -22,26 +22,26 @@
22
22
  -moz-user-select: none;
23
23
  user-select: none;
24
24
  transition: transform 0.4s ease-out
25
- } @media screen and (min-width: 600px) { .notification__notificationComponent_ue7qy {
25
+ } @media screen and (min-width: 600px) { .notification__notificationComponent_1wz1k {
26
26
  right: var(--gap-48);
27
27
  width: auto;
28
28
  transform: translate(calc(100% + var(--gap-48)), 0)
29
29
  }
30
- } .notification__notificationComponent_ue7qy.notification__isVisible_ue7qy {
30
+ } .notification__notificationComponent_1wz1k.notification__isVisible_1wz1k {
31
31
  visibility: visible;
32
32
  transform: translate(0, 0);
33
- } .notification__notificationComponent_ue7qy.notification__isClosing_ue7qy {
33
+ } .notification__notificationComponent_1wz1k.notification__isClosing_1wz1k {
34
34
  transition: transform 0.1s ease-out;
35
35
  transform: translate(100vw, 0)
36
- } @media screen and (min-width: 600px) { .notification__notificationComponent_ue7qy.notification__isClosing_ue7qy {
36
+ } @media screen and (min-width: 600px) { .notification__notificationComponent_1wz1k.notification__isClosing_1wz1k {
37
37
  transform: translate(calc(100% + var(--gap-48)), 0)
38
38
  }
39
- } .notification__notificationComponent_ue7qy.notification__notificationComponent_ue7qy {
39
+ } .notification__notificationComponent_1wz1k.notification__notificationComponent_1wz1k {
40
40
  position: fixed;
41
- } @media screen and (min-width: 600px) { .notification__toastContent_ue7qy {
41
+ } @media screen and (min-width: 600px) { .notification__toastContent_1wz1k {
42
42
  width: var(--notification-desktop-content-width)
43
43
  }
44
- } .notification__actionSection_ue7qy {
44
+ } .notification__actionSection_1wz1k {
45
45
  min-width: 104px;
46
46
  min-height: 48px;
47
47
  padding: var(--gap-0) var(--gap-8);
@@ -2,7 +2,7 @@
2
2
 
3
3
  require('./index.css');
4
4
 
5
- var styles = {"notificationComponent":"notification__notificationComponent_ue7qy","isVisible":"notification__isVisible_ue7qy","isClosing":"notification__isClosing_ue7qy","toastContent":"notification__toastContent_ue7qy","actionSection":"notification__actionSection_ue7qy"};
5
+ var styles = {"notificationComponent":"notification__notificationComponent_1wz1k","isVisible":"notification__isVisible_1wz1k","isClosing":"notification__isClosing_1wz1k","toastContent":"notification__toastContent_1wz1k","actionSection":"notification__actionSection_1wz1k"};
6
6
 
7
7
  module.exports = styles;
8
8
  //# sourceMappingURL=index.module.css.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.module.css.js","sources":["src/index.module.css"],"sourcesContent":["@import '@alfalab/core-components-vars/src/index.css';\n\n:root {\n --notification-desktop-content-width: 278px;\n}\n\n.notificationComponent {\n visibility: hidden;\n right: var(--gap-12);\n transform: translate(0, -500px);\n width: calc(100% - var(--gap-24));\n max-width: calc(100vw - var(--gap-24));\n user-select: none;\n transition: transform 0.4s ease-out;\n\n @media screen and (min-width: 600px) {\n right: var(--gap-48);\n width: auto;\n transform: translate(calc(100% + var(--gap-48)), 0);\n }\n\n &.isVisible {\n visibility: visible;\n transform: translate(0, 0);\n }\n\n &.isClosing {\n transition: transform 0.1s ease-out;\n transform: translate(100vw, 0);\n\n @media screen and (min-width: 600px) {\n transform: translate(calc(100% + var(--gap-48)), 0);\n }\n }\n}\n\n.notificationComponent.notificationComponent {\n position: fixed;\n}\n\n.toastContent {\n @media screen and (min-width: 600px) {\n width: var(--notification-desktop-content-width);\n }\n}\n\n.actionSection {\n min-width: 104px;\n min-height: 48px;\n padding: var(--gap-0) var(--gap-8);\n margin: var(--gap-12-neg) var(--gap-0);\n}\n"],"names":[],"mappings":";;;;AAEgB,aAAe,CAAC,uBAAuB,CAAC,2CAA2C,CAAC,WAAW,CAAC,+BAA+B,CAAC,WAAW,CAAC,+BAA+B,CAAC,cAAc,CAAC,kCAAkC,CAAC,eAAe,CAAC,mCAAmC,CAAC;;;;"}
1
+ {"version":3,"file":"index.module.css.js","sources":["src/index.module.css"],"sourcesContent":["@import '@alfalab/core-components-vars/src/no-dynamic-mixins-index.css';\n\n:root {\n --notification-desktop-content-width: 278px;\n}\n\n.notificationComponent {\n visibility: hidden;\n right: var(--gap-12);\n transform: translate(0, -500px);\n width: calc(100% - var(--gap-24));\n max-width: calc(100vw - var(--gap-24));\n user-select: none;\n transition: transform 0.4s ease-out;\n\n @media screen and (min-width: 600px) {\n right: var(--gap-48);\n width: auto;\n transform: translate(calc(100% + var(--gap-48)), 0);\n }\n\n &.isVisible {\n visibility: visible;\n transform: translate(0, 0);\n }\n\n &.isClosing {\n transition: transform 0.1s ease-out;\n transform: translate(100vw, 0);\n\n @media screen and (min-width: 600px) {\n transform: translate(calc(100% + var(--gap-48)), 0);\n }\n }\n}\n\n.notificationComponent.notificationComponent {\n position: fixed;\n}\n\n.toastContent {\n @media screen and (min-width: 600px) {\n width: var(--notification-desktop-content-width);\n }\n}\n\n.actionSection {\n min-width: 104px;\n min-height: 48px;\n padding: var(--gap-0) var(--gap-8);\n margin: var(--gap-12-neg) var(--gap-0);\n}\n"],"names":[],"mappings":";;;;AAEgB,aAAe,CAAC,uBAAuB,CAAC,2CAA2C,CAAC,WAAW,CAAC,+BAA+B,CAAC,WAAW,CAAC,+BAA+B,CAAC,cAAc,CAAC,kCAAkC,CAAC,eAAe,CAAC,mCAAmC,CAAC;;;;"}
package/modern/index.css CHANGED
@@ -12,7 +12,7 @@
12
12
  --gap-12-neg: var(--gap-s-neg);
13
13
  } :root {
14
14
  --notification-desktop-content-width: 278px;
15
- } .notification__notificationComponent_ue7qy {
15
+ } .notification__notificationComponent_1wz1k {
16
16
  visibility: hidden;
17
17
  right: var(--gap-12);
18
18
  transform: translate(0, -500px);
@@ -22,26 +22,26 @@
22
22
  -moz-user-select: none;
23
23
  user-select: none;
24
24
  transition: transform 0.4s ease-out
25
- } @media screen and (min-width: 600px) { .notification__notificationComponent_ue7qy {
25
+ } @media screen and (min-width: 600px) { .notification__notificationComponent_1wz1k {
26
26
  right: var(--gap-48);
27
27
  width: auto;
28
28
  transform: translate(calc(100% + var(--gap-48)), 0)
29
29
  }
30
- } .notification__notificationComponent_ue7qy.notification__isVisible_ue7qy {
30
+ } .notification__notificationComponent_1wz1k.notification__isVisible_1wz1k {
31
31
  visibility: visible;
32
32
  transform: translate(0, 0);
33
- } .notification__notificationComponent_ue7qy.notification__isClosing_ue7qy {
33
+ } .notification__notificationComponent_1wz1k.notification__isClosing_1wz1k {
34
34
  transition: transform 0.1s ease-out;
35
35
  transform: translate(100vw, 0)
36
- } @media screen and (min-width: 600px) { .notification__notificationComponent_ue7qy.notification__isClosing_ue7qy {
36
+ } @media screen and (min-width: 600px) { .notification__notificationComponent_1wz1k.notification__isClosing_1wz1k {
37
37
  transform: translate(calc(100% + var(--gap-48)), 0)
38
38
  }
39
- } .notification__notificationComponent_ue7qy.notification__notificationComponent_ue7qy {
39
+ } .notification__notificationComponent_1wz1k.notification__notificationComponent_1wz1k {
40
40
  position: fixed;
41
- } @media screen and (min-width: 600px) { .notification__toastContent_ue7qy {
41
+ } @media screen and (min-width: 600px) { .notification__toastContent_1wz1k {
42
42
  width: var(--notification-desktop-content-width)
43
43
  }
44
- } .notification__actionSection_ue7qy {
44
+ } .notification__actionSection_1wz1k {
45
45
  min-width: 104px;
46
46
  min-height: 48px;
47
47
  padding: var(--gap-0) var(--gap-8);
@@ -1,6 +1,6 @@
1
1
  import './index.css';
2
2
 
3
- const styles = {"notificationComponent":"notification__notificationComponent_ue7qy","isVisible":"notification__isVisible_ue7qy","isClosing":"notification__isClosing_ue7qy","toastContent":"notification__toastContent_ue7qy","actionSection":"notification__actionSection_ue7qy"};
3
+ const styles = {"notificationComponent":"notification__notificationComponent_1wz1k","isVisible":"notification__isVisible_1wz1k","isClosing":"notification__isClosing_1wz1k","toastContent":"notification__toastContent_1wz1k","actionSection":"notification__actionSection_1wz1k"};
4
4
 
5
5
  export { styles as default };
6
6
  //# sourceMappingURL=index.module.css.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.module.css.js","sources":["src/index.module.css"],"sourcesContent":["@import '@alfalab/core-components-vars/src/index.css';\n\n:root {\n --notification-desktop-content-width: 278px;\n}\n\n.notificationComponent {\n visibility: hidden;\n right: var(--gap-12);\n transform: translate(0, -500px);\n width: calc(100% - var(--gap-24));\n max-width: calc(100vw - var(--gap-24));\n user-select: none;\n transition: transform 0.4s ease-out;\n\n @media screen and (min-width: 600px) {\n right: var(--gap-48);\n width: auto;\n transform: translate(calc(100% + var(--gap-48)), 0);\n }\n\n &.isVisible {\n visibility: visible;\n transform: translate(0, 0);\n }\n\n &.isClosing {\n transition: transform 0.1s ease-out;\n transform: translate(100vw, 0);\n\n @media screen and (min-width: 600px) {\n transform: translate(calc(100% + var(--gap-48)), 0);\n }\n }\n}\n\n.notificationComponent.notificationComponent {\n position: fixed;\n}\n\n.toastContent {\n @media screen and (min-width: 600px) {\n width: var(--notification-desktop-content-width);\n }\n}\n\n.actionSection {\n min-width: 104px;\n min-height: 48px;\n padding: var(--gap-0) var(--gap-8);\n margin: var(--gap-12-neg) var(--gap-0);\n}\n"],"names":[],"mappings":";;AAEgB,eAAe,CAAC,uBAAuB,CAAC,2CAA2C,CAAC,WAAW,CAAC,+BAA+B,CAAC,WAAW,CAAC,+BAA+B,CAAC,cAAc,CAAC,kCAAkC,CAAC,eAAe,CAAC,mCAAmC,CAAC;;;;"}
1
+ {"version":3,"file":"index.module.css.js","sources":["src/index.module.css"],"sourcesContent":["@import '@alfalab/core-components-vars/src/no-dynamic-mixins-index.css';\n\n:root {\n --notification-desktop-content-width: 278px;\n}\n\n.notificationComponent {\n visibility: hidden;\n right: var(--gap-12);\n transform: translate(0, -500px);\n width: calc(100% - var(--gap-24));\n max-width: calc(100vw - var(--gap-24));\n user-select: none;\n transition: transform 0.4s ease-out;\n\n @media screen and (min-width: 600px) {\n right: var(--gap-48);\n width: auto;\n transform: translate(calc(100% + var(--gap-48)), 0);\n }\n\n &.isVisible {\n visibility: visible;\n transform: translate(0, 0);\n }\n\n &.isClosing {\n transition: transform 0.1s ease-out;\n transform: translate(100vw, 0);\n\n @media screen and (min-width: 600px) {\n transform: translate(calc(100% + var(--gap-48)), 0);\n }\n }\n}\n\n.notificationComponent.notificationComponent {\n position: fixed;\n}\n\n.toastContent {\n @media screen and (min-width: 600px) {\n width: var(--notification-desktop-content-width);\n }\n}\n\n.actionSection {\n min-width: 104px;\n min-height: 48px;\n padding: var(--gap-0) var(--gap-8);\n margin: var(--gap-12-neg) var(--gap-0);\n}\n"],"names":[],"mappings":";;AAEgB,eAAe,CAAC,uBAAuB,CAAC,2CAA2C,CAAC,WAAW,CAAC,+BAA+B,CAAC,WAAW,CAAC,+BAA+B,CAAC,cAAc,CAAC,kCAAkC,CAAC,eAAe,CAAC,mCAAmC,CAAC;;;;"}
@@ -1,3 +1,5 @@
1
+
2
+
1
3
  :root {
2
4
  --notification-desktop-content-width: 278px;
3
5
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alfalab/core-components-notification",
3
- "version": "8.0.0",
3
+ "version": "8.1.0-snapshot-92b8690",
4
4
  "description": "",
5
5
  "keywords": [],
6
6
  "license": "MIT",
@@ -10,10 +10,10 @@
10
10
  "main": "index.js",
11
11
  "module": "./esm/index.js",
12
12
  "dependencies": {
13
- "@alfalab/core-components-portal": "^4.0.0",
14
- "@alfalab/core-components-shared": "^1.0.0",
15
- "@alfalab/core-components-stack": "^6.0.0",
16
- "@alfalab/core-components-toast-plate": "^8.0.0",
13
+ "@alfalab/core-components-portal": "4.1.0-snapshot-92b8690",
14
+ "@alfalab/core-components-shared": "1.1.0-snapshot-92b8690",
15
+ "@alfalab/core-components-stack": "6.1.0-snapshot-92b8690",
16
+ "@alfalab/core-components-toast-plate": "8.1.0-snapshot-92b8690",
17
17
  "classnames": "^2.5.1",
18
18
  "element-closest": "^3.0.2",
19
19
  "react-merge-refs": "^1.1.0",
@@ -21,7 +21,7 @@
21
21
  "tslib": "^2.4.0"
22
22
  },
23
23
  "peerDependencies": {
24
- "@alfalab/core-components-stack-context": "^1.0.0",
24
+ "@alfalab/core-components-stack-context": "1.1.0-snapshot-92b8690",
25
25
  "react": "^16.9.0 || ^17.0.1 || ^18.0.0",
26
26
  "react-dom": "^16.9.0 || ^17.0.1 || ^18.0.0"
27
27
  },
@@ -29,6 +29,6 @@
29
29
  "access": "public",
30
30
  "directory": "dist"
31
31
  },
32
- "themesVersion": "14.0.0",
33
- "varsVersion": "10.0.0"
32
+ "themesVersion": "14.1.0-snapshot-92b8690",
33
+ "varsVersion": "10.1.0-snapshot-92b8690"
34
34
  }
@@ -1,4 +1,4 @@
1
- @import '@alfalab/core-components-vars/src/index.css';
1
+ @import '@alfalab/core-components-vars/src/no-dynamic-mixins-index.css';
2
2
 
3
3
  :root {
4
4
  --notification-desktop-content-width: 278px;