@sima-land/ui-nucleons 42.0.0 → 43.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/_internal/custom-scrollbar/custom-scrollbar.module.scss +2 -2
  2. package/alert/alert.module.scss +1 -1
  3. package/arrow-button/arrow-button.module.scss +2 -2
  4. package/autocomplete/index.js +10 -12
  5. package/avatar/index.js +1 -1
  6. package/avatar/user.js +2 -3
  7. package/box/index.d.ts +0 -24
  8. package/box/index.js +0 -28
  9. package/button/button.module.scss +6 -6
  10. package/carousel/index.d.ts +9 -12
  11. package/carousel/index.js +66 -47
  12. package/checkbox-field/checkbox-field.module.scss +3 -3
  13. package/chips/chips.module.scss +10 -10
  14. package/clean-buttons/clean-buttons.module.scss +1 -1
  15. package/colors.d.ts +29 -34
  16. package/colors.js +28 -35
  17. package/colors.scss +28 -37
  18. package/dot-nav/dot-nav.module.scss +2 -2
  19. package/dropdown-item/dropdown-item.module.scss +2 -2
  20. package/file-icon/index.js +2 -2
  21. package/helpers/find-child-element.d.ts +1 -1
  22. package/hint/hint.module.scss +5 -5
  23. package/hooks/index.js +3 -6
  24. package/link/index.d.ts +1 -1
  25. package/link/index.js +1 -1
  26. package/link/link.module.scss +7 -7
  27. package/nav-bar/index.js +1 -1
  28. package/nav-bar/nav-bar.module.scss +3 -3
  29. package/package.json +3 -1
  30. package/pagination/pagination.module.scss +4 -4
  31. package/panel/index.js +1 -1
  32. package/phone-input/index.d.ts +1 -1
  33. package/phone-input/index.js +24 -17
  34. package/phone-input/phone-input.module.scss +11 -4
  35. package/plate/index.js +1 -1
  36. package/price/price.module.scss +1 -1
  37. package/rating/rating.module.scss +1 -1
  38. package/select/index.d.ts +9 -2
  39. package/select/index.js +16 -8
  40. package/spinner/index.d.ts +3 -2
  41. package/spinner/index.js +2 -2
  42. package/spinner/spinner.module.scss +1 -0
  43. package/stepper/stepper.module.scss +8 -8
  44. package/stroked-svg/index.d.ts +2 -2
  45. package/stroked-svg/index.js +1 -1
  46. package/styling/borders.module.scss +3 -3
  47. package/styling/colors.d.ts +5 -5
  48. package/tabs/tabs.module.scss +12 -12
  49. package/text-field/index.d.ts +1 -1
  50. package/text-field/index.js +13 -7
  51. package/text-field/text-field.module.scss +18 -18
  52. package/toggle/toggle.module.scss +3 -3
  53. package/tooltip/tooltip.module.scss +1 -1
  54. package/top-bar/top-bar.module.scss +3 -3
  55. package/unknown-content/unknown-content.module.scss +14 -14
  56. package/upload/area.js +1 -1
  57. package/upload/area.module.scss +4 -4
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
  });
@@ -5,7 +5,7 @@
5
5
  display: inline-block;
6
6
  white-space: nowrap;
7
7
  &.crossed-out {
8
- color: colors.$gray38;
8
+ color: colors.$basic-gray38;
9
9
  text-decoration: line-through;
10
10
  }
11
11
  }
@@ -30,7 +30,7 @@
30
30
  left: 0;
31
31
  width: 100%;
32
32
  height: 100%;
