@snack-uikit/fields 0.22.2 → 0.23.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 (36) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/README.md +8 -0
  3. package/dist/components/FieldDate/FieldDate.d.ts +1 -1
  4. package/dist/components/FieldDate/FieldDate.js +2 -2
  5. package/dist/components/FieldDecorator/FieldDecorator.d.ts +1 -1
  6. package/dist/components/FieldDecorator/FieldDecorator.js +2 -2
  7. package/dist/components/FieldDecorator/Header.d.ts +3 -1
  8. package/dist/components/FieldDecorator/Header.js +2 -2
  9. package/dist/components/FieldDecorator/styles.module.css +39 -2
  10. package/dist/components/FieldDecorator/utils.d.ts +2 -1
  11. package/dist/components/FieldDecorator/utils.js +2 -1
  12. package/dist/components/FieldSecure/FieldSecure.d.ts +1 -1
  13. package/dist/components/FieldSecure/FieldSecure.js +2 -2
  14. package/dist/components/FieldSelect/types.d.ts +1 -1
  15. package/dist/components/FieldSlider/FieldSlider.d.ts +1 -1
  16. package/dist/components/FieldSlider/FieldSlider.js +2 -2
  17. package/dist/components/FieldStepper/FieldStepper.d.ts +1 -1
  18. package/dist/components/FieldStepper/FieldStepper.js +2 -2
  19. package/dist/components/FieldText/FieldText.d.ts +1 -1
  20. package/dist/components/FieldText/FieldText.js +2 -2
  21. package/dist/components/FieldTextArea/FieldTextArea.d.ts +1 -1
  22. package/dist/components/FieldTextArea/FieldTextArea.js +2 -2
  23. package/dist/helperComponents/ButtonHideValue/ButtonHideValue.js +1 -1
  24. package/package.json +2 -2
  25. package/src/components/FieldDate/FieldDate.tsx +4 -1
  26. package/src/components/FieldDecorator/FieldDecorator.tsx +2 -0
  27. package/src/components/FieldDecorator/Header.tsx +10 -1
  28. package/src/components/FieldDecorator/styles.module.scss +38 -19
  29. package/src/components/FieldDecorator/utils.ts +2 -0
  30. package/src/components/FieldSecure/FieldSecure.tsx +3 -0
  31. package/src/components/FieldSelect/types.ts +1 -0
  32. package/src/components/FieldSlider/FieldSlider.tsx +11 -1
  33. package/src/components/FieldStepper/FieldStepper.tsx +3 -0
  34. package/src/components/FieldText/FieldText.tsx +3 -0
  35. package/src/components/FieldTextArea/FieldTextArea.tsx +3 -0
  36. package/src/helperComponents/ButtonHideValue/ButtonHideValue.tsx +4 -4
