@ozen-ui/kit 0.12.0 → 0.13.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 (35) hide show
  1. package/__inner__/cjs/components/DataList/DataList.css +55 -28
  2. package/__inner__/cjs/components/DataList/DataList.d.ts +2 -2
  3. package/__inner__/cjs/components/DataList/DataList.js +62 -24
  4. package/__inner__/cjs/components/DataList/DataListProvider.d.ts +8 -10
  5. package/__inner__/cjs/components/DataList/DataListProvider.js +0 -2
  6. package/__inner__/cjs/components/DataList/components/DataListOption.d.ts +5 -18
  7. package/__inner__/cjs/components/DataList/components/DataListOption.js +14 -22
  8. package/__inner__/cjs/components/DataList/types.d.ts +19 -12
  9. package/__inner__/cjs/components/DataList/types.js +5 -0
  10. package/__inner__/cjs/components/DataList/useDataListNavigation.d.ts +15 -6
  11. package/__inner__/cjs/components/DataList/useDataListNavigation.js +68 -21
  12. package/__inner__/cjs/components/Input/Input.js +5 -5
  13. package/__inner__/cjs/components/Input/types.d.ts +3 -3
  14. package/__inner__/cjs/components/InputNumber/InputNumber.js +10 -10
  15. package/__inner__/cjs/components/InputNumber/types.d.ts +2 -0
  16. package/__inner__/cjs/components/Textarea/types.d.ts +1 -3
  17. package/__inner__/cjs/hooks/useControlled/useControlled.js +3 -3
  18. package/__inner__/esm/components/DataList/DataList.css +55 -28
  19. package/__inner__/esm/components/DataList/DataList.d.ts +2 -2
  20. package/__inner__/esm/components/DataList/DataList.js +63 -25
  21. package/__inner__/esm/components/DataList/DataListProvider.d.ts +8 -10
  22. package/__inner__/esm/components/DataList/DataListProvider.js +0 -2
  23. package/__inner__/esm/components/DataList/components/DataListOption.d.ts +5 -18
  24. package/__inner__/esm/components/DataList/components/DataListOption.js +16 -23
  25. package/__inner__/esm/components/DataList/types.d.ts +19 -12
  26. package/__inner__/esm/components/DataList/types.js +2 -1
  27. package/__inner__/esm/components/DataList/useDataListNavigation.d.ts +15 -6
  28. package/__inner__/esm/components/DataList/useDataListNavigation.js +69 -22
  29. package/__inner__/esm/components/Input/Input.js +5 -5
  30. package/__inner__/esm/components/Input/types.d.ts +3 -3
  31. package/__inner__/esm/components/InputNumber/InputNumber.js +10 -10
  32. package/__inner__/esm/components/InputNumber/types.d.ts +2 -0
  33. package/__inner__/esm/components/Textarea/types.d.ts +1 -3
  34. package/__inner__/esm/hooks/useControlled/useControlled.js +3 -3
  35. package/package.json +1 -1
@@ -1,14 +1,23 @@
1
+ import type React from 'react';
1
2
  import type { MouseEvent, RefObject } from 'react';
3
+ type UserListItemValue = string | null;
2
4
  export type UseListNavigationProps = {
3
5
  name?: string;
4
- listRef?: RefObject<HTMLUListElement>;
6
+ ref?: RefObject<HTMLElement>;
7
+ selected?: UserListItemValue;
8
+ active?: boolean;
9
+ onSelect?: (e: React.SyntheticEvent | KeyboardEvent, selectedItem: string) => void;
5
10
  };
