@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
|
@@ -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,14 +15,15 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
38
15
|
};
|
|
39
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
17
|
exports.Select = exports.renderDefaultArrow = void 0;
|
|
41
|
-
const
|
|
18
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
19
|
+
const react_1 = require("react");
|
|
42
20
|
const dropdown_1 = require("../dropdown");
|
|
43
21
|
const dropdown_item_1 = require("../dropdown-item");
|
|
44
22
|
const text_field_1 = require("../text-field");
|
|
45
23
|
const dropdown_2 = require("../_internal/utils/dropdown");
|
|
46
24
|
const bind_1 = __importDefault(require("classnames/bind"));
|
|
47
|
-
const
|
|
48
|
-
const
|
|
25
|
+
const Down_1 = __importDefault(require("@sima-land/ui-quarks/icons/16x16/Stroked/Arrows/Down"));
|
|
26
|
+
const Up_1 = __importDefault(require("@sima-land/ui-quarks/icons/16x16/Stroked/Arrows/Up"));
|
|
49
27
|
const select_module_scss_1 = __importDefault(require("./select.module.scss"));
|
|
50
28
|
const colors_1 = require("../colors");
|
|
51
29
|
const dropdown_loading_1 = require("../_internal/dropdown-loading");
|
|
@@ -57,8 +35,8 @@ const cx = bind_1.default.bind(select_module_scss_1.default);
|
|
|
57
35
|
* @return Элемент.
|
|
58
36
|
*/
|
|
59
37
|
const renderDefaultArrow = (opened) => {
|
|
60
|
-
const ArrowSVG = opened ?
|
|
61
|
-
return
|
|
38
|
+
const ArrowSVG = opened ? Up_1.default : Down_1.default;
|
|
39
|
+
return (0, jsx_runtime_1.jsx)(ArrowSVG, { fill: colors_1.COLORS.get('basic-gray38') });
|
|
62
40
|
};
|
|
63
41
|
exports.renderDefaultArrow = renderDefaultArrow;
|
|
64
42
|
/**
|
|
@@ -78,35 +56,33 @@ const Select = (_a) => {
|
|
|
78
56
|
onMenuToggle && onMenuToggle(opened);
|
|
79
57
|
}, [opened]);
|
|
80
58
|
(0, hooks_1.useOutsideClick)(rootRef, toggleMenu.bind(null, false));
|
|
81
|
-
return (
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
},
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
tabIndex: -1,
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
59
|
+
return ((0, jsx_runtime_1.jsxs)("div", Object.assign({ ref: rootRef, style: style, className: cx('root', className), "data-testid": dataTestId }, { children: [(0, jsx_runtime_1.jsx)(text_field_1.TextField, Object.assign({}, restProps, { size: size, blockProps: {
|
|
60
|
+
ref: fieldRef,
|
|
61
|
+
tabIndex: 0,
|
|
62
|
+
onMouseDown: () => {
|
|
63
|
+
toggleMenu(a => !a);
|
|
64
|
+
},
|
|
65
|
+
onKeyDown: e => {
|
|
66
|
+
e.key === 'Enter' && toggleMenu(true);
|
|
67
|
+
},
|
|
68
|
+
}, onClick: e => {
|
|
69
|
+
e.preventDefault();
|
|
70
|
+
onClick && onClick(e);
|
|
71
|
+
}, className: select_module_scss_1.default.field, "data-testid": 'select:field', label: label, focused: opened, baseInputProps: {
|
|
72
|
+
// чтобы не ловить фокус на поле
|
|
73
|
+
style: { pointerEvents: 'none' },
|
|
74
|
+
tabIndex: -1,
|
|
75
|
+
}, value: value, multiline: false, variant: 'desktop', readOnly: true, endAdornment: typeof endAdornment === 'function' ? endAdornment(opened) : endAdornment })), opened && (loading || options.length > 0) && ((0, jsx_runtime_1.jsx)(dropdown_1.Dropdown, Object.assign({}, (0, dropdown_2.placeDropdown)(size), { ref: menuRef, "data-testid": 'select:menu', role: 'menu', tabIndex: -1, className: cx('menu'), onKeyDown: event => {
|
|
76
|
+
if (event.key === 'Enter') {
|
|
77
|
+
toggleMenu(false);
|
|
78
|
+
fieldRef.current && fieldRef.current.focus();
|
|
79
|
+
}
|
|
80
|
+
}, onBlur: () => {
|
|
101
81
|
toggleMenu(false);
|
|
102
82
|
fieldRef.current && fieldRef.current.focus();
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
} }), loading ? (react_1.default.createElement(dropdown_loading_1.DropdownLoading, { "data-testid": 'select:loading-area' })) : (options.map((option, index) => (react_1.default.createElement(dropdown_item_1.DropdownItem, { size: optionSize, key: index, role: 'menuitem', onClick: () => {
|
|
108
|
-
toggleMenu(false);
|
|
109
|
-
onSelect && onSelect(option);
|
|
110
|
-
} }, renderOption(option)))))))));
|
|
83
|
+
} }, { children: loading ? ((0, jsx_runtime_1.jsx)(dropdown_loading_1.DropdownLoading, { "data-testid": 'select:loading-area' })) : (options.map((option, index) => ((0, jsx_runtime_1.jsx)(dropdown_item_1.DropdownItem, Object.assign({ size: optionSize, role: 'menuitem', onClick: () => {
|
|
84
|
+
toggleMenu(false);
|
|
85
|
+
onSelect && onSelect(option);
|
|
86
|
+
} }, { children: renderOption(option) }), index)))) })))] })));
|
|
111
87
|
};
|
|
112
88
|
exports.Select = Select;
|
package/side-page/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.SidePage = void 0;
|
|
41
|
-
const
|
|
18
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
19
|
+
const react_1 = require("react");
|
|
42
20
|
const define_slots_1 = require("../helpers/define-slots");
|
|
43
21
|
const page_scroll_lock_1 = require("../_internal/page-scroll-lock");
|
|
44
22
|
const slots_1 = require("./slots");
|
|
@@ -62,7 +40,7 @@ const transitionClasses = {
|
|
|
62
40
|
function SidePage(_a) {
|
|
63
41
|
var { shown, withTransitions, onEnter, onEntering, onEntered, onExit, onExiting, onExited } = _a, restProps = __rest(_a, ["shown", "withTransitions", "onEnter", "onEntering", "onEntered", "onExit", "onExiting", "onExited"]);
|
|
64
42
|
const transitionDuration = withTransitions ? 300 : 0;
|
|
65
|
-
return (
|
|
43
|
+
return ((0, jsx_runtime_1.jsx)(CSSTransition_1.default, Object.assign({ in: shown, timeout: transitionDuration, classNames: transitionClasses, unmountOnExit: true, onEntering: onEntering, onEnter: onEnter, onEntered: onEntered, onExit: onExit, onExiting: onExiting, onExited: onExited }, { children: transitionStatus => ((0, jsx_runtime_1.jsx)(SidePageInner, Object.assign({}, restProps, { transitionStatus, transitionDuration }))) })));
|
|
66
44
|
}
|
|
67
45
|
exports.SidePage = SidePage;
|
|
68
46
|
/**
|
|
@@ -80,11 +58,7 @@ function SidePageInner({ size = 'm', children, onClose, withScrollDisable = fals
|
|
|
80
58
|
footer: SidePage.Footer,
|
|
81
59
|
});
|
|
82
60
|
const overlayProps = Object.assign({ style: { '--transition-duration': `${transitionDuration}ms` } }, (transitionStatus !== 'entering' && overlayClickBind));
|
|
83
|
-
return (
|
|
84
|
-
react_1.default.createElement("div", { className: cx('side-page', `size-${size}`) },
|
|
85
|
-
header,
|
|
86
|
-
react_1.default.createElement("div", { ref: ref, className: cx('body') }, body),
|
|
87
|
-
footer)));
|
|
61
|
+
return ((0, jsx_runtime_1.jsx)(modal_overlay_1.ModalOverlay, Object.assign({}, overlayProps, { children: (0, jsx_runtime_1.jsxs)("div", Object.assign({ className: cx('side-page', `size-${size}`) }, { children: [header, (0, jsx_runtime_1.jsx)("div", Object.assign({ ref: ref, className: cx('body') }, { children: body })), footer] })) })));
|
|
88
62
|
}
|
|
89
63
|
SidePage.Header = slots_1.SidePageHeader;
|
|
90
64
|
SidePage.Body = slots_1.SidePageBody;
|
package/side-page/slots.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.SidePageFooter = exports.SidePageBody = exports.SidePageHeader = void 0;
|
|
18
|
-
const
|
|
18
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
19
19
|
const top_bar_1 = require("../top-bar");
|
|
20
20
|
const bottom_bar_1 = require("../bottom-bar");
|
|
21
21
|
const utils_1 = require("../top-bar/utils");
|
|
@@ -28,7 +28,7 @@ const side_page_module_scss_1 = __importDefault(require("./side-page.module.scss
|
|
|
28
28
|
*/
|
|
29
29
|
function SidePageHeader(_a) {
|
|
30
30
|
var { onBack, onClose, buttons } = _a, topBarProps = __rest(_a, ["onBack", "onClose", "buttons"]);
|
|
31
|
-
return (
|
|
31
|
+
return ((0, jsx_runtime_1.jsx)(top_bar_1.TopBar, Object.assign({}, topBarProps, { size: 'unset', className: side_page_module_scss_1.default.header, buttons: (0, utils_1.navigationButtons)({ buttons, onBack, onClose }) })));
|
|
32
32
|
}
|
|
33
33
|
exports.SidePageHeader = SidePageHeader;
|
|
34
34
|
/**
|
|
@@ -37,7 +37,7 @@ exports.SidePageHeader = SidePageHeader;
|
|
|
37
37
|
* @return Элемент.
|
|
38
38
|
*/
|
|
39
39
|
function SidePageBody({ children }) {
|
|
40
|
-
return
|
|
40
|
+
return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: children });
|
|
41
41
|
}
|
|
42
42
|
exports.SidePageBody = SidePageBody;
|
|
43
43
|
/**
|
|
@@ -47,6 +47,6 @@ exports.SidePageBody = SidePageBody;
|
|
|
47
47
|
*/
|
|
48
48
|
function SidePageFooter(_a) {
|
|
49
49
|
var props = __rest(_a, []);
|
|
50
|
-
return
|
|
50
|
+
return (0, jsx_runtime_1.jsx)(bottom_bar_1.BottomBar, Object.assign({}, props, { size: 'unset', className: (0, classnames_1.default)(side_page_module_scss_1.default.footer) }));
|
|
51
51
|
}
|
|
52
52
|
exports.SidePageFooter = SidePageFooter;
|
package/spinner/index.d.ts
CHANGED
package/spinner/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.SpinnerSVG = exports.Spinner = exports.DIAMETERS = void 0;
|
|
7
|
-
const
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
8
|
const lodash_1 = require("lodash");
|
|
9
9
|
const colors_1 = require("../colors");
|
|
10
10
|
const bind_1 = __importDefault(require("classnames/bind"));
|
|
@@ -28,8 +28,7 @@ const DEFAULT_COLOR = 'basic-blue';
|
|
|
28
28
|
function Spinner({ size = 'm', color = DEFAULT_COLOR, className, style, 'data-testid': testId = 'spinner', }) {
|
|
29
29
|
const readySize = (0, lodash_1.has)(exports.DIAMETERS, size) ? size : 'm';
|
|
30
30
|
const readyColor = colors_1.COLORS.has(color) ? color : DEFAULT_COLOR;
|
|
31
|
-
return (
|
|
32
|
-
react_1.default.createElement(SpinnerSVG, { size: readySize, color: readyColor, "data-testid": null })));
|
|
31
|
+
return ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: className, style: style, "data-testid": testId }, { children: (0, jsx_runtime_1.jsx)(SpinnerSVG, { size: readySize, color: readyColor, "data-testid": null }) })));
|
|
33
32
|
}
|
|
34
33
|
exports.Spinner = Spinner;
|
|
35
34
|
/**
|
|
@@ -41,7 +40,6 @@ exports.Spinner = Spinner;
|
|
|
41
40
|
function SpinnerSVG({ size = 'm', color = DEFAULT_COLOR, className, style, 'data-testid': testId = 'spinner', }) {
|
|
42
41
|
const diameter = exports.DIAMETERS[size];
|
|
43
42
|
const radius = diameter / 2;
|
|
44
|
-
return (
|
|
45
|
-
react_1.default.createElement("circle", { className: cx('circle'), cx: radius, cy: radius, r: radius - 1 })));
|
|
43
|
+
return ((0, jsx_runtime_1.jsx)("svg", Object.assign({ style: style, className: cx('spinner', `size-${size}`, className), viewBox: `0 0 ${diameter} ${diameter}`, width: diameter, height: diameter, stroke: colors_1.COLORS.get(color), "data-testid": testId }, { children: (0, jsx_runtime_1.jsx)("circle", { className: cx('circle'), cx: radius, cy: radius, r: radius - 1 }) })));
|
|
46
44
|
}
|
|
47
45
|
exports.SpinnerSVG = SpinnerSVG;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
@use 'sass:map';
|
|
2
|
+
|
|
1
3
|
$pi: 3.141592653589793;
|
|
2
4
|
$sizes: (
|
|
3
5
|
s: 20,
|
|
@@ -32,7 +34,7 @@ $durations: (
|
|
|
32
34
|
width: #{$diameter}px;
|
|
33
35
|
height: #{$diameter}px;
|
|
34
36
|
.circle {
|
|
35
|
-
animation: dash-#{$sizeKey} map
|
|
37
|
+
animation: dash-#{$sizeKey} map.get($durations, $sizeKey) linear infinite;
|
|
36
38
|
}
|
|
37
39
|
@keyframes dash-#{$sizeKey} {
|
|
38
40
|
0% {
|
package/stepper/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { CSSProperties, InputHTMLAttributes, MouseEventHandler } from 'react';
|
|
2
2
|
/** Размер Stepper (влияет на высоту и минимальную ширину). */
|
|
3
3
|
export type StepperSize = 's' | 'm';
|
|
4
4
|
/** Стили Stepper. */
|
|
@@ -35,4 +35,4 @@ export interface StepperProps extends Omit<InputHTMLAttributes<HTMLInputElement>
|
|
|
35
35
|
* @param props Свойства.
|
|
36
36
|
* @return Элемент.
|
|
37
37
|
*/
|
|
38
|
-
export declare const Stepper:
|
|
38
|
+
export declare const Stepper: import("react").ForwardRefExoticComponent<StepperProps & import("react").RefAttributes<HTMLInputElement>>;
|
package/stepper/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,9 +15,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
38
15
|
};
|
|
39
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
17
|
exports.Stepper = void 0;
|
|
41
|
-
const
|
|
42
|
-
const
|
|
43
|
-
const
|
|
18
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
19
|
+
const react_1 = require("react");
|
|
20
|
+
const Plus_1 = __importDefault(require("@sima-land/ui-quarks/icons/16x16/Stroked/Plus"));
|
|
21
|
+
const Minus_1 = __importDefault(require("@sima-land/ui-quarks/icons/16x16/Stroked/Minus"));
|
|
44
22
|
const stepper_module_scss_1 = __importDefault(require("./stepper.module.scss"));
|
|
45
23
|
const bind_1 = __importDefault(require("classnames/bind"));
|
|
46
24
|
const cx = bind_1.default.bind(stepper_module_scss_1.default);
|
|
@@ -61,16 +39,11 @@ exports.Stepper = (0, react_1.forwardRef)(function Stepper(_a, forwardedRef) {
|
|
|
61
39
|
}
|
|
62
40
|
}, [focused, buttonClickBehavior]);
|
|
63
41
|
const rootClassName = cx('root', `size-${size}`, { disabled, focused, failed }, className);
|
|
64
|
-
return (
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
setFocused(false);
|
|
72
|
-
onBlur === null || onBlur === void 0 ? void 0 : onBlur(e);
|
|
73
|
-
} })),
|
|
74
|
-
react_1.default.createElement("button", { tabIndex: -1, hidden: !canAdd, disabled: (_c = plusDisabled !== null && plusDisabled !== void 0 ? plusDisabled : disabled) !== null && _c !== void 0 ? _c : readOnly, className: cx('button'), "data-testid": 'stepper:plus', "aria-label": '\u0423\u0432\u0435\u043B\u0438\u0447\u0438\u0442\u044C', onMouseDown: noBlurOnMousedown, onClick: canAdd && !plusDisabled && !disabled && !readOnly ? onAdd : undefined },
|
|
75
|
-
react_1.default.createElement(plus_1.default, { className: stepper_module_scss_1.default.svg }))));
|
|
42
|
+
return ((0, jsx_runtime_1.jsxs)("div", Object.assign({ "data-testid": testId, style: style, className: rootClassName, onMouseDown: noBlurOnMousedown }, { children: [(0, jsx_runtime_1.jsx)("button", Object.assign({ tabIndex: -1, hidden: !canSubtract, disabled: (_b = minusDisabled !== null && minusDisabled !== void 0 ? minusDisabled : disabled) !== null && _b !== void 0 ? _b : readOnly, className: cx('button'), "data-testid": 'stepper:minus', "aria-label": '\u0423\u043C\u0435\u043D\u044C\u0448\u0438\u0442\u044C', onMouseDown: noBlurOnMousedown, onClick: canSubtract && !minusDisabled && !disabled && !readOnly ? onSubtract : undefined }, { children: (0, jsx_runtime_1.jsx)(Minus_1.default, { className: stepper_module_scss_1.default.svg }) })), (0, jsx_runtime_1.jsx)("input", Object.assign({}, inputProps, { ref: ref, readOnly: readOnly, "data-testid": 'stepper:input', className: cx('input'), value: value, disabled: disabled, onChange: onChange, onFocus: e => {
|
|
43
|
+
setFocused(true);
|
|
44
|
+
onFocus === null || onFocus === void 0 ? void 0 : onFocus(e);
|
|
45
|
+
}, onBlur: e => {
|
|
46
|
+
setFocused(false);
|
|
47
|
+
onBlur === null || onBlur === void 0 ? void 0 : onBlur(e);
|
|
48
|
+
} })), (0, jsx_runtime_1.jsx)("button", Object.assign({ tabIndex: -1, hidden: !canAdd, disabled: (_c = plusDisabled !== null && plusDisabled !== void 0 ? plusDisabled : disabled) !== null && _c !== void 0 ? _c : readOnly, className: cx('button'), "data-testid": 'stepper:plus', "aria-label": '\u0423\u0432\u0435\u043B\u0438\u0447\u0438\u0442\u044C', onMouseDown: noBlurOnMousedown, onClick: canAdd && !plusDisabled && !disabled && !readOnly ? onAdd : undefined }, { children: (0, jsx_runtime_1.jsx)(Plus_1.default, { className: stepper_module_scss_1.default.svg }) }))] })));
|
|
76
49
|
});
|
package/stroked-svg/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
2
|
export interface StrokedSVGProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
3
3
|
/** Компонент, выводящий svg-элемент. */
|
|
4
4
|
component: React.ComponentType<React.SVGAttributes<SVGSVGElement>>;
|
|
@@ -14,4 +14,4 @@ export interface StrokedSVGProps extends Omit<React.HTMLAttributes<HTMLDivElemen
|
|
|
14
14
|
* @param props Свойства.
|
|
15
15
|
* @return Элемент.
|
|
16
16
|
*/
|
|
17
|
-
export declare const StrokedSVG:
|
|
17
|
+
export declare const StrokedSVG: import("react").ForwardRefExoticComponent<StrokedSVGProps & import("react").RefAttributes<HTMLDivElement>>;
|
package/stroked-svg/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.StrokedSVG = void 0;
|
|
41
|
-
const
|
|
18
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
19
|
+
const react_1 = require("react");
|
|
42
20
|
const colors_1 = require("../colors");
|
|
43
21
|
const classnames_1 = __importDefault(require("classnames"));
|
|
44
22
|
const index_module_scss_1 = __importDefault(require("./index.module.scss"));
|
|
@@ -49,8 +27,6 @@ const index_module_scss_1 = __importDefault(require("./index.module.scss"));
|
|
|
49
27
|
*/
|
|
50
28
|
exports.StrokedSVG = (0, react_1.forwardRef)((_a, ref) => {
|
|
51
29
|
var { component: Tag, fill, stroke = colors_1.COLORS.get('basic-gray4'), strokeWidth = 1, className } = _a, restProps = __rest(_a, ["component", "fill", "stroke", "strokeWidth", "className"]);
|
|
52
|
-
return (
|
|
53
|
-
react_1.default.createElement(Tag, { stroke: stroke, strokeWidth: `${strokeWidth * 2}px`, className: index_module_scss_1.default.stroke }),
|
|
54
|
-
react_1.default.createElement(Tag, { fill: fill, className: index_module_scss_1.default.svg })));
|
|
30
|
+
return ((0, jsx_runtime_1.jsxs)("div", Object.assign({ ref: ref, className: (0, classnames_1.default)(index_module_scss_1.default.root, className) }, restProps, { children: [(0, jsx_runtime_1.jsx)(Tag, { stroke: stroke, strokeWidth: `${strokeWidth * 2}px`, className: index_module_scss_1.default.stroke }), (0, jsx_runtime_1.jsx)(Tag, { fill: fill, className: index_module_scss_1.default.svg })] })));
|
|
55
31
|
});
|
|
56
32
|
exports.StrokedSVG.displayName = 'StrokedSVG';
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
@use 'sass:string';
|
|
2
|
+
|
|
1
3
|
$step: 4px;
|
|
2
4
|
|
|
3
5
|
$directions: 'top', 'right', 'bottom', 'left';
|
|
@@ -6,7 +8,7 @@ $directions: 'top', 'right', 'bottom', 'left';
|
|
|
6
8
|
@for $index from -8 through 32 {
|
|
7
9
|
@each $direction in $directions {
|
|
8
10
|
// ключи классов попадают в JS - сокращаем до одной буквы для экономии
|
|
9
|
-
$short:
|
|
11
|
+
$short: string.slice($direction, 0, 1);
|
|
10
12
|
|
|
11
13
|
// внешние отступы
|
|
12
14
|
.M-#{$short}__#{$index} {
|
|
@@ -1,17 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.SuperEllipseClipPath = void 0;
|
|
7
|
-
const
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
5
|
/**
|
|
9
6
|
* Выводит svg-элемент, содержащий clipPath в форме "супер-эллипса".
|
|
10
7
|
* @param props Свойства.
|
|
11
8
|
* @return Элемент.
|
|
12
9
|
*/
|
|
13
|
-
const SuperEllipseClipPath = ({ id }) => (
|
|
14
|
-
react_1.default.createElement("defs", null,
|
|
15
|
-
react_1.default.createElement("clipPath", { id: id, clipPathUnits: 'objectBoundingBox' },
|
|
16
|
-
react_1.default.createElement("path", { d: 'M1 0.5 C 1 0.856, 0.856 1, 0.5 1 S 0 0.856, 0 0.5 S 0.143 0, 0.5 0 S 1 0.143 1 0.5 Z' })))));
|
|
10
|
+
const SuperEllipseClipPath = ({ id }) => ((0, jsx_runtime_1.jsx)("svg", Object.assign({ width: 0, height: 0, style: { position: 'absolute' } }, { children: (0, jsx_runtime_1.jsx)("defs", { children: (0, jsx_runtime_1.jsx)("clipPath", Object.assign({ id: id, clipPathUnits: 'objectBoundingBox' }, { children: (0, jsx_runtime_1.jsx)("path", { d: 'M1 0.5 C 1 0.856, 0.856 1, 0.5 1 S 0 0.856, 0 0.5 S 0.143 0, 0.5 0 S 1 0.143 1 0.5 Z' }) })) }) })));
|
|
17
11
|
exports.SuperEllipseClipPath = SuperEllipseClipPath;
|
package/switcher-row/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.SwitcherRow = void 0;
|
|
7
|
-
const
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
8
|
const checkbox_1 = require("../checkbox");
|
|
9
9
|
const define_slots_1 = require("../helpers/define-slots");
|
|
10
10
|
const radio_button_1 = require("../radio-button");
|
|
@@ -31,13 +31,8 @@ function SwitcherRow({ children, className, style, textAlign = 'left', fieldPosi
|
|
|
31
31
|
const disabled = input === null || input === void 0 ? void 0 : input.props.disabled;
|
|
32
32
|
const fieldId = input === null || input === void 0 ? void 0 : input.props.id;
|
|
33
33
|
// @todo в Safari position: relative ломает vertical-align
|
|
34
|
-
const fieldColumn = input && (
|
|
35
|
-
return (
|
|
36
|
-
fieldPosition === 'start' && fieldColumn,
|
|
37
|
-
react_1.default.createElement("label", { className: cx('col', 'main-col'), htmlFor: fieldId },
|
|
38
|
-
label && (react_1.default.createElement("span", { className: cx('label', { 'for-toggle': toggle }), "data-testid": 'switcher-row:label' }, label)),
|
|
39
|
-
comment && (react_1.default.createElement("span", { className: cx('comment'), "data-testid": 'switcher-row:comment' }, comment))),
|
|
40
|
-
fieldPosition === 'end' && fieldColumn));
|
|
34
|
+
const fieldColumn = input && ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: cx('col', 'field-col', { 'toggle-col': toggle }) }, { children: input })));
|
|
35
|
+
return ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: cx('root', `text-align-${textAlign}`, { failed, disabled }, className), style: style, "data-testid": testId }, { children: [fieldPosition === 'start' && fieldColumn, (0, jsx_runtime_1.jsxs)("label", Object.assign({ className: cx('col', 'main-col'), htmlFor: fieldId }, { children: [label && ((0, jsx_runtime_1.jsx)("span", Object.assign({ className: cx('label', { 'for-toggle': toggle }), "data-testid": 'switcher-row:label' }, { children: label }))), comment && ((0, jsx_runtime_1.jsx)("span", Object.assign({ className: cx('comment'), "data-testid": 'switcher-row:comment' }, { children: comment })))] })), fieldPosition === 'end' && fieldColumn] })));
|
|
41
36
|
}
|
|
42
37
|
exports.SwitcherRow = SwitcherRow;
|
|
43
38
|
/**
|
|
@@ -46,7 +41,7 @@ exports.SwitcherRow = SwitcherRow;
|
|
|
46
41
|
* @return Элемент.
|
|
47
42
|
*/
|
|
48
43
|
function SwitcherRowLabel({ children }) {
|
|
49
|
-
return
|
|
44
|
+
return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: children });
|
|
50
45
|
}
|
|
51
46
|
/**
|
|
52
47
|
* Слот комментария.
|
|
@@ -54,7 +49,7 @@ function SwitcherRowLabel({ children }) {
|
|
|
54
49
|
* @return Элемент.
|
|
55
50
|
*/
|
|
56
51
|
function SwitcherRowComment({ children }) {
|
|
57
|
-
return
|
|
52
|
+
return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: children });
|
|
58
53
|
}
|
|
59
54
|
SwitcherRow.Label = SwitcherRowLabel;
|
|
60
55
|
SwitcherRow.Comment = SwitcherRowComment;
|
package/tabs/index.d.ts
CHANGED
package/tabs/index.js
CHANGED
|
@@ -1,33 +1,11 @@
|
|
|
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.Tabs = void 0;
|
|
30
|
-
const
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const react_1 = require("react");
|
|
31
9
|
const bind_1 = __importDefault(require("classnames/bind"));
|
|
32
10
|
const tabs_module_scss_1 = __importDefault(require("./tabs.module.scss"));
|
|
33
11
|
const cx = bind_1.default.bind(tabs_module_scss_1.default);
|
|
@@ -36,12 +14,12 @@ const cx = bind_1.default.bind(tabs_module_scss_1.default);
|
|
|
36
14
|
* @param props Свойства.
|
|
37
15
|
* @return Элемент.
|
|
38
16
|
*/
|
|
39
|
-
const Tab = ({ name, selected, disabled, 'data-testid': testId = 'tab', onClick, }) => (
|
|
17
|
+
const Tab = ({ name, selected, disabled, 'data-testid': testId = 'tab', onClick, }) => ((0, jsx_runtime_1.jsx)("li", Object.assign({ className: cx('item', { selected, disabled }), "data-testid": testId, onClick: disabled ? undefined : onClick }, { children: String(name) })));
|
|
40
18
|
/**
|
|
41
19
|
* Компонент строки вкладок.
|
|
42
20
|
* @param props Свойства.
|
|
43
21
|
* @return Элемент.
|
|
44
22
|
*/
|
|
45
|
-
const Tabs = ({ children, view = 'clean', stretch = false, gapSize = 'm', className, 'data-testid': testId = 'tabs', }) => (
|
|
23
|
+
const Tabs = ({ children, view = 'clean', stretch = false, gapSize = 'm', className, 'data-testid': testId = 'tabs', }) => ((0, jsx_runtime_1.jsx)("ul", Object.assign({ "data-testid": testId, className: cx('root', `view-${view}`, `gap-${gapSize}`, { stretch }, className) }, { children: react_1.Children.toArray(children).filter(child => (0, react_1.isValidElement)(child) && child.type === Tab) })));
|
|
46
24
|
exports.Tabs = Tabs;
|
|
47
25
|
exports.Tabs.Item = Tab;
|
package/text/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
2
|
import { Size, LineHeight, Weight } from '../styling/fonts';
|
|
3
3
|
import { Token } from '../colors';
|
|
4
4
|
type Align = 'left' | 'center' | 'right' | 'justify';
|
|
@@ -33,5 +33,5 @@ export declare const ALIGNS: Set<Align>;
|
|
|
33
33
|
* @param props Свойства.
|
|
34
34
|
* @return Элемент.
|
|
35
35
|
*/
|
|
36
|
-
export declare const Text:
|
|
36
|
+
export declare const Text: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<TextProps & import("react").RefAttributes<any>>>;
|
|
37
37
|
export {};
|
package/text/index.js
CHANGED
|
@@ -1,33 +1,11 @@
|
|
|
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.Text = exports.ALIGNS = exports.defaultHeights = void 0;
|
|
30
|
-
const
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const react_1 = require("react");
|
|
31
9
|
const bind_1 = __importDefault(require("classnames/bind"));
|
|
32
10
|
const text_module_scss_1 = __importDefault(require("./text.module.scss"));
|
|
33
11
|
const colors_1 = require("../styling/colors");
|
|
@@ -55,7 +33,7 @@ lineHeight = size ? exports.defaultHeights[size] : undefined,
|
|
|
55
33
|
// не устанавливаем значения по умолчанию, чтобы компонент вел себя предсказуемо
|
|
56
34
|
align, color, nowrap, truncate, weight, }, ref) {
|
|
57
35
|
const needLineClamp = typeof truncate === 'number' && truncate > 0;
|
|
58
|
-
return (
|
|
36
|
+
return ((0, jsx_runtime_1.jsx)(Container, { ref: ref, className: cx([
|
|
59
37
|
// styling
|
|
60
38
|
size && (0, fonts_1.size)(size),
|
|
61
39
|
lineHeight && (0, fonts_1.lineHeight)(lineHeight),
|