@mailstep/design-system 0.1.4-beta.3 → 0.1.4-beta.6
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 +10 -4
- package/build/packages/ui/Blocks/CornerDialog/CornerDialog.js +0 -23
- package/build/packages/ui/Blocks/CornerDialog/CornerDialog.js.map +0 -1
- package/build/packages/ui/Blocks/CornerDialog/styles.js +0 -22
- package/build/packages/ui/Blocks/CornerDialog/styles.js.map +0 -1
- package/build/packages/ui/Blocks/CornerDialog/utils.js +0 -15
- package/build/packages/ui/Blocks/CornerDialog/utils.js.map +0 -1
- package/build/packages/ui/Blocks/ImageList/ImageList.js +0 -25
- package/build/packages/ui/Blocks/ImageList/ImageList.js.map +0 -1
- package/build/packages/ui/Blocks/ImageList/components/AddPhoto/index.js +0 -32
- package/build/packages/ui/Blocks/ImageList/components/AddPhoto/index.js.map +0 -1
- package/build/packages/ui/Blocks/ImageList/components/AddPhoto/styles.js +0 -9
- package/build/packages/ui/Blocks/ImageList/components/AddPhoto/styles.js.map +0 -1
- package/build/packages/ui/Blocks/ImageList/components/CloseButton/index.js +0 -12
- package/build/packages/ui/Blocks/ImageList/components/CloseButton/index.js.map +0 -1
- package/build/packages/ui/Blocks/ImageList/components/CloseButton/styles.js +0 -8
- package/build/packages/ui/Blocks/ImageList/components/CloseButton/styles.js.map +0 -1
- package/build/packages/ui/Blocks/ImageList/components/ImageElement/index.js +0 -15
- package/build/packages/ui/Blocks/ImageList/components/ImageElement/index.js.map +0 -1
- package/build/packages/ui/Blocks/ImageList/components/ImageElement/styles.js +0 -9
- package/build/packages/ui/Blocks/ImageList/components/ImageElement/styles.js.map +0 -1
- package/build/packages/ui/Blocks/ImageList/components/ImageTag/index.js +0 -13
- package/build/packages/ui/Blocks/ImageList/components/ImageTag/index.js.map +0 -1
- package/build/packages/ui/Blocks/ImageList/components/ImageTag/styles.js +0 -8
- package/build/packages/ui/Blocks/ImageList/components/ImageTag/styles.js.map +0 -1
- package/build/packages/ui/Blocks/ImageList/styles.js +0 -8
- package/build/packages/ui/Blocks/ImageList/styles.js.map +0 -1
- package/build/packages/ui/Blocks/LightBox/LightBox.js +0 -20
- package/build/packages/ui/Blocks/LightBox/LightBox.js.map +0 -1
- package/build/packages/ui/Blocks/LightBox/hooks/useLightBox.js +0 -22
- package/build/packages/ui/Blocks/LightBox/hooks/useLightBox.js.map +0 -1
- package/build/packages/ui/Blocks/LightBox/styles.js +0 -10
- package/build/packages/ui/Blocks/LightBox/styles.js.map +0 -1
- package/build/packages/ui/Blocks/Modal/Modal.js +0 -40
- package/build/packages/ui/Blocks/Modal/Modal.js.map +0 -1
- package/build/packages/ui/Blocks/Modal/hooks/useClickOutside.js +0 -34
- package/build/packages/ui/Blocks/Modal/hooks/useClickOutside.js.map +0 -1
- package/build/packages/ui/Blocks/Modal/hooks/useModal.js +0 -19
- package/build/packages/ui/Blocks/Modal/hooks/useModal.js.map +0 -1
- package/build/packages/ui/Blocks/Modal/styles.js +0 -47
- package/build/packages/ui/Blocks/Modal/styles.js.map +0 -1
- package/build/packages/ui/Blocks/Modal/utils.js +0 -14
- package/build/packages/ui/Blocks/Modal/utils.js.map +0 -1
- package/build/packages/ui/Blocks/Tabs/Tabs.js +0 -24
- package/build/packages/ui/Blocks/Tabs/Tabs.js.map +0 -1
- package/build/packages/ui/Blocks/Tabs/hooks/useTabs.js +0 -14
- package/build/packages/ui/Blocks/Tabs/hooks/useTabs.js.map +0 -1
- package/build/packages/ui/Blocks/Tabs/styles.js +0 -16
- package/build/packages/ui/Blocks/Tabs/styles.js.map +0 -1
- package/build/packages/ui/Elements/Alert/Alert.js +0 -35
- package/build/packages/ui/Elements/Alert/Alert.js.map +0 -1
- package/build/packages/ui/Elements/Alert/styles.js +0 -33
- package/build/packages/ui/Elements/Alert/styles.js.map +0 -1
- package/build/packages/ui/Elements/Avatar/Avatar.js +0 -15
- package/build/packages/ui/Elements/Avatar/Avatar.js.map +0 -1
- package/build/packages/ui/Elements/Badge/Badge.js +0 -39
- package/build/packages/ui/Elements/Badge/Badge.js.map +0 -1
- package/build/packages/ui/Elements/BorderedBox/BorderedBox.js +0 -13
- package/build/packages/ui/Elements/BorderedBox/BorderedBox.js.map +0 -1
- package/build/packages/ui/Elements/Button/Button.js +0 -12
- package/build/packages/ui/Elements/Button/Button.js.map +0 -1
- package/build/packages/ui/Elements/Button/styles.js +0 -49
- package/build/packages/ui/Elements/Button/styles.js.map +0 -1
- package/build/packages/ui/Elements/Card/Card.js +0 -22
- package/build/packages/ui/Elements/Card/Card.js.map +0 -1
- package/build/packages/ui/Elements/Card/styles.js +0 -34
- package/build/packages/ui/Elements/Card/styles.js.map +0 -1
- package/build/packages/ui/Elements/Dropdown/Dropdown.js +0 -27
- package/build/packages/ui/Elements/Dropdown/Dropdown.js.map +0 -1
- package/build/packages/ui/Elements/ErrorMessage/ErrorMessage.js +0 -16
- package/build/packages/ui/Elements/ErrorMessage/ErrorMessage.js.map +0 -1
- package/build/packages/ui/Elements/Icon/Icon.js +0 -244
- package/build/packages/ui/Elements/Icon/Icon.js.map +0 -1
- package/build/packages/ui/Elements/Icon/icons/FlagCZ.js +0 -7
- package/build/packages/ui/Elements/Icon/icons/FlagCZ.js.map +0 -1
- package/build/packages/ui/Elements/Icon/icons/FlagUSA.js +0 -7
- package/build/packages/ui/Elements/Icon/icons/FlagUSA.js.map +0 -1
- package/build/packages/ui/Elements/Image/Image.js +0 -19
- package/build/packages/ui/Elements/Image/Image.js.map +0 -1
- package/build/packages/ui/Elements/Label/Label.js +0 -17
- package/build/packages/ui/Elements/Label/Label.js.map +0 -1
- package/build/packages/ui/Elements/Line/Line.js +0 -25
- package/build/packages/ui/Elements/Line/Line.js.map +0 -1
- package/build/packages/ui/Elements/Link/Link.js +0 -45
- package/build/packages/ui/Elements/Link/Link.js.map +0 -1
- package/build/packages/ui/Elements/Logo/Logo.js +0 -62
- package/build/packages/ui/Elements/Logo/Logo.js.map +0 -1
- package/build/packages/ui/Elements/Logo/assets/mailship/logo_black.png.js +0 -4
- package/build/packages/ui/Elements/Logo/assets/mailship/logo_black.png.js.map +0 -1
- package/build/packages/ui/Elements/Logo/assets/mailship/logo_m.png.js +0 -4
- package/build/packages/ui/Elements/Logo/assets/mailship/logo_m.png.js.map +0 -1
- package/build/packages/ui/Elements/Logo/assets/mailship/logo_white.png.js +0 -4
- package/build/packages/ui/Elements/Logo/assets/mailship/logo_white.png.js.map +0 -1
- package/build/packages/ui/Elements/Logo/assets/mailship/mailship-logo.svg.js +0 -6
- package/build/packages/ui/Elements/Logo/assets/mailship/mailship-logo.svg.js.map +0 -1
- package/build/packages/ui/Elements/Logo/assets/mailstep/mailstep_black.svg.js +0 -6
- package/build/packages/ui/Elements/Logo/assets/mailstep/mailstep_black.svg.js.map +0 -1
- package/build/packages/ui/Elements/Logo/assets/mailstep/mailstep_white.svg.js +0 -6
- package/build/packages/ui/Elements/Logo/assets/mailstep/mailstep_white.svg.js.map +0 -1
- package/build/packages/ui/Elements/Logo/assets/mailstock/mailstock.svg.js +0 -6
- package/build/packages/ui/Elements/Logo/assets/mailstock/mailstock.svg.js.map +0 -1
- package/build/packages/ui/Elements/Logo/assets/mailwise/mailwiseLogo.svg.js +0 -6
- package/build/packages/ui/Elements/Logo/assets/mailwise/mailwiseLogo.svg.js.map +0 -1
- package/build/packages/ui/Elements/Logo/assets/mailwise/mailwiseLogoSmall.svg.js +0 -6
- package/build/packages/ui/Elements/Logo/assets/mailwise/mailwiseLogoSmall.svg.js.map +0 -1
- package/build/packages/ui/Elements/Logo/assets/mailwrap/mailwrapLogo.svg.js +0 -6
- package/build/packages/ui/Elements/Logo/assets/mailwrap/mailwrapLogo.svg.js.map +0 -1
- package/build/packages/ui/Elements/Pagination/Pagination.js +0 -38
- package/build/packages/ui/Elements/Pagination/Pagination.js.map +0 -1
- package/build/packages/ui/Elements/Pagination/styled.js +0 -27
- package/build/packages/ui/Elements/Pagination/styled.js.map +0 -1
- package/build/packages/ui/Elements/Paragraph/Paragraph.js +0 -6
- package/build/packages/ui/Elements/Paragraph/Paragraph.js.map +0 -1
- package/build/packages/ui/Elements/Portal/index.js +0 -17
- package/build/packages/ui/Elements/Portal/index.js.map +0 -1
- package/build/packages/ui/Elements/ProgressBar/ProgressBar.js +0 -12
- package/build/packages/ui/Elements/ProgressBar/ProgressBar.js.map +0 -1
- package/build/packages/ui/Elements/ProgressBar/styles.js +0 -20
- package/build/packages/ui/Elements/ProgressBar/styles.js.map +0 -1
- package/build/packages/ui/Elements/SimpleLink/SimpleLink.js +0 -17
- package/build/packages/ui/Elements/SimpleLink/SimpleLink.js.map +0 -1
- package/build/packages/ui/Elements/SpaceAround/SpaceAround.js +0 -31
- package/build/packages/ui/Elements/SpaceAround/SpaceAround.js.map +0 -1
- package/build/packages/ui/Elements/Spinner/Spinner.js +0 -21
- package/build/packages/ui/Elements/Spinner/Spinner.js.map +0 -1
- package/build/packages/ui/Elements/Spinner/styles.js +0 -21
- package/build/packages/ui/Elements/Spinner/styles.js.map +0 -1
- package/build/packages/ui/Elements/Tag/Tag.js +0 -59
- package/build/packages/ui/Elements/Tag/Tag.js.map +0 -1
- package/build/packages/ui/Elements/Tag/palletes.js +0 -13
- package/build/packages/ui/Elements/Tag/palletes.js.map +0 -1
- package/build/packages/ui/Elements/Text/Text.js +0 -8
- package/build/packages/ui/Elements/Text/Text.js.map +0 -1
- package/build/packages/ui/Elements/Toast/Toast.js +0 -23
- package/build/packages/ui/Elements/Toast/Toast.js.map +0 -1
- package/build/packages/ui/Elements/Toggle/Toggle.js +0 -30
- package/build/packages/ui/Elements/Toggle/Toggle.js.map +0 -1
- package/build/packages/ui/Elements/Typography/Typography.js +0 -35
- package/build/packages/ui/Elements/Typography/Typography.js.map +0 -1
- package/build/packages/ui/Forms/Checkbox/Checkbox.js +0 -15
- package/build/packages/ui/Forms/Checkbox/Checkbox.js.map +0 -1
- package/build/packages/ui/Forms/Checkbox/styles.js +0 -28
- package/build/packages/ui/Forms/Checkbox/styles.js.map +0 -1
- package/build/packages/ui/Forms/Input/Input.js +0 -43
- package/build/packages/ui/Forms/Input/Input.js.map +0 -1
- package/build/packages/ui/Forms/Input/styles.js +0 -58
- package/build/packages/ui/Forms/Input/styles.js.map +0 -1
- package/build/packages/ui/Forms/RadioButton/RadioButton.js +0 -11
- package/build/packages/ui/Forms/RadioButton/RadioButton.js.map +0 -1
- package/build/packages/ui/Forms/RadioButton/styles.js +0 -16
- package/build/packages/ui/Forms/RadioButton/styles.js.map +0 -1
- package/build/packages/ui/ThemeProvider/ThemeProvider.js +0 -11
- package/build/packages/ui/ThemeProvider/ThemeProvider.js.map +0 -1
- package/build/packages/ui/ThemeProvider/themes/default.js +0 -145
- package/build/packages/ui/ThemeProvider/themes/default.js.map +0 -1
- package/build/packages/ui/ThemeProvider/themes/index.js +0 -12
- package/build/packages/ui/ThemeProvider/themes/index.js.map +0 -1
- package/build/packages/ui/ThemeProvider/themes/light.js +0 -9
- package/build/packages/ui/ThemeProvider/themes/light.js.map +0 -1
- package/build/packages/ui/ThemeProvider/themes/mailwise.js +0 -216
- package/build/packages/ui/ThemeProvider/themes/mailwise.js.map +0 -1
- package/build/packages/ui/index.js +0 -45
- package/build/packages/ui/index.js.map +0 -1
- package/build/packages/ui/utils/CreateRgba/createRgba.js +0 -21
- package/build/packages/ui/utils/CreateRgba/createRgba.js.map +0 -1
- package/build/packages/ui/utils/KeyPress/KeyPress.js +0 -20
- package/build/packages/ui/utils/KeyPress/KeyPress.js.map +0 -1
- package/build/packages/ui/utils/KeyPress/index.js +0 -6
- package/build/packages/ui/utils/KeyPress/index.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mailstep/design-system",
|
|
3
|
-
"version": "0.1.4-beta.
|
|
3
|
+
"version": "0.1.4-beta.6",
|
|
4
4
|
"license": "ISC",
|
|
5
5
|
"type": "module",
|
|
6
|
-
"main": "./build/
|
|
6
|
+
"main": "./build/index.js",
|
|
7
7
|
"module": "./build/index.es.js",
|
|
8
8
|
"types": "./build/index.d.ts",
|
|
9
9
|
"files": [
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
],
|
|
12
12
|
"scripts": {
|
|
13
13
|
"storybook": "storybook dev -p 6006",
|
|
14
|
-
"build": "rollup -c",
|
|
14
|
+
"build": "rm -rf ./build && rollup -c",
|
|
15
15
|
"build-storybook": "storybook build",
|
|
16
16
|
"dev": "yarn storybook",
|
|
17
17
|
"test": "echo \"The tests are still waiting to be written, but it seems like they're really good at procrastinating!\""
|
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
"@fortawesome/pro-regular-svg-icons": "^6.0.0",
|
|
28
28
|
"@fortawesome/pro-solid-svg-icons": "^6.3.0",
|
|
29
29
|
"@fortawesome/react-fontawesome": "^0.2.0",
|
|
30
|
+
"@rollup/plugin-alias": "^5.0.1",
|
|
30
31
|
"@rollup/plugin-commonjs": "^25.0.0",
|
|
31
32
|
"@rollup/plugin-node-resolve": "^15.0.2",
|
|
32
33
|
"@rollup/plugin-typescript": "^11.1.1",
|
|
@@ -50,6 +51,7 @@
|
|
|
50
51
|
"babel-loader": "^9.1.2",
|
|
51
52
|
"babel-plugin-named-exports-order": "^0.0.2",
|
|
52
53
|
"eslint-plugin-storybook": "0.6.15",
|
|
54
|
+
"lodash": "^4.17.21",
|
|
53
55
|
"react": "^18.2.0",
|
|
54
56
|
"react-dom": "^18.2.0",
|
|
55
57
|
"react-image": "^4.1.0",
|
|
@@ -68,6 +70,7 @@
|
|
|
68
70
|
"string-width": "6.1.0",
|
|
69
71
|
"styled-components": "^5.3.10",
|
|
70
72
|
"swiper": "^11.0.3",
|
|
73
|
+
"tslib": "^2.6.2",
|
|
71
74
|
"typescript": "^5.0.4",
|
|
72
75
|
"webpack": "^5.82.1"
|
|
73
76
|
},
|
|
@@ -80,6 +83,7 @@
|
|
|
80
83
|
"@fortawesome/pro-solid-svg-icons": "^6.3.0",
|
|
81
84
|
"@fortawesome/react-fontawesome": "^0.2.0",
|
|
82
85
|
"@xstyled/styled-components": "^3.8.0",
|
|
86
|
+
"lodash": "^4.17.21",
|
|
83
87
|
"react": "^18.2.0",
|
|
84
88
|
"react-dom": "^18.2.0",
|
|
85
89
|
"react-image": "^4.1.0",
|
|
@@ -88,7 +92,9 @@
|
|
|
88
92
|
"react-toastify": "^9.1.3",
|
|
89
93
|
"react-use-draggable-scroll": "^0.4.7",
|
|
90
94
|
"styled-components": "^5.3.10",
|
|
91
|
-
"swiper": "^11.0.3"
|
|
95
|
+
"swiper": "^11.0.3",
|
|
96
|
+
"tslib": "^2.6.2",
|
|
97
|
+
"typescript": "^5.0.4"
|
|
92
98
|
},
|
|
93
99
|
"resolutions": {
|
|
94
100
|
"jackspeak": "2.1.1"
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
-
import { useState, useEffect } from 'react';
|
|
3
|
-
import { statusToIcon, statusToColors } from './utils.js';
|
|
4
|
-
import { Portal } from '../../Elements/Portal/index.js';
|
|
5
|
-
import Icon from '../../Elements/Icon/Icon.js';
|
|
6
|
-
import '../../../../node_modules/tslib/tslib.es6.js';
|
|
7
|
-
import { Container, Status, StatusText, Header, CloseBtn, Wrapper } from './styles.js';
|
|
8
|
-
|
|
9
|
-
var CornerDialog = function (_a) {
|
|
10
|
-
var title = _a.title, children = _a.children, onClose = _a.onClose, statusToTitle = _a.statusToTitle, _b = _a.isOpen, isOpen = _b === void 0 ? true : _b, _intent = _a.intent;
|
|
11
|
-
var _c = useState(false), isMounted = _c[0], setIsMounted = _c[1];
|
|
12
|
-
useEffect(function () {
|
|
13
|
-
setIsMounted(true);
|
|
14
|
-
}, []);
|
|
15
|
-
var intent = _intent !== null && _intent !== void 0 ? _intent : 'info';
|
|
16
|
-
var _d = statusToColors[intent], fontColor = _d.fontColor, backgroundColor = _d.backgroundColor, fill = _d.fill;
|
|
17
|
-
if (!isOpen)
|
|
18
|
-
return null;
|
|
19
|
-
return (jsx(Portal, { children: jsxs(Container, { "$mounted": isMounted, children: [jsxs(Status, { background: backgroundColor, children: [jsx(Icon, { icon: statusToIcon[intent], fill: fill }), jsx(StatusText, { fontColor: fontColor, children: statusToTitle[intent]() })] }), jsx(Header, { children: title }), jsx(CloseBtn, { onClick: onClose, children: jsx(Icon, { icon: "close", size: "25px" }) }), jsx(Wrapper, { children: children })] }) }));
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
export { CornerDialog };
|
|
23
|
-
//# sourceMappingURL=CornerDialog.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CornerDialog.js","sources":["../../../../../packages/ui/Blocks/CornerDialog/CornerDialog.tsx"],"sourcesContent":["import { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport { useEffect, useState } from 'react';\nimport { statusToColors, statusToIcon } from './utils';\nimport { Portal } from '../../Elements/Portal';\nimport { Icon } from '../../Elements/Icon';\nimport { Container, Header, Status, StatusText, Wrapper, CloseBtn } from './styles';\nexport var CornerDialog = function (_a) {\n var title = _a.title, children = _a.children, onClose = _a.onClose, statusToTitle = _a.statusToTitle, _b = _a.isOpen, isOpen = _b === void 0 ? true : _b, _intent = _a.intent;\n var _c = useState(false), isMounted = _c[0], setIsMounted = _c[1];\n useEffect(function () {\n setIsMounted(true);\n }, []);\n var intent = _intent !== null && _intent !== void 0 ? _intent : 'info';\n var _d = statusToColors[intent], fontColor = _d.fontColor, backgroundColor = _d.backgroundColor, fill = _d.fill;\n if (!isOpen)\n return null;\n return (_jsx(Portal, { children: _jsxs(Container, { \"$mounted\": isMounted, children: [_jsxs(Status, { background: backgroundColor, children: [_jsx(Icon, { icon: statusToIcon[intent], fill: fill }), _jsx(StatusText, { fontColor: fontColor, children: statusToTitle[intent]() })] }), _jsx(Header, { children: title }), _jsx(CloseBtn, { onClick: onClose, children: _jsx(Icon, { icon: \"close\", size: \"25px\" }) }), _jsx(Wrapper, { children: children })] }) }));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AAI,EAAE,EAAE,IAAI,EAAE,YAAY,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EAAEA,GAAI,CAAC,UAAU,EAAE,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,aAAa,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,EAAEA,GAAI,CAAC,MAAM,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC,EAAEA,GAAI,CAAC,QAAQ,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAEA,GAAI,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC,EAAEA,GAAI,CAAC,OAAO,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE;AAC3c;;;;"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { __makeTemplateObject } from '../../../../node_modules/tslib/tslib.es6.js';
|
|
2
|
-
import styled, { th } from '@xstyled/styled-components';
|
|
3
|
-
|
|
4
|
-
var Container = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n position: fixed;\n z-index: 10;\n bottom: 3rem;\n right: 3rem;\n background: white;\n border-radius: 12px;\n box-shadow: cornerDialogShadow;\n width: 400px;\n padding: 50px 30px 30px;\n color: typoPrimary;\n transition: opacity 225ms linear;\n opacity: ", ";\n"], ["\n position: fixed;\n z-index: 10;\n bottom: 3rem;\n right: 3rem;\n background: white;\n border-radius: 12px;\n box-shadow: cornerDialogShadow;\n width: 400px;\n padding: 50px 30px 30px;\n color: typoPrimary;\n transition: opacity 225ms linear;\n opacity: ", ";\n"])), function (_a) {
|
|
5
|
-
var $mounted = _a.$mounted;
|
|
6
|
-
return ($mounted ? 1 : 0);
|
|
7
|
-
});
|
|
8
|
-
var Header = styled.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n margin-bottom: 15px;\n color: typoPrimary;\n font-size: 18px;\n font-weight: bold;\n display: flex;\n align-items: center;\n"], ["\n margin-bottom: 15px;\n color: typoPrimary;\n font-size: 18px;\n font-weight: bold;\n display: flex;\n align-items: center;\n"])));
|
|
9
|
-
var Wrapper = styled.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n font-size: 14px;\n font-weight: 400;\n"], ["\n font-size: 14px;\n font-weight: 400;\n"])));
|
|
10
|
-
var Status = styled.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n position: absolute;\n left: 0;\n top: 0;\n padding: 6px 10px;\n text-transform: uppercase;\n border-radius: 12px 0 12px 0;\n background-color: ", ";\n"], ["\n position: absolute;\n left: 0;\n top: 0;\n padding: 6px 10px;\n text-transform: uppercase;\n border-radius: 12px 0 12px 0;\n background-color: ", ";\n"])), function (_a) {
|
|
11
|
-
var background = _a.background;
|
|
12
|
-
return th.color(background);
|
|
13
|
-
});
|
|
14
|
-
var CloseBtn = styled.div(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n cursor: pointer;\n position: absolute;\n top: 12px;\n right: 12px;\n"], ["\n cursor: pointer;\n position: absolute;\n top: 12px;\n right: 12px;\n"])));
|
|
15
|
-
var StatusText = styled.span(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n display: inline-block;\n margin-left: 6px;\n font-size: 14px;\n font-weight: 700;\n color: ", ";\n"], ["\n display: inline-block;\n margin-left: 6px;\n font-size: 14px;\n font-weight: 700;\n color: ", ";\n"])), function (_a) {
|
|
16
|
-
var fontColor = _a.fontColor;
|
|
17
|
-
return th.color(fontColor);
|
|
18
|
-
});
|
|
19
|
-
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6;
|
|
20
|
-
|
|
21
|
-
export { CloseBtn, Container, Header, Status, StatusText, Wrapper };
|
|
22
|
-
//# sourceMappingURL=styles.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","sources":["../../../../../packages/ui/Blocks/CornerDialog/styles.ts"],"sourcesContent":["import { __makeTemplateObject } from \"tslib\";\nimport styled, { th } from '@xstyled/styled-components';\nexport var Container = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject([\"\\n position: fixed;\\n z-index: 10;\\n bottom: 3rem;\\n right: 3rem;\\n background: white;\\n border-radius: 12px;\\n box-shadow: cornerDialogShadow;\\n width: 400px;\\n padding: 50px 30px 30px;\\n color: typoPrimary;\\n transition: opacity 225ms linear;\\n opacity: \", \";\\n\"], [\"\\n position: fixed;\\n z-index: 10;\\n bottom: 3rem;\\n right: 3rem;\\n background: white;\\n border-radius: 12px;\\n box-shadow: cornerDialogShadow;\\n width: 400px;\\n padding: 50px 30px 30px;\\n color: typoPrimary;\\n transition: opacity 225ms linear;\\n opacity: \", \";\\n\"])), function (_a) {\n var $mounted = _a.$mounted;\n return ($mounted ? 1 : 0);\n});\nexport var Header = styled.div(templateObject_2 || (templateObject_2 = __makeTemplateObject([\"\\n margin-bottom: 15px;\\n color: typoPrimary;\\n font-size: 18px;\\n font-weight: bold;\\n display: flex;\\n align-items: center;\\n\"], [\"\\n margin-bottom: 15px;\\n color: typoPrimary;\\n font-size: 18px;\\n font-weight: bold;\\n display: flex;\\n align-items: center;\\n\"])));\nexport var Wrapper = styled.div(templateObject_3 || (templateObject_3 = __makeTemplateObject([\"\\n font-size: 14px;\\n font-weight: 400;\\n\"], [\"\\n font-size: 14px;\\n font-weight: 400;\\n\"])));\nexport var Status = styled.div(templateObject_4 || (templateObject_4 = __makeTemplateObject([\"\\n position: absolute;\\n left: 0;\\n top: 0;\\n padding: 6px 10px;\\n text-transform: uppercase;\\n border-radius: 12px 0 12px 0;\\n background-color: \", \";\\n\"], [\"\\n position: absolute;\\n left: 0;\\n top: 0;\\n padding: 6px 10px;\\n text-transform: uppercase;\\n border-radius: 12px 0 12px 0;\\n background-color: \", \";\\n\"])), function (_a) {\n var background = _a.background;\n return th.color(background);\n});\nexport var CloseBtn = styled.div(templateObject_5 || (templateObject_5 = __makeTemplateObject([\"\\n cursor: pointer;\\n position: absolute;\\n top: 12px;\\n right: 12px;\\n\"], [\"\\n cursor: pointer;\\n position: absolute;\\n top: 12px;\\n right: 12px;\\n\"])));\nexport var StatusText = styled.span(templateObject_6 || (templateObject_6 = __makeTemplateObject([\"\\n display: inline-block;\\n margin-left: 6px;\\n font-size: 14px;\\n font-weight: 700;\\n color: \", \";\\n\"], [\"\\n display: inline-block;\\n margin-left: 6px;\\n font-size: 14px;\\n font-weight: 700;\\n color: \", \";\\n\"])), function (_a) {\n var fontColor = _a.fontColor;\n return th.color(fontColor);\n});\nvar templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6;\n//# sourceMappingURL=styles.js.map"],"names":[],"mappings":";;;AAEU,IAAC,SAAS,GAAG,MAAM,CAAC,GAAG,CAAC,gBAAgB,KAAK,gBAAgB,GAAG,oBAAoB,CAAC,CAAC,8QAA8Q,EAAE,KAAK,CAAC,EAAE,CAAC,8QAA8Q,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,EAAE;AACjqB,IAAI,IAAI,QAAQ,GAAG,EAAE,CAAC,QAAQ,CAAC;AAC/B,IAAI,QAAQ,QAAQ,GAAG,CAAC,GAAG,CAAC,EAAE;AAC9B,CAAC,EAAE;AACO,IAAC,MAAM,GAAG,MAAM,CAAC,GAAG,CAAC,gBAAgB,KAAK,gBAAgB,GAAG,oBAAoB,CAAC,CAAC,uIAAuI,CAAC,EAAE,CAAC,uIAAuI,CAAC,CAAC,CAAC,EAAE;AAC1W,IAAC,OAAO,GAAG,MAAM,CAAC,GAAG,CAAC,gBAAgB,KAAK,gBAAgB,GAAG,oBAAoB,CAAC,CAAC,6CAA6C,CAAC,EAAE,CAAC,6CAA6C,CAAC,CAAC,CAAC,EAAE;AACvL,IAAC,MAAM,GAAG,MAAM,CAAC,GAAG,CAAC,gBAAgB,KAAK,gBAAgB,GAAG,oBAAoB,CAAC,CAAC,2JAA2J,EAAE,KAAK,CAAC,EAAE,CAAC,2JAA2J,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,EAAE;AACxb,IAAI,IAAI,UAAU,GAAG,EAAE,CAAC,UAAU,CAAC;AACnC,IAAI,OAAO,EAAE,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;AAChC,CAAC,EAAE;AACO,IAAC,QAAQ,GAAG,MAAM,CAAC,GAAG,CAAC,gBAAgB,KAAK,gBAAgB,GAAG,oBAAoB,CAAC,CAAC,6EAA6E,CAAC,EAAE,CAAC,6EAA6E,CAAC,CAAC,CAAC,EAAE;AACxP,IAAC,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,gBAAgB,KAAK,gBAAgB,GAAG,oBAAoB,CAAC,CAAC,qGAAqG,EAAE,KAAK,CAAC,EAAE,CAAC,qGAAqG,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,EAAE;AACjV,IAAI,IAAI,SAAS,GAAG,EAAE,CAAC,SAAS,CAAC;AACjC,IAAI,OAAO,EAAE,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;AAC/B,CAAC,EAAE;AACH,IAAI,gBAAgB,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,gBAAgB;;;;"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
var statusToColors = {
|
|
2
|
-
info: { fontColor: 'gray1', backgroundColor: 'lightGray7', fill: 'gray1' },
|
|
3
|
-
success: { fontColor: 'white', backgroundColor: 'green', fill: 'white' },
|
|
4
|
-
error: { fontColor: 'white', backgroundColor: 'red1', fill: 'white' },
|
|
5
|
-
warning: { fontColor: 'blue2', backgroundColor: 'yellow1', fill: 'blue2' },
|
|
6
|
-
};
|
|
7
|
-
var statusToIcon = {
|
|
8
|
-
info: 'info',
|
|
9
|
-
success: 'circleCheck',
|
|
10
|
-
error: 'circleX',
|
|
11
|
-
warning: 'circleTriangle',
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
export { statusToColors, statusToIcon };
|
|
15
|
-
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sources":["../../../../../packages/ui/Blocks/CornerDialog/utils.ts"],"sourcesContent":["export var statusToColors = {\n info: { fontColor: 'gray1', backgroundColor: 'lightGray7', fill: 'gray1' },\n success: { fontColor: 'white', backgroundColor: 'green', fill: 'white' },\n error: { fontColor: 'white', backgroundColor: 'red1', fill: 'white' },\n warning: { fontColor: 'blue2', backgroundColor: 'yellow1', fill: 'blue2' },\n};\nexport var statusToIcon = {\n info: 'info',\n success: 'circleCheck',\n error: 'circleX',\n warning: 'circleTriangle',\n};\n//# sourceMappingURL=utils.js.map"],"names":[],"mappings":"AAAU,IAAC,cAAc,GAAG;AAC5B,IAAI,IAAI,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,IAAI,EAAE,OAAO,EAAE;AAC9E,IAAI,OAAO,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,eAAe,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE;AAC5E,IAAI,KAAK,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE;AACzE,IAAI,OAAO,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE;AAC9E,EAAE;AACQ,IAAC,YAAY,GAAG;AAC1B,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,aAAa;AAC1B,IAAI,KAAK,EAAE,SAAS;AACpB,IAAI,OAAO,EAAE,gBAAgB;AAC7B;;;;"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { __assign } from '../../../../node_modules/tslib/tslib.es6.js';
|
|
2
|
-
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
|
-
import { useRef } from 'react';
|
|
4
|
-
import { useDraggable } from 'react-use-draggable-scroll';
|
|
5
|
-
import { LightBox } from '../LightBox/LightBox.js';
|
|
6
|
-
import { useLightBox } from '../LightBox/hooks/useLightBox.js';
|
|
7
|
-
import { AddPhoto } from './components/AddPhoto/index.js';
|
|
8
|
-
import { ImageElement } from './components/ImageElement/index.js';
|
|
9
|
-
import { x } from '@xstyled/styled-components';
|
|
10
|
-
import { ImageListContainer } from './styles.js';
|
|
11
|
-
|
|
12
|
-
var ImageList = function (_a) {
|
|
13
|
-
var onImageUpload = _a.onImageUpload, onImageRemove = _a.onImageRemove, lightBoxAction = _a.lightBoxAction, lightBoxActionTitle = _a.lightBoxActionTitle, images = _a.images;
|
|
14
|
-
var ref = useRef();
|
|
15
|
-
var events = useDraggable(ref, { isMounted: !!(images === null || images === void 0 ? void 0 : images.length) }).events;
|
|
16
|
-
var _b = useLightBox(), isLightBoxOpen = _b.isLightBoxOpen, onCloseLightBox = _b.onCloseLightBox, onOpenLightBox = _b.onOpenLightBox, lightBoxData = _b.lightBoxData;
|
|
17
|
-
return (jsxs(x.div, { display: "flex", alignItems: "flex-end", children: [jsx(AddPhoto, { onImageUpload: onImageUpload }), images &&
|
|
18
|
-
jsx(ImageListContainer, __assign({ ref: ref }, events, { children: images.map(function (item, index) {
|
|
19
|
-
var _a, _b;
|
|
20
|
-
return (jsx(ImageElement, { imageUrl: (_a = item.smallUrl) !== null && _a !== void 0 ? _a : item.url, onImageRemove: onImageRemove === null || onImageRemove === void 0 ? void 0 : onImageRemove(item.id), onOpenLightBox: onOpenLightBox(index) }, (_b = item.id) !== null && _b !== void 0 ? _b : index));
|
|
21
|
-
}) })), jsx(LightBox, { initialSlide: lightBoxData === null || lightBoxData === void 0 ? void 0 : lightBoxData.initialSlide, isLightBoxOpen: isLightBoxOpen, onCloseLightBox: onCloseLightBox, lightBoxAction: lightBoxAction, lightBoxActionTitle: lightBoxActionTitle, images: images })] }));
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
export { ImageList };
|
|
25
|
-
//# sourceMappingURL=ImageList.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ImageList.js","sources":["../../../../../packages/ui/Blocks/ImageList/ImageList.tsx"],"sourcesContent":["import { __assign } from \"tslib\";\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport { useRef } from 'react';\nimport { useDraggable } from 'react-use-draggable-scroll';\nimport { LightBox, useLightBox } from '../LightBox';\nimport { AddPhoto } from './components/AddPhoto';\nimport { ImageElement } from './components/ImageElement';\nimport { x } from '@xstyled/styled-components';\nimport { ImageListContainer } from './styles';\nexport var ImageList = function (_a) {\n var onImageUpload = _a.onImageUpload, onImageRemove = _a.onImageRemove, lightBoxAction = _a.lightBoxAction, lightBoxActionTitle = _a.lightBoxActionTitle, images = _a.images;\n var ref = useRef();\n var events = useDraggable(ref, { isMounted: !!(images === null || images === void 0 ? void 0 : images.length) }).events;\n var _b = useLightBox(), isLightBoxOpen = _b.isLightBoxOpen, onCloseLightBox = _b.onCloseLightBox, onOpenLightBox = _b.onOpenLightBox, lightBoxData = _b.lightBoxData;\n return (_jsxs(x.div, { display: \"flex\", alignItems: \"flex-end\", children: [_jsx(AddPhoto, { onImageUpload: onImageUpload }), images &&\n _jsx(ImageListContainer, __assign({ ref: ref }, events, { children: images.map(function (item, index) {\n var _a, _b;\n return (_jsx(ImageElement, { imageUrl: (_a = item.smallUrl) !== null && _a !== void 0 ? _a : item.url, onImageRemove: onImageRemove === null || onImageRemove === void 0 ? void 0 : onImageRemove(item.id), onOpenLightBox: onOpenLightBox(index) }, (_b = item.id) !== null && _b !== void 0 ? _b : index));\n }) })), _jsx(LightBox, { initialSlide: lightBoxData === null || lightBoxData === void 0 ? void 0 : lightBoxData.initialSlide, isLightBoxOpen: isLightBoxOpen, onCloseLightBox: onCloseLightBox, lightBoxAction: lightBoxAction, lightBoxActionTitle: lightBox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,CAAC,YAAY,EAAE,EAAE,QAAQ,EAAE,CAAC,EAAE,GAAG,IAAI,CAAC,QAAQ,MAAM,IAAI,IAAI,EAAE,KAAK,KAAK,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,GAAG,EAAE,aAAa,EAAE,aAAa,KAAK,IAAI,IAAI,aAAa,KAAK,KAAK,CAAC,GAAG,KAAK,CAAC,GAAG,aAAa,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,cAAc,EAAE,cAAc,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC,EAAE,GAAG,IAAI,CAAC,EAAE,MAAM,IAAI,IAAI,EAAE,KAAK,KAAK,CAAC,GAAG,EAAE,GAAG,KAAK,CAAC,EAAE;AACrU,qBAAqB,CAAC,EAAE,CAAC,CAAC,EAAEA,GAAI,CAAC,QAAQ,EAAE,EAAE,YAAY,EAAE,YAAY,KAAK,IAAI,IAAI,YAAY,KAAK,KAAK,CAAC,GAAG,KAAK,CAAC,GAAG,YAAY,CAAC,YAAY,EAAE,cAAc,EAAE,cAAc,EAAE,eAAe,EAAE,eAAe,EAAE,cAAc,EAAE,cAAc,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE;AACrT;;;;"}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { __awaiter, __generator } from '../../../../../../node_modules/tslib/tslib.es6.js';
|
|
2
|
-
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
|
-
import { useCallback } from 'react';
|
|
4
|
-
import { Container, HiddenInput } from './styles.js';
|
|
5
|
-
|
|
6
|
-
var AddPhoto = function (_a) {
|
|
7
|
-
var onImageUpload = _a.onImageUpload;
|
|
8
|
-
var handleImageUpload = useCallback(function (event) {
|
|
9
|
-
var _a, _b;
|
|
10
|
-
if (!((_b = (_a = event.target) === null || _a === void 0 ? void 0 : _a.files) === null || _b === void 0 ? void 0 : _b[0]))
|
|
11
|
-
return;
|
|
12
|
-
var reader = new FileReader();
|
|
13
|
-
reader.readAsDataURL(event.target.files[0]);
|
|
14
|
-
reader.onload = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
15
|
-
var _a;
|
|
16
|
-
return __generator(this, function (_b) {
|
|
17
|
-
switch (_b.label) {
|
|
18
|
-
case 0: return [4 /*yield*/, (onImageUpload === null || onImageUpload === void 0 ? void 0 : onImageUpload({ base64: reader.result, file: (_a = event.target.files) === null || _a === void 0 ? void 0 : _a[0] }))];
|
|
19
|
-
case 1:
|
|
20
|
-
_b.sent();
|
|
21
|
-
return [2 /*return*/];
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
}); };
|
|
25
|
-
}, [onImageUpload]);
|
|
26
|
-
if (!onImageUpload)
|
|
27
|
-
return null;
|
|
28
|
-
return (jsxs(Container, { children: [jsx(HiddenInput, { onChange: handleImageUpload, type: "file", accept: "image/*" }), jsxs("svg", { width: "36", height: "36", viewBox: "0 0 37 34", fill: "#DB2B19", xmlns: "http://www.w3.org/2000/svg", children: [jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M9.82792 6.14124C10.7187 5.25044 11.9269 4.75 13.1867 4.75H19C19.8745 4.75 20.5833 5.45889 20.5833 6.33333C20.5833 7.20778 19.8745 7.91667 19 7.91667H13.1867C12.7668 7.91667 12.364 8.08349 12.0671 8.38041L10.7554 9.69209C9.86461 10.5829 8.65643 11.0833 7.39665 11.0833H4.75C3.87556 11.0833 3.16667 11.7922 3.16667 12.6667V28.5C3.16667 29.3745 3.87556 30.0833 4.75 30.0833H26.9167C27.7911 30.0833 28.5 29.3745 28.5 28.5V17.4167C28.5 16.5422 29.2089 15.8333 30.0833 15.8333C30.9578 15.8333 31.6667 16.5422 31.6667 17.4167V28.5C31.6667 31.1234 29.5401 33.25 26.9167 33.25H4.75C2.12665 33.25 0 31.1234 0 28.5V12.6667C0 10.0433 2.12665 7.91667 4.75 7.91667H7.39665C7.81658 7.91667 8.21931 7.74985 8.51624 7.45292L9.82792 6.14124Z" }), jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M7.9165 20.5834C7.9165 16.2112 11.4609 12.6667 15.8332 12.6667C20.2054 12.6667 23.7498 16.2112 23.7498 20.5834C23.7498 24.9556 20.2054 28.5001 15.8332 28.5001C11.4609 28.5001 7.9165 24.9556 7.9165 20.5834ZM15.8332 15.8334C13.2098 15.8334 11.0832 17.96 11.0832 20.5834C11.0832 23.2068 13.2098 25.3334 15.8332 25.3334C18.4566 25.3334 20.5832 23.2068 20.5832 20.5834C20.5832 17.96 18.4566 15.8334 15.8332 15.8334Z" }), jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M23.75 6.33333C23.75 5.45889 24.4589 4.75 25.3333 4.75H34.8333C35.7078 4.75 36.4167 5.45889 36.4167 6.33333C36.4167 7.20778 35.7078 7.91667 34.8333 7.91667H25.3333C24.4589 7.91667 23.75 7.20778 23.75 6.33333Z" }), jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M30.0833 0C30.9578 0 31.6667 0.70889 31.6667 1.58333V11.0833C31.6667 11.9578 30.9578 12.6667 30.0833 12.6667C29.2089 12.6667 28.5 11.9578 28.5 11.0833V1.58333C28.5 0.70889 29.2089 0 30.0833 0Z" })] })] }));
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
export { AddPhoto };
|
|
32
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../../../packages/ui/Blocks/ImageList/components/AddPhoto/index.tsx"],"sourcesContent":["import { __awaiter, __generator } from \"tslib\";\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport { useCallback } from 'react';\nimport { Container, HiddenInput } from './styles';\nexport var AddPhoto = function (_a) {\n var onImageUpload = _a.onImageUpload;\n var handleImageUpload = useCallback(function (event) {\n var _a, _b;\n if (!((_b = (_a = event.target) === null || _a === void 0 ? void 0 : _a.files) === null || _b === void 0 ? void 0 : _b[0]))\n return;\n var reader = new FileReader();\n reader.readAsDataURL(event.target.files[0]);\n reader.onload = function () { return __awaiter(void 0, void 0, void 0, function () {\n var _a;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0: return [4 /*yield*/, (onImageUpload === null || onImageUpload === void 0 ? void 0 : onImageUpload({ base64: reader.result, file: (_a = event.target.files) === null || _a === void 0 ? void 0 : _a[0] }))];\n case 1:\n _b.sent();\n return [2 /*return*/];\n }\n });\n }); };\n }, [onImageUpload]);\n if (!onImageUpload)\n return null;\n return (_jsxs(Container, { children: [_jsx(HiddenInput, { onChange: handleImageUpload, type: \"file\", accept: \"image/*\" }), _jsxs(\"svg\", { width: \"36\", height: \"36\", viewBox: \"0 0 37 34\", fill: \"#DB2B19\", xmlns: \"http://www.w3.org/2000/svg\", children: [_jsx(\"path\", { fillRule: \"evenodd\", clipRule: \"evenodd\", d: \"M9.82792 6.14124C10.7187 5.25044 11.9269 4.75 13.1867 4.75H19C19.8745 4.75 20.5833 5.45889 20.5833 6.33333C20.5833 7.20778 19.8745 7.91667 19 7.91667H13.1867C12.7668 7.91667 12.364 8.08349 12.0671 8.38041L10.7554 9.69209C9.86461 10.5829 8.65643 11.0833 7.39665 11.0833H4.75C3.87556 11.0833 3.16667 11.7922 3.16667 12.6667V28.5C3.16667 29.3745 3.87556 30.0833 4.75 30.0833H26.9167C27.7911 30.0833 28.5 29.3745 28.5 28.5V17.4167C28.5 16.5422 29.2089 15.8333 30.0833 15.8333C30.9578 15.8333 31.6667 16.5422 31.6667 17.4167V28.5C31.6667 31.1234 29.5401 33.25 26.9167 33.25H4.75C2.12665 33.25 0 31.1234 0 28.5V12.6667C0 10.0433 2.12665 7.91667 4.75 7.91667H7.39665C7.81658 7.91667 8.21931 7.74985 8.51624 7.45292L9.82792 6.14124Z\" }), _jsx(\"path\", { fillRule: \"evenodd\", clipRule: \"evenodd\", d: \"M7.9165 20.5834C7.9165 16.2112 11.4609 12.6667 15.8332 12.6667C20.2054 12.6667 23.7498 16.2112 23.7498 20.5834C23.7498 24.9556 20.2054 28.5001 15.8332 28.5001C11.4609 28.5001 7.9165 24.9556 7.9165 20.5834ZM15.8332 15.8334C13.2098 15.8334 11.0832 17.96 11.0832 20.5834C11.0832 23.2068 13.2098 25.3334 15.8332 25.3334C18.4566 25.3334 20.5832 23.2068 20.5832 20.5834C20.5832 17.96 18.4566 15.8334 15.8332 15.8334Z\" }), _jsx(\"path\", { fillRule: \"evenodd\", clipRule: \"evenodd\", d: \"M23.75 6.33333C23.75 5.45889 24.4589 4.75 25.3333 4.75H34.8333C35.7078 4.75 36.4167 5.45889 36.4167 6.33333C36.4167 7.20778 35.7078 7.91667 34.8333 7.91667H25.3333C24.4589 7.91667 23.75 7.20778 23.75 6.33333Z\" }), _jsx(\"path\", { fillRule: \"evenodd\", clipRule: \"evenodd\", d: \"M30.0833 0C30.9578 0 31.6667 0.70889 31.6667 1.58333V11.0833C31.6667 11.9578 30.9578 12.6667 30.0833 12.6667C29.2089 12.6667 28.5 11.9578 28.5 11.0833V1.58333C28.5 0.70889 29.2089 0 30.0833 0Z\" })] })] }));\n};\n//# sourceMappingURL=index.js.map"],"names":["_jsxs","_jsx"],"mappings":";;;;;AAIU,IAAC,QAAQ,GAAG,UAAU,EAAE,EAAE;AACpC,IAAI,IAAI,aAAa,GAAG,EAAE,CAAC,aAAa,CAAC;AACzC,IAAI,IAAI,iBAAiB,GAAG,WAAW,CAAC,UAAU,KAAK,EAAE;AACzD,QAAQ,IAAI,EAAE,EAAE,EAAE,CAAC;AACnB,QAAQ,IAAI,EAAE,CAAC,EAAE,GAAG,CAAC,EAAE,GAAG,KAAK,CAAC,MAAM,MAAM,IAAI,IAAI,EAAE,KAAK,KAAK,CAAC,GAAG,KAAK,CAAC,GAAG,EAAE,CAAC,KAAK,MAAM,IAAI,IAAI,EAAE,KAAK,KAAK,CAAC,GAAG,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC;AAClI,YAAY,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AAE,SAAS,EAAE,CAAC,EAAED,IAAK,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,4BAA4B,EAAE,QAAQ,EAAE,CAACC,GAAI,CAAC,MAAM,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC,EAAE,stBAAstB,EAAE,CAAC,EAAEA,GAAI,CAAC,MAAM,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC,EAAE,4ZAA4Z,EAAE,CAAC,EAAEA,GAAI,CAAC,MAAM,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC,EAAE,kNAAkN,EAAE,CAAC,EAAEA,GAAI,CAAC,MAAM,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC,EAAE,kMAAkM,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE;AAClhE;;;;"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { __makeTemplateObject } from '../../../../../../node_modules/tslib/tslib.es6.js';
|
|
2
|
-
import styled, { th } from '@xstyled/styled-components';
|
|
3
|
-
|
|
4
|
-
var Container = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n position: relative;\n flex-shrink: 0;\n height: 85px !important;\n width: 85px !important;\n border-radius: ", ";\n border: ", ";\n border-color: ", ";\n display: flex;\n justify-content: center;\n align-items: center;\n cursor: pointer;\n margin-right: 15px;\n"], ["\n position: relative;\n flex-shrink: 0;\n height: 85px !important;\n width: 85px !important;\n border-radius: ", ";\n border: ", ";\n border-color: ", ";\n display: flex;\n justify-content: center;\n align-items: center;\n cursor: pointer;\n margin-right: 15px;\n"])), th.radius('lg'), th.border('mediumSlim'), th.color('red1'));
|
|
5
|
-
var HiddenInput = styled.input(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n opacity: 0;\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n cursor: pointer;\n"], ["\n opacity: 0;\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n cursor: pointer;\n"])));
|
|
6
|
-
var templateObject_1, templateObject_2;
|
|
7
|
-
|
|
8
|
-
export { Container, HiddenInput };
|
|
9
|
-
//# sourceMappingURL=styles.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","sources":["../../../../../../../packages/ui/Blocks/ImageList/components/AddPhoto/styles.ts"],"sourcesContent":["import { __makeTemplateObject } from \"tslib\";\nimport styled, { th } from '@xstyled/styled-components';\nexport var Container = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject([\"\\n position: relative;\\n flex-shrink: 0;\\n height: 85px !important;\\n width: 85px !important;\\n border-radius: \", \";\\n border: \", \";\\n border-color: \", \";\\n display: flex;\\n justify-content: center;\\n align-items: center;\\n cursor: pointer;\\n margin-right: 15px;\\n\"], [\"\\n position: relative;\\n flex-shrink: 0;\\n height: 85px !important;\\n width: 85px !important;\\n border-radius: \", \";\\n border: \", \";\\n border-color: \", \";\\n display: flex;\\n justify-content: center;\\n align-items: center;\\n cursor: pointer;\\n margin-right: 15px;\\n\"])), th.radius('lg'), th.border('mediumSlim'), th.color('red1'));\nexport var HiddenInput = styled.input(templateObject_2 || (templateObject_2 = __makeTemplateObject([\"\\n opacity: 0;\\n position: absolute;\\n top: 0;\\n left: 0;\\n width: 100%;\\n height: 100%;\\n cursor: pointer;\\n\"], [\"\\n opacity: 0;\\n position: absolute;\\n top: 0;\\n left: 0;\\n width: 100%;\\n height: 100%;\\n cursor: pointer;\\n\"])));\nvar templateObject_1, templateObject_2;\n//# sourceMappingURL=styles.js.map"],"names":[],"mappings":";;;AAEU,IAAC,SAAS,GAAG,MAAM,CAAC,GAAG,CAAC,gBAAgB,KAAK,gBAAgB,GAAG,oBAAoB,CAAC,CAAC,sHAAsH,EAAE,eAAe,EAAE,qBAAqB,EAAE,sHAAsH,CAAC,EAAE,CAAC,sHAAsH,EAAE,eAAe,EAAE,qBAAqB,EAAE,sHAAsH,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,YAAY,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE;AACvsB,IAAC,WAAW,GAAG,MAAM,CAAC,KAAK,CAAC,gBAAgB,KAAK,gBAAgB,GAAG,oBAAoB,CAAC,CAAC,sHAAsH,CAAC,EAAE,CAAC,sHAAsH,CAAC,CAAC,CAAC,EAAE;AACzV,IAAI,gBAAgB,EAAE,gBAAgB;;;;"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { jsx } from 'react/jsx-runtime';
|
|
2
|
-
import Icon from '../../../../Elements/Icon/Icon.js';
|
|
3
|
-
import '../../../../../../node_modules/tslib/tslib.es6.js';
|
|
4
|
-
import { Container } from './styles.js';
|
|
5
|
-
|
|
6
|
-
var CloseButton = function (_a) {
|
|
7
|
-
var onImageRemove = _a.onImageRemove;
|
|
8
|
-
return (jsx(Container, { onClick: onImageRemove, children: jsx(Icon, { icon: "close", size: "22px", fill: "red1" }) }));
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
export { CloseButton };
|
|
12
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../../../packages/ui/Blocks/ImageList/components/CloseButton/index.tsx"],"sourcesContent":["import { jsx as _jsx } from \"react/jsx-runtime\";\nimport { Icon } from '../../../../Elements/Icon';\nimport { Container } from './styles';\nexport var CloseButton = function (_a) {\n var onImageRemove = _a.onImageRemove;\n return (_jsx(Container, { onClick: onImageRemove, children: _jsx(Icon, { icon: \"close\", size: \"22px\", fill: \"red1\" }) }));\n};\n//# sourceMappingURL=index.js.map"],"names":["_jsx"],"mappings":";;;;;AAGU,IAAC,WAAW,GAAG,UAAU,EAAE,EAAE;AACvC,IAAI,IAAI,aAAa,GAAG,EAAE,CAAC,aAAa,CAAC;AACzC,IAAI,QAAQA,GAAI,CAAC,SAAS,EAAE,EAAE,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAEA,GAAI,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC,EAAE;AAC9H;;;;"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { __makeTemplateObject } from '../../../../../../node_modules/tslib/tslib.es6.js';
|
|
2
|
-
import styled, { th } from '@xstyled/styled-components';
|
|
3
|
-
|
|
4
|
-
var Container = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n position: absolute;\n top: 0;\n right: 0;\n width: 30px;\n height: 30px;\n background-color: ", ";\n border-radius: 50%;\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n"], ["\n position: absolute;\n top: 0;\n right: 0;\n width: 30px;\n height: 30px;\n background-color: ", ";\n border-radius: 50%;\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n"])), th.color('red20'));
|
|
5
|
-
var templateObject_1;
|
|
6
|
-
|
|
7
|
-
export { Container };
|
|
8
|
-
//# sourceMappingURL=styles.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","sources":["../../../../../../../packages/ui/Blocks/ImageList/components/CloseButton/styles.ts"],"sourcesContent":["import { __makeTemplateObject } from \"tslib\";\nimport styled, { th } from '@xstyled/styled-components';\nexport var Container = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject([\"\\n position: absolute;\\n top: 0;\\n right: 0;\\n width: 30px;\\n height: 30px;\\n background-color: \", \";\\n border-radius: 50%;\\n display: flex;\\n align-items: center;\\n justify-content: center;\\n cursor: pointer;\\n\"], [\"\\n position: absolute;\\n top: 0;\\n right: 0;\\n width: 30px;\\n height: 30px;\\n background-color: \", \";\\n border-radius: 50%;\\n display: flex;\\n align-items: center;\\n justify-content: center;\\n cursor: pointer;\\n\"])), th.color('red20'));\nvar templateObject_1;\n//# sourceMappingURL=styles.js.map"],"names":[],"mappings":";;;AAEU,IAAC,SAAS,GAAG,MAAM,CAAC,GAAG,CAAC,gBAAgB,KAAK,gBAAgB,GAAG,oBAAoB,CAAC,CAAC,wGAAwG,EAAE,sHAAsH,CAAC,EAAE,CAAC,wGAAwG,EAAE,sHAAsH,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE;AAC5jB,IAAI,gBAAgB;;;;"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { Image } from './styles.js';
|
|
3
|
-
import { ImageTag } from '../ImageTag/index.js';
|
|
4
|
-
import { CloseButton } from '../CloseButton/index.js';
|
|
5
|
-
import { x } from '@xstyled/styled-components';
|
|
6
|
-
|
|
7
|
-
var ImageElement = function (_a) {
|
|
8
|
-
var label = _a.label, onImageRemove = _a.onImageRemove, onOpenLightBox = _a.onOpenLightBox, imageUrl = _a.imageUrl;
|
|
9
|
-
if (!imageUrl)
|
|
10
|
-
return null;
|
|
11
|
-
return (jsxs(x.div, { position: "relative", pr: "15px", pt: "15px", w: "100px", children: [jsx(Image, { src: imageUrl, alt: "", width: "85px", height: "85px", onClick: onOpenLightBox }), onImageRemove && jsx(CloseButton, { onImageRemove: onImageRemove }), jsx(ImageTag, { label: label })] }));
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
export { ImageElement };
|
|
15
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../../../packages/ui/Blocks/ImageList/components/ImageElement/index.tsx"],"sourcesContent":["import { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport { Image } from './styles';\nimport { ImageTag } from '../ImageTag';\nimport { CloseButton } from '../CloseButton';\nimport { x } from '@xstyled/styled-components';\nexport var ImageElement = function (_a) {\n var label = _a.label, onImageRemove = _a.onImageRemove, onOpenLightBox = _a.onOpenLightBox, imageUrl = _a.imageUrl;\n if (!imageUrl)\n return null;\n return (_jsxs(x.div, { position: \"relative\", pr: \"15px\", pt: \"15px\", w: \"100px\", children: [_jsx(Image, { src: imageUrl, alt: \"\", width: \"85px\", height: \"85px\", onClick: onOpenLightBox }), onImageRemove && _jsx(CloseButton, { onImageRemove: onImageRemove }), _jsx(ImageTag, { label: label })] }));\n};\n//# sourceMappingURL=index.js.map"],"names":["_jsxs","_jsx"],"mappings":";;;;;;AAKU,IAAC,YAAY,GAAG,UAAU,EAAE,EAAE;AACxC,IAAI,IAAI,KAAK,GAAG,EAAE,CAAC,KAAK,EAAE,aAAa,GAAG,EAAE,CAAC,aAAa,EAAE,cAAc,GAAG,EAAE,CAAC,cAAc,EAAE,QAAQ,GAAG,EAAE,CAAC,QAAQ,CAAC;AACvH,IAAI,IAAI,CAAC,QAAQ;AACjB,QAAQ,OAAO,IAAI,CAAC;AACpB,IAAI,QAAQA,IAAK,CAAC,CAAC,CAAC,GAAG,EAAE,EAAE,QAAQ,EAAE,UAAU,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,CAACC,GAAI,CAAC,KAAK,EAAE,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc,EAAE,CAAC,EAAE,aAAa,IAAIA,GAAI,CAAC,WAAW,EAAE,EAAE,aAAa,EAAE,aAAa,EAAE,CAAC,EAAEA,GAAI,CAAC,QAAQ,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE;AAC7S;;;;"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { __makeTemplateObject } from '../../../../../../node_modules/tslib/tslib.es6.js';
|
|
2
|
-
import styled, { th } from '@xstyled/styled-components';
|
|
3
|
-
|
|
4
|
-
styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject([""], [""])));
|
|
5
|
-
var Image = styled.img(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n border-radius: ", ";\n"], ["\n border-radius: ", ";\n"])), th.radius('lg'));
|
|
6
|
-
var templateObject_1, templateObject_2;
|
|
7
|
-
|
|
8
|
-
export { Image };
|
|
9
|
-
//# sourceMappingURL=styles.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","sources":["../../../../../../../packages/ui/Blocks/ImageList/components/ImageElement/styles.ts"],"sourcesContent":["import { __makeTemplateObject } from \"tslib\";\nimport styled, { th } from '@xstyled/styled-components';\nexport var Container = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject([\"\"], [\"\"])));\nexport var Image = styled.img(templateObject_2 || (templateObject_2 = __makeTemplateObject([\"\\n border-radius: \", \";\\n\"], [\"\\n border-radius: \", \";\\n\"])), th.radius('lg'));\nvar templateObject_1, templateObject_2;\n//# sourceMappingURL=styles.js.map"],"names":[],"mappings":";;;AAEuB,MAAM,CAAC,GAAG,CAAC,gBAAgB,KAAK,gBAAgB,GAAG,oBAAoB,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE;AACnG,IAAC,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,gBAAgB,KAAK,gBAAgB,GAAG,oBAAoB,CAAC,CAAC,qBAAqB,EAAE,KAAK,CAAC,EAAE,CAAC,qBAAqB,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE;AAC9K,IAAI,gBAAgB,EAAE,gBAAgB;;;;"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { Tag } from '../../../../Elements/Tag/Tag.js';
|
|
3
|
-
import { Container } from './styles.js';
|
|
4
|
-
|
|
5
|
-
var ImageTag = function (_a) {
|
|
6
|
-
var label = _a.label;
|
|
7
|
-
if (!label)
|
|
8
|
-
return null;
|
|
9
|
-
return (jsx(Container, { children: jsx(Tag, { size: "small", color: "darkGreen", textColor: "white", children: jsx("b", { children: label }) }) }));
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
export { ImageTag };
|
|
13
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../../../packages/ui/Blocks/ImageList/components/ImageTag/index.tsx"],"sourcesContent":["import { jsx as _jsx } from \"react/jsx-runtime\";\nimport { Tag } from '../../../../Elements/Tag';\nimport { Container } from './styles';\nexport var ImageTag = function (_a) {\n var label = _a.label;\n if (!label)\n return null;\n return (_jsx(Container, { children: _jsx(Tag, { size: \"small\", color: \"darkGreen\", textColor: \"white\", children: _jsx(\"b\", { children: label }) }) }));\n};\n//# sourceMappingURL=index.js.map"],"names":["_jsx"],"mappings":";;;;AAGU,IAAC,QAAQ,GAAG,UAAU,EAAE,EAAE;AACpC,IAAI,IAAI,KAAK,GAAG,EAAE,CAAC,KAAK,CAAC;AACzB,IAAI,IAAI,CAAC,KAAK;AACd,QAAQ,OAAO,IAAI,CAAC;AACpB,IAAI,QAAQA,GAAI,CAAC,SAAS,EAAE,EAAE,QAAQ,EAAEA,GAAI,CAAC,GAAG,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAEA,GAAI,CAAC,GAAG,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE;AAC3J;;;;"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { __makeTemplateObject } from '../../../../../../node_modules/tslib/tslib.es6.js';
|
|
2
|
-
import styled from '@xstyled/styled-components';
|
|
3
|
-
|
|
4
|
-
var Container = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n position: absolute;\n bottom: 2px;\n left: 2px;\n"], ["\n position: absolute;\n bottom: 2px;\n left: 2px;\n"])));
|
|
5
|
-
var templateObject_1;
|
|
6
|
-
|
|
7
|
-
export { Container };
|
|
8
|
-
//# sourceMappingURL=styles.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","sources":["../../../../../../../packages/ui/Blocks/ImageList/components/ImageTag/styles.ts"],"sourcesContent":["import { __makeTemplateObject } from \"tslib\";\nimport styled from '@xstyled/styled-components';\nexport var Container = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject([\"\\n position: absolute;\\n bottom: 2px;\\n left: 2px;\\n\"], [\"\\n position: absolute;\\n bottom: 2px;\\n left: 2px;\\n\"])));\nvar templateObject_1;\n//# sourceMappingURL=styles.js.map"],"names":[],"mappings":";;;AAEU,IAAC,SAAS,GAAG,MAAM,CAAC,GAAG,CAAC,gBAAgB,KAAK,gBAAgB,GAAG,oBAAoB,CAAC,CAAC,yDAAyD,CAAC,EAAE,CAAC,yDAAyD,CAAC,CAAC,CAAC,EAAE;AAC3N,IAAI,gBAAgB;;;;"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { __makeTemplateObject } from '../../../../node_modules/tslib/tslib.es6.js';
|
|
2
|
-
import styled from '@xstyled/styled-components';
|
|
3
|
-
|
|
4
|
-
var ImageListContainer = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n overflow-x: scroll;\n -ms-overflow-style: none;\n scrollbar-width: none;\n position: relative;\n\n &::-webkit-scrollbar {\n display: none;\n }\n"], ["\n display: flex;\n overflow-x: scroll;\n -ms-overflow-style: none;\n scrollbar-width: none;\n position: relative;\n\n &::-webkit-scrollbar {\n display: none;\n }\n"])));
|
|
5
|
-
var templateObject_1;
|
|
6
|
-
|
|
7
|
-
export { ImageListContainer };
|
|
8
|
-
//# sourceMappingURL=styles.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","sources":["../../../../../packages/ui/Blocks/ImageList/styles.ts"],"sourcesContent":["import { __makeTemplateObject } from \"tslib\";\nimport styled from '@xstyled/styled-components';\nexport var ImageListContainer = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject([\"\\n display: flex;\\n overflow-x: scroll;\\n -ms-overflow-style: none;\\n scrollbar-width: none;\\n position: relative;\\n\\n &::-webkit-scrollbar {\\n display: none;\\n }\\n\"], [\"\\n display: flex;\\n overflow-x: scroll;\\n -ms-overflow-style: none;\\n scrollbar-width: none;\\n position: relative;\\n\\n &::-webkit-scrollbar {\\n display: none;\\n }\\n\"])));\nvar templateObject_1;\n//# sourceMappingURL=styles.js.map"],"names":[],"mappings":";;;AAEU,IAAC,kBAAkB,GAAG,MAAM,CAAC,GAAG,CAAC,gBAAgB,KAAK,gBAAgB,GAAG,oBAAoB,CAAC,CAAC,gLAAgL,CAAC,EAAE,CAAC,gLAAgL,CAAC,CAAC,CAAC,EAAE;AACld,IAAI,gBAAgB;;;;"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
-
import Button from '../../Elements/Button/Button.js';
|
|
3
|
-
import { Modal } from '../Modal/Modal.js';
|
|
4
|
-
import 'react';
|
|
5
|
-
import 'swiper/css';
|
|
6
|
-
import { Swiper, SwiperSlide } from 'swiper/react';
|
|
7
|
-
import { Container, Image, ButtonContainer } from './styles.js';
|
|
8
|
-
|
|
9
|
-
var LightBox = function (_a) {
|
|
10
|
-
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;
|
|
11
|
-
if (!(images === null || images === void 0 ? void 0 : images.length))
|
|
12
|
-
return null;
|
|
13
|
-
return (jsx(Modal, { isShown: isLightBoxOpen, onClose: onCloseLightBox, mobileFullscreen: true, miniCloseBtn: true, withCloseIcon: true, children: jsx(Swiper, { initialSlide: initialSlide, slidesPerView: 1, autoHeight: true, children: images.map(function (item) {
|
|
14
|
-
var _a;
|
|
15
|
-
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));
|
|
16
|
-
}) }) }));
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
export { LightBox };
|
|
20
|
-
//# sourceMappingURL=LightBox.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"LightBox.js","sources":["../../../../../packages/ui/Blocks/LightBox/LightBox.tsx"],"sourcesContent":["import { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport { Button } from '../../Elements/Button';\nimport { Modal } from '../Modal';\nimport 'swiper/css';\nimport { Swiper, SwiperSlide } from 'swiper/react';\nimport { Container, Image, ButtonContainer } from './styles';\nexport var LightBox = function (_a) {\n 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;\n if (!(images === null || images === void 0 ? void 0 : images.length))\n return null;\n return (_jsx(Modal, { isShown: isLightBoxOpen, onClose: onCloseLightBox, mobileFullscreen: true, miniCloseBtn: true, withCloseIcon: true, children: _jsx(Swiper, { initialSlide: initialSlide, slidesPerView: 1, autoHeight: true, children: images.map(function (item) {\n var _a;\n 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));\n }) }) }));\n};\n//# sourceMappingURL=LightBox.js.map"],"names":["_jsx","_jsxs"],"mappings":";;;;;;;;AAMU,IAAC,QAAQ,GAAG,UAAU,EAAE,EAAE;AACpC,IAAI,IAAI,cAAc,GAAG,EAAE,CAAC,cAAc,EAAE,eAAe,GAAG,EAAE,CAAC,eAAe,EAAE,cAAc,GAAG,EAAE,CAAC,cAAc,EAAE,mBAAmB,GAAG,EAAE,CAAC,mBAAmB,EAAE,MAAM,GAAG,EAAE,CAAC,MAAM,EAAE,EAAE,GAAG,EAAE,CAAC,YAAY,EAAE,YAAY,GAAG,EAAE,KAAK,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC;AACpP,IAAI,IAAI,EAAE,MAAM,KAAK,IAAI,IAAI,MAAM,KAAK,KAAK,CAAC,GAAG,KAAK,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC;AACxE,QAAQ,OAAO,IAAI,CAAC;AACpB,IAAI,QAAQA,GAAI,CAAC,KAAK,EAAE,EAAE,OAAO,EAAE,cAAc,EAAE,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE,QAAQ,EAAEA,GAAI,CAAC,MAAM,EAAE,EAAE,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,CAAC,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,CAAC,GAAG,CAAC,UAAU,IAAI,EAAE;AAC5Q,gBAAgB,IAAI,EAAE,CAAC;AACvB,gBAAgB,QAAQA,GAAI,CAAC,WAAW,EAAE,EAAE,QAAQ,EAAEC,IAAK,CAAC,SAAS,EAAE,EAAE,QAAQ,EAAE,CAACD,GAAI,CAAC,KAAK,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,IAAI,CAAC,WAAW,MAAM,IAAI,IAAI,EAAE,KAAK,KAAK,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,kBAAkB,IAAI,cAAc,IAAI,mBAAmB,KAAKA,GAAI,CAAC,eAAe,EAAE,EAAE,QAAQ,EAAEA,GAAI,CAAC,MAAM,EAAE,EAAE,OAAO,EAAE,cAAc,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,UAAU,EAAE,cAAc,EAAE,QAAQ,EAAE,mBAAmB,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,IAAI,CAAC,EAAE,CAAC,EAAE;AACnb,aAAa,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE;AACtB;;;;"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { useCallback } from 'react';
|
|
2
|
-
import '../../Modal/Modal.js';
|
|
3
|
-
import { useModal } from '../../Modal/hooks/useModal.js';
|
|
4
|
-
|
|
5
|
-
var useLightBox = function () {
|
|
6
|
-
var _a = useModal(), isOpen = _a.isOpen, onOpen = _a.onOpen, onClose = _a.onClose, data = _a.data;
|
|
7
|
-
var onOpenLightBox = useCallback(function (index) {
|
|
8
|
-
if (index === void 0) { index = 0; }
|
|
9
|
-
return function () {
|
|
10
|
-
onOpen({ initialSlide: index });
|
|
11
|
-
};
|
|
12
|
-
}, [onOpen]);
|
|
13
|
-
return {
|
|
14
|
-
onOpenLightBox: onOpenLightBox,
|
|
15
|
-
onCloseLightBox: onClose,
|
|
16
|
-
isLightBoxOpen: isOpen,
|
|
17
|
-
lightBoxData: data
|
|
18
|
-
};
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
export { useLightBox };
|
|
22
|
-
//# sourceMappingURL=useLightBox.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useLightBox.js","sources":["../../../../../../packages/ui/Blocks/LightBox/hooks/useLightBox.ts"],"sourcesContent":["import { useCallback } from 'react';\nimport { useModal } from '../../Modal';\nexport var useLightBox = function () {\n var _a = useModal(), isOpen = _a.isOpen, onOpen = _a.onOpen, onClose = _a.onClose, data = _a.data;\n var onOpenLightBox = useCallback(function (index) {\n if (index === void 0) { index = 0; }\n return function () {\n onOpen({ initialSlide: index });\n };\n }, [onOpen]);\n return {\n onOpenLightBox: onOpenLightBox,\n onCloseLightBox: onClose,\n isLightBoxOpen: isOpen,\n lightBoxData: data\n };\n};\n//# sourceMappingURL=useLightBox.js.map"],"names":[],"mappings":";;;;AAEU,IAAC,WAAW,GAAG,YAAY;AACrC,IAAI,IAAI,EAAE,GAAG,QAAQ,EAAE,EAAE,MAAM,GAAG,EAAE,CAAC,MAAM,EAAE,MAAM,GAAG,EAAE,CAAC,MAAM,EAAE,OAAO,GAAG,EAAE,CAAC,OAAO,EAAE,IAAI,GAAG,EAAE,CAAC,IAAI,CAAC;AACtG,IAAI,IAAI,cAAc,GAAG,WAAW,CAAC,UAAU,KAAK,EAAE;AACtD,QAAQ,IAAI,KAAK,KAAK,KAAK,CAAC,EAAE,EAAE,KAAK,GAAG,CAAC,CAAC,EAAE;AAC5C,QAAQ,OAAO,YAAY;AAC3B,YAAY,MAAM,CAAC,EAAE,YAAY,EAAE,KAAK,EAAE,CAAC,CAAC;AAC5C,SAAS,CAAC;AACV,KAAK,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;AACjB,IAAI,OAAO;AACX,QAAQ,cAAc,EAAE,cAAc;AACtC,QAAQ,eAAe,EAAE,OAAO;AAChC,QAAQ,cAAc,EAAE,MAAM;AAC9B,QAAQ,YAAY,EAAE,IAAI;AAC1B,KAAK,CAAC;AACN;;;;"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { __makeTemplateObject } from '../../../../node_modules/tslib/tslib.es6.js';
|
|
2
|
-
import styled from '@xstyled/styled-components';
|
|
3
|
-
|
|
4
|
-
var Container = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n width: 100%;\n height: 100%;\n position: relative;\n"], ["\n width: 100%;\n height: 100%;\n position: relative;\n"])));
|
|
5
|
-
var Image = styled.img(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n width: 100%;\n height: 100%;\n"], ["\n width: 100%;\n height: 100%;\n"])));
|
|
6
|
-
var ButtonContainer = styled.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n width: 100%;\n display: flex;\n justify-content: center;\n position: absolute;\n bottom: -60px;\n"], ["\n width: 100%;\n display: flex;\n justify-content: center;\n position: absolute;\n bottom: -60px;\n"])));
|
|
7
|
-
var templateObject_1, templateObject_2, templateObject_3;
|
|
8
|
-
|
|
9
|
-
export { ButtonContainer, Container, Image };
|
|
10
|
-
//# sourceMappingURL=styles.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","sources":["../../../../../packages/ui/Blocks/LightBox/styles.ts"],"sourcesContent":["import { __makeTemplateObject } from \"tslib\";\nimport styled from '@xstyled/styled-components';\nexport var Container = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject([\"\\n width: 100%;\\n height: 100%;\\n position: relative;\\n\"], [\"\\n width: 100%;\\n height: 100%;\\n position: relative;\\n\"])));\nexport var Image = styled.img(templateObject_2 || (templateObject_2 = __makeTemplateObject([\"\\n width: 100%;\\n height: 100%;\\n\"], [\"\\n width: 100%;\\n height: 100%;\\n\"])));\nexport var ButtonContainer = styled.div(templateObject_3 || (templateObject_3 = __makeTemplateObject([\"\\n width: 100%;\\n display: flex;\\n justify-content: center;\\n position: absolute;\\n bottom: -60px;\\n\"], [\"\\n width: 100%;\\n display: flex;\\n justify-content: center;\\n position: absolute;\\n bottom: -60px;\\n\"])));\nvar templateObject_1, templateObject_2, templateObject_3;\n//# sourceMappingURL=styles.js.map"],"names":[],"mappings":";;;AAEU,IAAC,SAAS,GAAG,MAAM,CAAC,GAAG,CAAC,gBAAgB,KAAK,gBAAgB,GAAG,oBAAoB,CAAC,CAAC,4DAA4D,CAAC,EAAE,CAAC,4DAA4D,CAAC,CAAC,CAAC,EAAE;AACvN,IAAC,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,gBAAgB,KAAK,gBAAgB,GAAG,oBAAoB,CAAC,CAAC,qCAAqC,CAAC,EAAE,CAAC,qCAAqC,CAAC,CAAC,CAAC,EAAE;AACrK,IAAC,eAAe,GAAG,MAAM,CAAC,GAAG,CAAC,gBAAgB,KAAK,gBAAgB,GAAG,oBAAoB,CAAC,CAAC,2GAA2G,CAAC,EAAE,CAAC,2GAA2G,CAAC,CAAC,CAAC,EAAE;AACrU,IAAI,gBAAgB,EAAE,gBAAgB,EAAE,gBAAgB;;;;"}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
-
import { memo, useCallback, useMemo, useEffect } from 'react';
|
|
3
|
-
import Icon from '../../Elements/Icon/Icon.js';
|
|
4
|
-
import '../../../../node_modules/tslib/tslib.es6.js';
|
|
5
|
-
import { DialogOverlay, DialogWindow, HeaderContainer, TitleContainer, H4, ContentContainer, ButtonsContainer, CloseButton } from './styles.js';
|
|
6
|
-
import { x } from '@xstyled/styled-components';
|
|
7
|
-
import Button from '../../Elements/Button/Button.js';
|
|
8
|
-
import { Portal } from '../../Elements/Portal/index.js';
|
|
9
|
-
import { useClickOutside } from './hooks/useClickOutside.js';
|
|
10
|
-
import { widthMap, topSpaceMap } from './utils.js';
|
|
11
|
-
|
|
12
|
-
var Modal = memo(function (_a) {
|
|
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, _d = _a.topSpace, topSpace = _d === void 0 ? 'default' : _d, onClose = _a.onClose, _e = _a.hasFooter, hasFooter = _e === void 0 ? true : _e, _f = _a.hasHeader, hasHeader = _f === void 0 ? true : _f, _g = _a.whiteBg, whiteBg = _g === void 0 ? false : _g, _h = _a.miniCloseBtn, miniCloseBtn = _h === void 0 ? false : _h, _j = _a.ignoreClickOutside, ignoreClickOutside = _j === void 0 ? false : _j, _k = _a.closeEverywhere, closeEverywhere = _k === void 0 ? false : _k, _l = _a.withCloseIcon, withCloseIcon = _l === void 0 ? true : _l, _m = _a.mobileFullscreen, mobileFullscreen = _m === void 0 ? false : _m, overlayColor = _a.overlayColor, minWidth = _a.minWidth, minHeight = _a.minHeight, maxWidth = _a.maxWidth, maxHeight = _a.maxHeight;
|
|
14
|
-
var closeDialog = useCallback(function () {
|
|
15
|
-
if (onClose) {
|
|
16
|
-
onClose();
|
|
17
|
-
}
|
|
18
|
-
else if (onCancel) {
|
|
19
|
-
onCancel();
|
|
20
|
-
}
|
|
21
|
-
}, [onClose, onCancel]);
|
|
22
|
-
var dialogStyle = useMemo(function () { return ({ width: widthMap[width] }); }, [width]);
|
|
23
|
-
var dialogRef = useClickOutside({ onClose: closeDialog, ignoreClickOutside: ignoreClickOutside, closeCurrent: true, allowScrollbarClick: true });
|
|
24
|
-
var onDialogConfirmClick = useCallback(function () {
|
|
25
|
-
onConfirm === null || onConfirm === void 0 ? void 0 : onConfirm(closeDialog);
|
|
26
|
-
}, [onConfirm, closeDialog]);
|
|
27
|
-
useEffect(function () {
|
|
28
|
-
window.addEventListener('popstate', closeDialog);
|
|
29
|
-
return function () {
|
|
30
|
-
window.removeEventListener('popstate', closeDialog);
|
|
31
|
-
};
|
|
32
|
-
}, []);
|
|
33
|
-
if (!isShown) {
|
|
34
|
-
return null;
|
|
35
|
-
}
|
|
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, "$mobileFullscreen": mobileFullscreen, children: [title && hasHeader && (jsx(HeaderContainer, { topSpace: topSpaceMap[topSpace], children: jsxs(TitleContainer, { children: [titleIcon && (jsx(x.div, { as: "span", className: "icon", children: typeof titleIcon === 'string' ? jsx(Icon, { icon: titleIcon, fill: "blue2" }) : titleIcon })), jsx(H4, { children: title })] }) })), jsx(ContentContainer, { topSpace: topSpaceMap[topSpace], "$mobileFullscreen": mobileFullscreen, 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' }))] })), hasHeader && !closeEverywhere && withCloseIcon && (jsx(CloseButton, { onClick: closeDialog, "data-cy": "dialogCloseBtn", children: jsx(Icon, { icon: "close", size: miniCloseBtn ? '20px' : '26px' }) }))] }) }) }));
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
export { Modal };
|
|
40
|
-
//# sourceMappingURL=Modal.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Modal.js","sources":["../../../../../packages/ui/Blocks/Modal/Modal.tsx"],"sourcesContent":["import { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport { memo, useCallback, useMemo, useEffect } from 'react';\nimport { Icon } from '../../Elements/Icon';\nimport { DialogOverlay, DialogWindow, HeaderContainer, ButtonsContainer, ContentContainer, TitleContainer, CloseButton, H4, } from './styles';\nimport { x } from '@xstyled/styled-components';\nimport { Button } from '../../Elements/Button';\nimport { Portal } from '../../Elements/Portal';\nimport { useClickOutside } from './hooks/useClickOutside';\nimport { topSpaceMap, widthMap } from './utils';\nexport var Modal = memo(function (_a) {\n 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, _d = _a.topSpace, topSpace = _d === void 0 ? 'default' : _d, onClose = _a.onClose, _e = _a.hasFooter, hasFooter = _e === void 0 ? true : _e, _f = _a.hasHeader, hasHeader = _f === void 0 ? true : _f, _g = _a.whiteBg, whiteBg = _g === void 0 ? false : _g, _h = _a.miniCloseBtn, miniCloseBtn = _h === void 0 ? false : _h, _j = _a.ignoreClickOutside, ignoreClickOutside = _j === void 0 ? false : _j, _k = _a.closeEverywhere, closeEverywhere = _k === void 0 ? false : _k, _l = _a.withCloseIcon, withCloseIcon = _l === void 0 ? true : _l, _m = _a.mobileFullscreen, mobileFullscreen = _m === void 0 ? false : _m, overlayColor = _a.overlayColor, minWidth = _a.minWidth, minHeight = _a.minHeight, maxWidth = _a.maxWidth, maxHeight = _a.maxHeight;\n var closeDialog = useCallback(function () {\n if (onClose) {\n onClose();\n }\n else if (onCancel) {\n onCancel();\n }\n }, [onClose, onCancel]);\n var dialogStyle = useMemo(function () { return ({ width: widthMap[width] }); }, [width]);\n var dialogRef = useClickOutside({ onClose: closeDialog, ignoreClickOutside: ignoreClickOutside, closeCurrent: true, allowScrollbarClick: true });\n var onDialogConfirmClick = useCallback(function () {\n onConfirm === null || onConfirm === void 0 ? void 0 : onConfirm(closeDialog);\n }, [onConfirm, closeDialog]);\n useEffect(function () {\n window.addEventListener('popstate', closeDialog);\n return function () {\n window.removeEventListener('popstate', closeDialog);\n };\n }, []);\n if (!isShown) {\n return null;\n }\n 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, \"$mobileFullscreen\": mobileFullscreen, children: [title && hasHeader && (_jsx(HeaderContainer, { topSpace: topSpaceMap[topSpace], children: _jsxs(TitleContainer, { children: [titleIcon && (_jsx(x.div, { as: \"span\", className: \"icon\", children: typeof titleIcon === 'string' ? _jsx(Icon, { icon: titleIcon, fill: \"blue2\" }) : titleIcon })), _jsx(H4, { children: title })] }) })), _jsx(ContentContainer, { topSpace: topSpaceMap[topSpace], \"$mobileFullscreen\": mobileFullscreen, 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' }))] })), hasHeader && !closeEverywhere && withCloseIcon && (_jsx(CloseButton, { onClick: closeDialog, \"data-cy\": \"dialogCloseBtn\", children: _jsx(Icon, { icon: \"close\", size: miniCloseBtn ? '20px' : '26px' }) }))] }) }) }));\n});\n//# source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AAE,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE;AACzgD,CAAC;;;;"}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { useRef, useCallback, useEffect } from 'react';
|
|
2
|
-
|
|
3
|
-
var useClickOutside = function (_a) {
|
|
4
|
-
var onClose = _a.onClose, parentRef = _a.parentRef, _b = _a.ignoreClickOutside, ignoreClickOutside = _b === void 0 ? false : _b, _c = _a.closeCurrent, closeCurrent = _c === void 0 ? false : _c, _d = _a.allowScrollbarClick, allowScrollbarClick = _d === void 0 ? false : _d;
|
|
5
|
-
var elementRef = useRef(null);
|
|
6
|
-
var onCloseModal = !ignoreClickOutside ? onClose : undefined;
|
|
7
|
-
var handleClickOutside = useCallback(function (e) {
|
|
8
|
-
var _a;
|
|
9
|
-
var ignoreEvent = allowScrollbarClick && e.offsetX > e.target.clientWidth;
|
|
10
|
-
if (!ignoreEvent &&
|
|
11
|
-
elementRef.current &&
|
|
12
|
-
!elementRef.current.contains(e.target) &&
|
|
13
|
-
!((_a = parentRef === null || parentRef === void 0 ? void 0 : parentRef.current) === null || _a === void 0 ? void 0 : _a.contains(e.target))) {
|
|
14
|
-
closeCurrent ? e.target.contains(elementRef.current) && (onCloseModal === null || onCloseModal === void 0 ? void 0 : onCloseModal()) : onCloseModal === null || onCloseModal === void 0 ? void 0 : onCloseModal();
|
|
15
|
-
}
|
|
16
|
-
}, [allowScrollbarClick, parentRef, closeCurrent, onCloseModal]);
|
|
17
|
-
var keyPress = useCallback(function (e) {
|
|
18
|
-
if (e.key === 'Escape') {
|
|
19
|
-
onCloseModal === null || onCloseModal === void 0 ? void 0 : onCloseModal();
|
|
20
|
-
}
|
|
21
|
-
}, [onCloseModal]);
|
|
22
|
-
useEffect(function () {
|
|
23
|
-
document.addEventListener('mousedown', handleClickOutside);
|
|
24
|
-
document.addEventListener('keydown', keyPress);
|
|
25
|
-
return function () {
|
|
26
|
-
document.removeEventListener('mousedown', handleClickOutside);
|
|
27
|
-
document.removeEventListener('keydown', keyPress);
|
|
28
|
-
};
|
|
29
|
-
}, [handleClickOutside, keyPress]);
|
|
30
|
-
return elementRef;
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
export { useClickOutside };
|
|
34
|
-
//# sourceMappingURL=useClickOutside.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useClickOutside.js","sources":["../../../../../../packages/ui/Blocks/Modal/hooks/useClickOutside.ts"],"sourcesContent":["import { useCallback, useEffect, useRef } from 'react';\nexport var useClickOutside = function (_a) {\n var onClose = _a.onClose, parentRef = _a.parentRef, _b = _a.ignoreClickOutside, ignoreClickOutside = _b === void 0 ? false : _b, _c = _a.closeCurrent, closeCurrent = _c === void 0 ? false : _c, _d = _a.allowScrollbarClick, allowScrollbarClick = _d === void 0 ? false : _d;\n var elementRef = useRef(null);\n var onCloseModal = !ignoreClickOutside ? onClose : undefined;\n var handleClickOutside = useCallback(function (e) {\n var _a;\n var ignoreEvent = allowScrollbarClick && e.offsetX > e.target.clientWidth;\n if (!ignoreEvent &&\n elementRef.current &&\n !elementRef.current.contains(e.target) &&\n !((_a = parentRef === null || parentRef === void 0 ? void 0 : parentRef.current) === null || _a === void 0 ? void 0 : _a.contains(e.target))) {\n closeCurrent ? e.target.contains(elementRef.current) && (onCloseModal === null || onCloseModal === void 0 ? void 0 : onCloseModal()) : onCloseModal === null || onCloseModal === void 0 ? void 0 : onCloseModal();\n }\n }, [allowScrollbarClick, parentRef, closeCurrent, onCloseModal]);\n var keyPress = useCallback(function (e) {\n if (e.key === 'Escape') {\n onCloseModal === null || onCloseModal === void 0 ? void 0 : onCloseModal();\n }\n }, [onCloseModal]);\n useEffect(function () {\n document.addEventListener('mousedown', handleClickOutside);\n document.addEventListener('keydown', keyPress);\n return function () {\n document.removeEventListener('mousedown', handleClickOutside);\n document.removeEventListener('keydown', keyPress);\n };\n }, [handleClickOutside, keyPress]);\n return elementRef;\n};\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