@cloudflare/kumo 1.18.0 → 1.19.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 (228) hide show
  1. package/CHANGELOG.md +90 -0
  2. package/ai/component-registry.json +174 -66
  3. package/ai/component-registry.md +836 -503
  4. package/ai/schemas.ts +19 -3
  5. package/dist/.build-complete +1 -1
  6. package/dist/ai/schemas.d.ts +55 -8
  7. package/dist/ai/schemas.d.ts.map +1 -1
  8. package/dist/ai/schemas.js +163 -146
  9. package/dist/ai/schemas.js.map +1 -1
  10. package/dist/chunks/{Legend-o0ntojbaplmszwk0.js → Legend-ks7se6149vsa3tze.js} +127 -118
  11. package/dist/chunks/Legend-ks7se6149vsa3tze.js.map +1 -0
  12. package/dist/chunks/{breadcrumbs-k39s28qx05vbxxth.js → breadcrumbs-ge20hcb3o5spswrk.js} +2 -2
  13. package/dist/chunks/{breadcrumbs-k39s28qx05vbxxth.js.map → breadcrumbs-ge20hcb3o5spswrk.js.map} +1 -1
  14. package/dist/chunks/{button-cdxnqcgzwko8ooha.js → button-oaqi7ykdisyskoos.js} +12 -12
  15. package/dist/chunks/button-oaqi7ykdisyskoos.js.map +1 -0
  16. package/dist/chunks/{checkbox-kt1uojk2f9e0d0h1.js → checkbox-mwgmohffm22ut13s.js} +5 -5
  17. package/dist/chunks/checkbox-mwgmohffm22ut13s.js.map +1 -0
  18. package/dist/chunks/{clipboard-text-vcbvmtne4zjk4b18.js → clipboard-text-dxczqon3d27xp6f0.js} +10 -10
  19. package/dist/chunks/{clipboard-text-vcbvmtne4zjk4b18.js.map → clipboard-text-dxczqon3d27xp6f0.js.map} +1 -1
  20. package/dist/chunks/{cloudflare-logo-bgts2jgsdh7sslw4.js → cloudflare-logo-pbavoe1wu8nr5c4n.js} +9 -9
  21. package/dist/chunks/{cloudflare-logo-bgts2jgsdh7sslw4.js.map → cloudflare-logo-pbavoe1wu8nr5c4n.js.map} +1 -1
  22. package/dist/chunks/{combobox-he2hd9e2ruknq5mp.js → combobox-eaowwt1xr4d23gsn.js} +113 -101
  23. package/dist/chunks/combobox-eaowwt1xr4d23gsn.js.map +1 -0
  24. package/dist/chunks/{command-palette-jc1w07jwakxvj23a.js → command-palette-maqtbmpfev9mysqd.js} +19 -19
  25. package/dist/chunks/command-palette-maqtbmpfev9mysqd.js.map +1 -0
  26. package/dist/chunks/{dialog-oqh8l3l3zutpibxx.js → dialog-e3m5bhs7fds26p9y.js} +25 -25
  27. package/dist/chunks/dialog-e3m5bhs7fds26p9y.js.map +1 -0
  28. package/dist/chunks/{dropdown-ncwhcd912vmone8k.js → dropdown-ewte287db3vyt8t5.js} +94 -92
  29. package/dist/chunks/{dropdown-ncwhcd912vmone8k.js.map → dropdown-ewte287db3vyt8t5.js.map} +1 -1
  30. package/dist/chunks/{empty-cj898km1r8xwuw44.js → empty-dr1eckm2z40euns6.js} +2 -2
  31. package/dist/chunks/{empty-cj898km1r8xwuw44.js.map → empty-dr1eckm2z40euns6.js.map} +1 -1
  32. package/dist/chunks/{field-krp6z6vfbkrvufz2.js → field-bo5gmna16odrrb1q.js} +3 -3
  33. package/dist/chunks/{field-krp6z6vfbkrvufz2.js.map → field-bo5gmna16odrrb1q.js.map} +1 -1
  34. package/dist/chunks/{grid-m9r71jxo2b8q1972.js → grid-hj1ylz16p7g5uelh.js} +2 -2
  35. package/dist/chunks/{grid-m9r71jxo2b8q1972.js.map → grid-hj1ylz16p7g5uelh.js.map} +1 -1
  36. package/dist/chunks/{input-area-no30c09udyjxshu5.js → input-area-jkkkjej6luumrqpa.js} +4 -4
  37. package/dist/chunks/{input-area-no30c09udyjxshu5.js.map → input-area-jkkkjej6luumrqpa.js.map} +1 -1
  38. package/dist/chunks/{input-h48k3uagzrgb98au.js → input-cw05pbqdburghkus.js} +31 -31
  39. package/dist/chunks/input-cw05pbqdburghkus.js.map +1 -0
  40. package/dist/chunks/{input-group-lxdd09p60cf27pe1.js → input-group-lfugneuz71g42n0w.js} +6 -6
  41. package/dist/chunks/input-group-lfugneuz71g42n0w.js.map +1 -0
  42. package/dist/chunks/label-cvyvbqmt4mt757ff.js +68 -0
  43. package/dist/chunks/{label-latndvb1ngem7we8.js.map → label-cvyvbqmt4mt757ff.js.map} +1 -1
  44. package/dist/chunks/layer-card-ljqth3yxgnk04v2o.js +46 -0
  45. package/dist/chunks/layer-card-ljqth3yxgnk04v2o.js.map +1 -0
  46. package/dist/chunks/{link-hn5ejal7nhh0o0b4.js → link-fjnhtxvfe5ieamjf.js} +2 -2
  47. package/dist/chunks/{link-hn5ejal7nhh0o0b4.js.map → link-fjnhtxvfe5ieamjf.js.map} +1 -1
  48. package/dist/chunks/menubar-e5e4zwfagr0wx023.js +96 -0
  49. package/dist/chunks/menubar-e5e4zwfagr0wx023.js.map +1 -0
  50. package/dist/chunks/{meter-gfa1hz9fhjnvx784.js → meter-duj3micor1lqj3y2.js} +2 -2
  51. package/dist/chunks/{meter-gfa1hz9fhjnvx784.js.map → meter-duj3micor1lqj3y2.js.map} +1 -1
  52. package/dist/chunks/pagination-olaypvwr8swsmn8m.js +266 -0
  53. package/dist/chunks/pagination-olaypvwr8swsmn8m.js.map +1 -0
  54. package/dist/chunks/{popover-h300w4vit0s2ayej.js → popover-nv9cmzbo7mf6bky0.js} +70 -74
  55. package/dist/chunks/popover-nv9cmzbo7mf6bky0.js.map +1 -0
  56. package/dist/chunks/{radio-jouttv89lbvhs55r.js → radio-ihxbe37us2jnqtzf.js} +5 -5
  57. package/dist/chunks/radio-ihxbe37us2jnqtzf.js.map +1 -0
  58. package/dist/chunks/select-nx6ded5swra74iar.js +213 -0
  59. package/dist/chunks/select-nx6ded5swra74iar.js.map +1 -0
  60. package/dist/chunks/{sensitive-input-hd4tpqkzifad1yca.js → sensitive-input-00fujb510rrn61v9.js} +4 -4
  61. package/dist/chunks/{sensitive-input-hd4tpqkzifad1yca.js.map → sensitive-input-00fujb510rrn61v9.js.map} +1 -1
  62. package/dist/chunks/{sidebar-hljy3ssm8itc0ucx.js → sidebar-ltbfius1eolkl8tb.js} +22 -26
  63. package/dist/chunks/sidebar-ltbfius1eolkl8tb.js.map +1 -0
  64. package/dist/chunks/surface-dfgurg5eu3et4vw1.js +29 -0
  65. package/dist/chunks/surface-dfgurg5eu3et4vw1.js.map +1 -0
  66. package/dist/chunks/{switch-ihaydbzem62bey4p.js → switch-fbv3iawqo3o3jgap.js} +17 -17
  67. package/dist/chunks/switch-fbv3iawqo3o3jgap.js.map +1 -0
  68. package/dist/chunks/table-of-contents-f813ivi7ta23vqdm.js +88 -0
  69. package/dist/chunks/table-of-contents-f813ivi7ta23vqdm.js.map +1 -0
  70. package/dist/chunks/table-olwwulga2l3hdwlx.js +189 -0
  71. package/dist/chunks/table-olwwulga2l3hdwlx.js.map +1 -0
  72. package/dist/chunks/{tabs-e7eh7l3mpk3xgmwq.js → tabs-lohcglgppp6gj0hp.js} +4 -4
  73. package/dist/chunks/{tabs-e7eh7l3mpk3xgmwq.js.map → tabs-lohcglgppp6gj0hp.js.map} +1 -1
  74. package/dist/chunks/{toast-bpz6iaq54u9jmuu8.js → toast-dg52x89yd231mxhe.js} +4 -4
  75. package/dist/chunks/{toast-bpz6iaq54u9jmuu8.js.map → toast-dg52x89yd231mxhe.js.map} +1 -1
  76. package/dist/chunks/{tooltip-belkznz8t8333h5f.js → tooltip-hikjvdbg3xghnq1x.js} +38 -37
  77. package/dist/chunks/tooltip-hikjvdbg3xghnq1x.js.map +1 -0
  78. package/dist/chunks/{vendor-base-ui-k7bzesq81ie36nya.js → vendor-base-ui-m5pz3e8c4grg5qmj.js} +21 -21
  79. package/dist/chunks/{vendor-base-ui-k7bzesq81ie36nya.js.map → vendor-base-ui-m5pz3e8c4grg5qmj.js.map} +1 -1
  80. package/dist/code.js +1 -1
  81. package/dist/components/breadcrumbs.js +1 -1
  82. package/dist/components/button.js +1 -1
  83. package/dist/components/chart.js +1 -1
  84. package/dist/components/checkbox.js +1 -1
  85. package/dist/components/clipboard-text.js +1 -1
  86. package/dist/components/cloudflare-logo.js +1 -1
  87. package/dist/components/combobox.js +1 -1
  88. package/dist/components/command-palette.js +1 -1
  89. package/dist/components/dialog.js +1 -1
  90. package/dist/components/dropdown.js +1 -1
  91. package/dist/components/empty.js +1 -1
  92. package/dist/components/field.js +1 -1
  93. package/dist/components/flow.js +2 -2
  94. package/dist/components/flow.js.map +1 -1
  95. package/dist/components/grid.js +1 -1
  96. package/dist/components/input.js +3 -3
  97. package/dist/components/label.js +1 -1
  98. package/dist/components/layer-card.js +1 -1
  99. package/dist/components/link.js +1 -1
  100. package/dist/components/menubar.js +1 -1
  101. package/dist/components/meter.js +1 -1
  102. package/dist/components/pagination.js +1 -1
  103. package/dist/components/popover.js +1 -1
  104. package/dist/components/radio.js +1 -1
  105. package/dist/components/select.js +1 -1
  106. package/dist/components/sensitive-input.js +1 -1
  107. package/dist/components/sidebar.js +1 -1
  108. package/dist/components/surface.js +1 -1
  109. package/dist/components/switch.js +1 -1
  110. package/dist/components/table-of-contents.js +8 -0
  111. package/dist/components/table-of-contents.js.map +1 -0
  112. package/dist/components/table.js +1 -1
  113. package/dist/components/tabs.js +1 -1
  114. package/dist/components/toast.js +2 -2
  115. package/dist/components/tooltip.js +1 -1
  116. package/dist/index.js +124 -120
  117. package/dist/index.js.map +1 -1
  118. package/dist/primitives/accordion.js +1 -1
  119. package/dist/primitives/alert-dialog.js +1 -1
  120. package/dist/primitives/autocomplete.js +1 -1
  121. package/dist/primitives/avatar.js +1 -1
  122. package/dist/primitives/button.js +1 -1
  123. package/dist/primitives/checkbox-group.js +1 -1
  124. package/dist/primitives/checkbox.js +1 -1
  125. package/dist/primitives/collapsible.js +1 -1
  126. package/dist/primitives/combobox.js +1 -1
  127. package/dist/primitives/context-menu.js +1 -1
  128. package/dist/primitives/csp-provider.js +1 -1
  129. package/dist/primitives/dialog.js +1 -1
  130. package/dist/primitives/direction-provider.js +1 -1
  131. package/dist/primitives/drawer.js +1 -1
  132. package/dist/primitives/field.js +1 -1
  133. package/dist/primitives/fieldset.js +1 -1
  134. package/dist/primitives/form.js +1 -1
  135. package/dist/primitives/input.js +1 -1
  136. package/dist/primitives/menu.js +1 -1
  137. package/dist/primitives/menubar.js +1 -1
  138. package/dist/primitives/meter.js +1 -1
  139. package/dist/primitives/navigation-menu.js +1 -1
  140. package/dist/primitives/number-field.js +1 -1
  141. package/dist/primitives/popover.js +1 -1
  142. package/dist/primitives/preview-card.js +1 -1
  143. package/dist/primitives/progress.js +1 -1
  144. package/dist/primitives/radio-group.js +1 -1
  145. package/dist/primitives/radio.js +1 -1
  146. package/dist/primitives/scroll-area.js +1 -1
  147. package/dist/primitives/select.js +1 -1
  148. package/dist/primitives/separator.js +1 -1
  149. package/dist/primitives/slider.js +1 -1
  150. package/dist/primitives/switch.js +1 -1
  151. package/dist/primitives/tabs.js +1 -1
  152. package/dist/primitives/toast.js +1 -1
  153. package/dist/primitives/toggle-group.js +1 -1
  154. package/dist/primitives/toggle.js +1 -1
  155. package/dist/primitives/toolbar.js +1 -1
  156. package/dist/primitives/tooltip.js +1 -1
  157. package/dist/primitives.js +1 -1
  158. package/dist/scripts/theme-generator/config.d.ts.map +1 -1
  159. package/dist/scripts/theme-generator/config.js +3 -3
  160. package/dist/scripts/theme-generator/config.js.map +1 -1
  161. package/dist/src/components/button/button.d.ts +1 -1
  162. package/dist/src/components/button/button.d.ts.map +1 -1
  163. package/dist/src/components/chart/EChart.d.ts +18 -2
  164. package/dist/src/components/chart/EChart.d.ts.map +1 -1
  165. package/dist/src/components/chart/TimeseriesChart.d.ts.map +1 -1
  166. package/dist/src/components/chart/index.d.ts +1 -1
  167. package/dist/src/components/chart/index.d.ts.map +1 -1
  168. package/dist/src/components/combobox/combobox.d.ts +16 -2
  169. package/dist/src/components/combobox/combobox.d.ts.map +1 -1
  170. package/dist/src/components/dropdown/dropdown.d.ts.map +1 -1
  171. package/dist/src/components/input/input.d.ts.map +1 -1
  172. package/dist/src/components/label/label.d.ts.map +1 -1
  173. package/dist/src/components/layer-card/layer-card.d.ts +39 -5
  174. package/dist/src/components/layer-card/layer-card.d.ts.map +1 -1
  175. package/dist/src/components/menubar/menubar.d.ts.map +1 -1
  176. package/dist/src/components/pagination/pagination.d.ts +51 -1
  177. package/dist/src/components/pagination/pagination.d.ts.map +1 -1
  178. package/dist/src/components/popover/popover.d.ts +35 -8
  179. package/dist/src/components/popover/popover.d.ts.map +1 -1
  180. package/dist/src/components/radio/radio.d.ts +1 -1
  181. package/dist/src/components/select/select.d.ts +49 -5
  182. package/dist/src/components/select/select.d.ts.map +1 -1
  183. package/dist/src/components/sidebar/sidebar.d.ts +2 -2
  184. package/dist/src/components/sidebar/sidebar.d.ts.map +1 -1
  185. package/dist/src/components/surface/index.d.ts +3 -0
  186. package/dist/src/components/surface/index.d.ts.map +1 -1
  187. package/dist/src/components/surface/surface.d.ts +14 -10
  188. package/dist/src/components/surface/surface.d.ts.map +1 -1
  189. package/dist/src/components/table/table.d.ts.map +1 -1
  190. package/dist/src/components/table-of-contents/index.d.ts +2 -0
  191. package/dist/src/components/table-of-contents/index.d.ts.map +1 -0
  192. package/dist/src/components/table-of-contents/table-of-contents.d.ts +70 -0
  193. package/dist/src/components/table-of-contents/table-of-contents.d.ts.map +1 -0
  194. package/dist/src/components/tooltip/tooltip.d.ts +15 -6
  195. package/dist/src/components/tooltip/tooltip.d.ts.map +1 -1
  196. package/dist/src/index.d.ts +6 -2
  197. package/dist/src/index.d.ts.map +1 -1
  198. package/dist/styles/kumo-binding.css +1 -0
  199. package/dist/styles/kumo-standalone.css +1 -1
  200. package/dist/styles/theme-kumo.css +6 -6
  201. package/package.json +5 -1
  202. package/scripts/theme-generator/config.ts +8 -6
  203. package/dist/chunks/Legend-o0ntojbaplmszwk0.js.map +0 -1
  204. package/dist/chunks/button-cdxnqcgzwko8ooha.js.map +0 -1
  205. package/dist/chunks/checkbox-kt1uojk2f9e0d0h1.js.map +0 -1
  206. package/dist/chunks/combobox-he2hd9e2ruknq5mp.js.map +0 -1
  207. package/dist/chunks/command-palette-jc1w07jwakxvj23a.js.map +0 -1
  208. package/dist/chunks/dialog-oqh8l3l3zutpibxx.js.map +0 -1
  209. package/dist/chunks/input-group-lxdd09p60cf27pe1.js.map +0 -1
  210. package/dist/chunks/input-h48k3uagzrgb98au.js.map +0 -1
  211. package/dist/chunks/label-latndvb1ngem7we8.js +0 -62
  212. package/dist/chunks/layer-card-l5yjvrxry1dhte57.js +0 -44
  213. package/dist/chunks/layer-card-l5yjvrxry1dhte57.js.map +0 -1
  214. package/dist/chunks/menubar-f1pilzooe5mue7c4.js +0 -92
  215. package/dist/chunks/menubar-f1pilzooe5mue7c4.js.map +0 -1
  216. package/dist/chunks/pagination-cu5lm6p5dxuycta4.js +0 -243
  217. package/dist/chunks/pagination-cu5lm6p5dxuycta4.js.map +0 -1
  218. package/dist/chunks/popover-h300w4vit0s2ayej.js.map +0 -1
  219. package/dist/chunks/radio-jouttv89lbvhs55r.js.map +0 -1
  220. package/dist/chunks/select-kva5ru5f673kah1m.js +0 -179
  221. package/dist/chunks/select-kva5ru5f673kah1m.js.map +0 -1
  222. package/dist/chunks/sidebar-hljy3ssm8itc0ucx.js.map +0 -1
  223. package/dist/chunks/surface-cilvbyhmyujz1bee.js +0 -36
  224. package/dist/chunks/surface-cilvbyhmyujz1bee.js.map +0 -1
  225. package/dist/chunks/switch-ihaydbzem62bey4p.js.map +0 -1
  226. package/dist/chunks/table-inweecadl3her7pd.js +0 -183
  227. package/dist/chunks/table-inweecadl3her7pd.js.map +0 -1
  228. package/dist/chunks/tooltip-belkznz8t8333h5f.js.map +0 -1
