@cloudflare/kumo 1.1.0 → 1.3.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 (152) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/LICENSE +21 -0
  3. package/ai/component-registry.json +111 -3
  4. package/ai/component-registry.md +9 -2
  5. package/ai/schemas.ts +3 -1
  6. package/dist/.build-complete +1 -1
  7. package/dist/{breadcrumbs-B5SY2CWj.js → breadcrumbs-DyKi7BcP.js} +2 -2
  8. package/dist/{breadcrumbs-B5SY2CWj.js.map → breadcrumbs-DyKi7BcP.js.map} +1 -1
  9. package/dist/{button-E2-hZMZE.js → button-Bh96oxRL.js} +3 -3
  10. package/dist/{button-E2-hZMZE.js.map → button-Bh96oxRL.js.map} +1 -1
  11. package/dist/catalog.js +1 -1
  12. package/dist/{checkbox-BexIU_lZ.js → checkbox-C1LPq8eL.js} +3 -3
  13. package/dist/{checkbox-BexIU_lZ.js.map → checkbox-C1LPq8eL.js.map} +1 -1
  14. package/dist/{clipboard-text-BFHWMjmr.js → clipboard-text-CJSI9X2m.js} +3 -3
  15. package/dist/{clipboard-text-BFHWMjmr.js.map → clipboard-text-CJSI9X2m.js.map} +1 -1
  16. package/dist/{combobox-Dld0kS0U.js → combobox-CWxn5aHA.js} +4 -4
  17. package/dist/{combobox-Dld0kS0U.js.map → combobox-CWxn5aHA.js.map} +1 -1
  18. package/dist/command-line/cli.js +0 -0
  19. package/dist/command-line/commands/add.js +0 -0
  20. package/dist/command-line/commands/blocks.js +0 -0
  21. package/dist/command-line/commands/doc.js +0 -0
  22. package/dist/command-line/commands/init.js +0 -0
  23. package/dist/command-line/commands/ls.js +0 -0
  24. package/dist/{command-palette-BgQ680BG.js → command-palette-BxmGYxBv.js} +2 -2
  25. package/dist/{command-palette-BgQ680BG.js.map → command-palette-BxmGYxBv.js.map} +1 -1
  26. package/dist/components/breadcrumbs.js +1 -1
  27. package/dist/components/button.js +1 -1
  28. package/dist/components/checkbox.js +1 -1
  29. package/dist/components/clipboard-text.js +1 -1
  30. package/dist/components/combobox.js +1 -1
  31. package/dist/components/command-palette.js +1 -1
  32. package/dist/components/dialog.js +1 -1
  33. package/dist/components/dropdown.js +1 -1
  34. package/dist/components/empty.js +1 -1
  35. package/dist/components/field.js +1 -1
  36. package/dist/components/input.js +3 -3
  37. package/dist/components/label.js +1 -1
  38. package/dist/components/link.js +1 -1
  39. package/dist/components/menubar.js +1 -1
  40. package/dist/components/meter.js +1 -1
  41. package/dist/components/pagination.js +1 -1
  42. package/dist/components/popover.js +1 -1
  43. package/dist/components/radio.js +1 -1
  44. package/dist/components/select.js +1 -1
  45. package/dist/components/sensitive-input.js +1 -1
  46. package/dist/components/switch.js +1 -1
  47. package/dist/components/table.js +1 -1
  48. package/dist/components/tabs.js +1 -1
  49. package/dist/components/toast.js +6 -4
  50. package/dist/components/tooltip.js +1 -1
  51. package/dist/{dialog-B1TaN0oR.js → dialog-x9n9wI13.js} +18 -18
  52. package/dist/dialog-x9n9wI13.js.map +1 -0
  53. package/dist/{dropdown-D0rhYKeG.js → dropdown-BAyk1knz.js} +7 -7
  54. package/dist/{dropdown-D0rhYKeG.js.map → dropdown-BAyk1knz.js.map} +1 -1
  55. package/dist/{empty-DzCqjea-.js → empty-D03cbzRS.js} +2 -2
  56. package/dist/{empty-DzCqjea-.js.map → empty-D03cbzRS.js.map} +1 -1
  57. package/dist/{field-V3J0Ql_V.js → field-B7ORz5ej.js} +3 -3
  58. package/dist/{field-V3J0Ql_V.js.map → field-B7ORz5ej.js.map} +1 -1
  59. package/dist/index.js +268 -121
  60. package/dist/index.js.map +1 -1
  61. package/dist/{input-Dqvc2AB_.js → input-D6YgDfDG.js} +3 -3
  62. package/dist/{input-Dqvc2AB_.js.map → input-D6YgDfDG.js.map} +1 -1
  63. package/dist/{input-area-B9qajxvZ.js → input-area-DN_Ncliw.js} +10 -10
  64. package/dist/{input-area-B9qajxvZ.js.map → input-area-DN_Ncliw.js.map} +1 -1
  65. package/dist/{input-group-Bl6tgD5-.js → input-group-BXzBwH4p.js} +29 -29
  66. package/dist/{input-group-Bl6tgD5-.js.map → input-group-BXzBwH4p.js.map} +1 -1
  67. package/dist/{label-87HQArUG.js → label-B4FY8MX_.js} +2 -2
  68. package/dist/{label-87HQArUG.js.map → label-B4FY8MX_.js.map} +1 -1
  69. package/dist/{link-6TIZ4JIw.js → link-CcuZKqob.js} +8 -8
  70. package/dist/{link-6TIZ4JIw.js.map → link-CcuZKqob.js.map} +1 -1
  71. package/dist/{menubar-DLwLRFB1.js → menubar-CzimiryS.js} +2 -2
  72. package/dist/{menubar-DLwLRFB1.js.map → menubar-CzimiryS.js.map} +1 -1
  73. package/dist/{meter-DKUuvXxS.js → meter-BrJnHJ3Q.js} +2 -2
  74. package/dist/{meter-DKUuvXxS.js.map → meter-BrJnHJ3Q.js.map} +1 -1
  75. package/dist/{pagination-C4HQqodz.js → pagination-D0x9KQSk.js} +2 -2
  76. package/dist/{pagination-C4HQqodz.js.map → pagination-D0x9KQSk.js.map} +1 -1
  77. package/dist/{popover-DhdIqrP7.js → popover-CtKDH8Yc.js} +11 -11
  78. package/dist/{popover-DhdIqrP7.js.map → popover-CtKDH8Yc.js.map} +1 -1
  79. package/dist/primitives/accordion.js +1 -1
  80. package/dist/primitives/alert-dialog.js +1 -1
  81. package/dist/primitives/autocomplete.js +1 -1
  82. package/dist/primitives/avatar.js +1 -1
  83. package/dist/primitives/button.js +1 -1
  84. package/dist/primitives/checkbox-group.js +1 -1
  85. package/dist/primitives/checkbox.js +1 -1
  86. package/dist/primitives/collapsible.js +1 -1
  87. package/dist/primitives/combobox.js +1 -1
  88. package/dist/primitives/context-menu.js +1 -1
  89. package/dist/primitives/dialog.js +1 -1
  90. package/dist/primitives/direction-provider.js +1 -1
  91. package/dist/primitives/field.js +1 -1
  92. package/dist/primitives/fieldset.js +1 -1
  93. package/dist/primitives/form.js +1 -1
  94. package/dist/primitives/input.js +1 -1
  95. package/dist/primitives/menu.js +1 -1
  96. package/dist/primitives/menubar.js +1 -1
  97. package/dist/primitives/meter.js +1 -1
  98. package/dist/primitives/navigation-menu.js +1 -1
  99. package/dist/primitives/number-field.js +1 -1
  100. package/dist/primitives/popover.js +1 -1
  101. package/dist/primitives/preview-card.js +1 -1
  102. package/dist/primitives/progress.js +1 -1
  103. package/dist/primitives/radio-group.js +1 -1
  104. package/dist/primitives/radio.js +1 -1
  105. package/dist/primitives/scroll-area.js +1 -1
  106. package/dist/primitives/select.js +1 -1
  107. package/dist/primitives/separator.js +1 -1
  108. package/dist/primitives/slider.js +1 -1
  109. package/dist/primitives/switch.js +1 -1
  110. package/dist/primitives/tabs.js +1 -1
  111. package/dist/primitives/toast.js +1 -1
  112. package/dist/primitives/toggle-group.js +1 -1
  113. package/dist/primitives/toggle.js +1 -1
  114. package/dist/primitives/toolbar.js +1 -1
  115. package/dist/primitives/tooltip.js +1 -1
  116. package/dist/primitives.js +1 -1
  117. package/dist/{radio-BVAG7hNp.js → radio-CYejLANA.js} +6 -6
  118. package/dist/{radio-BVAG7hNp.js.map → radio-CYejLANA.js.map} +1 -1
  119. package/dist/{schemas-Cbid4MwW.js → schemas-C2YJKpDC.js} +5 -1
  120. package/dist/{schemas-Cbid4MwW.js.map → schemas-C2YJKpDC.js.map} +1 -1
  121. package/dist/{select-B5Vb3zou.js → select-D4rKQAax.js} +4 -4
  122. package/dist/{select-B5Vb3zou.js.map → select-D4rKQAax.js.map} +1 -1
  123. package/dist/{sensitive-input-D5HCV04N.js → sensitive-input-DYvAmxkN.js} +19 -19
  124. package/dist/{sensitive-input-D5HCV04N.js.map → sensitive-input-DYvAmxkN.js.map} +1 -1
  125. package/dist/src/blocks/delete-resource/delete-resource.d.ts +46 -0
  126. package/dist/src/blocks/delete-resource/delete-resource.d.ts.map +1 -0
  127. package/dist/src/blocks/delete-resource/index.d.ts +2 -0
  128. package/dist/src/blocks/delete-resource/index.d.ts.map +1 -0
  129. package/dist/src/components/dialog/dialog.d.ts +1 -1
  130. package/dist/src/components/toast/index.d.ts +2 -0
  131. package/dist/src/components/toast/index.d.ts.map +1 -1
  132. package/dist/src/components/toast/toast.d.ts +53 -3
  133. package/dist/src/components/toast/toast.d.ts.map +1 -1
  134. package/dist/src/index.d.ts +2 -1
  135. package/dist/src/index.d.ts.map +1 -1
  136. package/dist/styles/kumo-standalone.css +1 -1
  137. package/dist/{switch-D4duMhJ0.js → switch-z7FE1nQE.js} +3 -3
  138. package/dist/{switch-D4duMhJ0.js.map → switch-z7FE1nQE.js.map} +1 -1
  139. package/dist/{table-KuvHGpL8.js → table-Sd2Etb1N.js} +2 -2
  140. package/dist/{table-KuvHGpL8.js.map → table-Sd2Etb1N.js.map} +1 -1
  141. package/dist/{tabs-lQup-IbT.js → tabs-DAEeuQLd.js} +2 -2
  142. package/dist/{tabs-lQup-IbT.js.map → tabs-DAEeuQLd.js.map} +1 -1
  143. package/dist/toast-B8ebpHaU.js +248 -0
  144. package/dist/toast-B8ebpHaU.js.map +1 -0
  145. package/dist/{tooltip-DJWsDTWJ.js → tooltip-C4DRhJi1.js} +6 -6
  146. package/dist/{tooltip-DJWsDTWJ.js.map → tooltip-C4DRhJi1.js.map} +1 -1
  147. package/dist/{vendor-base-ui-DWIDNgE1.js → vendor-base-ui-kX0wjdav.js} +32 -31
  148. package/dist/{vendor-base-ui-DWIDNgE1.js.map → vendor-base-ui-kX0wjdav.js.map} +1 -1
  149. package/package.json +46 -46
  150. package/dist/dialog-B1TaN0oR.js.map +0 -1
  151. package/dist/toast-8YyyQuqZ.js +0 -69
  152. package/dist/toast-8YyyQuqZ.js.map +0 -1
