@alphakits/ui 2.5.7 → 2.5.8

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 (41) hide show
  1. package/dist/amount/component.js +39 -39
  2. package/dist/amount-input/component.js +124 -101
  3. package/dist/amount-input/index.css +1 -1
  4. package/dist/amount-input/index.module.css.js +12 -8
  5. package/dist/amount-input/utils/index.d.ts +5 -0
  6. package/dist/amount-input/utils/index.js +40 -12
  7. package/dist/calendar/components/days-table/index.css +1 -1
  8. package/dist/calendar/components/header/index.css +1 -1
  9. package/dist/calendar/components/months-table/index.css +1 -1
  10. package/dist/calendar/components/select-button/index.css +1 -1
  11. package/dist/calendar/components/years-table/index.css +1 -1
  12. package/dist/calendar/index.css +1 -1
  13. package/dist/calendar-input/index.css +1 -1
  14. package/dist/form/templates/base-form/index.js +8 -8
  15. package/dist/form/templates/filters-form/index.js +13 -13
  16. package/dist/form/templates/rest-form/form.js +28 -28
  17. package/dist/form/templates/rest-form/index.js +12 -12
  18. package/dist/form-control/component.d.ts +8 -0
  19. package/dist/form-control/component.js +49 -28
  20. package/dist/index.js +43 -42
  21. package/dist/input/component.d.ts +4 -0
  22. package/dist/input/component.js +159 -105
  23. package/dist/input/index.css +1 -1
  24. package/dist/input/index.module.css.js +16 -8
  25. package/dist/input/utils/get-default-input-mode.d.ts +3 -0
  26. package/dist/input/utils/get-default-input-mode.js +14 -0
  27. package/dist/input-autocomplete/component.d.ts +4 -0
  28. package/dist/masked-input/component.d.ts +2 -0
  29. package/dist/select/component.d.ts +4 -0
  30. package/dist/select/components/arrow/index.css +1 -1
  31. package/dist/select/components/checkmark/index.css +1 -1
  32. package/dist/select/components/field/index.css +1 -1
  33. package/dist/select/components/optgroup/index.css +1 -1
  34. package/dist/select/components/option/index.css +1 -1
  35. package/dist/select/components/options-list/index.css +1 -1
  36. package/dist/select/components/virtual-options-list/index.css +1 -1
  37. package/dist/utils/format-amount/util.d.ts +1 -0
  38. package/dist/utils/format-amount/util.js +31 -26
  39. package/dist/utils/index.js +33 -32
  40. package/dist/with-suffix/component.d.ts +2 -0
  41. package/package.json +3 -2
package/dist/index.js CHANGED
@@ -11,7 +11,7 @@ import { ButtonArrow as C } from "./button-arrow/component.js";
11
11
  import { Calendar as k } from "./calendar/component.js";
12
12
  import { useCalendar as M } from "./calendar/use-calendar.js";
13
13
  import { usePeriod as P } from "./calendar/use-period.js";
14
- import { DAYS_IN_WEEK as F, MONTHS_IN_YEAR as R, SUNDAY_INDEX as B, dateInLimits as L, limitDate as y, monthName as b, russianWeekDay as w } from "./calendar/utils.js";
14
+ import { DAYS_IN_WEEK as F, MONTHS_IN_YEAR as R, SUNDAY_INDEX as y, dateInLimits as B, limitDate as L, monthName as b, russianWeekDay as w } from "./calendar/utils.js";
15
15
  import { CalendarInput as N } from "./calendar-input/component.js";
16
16
  import { DATE_FORMAT as v, DATE_MASK as G, IS_BROWSER as H, NATIVE_DATE_FORMAT as U, SUPPORTS_INPUT_TYPE_DATE as q, isCompleteDateInput as z, isInputDateSupported as K, parseDateString as V } from "./calendar-input/utils.js";
17
17
  import { Card as J } from "./card/component.js";
@@ -31,8 +31,8 @@ import { Dot as ko } from "./dot/component.js";
31
31
  import { EmptyPage as Mo } from "./empty-page/component.js";
32
32
  import { FilterTag as Po } from "./filter-tag/component.js";
33
33
  import { Flex as Fo } from "./flex/component.js";
34
- import { FlexColumns as Bo } from "./flex-columns/component.js";
35
- import { Footer as yo } from "./footer/component.js";
34
+ import { FlexColumns as yo } from "./flex-columns/component.js";
35
+ import { Footer as Lo } from "./footer/component.js";
36
36
  import { FiltersForm as wo } from "./form/templates/filters-form/index.js";
37
37
  import { FormControl as No } from "./form-control/component.js";
38
38
  import { ErrorMessage as vo, FastField as Go, Field as Ho, FieldArray as Uo, Form as qo, Formik as zo, connect as Ko, useField as Vo, useFormik as jo, useFormikContext as Jo, withFormik as Xo } from "formik";
@@ -52,8 +52,8 @@ import { InfoBlockHeader as kr } from "./info-block-header/component.js";
52
52
  import { InfoBlockItem as Mr } from "./info-block-item/component.js";
53
53
  import { InfoBlockWrapper as Pr } from "./info-block-wrapper/component.js";
