@cloud-ru/uikit-product-mobile-modal 0.9.18 → 0.9.20
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/CHANGELOG.md +22 -0
- package/dist/cjs/components/AdaptiveDrawer/AdaptiveDrawer.d.ts +10 -0
- package/dist/cjs/components/AdaptiveDrawer/AdaptiveDrawer.js +34 -0
- package/dist/cjs/components/AdaptiveDrawer/index.d.ts +1 -0
- package/dist/cjs/components/AdaptiveDrawer/index.js +17 -0
- package/dist/cjs/components/AdaptiveModal/AdaptiveModal.d.ts +10 -0
- package/dist/cjs/components/AdaptiveModal/AdaptiveModal.js +31 -0
- package/dist/cjs/components/AdaptiveModal/index.d.ts +1 -0
- package/dist/cjs/components/AdaptiveModal/index.js +17 -0
- package/dist/cjs/components/MobileModal/MobileModal.d.ts +46 -0
- package/dist/cjs/components/MobileModal/MobileModal.js +47 -0
- package/dist/cjs/components/MobileModal/index.d.ts +1 -0
- package/dist/cjs/components/MobileModal/index.js +17 -0
- package/dist/cjs/components/MobileModal/styles.module.css +21 -0
- package/dist/cjs/components/MobileModalCustom/MobileModalCustom.d.ts +28 -0
- package/dist/cjs/components/MobileModalCustom/MobileModalCustom.js +27 -0
- package/dist/cjs/components/MobileModalCustom/index.d.ts +1 -0
- package/dist/cjs/components/MobileModalCustom/index.js +17 -0
- package/dist/cjs/components/index.d.ts +4 -0
- package/dist/cjs/components/index.js +20 -0
- package/dist/cjs/constants.d.ts +37 -0
- package/dist/cjs/constants.js +40 -0
- package/dist/cjs/helperComponents/Body/Body.d.ts +11 -0
- package/dist/cjs/helperComponents/Body/Body.js +27 -0
- package/dist/cjs/helperComponents/Body/index.d.ts +1 -0
- package/dist/cjs/helperComponents/Body/index.js +17 -0
- package/dist/cjs/helperComponents/Body/styles.module.css +16 -0
- package/dist/cjs/helperComponents/Footer/Footer.d.ts +13 -0
- package/dist/cjs/helperComponents/Footer/Footer.js +26 -0
- package/dist/cjs/helperComponents/Footer/index.d.ts +1 -0
- package/dist/cjs/helperComponents/Footer/index.js +17 -0
- package/dist/cjs/helperComponents/Footer/styles.module.css +37 -0
- package/dist/cjs/helperComponents/Header/Header.d.ts +16 -0
- package/dist/cjs/helperComponents/Header/Header.js +28 -0
- package/dist/cjs/helperComponents/Header/index.d.ts +2 -0
- package/dist/cjs/helperComponents/Header/index.js +18 -0
- package/dist/cjs/helperComponents/Header/styles.module.css +56 -0
- package/dist/cjs/helperComponents/Header/types.d.ts +4 -0
- package/dist/cjs/helperComponents/Header/types.js +2 -0
- package/dist/cjs/helperComponents/index.d.ts +3 -0
- package/dist/cjs/helperComponents/index.js +19 -0
- package/dist/cjs/index.d.ts +1 -0
- package/dist/cjs/index.js +17 -0
- package/dist/cjs/types.d.ts +6 -0
- package/dist/cjs/types.js +2 -0
- package/dist/cjs/utils.d.ts +17 -0
- package/dist/cjs/utils.js +28 -0
- package/dist/esm/components/AdaptiveDrawer/AdaptiveDrawer.d.ts +10 -0
- package/dist/esm/components/AdaptiveDrawer/AdaptiveDrawer.js +30 -0
- package/dist/esm/components/AdaptiveDrawer/index.d.ts +1 -0
- package/dist/esm/components/AdaptiveDrawer/index.js +1 -0
- package/dist/esm/components/AdaptiveModal/AdaptiveModal.d.ts +10 -0
- package/dist/esm/components/AdaptiveModal/AdaptiveModal.js +27 -0
- package/dist/esm/components/AdaptiveModal/index.d.ts +1 -0
- package/dist/esm/components/AdaptiveModal/index.js +1 -0
- package/dist/esm/components/MobileModal/MobileModal.d.ts +46 -0
- package/dist/esm/components/MobileModal/MobileModal.js +41 -0
- package/dist/esm/components/MobileModal/index.d.ts +1 -0
- package/dist/esm/components/MobileModal/index.js +1 -0
- package/dist/esm/components/MobileModal/styles.module.css +21 -0
- package/dist/esm/components/MobileModalCustom/MobileModalCustom.d.ts +28 -0
- package/dist/esm/components/MobileModalCustom/MobileModalCustom.js +24 -0
- package/dist/esm/components/MobileModalCustom/index.d.ts +1 -0
- package/dist/esm/components/MobileModalCustom/index.js +1 -0
- package/dist/esm/components/index.d.ts +4 -0
- package/dist/esm/components/index.js +4 -0
- package/dist/esm/constants.d.ts +37 -0
- package/dist/esm/constants.js +37 -0
- package/dist/esm/helperComponents/Body/Body.d.ts +11 -0
- package/dist/esm/helperComponents/Body/Body.js +21 -0
- package/dist/esm/helperComponents/Body/index.d.ts +1 -0
- package/dist/esm/helperComponents/Body/index.js +1 -0
- package/dist/esm/helperComponents/Body/styles.module.css +16 -0
- package/dist/esm/helperComponents/Footer/Footer.d.ts +13 -0
- package/dist/esm/helperComponents/Footer/Footer.js +20 -0
- package/dist/esm/helperComponents/Footer/index.d.ts +1 -0
- package/dist/esm/helperComponents/Footer/index.js +1 -0
- package/dist/esm/helperComponents/Footer/styles.module.css +37 -0
- package/dist/esm/helperComponents/Header/Header.d.ts +16 -0
- package/dist/esm/helperComponents/Header/Header.js +22 -0
- package/dist/esm/helperComponents/Header/index.d.ts +2 -0
- package/dist/esm/helperComponents/Header/index.js +2 -0
- package/dist/esm/helperComponents/Header/styles.module.css +56 -0
- package/dist/esm/helperComponents/Header/types.d.ts +4 -0
- package/dist/esm/helperComponents/Header/types.js +1 -0
- package/dist/esm/helperComponents/index.d.ts +3 -0
- package/dist/esm/helperComponents/index.js +3 -0
- package/dist/esm/index.d.ts +1 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/types.d.ts +6 -0
- package/dist/esm/types.js +1 -0
- package/dist/esm/utils.d.ts +17 -0
- package/dist/esm/utils.js +24 -0
- package/package.json +6 -5
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,28 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## 0.9.20 (2025-11-13)
|
|
7
|
+
|
|
8
|
+
### Only dependencies have been changed
|
|
9
|
+
* [@cloud-ru/uikit-product-mobile-drawer@0.9.17](https://gitverse.ru/cloud-ru-tech/uikit-product/-/blob/master/packages/mobile-drawer/CHANGELOG.md)
|
|
10
|
+
* [@cloud-ru/uikit-product-mobile-tooltip@0.4.67](https://gitverse.ru/cloud-ru-tech/uikit-product/-/blob/master/packages/mobile-tooltip/CHANGELOG.md)
|
|
11
|
+
* [@cloud-ru/uikit-product-utils@7.0.2](https://gitverse.ru/cloud-ru-tech/uikit-product/-/blob/master/packages/utils/CHANGELOG.md)
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
## 0.9.19 (2025-11-12)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Bug Fixes
|
|
21
|
+
|
|
22
|
+
* **PD-3377:** contributors update to publish all packages ([719fd3e](https://gitverse.ru/cloud-ru-tech/uikit-product/commits/719fd3e1249e247443b125c47ea408d92c8395c3))
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
6
28
|
## 0.9.18 (2025-11-12)
|
|
7
29
|
|
|
8
30
|
### Only dependencies have been changed
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { WithLayoutType } from '@sbercloud/uikit-product-utils';
|
|
2
|
+
import { DrawerCustom, DrawerProps } from '@snack-uikit/drawer';
|
|
3
|
+
import { MobileModalProps } from '../MobileModal';
|
|
4
|
+
import { MobileModalCustom } from '../MobileModalCustom';
|
|
5
|
+
export type AdaptiveDrawerProps = WithLayoutType<Omit<DrawerProps, 'size'> & {
|
|
6
|
+
size?: DrawerProps['size'] | MobileModalProps['size'];
|
|
7
|
+
}>;
|
|
8
|
+
export declare function AdaptiveDrawer({ layoutType, size, ...props }: AdaptiveDrawerProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export declare function useAdaptiveDrawerCustom({ layoutType }: WithLayoutType): typeof MobileModalCustom | typeof DrawerCustom;
|
|
10
|
+
export type { DrawerProps };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.AdaptiveDrawer = AdaptiveDrawer;
|
|
15
|
+
exports.useAdaptiveDrawerCustom = useAdaptiveDrawerCustom;
|
|
16
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
17
|
+
const drawer_1 = require("@snack-uikit/drawer");
|
|
18
|
+
const constants_1 = require("../../constants");
|
|
19
|
+
const MobileModal_1 = require("../MobileModal");
|
|
20
|
+
const MobileModalCustom_1 = require("../MobileModalCustom");
|
|
21
|
+
function AdaptiveDrawer(_a) {
|
|
22
|
+
var { layoutType, size } = _a, props = __rest(_a, ["layoutType", "size"]);
|
|
23
|
+
const isMobile = layoutType === 'mobile';
|
|
24
|
+
const mobileSize = size && Object.values(constants_1.SIZE).includes(size) ? size : undefined;
|
|
25
|
+
const desktopProps = Object.assign(Object.assign({}, props), { size: size && ['s', 'm', 'l'].includes(size) ? size : undefined });
|
|
26
|
+
return isMobile ? (
|
|
27
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
28
|
+
// @ts-ignore
|
|
29
|
+
(0, jsx_runtime_1.jsx)(MobileModal_1.MobileModal, Object.assign({ size: mobileSize }, props))) : ((0, jsx_runtime_1.jsx)(drawer_1.Drawer, Object.assign({}, desktopProps)));
|
|
30
|
+
}
|
|
31
|
+
function useAdaptiveDrawerCustom({ layoutType }) {
|
|
32
|
+
const isMobile = layoutType === 'mobile';
|
|
33
|
+
return isMobile ? MobileModalCustom_1.MobileModalCustom : drawer_1.DrawerCustom;
|
|
34
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './AdaptiveDrawer';
|
|
@@ -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("./AdaptiveDrawer"), exports);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { WithLayoutType } from '@sbercloud/uikit-product-utils';
|
|
2
|
+
import { ModalCustom, ModalProps } from '@snack-uikit/modal';
|
|
3
|
+
import { MobileModalProps } from '../MobileModal';
|
|
4
|
+
import { MobileModalCustom } from '../MobileModalCustom';
|
|
5
|
+
export type AdaptiveModalProps = WithLayoutType<Omit<ModalProps, 'size'> & {
|
|
6
|
+
size?: ModalProps['size'] | MobileModalProps['size'];
|
|
7
|
+
}>;
|
|
8
|
+
export declare function AdaptiveModal({ layoutType, size, ...props }: AdaptiveModalProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export declare function useAdaptiveModalCustom({ layoutType }: WithLayoutType): typeof MobileModalCustom | typeof ModalCustom;
|
|
10
|
+
export type { ModalProps };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.AdaptiveModal = AdaptiveModal;
|
|
15
|
+
exports.useAdaptiveModalCustom = useAdaptiveModalCustom;
|
|
16
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
17
|
+
const modal_1 = require("@snack-uikit/modal");
|
|
18
|
+
const constants_1 = require("../../constants");
|
|
19
|
+
const MobileModal_1 = require("../MobileModal");
|
|
20
|
+
const MobileModalCustom_1 = require("../MobileModalCustom");
|
|
21
|
+
function AdaptiveModal(_a) {
|
|
22
|
+
var { layoutType, size } = _a, props = __rest(_a, ["layoutType", "size"]);
|
|
23
|
+
const isMobile = layoutType === 'mobile';
|
|
24
|
+
const mobileSize = size && Object.values(constants_1.SIZE).includes(size) ? size : undefined;
|
|
25
|
+
const desktopProps = Object.assign(Object.assign({}, props), { size: size && ['s', 'm', 'l'].includes(size) ? size : undefined });
|
|
26
|
+
return isMobile ? (0, jsx_runtime_1.jsx)(MobileModal_1.MobileModal, Object.assign({ size: mobileSize }, props)) : (0, jsx_runtime_1.jsx)(modal_1.Modal, Object.assign({}, desktopProps));
|
|
27
|
+
}
|
|
28
|
+
function useAdaptiveModalCustom({ layoutType }) {
|
|
29
|
+
const isMobile = layoutType === 'mobile';
|
|
30
|
+
return isMobile ? MobileModalCustom_1.MobileModalCustom : modal_1.ModalCustom;
|
|
31
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './AdaptiveModal';
|
|
@@ -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("./AdaptiveModal"), exports);
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { ButtonFilledProps, ButtonOutlineProps, ButtonSimpleProps } from '@snack-uikit/button';
|
|
3
|
+
import { LinkProps } from '@snack-uikit/link';
|
|
4
|
+
import { Align } from '../../types';
|
|
5
|
+
import { MobileModalCustom, MobileModalCustomProps } from '../MobileModalCustom';
|
|
6
|
+
export type MobileModalProps = Omit<MobileModalCustomProps, 'children'> & {
|
|
7
|
+
/** Заголовок модального окна */
|
|
8
|
+
title: string;
|
|
9
|
+
/** Всплывающая подсказка для заголовка */
|
|
10
|
+
titleTooltip?: MobileModalCustom.HeaderProps['titleTooltip'];
|
|
11
|
+
/** Подзаголовок */
|
|
12
|
+
subtitle?: string;
|
|
13
|
+
/** Содержимое модального окна */
|
|
14
|
+
content?: MobileModalCustom.BodyProps['content'];
|
|
15
|
+
/** Основная кнопка действия */
|
|
16
|
+
approveButton: Omit<ButtonFilledProps, 'size' | 'data-test-id'>;
|
|
17
|
+
/** Кнопка отмены */
|
|
18
|
+
cancelButton?: Omit<ButtonOutlineProps, 'size' | 'data-test-id'>;
|
|
19
|
+
/** Вторая кнопка действия */
|
|
20
|
+
additionalButton?: Omit<ButtonSimpleProps, 'size' | 'data-test-id'>;
|
|
21
|
+
/** Небольшой текст под кнопками футера с возможностью передать дополнительно ссылку */
|
|
22
|
+
disclaimer?: {
|
|
23
|
+
text: string;
|
|
24
|
+
link?: Pick<LinkProps, 'text' | 'href' | 'target'>;
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Выравнивание, для разных размеров доступны разные значения
|
|
28
|
+
* <br> для size=`s` - все
|
|
29
|
+
*/
|
|
30
|
+
align?: Align;
|
|
31
|
+
/**
|
|
32
|
+
* Максимальное кол-во строк
|
|
33
|
+
* <br> - `title` - в заголовке
|
|
34
|
+
* <br> - `subtitle` - в подзаголовке
|
|
35
|
+
* @default '{ <br>title: 1; <br>subtitle: 2; }'
|
|
36
|
+
*/
|
|
37
|
+
truncate?: {
|
|
38
|
+
title?: number;
|
|
39
|
+
subtitle?: number;
|
|
40
|
+
};
|
|
41
|
+
/** Управление состоянием загрузки */
|
|
42
|
+
loading?: boolean;
|
|
43
|
+
/** Содержимое состояния загрузки вместо спиннера по умолчанию */
|
|
44
|
+
loadingState?: ReactNode;
|
|
45
|
+
};
|
|
46
|
+
export declare function MobileModal({ title, titleTooltip, subtitle, content, approveButton, cancelButton, additionalButton, disclaimer, align, loading, loadingState, ...rest }: MobileModalProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.MobileModal = MobileModal;
|
|
18
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
19
|
+
const classnames_1 = __importDefault(require("classnames"));
|
|
20
|
+
const react_1 = require("react");
|
|
21
|
+
const button_1 = require("@snack-uikit/button");
|
|
22
|
+
const link_1 = require("@snack-uikit/link");
|
|
23
|
+
const loaders_1 = require("@snack-uikit/loaders");
|
|
24
|
+
const typography_1 = require("@snack-uikit/typography");
|
|
25
|
+
const constants_1 = require("../../constants");
|
|
26
|
+
const utils_1 = require("../../utils");
|
|
27
|
+
const MobileModalCustom_1 = require("../MobileModalCustom");
|
|
28
|
+
const styles_module_scss_1 = __importDefault(require('./styles.module.css'));
|
|
29
|
+
function MobileModal(_a) {
|
|
30
|
+
var { title, titleTooltip, subtitle, content, approveButton, cancelButton, additionalButton, disclaimer, align = constants_1.ALIGN.Default, loading, loadingState } = _a, rest = __rest(_a, ["title", "titleTooltip", "subtitle", "content", "approveButton", "cancelButton", "additionalButton", "disclaimer", "align", "loading", "loadingState"]);
|
|
31
|
+
const aligns = (0, utils_1.getAlignProps)({ align });
|
|
32
|
+
const buttonsSize = (0, utils_1.getButtonsSize)();
|
|
33
|
+
const showFooter = !loading && (Boolean(approveButton) || Boolean(cancelButton) || Boolean(additionalButton) || Boolean(disclaimer));
|
|
34
|
+
const body = (0, react_1.useMemo)(() => {
|
|
35
|
+
if (loading) {
|
|
36
|
+
if (loadingState) {
|
|
37
|
+
return (0, jsx_runtime_1.jsx)(MobileModalCustom_1.MobileModalCustom.Body, { content: loadingState, align: aligns.body });
|
|
38
|
+
}
|
|
39
|
+
return ((0, jsx_runtime_1.jsx)(MobileModalCustom_1.MobileModalCustom.Body, { content: (0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.loaderWrapper, children: (0, jsx_runtime_1.jsx)(loaders_1.Spinner, { size: 'm', "data-test-id": constants_1.TEST_IDS.loadingSpinner }) }), align: aligns.body }));
|
|
40
|
+
}
|
|
41
|
+
if (content) {
|
|
42
|
+
return (0, jsx_runtime_1.jsx)(MobileModalCustom_1.MobileModalCustom.Body, { className: styles_module_scss_1.default.modalBody, content: content, align: aligns.body });
|
|
43
|
+
}
|
|
44
|
+
return null;
|
|
45
|
+
}, [aligns.body, content, loading, loadingState]);
|
|
46
|
+
return ((0, jsx_runtime_1.jsxs)(MobileModalCustom_1.MobileModalCustom, Object.assign({}, rest, { children: [(0, jsx_runtime_1.jsx)(MobileModalCustom_1.MobileModalCustom.Header, { className: (0, classnames_1.default)({ [styles_module_scss_1.default.modalHeader]: !content }), title: title, titleTooltip: titleTooltip, subtitle: subtitle, align: aligns.header }), body, showFooter && ((0, jsx_runtime_1.jsx)(MobileModalCustom_1.MobileModalCustom.Footer, { actions: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [approveButton && ((0, jsx_runtime_1.jsx)(button_1.ButtonFilled, Object.assign({ appearance: 'primary' }, approveButton, { size: buttonsSize, className: (0, classnames_1.default)(styles_module_scss_1.default.footerButton, approveButton.className), "data-test-id": constants_1.TEST_IDS.approveButton }))), cancelButton && ((0, jsx_runtime_1.jsx)(button_1.ButtonOutline, Object.assign({ appearance: 'neutral' }, cancelButton, { size: buttonsSize, className: (0, classnames_1.default)(styles_module_scss_1.default.footerButton, cancelButton.className), "data-test-id": constants_1.TEST_IDS.cancelButton }))), additionalButton && ((0, jsx_runtime_1.jsx)(button_1.ButtonSimple, Object.assign({ appearance: 'neutral' }, additionalButton, { size: buttonsSize, className: (0, classnames_1.default)(styles_module_scss_1.default.footerButton, additionalButton.className), "data-test-id": constants_1.TEST_IDS.additionalButton })))] }), disclaimer: disclaimer && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(typography_1.Typography.SansBodyS, { "data-test-id": constants_1.TEST_IDS.disclaimerText, children: disclaimer.text }), disclaimer.link && (0, jsx_runtime_1.jsx)(link_1.Link, Object.assign({}, disclaimer.link, { size: 's', "data-test-id": constants_1.TEST_IDS.disclaimerLink }))] })), align: aligns.footer, className: styles_module_scss_1.default.modalFooter }))] })));
|
|
47
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './MobileModal';
|
|
@@ -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("./MobileModal"), exports);
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
.modalFooter[data-align=vertical] .footerButton{
|
|
2
|
+
width:100%;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.modalBody{
|
|
6
|
+
flex:0 1 auto;
|
|
7
|
+
height:-moz-min-content;
|
|
8
|
+
height:min-content;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.modalHeader{
|
|
12
|
+
margin-bottom:24px;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.loaderWrapper{
|
|
16
|
+
display:flex;
|
|
17
|
+
align-items:center;
|
|
18
|
+
justify-content:center;
|
|
19
|
+
padding-top:var(--space-modal-body-top-bottom, 4px);
|
|
20
|
+
padding-bottom:var(--space-modal-footer-bottom, 32px);
|
|
21
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { MobileDrawerCustomProps } from '@sbercloud/uikit-product-mobile-drawer';
|
|
2
|
+
import { WithSupportProps } from '@snack-uikit/utils';
|
|
3
|
+
import { ModalBody, ModalBodyProps, ModalFooter, ModalFooterProps, ModalHeader, ModalHeaderProps } from '../../helperComponents';
|
|
4
|
+
import { Mode, Size } from '../../types';
|
|
5
|
+
export type MobileModalCustomProps = Pick<MobileDrawerCustomProps, 'open' | 'onClose' | 'className' | 'children' | 'closeButtonEnabled' | 'closeOnPopstate'> & WithSupportProps<{
|
|
6
|
+
/**
|
|
7
|
+
* Режим отображения модального окна:
|
|
8
|
+
* <br> - __`Regular`__ - есть кнопка закрытия, клик на оверлей и нажатие кнопки `Esc` закрывают модалку
|
|
9
|
+
* <br> - __`Aggressive`__ - есть кнопка закрытия, но выключен клик на оверлей и не работает закрытие по клавише `Esc`
|
|
10
|
+
* <br> - __`Forced`__ - закрыть модальное окно можно только по нажатию на кнопку действия в нижней части
|
|
11
|
+
* @default Mode.Regular
|
|
12
|
+
*/
|
|
13
|
+
mode?: Mode;
|
|
14
|
+
/**
|
|
15
|
+
* Размер модального окна
|
|
16
|
+
* @default Size.Auto
|
|
17
|
+
*/
|
|
18
|
+
size?: Size;
|
|
19
|
+
}>;
|
|
20
|
+
export declare function MobileModalCustom({ size, mode, closeButtonEnabled, ...rest }: MobileModalCustomProps): import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
export declare namespace MobileModalCustom {
|
|
22
|
+
type HeaderProps = ModalHeaderProps;
|
|
23
|
+
type BodyProps = ModalBodyProps;
|
|
24
|
+
type FooterProps = ModalFooterProps;
|
|
25
|
+
const Header: typeof ModalHeader;
|
|
26
|
+
const Body: typeof ModalBody;
|
|
27
|
+
const Footer: typeof ModalFooter;
|
|
28
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.MobileModalCustom = MobileModalCustom;
|
|
15
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
16
|
+
const uikit_product_mobile_drawer_1 = require("@sbercloud/uikit-product-mobile-drawer");
|
|
17
|
+
const constants_1 = require("../../constants");
|
|
18
|
+
const helperComponents_1 = require("../../helperComponents");
|
|
19
|
+
function MobileModalCustom(_a) {
|
|
20
|
+
var { size = constants_1.SIZE.Auto, mode = constants_1.MODE.Regular, closeButtonEnabled = false } = _a, rest = __rest(_a, ["size", "mode", "closeButtonEnabled"]);
|
|
21
|
+
return ((0, jsx_runtime_1.jsx)(uikit_product_mobile_drawer_1.MobileDrawerCustom, Object.assign({}, rest, { modalMode: mode, size: size === constants_1.SIZE.Auto ? 'auto' : '100%', hasBorderRadius: true, position: 'bottom', swipeEnabled: true, closeButtonEnabled: closeButtonEnabled })));
|
|
22
|
+
}
|
|
23
|
+
(function (MobileModalCustom) {
|
|
24
|
+
MobileModalCustom.Header = helperComponents_1.ModalHeader;
|
|
25
|
+
MobileModalCustom.Body = helperComponents_1.ModalBody;
|
|
26
|
+
MobileModalCustom.Footer = helperComponents_1.ModalFooter;
|
|
27
|
+
})(MobileModalCustom || (exports.MobileModalCustom = MobileModalCustom = {}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './MobileModalCustom';
|
|
@@ -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("./MobileModalCustom"), exports);
|
|
@@ -0,0 +1,20 @@
|
|
|
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("./AdaptiveDrawer"), exports);
|
|
18
|
+
__exportStar(require("./AdaptiveModal"), exports);
|
|
19
|
+
__exportStar(require("./MobileModal"), exports);
|
|
20
|
+
__exportStar(require("./MobileModalCustom"), exports);
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export declare const SIZE: {
|
|
2
|
+
readonly Full: "full";
|
|
3
|
+
readonly Auto: "auto";
|
|
4
|
+
};
|
|
5
|
+
export declare const MODE: {
|
|
6
|
+
readonly Regular: "regular";
|
|
7
|
+
readonly Aggressive: "aggressive";
|
|
8
|
+
readonly Forced: "forced";
|
|
9
|
+
};
|
|
10
|
+
export declare const ALIGN: {
|
|
11
|
+
readonly Default: "default";
|
|
12
|
+
readonly Center: "center";
|
|
13
|
+
readonly Vertical: "vertical";
|
|
14
|
+
};
|
|
15
|
+
export declare const CONTENT_ALIGN: {
|
|
16
|
+
readonly Default: "default";
|
|
17
|
+
readonly Center: "center";
|
|
18
|
+
};
|
|
19
|
+
export declare const TEST_IDS: {
|
|
20
|
+
overlay: string;
|
|
21
|
+
closeButton: string;
|
|
22
|
+
header: string;
|
|
23
|
+
title: string;
|
|
24
|
+
subtitle: string;
|
|
25
|
+
tooltip: string;
|
|
26
|
+
icon: string;
|
|
27
|
+
image: string;
|
|
28
|
+
content: string;
|
|
29
|
+
footer: string;
|
|
30
|
+
approveButton: string;
|
|
31
|
+
cancelButton: string;
|
|
32
|
+
additionalButton: string;
|
|
33
|
+
disclaimer: string;
|
|
34
|
+
disclaimerText: string;
|
|
35
|
+
disclaimerLink: string;
|
|
36
|
+
loadingSpinner: string;
|
|
37
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TEST_IDS = exports.CONTENT_ALIGN = exports.ALIGN = exports.MODE = exports.SIZE = void 0;
|
|
4
|
+
exports.SIZE = {
|
|
5
|
+
Full: 'full',
|
|
6
|
+
Auto: 'auto',
|
|
7
|
+
};
|
|
8
|
+
exports.MODE = {
|
|
9
|
+
Regular: 'regular',
|
|
10
|
+
Aggressive: 'aggressive',
|
|
11
|
+
Forced: 'forced',
|
|
12
|
+
};
|
|
13
|
+
exports.ALIGN = {
|
|
14
|
+
Default: 'default',
|
|
15
|
+
Center: 'center',
|
|
16
|
+
Vertical: 'vertical',
|
|
17
|
+
};
|
|
18
|
+
exports.CONTENT_ALIGN = {
|
|
19
|
+
Default: 'default',
|
|
20
|
+
Center: 'center',
|
|
21
|
+
};
|
|
22
|
+
exports.TEST_IDS = {
|
|
23
|
+
overlay: 'modal__overlay',
|
|
24
|
+
closeButton: 'modal__close-button',
|
|
25
|
+
header: 'modal__header',
|
|
26
|
+
title: 'modal__title',
|
|
27
|
+
subtitle: 'modal__subtitle',
|
|
28
|
+
tooltip: 'modal__title-tooltip',
|
|
29
|
+
icon: 'modal__icon',
|
|
30
|
+
image: 'modal__image',
|
|
31
|
+
content: 'modal__body',
|
|
32
|
+
footer: 'modal__footer',
|
|
33
|
+
approveButton: 'modal__approve-button',
|
|
34
|
+
cancelButton: 'modal__cancel-button',
|
|
35
|
+
additionalButton: 'modal__additional-button',
|
|
36
|
+
disclaimer: 'modal__disclaimer',
|
|
37
|
+
disclaimerText: 'modal__disclaimer-text',
|
|
38
|
+
disclaimerLink: 'modal__disclaimer-link',
|
|
39
|
+
loadingSpinner: 'modal__loading-spinner',
|
|
40
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { WithSupportProps } from '@snack-uikit/utils';
|
|
3
|
+
import { ContentAlign } from '../../types';
|
|
4
|
+
export type ModalBodyProps = WithSupportProps<{
|
|
5
|
+
/** Содержимое модального окна */
|
|
6
|
+
content: ReactNode;
|
|
7
|
+
/** Выравнивание контента */
|
|
8
|
+
align?: ContentAlign;
|
|
9
|
+
className?: string;
|
|
10
|
+
}>;
|
|
11
|
+
export declare function ModalBody({ content, align, className, ...rest }: ModalBodyProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.ModalBody = ModalBody;
|
|
18
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
19
|
+
const classnames_1 = __importDefault(require("classnames"));
|
|
20
|
+
const uikit_product_mobile_drawer_1 = require("@sbercloud/uikit-product-mobile-drawer");
|
|
21
|
+
const utils_1 = require("@snack-uikit/utils");
|
|
22
|
+
const constants_1 = require("../../constants");
|
|
23
|
+
const styles_module_scss_1 = __importDefault(require('./styles.module.css'));
|
|
24
|
+
function ModalBody(_a) {
|
|
25
|
+
var { content, align = constants_1.CONTENT_ALIGN.Default, className } = _a, rest = __rest(_a, ["content", "align", "className"]);
|
|
26
|
+
return ((0, jsx_runtime_1.jsx)(uikit_product_mobile_drawer_1.MobileDrawerCustom.Body, Object.assign({ content: content, className: (0, classnames_1.default)(styles_module_scss_1.default.modalBody, className) }, (0, utils_1.extractSupportProps)(rest), { "data-align": align, "data-test-id": constants_1.TEST_IDS.content })));
|
|
27
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Body';
|
|
@@ -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("./Body"), exports);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
.modalBody{
|
|
2
|
+
font-family:var(--sans-body-m-font-family, SB Sans Interface);
|
|
3
|
+
font-weight:var(--sans-body-m-font-weight, Regular);
|
|
4
|
+
line-height:var(--sans-body-m-line-height, 20px);
|
|
5
|
+
font-size:var(--sans-body-m-font-size, 14px);
|
|
6
|
+
letter-spacing:var(--sans-body-m-letter-spacing, 0.1px);
|
|
7
|
+
paragraph-spacing:var(--sans-body-m-paragraph-spacing, 7.7px);
|
|
8
|
+
padding:var(--dimension-3m, 24px) var(--dimension-2m, 16px);
|
|
9
|
+
flex:1 1 auto;
|
|
10
|
+
box-sizing:border-box;
|
|
11
|
+
min-height:var(--dimension-2m, 16px);
|
|
12
|
+
color:var(--sys-neutral-text-main, #41424e);
|
|
13
|
+
}
|
|
14
|
+
.modalBody[data-align=center]{
|
|
15
|
+
text-align:center;
|
|
16
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { WithSupportProps } from '@snack-uikit/utils';
|
|
3
|
+
import { Align } from '../../types';
|
|
4
|
+
export type ModalFooterProps = WithSupportProps<{
|
|
5
|
+
/** Параметр для передачи кнопок */
|
|
6
|
+
actions: ReactNode;
|
|
7
|
+
/** Параметр для небольшого текста под кнопками */
|
|
8
|
+
disclaimer?: ReactNode;
|
|
9
|
+
/** Выравнивание контента */
|
|
10
|
+
align?: Align;
|
|
11
|
+
className?: string;
|
|
12
|
+
}>;
|
|
13
|
+
export declare function ModalFooter({ actions, disclaimer, align, className, ...rest }: ModalFooterProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.ModalFooter = ModalFooter;
|
|
18
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
19
|
+
const classnames_1 = __importDefault(require("classnames"));
|
|
20
|
+
const utils_1 = require("@snack-uikit/utils");
|
|
21
|
+
const constants_1 = require("../../constants");
|
|
22
|
+
const styles_module_scss_1 = __importDefault(require('./styles.module.css'));
|
|
23
|
+
function ModalFooter(_a) {
|
|
24
|
+
var { actions, disclaimer, align = constants_1.ALIGN.Default, className } = _a, rest = __rest(_a, ["actions", "disclaimer", "align", "className"]);
|
|
25
|
+
return ((0, jsx_runtime_1.jsxs)("div", Object.assign({ "data-align": align, className: (0, classnames_1.default)(styles_module_scss_1.default.footer, className) }, (0, utils_1.extractSupportProps)(rest), { "data-test-id": constants_1.TEST_IDS.footer, children: [(0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.footerActions, children: actions }), disclaimer && ((0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.footerDisclaimer, "data-test-id": constants_1.TEST_IDS.disclaimer, children: disclaimer }))] })));
|
|
26
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Footer';
|
|
@@ -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("./Footer"), exports);
|