@@ -2,11 +2,11 @@
2
2
  import { jsx as e, jsxs as m } from "react/jsx-runtime";
3
3
  import { forwardRef as y, createContext as j, useContext as A } from "react";
4
4
  import { c as o } from "./cn-ct4n7r74mh8y0f48.js";
5
- import { R as I, P as C, Q as G, bn as k, bo as b } from "./vendor-base-ui-k7bzesq81ie36nya.js";
5
+ import { R as I, P as C, Q as G, bn as k, bo as b } from "./vendor-base-ui-m5pz3e8c4grg5qmj.js";
6
6
  const x = {
7
7
  variant: {
8
8
  default: {
9
- classes: "ring-kumo-line",
9
+ classes: "ring-kumo-hairline",
10
10
  description: "Default radio appearance"
11
11
  },
12
12
  error: {
@@ -76,7 +76,7 @@ const N = j({
76
76
  disabled: a,
77
77
  className: o(
78
78
  "relative mt-0.5 flex h-4 w-4 shrink-0 items-center justify-center rounded-full border-0 bg-kumo-base ring",
79
- r === "error" ? "ring-kumo-danger" : "ring-kumo-line",
79
+ r === "error" ? "ring-kumo-danger" : "ring-kumo-hairline",
80
80
  !a && r !== "error" && "group-hover:ring-kumo-hairline focus-visible:ring-kumo-hairline focus-visible:outline-offset-3",
81
81
  !a && r === "error" && "focus-visible:ring-kumo-danger focus-visible:outline-offset-3",
82
82
  "data-[checked]:bg-kumo-contrast"
@@ -113,7 +113,7 @@ const N = j({
113
113
  disabled: a,
114
114
  className: o(
115
115
  "relative flex h-4 w-4 items-center justify-center rounded-full border-0 bg-kumo-base ring after:absolute after:-inset-x-3 after:-inset-y-2",
116
- r === "error" ? "ring-kumo-danger" : "ring-kumo-line",
116
+ r === "error" ? "ring-kumo-danger" : "ring-kumo-hairline",
117
117
  !a && r !== "error" && "group-hover:ring-kumo-hairline focus-visible:ring-kumo-hairline focus-visible:outline-offset-3",
118
118
  !a && r === "error" && "focus-visible:ring-kumo-danger focus-visible:outline-offset-3",
119
119
  "data-[checked]:bg-kumo-contrast"
@@ -194,4 +194,4 @@ export {
194
194
  v as b,
195
195
  M as r
196
196
  };
197
- //# sourceMappingURL=radio-jouttv89lbvhs55r.js.map
197
+ //# sourceMappingURL=radio-ihxbe37us2jnqtzf.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"radio-ihxbe37us2jnqtzf.js","sources":["../../src/components/radio/radio.tsx"],"sourcesContent":["import { forwardRef, createContext, useContext, type ReactNode } from \"react\";\nimport { cn } from \"../../utils/cn\";\nimport { Fieldset } from \"@base-ui/react/fieldset\";\nimport { RadioGroup as BaseRadioGroup } from \"@base-ui/react/radio-group\";\nimport { Radio as BaseRadio } from \"@base-ui/react/radio\";\n\n/** Radio variant definitions mapping variant names to their Tailwind classes. */\nexport const KUMO_RADIO_VARIANTS = {\n variant: {\n default: {\n classes: \"ring-kumo-hairline\",\n description: \"Default radio appearance\",\n },\n error: {\n classes: \"ring-kumo-danger\",\n description: \"Error state for validation failures\",\n },\n },\n appearance: {\n default: {\n classes: \"\",\n description: \"Standard inline radio item\",\n },\n card: {\n classes:\n \"rounded-lg border border-kumo-hairline bg-kumo-base p-3 transition-colors hover:bg-kumo-tint has-[[data-checked]]:border-kumo-interact has-[[data-checked]]:bg-kumo-tint\",\n description:\n \"Choice card appearance with border, padding, and highlighted selection state\",\n },\n },\n} as const;\n\nexport const KUMO_RADIO_DEFAULT_VARIANTS = {\n variant: \"default\",\n appearance: \"default\",\n} as const;\n\n// Derived types from KUMO_RADIO_VARIANTS\nexport type KumoRadioVariant = keyof typeof KUMO_RADIO_VARIANTS.variant;\nexport type KumoRadioAppearance = keyof typeof KUMO_RADIO_VARIANTS.appearance;\n\nexport interface KumoRadioVariantsProps {\n /**\n * Visual variant.\n * - `\"default\"` — Standard radio appearance\n * - `\"error\"` — Error state for validation failures\n * @default \"default\"\n */\n variant?: KumoRadioVariant;\n /**\n * Visual appearance.\n * - `\"default\"` — Standard inline radio item\n * - `\"card\"` — Choice card with border, padding, and highlighted selection state\n * @default \"default\"\n */\n appearance?: KumoRadioAppearance;\n}\n\nexport function radioVariants({\n variant = KUMO_RADIO_DEFAULT_VARIANTS.variant,\n appearance = KUMO_RADIO_DEFAULT_VARIANTS.appearance,\n}: KumoRadioVariantsProps = {}) {\n return cn(\n KUMO_RADIO_VARIANTS.variant[variant].classes,\n KUMO_RADIO_VARIANTS.appearance[appearance].classes,\n );\n}\n\n// Legacy type alias for backwards compatibility\nexport type RadioVariant = KumoRadioVariant;\n\n/** Position of the radio control relative to its label */\nexport type RadioControlPosition = \"start\" | \"end\";\n\n// Context for passing controlPosition and appearance from Group to Items\nconst RadioGroupContext = createContext<{\n controlPosition: RadioControlPosition;\n appearance: KumoRadioAppearance;\n}>({\n controlPosition: \"start\",\n appearance: \"default\",\n});\n\n/**\n * Radio group component props (with built-in Fieldset and RadioGroup)\n *\n * @example\n * // Basic usage\n * ```tsx\n * <Radio.Group legend=\"Notification preference\" defaultValue=\"email\">\n * <Radio.Item label=\"Email\" value=\"email\" />\n * <Radio.Item label=\"SMS\" value=\"sms\" />\n * <Radio.Item label=\"Push\" value=\"push\" />\n * </Radio.Group>\n * ```\n *\n * @example\n * // Horizontal layout\n * ```tsx\n * <Radio.Group legend=\"Size\" orientation=\"horizontal\" defaultValue=\"md\">\n * <Radio.Item label=\"Small\" value=\"sm\" />\n * <Radio.Item label=\"Medium\" value=\"md\" />\n * <Radio.Item label=\"Large\" value=\"lg\" />\n * </Radio.Group>\n * ```\n *\n * @example\n * // With error and description\n * ```tsx\n * <Radio.Group\n * legend=\"Payment method\"\n * error=\"Please select a payment method\"\n * description=\"Choose how you'd like to pay\"\n * >\n * <Radio.Item label=\"Credit Card\" value=\"card\" />\n * <Radio.Item label=\"PayPal\" value=\"paypal\" />\n * </Radio.Group>\n * ```\n *\n * @example\n * // Controlled\n * ```tsx\n * const [value, setValue] = useState(\"email\");\n * <Radio.Group legend=\"Contact\" value={value} onValueChange={setValue}>\n * <Radio.Item label=\"Email\" value=\"email\" />\n * <Radio.Item label=\"Phone\" value=\"phone\" />\n * </Radio.Group>\n * ```\n *\n * @example\n * // Label before radio (controlPosition=\"end\")\n * ```tsx\n * <Radio.Group legend=\"Options\" controlPosition=\"end\" defaultValue=\"a\">\n * <Radio.Item label=\"Option A\" value=\"a\" />\n * <Radio.Item label=\"Option B\" value=\"b\" />\n * </Radio.Group>\n * ```\n */\nexport interface RadioGroupProps {\n /** Legend text for the group (required for accessibility) */\n legend: string;\n /** Child Radio.Item components */\n children: ReactNode;\n /** Layout direction of the radio items */\n orientation?: \"vertical\" | \"horizontal\";\n /**\n * Visual appearance applied to all Radio.Item children.\n * - `\"default\"` — Standard inline radio items\n * - `\"card\"` — Choice card with border, padding, and highlighted selection state\n *\n * Individual items can override this with their own `appearance` prop.\n * @default \"default\"\n */\n appearance?: KumoRadioAppearance;\n /** Error message for the group */\n error?: string;\n /** Helper text for the group */\n description?: ReactNode;\n /** Value of the radio that should be initially selected (uncontrolled) */\n defaultValue?: string;\n /** Value of the radio that should be selected (controlled) */\n value?: string;\n /** Event handler called when radio value changes */\n onValueChange?: (value: string) => void;\n /** Whether all radios in the group are disabled */\n disabled?: boolean;\n /** Position of radio control relative to label: \"start\" (default) puts radio before label, \"end\" puts label before radio. Note: In card appearance, the control is always positioned at the end. */\n controlPosition?: RadioControlPosition;\n /** Form submission name for the radio group */\n name?: string;\n /** Additional CSS classes */\n className?: string;\n}\n\n/**\n * Individual radio item within a group\n *\n * @example\n * ```tsx\n * <Radio.Item label=\"Option A\" value=\"a\" />\n * ```\n *\n * @example\n * // Disabled item\n * ```tsx\n * <Radio.Item label=\"Unavailable\" value=\"unavailable\" disabled />\n * ```\n */\nexport type RadioItemProps = {\n /** Visual variant: \"default\" or \"error\" for validation failures */\n variant?: RadioVariant;\n /**\n * Visual appearance of the radio item.\n * - `\"default\"` — Standard inline radio item\n * - `\"card\"` — Choice card with border, padding, and highlighted selection state\n *\n * When set on an individual item, overrides the group-level `appearance`.\n * @default \"default\"\n */\n appearance?: KumoRadioAppearance;\n /** Label text displayed next to radio (required) */\n label: string;\n /** Description text displayed below the label (only visible in card appearance) */\n description?: ReactNode;\n /** Value of the radio (required) */\n value: string;\n /** Additional CSS classes for the label wrapper */\n className?: string;\n /** Whether the radio is disabled */\n disabled?: boolean;\n};\n\n// Radio.Item for use within Radio.Group\nconst RadioItem = forwardRef<HTMLButtonElement, RadioItemProps>(\n (\n {\n className,\n disabled,\n variant = \"default\",\n appearance: appearanceProp,\n label,\n description,\n value,\n },\n ref,\n ) => {\n const { controlPosition, appearance: groupAppearance } =\n useContext(RadioGroupContext);\n const appearance = appearanceProp ?? groupAppearance;\n const isCard = appearance === \"card\";\n\n // In card mode, default to \"end\" (radio on the right); otherwise follow group setting\n const effectiveControlPosition = isCard ? \"end\" : controlPosition;\n\n if (isCard) {\n return (\n <label\n className={cn(\n \"m-0 group relative flex items-start gap-3 rounded-lg border border-kumo-hairline bg-kumo-base p-3 transition-colors has-[[data-checked]]:border-kumo-interact has-[[data-checked]]:bg-kumo-tint\",\n variant === \"error\" &&\n \"border-kumo-danger has-[[data-checked]]:border-kumo-danger has-[[data-checked]]:bg-kumo-base\",\n disabled\n ? \"cursor-not-allowed opacity-50\"\n : cn(\n \"has-[[data-disabled]]:cursor-not-allowed has-[[data-disabled]]:opacity-50 cursor-pointer\",\n variant !== \"error\" &&\n \"hover:not-has-[[data-disabled]]:bg-kumo-tint\",\n ),\n className,\n )}\n >\n <div className=\"flex min-w-0 flex-1 flex-col gap-0.5\">\n <span className=\"text-base font-medium text-kumo-default\">\n {label}\n </span>\n {description && (\n <span className=\"text-sm text-kumo-subtle\">{description}</span>\n )}\n </div>\n <BaseRadio.Root\n ref={ref}\n value={value}\n disabled={disabled}\n className={cn(\n \"relative mt-0.5 flex h-4 w-4 shrink-0 items-center justify-center rounded-full border-0 bg-kumo-base ring\",\n variant === \"error\" ? \"ring-kumo-danger\" : \"ring-kumo-hairline\",\n !disabled &&\n variant !== \"error\" &&\n \"group-hover:ring-kumo-hairline focus-visible:ring-kumo-hairline focus-visible:outline-offset-3\",\n !disabled &&\n variant === \"error\" &&\n \"focus-visible:ring-kumo-danger focus-visible:outline-offset-3\",\n \"data-[checked]:bg-kumo-contrast\",\n )}\n >\n <BaseRadio.Indicator\n keepMounted\n className=\"flex items-center justify-center\"\n >\n <span className=\"h-2 w-2 rounded-full bg-kumo-base\" />\n </BaseRadio.Indicator>\n </BaseRadio.Root>\n </label>\n );\n }\n\n return (\n <label\n className={cn(\n \"m-0 group relative inline-flex items-center gap-2\",\n // \"start\" (default): radio before label\n // \"end\": label before radio using flex-row-reverse\n effectiveControlPosition === \"end\" && \"flex-row-reverse justify-end\",\n disabled ? \"cursor-not-allowed opacity-50\" : \"cursor-pointer\",\n className,\n )}\n >\n <BaseRadio.Root\n ref={ref}\n value={value}\n disabled={disabled}\n className={cn(\n \"relative flex h-4 w-4 items-center justify-center rounded-full border-0 bg-kumo-base ring after:absolute after:-inset-x-3 after:-inset-y-2\",\n variant === \"error\" ? \"ring-kumo-danger\" : \"ring-kumo-hairline\",\n !disabled &&\n variant !== \"error\" &&\n \"group-hover:ring-kumo-hairline focus-visible:ring-kumo-hairline focus-visible:outline-offset-3\",\n !disabled &&\n variant === \"error\" &&\n \"focus-visible:ring-kumo-danger focus-visible:outline-offset-3\",\n \"data-[checked]:bg-kumo-contrast\",\n )}\n >\n <BaseRadio.Indicator\n keepMounted\n className=\"flex items-center justify-center\"\n >\n <span className=\"h-2 w-2 rounded-full bg-kumo-base\" />\n </BaseRadio.Indicator>\n </BaseRadio.Root>\n <span className=\"text-base text-kumo-default\">{label}</span>\n </label>\n );\n },\n);\n\nRadioItem.displayName = \"Radio.Item\";\n\n// Radio.Group with built-in Fieldset and RadioGroup\nfunction RadioGroup({\n legend,\n children,\n orientation = \"vertical\",\n appearance = \"default\",\n error,\n description,\n defaultValue,\n value,\n onValueChange,\n disabled,\n controlPosition = \"start\",\n name,\n className,\n}: RadioGroupProps) {\n return (\n <RadioGroupContext.Provider value={{ controlPosition, appearance }}>\n <BaseRadioGroup\n defaultValue={defaultValue}\n value={value}\n onValueChange={(newValue) => onValueChange?.(newValue)}\n disabled={disabled}\n name={name}\n >\n <Fieldset.Root\n disabled={disabled}\n className={cn(\"flex flex-col gap-4\", className)}\n >\n <Fieldset.Legend className=\"text-base font-medium text-kumo-default\">\n {legend}\n </Fieldset.Legend>\n <div\n className={cn(\n orientation === \"vertical\"\n ? cn(\"flex flex-col\", appearance === \"card\" ? \"gap-3\" : \"gap-2\")\n : appearance === \"card\"\n ? \"grid grid-cols-2 gap-3\"\n : \"flex flex-row flex-wrap gap-2\",\n )}\n >\n {children}\n </div>\n {error && <p className=\"text-sm text-kumo-danger\">{error}</p>}\n {description && (\n <p className=\"text-sm text-kumo-subtle\">{description}</p>\n )}\n </Fieldset.Root>\n </BaseRadioGroup>\n </RadioGroupContext.Provider>\n );\n}\n\nRadioGroup.displayName = \"Radio.Group\";\n\n// Export RadioGroup directly for external usage\nexport { RadioGroup };\n\n/**\n * Radio — radio button group for single-select choices.\n *\n * Compound component: `Radio.Group` (with built-in Fieldset) and `Radio.Item`.\n * Built on `@base-ui/react/radio-group` + `@base-ui/react/radio`.\n *\n * @example\n * ```tsx\n * <Radio.Group legend=\"Notification preference\" defaultValue=\"email\">\n * <Radio.Item label=\"Email\" value=\"email\" />\n * <Radio.Item label=\"SMS\" value=\"sms\" />\n * <Radio.Item label=\"Push\" value=\"push\" />\n * </Radio.Group>\n * ```\n */\nexport const Radio = Object.assign(RadioGroup, {\n Item: RadioItem,\n Group: RadioGroup,\n});\n"],"names":["KUMO_RADIO_VARIANTS","KUMO_RADIO_DEFAULT_VARIANTS","radioVariants","variant","appearance","cn","RadioGroupContext","createContext","RadioItem","forwardRef","className","disabled","appearanceProp","label","description","value","ref","controlPosition","groupAppearance","useContext","isCard","effectiveControlPosition","jsxs","jsx","BaseRadio.Root","BaseRadio.Indicator","RadioGroup","legend","children","orientation","error","defaultValue","onValueChange","name","BaseRadioGroup","newValue","Fieldset.Root","Fieldset.Legend","Radio"],"mappings":";;;;;AAOO,MAAMA,IAAsB;AAAA,EACjC,SAAS;AAAA,IACP,SAAS;AAAA,MACP,SAAS;AAAA,MACT,aAAa;AAAA,IAAA;AAAA,IAEf,OAAO;AAAA,MACL,SAAS;AAAA,MACT,aAAa;AAAA,IAAA;AAAA,EACf;AAAA,EAEF,YAAY;AAAA,IACV,SAAS;AAAA,MACP,SAAS;AAAA,MACT,aAAa;AAAA,IAAA;AAAA,IAEf,MAAM;AAAA,MACJ,SACE;AAAA,MACF,aACE;AAAA,IAAA;AAAA,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AAA,EACN,OAAOkB;AACT,CAAC;"}
@@ -0,0 +1,213 @@
1
+ "use client";
2
+ import { jsxs as u, jsx as t } from "react/jsx-runtime";
3
+ import { CaretUpDownIcon as R, CheckIcon as B } from "@phosphor-icons/react";
4
+ import { useId as W, forwardRef as f } from "react";
5
+ import { c as o } from "./cn-ct4n7r74mh8y0f48.js";
6
+ import { b as X } from "./button-oaqi7ykdisyskoos.js";
7
+ import { K as Y } from "./input-cw05pbqdburghkus.js";
8
+ import { S as Z } from "./skeleton-line-epxenksfesr2fkcv.js";
9
+ import { F as q } from "./field-bo5gmna16odrrb1q.js";
10
+ import { u as H } from "./portal-provider-hwmkdmkpvct0cb76.js";
11
+ import { aX as J, aY as Q, aZ as ee, a_ as ae, a$ as te, b0 as se, b1 as le, b2 as oe, b3 as ne, b4 as ie, b5 as re, b6 as ce, b7 as de, S as me } from "./vendor-base-ui-m5pz3e8c4grg5qmj.js";
12
+ Y.size;
13
+ const I = {
14
+ size: "base"
15
+ };
16
+ function ue({
17
+ size: e = I.size
18
+ } = {}) {
19
+ return o(
20
+ X({ size: e }),
21
+ "justify-between font-normal",
22
+ "focus:opacity-100 focus-visible:ring-1 focus-visible:ring-kumo-hairline *:in-focus:opacity-100"
23
+ );
24
+ }
25
+ const k = {
26
+ xs: { iconSize: 12, className: "text-kumo-subtle" },
27
+ sm: { iconSize: 14, className: "text-kumo-subtle" },
28
+ base: { iconSize: 16, className: "text-kumo-subtle" },
29
+ lg: { iconSize: 18, className: "text-kumo-subtle" }
30
+ };
31
+ function L(e) {
32
+ if (e == null || typeof e != "object" || Array.isArray(e) || "$$typeof" in e || e instanceof Promise) return !1;
33
+ const s = e;
34
+ return "label" in s && s.label !== void 0;
35
+ }
36
+ function w(e) {
37
+ return Array.isArray(e) ? e : Object.entries(e).map(([s, l]) => ({
38
+ value: s,
39
+ label: L(l) ? l.label : l
40
+ }));
41
+ }
42
+ function be(e) {
43
+ const s = w(e), l = /* @__PURE__ */ new Map();
44
+ if (!Array.isArray(e))
45
+ for (const [a, r] of Object.entries(e))
46
+ L(r) && l.set(a, { disabled: r.disabled });
47
+ return s.filter((a) => a.value !== null).map((a, r) => {
48
+ const c = typeof a.value == "string" ? a.value : `option-${r}`, m = typeof a.value == "string" ? l.get(a.value) : void 0;
49
+ return /* @__PURE__ */ t(z, { value: a.value, disabled: m?.disabled, children: a.label }, c);
50
+ });
51
+ }
52
+ function d({
53
+ children: e,
54
+ className: s,
55
+ renderValue: l,
56
+ label: a,
57
+ hideLabel: r,
58
+ placeholder: c,
59
+ loading: m,
60
+ size: b = I.size,
61
+ labelTooltip: F,
62
+ description: p,
63
+ error: n,
64
+ required: G,
65
+ container: _,
66
+ ...i
67
+ }) {
68
+ const h = W(), j = H(), P = _ ?? j ?? void 0, S = i, T = S["aria-label"], E = S["aria-labelledby"], U = typeof a == "string" ? a : c;
69
+ process.env.NODE_ENV !== "production" && r !== void 0 && console.warn(
70
+ '[Kumo Select]: `hideLabel` is deprecated. For hidden labels, use `aria-label` instead of `label` + `hideLabel={true}`.\n Migration:\n - For visible labels: <Select label="Country" /> (hideLabel no longer needed)\n - For hidden labels: <Select aria-label="Select a country" /> (remove label and hideLabel)'
71
+ );
72
+ const g = a && r !== !0, y = g ? void 0 : E ?? (a ? h : void 0), V = T ?? (y ? void 0 : U), $ = i.items ? w(i.items) : void 0, D = e || (i.items ? be(i.items) : null), K = l ? (v) => v == null ? c == null ? null : /* @__PURE__ */ t("span", { className: "text-kumo-placeholder", children: c }) : l(v) : void 0, { items: pe, ...M } = i, x = /* @__PURE__ */ u(
73
+ J,
74
+ {
75
+ ...M,
76
+ items: $,
77
+ disabled: m || i.disabled,
78
+ children: [
79
+ /* @__PURE__ */ u(
80
+ Q,
81
+ {
82
+ className: o(
83
+ ue({ size: b }),
84
+ i.disabled && "cursor-not-allowed opacity-50",
85
+ s
86
+ ),
87
+ "aria-label": V,
88
+ "aria-labelledby": y,
89
+ children: [
90
+ m ? /* @__PURE__ */ t(Z, { className: "w-32" }) : /* @__PURE__ */ t(
91
+ ee,
92
+ {
93
+ placeholder: c,
94
+ className: "min-w-0 truncate data-[placeholder]:text-kumo-placeholder",
95
+ children: K
96
+ }
97
+ ),
98
+ /* @__PURE__ */ t(
99
+ ae,
100
+ {
101
+ className: o(
102
+ "flex shrink-0 items-center",
103
+ k[b].className
104
+ ),
105
+ children: /* @__PURE__ */ t(
106
+ R,
107
+ {
108
+ size: k[b].iconSize,
109
+ className: "fill-current"
110
+ }
111
+ )
112
+ }
113
+ )
114
+ ]
115
+ }
116
+ ),
117
+ /* @__PURE__ */ t(te, { container: P, children: /* @__PURE__ */ t(se, { children: /* @__PURE__ */ t(
118
+ le,
119
+ {
120
+ className: o(
121
+ "flex flex-col",
122
+ "max-h-[var(--available-height)] bg-kumo-base text-kumo-default",
123
+ "rounded-lg shadow-lg ring ring-kumo-line",
124
+ "min-w-[calc(var(--anchor-width)+3px)] py-1.5"
125
+ ),
126
+ children: /* @__PURE__ */ t(
127
+ oe,
128
+ {
129
+ className: o(
130
+ "min-h-0 flex-1 overflow-y-auto overscroll-none scroll-pt-2 scroll-pb-2"
131
+ ),
132
+ children: D
133
+ }
134
+ )
135
+ }
136
+ ) }) })
137
+ ]
138
+ }
139
+ );
140
+ if (g)
141
+ return /* @__PURE__ */ t(
142
+ q,
143
+ {
144
+ label: a,
145
+ required: G,
146
+ labelTooltip: F,
147
+ description: p,
148
+ error: n ? typeof n == "string" ? { message: n, match: !0 } : n : void 0,
149
+ children: x
150
+ }
151
+ );
152
+ const N = n ? typeof n == "string" ? { message: n } : n : void 0;
153
+ return /* @__PURE__ */ u("div", { className: "grid gap-2", children: [
154
+ a && /* @__PURE__ */ t("span", { id: h, className: "sr-only", children: a }),
155
+ x,
156
+ N ? /* @__PURE__ */ t("span", { className: "text-sm text-kumo-danger", children: N.message }) : p && /* @__PURE__ */ t("span", { className: "text-sm leading-snug text-kumo-subtle", children: p })
157
+ ] });
158
+ }
159
+ function z({ children: e, value: s, disabled: l, className: a }) {
160
+ return /* @__PURE__ */ u(
161
+ ne,
162
+ {
163
+ value: s,
164
+ disabled: l,
165
+ className: o(
166
+ "group mx-1.5 flex cursor-pointer items-center justify-between gap-2 rounded px-2 py-1.5 text-base data-highlighted:bg-kumo-tint",
167
+ "data-[disabled]:pointer-events-none data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50",
168
+ a
169
+ ),
170
+ children: [
171
+ /* @__PURE__ */ t(ie, { children: e }),
172
+ /* @__PURE__ */ t(re, { children: /* @__PURE__ */ t(B, {}) })
173
+ ]
174
+ }
175
+ );
176
+ }
177
+ const A = f(
178
+ ({ children: e, className: s }, l) => /* @__PURE__ */ t(ce, { ref: l, className: o(s), children: e })
179
+ );
180
+ A.displayName = "Select.Group";
181
+ const O = f(
182
+ ({ children: e, className: s }, l) => /* @__PURE__ */ t(
183
+ de,
184
+ {
185
+ ref: l,
186
+ className: o(
187
+ "px-3.5 py-1.5 text-sm font-semibold text-kumo-subtle",
188
+ s
189
+ ),
190
+ children: e
191
+ }
192
+ )
193
+ );
194
+ O.displayName = "Select.GroupLabel";
195
+ const C = f(
196
+ ({ className: e }, s) => /* @__PURE__ */ t(
197
+ me,
198
+ {
199
+ ref: s,
200
+ className: o("-mx-1 my-1 h-px bg-kumo-hairline", e)
201
+ }
202
+ )
203
+ );
204
+ C.displayName = "Select.Separator";
205
+ d.Option = z;
206
+ d.Group = A;
207
+ d.GroupLabel = O;
208
+ d.Separator = C;
209
+ d.Option.displayName = "Select.Option";
210
+ export {
211
+ d as S
212
+ };
213
+ //# sourceMappingURL=select-nx6ded5swra74iar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"select-nx6ded5swra74iar.js","sources":["../../src/components/select/select.tsx"],"sourcesContent":["import { Select as SelectBase } from \"@base-ui/react/select\";\nimport { CaretUpDownIcon, CheckIcon } from \"@phosphor-icons/react\";\nimport { forwardRef, useId } from \"react\";\nimport type { ReactNode } from \"react\";\nimport { cn } from \"../../utils/cn\";\nimport { buttonVariants } from \"../button\";\nimport { KUMO_INPUT_VARIANTS, type KumoInputSize } from \"../input/input\";\nimport { SkeletonLine } from \"../loader\";\nimport { Field, type FieldErrorMatch } from \"../field/field\";\nimport {\n usePortalContainer,\n type PortalContainer,\n} from \"../../utils/portal-provider\";\n\n/** Select variant definitions. */\nexport const KUMO_SELECT_VARIANTS = {\n size: KUMO_INPUT_VARIANTS.size,\n} as const;\n\nexport const KUMO_SELECT_DEFAULT_VARIANTS = {\n size: \"base\",\n} as const;\n\n/**\n * Select component styling metadata for Figma plugin code generation\n * Extracted from select.tsx implementation (source of truth)\n */\nexport const KUMO_SELECT_STYLING = {\n trigger: {\n height: 36, // h-9\n paddingX: 12, // px-3\n borderRadius: 8, // rounded-lg\n background: \"color-secondary\",\n text: \"text-color-surface\",\n ring: \"color-border\",\n fontSize: 16, // text-base\n fontWeight: 400, // font-normal\n },\n stateTokens: {\n focus: { ring: \"color-active\" },\n disabled: { opacity: 0.5 },\n },\n icons: {\n caret: { name: \"ph-caret-up-down\", size: 20 },\n check: { name: \"ph-check\", size: 20 },\n },\n popup: {\n background: \"color-secondary\",\n ring: \"color-border\",\n borderRadius: 8, // rounded-lg\n padding: 6, // p-1.5\n },\n option: {\n paddingX: 8, // px-2\n paddingY: 6, // py-1.5\n borderRadius: 4, // rounded\n fontSize: 16, // text-base\n highlightBackground: \"color-surface-secondary\",\n },\n} as const;\n\n// Derived types from KUMO_SELECT_VARIANTS\nexport type KumoSelectSize = keyof typeof KUMO_SELECT_VARIANTS.size;\n\nexport interface KumoSelectVariantsProps {\n /**\n * Size of the select trigger. Matches Input component sizes.\n * - `\"xs\"` — Extra small for compact UIs (h-5 / 20px)\n * - `\"sm\"` — Small for secondary fields (h-6.5 / 26px)\n * - `\"base\"` — Default size (h-9 / 36px)\n * - `\"lg\"` — Large for prominent fields (h-10 / 40px)\n * @default \"base\"\n */\n size?: KumoSelectSize;\n}\n\nexport function selectVariants({\n size = KUMO_SELECT_DEFAULT_VARIANTS.size,\n}: KumoSelectVariantsProps = {}) {\n return cn(\n buttonVariants({ size }),\n \"justify-between font-normal\",\n \"focus:opacity-100 focus-visible:ring-1 focus-visible:ring-kumo-hairline *:in-focus:opacity-100\",\n );\n}\n\nconst triggerIconStyles: Record<\n KumoInputSize,\n { iconSize: number; className: string }\n> = {\n xs: { iconSize: 12, className: \"text-kumo-subtle\" },\n sm: { iconSize: 14, className: \"text-kumo-subtle\" },\n base: { iconSize: 16, className: \"text-kumo-subtle\" },\n lg: { iconSize: 18, className: \"text-kumo-subtle\" },\n};\n\n/**\n * Shape for items that carry extra metadata (disabled state, tooltip).\n * Plain `ReactNode` values are still supported for backward compatibility.\n */\nexport interface SelectItemDescriptor {\n /** Display label for the option. */\n label: ReactNode;\n /** When `true`, the option cannot be selected. */\n disabled?: boolean;\n}\n\n/** Value type accepted by the `items` object-map prop. */\nexport type SelectItemValue = ReactNode | SelectItemDescriptor;\n\nfunction isItemDescriptor(\n value: SelectItemValue,\n): value is SelectItemDescriptor {\n if (value === null || value === undefined) return false;\n if (typeof value !== \"object\" || Array.isArray(value)) return false;\n // React elements have $$typeof — exclude them\n if (\"$$typeof\" in (value as object)) return false;\n // Promises are not descriptors\n if (value instanceof Promise) return false;\n // Must have a defined label (not just the key existing)\n const candidate = value as unknown as Record<string, unknown>;\n return \"label\" in candidate && candidate.label !== undefined;\n}\n\n/**\n * Normalizes items to array format for Base UI.\n * Object maps are converted to array format so Base UI can properly\n * handle value matching and placeholder display.\n */\nfunction normalizeItems<T>(\n items:\n | Record<string, SelectItemValue>\n | ReadonlyArray<{ label: ReactNode; value: T }>,\n): ReadonlyArray<{ label: ReactNode; value: T }> {\n if (Array.isArray(items)) {\n return items;\n }\n // Convert object map to array format\n return Object.entries(items).map(([key, entry]) => ({\n value: key as T,\n label: isItemDescriptor(entry) ? entry.label : entry,\n }));\n}\n\n/**\n * Auto-generates Select.Option elements from items prop.\n * Only used when children are not explicitly provided.\n * Filters out null values (typically used for placeholders).\n */\nfunction renderOptionsFromItems<T>(\n items:\n | Record<string, SelectItemValue>\n | ReadonlyArray<{ label: ReactNode; value: T }>,\n): ReactNode {\n const normalizedItems = normalizeItems(items);\n\n // Build a lookup for disabled metadata from object-map items.\n // Object-map keys are always strings (Record<string, ...>), so the lookup\n // uses string keys. The array form ({ label, value }[]) does not support\n // descriptors — consumers should use the children API for that case.\n const disabledLookup = new Map<string, { disabled?: boolean }>();\n if (!Array.isArray(items)) {\n for (const [key, entry] of Object.entries(items)) {\n if (isItemDescriptor(entry)) {\n disabledLookup.set(key, { disabled: entry.disabled });\n }\n }\n }\n\n // Filter out null values and render options\n return normalizedItems\n .filter((item) => item.value !== null)\n .map((item, index) => {\n const key =\n typeof item.value === \"string\" ? item.value : `option-${index}`;\n // When items is an object-map, value is always a string key from\n // Object.entries. When items is an array, disabledLookup is empty.\n const meta =\n typeof item.value === \"string\"\n ? disabledLookup.get(item.value)\n : undefined;\n\n return (\n <Option key={key} value={item.value} disabled={meta?.disabled}>\n {item.label}\n </Option>\n );\n });\n}\n\ntype SelectPropsGeneric<T, Multiple extends boolean | undefined = false> = Omit<\n SelectBase.Root.Props<T, Multiple>,\n \"items\"\n> &\n KumoSelectVariantsProps & {\n multiple?: Multiple;\n /**\n * A function that returns a `ReactNode` to format the selected value.\n * Only called when a value is selected — use `placeholder` for the empty state.\n * @example\n * ```tsx\n * <Select\n * placeholder=\"Select a user...\"\n * renderValue={(user) => user.name}\n * />\n * ```\n */\n renderValue?: (value: Multiple extends true ? T[] : T) => ReactNode;\n className?: string;\n /**\n * Data structure of items rendered in the popup.\n * Accepts a plain object map (`{ key: \"Label\" }`) or an array of `{ label, value }`.\n *\n * Object-map values can be a `ReactNode` (backward-compatible) **or** a\n * `SelectItemDescriptor` for extra metadata:\n *\n * ```tsx\n * items={{\n * apple: \"Apple\",\n * banana: { label: \"Banana\", disabled: true, disabledReason: \"Out of season\" },\n * }}\n * ```\n */\n items?:\n | Record<string, SelectItemValue>\n | ReadonlyArray<{ label: ReactNode; value: T }>;\n /**\n * Label content for the select.\n * When provided, enables the Field wrapper with a visible label.\n * For accessibility without a visible label, use `aria-label` instead.\n */\n label?: ReactNode;\n /**\n * @deprecated Use `aria-label` for hidden labels instead of `label` + `hideLabel={true}`.\n * When `label` is provided without `hideLabel`, the label is now visible by default (matching Input behavior).\n * This prop will be removed in a future version.\n */\n hideLabel?: boolean;\n placeholder?: string;\n loading?: boolean;\n /** Tooltip content to display next to the label via an info icon */\n labelTooltip?: ReactNode;\n /** Helper text displayed below the select */\n description?: ReactNode;\n /** Error message or validation error object */\n error?: string | { message: ReactNode; match: FieldErrorMatch };\n /**\n * Container element for the portal. Use this to render the select inside\n * a Shadow DOM or custom container. Overrides `KumoPortalProvider` context.\n * @default document.body (or KumoPortalProvider container if set)\n */\n container?: PortalContainer;\n };\n\n/**\n * Select component props.\n *\n * **Accessible Name Required:** Select should have one of:\n * 1. `label` prop (recommended) - enables Field wrapper with visible label\n * 2. `aria-label` - for selects without visible label (accessibility-only)\n * 3. `aria-labelledby` - for custom label association\n *\n * @example\n * ```tsx\n * // With visible label (recommended)\n * <Select label=\"Country\" onValueChange={setValue}>\n * <Select.Option value=\"us\">United States</Select.Option>\n * <Select.Option value=\"uk\">United Kingdom</Select.Option>\n * </Select>\n *\n * // Without visible label (use aria-label for accessibility)\n * <Select aria-label=\"Select a country\" onValueChange={setValue}>\n * <Select.Option value=\"us\">United States</Select.Option>\n * </Select>\n * ```\n */\nexport interface SelectProps {\n /** Additional CSS classes merged via `cn()`. */\n className?: string;\n /** Size of the select trigger. Matches Input component sizes. */\n size?: KumoSelectSize;\n /**\n * Label content for the select.\n * When provided, enables the Field wrapper with a visible label above the select.\n * For accessibility without a visible label, use `aria-label` instead.\n */\n label?: ReactNode;\n /**\n * @deprecated Use `aria-label` for hidden labels instead of `label` + `hideLabel={true}`.\n * When `label` is provided without `hideLabel`, the label is now visible by default (matching Input behavior).\n * This prop will be removed in a future version.\n */\n hideLabel?: boolean;\n /** Placeholder text shown when no value is selected. */\n placeholder?: string;\n /** When `true`, shows a skeleton loader in place of the selected value. */\n loading?: boolean;\n /** Whether the select is disabled. */\n disabled?: boolean;\n /** Whether the select is required. When `false`, shows \"(optional)\" text. */\n required?: boolean;\n /** Tooltip content displayed next to the label via an info icon. */\n labelTooltip?: ReactNode;\n /** Currently selected value (controlled mode). */\n value?: unknown;\n /** Initial value for uncontrolled mode. */\n defaultValue?: unknown;\n /** Callback fired when the selected value changes. */\n onValueChange?: (value: unknown) => void;\n /** Enable multi-select mode. */\n multiple?: boolean;\n /** `Select.Option` elements to render in the dropdown. */\n children?: ReactNode;\n /** Helper text displayed below the select. */\n description?: ReactNode;\n /** Error message string or validation error object with `match` key. */\n error?: string | { message: ReactNode; match: FieldErrorMatch };\n}\n\n/**\n * Select.Option component props.\n */\nexport interface SelectOptionProps {\n /** The option content. */\n children: ReactNode;\n /** The value associated with this option. */\n value: unknown;\n /** When `true`, the option cannot be selected. */\n disabled?: boolean;\n /** Additional CSS classes merged via `cn()`. */\n className?: string;\n}\n\n/**\n * Dropdown for selecting a value from a list of options.\n * Wraps Base UI Select with Kumo styling and optional Field integration.\n *\n * @example\n * ```tsx\n * <Select label=\"Fruit\" onValueChange={setFruit}>\n * <Select.Option value=\"apple\">Apple</Select.Option>\n * <Select.Option value=\"banana\">Banana</Select.Option>\n * </Select>\n * ```\n */\nexport function Select<T, Multiple extends boolean | undefined = false>({\n children,\n className,\n renderValue,\n label,\n hideLabel,\n placeholder,\n loading,\n size = KUMO_SELECT_DEFAULT_VARIANTS.size,\n labelTooltip,\n description,\n error,\n required,\n container: containerProp,\n ...props\n}: SelectPropsGeneric<T, Multiple> & { required?: boolean }) {\n const labelId = useId();\n const contextContainer = usePortalContainer();\n const container = containerProp ?? contextContainer ?? undefined;\n const propLookup = props as Record<string, unknown>;\n const ariaLabel = propLookup[\"aria-label\"] as string | undefined;\n const ariaLabelledby = propLookup[\"aria-labelledby\"] as string | undefined;\n // For aria-label, use string label or placeholder (ReactNode labels can't be used for aria-label)\n const fallbackLabel = typeof label === \"string\" ? label : placeholder;\n\n // Deprecation warning for hideLabel\n if (process.env.NODE_ENV !== \"production\" && hideLabel !== undefined) {\n console.warn(\n \"[Kumo Select]: `hideLabel` is deprecated. For hidden labels, use `aria-label` instead of `label` + `hideLabel={true}`.\\n\" +\n \" Migration:\\n\" +\n ' - For visible labels: <Select label=\"Country\" /> (hideLabel no longer needed)\\n' +\n ' - For hidden labels: <Select aria-label=\"Select a country\" /> (remove label and hideLabel)',\n );\n }\n\n // New behavior: label presence determines Field wrapper visibility (like Input)\n // hideLabel is only respected for backward compatibility when explicitly set to true\n const useFieldWrapper = label && hideLabel !== true;\n const triggerLabelledBy = useFieldWrapper\n ? undefined\n : (ariaLabelledby ?? (label ? labelId : undefined));\n const triggerAriaLabel =\n ariaLabel ?? (!triggerLabelledBy ? fallbackLabel : undefined);\n\n // Normalize items to array format for Base UI compatibility\n // This fixes placeholder not showing with object map items\n const normalizedItems = props.items ? normalizeItems(props.items) : undefined;\n\n // Auto-render children from items if no explicit children provided\n const renderedChildren = children\n ? children\n : props.items\n ? renderOptionsFromItems(props.items)\n : null;\n\n // Wrap renderValue to handle null values properly:\n // - When value is null, show placeholder (Base UI ignores placeholder when children fn provided)\n // - When value is non-null, call user's renderValue\n const valueChildrenFn = renderValue\n ? (value: unknown) => {\n if (value == null) {\n // If no placeholder provided, return null to show nothing (same as no renderValue)\n if (placeholder == null) {\n return null;\n }\n return <span className=\"text-kumo-placeholder\">{placeholder}</span>;\n }\n // Cast through `any` as a deliberate type boundary: Base UI passes `unknown`,\n // but our renderValue expects the generic T (or T[] for multiple)\n return renderValue(value as any);\n }\n : undefined;\n\n // Exclude Kumo-extended `items` from Base UI spread — we pass `normalizedItems` instead\n const { items: _items, ...baseProps } = props;\n\n const selectControl = (\n <SelectBase.Root\n {...baseProps}\n items={normalizedItems}\n disabled={loading || props.disabled}\n >\n <SelectBase.Trigger\n className={cn(\n selectVariants({ size }),\n props.disabled && \"cursor-not-allowed opacity-50\",\n className,\n )}\n aria-label={triggerAriaLabel}\n aria-labelledby={triggerLabelledBy}\n >\n {loading ? (\n <SkeletonLine className=\"w-32\" />\n ) : (\n <SelectBase.Value\n placeholder={placeholder}\n className=\"min-w-0 truncate data-[placeholder]:text-kumo-placeholder\"\n >\n {valueChildrenFn}\n </SelectBase.Value>\n )}\n <SelectBase.Icon\n className={cn(\n \"flex shrink-0 items-center\",\n triggerIconStyles[size].className,\n )}\n >\n <CaretUpDownIcon\n size={triggerIconStyles[size].iconSize}\n className=\"fill-current\"\n />\n </SelectBase.Icon>\n </SelectBase.Trigger>\n <SelectBase.Portal container={container}>\n <SelectBase.Positioner>\n <SelectBase.Popup\n className={cn(\n \"flex flex-col\",\n \"max-h-[var(--available-height)] bg-kumo-base text-kumo-default\",\n \"rounded-lg shadow-lg ring ring-kumo-line\",\n \"min-w-[calc(var(--anchor-width)+3px)] py-1.5\",\n )}\n >\n <SelectBase.List\n className={cn(\n \"min-h-0 flex-1 overflow-y-auto overscroll-none scroll-pt-2 scroll-pb-2\",\n )}\n >\n {renderedChildren}\n </SelectBase.List>\n </SelectBase.Popup>\n </SelectBase.Positioner>\n </SelectBase.Portal>\n </SelectBase.Root>\n );\n\n // Use Field wrapper when label is provided and not hidden\n if (useFieldWrapper) {\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 {selectControl}\n </Field>\n );\n }\n\n // Render with standalone label when label is hidden (sr-only)\n // Still show description/error for accessibility and UX\n const normalizedError = error\n ? typeof error === \"string\"\n ? { message: error, match: true as const }\n : error\n : undefined;\n\n return (\n <div className=\"grid gap-2\">\n {label && (\n <span id={labelId} className=\"sr-only\">\n {label}\n </span>\n )}\n {selectControl}\n {normalizedError ? (\n <span className=\"text-sm text-kumo-danger\">\n {normalizedError.message}\n </span>\n ) : (\n description && (\n <span className=\"text-sm leading-snug text-kumo-subtle\">\n {description}\n </span>\n )\n )}\n </div>\n );\n}\n\ntype OptionProps<T> = {\n children: ReactNode;\n value: T;\n /** When `true`, the option cannot be selected. */\n disabled?: boolean;\n /** Additional CSS classes merged via `cn()`. */\n className?: string;\n};\n\nfunction Option<T>({ children, value, disabled, className }: OptionProps<T>) {\n return (\n <SelectBase.Item\n value={value}\n disabled={disabled}\n className={cn(\n \"group mx-1.5 flex cursor-pointer items-center justify-between gap-2 rounded px-2 py-1.5 text-base data-highlighted:bg-kumo-tint\",\n \"data-[disabled]:pointer-events-none data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50\",\n className,\n )}\n >\n <SelectBase.ItemText>{children}</SelectBase.ItemText>\n <SelectBase.ItemIndicator>\n <CheckIcon />\n </SelectBase.ItemIndicator>\n </SelectBase.Item>\n );\n}\n\n// --- Select.Group ---\n\ntype GroupProps = {\n children: ReactNode;\n /** Additional CSS classes merged via `cn()`. */\n className?: string;\n};\n\n/**\n * Groups related options together with an accessible `role=\"group\"`.\n * Use with `Select.GroupLabel` to provide a visible heading for the group.\n *\n * @example\n * ```tsx\n * <Select.Group>\n * <Select.GroupLabel>Fruits</Select.GroupLabel>\n * <Select.Option value=\"apple\">Apple</Select.Option>\n * </Select.Group>\n * ```\n */\nconst Group = forwardRef<HTMLDivElement, GroupProps>(\n ({ children, className }, ref) => (\n <SelectBase.Group ref={ref} className={cn(className)}>\n {children}\n </SelectBase.Group>\n ),\n);\nGroup.displayName = \"Select.Group\";\n\n// --- Select.GroupLabel ---\n\ntype GroupLabelProps = {\n children: ReactNode;\n /** Additional CSS classes merged via `cn()`. */\n className?: string;\n};\n\n/**\n * A visible heading for a `Select.Group`.\n * Automatically associated with its parent group for accessibility.\n *\n * @example\n * ```tsx\n * <Select.Group>\n * <Select.GroupLabel>Available</Select.GroupLabel>\n * <Select.Option value=\"a\">Option A</Select.Option>\n * </Select.Group>\n * ```\n */\nconst GroupLabel = forwardRef<HTMLDivElement, GroupLabelProps>(\n ({ children, className }, ref) => (\n <SelectBase.GroupLabel\n ref={ref}\n className={cn(\n \"px-3.5 py-1.5 text-sm font-semibold text-kumo-subtle\",\n className,\n )}\n >\n {children}\n </SelectBase.GroupLabel>\n ),\n);\nGroupLabel.displayName = \"Select.GroupLabel\";\n\n// --- Select.Separator ---\n\ntype SeparatorProps = {\n /** Additional CSS classes merged via `cn()`. */\n className?: string;\n};\n\n/**\n * A visual divider between option groups.\n *\n * @example\n * ```tsx\n * <Select.Option value=\"a\">Option A</Select.Option>\n * <Select.Separator />\n * <Select.Option value=\"b\">Option B</Select.Option>\n * ```\n */\nconst Separator = forwardRef<HTMLDivElement, SeparatorProps>(\n ({ className }, ref) => (\n <SelectBase.Separator\n ref={ref}\n className={cn(\"-mx-1 my-1 h-px bg-kumo-hairline\", className)}\n />\n ),\n);\nSeparator.displayName = \"Select.Separator\";\n\n// --- Assign sub-components ---\n\nSelect.Option = Option;\nSelect.Group = Group;\nSelect.GroupLabel = GroupLabel;\nSelect.Separator = Separator;\n\n(Select.Option as { displayName?: string }).displayName = \"Select.Option\";\n"],"names":["KUMO_INPUT_VARIANTS","KUMO_SELECT_DEFAULT_VARIANTS","selectVariants","size","cn","buttonVariants","triggerIconStyles","isItemDescriptor","value","candidate","normalizeItems","items","key","entry","renderOptionsFromItems","normalizedItems","disabledLookup","item","index","meta","jsx","Option","Select","children","className","renderValue","label","hideLabel","placeholder","loading","labelTooltip","description","error","required","containerProp","props","labelId","useId","contextContainer","usePortalContainer","container","propLookup","ariaLabel","ariaLabelledby","fallbackLabel","useFieldWrapper","triggerLabelledBy","triggerAriaLabel","renderedChildren","valueChildrenFn","_items","baseProps","selectControl","jsxs","SelectBase.Root","SelectBase.Trigger","SkeletonLine","SelectBase.Value","SelectBase.Icon","CaretUpDownIcon","SelectBase.Portal","SelectBase.Positioner","SelectBase.Popup","SelectBase.List","Field","normalizedError","disabled","SelectBase.Item","SelectBase.ItemText","SelectBase.ItemIndicator","CheckIcon","Group","forwardRef","ref","SelectBase.Group","GroupLabel","Select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A,MAAA;AAAA,IAAA;AAAA,EAAA;AAGN;AAsBA,MAAMC,IAAQC;AAAA,EACZ,CAAC,EAAE,UAAAjD,GAAU,WAAAC,KAAaiD,MACxB,gBAAArD,EAACsD,IAAA,EAAiB,KAAAD,GAAU,WAAWrE,EAAGoB,CAAS,GAChD,UAAAD,EAAA,CACH;AAEJ;AACAgD,EAAM,cAAc;AAsBpB,MAAMI,IAAaH;AAAA,EACjB,CAAC,EAAE,UAAAjD,GAAU,WAAAC,EAAA,GAAaiD,MACxB,gBAAArD;AAAA,IAACwD;AAAAA,IAAA;AAAA,MACC,KAAAH;AAAA,MACA,WAAWrE;AAAA,QACT;AAAA,QACAoB;AAAA,MAAA;AAAA,MAGD,UAAAD;AAAA,IAAA;AAAA,EAAA;AAGP;AACAoD,EAAW,cAAc;AAmBzB,MAAME,IAAYL;AAAA,EAChB,CAAC,EAAE,WAAAhD,KAAaiD,MACd,gBAAArD;AAAA,IAAC0D;AAAAA,IAAA;AAAA,MACC,KAAAL;AAAA,MACA,WAAWrE,EAAG,oCAAoCoB,CAAS;AAAA,IAAA;AAAA,EAAA;AAGjE;AACAqD,EAAU,cAAc;AAIxBvD,EAAO,SAASD;AAChBC,EAAO,QAAQiD;AACfjD,EAAO,aAAaqD;AACpBrD,EAAO,YAAYuD;AAElBvD,EAAO,OAAoC,cAAc;"}
@@ -3,9 +3,9 @@ import { jsxs as y, Fragment as ce, jsx as r } from "react/jsx-runtime";
3
3
  import { EyeSlash as ue, Eye as pe } from "@phosphor-icons/react";
4
4
  import { forwardRef as de, useState as C, useRef as N, useId as T, useCallback as c, useEffect as fe } from "react";
5
5
  import { c as p } from "./cn-ct4n7r74mh8y0f48.js";
6
- import { K as me, i as he } from "./input-h48k3uagzrgb98au.js";
7
- import { F as ve } from "./field-krp6z6vfbkrvufz2.js";
8
- import { I as ge } from "./vendor-base-ui-k7bzesq81ie36nya.js";
6
+ import { K as me, i as he } from "./input-cw05pbqdburghkus.js";
7
+ import { F as ve } from "./field-bo5gmna16odrrb1q.js";
8
+ import { I as ge } from "./vendor-base-ui-m5pz3e8c4grg5qmj.js";
9
9
  const Te = me, M = {
10
10
  size: "base",
11
11
  variant: "default"
@@ -261,4 +261,4 @@ export {
261
261
  be as S,
262
262
  M as a
263
263
  };
264
- //# sourceMappingURL=sensitive-input-hd4tpqkzifad1yca.js.map
264
+ //# sourceMappingURL=sensitive-input-00fujb510rrn61v9.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"sensitive-input-hd4tpqkzifad1yca.js","sources":["../../src/components/sensitive-input/sensitive-input.tsx"],"sourcesContent":["import { Eye, EyeSlash } from \"@phosphor-icons/react\";\nimport {\n forwardRef,\n useCallback,\n useEffect,\n useId,\n useRef,\n useState,\n type ComponentPropsWithoutRef,\n type ReactNode,\n} from \"react\";\nimport { cn } from \"../../utils/cn\";\nimport { Input as BaseInput } from \"@base-ui/react/input\";\nimport {\n inputVariants,\n KUMO_INPUT_VARIANTS,\n type KumoInputSize,\n type KumoInputVariant,\n} from \"../input/input\";\nimport { Field, type FieldErrorMatch } from \"../field/field\";\n\nexport const KUMO_SENSITIVE_INPUT_VARIANTS = KUMO_INPUT_VARIANTS;\n\nexport const KUMO_SENSITIVE_INPUT_DEFAULT_VARIANTS = {\n size: \"base\",\n variant: \"default\",\n} as const;\n\ntype Mode = \"masked\" | \"revealed\" | \"empty\";\n\n/**\n * SensitiveInput component props.\n *\n * @example\n * ```tsx\n * <SensitiveInput label=\"API Key\" defaultValue=\"sk_live_abc123xyz789\" />\n * <SensitiveInput label=\"Secret\" value={secret} onValueChange={setSecret} />\n * ```\n */\nexport interface SensitiveInputProps\n extends Omit<\n ComponentPropsWithoutRef<\"input\">,\n \"size\" | \"type\" | \"value\" | \"defaultValue\"\n > {\n /** Controlled value */\n value?: string;\n /** Uncontrolled default value */\n defaultValue?: string;\n /** Simplified change handler receiving just the value */\n onValueChange?: (value: string) => void;\n /** Callback fired after value is copied to clipboard */\n onCopy?: () => void;\n /**\n * Size of the input.\n * - `\"xs\"` — Extra small for compact UIs\n * - `\"sm\"` — Small for secondary fields\n * - `\"base\"` — Default input size\n * - `\"lg\"` — Large for prominent fields\n * @default \"base\"\n */\n size?: KumoInputSize;\n /**\n * Style variant of the input.\n * - `\"default\"` — Default input appearance\n * - `\"error\"` — Error state for validation failures\n * @default \"default\"\n */\n variant?: KumoInputVariant;\n /** Label content for the input (enables Field wrapper and sets masked state label) - 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\n/**\n * Password/secret input that masks its value by default and reveals on click.\n * Includes a built-in copy-to-clipboard button on hover.\n *\n * @example\n * ```tsx\n * <SensitiveInput label=\"API Key\" defaultValue=\"sk_live_abc123xyz789\" />\n * ```\n */\nexport const SensitiveInput = forwardRef<HTMLInputElement, SensitiveInputProps>(\n (\n {\n value: controlledValue,\n defaultValue = \"\",\n onChange,\n onValueChange,\n onCopy,\n size = KUMO_SENSITIVE_INPUT_DEFAULT_VARIANTS.size,\n variant = KUMO_SENSITIVE_INPUT_DEFAULT_VARIANTS.variant,\n disabled = false,\n readOnly = false,\n id,\n autoComplete = \"off\",\n className,\n label,\n labelTooltip,\n description,\n error,\n required,\n ...inputProps\n },\n ref,\n ) => {\n // For aria-label, only use string labels (ReactNode labels can't be used for aria-label)\n const ariaLabelFallback =\n typeof label === \"string\" ? label : \"Sensitive value\";\n const isControlled = controlledValue !== undefined;\n const [internalValue, setInternalValue] = useState(defaultValue);\n const value = isControlled ? controlledValue : internalValue;\n const hasValue = value.length > 0;\n\n const [mode, setMode] = useState<Mode>(() =>\n hasValue ? \"masked\" : \"empty\",\n );\n\n const [copied, setCopied] = useState(false);\n\n const inputRef = useRef<HTMLInputElement | null>(null);\n const containerRef = useRef<HTMLDivElement>(null);\n const liveRegionId = useId();\n const generatedId = useId();\n const inputId = id ?? generatedId;\n const maskedInstructionId = useId();\n\n const mergedRef = useCallback(\n (node: HTMLInputElement | null) => {\n inputRef.current = node;\n if (typeof ref === \"function\") {\n ref(node);\n } else if (ref) {\n ref.current = node;\n }\n },\n [ref],\n );\n\n // Reset copied state after 2 seconds\n useEffect(() => {\n if (copied) {\n const timeoutId = setTimeout(() => setCopied(false), 2000);\n return () => clearTimeout(timeoutId);\n }\n }, [copied]);\n\n const copyToClipboard = useCallback(\n async (e: React.MouseEvent<HTMLButtonElement>) => {\n e.stopPropagation();\n try {\n if (\n typeof navigator !== \"undefined\" &&\n navigator.clipboard &&\n typeof navigator.clipboard.writeText === \"function\"\n ) {\n await navigator.clipboard.writeText(value);\n setCopied(true);\n onCopy?.();\n return;\n }\n } catch {\n // Fall through to manual fallback\n }\n\n if (typeof document !== \"undefined\") {\n const textarea = document.createElement(\"textarea\");\n textarea.value = value;\n textarea.setAttribute(\"readonly\", \"\");\n textarea.style.position = \"absolute\";\n textarea.style.left = \"-9999px\";\n document.body.appendChild(textarea);\n const selection = document.getSelection();\n const previousRange = selection?.rangeCount\n ? selection.getRangeAt(0)\n : null;\n textarea.select();\n try {\n document.execCommand(\"copy\");\n setCopied(true);\n onCopy?.();\n } catch (error) {\n console.warn(\"Clipboard copy failed\", error);\n } finally {\n document.body.removeChild(textarea);\n if (previousRange) {\n selection?.removeAllRanges();\n selection?.addRange(previousRange);\n }\n }\n }\n },\n [value, onCopy],\n );\n\n // Sync mode when value changes externally\n const prevHasValueRef = useRef(hasValue);\n if (prevHasValueRef.current !== hasValue) {\n prevHasValueRef.current = hasValue;\n if (!hasValue && mode === \"masked\") {\n setMode(\"empty\");\n }\n }\n\n const handleContainerClick = useCallback(\n (e: React.MouseEvent) => {\n if (disabled) return;\n // Ignore clicks that originated from outside (e.g., label click focusing input)\n // Label clicks trigger a click on the input, but the click coordinates are outside the container\n if (containerRef.current) {\n const rect = containerRef.current.getBoundingClientRect();\n const isClickInsideContainer =\n e.clientX >= rect.left &&\n e.clientX <= rect.right &&\n e.clientY >= rect.top &&\n e.clientY <= rect.bottom;\n if (!isClickInsideContainer) return;\n }\n if (mode === \"masked\" && hasValue) {\n setMode(\"revealed\");\n if (!readOnly) {\n setTimeout(() => inputRef.current?.focus(), 0);\n }\n }\n },\n [mode, hasValue, disabled, readOnly],\n );\n\n const handleToggleVisibility = useCallback(\n (e: React.MouseEvent<HTMLButtonElement>) => {\n e.stopPropagation();\n if (mode === \"revealed\") {\n setMode(\"masked\");\n } else if (mode === \"empty\" && hasValue) {\n setMode(\"revealed\");\n }\n },\n [mode, hasValue],\n );\n\n const handleChange = useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n const newValue = e.target.value;\n if (!isControlled) {\n setInternalValue(newValue);\n }\n // When typing into an empty field, switch to revealed mode\n // so the input shows as type=\"text\" instead of type=\"password\"\n if (mode === \"empty\" && newValue.length > 0) {\n setMode(\"revealed\");\n }\n onChange?.(e);\n onValueChange?.(newValue);\n },\n [isControlled, onChange, onValueChange, mode],\n );\n\n const handleBlur = useCallback(\n (e: React.FocusEvent<HTMLInputElement>) => {\n // Don't mask if focus is moving to a button inside the container (copy/eye buttons)\n if (\n containerRef.current &&\n e.relatedTarget instanceof Node &&\n containerRef.current.contains(e.relatedTarget)\n ) {\n return;\n }\n if (hasValue) {\n setMode(\"masked\");\n }\n },\n [hasValue],\n );\n\n const handleContainerKeyDown = useCallback(\n (e: React.KeyboardEvent<HTMLDivElement>) => {\n if (disabled) return;\n if (mode === \"masked\" && hasValue) {\n if (e.key === \"Enter\" || e.key === \" \") {\n e.preventDefault();\n setMode(\"revealed\");\n if (!readOnly) {\n setTimeout(() => inputRef.current?.focus(), 0);\n }\n }\n }\n },\n [mode, hasValue, disabled, readOnly],\n );\n\n const handleInputKeyDown = useCallback(\n (e: React.KeyboardEvent<HTMLInputElement>) => {\n if (mode === \"revealed\" && e.key === \"Escape\") {\n setMode(\"masked\");\n // Move focus to container to avoid focus trap (input becomes tabIndex={-1})\n setTimeout(() => containerRef.current?.focus(), 0);\n }\n },\n [mode],\n );\n\n const isMaskedWithValue = mode === \"masked\" && hasValue;\n const showEyeButton =\n !disabled && (mode === \"revealed\" || (mode === \"empty\" && hasValue));\n\n // Icon sizes matching input sizes\n const iconSize = size === \"xs\" || size === \"sm\" ? \"size-3\" : \"size-4\";\n\n const containerClassName = cn(\n inputVariants({ size, variant, parentFocusIndicator: true }),\n \"group/container relative flex w-full items-center\",\n // Show browser-native focus outline on container when child input is focused\n \"focus-within:outline focus-within:outline-2 focus-within:outline-[-webkit-focus-ring-color]\",\n isMaskedWithValue && !disabled && \"cursor-pointer\",\n disabled && \"cursor-not-allowed\",\n className,\n );\n\n const containerContent = (\n <>\n {/* Input - defines the width, always rendered */}\n <BaseInput\n ref={mergedRef}\n id={inputId}\n type={mode === \"revealed\" ? \"text\" : \"password\"}\n value={value}\n onChange={handleChange}\n onBlur={handleBlur}\n onKeyDown={handleInputKeyDown}\n disabled={disabled}\n readOnly={readOnly || isMaskedWithValue}\n autoComplete={autoComplete}\n tabIndex={isMaskedWithValue ? -1 : 0}\n className={cn(\n \"w-full border-0 bg-transparent p-0 text-kumo-default ring-0 outline-none kumo-input-placeholder disabled:cursor-not-allowed disabled:text-kumo-subtle\",\n size === \"xs\" && \"pr-5\",\n size === \"sm\" && \"pr-6\",\n size === \"base\" && \"pr-8\",\n size === \"lg\" && \"pr-10\",\n isMaskedWithValue && \"pointer-events-none text-transparent\",\n )}\n aria-hidden={isMaskedWithValue}\n {...inputProps}\n />\n\n {/* Mask overlay - absolutely positioned, doesn't affect layout */}\n <span\n className={cn(\n \"pointer-events-none absolute inset-y-0 left-0 flex items-center overflow-hidden select-none\",\n // Match input pr padding (space for icon)\n size === \"xs\" && \"right-5\",\n size === \"sm\" && \"right-6\",\n size === \"base\" && \"right-8\",\n size === \"lg\" && \"right-10\",\n // Match the padding from inputVariants\n size === \"xs\" && \"px-1.5\",\n size === \"sm\" && \"px-2\",\n size === \"base\" && \"px-3\",\n size === \"lg\" && \"px-4\",\n // Hidden when not masked\n !isMaskedWithValue && \"invisible\",\n // When masked: enable pointer events\n isMaskedWithValue && \"pointer-events-auto\",\n // Text color - use text-kumo-default to contrast with bg-kumo-control input background\n \"text-kumo-default\",\n // Hover state - pure CSS, no React state (group for children)\n \"group/mask\",\n )}\n aria-hidden=\"true\"\n >\n {/* Both texts rendered, stacked. Visibility toggled on hover to prevent layout shift */}\n <span className=\"relative\">\n <span\n className={cn(\n isMaskedWithValue &&\n !disabled &&\n \"group-focus-within/container:invisible group-hover/mask:invisible\",\n )}\n >\n ••••••••\n </span>\n {isMaskedWithValue && !disabled && (\n <span className=\"invisible absolute left-0 top-0 whitespace-nowrap text-kumo-subtle group-focus-within/container:visible group-hover/mask:visible\">\n Click to reveal\n </span>\n )}\n </span>\n </span>\n\n {/* Eye button - absolutely positioned to the right */}\n <button\n type=\"button\"\n onClick={handleToggleVisibility}\n onKeyDown={(e) => e.stopPropagation()}\n aria-label={mode === \"revealed\" ? \"Hide value\" : \"Reveal value\"}\n tabIndex={showEyeButton ? 0 : -1}\n className={cn(\n \"absolute top-1/2 right-0 -translate-y-1/2 cursor-pointer text-kumo-subtle hover:text-kumo-default focus:text-kumo-default focus-visible:ring-1 focus-visible:ring-kumo-hairline focus-visible:rounded-sm\",\n // Defensive styles to prevent global CSS pollution (e.g., button { background: gray })\n \"bg-transparent border-none shadow-none p-0 m-0 h-auto min-h-0 inline-flex items-center justify-center\",\n // Match right padding from inputVariants\n size === \"xs\" && \"right-1.5\",\n size === \"sm\" && \"right-2\",\n size === \"base\" && \"right-3\",\n size === \"lg\" && \"right-4\",\n iconSize,\n !showEyeButton && \"pointer-events-none opacity-0\",\n )}\n >\n {mode === \"revealed\" ? (\n <EyeSlash className=\"size-full\" />\n ) : (\n <Eye className=\"size-full\" />\n )}\n </button>\n\n {/* Copy tab - appears on hover/focus at top right (hidden when disabled) */}\n {hasValue && !disabled && (\n <button\n type=\"button\"\n onClick={copyToClipboard}\n onKeyDown={(e) => e.stopPropagation()}\n aria-label={copied ? \"Copied\" : \"Copy to clipboard\"}\n className={cn(\n \"absolute -top-px right-2 -translate-y-full cursor-pointer rounded-t-md bg-kumo-brand px-2 py-0.5 text-xs text-white opacity-0 transition-opacity group-focus-within/container:opacity-100 group-hover/container:opacity-100 hover:brightness-120 focus-visible:outline focus-visible:outline-offset-1 focus-visible:outline-kumo-hairline\",\n // Defensive styles to prevent global CSS pollution\n \"border-none shadow-none m-0 h-auto min-h-0\",\n )}\n >\n {copied ? \"Copied\" : \"Copy\"}\n </button>\n )}\n </>\n );\n\n const input = (\n <div>\n {isMaskedWithValue ? (\n <div\n ref={containerRef}\n // Cannot use <button> here because containerContent contains interactive button elements (Copy, Reveal).\n // Using role=\"button\" with proper keyboard handling instead.\n // oxlint-disable-next-line prefer-tag-over-role\n role=\"button\"\n tabIndex={disabled ? -1 : 0}\n className={containerClassName}\n onClick={handleContainerClick}\n onKeyDown={handleContainerKeyDown}\n aria-label={`${ariaLabelFallback}, masked.`}\n aria-describedby={`${maskedInstructionId} ${liveRegionId}`}\n aria-disabled={disabled}\n >\n {containerContent}\n </div>\n ) : (\n <div ref={containerRef} className={containerClassName}>\n {containerContent}\n </div>\n )}\n {isMaskedWithValue && (\n <span id={maskedInstructionId} className=\"sr-only\">\n Click or press Enter to reveal.\n </span>\n )}\n <span id={liveRegionId} className=\"sr-only\" aria-live=\"polite\">\n {mode === \"masked\" && hasValue && \"Value hidden\"}\n {copied && \"Copied to clipboard\"}\n </span>\n </div>\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);\n\nSensitiveInput.displayName = \"SensitiveInput\";\n"],"names":["KUMO_SENSITIVE_INPUT_VARIANTS","KUMO_INPUT_VARIANTS","KUMO_SENSITIVE_INPUT_DEFAULT_VARIANTS","SensitiveInput","forwardRef","controlledValue","defaultValue","onChange","onValueChange","onCopy","size","variant","disabled","readOnly","id","autoComplete","className","label","labelTooltip","description","error","required","inputProps","ref","ariaLabelFallback","isControlled","internalValue","setInternalValue","useState","value","hasValue","mode","setMode","copied","setCopied","inputRef","useRef","containerRef","liveRegionId","useId","generatedId","inputId","maskedInstructionId","mergedRef","useCallback","node","useEffect","timeoutId","copyToClipboard","textarea","selection","previousRange","prevHasValueRef","handleContainerClick","rect","handleToggleVisibility","handleChange","newValue","handleBlur","handleContainerKeyDown","handleInputKeyDown","isMaskedWithValue","showEyeButton","iconSize","containerClassName","cn","inputVariants","containerContent","jsxs","Fragment","jsx","BaseInput","EyeSlash","Eye","input","Field"],"mappings":";;;;;;;;AAqBO,MAAMA,KAAgCC,IAEhCC,IAAwC;AAAA,EACnD,MAAM;AAAA,EACN,SAAS;AACX,GA6DaC,KAAiBC;AAAA,EAC5B,CACE;AAAA,IACE,OAAOC;AAAA,IACP,cAAAC,IAAe;AAAA,IACf,UAAAC;AAAA,IACA,eAAAC;AAAA,IACA,QAAAC;AAAA,IACA,MAAAC,IAAOR,EAAsC;AAAA,IAC7C,SAAAS,IAAUT,EAAsC;AAAA,IAChD,UAAAU,IAAW;AAAA,IACX,UAAAC,IAAW;AAAA,IACX,IAAAC;AAAA,IACA,cAAAC,IAAe;AAAA,IACf,WAAAC;AAAA,IACA,OAAAC;AAAA,IACA,cAAAC;AAAA,IACA,aAAAC;AAAA,IACA,OAAAC;AAAA,IACA,UAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,GAELC,MACG;AAEH,UAAMC,IACJ,OAAOP,KAAU,WAAWA,IAAQ,mBAChCQ,IAAepB,MAAoB,QACnC,CAACqB,GAAeC,CAAgB,IAAIC,EAAStB,CAAY,GACzDuB,IAAQJ,IAAepB,IAAkBqB,GACzCI,IAAWD,EAAM,SAAS,GAE1B,CAACE,GAAMC,CAAO,IAAIJ;AAAA,MAAe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,OAAA,EAAI,KAAKjC,GAAc,WAAW2B,GAChC,UAAAG,GACH;AAAA,MAEDN,KACC,gBAAAS,EAAC,QAAA,EAAK,IAAI5B,GAAqB,WAAU,WAAU,UAAA,mCAEnD;AAAA,wBAED,QAAA,EAAK,IAAIJ,GAAc,WAAU,WAAU,aAAU,UACnD,UAAA;AAAA,QAAAP,MAAS,YAAYD,KAAY;AAAA,QACjCG,KAAU;AAAA,MAAA,EAAA,CACb;AAAA,IAAA,GACF;AAIF,WAAIhB,IAEA,gBAAAqD;AAAA,MAACK;AAAA,MAAA;AAAA,QACC,OAAA1D;AAAA,QACA,UAAAI;AAAA,QACA,cAAAH;AAAA,QACA,aAAAC;AAAA,QACA,OACEC,IACI,OAAOA,KAAU,WACf,EAAE,SAASA,GAAO,OAAO,GAAA,IACzBA,IACF;AAAA,QAGL,UAAAsD;AAAA,MAAA;AAAA,IAAA,IAMAA;AAAA,EACT;AACF;AAEAvE,GAAe,cAAc;"}
1
+ {"version":3,"file":"sensitive-input-00fujb510rrn61v9.js","sources":["../../src/components/sensitive-input/sensitive-input.tsx"],"sourcesContent":["import { Eye, EyeSlash } from \"@phosphor-icons/react\";\nimport {\n forwardRef,\n useCallback,\n useEffect,\n useId,\n useRef,\n useState,\n type ComponentPropsWithoutRef,\n type ReactNode,\n} from \"react\";\nimport { cn } from \"../../utils/cn\";\nimport { Input as BaseInput } from \"@base-ui/react/input\";\nimport {\n inputVariants,\n KUMO_INPUT_VARIANTS,\n type KumoInputSize,\n type KumoInputVariant,\n} from \"../input/input\";\nimport { Field, type FieldErrorMatch } from \"../field/field\";\n\nexport const KUMO_SENSITIVE_INPUT_VARIANTS = KUMO_INPUT_VARIANTS;\n\nexport const KUMO_SENSITIVE_INPUT_DEFAULT_VARIANTS = {\n size: \"base\",\n variant: \"default\",\n} as const;\n\ntype Mode = \"masked\" | \"revealed\" | \"empty\";\n\n/**\n * SensitiveInput component props.\n *\n * @example\n * ```tsx\n * <SensitiveInput label=\"API Key\" defaultValue=\"sk_live_abc123xyz789\" />\n * <SensitiveInput label=\"Secret\" value={secret} onValueChange={setSecret} />\n * ```\n */\nexport interface SensitiveInputProps\n extends Omit<\n ComponentPropsWithoutRef<\"input\">,\n \"size\" | \"type\" | \"value\" | \"defaultValue\"\n > {\n /** Controlled value */\n value?: string;\n /** Uncontrolled default value */\n defaultValue?: string;\n /** Simplified change handler receiving just the value */\n onValueChange?: (value: string) => void;\n /** Callback fired after value is copied to clipboard */\n onCopy?: () => void;\n /**\n * Size of the input.\n * - `\"xs\"` — Extra small for compact UIs\n * - `\"sm\"` — Small for secondary fields\n * - `\"base\"` — Default input size\n * - `\"lg\"` — Large for prominent fields\n * @default \"base\"\n */\n size?: KumoInputSize;\n /**\n * Style variant of the input.\n * - `\"default\"` — Default input appearance\n * - `\"error\"` — Error state for validation failures\n * @default \"default\"\n */\n variant?: KumoInputVariant;\n /** Label content for the input (enables Field wrapper and sets masked state label) - 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\n/**\n * Password/secret input that masks its value by default and reveals on click.\n * Includes a built-in copy-to-clipboard button on hover.\n *\n * @example\n * ```tsx\n * <SensitiveInput label=\"API Key\" defaultValue=\"sk_live_abc123xyz789\" />\n * ```\n */\nexport const SensitiveInput = forwardRef<HTMLInputElement, SensitiveInputProps>(\n (\n {\n value: controlledValue,\n defaultValue = \"\",\n onChange,\n onValueChange,\n onCopy,\n size = KUMO_SENSITIVE_INPUT_DEFAULT_VARIANTS.size,\n variant = KUMO_SENSITIVE_INPUT_DEFAULT_VARIANTS.variant,\n disabled = false,\n readOnly = false,\n id,\n autoComplete = \"off\",\n className,\n label,\n labelTooltip,\n description,\n error,\n required,\n ...inputProps\n },\n ref,\n ) => {\n // For aria-label, only use string labels (ReactNode labels can't be used for aria-label)\n const ariaLabelFallback =\n typeof label === \"string\" ? label : \"Sensitive value\";\n const isControlled = controlledValue !== undefined;\n const [internalValue, setInternalValue] = useState(defaultValue);\n const value = isControlled ? controlledValue : internalValue;\n const hasValue = value.length > 0;\n\n const [mode, setMode] = useState<Mode>(() =>\n hasValue ? \"masked\" : \"empty\",\n );\n\n const [copied, setCopied] = useState(false);\n\n const inputRef = useRef<HTMLInputElement | null>(null);\n const containerRef = useRef<HTMLDivElement>(null);\n const liveRegionId = useId();\n const generatedId = useId();\n const inputId = id ?? generatedId;\n const maskedInstructionId = useId();\n\n const mergedRef = useCallback(\n (node: HTMLInputElement | null) => {\n inputRef.current = node;\n if (typeof ref === \"function\") {\n ref(node);\n } else if (ref) {\n ref.current = node;\n }\n },\n [ref],\n );\n\n // Reset copied state after 2 seconds\n useEffect(() => {\n if (copied) {\n const timeoutId = setTimeout(() => setCopied(false), 2000);\n return () => clearTimeout(timeoutId);\n }\n }, [copied]);\n\n const copyToClipboard = useCallback(\n async (e: React.MouseEvent<HTMLButtonElement>) => {\n e.stopPropagation();\n try {\n if (\n typeof navigator !== \"undefined\" &&\n navigator.clipboard &&\n typeof navigator.clipboard.writeText === \"function\"\n ) {\n await navigator.clipboard.writeText(value);\n setCopied(true);\n onCopy?.();\n return;\n }\n } catch {\n // Fall through to manual fallback\n }\n\n if (typeof document !== \"undefined\") {\n const textarea = document.createElement(\"textarea\");\n textarea.value = value;\n textarea.setAttribute(\"readonly\", \"\");\n textarea.style.position = \"absolute\";\n textarea.style.left = \"-9999px\";\n document.body.appendChild(textarea);\n const selection = document.getSelection();\n const previousRange = selection?.rangeCount\n ? selection.getRangeAt(0)\n : null;\n textarea.select();\n try {\n document.execCommand(\"copy\");\n setCopied(true);\n onCopy?.();\n } catch (error) {\n console.warn(\"Clipboard copy failed\", error);\n } finally {\n document.body.removeChild(textarea);\n if (previousRange) {\n selection?.removeAllRanges();\n selection?.addRange(previousRange);\n }\n }\n }\n },\n [value, onCopy],\n );\n\n // Sync mode when value changes externally\n const prevHasValueRef = useRef(hasValue);\n if (prevHasValueRef.current !== hasValue) {\n prevHasValueRef.current = hasValue;\n if (!hasValue && mode === \"masked\") {\n setMode(\"empty\");\n }\n }\n\n const handleContainerClick = useCallback(\n (e: React.MouseEvent) => {\n if (disabled) return;\n // Ignore clicks that originated from outside (e.g., label click focusing input)\n // Label clicks trigger a click on the input, but the click coordinates are outside the container\n if (containerRef.current) {\n const rect = containerRef.current.getBoundingClientRect();\n const isClickInsideContainer =\n e.clientX >= rect.left &&\n e.clientX <= rect.right &&\n e.clientY >= rect.top &&\n e.clientY <= rect.bottom;\n if (!isClickInsideContainer) return;\n }\n if (mode === \"masked\" && hasValue) {\n setMode(\"revealed\");\n if (!readOnly) {\n setTimeout(() => inputRef.current?.focus(), 0);\n }\n }\n },\n [mode, hasValue, disabled, readOnly],\n );\n\n const handleToggleVisibility = useCallback(\n (e: React.MouseEvent<HTMLButtonElement>) => {\n e.stopPropagation();\n if (mode === \"revealed\") {\n setMode(\"masked\");\n } else if (mode === \"empty\" && hasValue) {\n setMode(\"revealed\");\n }\n },\n [mode, hasValue],\n );\n\n const handleChange = useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n const newValue = e.target.value;\n if (!isControlled) {\n setInternalValue(newValue);\n }\n // When typing into an empty field, switch to revealed mode\n // so the input shows as type=\"text\" instead of type=\"password\"\n if (mode === \"empty\" && newValue.length > 0) {\n setMode(\"revealed\");\n }\n onChange?.(e);\n onValueChange?.(newValue);\n },\n [isControlled, onChange, onValueChange, mode],\n );\n\n const handleBlur = useCallback(\n (e: React.FocusEvent<HTMLInputElement>) => {\n // Don't mask if focus is moving to a button inside the container (copy/eye buttons)\n if (\n containerRef.current &&\n e.relatedTarget instanceof Node &&\n containerRef.current.contains(e.relatedTarget)\n ) {\n return;\n }\n if (hasValue) {\n setMode(\"masked\");\n }\n },\n [hasValue],\n );\n\n const handleContainerKeyDown = useCallback(\n (e: React.KeyboardEvent<HTMLDivElement>) => {\n if (disabled) return;\n if (mode === \"masked\" && hasValue) {\n if (e.key === \"Enter\" || e.key === \" \") {\n e.preventDefault();\n setMode(\"revealed\");\n if (!readOnly) {\n setTimeout(() => inputRef.current?.focus(), 0);\n }\n }\n }\n },\n [mode, hasValue, disabled, readOnly],\n );\n\n const handleInputKeyDown = useCallback(\n (e: React.KeyboardEvent<HTMLInputElement>) => {\n if (mode === \"revealed\" && e.key === \"Escape\") {\n setMode(\"masked\");\n // Move focus to container to avoid focus trap (input becomes tabIndex={-1})\n setTimeout(() => containerRef.current?.focus(), 0);\n }\n },\n [mode],\n );\n\n const isMaskedWithValue = mode === \"masked\" && hasValue;\n const showEyeButton =\n !disabled && (mode === \"revealed\" || (mode === \"empty\" && hasValue));\n\n // Icon sizes matching input sizes\n const iconSize = size === \"xs\" || size === \"sm\" ? \"size-3\" : \"size-4\";\n\n const containerClassName = cn(\n inputVariants({ size, variant, parentFocusIndicator: true }),\n \"group/container relative flex w-full items-center\",\n // Show browser-native focus outline on container when child input is focused\n \"focus-within:outline focus-within:outline-2 focus-within:outline-[-webkit-focus-ring-color]\",\n isMaskedWithValue && !disabled && \"cursor-pointer\",\n disabled && \"cursor-not-allowed\",\n className,\n );\n\n const containerContent = (\n <>\n {/* Input - defines the width, always rendered */}\n <BaseInput\n ref={mergedRef}\n id={inputId}\n type={mode === \"revealed\" ? \"text\" : \"password\"}\n value={value}\n onChange={handleChange}\n onBlur={handleBlur}\n onKeyDown={handleInputKeyDown}\n disabled={disabled}\n readOnly={readOnly || isMaskedWithValue}\n autoComplete={autoComplete}\n tabIndex={isMaskedWithValue ? -1 : 0}\n className={cn(\n \"w-full border-0 bg-transparent p-0 text-kumo-default ring-0 outline-none kumo-input-placeholder disabled:cursor-not-allowed disabled:text-kumo-subtle\",\n size === \"xs\" && \"pr-5\",\n size === \"sm\" && \"pr-6\",\n size === \"base\" && \"pr-8\",\n size === \"lg\" && \"pr-10\",\n isMaskedWithValue && \"pointer-events-none text-transparent\",\n )}\n aria-hidden={isMaskedWithValue}\n {...inputProps}\n />\n\n {/* Mask overlay - absolutely positioned, doesn't affect layout */}\n <span\n className={cn(\n \"pointer-events-none absolute inset-y-0 left-0 flex items-center overflow-hidden select-none\",\n // Match input pr padding (space for icon)\n size === \"xs\" && \"right-5\",\n size === \"sm\" && \"right-6\",\n size === \"base\" && \"right-8\",\n size === \"lg\" && \"right-10\",\n // Match the padding from inputVariants\n size === \"xs\" && \"px-1.5\",\n size === \"sm\" && \"px-2\",\n size === \"base\" && \"px-3\",\n size === \"lg\" && \"px-4\",\n // Hidden when not masked\n !isMaskedWithValue && \"invisible\",\n // When masked: enable pointer events\n isMaskedWithValue && \"pointer-events-auto\",\n // Text color - use text-kumo-default to contrast with bg-kumo-control input background\n \"text-kumo-default\",\n // Hover state - pure CSS, no React state (group for children)\n \"group/mask\",\n )}\n aria-hidden=\"true\"\n >\n {/* Both texts rendered, stacked. Visibility toggled on hover to prevent layout shift */}\n <span className=\"relative\">\n <span\n className={cn(\n isMaskedWithValue &&\n !disabled &&\n \"group-focus-within/container:invisible group-hover/mask:invisible\",\n )}\n >\n ••••••••\n </span>\n {isMaskedWithValue && !disabled && (\n <span className=\"invisible absolute left-0 top-0 whitespace-nowrap text-kumo-subtle group-focus-within/container:visible group-hover/mask:visible\">\n Click to reveal\n </span>\n )}\n </span>\n </span>\n\n {/* Eye button - absolutely positioned to the right */}\n <button\n type=\"button\"\n onClick={handleToggleVisibility}\n onKeyDown={(e) => e.stopPropagation()}\n aria-label={mode === \"revealed\" ? \"Hide value\" : \"Reveal value\"}\n tabIndex={showEyeButton ? 0 : -1}\n className={cn(\n \"absolute top-1/2 right-0 -translate-y-1/2 cursor-pointer text-kumo-subtle hover:text-kumo-default focus:text-kumo-default focus-visible:ring-1 focus-visible:ring-kumo-hairline focus-visible:rounded-sm\",\n // Defensive styles to prevent global CSS pollution (e.g., button { background: gray })\n \"bg-transparent border-none shadow-none p-0 m-0 h-auto min-h-0 inline-flex items-center justify-center\",\n // Match right padding from inputVariants\n size === \"xs\" && \"right-1.5\",\n size === \"sm\" && \"right-2\",\n size === \"base\" && \"right-3\",\n size === \"lg\" && \"right-4\",\n iconSize,\n !showEyeButton && \"pointer-events-none opacity-0\",\n )}\n >\n {mode === \"revealed\" ? (\n <EyeSlash className=\"size-full\" />\n ) : (\n <Eye className=\"size-full\" />\n )}\n </button>\n\n {/* Copy tab - appears on hover/focus at top right (hidden when disabled) */}\n {hasValue && !disabled && (\n <button\n type=\"button\"\n onClick={copyToClipboard}\n onKeyDown={(e) => e.stopPropagation()}\n aria-label={copied ? \"Copied\" : \"Copy to clipboard\"}\n className={cn(\n \"absolute -top-px right-2 -translate-y-full cursor-pointer rounded-t-md bg-kumo-brand px-2 py-0.5 text-xs text-white opacity-0 transition-opacity group-focus-within/container:opacity-100 group-hover/container:opacity-100 hover:brightness-120 focus-visible:outline focus-visible:outline-offset-1 focus-visible:outline-kumo-hairline\",\n // Defensive styles to prevent global CSS pollution\n \"border-none shadow-none m-0 h-auto min-h-0\",\n )}\n >\n {copied ? \"Copied\" : \"Copy\"}\n </button>\n )}\n </>\n );\n\n const input = (\n <div>\n {isMaskedWithValue ? (\n <div\n ref={containerRef}\n // Cannot use <button> here because containerContent contains interactive button elements (Copy, Reveal).\n // Using role=\"button\" with proper keyboard handling instead.\n // oxlint-disable-next-line prefer-tag-over-role\n role=\"button\"\n tabIndex={disabled ? -1 : 0}\n className={containerClassName}\n onClick={handleContainerClick}\n onKeyDown={handleContainerKeyDown}\n aria-label={`${ariaLabelFallback}, masked.`}\n aria-describedby={`${maskedInstructionId} ${liveRegionId}`}\n aria-disabled={disabled}\n >\n {containerContent}\n </div>\n ) : (\n <div ref={containerRef} className={containerClassName}>\n {containerContent}\n </div>\n )}\n {isMaskedWithValue && (\n <span id={maskedInstructionId} className=\"sr-only\">\n Click or press Enter to reveal.\n </span>\n )}\n <span id={liveRegionId} className=\"sr-only\" aria-live=\"polite\">\n {mode === \"masked\" && hasValue && \"Value hidden\"}\n {copied && \"Copied to clipboard\"}\n </span>\n </div>\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);\n\nSensitiveInput.displayName = \"SensitiveInput\";\n"],"names":["KUMO_SENSITIVE_INPUT_VARIANTS","KUMO_INPUT_VARIANTS","KUMO_SENSITIVE_INPUT_DEFAULT_VARIANTS","SensitiveInput","forwardRef","controlledValue","defaultValue","onChange","onValueChange","onCopy","size","variant","disabled","readOnly","id","autoComplete","className","label","labelTooltip","description","error","required","inputProps","ref","ariaLabelFallback","isControlled","internalValue","setInternalValue","useState","value","hasValue","mode","setMode","copied","setCopied","inputRef","useRef","containerRef","liveRegionId","useId","generatedId","inputId","maskedInstructionId","mergedRef","useCallback","node","useEffect","timeoutId","copyToClipboard","textarea","selection","previousRange","prevHasValueRef","handleContainerClick","rect","handleToggleVisibility","handleChange","newValue","handleBlur","handleContainerKeyDown","handleInputKeyDown","isMaskedWithValue","showEyeButton","iconSize","containerClassName","cn","inputVariants","containerContent","jsxs","Fragment","jsx","BaseInput","EyeSlash","Eye","input","Field"],"mappings":";;;;;;;;AAqBO,MAAMA,KAAgCC,IAEhCC,IAAwC;AAAA,EACnD,MAAM;AAAA,EACN,SAAS;AACX,GA6DaC,KAAiBC;AAAA,EAC5B,CACE;AAAA,IACE,OAAOC;AAAA,IACP,cAAAC,IAAe;AAAA,IACf,UAAAC;AAAA,IACA,eAAAC;AAAA,IACA,QAAAC;AAAA,IACA,MAAAC,IAAOR,EAAsC;AAAA,IAC7C,SAAAS,IAAUT,EAAsC;AAAA,IAChD,UAAAU,IAAW;AAAA,IACX,UAAAC,IAAW;AAAA,IACX,IAAAC;AAAA,IACA,cAAAC,IAAe;AAAA,IACf,WAAAC;AAAA,IACA,OAAAC;AAAA,IACA,cAAAC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