6
11
  export type UseListNavigationValue = {
7
12
  'data-list': string;
8
- currentItem: HTMLLIElement | null;
9
- keyboardHighlight: boolean;
13
+ focused?: UserListItemValue;
14
+ highlighted?: UserListItemValue;
15
+ ref?: RefObject<HTMLElement>;
10
16
  onKeyDown: (event: KeyboardEvent) => void;
11
- onMouseMove: (event: MouseEvent<HTMLLIElement>) => void;
12
- onMouseLeave: (event: MouseEvent<HTMLLIElement>) => void;
17
+ onMouseMove: (event: MouseEvent<HTMLElement>) => void;
18
+ onMouseLeave: (event: MouseEvent<HTMLElement>) => void;
19
+ onClick: (event: React.MouseEvent<HTMLElement>) => void;
13
20
  };
14
- export declare function useDataListNavigation({ name: nameProp, listRef, }?: UseListNavigationProps): UseListNavigationValue;
21
+ /** Навигация по элементам списка без перехвата фокуса с элемента контроля */
22
+ export declare function useDataListNavigation({ name: nameProp, selected, active, onSelect, }?: UseListNavigationProps): UseListNavigationValue;
23
+ export {};
@@ -1,54 +1,101 @@
1
1
  import { __read } from "tslib";
2
- import { useState } from 'react';
3
- import { useBoolean } from '../../hooks/useBoolean';
2
+ import { useEffect, useState, useCallback, useRef } from 'react';
4
3
  import { useUniqueId } from '../../hooks/useUniqueId';
5
4
  import { getNextIndex } from '../../utils/getNextIndex';
6
5
  import { getPrevIndex } from '../../utils/getPrevIndex';
7
6
  import { isKey } from '../../utils/isKey';
8
7
  import { scrollContainerToElement } from '../../utils/scrollContainerToElement';