33
- fill: colors.$gray12;
33
+ fill: colors.$basic-gray12;
34
34
  &.half {
35
35
  width: 50%;
36
36
  fill: colors.$additional-amber;
package/select/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { TextFieldProps } from '../text-field';
3
3
  declare type Size = 's' | 'm' | 'l' | 'xl';
4
- export interface SelectProps extends Omit<TextFieldProps, 'style'> {
4
+ export interface SelectProps extends Omit<TextFieldProps, 'style' | 'endAdornment'> {
5
5
  /** Нужно ли выводить состояние загрузки списка. */
6
6
  loading?: boolean;
7
7
  /** Сработает при открытии/закрытии меню. */
@@ -16,11 +16,18 @@ export interface SelectProps extends Omit<TextFieldProps, 'style'> {
16
16
  renderOption?: (option: any) => React.ReactNode;
17
17
  /** Стили. */
18
18
  style?: React.CSSProperties;
19
+ endAdornment?: TextFieldProps['endAdornment'] | ((opened: boolean) => React.ReactNode);
19
20
  }
21
+ /**
22
+ * Выводит иконку стрелки для поля Select по умолчанию.
23
+ * @param opened Открыт ли список опций.
24
+ * @return Элемент.
25
+ */
26
+ export declare const renderDefaultArrow: (opened: boolean) => JSX.Element;
20
27
  /**
21
28
  * Поле выбора из списка.
22
29
  * @param props Свойства.
23
30
  * @return Элемент.
24
31
  */
25
- export declare const Select: ({ options, optionSize, onSelect, style, className, label, onClick, value, loading, onMenuToggle, renderOption, "data-testid": dataTestId, size, ...restProps }: SelectProps) => JSX.Element;
32
+ export declare const Select: ({ options, optionSize, onSelect, style, className, label, onClick, value, loading, onMenuToggle, renderOption, "data-testid": dataTestId, size, endAdornment, ...restProps }: SelectProps) => JSX.Element;
26
33
  export {};
package/select/index.js CHANGED
@@ -33,7 +33,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
33
33
  return (mod && mod.__esModule) ? mod : { "default": mod };
34
34
  };
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.Select = void 0;
36
+ exports.Select = exports.renderDefaultArrow = void 0;
37
37
  const react_1 = __importStar(require("react"));
38
38
  const dropdown_1 = require("../dropdown");
39
39
  const dropdown_item_1 = require("../dropdown-item");
@@ -47,18 +47,27 @@ const colors_1 = require("../colors");
47
47
  const dropdown_loading_1 = require("../_internal/dropdown-loading");
48
48
  const hooks_1 = require("../hooks");
49
49
  const cx = bind_1.default.bind(select_module_scss_1.default);
50
+ /**
51
+ * Выводит иконку стрелки для поля Select по умолчанию.
52
+ * @param opened Открыт ли список опций.
53
+ * @return Элемент.
54
+ */
55
+ const renderDefaultArrow = (opened) => {
56
+ const ArrowSVG = opened ? up_1.default : down_1.default;
57
+ return react_1.default.createElement(ArrowSVG, { fill: colors_1.COLORS.get('basic-gray38') });
58
+ };
59
+ exports.renderDefaultArrow = renderDefaultArrow;
50
60
  /**
51
61
  * Поле выбора из списка.
52
62
  * @param props Свойства.
53
63
  * @return Элемент.
54
64
  */
55
65
  const Select = (_a) => {
56
- var { options, optionSize, onSelect, style, className, label, onClick, value, loading, onMenuToggle, renderOption = String, 'data-testid': dataTestId, size } = _a, restProps = __rest(_a, ["options", "optionSize", "onSelect", "style", "className", "label", "onClick", "value", "loading", "onMenuToggle", "renderOption", 'data-testid', "size"]);
66
+ var { options, optionSize, onSelect, style, className, label, onClick, value, loading, onMenuToggle, renderOption = String, 'data-testid': dataTestId, size, endAdornment = exports.renderDefaultArrow } = _a, restProps = __rest(_a, ["options", "optionSize", "onSelect", "style", "className", "label", "onClick", "value", "loading", "onMenuToggle", "renderOption", 'data-testid', "size", "endAdornment"]);
57
67
  const rootRef = (0, react_1.useRef)(null);
58
68
  const fieldRef = (0, react_1.useRef)(null);
59
69
  const menuRef = (0, react_1.useRef)(null);
60
70
  const [opened, toggleMenu] = (0, react_1.useState)(false);
61
- const ArrowSVG = opened ? up_1.default : down_1.default;
62
71
  (0, react_1.useEffect)(() => {
63
72
  opened && menuRef.current && menuRef.current.focus();
64
73
  onMenuToggle && onMenuToggle(opened);
@@ -74,15 +83,14 @@ const Select = (_a) => {
74
83
  onKeyDown: e => {
75
84
  e.key === 'Enter' && toggleMenu(true);
76
85
  },
77
- onClick: e => {
78
- e.preventDefault();
79
- onClick && onClick(e);
80
- },
86
+ }, onClick: e => {
87
+ e.preventDefault();
88
+ onClick && onClick(e);
81
89
  }, className: select_module_scss_1.default.field, "data-testid": 'select:field', label: label, focused: opened, baseInputProps: {
82
90
  // чтобы не ловить фокус на поле
83
91
  style: { pointerEvents: 'none' },
84
92
  tabIndex: -1,
85
- }, value: value, multiline: false, variant: 'desktop', readOnly: true, endAdornment: react_1.default.createElement(ArrowSVG, { fill: colors_1.COLORS.get('gray38') }) })),
93
+ }, value: value, multiline: false, variant: 'desktop', readOnly: true, endAdornment: typeof endAdornment === 'function' ? endAdornment(opened) : endAdornment })),
86
94
  opened && (loading || options.length > 0) && (react_1.default.createElement(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 => {
87
95
  if (event.key === 'Enter') {
88
96
  toggleMenu(false);
@@ -1,11 +1,12 @@
1
1
  import React from 'react';
2
- declare type Color = 'brand-blue' | 'white';
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?: 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 = 'brand-blue';
19
- const AVAILABLE_COLORS = ['brand-blue', 'white'];
18
+ const DEFAULT_COLOR = 'basic-blue';
19
+ const AVAILABLE_COLORS = ['basic-blue', 'basic-white'];
20
20
  /**
21
21
  * Компонент спиннера.
22
22
  * @param props Свойства.
@@ -11,6 +11,7 @@ $durations: (
11
11
  );
12
12
 
13
13
  .spinner {
14
+ display: block;
14
15
  .circle {
15
16
  fill: none;
16
17
  stroke-width: 2;
@@ -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.$brand-blue;
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;
@@ -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;
@@ -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
  }
@@ -1,5 +1,5 @@
1
- export declare const color: (value: "black" | "white" | "brand-blue" | "brand-dark-blue" | "brand-deep-blue" | "brand-dirty" | "brand-sky" | "gray87" | "gray76" | "gray66" | "gray54" | "gray38" | "gray24" | "gray12" | "gray8" | "gray4" | "gray2" | "additional-amber" | "additional-blue-gray" | "additional-blue" | "additional-brown" | "additional-cyan" | "additional-deep-orange" | "additional-deep-purple" | "additional-deep-red" | "additional-faded-green" | "additional-fog" | "additional-gold" | "additional-grass" | "additional-green" | "additional-light-blue" | "additional-light-green" | "additional-light-red" | "additional-lime" | "additional-pink" | "additional-purple" | "additional-red" | "additional-sand" | "additional-teal" | "additional-violet" | "additional-yellow") => string | undefined;
2
- export declare const hoverColor: (value: "black" | "white" | "brand-blue" | "brand-dark-blue" | "brand-deep-blue" | "brand-dirty" | "brand-sky" | "gray87" | "gray76" | "gray66" | "gray54" | "gray38" | "gray24" | "gray12" | "gray8" | "gray4" | "gray2" | "additional-amber" | "additional-blue-gray" | "additional-blue" | "additional-brown" | "additional-cyan" | "additional-deep-orange" | "additional-deep-purple" | "additional-deep-red" | "additional-faded-green" | "additional-fog" | "additional-gold" | "additional-grass" | "additional-green" | "additional-light-blue" | "additional-light-green" | "additional-light-red" | "additional-lime" | "additional-pink" | "additional-purple" | "additional-red" | "additional-sand" | "additional-teal" | "additional-violet" | "additional-yellow") => string | undefined;
3
- export declare const bgColor: (value: "black" | "white" | "brand-blue" | "brand-dark-blue" | "brand-deep-blue" | "brand-dirty" | "brand-sky" | "gray87" | "gray76" | "gray66" | "gray54" | "gray38" | "gray24" | "gray12" | "gray8" | "gray4" | "gray2" | "additional-amber" | "additional-blue-gray" | "additional-blue" | "additional-brown" | "additional-cyan" | "additional-deep-orange" | "additional-deep-purple" | "additional-deep-red" | "additional-faded-green" | "additional-fog" | "additional-gold" | "additional-grass" | "additional-green" | "additional-light-blue" | "additional-light-green" | "additional-light-red" | "additional-lime" | "additional-pink" | "additional-purple" | "additional-red" | "additional-sand" | "additional-teal" | "additional-violet" | "additional-yellow") => string | undefined;
4
- export declare const stroke: (value: "black" | "white" | "brand-blue" | "brand-dark-blue" | "brand-deep-blue" | "brand-dirty" | "brand-sky" | "gray87" | "gray76" | "gray66" | "gray54" | "gray38" | "gray24" | "gray12" | "gray8" | "gray4" | "gray2" | "additional-amber" | "additional-blue-gray" | "additional-blue" | "additional-brown" | "additional-cyan" | "additional-deep-orange" | "additional-deep-purple" | "additional-deep-red" | "additional-faded-green" | "additional-fog" | "additional-gold" | "additional-grass" | "additional-green" | "additional-light-blue" | "additional-light-green" | "additional-light-red" | "additional-lime" | "additional-pink" | "additional-purple" | "additional-red" | "additional-sand" | "additional-teal" | "additional-violet" | "additional-yellow") => string | undefined;
5
- export declare const fill: (value: "black" | "white" | "brand-blue" | "brand-dark-blue" | "brand-deep-blue" | "brand-dirty" | "brand-sky" | "gray87" | "gray76" | "gray66" | "gray54" | "gray38" | "gray24" | "gray12" | "gray8" | "gray4" | "gray2" | "additional-amber" | "additional-blue-gray" | "additional-blue" | "additional-brown" | "additional-cyan" | "additional-deep-orange" | "additional-deep-purple" | "additional-deep-red" | "additional-faded-green" | "additional-fog" | "additional-gold" | "additional-grass" | "additional-green" | "additional-light-blue" | "additional-light-green" | "additional-light-red" | "additional-lime" | "additional-pink" | "additional-purple" | "additional-red" | "additional-sand" | "additional-teal" | "additional-violet" | "additional-yellow") => string | undefined;
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;
@@ -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.$brand-blue;
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.$brand-blue;
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
  }
@@ -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
  }
@@ -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
- } }, blockProps),
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: onInput, onChange: onChange, onKeyDown: onKeyDown, onKeyUp: onKeyUp })))),
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.$brand-blue;
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.$brand-blue;
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.$brand-blue;
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.$brand-blue;
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: '';
@@ -9,7 +9,7 @@
9
9
  padding: 40px 8px;
10
10
  box-sizing: border-box;
11
11
  overflow: hidden;
12
- background: colors.$gray4;
12
+ background: colors.$basic-gray4;
13
13
  border-radius: 4px;
14
14
  @extend .shadow-z2;
15
15
  }
@@ -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;