54
54
  import { Input as Fr } from "./input/component.js";
55
- import { InputAutocomplete as Br } from "./input-autocomplete/component.js";
56
- import { InputGhost as yr } from "./input-ghost/component.js";
55
+ import { InputAutocomplete as yr } from "./input-autocomplete/component.js";
56
+ import { InputGhost as Lr } from "./input-ghost/component.js";
57
57
  import { Link as wr } from "./link/component.js";
58
58
  import { ListAllert as Nr } from "./list-allert/component.js";
59
59
  import { Loader as vr } from "./loader/component.js";
@@ -78,8 +78,8 @@ import { Radio as ke } from "./radio/component.js";
78
78
  import { RadioGroup as Me } from "./radio-group/component.js";
79
79
  import { RadioGroups as Pe } from "./radio-groups/component.js";
80
80
  import { SectionWrapper as Fe } from "./section-wrapper/component.js";
81
- import { Select as Be } from "./select/component.js";
82
- import { Arrow as ye } from "./select/components/arrow/component.js";
81
+ import { Select as ye } from "./select/component.js";
82
+ import { Arrow as Le } from "./select/components/arrow/component.js";
83
83
  import { BaseSelect as we } from "./select/components/base-select/component.js";
84
84
  import { SelectField as Ne } from "./select/components/field/component.js";
85
85
  import { Optgroup as ve } from "./select/components/optgroup/component.js";
@@ -101,8 +101,8 @@ import { SteppedProgressBar as Dt, useSteps as kt } from "./stepped-progress-bar
101
101
  import { Sticker as Mt } from "./sticker/component.js";
102
102
  import { SuffixInput as Pt } from "./suffix-input/component.js";
103
103
  import { SuperListHeader as Ft } from "./super-list-header/component.js";
104
- import { SuperListItem as Bt } from "./super-list-item/component.js";
105
- import { Switch as yt } from "./switch/component.js";
104
+ import { SuperListItem as yt } from "./super-list-item/component.js";
105
+ import { Switch as Lt } from "./switch/component.js";
106
106
  import { Table as wt } from "./table/component.js";
107
107
  import { TableCell as Nt } from "./table/components/cell/component.js";
108
108
  import { TableStatus as vt } from "./table-status/component.js";
@@ -116,21 +116,21 @@ import { ToastNotifier as mp } from "./toast-notifier/component.js";
116
116
  import { ToastPlate as ap } from "./toast-plate/component.js";
117
117
  import { Tooltip as sp } from "./tooltip/component.js";
118
118
  import { Typography as np } from "./typography/component.js";
119
- import { add as lp, addDays as dp, addMonths as Sp, addYears as cp, eachDayOfInterval as Tp, eachMonthOfInterval as Op, eachYearOfInterval as hp, endOfDay as Ip, endOfISOWeek as Ap, endOfWeek as Cp, endOfYear as Dp, format as kp, isAfter as Ep, isBefore as Mp, isEqual as gp, isLastDayOfMonth as Pp, isSameDay as _p, isSameMonth as Fp, isSameYear as Rp, isThisMonth as Bp, isThisYear as Lp, isToday as yp, isWithinInterval as bp, lastDayOfMonth as wp, max as Wp, min as Np, parse as Yp, parseISO as vp, startOfDay as Gp, startOfISOWeek as Hp, startOfMonth as Up, startOfWeek as qp, startOfYear as zp, subDays as Kp, subMonths as Vp, subWeeks as jp, subYears as Jp, weekDaysShort as Xp } from "./utils/date/index.js";
119
+ import { add as lp, addDays as dp, addMonths as Sp, addYears as cp, eachDayOfInterval as Tp, eachMonthOfInterval as Op, eachYearOfInterval as hp, endOfDay as Ip, endOfISOWeek as Ap, endOfWeek as Cp, endOfYear as Dp, format as kp, isAfter as Ep, isBefore as Mp, isEqual as gp, isLastDayOfMonth as Pp, isSameDay as _p, isSameMonth as Fp, isSameYear as Rp, isThisMonth as yp, isThisYear as Bp, isToday as Lp, isWithinInterval as bp, lastDayOfMonth as wp, max as Wp, min as Np, parse as Yp, parseISO as vp, startOfDay as Gp, startOfISOWeek as Hp, startOfMonth as Up, startOfWeek as qp, startOfYear as zp, subDays as Kp, subMonths as Vp, subWeeks as jp, subYears as Jp, weekDaysShort as Xp } from "./utils/date/index.js";
120
120
  import { debounce as Zp } from "./utils/debounce.js";
