@vkzstudio/muza-ui 1.3.0 → 1.4.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 (58) hide show
  1. package/dist/components/BalanceListView/BalanceListView.examples.d.ts +38 -0
  2. package/dist/components/BalanceListView/BalanceListView.examples.d.ts.map +1 -0
  3. package/dist/components/BalanceListView/BalanceListView.stories.d.ts +8 -0
  4. package/dist/components/BalanceListView/BalanceListView.stories.d.ts.map +1 -0
  5. package/dist/components/ButtonArrow/ButtonArrow.d.ts +3 -3
  6. package/dist/components/ButtonArrow/ButtonArrow.d.ts.map +1 -1
  7. package/dist/components/ButtonArrow/ButtonArrow.js +25 -24
  8. package/dist/components/CarouselSection/CarouselSection.examples.d.ts.map +1 -1
  9. package/dist/components/Dialog/Dialog.d.ts +12 -6
  10. package/dist/components/Dialog/Dialog.d.ts.map +1 -1
  11. package/dist/components/Dialog/Dialog.js +116 -120
  12. package/dist/components/Dialog/Dialog.stories.d.ts +1 -0
  13. package/dist/components/Dialog/Dialog.stories.d.ts.map +1 -1
  14. package/dist/components/DropdownMenu/DropdownMenu.d.ts.map +1 -1
  15. package/dist/components/DropdownMenu/DropdownMenu.js +13 -13
  16. package/dist/components/EdgeButton/EdgeButton.d.ts.map +1 -1
  17. package/dist/components/EdgeButton/EdgeButton.js +10 -11
  18. package/dist/components/EmptyState/EmptyState.js +19 -19
  19. package/dist/components/FileUpload/FileItem.d.ts.map +1 -1
  20. package/dist/components/FileUpload/FileItem.js +8 -9
  21. package/dist/components/FileUpload/FileUpload.js +3 -3
  22. package/dist/components/InputOTP/InputOTP.d.ts +95 -0
  23. package/dist/components/InputOTP/InputOTP.d.ts.map +1 -0
  24. package/dist/components/InputOTP/InputOTP.js +187 -0
  25. package/dist/components/InputOTP/InputOTP.stories.d.ts +18 -0
  26. package/dist/components/InputOTP/InputOTP.stories.d.ts.map +1 -0
  27. package/dist/components/InputOTP/index.d.ts +3 -0
  28. package/dist/components/InputOTP/index.d.ts.map +1 -0
  29. package/dist/components/InputOTP/useWebOtpAutofill.d.ts +33 -0
  30. package/dist/components/InputOTP/useWebOtpAutofill.d.ts.map +1 -0
  31. package/dist/components/InputOTP/useWebOtpAutofill.js +25 -0
  32. package/dist/components/MarketNav/MarketNav.examples.d.ts +60 -0
  33. package/dist/components/MarketNav/MarketNav.examples.d.ts.map +1 -0
  34. package/dist/components/MarketNav/MarketNav.stories.d.ts +9 -0
  35. package/dist/components/MarketNav/MarketNav.stories.d.ts.map +1 -0
  36. package/dist/components/PageContainer/PageContainer.d.ts +53 -0
  37. package/dist/components/PageContainer/PageContainer.d.ts.map +1 -0
  38. package/dist/components/PageContainer/PageContainer.js +49 -0
  39. package/dist/components/PageContainer/PageContainer.stories.d.ts +14 -0
  40. package/dist/components/PageContainer/PageContainer.stories.d.ts.map +1 -0
  41. package/dist/components/PageContainer/index.d.ts +2 -0
  42. package/dist/components/PageContainer/index.d.ts.map +1 -0
  43. package/dist/components/ReorderableTable/ReorderableTable.stories.d.ts.map +1 -1
  44. package/dist/components/SegmentedControl/SegmentedControl.js +11 -11
  45. package/dist/components/Tag/Tag.js +1 -1
  46. package/dist/components/UniversalFooter/UniversalFooter.d.ts +6 -5
  47. package/dist/components/UniversalFooter/UniversalFooter.d.ts.map +1 -1
  48. package/dist/components/UniversalFooter/UniversalFooter.js +186 -177
  49. package/dist/components/UniversalFooter/UniversalFooter.stories.d.ts.map +1 -1
  50. package/dist/components/index.d.ts +2 -0
  51. package/dist/components/index.d.ts.map +1 -1
  52. package/dist/index.js +257 -249
  53. package/dist/muza-ui.css +1 -1
  54. package/dist/styles/token-colors.css +1 -0
  55. package/dist/styles/token-sizes.css +36 -16
  56. package/dist/utils/cn.d.ts.map +1 -1
  57. package/dist/utils/cn.js +9 -4
  58. package/package.json +4 -3
@@ -1,7 +1,7 @@
1
- import { jsx as e, jsxs as b, Fragment as y } from "react/jsx-runtime";
1
+ import { jsx as e, jsxs as b, Fragment as N } from "react/jsx-runtime";
2
2
  import * as m from "react";
3
3
  import * as a from "@radix-ui/react-dropdown-menu";
4
- import { cva as N } from "class-variance-authority";
4
+ import { cva as y } from "class-variance-authority";
5
5
  import { Button as I } from "../Button/Button.js";
6
6
  import { cn as s } from "../../utils/cn.js";
7
7
  import { UnreadOutline as x } from "@solar-icons/react-perf";
