@sima-land/ui-nucleons 45.0.0-alpha.3 → 45.0.0-alpha.5
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/_internal/custom-scrollbar/index.d.ts +2 -2
- package/_internal/custom-scrollbar/index.js +17 -14
- package/_internal/dropdown-loading/index.js +2 -3
- package/_internal/page-scroll-lock/context.js +3 -25
- package/alert/index.d.ts +2 -2
- package/alert/index.js +4 -30
- package/arrow-button/arrow-button.module.scss +5 -5
- package/arrow-button/index.js +18 -19
- package/autocomplete/autocomplete.js +49 -76
- package/autocomplete-deprecated/index.d.ts +1 -1
- package/autocomplete-deprecated/index.js +43 -67
- package/avatar/avatar.module.scss +3 -1
- package/avatar/index.d.ts +1 -1
- package/avatar/index.js +10 -36
- package/avatar/user.d.ts +1 -1
- package/avatar/user.js +8 -29
- package/avatar/utils.d.ts +1 -1
- package/avatar/utils.js +12 -10
- package/base-input/base-input.js +5 -31
- package/base-input-deprecated/index.d.ts +2 -2
- package/base-input-deprecated/index.js +8 -34
- package/bordered-layout/index.d.ts +1 -1
- package/bordered-layout/index.js +2 -3
- package/bottom-bar/bottom-bar.js +2 -3
- package/box/index.d.ts +1 -1
- package/box/index.js +2 -2
- package/button/index.d.ts +2 -2
- package/button/index.js +6 -32
- package/card/index.js +2 -8
- package/card/slots.d.ts +1 -1
- package/card/slots.js +9 -31
- package/carousel/draggable.d.ts +1 -1
- package/carousel/draggable.js +5 -28
- package/carousel/index.d.ts +1 -1
- package/carousel/index.js +17 -43
- package/checkbox/index.d.ts +2 -2
- package/checkbox/index.js +3 -29
- package/checkbox-field/index.d.ts +2 -2
- package/checkbox-field/index.js +3 -31
- package/chips/index.d.ts +1 -1
- package/chips/index.js +3 -25
- package/chips/item.d.ts +1 -1
- package/chips/item.js +3 -5
- package/clean-buttons/index.js +6 -28
- package/dot-nav/index.d.ts +1 -1
- package/dot-nav/index.js +12 -34
- package/dropdown/index.d.ts +2 -2
- package/dropdown/index.js +3 -26
- package/dropdown-item/index.d.ts +1 -1
- package/dropdown-item/index.js +4 -9
- package/expandable/index.d.ts +2 -2
- package/expandable/index.js +8 -36
- package/field-block/index.js +2 -9
- package/field-grid/index.d.ts +1 -1
- package/field-grid/index.js +43 -65
- package/file-icon/index.d.ts +1 -1
- package/file-icon/index.js +5 -10
- package/group-overflow/index.js +7 -29
- package/helpers/define-slots.d.ts +1 -1
- package/helpers/events.d.ts +1 -1
- package/helpers/on.d.ts +1 -1
- package/hint/hint-view.js +3 -3
- package/hint/hint.js +3 -8
- package/hint/utils.d.ts +4 -1
- package/hint/utils.js +4 -3
- package/hint-deprecated/index.d.ts +2 -2
- package/hint-deprecated/index.js +3 -26
- package/hooks/breakpoint/index.js +3 -25
- package/info-text/index.js +15 -42
- package/input/index.js +8 -30
- package/layout/layout.js +2 -2
- package/layout/legacy.d.ts +5 -5
- package/layout/legacy.js +3 -25
- package/link/index.d.ts +6 -3
- package/link/index.js +3 -25
- package/loading-overlay/index.d.ts +1 -1
- package/loading-overlay/index.js +2 -3
- package/masked-field/index.d.ts +2 -2
- package/masked-field/index.js +3 -25
- package/masked-input/masked-input.js +3 -25
- package/modal/index.d.ts +1 -1
- package/modal/index.js +3 -10
- package/modal/slots.js +6 -29
- package/modal-overlay/index.js +3 -26
- package/no-index/index.d.ts +3 -3
- package/no-index/index.js +4 -8
- package/no-index-mark/index.d.ts +2 -2
- package/no-index-mark/index.js +7 -6
- package/package.json +6 -11
- package/pagination/index.d.ts +4 -20
- package/pagination/index.js +8 -15
- package/pagination/pagination-item.d.ts +8 -0
- package/pagination/pagination-item.js +31 -0
- package/pagination/pagination-item.module.scss +49 -0
- package/pagination/pagination.d.ts +8 -0
- package/pagination/pagination.js +78 -0
- package/pagination/pagination.module.scss +14 -70
- package/pagination/types.d.ts +28 -0
- package/pagination/types.js +2 -0
- package/pagination/utils.d.ts +15 -43
- package/pagination/utils.js +38 -87
- package/{pagination → pagination-deprecated}/base-pagination.d.ts +6 -1
- package/{pagination → pagination-deprecated}/base-pagination.js +33 -33
- package/pagination-deprecated/index.d.ts +22 -0
- package/pagination-deprecated/index.js +15 -0
- package/{pagination → pagination-deprecated}/page-button.d.ts +2 -1
- package/{pagination → pagination-deprecated}/page-button.js +3 -5
- package/pagination-deprecated/pagination.module.scss +76 -0
- package/pagination-deprecated/utils.d.ts +58 -0
- package/pagination-deprecated/utils.js +124 -0
- package/panel/index.js +3 -6
- package/phone-input/images/armenia.png +0 -0
- package/phone-input/images/azerbaijan.png +0 -0
- package/phone-input/images/belarus.png +0 -0
- package/phone-input/images/georgia.png +0 -0
- package/phone-input/images/kazakhstan.png +0 -0
- package/phone-input/images/kyrgyzstan.png +0 -0
- package/phone-input/images/moldova.png +0 -0
- package/phone-input/images/other.png +0 -0
- package/phone-input/images/russia.png +0 -0
- package/phone-input/images/tajikistan.png +0 -0
- package/phone-input/images/turkmenistan.png +0 -0
- package/phone-input/images/ukraine.png +0 -0
- package/phone-input/images/uzbekistan.png +0 -0
- package/phone-input/phone-input.js +13 -37
- package/phone-input/presets.js +2 -0
- package/phone-input-deprecated/index.d.ts +1 -1
- package/phone-input-deprecated/index.js +31 -57
- package/plate/index.d.ts +2 -2
- package/plate/index.js +3 -25
- package/popup/popup-view.js +3 -6
- package/popup/popup.js +4 -26
- package/portal/index.d.ts +1 -1
- package/price/index.js +2 -2
- package/radio-button/index.js +2 -4
- package/range/index.d.ts +1 -1
- package/range/index.js +6 -33
- package/rating/index.d.ts +1 -1
- package/rating/index.js +4 -9
- package/readme.md +4 -67
- package/screen/index.d.ts +5 -5
- package/screen/index.js +11 -37
- package/screen/slots.d.ts +3 -3
- package/screen/slots.js +9 -31
- package/select/parts/block.js +6 -28
- package/select/parts/button.js +7 -29
- package/select/parts/menu.js +12 -33
- package/select/select.js +4 -28
- package/select-deprecated/index.d.ts +1 -1
- package/select-deprecated/index.js +32 -56
- package/side-page/index.js +4 -30
- package/side-page/slots.js +4 -4
- package/spinner/index.d.ts +1 -1
- package/spinner/index.js +3 -5
- package/spinner/spinner.module.scss +3 -1
- package/stepper/index.d.ts +2 -2
- package/stepper/index.js +11 -38
- package/stroked-svg/index.d.ts +2 -2
- package/stroked-svg/index.js +3 -27
- package/styling/sizes.module.scss +3 -1
- package/super-ellipse-clip-path/index.js +2 -8
- package/switcher-row/index.js +5 -10
- package/tabs/index.d.ts +1 -1
- package/tabs/index.js +4 -26
- package/text/index.d.ts +2 -2
- package/text/index.js +3 -25
- package/text-button/index.d.ts +2 -2
- package/text-button/index.js +4 -7
- package/text-button/text-button.module.scss +1 -1
- package/text-field/index.d.ts +2 -2
- package/text-field/index.js +25 -55
- package/textarea/index.js +4 -26
- package/timer/index.d.ts +1 -1
- package/timer/index.js +3 -25
- package/toggle/index.d.ts +2 -2
- package/toggle/index.js +3 -27
- package/tooltip/index.d.ts +2 -2
- package/tooltip/index.js +4 -28
- package/top-bar/index.d.ts +1 -1
- package/top-bar/index.js +3 -1
- package/top-bar/top-bar.js +5 -45
- package/top-bar/utils.d.ts +2 -2
- package/top-bar/utils.js +6 -28
- package/touch-slider/index.d.ts +1 -1
- package/touch-slider/index.js +2 -4
- package/unknown-content/index.d.ts +1 -1
- package/unknown-content/index.js +3 -25
- package/upload-area/upload-area.js +8 -38
- package/with-hint/index.d.ts +1 -1
- package/with-hint/index.js +3 -28
- package/with-hint/positioning-hint.d.ts +1 -1
- package/with-hint/positioning-hint.js +3 -25
- package/with-tooltip/index.d.ts +1 -1
- package/with-tooltip/index.js +6 -31
- package/with-tooltip/positioning-tooltip.d.ts +1 -1
- package/with-tooltip/positioning-tooltip.js +4 -26
- package/file-icon/unknown.svg +0 -9
- package/rating/star.svg +0 -3
- package/upload-area/upload.svg +0 -6
package/avatar/index.js
CHANGED
|
@@ -1,40 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
4
|
};
|
|
28
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
6
|
exports.Avatar = void 0;
|
|
30
|
-
const
|
|
31
|
-
const
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const react_1 = require("react");
|
|
32
9
|
const colors_1 = require("../colors");
|
|
33
|
-
const person_1 = __importDefault(require("@sima-land/ui-quarks/icons/24x24/Stroked/person"));
|
|
34
|
-
const avatar_module_scss_1 = __importDefault(require("./avatar.module.scss"));
|
|
35
10
|
const utils_1 = require("./utils");
|
|
36
11
|
const colors_2 = require("../styling/colors");
|
|
37
|
-
const
|
|
12
|
+
const Person_1 = __importDefault(require("@sima-land/ui-quarks/icons/24x24/Stroked/Person"));
|
|
13
|
+
const bind_1 = __importDefault(require("classnames/bind"));
|
|
14
|
+
const avatar_module_scss_1 = __importDefault(require("./avatar.module.scss"));
|
|
38
15
|
const SIZES = [40, 48, 56, 64, 72, 80, 104];
|
|
39
16
|
const ICON_SIZES = {
|
|
40
17
|
40: 16,
|
|
@@ -45,21 +22,18 @@ const ICON_SIZES = {
|
|
|
45
22
|
80: 24,
|
|
46
23
|
104: 24,
|
|
47
24
|
};
|
|
25
|
+
const cx = bind_1.default.bind(avatar_module_scss_1.default);
|
|
48
26
|
/**
|
|
49
27
|
* Компонент аватара.
|
|
50
28
|
* @param props Свойства компонента.
|
|
51
29
|
* @return Элемент.
|
|
52
30
|
*/
|
|
53
|
-
|
|
54
|
-
const [needImage, toggleImage] = (0, react_1.useState)(Boolean(imageUrl));
|
|
31
|
+
function Avatar({ size: sizeProp = 72, imageUrl, bgColor = 'basic-gray4', bgOpacity = 1, textColor = 'basic-gray87', title, monogram = (0, utils_1.getMonogram)(title), className, style, 'data-testid': testId = 'avatar', }) {
|
|
32
|
+
const [needImage, toggleImage] = (0, react_1.useState)(() => Boolean(imageUrl));
|
|
55
33
|
(0, react_1.useEffect)(() => {
|
|
56
34
|
toggleImage(Boolean(imageUrl));
|
|
57
35
|
}, [imageUrl]);
|
|
58
36
|
const size = SIZES.includes(sizeProp) ? sizeProp : 72;
|
|
59
|
-
return (
|
|
60
|
-
|
|
61
|
-
needImage && (react_1.default.createElement(react_1.default.Fragment, null,
|
|
62
|
-
react_1.default.createElement("img", { src: imageUrl, alt: '', className: cx('layer', 'image'), onError: () => toggleImage(false) }),
|
|
63
|
-
react_1.default.createElement("div", { className: cx('layer', 'image-overlay') })))));
|
|
64
|
-
};
|
|
37
|
+
return ((0, jsx_runtime_1.jsxs)("div", Object.assign({ "data-testid": testId, className: cx('root', `size-${size}`, (0, colors_2.color)(textColor), className), style: Object.assign(Object.assign({}, style), { '--avatar-color': !needImage ? colors_1.COLORS.get(bgColor) : undefined, '--avatar-color-opacity': bgOpacity }) }, { children: [!needImage && ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: monogram ? ((0, jsx_runtime_1.jsx)("span", Object.assign({ className: cx('monogram') }, { children: monogram.slice(0, 2).toUpperCase() }))) : ((0, jsx_runtime_1.jsx)(Person_1.default, { fill: colors_1.COLORS.get(textColor), width: ICON_SIZES[size], height: ICON_SIZES[size], className: cx('icon') })) })), needImage && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("img", { src: imageUrl, alt: '', className: cx('layer', 'image'), onError: () => toggleImage(false) }), (0, jsx_runtime_1.jsx)("div", { className: cx('layer', 'image-overlay') })] }))] })));
|
|
38
|
+
}
|
|
65
39
|
exports.Avatar = Avatar;
|
package/avatar/user.d.ts
CHANGED
|
@@ -7,4 +7,4 @@ export declare const colorKey: unique symbol;
|
|
|
7
7
|
* @param props Свойства. Поддерживаются свойства Avatar.
|
|
8
8
|
* @return Элемент.
|
|
9
9
|
*/
|
|
10
|
-
export declare
|
|
10
|
+
export declare function UserAvatar(props: UserAvatarProps): JSX.Element;
|
package/avatar/user.js
CHANGED
|
@@ -1,30 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
3
|
exports.UserAvatar = exports.colorKey = void 0;
|
|
27
|
-
const
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
28
6
|
const lodash_1 = require("lodash");
|
|
29
7
|
const _1 = require(".");
|
|
30
8
|
const COLORS = [
|
|
@@ -49,13 +27,14 @@ exports.colorKey = Symbol.for('user-avatar:color-key');
|
|
|
49
27
|
* @param props Свойства. Поддерживаются свойства Avatar.
|
|
50
28
|
* @return Элемент.
|
|
51
29
|
*/
|
|
52
|
-
|
|
30
|
+
function UserAvatar(props) {
|
|
53
31
|
const [color, setColor] = (0, react_1.useState)();
|
|
54
32
|
(0, react_1.useEffect)(() => {
|
|
33
|
+
const source = window;
|
|
55
34
|
// запоминаем цвет (пока только один для всех аватаров на странице)
|
|
56
|
-
|
|
57
|
-
setColor(
|
|
35
|
+
source[exports.colorKey] = source[exports.colorKey] || (0, lodash_1.sample)(COLORS);
|
|
36
|
+
setColor(source[exports.colorKey]);
|
|
58
37
|
}, []);
|
|
59
|
-
return
|
|
60
|
-
}
|
|
38
|
+
return (0, jsx_runtime_1.jsx)(_1.Avatar, Object.assign({}, props, { bgColor: color, bgOpacity: color ? 0.48 : 0, textColor: 'basic-white' }));
|
|
39
|
+
}
|
|
61
40
|
exports.UserAvatar = UserAvatar;
|
package/avatar/utils.d.ts
CHANGED
package/avatar/utils.js
CHANGED
|
@@ -1,19 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getMonogram = void 0;
|
|
4
|
-
const lodash_1 = require("lodash");
|
|
5
4
|
/**
|
|
6
5
|
* Формирует монограмму из переданной строки.
|
|
7
6
|
* @param value Переданная строка.
|
|
8
7
|
* @return Монограмма.
|
|
9
8
|
*/
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
9
|
+
function getMonogram(value) {
|
|
10
|
+
if (typeof value === 'string') {
|
|
11
|
+
return value
|
|
12
|
+
.split(/\s+/g)
|
|
13
|
+
.slice(0, 2)
|
|
14
|
+
.map(s => s[0])
|
|
15
|
+
.reverse()
|
|
16
|
+
.join('')
|
|
17
|
+
.toUpperCase();
|
|
18
|
+
}
|
|
19
|
+
return '';
|
|
20
|
+
}
|
|
19
21
|
exports.getMonogram = getMonogram;
|
package/base-input/base-input.js
CHANGED
|
@@ -1,27 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
2
|
var __rest = (this && this.__rest) || function (s, e) {
|
|
26
3
|
var t = {};
|
|
27
4
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
@@ -38,7 +15,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
38
15
|
};
|
|
39
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
17
|
exports.BaseInput = void 0;
|
|
41
|
-
const
|
|
18
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
19
|
+
const react_1 = require("react");
|
|
42
20
|
const fit_element_height_1 = require("../helpers/fit-element-height");
|
|
43
21
|
const hooks_1 = require("../hooks");
|
|
44
22
|
const utils_1 = require("./utils");
|
|
@@ -68,7 +46,7 @@ function BaseInput(_a) {
|
|
|
68
46
|
});
|
|
69
47
|
let field;
|
|
70
48
|
if (props.multiline) {
|
|
71
|
-
field = (
|
|
49
|
+
field = ((0, jsx_runtime_1.jsx)("textarea", Object.assign({}, (0, utils_1.omitMultiline)(props), { ref: textareaInnerRef, rows: (_b = props.rows) !== null && _b !== void 0 ? _b : 1, "data-testid": 'base-input:field' // ВАЖНО: не даем переопределить data-test-id
|
|
72
50
|
, className: cx('field', 'reset', 'multiline'), onInput: e => {
|
|
73
51
|
var _a;
|
|
74
52
|
(_a = props.onInput) === null || _a === void 0 ? void 0 : _a.call(props, e);
|
|
@@ -76,7 +54,7 @@ function BaseInput(_a) {
|
|
|
76
54
|
} })));
|
|
77
55
|
}
|
|
78
56
|
else {
|
|
79
|
-
field = (
|
|
57
|
+
field = ((0, jsx_runtime_1.jsx)("input", Object.assign({}, (0, utils_1.omitMultiline)(props), { ref: inputInnerRef, "data-testid": 'base-input:field' // ВАЖНО: не даем переопределить data-test-id
|
|
80
58
|
, className: cx('field', 'reset') })));
|
|
81
59
|
}
|
|
82
60
|
let restPlaceholder = null;
|
|
@@ -87,10 +65,6 @@ function BaseInput(_a) {
|
|
|
87
65
|
? { shiftValue: String(props.value), value: restPlaceholderProp }
|
|
88
66
|
: Object.assign({ shiftValue: String(props.value), value: '' }, restPlaceholderProp);
|
|
89
67
|
}
|
|
90
|
-
return (
|
|
91
|
-
!props.multiline && restPlaceholder && restPlaceholder.value && (react_1.default.createElement("span", { "aria-hidden": true, className: cx('rest-placeholder') },
|
|
92
|
-
react_1.default.createElement("span", { "data-testid": 'rest-placeholder-shift', className: cx('shift-part') }, restPlaceholder.shiftValue),
|
|
93
|
-
react_1.default.createElement("span", { "data-testid": 'rest-placeholder', className: cx('main-part') }, restPlaceholder.value))),
|
|
94
|
-
field));
|
|
68
|
+
return ((0, jsx_runtime_1.jsxs)("div", Object.assign({ style: style, className: cx('reset', 'root', className), "data-testid": testId }, { children: [!props.multiline && restPlaceholder && restPlaceholder.value && ((0, jsx_runtime_1.jsxs)("span", Object.assign({ "aria-hidden": true, className: cx('rest-placeholder') }, { children: [(0, jsx_runtime_1.jsx)("span", Object.assign({ "data-testid": 'rest-placeholder-shift', className: cx('shift-part') }, { children: restPlaceholder.shiftValue })), (0, jsx_runtime_1.jsx)("span", Object.assign({ "data-testid": 'rest-placeholder', className: cx('main-part') }, { children: restPlaceholder.value }))] }))), field] })));
|
|
95
69
|
}
|
|
96
70
|
exports.BaseInput = BaseInput;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
2
|
interface RestPlaceholder {
|
|
3
3
|
value: string;
|
|
4
4
|
shiftValue?: string;
|
|
@@ -20,5 +20,5 @@ export type BaseInputProps = CustomProps & React.TextareaHTMLAttributes<HTMLText
|
|
|
20
20
|
* @param props Свойства. Поддерживаются свойства элемента input.
|
|
21
21
|
* @return Элемент.
|
|
22
22
|
*/
|
|
23
|
-
export declare const BaseInput:
|
|
23
|
+
export declare const BaseInput: import("react").ForwardRefExoticComponent<CustomProps & import("react").TextareaHTMLAttributes<HTMLTextAreaElement> & import("react").InputHTMLAttributes<HTMLInputElement> & import("react").RefAttributes<HTMLInputElement | HTMLTextAreaElement | undefined>>;
|
|
24
24
|
export {};
|
|
@@ -1,27 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
2
|
var __rest = (this && this.__rest) || function (s, e) {
|
|
26
3
|
var t = {};
|
|
27
4
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
@@ -38,7 +15,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
38
15
|
};
|
|
39
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
17
|
exports.BaseInput = void 0;
|
|
41
|
-
const
|
|
18
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
19
|
+
const react_1 = require("react");
|
|
42
20
|
const fit_element_height_1 = require("../helpers/fit-element-height");
|
|
43
21
|
const bind_1 = __importDefault(require("classnames/bind"));
|
|
44
22
|
const base_input_module_scss_1 = __importDefault(require("./base-input.module.scss"));
|
|
@@ -67,14 +45,10 @@ exports.BaseInput = (0, react_1.forwardRef)(function BaseInput(_a, ref) {
|
|
|
67
45
|
const restPlaceholder = typeof restPlaceholderProp === 'string'
|
|
68
46
|
? { shiftValue: value, value: restPlaceholderProp }
|
|
69
47
|
: Object.assign({ shiftValue: value }, restPlaceholderProp);
|
|
70
|
-
return (
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
className: cx('field', 'reset', multiline && 'multiline'), value: value, onInput: (event) => {
|
|
77
|
-
multiline && (0, fit_element_height_1.fitElementHeight)(event);
|
|
78
|
-
onInput === null || onInput === void 0 ? void 0 : onInput(event);
|
|
79
|
-
} }))));
|
|
48
|
+
return ((0, jsx_runtime_1.jsxs)("div", Object.assign({ "data-testid": 'base-input:root', style: style, className: cx('reset', 'root', disabled && 'disabled', className) }, { children: [!multiline && Boolean(restPlaceholder.value) && ((0, jsx_runtime_1.jsxs)("span", Object.assign({ "aria-hidden": true, className: cx('fake-text') }, { children: [(0, jsx_runtime_1.jsx)("span", Object.assign({ className: cx('invisible-value') }, { children: restPlaceholder.shiftValue })), (0, jsx_runtime_1.jsx)("span", Object.assign({ className: cx('placeholder') }, { children: restPlaceholder.value }))] }))), (0, jsx_runtime_1.jsx)(Element, Object.assign({ "data-testid": 'base-input:field' }, props, { rows: multiline ? rows : undefined, ref: inputRef, disabled: disabled,
|
|
49
|
+
// ВАЖНО: не даем возможности задать стили/классы именно для этого элемента
|
|
50
|
+
className: cx('field', 'reset', multiline && 'multiline'), value: value, onInput: (event) => {
|
|
51
|
+
multiline && (0, fit_element_height_1.fitElementHeight)(event);
|
|
52
|
+
onInput === null || onInput === void 0 ? void 0 : onInput(event);
|
|
53
|
+
} }))] })));
|
|
80
54
|
});
|
package/bordered-layout/index.js
CHANGED
|
@@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.BorderedLayout = void 0;
|
|
7
|
-
const
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
8
|
const bind_1 = __importDefault(require("classnames/bind"));
|
|
9
9
|
const layout_1 = require("../layout");
|
|
10
10
|
const borders_1 = require("../styling/borders");
|
|
@@ -27,7 +27,6 @@ const BorderedLayout = ({ top, bottom, children }) => {
|
|
|
27
27
|
else if (bottom) {
|
|
28
28
|
borderClass = borders_1.InnerBorder.bottom;
|
|
29
29
|
}
|
|
30
|
-
return (
|
|
31
|
-
react_1.default.createElement("div", { className: cx('inner', borderClass) }, children)));
|
|
30
|
+
return ((0, jsx_runtime_1.jsx)(layout_1.MobileLayout, Object.assign({ disabledOn: ['mxs', 'ms'] }, { children: (0, jsx_runtime_1.jsx)("div", Object.assign({ className: cx('inner', borderClass) }, { children: children })) })));
|
|
32
31
|
};
|
|
33
32
|
exports.BorderedLayout = BorderedLayout;
|
package/bottom-bar/bottom-bar.js
CHANGED
|
@@ -15,7 +15,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
exports.BottomBar = exports.BOTTOM_BAR_DEFAULTS = exports.BOTTOM_BAR_HEIGHT = void 0;
|
|
18
|
-
const
|
|
18
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
19
19
|
const shapes_1 = require("../styling/shapes");
|
|
20
20
|
const utils_1 = require("../clean-buttons/utils");
|
|
21
21
|
const bind_1 = __importDefault(require("classnames/bind"));
|
|
@@ -41,7 +41,6 @@ function BottomBar(_a) {
|
|
|
41
41
|
const rooClassName = cx('root', size !== 'unset' && `size-${size}`, { divided }, shapes_1.MediumRounds.bottom, className);
|
|
42
42
|
return (
|
|
43
43
|
// чтобы CleanButton автоматически брали размер, соответствующий размеру BottomBar
|
|
44
|
-
|
|
45
|
-
react_1.default.createElement("div", Object.assign({}, rest, { className: rooClassName, "data-testid": testId }), children)));
|
|
44
|
+
(0, jsx_runtime_1.jsx)(utils_1.CleanGroupSizeContext.Provider, Object.assign({ value: size }, { children: (0, jsx_runtime_1.jsx)("div", Object.assign({}, rest, { className: rooClassName, "data-testid": testId }, { children: children })) })));
|
|
46
45
|
}
|
|
47
46
|
exports.BottomBar = BottomBar;
|
package/box/index.d.ts
CHANGED
package/box/index.js
CHANGED
|
@@ -27,7 +27,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
29
|
exports.Box = void 0;
|
|
30
|
-
const
|
|
30
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
31
31
|
const bind_1 = __importDefault(require("classnames/bind"));
|
|
32
32
|
const box_module_scss_1 = __importDefault(require("./box.module.scss"));
|
|
33
33
|
const Spacing = __importStar(require("../styling/sizes"));
|
|
@@ -65,7 +65,7 @@ margin, marginTop, marginRight, marginBottom, marginLeft, marginX, marginY,
|
|
|
65
65
|
// paddings
|
|
66
66
|
padding, paddingTop, paddingRight, paddingBottom, paddingLeft, paddingX, paddingY,
|
|
67
67
|
// color
|
|
68
|
-
color, }) => (
|
|
68
|
+
color, }) => ((0, jsx_runtime_1.jsx)(Container, { style: dangerouslySetInlineStyle === null || dangerouslySetInlineStyle === void 0 ? void 0 : dangerouslySetInlineStyle.__style, className: cx(display && DISPLAY.has(display) && `display-${display}`, flex && FLEX.has(flex) && `flex-${flex}`, direction && DIRECTION.has(direction) && `direction-${direction}`, alignItems && ALIGN_ITEMS.has(alignItems) && `align-items-${alignItems}`, justifyContent && JUSTIFY_CONTENT.has(justifyContent) && `justify-content-${justifyContent}`, color && colors_2.COLORS.has(color) && (0, colors_1.bgColor)(color), wrap && 'flex-wrap',
|
|
69
69
|
// margins
|
|
70
70
|
getMarginClasses({
|
|
71
71
|
margin,
|
package/button/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { AnchorHTMLAttributes, ButtonHTMLAttributes, ComponentType, HTMLAttributes, SVGAttributes } from 'react';
|
|
2
2
|
export type ButtonSize = 'xs' | 's' | 'm';
|
|
3
3
|
export type ButtonViewType = 'primary' | 'secondary';
|
|
4
4
|
export type ButtonAppearance = 'button' | 'link' | 'container';
|
|
@@ -36,5 +36,5 @@ export type ButtonProps = AsButtonProps | AsAnchorProps | AsContainerProps;
|
|
|
36
36
|
* @param props Свойства.
|
|
37
37
|
* @return Элемент.
|
|
38
38
|
*/
|
|
39
|
-
export declare const Button:
|
|
39
|
+
export declare const Button: import("react").ForwardRefExoticComponent<ButtonProps & import("react").RefAttributes<any>>;
|
|
40
40
|
export {};
|
package/button/index.js
CHANGED
|
@@ -1,27 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
2
|
var __rest = (this && this.__rest) || function (s, e) {
|
|
26
3
|
var t = {};
|
|
27
4
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
@@ -38,7 +15,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
38
15
|
};
|
|
39
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
17
|
exports.Button = void 0;
|
|
41
|
-
const
|
|
18
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
19
|
+
const react_1 = require("react");
|
|
42
20
|
const spinner_1 = require("../spinner");
|
|
43
21
|
const bind_1 = __importDefault(require("classnames/bind"));
|
|
44
22
|
const button_module_scss_1 = __importDefault(require("./button.module.scss"));
|
|
@@ -53,20 +31,16 @@ exports.Button = (0, react_1.forwardRef)(function Button(_a, ref) {
|
|
|
53
31
|
const hasIcon = Boolean(Icon);
|
|
54
32
|
const hasText = Boolean(children);
|
|
55
33
|
const rootClassName = cx('root', `size-${size}`, `view-${viewType}`, loading && 'loading', disabled && 'disabled', hasIcon && !hasText && 'icon-only', hasText && hasIcon && iconPosition === 'start' && 'icon-start', hasText && hasIcon && iconPosition === 'end' && 'icon-end', className);
|
|
56
|
-
const content = (
|
|
57
|
-
Icon && iconPosition === 'start' && react_1.default.createElement(Icon, { className: cx('icon') }),
|
|
58
|
-
children,
|
|
59
|
-
Icon && iconPosition === 'end' && react_1.default.createElement(Icon, { className: cx('icon') }),
|
|
60
|
-
loading && (react_1.default.createElement(spinner_1.SpinnerSVG, { size: 's', color: disabled || viewType === 'secondary' ? 'basic-gray38' : 'basic-white', className: cx('spinner') }))));
|
|
34
|
+
const content = ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [Icon && iconPosition === 'start' && (0, jsx_runtime_1.jsx)(Icon, { className: cx('icon') }), children, Icon && iconPosition === 'end' && (0, jsx_runtime_1.jsx)(Icon, { className: cx('icon') }), loading && ((0, jsx_runtime_1.jsx)(spinner_1.SpinnerSVG, { size: 's', color: disabled || viewType === 'secondary' ? 'basic-gray38' : 'basic-white', className: cx('spinner') }))] }));
|
|
61
35
|
let result = null;
|
|
62
36
|
if (restProps.appearance === 'container') {
|
|
63
|
-
result = (
|
|
37
|
+
result = ((0, jsx_runtime_1.jsx)("div", Object.assign({}, restProps, { ref: ref, className: rootClassName, role: 'button', "data-testid": testId }, { children: content })));
|
|
64
38
|
}
|
|
65
39
|
else if (restProps.appearance === 'link') {
|
|
66
|
-
result = (
|
|
40
|
+
result = ((0, jsx_runtime_1.jsx)("a", Object.assign({}, restProps, { ref: ref, className: rootClassName, "data-testid": testId }, { children: content })));
|
|
67
41
|
}
|
|
68
42
|
else {
|
|
69
|
-
result = (
|
|
43
|
+
result = ((0, jsx_runtime_1.jsx)("button", Object.assign({}, restProps, { ref: ref, className: rootClassName, disabled: disabled, "data-testid": testId }, { children: content })));
|
|
70
44
|
}
|
|
71
45
|
return result;
|
|
72
46
|
});
|
package/card/index.js
CHANGED
|
@@ -15,7 +15,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
exports.CardContent = exports.Card = void 0;
|
|
18
|
-
const
|
|
18
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
19
19
|
const plate_1 = require("../plate");
|
|
20
20
|
const slots_1 = require("./slots");
|
|
21
21
|
Object.defineProperty(exports, "CardContent", { enumerable: true, get: function () { return slots_1.CardContent; } });
|
|
@@ -40,13 +40,7 @@ const Card = (_a) => {
|
|
|
40
40
|
header: slots_1.CardHeader,
|
|
41
41
|
footer: slots_1.CardFooter,
|
|
42
42
|
});
|
|
43
|
-
return (
|
|
44
|
-
react_1.default.createElement(plate_1.Plate, Object.assign({}, restProps, { rounds: rounds, className: (0, classnames_1.default)(card_module_scss_1.default.root, className) }),
|
|
45
|
-
!topBar && header,
|
|
46
|
-
topBar && (react_1.default.createElement(top_bar_1.TopBar, Object.assign({}, topBar.props, { className: (0, classnames_1.default)(topBar.props.className, rounds === 's' && shapes_1.SmallRounds.top, rounds === 'm' && shapes_1.MediumRounds.top) }))),
|
|
47
|
-
content,
|
|
48
|
-
bottomBar && react_1.default.createElement(bottom_bar_1.BottomBar, Object.assign({}, bottomBar.props)),
|
|
49
|
-
!bottomBar && footer)));
|
|
43
|
+
return ((0, jsx_runtime_1.jsx)(utils_1.CardContext.Provider, Object.assign({ value: { rounds } }, { children: (0, jsx_runtime_1.jsxs)(plate_1.Plate, Object.assign({}, restProps, { rounds: rounds, className: (0, classnames_1.default)(card_module_scss_1.default.root, className) }, { children: [!topBar && header, topBar && ((0, jsx_runtime_1.jsx)(top_bar_1.TopBar, Object.assign({}, topBar.props, { className: (0, classnames_1.default)(topBar.props.className, rounds === 's' && shapes_1.SmallRounds.top, rounds === 'm' && shapes_1.MediumRounds.top) }))), content, bottomBar && (0, jsx_runtime_1.jsx)(bottom_bar_1.BottomBar, Object.assign({}, bottomBar.props)), !bottomBar && footer] })) })));
|
|
50
44
|
};
|
|
51
45
|
exports.Card = Card;
|
|
52
46
|
/**
|
package/card/slots.d.ts
CHANGED
package/card/slots.js
CHANGED
|
@@ -1,27 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
2
|
var __rest = (this && this.__rest) || function (s, e) {
|
|
26
3
|
var t = {};
|
|
27
4
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
@@ -38,7 +15,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
38
15
|
};
|
|
39
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
17
|
exports.CardFooter = exports.CardContent = exports.CardHeader = void 0;
|
|
41
|
-
const
|
|
18
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
19
|
+
const react_1 = require("react");
|
|
42
20
|
const borders_1 = require("../styling/borders");
|
|
43
21
|
const classnames_1 = __importDefault(require("classnames"));
|
|
44
22
|
const card_module_scss_1 = __importDefault(require("./card.module.scss"));
|
|
@@ -53,11 +31,11 @@ const utils_1 = require("./utils");
|
|
|
53
31
|
*/
|
|
54
32
|
function CardHeader({ children, divided }) {
|
|
55
33
|
const { rounds } = (0, react_1.useContext)(utils_1.CardContext);
|
|
56
|
-
return (
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
34
|
+
return ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: (0, classnames_1.default)(divided && borders_1.InnerBorder.bottom) }, { children: (0, react_1.isValidElement)(children) && children.type === top_bar_1.TopBar
|
|
35
|
+
? (0, react_1.cloneElement)(children, {
|
|
36
|
+
className: (0, classnames_1.default)(children.props.className, divided && borders_1.InnerBorder.bottom, rounds === 's' && shapes_1.SmallRounds.top, rounds === 'm' && shapes_1.MediumRounds.top),
|
|
37
|
+
})
|
|
38
|
+
: children })));
|
|
61
39
|
}
|
|
62
40
|
exports.CardHeader = CardHeader;
|
|
63
41
|
CardHeader.displayName = 'Card.Header';
|
|
@@ -68,7 +46,7 @@ CardHeader.displayName = 'Card.Header';
|
|
|
68
46
|
*/
|
|
69
47
|
function CardContent(_a) {
|
|
70
48
|
var { children, className, scrollableRef } = _a, restProps = __rest(_a, ["children", "className", "scrollableRef"]);
|
|
71
|
-
return (
|
|
49
|
+
return ((0, jsx_runtime_1.jsx)("div", Object.assign({}, restProps, { ref: scrollableRef, className: (0, classnames_1.default)(card_module_scss_1.default.content, className) }, { children: children })));
|
|
72
50
|
}
|
|
73
51
|
exports.CardContent = CardContent;
|
|
74
52
|
CardContent.displayName = 'Card.Content';
|
|
@@ -80,7 +58,7 @@ CardContent.displayName = 'Card.Content';
|
|
|
80
58
|
*/
|
|
81
59
|
function CardFooter(_a) {
|
|
82
60
|
var { children, divided, className } = _a, restProps = __rest(_a, ["children", "divided", "className"]);
|
|
83
|
-
return (
|
|
61
|
+
return ((0, jsx_runtime_1.jsx)("div", Object.assign({}, restProps, { className: (0, classnames_1.default)(className, divided && borders_1.InnerBorder.top) }, { children: children })));
|
|
84
62
|
}
|
|
85
63
|
exports.CardFooter = CardFooter;
|
|
86
64
|
CardFooter.displayName = 'Card.Footer';
|
package/carousel/draggable.d.ts
CHANGED