package/CHANGELOG.md CHANGED
@@ -3,6 +3,17 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # 0.23.0 (2024-07-02)
7
+
8
+
9
+ ### Features
10
+
11
+ * **PDS-153:** add caption, invert hidden button icon behavior, set width=auto for droplist in field-date, up tokens ([606716c](https://github.com/cloud-ru-tech/snack-uikit/commit/606716cc2b877d8a452a89dc23d3e38265ff5848))
12
+
13
+
14
+
15
+
16
+
6
17
  ## 0.22.2 (2024-06-27)
7
18
 
8
19
  ### Only dependencies have been changed
package/README.md CHANGED
@@ -195,6 +195,7 @@ FieldStepper в основном предназначен для работы с
195
195
  | readonly | `boolean` | - | Является ли поле доступным только на чтение Доступно ли поле только на чтение |
196
196
  | error | `string` | - | |
197
197
  | label | `string` | - | Лейбл |
198
+ | caption | `string` | - | Подпись справа от лейбла |
198
199
  | labelTooltip | `ReactNode` | - | Всплывающая подсказка лейбла |
199
200
  | labelFor | `string` | - | Аттрибут for |
200
201
  | required | `boolean` | - | Является ли поле обязательным |
@@ -225,6 +226,7 @@ FieldStepper в основном предназначен для работы с
225
226
  | error | `string` | - | |
226
227
  | className | `string` | - | CSS-класс |
227
228
  | label | `string` | - | Лейбл |
229
+ | caption | `string` | - | Подпись справа от лейбла |
228
230
  | labelTooltip | `ReactNode` | - | Всплывающая подсказка лейбла |
229
231
  | required | `boolean` | - | Является ли поле обязательным |
230
232
  | size | enum Size: `"s"`, `"m"`, `"l"` | SIZE.S | Размер |
@@ -257,6 +259,7 @@ FieldStepper в основном предназначен для работы с
257
259
  | error | `string` | - | |
258
260
  | className | `string` | - | CSS-класс |
259
261
  | label | `string` | - | Лейбл |
262
+ | caption | `string` | - | Подпись справа от лейбла |
260
263
  | labelTooltip | `ReactNode` | - | Всплывающая подсказка лейбла |
261
264
  | required | `boolean` | - | Является ли поле обязательным |
262
265
  | size | enum Size: `"s"`, `"m"`, `"l"` | SIZE.S | Размер |
@@ -289,6 +292,7 @@ FieldStepper в основном предназначен для работы с
289
292
  | error | `string` | - | |
290
293
  | className | `string` | - | CSS-класс |
291
294
  | label | `string` | - | Лейбл |
295
+ | caption | `string` | - | Подпись справа от лейбла |
292
296
  | labelTooltip | `ReactNode` | - | Всплывающая подсказка лейбла |
293
297
  | required | `boolean` | - | Является ли поле обязательным |
294
298
  | size | enum Size: `"s"`, `"m"`, `"l"` | SIZE.S | Размер |
@@ -323,6 +327,7 @@ FieldStepper в основном предназначен для работы с
323
327
  | error | `string` | - | |
324
328
  | className | `string` | - | CSS-класс |
325
329
  | label | `string` | - | Лейбл |
330
+ | caption | `string` | - | Подпись справа от лейбла |
326
331
  | labelTooltip | `ReactNode` | - | Всплывающая подсказка лейбла |
327
332
  | required | `boolean` | - | Является ли поле обязательным |
328
333
  | size | enum Size: `"s"`, `"m"`, `"l"` | SIZE.S | Размер |
@@ -348,6 +353,7 @@ FieldStepper в основном предназначен для работы с
348
353
  | error | `string` | - | |
349
354
  | className | `string` | - | CSS-класс |
350
355
  | label | `string` | - | Лейбл |
356
+ | caption | `string` | - | Подпись справа от лейбла |
351
357
  | labelTooltip | `ReactNode` | - | Всплывающая подсказка лейбла |
352
358
  | required | `boolean` | - | Является ли поле обязательным |
353
359
  | size | enum Size: `"s"`, `"m"`, `"l"` | - | Размер |
@@ -401,6 +407,7 @@ FieldStepper в основном предназначен для работы с
401
407
  | error | `string` | - | |
402
408
  | className | `string` | - | CSS-класс |
403
409
  | label | `string` | - | Лейбл |
410
+ | caption | `string` | - | Подпись справа от лейбла |
404
411
  | labelTooltip | `ReactNode` | - | Всплывающая подсказка лейбла |
405
412
  | required | `boolean` | - | Является ли поле обязательным |
406
413
  | size | enum Size: `"s"`, `"m"`, `"l"` | SIZE.S | Размер |
@@ -433,6 +440,7 @@ FieldStepper в основном предназначен для работы с
433
440
  | marks | `Record<string \| number, ReactNode \| MarkObj>` | - | |
434
441
  | className | `string` | - | CSS-класс |
435
442
  | label | `string` | - | Лейбл |
443
+ | caption | `string` | - | Подпись справа от лейбла |
436
444
  | labelTooltip | `ReactNode` | - | Всплывающая подсказка лейбла |
437
445
  | required | `boolean` | - | Является ли поле обязательным |
438
446
  | size | enum Size: `"s"`, `"m"`, `"l"` | SIZE.S | Размер |
@@ -4,7 +4,7 @@ import { InputPrivateProps } from '@snack-uikit/input-private';
4
4
  import { WithSupportProps } from '@snack-uikit/utils';
5
5
  import { FieldDecoratorProps } from '../FieldDecorator';
6
6
  type InputProps = Pick<InputPrivateProps, 'id' | 'name' | 'value' | 'disabled' | 'readonly' | 'onFocus' | 'onBlur'>;
7
- type WrapperProps = Pick<FieldDecoratorProps, 'className' | 'label' | 'labelTooltip' | 'required' | 'hint' | 'showHintIcon' | 'size' | 'validationState' | 'labelTooltipPlacement' | 'error'>;
7
+ type WrapperProps = Pick<FieldDecoratorProps, 'className' | 'label' | 'labelTooltip' | 'required' | 'caption' | 'hint' | 'showHintIcon' | 'size' | 'validationState' | 'labelTooltipPlacement' | 'error'>;
8
8
  type FieldDateOwnProps = {
9
9
  /** Открыт date-picker */
10
10
  open?: boolean;
@@ -35,7 +35,7 @@ const CALENDAR_SIZE_MAP = {
35
35
  [SIZE.L]: 'm',
36
36
  };
37
37
  export const FieldDate = forwardRef((_a, ref) => {
38
- var { id, name, value: valueProp, disabled = false, readonly = false, showCopyButton: showCopyButtonProp = true, showClearButton: showClearButtonProp = true, open, onOpenChange, onChange, onFocus, onBlur: onBlurProp, className, label, labelTooltip, labelTooltipPlacement, required = false, hint, showHintIcon, size = SIZE.S, validationState = VALIDATION_STATE.Default, locale = DEFAULT_LOCALE, buildCellProps, error } = _a, rest = __rest(_a, ["id", "name", "value", "disabled", "readonly", "showCopyButton", "showClearButton", "open", "onOpenChange", "onChange", "onFocus", "onBlur", "className", "label", "labelTooltip", "labelTooltipPlacement", "required", "hint", "showHintIcon", "size", "validationState", "locale", "buildCellProps", "error"]);
38
+ var { id, name, value: valueProp, disabled = false, readonly = false, showCopyButton: showCopyButtonProp = true, showClearButton: showClearButtonProp = true, open, onOpenChange, onChange, onFocus, onBlur: onBlurProp, className, label, labelTooltip, labelTooltipPlacement, required = false, caption, hint, showHintIcon, size = SIZE.S, validationState = VALIDATION_STATE.Default, locale = DEFAULT_LOCALE, buildCellProps, error } = _a, rest = __rest(_a, ["id", "name", "value", "disabled", "readonly", "showCopyButton", "showClearButton", "open", "onOpenChange", "onChange", "onFocus", "onBlur", "className", "label", "labelTooltip", "labelTooltipPlacement", "required", "caption", "hint", "showHintIcon", "size", "validationState", "locale", "buildCellProps", "error"]);
39
39
  const [isOpen, setIsOpen] = useUncontrolledProp(open, false, onOpenChange);
40
40
  const [pickerAutofocus, setPickerAutofocus] = useState(false);
41
41
  const localRef = useRef(null);
@@ -135,7 +135,7 @@ export const FieldDate = forwardRef((_a, ref) => {
135
135
  e.stopPropagation();
136
136
  }
137
137
  }, [dateInputClickHandler, isOpen]);
138
- return (_jsx(FieldDecorator, Object.assign({ className: className, label: label, labelTooltip: labelTooltip, labelTooltipPlacement: labelTooltipPlacement, labelFor: id, required: required, hint: hint, disabled: disabled, readonly: readonly, showHintIcon: showHintIcon, size: size, error: error, validationState: fieldValidationState }, extractSupportProps(rest), { children: _jsx(Dropdown, Object.assign({ trigger: 'click', triggerClassName: styles.triggerClassName, widthStrategy: 'gte' }, (readonly || disabled
138
+ return (_jsx(FieldDecorator, Object.assign({ className: className, label: label, labelTooltip: labelTooltip, labelTooltipPlacement: labelTooltipPlacement, labelFor: id, required: required, caption: caption, hint: hint, disabled: disabled, readonly: readonly, showHintIcon: showHintIcon, size: size, error: error, validationState: fieldValidationState }, extractSupportProps(rest), { children: _jsx(Dropdown, Object.assign({ trigger: 'click', triggerClassName: styles.triggerClassName, widthStrategy: 'auto' }, (readonly || disabled
139
139
  ? { open: false }
140
140
  : {
141
141
  open: showDropList,
@@ -12,4 +12,4 @@ export type FieldDecoratorProps = WithSupportProps<{
12
12
  readonly?: boolean;
13
13
  error?: string;
14
14
  } & HeaderProps & FooterProps>;
15
- export declare function FieldDecorator({ children, className, label, labelTooltip, required, labelFor, length, hint, disabled, readonly, showHintIcon, labelTooltipPlacement, size, error, validationState, ...rest }: FieldDecoratorProps): import("react/jsx-runtime").JSX.Element;
15
+ export declare function FieldDecorator({ children, className, label, labelTooltip, required, labelFor, caption, length, hint, disabled, readonly, showHintIcon, labelTooltipPlacement, size, error, validationState, ...rest }: FieldDecoratorProps): import("react/jsx-runtime").JSX.Element;
@@ -19,8 +19,8 @@ import { Footer } from './Footer';
19
19
  import { Header } from './Header';
20
20
  import styles from './styles.module.css';
21
21
  export function FieldDecorator(_a) {
22
- var { children, className, label, labelTooltip, required, labelFor, length, hint, disabled, readonly, showHintIcon, labelTooltipPlacement, size = SIZE.S, error, validationState = VALIDATION_STATE.Default } = _a, rest = __rest(_a, ["children", "className", "label", "labelTooltip", "required", "labelFor", "length", "hint", "disabled", "readonly", "showHintIcon", "labelTooltipPlacement", "size", "error", "validationState"]);
22
+ var { children, className, label, labelTooltip, required, labelFor, caption, length, hint, disabled, readonly, showHintIcon, labelTooltipPlacement, size = SIZE.S, error, validationState = VALIDATION_STATE.Default } = _a, rest = __rest(_a, ["children", "className", "label", "labelTooltip", "required", "labelFor", "caption", "length", "hint", "disabled", "readonly", "showHintIcon", "labelTooltipPlacement", "size", "error", "validationState"]);
23
23
  const isFieldActive = !disabled && !readonly;
24
24
  const fieldValidationState = getValidationState({ validationState, error });
25
- return (_jsxs("div", Object.assign({ className: cn(styles.decorator, className) }, extractSupportProps(rest), { "data-size": size, children: [label && (_jsx(Header, { labelTooltipPlacement: labelTooltipPlacement, required: required, label: label, labelTooltip: labelTooltip, labelFor: labelFor, size: size })), children, _jsx(Footer, { length: isFieldActive ? length : undefined, hint: error || hint, showHintIcon: showHintIcon, size: size, validationState: isFieldActive ? fieldValidationState : VALIDATION_STATE.Default })] })));
25
+ return (_jsxs("div", Object.assign({ className: cn(styles.decorator, className) }, extractSupportProps(rest), { "data-size": size, children: [label && (_jsx(Header, { labelTooltipPlacement: labelTooltipPlacement, required: required, label: label, labelTooltip: labelTooltip, labelFor: labelFor, caption: caption, size: size })), children, _jsx(Footer, { length: isFieldActive ? length : undefined, hint: error || hint, showHintIcon: showHintIcon, size: size, validationState: isFieldActive ? fieldValidationState : VALIDATION_STATE.Default })] })));
26
26
  }
@@ -4,6 +4,8 @@ import { TooltipProps } from '@snack-uikit/tooltip';
4
4
  export type HeaderProps = {
5
5
  /** Лейбл */
6
6
  label?: string;
7
+ /** Подпись справа от лейбла */
8
+ caption?: string;
7
9
  /** Всплывающая подсказка лейбла */
8
10
  labelTooltip?: ReactNode;
9
11
  /** Аттрибут for */
@@ -18,4 +20,4 @@ export type HeaderProps = {
18
20
  */
19
21
  labelTooltipPlacement?: TooltipProps['placement'];
20
22
  };
21
- export declare function Header({ label, labelTooltip, labelFor, size, required, labelTooltipPlacement, }: HeaderProps): import("react/jsx-runtime").JSX.Element;
23
+ export declare function Header({ label, labelTooltip, caption, labelFor, size, required, labelTooltipPlacement, }: HeaderProps): import("react/jsx-runtime").JSX.Element;
@@ -3,6 +3,6 @@ import { QuestionSVG } from '@snack-uikit/icons';
3
3
  import { Tooltip } from '@snack-uikit/tooltip';
4
4
  import { TruncateString } from '@snack-uikit/truncate-string';
5
5
  import styles from './styles.module.css';
6
- export function Header({ label = '', labelTooltip, labelFor, size, required = false, labelTooltipPlacement = 'top', }) {
7
- return (_jsx("span", { className: styles.header, "data-size": size, children: label && (_jsxs("span", { className: styles.labelLayout, children: [_jsx("label", { className: styles.label, htmlFor: labelFor, "data-test-id": 'field-decorator__label', children: _jsx(TruncateString, { text: label }) }), required && _jsx("span", { "data-test-id": 'field-decorator__required-sign', children: "*" }), labelTooltip && (_jsx(Tooltip, { tip: labelTooltip, placement: labelTooltipPlacement, "data-test-id": 'field-decorator__label-tooltip', triggerClassName: styles.labelTooltipTrigger, children: _jsx(QuestionSVG, { size: 16, className: styles.icon, "data-test-id": 'field-decorator__label-tooltip-trigger' }) }))] })) }));
6
+ export function Header({ label = '', labelTooltip, caption, labelFor, size, required = false, labelTooltipPlacement = 'top', }) {
7
+ return (_jsxs("span", { className: styles.header, "data-size": size, children: [label && (_jsxs("span", { className: styles.labelLayout, children: [_jsx("label", { className: styles.label, htmlFor: labelFor, "data-test-id": 'field-decorator__label', children: _jsx(TruncateString, { text: label }) }), required && (_jsx("span", { className: styles.required, "data-test-id": 'field-decorator__required-sign', children: "*" })), labelTooltip && (_jsx(Tooltip, { tip: labelTooltip, placement: labelTooltipPlacement, "data-test-id": 'field-decorator__label-tooltip', triggerClassName: styles.labelTooltipTrigger, children: _jsx(QuestionSVG, { size: 16, className: styles.icon, "data-test-id": 'field-decorator__label-tooltip-trigger' }) }))] })), caption && _jsx("span", { className: styles.caption, children: caption })] }));
8
8
  }
@@ -17,6 +17,7 @@
17
17
 
18
18
  .header{
19
19
  display:flex;
20
+ gap:var(--dimension-050m, 4px);
20
21
  box-sizing:border-box;
21
22
  color:var(--sys-neutral-text-support, #656771);
22
23
  }
@@ -28,6 +29,16 @@
28
29
  letter-spacing:var(--sans-label-m-letter-spacing, -0.1px);
29
30
  paragraph-spacing:var(--sans-label-m-paragraph-spacing, 6.6px);
30
31
  }
32
+ .header[data-size=s] .caption{
33
+ font-family:var(--sans-body-s-font-family, SB Sans Interface);
34
+ font-weight:var(--sans-body-s-font-weight, Regular);
35
+ line-height:var(--sans-body-s-line-height, 16px);
36
+ font-size:var(--sans-body-s-font-size, 12px);
37
+ letter-spacing:var(--sans-body-s-letter-spacing, 0.1px);
38
+ paragraph-spacing:var(--sans-body-s-paragraph-spacing, 6.6px);
39
+ margin-left:auto;
40
+ color:var(--sys-neutral-text-light, #868892);
41
+ }
31
42
  .header[data-size=m]{
32
43
  font-family:var(--sans-label-l-font-family, SB Sans Interface);
33
44
  font-weight:var(--sans-label-l-font-weight, Semibold);
@@ -36,6 +47,16 @@
36
47
  letter-spacing:var(--sans-label-l-letter-spacing, -0.1px);
37
48
  paragraph-spacing:var(--sans-label-l-paragraph-spacing, 7.7px);
38
49
  }
50
+ .header[data-size=m] .caption{
51
+ font-family:var(--sans-body-m-font-family, SB Sans Interface);
52
+ font-weight:var(--sans-body-m-font-weight, Regular);
53
+ line-height:var(--sans-body-m-line-height, 20px);
54
+ font-size:var(--sans-body-m-font-size, 14px);
55
+ letter-spacing:var(--sans-body-m-letter-spacing, 0.1px);
56
+ paragraph-spacing:var(--sans-body-m-paragraph-spacing, 7.7px);
57
+ margin-left:auto;
58
+ color:var(--sys-neutral-text-light, #868892);
59
+ }
39
60
  .header[data-size=l]{
40
61
  font-family:var(--sans-label-l-font-family, SB Sans Interface);
41
62
  font-weight:var(--sans-label-l-font-weight, Semibold);
@@ -44,19 +65,35 @@
44
65
  letter-spacing:var(--sans-label-l-letter-spacing, -0.1px);
45
66
  paragraph-spacing:var(--sans-label-l-paragraph-spacing, 7.7px);
46
67
  }
68
+ .header[data-size=l] .caption{
69
+ font-family:var(--sans-body-m-font-family, SB Sans Interface);
70
+ font-weight:var(--sans-body-m-font-weight, Regular);
71
+ line-height:var(--sans-body-m-line-height, 20px);
72
+ font-size:var(--sans-body-m-font-size, 14px);
73
+ letter-spacing:var(--sans-body-m-letter-spacing, 0.1px);
74
+ paragraph-spacing:var(--sans-body-m-paragraph-spacing, 7.7px);
75
+ margin-left:auto;
76
+ color:var(--sys-neutral-text-light, #868892);
77
+ }
47
78
 
48
79
  .labelLayout{
49
80
  gap:var(--space-fields-label-gap, 2px);
50
81
  display:inline-flex;
51
82
  align-items:center;
83
+ color:var(--sys-neutral-text-light, #868892);
52
84
  }
53
85
 
54
86
  .label{
55
87
  display:grid;
88
+ color:var(--sys-neutral-text-support, #656771);
89
+ }
90
+
91
+ .required{
92
+ color:var(--sys-neutral-text-support, #656771);
56
93
  }
57
94
 
58
95
  .footer{
59
- gap:var(--space-fields-hint-container-gap, 4px);
96
+ gap:var(--space-fields-hint-container-gap, 16px);
60
97
  display:flex;
61
98
  justify-content:space-between;
62
99
  box-sizing:border-box;
@@ -143,7 +180,7 @@
143
180
  box-sizing:content-box;
144
181
  }
145
182
  .hintIcon[data-validation=default]{
146
- color:var(--sys-neutral-text-light, #868892);
183
+ color:var(--sys-neutral-accent-default, #6f717c);
147
184
  }
148
185
  .hintIcon[data-validation=error]{
149
186
  color:var(--sys-red-accent-default, #cd3c3c);
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { FieldDecoratorProps } from './FieldDecorator';
3
- export declare function extractFieldDecoratorProps<T extends Partial<FieldDecoratorProps>>({ error, required, readonly, label, labelTooltip, labelTooltipPlacement, labelFor, hint, disabled, showHintIcon, size, validationState, className, }: T): {
3
+ export declare function extractFieldDecoratorProps<T extends Partial<FieldDecoratorProps>>({ error, required, readonly, label, labelTooltip, labelTooltipPlacement, labelFor, caption, hint, disabled, showHintIcon, size, validationState, className, }: T): {
4
4
  error: string | undefined;
5
5
  required: boolean | undefined;
6
6
  readonly: boolean | undefined;
@@ -8,6 +8,7 @@ export declare function extractFieldDecoratorProps<T extends Partial<FieldDecora
8
8
  labelTooltip: import("react").ReactNode;
9
9
  labelTooltipPlacement: import("@snack-uikit/popover-private/dist/types").Placement | undefined;
10
10
  labelFor: string | undefined;
11
+ caption: string | undefined;
11
12
  hint: string | undefined;
12
13
  disabled: boolean | undefined;
13
14
  showHintIcon: boolean | undefined;
@@ -1,4 +1,4 @@
1
- export function extractFieldDecoratorProps({ error, required, readonly, label, labelTooltip, labelTooltipPlacement, labelFor, hint, disabled, showHintIcon, size, validationState, className, }) {
1
+ export function extractFieldDecoratorProps({ error, required, readonly, label, labelTooltip, labelTooltipPlacement, labelFor, caption, hint, disabled, showHintIcon, size, validationState, className, }) {
2
2
  return {
3
3
  error,
4
4
  required,
@@ -7,6 +7,7 @@ export function extractFieldDecoratorProps({ error, required, readonly, label, l
7
7
  labelTooltip,
8
8
  labelTooltipPlacement,
9
9
  labelFor,
10
+ caption,
10
11
  hint,
11
12
  disabled,
12
13
  showHintIcon,
@@ -3,7 +3,7 @@ import { InputPrivateProps } from '@snack-uikit/input-private';
3
3
  import { WithSupportProps } from '@snack-uikit/utils';
4
4
  import { FieldDecoratorProps } from '../FieldDecorator';
5
5
  type InputProps = Pick<Partial<InputPrivateProps>, 'value' | 'onChange'> & Pick<InputPrivateProps, 'id' | 'name' | 'placeholder' | 'maxLength' | 'disabled' | 'readonly' | 'onFocus' | 'onBlur'>;
6
- type WrapperProps = Pick<FieldDecoratorProps, 'className' | 'label' | 'labelTooltip' | 'required' | 'hint' | 'size' | 'validationState' | 'showHintIcon' | 'labelTooltipPlacement' | 'error'>;
6
+ type WrapperProps = Pick<FieldDecoratorProps, 'className' | 'label' | 'labelTooltip' | 'required' | 'caption' | 'hint' | 'size' | 'validationState' | 'showHintIcon' | 'labelTooltipPlacement' | 'error'>;
7
7
  type FieldSecureOwnProps = {
8
8
  /** Замаскированно ли значение поля */
9
9
  hidden?: boolean;
@@ -30,7 +30,7 @@ import { useCopyButton, useHideButton, useValueControl } from '../../hooks';
30
30
  import { getValidationState } from '../../utils/getValidationState';
31
31
  import { FieldDecorator } from '../FieldDecorator';
32
32
  export const FieldSecure = forwardRef((_a, ref) => {
33
- var { id, name, value: valueProp, placeholder, maxLength, disabled = false, readonly = false, showCopyButton: showCopyButtonProp = true, allowMoreThanMaxLength = false, hidden: hiddenProp, onHiddenChange, showHintIcon, onChange: onChangeProp, onFocus, onBlur, className, label, labelTooltip, labelTooltipPlacement, required = false, hint, size = SIZE.S, validationState = VALIDATION_STATE.Default, prefixIcon, error, asyncValueGetter } = _a, rest = __rest(_a, ["id", "name", "value", "placeholder", "maxLength", "disabled", "readonly", "showCopyButton", "allowMoreThanMaxLength", "hidden", "onHiddenChange", "showHintIcon", "onChange", "onFocus", "onBlur", "className", "label", "labelTooltip", "labelTooltipPlacement", "required", "hint", "size", "validationState", "prefixIcon", "error", "asyncValueGetter"]);
33
+ var { id, name, value: valueProp, placeholder, maxLength, disabled = false, readonly = false, showCopyButton: showCopyButtonProp = true, allowMoreThanMaxLength = false, hidden: hiddenProp, onHiddenChange, showHintIcon, onChange: onChangeProp, onFocus, onBlur, className, label, labelTooltip, labelTooltipPlacement, required = false, caption, hint, size = SIZE.S, validationState = VALIDATION_STATE.Default, prefixIcon, error, asyncValueGetter } = _a, rest = __rest(_a, ["id", "name", "value", "placeholder", "maxLength", "disabled", "readonly", "showCopyButton", "allowMoreThanMaxLength", "hidden", "onHiddenChange", "showHintIcon", "onChange", "onFocus", "onBlur", "className", "label", "labelTooltip", "labelTooltipPlacement", "required", "caption", "hint", "size", "validationState", "prefixIcon", "error", "asyncValueGetter"]);
34
34
  const localRef = useRef(null);
35
35
  const copyButtonRef = useRef(null);
36
36
  const hideButtonRef = useRef(null);
@@ -110,5 +110,5 @@ export const FieldSecure = forwardRef((_a, ref) => {
110
110
  readonly,
111
111
  submitKeys: ['Enter', 'Space', 'Tab'],
112
112
  });
113
- return (_jsx(FieldDecorator, Object.assign({ className: className, label: label, labelTooltip: labelTooltip, labelTooltipPlacement: labelTooltipPlacement, labelFor: id, required: required, length: maxLength ? { max: maxLength, current: value.length } : undefined, hint: hint, disabled: disabled, readonly: readonly, showHintIcon: showHintIcon, size: size, error: error, validationState: fieldValidationState }, extractSupportProps(rest), { children: _jsx(FieldContainerPrivate, { size: size, validationState: fieldValidationState, disabled: disabled, readonly: readonly, variant: CONTAINER_VARIANT.SingleLine, inputRef: localRef, prefix: prefixIcon, postfix: buttons, children: _jsx(WithSkeleton, { skeleton: _jsx(Skeleton, { width: '100%', borderRadius: 2 }), loading: isLoading, children: _jsx(InputPrivate, { ref: mergeRefs(ref, localRef), "data-size": size, value: value, onChange: onChange, onFocus: onFocus, onBlur: onBlur, onKeyDown: onInputKeyDown, tabIndex: inputTabIndex, placeholder: placeholder, disabled: disabled, readonly: readonly, type: hidden ? 'password' : 'text', maxLength: allowMoreThanMaxLength ? undefined : maxLength || undefined, id: id, name: name, "data-test-id": 'field-secure__input' }) }) }) })));
113
+ return (_jsx(FieldDecorator, Object.assign({ className: className, label: label, labelTooltip: labelTooltip, labelTooltipPlacement: labelTooltipPlacement, labelFor: id, required: required, caption: caption, length: maxLength ? { max: maxLength, current: value.length } : undefined, hint: hint, disabled: disabled, readonly: readonly, showHintIcon: showHintIcon, size: size, error: error, validationState: fieldValidationState }, extractSupportProps(rest), { children: _jsx(FieldContainerPrivate, { size: size, validationState: fieldValidationState, disabled: disabled, readonly: readonly, variant: CONTAINER_VARIANT.SingleLine, inputRef: localRef, prefix: prefixIcon, postfix: buttons, children: _jsx(WithSkeleton, { skeleton: _jsx(Skeleton, { width: '100%', borderRadius: 2 }), loading: isLoading, children: _jsx(InputPrivate, { ref: mergeRefs(ref, localRef), "data-size": size, value: value, onChange: onChange, onFocus: onFocus, onBlur: onBlur, onKeyDown: onInputKeyDown, tabIndex: inputTabIndex, placeholder: placeholder, disabled: disabled, readonly: readonly, type: hidden ? 'password' : 'text', maxLength: allowMoreThanMaxLength ? undefined : maxLength || undefined, id: id, name: name, "data-test-id": 'field-secure__input' }) }) }) })));
114
114
  });
@@ -20,7 +20,7 @@ export type NestListOptionProps = Pick<NextListItemProps, 'type' | 'onSublistOpe
20
20
  options: OptionProps[];
21
21
  };
22
22
  export type InputProps = Pick<InputPrivateProps, 'id' | 'name' | 'placeholder' | 'disabled' | 'readonly' | 'onFocus' | 'onBlur' | 'onKeyDown'>;
23
- export type WrapperProps = Pick<FieldDecoratorProps, 'className' | 'label' | 'labelTooltip' | 'required' | 'hint' | 'showHintIcon' | 'size' | 'validationState' | 'labelTooltipPlacement' | 'error'>;
23
+ export type WrapperProps = Pick<FieldDecoratorProps, 'className' | 'label' | 'labelTooltip' | 'required' | 'caption' | 'hint' | 'showHintIcon' | 'size' | 'validationState' | 'labelTooltipPlacement' | 'error'>;
24
24
  export type ItemWithId = (BaseItemProps | AccordionItemProps | NextListItemProps) & {
25
25
  placeholder?: boolean;
26
26
  appearance?: TagProps['appearance'];
@@ -5,7 +5,7 @@ import { WithSupportProps } from '@snack-uikit/utils';
5
5
  import { FieldDecoratorProps } from '../FieldDecorator';
6
6
  import { TextInputFormatter } from './types';
7
7
  type SliderProps = Pick<InputPrivateProps, 'id' | 'name' | 'disabled' | 'readonly' | 'onFocus' | 'onBlur'> & Pick<SliderComponentProps, 'range' | 'value' | 'onChange' | 'tipFormatter'> & Required<Pick<SliderComponentProps, 'min' | 'max' | 'step' | 'marks'>>;
8
- type WrapperProps = Pick<FieldDecoratorProps, 'className' | 'label' | 'labelTooltip' | 'required' | 'hint' | 'showHintIcon' | 'size' | 'labelTooltipPlacement'>;
8
+ type WrapperProps = Pick<FieldDecoratorProps, 'className' | 'label' | 'labelTooltip' | 'required' | 'caption' | 'hint' | 'showHintIcon' | 'size' | 'labelTooltipPlacement'>;
9
9
  type FieldSliderOwnProps = {
10
10
  /** Иконка-постфикс для поля */
11
11
  postfixIcon?: ReactElement;
@@ -31,7 +31,7 @@ const getDefaultValue = (range, min, max, value) => {
31
31
  return value !== null && value !== void 0 ? value : min;
32
32
  };
33
33
  export const FieldSlider = forwardRef((_a, ref) => {
34
- var { id, name, min, max, step, marks, showScaleBar = true, value: valueProp, range = false, disabled = false, readonly = false, onChange: onChangeProp, onFocus, onBlur, className, label, labelTooltip, labelTooltipPlacement, required, hint, showHintIcon, size = SIZE.S, postfixIcon, textInputFormatter } = _a, rest = __rest(_a, ["id", "name", "min", "max", "step", "marks", "showScaleBar", "value", "range", "disabled", "readonly", "onChange", "onFocus", "onBlur", "className", "label", "labelTooltip", "labelTooltipPlacement", "required", "hint", "showHintIcon", "size", "postfixIcon", "textInputFormatter"]);
34
+ var { id, name, min, max, step, marks, showScaleBar = true, value: valueProp, range = false, disabled = false, readonly = false, onChange: onChangeProp, onFocus, onBlur, className, label, labelTooltip, labelTooltipPlacement, required, caption, hint, showHintIcon, size = SIZE.S, postfixIcon, textInputFormatter } = _a, rest = __rest(_a, ["id", "name", "min", "max", "step", "marks", "showScaleBar", "value", "range", "disabled", "readonly", "onChange", "onFocus", "onBlur", "className", "label", "labelTooltip", "labelTooltipPlacement", "required", "caption", "hint", "showHintIcon", "size", "postfixIcon", "textInputFormatter"]);
35
35
  const getMarkValue = useCallback((key) => {
36
36
  const mark = marks[key];
37
37
  if (isMarkObject(mark)) {
@@ -145,5 +145,5 @@ export const FieldSlider = forwardRef((_a, ref) => {
145
145
  // update value only when marks, min or max are changed
146
146
  // eslint-disable-next-line react-hooks/exhaustive-deps
147
147
  }, [marks, min, max]);
148
- return (_jsxs(FieldDecorator, Object.assign({ className: className, label: label, labelTooltip: labelTooltip, labelTooltipPlacement: labelTooltipPlacement, labelFor: id, disabled: disabled, required: required, hint: hint, showHintIcon: showHintIcon, readonly: readonly, size: size }, extractSupportProps(rest), { children: [_jsx(FieldContainerPrivate, { className: styles.fieldContainer, size: size, validationState: VALIDATION_STATE.Default, disabled: disabled, readonly: readonly, variant: CONTAINER_VARIANT.SingleLine, inputRef: localRef, postfix: postfixIcon, children: _jsx(InputPrivate, { ref: mergeRefs(ref, localRef), "data-size": size, value: textFieldInputValue, onChange: range ? undefined : onTextFieldChange, onFocus: onFocus, onBlur: range ? onBlur : onTextFieldBlur, onKeyDown: handleTextFieldKeyChange, disabled: disabled, readonly: range ? true : readonly, type: 'text', id: id, name: name, "data-test-id": 'field-slider__input' }) }), _jsx("div", { className: styles.sliderWrapper, children: _jsx("div", { className: styles.slider, "data-size": size, children: _jsx(Slider, { range: range, min: min, max: max, step: step, value: value, onChange: onChange, marks: showScaleBar ? marks : undefined, disabled: readonly || disabled, "data-test-id": 'field-slider__slider' }) }) })] })));
148
+ return (_jsxs(FieldDecorator, Object.assign({ className: className, label: label, labelTooltip: labelTooltip, labelTooltipPlacement: labelTooltipPlacement, labelFor: id, disabled: disabled, required: required, caption: caption, hint: hint, showHintIcon: showHintIcon, readonly: readonly, size: size }, extractSupportProps(rest), { children: [_jsx(FieldContainerPrivate, { className: styles.fieldContainer, size: size, validationState: VALIDATION_STATE.Default, disabled: disabled, readonly: readonly, variant: CONTAINER_VARIANT.SingleLine, inputRef: localRef, postfix: postfixIcon, children: _jsx(InputPrivate, { ref: mergeRefs(ref, localRef), "data-size": size, value: textFieldInputValue, onChange: range ? undefined : onTextFieldChange, onFocus: onFocus, onBlur: range ? onBlur : onTextFieldBlur, onKeyDown: handleTextFieldKeyChange, disabled: disabled, readonly: range ? true : readonly, type: 'text', id: id, name: name, "data-test-id": 'field-slider__input' }) }), _jsx("div", { className: styles.sliderWrapper, children: _jsx("div", { className: styles.slider, "data-size": size, children: _jsx(Slider, { range: range, min: min, max: max, step: step, value: value, onChange: onChange, marks: showScaleBar ? marks : undefined, disabled: readonly || disabled, "data-test-id": 'field-slider__slider' }) }) })] })));
149
149
  });
@@ -3,7 +3,7 @@ import { InputPrivateProps } from '@snack-uikit/input-private';
3
3
  import { WithSupportProps } from '@snack-uikit/utils';
4
4
  import { FieldDecoratorProps } from '../FieldDecorator';
5
5
  type InputProps = Pick<InputPrivateProps, 'id' | 'name' | 'disabled' | 'readonly' | 'onFocus' | 'onBlur' | 'min' | 'max'>;
6
- type WrapperProps = Pick<FieldDecoratorProps, 'className' | 'label' | 'labelTooltip' | 'required' | 'hint' | 'showHintIcon' | 'size' | 'validationState' | 'labelTooltipPlacement' | 'error'>;
6
+ type WrapperProps = Pick<FieldDecoratorProps, 'className' | 'label' | 'labelTooltip' | 'required' | 'caption' | 'hint' | 'showHintIcon' | 'size' | 'validationState' | 'labelTooltipPlacement' | 'error'>;
7
7
  type FieldStepperOwnProps = {
8
8
  /** Значение поля */
9
9
  value?: number;
@@ -35,7 +35,7 @@ const getDefaultValue = (min, max) => {
35
35
  return 0;
36
36
  };
37
37
  export const FieldStepper = forwardRef((_a, ref) => {
38
- var { id, name, value: valueProp, min = Number.NEGATIVE_INFINITY, max = Number.POSITIVE_INFINITY, step = 1, disabled = false, readonly = false, allowMoreThanLimits = true, onChange: onChangeProp, onFocus, onBlur, className, label, labelTooltip, labelTooltipPlacement, required = false, hint, showHintIcon, size = SIZE.S, validationState = VALIDATION_STATE.Default, error } = _a, rest = __rest(_a, ["id", "name", "value", "min", "max", "step", "disabled", "readonly", "allowMoreThanLimits", "onChange", "onFocus", "onBlur", "className", "label", "labelTooltip", "labelTooltipPlacement", "required", "hint", "showHintIcon", "size", "validationState", "error"]);
38
+ var { id, name, value: valueProp, min = Number.NEGATIVE_INFINITY, max = Number.POSITIVE_INFINITY, step = 1, disabled = false, readonly = false, allowMoreThanLimits = true, onChange: onChangeProp, onFocus, onBlur, className, label, labelTooltip, labelTooltipPlacement, required = false, caption, hint, showHintIcon, size = SIZE.S, validationState = VALIDATION_STATE.Default, error } = _a, rest = __rest(_a, ["id", "name", "value", "min", "max", "step", "disabled", "readonly", "allowMoreThanLimits", "onChange", "onFocus", "onBlur", "className", "label", "labelTooltip", "labelTooltipPlacement", "required", "caption", "hint", "showHintIcon", "size", "validationState", "error"]);
39
39
  const { t } = useLocale('Fields');
40
40
  const [value = 0, setValue] = useValueControl({
41
41
  value: valueProp,
@@ -124,5 +124,5 @@ export const FieldStepper = forwardRef((_a, ref) => {
124
124
  (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
125
125
  }
126
126
  };
127
- return (_jsx(FieldDecorator, Object.assign({ className: className, label: label, labelTooltip: labelTooltip, labelTooltipPlacement: labelTooltipPlacement, labelFor: id, required: required, hint: hint, disabled: disabled, readonly: readonly, showHintIcon: showHintIcon, size: size, validationState: fieldValidationState, error: error }, extractSupportProps(rest), { children: _jsx(Tooltip, { tip: tooltip, open: allowMoreThanLimits ? false : tooltipOpen, "data-test-id": 'field-stepper__limit-tooltip', children: _jsx(FieldContainerPrivate, { size: size, validationState: fieldValidationState, disabled: disabled, readonly: readonly, variant: CONTAINER_VARIANT.SingleLine, inputRef: inputRef, prefix: _jsx(ButtonFunction, { tabIndex: -1, ref: minusButtonRef, size: 'xs', className: styles.button, icon: _jsx(MinusSVG, {}), onClick: handleMinusButtonClick, onKeyDown: handleMinusButtonKeyDown, disabled: isMinusButtonDisabled, "data-test-id": 'field-stepper__minus-button' }), postfix: _jsx(ButtonFunction, { ref: plusButtonRef, tabIndex: -1, size: 'xs', className: styles.button, icon: _jsx(PlusSVG, {}), onClick: handlePlusButtonClick, onKeyDown: handlePlusButtonKeyDown, disabled: isPlusButtonDisabled, "data-test-id": 'field-stepper__plus-button' }), children: _jsx(InputPrivate, { ref: mergeRefs(ref, inputRef), className: styles.stepper, "data-size": size, value: String(value), tabIndex: 0, onKeyDown: handleInputKeyDown, onChange: handleInputChange, onBlur: handleInputBlur, onFocus: handleInputFocus, disabled: disabled, readonly: readonly, type: 'number', id: id, name: name, min: min, max: max, "data-test-id": 'field-stepper__input' }) }) }) })));
127
+ return (_jsx(FieldDecorator, Object.assign({ className: className, label: label, labelTooltip: labelTooltip, labelTooltipPlacement: labelTooltipPlacement, labelFor: id, required: required, caption: caption, hint: hint, disabled: disabled, readonly: readonly, showHintIcon: showHintIcon, size: size, validationState: fieldValidationState, error: error }, extractSupportProps(rest), { children: _jsx(Tooltip, { tip: tooltip, open: allowMoreThanLimits ? false : tooltipOpen, "data-test-id": 'field-stepper__limit-tooltip', children: _jsx(FieldContainerPrivate, { size: size, validationState: fieldValidationState, disabled: disabled, readonly: readonly, variant: CONTAINER_VARIANT.SingleLine, inputRef: inputRef, prefix: _jsx(ButtonFunction, { tabIndex: -1, ref: minusButtonRef, size: 'xs', className: styles.button, icon: _jsx(MinusSVG, {}), onClick: handleMinusButtonClick, onKeyDown: handleMinusButtonKeyDown, disabled: isMinusButtonDisabled, "data-test-id": 'field-stepper__minus-button' }), postfix: _jsx(ButtonFunction, { ref: plusButtonRef, tabIndex: -1, size: 'xs', className: styles.button, icon: _jsx(PlusSVG, {}), onClick: handlePlusButtonClick, onKeyDown: handlePlusButtonKeyDown, disabled: isPlusButtonDisabled, "data-test-id": 'field-stepper__plus-button' }), children: _jsx(InputPrivate, { ref: mergeRefs(ref, inputRef), className: styles.stepper, "data-size": size, value: String(value), tabIndex: 0, onKeyDown: handleInputKeyDown, onChange: handleInputChange, onBlur: handleInputBlur, onFocus: handleInputFocus, disabled: disabled, readonly: readonly, type: 'number', id: id, name: name, min: min, max: max, "data-test-id": 'field-stepper__input' }) }) }) })));
128
128
  });
@@ -3,7 +3,7 @@ import { InputPrivateProps } from '@snack-uikit/input-private';
3
3
  import { WithSupportProps } from '@snack-uikit/utils';
4
4
  import { FieldDecoratorProps } from '../FieldDecorator';
5
5
  type InputProps = Pick<Partial<InputPrivateProps>, 'value' | 'onChange'> & Pick<InputPrivateProps, 'id' | 'name' | 'placeholder' | 'maxLength' | 'disabled' | 'readonly' | 'onFocus' | 'onBlur'>;
6
- type WrapperProps = Pick<FieldDecoratorProps, 'className' | 'label' | 'labelTooltip' | 'required' | 'hint' | 'showHintIcon' | 'size' | 'validationState' | 'labelTooltipPlacement' | 'error'>;
6
+ type WrapperProps = Pick<FieldDecoratorProps, 'className' | 'label' | 'labelTooltip' | 'required' | 'caption' | 'hint' | 'showHintIcon' | 'size' | 'validationState' | 'labelTooltipPlacement' | 'error'>;
7
7
  type FieldTextOwnProps = {
8
8
  /** Отображение кнопки Копировать для поля (актуально только для `readonly = true`) */
9
9
  showCopyButton?: boolean;
@@ -20,7 +20,7 @@ import { useCopyButton, useValueControl } from '../../hooks';
20
20
  import { getValidationState } from '../../utils/getValidationState';
21
21
  import { FieldDecorator } from '../FieldDecorator';
22
22
  export const FieldText = forwardRef((_a, ref) => {
23
- var { id, name, value: valueProp, placeholder, maxLength, disabled = false, readonly = false, showCopyButton: showCopyButtonProp = true, showClearButton: showClearButtonProp = true, allowMoreThanMaxLength = false, onChange: onChangeProp, onFocus, onBlur, className, label, labelTooltip, labelTooltipPlacement, required = false, hint, showHintIcon, size = SIZE.S, validationState = VALIDATION_STATE.Default, prefixIcon, error } = _a, rest = __rest(_a, ["id", "name", "value", "placeholder", "maxLength", "disabled", "readonly", "showCopyButton", "showClearButton", "allowMoreThanMaxLength", "onChange", "onFocus", "onBlur", "className", "label", "labelTooltip", "labelTooltipPlacement", "required", "hint", "showHintIcon", "size", "validationState", "prefixIcon", "error"]);
23
+ var { id, name, value: valueProp, placeholder, maxLength, disabled = false, readonly = false, showCopyButton: showCopyButtonProp = true, showClearButton: showClearButtonProp = true, allowMoreThanMaxLength = false, onChange: onChangeProp, onFocus, onBlur, className, label, labelTooltip, labelTooltipPlacement, required = false, caption, hint, showHintIcon, size = SIZE.S, validationState = VALIDATION_STATE.Default, prefixIcon, error } = _a, rest = __rest(_a, ["id", "name", "value", "placeholder", "maxLength", "disabled", "readonly", "showCopyButton", "showClearButton", "allowMoreThanMaxLength", "onChange", "onFocus", "onBlur", "className", "label", "labelTooltip", "labelTooltipPlacement", "required", "caption", "hint", "showHintIcon", "size", "validationState", "prefixIcon", "error"]);
24
24
  const [value = '', onChange] = useValueControl({
25
25
  value: valueProp,
26
26
  defaultValue: '',
@@ -48,5 +48,5 @@ export const FieldText = forwardRef((_a, ref) => {
48
48
  readonly,
49
49
  submitKeys: ['Enter', 'Space', 'Tab'],
50
50
  });
51
- return (_jsx(FieldDecorator, Object.assign({ className: className, label: label, labelTooltip: labelTooltip, labelTooltipPlacement: labelTooltipPlacement, labelFor: id, required: required, length: maxLength ? { max: maxLength, current: value.length } : undefined, hint: hint, disabled: disabled, readonly: readonly, showHintIcon: showHintIcon, size: size, validationState: fieldValidationState, error: error }, extractSupportProps(rest), { children: _jsx(FieldContainerPrivate, { size: size, validationState: fieldValidationState, disabled: disabled, readonly: readonly, variant: CONTAINER_VARIANT.SingleLine, inputRef: localRef, prefix: prefixIcon, postfix: buttons, children: _jsx(InputPrivate, { ref: mergeRefs(ref, localRef), "data-size": size, value: value, onChange: onChange, onFocus: onFocus, onBlur: onBlur, tabIndex: inputTabIndex, onKeyDown: onInputKeyDown, placeholder: placeholder, disabled: disabled, readonly: readonly, type: 'text', maxLength: allowMoreThanMaxLength ? undefined : maxLength || undefined, id: id, name: name, "data-test-id": 'field-text__input' }) }) })));
51
+ return (_jsx(FieldDecorator, Object.assign({ className: className, label: label, labelTooltip: labelTooltip, labelTooltipPlacement: labelTooltipPlacement, labelFor: id, required: required, caption: caption, length: maxLength ? { max: maxLength, current: value.length } : undefined, hint: hint, disabled: disabled, readonly: readonly, showHintIcon: showHintIcon, size: size, validationState: fieldValidationState, error: error }, extractSupportProps(rest), { children: _jsx(FieldContainerPrivate, { size: size, validationState: fieldValidationState, disabled: disabled, readonly: readonly, variant: CONTAINER_VARIANT.SingleLine, inputRef: localRef, prefix: prefixIcon, postfix: buttons, children: _jsx(InputPrivate, { ref: mergeRefs(ref, localRef), "data-size": size, value: value, onChange: onChange, onFocus: onFocus, onBlur: onBlur, tabIndex: inputTabIndex, onKeyDown: onInputKeyDown, placeholder: placeholder, disabled: disabled, readonly: readonly, type: 'text', maxLength: allowMoreThanMaxLength ? undefined : maxLength || undefined, id: id, name: name, "data-test-id": 'field-text__input' }) }) })));
52
52
  });
@@ -3,7 +3,7 @@ import { WithSupportProps } from '@snack-uikit/utils';
3
3
  import { TextAreaProps } from '../../helperComponents';
4
4
  import { FieldDecoratorProps } from '../FieldDecorator';
5
5
  type InputProps = Pick<Partial<TextAreaProps>, 'value'> & Pick<TextAreaProps, 'id' | 'name' | 'placeholder' | 'maxLength' | 'disabled' | 'readonly' | 'onFocus' | 'onBlur'>;
6
- type WrapperProps = Pick<FieldDecoratorProps, 'className' | 'label' | 'labelTooltip' | 'required' | 'hint' | 'size' | 'validationState' | 'showHintIcon' | 'labelTooltipPlacement' | 'error'>;
6
+ type WrapperProps = Pick<FieldDecoratorProps, 'className' | 'label' | 'labelTooltip' | 'required' | 'caption' | 'hint' | 'size' | 'validationState' | 'showHintIcon' | 'labelTooltipPlacement' | 'error'>;
7
7
  type FieldTextAreaOwnProps = {
8
8
  /** Минимальное кол-во строк, до которого размер поля может быть увеличен @default 3*/
9
9
  minRows?: number;
@@ -22,7 +22,7 @@ import { getValidationState } from '../../utils/getValidationState';
22
22
  import { FieldDecorator } from '../FieldDecorator';
23
23
  import styles from './styles.module.css';
24
24
  export const FieldTextArea = forwardRef((_a, ref) => {
25
- var { id, name, value: valueProp, placeholder, maxLength, minRows = 3, maxRows = 1000, disabled = false, resizable = false, readonly = false, showCopyButton: showCopyButtonProp = true, showClearButton: showClearButtonProp = true, allowMoreThanMaxLength = true, showHintIcon, onChange: onChangeProp, onFocus, onBlur, className, label, labelTooltip, labelTooltipPlacement, required = false, hint, error, size = SIZE.S, validationState = VALIDATION_STATE.Default } = _a, rest = __rest(_a, ["id", "name", "value", "placeholder", "maxLength", "minRows", "maxRows", "disabled", "resizable", "readonly", "showCopyButton", "showClearButton", "allowMoreThanMaxLength", "showHintIcon", "onChange", "onFocus", "onBlur", "className", "label", "labelTooltip", "labelTooltipPlacement", "required", "hint", "error", "size", "validationState"]);
25
+ var { id, name, value: valueProp, placeholder, maxLength, minRows = 3, maxRows = 1000, disabled = false, resizable = false, readonly = false, showCopyButton: showCopyButtonProp = true, showClearButton: showClearButtonProp = true, allowMoreThanMaxLength = true, showHintIcon, onChange: onChangeProp, onFocus, onBlur, className, label, labelTooltip, labelTooltipPlacement, required = false, caption, hint, error, size = SIZE.S, validationState = VALIDATION_STATE.Default } = _a, rest = __rest(_a, ["id", "name", "value", "placeholder", "maxLength", "minRows", "maxRows", "disabled", "resizable", "readonly", "showCopyButton", "showClearButton", "allowMoreThanMaxLength", "showHintIcon", "onChange", "onFocus", "onBlur", "className", "label", "labelTooltip", "labelTooltipPlacement", "required", "caption", "hint", "error", "size", "validationState"]);
26
26
  const localRef = useRef(null);
27
27
  const clearButtonRef = useRef(null);
28
28
  const copyButtonRef = useRef(null);
@@ -50,5 +50,5 @@ export const FieldTextArea = forwardRef((_a, ref) => {
50
50
  readonly,
51
51
  submitKeys: ['Enter', 'Space', 'Tab'],
52
52
  });
53
- return (_jsx(FieldDecorator, Object.assign({ className: className, label: label, labelTooltip: labelTooltip, labelTooltipPlacement: labelTooltipPlacement, labelFor: id, required: required, length: maxLength ? { max: maxLength, current: value.length } : undefined, hint: hint, disabled: disabled, readonly: readonly, showHintIcon: showHintIcon, size: size, error: error, validationState: fieldValidationState }, extractSupportProps(rest), { children: _jsx(FieldContainerPrivate, { className: styles.container, size: size, validationState: fieldValidationState, disabled: disabled, readonly: readonly, "data-resizable": isResizable || undefined, variant: CONTAINER_VARIANT.MultiLine, style: { '--max-rows': maxRows, '--min-rows': minRows }, inputRef: localRef, postfix: _jsx("span", { className: styles.postfix, children: buttons }), children: _jsx(Scroll, { className: styles.scrollContainer, size: 's', barHideStrategy: 'never', resize: isResizable ? 'vertical' : 'none', "data-test-id": 'field-textarea__scroll-area', children: _jsx(TextArea, { className: styles.textarea, "data-size": size, value: value, onChange: onChange, placeholder: placeholder, disabled: disabled, readonly: readonly, minRows: minRows, id: id, name: name, ref: mergeRefs(ref, localRef), onFocus: onFocus, onBlur: onBlur, onKeyDown: onInputKeyDown, tabIndex: inputTabIndex, maxLength: allowMoreThanMaxLength ? undefined : maxLength || undefined, "data-test-id": 'field-textarea__input' }) }) }) })));
53
+ return (_jsx(FieldDecorator, Object.assign({ className: className, label: label, labelTooltip: labelTooltip, labelTooltipPlacement: labelTooltipPlacement, labelFor: id, required: required, caption: caption, length: maxLength ? { max: maxLength, current: value.length } : undefined, hint: hint, disabled: disabled, readonly: readonly, showHintIcon: showHintIcon, size: size, error: error, validationState: fieldValidationState }, extractSupportProps(rest), { children: _jsx(FieldContainerPrivate, { className: styles.container, size: size, validationState: fieldValidationState, disabled: disabled, readonly: readonly, "data-resizable": isResizable || undefined, variant: CONTAINER_VARIANT.MultiLine, style: { '--max-rows': maxRows, '--min-rows': minRows }, inputRef: localRef, postfix: _jsx("span", { className: styles.postfix, children: buttons }), children: _jsx(Scroll, { className: styles.scrollContainer, size: 's', barHideStrategy: 'never', resize: isResizable ? 'vertical' : 'none', "data-test-id": 'field-textarea__scroll-area', children: _jsx(TextArea, { className: styles.textarea, "data-size": size, value: value, onChange: onChange, placeholder: placeholder, disabled: disabled, readonly: readonly, minRows: minRows, id: id, name: name, ref: mergeRefs(ref, localRef), onFocus: onFocus, onBlur: onBlur, onKeyDown: onInputKeyDown, tabIndex: inputTabIndex, maxLength: allowMoreThanMaxLength ? undefined : maxLength || undefined, "data-test-id": 'field-textarea__input' }) }) }) })));
54
54
  });
@@ -11,5 +11,5 @@ export const ButtonHideValue = forwardRef(({ size, onClick, hidden, disabled, ta
11
11
  event.stopPropagation();
12
12
  onClick(event);
13
13
  };
14
- return (_jsx("button", { className: styles.buttonHideValue, "data-size": size, "data-disabled": disabled || undefined, disabled: disabled, onClick: handleClick, "data-test-id": 'button-hide-value', ref: ref, onKeyDown: onKeyDown, type: 'button', tabIndex: disabled ? -1 : tabIndex, children: hidden ? (_jsxs(_Fragment, { children: [size === BUTTON_SIZE.S && _jsx(EyeClosedSVG, { size: 16 }), size === BUTTON_SIZE.M && _jsx(EyeClosedSVG, {})] })) : (_jsxs(_Fragment, { children: [size === BUTTON_SIZE.S && _jsx(EyeSVG, { size: 16 }), size === BUTTON_SIZE.M && _jsx(EyeSVG, {})] })) }));
14
+ return (_jsx("button", { className: styles.buttonHideValue, "data-size": size, "data-disabled": disabled || undefined, disabled: disabled, onClick: handleClick, "data-test-id": 'button-hide-value', ref: ref, onKeyDown: onKeyDown, type: 'button', tabIndex: disabled ? -1 : tabIndex, children: hidden ? (_jsxs(_Fragment, { children: [size === BUTTON_SIZE.S && _jsx(EyeSVG, { size: 16 }), size === BUTTON_SIZE.M && _jsx(EyeSVG, {})] })) : (_jsxs(_Fragment, { children: [size === BUTTON_SIZE.S && _jsx(EyeClosedSVG, { size: 16 }), size === BUTTON_SIZE.M && _jsx(EyeClosedSVG, {})] })) }));
15
15
  });
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "access": "public"
5
5
  },
6
6
  "title": "Fields",
7
- "version": "0.22.2",
7
+ "version": "0.23.0",
8
8
  "sideEffects": [
9
9
  "*.css",
10
10
  "*.woff",
@@ -59,5 +59,5 @@
59
59
  "peerDependencies": {
60
60
  "@snack-uikit/locale": "*"
61
61
  },
62
- "gitHead": "0c81fa6b2657f51768401ba7ce5015fe8d293805"
62
+ "gitHead": "d3b4cf017a5d6d34f1fb21b71b4e438e38c758c3"
63
63
  }
@@ -47,6 +47,7 @@ type WrapperProps = Pick<
47
47
  | 'label'
48
48
  | 'labelTooltip'
49
49
  | 'required'
50
+ | 'caption'
50
51
  | 'hint'
51
52
  | 'showHintIcon'
52
53
  | 'size'
@@ -101,6 +102,7 @@ export const FieldDate = forwardRef<HTMLInputElement, FieldDateProps>(
101
102
  labelTooltip,
102
103
  labelTooltipPlacement,
103
104
  required = false,
105
+ caption,
104
106
  hint,
105
107
  showHintIcon,
106
108
  size = SIZE.S,
@@ -259,6 +261,7 @@ export const FieldDate = forwardRef<HTMLInputElement, FieldDateProps>(
259
261
  labelTooltipPlacement={labelTooltipPlacement}
260
262
  labelFor={id}
261
263
  required={required}
264
+ caption={caption}
262
265
  hint={hint}
263
266
  disabled={disabled}
264
267
  readonly={readonly}
@@ -271,7 +274,7 @@ export const FieldDate = forwardRef<HTMLInputElement, FieldDateProps>(
271
274
  <Dropdown
272
275
  trigger='click'
273
276
  triggerClassName={styles.triggerClassName}
274
- widthStrategy='gte'
277
+ widthStrategy='auto'
275
278
  {...(readonly || disabled
276
279
  ? { open: false }
277
280
  : {
@@ -32,6 +32,7 @@ export function FieldDecorator({
32
32
  labelTooltip,
33
33
  required,
34
34
  labelFor,
35
+ caption,
35
36
  length,
36
37
  hint,
37
38
  disabled,
@@ -55,6 +56,7 @@ export function FieldDecorator({
55
56
  label={label}
56
57
  labelTooltip={labelTooltip}
57
58
  labelFor={labelFor}
59
+ caption={caption}
58
60
  size={size}
59
61
  />
60
62
  )}
@@ -10,6 +10,8 @@ import styles from './styles.module.scss';
10
10
  export type HeaderProps = {
11
11
  /** Лейбл */
12
12
  label?: string;
13
+ /** Подпись справа от лейбла */
14
+ caption?: string;
13
15
  /** Всплывающая подсказка лейбла */
14
16
  labelTooltip?: ReactNode;
15
17
  /** Аттрибут for */
@@ -28,6 +30,7 @@ export type HeaderProps = {
28
30
  export function Header({
29
31
  label = '',
30
32
  labelTooltip,
33
+ caption,
31
34
  labelFor,
32
35
  size,
33
36
  required = false,
@@ -41,7 +44,11 @@ export function Header({
41
44
  <label className={styles.label} htmlFor={labelFor} data-test-id='field-decorator__label'>
42
45
  <TruncateString text={label} />
43
46
  </label>
44
- {required && <span data-test-id='field-decorator__required-sign'>*</span>}
47
+ {required && (
48
+ <span className={styles.required} data-test-id='field-decorator__required-sign'>
49
+ *
50
+ </span>
51
+ )}
45
52
  {labelTooltip && (
46
53
  <Tooltip
47
54
  tip={labelTooltip}
@@ -54,6 +61,8 @@ export function Header({
54
61
  )}
55
62
  </span>
56
63
  )}
64
+
65
+ {caption && <span className={styles.caption}>{caption}</span>}
57
66
  </span>
58
67
  );
59
68
  }
@@ -17,6 +17,11 @@ $hint-icon-container: (
17
17
  'm': $fields-hint-icon-container-m,
18
18
  'l': $fields-hint-icon-container-m,
19
19
  );
20
+ $caption-typography: (
21
+ 's': $sans-body-s,
22
+ 'm': $sans-body-m,
23
+ 'l': $sans-body-m,
24
+ );
20
25
 
21
26
  .decorator {
22
27
  display: flex;
@@ -35,12 +40,20 @@ $hint-icon-container: (
35
40
 
36
41
  .header {
37
42
  display: flex;
43
+ gap: $dimension-050m;
38
44
  box-sizing: border-box;
39
- color: simple-var($sys-neutral-text-support);
45
+ color: $sys-neutral-text-support;
40
46
 
41
47
  @each $size in $sizes {
42
48
  &[data-size='#{$size}'] {
43
49
  @include composite-var($header-typography, $size);
50
+
51
+ .caption {
52
+ @include composite-var($caption-typography, $size);
53
+
54
+ margin-left: auto;
55
+ color: $sys-neutral-text-light;
56
+ }
44
57
  }
45
58
  }
46
59
  }
@@ -50,10 +63,16 @@ $hint-icon-container: (
50
63
 
51
64
  display: inline-flex;
52
65
  align-items: center;
66
+ color: $sys-neutral-text-light;
53
67
  }
54
68
 
55
69
  .label {
56
70
  display: grid;
71
+ color: $sys-neutral-text-support;
72
+ }
73
+
74
+ .required {
75
+ color: $sys-neutral-text-support;
57
76
  }
58
77
 
59
78
  .footer {
@@ -100,26 +119,26 @@ $hint-icon-container: (
100
119
  word-break: break-word;
101
120
 
102
121
  &[data-validation='default'] {
103
- color: simple-var($sys-neutral-text-light);
122
+ color: $sys-neutral-text-light;
104
123
  }
105
124
 
106
125
  &[data-validation='error'] {
107
- color: simple-var($sys-red-text-main);
126
+ color: $sys-red-text-main;
108
127
  }
109
128
 
110
129
  &[data-validation='warning'] {
111
- color: simple-var($sys-yellow-text-main);
130
+ color: $sys-yellow-text-main;
112
131
  }
113
132
 
114
133
  &[data-validation='success'] {
115
- color: simple-var($sys-green-text-main);
134
+ color: $sys-green-text-main;
116
135
  }
117
136
  }
118
137
 
119
138
  .icon {
120
139
  flex-shrink: 0;
121
140
  box-sizing: content-box;
122
- color: simple-var($sys-neutral-text-light);
141
+ color: $sys-neutral-text-light;
123
142
  }
124
143
 
125
144
  .hintIcon {
@@ -127,39 +146,39 @@ $hint-icon-container: (
127
146
  box-sizing: content-box;
128
147
 
129
148
  &[data-validation='default'] {
130
- color: simple-var($sys-neutral-text-light);
149
+ color: $sys-neutral-accent-default;
131
150
  }
132
151
 
133
152
  &[data-validation='error'] {
134
- color: simple-var($sys-red-accent-default);
153
+ color: $sys-red-accent-default;
135
154
  }
136
155
 
137
156
  &[data-validation='warning'] {
138
- color: simple-var($sys-yellow-accent-default);
157
+ color: $sys-yellow-accent-default;
139
158
  }
140
159
 
141
160
  &[data-validation='success'] {
142
- color: simple-var($sys-green-accent-default);
161
+ color: $sys-green-accent-default;
143
162
  }
144
163
  }
145
164
 
146
165
  .counterLimit {
147
166
  > span {
148
167
  &[data-validation='default'] {
149
- color: simple-var($sys-neutral-text-light);
168
+ color: $sys-neutral-text-light;
150
169
  }
151
170
 
152
171
  &[data-limit-exceeded],
153
172
  &[data-validation='error'] {
154
- color: simple-var($sys-red-text-light);
173
+ color: $sys-red-text-light;
155
174
  }
156
175
 
157
176
  &[data-validation='warning'] {
158
- color: simple-var($sys-yellow-text-light);
177
+ color: $sys-yellow-text-light;
159
178
  }
160
179
 
161
180
  &[data-validation='success'] {
162
- color: simple-var($sys-green-text-light);
181
+ color: $sys-green-text-light;
163
182
  }
164
183
  }
165
184
  }
@@ -167,18 +186,18 @@ $hint-icon-container: (
167
186
  .counterCurrentValue {
168
187
  &[data-limit-exceeded] {
169
188
  &[data-validation='default'] {
170
- color: simple-var($sys-neutral-text-main);
189
+ color: $sys-neutral-text-main;
171
190
  }
172
191
  &[data-validation='error'] {
173
- color: simple-var($sys-red-text-main);
192
+ color: $sys-red-text-main;
174
193
  }
175
194
 
176
195
  &[data-validation='warning'] {
177
- color: simple-var($sys-yellow-text-main);
196
+ color: $sys-yellow-text-main;
178
197
  }
179
198
 
180
199
  &[data-validation='success'] {
181
- color: simple-var($sys-green-text-light);
200
+ color: $sys-green-text-light;
182
201
  }
183
202
  }
184
203
  }
@@ -188,4 +207,4 @@ $hint-icon-container: (
188
207
  display: flex;
189
208
  align-items: center;
190
209
  height: 100%;
191
- }
210
+ }
@@ -8,6 +8,7 @@ export function extractFieldDecoratorProps<T extends Partial<FieldDecoratorProps
8
8
  labelTooltip,
9
9
  labelTooltipPlacement,
10
10
  labelFor,
11
+ caption,
11
12
  hint,
12
13
  disabled,
13
14
  showHintIcon,
@@ -23,6 +24,7 @@ export function extractFieldDecoratorProps<T extends Partial<FieldDecoratorProps
23
24
  labelTooltip,
24
25
  labelTooltipPlacement,
25
26
  labelFor,
27
+ caption,
26
28
  hint,
27
29
  disabled,
28
30
  showHintIcon,
@@ -28,6 +28,7 @@ type WrapperProps = Pick<
28
28
  | 'label'
29
29
  | 'labelTooltip'
30
30
  | 'required'
31
+ | 'caption'
31
32
  | 'hint'
32
33
  | 'size'
33
34
  | 'validationState'
@@ -76,6 +77,7 @@ export const FieldSecure = forwardRef<HTMLInputElement, FieldSecureProps>(
76
77
  labelTooltip,
77
78
  labelTooltipPlacement,
78
79
  required = false,
80
+ caption,
79
81
  hint,
80
82
  size = SIZE.S,
81
83
  validationState = VALIDATION_STATE.Default,
@@ -186,6 +188,7 @@ export const FieldSecure = forwardRef<HTMLInputElement, FieldSecureProps>(
186
188
  labelTooltipPlacement={labelTooltipPlacement}
187
189
  labelFor={id}
188
190
  required={required}
191
+ caption={caption}
189
192
  length={maxLength ? { max: maxLength, current: value.length } : undefined}
190
193
  hint={hint}
191
194
  disabled={disabled}
@@ -57,6 +57,7 @@ export type WrapperProps = Pick<
57
57
  | 'label'
58
58
  | 'labelTooltip'
59
59
  | 'required'
60
+ | 'caption'
60
61
  | 'hint'
61
62
  | 'showHintIcon'
62
63
  | 'size'
@@ -29,7 +29,15 @@ type SliderProps = Pick<InputPrivateProps, 'id' | 'name' | 'disabled' | 'readonl
29
29
 
30
30
  type WrapperProps = Pick<
31
31
  FieldDecoratorProps,
32
- 'className' | 'label' | 'labelTooltip' | 'required' | 'hint' | 'showHintIcon' | 'size' | 'labelTooltipPlacement'
32
+ | 'className'
33
+ | 'label'
34
+ | 'labelTooltip'
35
+ | 'required'
36
+ | 'caption'
37
+ | 'hint'
38
+ | 'showHintIcon'
39
+ | 'size'
40
+ | 'labelTooltipPlacement'
33
41
  >;
34
42
 
35
43
  type FieldSliderOwnProps = {
@@ -82,6 +90,7 @@ export const FieldSlider = forwardRef<HTMLInputElement, FieldSliderProps>(
82
90
  labelTooltip,
83
91
  labelTooltipPlacement,
84
92
  required,
93
+ caption,
85
94
  hint,
86
95
  showHintIcon,
87
96
  size = SIZE.S,
@@ -251,6 +260,7 @@ export const FieldSlider = forwardRef<HTMLInputElement, FieldSliderProps>(
251
260
  labelFor={id}
252
261
  disabled={disabled}
253
262
  required={required}
263
+ caption={caption}
254
264
  hint={hint}
255
265
  showHintIcon={showHintIcon}
256
266
  readonly={readonly}
@@ -35,6 +35,7 @@ type WrapperProps = Pick<
35
35
  | 'label'
36
36
  | 'labelTooltip'
37
37
  | 'required'
38
+ | 'caption'
38
39
  | 'hint'
39
40
  | 'showHintIcon'
40
41
  | 'size'
@@ -90,6 +91,7 @@ export const FieldStepper = forwardRef<HTMLInputElement, FieldStepperProps>(
90
91
  labelTooltip,
91
92
  labelTooltipPlacement,
92
93
  required = false,
94
+ caption,
93
95
  hint,
94
96
  showHintIcon,
95
97
  size = SIZE.S,
@@ -215,6 +217,7 @@ export const FieldStepper = forwardRef<HTMLInputElement, FieldStepperProps>(
215
217
  labelTooltipPlacement={labelTooltipPlacement}
216
218
  labelFor={id}
217
219
  required={required}
220
+ caption={caption}
218
221
  hint={hint}
219
222
  disabled={disabled}
220
223
  readonly={readonly}
@@ -19,6 +19,7 @@ type WrapperProps = Pick<
19
19
  | 'label'
20
20
  | 'labelTooltip'
21
21
  | 'required'
22
+ | 'caption'
22
23
  | 'hint'
23
24
  | 'showHintIcon'
24
25
  | 'size'
@@ -64,6 +65,7 @@ export const FieldText = forwardRef<HTMLInputElement, FieldTextProps>(
64
65
  labelTooltip,
65
66
  labelTooltipPlacement,
66
67
  required = false,
68
+ caption,
67
69
  hint,
68
70
  showHintIcon,
69
71
  size = SIZE.S,
@@ -112,6 +114,7 @@ export const FieldText = forwardRef<HTMLInputElement, FieldTextProps>(
112
114
  labelTooltipPlacement={labelTooltipPlacement}
113
115
  labelFor={id}
114
116
  required={required}
117
+ caption={caption}
115
118
  length={maxLength ? { max: maxLength, current: value.length } : undefined}
116
119
  hint={hint}
117
120
  disabled={disabled}
@@ -21,6 +21,7 @@ type WrapperProps = Pick<
21
21
  | 'label'
22
22
  | 'labelTooltip'
23
23
  | 'required'
24
+ | 'caption'
24
25
  | 'hint'
25
26
  | 'size'
26
27
  | 'validationState'
@@ -76,6 +77,7 @@ export const FieldTextArea = forwardRef<HTMLTextAreaElement, FieldTextAreaProps>
76
77
  labelTooltip,
77
78
  labelTooltipPlacement,
78
79
  required = false,
80
+ caption,
79
81
  hint,
80
82
  error,
81
83
  size = SIZE.S,
@@ -124,6 +126,7 @@ export const FieldTextArea = forwardRef<HTMLTextAreaElement, FieldTextAreaProps>
124
126
  labelTooltipPlacement={labelTooltipPlacement}
125
127
  labelFor={id}
126
128
  required={required}
129
+ caption={caption}
127
130
  length={maxLength ? { max: maxLength, current: value.length } : undefined}
128
131
  hint={hint}
129
132
  disabled={disabled}
@@ -40,13 +40,13 @@ export const ButtonHideValue = forwardRef<HTMLButtonElement, ButtonHideValueProp
40
40
  >
41
41
  {hidden ? (
42
42
  <>
43
- {size === BUTTON_SIZE.S && <EyeClosedSVG size={16} />}
44
- {size === BUTTON_SIZE.M && <EyeClosedSVG />}
43
+ {size === BUTTON_SIZE.S && <EyeSVG size={16} />}
44
+ {size === BUTTON_SIZE.M && <EyeSVG />}
45
45
  </>
46
46
  ) : (
47
47
  <>
48
- {size === BUTTON_SIZE.S && <EyeSVG size={16} />}
49
- {size === BUTTON_SIZE.M && <EyeSVG />}
48
+ {size === BUTTON_SIZE.S && <EyeClosedSVG size={16} />}
49
+ {size === BUTTON_SIZE.M && <EyeClosedSVG />}
50
50
  </>
51
51
  )}
52
52
  </button>