@@ -55,9 +55,9 @@ const g = m.createContext(null), M = () => m.useContext(g), B = ({ ...o }) => /*
55
55
  )
56
56
  }
57
57
  ) });
58
- }, w = N(
58
+ }, w = y(
59
59
  [
60
- "text-comp-dropdown-menu-text-primary flex cursor-pointer items-center gap-sm rounded-md pt-md pr-lg pb-md pl-lg outline-0 transition-colors",
60
+ "flex cursor-pointer items-center gap-sm rounded-md pt-md pr-lg pb-md pl-lg text-comp-dropdown-menu-text-base-def outline-0 transition-colors",
61
61
  "hover:bg-comp-dropdown-menu-fill-base-hover hover:text-comp-dropdown-menu-text-base-hover",
62
62
  "focus-within:bg-comp-dropdown-menu-fill-base-focused"
63
63
  ],
@@ -83,7 +83,7 @@ const g = m.createContext(null), M = () => m.useContext(g), B = ({ ...o }) => /*
83
83
  ), h = ({
84
84
  children: o,
85
85
  description: t
86
- }) => typeof o == "function" ? /* @__PURE__ */ e(y, { children: o }) : t ? /* @__PURE__ */ b(D, { flex: 1, direction: "column", className: "min-w-0", children: [
86
+ }) => typeof o == "function" ? /* @__PURE__ */ e(N, { children: o }) : t ? /* @__PURE__ */ b(D, { flex: 1, direction: "column", className: "min-w-0", children: [
87
87
  /* @__PURE__ */ e(
88
88
  f,
89
89
  {
@@ -135,8 +135,8 @@ const g = m.createContext(null), M = () => m.useContext(g), B = ({ ...o }) => /*
135
135
  "span",
136
136
  {
137
137
  className: s("block [&>svg]:block [&>svg]:size-icon-small", {
138
- "text-comp-dropdown-menu-text-error": t === "destructive",
139
- "group-focus-visible:-icon-brand-focused text-icon-dark-secondary-def group-hover:text-icon-brand-def": t !== "destructive",
138
+ "text-comp-dropdown-menu-icon-error-def": t === "destructive",
139
+ "text-icon-dark-secondary-def group-hover:text-icon-brand-def group-focus-visible:text-comp-dropdown-menu-icon-base-focused": t !== "destructive",
140
140
  "text-comp-dropdown-menu-icon-base-active": i
141
141
  }),
142
142
  children: r
@@ -199,14 +199,14 @@ const g = m.createContext(null), M = () => m.useContext(g), B = ({ ...o }) => /*
199
199
  "span",
200
200
  {
201
201
  className: s({
202
- "text-comp-dropdown-menu-text-error": r === "destructive",
203
- "group-focus-visible:-icon-brand-focused text-icon-dark-secondary-def group-hover:text-icon-brand-def": r !== "destructive"
202
+ "text-comp-dropdown-menu-icon-error-def": r === "destructive",
203
+ "text-icon-dark-secondary-def group-hover:text-icon-brand-def group-focus-visible:text-comp-dropdown-menu-icon-base-focused": r !== "destructive"
204
204
  }),
205
205
  children: c
206
206
  }
207
207
  ),
208
208
  /* @__PURE__ */ e(h, { description: i, children: t }),
209
- /* @__PURE__ */ e("span", { className: "text-comp-dropdown-menu-icon-brand-def", children: /* @__PURE__ */ e(a.ItemIndicator, { children: /* @__PURE__ */ e(x, { className: "size-icon-small" }) }) })
209
+ /* @__PURE__ */ e("span", { className: "text-icon-brand-def", children: /* @__PURE__ */ e(a.ItemIndicator, { children: /* @__PURE__ */ e(x, { className: "size-icon-small" }) }) })
210
210
  ]
211
211
  }
212
212
  ), L = ({
@@ -244,15 +244,15 @@ const g = m.createContext(null), M = () => m.useContext(g), B = ({ ...o }) => /*
244
244
  "span",
245
245
  {
246
246
  className: s({
247
- "text-comp-dropdown-menu-text-error": n === "destructive",
248
- "group-focus-visible:-icon-brand-focused text-icon-dark-secondary-def group-hover:text-icon-brand-def": n !== "destructive",
247
+ "text-comp-dropdown-menu-icon-error-def": n === "destructive",
248
+ "text-icon-dark-secondary-def group-hover:text-icon-brand-def group-focus-visible:text-comp-dropdown-menu-icon-base-focused": n !== "destructive",
249
249
  "text-comp-dropdown-menu-text-base-disabled": d.disabled
250
250
  }),
251
251
  children: r
252
252
  }
253
253
  ),
254
254
  /* @__PURE__ */ e(h, { description: c, children: t }),
255
- /* @__PURE__ */ e("span", { className: "text-comp-dropdown-menu-icon-brand-def", children: /* @__PURE__ */ e(a.ItemIndicator, { children: /* @__PURE__ */ e(x, { className: "size-icon-small" }) }) })
255
+ /* @__PURE__ */ e("span", { className: "text-icon-brand-def", children: /* @__PURE__ */ e(a.ItemIndicator, { children: /* @__PURE__ */ e(x, { className: "size-icon-small" }) }) })
256
256
  ]
257
257
  }
258
258
  );
@@ -1 +1 @@
1
- {"version":3,"file":"EdgeButton.d.ts","sourceRoot":"","sources":["../../../src/components/EdgeButton/EdgeButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAOzB,QAAA,MAAM,kBAAkB;;8EAwBvB,CAAA;AAED;;;;GAIG;AACH,MAAM,WAAW,eACf,SAAQ,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC;IACrD,oGAAoG;IACpG,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,wEAAwE;IACxE,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB;;;;;;;;;;;;;OAaG;IACH,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,+EAA+E;IAC/E,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CACvB;AAED,QAAA,MAAM,UAAU,2FAmFf,CAAA;AAID,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,CAAA"}
1
+ {"version":3,"file":"EdgeButton.d.ts","sourceRoot":"","sources":["../../../src/components/EdgeButton/EdgeButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAOzB,QAAA,MAAM,kBAAkB;;8EAuBvB,CAAA;AAED;;;;GAIG;AACH,MAAM,WAAW,eACf,SAAQ,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC;IACrD,oGAAoG;IACpG,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,wEAAwE;IACxE,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB;;;;;;;;;;;;;OAaG;IACH,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,+EAA+E;IAC/E,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CACvB;AAED,QAAA,MAAM,UAAU,2FAmFf,CAAA;AAID,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,CAAA"}
@@ -2,7 +2,7 @@ import { jsx as e, jsxs as i, Fragment as a } from "react/jsx-runtime";
2
2
  import s from "react";
3
3
  import { Slot as h, Slottable as l } from "@radix-ui/react-slot";
4
4
  import { cva as x } from "class-variance-authority";
5
- import { sharedButtonVariants as d } from "../Button/buttonVariants.js";
5
+ import { sharedButtonVariants as u } from "../Button/buttonVariants.js";
6
6
  import { cn as y } from "../../utils/cn.js";
7
7
  import { Typography as j } from "../Typography/Typography.js";
8
8
  const _ = x(
@@ -13,15 +13,14 @@ const _ = x(
13
13
  "&>svg]:duration-250 transition-colors duration-250 [&>svg]:transition-opacity",
14
14
  "[&>svg]:size-icon-medium",
15
15
  "disabled:pointer-events-none",
16
- ...d.primary
16
+ ...u.primary
17
17
  ],
18
18
  {
19
19
  variants: {
20
20
  disabled: {
21
21
  true: [
22
- // 'bg-comp-button-fill-primary-disabled text-comp-button-text-text-disabled',
23
22
  "pointer-events-none",
24
- "[&>svg]:text-comp-button-icon-brand-disabled"
23
+ "[&>svg]:text-comp-button-primary-text-disabled"
25
24
  ]
26
25
  }
27
26
  },
@@ -31,7 +30,7 @@ const _ = x(
31
30
  }
32
31
  ), B = s.forwardRef(
33
32
  ({
34
- onClick: u,
33
+ onClick: d,
35
34
  disabled: p,
36
35
  text: m,
37
36
  className: c,
@@ -39,8 +38,8 @@ const _ = x(
39
38
  icon: o,
40
39
  children: t,
41
40
  ...f
42
- }, b) => {
43
- const g = n ? h : "button", r = m ? /* @__PURE__ */ e(
41
+ }, g) => {
42
+ const b = n ? h : "button", r = m ? /* @__PURE__ */ e(
44
43
  j,
45
44
  {
46
45
  component: "span",
@@ -68,10 +67,10 @@ const _ = x(
68
67
  t
69
68
  ] });
70
69
  return /* @__PURE__ */ e(
71
- g,
70
+ b,
72
71
  {
73
- ref: b,
74
- onClick: p ? void 0 : u,
72
+ ref: g,
73
+ onClick: p ? void 0 : d,
75
74
  ...n ? {} : { type: "button", disabled: p },
76
75
  className: y(
77
76
  "inline-flex items-center justify-center",
@@ -80,7 +79,7 @@ const _ = x(
80
79
  "cursor-pointer disabled:pointer-events-none",
81
80
  "&>svg]:duration-250 transition-colors duration-250 [&>svg]:transition-opacity",
82
81
  "[&>svg]:size-icon-medium",
83
- ...d.primary,
82
+ ...u.primary,
84
83
  c
85
84
  ),
86
85
  ...f,
@@ -1,26 +1,26 @@
1
- import { jsxs as r, jsx as a } from "react/jsx-runtime";
2
- import { cn as m } from "../../utils/cn.js";
3
- import { Typography as c } from "../Typography/Typography.js";
1
+ import { jsxs as m, jsx as s } from "react/jsx-runtime";
2
+ import { cn as c } from "../../utils/cn.js";
3
+ import { Typography as o } from "../Typography/Typography.js";
4
4
  const d = ({
5
- icon: o,
5
+ icon: r,
6
6
  className: i,
7
7
  headline: e,
8
8
  text: t,
9
- children: s,
10
- buttonsLayout: l
11
- }) => /* @__PURE__ */ r(
9
+ children: a,
10
+ buttonsLayout: p
11
+ }) => /* @__PURE__ */ m(
12
12
  "div",
13
13
  {
14
- className: m(
14
+ className: c(
15
15
  "flex flex-col items-center gap-comp-empty-state-gap",
16
- "[&>svg]:size-comp-empty-state-ico-size [&>svg]:text-gray-500",
16
+ "[&>svg]:size-comp-empty-state-ico-size [&>svg]:text-comp-empty-state-icon",
17
17
  i
18
18
  ),
19
19
  children: [
20
- o,
21
- (e || t) && /* @__PURE__ */ r("div", { className: "flex flex-col gap-2xs text-center align-middle", children: [
22
- e && /* @__PURE__ */ a(
23
- c,
20
+ r,
21
+ (e || t) && /* @__PURE__ */ m("div", { className: "flex flex-col gap-2xs text-center align-middle", children: [
22
+ e && /* @__PURE__ */ s(
23
+ o,
24
24
  {
25
25
  component: "p",
26
26
  variant: "body",
@@ -30,8 +30,8 @@ const d = ({
30
30
  children: e
31
31
  }
32
32
  ),
33
- t && /* @__PURE__ */ a(
34
- c,
33
+ t && /* @__PURE__ */ s(
34
+ o,
35
35
  {
36
36
  component: "p",
37
37
  variant: "body",
@@ -42,13 +42,13 @@ const d = ({
42
42
  }
43
43
  )
44
44
  ] }),
45
- s && /* @__PURE__ */ a(
45
+ a && /* @__PURE__ */ s(
46
46
  "div",
47
47
  {
48
- className: m("flex gap-sm", {
49
- "flex-col": l === "vertical"
48
+ className: c("flex gap-sm", {
49
+ "flex-col": p === "vertical"
50
50
  }),
51
- children: s
51
+ children: a
52
52
  }
53
53
  )
54
54
  ]
@@ -1 +1 @@
1
- {"version":3,"file":"FileItem.d.ts","sourceRoot":"","sources":["../../../src/components/FileUpload/FileItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AA8C9B;;;GAGG;AACH,UAAU,iBAAiB;IACzB,qFAAqF;IACrF,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,mGAAmG;IACnG,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,8CAA8C;IAC9C,IAAI,CAAC,EAAE,IAAI,GAAG,MAAM,GAAG,IAAI,CAAA;IAC3B,yDAAyD;IACzD,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,qFAAqF;IACrF,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,oEAAoE;IACpE,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACtB,iEAAiE;IACjE,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACvB,sEAAsE;IACtE,aAAa,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC/B,+CAA+C;IAC/C,QAAQ,EAAE,MAAM,IAAI,CAAA;IACpB;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,IAAI,CAAA;IACvB,oEAAoE;IACpE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,IAAI,KAAK,IAAI,CAAA;CAC/C;AAED,qEAAqE;AACrE,UAAU,iBAAkB,SAAQ,iBAAiB;IACnD,MAAM,EAAE,MAAM,CAAA;IACd,IAAI,EAAE,IAAI,CAAA;CACX;AAED,oFAAoF;AACpF,UAAU,gBAAiB,SAAQ,iBAAiB;IAClD,MAAM,EAAE,KAAK,CAAA;IACb,GAAG,EAAE,MAAM,CAAA;IACX,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,CAAC,EAAE,MAAM,CAAA;CACd;AAED,wGAAwG;AACxG,KAAK,aAAa,GAAG,iBAAiB,GAAG,gBAAgB,CAAA;AAsEzD,eAAO,MAAM,QAAQ,GAAI,OAAO,aAAa,4CAiO5C,CAAA"}
1
+ {"version":3,"file":"FileItem.d.ts","sourceRoot":"","sources":["../../../src/components/FileUpload/FileItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AA8C9B;;;GAGG;AACH,UAAU,iBAAiB;IACzB,qFAAqF;IACrF,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,mGAAmG;IACnG,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,8CAA8C;IAC9C,IAAI,CAAC,EAAE,IAAI,GAAG,MAAM,GAAG,IAAI,CAAA;IAC3B,yDAAyD;IACzD,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,qFAAqF;IACrF,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,oEAAoE;IACpE,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACtB,iEAAiE;IACjE,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACvB,sEAAsE;IACtE,aAAa,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC/B,+CAA+C;IAC/C,QAAQ,EAAE,MAAM,IAAI,CAAA;IACpB;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,IAAI,CAAA;IACvB,oEAAoE;IACpE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,IAAI,KAAK,IAAI,CAAA;CAC/C;AAED,qEAAqE;AACrE,UAAU,iBAAkB,SAAQ,iBAAiB;IACnD,MAAM,EAAE,MAAM,CAAA;IACd,IAAI,EAAE,IAAI,CAAA;CACX;AAED,oFAAoF;AACpF,UAAU,gBAAiB,SAAQ,iBAAiB;IAClD,MAAM,EAAE,KAAK,CAAA;IACb,GAAG,EAAE,MAAM,CAAA;IACX,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,CAAC,EAAE,MAAM,CAAA;CACd;AAED,wGAAwG;AACxG,KAAK,aAAa,GAAG,iBAAiB,GAAG,gBAAgB,CAAA;AAsEzD,eAAO,MAAM,QAAQ,GAAI,OAAO,aAAa,4CAgO5C,CAAA"}
@@ -1,5 +1,5 @@
1
- import { jsxs as f, jsx as t } from "react/jsx-runtime";
2
- import * as p from "react";
1
+ import { jsxs as p, jsx as t } from "react/jsx-runtime";
2
+ import * as f from "react";
3
3
  import { cva as _ } from "class-variance-authority";
4
4
  import { useMuzaTranslations as B } from "../../translations/TranslationContext.js";
5
5
  import { Flex as z } from "../Flex/Flex.js";
@@ -89,12 +89,12 @@ const S = (e, l, i) => {
89
89
  onDelete: g,
90
90
  onDownload: v,
91
91
  onError: T
92
- } = e, m = B(), [w, N] = p.useState(!1), k = e.source === "file" ? e.file.name : e.name, b = e.source === "url" ? (e.type ?? "").startsWith("image/") || F.test(e.name) : e.file.type.startsWith("image/"), C = e.source === "url" ? L.includes(e.type ?? "") || E.test(e.name) : L.includes(e.file.type) || E.test(e.file.name), d = e.source === "file" ? e.file : e.url, O = p.useMemo(() => o ? "disabled" : s ? "error" : typeof i == "number" && i > 0 && i < 100 ? "loading" : "default", [o, s, i]), x = p.useMemo(() => {
92
+ } = e, m = B(), [w, N] = f.useState(!1), k = e.source === "file" ? e.file.name : e.name, b = e.source === "url" ? (e.type ?? "").startsWith("image/") || F.test(e.name) : e.file.type.startsWith("image/"), C = e.source === "url" ? L.includes(e.type ?? "") || E.test(e.name) : L.includes(e.file.type) || E.test(e.file.name), d = e.source === "file" ? e.file : e.url, O = f.useMemo(() => o ? "disabled" : s ? "error" : typeof i == "number" && i > 0 && i < 100 ? "loading" : "default", [o, s, i]), x = f.useMemo(() => {
93
93
  if (b)
94
94
  return typeof d == "string" ? d : URL.createObjectURL(d);
95
95
  }, [b, d]);
96
- return p.useEffect(() => N(!1), [d]), /* @__PURE__ */ f(z, { gap: "sm", direction: "column", component: "li", children: [
97
- /* @__PURE__ */ f(
96
+ return f.useEffect(() => N(!1), [d]), /* @__PURE__ */ p(z, { gap: "sm", direction: "column", component: "li", children: [
97
+ /* @__PURE__ */ p(
98
98
  "div",
99
99
  {
100
100
  className: a(
@@ -139,7 +139,7 @@ const S = (e, l, i) => {
139
139
  )
140
140
  }
141
141
  ),
142
- /* @__PURE__ */ f(z, { direction: "column", className: "min-w-0 flex-1 justify-center", children: [
142
+ /* @__PURE__ */ p(z, { direction: "column", className: "min-w-0 flex-1 justify-center", children: [
143
143
  /* @__PURE__ */ t(
144
144
  u,
145
145
  {
@@ -175,13 +175,12 @@ const S = (e, l, i) => {
175
175
  h,
176
176
  "text-comp-file-upload-icon-def-secondary",
177
177
  "hover:text-comp-file-upload-icon-def-hover",
178
- "focus-visible:text-comp-file-upload-icon-def-focused",
179
178
  "disabled:text-comp-file-upload-icon-def-disabled"
180
179
  ),
181
180
  children: /* @__PURE__ */ t(D, { className: "size-icon-medium" })
182
181
  }
183
182
  ),
184
- l && /* @__PURE__ */ f("div", { className: "flex gap-xl", children: [
183
+ l && /* @__PURE__ */ p("div", { className: "flex gap-xl", children: [
185
184
  /* @__PURE__ */ t(
186
185
  "button",
187
186
  {
@@ -223,7 +222,7 @@ const S = (e, l, i) => {
223
222
  h,
224
223
  "text-comp-file-upload-icon-error-def",
225
224
  "hover:text-comp-file-upload-icon-error-hover",
226
- "focus-visible:text-comp-file-upload-icon-error-focused",
225
+ "focus-visible:text-comp-file-upload-icon-error-focused-pressed",
227
226
  "disabled:text-comp-file-upload-icon-error-disabled"
228
227
  ),
229
228
  children: /* @__PURE__ */ t(R, { className: "size-icon-medium" })
@@ -19,20 +19,20 @@ const be = O(
19
19
  "hover:border-comp-file-upload-stroke-dashed-hover hover:bg-comp-file-upload-fill-hover",
20
20
  "hover:text-comp-file-upload-text-brand-hover",
21
21
  "focus-visible-default focus-visible:border-comp-file-upload-stroke-dashed-focused",
22
- "focus-visible:text-comp-file-upload-title-text-focused focus-visible:bg-comp-file-upload-fill-focused"
22
+ "focus-visible:bg-comp-file-upload-fill-focused focus-visible:text-comp-file-upload-text-brand-focused"
23
23
  ],
24
24
  {
25
25
  variants: {
26
26
  error: {
27
27
  true: [
28
- "border-comp-button-stroke-error-def bg-comp-file-upload-fill-def",
28
+ "border-comp-file-upload-stroke-error-def bg-comp-file-upload-fill-def",
29
29
  "text-comp-file-upload-text-error-def"
30
30
  ]
31
31
  },
32
32
  isDragActive: {
33
33
  true: [
34
34
  "border-comp-file-upload-stroke-dashed-focused bg-comp-file-upload-fill-focused",
35
- "text-comp-file-upload-title-text-focused"
35
+ "text-comp-file-upload-text-brand-focused"
36
36
  ]
37
37
  },
38
38
  disabled: {
@@ -0,0 +1,95 @@
1
+ import { ComponentPropsWithoutRef, ReactNode } from 'react';
2
+ /**
3
+ * Character set the field accepts. Also selects the mobile keyboard:
4
+ * `numeric` → number pad, the others → text keyboard.
5
+ */
6
+ export type InputOTPAllowedChars = 'numeric' | 'alphanumeric' | 'alphabetic';
7
+ export declare const inputOTPCellVariants: (props?: ({
8
+ size?: "sm" | "lg" | "base" | null | undefined;
9
+ active?: boolean | null | undefined;
10
+ error?: boolean | null | undefined;
11
+ disabled?: boolean | null | undefined;
12
+ } & import('class-variance-authority/types').ClassProp) | undefined) => string;
13
+ /**
14
+ * Props for the InputOTP component.
15
+ *
16
+ * Extends the underlying input's attributes except the ones InputOTP manages
17
+ * itself (`value`/`onChange`/`size`/`type`/`children`).
18
+ */
19
+ export interface InputOTPProps extends Omit<ComponentPropsWithoutRef<'input'>, 'value' | 'onChange' | 'size' | 'type' | 'children' | 'defaultValue'> {
20
+ /**
21
+ * Number of OTP characters (cells).
22
+ * @default 6
23
+ */
24
+ length?: number;
25
+ /** Controlled value. Should never exceed `length` characters. */
26
+ value?: string;
27
+ /** Initial value for uncontrolled usage. @default '' */
28
+ defaultValue?: string;
29
+ /** Fires with the full string whenever the value changes. */
30
+ onChange?: (value: string) => void;
31
+ /** Fires once the value reaches `length` characters. */
32
+ onComplete?: (value: string) => void;
33
+ /** Controls cell height and character size. @default 'base' */
34
+ size?: 'sm' | 'base' | 'lg';
35
+ /** Applies the error border to all cells and error-styles the hint. @default false */
36
+ error?: boolean;
37
+ /** Disables input and applies disabled styling. @default false */
38
+ disabled?: boolean;
39
+ /**
40
+ * Renders each filled cell as an 8×8px dot (DotDivider) instead of the
41
+ * character, for sensitive codes.
42
+ * @default false
43
+ */
44
+ mask?: boolean;
45
+ /**
46
+ * Which characters the field accepts — this also chooses the mobile keyboard:
47
+ * - `numeric` — digits only, number pad.
48
+ * - `alphanumeric` — letters and digits, text keyboard.
49
+ * - `alphabetic` — letters only, text keyboard.
50
+ *
51
+ * Values are case-sensitive; uppercase in `onChange` if you need a canonical
52
+ * form. For a fully custom rule, use `pattern` instead (it overrides this).
53
+ * @default 'numeric'
54
+ */
55
+ allowedChars?: InputOTPAllowedChars;
56
+ /**
57
+ * Advanced escape hatch: a raw regex string restricting allowed characters
58
+ * (see input-otp). Overrides `allowedChars` when provided. Leave unset and
59
+ * use `allowedChars` for the common cases.
60
+ */
61
+ pattern?: string;
62
+ /**
63
+ * Enables the Android WebOTP API for fully-automatic SMS code retrieval, as
64
+ * a progressive enhancement. iOS Safari and desktop rely on the built-in
65
+ * `autocomplete="one-time-code"` keyboard suggestion instead (always on).
66
+ * Requires HTTPS and an origin-bound SMS. See {@link useWebOtpAutofill}.
67
+ * @default false
68
+ */
69
+ enableWebOtp?: boolean;
70
+ /** Label text rendered above the field. */
71
+ label?: string;
72
+ /** Helper or error text rendered below the field. */
73
+ hint?: string;
74
+ /** Marks the field as required and shows an asterisk in the label. @default false */
75
+ required?: boolean;
76
+ /**
77
+ * Hides the required asterisk in the label even when `required` is `true`.
78
+ * @default false
79
+ */
80
+ disableRequiredAsterisk?: boolean;
81
+ /**
82
+ * Custom content rendered inline next to the label. Takes precedence over
83
+ * `infoTooltip` when both are provided.
84
+ */
85
+ labelExtra?: ReactNode;
86
+ /**
87
+ * Tooltip content shown in an info icon next to the label. Ignored when
88
+ * `labelExtra` is provided.
89
+ */
90
+ infoTooltip?: string;
91
+ /** Additional classes for the cells container. */
92
+ className?: string;
93
+ }
94
+ export declare const InputOTP: import('react').ForwardRefExoticComponent<InputOTPProps & import('react').RefAttributes<HTMLInputElement>>;
95
+ //# sourceMappingURL=InputOTP.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InputOTP.d.ts","sourceRoot":"","sources":["../../../src/components/InputOTP/InputOTP.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,wBAAwB,EAC7B,KAAK,SAAS,EAIf,MAAM,OAAO,CAAA;AAgBd;;;GAGG;AACH,MAAM,MAAM,oBAAoB,GAAG,SAAS,GAAG,cAAc,GAAG,YAAY,CAAA;AAuB5E,eAAO,MAAM,oBAAoB;;;;;8EA2ChC,CAAA;AA+CD;;;;;GAKG;AACH,MAAM,WAAW,aACf,SAAQ,IAAI,CACV,wBAAwB,CAAC,OAAO,CAAC,EACjC,OAAO,GAAG,UAAU,GAAG,MAAM,GAAG,MAAM,GAAG,UAAU,GAAG,cAAc,CACrE;IACD;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,iEAAiE;IACjE,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,wDAAwD;IACxD,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,6DAA6D;IAC7D,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IAClC,wDAAwD;IACxD,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IACpC,+DAA+D;IAC/D,IAAI,CAAC,EAAE,IAAI,GAAG,MAAM,GAAG,IAAI,CAAA;IAC3B,sFAAsF;IACtF,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,kEAAkE;IAClE,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB;;;;OAIG;IACH,IAAI,CAAC,EAAE,OAAO,CAAA;IACd;;;;;;;;;OASG;IACH,YAAY,CAAC,EAAE,oBAAoB,CAAA;IACnC;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB;;;;;;OAMG;IACH,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,2CAA2C;IAC3C,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,qDAAqD;IACrD,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,qFAAqF;IACrF,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB;;;OAGG;IACH,uBAAuB,CAAC,EAAE,OAAO,CAAA;IACjC;;;OAGG;IACH,UAAU,CAAC,EAAE,SAAS,CAAA;IACtB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,kDAAkD;IAClD,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,eAAO,MAAM,QAAQ,4GA0HpB,CAAA"}
@@ -0,0 +1,187 @@
1
+ import { jsx as r, Fragment as H, jsxs as V } from "react/jsx-runtime";
2
+ import { forwardRef as W, useId as j, useCallback as M } from "react";
3
+ import { useControllableState as Y } from "@radix-ui/react-use-controllable-state";
4
+ import { cva as w } from "class-variance-authority";
5
+ import { OTPInput as X, REGEXP_ONLY_CHARS as Z, REGEXP_ONLY_DIGITS_AND_CHARS as $, REGEXP_ONLY_DIGITS as U } from "input-otp";
6
+ import { useWebOtpAutofill as B } from "./useWebOtpAutofill.js";
7
+ import { FormField as J } from "../FormField/FormField.js";
8
+ import { cn as g } from "../../utils/cn.js";
9
+ import { DotDivider as K } from "../DotDivider/DotDivider.js";
10
+ import { typographyVariants as Q } from "../Typography/Typography.js";
11
+ const q = {
12
+ numeric: U,
13
+ alphanumeric: $,
14
+ alphabetic: Z
15
+ }, ee = {
16
+ numeric: "numeric",
17
+ alphanumeric: "text",
18
+ alphabetic: "text"
19
+ }, re = {
20
+ numeric: /[^0-9]/g,
21
+ alphanumeric: /[^a-zA-Z0-9]/g,
22
+ alphabetic: /[^a-zA-Z]/g
23
+ }, te = w(
24
+ [
25
+ "relative flex shrink-0 items-center justify-center",
26
+ // Fixed 48px cell width across all sizes, per Figma. `comp-input-h-small`
27
+ // is the design-system's 48px spacing token (it also drives the small
28
+ // input height), reused here as the cell's constant width.
29
+ "w-comp-input-h-small",
30
+ "border border-comp-input-stroke-def bg-comp-input-fill-def",
31
+ "rounded-comp-input-radius-pin transition-colors",
32
+ "text-comp-input-text-primary",
33
+ // Hover is captured on the whole field via the container `group`.
34
+ "group-hover:border-comp-input-stroke-hover"
35
+ ],
36
+ {
37
+ variants: {
38
+ size: {
39
+ sm: "h-comp-input-h-small",
40
+ base: "h-comp-input-h-def",
41
+ lg: "h-comp-input-h-large"
42
+ },
43
+ active: {
44
+ true: "z-10 border-comp-input-icon-brand-focused group-hover:border-comp-input-icon-brand-focused"
45
+ },
46
+ error: {
47
+ true: "border-comp-input-stroke-error-def group-hover:border-comp-input-stroke-error-def"
48
+ },
49
+ disabled: {
50
+ true: "border-comp-input-stroke-disabled bg-comp-input-fill-disabled group-hover:border-comp-input-stroke-disabled"
51
+ }
52
+ },
53
+ compoundVariants: [
54
+ // Error styling must win over the focused border colour.
55
+ {
56
+ active: !0,
57
+ error: !0,
58
+ class: "border-comp-input-stroke-error-def group-hover:border-comp-input-stroke-error-def"
59
+ }
60
+ ],
61
+ defaultVariants: {
62
+ size: "base"
63
+ }
64
+ }
65
+ ), oe = g(
66
+ Q({ size: "lg", weight: "medium", fixY: !0 }),
67
+ "text-comp-input-text-primary"
68
+ ), x = ({
69
+ slot: e,
70
+ size: p,
71
+ error: c,
72
+ disabled: t,
73
+ mask: s
74
+ }) => /* @__PURE__ */ V(
75
+ "div",
76
+ {
77
+ className: te({
78
+ size: p,
79
+ active: e.isActive && !t,
80
+ error: c,
81
+ disabled: t
82
+ }),
83
+ children: [
84
+ e.char !== null && (s ? /* @__PURE__ */ r(K, { className: "size-comp-inputotp-dot-size bg-comp-input-text-primary" }) : /* @__PURE__ */ r("span", { className: oe, children: e.char })),
85
+ e.hasFakeCaret && /* @__PURE__ */ r("div", { className: "pointer-events-none absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ r("div", { className: "h-2/3 w-px bg-comp-input-text-primary" }) })
86
+ ]
87
+ }
88
+ );
89
+ x.displayName = "InputOTPSlot";
90
+ const ie = W(
91
+ ({
92
+ length: e = 6,
93
+ value: p,
94
+ defaultValue: c = "",
95
+ onChange: t,
96
+ onComplete: s,
97
+ size: I = "base",
98
+ error: m,
99
+ disabled: o,
100
+ mask: O,
101
+ allowedChars: i = "numeric",
102
+ pattern: P,
103
+ enableWebOtp: N = !1,
104
+ label: b,
105
+ hint: f,
106
+ required: u,
107
+ disableRequiredAsterisk: _,
108
+ labelExtra: A,
109
+ infoTooltip: y,
110
+ className: T,
111
+ id: R,
112
+ inputMode: S,
113
+ ...k
114
+ }, E) => {
115
+ const C = P ?? q[i], L = S ?? ee[i], [D, l] = Y({
116
+ prop: p,
117
+ defaultProp: c,
118
+ onChange: t
119
+ }), z = j(), n = R ?? z, h = f ? `${n}-hint` : void 0, v = b ? `${n}-label` : void 0, F = M(
120
+ (d) => {
121
+ const a = d.replace(re[i], "").slice(0, e);
122
+ a && l(a);
123
+ },
124
+ [i, e, l]
125
+ );
126
+ return B({
127
+ enabled: N && !o,
128
+ onReceive: F
129
+ }), /* @__PURE__ */ r(
130
+ J,
131
+ {
132
+ label: b,
133
+ hint: f,
134
+ error: m,
135
+ required: u,
136
+ disableRequiredAsterisk: _,
137
+ htmlFor: n,
138
+ labelId: v,
139
+ hintId: h,
140
+ labelExtra: A,
141
+ infoTooltip: y,
142
+ children: /* @__PURE__ */ r(
143
+ X,
144
+ {
145
+ ref: E,
146
+ id: n,
147
+ maxLength: e,
148
+ value: D ?? "",
149
+ onChange: l,
150
+ onComplete: s,
151
+ disabled: o,
152
+ pattern: C,
153
+ inputMode: L,
154
+ required: u,
155
+ "aria-describedby": h,
156
+ "aria-labelledby": v,
157
+ "aria-invalid": m,
158
+ "aria-required": u,
159
+ pushPasswordManagerStrategy: "none",
160
+ containerClassName: g(
161
+ "group flex items-center gap-comp-input-spacing-pin",
162
+ o && "cursor-not-allowed",
163
+ T
164
+ ),
165
+ render: ({ slots: d }) => /* @__PURE__ */ r(H, { children: d.map((a, G) => /* @__PURE__ */ r(
166
+ x,
167
+ {
168
+ slot: a,
169
+ size: I,
170
+ error: m,
171
+ disabled: o,
172
+ mask: O
173
+ },
174
+ G
175
+ )) }),
176
+ ...k
177
+ }
178
+ )
179
+ }
180
+ );
181
+ }
182
+ );
183
+ ie.displayName = "InputOTP";
184
+ export {
185
+ ie as InputOTP,
186
+ te as inputOTPCellVariants
187
+ };
@@ -0,0 +1,18 @@
1
+ import { Meta, StoryObj } from '@storybook/react-vite';
2
+ import { InputOTP } from './InputOTP';
3
+ declare const meta: Meta<typeof InputOTP>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof InputOTP>;
6
+ export declare const Default: Story;
7
+ export declare const WithLabelAndHint: Story;
8
+ export declare const SmsAutofill: Story;
9
+ export declare const ConfigurableLength: Story;
10
+ export declare const Masked: Story;
11
+ export declare const Alphanumeric: Story;
12
+ export declare const Disabled: Story;
13
+ /** Consolidated size showcase — enabled for visual regression. */
14
+ export declare const AllSizes: Story;
15
+ /** Consolidated state showcase — enabled for visual regression. */
16
+ export declare const AllStates: Story;
17
+ export declare const Controlled: Story;
18
+ //# sourceMappingURL=InputOTP.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InputOTP.stories.d.ts","sourceRoot":"","sources":["../../../src/components/InputOTP/InputOTP.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAC3D,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAErC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,QAAQ,CAmG/B,CAAA;AAED,eAAe,IAAI,CAAA;AACnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,QAAQ,CAAC,CAAA;AAEtC,eAAO,MAAM,OAAO,EAAE,KAarB,CAAA;AAED,eAAO,MAAM,gBAAgB,EAAE,KAc9B,CAAA;AAED,eAAO,MAAM,WAAW,EAAE,KAgDzB,CAAA;AAED,eAAO,MAAM,kBAAkB,EAAE,KAchC,CAAA;AAED,eAAO,MAAM,MAAM,EAAE,KAepB,CAAA;AAED,eAAO,MAAM,YAAY,EAAE,KAiB1B,CAAA;AAED,eAAO,MAAM,QAAQ,EAAE,KAetB,CAAA;AAED,kEAAkE;AAClE,eAAO,MAAM,QAAQ,EAAE,KAetB,CAAA;AAED,mEAAmE;AACnE,eAAO,MAAM,SAAS,EAAE,KAmBvB,CAAA;AAED,eAAO,MAAM,UAAU,EAAE,KA6BxB,CAAA"}
@@ -0,0 +1,3 @@
1
+ export { InputOTP, inputOTPCellVariants, type InputOTPProps, type InputOTPAllowedChars, } from './InputOTP';
2
+ export { useWebOtpAutofill, type UseWebOtpAutofillOptions, } from './useWebOtpAutofill';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/InputOTP/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EACR,oBAAoB,EACpB,KAAK,aAAa,EAClB,KAAK,oBAAoB,GAC1B,MAAM,YAAY,CAAA;AACnB,OAAO,EACL,iBAAiB,EACjB,KAAK,wBAAwB,GAC9B,MAAM,qBAAqB,CAAA"}