mimir-ui-kit 1.19.1 → 1.19.2

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.
@@ -91,6 +91,8 @@ const Input = memo(
91
91
  rightAddon,
92
92
  leftAddon,
93
93
  size = "m",
94
+ numbersOnly,
95
+ maxLength,
94
96
  ...otherProps
95
97
  } = props;
96
98
  const [isFocused, setIsFocused] = useState(autofocus);
@@ -128,9 +130,16 @@ const Input = memo(
128
130
  }
129
131
  };
130
132
  const handleChange = (event) => {
131
- const targetValue = event.target.value;
132
- setWithValue(!!targetValue);
133
+ let newValue = event.target.value;
134
+ if (numbersOnly) {
135
+ newValue = newValue.replace(/\D/g, "");
136
+ }
137
+ if (maxLength !== void 0) {
138
+ newValue = newValue.slice(0, maxLength);
139
+ }
140
+ event.target.value = newValue;
133
141
  onChange == null ? void 0 : onChange(event);
142
+ setWithValue(!!newValue);
134
143
  };
135
144
  const currentLeftAddon = renderAddon(leftAddon);
136
145
  const currentRightAddon = renderAddon(rightAddon);
@@ -188,6 +197,8 @@ const Input = memo(
188
197
  readOnly: readonly,
189
198
  value,
190
199
  onChange: handleChange,
200
+ maxLength,
201
+ disabled: disabled2,
191
202
  ...otherProps
192
203
  }
193
204
  ),
@@ -5,7 +5,7 @@ import { c as cls, D as DatePickerModal } from "../../DatePickerModal-BM0BgzTb.j
5
5
  import { useClickOutside } from "../../hooks/useClickOutside/useClickOutside.js";
6
6
  import { formating } from "../../utils/index.js";
7
7
  import { Button } from "../Button/Button.js";