121
- import { AMOUNT_MAJOR_MINOR_PARTS_SEPARATOR as om, THINSP as rm, formatAmount as em } from "./utils/format-amount/util.js";
122
- import { formatDate as pm, locales as mm } from "./utils/format-date/index.js";
123
- import { safeStringify as am } from "./utils/safe-stringify.js";
124
- import { showCompactSuccess as sm, showError as im, showSuccess as nm } from "./utils/show-toast/index.js";
125
- import { splitAmount as lm } from "./utils/split-amount/util.js";
126
- import { capitalize as Sm } from "./utils/string.js";
127
- import { WelcomeContainer as Tm } from "./welcome-layout/component.js";
128
- import { withSuffix as hm } from "./with-suffix/component.js";
121
+ import { AMOUNT_MAJOR_MINOR_PARTS_SEPARATOR as om, THINSP as rm, formatAmount as em, isCurrencyFirst as tm } from "./utils/format-amount/util.js";
122
+ import { formatDate as mm, locales as fm } from "./utils/format-date/index.js";
123
+ import { safeStringify as xm } from "./utils/safe-stringify.js";
124
+ import { showCompactSuccess as im, showError as nm, showSuccess as um } from "./utils/show-toast/index.js";
125
+ import { splitAmount as dm } from "./utils/split-amount/util.js";
126
+ import { capitalize as cm } from "./utils/string.js";
127
+ import { WelcomeContainer as Om } from "./welcome-layout/component.js";
128
+ import { withSuffix as Im } from "./with-suffix/component.js";
129
129
  export {
130
130
  om as AMOUNT_MAJOR_MINOR_PARTS_SEPARATOR,
131
131
  e as Amount,
132
132
  p as AmountInput,
133
- ye as Arrow,
133
+ Le as Arrow,
134
134
  f as Avatar,
135
135
  x as BackButton,
136
136
  i as Badge,
@@ -167,8 +167,8 @@ export {
167
167
  Po as FilterTag,
168
168
  wo as FiltersForm,
169
169
  Fo as Flex,
170
- Bo as FlexColumns,
171
- yo as Footer,
170
+ yo as FlexColumns,
171
+ Lo as Footer,
172
172
  qo as Form,
173
173
  No as FormControl,
174
174
  co as FormattedDate,
@@ -184,8 +184,8 @@ export {
184
184
  Mr as InfoBlockItem,
185
185
  Pr as InfoBlockWrapper,
186
186
  Fr as Input,
187
- Br as InputAutocomplete,
188
- yr as InputGhost,
187
+ yr as InputAutocomplete,
188
+ Lr as InputGhost,
189
189
  jt as LOACAL_STORAGE_THEME_KEY,
190
190
  ue as LabeledButton,
191
191
  wr as Link,
@@ -219,10 +219,10 @@ export {
219
219
  T as Radiuses,
220
220
  or as Row,
221
221
  Jt as STYLE_TAG_ID,
222
- B as SUNDAY_INDEX,
222
+ y as SUNDAY_INDEX,
223
223
  q as SUPPORTS_INPUT_TYPE_DATE,
224
224
  Fe as SectionWrapper,
225
- Be as Select,
225
+ ye as Select,
226
226
  Ne as SelectField,
227
227
  ft as Sidepanel,
228
228
  xt as SidepanelHeader,
@@ -237,8 +237,8 @@ export {
237
237
  Mt as Sticker,
238
238
  Pt as SuffixInput,
239
239
  Ft as SuperListHeader,
240
- Bt as SuperListItem,
241
- yt as Switch,
240
+ yt as SuperListItem,
241
+ Lt as Switch,
242
242
  Xt as THEME,
243
243
  Qt as THEME_DATA_ATTR,
244
244
  rm as THINSP,
@@ -255,15 +255,15 @@ export {
255
255
  sp as Tooltip,
256
256
  np as Typography,
257
257
  Ke as VirtualOptionsList,
258
- Tm as WelcomeContainer,
258
+ Om as WelcomeContainer,
259
259
  lp as add,
260
260
  dp as addDays,
261
261
  Sp as addMonths,
262
262
  cp as addYears,
263
- Sm as capitalize,
263
+ cm as capitalize,
264
264
  Ko as connect,
265
265
  Ze as convertToOptions,
266
- L as dateInLimits,
266
+ B as dateInLimits,
267
267
  Zp as debounce,
268
268
  rp as defaultThemes,
269
269
  Tp as eachDayOfInterval,
@@ -275,10 +275,11 @@ export {
275
275
  Dp as endOfYear,
276
276
  kp as format,
277
277
  em as formatAmount,
278
- pm as formatDate,
278
+ mm as formatDate,
279
279
  Ep as isAfter,
280
280
  Mp as isBefore,
281
281
  z as isCompleteDateInput,
282
+ tm as isCurrencyFirst,
282
283
  gp as isEqual,
283
284
  $e as isGroup,
284
285
  K as isInputDateSupported,
@@ -287,15 +288,15 @@ export {
287
288
  _p as isSameDay,
288
289
  Fp as isSameMonth,
289
290
  Rp as isSameYear,
290
- Bp as isThisMonth,
291
- Lp as isThisYear,
292
- yp as isToday,
291
+ yp as isThisMonth,
292
+ Bp as isThisYear,
293
+ Lp as isToday,
293
294
  bp as isWithinInterval,
294
295
  rt as joinOptions,
295
296
  wp as lastDayOfMonth,
296
297
  et as lastIndexOf,
297
- y as limitDate,
298
- mm as locales,
298
+ L as limitDate,
299
+ fm as locales,
299
300
  Wp as max,
300
301
  Np as min,
301
302
  b as monthName,
@@ -304,13 +305,13 @@ export {
304
305
  vp as parseISO,
305
306
  tt as processOptions,
306
307
  w as russianWeekDay,
307
- am as safeStringify,
308
+ xm as safeStringify,
308
309
  io as showAlert,
309
- sm as showCompactSuccess,
310
+ im as showCompactSuccess,
310
311
  no as showConfirm,
311
- im as showError,
312
- nm as showSuccess,
313
- lm as splitAmount,
312
+ nm as showError,
313
+ um as showSuccess,
314
+ dm as splitAmount,
314
315
  ht as stackingOrder,
315
316
  Gp as startOfDay,
316
317
  Hp as startOfISOWeek,
@@ -340,5 +341,5 @@ export {
340
341
  pt as useVisibleOptions,
341
342
  Xp as weekDaysShort,
342
343
  Xo as withFormik,
343
- hm as withSuffix
344
+ Im as withSuffix
344
345
  };
@@ -9,8 +9,10 @@ export type InputProps = Omit<InputHTMLAttributes<HTMLInputElement>, 'size' | 't
9
9
  error?: string | boolean;
10
10
  success?: boolean;
11
11
  hint?: string;
12
+ showCount?: boolean;
12
13
  label?: React.ReactNode;
13
14
  type?: 'number' | 'card' | 'email' | 'money' | 'password' | 'tel' | 'text';
15
+ passwordReveal?: boolean;
14
16
  wrapperRef?: React.Ref<HTMLDivElement>;
15
17
  leftAddons?: React.ReactNode;
16
18
  rightAddons?: React.ReactNode;
@@ -41,8 +43,10 @@ export declare const Input: React.ForwardRefExoticComponent<Omit<React.InputHTML
41
43
  error?: string | boolean | undefined;
42
44
  success?: boolean | undefined;
43
45
  hint?: string | undefined;
46
+ showCount?: boolean | undefined;
44
47
  label?: React.ReactNode;
45
48
  type?: "number" | "text" | "tel" | "email" | "card" | "money" | "password" | undefined;
49
+ passwordReveal?: boolean | undefined;
46
50
  wrapperRef?: React.Ref<HTMLDivElement> | undefined;
47
51
  leftAddons?: React.ReactNode;
48
52
  rightAddons?: React.ReactNode;
@@ -1,132 +1,186 @@
1
- import { jsx as a, jsxs as et } from "react/jsx-runtime";
1
+ import { jsx as o, jsxs as Ne } from "react/jsx-runtime";
2
2
  import I from "classnames";
3
- import st, { useRef as ot, useState as F, useCallback as l, Fragment as at } from "react";
4
- import nt from "react-merge-refs";
5
- import { Button as rt } from "../button/component.js";
6
- import { FormControl as it } from "../form-control/component.js";
7
- import { useFocus as ct } from "../hooks/useFocus/index.js";
3
+ import Be from "@alphakits/icons/dist/CancelM";
4
+ import $e from "@alphakits/icons/dist/AlertCircleM";
5
+ import ke from "@alphakits/icons/dist/CheckmarkCircleM";
6
+ import ye from "@alphakits/icons/dist/EyeM";
7
+ import Fe, { useRef as xe, useId as je, useState as k, useMemo as He, useCallback as u, Fragment as Pe } from "react";
8
+ import Te from "react-merge-refs";
9
+ import { Button as E } from "../button/component.js";
10
+ import { FormControl as Ae } from "../form-control/component.js";
11
+ import { useFocus as Ce } from "../hooks/useFocus/index.js";
8
12
  import s from "./index.module.css.js";
9
- const Vt = st.forwardRef(
13
+ import { getDefaultInputMode as Se } from "./utils/get-default-input-mode.js";
14
+ const Ze = Fe.forwardRef(
10
15
  ({
11
- size: k = "m",
12
- type: v = "text",
13
- block: C = !1,
14
- bottomAddons: j,
15
- dataTestId: w,
16
- clear: S = !1,
17
- disabled: n,
18
- error: u,
19
- success: N,
20
- required: y,
21
- hint: A,
16
+ size: q = "m",
17
+ type: b = "text",
18
+ block: z = !1,
19
+ bottomAddons: G,
20
+ dataTestId: J,
21
+ clear: K = !1,
22
+ disabled: a,
23
+ error: t,
24
+ success: y,
25
+ required: F,
26
+ hint: i,
27
+ showCount: f = !1,
22
28
  className: L,
23
- fieldClassName: q,
24
- inputClassName: z,
25
- labelClassName: D,
26
- addonsClassName: E,
27
- focusedClassName: G,
28
- filledClassName: H,
29
- label: r,
30
- maxLength: J = 100,
31
- leftAddons: K,
32
- onFocus: m,
33
- onBlur: p,
34
- onChange: d,
35
- onClear: h,
36
- onClick: M,
37
- onMouseDown: P,
38
- onMouseUp: Q,
39
- rightAddons: R,
40
- value: g,
41
- defaultValue: T,
42
- wrapperRef: U,
43
- readOnly: i,
44
- ...W
45
- }, X) => {
46
- const e = g === void 0, c = ot(null), [Y] = ct(c, "keyboard"), [o, b] = F(!1), [x, B] = F(T || ""), V = !!(e ? x : g), f = S && V && !n && !i, Z = l(
47
- (t) => {
48
- i || b(!0), m && m(t);
29
+ fieldClassName: Q,
30
+ inputClassName: U,
31
+ labelClassName: W,
32
+ addonsClassName: X,
33
+ focusedClassName: Y,
34
+ filledClassName: Z,
35
+ label: m,
36
+ maxLength: x = 100,
37
+ leftAddons: _,
38
+ onFocus: g,
39
+ onBlur: R,
40
+ onChange: r,
41
+ onClear: V,
42
+ onClick: O,
43
+ onMouseDown: ee,
44
+ onMouseUp: te,
45
+ rightAddons: j,
46
+ value: H,
47
+ defaultValue: se,
48
+ wrapperRef: oe,
49
+ readOnly: c,
50
+ passwordReveal: ae = !0,
51
+ inputMode: ie,
52
+ enterKeyHint: re,
53
+ id: ne,
54
+ ...ce
55
+ }, le) => {
56
+ const l = H === void 0, n = xe(null), de = je(), [ue] = Ce(n, "keyboard"), [h, P] = k(!1), [fe, T] = k(se || ""), [p, me] = k(!1), d = ne ?? de, A = m ? `${d}-label` : void 0, w = i || f ? `${d}-hint` : void 0, M = t && typeof t == "string" ? `${d}-error` : void 0, N = l ? fe : H ?? "", B = !!N, C = typeof t == "string" ? t : "", pe = He(
57
+ () => [C ? M : null, i || f ? w : null].filter(Boolean).join(" ") || void 0,
58
+ [C, M, i, f, w]
59
+ ), $ = f ? `${N.length}/${x}` : "", ve = i && $ ? `${i} · ${$}` : $ || i, S = b === "password", D = S && ae && !a && !c, Ie = S && p ? "text" : b, be = ie ?? Se(b), v = K && B && !a && !c, ge = u(
60
+ (e) => {
61
+ c || P(!0), g && g(e);
49
62
  },
50
- [m, i]
51
- ), _ = l(
52
- (t) => {
53
- b(!1), p && p(t);
63
+ [g, c]
64
+ ), Re = u(
65
+ (e) => {
66
+ P(!1), R && R(e);
54
67
  },
55
- [p]
56
- ), $ = l(
57
- (t) => {
58
- d && d(t, { value: t.target.value }), e && B(t.target.value);
68
+ [R]
69
+ ), Ve = u(
70
+ (e) => {
71
+ r && r(e, { value: e.target.value }), l && T(e.target.value);
59
72
  },
60
- [d, e]
61
- ), O = l(
62
- (t) => {
63
- f && (e && B(""), h && h(t), c.current && !o && c.current.focus());
73
+ [r, l]
74
+ ), he = u(
75
+ (e) => {
76
+ v && (l && T(""), r && r(
77
+ {
78
+ ...e,
79
+ target: n.current,
80
+ currentTarget: n.current
81
+ },
82
+ { value: "" }
83
+ ), V && V(e), n.current?.focus());
64
84
  },
65
- [f, o, h, e]
66
- ), tt = () => (f || R || N) && /* @__PURE__ */ et(at, { children: [
67
- f && /* @__PURE__ */ a(
68
- rt,
85
+ [v, r, V, l]
86
+ ), we = u(() => {
87
+ me((e) => !e), n.current?.focus();
88
+ }, []), Me = () => (v || j || y || t || D) && /* @__PURE__ */ Ne(Pe, { children: [
89
+ v && /* @__PURE__ */ o(
90
+ E,
69
91
  {
70
92
  type: "button",
71
93
  view: "ghost",
72
- disabled: n,
94
+ disabled: a,
73
95
  "aria-label": "Очистить",
74
96
  className: s.clearButton,
75
- onClick: O,
76
- children: /* @__PURE__ */ a("span", { className: s.clearIcon })
97
+ onClick: he,
98
+ children: /* @__PURE__ */ o(Be, { className: s.clearIcon, "aria-hidden": "true" })
99
+ }
100
+ ),
101
+ D && /* @__PURE__ */ o(
102
+ E,
103
+ {
104
+ type: "button",
105
+ view: "ghost",
106
+ disabled: a,
107
+ "aria-label": p ? "Скрыть пароль" : "Показать пароль",
108
+ "aria-pressed": p,
109
+ className: s.passwordRevealButton,
110
+ onClick: we,
111
+ children: /* @__PURE__ */ o(
112
+ ye,
113
+ {
114
+ className: I(s.passwordRevealIcon, {
115
+ [s.passwordRevealIconHidden]: p
116
+ }),
117
+ "aria-hidden": "true"
118
+ }
119
+ )
77
120
  }
78
121
  ),
79
- N && !u && /* @__PURE__ */ a("span", { className: s.successIcon }),
80
- R
122
+ t && /* @__PURE__ */ o($e, { className: s.errorIcon, "aria-hidden": "true" }),
123
+ y && !t && /* @__PURE__ */ o(ke, { className: s.successIcon, "aria-hidden": "true" }),
124
+ j
81
125
  ] });
82
- return /* @__PURE__ */ a(
83
- it,
126
+ return /* @__PURE__ */ o(
127
+ Ae,
84
128
  {
85
- ref: U,
86
- className: I(L, o && G, V && H),
87
- fieldClassName: I(q, {
88
- [s.focusVisible]: Y
129
+ ref: oe,
130
+ className: I(L, h && Y, B && Z),
131
+ fieldClassName: I(Q, {
132
+ [s.focusVisible]: ue
89
133
  }),
90
- labelClassName: D,
91
- addonsClassName: E,
92
- size: k,
93
- block: C,
94
- required: y,
95
- disabled: n,
96
- filled: V || o,
97
- focused: o,
98
- error: u,
99
- label: r,
100
- hint: A,
101
- leftAddons: K,
102
- rightAddons: tt(),
103
- bottomAddons: j,
104
- onClick: M,
105
- onMouseDown: P,
106
- onMouseUp: Q,
107
- children: /* @__PURE__ */ a(
134
+ labelClassName: W,
135
+ addonsClassName: X,
136
+ size: q,
137
+ block: z,
138
+ required: F,
139
+ disabled: a,
140
+ filled: B || h,
141
+ focused: h,
142
+ error: t,
143
+ label: m,
144
+ hint: ve,
145
+ inputId: d,
146
+ labelId: A,
147
+ hintId: w,
148
+ errorId: M,
149
+ leftAddons: _,
150
+ rightAddons: Me(),
151
+ bottomAddons: G,
152
+ onClick: O,
153
+ onMouseDown: ee,
154
+ onMouseUp: te,
155
+ children: /* @__PURE__ */ o(
108
156
  "input",
109
157
  {
110
- ...W,
158
+ ...ce,
159
+ id: d,
111
160
  className: I(
112
161
  s.input,
113
162
  {
114
- [s.hasLabel]: r
163
+ [s.hasLabel]: m
115
164
  },
116
- z
165
+ U
117
166
  ),
118
- disabled: n,
119
- onBlur: _,
120
- onFocus: Z,
121
- onChange: $,
122
- maxLength: J,
123
- ref: nt([X, c]),
124
- type: v,
125
- value: e ? x : g,
126
- readOnly: i,
127
- "data-test-id": w,
128
- "data-error": !!u,
129
- "aria-label": typeof r == "string" ? r : void 0
167
+ disabled: a,
168
+ onBlur: Re,
169
+ onFocus: ge,
170
+ onChange: Ve,
171
+ maxLength: x,
172
+ ref: Te([le, n]),
173
+ type: Ie,
174
+ value: N,
175
+ readOnly: c,
176
+ inputMode: be,
177
+ enterKeyHint: re,
178
+ "data-test-id": J,
179
+ "data-error": !!t,
180
+ "aria-invalid": t ? !0 : void 0,
181
+ "aria-required": F || void 0,
182
+ "aria-describedby": pe,
183
+ "aria-labelledby": m ? A : void 0
130
184
  }
131
185
  )
132
186
  }
@@ -134,5 +188,5 @@ const Vt = st.forwardRef(
134
188
  }
135
189
  );
136
190
  export {
137
- Vt as Input
191
+ Ze as Input
138
192
  };
@@ -1 +1 @@
1
- :root{--text-primary-color: var(--color-text-primary);--text-secondary-color: var(--color-text-secondary);--text-tertiary-color: var(--color-text-tertiary);--border-radius: 4px;--focus-color: var(--color-border-link);--font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Helvetica, sans-serif;--disabled-cursor: not-allowed;--arrow-transform: rotate(180deg)}:root{--input-clear-icon: url(https://alfabank.st/icons/glyph_cross-circle_m.svg);--input-color: var(--color-text-primary);--input-placeholder-color: color-mix(in srgb, var(--color-text-secondary) 35%, transparent);--input-focus-placeholder-color: color-mix(in srgb, var(--color-text-tertiary, var(--color-text-secondary)) 35%, transparent);--input-with-label-placeholder-color: color-mix(in srgb, var(--color-text-tertiary, var(--color-text-secondary)) 35%, transparent);--input-error-icon-display: flex;--input-success-icon-display: flex;--input-error-icon: url(https://alfabank.st/icons/icon_error_s_color.svg);--input-success-icon: url(https://alfabank.st/icons/icon_ok_s_color.svg);--input-disabled-color: var(--color-text-secondary);--input-read-only-color: var(--color-text-secondary)}.input_XkSq{font-size:16px!important;line-height:20px;font-weight:400;font-family:var(--font-family);position:relative;display:block;width:100%;height:100%;color:var(--input-color);background:none;border:none;margin:0;outline:none;text-overflow:ellipsis;box-sizing:border-box;-webkit-appearance:none;-webkit-tap-highlight-color:rgba(0,0,0,0)}.input_XkSq::placeholder{transition:opacity .2s ease,color .2s ease;color:var(--input-placeholder-color)}.hasLabel_3lW-::placeholder{opacity:0;color:var(--input-with-label-placeholder-color)}.block_Lq9-{width:100%}.clearIcon_951a{width:24px;height:24px;background-repeat:no-repeat;background-position:50% 50%;display:block;background-image:var(--input-clear-icon);opacity:.3;transition:opacity .2s ease}.clearIcon_951a:hover{opacity:.6}.clearIcon_951a:active{opacity:1}.errorIcon_Z4ac{width:24px;height:24px;background-repeat:no-repeat;background-position:50% 50%;display:var(--input-error-icon-display);background-image:url(https://alfabank.st/icons/icon_error_s_color.svg)}.successIcon_yfoM{width:24px;height:24px;background-repeat:no-repeat;background-position:50% 50%;display:var(--input-success-icon-display);background-image:url(https://alfabank.st/icons/icon_ok_s_color.svg)}.input_XkSq:disabled{cursor:var(--disabled-cursor);color:var(--input-disabled-color)}.input_XkSq:focus.hasLabel_3lW-::placeholder{opacity:1}.input_XkSq:focus::placeholder{color:var(--input-focus-placeholder-color)}.focusVisible_3hin{outline:2px solid var(--focus-color);outline-offset:2px}.input_XkSq:read-only{cursor:var(--disabled-cursor);color:var(--input-read-only-color)}.input_XkSq:read-only:focus::placeholder{color:var(--input-placeholder-color)}.hasLabel_3lW-:read-only:focus::placeholder{opacity:0}.input_XkSq::-ms-clear{display:none;width:0;height:0}.input_XkSq:-webkit-autofill,.input_XkSq:-webkit-autofill:hover,.input_XkSq:-webkit-autofill:focus,.input_XkSq:-webkit-autofill:active{-webkit-transition:background-color 999999s ease-in-out 0s;transition:background-color 999999s ease-in-out 0s;-webkit-box-shadow:0 0 0 30px #ffffff00 inset!important;-webkit-text-fill-color:var(--input-color)!important;caret-color:var(--input-color)}
1
+ :root{--text-primary-color: var(--color-text-primary);--text-secondary-color: var(--color-text-secondary);--text-tertiary-color: var(--color-text-tertiary);--border-radius: 4px;--focus-color: var(--color-border-link);--font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Helvetica, sans-serif;--disabled-cursor: not-allowed;--arrow-transform: rotate(180deg)}:root{--input-color: var(--color-text-primary);--input-placeholder-color: color-mix(in srgb, var(--color-text-secondary) 35%, transparent);--input-focus-placeholder-color: color-mix(in srgb, var(--color-text-tertiary, var(--color-text-secondary)) 35%, transparent);--input-with-label-placeholder-color: color-mix(in srgb, var(--color-text-tertiary, var(--color-text-secondary)) 35%, transparent);--input-error-icon-display: flex;--input-success-icon-display: flex;--input-disabled-color: var(--color-text-secondary);--input-read-only-color: var(--color-text-secondary)}.input_XkSq{font-size:16px!important;line-height:20px;font-weight:400;font-family:var(--font-family);position:relative;display:block;width:100%;height:100%;color:var(--input-color);background:none;border:none;margin:0;outline:none;text-overflow:ellipsis;box-sizing:border-box;-webkit-appearance:none;-webkit-tap-highlight-color:rgba(0,0,0,0)}.input_XkSq::placeholder{transition:opacity .2s ease,color .2s ease;color:var(--input-placeholder-color)}.hasLabel_3lW-::placeholder{opacity:0;color:var(--input-with-label-placeholder-color)}.block_Lq9-{width:100%}.clearIcon_951a{width:24px;height:24px;flex-shrink:0;display:block;color:var(--color-graphic-primary);opacity:.3;transition:opacity .2s ease}.clearIcon_951a:hover{opacity:.6}.clearIcon_951a:active{opacity:1}.errorIcon_Z4ac{width:24px;height:24px;flex-shrink:0;display:var(--input-error-icon-display);color:var(--color-text-negative)}.successIcon_yfoM{width:24px;height:24px;flex-shrink:0;display:var(--input-success-icon-display);color:var(--color-graphic-positive)}.passwordRevealButton_WL2G{flex-shrink:0}.passwordRevealIcon_uPrs{width:24px;height:24px;flex-shrink:0;display:block;color:var(--color-graphic-primary);opacity:.5;transition:opacity .2s ease}.passwordRevealIcon_uPrs:hover{opacity:.8}.passwordRevealIcon_uPrs:active{opacity:1}.passwordRevealIconHidden_E8-S{opacity:.35}.input_XkSq:disabled{cursor:var(--disabled-cursor);color:var(--input-disabled-color)}.input_XkSq:focus.hasLabel_3lW-::placeholder{opacity:1}.input_XkSq:focus::placeholder{color:var(--input-focus-placeholder-color)}.focusVisible_3hin{outline:2px solid var(--focus-color);outline-offset:2px}.input_XkSq:read-only{cursor:var(--disabled-cursor);color:var(--input-read-only-color)}.input_XkSq:read-only:focus::placeholder{color:var(--input-placeholder-color)}.hasLabel_3lW-:read-only:focus::placeholder{opacity:0}.input_XkSq::-ms-clear{display:none;width:0;height:0}.input_XkSq:-webkit-autofill,.input_XkSq:-webkit-autofill:hover,.input_XkSq:-webkit-autofill:focus,.input_XkSq:-webkit-autofill:active{-webkit-transition:background-color 999999s ease-in-out 0s;transition:background-color 999999s ease-in-out 0s;-webkit-box-shadow:0 0 0 30px #ffffff00 inset!important;-webkit-text-fill-color:var(--input-color)!important;caret-color:var(--input-color)}
@@ -1,17 +1,25 @@
1
1
  import * as __css from './index.css';
2
2
  export const __cssModule = __css;
3
- const s = "input_XkSq", c = "hasLabel_3lW-", o = "clearIcon_951a", n = "successIcon_yfoM", e = "focusVisible_3hin", a = {
3
+ const s = "input_XkSq", o = "hasLabel_3lW-", e = "clearIcon_951a", c = "errorIcon_Z4ac", n = "successIcon_yfoM", a = "passwordRevealButton_WL2G", r = "passwordRevealIcon_uPrs", t = "passwordRevealIconHidden_E8-S", l = "focusVisible_3hin", d = {
4
4
  input: s,
5
- hasLabel: c,
6
- clearIcon: o,
5
+ hasLabel: o,
6
+ clearIcon: e,
7
+ errorIcon: c,
7
8
  successIcon: n,
8
- focusVisible: e
9
+ passwordRevealButton: a,
10
+ passwordRevealIcon: r,
11
+ passwordRevealIconHidden: t,
12
+ focusVisible: l
9
13
  };
10
14
  export {
11
- o as clearIcon,
12
- a as default,
13
- e as focusVisible,
14
- c as hasLabel,
15
+ e as clearIcon,
16
+ d as default,
17
+ c as errorIcon,
18
+ l as focusVisible,
19
+ o as hasLabel,
15
20
  s as input,
21
+ a as passwordRevealButton,
22
+ r as passwordRevealIcon,
23
+ t as passwordRevealIconHidden,
16
24
  n as successIcon
17
25
  };
@@ -0,0 +1,3 @@
1
+ import { InputHTMLAttributes } from 'react';
2
+ import { InputProps } from '../component';
3
+ export declare function getDefaultInputMode(type: InputProps['type']): InputHTMLAttributes<HTMLInputElement>['inputMode'] | undefined;
@@ -0,0 +1,14 @@
1
+ const n = {
2
+ tel: "tel",
3
+ email: "email",
4
+ number: "numeric",
5
+ money: "decimal",
6
+ card: "numeric"
7
+ };
8
+ function r(e) {
9
+ if (e)
10
+ return n[e];
11
+ }
12
+ export {
13
+ r as getDefaultInputMode
14
+ };
@@ -21,8 +21,10 @@ export declare const InputAutocomplete: import('react').ForwardRefExoticComponen
21
21
  error?: string | boolean | undefined;
22
22
  success?: boolean | undefined;
23
23
  hint?: string | undefined;
24
+ showCount?: boolean | undefined;
24
25
  label?: import('react').ReactNode;
25
26
  type?: "number" | "text" | "tel" | "email" | "card" | "money" | "password" | undefined;
27
+ passwordReveal?: boolean | undefined;
26
28
  wrapperRef?: import('react').Ref<HTMLDivElement> | undefined;
27
29
  leftAddons?: import('react').ReactNode;
28
30
  rightAddons?: import('react').ReactNode;
@@ -53,8 +55,10 @@ export declare const InputAutocomplete: import('react').ForwardRefExoticComponen
53
55
  error?: string | boolean | undefined;
54
56
  success?: boolean | undefined;
55
57
  hint?: string | undefined;
58
+ showCount?: boolean | undefined;
56
59
  label?: import('react').ReactNode;
57
60
  type?: "number" | "text" | "tel" | "email" | "card" | "money" | "password" | undefined;
61
+ passwordReveal?: boolean | undefined;
58
62
  wrapperRef?: import('react').Ref<HTMLDivElement> | undefined;
59
63
  leftAddons?: import('react').ReactNode;
60
64
  rightAddons?: import('react').ReactNode;
@@ -16,8 +16,10 @@ export declare const MaskedInput: React.ForwardRefExoticComponent<Omit<React.Inp
16
16
  error?: string | boolean | undefined;
17
17
  success?: boolean | undefined;
18
18
  hint?: string | undefined;
19
+ showCount?: boolean | undefined;
19
20
  label?: React.ReactNode;
20
21
  type?: "number" | "text" | "tel" | "email" | "card" | "money" | "password" | undefined;
22
+ passwordReveal?: boolean | undefined;
21
23
  wrapperRef?: React.Ref<HTMLDivElement> | undefined;
22
24
  leftAddons?: React.ReactNode;
23
25
  rightAddons?: React.ReactNode;
@@ -23,6 +23,10 @@ export declare const Select: import('react').ForwardRefExoticComponent<Omit<Base
23
23
  labelClassName?: string | undefined;
24
24
  addonsClassName?: string | undefined;
25
25
  dataTestId?: string | undefined;
26
+ inputId?: string | undefined;
27
+ labelId?: string | undefined;
28
+ hintId?: string | undefined;
29
+ errorId?: string | undefined;
26
30
  children?: import('react').ReactNode;
27
31
  } & Record<string, unknown>) | undefined;
28
32
  showSearch?: boolean | undefined;