package/dist/index.js CHANGED
@@ -1,125 +1,272 @@
1
1
  "use client";
2
- import { B as r } from "./badge-Dc99vsfo.js";
3
- import { B as e, a as t } from "./banner-4fkH6Sbt.js";
4
- import { B as i, L as m, R as A, b as n } from "./button-E2-hZMZE.js";
5
- import { D as f } from "./date-range-picker-CbKEQ9pi.js";
6
- import { C as _ } from "./checkbox-BexIU_lZ.js";
7
- import { C as L } from "./clipboard-text-BFHWMjmr.js";
8
- import { C as R, a as S } from "./code-T2wPDiM0.js";
9
- import { C as D } from "./combobox-Dld0kS0U.js";
10
- import { D as M, e as U, d as N, a as E, c as O, b as d } from "./dialog-B1TaN0oR.js";
11
- import { D as C } from "./dropdown-D0rhYKeG.js";
12
- import { C as P } from "./collapsible-OBNkTO48.js";
13
- import { F as B, a as c, K as F, f as k } from "./field-V3J0Ql_V.js";
14
- import { b as v, K as h, L as y, a as w, l as j } from "./label-87HQArUG.js";
15
- import { I as z, i as H } from "./input-Dqvc2AB_.js";
16
- import { I as Q } from "./input-area-B9qajxvZ.js";
17
- import { I as X } from "./input-group-Bl6tgD5-.js";
18
- import { L as Z } from "./layer-card-C8j5Hkkj.js";
19
- import { L as aa } from "./loader-DHGMYlC6.js";
20
- import { S as ra } from "./skeleton-line-CtpS1u1J.js";
21
- import { M as ea, u as ta } from "./menubar-DLwLRFB1.js";
22
- import { M as ia } from "./meter-DKUuvXxS.js";
23
- import { P as Aa } from "./pagination-C4HQqodz.js";
24
- import { S as Ta } from "./select-B5Vb3zou.js";
25
- import { S as xa } from "./surface-BIC6CXiz.js";
26
- import { S as Ia } from "./switch-D4duMhJ0.js";
27
- import { T as la } from "./tabs-lQup-IbT.js";
28
- import { T as Sa } from "./table-KuvHGpL8.js";
29
- import { T as Da } from "./text-BEhqwMfe.js";
30
- import { T as Ma } from "./toast-8YyyQuqZ.js";
31
- import { T as Na, a as Ea } from "./tooltip-DJWsDTWJ.js";
32
- import { a as da, K as ua, P as Ca } from "./popover-DhdIqrP7.js";
33
- import { a as Pa, K as ga, S as Ba } from "./sensitive-input-D5HCV04N.js";
34
- import { b as Fa, K as ka, R as Ga, a as va } from "./radio-BVAG7hNp.js";
35
- import { C as ya, a as wa, K as ja } from "./command-palette-BgQ680BG.js";
36
- import { a as za, K as Ha, L as Ja, l as Qa } from "./link-6TIZ4JIw.js";
37
- import { B as Xa } from "./breadcrumbs-B5SY2CWj.js";
38
- import { E as Za } from "./empty-DzCqjea-.js";
39
- import { G as ao, a as oo, c as ro, K as so, b as eo, g as to } from "./grid-DKajRHh8.js";
40
- import { c as io, s as mo } from "./cn-Bhsu1vx2.js";
41
- import { L as no, u as To } from "./link-provider-DPBGo-0n.js";
42
- import { i as xo } from "./vendor-base-ui-DWIDNgE1.js";
2
+ import { B as J } from "./badge-Dc99vsfo.js";
3
+ import { B as S } from "./banner-4fkH6Sbt.js";
4
+ import { a as Y } from "./banner-4fkH6Sbt.js";
5
+ import { B as n } from "./button-Bh96oxRL.js";
6
+ import { L as aa, R as ea, b as oa } from "./button-Bh96oxRL.js";
7
+ import { D as ta } from "./date-range-picker-CbKEQ9pi.js";
8
+ import { C as ia } from "./checkbox-C1LPq8eL.js";
9
+ import { C as na } from "./clipboard-text-CJSI9X2m.js";
10
+ import { C as pa, a as fa } from "./code-T2wPDiM0.js";
11
+ import { C as ca } from "./combobox-CWxn5aHA.js";
12
+ import { a as N, D as U, c as V, e as A } from "./dialog-x9n9wI13.js";
13
+ import { d as ua, b as Ta } from "./dialog-x9n9wI13.js";
14
+ import { D as _a } from "./dropdown-BAyk1knz.js";
15
+ import { C as ba } from "./collapsible-OBNkTO48.js";
16
+ import { F as ha, a as Ra, K as La, f as Ea } from "./field-B7ORz5ej.js";
17
+ import { b as Na, K as Ua, L as Va, a as ga, l as Da } from "./label-B4FY8MX_.js";
18
+ import { I as g } from "./input-D6YgDfDG.js";
19
+ import { i as Ma } from "./input-D6YgDfDG.js";
20
+ import { I as ka } from "./input-area-DN_Ncliw.js";
21
+ import { I as ya } from "./input-group-BXzBwH4p.js";
22
+ import { L as Ba } from "./layer-card-C8j5Hkkj.js";
23
+ import { L as wa } from "./loader-DHGMYlC6.js";
24
+ import { S as Ga } from "./skeleton-line-CtpS1u1J.js";
25
+ import { M as $a, u as qa } from "./menubar-CzimiryS.js";
26
+ import { M as Xa } from "./meter-BrJnHJ3Q.js";
27
+ import { P as Ja } from "./pagination-D0x9KQSk.js";
28
+ import { S as Ya } from "./select-D4rKQAax.js";
29
+ import { S as ae } from "./surface-BIC6CXiz.js";
30
+ import { S as oe } from "./switch-z7FE1nQE.js";
31
+ import { T as te } from "./tabs-DAEeuQLd.js";
32
+ import { T as ie } from "./table-Sd2Etb1N.js";
33
+ import { T as ne } from "./text-BEhqwMfe.js";
34
+ import { T as pe, u as fe } from "./toast-B8ebpHaU.js";
35
+ import { T as ce, a as xe } from "./tooltip-C4DRhJi1.js";
36
+ import { g as Te, K as Ae, P as _e } from "./popover-CtKDH8Yc.js";
37
+ import { a as be, K as Ce, S as he } from "./sensitive-input-DYvAmxkN.js";
38
+ import { b as Le, K as Ee, R as Se, a as Ne } from "./radio-CYejLANA.js";
39
+ import { C as Ve, a as ge, K as De } from "./command-palette-BxmGYxBv.js";
40
+ import { a as Me, K as Oe, L as ke, l as ve } from "./link-CcuZKqob.js";
41
+ import { B as Pe } from "./breadcrumbs-DyKi7BcP.js";
42
+ import { E as Fe } from "./empty-D03cbzRS.js";
43
+ import { G as ze, a as Ge, c as je, K as $e, b as qe, g as We } from "./grid-DKajRHh8.js";
44
+ import { c as D } from "./cn-Bhsu1vx2.js";
45
+ import { s as He } from "./cn-Bhsu1vx2.js";
46
+ import { L as Qe, u as Ye } from "./link-provider-DPBGo-0n.js";
47
+ import { jsx as a, jsxs as e } from "react/jsx-runtime";
48
+ import { useState as _, useEffect as K, useCallback as m } from "react";
49
+ import { XIcon as M, WarningCircleIcon as O, CheckIcon as k, CopyIcon as v } from "@phosphor-icons/react";
50
+ import { i as ao } from "./vendor-base-ui-kX0wjdav.js";
51
+ const W = {
52
+ size: {
53
+ sm: {
54
+ classes: "",
55
+ description: "Small dialog for simple delete confirmations"
56
+ },
57
+ base: {
58
+ classes: "",
59
+ description: "Default delete confirmation dialog size"
60
+ }
61
+ }
62
+ }, y = {
63
+ size: "base"
64
+ };
65
+ function P({
66
+ open: s,
67
+ onOpenChange: I,
68
+ resourceType: p,
69
+ resourceName: o,
70
+ onDelete: f,
71
+ isDeleting: r = !1,
72
+ caseSensitive: d = !0,
73
+ deleteButtonText: b,
74
+ size: C = y.size,
75
+ errorMessage: c,
76
+ className: h
77
+ }) {
78
+ const [x, u] = _(""), [R, i] = _(!1);
79
+ K(() => {
80
+ s || (u(""), i(!1));
81
+ }, [s]);
82
+ const T = m(
83
+ (t) => d ? t : t.toLowerCase(),
84
+ [d]
85
+ ), l = T(x) === T(o), L = m(async () => {
86
+ !l || r || await f();
87
+ }, [l, r, f]), E = m(async () => {
88
+ await navigator.clipboard.writeText(o), i(!0), setTimeout(() => i(!1), 1500);
89
+ }, [o]);
90
+ return /* @__PURE__ */ a(N, { open: s, onOpenChange: I, children: /* @__PURE__ */ e(U, { size: C, className: D("p-0", h), children: [
91
+ /* @__PURE__ */ e("div", { className: "flex items-center justify-between border-b border-kumo-line px-6 py-4", children: [
92
+ /* @__PURE__ */ e(V, { className: "text-lg font-semibold", children: [
93
+ "Delete ",
94
+ o
95
+ ] }),
96
+ /* @__PURE__ */ a(A, { children: /* @__PURE__ */ a(
97
+ n,
98
+ {
99
+ variant: "ghost",
100
+ shape: "square",
101
+ size: "sm",
102
+ "aria-label": "Close",
103
+ disabled: r,
104
+ children: /* @__PURE__ */ a(M, { size: 18 })
105
+ }
106
+ ) })
107
+ ] }),
108
+ /* @__PURE__ */ e("div", { className: "flex flex-col p-6 gap-4", children: [
109
+ /* @__PURE__ */ e("div", { className: "flex flex-col gap-2", children: [
110
+ c && /* @__PURE__ */ a(S, { icon: /* @__PURE__ */ a(O, {}), variant: "error", children: c }),
111
+ /* @__PURE__ */ e("p", { className: "text-base text-kumo-subtle max-w-prose text-pretty", children: [
112
+ "This action cannot be undone. This will permanently delete the",
113
+ " ",
114
+ /* @__PURE__ */ a("span", { className: "font-medium text-kumo-default", children: o }),
115
+ " ",
116
+ p.toLowerCase(),
117
+ "."
118
+ ] })
119
+ ] }),
120
+ /* @__PURE__ */ e("div", { className: "flex flex-col gap-2", children: [
121
+ /* @__PURE__ */ a("div", { className: "flex items-center gap-1.5 text-base", children: /* @__PURE__ */ e("span", { children: [
122
+ "Type",
123
+ " ",
124
+ /* @__PURE__ */ e(
125
+ "button",
126
+ {
127
+ className: "font-mono text-sm inline font-semibold bg-kumo-tint hover:bg-kumo-fill rounded-md px-2 py-1 group hover:cursor-pointer",
128
+ onClick: E,
129
+ "aria-label": `Copy ${o} to clipboard`,
130
+ children: [
131
+ o,
132
+ R ? /* @__PURE__ */ a(
133
+ k,
134
+ {
135
+ size: 12,
136
+ weight: "bold",
137
+ className: "inline ml-1.5"
138
+ }
139
+ ) : /* @__PURE__ */ a(
140
+ v,
141
+ {
142
+ size: 12,
143
+ weight: "bold",
144
+ className: "inline text-kumo-subtle group-hover:text-kumo-default ml-1.5"
145
+ }
146
+ )
147
+ ]
148
+ }
149
+ ),
150
+ " ",
151
+ "to confirm:"
152
+ ] }) }),
153
+ /* @__PURE__ */ a(
154
+ g,
155
+ {
156
+ placeholder: o,
157
+ value: x,
158
+ onChange: (t) => u(t.target.value),
159
+ disabled: r,
160
+ autoComplete: "off",
161
+ autoCorrect: "off",
162
+ autoCapitalize: "off",
163
+ spellCheck: !1,
164
+ "aria-label": `Type ${o} to confirm deletion`,
165
+ className: "w-full"
166
+ }
167
+ )
168
+ ] })
169
+ ] }),
170
+ /* @__PURE__ */ e("div", { className: "flex justify-end gap-3 border-t border-kumo-line px-6 py-4", children: [
171
+ /* @__PURE__ */ a(A, { children: /* @__PURE__ */ a(n, { variant: "secondary", disabled: r, children: "Cancel" }) }),
172
+ /* @__PURE__ */ a(
173
+ n,
174
+ {
175
+ variant: "destructive",
176
+ onClick: L,
177
+ disabled: !l || r,
178
+ loading: r,
179
+ children: b || `Delete ${p}`
180
+ }
181
+ )
182
+ ] })
183
+ ] }) });
184
+ }
185
+ P.displayName = "DeleteResource";
43
186
  export {
44
- r as Badge,
45
- e as Banner,
46
- t as BannerVariant,
47
- Xa as Breadcrumbs,
48
- i as Button,
49
- _ as Checkbox,
50
- L as ClipboardText,
51
- R as Code,
52
- S as CodeBlock,
53
- P as Collapsible,
54
- D as Combobox,
55
- ya as CommandPalette,
56
- f as DateRangePicker,
57
- M as Dialog,
58
- U as DialogClose,
59
- N as DialogDescription,
60
- E as DialogRoot,
61
- O as DialogTitle,
62
- d as DialogTrigger,
63
- C as DropdownMenu,
64
- Za as Empty,
65
- B as Field,
66
- ao as Grid,
67
- oo as GridItem,
68
- z as Input,
69
- Q as InputArea,
70
- X as InputGroup,
71
- wa as KUMO_COMMAND_PALETTE_DEFAULT_VARIANTS,
72
- ja as KUMO_COMMAND_PALETTE_VARIANTS,
73
- c as KUMO_FIELD_DEFAULT_VARIANTS,
74
- F as KUMO_FIELD_VARIANTS,
75
- ro as KUMO_GRID_DEFAULT_VARIANTS,
76
- so as KUMO_GRID_VARIANTS,
77
- v as KUMO_LABEL_DEFAULT_VARIANTS,
78
- h as KUMO_LABEL_VARIANTS,
79
- za as KUMO_LINK_DEFAULT_VARIANTS,
80
- Ha as KUMO_LINK_VARIANTS,
81
- da as KUMO_POPOVER_DEFAULT_VARIANTS,
82
- ua as KUMO_POPOVER_VARIANTS,
83
- Fa as KUMO_RADIO_DEFAULT_VARIANTS,
84
- ka as KUMO_RADIO_VARIANTS,
85
- Pa as KUMO_SENSITIVE_INPUT_DEFAULT_VARIANTS,
86
- ga as KUMO_SENSITIVE_INPUT_VARIANTS,
87
- y as Label,
88
- Z as LayerCard,
89
- Ja as Link,
90
- m as LinkButton,
91
- no as LinkProvider,
92
- aa as Loader,
93
- ea as MenuBar,
94
- ia as Meter,
95
- Aa as Pagination,
96
- Ca as Popover,
97
- Ga as Radio,
98
- va as RadioGroup,
99
- A as RefreshButton,
100
- Ta as Select,
101
- Ba as SensitiveInput,
102
- ra as SkeletonLine,
103
- xa as Surface,
104
- Ia as Switch,
105
- Sa as Table,
106
- la as Tabs,
107
- Da as Text,
108
- xo as Toast,
109
- Ma as Toasty,
110
- Na as Tooltip,
111
- Ea as TooltipProvider,
112
- n as buttonVariants,
113
- io as cn,
114
- k as fieldVariants,
115
- eo as gridItemVariants,
116
- to as gridVariants,
117
- H as inputVariants,
118
- w as labelContentVariants,
119
- j as labelVariants,
120
- Qa as linkVariants,
121
- mo as safeRandomId,
122
- To as useLinkComponent,
123
- ta as useMenuNavigation
187
+ J as Badge,
188
+ S as Banner,
189
+ Y as BannerVariant,
190
+ Pe as Breadcrumbs,
191
+ n as Button,
192
+ ia as Checkbox,
193
+ na as ClipboardText,
194
+ pa as Code,
195
+ fa as CodeBlock,
196
+ ba as Collapsible,
197
+ ca as Combobox,
198
+ Ve as CommandPalette,
199
+ ta as DateRangePicker,
200
+ P as DeleteResource,
201
+ U as Dialog,
202
+ A as DialogClose,
203
+ ua as DialogDescription,
204
+ N as DialogRoot,
205
+ V as DialogTitle,
206
+ Ta as DialogTrigger,
207
+ _a as DropdownMenu,
208
+ Fe as Empty,
209
+ ha as Field,
210
+ ze as Grid,
211
+ Ge as GridItem,
212
+ g as Input,
213
+ ka as InputArea,
214
+ ya as InputGroup,
215
+ ge as KUMO_COMMAND_PALETTE_DEFAULT_VARIANTS,
216
+ De as KUMO_COMMAND_PALETTE_VARIANTS,
217
+ y as KUMO_DELETE_RESOURCE_DEFAULT_VARIANTS,
218
+ W as KUMO_DELETE_RESOURCE_VARIANTS,
219
+ Ra as KUMO_FIELD_DEFAULT_VARIANTS,
220
+ La as KUMO_FIELD_VARIANTS,
221
+ je as KUMO_GRID_DEFAULT_VARIANTS,
222
+ $e as KUMO_GRID_VARIANTS,
223
+ Na as KUMO_LABEL_DEFAULT_VARIANTS,
224
+ Ua as KUMO_LABEL_VARIANTS,
225
+ Me as KUMO_LINK_DEFAULT_VARIANTS,
226
+ Oe as KUMO_LINK_VARIANTS,
227
+ Te as KUMO_POPOVER_DEFAULT_VARIANTS,
228
+ Ae as KUMO_POPOVER_VARIANTS,
229
+ Le as KUMO_RADIO_DEFAULT_VARIANTS,
230
+ Ee as KUMO_RADIO_VARIANTS,
231
+ be as KUMO_SENSITIVE_INPUT_DEFAULT_VARIANTS,
232
+ Ce as KUMO_SENSITIVE_INPUT_VARIANTS,
233
+ Va as Label,
234
+ Ba as LayerCard,
235
+ ke as Link,
236
+ aa as LinkButton,
237
+ Qe as LinkProvider,
238
+ wa as Loader,
239
+ $a as MenuBar,
240
+ Xa as Meter,
241
+ Ja as Pagination,
242
+ _e as Popover,
243
+ Se as Radio,
244
+ Ne as RadioGroup,
245
+ ea as RefreshButton,
246
+ Ya as Select,
247
+ he as SensitiveInput,
248
+ Ga as SkeletonLine,
249
+ ae as Surface,
250
+ oe as Switch,
251
+ ie as Table,
252
+ te as Tabs,
253
+ ne as Text,
254
+ ao as Toast,
255
+ pe as Toasty,
256
+ ce as Tooltip,
257
+ xe as TooltipProvider,
258
+ oa as buttonVariants,
259
+ D as cn,
260
+ Ea as fieldVariants,
261
+ qe as gridItemVariants,
262
+ We as gridVariants,
263
+ Ma as inputVariants,
264
+ ga as labelContentVariants,
265
+ Da as labelVariants,
266
+ ve as linkVariants,
267
+ He as safeRandomId,
268
+ fe as useKumoToastManager,
269
+ Ye as useLinkComponent,
270
+ qa as useMenuNavigation
124
271
  };
