@sima-land/ui-nucleons 42.1.0 → 43.0.1
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/custom-scrollbar.module.scss +2 -2
- package/alert/alert.module.scss +1 -1
- package/arrow-button/arrow-button.module.scss +2 -2
- package/autocomplete/index.js +10 -12
- package/avatar/index.js +1 -1
- package/avatar/user.js +2 -3
- package/box/index.d.ts +0 -24
- package/box/index.js +0 -28
- package/button/button.module.scss +6 -6
- package/carousel/index.d.ts +9 -12
- package/carousel/index.js +66 -47
- package/checkbox-field/checkbox-field.module.scss +3 -3
- package/chips/chips.module.scss +10 -10
- package/clean-buttons/clean-buttons.module.scss +1 -1
- package/colors.d.ts +29 -34
- package/colors.js +28 -35
- package/colors.scss +28 -37
- package/dot-nav/dot-nav.module.scss +2 -2
- package/dropdown-item/dropdown-item.module.scss +2 -2
- package/file-icon/index.js +2 -2
- package/helpers/find-child-element.d.ts +1 -1
- package/hint/hint.module.scss +5 -5
- package/hooks/index.js +3 -6
- package/link/index.d.ts +1 -1
- package/link/index.js +2 -2
- package/link/link.module.scss +10 -10
- package/nav-bar/index.js +1 -1
- package/nav-bar/nav-bar.module.scss +3 -3
- package/package.json +3 -1
- package/pagination/pagination.module.scss +4 -4
- package/panel/index.js +1 -1
- package/phone-input/index.d.ts +1 -1
- package/phone-input/index.js +24 -17
- package/phone-input/phone-input.module.scss +11 -4
- package/plate/index.js +1 -1
- package/price/price.module.scss +1 -1
- package/rating/rating.module.scss +1 -1
- package/select/index.js +4 -5
- package/spinner/index.d.ts +3 -2
- package/spinner/index.js +2 -2
- package/spinner/spinner.module.scss +1 -0
- package/stepper/stepper.module.scss +8 -8
- package/stroked-svg/index.d.ts +2 -2
- package/stroked-svg/index.js +1 -1
- package/styling/borders.module.scss +3 -3
- package/styling/colors.d.ts +5 -5
- package/tabs/tabs.module.scss +12 -12
- package/text-field/index.d.ts +1 -1
- package/text-field/index.js +13 -7
- package/text-field/text-field.module.scss +18 -18
- package/toggle/toggle.module.scss +3 -3
- package/tooltip/tooltip.module.scss +1 -1
- package/top-bar/top-bar.module.scss +3 -3
- package/unknown-content/unknown-content.module.scss +14 -14
- package/upload/area.js +1 -1
- package/upload/area.module.scss +4 -4
|
@@ -17,7 +17,14 @@
|
|
|
17
17
|
cursor: pointer;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
.
|
|
20
|
+
.arrow {
|
|
21
|
+
display: block;
|
|
22
|
+
fill: colors.$basic-gray38;
|
|
23
|
+
margin-left: 4px;
|
|
24
|
+
pointer-events: none; // игнорируем клики т.к. после них элемент стрелки подменяется и считается что он сработал вне элемента родителя
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.menu {
|
|
21
28
|
position: absolute;
|
|
22
29
|
width: 100%;
|
|
23
30
|
top: 56px;
|
|
@@ -25,15 +32,15 @@
|
|
|
25
32
|
z-index: 2;
|
|
26
33
|
}
|
|
27
34
|
|
|
28
|
-
.
|
|
35
|
+
.menu-item {
|
|
29
36
|
font-size: 16px;
|
|
30
37
|
line-height: 24px;
|
|
31
38
|
.item-name {
|
|
32
|
-
color: colors.$gray87;
|
|
39
|
+
color: colors.$basic-gray87;
|
|
33
40
|
flex-grow: 1;
|
|
34
41
|
margin-left: 16px;
|
|
35
42
|
}
|
|
36
43
|
.item-code {
|
|
37
|
-
color: colors.$gray38;
|
|
44
|
+
color: colors.$basic-gray38;
|
|
38
45
|
}
|
|
39
46
|
}
|
package/plate/index.js
CHANGED
|
@@ -45,5 +45,5 @@ const classnames_1 = __importDefault(require("classnames"));
|
|
|
45
45
|
*/
|
|
46
46
|
exports.Plate = (0, react_1.forwardRef)(function Plate(_a, ref) {
|
|
47
47
|
var { className, children, rounds = 's', shadow = 'z1', 'data-testid': testId = 'plate' } = _a, restProps = __rest(_a, ["className", "children", "rounds", "shadow", 'data-testid']);
|
|
48
|
-
return (react_1.default.createElement("div", Object.assign({ ref: ref, className: (0, classnames_1.default)((0, colors_1.bgColor)('white'), className, shadows_1.BoxShadow[shadow], rounds === 's' && shapes_1.SmallRounds.all, rounds === 'm' && shapes_1.MediumRounds.all), "data-testid": testId, children: children }, restProps)));
|
|
48
|
+
return (react_1.default.createElement("div", Object.assign({ ref: ref, className: (0, classnames_1.default)((0, colors_1.bgColor)('basic-white'), className, shadows_1.BoxShadow[shadow], rounds === 's' && shapes_1.SmallRounds.all, rounds === 'm' && shapes_1.MediumRounds.all), "data-testid": testId, children: children }, restProps)));
|
|
49
49
|
});
|
package/price/price.module.scss
CHANGED
package/select/index.js
CHANGED
|
@@ -54,7 +54,7 @@ const cx = bind_1.default.bind(select_module_scss_1.default);
|
|
|
54
54
|
*/
|
|
55
55
|
const renderDefaultArrow = (opened) => {
|
|
56
56
|
const ArrowSVG = opened ? up_1.default : down_1.default;
|
|
57
|
-
return react_1.default.createElement(ArrowSVG, { fill: colors_1.COLORS.get('gray38') });
|
|
57
|
+
return react_1.default.createElement(ArrowSVG, { fill: colors_1.COLORS.get('basic-gray38') });
|
|
58
58
|
};
|
|
59
59
|
exports.renderDefaultArrow = renderDefaultArrow;
|
|
60
60
|
/**
|
|
@@ -83,10 +83,9 @@ const Select = (_a) => {
|
|
|
83
83
|
onKeyDown: e => {
|
|
84
84
|
e.key === 'Enter' && toggleMenu(true);
|
|
85
85
|
},
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
},
|
|
86
|
+
}, onClick: e => {
|
|
87
|
+
e.preventDefault();
|
|
88
|
+
onClick && onClick(e);
|
|
90
89
|
}, className: select_module_scss_1.default.field, "data-testid": 'select:field', label: label, focused: opened, baseInputProps: {
|
|
91
90
|
// чтобы не ловить фокус на поле
|
|
92
91
|
style: { pointerEvents: 'none' },
|
package/spinner/index.d.ts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
2
|
+
import { Token } from '../colors';
|
|
3
|
+
declare type SpinnerColor = Extract<Token, 'basic-blue' | 'basic-white'>;
|
|
3
4
|
declare type Size = 'small' | 'medium' | 'large';
|
|
4
5
|
export interface SpinnerProps {
|
|
5
6
|
/** Размер. */
|
|
6
7
|
size?: Size;
|
|
7
8
|
/** Цвет. */
|
|
8
|
-
color?:
|
|
9
|
+
color?: SpinnerColor;
|
|
9
10
|
/** Класс. */
|
|
10
11
|
className?: string;
|
|
11
12
|
/** Стили. */
|
package/spinner/index.js
CHANGED
|
@@ -15,8 +15,8 @@ exports.DIAMETERS = {
|
|
|
15
15
|
medium: 48,
|
|
16
16
|
large: 80,
|
|
17
17
|
};
|
|
18
|
-
const DEFAULT_COLOR = '
|
|
19
|
-
const AVAILABLE_COLORS = ['
|
|
18
|
+
const DEFAULT_COLOR = 'basic-blue';
|
|
19
|
+
const AVAILABLE_COLORS = ['basic-blue', 'basic-white'];
|
|
20
20
|
/**
|
|
21
21
|
* Компонент спиннера.
|
|
22
22
|
* @param props Свойства.
|
|
@@ -3,23 +3,23 @@
|
|
|
3
3
|
.root {
|
|
4
4
|
display: flex;
|
|
5
5
|
align-items: center;
|
|
6
|
-
border: 1px solid colors.$gray12;
|
|
6
|
+
border: 1px solid colors.$basic-gray12;
|
|
7
7
|
border-radius: 4px;
|
|
8
|
-
color: colors.$gray87;
|
|
8
|
+
color: colors.$basic-gray87;
|
|
9
9
|
background: #fff;
|
|
10
10
|
&.focused:not(.disabled) {
|
|
11
|
-
border-color: colors.$
|
|
11
|
+
border-color: colors.$basic-blue;
|
|
12
12
|
}
|
|
13
13
|
&.disabled {
|
|
14
|
-
color: colors.$gray24;
|
|
15
|
-
border-color: colors.$gray12;
|
|
14
|
+
color: colors.$basic-gray24;
|
|
15
|
+
border-color: colors.$basic-gray12;
|
|
16
16
|
.button {
|
|
17
|
-
fill: colors.$gray12;
|
|
17
|
+
fill: colors.$basic-gray12;
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
20
|
&.readonly {
|
|
21
21
|
.button {
|
|
22
|
-
fill: colors.$gray24;
|
|
22
|
+
fill: colors.$basic-gray24;
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
&.failed:not(.disabled):not(.focused) {
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
.button {
|
|
59
|
-
fill: colors.$gray38;
|
|
59
|
+
fill: colors.$basic-gray38;
|
|
60
60
|
flex-shrink: 0;
|
|
61
61
|
&:not(.hidden) {
|
|
62
62
|
cursor: pointer;
|
package/stroked-svg/index.d.ts
CHANGED
|
@@ -2,9 +2,9 @@ import React from 'react';
|
|
|
2
2
|
export interface StrokedSVGProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
3
3
|
/** Компонент, выводящий svg-элемент. */
|
|
4
4
|
component: React.ComponentType<React.SVGAttributes<SVGSVGElement>>;
|
|
5
|
-
/** Ширина внешней обводки. */
|
|
6
|
-
stroke?: string;
|
|
7
5
|
/** Цвет внешней обводки. */
|
|
6
|
+
stroke?: string;
|
|
7
|
+
/** Ширина внешней обводки. */
|
|
8
8
|
strokeWidth?: number;
|
|
9
9
|
/** Цвет заливки. */
|
|
10
10
|
fill?: string;
|
package/stroked-svg/index.js
CHANGED
|
@@ -44,7 +44,7 @@ const index_module_scss_1 = __importDefault(require("./index.module.scss"));
|
|
|
44
44
|
* @return Элемент.
|
|
45
45
|
*/
|
|
46
46
|
exports.StrokedSVG = (0, react_1.forwardRef)((_a, ref) => {
|
|
47
|
-
var { component: Tag, fill, stroke = colors_1.COLORS.get('gray4'), strokeWidth = 1, className } = _a, restProps = __rest(_a, ["component", "fill", "stroke", "strokeWidth", "className"]);
|
|
47
|
+
var { component: Tag, fill, stroke = colors_1.COLORS.get('basic-gray4'), strokeWidth = 1, className } = _a, restProps = __rest(_a, ["component", "fill", "stroke", "strokeWidth", "className"]);
|
|
48
48
|
return (react_1.default.createElement("div", Object.assign({ ref: ref, className: (0, classnames_1.default)(index_module_scss_1.default.root, className) }, restProps),
|
|
49
49
|
react_1.default.createElement(Tag, { stroke: stroke, strokeWidth: `${strokeWidth * 2}px`, className: index_module_scss_1.default.stroke }),
|
|
50
50
|
react_1.default.createElement(Tag, { fill: fill, className: index_module_scss_1.default.svg })));
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
@use '../colors';
|
|
2
2
|
|
|
3
3
|
.inner-border-top {
|
|
4
|
-
box-shadow: inset 0 1px 0 colors.$gray12;
|
|
4
|
+
box-shadow: inset 0 1px 0 colors.$basic-gray12;
|
|
5
5
|
}
|
|
6
6
|
|
|
7
7
|
.inner-border-bottom {
|
|
8
|
-
box-shadow: inset 0 -1px 0 colors.$gray12;
|
|
8
|
+
box-shadow: inset 0 -1px 0 colors.$basic-gray12;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
.inner-border-y {
|
|
12
|
-
box-shadow: inset 0 1px 0 colors.$gray12, inset 0 -1px 0 colors.$gray12;
|
|
12
|
+
box-shadow: inset 0 1px 0 colors.$basic-gray12, inset 0 -1px 0 colors.$basic-gray12;
|
|
13
13
|
}
|
package/styling/colors.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export declare const color: (value: "
|
|
2
|
-
export declare const hoverColor: (value: "
|
|
3
|
-
export declare const bgColor: (value: "
|
|
4
|
-
export declare const stroke: (value: "
|
|
5
|
-
export declare const fill: (value: "
|
|
1
|
+
export declare const color: (value: "basic-blue" | "basic-gray87" | "basic-gray76" | "basic-gray66" | "basic-gray54" | "basic-gray38" | "basic-gray24" | "basic-gray12" | "basic-gray8" | "basic-gray4" | "basic-gray2" | "basic-white" | "additional-deep-red" | "additional-red" | "additional-light-red" | "additional-teal" | "additional-green" | "additional-light-green" | "additional-lime" | "additional-faded-green" | "additional-pink" | "additional-purple" | "additional-violet" | "additional-deep-purple" | "additional-electric-blue" | "additional-light-blue" | "additional-cyan" | "additional-sky" | "additional-deep-orange" | "additional-amber" | "additional-yellow" | "additional-gold" | "additional-brown" | "additional-blue-gray" | "additional-deep-blue" | "additional-dark-blue") => string | undefined;
|
|
2
|
+
export declare const hoverColor: (value: "basic-blue" | "basic-gray87" | "basic-gray76" | "basic-gray66" | "basic-gray54" | "basic-gray38" | "basic-gray24" | "basic-gray12" | "basic-gray8" | "basic-gray4" | "basic-gray2" | "basic-white" | "additional-deep-red" | "additional-red" | "additional-light-red" | "additional-teal" | "additional-green" | "additional-light-green" | "additional-lime" | "additional-faded-green" | "additional-pink" | "additional-purple" | "additional-violet" | "additional-deep-purple" | "additional-electric-blue" | "additional-light-blue" | "additional-cyan" | "additional-sky" | "additional-deep-orange" | "additional-amber" | "additional-yellow" | "additional-gold" | "additional-brown" | "additional-blue-gray" | "additional-deep-blue" | "additional-dark-blue") => string | undefined;
|
|
3
|
+
export declare const bgColor: (value: "basic-blue" | "basic-gray87" | "basic-gray76" | "basic-gray66" | "basic-gray54" | "basic-gray38" | "basic-gray24" | "basic-gray12" | "basic-gray8" | "basic-gray4" | "basic-gray2" | "basic-white" | "additional-deep-red" | "additional-red" | "additional-light-red" | "additional-teal" | "additional-green" | "additional-light-green" | "additional-lime" | "additional-faded-green" | "additional-pink" | "additional-purple" | "additional-violet" | "additional-deep-purple" | "additional-electric-blue" | "additional-light-blue" | "additional-cyan" | "additional-sky" | "additional-deep-orange" | "additional-amber" | "additional-yellow" | "additional-gold" | "additional-brown" | "additional-blue-gray" | "additional-deep-blue" | "additional-dark-blue") => string | undefined;
|
|
4
|
+
export declare const stroke: (value: "basic-blue" | "basic-gray87" | "basic-gray76" | "basic-gray66" | "basic-gray54" | "basic-gray38" | "basic-gray24" | "basic-gray12" | "basic-gray8" | "basic-gray4" | "basic-gray2" | "basic-white" | "additional-deep-red" | "additional-red" | "additional-light-red" | "additional-teal" | "additional-green" | "additional-light-green" | "additional-lime" | "additional-faded-green" | "additional-pink" | "additional-purple" | "additional-violet" | "additional-deep-purple" | "additional-electric-blue" | "additional-light-blue" | "additional-cyan" | "additional-sky" | "additional-deep-orange" | "additional-amber" | "additional-yellow" | "additional-gold" | "additional-brown" | "additional-blue-gray" | "additional-deep-blue" | "additional-dark-blue") => string | undefined;
|
|
5
|
+
export declare const fill: (value: "basic-blue" | "basic-gray87" | "basic-gray76" | "basic-gray66" | "basic-gray54" | "basic-gray38" | "basic-gray24" | "basic-gray12" | "basic-gray8" | "basic-gray4" | "basic-gray2" | "basic-white" | "additional-deep-red" | "additional-red" | "additional-light-red" | "additional-teal" | "additional-green" | "additional-light-green" | "additional-lime" | "additional-faded-green" | "additional-pink" | "additional-purple" | "additional-violet" | "additional-deep-purple" | "additional-electric-blue" | "additional-light-blue" | "additional-cyan" | "additional-sky" | "additional-deep-orange" | "additional-amber" | "additional-yellow" | "additional-gold" | "additional-brown" | "additional-blue-gray" | "additional-deep-blue" | "additional-dark-blue") => string | undefined;
|
package/tabs/tabs.module.scss
CHANGED
|
@@ -26,10 +26,10 @@
|
|
|
26
26
|
&.view-clean-underline {
|
|
27
27
|
height: 32px;
|
|
28
28
|
.item {
|
|
29
|
-
color: colors.$gray38;
|
|
29
|
+
color: colors.$basic-gray38;
|
|
30
30
|
&.selected {
|
|
31
31
|
position: relative;
|
|
32
|
-
color: colors.$gray87;
|
|
32
|
+
color: colors.$basic-gray87;
|
|
33
33
|
&::before {
|
|
34
34
|
content: '';
|
|
35
35
|
position: absolute;
|
|
@@ -38,17 +38,17 @@
|
|
|
38
38
|
left: 0;
|
|
39
39
|
right: 0;
|
|
40
40
|
bottom: 0;
|
|
41
|
-
background-color: colors.$
|
|
41
|
+
background-color: colors.$basic-blue;
|
|
42
42
|
border-top-left-radius: 4px;
|
|
43
43
|
border-top-right-radius: 4px;
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
46
|
&.disabled {
|
|
47
|
-
color: colors.$gray12;
|
|
47
|
+
color: colors.$basic-gray12;
|
|
48
48
|
}
|
|
49
49
|
&:not(.selected):not(.disabled):hover {
|
|
50
50
|
cursor: pointer;
|
|
51
|
-
color: colors.$gray54;
|
|
51
|
+
color: colors.$basic-gray54;
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
54
|
}
|
|
@@ -61,26 +61,26 @@
|
|
|
61
61
|
content: '';
|
|
62
62
|
height: 1px;
|
|
63
63
|
width: 100%;
|
|
64
|
-
background-color: colors.$gray12;
|
|
64
|
+
background-color: colors.$basic-gray12;
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
67
|
&.view-round {
|
|
68
68
|
height: 40px;
|
|
69
69
|
.item {
|
|
70
|
-
color: colors.$gray87;
|
|
70
|
+
color: colors.$basic-gray87;
|
|
71
71
|
padding: 8px 16px;
|
|
72
72
|
border-radius: 4px;
|
|
73
|
-
background-color: colors.$gray4;
|
|
73
|
+
background-color: colors.$basic-gray4;
|
|
74
74
|
&.selected {
|
|
75
|
-
background-color: colors.$
|
|
76
|
-
color: colors.$white;
|
|
75
|
+
background-color: colors.$basic-blue;
|
|
76
|
+
color: colors.$basic-white;
|
|
77
77
|
}
|
|
78
78
|
&.disabled {
|
|
79
|
-
color: colors.$gray24;
|
|
79
|
+
color: colors.$basic-gray24;
|
|
80
80
|
}
|
|
81
81
|
&:not(.selected):not(.disabled):hover {
|
|
82
82
|
cursor: pointer;
|
|
83
|
-
background-color: colors.$gray8;
|
|
83
|
+
background-color: colors.$basic-gray8;
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
86
|
}
|
package/text-field/index.d.ts
CHANGED
|
@@ -47,7 +47,7 @@ export interface TextFieldProps extends Omit<React.InputHTMLAttributes<HTMLInput
|
|
|
47
47
|
/** Вариант отображения. */
|
|
48
48
|
variant?: Variant;
|
|
49
49
|
/** Свойства элемента-блока. */
|
|
50
|
-
blockProps?: React.HTMLProps<HTMLDivElement>;
|
|
50
|
+
blockProps?: Omit<React.HTMLProps<HTMLDivElement>, 'onClick'>;
|
|
51
51
|
/** Идентификатор для систем автоматизированного тестирования. */
|
|
52
52
|
'data-testid'?: string;
|
|
53
53
|
}
|
package/text-field/index.js
CHANGED
|
@@ -51,7 +51,7 @@ const modifiersToClasses = ({ disabled, failed, focused, variant, }) => cx(disab
|
|
|
51
51
|
* @param props Свойства.
|
|
52
52
|
* @return Элемент.
|
|
53
53
|
*/
|
|
54
|
-
exports.TextField = (0, react_1.forwardRef)(function TextField({ autoFocus, caption, classes = {}, defaultValue, disabled, endAdornment, failed, focused: asFocused, label, onClick, onBlur, onChange, onFocus, onInput, onKeyDown, onKeyUp, placeholder, readOnly, rounds = 'all', size = exports.DEFAULTS.size, startAdornment, value, variant = 'desktop', multiline, baseInputProps = {}, className, restPlaceholder, style, blockProps, 'data-testid': dataTestId, }, ref) {
|
|
54
|
+
exports.TextField = (0, react_1.forwardRef)(function TextField({ autoFocus, caption, classes = {}, defaultValue, disabled, endAdornment, failed, focused: asFocused, label, onClick, onBlur, onChange, onFocus, onInput, onKeyDown, onKeyUp, placeholder, readOnly, rounds = 'all', size = exports.DEFAULTS.size, startAdornment, value, variant = 'desktop', multiline, baseInputProps = {}, className, restPlaceholder, style, blockProps, 'data-testid': dataTestId, type, name, autoComplete, id, }, ref) {
|
|
55
55
|
const [hasValue, toggleHasValue] = (0, react_1.useState)(isVisible(value) || isVisible(defaultValue));
|
|
56
56
|
const [reallyFocused, toggleFocused] = (0, react_1.useState)(autoFocus);
|
|
57
57
|
const focused = reallyFocused || Boolean(asFocused);
|
|
@@ -68,9 +68,9 @@ exports.TextField = (0, react_1.forwardRef)(function TextField({ autoFocus, capt
|
|
|
68
68
|
variant,
|
|
69
69
|
});
|
|
70
70
|
(0, react_1.useImperativeHandle)(ref, () => baseInputRef.current);
|
|
71
|
-
(0, react_1.useEffect)(() => toggleHasValue(Boolean(baseInputRef.current.value)));
|
|
71
|
+
(0, react_1.useEffect)(() => { var _a; return toggleHasValue(Boolean((_a = baseInputRef.current) === null || _a === void 0 ? void 0 : _a.value)); });
|
|
72
72
|
return (react_1.default.createElement("div", { "data-testid": dataTestId, className: cx('root', className, classes.root), style: style },
|
|
73
|
-
react_1.default.createElement("div", Object.assign({ "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 => {
|
|
73
|
+
react_1.default.createElement("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 => {
|
|
74
74
|
const input = baseInputRef.current;
|
|
75
75
|
onClick === null || onClick === void 0 ? void 0 : onClick(event);
|
|
76
76
|
input &&
|
|
@@ -78,12 +78,12 @@ exports.TextField = (0, react_1.forwardRef)(function TextField({ autoFocus, capt
|
|
|
78
78
|
!event.defaultPrevented &&
|
|
79
79
|
input !== document.activeElement &&
|
|
80
80
|
input.focus();
|
|
81
|
-
} }
|
|
81
|
+
} }),
|
|
82
82
|
!multiline && Boolean(startAdornment) && (react_1.default.createElement(box_1.Box, { display: 'flex', alignItems: 'center', marginRight: 4 }, startAdornment)),
|
|
83
83
|
react_1.default.createElement("div", { className: cx('main-column') },
|
|
84
|
-
withLabel && (react_1.default.createElement("label", { className: cx('label', commonModifyClasses, hasValue && 'filled', labelAsPlaceholder && 'as-placeholder'), children: label, "data-testid": 'text-field:label' })),
|
|
84
|
+
withLabel && (react_1.default.createElement("label", { className: cx('label', commonModifyClasses, hasValue && 'filled', labelAsPlaceholder && 'as-placeholder'), htmlFor: id, children: label, "data-testid": 'text-field:label' })),
|
|
85
85
|
react_1.default.createElement("div", { className: cx('input-wrapper') },
|
|
86
|
-
react_1.default.createElement(base_input_1.BaseInput, Object.assign({}, baseInputProps, { "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) => {
|
|
86
|
+
react_1.default.createElement(base_input_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) => {
|
|
87
87
|
onFocus && onFocus(event);
|
|
88
88
|
toggleHasValue(Boolean(event.target.value));
|
|
89
89
|
toggleFocused(true);
|
|
@@ -91,7 +91,13 @@ exports.TextField = (0, react_1.forwardRef)(function TextField({ autoFocus, capt
|
|
|
91
91
|
onBlur && onBlur(event);
|
|
92
92
|
toggleHasValue(Boolean(event.target.value));
|
|
93
93
|
toggleFocused(false);
|
|
94
|
-
}, onInput:
|
|
94
|
+
}, onInput: (event) => {
|
|
95
|
+
onInput === null || onInput === void 0 ? void 0 : onInput(event);
|
|
96
|
+
toggleHasValue(Boolean(event.target.value));
|
|
97
|
+
}, onChange: (event) => {
|
|
98
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(event);
|
|
99
|
+
toggleHasValue(Boolean(event.target.value));
|
|
100
|
+
}, onKeyDown: onKeyDown, onKeyUp: onKeyUp })))),
|
|
95
101
|
!multiline && Boolean(endAdornment) && (react_1.default.createElement(box_1.Box, { display: 'flex', alignItems: 'center', marginLeft: 4 }, endAdornment))),
|
|
96
102
|
Boolean(caption) && (react_1.default.createElement("div", { className: cx('caption', (0, sizes_1.marginTop)(isMobile ? 1 : 2), failed && 'failed'), children: caption }))));
|
|
97
103
|
});
|
|
@@ -38,16 +38,16 @@ input.reset {
|
|
|
38
38
|
// variant: desktop
|
|
39
39
|
&.variant-desktop {
|
|
40
40
|
background-color: #fff;
|
|
41
|
-
border: 1px solid colors.$gray12;
|
|
41
|
+
border: 1px solid colors.$basic-gray12;
|
|
42
42
|
&.disabled {
|
|
43
|
-
border-color: colors.$gray12;
|
|
44
|
-
background-color: colors.$gray2;
|
|
43
|
+
border-color: colors.$basic-gray12;
|
|
44
|
+
background-color: colors.$basic-gray2;
|
|
45
45
|
}
|
|
46
46
|
&.focused:not(.disabled):not(.failed) {
|
|
47
|
-
border-color: colors.$
|
|
47
|
+
border-color: colors.$basic-blue;
|
|
48
48
|
}
|
|
49
49
|
&.disabled {
|
|
50
|
-
border-color: colors.$gray12;
|
|
50
|
+
border-color: colors.$basic-gray12;
|
|
51
51
|
}
|
|
52
52
|
&:not(.multiline) {
|
|
53
53
|
&.size-xs {
|
|
@@ -79,7 +79,7 @@ input.reset {
|
|
|
79
79
|
&.variant-mobile {
|
|
80
80
|
padding: 0;
|
|
81
81
|
border: 0;
|
|
82
|
-
box-shadow: inset 0 -1px colors.$gray12;
|
|
82
|
+
box-shadow: inset 0 -1px colors.$basic-gray12;
|
|
83
83
|
.main-column {
|
|
84
84
|
height: 100%;
|
|
85
85
|
justify-content: center;
|
|
@@ -88,7 +88,7 @@ input.reset {
|
|
|
88
88
|
justify-content: flex-start;
|
|
89
89
|
}
|
|
90
90
|
&.focused:not(.disabled) {
|
|
91
|
-
box-shadow: inset 0 -1px colors.$
|
|
91
|
+
box-shadow: inset 0 -1px colors.$basic-blue;
|
|
92
92
|
}
|
|
93
93
|
&.failed:not(:disabled) {
|
|
94
94
|
box-shadow: inset 0 -1px colors.$additional-red;
|
|
@@ -109,9 +109,9 @@ input.reset {
|
|
|
109
109
|
}
|
|
110
110
|
|
|
111
111
|
// чтобы startAdornment/endAdornment подхватили цвет
|
|
112
|
-
color: colors.$gray87;
|
|
112
|
+
color: colors.$basic-gray87;
|
|
113
113
|
&.disabled {
|
|
114
|
-
color: colors.$gray24;
|
|
114
|
+
color: colors.$basic-gray24;
|
|
115
115
|
}
|
|
116
116
|
}
|
|
117
117
|
|
|
@@ -138,9 +138,9 @@ input.reset {
|
|
|
138
138
|
transform-origin: left bottom;
|
|
139
139
|
white-space: nowrap;
|
|
140
140
|
overflow: hidden;
|
|
141
|
-
color: colors.$gray38;
|
|
141
|
+
color: colors.$basic-gray38;
|
|
142
142
|
&.disabled {
|
|
143
|
-
color: colors.$gray24;
|
|
143
|
+
color: colors.$basic-gray24;
|
|
144
144
|
}
|
|
145
145
|
&.as-placeholder {
|
|
146
146
|
font-size: 16px;
|
|
@@ -154,7 +154,7 @@ input.reset {
|
|
|
154
154
|
}
|
|
155
155
|
&.variant-mobile {
|
|
156
156
|
&.focused:not(.failed) {
|
|
157
|
-
color: colors.$
|
|
157
|
+
color: colors.$basic-blue;
|
|
158
158
|
}
|
|
159
159
|
&.failed.focused,
|
|
160
160
|
&.failed.filled {
|
|
@@ -172,15 +172,15 @@ input.reset {
|
|
|
172
172
|
.input-wrapper .base-input {
|
|
173
173
|
font-size: 16px;
|
|
174
174
|
line-height: 24px;
|
|
175
|
-
color: colors.$gray87;
|
|
176
|
-
--placeholder-color: #{colors.$gray38};
|
|
175
|
+
color: colors.$basic-gray87;
|
|
176
|
+
--placeholder-color: #{colors.$basic-gray38};
|
|
177
177
|
background-color: transparent;
|
|
178
178
|
width: 0;
|
|
179
179
|
flex-grow: 1;
|
|
180
180
|
&.disabled {
|
|
181
|
-
color: colors.$gray24;
|
|
182
|
-
--placeholder-color: #{colors.$gray24};
|
|
183
|
-
-webkit-text-fill-color: colors.$gray24; //fix safari disabled
|
|
181
|
+
color: colors.$basic-gray24;
|
|
182
|
+
--placeholder-color: #{colors.$basic-gray24};
|
|
183
|
+
-webkit-text-fill-color: colors.$basic-gray24; //fix safari disabled
|
|
184
184
|
}
|
|
185
185
|
&.size-xs {
|
|
186
186
|
font-size: 14px;
|
|
@@ -198,7 +198,7 @@ input.reset {
|
|
|
198
198
|
.caption {
|
|
199
199
|
font-size: 12px;
|
|
200
200
|
line-height: 16px;
|
|
201
|
-
color: colors.$gray38;
|
|
201
|
+
color: colors.$basic-gray38;
|
|
202
202
|
&.failed {
|
|
203
203
|
color: colors.$additional-red;
|
|
204
204
|
}
|
|
@@ -12,13 +12,13 @@
|
|
|
12
12
|
.input {
|
|
13
13
|
display: none;
|
|
14
14
|
&:checked + .switch {
|
|
15
|
-
background: colors.$
|
|
15
|
+
background: colors.$basic-blue;
|
|
16
16
|
&::after {
|
|
17
17
|
left: calc(100% - 22px);
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
20
|
&:disabled + .switch {
|
|
21
|
-
background: colors.$gray4;
|
|
21
|
+
background: colors.$basic-gray4;
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
24
|
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
width: 44px;
|
|
29
29
|
height: 24px;
|
|
30
30
|
border-radius: 12px;
|
|
31
|
-
background: colors.$gray12;
|
|
31
|
+
background: colors.$basic-gray12;
|
|
32
32
|
transition: background 0.16s ease-in-out;
|
|
33
33
|
&::after {
|
|
34
34
|
content: '';
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
.subtitle {
|
|
26
26
|
font-size: 12px;
|
|
27
27
|
line-height: 16px;
|
|
28
|
-
color: colors.$gray38;
|
|
28
|
+
color: colors.$basic-gray38;
|
|
29
29
|
}
|
|
30
30
|
.icon-button {
|
|
31
31
|
+ .icon-button {
|
|
@@ -84,10 +84,10 @@
|
|
|
84
84
|
flex-shrink: 0;
|
|
85
85
|
overflow: hidden;
|
|
86
86
|
background: transparent;
|
|
87
|
-
color: colors.$gray87;
|
|
87
|
+
color: colors.$basic-gray87;
|
|
88
88
|
&:not(.stub):hover {
|
|
89
89
|
cursor: pointer;
|
|
90
|
-
color: colors.$gray54;
|
|
90
|
+
color: colors.$basic-gray54;
|
|
91
91
|
}
|
|
92
92
|
> svg {
|
|
93
93
|
fill: currentColor;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
@use '../breakpoints';
|
|
3
3
|
|
|
4
4
|
.root {
|
|
5
|
-
color: colors.$gray87;
|
|
5
|
+
color: colors.$basic-gray87;
|
|
6
6
|
font-size: 16px;
|
|
7
7
|
line-height: 24px;
|
|
8
8
|
|
|
@@ -15,10 +15,10 @@
|
|
|
15
15
|
|
|
16
16
|
// ссылки
|
|
17
17
|
a {
|
|
18
|
-
color: colors.$
|
|
18
|
+
color: colors.$basic-blue;
|
|
19
19
|
text-decoration: none;
|
|
20
20
|
&:hover {
|
|
21
|
-
color: colors.$
|
|
21
|
+
color: colors.$additional-deep-blue;
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
24
|
|
|
@@ -56,14 +56,14 @@
|
|
|
56
56
|
font-weight: 600;
|
|
57
57
|
font-size: 16px;
|
|
58
58
|
line-height: 24px;
|
|
59
|
-
color: colors.$gray38;
|
|
59
|
+
color: colors.$basic-gray38;
|
|
60
60
|
margin-bottom: 16px;
|
|
61
61
|
}
|
|
62
62
|
h5 {
|
|
63
63
|
font-weight: normal;
|
|
64
64
|
font-size: 14px;
|
|
65
65
|
line-height: 20px;
|
|
66
|
-
color: colors.$gray38;
|
|
66
|
+
color: colors.$basic-gray38;
|
|
67
67
|
margin-bottom: 24px;
|
|
68
68
|
}
|
|
69
69
|
h6 {
|
|
@@ -96,13 +96,13 @@
|
|
|
96
96
|
font-weight: 600;
|
|
97
97
|
font-size: 16px;
|
|
98
98
|
line-height: 24px;
|
|
99
|
-
color: colors.$gray38;
|
|
99
|
+
color: colors.$basic-gray38;
|
|
100
100
|
margin-bottom: 16px;
|
|
101
101
|
}
|
|
102
102
|
h5 {
|
|
103
103
|
font-size: 14px;
|
|
104
104
|
line-height: 20px;
|
|
105
|
-
color: colors.$gray38;
|
|
105
|
+
color: colors.$basic-gray38;
|
|
106
106
|
margin-bottom: 24px;
|
|
107
107
|
}
|
|
108
108
|
h6 {
|
|
@@ -160,7 +160,7 @@
|
|
|
160
160
|
@include breakpoints.up('xs') {
|
|
161
161
|
table {
|
|
162
162
|
thead {
|
|
163
|
-
color: colors.$gray38;
|
|
163
|
+
color: colors.$basic-gray38;
|
|
164
164
|
font-size: 14px;
|
|
165
165
|
line-height: 20px;
|
|
166
166
|
td,
|
|
@@ -173,7 +173,7 @@
|
|
|
173
173
|
padding: 24px 0;
|
|
174
174
|
|
|
175
175
|
// накидываем именно сюда чтобы работало в Safari
|
|
176
|
-
box-shadow: inset 0 -1px 0 colors.$gray12;
|
|
176
|
+
box-shadow: inset 0 -1px 0 colors.$basic-gray12;
|
|
177
177
|
&:not(:last-child) {
|
|
178
178
|
padding-right: 32px;
|
|
179
179
|
}
|
|
@@ -190,7 +190,7 @@
|
|
|
190
190
|
display: block;
|
|
191
191
|
}
|
|
192
192
|
table {
|
|
193
|
-
box-shadow: inset 0 1px 0 colors.$gray12;
|
|
193
|
+
box-shadow: inset 0 1px 0 colors.$basic-gray12;
|
|
194
194
|
}
|
|
195
195
|
thead {
|
|
196
196
|
position: absolute;
|
|
@@ -199,7 +199,7 @@
|
|
|
199
199
|
}
|
|
200
200
|
tr {
|
|
201
201
|
padding: 32px 0;
|
|
202
|
-
box-shadow: inset 0 -1px 0 colors.$gray12;
|
|
202
|
+
box-shadow: inset 0 -1px 0 colors.$basic-gray12;
|
|
203
203
|
}
|
|
204
204
|
td + td {
|
|
205
205
|
margin-top: 24px;
|
|
@@ -209,7 +209,7 @@
|
|
|
209
209
|
display: block;
|
|
210
210
|
font-size: 14px;
|
|
211
211
|
line-height: 20px;
|
|
212
|
-
color: colors.$gray38;
|
|
212
|
+
color: colors.$basic-gray38;
|
|
213
213
|
margin-bottom: 8px;
|
|
214
214
|
}
|
|
215
215
|
}
|
|
@@ -264,7 +264,7 @@
|
|
|
264
264
|
font-weight: normal;
|
|
265
265
|
font-size: 16px;
|
|
266
266
|
line-height: 24px;
|
|
267
|
-
color: colors.$gray38;
|
|
267
|
+
color: colors.$basic-gray38;
|
|
268
268
|
}
|
|
269
269
|
}
|
|
270
270
|
|
|
@@ -273,7 +273,7 @@
|
|
|
273
273
|
display: block;
|
|
274
274
|
width: 100%;
|
|
275
275
|
height: 1px;
|
|
276
|
-
background: colors.$gray12;
|
|
276
|
+
background: colors.$basic-gray12;
|
|
277
277
|
margin-bottom: 32px;
|
|
278
278
|
@include breakpoints.up('xs') {
|
|
279
279
|
margin-bottom: 40px;
|