@snack-uikit/drawer 0.8.9 → 0.8.10-preview-d96c83e8.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/dist/cjs/components/Drawer/Drawer.js +84 -0
- package/dist/cjs/components/Drawer/index.js +25 -0
- package/dist/cjs/components/DrawerCustom/DrawerCustom.js +76 -0
- package/dist/cjs/components/DrawerCustom/constants.js +19 -0
- package/dist/cjs/components/DrawerCustom/index.js +25 -0
- package/dist/cjs/components/index.js +26 -0
- package/dist/cjs/constants.js +35 -0
- package/dist/cjs/helperComponents/Body/Body.js +39 -0
- package/dist/cjs/helperComponents/Body/index.js +25 -0
- package/dist/cjs/helperComponents/ButtonClose/ButtonClose.js +28 -0
- package/dist/cjs/helperComponents/ButtonClose/index.js +25 -0
- package/dist/cjs/helperComponents/Footer/Footer.js +41 -0
- package/dist/cjs/helperComponents/Footer/index.js +25 -0
- package/dist/cjs/helperComponents/Header/Header.js +65 -0
- package/dist/cjs/helperComponents/Header/index.js +25 -0
- package/dist/cjs/helperComponents/WithTooltip/WithTooltip.js +22 -0
- package/dist/cjs/helperComponents/WithTooltip/index.js +25 -0
- package/dist/cjs/helperComponents/index.js +28 -0
- package/dist/cjs/index.js +25 -0
- package/dist/cjs/types.js +5 -0
- package/dist/esm/components/Drawer/Drawer.d.ts +40 -0
- package/dist/esm/components/Drawer/index.js +1 -0
- package/dist/esm/components/DrawerCustom/DrawerCustom.d.ts +41 -0
- package/dist/esm/components/DrawerCustom/constants.d.ts +5 -0
- package/dist/esm/components/DrawerCustom/index.js +1 -0
- package/dist/esm/components/index.js +2 -0
- package/dist/esm/constants.d.ts +29 -0
- package/dist/esm/helperComponents/Body/Body.d.ts +10 -0
- package/dist/esm/helperComponents/Body/index.js +1 -0
- package/dist/esm/helperComponents/ButtonClose/ButtonClose.d.ts +5 -0
- package/dist/esm/helperComponents/ButtonClose/index.js +1 -0
- package/dist/esm/helperComponents/Footer/Footer.d.ts +10 -0
- package/dist/esm/helperComponents/Footer/index.js +1 -0
- package/dist/esm/helperComponents/Header/Header.d.ts +20 -0
- package/dist/esm/helperComponents/Header/index.js +1 -0
- package/dist/esm/helperComponents/WithTooltip/WithTooltip.d.ts +8 -0
- package/dist/esm/helperComponents/WithTooltip/index.js +1 -0
- package/dist/esm/helperComponents/index.js +4 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/types.d.ts +5 -0
- package/package.json +14 -12
- package/dist/components/Drawer/styles.module.css +0 -3
- package/dist/components/DrawerCustom/motion.css +0 -63
- package/dist/components/DrawerCustom/styles.module.css +0 -53
- package/dist/helperComponents/Body/styles.module.css +0 -8
- package/dist/helperComponents/ButtonClose/styles.module.css +0 -35
- package/dist/helperComponents/Footer/styles.module.css +0 -17
- package/dist/helperComponents/Header/styles.module.css +0 -35
- /package/dist/{components → cjs/components}/Drawer/Drawer.d.ts +0 -0
- /package/dist/{components → cjs/components}/Drawer/index.d.ts +0 -0
- /package/dist/{components → cjs/components}/DrawerCustom/DrawerCustom.d.ts +0 -0
- /package/dist/{components → cjs/components}/DrawerCustom/constants.d.ts +0 -0
- /package/dist/{components → cjs/components}/DrawerCustom/index.d.ts +0 -0
- /package/dist/{components → cjs/components}/index.d.ts +0 -0
- /package/dist/{constants.d.ts → cjs/constants.d.ts} +0 -0
- /package/dist/{helperComponents → cjs/helperComponents}/Body/Body.d.ts +0 -0
- /package/dist/{helperComponents → cjs/helperComponents}/Body/index.d.ts +0 -0
- /package/dist/{helperComponents → cjs/helperComponents}/ButtonClose/ButtonClose.d.ts +0 -0
- /package/dist/{helperComponents → cjs/helperComponents}/ButtonClose/index.d.ts +0 -0
- /package/dist/{helperComponents → cjs/helperComponents}/Footer/Footer.d.ts +0 -0
- /package/dist/{helperComponents → cjs/helperComponents}/Footer/index.d.ts +0 -0
- /package/dist/{helperComponents → cjs/helperComponents}/Header/Header.d.ts +0 -0
- /package/dist/{helperComponents → cjs/helperComponents}/Header/index.d.ts +0 -0
- /package/dist/{helperComponents → cjs/helperComponents}/WithTooltip/WithTooltip.d.ts +0 -0
- /package/dist/{helperComponents → cjs/helperComponents}/WithTooltip/index.d.ts +0 -0
- /package/dist/{helperComponents → cjs/helperComponents}/index.d.ts +0 -0
- /package/dist/{index.d.ts → cjs/index.d.ts} +0 -0
- /package/dist/{types.d.ts → cjs/types.d.ts} +0 -0
- /package/dist/{components → esm/components}/Drawer/Drawer.js +0 -0
- /package/dist/{components/Drawer/index.js → esm/components/Drawer/index.d.ts} +0 -0
- /package/dist/{components → esm/components}/DrawerCustom/DrawerCustom.js +0 -0
- /package/dist/{components → esm/components}/DrawerCustom/constants.js +0 -0
- /package/dist/{components/DrawerCustom/index.js → esm/components/DrawerCustom/index.d.ts} +0 -0
- /package/dist/{components/index.js → esm/components/index.d.ts} +0 -0
- /package/dist/{constants.js → esm/constants.js} +0 -0
- /package/dist/{helperComponents → esm/helperComponents}/Body/Body.js +0 -0
- /package/dist/{helperComponents/Body/index.js → esm/helperComponents/Body/index.d.ts} +0 -0
- /package/dist/{helperComponents → esm/helperComponents}/ButtonClose/ButtonClose.js +0 -0
- /package/dist/{helperComponents/ButtonClose/index.js → esm/helperComponents/ButtonClose/index.d.ts} +0 -0
- /package/dist/{helperComponents → esm/helperComponents}/Footer/Footer.js +0 -0
- /package/dist/{helperComponents/Footer/index.js → esm/helperComponents/Footer/index.d.ts} +0 -0
- /package/dist/{helperComponents → esm/helperComponents}/Header/Header.js +0 -0
- /package/dist/{helperComponents/Header/index.js → esm/helperComponents/Header/index.d.ts} +0 -0
- /package/dist/{helperComponents → esm/helperComponents}/WithTooltip/WithTooltip.js +0 -0
- /package/dist/{helperComponents/WithTooltip/index.js → esm/helperComponents/WithTooltip/index.d.ts} +0 -0
- /package/dist/{helperComponents/index.js → esm/helperComponents/index.d.ts} +0 -0
- /package/dist/{index.js → esm/index.d.ts} +0 -0
- /package/dist/{types.js → esm/types.js} +0 -0
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var __rest = void 0 && (void 0).__rest || function (s, e) {
|
|
4
|
+
var t = {};
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", {
|
|
12
|
+
value: true
|
|
13
|
+
});
|
|
14
|
+
exports.Drawer = Drawer;
|
|
15
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
16
|
+
const button_1 = require("@snack-uikit/button");
|
|
17
|
+
const truncate_string_1 = require("@snack-uikit/truncate-string");
|
|
18
|
+
const constants_1 = require("../../constants");
|
|
19
|
+
const WithTooltip_1 = require("../../helperComponents/WithTooltip");
|
|
20
|
+
const DrawerCustom_1 = require("../DrawerCustom");
|
|
21
|
+
/** Готовый компонент Drawer */
|
|
22
|
+
function Drawer(_a) {
|
|
23
|
+
var {
|
|
24
|
+
title,
|
|
25
|
+
titleTooltip,
|
|
26
|
+
subtitle,
|
|
27
|
+
image,
|
|
28
|
+
content,
|
|
29
|
+
approveButton,
|
|
30
|
+
cancelButton,
|
|
31
|
+
additionalButton,
|
|
32
|
+
nestedDrawer,
|
|
33
|
+
truncate
|
|
34
|
+
} = _a,
|
|
35
|
+
rest = __rest(_a, ["title", "titleTooltip", "subtitle", "image", "content", "approveButton", "cancelButton", "additionalButton", "nestedDrawer", "truncate"]);
|
|
36
|
+
const needFooter = Boolean(approveButton) || Boolean(cancelButton) || Boolean(additionalButton);
|
|
37
|
+
return (0, jsx_runtime_1.jsxs)(DrawerCustom_1.DrawerCustom, Object.assign({}, rest, {
|
|
38
|
+
push: Boolean(nestedDrawer) && {
|
|
39
|
+
distance: constants_1.NESTED_DRAWER_PUSH_DISTANCE
|
|
40
|
+
},
|
|
41
|
+
children: [(0, jsx_runtime_1.jsx)(DrawerCustom_1.DrawerCustom.Header, {
|
|
42
|
+
title: (0, jsx_runtime_1.jsx)(truncate_string_1.TruncateString, {
|
|
43
|
+
text: title,
|
|
44
|
+
maxLines: (truncate === null || truncate === void 0 ? void 0 : truncate.title) || 1
|
|
45
|
+
}),
|
|
46
|
+
titleTooltip: titleTooltip,
|
|
47
|
+
subtitle: subtitle ? (0, jsx_runtime_1.jsx)(truncate_string_1.TruncateString, {
|
|
48
|
+
text: subtitle,
|
|
49
|
+
maxLines: (truncate === null || truncate === void 0 ? void 0 : truncate.subtitle) || 2
|
|
50
|
+
}) : undefined,
|
|
51
|
+
image: image,
|
|
52
|
+
"data-test-id": constants_1.TEST_IDS.header
|
|
53
|
+
}), (0, jsx_runtime_1.jsx)(DrawerCustom_1.DrawerCustom.Body, {
|
|
54
|
+
content: content,
|
|
55
|
+
"data-test-id": constants_1.TEST_IDS.content
|
|
56
|
+
}), needFooter && (0, jsx_runtime_1.jsx)(DrawerCustom_1.DrawerCustom.Footer, {
|
|
57
|
+
"data-test-id": constants_1.TEST_IDS.footer,
|
|
58
|
+
actions: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, {
|
|
59
|
+
children: [approveButton && (0, jsx_runtime_1.jsx)(WithTooltip_1.WithTooltip, {
|
|
60
|
+
tooltip: approveButton.tooltip,
|
|
61
|
+
children: (0, jsx_runtime_1.jsx)(button_1.ButtonFilled, Object.assign({
|
|
62
|
+
appearance: 'primary',
|
|
63
|
+
size: 'm',
|
|
64
|
+
"data-test-id": constants_1.TEST_IDS.approveButton
|
|
65
|
+
}, approveButton))
|
|
66
|
+
}), cancelButton && (0, jsx_runtime_1.jsx)(WithTooltip_1.WithTooltip, {
|
|
67
|
+
tooltip: cancelButton.tooltip,
|
|
68
|
+
children: (0, jsx_runtime_1.jsx)(button_1.ButtonOutline, Object.assign({
|
|
69
|
+
appearance: 'neutral',
|
|
70
|
+
size: 'm',
|
|
71
|
+
"data-test-id": constants_1.TEST_IDS.cancelButton
|
|
72
|
+
}, cancelButton))
|
|
73
|
+
}), additionalButton && (0, jsx_runtime_1.jsx)(WithTooltip_1.WithTooltip, {
|
|
74
|
+
tooltip: additionalButton.tooltip,
|
|
75
|
+
children: (0, jsx_runtime_1.jsx)(button_1.ButtonSimple, Object.assign({
|
|
76
|
+
appearance: 'neutral',
|
|
77
|
+
size: 'm',
|
|
78
|
+
"data-test-id": constants_1.TEST_IDS.additionalButton
|
|
79
|
+
}, additionalButton))
|
|
80
|
+
})]
|
|
81
|
+
})
|
|
82
|
+
}), nestedDrawer]
|
|
83
|
+
}));
|
|
84
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var __createBinding = void 0 && (void 0).__createBinding || (Object.create ? function (o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: function () {
|
|
10
|
+
return m[k];
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
Object.defineProperty(o, k2, desc);
|
|
15
|
+
} : function (o, m, k, k2) {
|
|
16
|
+
if (k2 === undefined) k2 = k;
|
|
17
|
+
o[k2] = m[k];
|
|
18
|
+
});
|
|
19
|
+
var __exportStar = void 0 && (void 0).__exportStar || function (m, exports) {
|
|
20
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
21
|
+
};
|
|
22
|
+
Object.defineProperty(exports, "__esModule", {
|
|
23
|
+
value: true
|
|
24
|
+
});
|
|
25
|
+
__exportStar(require("./Drawer"), exports);
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var __rest = void 0 && (void 0).__rest || function (s, e) {
|
|
4
|
+
var t = {};
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = void 0 && (void 0).__importDefault || function (mod) {
|
|
12
|
+
return mod && mod.__esModule ? mod : {
|
|
13
|
+
"default": mod
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", {
|
|
17
|
+
value: true
|
|
18
|
+
});
|
|
19
|
+
exports.DrawerCustom = void 0;
|
|
20
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
21
|
+
const classnames_1 = __importDefault(require("classnames"));
|
|
22
|
+
const rc_drawer_1 = __importDefault(require("rc-drawer"));
|
|
23
|
+
const utils_1 = require("@snack-uikit/utils");
|
|
24
|
+
const constants_1 = require("../../constants");
|
|
25
|
+
const helperComponents_1 = require("../../helperComponents");
|
|
26
|
+
const constants_2 = require("./constants");
|
|
27
|
+
const styles_module_scss_1 = __importDefault({});
|
|
28
|
+
function DrawerCustomComponent(_a) {
|
|
29
|
+
var {
|
|
30
|
+
open,
|
|
31
|
+
mode = constants_1.MODE.Regular,
|
|
32
|
+
position = constants_1.POSITION.Right,
|
|
33
|
+
onClose,
|
|
34
|
+
rootClassName,
|
|
35
|
+
className,
|
|
36
|
+
size = constants_1.SIZE.S,
|
|
37
|
+
push,
|
|
38
|
+
container,
|
|
39
|
+
children,
|
|
40
|
+
nestedDrawer
|
|
41
|
+
} = _a,
|
|
42
|
+
rest = __rest(_a, ["open", "mode", "position", "onClose", "rootClassName", "className", "size", "push", "container", "children", "nestedDrawer"]);
|
|
43
|
+
const isRegular = mode === constants_1.MODE.Regular;
|
|
44
|
+
const isPredefinedSize = typeof size === 'string' && constants_1.SIZE_AS_VALUES.includes(size);
|
|
45
|
+
return (0, jsx_runtime_1.jsxs)(rc_drawer_1.default, Object.assign({
|
|
46
|
+
mask: isRegular,
|
|
47
|
+
maskClosable: isRegular,
|
|
48
|
+
maskClassName: styles_module_scss_1.default.mask,
|
|
49
|
+
keyboard: isRegular,
|
|
50
|
+
width: isPredefinedSize ? 'null' : size,
|
|
51
|
+
open: open,
|
|
52
|
+
placement: position,
|
|
53
|
+
destroyOnClose: true,
|
|
54
|
+
push: push,
|
|
55
|
+
onClose: onClose,
|
|
56
|
+
getContainer: container,
|
|
57
|
+
className: (0, classnames_1.default)(styles_module_scss_1.default.drawer, className),
|
|
58
|
+
rootClassName: (0, classnames_1.default)(styles_module_scss_1.default.drawerRoot, rootClassName)
|
|
59
|
+
}, (0, utils_1.extractSupportProps)(rest), {
|
|
60
|
+
"data-content-wrapper": true,
|
|
61
|
+
"data-size": isPredefinedSize ? size : undefined,
|
|
62
|
+
"data-mode": mode
|
|
63
|
+
}, constants_2.motionProps, {
|
|
64
|
+
children: [(0, jsx_runtime_1.jsx)("div", {
|
|
65
|
+
className: styles_module_scss_1.default.headerElements,
|
|
66
|
+
children: (0, jsx_runtime_1.jsx)(helperComponents_1.ButtonClose, {
|
|
67
|
+
onClick: onClose
|
|
68
|
+
})
|
|
69
|
+
}), children, nestedDrawer]
|
|
70
|
+
}));
|
|
71
|
+
}
|
|
72
|
+
/** Компонент-конструктор */
|
|
73
|
+
exports.DrawerCustom = DrawerCustomComponent;
|
|
74
|
+
exports.DrawerCustom.Header = helperComponents_1.DrawerHeader;
|
|
75
|
+
exports.DrawerCustom.Body = helperComponents_1.DrawerBody;
|
|
76
|
+
exports.DrawerCustom.Footer = helperComponents_1.DrawerFooter;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.motionProps = exports.motion = exports.maskMotion = void 0;
|
|
7
|
+
exports.maskMotion = {
|
|
8
|
+
motionAppear: true,
|
|
9
|
+
motionName: 'maskMotion'
|
|
10
|
+
};
|
|
11
|
+
const motion = placement => ({
|
|
12
|
+
motionAppear: true,
|
|
13
|
+
motionName: `panelMotion-${placement}`
|
|
14
|
+
});
|
|
15
|
+
exports.motion = motion;
|
|
16
|
+
exports.motionProps = {
|
|
17
|
+
maskMotion: exports.maskMotion,
|
|
18
|
+
motion: exports.motion
|
|
19
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var __createBinding = void 0 && (void 0).__createBinding || (Object.create ? function (o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: function () {
|
|
10
|
+
return m[k];
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
Object.defineProperty(o, k2, desc);
|
|
15
|
+
} : function (o, m, k, k2) {
|
|
16
|
+
if (k2 === undefined) k2 = k;
|
|
17
|
+
o[k2] = m[k];
|
|
18
|
+
});
|
|
19
|
+
var __exportStar = void 0 && (void 0).__exportStar || function (m, exports) {
|
|
20
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
21
|
+
};
|
|
22
|
+
Object.defineProperty(exports, "__esModule", {
|
|
23
|
+
value: true
|
|
24
|
+
});
|
|
25
|
+
__exportStar(require("./DrawerCustom"), exports);
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var __createBinding = void 0 && (void 0).__createBinding || (Object.create ? function (o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: function () {
|
|
10
|
+
return m[k];
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
Object.defineProperty(o, k2, desc);
|
|
15
|
+
} : function (o, m, k, k2) {
|
|
16
|
+
if (k2 === undefined) k2 = k;
|
|
17
|
+
o[k2] = m[k];
|
|
18
|
+
});
|
|
19
|
+
var __exportStar = void 0 && (void 0).__exportStar || function (m, exports) {
|
|
20
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
21
|
+
};
|
|
22
|
+
Object.defineProperty(exports, "__esModule", {
|
|
23
|
+
value: true
|
|
24
|
+
});
|
|
25
|
+
__exportStar(require("./DrawerCustom"), exports);
|
|
26
|
+
__exportStar(require("./Drawer"), exports);
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.TEST_IDS = exports.NESTED_DRAWER_PUSH_DISTANCE = exports.POSITION = exports.MODE = exports.SIZE_AS_VALUES = exports.SIZE = void 0;
|
|
7
|
+
exports.SIZE = {
|
|
8
|
+
S: 's',
|
|
9
|
+
M: 'm',
|
|
10
|
+
L: 'l'
|
|
11
|
+
};
|
|
12
|
+
exports.SIZE_AS_VALUES = Object.values(exports.SIZE);
|
|
13
|
+
exports.MODE = {
|
|
14
|
+
Regular: 'regular',
|
|
15
|
+
Soft: 'soft'
|
|
16
|
+
};
|
|
17
|
+
exports.POSITION = {
|
|
18
|
+
Right: 'right',
|
|
19
|
+
Left: 'left'
|
|
20
|
+
};
|
|
21
|
+
exports.NESTED_DRAWER_PUSH_DISTANCE = 24;
|
|
22
|
+
exports.TEST_IDS = {
|
|
23
|
+
closeButton: 'drawer__close-button',
|
|
24
|
+
header: 'drawer__header',
|
|
25
|
+
title: 'drawer__title',
|
|
26
|
+
tooltip: 'drawer__title-tooltip',
|
|
27
|
+
subtitle: 'drawer__subtitle',
|
|
28
|
+
image: 'drawer__image',
|
|
29
|
+
content: 'drawer__body',
|
|
30
|
+
footer: 'drawer__footer',
|
|
31
|
+
footerActions: 'drawer__footer-actions',
|
|
32
|
+
approveButton: 'drawer__approve-button',
|
|
33
|
+
cancelButton: 'drawer__cancel-button',
|
|
34
|
+
additionalButton: 'drawer__additional-button'
|
|
35
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var __rest = void 0 && (void 0).__rest || function (s, e) {
|
|
4
|
+
var t = {};
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = void 0 && (void 0).__importDefault || function (mod) {
|
|
12
|
+
return mod && mod.__esModule ? mod : {
|
|
13
|
+
"default": mod
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", {
|
|
17
|
+
value: true
|
|
18
|
+
});
|
|
19
|
+
exports.DrawerBody = DrawerBody;
|
|
20
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
21
|
+
const classnames_1 = __importDefault(require("classnames"));
|
|
22
|
+
const scroll_1 = require("@snack-uikit/scroll");
|
|
23
|
+
const utils_1 = require("@snack-uikit/utils");
|
|
24
|
+
const styles_module_scss_1 = __importDefault({});
|
|
25
|
+
/** Вспомогательный компонент для добавления "тела" в DrawerCustom */
|
|
26
|
+
function DrawerBody(_a) {
|
|
27
|
+
var {
|
|
28
|
+
content,
|
|
29
|
+
className
|
|
30
|
+
} = _a,
|
|
31
|
+
rest = __rest(_a, ["content", "className"]);
|
|
32
|
+
return (0, jsx_runtime_1.jsx)(scroll_1.Scroll, Object.assign({
|
|
33
|
+
size: 'm',
|
|
34
|
+
barHideStrategy: 'never',
|
|
35
|
+
className: (0, classnames_1.default)(styles_module_scss_1.default.drawerBody, className)
|
|
36
|
+
}, (0, utils_1.extractSupportProps)(rest), {
|
|
37
|
+
children: content
|
|
38
|
+
}));
|
|
39
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var __createBinding = void 0 && (void 0).__createBinding || (Object.create ? function (o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: function () {
|
|
10
|
+
return m[k];
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
Object.defineProperty(o, k2, desc);
|
|
15
|
+
} : function (o, m, k, k2) {
|
|
16
|
+
if (k2 === undefined) k2 = k;
|
|
17
|
+
o[k2] = m[k];
|
|
18
|
+
});
|
|
19
|
+
var __exportStar = void 0 && (void 0).__exportStar || function (m, exports) {
|
|
20
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
21
|
+
};
|
|
22
|
+
Object.defineProperty(exports, "__esModule", {
|
|
23
|
+
value: true
|
|
24
|
+
});
|
|
25
|
+
__exportStar(require("./Body"), exports);
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var __importDefault = void 0 && (void 0).__importDefault || function (mod) {
|
|
4
|
+
return mod && mod.__esModule ? mod : {
|
|
5
|
+
"default": mod
|
|
6
|
+
};
|
|
7
|
+
};
|
|
8
|
+
Object.defineProperty(exports, "__esModule", {
|
|
9
|
+
value: true
|
|
10
|
+
});
|
|
11
|
+
exports.ButtonClose = ButtonClose;
|
|
12
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
13
|
+
const icons_1 = require("@snack-uikit/icons");
|
|
14
|
+
const constants_1 = require("../../constants");
|
|
15
|
+
const styles_module_scss_1 = __importDefault({});
|
|
16
|
+
function ButtonClose(_ref) {
|
|
17
|
+
let {
|
|
18
|
+
onClick
|
|
19
|
+
} = _ref;
|
|
20
|
+
return (0, jsx_runtime_1.jsx)("button", {
|
|
21
|
+
type: 'button',
|
|
22
|
+
className: styles_module_scss_1.default.buttonClose,
|
|
23
|
+
onClick: onClick,
|
|
24
|
+
"aria-label": 'close drawer',
|
|
25
|
+
"data-test-id": constants_1.TEST_IDS.closeButton,
|
|
26
|
+
children: (0, jsx_runtime_1.jsx)(icons_1.CrossSVG, {})
|
|
27
|
+
});
|
|
28
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var __createBinding = void 0 && (void 0).__createBinding || (Object.create ? function (o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: function () {
|
|
10
|
+
return m[k];
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
Object.defineProperty(o, k2, desc);
|
|
15
|
+
} : function (o, m, k, k2) {
|
|
16
|
+
if (k2 === undefined) k2 = k;
|
|
17
|
+
o[k2] = m[k];
|
|
18
|
+
});
|
|
19
|
+
var __exportStar = void 0 && (void 0).__exportStar || function (m, exports) {
|
|
20
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
21
|
+
};
|
|
22
|
+
Object.defineProperty(exports, "__esModule", {
|
|
23
|
+
value: true
|
|
24
|
+
});
|
|
25
|
+
__exportStar(require("./ButtonClose"), exports);
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var __rest = void 0 && (void 0).__rest || function (s, e) {
|
|
4
|
+
var t = {};
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = void 0 && (void 0).__importDefault || function (mod) {
|
|
12
|
+
return mod && mod.__esModule ? mod : {
|
|
13
|
+
"default": mod
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", {
|
|
17
|
+
value: true
|
|
18
|
+
});
|
|
19
|
+
exports.DrawerFooter = DrawerFooter;
|
|
20
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
21
|
+
const classnames_1 = __importDefault(require("classnames"));
|
|
22
|
+
const utils_1 = require("@snack-uikit/utils");
|
|
23
|
+
const constants_1 = require("../../constants");
|
|
24
|
+
const styles_module_scss_1 = __importDefault({});
|
|
25
|
+
/** Вспомогательный компонент для добавления "футера" в DrawerCustom */
|
|
26
|
+
function DrawerFooter(_a) {
|
|
27
|
+
var {
|
|
28
|
+
actions,
|
|
29
|
+
className
|
|
30
|
+
} = _a,
|
|
31
|
+
rest = __rest(_a, ["actions", "className"]);
|
|
32
|
+
return (0, jsx_runtime_1.jsx)("div", Object.assign({
|
|
33
|
+
className: (0, classnames_1.default)(styles_module_scss_1.default.footer, className)
|
|
34
|
+
}, (0, utils_1.extractSupportProps)(rest), {
|
|
35
|
+
children: (0, jsx_runtime_1.jsx)("div", {
|
|
36
|
+
className: styles_module_scss_1.default.footerActions,
|
|
37
|
+
"data-test-id": constants_1.TEST_IDS.footerActions,
|
|
38
|
+
children: actions
|
|
39
|
+
})
|
|
40
|
+
}));
|
|
41
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var __createBinding = void 0 && (void 0).__createBinding || (Object.create ? function (o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: function () {
|
|
10
|
+
return m[k];
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
Object.defineProperty(o, k2, desc);
|
|
15
|
+
} : function (o, m, k, k2) {
|
|
16
|
+
if (k2 === undefined) k2 = k;
|
|
17
|
+
o[k2] = m[k];
|
|
18
|
+
});
|
|
19
|
+
var __exportStar = void 0 && (void 0).__exportStar || function (m, exports) {
|
|
20
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
21
|
+
};
|
|
22
|
+
Object.defineProperty(exports, "__esModule", {
|
|
23
|
+
value: true
|
|
24
|
+
});
|
|
25
|
+
__exportStar(require("./Footer"), exports);
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var __rest = void 0 && (void 0).__rest || function (s, e) {
|
|
4
|
+
var t = {};
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = void 0 && (void 0).__importDefault || function (mod) {
|
|
12
|
+
return mod && mod.__esModule ? mod : {
|
|
13
|
+
"default": mod
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", {
|
|
17
|
+
value: true
|
|
18
|
+
});
|
|
19
|
+
exports.DrawerHeader = DrawerHeader;
|
|
20
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
21
|
+
const classnames_1 = __importDefault(require("classnames"));
|
|
22
|
+
const tooltip_1 = require("@snack-uikit/tooltip");
|
|
23
|
+
const typography_1 = require("@snack-uikit/typography");
|
|
24
|
+
const utils_1 = require("@snack-uikit/utils");
|
|
25
|
+
const constants_1 = require("../../constants");
|
|
26
|
+
const styles_module_scss_1 = __importDefault({});
|
|
27
|
+
/** Вспомогательный компонент для добавления "шапки" в DrawerCustom */
|
|
28
|
+
function DrawerHeader(_a) {
|
|
29
|
+
var {
|
|
30
|
+
title,
|
|
31
|
+
titleTooltip,
|
|
32
|
+
subtitle,
|
|
33
|
+
image,
|
|
34
|
+
className
|
|
35
|
+
} = _a,
|
|
36
|
+
rest = __rest(_a, ["title", "titleTooltip", "subtitle", "image", "className"]);
|
|
37
|
+
return (0, jsx_runtime_1.jsxs)("div", Object.assign({
|
|
38
|
+
className: (0, classnames_1.default)(styles_module_scss_1.default.drawerHeader, className)
|
|
39
|
+
}, (0, utils_1.extractSupportProps)(rest), {
|
|
40
|
+
children: [image && (0, jsx_runtime_1.jsx)("img", {
|
|
41
|
+
src: image.src,
|
|
42
|
+
alt: image.alt,
|
|
43
|
+
className: styles_module_scss_1.default.image,
|
|
44
|
+
"data-test-id": constants_1.TEST_IDS.image
|
|
45
|
+
}), (0, jsx_runtime_1.jsxs)("div", {
|
|
46
|
+
className: styles_module_scss_1.default.headlineLayout,
|
|
47
|
+
children: [(0, jsx_runtime_1.jsxs)("div", {
|
|
48
|
+
className: styles_module_scss_1.default.headline,
|
|
49
|
+
children: [(0, jsx_runtime_1.jsx)(typography_1.Typography.SansHeadlineS, {
|
|
50
|
+
className: styles_module_scss_1.default.title,
|
|
51
|
+
"data-test-id": constants_1.TEST_IDS.title,
|
|
52
|
+
children: title
|
|
53
|
+
}), titleTooltip && (0, jsx_runtime_1.jsx)(tooltip_1.QuestionTooltip, {
|
|
54
|
+
tip: titleTooltip,
|
|
55
|
+
size: 's',
|
|
56
|
+
"data-test-id": constants_1.TEST_IDS.tooltip
|
|
57
|
+
})]
|
|
58
|
+
}), subtitle && (0, jsx_runtime_1.jsx)(typography_1.Typography.SansBodyM, {
|
|
59
|
+
className: styles_module_scss_1.default.subtitle,
|
|
60
|
+
"data-test-id": constants_1.TEST_IDS.subtitle,
|
|
61
|
+
children: subtitle
|
|
62
|
+
})]
|
|
63
|
+
})]
|
|
64
|
+
}));
|
|
65
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var __createBinding = void 0 && (void 0).__createBinding || (Object.create ? function (o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: function () {
|
|
10
|
+
return m[k];
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
Object.defineProperty(o, k2, desc);
|
|
15
|
+
} : function (o, m, k, k2) {
|
|
16
|
+
if (k2 === undefined) k2 = k;
|
|
17
|
+
o[k2] = m[k];
|
|
18
|
+
});
|
|
19
|
+
var __exportStar = void 0 && (void 0).__exportStar || function (m, exports) {
|
|
20
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
21
|
+
};
|
|
22
|
+
Object.defineProperty(exports, "__esModule", {
|
|
23
|
+
value: true
|
|
24
|
+
});
|
|
25
|
+
__exportStar(require("./Header"), exports);
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.WithTooltip = WithTooltip;
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const tooltip_1 = require("@snack-uikit/tooltip");
|
|
9
|
+
function WithTooltip(_ref) {
|
|
10
|
+
let {
|
|
11
|
+
tooltip,
|
|
12
|
+
children
|
|
13
|
+
} = _ref;
|
|
14
|
+
if (!tooltip) {
|
|
15
|
+
return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, {
|
|
16
|
+
children: children
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
return (0, jsx_runtime_1.jsx)(tooltip_1.Tooltip, Object.assign({}, tooltip, {
|
|
20
|
+
children: children
|
|
21
|
+
}));
|
|
22
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var __createBinding = void 0 && (void 0).__createBinding || (Object.create ? function (o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: function () {
|
|
10
|
+
return m[k];
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
Object.defineProperty(o, k2, desc);
|
|
15
|
+
} : function (o, m, k, k2) {
|
|
16
|
+
if (k2 === undefined) k2 = k;
|
|
17
|
+
o[k2] = m[k];
|
|
18
|
+
});
|
|
19
|
+
var __exportStar = void 0 && (void 0).__exportStar || function (m, exports) {
|
|
20
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
21
|
+
};
|
|
22
|
+
Object.defineProperty(exports, "__esModule", {
|
|
23
|
+
value: true
|
|
24
|
+
});
|
|
25
|
+
__exportStar(require("./WithTooltip"), exports);
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var __createBinding = void 0 && (void 0).__createBinding || (Object.create ? function (o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: function () {
|
|
10
|
+
return m[k];
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
Object.defineProperty(o, k2, desc);
|
|
15
|
+
} : function (o, m, k, k2) {
|
|
16
|
+
if (k2 === undefined) k2 = k;
|
|
17
|
+
o[k2] = m[k];
|
|
18
|
+
});
|
|
19
|
+
var __exportStar = void 0 && (void 0).__exportStar || function (m, exports) {
|
|
20
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
21
|
+
};
|
|
22
|
+
Object.defineProperty(exports, "__esModule", {
|
|
23
|
+
value: true
|
|
24
|
+
});
|
|
25
|
+
__exportStar(require("./Body"), exports);
|
|
26
|
+
__exportStar(require("./ButtonClose"), exports);
|
|
27
|
+
__exportStar(require("./Footer"), exports);
|
|
28
|
+
__exportStar(require("./Header"), exports);
|