125
272
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../src/blocks/delete-resource/delete-resource.tsx"],"sourcesContent":["import { useState, useCallback, useEffect } from \"react\";\nimport {\n Dialog,\n DialogRoot,\n DialogTitle,\n DialogClose,\n} from \"../../components/dialog\";\nimport { Input } from \"../../components/input\";\nimport { Button } from \"../../components/button\";\nimport { cn } from \"../../utils/cn\";\nimport {\n CheckIcon,\n CopyIcon,\n WarningCircleIcon,\n XIcon,\n} from \"@phosphor-icons/react\";\nimport { Banner } from \"../../components/banner\";\n\nexport const KUMO_DELETE_RESOURCE_VARIANTS = {\n size: {\n sm: {\n classes: \"\",\n description: \"Small dialog for simple delete confirmations\",\n },\n base: {\n classes: \"\",\n description: \"Default delete confirmation dialog size\",\n },\n },\n} as const;\n\nexport const KUMO_DELETE_RESOURCE_DEFAULT_VARIANTS = {\n size: \"base\",\n} as const;\n\nexport type KumoDeleteResourceSize =\n keyof typeof KUMO_DELETE_RESOURCE_VARIANTS.size;\n\nexport interface KumoDeleteResourceVariantsProps {\n size?: KumoDeleteResourceSize;\n}\n\nexport interface DeleteResourceProps extends KumoDeleteResourceVariantsProps {\n /** Whether the dialog is open */\n open: boolean;\n /** Callback when open state changes */\n onOpenChange: (open: boolean) => void;\n /** The type of resource being deleted (e.g., \"Zone\", \"Worker\", \"KV Namespace\") */\n resourceType: string;\n /** The name of the specific resource being deleted */\n resourceName: string;\n /** Callback when delete is confirmed */\n onDelete: () => void | Promise<void>;\n /** Whether the delete action is in progress */\n isDeleting?: boolean;\n /** Whether the confirmation input should be case-sensitive (default: true) */\n caseSensitive?: boolean;\n /** Custom delete button text (defaults to \"Delete {resourceType}\") */\n deleteButtonText?: string;\n /** Additional className for the dialog */\n className?: string;\n /** Error message to display if the delete action fails */\n errorMessage?: string;\n}\n\nexport function DeleteResource({\n open,\n onOpenChange,\n resourceType,\n resourceName,\n onDelete,\n isDeleting = false,\n caseSensitive = true,\n deleteButtonText,\n size = KUMO_DELETE_RESOURCE_DEFAULT_VARIANTS.size,\n errorMessage,\n className,\n}: DeleteResourceProps) {\n const [confirmationInput, setConfirmationInput] = useState(\"\");\n const [copied, setCopied] = useState(false);\n\n useEffect(() => {\n if (!open) {\n setConfirmationInput(\"\");\n setCopied(false);\n }\n }, [open]);\n\n const normalizeForComparison = useCallback(\n (str: string) => (caseSensitive ? str : str.toLowerCase()),\n [caseSensitive],\n );\n\n const isConfirmed =\n normalizeForComparison(confirmationInput) ===\n normalizeForComparison(resourceName);\n\n const handleDelete = useCallback(async () => {\n if (!isConfirmed || isDeleting) return;\n await onDelete();\n }, [isConfirmed, isDeleting, onDelete]);\n\n const handleCopy = useCallback(async () => {\n await navigator.clipboard.writeText(resourceName);\n setCopied(true);\n setTimeout(() => setCopied(false), 1500);\n }, [resourceName]);\n\n return (\n <DialogRoot open={open} onOpenChange={onOpenChange}>\n <Dialog size={size} className={cn(\"p-0\", className)}>\n <div className=\"flex items-center justify-between border-b border-kumo-line px-6 py-4\">\n <DialogTitle className=\"text-lg font-semibold\">\n Delete {resourceName}\n </DialogTitle>\n <DialogClose>\n <Button\n variant=\"ghost\"\n shape=\"square\"\n size=\"sm\"\n aria-label=\"Close\"\n disabled={isDeleting}\n >\n <XIcon size={18} />\n </Button>\n </DialogClose>\n </div>\n\n <div className=\"flex flex-col p-6 gap-4\">\n <div className=\"flex flex-col gap-2\">\n {errorMessage && (\n <Banner icon={<WarningCircleIcon />} variant=\"error\">\n {errorMessage}\n </Banner>\n )}\n <p className=\"text-base text-kumo-subtle max-w-prose text-pretty\">\n This action cannot be undone. This will permanently delete the{\" \"}\n <span className=\"font-medium text-kumo-default\">\n {resourceName}\n </span>{\" \"}\n {resourceType.toLowerCase()}.\n </p>\n </div>\n\n <div className=\"flex flex-col gap-2\">\n <div className=\"flex items-center gap-1.5 text-base\">\n <span>\n Type{\" \"}\n <button\n className=\"font-mono text-sm inline font-semibold bg-kumo-tint hover:bg-kumo-fill rounded-md px-2 py-1 group hover:cursor-pointer\"\n onClick={handleCopy}\n aria-label={`Copy ${resourceName} to clipboard`}\n >\n {resourceName}\n\n {copied ? (\n <CheckIcon\n size={12}\n weight=\"bold\"\n className=\"inline ml-1.5\"\n />\n ) : (\n <CopyIcon\n size={12}\n weight=\"bold\"\n className=\"inline text-kumo-subtle group-hover:text-kumo-default ml-1.5\"\n />\n )}\n </button>{\" \"}\n to confirm:\n </span>\n </div>\n <Input\n placeholder={resourceName}\n value={confirmationInput}\n onChange={(e) => setConfirmationInput(e.target.value)}\n disabled={isDeleting}\n autoComplete=\"off\"\n autoCorrect=\"off\"\n autoCapitalize=\"off\"\n spellCheck={false}\n aria-label={`Type ${resourceName} to confirm deletion`}\n className=\"w-full\"\n />\n </div>\n </div>\n\n <div className=\"flex justify-end gap-3 border-t border-kumo-line px-6 py-4\">\n <DialogClose>\n <Button variant=\"secondary\" disabled={isDeleting}>\n Cancel\n </Button>\n </DialogClose>\n <Button\n variant=\"destructive\"\n onClick={handleDelete}\n disabled={!isConfirmed || isDeleting}\n loading={isDeleting}\n >\n {deleteButtonText || `Delete ${resourceType}`}\n </Button>\n </div>\n </Dialog>\n </DialogRoot>\n );\n}\n\nDeleteResource.displayName = \"DeleteResource\";\n"],"names":["KUMO_DELETE_RESOURCE_VARIANTS","KUMO_DELETE_RESOURCE_DEFAULT_VARIANTS","DeleteResource","open","onOpenChange","resourceType","resourceName","onDelete","isDeleting","caseSensitive","deleteButtonText","size","errorMessage","className","confirmationInput","setConfirmationInput","useState","copied","setCopied","useEffect","normalizeForComparison","useCallback","str","isConfirmed","handleDelete","handleCopy","jsx","DialogRoot","jsxs","Dialog","cn","DialogTitle","DialogClose","Button","XIcon","Banner","WarningCircleIcon","CheckIcon","CopyIcon","Input","e"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkBO,MAAMA,IAAgC;AAAA,EAC3C,MAAM;AAAA,IACJ,IAAI;AAAA,MACF,SAAS;AAAA,MACT,aAAa;AAAA,IAAA;AAAA,IAEf,MAAM;AAAA,MACJ,SAAS;AAAA,MACT,aAAa;AAAA,IAAA;AAAA,EACf;AAEJ,GAEaC,IAAwC;AAAA,EACnD,MAAM;AACR;AAgCO,SAASC,EAAe;AAAA,EAC7B,MAAAC;AAAA,EACA,cAAAC;AAAA,EACA,cAAAC;AAAA,EACA,cAAAC;AAAA,EACA,UAAAC;AAAA,EACA,YAAAC,IAAa;AAAA,EACb,eAAAC,IAAgB;AAAA,EAChB,kBAAAC;AAAA,EACA,MAAAC,IAAOV,EAAsC;AAAA,EAC7C,cAAAW;AAAA,EACA,WA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ACb,OAAOQ;AAAA,YACP,UAAU,CAAC0B,MAAMzB,EAAqByB,EAAE,OAAO,KAAK;AAAA,YACpD,UAAUhC;AAAA,YACV,cAAa;AAAA,YACb,aAAY;AAAA,YACZ,gBAAe;AAAA,YACf,YAAY;AAAA,YACZ,cAAY,QAAQF,CAAY;AAAA,YAChC,WAAU;AAAA,UAAA;AAAA,QAAA;AAAA,MACZ,EAAA,CACF;AAAA,IAAA,GACF;AAAA,IAEA,gBAAAsB,EAAC,OAAA,EAAI,WAAU,8DACb,UAAA;AAAA,MAAA,gBAAAF,EAACM,GAAA,EACC,4BAACC,GAAA,EAAO,SAAQ,aAAY,UAAUzB,GAAY,oBAElD,EAAA,CACF;AAAA,MACA,gBAAAkB;AAAA,QAACO;AAAA,QAAA;AAAA,UACC,SAAQ;AAAA,UACR,SAAST;AAAA,UACT,UAAU,CAACD,KAAef;AAAA,UAC1B,SAASA;AAAA,UAER,UAAAE,KAAoB,UAAUL,CAAY;AAAA,QAAA;AAAA,MAAA;AAAA,IAC7C,EAAA,CACF;AAAA,EAAA,EAAA,CACF,EAAA,CACF;AAEJ;AAEAH,EAAe,cAAc;"}
@@ -2,8 +2,8 @@
2
2
  import { jsx as l } from "react/jsx-runtime";
3
3
  import { c as p } from "./cn-Bhsu1vx2.js";
4
4
  import { forwardRef as I } from "react";
5
- import { F as k } from "./field-V3J0Ql_V.js";
6
- import { I as v } from "./vendor-base-ui-DWIDNgE1.js";
5
+ import { F as k } from "./field-B7ORz5ej.js";
6
+ import { I as v } from "./vendor-base-ui-kX0wjdav.js";
7
7
  const u = {
8
8
  size: {
9
9
  xs: {
@@ -106,4 +106,4 @@ export {
106
106
  u as K,
107
107
  N as i
108
108
  };
109
- //# sourceMappingURL=input-Dqvc2AB_.js.map
109
+ //# sourceMappingURL=input-D6YgDfDG.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"input-Dqvc2AB_.js","sources":["../src/components/input/input.tsx"],"sourcesContent":["import { cn } from \"../../utils/cn\";\nimport {\n forwardRef,\n type ComponentPropsWithoutRef,\n type ReactNode,\n} from \"react\";\nimport { Input as BaseInput } from \"@base-ui/react/input\";\nimport { Field, type FieldErrorMatch } from \"../field/field\";\n\nexport const KUMO_INPUT_VARIANTS = {\n size: {\n xs: {\n classes: \"h-5 gap-1 rounded-sm px-1.5 text-xs\",\n description: \"Extra small input for compact UIs\",\n },\n sm: {\n classes: \"h-6.5 gap-1 rounded-md px-2 text-xs\",\n description: \"Small input for secondary fields\",\n },\n base: {\n classes: \"h-9 gap-1.5 rounded-lg px-3 text-base\",\n description: \"Default input size\",\n },\n lg: {\n classes: \"h-10 gap-2 rounded-lg px-4 text-base\",\n description: \"Large input for prominent fields\",\n },\n },\n variant: {\n default: {\n classes: \"focus:ring-kumo-ring\",\n description: \"Default input appearance\",\n },\n error: {\n classes: \"!ring-kumo-danger focus:ring-kumo-danger\",\n description: \"Error state for validation failures\",\n },\n },\n} as const;\n\nexport const KUMO_INPUT_DEFAULT_VARIANTS = {\n size: \"base\",\n variant: \"default\",\n} as const;\n\nexport const KUMO_INPUT_STYLING = {\n dimensions: {\n xs: { height: 20, paddingX: 6, fontSize: 12, borderRadius: 2, width: 160 },\n sm: { height: 26, paddingX: 8, fontSize: 12, borderRadius: 6, width: 200 },\n base: {\n height: 36,\n paddingX: 12,\n fontSize: 16,\n borderRadius: 8,\n width: 280,\n },\n lg: { height: 40, paddingX: 16, fontSize: 16, borderRadius: 8, width: 320 },\n },\n baseTokens: {\n background: \"color-secondary\",\n text: \"text-color-surface\",\n placeholder: \"text-color-muted\",\n ring: \"color-border\",\n },\n stateTokens: {\n focus: { ring: \"color-active\" },\n error: { ring: \"color-error\" },\n disabled: { opacity: 0.5, text: \"text-color-muted\" },\n },\n} as const;\n\n// Derived types from KUMO_INPUT_VARIANTS\nexport type KumoInputSize = keyof typeof KUMO_INPUT_VARIANTS.size;\nexport type KumoInputVariant = keyof typeof KUMO_INPUT_VARIANTS.variant;\n\nexport interface KumoInputVariantsProps {\n size?: KumoInputSize;\n variant?: KumoInputVariant;\n parentFocusIndicator?: boolean;\n focusIndicator?: boolean;\n}\n\n// Omit native `size` attribute (number) to avoid conflict with our custom `size` variant\ntype BaseInputProps = Omit<ComponentPropsWithoutRef<typeof BaseInput>, \"size\">;\n\nexport function inputVariants({\n variant = KUMO_INPUT_DEFAULT_VARIANTS.variant,\n size = KUMO_INPUT_DEFAULT_VARIANTS.size,\n parentFocusIndicator = false,\n focusIndicator = false,\n}: KumoInputVariantsProps = {}) {\n return cn(\n // Base styles\n \"border-0 bg-kumo-control text-kumo-default ring ring-kumo-line\",\n // Disabled state and placeholder styles\n \"outline-none placeholder:text-kumo-subtle disabled:text-kumo-subtle\",\n // Apply size styles from KUMO_INPUT_VARIANTS\n KUMO_INPUT_VARIANTS.size[size].classes,\n // Apply variant styles from KUMO_INPUT_VARIANTS\n KUMO_INPUT_VARIANTS.variant[variant].classes,\n // Focus state handling\n parentFocusIndicator && \"[&:has(:focus-within)]:ring-kumo-ring\",\n focusIndicator && \"focus:ring-kumo-ring\",\n );\n}\n\nexport const Input = forwardRef<HTMLInputElement, InputProps>((props, ref) => {\n const {\n className,\n size = \"base\",\n variant = \"default\",\n label,\n labelTooltip,\n description,\n error,\n ...inputProps\n } = props;\n\n // Extract required from inputProps to pass to Field for label decoration\n const { required } = inputProps;\n\n // A11y enforcement: warn in dev if no accessible name provided\n if (process.env.NODE_ENV !== \"production\") {\n const hasLabel = Boolean(label);\n const hasPlaceholderAndAriaLabel = Boolean(\n inputProps.placeholder && inputProps[\"aria-label\"],\n );\n const hasAriaLabelledBy = Boolean(inputProps[\"aria-labelledby\"]);\n\n if (!hasLabel && !hasPlaceholderAndAriaLabel && !hasAriaLabelledBy) {\n console.warn(\n \"[Kumo Input]: Input must have an accessible name. Provide either:\\n\" +\n \" - label prop: <Input label='Email' />\\n\" +\n \" - placeholder + aria-label: <Input placeholder='Email' aria-label='Email address' />\\n\" +\n \" - aria-labelledby for custom label association\",\n );\n }\n }\n\n const input = (\n <BaseInput\n ref={ref}\n className={cn(\n inputVariants({ size, variant, focusIndicator: true }),\n className,\n )}\n {...inputProps}\n />\n );\n\n // Render with Field wrapper if label is provided\n if (label) {\n return (\n <Field\n label={label}\n required={required}\n labelTooltip={labelTooltip}\n description={description}\n error={\n error\n ? typeof error === \"string\"\n ? { message: error, match: true }\n : error\n : undefined\n }\n >\n {input}\n </Field>\n );\n }\n\n // Render bare input without Field wrapper\n return input;\n});\n\nInput.displayName = \"Input\";\n\n/**\n * Input component props with accessibility guidance.\n *\n * **Accessible Name Required:** Input should have one of:\n * 1. `label` prop (recommended) - enables Field wrapper with label/description/error\n * 2. `placeholder` + `aria-label` - for bare inputs with visual placeholder\n * 3. `aria-labelledby` - for custom label association\n *\n * Missing accessible names will trigger console warnings in development.\n *\n * @example\n * // Recommended: Built-in Field wrapper\n * <Input label=\"Email\" placeholder=\"you@example.com\" />\n *\n * @example\n * // Bare input with placeholder and aria-label\n * <Input placeholder=\"Search...\" aria-label=\"Search products\" />\n *\n * @example\n * // Custom label association\n * <label id=\"email-label\">Email</label>\n * <Input aria-labelledby=\"email-label\" />\n *\n * @example\n * // With description and error\n * <Input\n * label=\"Password\"\n * description=\"Must be at least 8 characters\"\n * error=\"Password is too short\"\n * variant=\"error\"\n * />\n */\nexport type InputProps = Pick<KumoInputVariantsProps, \"size\" | \"variant\"> &\n BaseInputProps & {\n /** Label content for the input (enables Field wrapper) - can be a string or any React node */\n label?: ReactNode;\n /** Tooltip content to display next to the label via an info icon */\n labelTooltip?: ReactNode;\n /** Helper text displayed below the input */\n description?: ReactNode;\n /** Error message or validation error object */\n error?: string | { message: ReactNode; match: FieldErrorMatch };\n };\n"],"names":["KUMO_INPUT_VARIANTS","KUMO_INPUT_DEFAULT_VARIANTS","inputVariants","variant","size","parentFocusIndicator","focusIndicator","cn","Input","forwardRef","props","ref","className","label","labelTooltip","description","error","inputProps","required","hasLabel","hasPlaceholderAndAriaLabel","hasAriaLabelledBy","input","jsx","BaseInput","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AAQN,GACnBO,IAA6B,GACjCH,EAAW,eAAeA,EAAW,YAAY,IAE7CI,IAAoB,EAAQJ,EAAW,iBAAiB;AAE9D,IAAI,CAACE,KAAY,CAACC,KAA8B,CAACC,KAC/C,QAAQ;AAAA,MACN;AAAA;AAAA;AAAA;AAAA,IAAA;AAAA,EAMN;AAEA,QAAMC,IACJ,gBAAAC;AAAA,IAACC;AAAAA,IAAA;AAAA,MACC,KAAAb;AAAA,MACA,WAAWJ;AAAA,QACTL,EAAc,EAAE,MAAAE,GAAM,SAAAD,GAAS,gBAAgB,IAAM;AAAA,QACrDS;AAAA,MAAA;AAAA,MAED,GAAGK;AAAA,IAAA;AAAA,EAAA;AAKR,SAAIJ,IAEA,gBAAAU;AAAA,IAACE;AAAA,IAAA;AAAA,MACC,OAAAZ;AAAA,MACA,UAAAK;AAAA,MACA,cAAAJ;AAAA,MACA,aAAAC;AAAA,MACA,OACEC,IACI,OAAOA,KAAU,WACf,EAAE,SAASA,GAAO,OAAO,GAAA,IACzBA,IACF;AAAA,MAGL,UAAAM;AAAA,IAAA;AAAA,EAAA,IAMAA;AACT,CAAC;AAEDd,EAAM,cAAc;"}
1
+ {"version":3,"file":"input-D6YgDfDG.js","sources":["../src/components/input/input.tsx"],"sourcesContent":["import { cn } from \"../../utils/cn\";\nimport {\n forwardRef,\n type ComponentPropsWithoutRef,\n type ReactNode,\n} from \"react\";\nimport { Input as BaseInput } from \"@base-ui/react/input\";\nimport { Field, type FieldErrorMatch } from \"../field/field\";\n\nexport const KUMO_INPUT_VARIANTS = {\n size: {\n xs: {\n classes: \"h-5 gap-1 rounded-sm px-1.5 text-xs\",\n description: \"Extra small input for compact UIs\",\n },\n sm: {\n classes: \"h-6.5 gap-1 rounded-md px-2 text-xs\",\n description: \"Small input for secondary fields\",\n },\n base: {\n classes: \"h-9 gap-1.5 rounded-lg px-3 text-base\",\n description: \"Default input size\",\n },\n lg: {\n classes: \"h-10 gap-2 rounded-lg px-4 text-base\",\n description: \"Large input for prominent fields\",\n },\n },\n variant: {\n default: {\n classes: \"focus:ring-kumo-ring\",\n description: \"Default input appearance\",\n },\n error: {\n classes: \"!ring-kumo-danger focus:ring-kumo-danger\",\n description: \"Error state for validation failures\",\n },\n },\n} as const;\n\nexport const KUMO_INPUT_DEFAULT_VARIANTS = {\n size: \"base\",\n variant: \"default\",\n} as const;\n\nexport const KUMO_INPUT_STYLING = {\n dimensions: {\n xs: { height: 20, paddingX: 6, fontSize: 12, borderRadius: 2, width: 160 },\n sm: { height: 26, paddingX: 8, fontSize: 12, borderRadius: 6, width: 200 },\n base: {\n height: 36,\n paddingX: 12,\n fontSize: 16,\n borderRadius: 8,\n width: 280,\n },\n lg: { height: 40, paddingX: 16, fontSize: 16, borderRadius: 8, width: 320 },\n },\n baseTokens: {\n background: \"color-secondary\",\n text: \"text-color-surface\",\n placeholder: \"text-color-muted\",\n ring: \"color-border\",\n },\n stateTokens: {\n focus: { ring: \"color-active\" },\n error: { ring: \"color-error\" },\n disabled: { opacity: 0.5, text: \"text-color-muted\" },\n },\n} as const;\n\n// Derived types from KUMO_INPUT_VARIANTS\nexport type KumoInputSize = keyof typeof KUMO_INPUT_VARIANTS.size;\nexport type KumoInputVariant = keyof typeof KUMO_INPUT_VARIANTS.variant;\n\nexport interface KumoInputVariantsProps {\n size?: KumoInputSize;\n variant?: KumoInputVariant;\n parentFocusIndicator?: boolean;\n focusIndicator?: boolean;\n}\n\n// Omit native `size` attribute (number) to avoid conflict with our custom `size` variant\ntype BaseInputProps = Omit<ComponentPropsWithoutRef<typeof BaseInput>, \"size\">;\n\nexport function inputVariants({\n variant = KUMO_INPUT_DEFAULT_VARIANTS.variant,\n size = KUMO_INPUT_DEFAULT_VARIANTS.size,\n parentFocusIndicator = false,\n focusIndicator = false,\n}: KumoInputVariantsProps = {}) {\n return cn(\n // Base styles\n \"border-0 bg-kumo-control text-kumo-default ring ring-kumo-line\",\n // Disabled state and placeholder styles\n \"outline-none placeholder:text-kumo-subtle disabled:text-kumo-subtle\",\n // Apply size styles from KUMO_INPUT_VARIANTS\n KUMO_INPUT_VARIANTS.size[size].classes,\n // Apply variant styles from KUMO_INPUT_VARIANTS\n KUMO_INPUT_VARIANTS.variant[variant].classes,\n // Focus state handling\n parentFocusIndicator && \"[&:has(:focus-within)]:ring-kumo-ring\",\n focusIndicator && \"focus:ring-kumo-ring\",\n );\n}\n\nexport const Input = forwardRef<HTMLInputElement, InputProps>((props, ref) => {\n const {\n className,\n size = \"base\",\n variant = \"default\",\n label,\n labelTooltip,\n description,\n error,\n ...inputProps\n } = props;\n\n // Extract required from inputProps to pass to Field for label decoration\n const { required } = inputProps;\n\n // A11y enforcement: warn in dev if no accessible name provided\n if (process.env.NODE_ENV !== \"production\") {\n const hasLabel = Boolean(label);\n const hasPlaceholderAndAriaLabel = Boolean(\n inputProps.placeholder && inputProps[\"aria-label\"],\n );\n const hasAriaLabelledBy = Boolean(inputProps[\"aria-labelledby\"]);\n\n if (!hasLabel && !hasPlaceholderAndAriaLabel && !hasAriaLabelledBy) {\n console.warn(\n \"[Kumo Input]: Input must have an accessible name. Provide either:\\n\" +\n \" - label prop: <Input label='Email' />\\n\" +\n \" - placeholder + aria-label: <Input placeholder='Email' aria-label='Email address' />\\n\" +\n \" - aria-labelledby for custom label association\",\n );\n }\n }\n\n const input = (\n <BaseInput\n ref={ref}\n className={cn(\n inputVariants({ size, variant, focusIndicator: true }),\n className,\n )}\n {...inputProps}\n />\n );\n\n // Render with Field wrapper if label is provided\n if (label) {\n return (\n <Field\n label={label}\n required={required}\n labelTooltip={labelTooltip}\n description={description}\n error={\n error\n ? typeof error === \"string\"\n ? { message: error, match: true }\n : error\n : undefined\n }\n >\n {input}\n </Field>\n );\n }\n\n // Render bare input without Field wrapper\n return input;\n});\n\nInput.displayName = \"Input\";\n\n/**\n * Input component props with accessibility guidance.\n *\n * **Accessible Name Required:** Input should have one of:\n * 1. `label` prop (recommended) - enables Field wrapper with label/description/error\n * 2. `placeholder` + `aria-label` - for bare inputs with visual placeholder\n * 3. `aria-labelledby` - for custom label association\n *\n * Missing accessible names will trigger console warnings in development.\n *\n * @example\n * // Recommended: Built-in Field wrapper\n * <Input label=\"Email\" placeholder=\"you@example.com\" />\n *\n * @example\n * // Bare input with placeholder and aria-label\n * <Input placeholder=\"Search...\" aria-label=\"Search products\" />\n *\n * @example\n * // Custom label association\n * <label id=\"email-label\">Email</label>\n * <Input aria-labelledby=\"email-label\" />\n *\n * @example\n * // With description and error\n * <Input\n * label=\"Password\"\n * description=\"Must be at least 8 characters\"\n * error=\"Password is too short\"\n * variant=\"error\"\n * />\n */\nexport type InputProps = Pick<KumoInputVariantsProps, \"size\" | \"variant\"> &\n BaseInputProps & {\n /** Label content for the input (enables Field wrapper) - can be a string or any React node */\n label?: ReactNode;\n /** Tooltip content to display next to the label via an info icon */\n labelTooltip?: ReactNode;\n /** Helper text displayed below the input */\n description?: ReactNode;\n /** Error message or validation error object */\n error?: string | { message: ReactNode; match: FieldErrorMatch };\n };\n"],"names":["KUMO_INPUT_VARIANTS","KUMO_INPUT_DEFAULT_VARIANTS","inputVariants","variant","size","parentFocusIndicator","focusIndicator","cn","Input","forwardRef","props","ref","className","label","labelTooltip","description","error","inputProps","required","hasLabel","hasPlaceholderAndAriaLabel","hasAriaLabelledBy","input","jsx","BaseInput","Field"],"mappings":";;;;;;AASO,MAAMA,IAAsB;AAAA,EACjC,MAAM;AAAA,IACJ,IAAI;AAAA,MACF,SAAS;AAAA,MACT,aAAa;AAAA,IAAA;AAAA,IAEf,IAAI;AAAA,MACF,SAAS;AAAA,MACT,aAAa;AAAA,IAAA;AAAA,IAEf,MAAM;AAAA,MACJ,SAAS;AAAA,MACT,aAAa;AAAA,IAAA;AAAA,IAEf,IAAI;AAAA,MACF,SAAS;AAAA,MACT,aAAa;AAAA,IAAA;AAAA,EACf;AAAA,EAEF,SAAS;AAAA,IACP,SAAS;AAAA,MACP,SAAS;AAAA,MACT,aAAa;AAAA,IAAA;AAAA,IAEf,OAAO;AAAA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;AAKR,SAAIJ,IAEA,gBAAAU;AAAA,IAACE;AAAA,IAAA;AAAA,MACC,OAAAZ;AAAA,MACA,UAAAK;AAAA,MACA,cAAAJ;AAAA,MACA,aAAAC;AAAA,MACA,OACEC,IACI,OAAOA,KAAU,WACf,EAAE,SAASA,GAAO,OAAO,GAAA,IACzBA,IACF;AAAA,MAGL,UAAAM;AAAA,IAAA;AAAA,EAAA,IAMAA;AACT,CAAC;AAEDd,EAAM,cAAc;"}
@@ -1,16 +1,16 @@
1
1
  "use client";
2
2
  import { jsx as i } from "react/jsx-runtime";
3
- import { i as C } from "./input-Dqvc2AB_.js";
3
+ import { i as C } from "./input-D6YgDfDG.js";
4
4
  import { c as b } from "./cn-Bhsu1vx2.js";
5
5
  import * as x from "react";
6
6
  import { useCallback as I } from "react";
7
- import { F as y } from "./field-V3J0Ql_V.js";
7
+ import { F as y } from "./field-B7ORz5ej.js";
8
8
  const N = x.forwardRef(
9
- (c, l) => {
9
+ (l, m) => {
10
10
  const {
11
- className: m,
11
+ className: p,
12
12
  onValueChange: r,
13
- size: p = "base",
13
+ size: c = "base",
14
14
  variant: u = "default",
15
15
  onChange: e,
16
16
  label: t,
@@ -18,7 +18,7 @@ const N = x.forwardRef(
18
18
  description: d,
19
19
  error: a,
20
20
  ...o
21
- } = c, { required: h } = o, g = I(
21
+ } = l, { required: h } = o, g = I(
22
22
  (n) => {
23
23
  e?.(n), r?.(n.target.value);
24
24
  },
@@ -26,12 +26,12 @@ const N = x.forwardRef(
26
26
  ), s = /* @__PURE__ */ i(
27
27
  "textarea",
28
28
  {
29
- ref: l,
29
+ ref: m,
30
30
  className: b(
31
- C({ size: p, variant: u, focusIndicator: !0 }),
31
+ C({ size: c, variant: u, focusIndicator: !0 }),
32
32
  "h-auto py-2",
33
33
  // Input variant always come with size, but it does not apply for textarea
34
- m
34
+ p
35
35
  ),
36
36
  onChange: g,
37
37
  ...o
@@ -54,4 +54,4 @@ N.displayName = "InputArea";
54
54
  export {
55
55
  N as I
56
56
  };
57
- //# sourceMappingURL=input-area-B9qajxvZ.js.map
57
+ //# sourceMappingURL=input-area-DN_Ncliw.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"input-area-B9qajxvZ.js","sources":["../src/components/input/input-area.tsx"],"sourcesContent":["import { inputVariants } from \"./input\";\nimport { cn } from \"../../utils/cn\";\nimport { useCallback, type ReactNode } from \"react\";\nimport * as React from \"react\";\nimport { Field as KumoField, type FieldErrorMatch } from \"../field/field\";\n\nexport const InputArea = React.forwardRef<HTMLTextAreaElement, InputAreaProps>(\n (props, ref) => {\n const {\n className,\n onValueChange,\n size = \"base\",\n variant = \"default\",\n onChange,\n label,\n labelTooltip,\n description,\n error,\n ...inputProps\n } = props;\n\n // Extract required from inputProps to pass to Field for label decoration\n const { required } = inputProps;\n const handleChange = useCallback(\n (event: React.ChangeEvent<HTMLTextAreaElement>) => {\n onChange?.(event);\n onValueChange?.(event.target.value);\n },\n [onChange, onValueChange],\n );\n\n const textarea = (\n <textarea\n ref={ref}\n className={cn(\n inputVariants({ size, variant, focusIndicator: true }),\n \"h-auto py-2\", // Input variant always come with size, but it does not apply for textarea\n className,\n )}\n onChange={handleChange}\n {...inputProps}\n />\n );\n\n // Render with Field wrapper if label is provided\n if (label) {\n return (\n <KumoField\n label={label}\n required={required}\n labelTooltip={labelTooltip}\n description={description}\n error={\n error\n ? typeof error === \"string\"\n ? { message: error, match: true }\n : error\n : undefined\n }\n >\n {textarea}\n </KumoField>\n );\n }\n\n // Render bare textarea without Field wrapper\n return textarea;\n },\n);\n\nInputArea.displayName = \"InputArea\";\n\n/**\n * InputArea component props\n * @property {ReactNode} [label] - Label content for the textarea (enables Field wrapper)\n * @property {ReactNode} [description] - Helper text displayed below the textarea\n * @property {string | { message: ReactNode, match: FieldErrorMatch }} [error] - Error message or validation error object\n */\nexport type InputAreaProps = {\n onValueChange?: (value: string) => void;\n variant?: \"default\" | \"error\";\n size?: \"xs\" | \"sm\" | \"base\" | \"lg\";\n // Then other custom props\n children?: React.ReactNode;\n className?: string;\n /** Label content for the textarea (enables Field wrapper) - can be a string or any React node */\n label?: ReactNode;\n /** Tooltip content to display next to the label via an info icon */\n labelTooltip?: ReactNode;\n /** Helper text displayed below the textarea */\n description?: ReactNode;\n /** Error message or validation error object */\n error?: string | { message: ReactNode; match: FieldErrorMatch };\n\n // Finally, spread the native input props (least important)\n} & Omit<React.TextareaHTMLAttributes<HTMLTextAreaElement>, \"size\">;\n"],"names":["InputArea","React","props","ref","className","onValueChange","size","variant","onChange","label","labelTooltip","description","error","inputProps","required","handleChange","useCallback","event","textarea","jsx","cn","inputVariants","KumoField"],"mappings":";;;;;;;AAMO,MAAMA,IAAYC,EAAM;AAAA,EAC7B,CAACC,GAAOC,MAAQ;AACd,UAAM;AAAA,MACJ,WAAAC;AAAA,MACA,eAAAC;AAAA,MACA,MAAAC,IAAO;AAAA,MACP,SAAAC,IAAU;AAAA,MACV,UAAAC;AAAA,MACA,OAAAC;AAAA,MACA,cAAAC;AAAA,MACA,aAAAC;AAAA,MACA,OAAAC;AAAA,MACA,GAAGC;AAAA,IAAA,IACDX,GAGE,EAAE,UAAAY,MAAaD,GACfE,IAAeC;AAAA,MACnB,CAACC,MAAkD;AACjD,QAAAT,IAAWS,CAAK,GAChBZ,IAAgBY,EAAM,OAAO,KAAK;AAAA,MACpC;AAAA,MACA,CAACT,GAAUH,CAAa;AAAA,IAAA,GAGpBa,IACJ,gBAAAC;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,KAAAhB;AAAA,QACA,WAAWiB;AAAA,UACTC,EAAc,EAAE,MAAAf,GAAM,SAAAC,GAAS,gBAAgB,IAAM;AAAA,UACrD;AAAA;AAAA,UACAH;AAAA,QAAA;AAAA,QAEF,UAAUW;AAAA,QACT,GAAGF;AAAA,MAAA;AAAA,IAAA;AAKR,WAAIJ,IAEA,gBAAAU;AAAA,MAACG;AAAAA,MAAA;AAAA,QACC,OAAAb;AAAA,QACA,UAAAK;AAAA,QACA,cAAAJ;AAAA,QACA,aAAAC;AAAA,QACA,OACEC,IACI,OAAOA,KAAU,WACf,EAAE,SAASA,GAAO,OAAO,GAAA,IACzBA,IACF;AAAA,QAGL,UAAAM;AAAA,MAAA;AAAA,IAAA,IAMAA;AAAA,EACT;AACF;AAEAlB,EAAU,cAAc;"}
1
+ {"version":3,"file":"input-area-DN_Ncliw.js","sources":["../src/components/input/input-area.tsx"],"sourcesContent":["import { inputVariants } from \"./input\";\nimport { cn } from \"../../utils/cn\";\nimport { useCallback, type ReactNode } from \"react\";\nimport * as React from \"react\";\nimport { Field as KumoField, type FieldErrorMatch } from \"../field/field\";\n\nexport const InputArea = React.forwardRef<HTMLTextAreaElement, InputAreaProps>(\n (props, ref) => {\n const {\n className,\n onValueChange,\n size = \"base\",\n variant = \"default\",\n onChange,\n label,\n labelTooltip,\n description,\n error,\n ...inputProps\n } = props;\n\n // Extract required from inputProps to pass to Field for label decoration\n const { required } = inputProps;\n const handleChange = useCallback(\n (event: React.ChangeEvent<HTMLTextAreaElement>) => {\n onChange?.(event);\n onValueChange?.(event.target.value);\n },\n [onChange, onValueChange],\n );\n\n const textarea = (\n <textarea\n ref={ref}\n className={cn(\n inputVariants({ size, variant, focusIndicator: true }),\n \"h-auto py-2\", // Input variant always come with size, but it does not apply for textarea\n className,\n )}\n onChange={handleChange}\n {...inputProps}\n />\n );\n\n // Render with Field wrapper if label is provided\n if (label) {\n return (\n <KumoField\n label={label}\n required={required}\n labelTooltip={labelTooltip}\n description={description}\n error={\n error\n ? typeof error === \"string\"\n ? { message: error, match: true }\n : error\n : undefined\n }\n >\n {textarea}\n </KumoField>\n );\n }\n\n // Render bare textarea without Field wrapper\n return textarea;\n },\n);\n\nInputArea.displayName = \"InputArea\";\n\n/**\n * InputArea component props\n * @property {ReactNode} [label] - Label content for the textarea (enables Field wrapper)\n * @property {ReactNode} [description] - Helper text displayed below the textarea\n * @property {string | { message: ReactNode, match: FieldErrorMatch }} [error] - Error message or validation error object\n */\nexport type InputAreaProps = {\n onValueChange?: (value: string) => void;\n variant?: \"default\" | \"error\";\n size?: \"xs\" | \"sm\" | \"base\" | \"lg\";\n // Then other custom props\n children?: React.ReactNode;\n className?: string;\n /** Label content for the textarea (enables Field wrapper) - can be a string or any React node */\n label?: ReactNode;\n /** Tooltip content to display next to the label via an info icon */\n labelTooltip?: ReactNode;\n /** Helper text displayed below the textarea */\n description?: ReactNode;\n /** Error message or validation error object */\n error?: string | { message: ReactNode; match: FieldErrorMatch };\n\n // Finally, spread the native input props (least important)\n} & Omit<React.TextareaHTMLAttributes<HTMLTextAreaElement>, \"size\">;\n"],"names":["InputArea","React","props","ref","className","onValueChange","size","variant","onChange","label","labelTooltip","description","error","inputProps","required","handleChange","useCallback","event","textarea","jsx","cn","inputVariants","KumoField"],"mappings":";;;;;;;AAMO,MAAMA,IAAYC,EAAM;AAAA,EAC7B,CAACC,GAAOC,MAAQ;AACd,UAAM;AAAA,MACJ,WAAAC;AAAA,MACA,eAAAC;AAAA,MACA,MAAAC,IAAO;AAAA,MACP,SAAAC,IAAU;AAAA,MACV,UAAAC;AAAA,MACA,OAAAC;AAAA,MACA,cAAAC;AAAA,MACA,aAAAC;AAAA,MACA,OAAAC;AAAA,MACA,GAAGC;AAAA,IAAA,IACDX,GAGE,EAAE,UAAAY,MAAaD,GACfE,IAAeC;AAAA,MACnB,CAACC,MAAkD;AACjD,QAAAT,IAAWS,CAAK,GAChBZ,IAAgBY,EAAM,OAAO,KAAK;AAAA,MACpC;AAAA,MACA,CAACT,GAAUH,CAAa;AAAA,IAAA,GAGpBa,IACJ,gBAAAC;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,KAAAhB;AAAA,QACA,WAAWiB;AAAA,UACTC,EAAc,EAAE,MAAAf,GAAM,SAAAC,GAAS,gBAAgB,IAAM;AAAA,UACrD;AAAA;AAAA,UACAH;AAAA,QAAA;AAAA,QAEF,UAAUW;AAAA,QACT,GAAGF;AAAA,MAAA;AAAA,IAAA;AAKR,WAAIJ,IAEA,gBAAAU;AAAA,MAACG;AAAAA,MAAA;AAAA,QACC,OAAAb;AAAA,QACA,UAAAK;AAAA,QACA,cAAAJ;AAAA,QACA,aAAAC;AAAA,QACA,OACEC,IACI,OAAOA,KAAU,WACf,EAAE,SAASA,GAAO,OAAO,GAAA,IACzBA,IACF;AAAA,QAGL,UAAAM;AAAA,MAAA;AAAA,IAAA,IAMAA;AAAA,EACT;AACF;AAEAlB,EAAU,cAAc;"}