@mailstep/design-system 0.3.4 → 0.4.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +9 -9
- package/ui/Blocks/LightBox/LightBox.js +2 -2
- package/ui/Blocks/Modal/Modal.js +7 -5
- package/ui/Blocks/Modal/index.d.ts +1 -0
- package/ui/Blocks/Modal/index.js +1 -0
- package/ui/Blocks/Modal/stories/Modal.stories.d.ts +6 -4
- package/ui/Blocks/Modal/stories/Modal.stories.js +25 -15
- package/ui/Blocks/Modal/styles.d.ts +4 -5
- package/ui/Blocks/Modal/styles.js +49 -24
- package/ui/Blocks/Modal/types.d.ts +6 -4
- package/ui/Blocks/Modal/types.js +6 -1
- package/ui/Blocks/Modal/utils.d.ts +1 -2
- package/ui/Blocks/Modal/utils.js +0 -4
- package/ui/Elements/Icon/icons/Cancel.d.ts +3 -0
- package/ui/Elements/Icon/icons/Cancel.js +13 -0
- package/ui/Elements/Icon/icons/Info.js +2 -2
- package/ui/Elements/Icon/icons/MakePhoto.js +2 -2
- package/ui/Elements/Icon/icons/Print.js +2 -2
- package/ui/Elements/Icon/icons/index.d.ts +1 -0
- package/ui/Elements/Icon/icons/index.js +1 -0
- package/ui/Elements/Icon/stories/BadgeIcon.stories.d.ts +1 -1
- package/ui/ThemeProvider/themes/default.js +1 -1
- package/ui/ThemeProvider/themes/mailwise.js +1 -1
- package/ui/index.es.js +4602 -4543
- package/ui/index.umd.js +290 -285
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mailstep/design-system",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0-beta.0",
|
|
4
4
|
"license": "ISC",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./ui/index.js",
|
|
@@ -28,13 +28,13 @@
|
|
|
28
28
|
"@fortawesome/pro-regular-svg-icons": "^6.0.0",
|
|
29
29
|
"@fortawesome/pro-solid-svg-icons": "^6.3.0",
|
|
30
30
|
"@fortawesome/react-fontawesome": "^0.2.0",
|
|
31
|
-
"@storybook/addon-controls": "7.
|
|
32
|
-
"@storybook/addon-essentials": "7.
|
|
33
|
-
"@storybook/addon-interactions": "7.
|
|
34
|
-
"@storybook/addon-links": "7.
|
|
35
|
-
"@storybook/blocks": "7.
|
|
36
|
-
"@storybook/react": "7.
|
|
37
|
-
"@storybook/react-webpack5": "7.
|
|
31
|
+
"@storybook/addon-controls": "7.6.8",
|
|
32
|
+
"@storybook/addon-essentials": "7.6.8",
|
|
33
|
+
"@storybook/addon-interactions": "7.6.8",
|
|
34
|
+
"@storybook/addon-links": "7.6.8",
|
|
35
|
+
"@storybook/blocks": "7.6.8",
|
|
36
|
+
"@storybook/react": "7.6.8",
|
|
37
|
+
"@storybook/react-webpack5": "7.6.8",
|
|
38
38
|
"@storybook/testing-library": "0.2.2",
|
|
39
39
|
"@svgr/rollup": "^8.0.1",
|
|
40
40
|
"@types/node": "^20.1.7",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"react-script": "^2.0.5",
|
|
58
58
|
"react-toastify": "^9.1.3",
|
|
59
59
|
"react-use-draggable-scroll": "^0.4.7",
|
|
60
|
-
"storybook": "7.
|
|
60
|
+
"storybook": "7.6.8",
|
|
61
61
|
"string-width": "6.1.0",
|
|
62
62
|
"styled-components": "^5.3.10",
|
|
63
63
|
"swiper": "^11.0.3",
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Button } from '../../Elements/Button';
|
|
3
|
-
import Modal from '../Modal';
|
|
3
|
+
import Modal, { Variant } from '../Modal';
|
|
4
4
|
import { Swiper, SwiperSlide } from 'swiper/react';
|
|
5
5
|
import { Container, Image, ButtonContainer } from './styles';
|
|
6
6
|
export var LightBox = function (_a) {
|
|
7
7
|
var isLightBoxOpen = _a.isLightBoxOpen, onCloseLightBox = _a.onCloseLightBox, lightBoxAction = _a.lightBoxAction, lightBoxActionTitle = _a.lightBoxActionTitle, images = _a.images, _b = _a.initialSlide, initialSlide = _b === void 0 ? 0 : _b;
|
|
8
8
|
if (!(images === null || images === void 0 ? void 0 : images.length))
|
|
9
9
|
return null;
|
|
10
|
-
return (_jsx(Modal, { isShown: isLightBoxOpen, onClose: onCloseLightBox,
|
|
10
|
+
return (_jsx(Modal, { isShown: isLightBoxOpen, onClose: onCloseLightBox, variant: Variant.MobileFullscreen, children: _jsx(Swiper, { initialSlide: initialSlide, slidesPerView: 1, autoHeight: true, children: images.map(function (item) {
|
|
11
11
|
var _a;
|
|
12
12
|
return (_jsx(SwiperSlide, { children: _jsxs(Container, { children: [_jsx(Image, { src: (_a = item.originalUrl) !== null && _a !== void 0 ? _a : item.url, loading: "lazy", alt: "" }), !!item.withLightBoxAction && lightBoxAction && lightBoxActionTitle && (_jsx(ButtonContainer, { children: _jsx(Button, { onClick: lightBoxAction(item.id), appearance: "primaryLight", children: lightBoxActionTitle }) }))] }) }, item.id));
|
|
13
13
|
}) }) }));
|
package/ui/Blocks/Modal/Modal.js
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { memo, useCallback, useMemo, useEffect } from 'react';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { Variant } from './types';
|
|
4
|
+
import { Icon, Cancel } from '../../Elements/Icon';
|
|
5
|
+
import { H2, H5 } from '../../Elements/Typography';
|
|
6
|
+
import { DialogOverlay, DialogWindow, HeaderContainer, ButtonsContainer, ContentContainer, TitleContainer, CloseButton, } from './styles';
|
|
5
7
|
import { x } from '@xstyled/styled-components';
|
|
6
8
|
import { Button } from '../../Elements/Button';
|
|
7
9
|
import { Portal } from '../../Elements/Portal';
|
|
8
10
|
import { useClickOutside } from './hooks/useClickOutside';
|
|
9
|
-
import {
|
|
11
|
+
import { widthMap } from './utils';
|
|
10
12
|
export var Modal = memo(function (_a) {
|
|
11
|
-
var children = _a.children, _b = _a.isShown, isShown = _b === void 0 ? true : _b, onCancel = _a.onCancel, title = _a.title, titleIcon = _a.titleIcon, onConfirm = _a.onConfirm, confirmLabel = _a.confirmLabel, cancelLabel = _a.cancelLabel, isLoading = _a.isLoading, isConfirmDisabled = _a.isConfirmDisabled, _c = _a.width, width = _c === void 0 ? 'narrow' : _c,
|
|
13
|
+
var children = _a.children, _b = _a.isShown, isShown = _b === void 0 ? true : _b, onCancel = _a.onCancel, title = _a.title, titleIcon = _a.titleIcon, onConfirm = _a.onConfirm, confirmLabel = _a.confirmLabel, cancelLabel = _a.cancelLabel, isLoading = _a.isLoading, isConfirmDisabled = _a.isConfirmDisabled, _c = _a.width, width = _c === void 0 ? 'narrow' : _c, onClose = _a.onClose, _d = _a.hasFooter, hasFooter = _d === void 0 ? true : _d, _e = _a.hasHeader, hasHeader = _e === void 0 ? true : _e, _f = _a.whiteBg, whiteBg = _f === void 0 ? false : _f, _g = _a.ignoreClickOutside, ignoreClickOutside = _g === void 0 ? false : _g, _h = _a.closeEverywhere, closeEverywhere = _h === void 0 ? false : _h, _j = _a.withCloseIcon, withCloseIcon = _j === void 0 ? true : _j, overlayColor = _a.overlayColor, minWidth = _a.minWidth, minHeight = _a.minHeight, maxWidth = _a.maxWidth, maxHeight = _a.maxHeight, _k = _a.variant, variant = _k === void 0 ? Variant.Compact : _k;
|
|
12
14
|
var closeDialog = useCallback(function () {
|
|
13
15
|
if (onClose) {
|
|
14
16
|
onClose();
|
|
@@ -31,5 +33,5 @@ export var Modal = memo(function (_a) {
|
|
|
31
33
|
if (!isShown) {
|
|
32
34
|
return null;
|
|
33
35
|
}
|
|
34
|
-
return (_jsx(Portal, { children: _jsx(DialogOverlay, { backgroundColor: overlayColor, children: _jsxs(DialogWindow, { ref: dialogRef, style: dialogStyle, "$whiteBg": whiteBg, "data-cy": "dialogWindow", onClick: closeEverywhere ? closeDialog : undefined, "$minWidth": minWidth, "$minHeight": minHeight, "$maxWidth": maxWidth, "$maxHeight": maxHeight,
|
|
36
|
+
return (_jsx(Portal, { children: _jsx(DialogOverlay, { backgroundColor: overlayColor, children: _jsxs(DialogWindow, { ref: dialogRef, style: dialogStyle, "$whiteBg": whiteBg, "data-cy": "dialogWindow", onClick: closeEverywhere ? closeDialog : undefined, "$minWidth": minWidth, "$minHeight": minHeight, "$maxWidth": maxWidth, "$maxHeight": maxHeight, variant: variant, children: [title && hasHeader && (_jsx(HeaderContainer, { variant: variant, children: _jsxs(TitleContainer, { children: [titleIcon && (_jsx(x.div, { as: "span", className: "icon", children: typeof titleIcon === 'string' ? _jsx(Icon, { icon: titleIcon, fill: "blue2" }) : titleIcon })), variant == Variant.Default ? (_jsx(H2, { mt: 0, mb: 0, children: title })) : (_jsx(H5, { mt: 0, mb: 0, children: title }))] }) })), hasHeader && !closeEverywhere && withCloseIcon && (_jsx(CloseButton, { onClick: closeDialog, "data-cy": "dialogCloseBtn", children: _jsx(Cancel, { width: "11px", height: "11px" }) })), _jsx(ContentContainer, { variant: variant, children: children }), hasFooter && (onCancel || onConfirm) && (_jsxs(ButtonsContainer, { children: [onCancel && (_jsx(Button, { type: "button", onClick: onCancel, isLoading: isLoading, "data-cy": "cancelBtn", appearance: "primaryLight", children: cancelLabel ? cancelLabel : 'Cancel' })), onConfirm && (_jsx(Button, { type: "button", onClick: onDialogConfirmClick, isLoading: isLoading, disabled: isConfirmDisabled, "data-cy": "submitBtn", children: confirmLabel ? confirmLabel : 'Submit' }))] }))] }) }) }));
|
|
35
37
|
});
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Modal } from './Modal';
|
|
2
2
|
export { useModal } from './hooks/useModal';
|
|
3
3
|
export { useClickOutside } from './hooks/useClickOutside';
|
|
4
|
+
export { Variant } from './types';
|
|
4
5
|
export type { ControlProps, ModalProps, ModalData } from './types';
|
|
5
6
|
export default Modal;
|
package/ui/Blocks/Modal/index.js
CHANGED
|
@@ -2,18 +2,20 @@
|
|
|
2
2
|
import { StoryObj } from '@storybook/react';
|
|
3
3
|
declare const meta: {
|
|
4
4
|
title: string;
|
|
5
|
-
component: import("react").FC<import("
|
|
5
|
+
component: import("react").FC<import("../types").ModalProps>;
|
|
6
6
|
tags: string[];
|
|
7
7
|
argTypes: {};
|
|
8
8
|
};
|
|
9
9
|
export default meta;
|
|
10
10
|
type Story = StoryObj<typeof meta>;
|
|
11
|
+
export declare const Default: Story;
|
|
12
|
+
export declare const Compact: Story;
|
|
13
|
+
export declare const MobileFullscreen: Story;
|
|
11
14
|
export declare const ModalWithCloseAndConfirmBtns: Story;
|
|
12
|
-
export declare const
|
|
13
|
-
export declare const
|
|
15
|
+
export declare const ModalWithoutCloseButton: Story;
|
|
16
|
+
export declare const ModalWithIconInTitle: Story;
|
|
14
17
|
export declare const ModalLoading: Story;
|
|
15
18
|
export declare const ModalWithWhiteBg: Story;
|
|
16
|
-
export declare const ModalWithoutCloseIcon: Story;
|
|
17
19
|
export declare const ModalWithoutHeader: Story;
|
|
18
20
|
export declare const ModalWithoutFooter: Story;
|
|
19
21
|
export declare const ModalWithoutHeaderAndFooter: Story;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import Modal, { Variant } from '../';
|
|
3
3
|
var meta = {
|
|
4
4
|
title: 'Blocks/Modal',
|
|
5
5
|
component: Modal,
|
|
@@ -7,26 +7,43 @@ var meta = {
|
|
|
7
7
|
argTypes: {},
|
|
8
8
|
};
|
|
9
9
|
export default meta;
|
|
10
|
+
export var Default = {
|
|
11
|
+
args: {
|
|
12
|
+
title: 'Modal default version',
|
|
13
|
+
children: _jsx(_Fragment, { children: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed condimentum id eros ac consequat." }),
|
|
14
|
+
},
|
|
15
|
+
};
|
|
16
|
+
export var Compact = {
|
|
17
|
+
args: {
|
|
18
|
+
title: 'Modal title',
|
|
19
|
+
children: _jsx(_Fragment, { children: "Modal compact version" }),
|
|
20
|
+
variant: Variant.Compact,
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
export var MobileFullscreen = {
|
|
24
|
+
args: {
|
|
25
|
+
children: _jsx(_Fragment, { children: "Mobile full screen version without title" }),
|
|
26
|
+
variant: Variant.MobileFullscreen,
|
|
27
|
+
},
|
|
28
|
+
};
|
|
10
29
|
export var ModalWithCloseAndConfirmBtns = {
|
|
11
30
|
args: {
|
|
12
|
-
children: _jsx(_Fragment, { children: "Modal
|
|
31
|
+
children: _jsx(_Fragment, { children: "Modal with narrow width" }),
|
|
13
32
|
title: 'Modal title',
|
|
14
33
|
width: 'narrow',
|
|
15
|
-
onClose: function () { return console.log('Close'); },
|
|
16
|
-
onConfirm: function () { return console.log('Submit'); },
|
|
17
34
|
},
|
|
18
35
|
};
|
|
19
|
-
export var
|
|
36
|
+
export var ModalWithoutCloseButton = {
|
|
20
37
|
args: {
|
|
38
|
+
title: 'Note',
|
|
21
39
|
children: (_jsx(_Fragment, { children: "Lorem ipsum dolor sit amet, consectetur adipisicing elit. Aspernatur explicabo harum, inventore natus qui repellendus suscipit vitae. Alias aliquam earum et ipsa labore, laboriosam maxime numquam odio recusandae, repellat, voluptas." })),
|
|
22
|
-
title: 'Poznamka',
|
|
23
40
|
width: 'narrow',
|
|
24
41
|
withCloseIcon: false,
|
|
25
42
|
onClose: function () { return console.log('Close'); },
|
|
26
43
|
onConfirm: undefined,
|
|
27
44
|
},
|
|
28
45
|
};
|
|
29
|
-
export var
|
|
46
|
+
export var ModalWithIconInTitle = {
|
|
30
47
|
args: {
|
|
31
48
|
children: _jsx(_Fragment, { children: "Modal with icon" }),
|
|
32
49
|
title: 'Modal title',
|
|
@@ -47,17 +64,10 @@ export var ModalWithWhiteBg = {
|
|
|
47
64
|
children: _jsx(_Fragment, { children: "Modal with white background" }),
|
|
48
65
|
title: 'Modal title',
|
|
49
66
|
width: 'narrow',
|
|
67
|
+
// @TODO fix this for SOLID requirements
|
|
50
68
|
whiteBg: true,
|
|
51
69
|
},
|
|
52
70
|
};
|
|
53
|
-
export var ModalWithoutCloseIcon = {
|
|
54
|
-
args: {
|
|
55
|
-
children: _jsx(_Fragment, { children: "Modal without close icon" }),
|
|
56
|
-
title: 'Modal title',
|
|
57
|
-
width: 'narrow',
|
|
58
|
-
withCloseIcon: false,
|
|
59
|
-
},
|
|
60
|
-
};
|
|
61
71
|
export var ModalWithoutHeader = {
|
|
62
72
|
args: {
|
|
63
73
|
children: _jsx(_Fragment, { children: "Modal without header" }),
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Variant } from './types';
|
|
1
2
|
export declare const DialogOverlay: import("styled-components").StyledComponent<"div", import("@xstyled/system").Theme, {
|
|
2
3
|
backgroundColor?: string | undefined;
|
|
3
4
|
}, never>;
|
|
@@ -7,16 +8,14 @@ export declare const DialogWindow: import("styled-components").StyledComponent<"
|
|
|
7
8
|
$minHeight?: string | undefined;
|
|
8
9
|
$maxWidth?: string | undefined;
|
|
9
10
|
$maxHeight?: string | undefined;
|
|
10
|
-
|
|
11
|
+
variant: Variant;
|
|
11
12
|
}, never>;
|
|
12
13
|
export declare const HeaderContainer: import("styled-components").StyledComponent<"div", import("@xstyled/system").Theme, {
|
|
13
|
-
|
|
14
|
+
variant: Variant;
|
|
14
15
|
}, never>;
|
|
15
16
|
export declare const ContentContainer: import("styled-components").StyledComponent<"div", import("@xstyled/system").Theme, {
|
|
16
|
-
|
|
17
|
-
$mobileFullscreen: boolean;
|
|
17
|
+
variant: Variant;
|
|
18
18
|
}, never>;
|
|
19
19
|
export declare const TitleContainer: import("styled-components").StyledComponent<"div", import("@xstyled/system").Theme, {}, never>;
|
|
20
|
-
export declare const H4: import("styled-components").StyledComponent<"h4", import("@xstyled/system").Theme, {}, never>;
|
|
21
20
|
export declare const ButtonsContainer: import("styled-components").StyledComponent<"div", import("@xstyled/system").Theme, {}, never>;
|
|
22
21
|
export declare const CloseButton: import("styled-components").StyledComponent<"div", import("@xstyled/system").Theme, {}, never>;
|
|
@@ -2,44 +2,69 @@ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cook
|
|
|
2
2
|
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
3
3
|
return cooked;
|
|
4
4
|
};
|
|
5
|
-
import styled, { th } from '@xstyled/styled-components';
|
|
5
|
+
import styled, { css, th } from '@xstyled/styled-components';
|
|
6
6
|
import { createRgba } from '../../utils';
|
|
7
|
-
|
|
7
|
+
import { Variant } from './types';
|
|
8
|
+
var Component;
|
|
9
|
+
(function (Component) {
|
|
10
|
+
Component["Header"] = "header";
|
|
11
|
+
Component["DialogWindow"] = "dialogWindow";
|
|
12
|
+
Component["ContentContainer"] = "contentContainer";
|
|
13
|
+
Component["Title"] = "title";
|
|
14
|
+
})(Component || (Component = {}));
|
|
15
|
+
var variantStyles = function (component, variant) {
|
|
16
|
+
if (variant === void 0) { variant = Variant.Default; }
|
|
17
|
+
return ({
|
|
18
|
+
header: {
|
|
19
|
+
default: css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n padding: 20px;\n border-bottom: 1px solid ", ";\n @media (min-width: 576px) {\n padding: 30px;\n border-bottom: 0;\n }\n "], ["\n padding: 20px;\n border-bottom: 1px solid ", ";\n @media (min-width: 576px) {\n padding: 30px;\n border-bottom: 0;\n }\n "])), th.color('lightGray6')),
|
|
20
|
+
compact: css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n padding: 20px 20px;\n border-bottom: 1px solid ", ";\n "], ["\n padding: 20px 20px;\n border-bottom: 1px solid ", ";\n "])), th.color('lightGray6')),
|
|
21
|
+
mobileFullscreen: css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n padding: 20px;\n "], ["\n padding: 20px;\n "]))),
|
|
22
|
+
},
|
|
23
|
+
dialogWindow: {
|
|
24
|
+
default: css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n border-radius: 10px;\n max-width: calc(100% - 32px);\n "], ["\n border-radius: 10px;\n max-width: calc(100% - 32px);\n "]))),
|
|
25
|
+
compact: css(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n border-radius: 10px;\n max-width: calc(100% - 32px);\n "], ["\n border-radius: 10px;\n max-width: calc(100% - 32px);\n "]))),
|
|
26
|
+
mobileFullscreen: css(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n border-radius: 0;\n max-width: 100% !important;\n "], ["\n border-radius: 0;\n max-width: 100% !important;\n "]))),
|
|
27
|
+
},
|
|
28
|
+
contentContainer: {
|
|
29
|
+
default: css(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n padding: 20px 20px 15px;\n @media (min-width: 576px) {\n padding: 30px;\n }\n "], ["\n padding: 20px 20px 15px;\n @media (min-width: 576px) {\n padding: 30px;\n }\n "]))),
|
|
30
|
+
compact: css(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n padding: 20px 20px 15px;\n "], ["\n padding: 20px 20px 15px;\n "]))),
|
|
31
|
+
mobileFullscreen: css(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n padding: 0;\n "], ["\n padding: 0;\n "]))),
|
|
32
|
+
},
|
|
33
|
+
title: {}
|
|
34
|
+
}[component][variant]);
|
|
35
|
+
};
|
|
36
|
+
export var DialogOverlay = styled.div(templateObject_10 || (templateObject_10 = __makeTemplateObject(["\n position: fixed;\n z-index: 5;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n overflow: auto;\n background-color: ", ";\n text-align: center;\n\n @media print {\n position: absolute !important;\n left: 0 !important;\n top: 0 !important;\n height: auto !important;\n visibility: hidden;\n }\n\n @media (max-width: 576px) {\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 16px 0;\n }\n"], ["\n position: fixed;\n z-index: 5;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n overflow: auto;\n background-color: ", ";\n text-align: center;\n\n @media print {\n position: absolute !important;\n left: 0 !important;\n top: 0 !important;\n height: auto !important;\n visibility: hidden;\n }\n\n @media (max-width: 576px) {\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 16px 0;\n }\n"])), function (_a) {
|
|
8
37
|
var _b = _a.backgroundColor, backgroundColor = _b === void 0 ? 'blue2' : _b;
|
|
9
38
|
return createRgba(backgroundColor, 0.6);
|
|
10
39
|
});
|
|
11
|
-
export var DialogWindow = styled.div(
|
|
40
|
+
export var DialogWindow = styled.div(templateObject_11 || (templateObject_11 = __makeTemplateObject(["\n background-color: ", ";\n margin: auto;\n box-shadow: dialogShadow;\n min-width: ", ";\n min-height: ", ";\n max-height: ", ";\n display: inline-block;\n position: relative;\n text-align: left;\n\n ", "\n ", ";\n\n @media print {\n background-color: #fff;\n margin: 0;\n visibility: visible;\n overflow: visible;\n box-shadow: none;\n max-width: 100%;\n }\n\n @media (min-width: 576px) {\n margin: 100px auto 0 auto;\n }\n"], ["\n background-color: ", ";\n margin: auto;\n box-shadow: dialogShadow;\n min-width: ", ";\n min-height: ", ";\n max-height: ", ";\n display: inline-block;\n position: relative;\n text-align: left;\n\n ", "\n ", ";\n\n @media print {\n background-color: #fff;\n margin: 0;\n visibility: visible;\n overflow: visible;\n box-shadow: none;\n max-width: 100%;\n }\n\n @media (min-width: 576px) {\n margin: 100px auto 0 auto;\n }\n"])), function (_a) {
|
|
12
41
|
var $whiteBg = _a.$whiteBg;
|
|
13
42
|
return ($whiteBg ? th.color('white') : '#fefefe');
|
|
14
43
|
}, function (_a) {
|
|
15
44
|
var $minWidth = _a.$minWidth;
|
|
16
45
|
return $minWidth || '10%';
|
|
17
|
-
}, function (_a) {
|
|
18
|
-
var $maxWidth = _a.$maxWidth;
|
|
19
|
-
return $maxWidth || 'calc(100% - 32px)';
|
|
20
46
|
}, function (_a) {
|
|
21
47
|
var $minHeight = _a.$minHeight;
|
|
22
48
|
return $minHeight || 'auto';
|
|
23
49
|
}, function (_a) {
|
|
24
50
|
var $maxHeight = _a.$maxHeight;
|
|
25
|
-
return $maxHeight || '
|
|
51
|
+
return $maxHeight || 'none';
|
|
26
52
|
}, function (_a) {
|
|
27
|
-
var
|
|
28
|
-
return
|
|
29
|
-
});
|
|
30
|
-
export var HeaderContainer = styled.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n display: flex;\n justify-content: space-between;\n padding: 30px;\n padding-bottom: ", ";\n\n @media (max-width: 576px) {\n padding: 18px;\n border-bottom: 1px solid ", ";\n }\n"], ["\n display: flex;\n justify-content: space-between;\n padding: 30px;\n padding-bottom: ", ";\n\n @media (max-width: 576px) {\n padding: 18px;\n border-bottom: 1px solid ", ";\n }\n"])), function (_a) {
|
|
31
|
-
var topSpace = _a.topSpace;
|
|
32
|
-
return topSpace;
|
|
33
|
-
}, th.color('lightGray6'));
|
|
34
|
-
export var ContentContainer = styled.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n padding: 30px;\n padding-top: ", ";\n\n @media (max-width: 576px) {\n padding: ", ";\n font-size: 16px;\n line-height: 1.4;\n }\n"], ["\n padding: 30px;\n padding-top: ", ";\n\n @media (max-width: 576px) {\n padding: ", ";\n font-size: 16px;\n line-height: 1.4;\n }\n"])), function (_a) {
|
|
35
|
-
var topSpace = _a.topSpace;
|
|
36
|
-
return topSpace;
|
|
53
|
+
var variant = _a.variant;
|
|
54
|
+
return variantStyles(Component.DialogWindow, variant);
|
|
37
55
|
}, function (_a) {
|
|
38
|
-
var $
|
|
39
|
-
return
|
|
56
|
+
var $maxWidth = _a.$maxWidth;
|
|
57
|
+
return $maxWidth && "max-width: ".concat($maxWidth);
|
|
58
|
+
});
|
|
59
|
+
export var HeaderContainer = styled.div(templateObject_12 || (templateObject_12 = __makeTemplateObject(["\n display: flex;\n justify-content: space-between;\n ", "\n"], ["\n display: flex;\n justify-content: space-between;\n ", "\n"])), function (_a) {
|
|
60
|
+
var variant = _a.variant;
|
|
61
|
+
return variantStyles(Component.Header, variant);
|
|
62
|
+
});
|
|
63
|
+
export var ContentContainer = styled.div(templateObject_13 || (templateObject_13 = __makeTemplateObject(["\n min-height: 50px;\n ", "\n"], ["\n min-height: 50px;\n ", "\n"])), function (_a) {
|
|
64
|
+
var variant = _a.variant;
|
|
65
|
+
return variantStyles(Component.ContentContainer, variant);
|
|
40
66
|
});
|
|
41
|
-
export var TitleContainer = styled.div(
|
|
42
|
-
export var
|
|
43
|
-
export var
|
|
44
|
-
|
|
45
|
-
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8;
|
|
67
|
+
export var TitleContainer = styled.div(templateObject_14 || (templateObject_14 = __makeTemplateObject(["\n display: flex;\n flex-flow: row;\n align-items: center;\n color: typoPrimary;\n padding-right: 34px;\n \n > div:first-of-type {\n margin-right: 0.5em;\n display: block;\n }\n\n .icon {\n font-size: 24px;\n margin-right: 15px;\n display: flex;\n\n @media (max-width: 576px) {\n font-size: 18px;\n margin-right: 12px;\n }\n }\n"], ["\n display: flex;\n flex-flow: row;\n align-items: center;\n color: typoPrimary;\n padding-right: 34px;\n \n > div:first-of-type {\n margin-right: 0.5em;\n display: block;\n }\n\n .icon {\n font-size: 24px;\n margin-right: 15px;\n display: flex;\n\n @media (max-width: 576px) {\n font-size: 18px;\n margin-right: 12px;\n }\n }\n"])));
|
|
68
|
+
export var ButtonsContainer = styled.div(templateObject_15 || (templateObject_15 = __makeTemplateObject(["\n padding: 1.5rem;\n text-align: right;\n > * {\n margin: 0 0.5em;\n }\n\n @media (max-width: 576px) {\n display: flex;\n justify-content: space-around;\n padding: 32px 18px 18px;\n\n > * {\n margin: 0;\n }\n }\n"], ["\n padding: 1.5rem;\n text-align: right;\n > * {\n margin: 0 0.5em;\n }\n\n @media (max-width: 576px) {\n display: flex;\n justify-content: space-around;\n padding: 32px 18px 18px;\n\n > * {\n margin: 0;\n }\n }\n"])));
|
|
69
|
+
export var CloseButton = styled.div(templateObject_16 || (templateObject_16 = __makeTemplateObject(["\n position: absolute;\n background-color: bgLightGray1;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 50%;\n z-index: 1;\n top: 11px;\n right: 20px;\n width: 34px;\n height: 34px;\n"], ["\n position: absolute;\n background-color: bgLightGray1;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 50%;\n z-index: 1;\n top: 11px;\n right: 20px;\n width: 34px;\n height: 34px;\n"])));
|
|
70
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10, templateObject_11, templateObject_12, templateObject_13, templateObject_14, templateObject_15, templateObject_16;
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { MutableRefObject } from 'react';
|
|
2
|
-
export
|
|
2
|
+
export declare enum Variant {
|
|
3
|
+
Default = "default",
|
|
4
|
+
Compact = "compact",
|
|
5
|
+
MobileFullscreen = "mobileFullscreen"
|
|
6
|
+
}
|
|
3
7
|
export type Width = 'wide' | 'mediumLarge' | 'medium' | 'narrow' | 'auto';
|
|
4
8
|
export interface ModalProps {
|
|
5
9
|
isShown?: boolean;
|
|
@@ -17,7 +21,6 @@ export interface ModalProps {
|
|
|
17
21
|
hasHeader?: boolean;
|
|
18
22
|
width?: Width;
|
|
19
23
|
whiteBg?: boolean;
|
|
20
|
-
miniCloseBtn?: boolean;
|
|
21
24
|
ignoreClickOutside?: boolean;
|
|
22
25
|
closeEverywhere?: boolean;
|
|
23
26
|
withCloseIcon?: boolean;
|
|
@@ -26,8 +29,7 @@ export interface ModalProps {
|
|
|
26
29
|
minHeight?: string;
|
|
27
30
|
maxWidth?: string;
|
|
28
31
|
maxHeight?: string;
|
|
29
|
-
|
|
30
|
-
mobileFullscreen?: boolean;
|
|
32
|
+
variant?: Variant;
|
|
31
33
|
}
|
|
32
34
|
export type ModalData = Record<string, any>;
|
|
33
35
|
export type ControlProps<T = ModalData> = {
|
package/ui/Blocks/Modal/types.js
CHANGED
package/ui/Blocks/Modal/utils.js
CHANGED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
export var Cancel = function (props) { return (_jsx("svg", __assign({ width: "11", height: "11", viewBox: "0 0 11 11", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, props, { children: _jsx("path", { id: "cancel", "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M1.61873 0.375917C1.26726 0.0244455 0.697412 0.0244455 0.34594 0.375917C-0.00553197 0.727389 -0.00553197 1.29724 0.34594 1.64871L4.21225 5.51502L0.34594 9.38133C-0.00553159 9.7328 -0.00553156 10.3026 0.34594 10.6541C0.697412 11.0056 1.26726 11.0056 1.61873 10.6541L5.48504 6.78781L9.35135 10.6541C9.70282 11.0056 10.2727 11.0056 10.6241 10.6541C10.9756 10.3026 10.9756 9.7328 10.6241 9.38133L6.75783 5.51502L10.6241 1.64871C10.9756 1.29724 10.9756 0.727391 10.6241 0.375919C10.2727 0.024447 9.70282 0.024447 9.35135 0.375919L5.48504 4.24223L1.61873 0.375917Z", fill: "#22394E" }) }))); };
|
|
@@ -9,5 +9,5 @@ var __assign = (this && this.__assign) || function () {
|
|
|
9
9
|
};
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
-
export var Info = function (props) { return (
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
export var Info = function (props) { return (_jsxs("svg", __assign({ width: "24", height: "24", viewBox: "0 0 24 24", stroke: "#374151", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, props, { children: [_jsx("path", { d: "M12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22Z", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }), _jsx("path", { d: "M12 16V12", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }), _jsx("path", { d: "M12 8H12.01", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" })] }))); };
|
|
@@ -9,5 +9,5 @@ var __assign = (this && this.__assign) || function () {
|
|
|
9
9
|
};
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
-
export var MakePhoto = function (props) { return (
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
export var MakePhoto = function (props) { return (_jsxs("svg", __assign({ width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", stroke: "#22394E", xmlns: "http://www.w3.org/2000/svg" }, props, { children: [_jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M17.6377 7.10987C17.2647 7.10987 16.9267 6.89487 16.7677 6.55887C16.4807 5.95087 16.1157 5.17387 15.8997 4.75087C15.5807 4.12187 15.0637 3.75587 14.3477 3.75087C14.3357 3.74987 9.66376 3.74987 9.65176 3.75087C8.93576 3.75587 8.41976 4.12187 8.09976 4.75087C7.88476 5.17387 7.51976 5.95087 7.23276 6.55887C7.07376 6.89487 6.73476 7.10987 6.36276 7.10987C4.36676 7.10987 2.74976 8.72687 2.74976 10.7219L2.74976 16.6579C2.74976 18.6519 4.36676 20.2699 6.36276 20.2699L17.6377 20.2699C19.6327 20.2699 21.2497 18.6519 21.2497 16.6579L21.2497 10.7219C21.2497 8.72687 19.6327 7.10987 17.6377 7.10987Z", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }), _jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M8.82139 13.3345C8.82039 15.0875 10.2514 16.5215 12.0014 16.5205C13.7484 16.5185 15.1754 15.0905 15.1784 13.3415C15.1814 11.5855 13.7554 10.1545 12.0034 10.1525C10.2414 10.1505 8.80739 11.6055 8.82139 13.3345Z", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }), _jsx("path", { d: "M16.5392 9.80995L16.5392 9.80995L16.54 9.80805C16.571 9.73747 16.5999 9.69016 16.6574 9.63231C16.7068 9.59037 16.7521 9.56032 16.8148 9.5318C17.0023 9.46148 17.2237 9.51198 17.3508 9.63902L17.3508 9.63903L17.3534 9.64159C17.3735 9.66141 17.3933 9.68463 17.4102 9.70806C17.4226 9.72528 17.4311 9.73931 17.4363 9.74872L17.4511 9.7867L17.4553 9.79744L17.46 9.80798C17.486 9.8665 17.5 9.9322 17.5 10.0005C17.5 10.1214 17.4561 10.2419 17.3488 10.3579C17.2703 10.4349 17.169 10.4834 17.06 10.4964L17.0002 10.4994L16.9431 10.4965C16.9056 10.4917 16.8609 10.4809 16.7989 10.4565C16.7374 10.4284 16.6907 10.3971 16.6427 10.3492C16.5483 10.2468 16.5 10.1205 16.5 10.0005C16.5 9.93165 16.5142 9.86606 16.5392 9.80995ZM16.0823 9.60681C16.1368 9.48285 16.2014 9.37829 16.3182 9.26456L16.0823 9.60681Z", fill: "#200E32" })] }))); };
|
|
@@ -9,5 +9,5 @@ var __assign = (this && this.__assign) || function () {
|
|
|
9
9
|
};
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
-
export var Print = function (props) { return (
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
export var Print = function (props) { return (_jsxs("svg", __assign({ width: "24", height: "24", viewBox: "0 0 24 24", stroke: "#22394E", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, props, { children: [_jsx("path", { d: "M17 17H19C20.1046 17 21 16.1046 21 15L21 11C21 9.89543 20.1046 9 19 9L5 9C3.89543 9 3 9.89543 3 11L3 15C3 16.1046 3.89543 17 5 17H7M9 21L15 21C16.1046 21 17 20.1046 17 19V15C17 13.8954 16.1046 13 15 13H9C7.89543 13 7 13.8954 7 15L7 19C7 20.1046 7.89543 21 9 21ZM17 9V5C17 3.89543 16.1046 3 15 3L9 3C7.89543 3 7 3.89543 7 5L7 9L17 9Z", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }), _jsx("rect", { x: "17", y: "11", width: "2", height: "1" }), _jsx("rect", { x: "9.25", y: "15.25", width: "5.5", height: "0.5", strokeWidth: "0.5" }), _jsx("rect", { x: "9.25", y: "18.25", width: "5.5", height: "0.5", strokeWidth: "0.5" })] }))); };
|
|
@@ -5,7 +5,7 @@ declare const meta: {
|
|
|
5
5
|
component: ({ badge, ...iconProps }: {
|
|
6
6
|
badge: "warning";
|
|
7
7
|
} & import("..").IconProps) => JSX.Element;
|
|
8
|
-
decorators: ((Story: import("@storybook/types").PartialStoryFn<import("@storybook/react/dist/types-
|
|
8
|
+
decorators: ((Story: import("@storybook/types").PartialStoryFn<import("@storybook/react/dist/types-0fc72a6d").R, {
|
|
9
9
|
badge: "warning";
|
|
10
10
|
icon: string;
|
|
11
11
|
style?: "normal" | "light" | "solid" | undefined;
|
|
@@ -128,7 +128,7 @@ var defaultTheme = {
|
|
|
128
128
|
cardShadow: '0 3px 10px 0 rgba(0, 0, 0, 0.15)',
|
|
129
129
|
smooth: '0px 4px 25px 0px #0000001a',
|
|
130
130
|
// redesign:
|
|
131
|
-
dialogShadow: '
|
|
131
|
+
dialogShadow: '0px 4px 23px 0px rgba(0, 0, 0, 0.08)',
|
|
132
132
|
tooltipShadow: '0px 1px 4px 0 #B1B8C3',
|
|
133
133
|
headerShadow: '1px 2px 3px #00000029',
|
|
134
134
|
headerShadowB: '1px 1px 3px #00000029',
|
|
@@ -159,7 +159,7 @@ var defaultTheme = {
|
|
|
159
159
|
cardShadow: '0 3px 10px 0 rgba(0, 0, 0, 0.15)',
|
|
160
160
|
smooth: '0px 4px 25px 0px #0000001a',
|
|
161
161
|
// redesign:
|
|
162
|
-
dialogShadow: '
|
|
162
|
+
dialogShadow: '0px 4px 23px 0px rgba(0, 0, 0, 0.08)',
|
|
163
163
|
tooltipShadow: '0px 1px 4px 0 #B1B8C3',
|
|
164
164
|
headerShadow: '1px 2px 3px #00000029',
|
|
165
165
|
headerShadowB: '1px 1px 3px #00000029',
|