8
- import { I as Input } from "../../Input-C8BYj-Cv.js";
8
+ import { I as Input } from "../../Input-DdKAiGfJ.js";
9
9
  const DatePicker = memo(
10
10
  forwardRef(
11
11
  ({ size, value, onChangeValue, name, before, ...props }, ref) => {
@@ -42,6 +42,14 @@ export type TAdditionalProps = {
42
42
  * Флаг, показывающий наличие кнопки очистки.
43
43
  */
44
44
  withClearButton?: boolean;
45
+ /**
46
+ * Разрешить только числовой ввод
47
+ */
48
+ numbersOnly?: boolean;
49
+ /**
50
+ * Максимальная длина ввода
51
+ */
52
+ maxLength?: number;
45
53
  };
46
54
  export type TProps = TInputProps & TAdditionalProps;
47
55
  export declare const Input: import('react').MemoExoticComponent<import('react').ForwardRefExoticComponent<TInputProps & TAdditionalProps & import('react').RefAttributes<HTMLInputElement>>>;
@@ -2,7 +2,7 @@ import "react/jsx-runtime";
2
2
  import "../../index-CweZ_OcN.js";
3
3
  import "react";
4
4
  import "./constants.js";
5
- import { I } from "../../Input-C8BYj-Cv.js";
5
+ import { I } from "../../Input-DdKAiGfJ.js";
6
6
  import "../../hooks/useMergeRefs/useMergeRefs.js";
7
7
  import "../../icons/Icon.js";
8
8
  import "../Button/Button.js";
@@ -1,4 +1,4 @@
1
- import { I } from "../../Input-C8BYj-Cv.js";
1
+ import { I } from "../../Input-DdKAiGfJ.js";
2
2
  import { EInputSize, EInputVariant } from "./constants.js";
3
3
  export {
4
4
  EInputSize,
@@ -2,7 +2,7 @@ import { jsxs, jsx } from "react/jsx-runtime";
2
2
  import { memo, forwardRef, useState } from "react";
3
3
  import { Icon } from "../../icons/Icon.js";
4
4
  import { Button } from "../Button/Button.js";
5
- import { I as Input } from "../../Input-C8BYj-Cv.js";
5
+ import { I as Input } from "../../Input-DdKAiGfJ.js";
6
6
  import '../../assets/InputPassword.css';const input = "_input_mam1g_2";
7
7
  const wrapper = "_wrapper_mam1g_6";
8
8
  const button = "_button_mam1g_17";
@@ -1,7 +1,7 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import { memo, forwardRef, useState, useCallback, useImperativeHandle } from "react";
3
3
  import { getMaskedInputPhoneValue, getUnmaskedInputValue } from "./utils.js";
4
- import { I as Input } from "../../Input-C8BYj-Cv.js";
4
+ import { I as Input } from "../../Input-DdKAiGfJ.js";
5
5
  const InputPhoneNumber = memo(
6
6
  forwardRef(
7
7
  ({ value = "", onChange, ...props }, ref) => {
@@ -3,7 +3,7 @@ import { c as classNames } from "../../index-CweZ_OcN.js";
3
3
  import { forwardRef, useImperativeHandle, Fragment } from "react";
4
4
  import { ITEMS_PER_SEPARATOR, DEFAULT_VALUE_LENGTH } from "./constants.js";
5
5
  import { useOTPInput } from "./hooks.js";
6
- import { I as Input } from "../../Input-C8BYj-Cv.js";
6
+ import { I as Input } from "../../Input-DdKAiGfJ.js";
7
7
  import '../../assets/OtpInput.css';const otp = "_otp_196ev_3";
8
8
  const input = "_input_196ev_14";
9
9
  const separator = "_separator_196ev_28";
@@ -1,8 +1,9 @@
1
1
  import { RadioGroupProps } from '@headlessui/react';
2
+ import { ReactNode } from 'react';
2
3
 
3
4
  export interface TRadioOption {
4
5
  value: string;
5
- label: string;
6
+ label: ReactNode;
6
7
  }
7
8
  /**
8
9
  * Свойства компонента RadioGroup.
@@ -23,6 +24,11 @@ export type TRadioGroupProps = Omit<RadioGroupProps, 'value'> & {
23
24
  * Может быть необязательным.
24
25
  */
25
26
  label?: string;
27
+ /**
28
+ * Дополнительный класснейм для элементов радиогруппы.
29
+ *
30
+ */
31
+ classNameRadioWrapper?: string;
26
32
  };
27
33
  /**
28
34
  * Компонент RadioGroup для выбора одной опции из нескольких.
@@ -43,4 +49,9 @@ export declare const RadioGroup: import('react').ForwardRefExoticComponent<Omit<
43
49
  * Может быть необязательным.
44
50
  */
45
51
  label?: string;
52
+ /**
53
+ * Дополнительный класснейм для элементов радиогруппы.
54
+ *
55
+ */
56
+ classNameRadioWrapper?: string;
46
57
  } & import('react').RefAttributes<HTMLElement>>;
@@ -120,10 +120,14 @@ const cls = {
120
120
  checked
121
121
  };
122
122
  const RadioGroup = forwardRef(
123
- ({ options, value, onChange, label: label2, ...props }, ref) => {
124
- const radioClasses = classNames(cls["radio-wrapper"], {
125
- [cls.disabled]: props.disabled
126
- });
123
+ ({ options, value, onChange, label: label2, classNameRadioWrapper, ...props }, ref) => {
124
+ const radioClasses = classNames(
125
+ cls["radio-wrapper"],
126
+ classNameRadioWrapper,
127
+ {
128
+ [cls.disabled]: props.disabled
129
+ }
130
+ );
127
131
  return /* @__PURE__ */ jsxs(
128
132
  Tt,
129
133
  {
@@ -163,7 +167,7 @@ const RadioGroup = forwardRef(
163
167
  label22
164
168
  ] })
165
169
  },
166
- label22
170
+ typeof value2 === "string" ? value2 : String(value2)
167
171
  )) })
168
172
  ]
169
173
  }
@@ -4,7 +4,7 @@ import * as React from "react";
4
4
  import React__default, { useReducer, useMemo, useSyncExternalStore, useId as useId$1, useEffect, useCallback, useRef, useLayoutEffect, createContext, useContext, useState, Fragment, createRef, forwardRef } from "react";
5
5
  import { ESelectSearchSize } from "./constants.js";
6
6
  import { Icon } from "../../icons/Icon.js";
7
- import { I as Input } from "../../Input-C8BYj-Cv.js";
7
+ import { I as Input } from "../../Input-DdKAiGfJ.js";
8
8
  import { EInputVariant, EInputSize } from "../Input/constants.js";
9
9
  import { n as n$2, u as u$3, d as o$1, s as s$3, o as o$2, p as p$1, t as t$3, e as s$4, W as W$1, y as y$3, T, H, M as M$1, a as u$5, $ as $f7dceffc5ad7768b$export$4e328f61c538687f, b as $6179b936705e76d3$export$ae780daf29e6d456, D as D$2, c as o$3 } from "../../keyboard-B256ZoM-.js";
10
10
  import * as ReactDOM from "react-dom";
@@ -3798,7 +3798,8 @@ const SelectSearch = forwardRef(
3798
3798
  onSearch,
3799
3799
  variant = EInputVariant.DefaultGray,
3800
3800
  menuPlacement = "bottom",
3801
- disabled: disabled2 = false
3801
+ disabled: disabled2 = false,
3802
+ searchProps
3802
3803
  } = props;
3803
3804
  const [inputValue, setInputValue] = useState("");
3804
3805
  const mapSizeToInputSize = (size22) => {
@@ -3863,7 +3864,8 @@ const SelectSearch = forwardRef(
3863
3864
  onChange: handleInputChange,
3864
3865
  value: inputValue,
3865
3866
  disabled: disabled2,
3866
- variant
3867
+ variant,
3868
+ ...searchProps
3867
3869
  }
3868
3870
  ),
3869
3871
  showArrow && /* @__PURE__ */ jsx(Ho, { className: cls.button, disabled: disabled2, children: /* @__PURE__ */ jsx(
@@ -1,6 +1,6 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { ESelectSearchSize } from './constants';
3
- import { TVariant } from '../Input';
3
+ import { TInputProps, TVariant } from '../Input';
4
4
 
5
5
  export type TSelectOption = {
6
6
  name: string;
@@ -50,4 +50,6 @@ export type TSelectSearchProps = {
50
50
  menuPlacement?: TMenuPlacement;
51
51
  /** Отключает компонент SelectSearch */
52
52
  disabled?: boolean;
53
+ /** Пропсы для инпута поиска опций */
54
+ searchProps?: Pick<TInputProps, 'numbersOnly' | 'maxLength'>;
53
55
  };
@@ -5,7 +5,7 @@ import { useAutoResizeTextArea } from "./hooks.js";
5
5
  import { useMergeRefs } from "../../hooks/useMergeRefs/useMergeRefs.js";
6
6
  import { Icon } from "../../icons/Icon.js";
7
7
  import { Button } from "../Button/Button.js";
8
- import { c as cls } from "../../Input-C8BYj-Cv.js";
8
+ import { c as cls } from "../../Input-DdKAiGfJ.js";
9
9
  import { EInputVariant } from "../Input/constants.js";
10
10
  import '../../assets/TextArea.css';const textarea = "_textarea_46c4k_2";
11
11
  const s = "_s_46c4k_6";
@@ -1,6 +1,6 @@
1
1
  import { Button } from "./Button/Button.js";
2
2
  import { EButtonForm, EButtonSize, EButtonVariantDefault, EButtonVariantOutline, EButtonVariantRound } from "./Button/constants.js";
3
- import { I } from "../Input-C8BYj-Cv.js";
3
+ import { I } from "../Input-DdKAiGfJ.js";
4
4
  import { EInputSize, EInputVariant } from "./Input/constants.js";
5
5
  import { TextArea } from "./TextArea/TextArea.js";
6
6
  import { InputPassword } from "./InputPassword/InputPassword.js";
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { Button } from "./components/Button/Button.js";
2
2
  import { EButtonForm, EButtonSize, EButtonVariantDefault, EButtonVariantOutline, EButtonVariantRound } from "./components/Button/constants.js";
3
- import { I } from "./Input-C8BYj-Cv.js";
3
+ import { I } from "./Input-DdKAiGfJ.js";
4
4
  import { EInputSize, EInputVariant } from "./components/Input/constants.js";
5
5
  import { TextArea } from "./components/TextArea/TextArea.js";
6
6
  import { InputPassword } from "./components/InputPassword/InputPassword.js";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mimir-ui-kit",
3
3
  "private": false,
4
- "version": "1.19.1",
4
+ "version": "1.19.2",
5
5
  "type": "module",
6
6
  "exports": {
7
7
  ".": {