@sima-land/ui-nucleons 45.0.0-alpha.4 → 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.js +5 -27
- 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/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 +7 -33
- package/avatar/user.d.ts +1 -1
- package/avatar/user.js +8 -29
- 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 +6 -30
- 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-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-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/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,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),
|
package/text-button/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { AnchorHTMLAttributes, ButtonHTMLAttributes, ComponentType, ReactElement, Ref, SVGAttributes } from 'react';
|
|
2
2
|
import { LinkColor } from '../link';
|
|
3
3
|
export type TextButtonSize = 's' | 'm';
|
|
4
4
|
export type TextButtonColor = LinkColor;
|
|
@@ -38,5 +38,5 @@ export type TextButtonProps = TextButtonAsButtonProps | TextButtonAsAnchorProps;
|
|
|
38
38
|
* @param props Свойства.
|
|
39
39
|
* @return Элемент.
|
|
40
40
|
*/
|
|
41
|
-
export declare function TextButton({ size, color, children, className, startIcon: StartIcon, endIcon: EndIcon, buttonRef, anchorRef, underline, disabled, iconGutter, 'data-testid': testId, ...restProps }: TextButtonProps):
|
|
41
|
+
export declare function TextButton({ size, color, children, className, startIcon: StartIcon, endIcon: EndIcon, buttonRef, anchorRef, underline, disabled, iconGutter, 'data-testid': testId, ...restProps }: TextButtonProps): ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
42
42
|
export {};
|
package/text-button/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.TextButton = void 0;
|
|
18
|
-
const
|
|
18
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
19
19
|
const bind_1 = __importDefault(require("classnames/bind"));
|
|
20
20
|
const text_button_module_scss_1 = __importDefault(require("./text-button.module.scss"));
|
|
21
21
|
const cx = bind_1.default.bind(text_button_module_scss_1.default);
|
|
@@ -27,18 +27,15 @@ const cx = bind_1.default.bind(text_button_module_scss_1.default);
|
|
|
27
27
|
function TextButton(_a) {
|
|
28
28
|
var { size = 'm', color = 'basic-blue', children, className, startIcon: StartIcon, endIcon: EndIcon, buttonRef, anchorRef, underline, disabled, iconGutter = 8, 'data-testid': testId = 'text-button' } = _a, restProps = __rest(_a, ["size", "color", "children", "className", "startIcon", "endIcon", "buttonRef", "anchorRef", "underline", "disabled", "iconGutter", 'data-testid']);
|
|
29
29
|
const rooClassName = cx('root', `color-${color}`, `size-${size}`, `icon-gutter-${iconGutter}`, underline && 'underline', disabled && 'disabled', className);
|
|
30
|
-
const content = (
|
|
31
|
-
StartIcon && react_1.default.createElement(StartIcon, { className: cx('icon-start') }),
|
|
32
|
-
children,
|
|
33
|
-
EndIcon && react_1.default.createElement(EndIcon, { className: cx('icon-end') })));
|
|
30
|
+
const content = ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [StartIcon && (0, jsx_runtime_1.jsx)(StartIcon, { className: cx('icon-start') }), children, EndIcon && (0, jsx_runtime_1.jsx)(EndIcon, { className: cx('icon-end') })] }));
|
|
34
31
|
let result;
|
|
35
32
|
switch (restProps.as) {
|
|
36
33
|
case 'anchor':
|
|
37
|
-
result = (
|
|
34
|
+
result = ((0, jsx_runtime_1.jsx)("a", Object.assign({}, restProps, { ref: anchorRef, className: rooClassName, "data-testid": testId }, { children: content })));
|
|
38
35
|
break;
|
|
39
36
|
case 'button':
|
|
40
37
|
default:
|
|
41
|
-
result = (
|
|
38
|
+
result = ((0, jsx_runtime_1.jsx)("button", Object.assign({}, restProps, { ref: buttonRef, className: rooClassName, disabled: disabled, "data-testid": testId }, { children: content })));
|
|
42
39
|
break;
|
|
43
40
|
}
|
|
44
41
|
return result;
|
package/text-field/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
2
|
import { BaseInputProps } from '../base-input-deprecated';
|
|
3
3
|
import { SmallRounds } from '../styling/shapes';
|
|
4
4
|
type Variant = 'desktop' | 'mobile';
|
|
@@ -65,5 +65,5 @@ export declare const DEFAULTS: {
|
|
|
65
65
|
* @param props Свойства.
|
|
66
66
|
* @return Элемент.
|
|
67
67
|
*/
|
|
68
|
-
export declare const TextField:
|
|
68
|
+
export declare const TextField: import("react").ForwardRefExoticComponent<TextFieldProps & import("react").RefAttributes<HTMLInputElement | HTMLTextAreaElement | undefined>>;
|
|
69
69
|
export {};
|
package/text-field/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.TextField = exports.DEFAULTS = exports.HEIGHTS = void 0;
|
|
30
|
-
const
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const react_1 = require("react");
|
|
31
9
|
const lodash_1 = require("lodash");
|
|
32
10
|
const box_1 = require("../box");
|
|
33
11
|
const base_input_deprecated_1 = require("../base-input-deprecated");
|
|
@@ -74,35 +52,27 @@ exports.TextField = (0, react_1.forwardRef)(function TextField({ autoFocus, capt
|
|
|
74
52
|
});
|
|
75
53
|
(0, react_1.useImperativeHandle)(ref, () => baseInputRef.current);
|
|
76
54
|
(0, react_1.useEffect)(() => { var _a; return toggleHasValue(Boolean((_a = baseInputRef.current) === null || _a === void 0 ? void 0 : _a.value)); });
|
|
77
|
-
return (
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
onInput === null || onInput === void 0 ? void 0 : onInput(event);
|
|
101
|
-
toggleHasValue(Boolean(event.target.value));
|
|
102
|
-
}, onChange: (event) => {
|
|
103
|
-
onChange === null || onChange === void 0 ? void 0 : onChange(event);
|
|
104
|
-
toggleHasValue(Boolean(event.target.value));
|
|
105
|
-
}, onKeyDown: onKeyDown, onKeyUp: onKeyUp })))),
|
|
106
|
-
!multiline && Boolean(endAdornment) && (react_1.default.createElement(box_1.Box, { display: 'flex', alignItems: 'center', marginLeft: 4 }, endAdornment))),
|
|
107
|
-
Boolean(caption) && (react_1.default.createElement("div", { className: cx('caption', (0, sizes_1.marginTop)(isMobile ? 1 : 2), failed && 'failed'), children: caption }))));
|
|
55
|
+
return ((0, jsx_runtime_1.jsxs)("div", Object.assign({ "data-testid": dataTestId, className: cx('root', className, classes.root), style: style }, { children: [(0, jsx_runtime_1.jsxs)("div", Object.assign({}, blockProps, { "data-testid": 'text-field:block', className: cx('reset', 'input-block', commonModifyClasses, size && `size-${size}`, focused && classes.blockFocused, multiline && 'multiline', withLabel && 'with-label', variant === 'desktop' && rounds !== 'none' && shapes_1.SmallRounds[rounds], blockProps === null || blockProps === void 0 ? void 0 : blockProps.className), onClick: event => {
|
|
56
|
+
const input = baseInputRef.current;
|
|
57
|
+
onClick === null || onClick === void 0 ? void 0 : onClick(event);
|
|
58
|
+
input &&
|
|
59
|
+
!disabled &&
|
|
60
|
+
!event.defaultPrevented &&
|
|
61
|
+
input !== document.activeElement &&
|
|
62
|
+
input.focus();
|
|
63
|
+
} }, { children: [!multiline && Boolean(startAdornment) && ((0, jsx_runtime_1.jsx)(box_1.Box, Object.assign({ display: 'flex', alignItems: 'center', marginRight: 4 }, { children: startAdornment }))), (0, jsx_runtime_1.jsxs)("div", Object.assign({ className: cx('main-column') }, { children: [withLabel && ((0, jsx_runtime_1.jsx)("label", { className: cx('label', commonModifyClasses, hasValue && 'filled', labelAsPlaceholder && 'as-placeholder'), htmlFor: id, children: label, "data-testid": 'text-field:label' })), (0, jsx_runtime_1.jsx)("div", Object.assign({ className: cx('input-wrapper') }, { children: (0, jsx_runtime_1.jsx)(base_input_deprecated_1.BaseInput, Object.assign({}, baseInputProps, { type: type, id: id, name: name, autoComplete: autoComplete, "data-testid": 'text-field:field', multiline: multiline, ref: baseInputRef, placeholder: withLabel && labelAsPlaceholder ? undefined : placeholder, restPlaceholder: withLabel && labelAsPlaceholder ? undefined : restPlaceholder, autoFocus: autoFocus, className: cx('base-input', commonModifyClasses, classes.baseInput, size && `size-${size}`), defaultValue: defaultValue, value: value, readOnly: readOnly, disabled: disabled, onFocus: (event) => {
|
|
64
|
+
onFocus && onFocus(event);
|
|
65
|
+
toggleHasValue(Boolean(event.target.value));
|
|
66
|
+
toggleFocused(true);
|
|
67
|
+
}, onBlur: (event) => {
|
|
68
|
+
onBlur && onBlur(event);
|
|
69
|
+
toggleHasValue(Boolean(event.target.value));
|
|
70
|
+
toggleFocused(false);
|
|
71
|
+
}, onInput: (event) => {
|
|
72
|
+
onInput === null || onInput === void 0 ? void 0 : onInput(event);
|
|
73
|
+
toggleHasValue(Boolean(event.target.value));
|
|
74
|
+
}, onChange: (event) => {
|
|
75
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(event);
|
|
76
|
+
toggleHasValue(Boolean(event.target.value));
|
|
77
|
+
}, onKeyDown: onKeyDown, onKeyUp: onKeyUp })) }))] })), !multiline && Boolean(endAdornment) && ((0, jsx_runtime_1.jsx)(box_1.Box, Object.assign({ display: 'flex', alignItems: 'center', marginLeft: 4 }, { children: endAdornment })))] })), Boolean(caption) && ((0, jsx_runtime_1.jsx)("div", { className: cx('caption', (0, sizes_1.marginTop)(isMobile ? 1 : 2), failed && 'failed'), children: caption }))] })));
|
|
108
78
|
});
|
package/textarea/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.Textarea = void 0;
|
|
41
|
-
const
|
|
18
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
19
|
+
const react_1 = require("react");
|
|
42
20
|
const base_input_1 = require("../base-input");
|
|
43
21
|
const field_block_1 = require("../field-block");
|
|
44
22
|
const utils_1 = require("../input/utils");
|
|
@@ -65,8 +43,8 @@ function Textarea(_a) {
|
|
|
65
43
|
const [focused, setFocused] = (0, react_1.useState)(false);
|
|
66
44
|
const handleMouseDown = (0, utils_1.useFieldMouseDown)(ref, blockProps === null || blockProps === void 0 ? void 0 : blockProps.onMouseDown);
|
|
67
45
|
(0, react_1.useImperativeHandle)(textareaRef, () => ref.current);
|
|
68
|
-
return (
|
|
69
|
-
className }), "data-testid": testId, caption: caption, disabled: disabled, failed: failed, fixedHeight: false, focused: focused, label: label, labelAsPlaceholder: !focused && !filled, labelProps: { htmlFor: id }, size: 'l', blockProps: Object.assign(Object.assign({}, blockProps), { onMouseDown: handleMouseDown }), main:
|
|
46
|
+
return ((0, jsx_runtime_1.jsx)(field_block_1.FieldBlock, Object.assign({}, restProps, { rootProps: Object.assign(Object.assign({}, restProps.rootProps), { style,
|
|
47
|
+
className }), "data-testid": testId, caption: caption, disabled: disabled, failed: failed, fixedHeight: false, focused: focused, label: label, labelAsPlaceholder: !focused && !filled, labelProps: { htmlFor: id }, size: 'l', blockProps: Object.assign(Object.assign({}, blockProps), { onMouseDown: handleMouseDown }), main: (0, jsx_runtime_1.jsx)(base_input_1.BaseInput, Object.assign({}, baseInputProps, { textareaRef: ref, multiline: true, className: cx('textarea', baseInputProps === null || baseInputProps === void 0 ? void 0 : baseInputProps.className), style: Object.assign(Object.assign({}, baseInputProps === null || baseInputProps === void 0 ? void 0 : baseInputProps.style), { '--placeholder-color': (0, utils_1.definePlaceholderColor)({ failed, disabled }) }), autoComplete: autoComplete, autoFocus: autoFocus, defaultValue: defaultValue, disabled: disabled, id: id, name: name, placeholder: placeholder, readOnly: readOnly, required: required, rows: rows, value: value, onFocus: (event) => {
|
|
70
48
|
onFocus === null || onFocus === void 0 ? void 0 : onFocus(event);
|
|
71
49
|
updateFilled(event);
|
|
72
50
|
setFocused(true);
|
package/timer/index.d.ts
CHANGED