@astral/ui 4.0.0-alpha.40 → 4.0.0-alpha.41

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.
Files changed (37) hide show
  1. package/components/RedesignBanner/RedesignBanner.d.ts +3 -0
  2. package/components/RedesignBanner/RedesignBanner.js +11 -0
  3. package/components/RedesignBanner/RedesignBannerDialog/RedesignBannerDialog.d.ts +3 -0
  4. package/components/RedesignBanner/RedesignBannerDialog/RedesignBannerDialog.js +16 -0
  5. package/components/RedesignBanner/RedesignBannerDialog/index.d.ts +2 -0
  6. package/components/RedesignBanner/RedesignBannerDialog/index.js +2 -0
  7. package/components/RedesignBanner/RedesignBannerDialog/styles.d.ts +12 -0
  8. package/components/RedesignBanner/RedesignBannerDialog/styles.js +28 -0
  9. package/components/RedesignBanner/constants.d.ts +5 -0
  10. package/components/RedesignBanner/constants.js +5 -0
  11. package/components/RedesignBanner/index.d.ts +1 -0
  12. package/components/RedesignBanner/index.js +1 -0
  13. package/components/RedesignBanner/types.d.ts +6 -0
  14. package/components/RedesignBanner/types.js +1 -0
  15. package/components/RedesignBanner/useLogic/index.d.ts +1 -0
  16. package/components/RedesignBanner/useLogic/index.js +1 -0
  17. package/components/RedesignBanner/useLogic/useLogic.d.ts +3 -0
  18. package/components/RedesignBanner/useLogic/useLogic.js +14 -0
  19. package/node/components/RedesignBanner/RedesignBanner.d.ts +3 -0
  20. package/node/components/RedesignBanner/RedesignBanner.js +38 -0
  21. package/node/components/RedesignBanner/RedesignBannerDialog/RedesignBannerDialog.d.ts +3 -0
  22. package/node/components/RedesignBanner/RedesignBannerDialog/RedesignBannerDialog.js +20 -0
  23. package/node/components/RedesignBanner/RedesignBannerDialog/index.d.ts +2 -0
  24. package/node/components/RedesignBanner/RedesignBannerDialog/index.js +4 -0
  25. package/node/components/RedesignBanner/RedesignBannerDialog/styles.d.ts +12 -0
  26. package/node/components/RedesignBanner/RedesignBannerDialog/styles.js +31 -0
  27. package/node/components/RedesignBanner/constants.d.ts +5 -0
  28. package/node/components/RedesignBanner/constants.js +8 -0
  29. package/node/components/RedesignBanner/index.d.ts +1 -0
  30. package/node/components/RedesignBanner/index.js +17 -0
  31. package/node/components/RedesignBanner/types.d.ts +6 -0
  32. package/node/components/RedesignBanner/types.js +2 -0
  33. package/node/components/RedesignBanner/useLogic/index.d.ts +1 -0
  34. package/node/components/RedesignBanner/useLogic/index.js +17 -0
  35. package/node/components/RedesignBanner/useLogic/useLogic.d.ts +3 -0
  36. package/node/components/RedesignBanner/useLogic/useLogic.js +18 -0
  37. package/package.json +8 -1
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import { type RedesignBannerProps } from './types';
3
+ export declare const RedesignBanner: (props: RedesignBannerProps) => JSX.Element | null;
@@ -0,0 +1,11 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { lazy, Suspense } from 'react';
3
+ import { useLogic } from './useLogic';
4
+ const RedesignBannerDialog = lazy(() => import('./RedesignBannerDialog'));
5
+ export const RedesignBanner = (props) => {
6
+ const { isSkipShow } = useLogic();
7
+ if (isSkipShow) {
8
+ return null;
9
+ }
10
+ return (_jsx(Suspense, { children: _jsx(RedesignBannerDialog, Object.assign({}, props)) }));
11
+ };
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import { type RedesignBannerProps } from '../types';
3
+ export declare const RedesignBannerDialog: ({ imgSrc }: RedesignBannerProps) => JSX.Element;
@@ -0,0 +1,16 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useState } from 'react';
3
+ import { Button } from '../../Button';
4
+ import { Dialog } from '../../Dialog';
5
+ import { DialogActions } from '../../DialogActions';
6
+ import { DialogContentText } from '../../DialogContentText';
7
+ import { DEFAULT_IMG_SRC, LOCAL_STORAGE_KEY } from '../constants';
8
+ import { Description, Picture, StyledDialogContent } from './styles';
9
+ export const RedesignBannerDialog = ({ imgSrc }) => {
10
+ const [isOpen, setOpen] = useState(true);
11
+ const handleClose = () => {
12
+ localStorage.setItem(LOCAL_STORAGE_KEY, 'true');
13
+ setOpen(false);
14
+ };
15
+ return (_jsxs(Dialog, { title: "\u0412\u0441\u0442\u0440\u0435\u0447\u0430\u0439\u0442\u0435 \u043E\u0431\u043D\u043E\u0432\u043B\u0451\u043D\u043D\u044B\u0439 \u0438\u043D\u0442\u0435\u0440\u0444\u0435\u0439\u0441", open: isOpen, onClose: handleClose, children: [_jsxs(StyledDialogContent, { children: [_jsxs(Picture, { children: [_jsx("source", { srcSet: imgSrc || DEFAULT_IMG_SRC.webp, type: "image/webp" }), _jsx("img", { src: DEFAULT_IMG_SRC.png, alt: "\u042D\u043B\u0435\u043C\u0435\u043D\u0442\u044B \u043E\u0431\u043D\u043E\u0432\u043B\u0435\u043D\u043D\u043E\u0433\u043E \u0438\u043D\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430" })] }), _jsxs(Description, { children: [_jsx(DialogContentText, { children: "\u041C\u044B \u043E\u0431\u043D\u043E\u0432\u0438\u043B\u0438 \u0434\u0438\u0437\u0430\u0439\u043D, \u0443\u043B\u0443\u0447\u0448\u0438\u043B\u0438 \u0441\u0442\u0440\u0443\u043A\u0442\u0443\u0440\u0443 \u0438 \u0441\u0434\u0435\u043B\u0430\u043B\u0438 \u0438\u043D\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0431\u043E\u043B\u0435\u0435 \u0441\u043E\u0432\u0440\u0435\u043C\u0435\u043D\u043D\u044B\u043C \u0438 \u0443\u0434\u043E\u0431\u043D\u044B\u043C \u0434\u043B\u044F \u0435\u0436\u0435\u0434\u043D\u0435\u0432\u043D\u043E\u0439 \u0440\u0430\u0431\u043E\u0442\u044B." }), _jsx(DialogContentText, { children: "\u041F\u043E\u043F\u0440\u043E\u0431\u0443\u0439\u0442\u0435 \u043D\u043E\u0432\u0443\u044E \u0432\u0435\u0440\u0441\u0438\u044E \u0438 \u043F\u043E\u0434\u0435\u043B\u0438\u0442\u0435\u0441\u044C \u0441\u0432\u043E\u0438\u043C \u043C\u043D\u0435\u043D\u0438\u0435\u043C \u2014 \u044D\u0442\u043E \u043F\u043E\u043C\u043E\u0436\u0435\u0442 \u043D\u0430\u043C \u0441\u043E\u0432\u0435\u0440\u0448\u0435\u043D\u0441\u0442\u0432\u043E\u0432\u0430\u0442\u044C \u043F\u0440\u043E\u0434\u0443\u043A\u0442." })] })] }), _jsx(DialogActions, { children: _jsx(Button, { onClick: handleClose, children: "\u041E\u0442\u043B\u0438\u0447\u043D\u043E" }) })] }));
16
+ };
@@ -0,0 +1,2 @@
1
+ import { RedesignBannerDialog } from './RedesignBannerDialog';
2
+ export default RedesignBannerDialog;
@@ -0,0 +1,2 @@
1
+ import { RedesignBannerDialog } from './RedesignBannerDialog';
2
+ export default RedesignBannerDialog;
@@ -0,0 +1,12 @@
1
+ /// <reference types="react" />
2
+ export declare const StyledDialogContent: import("@emotion/styled").StyledComponent<import("../../DialogContent").DialogContentProps & {
3
+ theme?: import("@emotion/react").Theme | undefined;
4
+ }, {}, {}>;
5
+ export declare const Picture: import("@emotion/styled").StyledComponent<{
6
+ theme?: import("@emotion/react").Theme | undefined;
7
+ as?: import("react").ElementType<any> | undefined;
8
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, {}>;
9
+ export declare const Description: import("@emotion/styled").StyledComponent<{
10
+ theme?: import("@emotion/react").Theme | undefined;
11
+ as?: import("react").ElementType<any> | undefined;
12
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
@@ -0,0 +1,28 @@
1
+ import { DialogContent } from '../../DialogContent';
2
+ import { styled } from '../../styles';
3
+ export const StyledDialogContent = styled(DialogContent) `
4
+ display: flex;
5
+ flex-direction: column;
6
+ gap: ${({ theme }) => theme.spacing(4)};
7
+ align-items: center;
8
+
9
+ max-width: 556px;
10
+ `;
11
+ export const Picture = styled.picture `
12
+ overflow: hidden;
13
+
14
+ border: 1px solid ${({ theme }) => theme.palette.grey[100]};
15
+ border-radius: ${({ theme }) => theme.shape.medium};
16
+
17
+ > img {
18
+ display: block;
19
+
20
+ width: 100%;
21
+ }
22
+ `;
23
+ export const Description = styled.span `
24
+ display: flex;
25
+ flex-direction: column;
26
+ gap: ${({ theme }) => theme.spacing(3)};
27
+ align-items: center;
28
+ `;
@@ -0,0 +1,5 @@
1
+ export declare const LOCAL_STORAGE_KEY = "astralui-redesign-banner";
2
+ export declare const DEFAULT_IMG_SRC: {
3
+ webp: string;
4
+ png: string;
5
+ };
@@ -0,0 +1,5 @@
1
+ export const LOCAL_STORAGE_KEY = 'astralui-redesign-banner';
2
+ export const DEFAULT_IMG_SRC = {
3
+ webp: 'https://frontend-static.astral.ru/images/UI-kit-v4.webp',
4
+ png: 'https://frontend-static.astral.ru/images/UI-kit-v4.png',
5
+ };
@@ -0,0 +1 @@
1
+ export * from './RedesignBanner';
@@ -0,0 +1 @@
1
+ export * from './RedesignBanner';
@@ -0,0 +1,6 @@
1
+ export type RedesignBannerProps = {
2
+ /**
3
+ * Кастомное изображение
4
+ */
5
+ imgSrc?: string;
6
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export * from './useLogic';
@@ -0,0 +1 @@
1
+ export * from './useLogic';
@@ -0,0 +1,3 @@
1
+ export declare const useLogic: () => {
2
+ isSkipShow: string | boolean | null;
3
+ };
@@ -0,0 +1,14 @@
1
+ import { useMemo } from 'react';
2
+ import { useViewportType } from '../../hooks';
3
+ import { LOCAL_STORAGE_KEY } from '../constants';
4
+ export const useLogic = () => {
5
+ const { isMobile } = useViewportType();
6
+ const isSkipShow = useMemo(() => {
7
+ if (isMobile) {
8
+ // Не показываем баннер нa mobile разрешениях
9
+ return true;
10
+ }
11
+ return localStorage.getItem(LOCAL_STORAGE_KEY);
12
+ }, []);
13
+ return { isSkipShow };
14
+ };
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import { type RedesignBannerProps } from './types';
3
+ export declare const RedesignBanner: (props: RedesignBannerProps) => JSX.Element | null;
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.RedesignBanner = void 0;
27
+ const jsx_runtime_1 = require("react/jsx-runtime");
28
+ const react_1 = require("react");
29
+ const useLogic_1 = require("./useLogic");
30
+ const RedesignBannerDialog = (0, react_1.lazy)(() => Promise.resolve().then(() => __importStar(require('./RedesignBannerDialog'))));
31
+ const RedesignBanner = (props) => {
32
+ const { isSkipShow } = (0, useLogic_1.useLogic)();
33
+ if (isSkipShow) {
34
+ return null;
35
+ }
36
+ return ((0, jsx_runtime_1.jsx)(react_1.Suspense, { children: (0, jsx_runtime_1.jsx)(RedesignBannerDialog, Object.assign({}, props)) }));
37
+ };
38
+ exports.RedesignBanner = RedesignBanner;
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import { type RedesignBannerProps } from '../types';
3
+ export declare const RedesignBannerDialog: ({ imgSrc }: RedesignBannerProps) => JSX.Element;
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RedesignBannerDialog = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_1 = require("react");
6
+ const Button_1 = require("../../Button");
7
+ const Dialog_1 = require("../../Dialog");
8
+ const DialogActions_1 = require("../../DialogActions");
9
+ const DialogContentText_1 = require("../../DialogContentText");
10
+ const constants_1 = require("../constants");
11
+ const styles_1 = require("./styles");
12
+ const RedesignBannerDialog = ({ imgSrc }) => {
13
+ const [isOpen, setOpen] = (0, react_1.useState)(true);
14
+ const handleClose = () => {
15
+ localStorage.setItem(constants_1.LOCAL_STORAGE_KEY, 'true');
16
+ setOpen(false);
17
+ };
18
+ return ((0, jsx_runtime_1.jsxs)(Dialog_1.Dialog, { title: "\u0412\u0441\u0442\u0440\u0435\u0447\u0430\u0439\u0442\u0435 \u043E\u0431\u043D\u043E\u0432\u043B\u0451\u043D\u043D\u044B\u0439 \u0438\u043D\u0442\u0435\u0440\u0444\u0435\u0439\u0441", open: isOpen, onClose: handleClose, children: [(0, jsx_runtime_1.jsxs)(styles_1.StyledDialogContent, { children: [(0, jsx_runtime_1.jsxs)(styles_1.Picture, { children: [(0, jsx_runtime_1.jsx)("source", { srcSet: imgSrc || constants_1.DEFAULT_IMG_SRC.webp, type: "image/webp" }), (0, jsx_runtime_1.jsx)("img", { src: constants_1.DEFAULT_IMG_SRC.png, alt: "\u042D\u043B\u0435\u043C\u0435\u043D\u0442\u044B \u043E\u0431\u043D\u043E\u0432\u043B\u0435\u043D\u043D\u043E\u0433\u043E \u0438\u043D\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430" })] }), (0, jsx_runtime_1.jsxs)(styles_1.Description, { children: [(0, jsx_runtime_1.jsx)(DialogContentText_1.DialogContentText, { children: "\u041C\u044B \u043E\u0431\u043D\u043E\u0432\u0438\u043B\u0438 \u0434\u0438\u0437\u0430\u0439\u043D, \u0443\u043B\u0443\u0447\u0448\u0438\u043B\u0438 \u0441\u0442\u0440\u0443\u043A\u0442\u0443\u0440\u0443 \u0438 \u0441\u0434\u0435\u043B\u0430\u043B\u0438 \u0438\u043D\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0431\u043E\u043B\u0435\u0435 \u0441\u043E\u0432\u0440\u0435\u043C\u0435\u043D\u043D\u044B\u043C \u0438 \u0443\u0434\u043E\u0431\u043D\u044B\u043C \u0434\u043B\u044F \u0435\u0436\u0435\u0434\u043D\u0435\u0432\u043D\u043E\u0439 \u0440\u0430\u0431\u043E\u0442\u044B." }), (0, jsx_runtime_1.jsx)(DialogContentText_1.DialogContentText, { children: "\u041F\u043E\u043F\u0440\u043E\u0431\u0443\u0439\u0442\u0435 \u043D\u043E\u0432\u0443\u044E \u0432\u0435\u0440\u0441\u0438\u044E \u0438 \u043F\u043E\u0434\u0435\u043B\u0438\u0442\u0435\u0441\u044C \u0441\u0432\u043E\u0438\u043C \u043C\u043D\u0435\u043D\u0438\u0435\u043C \u2014 \u044D\u0442\u043E \u043F\u043E\u043C\u043E\u0436\u0435\u0442 \u043D\u0430\u043C \u0441\u043E\u0432\u0435\u0440\u0448\u0435\u043D\u0441\u0442\u0432\u043E\u0432\u0430\u0442\u044C \u043F\u0440\u043E\u0434\u0443\u043A\u0442." })] })] }), (0, jsx_runtime_1.jsx)(DialogActions_1.DialogActions, { children: (0, jsx_runtime_1.jsx)(Button_1.Button, { onClick: handleClose, children: "\u041E\u0442\u043B\u0438\u0447\u043D\u043E" }) })] }));
19
+ };
20
+ exports.RedesignBannerDialog = RedesignBannerDialog;
@@ -0,0 +1,2 @@
1
+ import { RedesignBannerDialog } from './RedesignBannerDialog';
2
+ export default RedesignBannerDialog;
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const RedesignBannerDialog_1 = require("./RedesignBannerDialog");
4
+ exports.default = RedesignBannerDialog_1.RedesignBannerDialog;
@@ -0,0 +1,12 @@
1
+ /// <reference types="react" />
2
+ export declare const StyledDialogContent: import("@emotion/styled").StyledComponent<import("../../DialogContent").DialogContentProps & {
3
+ theme?: import("@emotion/react").Theme | undefined;
4
+ }, {}, {}>;
5
+ export declare const Picture: import("@emotion/styled").StyledComponent<{
6
+ theme?: import("@emotion/react").Theme | undefined;
7
+ as?: import("react").ElementType<any> | undefined;
8
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, {}>;
9
+ export declare const Description: import("@emotion/styled").StyledComponent<{
10
+ theme?: import("@emotion/react").Theme | undefined;
11
+ as?: import("react").ElementType<any> | undefined;
12
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Description = exports.Picture = exports.StyledDialogContent = void 0;
4
+ const DialogContent_1 = require("../../DialogContent");
5
+ const styles_1 = require("../../styles");
6
+ exports.StyledDialogContent = (0, styles_1.styled)(DialogContent_1.DialogContent) `
7
+ display: flex;
8
+ flex-direction: column;
9
+ gap: ${({ theme }) => theme.spacing(4)};
10
+ align-items: center;
11
+
12
+ max-width: 556px;
13
+ `;
14
+ exports.Picture = styles_1.styled.picture `
15
+ overflow: hidden;
16
+
17
+ border: 1px solid ${({ theme }) => theme.palette.grey[100]};
18
+ border-radius: ${({ theme }) => theme.shape.medium};
19
+
20
+ > img {
21
+ display: block;
22
+
23
+ width: 100%;
24
+ }
25
+ `;
26
+ exports.Description = styles_1.styled.span `
27
+ display: flex;
28
+ flex-direction: column;
29
+ gap: ${({ theme }) => theme.spacing(3)};
30
+ align-items: center;
31
+ `;
@@ -0,0 +1,5 @@
1
+ export declare const LOCAL_STORAGE_KEY = "astralui-redesign-banner";
2
+ export declare const DEFAULT_IMG_SRC: {
3
+ webp: string;
4
+ png: string;
5
+ };
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DEFAULT_IMG_SRC = exports.LOCAL_STORAGE_KEY = void 0;
4
+ exports.LOCAL_STORAGE_KEY = 'astralui-redesign-banner';
5
+ exports.DEFAULT_IMG_SRC = {
6
+ webp: 'https://frontend-static.astral.ru/images/UI-kit-v4.webp',
7
+ png: 'https://frontend-static.astral.ru/images/UI-kit-v4.png',
8
+ };
@@ -0,0 +1 @@
1
+ export * from './RedesignBanner';
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./RedesignBanner"), exports);
@@ -0,0 +1,6 @@
1
+ export type RedesignBannerProps = {
2
+ /**
3
+ * Кастомное изображение
4
+ */
5
+ imgSrc?: string;
6
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1 @@
1
+ export * from './useLogic';
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./useLogic"), exports);
@@ -0,0 +1,3 @@
1
+ export declare const useLogic: () => {
2
+ isSkipShow: string | boolean | null;
3
+ };
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useLogic = void 0;
4
+ const react_1 = require("react");
5
+ const hooks_1 = require("../../hooks");
6
+ const constants_1 = require("../constants");
7
+ const useLogic = () => {
8
+ const { isMobile } = (0, hooks_1.useViewportType)();
9
+ const isSkipShow = (0, react_1.useMemo)(() => {
10
+ if (isMobile) {
11
+ // Не показываем баннер нa mobile разрешениях
12
+ return true;
13
+ }
14
+ return localStorage.getItem(constants_1.LOCAL_STORAGE_KEY);
15
+ }, []);
16
+ return { isSkipShow };
17
+ };
18
+ exports.useLogic = useLogic;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@astral/ui",
3
- "version": "4.0.0-alpha.40",
3
+ "version": "4.0.0-alpha.41",
4
4
  "browser": "./index.js",
5
5
  "main": "./node/index.js",
6
6
  "dependencies": {
@@ -108,6 +108,13 @@
108
108
  "types": "./components/InfiniteTreeList/index.d.ts",
109
109
  "default": "./components/InfiniteTreeList/index.js",
110
110
  "import": "./components/InfiniteTreeList/index.js"
111
+ },
112
+ "./components/RedesignBanner": {
113
+ "module": "./components/RedesignBanner/index.js",
114
+ "require": "./node/components/RedesignBanner/index.js",
115
+ "types": "./components/RedesignBanner/index.d.ts",
116
+ "default": "./components/RedesignBanner/index.js",
117
+ "import": "./components/RedesignBanner/index.js"
111
118
  }
112
119
  },
113
120
  "author": "Astral.Soft",