8
+ var getData = function (el, attr) {
9
+ if (!el) {
10
+ return null;
11
+ }
12
+ if ('currentTarget' in el)
13
+ return el.currentTarget.getAttribute("data-list-".concat(attr));
14
+ return el.getAttribute("data-list-".concat(attr));
15
+ };
16
+ /** Навигация по элементам списка без перехвата фокуса с элемента контроля */
9
17
  export function useDataListNavigation(_a) {
10
- var _b = _a === void 0 ? {} : _a, nameProp = _b.name, listRef = _b.listRef;
18
+ var _b = _a === void 0 ? {} : _a, nameProp = _b.name, selected = _b.selected, _c = _b.active, active = _c === void 0 ? false : _c, onSelect = _b.onSelect;
11
19
  var name = useUniqueId(nameProp);
12
- var _c = __read(useState(null), 2), currentItem = _c[0], setCurrentItem = _c[1];
13
- var _d = __read(useBoolean(false), 2), keyboardHighlight = _d[0], _e = _d[1], showKeyboardHighlight = _e.on, hideKeyboardHighlight = _e.off;
14
- var onKeyDown = function (event) {
20
+ var ref = useRef(null);
21
+ var _d = __read(useState(null), 2), current = _d[0], setCurrent = _d[1];
22
+ var _e = __read(useState(), 2), focused = _e[0], serFocused = _e[1];
23
+ var _f = __read(useState(), 2), highlighted = _f[0], setHighlighted = _f[1];
24
+ var currentValue = current || selected;
25
+ var getItemsData = useCallback(function () {
15
26
  var _a;
27
+ var items = Array.from(((_a = ref === null || ref === void 0 ? void 0 : ref.current) === null || _a === void 0 ? void 0 : _a.querySelectorAll("[data-list=\"".concat(name, "\"]"))) || []).filter(function (item) { return getData(item, 'disabled') !== 'true'; });
28
+ return [
29
+ items,
30
+ items.find(function (item) { return getData(item, 'value') === currentValue; }),
31
+ ];
32
+ }, [name, currentValue]);
33
+ useEffect(function () {
34
+ if (!active) {
35
+ return undefined;
36
+ }
37
+ var _a = __read(getItemsData(), 2), selectedItem = _a[1];
38
+ if (ref === null || ref === void 0 ? void 0 : ref.current) {
39
+ scrollContainerToElement({
40
+ container: ref.current,
41
+ element: selectedItem,
42
+ });
43
+ setCurrent(getData(selectedItem, 'value') || '');
44
+ }
45
+ return function () {
46
+ setCurrent(null);
47
+ serFocused(null);
48
+ setHighlighted(null);
49
+ };
50
+ }, [active]);
51
+ var onClick = function (event) {
52
+ if (getData(event, 'disabled') === 'true') {
53
+ return;
54
+ }
55
+ serFocused(null);
56
+ onSelect === null || onSelect === void 0 ? void 0 : onSelect(event, currentValue || '');
57
+ };
58
+ var onKeyDown = function (event) {
59
+ if (isKey(event, 'Enter')) {
60
+ event.preventDefault();
61
+ if (currentValue)
62
+ onSelect === null || onSelect === void 0 ? void 0 : onSelect(event, currentValue);
63
+ }
16
64
  if (!isKey(event, 'ArrowUp') && !isKey(event, 'ArrowDown')) {
17
65
  return;
18
66
  }
19
67
  event.preventDefault();
20
- var items = Array.from(((_a = listRef === null || listRef === void 0 ? void 0 : listRef.current) === null || _a === void 0 ? void 0 : _a.querySelectorAll("[data-list=\"".concat(name, "\"]"))) || []).filter(function (item) { return item.getAttribute('aria-disabled') !== 'true'; });
21
- var currentIndex = currentItem !== null ? items.indexOf(currentItem) : null;
68
+ var _a = __read(getItemsData(), 2), items = _a[0], currentItem = _a[1];
69
+ var currentIndex = !currentItem ? null : items.indexOf(currentItem);
22
70
  var isArrowUp = isKey(event, 'ArrowUp');
23
71
  var newIndex = isArrowUp
24
72
  ? getPrevIndex(currentIndex !== null && currentIndex !== void 0 ? currentIndex : 0, items.length)
25
73
  : getNextIndex(currentIndex !== null && currentIndex !== void 0 ? currentIndex : -1, items.length);
26
74
  var item = items[newIndex];
27
- setCurrentItem(item);
28
- showKeyboardHighlight();
29
- if (listRef === null || listRef === void 0 ? void 0 : listRef.current) {
75
+ var newValue = getData(item, 'value');
76
+ setCurrent(newValue);
77
+ serFocused(newValue);
78
+ if (ref === null || ref === void 0 ? void 0 : ref.current) {
30
79
  scrollContainerToElement({
31
- container: listRef.current,
80
+ container: ref.current,
32
81
  element: item,
33
82
  });
34
83
  }
35
84
  };
36
85
  var onMouseMove = function (event) {
37
- if (currentItem !== event.currentTarget) {
38
- setCurrentItem(event.currentTarget || null);
39
- }
40
- hideKeyboardHighlight();
86
+ if (getData(event, 'disabled') !== 'true')
87
+ setCurrent(getData(event, 'value'));
88
+ setHighlighted(getData(event, 'value'));
41
89
  };
42
90
  var onMouseLeave = function () {
43
- if (keyboardHighlight) {
44
- return;
45
- }
46
- setCurrentItem(null);
91
+ setHighlighted(null);
47
92
  };
48
93
  return {
49
94
  'data-list': name,
50
- currentItem: currentItem,
51
- keyboardHighlight: keyboardHighlight,
95
+ ref: ref,
96
+ focused: focused,
97
+ highlighted: highlighted,
98
+ onClick: onClick,
52
99
  onKeyDown: onKeyDown,
53
100
  onMouseMove: onMouseMove,
54
101
  onMouseLeave: onMouseLeave,
@@ -18,16 +18,16 @@ export var Input = forwardRef(function (inProps, ref) {
18
18
  props: inProps,
19
19
  name: 'Input',
20
20
  });
21
- var _a = props.size, size = _a === void 0 ? INPUT_DEFAULT_SIZE : _a, label = props.label, error = props.error, autoFocus = props.autoFocus, placeholder = props.placeholder, id = props.id, name = props.name, type = props.type, renderLeft = props.renderLeft, renderRight = props.renderRight, inputRef = props.inputRef, fullWidth = props.fullWidth, disabled = props.disabled, hint = props.hint, required = props.required, className = props.className, inputProps = props.inputProps, value = props.value, defaultValue = props.defaultValue, onChange = props.onChange, labelProps = props.labelProps, labelRef = props.labelRef, other = __rest(props, ["size", "label", "error", "autoFocus", "placeholder", "id", "name", "type", "renderLeft", "renderRight", "inputRef", "fullWidth", "disabled", "hint", "required", "className", "inputProps", "value", "defaultValue", "onChange", "labelProps", "labelRef"]);
22
- var labelInnerRef = useRef(null);
21
+ var _a = props.size, size = _a === void 0 ? INPUT_DEFAULT_SIZE : _a, label = props.label, error = props.error, autoFocus = props.autoFocus, placeholder = props.placeholder, id = props.id, name = props.name, type = props.type, renderLeft = props.renderLeft, renderRight = props.renderRight, inputRef = props.inputRef, fullWidth = props.fullWidth, disabled = props.disabled, hint = props.hint, required = props.required, className = props.className, inputProps = props.inputProps, value = props.value, defaultValue = props.defaultValue, onChange = props.onChange, labelProps = props.labelProps, labelRef = props.labelRef, bodyProps = props.bodyProps, other = __rest(props, ["size", "label", "error", "autoFocus", "placeholder", "id", "name", "type", "renderLeft", "renderRight", "inputRef", "fullWidth", "disabled", "hint", "required", "className", "inputProps", "value", "defaultValue", "onChange", "labelProps", "labelRef", "bodyProps"]);
22
+ var bodyInnerRef = useRef(null);
23
23
  var fieldInnerRef = useRef(null);
24
24
  /* Хук useEventListener необходим для того, чтобы при нажатии на кнопку мыши
25
- * внутри HTML-элемента label - фокус не переходил на body или на цель нажатия кнопки мыши.
25
+ * внутри HTML-элемента label фокус не переходил на body или на цель нажатия кнопки мыши.
26
26
  * Если же нажатие кнопки происходит на самом HTML-элементе input, то мы ничего не делаем,
27
27
  * так как в противном случае мы сломаем возможность выделять текст для копирования.
28
28
  */
29
29
  useEventListener({
30
- element: labelInnerRef,
30
+ element: bodyInnerRef,
31
31
  eventName: 'mousedown',
32
32
  handler: function (e) {
33
33
  var _a;
@@ -38,7 +38,7 @@ export var Input = forwardRef(function (inProps, ref) {
38
38
  },
39
39
  });
40
40
  return (React.createElement(FieldControl, __assign({ size: size, error: error, disabled: disabled, required: required, fullWidth: fullWidth }, other, { ref: ref, className: cnInput({}, [className]) }),
41
- React.createElement("label", { className: cnInput('Body'), ref: labelInnerRef },
41
+ React.createElement("label", __assign({}, bodyProps, { className: cnInput('Body'), ref: useMultiRef([bodyProps === null || bodyProps === void 0 ? void 0 : bodyProps.ref, bodyInnerRef]) }),
42
42
  React.createElement(FieldIcon, { icon: renderLeft }),
43
43
  React.createElement("div", { className: cnInput('FieldContainer') },
44
44
  React.createElement(FieldLabel, __assign({}, labelProps, { ref: labelRef || (labelProps === null || labelProps === void 0 ? void 0 : labelProps.ref), className: labelProps === null || labelProps === void 0 ? void 0 : labelProps.className }), label),
@@ -1,4 +1,4 @@
1
- import type { ComponentPropsWithRef, ComponentRef, Ref } from 'react';
1
+ import type { ComponentPropsWithRef, Ref } from 'react';
2
2
  import type { FormElementSizeVariant } from '../../types/FormElementSizeVariant';
3
3
  import type { FIELD_CONTROL_DEFAULT_TAG } from '../FieldControl';
4
4
  import type { FieldIconProps } from '../FieldIcon';
@@ -63,8 +63,8 @@ export type InputProps = Omit<ComponentPropsWithRef<typeof FIELD_CONTROL_DEFAULT
63
63
  };
64
64
  /** Свойства FieldLabel */
65
65
  labelProps?: FieldLabelProps;
66
- /** Ссылка на корневой DOM-элемент компонента */
67
- ref?: ComponentRef<typeof FIELD_CONTROL_DEFAULT_TAG>;
66
+ /** Cвойства Body */
67
+ bodyProps?: ComponentPropsWithRef<'label'>;
68
68
  /** data-атрибут для тестирования */
69
69
  'data-testid'?: string;
70
70
  } & InputPropsDeprecated;
@@ -21,7 +21,7 @@ export var InputNumber = forwardRef(function (inProps, ref) {
21
21
  props: inProps,
22
22
  name: 'InputNumber',
23
23
  });
24
- var _a = props.size, size = _a === void 0 ? INPUT_NUMBER_DEFAULT_SIZE : _a, _b = props.step, step = _b === void 0 ? INPUT_NUMBER_DEFAULT_STEP : _b, _c = props.autoFocus, autoFocus = _c === void 0 ? INPUT_NUMBER_DEFAULT_AUTO_FOCUS : _c, _d = props.error, error = _d === void 0 ? INPUT_NUMBER_DEFAULT_ERROR : _d, _e = props.required, required = _e === void 0 ? INPUT_NUMBER_DEFAULT_REQUIRED : _e, _f = props.disabled, disabled = _f === void 0 ? INPUT_NUMBER_DEFAULT_DISABLED : _f, _g = props.fullWidth, fullWidth = _g === void 0 ? INPUT_NUMBER_DEFAULT_FULL_WIDTH : _g, _h = props.defaultValue, defaultValue = _h === void 0 ? INPUT_NUMBER_DEFAULT_VALUE : _h, _j = props.min, min = _j === void 0 ? INPUT_NUMBER_DEFAULT_MIN : _j, _k = props.max, max = _k === void 0 ? INPUT_NUMBER_DEFAULT_MAX : _k, label = props.label, placeholder = props.placeholder, id = props.id, name = props.name, renderLeft = props.renderLeft, renderRight = props.renderRight, hint = props.hint, className = props.className, inputProps = props.inputProps, valueProp = props.value, onChange = props.onChange, labelRef = props.labelRef, labelProps = props.labelProps, other = __rest(props, ["size", "step", "autoFocus", "error", "required", "disabled", "fullWidth", "defaultValue", "min", "max", "label", "placeholder", "id", "name", "renderLeft", "renderRight", "hint", "className", "inputProps", "value", "onChange", "labelRef", "labelProps"]);
24
+ var _a = props.size, size = _a === void 0 ? INPUT_NUMBER_DEFAULT_SIZE : _a, _b = props.step, step = _b === void 0 ? INPUT_NUMBER_DEFAULT_STEP : _b, _c = props.autoFocus, autoFocus = _c === void 0 ? INPUT_NUMBER_DEFAULT_AUTO_FOCUS : _c, _d = props.error, error = _d === void 0 ? INPUT_NUMBER_DEFAULT_ERROR : _d, _e = props.required, required = _e === void 0 ? INPUT_NUMBER_DEFAULT_REQUIRED : _e, _f = props.disabled, disabled = _f === void 0 ? INPUT_NUMBER_DEFAULT_DISABLED : _f, _g = props.fullWidth, fullWidth = _g === void 0 ? INPUT_NUMBER_DEFAULT_FULL_WIDTH : _g, _h = props.defaultValue, defaultValue = _h === void 0 ? INPUT_NUMBER_DEFAULT_VALUE : _h, _j = props.min, min = _j === void 0 ? INPUT_NUMBER_DEFAULT_MIN : _j, _k = props.max, max = _k === void 0 ? INPUT_NUMBER_DEFAULT_MAX : _k, label = props.label, placeholder = props.placeholder, id = props.id, name = props.name, renderLeft = props.renderLeft, renderRight = props.renderRight, hint = props.hint, className = props.className, inputProps = props.inputProps, valueProp = props.value, onChange = props.onChange, labelRef = props.labelRef, labelProps = props.labelProps, bodyProps = props.bodyProps, other = __rest(props, ["size", "step", "autoFocus", "error", "required", "disabled", "fullWidth", "defaultValue", "min", "max", "label", "placeholder", "id", "name", "renderLeft", "renderRight", "hint", "className", "inputProps", "value", "onChange", "labelRef", "labelProps", "bodyProps"]);
25
25
  var _l = __read(useState(false), 2), focused = _l[0], setFocused = _l[1];
26
26
  var _m = __read(useState(null), 2), timeoutId = _m[0], setTimeoutId = _m[1];
27
27
  var _o = __read(useState(null), 2), countDirection = _o[0], setCountDirection = _o[1];
@@ -31,8 +31,8 @@ export var InputNumber = forwardRef(function (inProps, ref) {
31
31
  state: 'value',
32
32
  defaultValue: defaultValue,
33
33
  }), 2), valueState = _p[0], setValueState = _p[1];
34
- var labelElemRef = useRef(null);
35
- var fieldRef = useRef(null);
34
+ var bodyInnerRef = useRef(null);
35
+ var fieldInnerRef = useRef(null);
36
36
  var filled = isValidValue(valueState);
37
37
  var handleChange = function (event) {
38
38
  if (disabled)
@@ -90,18 +90,18 @@ export var InputNumber = forwardRef(function (inProps, ref) {
90
90
  (_a = inputProps === null || inputProps === void 0 ? void 0 : inputProps.onKeyDown) === null || _a === void 0 ? void 0 : _a.call(inputProps, event);
91
91
  };
92
92
  /* Хук useEventListener необходим для того, чтобы при нажатии на кнопку мыши
93
- * внутри HTML-элемента label - фокус не переходил на body или на цель нажатия кнопки мыши.
93
+ * внутри HTML-элемента label фокус не переходил на body или на цель нажатия кнопки мыши.
94
94
  * Если же нажатие кнопки происходит на самом HTML-элементе input, то мы ничего не делаем,
95
95
  * так как в противном случае мы сломаем возможность выделять текст для копирования.
96
96
  */
97
97
  useEventListener({
98
- element: labelElemRef,
98
+ element: bodyInnerRef,
99
99
  eventName: 'mousedown',
100
100
  handler: function (e) {
101
101
  var _a;
102
- if (e.target !== fieldRef.current) {
102
+ if (e.target !== fieldInnerRef.current) {
103
103
  e.preventDefault();
104
- (_a = fieldRef.current) === null || _a === void 0 ? void 0 : _a.focus();
104
+ (_a = fieldInnerRef.current) === null || _a === void 0 ? void 0 : _a.focus();
105
105
  }
106
106
  },
107
107
  });
@@ -132,13 +132,13 @@ export var InputNumber = forwardRef(function (inProps, ref) {
132
132
  hasLabel: !!label,
133
133
  focused: focused,
134
134
  }, [className]) }),
135
- React.createElement("label", { ref: labelElemRef, className: cnInputNumber('Body') },
135
+ React.createElement("label", __assign({}, bodyProps, { className: cnInputNumber('Body'), ref: useMultiRef([bodyProps === null || bodyProps === void 0 ? void 0 : bodyProps.ref, bodyInnerRef]) }),
136
136
  React.createElement(FieldIcon, { className: cnInputNumber('RenderLeft'), icon: renderLeft, size: size }),
137
137
  React.createElement("div", { className: cnInputNumber('FieldContainer') },
138
- label && (React.createElement(FieldLabel, __assign({ filled: filled, focused: focused, required: required, disabled: disabled, size: size }, labelProps, { className: cnInputNumber('Label', [labelProps === null || labelProps === void 0 ? void 0 : labelProps.className]), ref: labelRef }), label)),
138
+ React.createElement(FieldLabel, __assign({ filled: filled, focused: focused, required: required, disabled: disabled, size: size }, labelProps, { className: cnInputNumber('Label', [labelProps === null || labelProps === void 0 ? void 0 : labelProps.className]), ref: labelRef }), label),
139
139
  React.createElement("input", __assign({ id: id, name: name, autoFocus: autoFocus, disabled: disabled, value: valueState, required: required, placeholder: placeholder, className: cnInputNumber('Field', { filled: filled }, [
140
140
  inputProps === null || inputProps === void 0 ? void 0 : inputProps.className,
141
- ]), min: min, max: max, step: step }, inputProps, { type: "number", onFocus: handleFocus, onBlur: handleBlur, onChange: handleChange, onKeyDown: handleKeyDown, ref: useMultiRef([inputProps === null || inputProps === void 0 ? void 0 : inputProps.ref, fieldRef]) }))),
141
+ ]), min: min, max: max, step: step }, inputProps, { type: "number", onFocus: handleFocus, onBlur: handleBlur, onChange: handleChange, onKeyDown: handleKeyDown, ref: useMultiRef([inputProps === null || inputProps === void 0 ? void 0 : inputProps.ref, fieldInnerRef]) }))),
142
142
  React.createElement(FieldIcon, { className: cnInputNumber('RenderRight'), icon: renderRight, size: size }),
143
143
  React.createElement("span", { className: cnInputNumber('Controls') },
144
144
  React.createElement(IconButton, { tabIndex: -1, size: size, className: cnInputNumber('Increment'), icon: SortUpIcon, onMouseDown: handleMouseDown('increment'), disabled: disabled, "aria-label": "increment", type: "button", variant: "ghost" }),
@@ -52,6 +52,8 @@ export type InputNumberProps = {
52
52
  labelRef?: FieldLabelProps['ref'];
53
53
  /** Свойства FieldLabel */
54
54
  labelProps?: FieldLabelProps;
55
+ /** Cвойства Body */
56
+ bodyProps?: ComponentPropsWithRef<'label'>;
55
57
  /** Шаг инкремента/декремента */
56
58
  step?: number;
57
59
  /** Минимально допустимое значение */
@@ -1,4 +1,4 @@
1
- import type { Ref, ComponentPropsWithRef, ComponentRef } from 'react';
1
+ import type { Ref, ComponentPropsWithRef } from 'react';
2
2
  import type { FormElementSizeVariant } from '../../types/FormElementSizeVariant';
3
3
  import type { FIELD_CONTROL_DEFAULT_TAG } from '../FieldControl';
4
4
  import type { FieldLabelProps } from '../FieldLabel';
@@ -61,8 +61,6 @@ export type TextareaProps = Omit<ComponentPropsWithRef<typeof FIELD_CONTROL_DEFA
61
61
  };
62
62
  /** Свойства FieldLabel */
63
63
  labelProps?: FieldLabelProps;
64
- /** Ссылка на корневой DOM-элемент компонента */
65
- ref?: ComponentRef<typeof FIELD_CONTROL_DEFAULT_TAG>;
66
64
  /** data-атрибут для тестирования */
67
65
  'data-testid'?: string;
68
66
  } & TextareaPropsDeprecated;
@@ -22,7 +22,7 @@ export var useControlled = function (_a) {
22
22
  console.error([
23
23
  "\u00D6zen-UI: \u041F\u043E\u0432\u0435\u0434\u0435\u043D\u0438\u0435 \u0441\u0432\u043E\u0439\u0441\u0442\u0432\u0430 '".concat(state, "' \u0443 \u043A\u043E\u043C\u043F\u043E\u043D\u0435\u043D\u0442\u0430 ").concat(name, " \u043F\u043E\u043C\u0435\u043D\u044F\u043B\u043E\u0441\u044C \u0441 ").concat(isControlled ? '' : 'не', "\u043A\u043E\u043D\u0442\u0440\u043E\u043B\u0438\u0440\u0443\u0435\u043C\u043E\u0433\u043E \u043D\u0430 ").concat(isControlled ? 'не' : '', "\u043A\u043E\u043D\u0442\u0440\u043E\u043B\u0438\u0440\u0443\u0435\u043C\u043E\u0435."),
24
24
  'Компоненты не должны переключаться с неконтролируемого поведения в контролируемое, или наоборот.',
25
- 'Поведение определяется после первого рендера и является контролируемым, если значение не "undefined"',
25
+ 'Поведение определяется после первого рендера и является контролируемым, если значение не «undefined».',
26
26
  ].join('\n'));
27
27
  }
28
28
  }, [state, name, valueProp]);
@@ -30,8 +30,8 @@ export var useControlled = function (_a) {
30
30
  useEffect(function () {
31
31
  if (!isControlled && defaultValue_1 !== defaultProp) {
32
32
  console.error([
33
- "\u00D6zen-UI: \u041D\u0435\u043A\u043E\u043D\u0442\u0440\u043E\u043B\u0438\u0440\u0443\u0435\u043C\u044B\u0439 \u043A\u043E\u043C\u043F\u043E\u043D\u0435\u043D\u0442 ".concat(name, " \u0441\u043C\u0435\u043D\u0438\u043B default ").concat(state, " \u043F\u043E\u0441\u043B\u0435 \u043F\u0435\u0440\u0432\u043E\u0439 \u0438\u043D\u0438\u0446\u0438\u0430\u043B\u0438\u0437\u0430\u0446\u0438\u0438 ").concat(name) +
34
- "\u0415\u0441\u043B\u0438 \u043D\u0435\u043E\u0431\u0445\u043E\u0434\u0438\u043C\u043E \u043C\u0435\u043D\u044F\u0442\u044C \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0432\u043E\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0439\u0442\u0435\u0441\u044C \u043A\u043E\u043D\u0442\u0440\u043E\u043B\u0438\u0440\u0443\u0435\u043C\u044B\u043C \u043F\u043E\u0432\u0435\u0434\u0435\u043D\u0438\u0435\u043C.",
33
+ "\u00D6zen-UI: \u041D\u0435\u043A\u043E\u043D\u0442\u0440\u043E\u043B\u0438\u0440\u0443\u0435\u043C\u044B\u0439 \u043A\u043E\u043C\u043F\u043E\u043D\u0435\u043D\u0442 ".concat(name, " \u0441\u043C\u0435\u043D\u0438\u043B default ").concat(state, " \u043F\u043E\u0441\u043B\u0435 \u043F\u0435\u0440\u0432\u043E\u0439 \u0438\u043D\u0438\u0446\u0438\u0430\u043B\u0438\u0437\u0430\u0446\u0438\u0438 ").concat(name, "."),
34
+ "\u0415\u0441\u043B\u0438 \u043D\u0435\u043E\u0431\u0445\u043E\u0434\u0438\u043C\u043E \u043C\u0435\u043D\u044F\u0442\u044C \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0432\u043E\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0439\u0442\u0435\u0441\u044C \u043A\u043E\u043D\u0442\u0440\u043E\u043B\u0438\u0440\u0443\u0435\u043C\u044B\u043C \u043F\u043E\u0432\u0435\u0434\u0435\u043D\u0438\u0435\u043C.",
35
35
  ].join('\n'));
36
36
  }
37
37
  }, [JSON.stringify(defaultProp)]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ozen-ui/kit",
3
- "version": "0.12.0",
3
+ "version": "0.13.0",
4
4
  "description": "React component library",
5
5
  "files": [
6
6
  "*"