@cloudflare/kumo 1.19.0 → 2.0.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 (289) hide show
  1. package/CHANGELOG.md +239 -0
  2. package/ai/component-registry.json +758 -118
  3. package/ai/component-registry.md +1151 -153
  4. package/ai/schemas.ts +42 -14
  5. package/dist/.build-complete +1 -1
  6. package/dist/ai/schemas.d.ts +153 -21
  7. package/dist/ai/schemas.d.ts.map +1 -1
  8. package/dist/ai/schemas.js +1994 -1956
  9. package/dist/ai/schemas.js.map +1 -1
  10. package/dist/chunks/Legend-ibjxhfm9pn2vrb6f.js +430 -0
  11. package/dist/chunks/Legend-ibjxhfm9pn2vrb6f.js.map +1 -0
  12. package/dist/chunks/autocomplete-cs3fwy6lwzlyirpq.js +174 -0
  13. package/dist/chunks/autocomplete-cs3fwy6lwzlyirpq.js.map +1 -0
  14. package/dist/chunks/{breadcrumbs-ge20hcb3o5spswrk.js → breadcrumbs-cxcwf2l1ki3ffg5d.js} +2 -2
  15. package/dist/chunks/{breadcrumbs-ge20hcb3o5spswrk.js.map → breadcrumbs-cxcwf2l1ki3ffg5d.js.map} +1 -1
  16. package/dist/chunks/{button-oaqi7ykdisyskoos.js → button-6by9ntsa3nj553mq.js} +23 -24
  17. package/dist/chunks/button-6by9ntsa3nj553mq.js.map +1 -0
  18. package/dist/chunks/checkbox-eren6w2csum1xghg.js +210 -0
  19. package/dist/chunks/checkbox-eren6w2csum1xghg.js.map +1 -0
  20. package/dist/chunks/{clipboard-text-dxczqon3d27xp6f0.js → clipboard-text-f9q753udny1uyxr5.js} +45 -41
  21. package/dist/chunks/{clipboard-text-dxczqon3d27xp6f0.js.map → clipboard-text-f9q753udny1uyxr5.js.map} +1 -1
  22. package/dist/chunks/collapsible-k8urhi16pg90jvxa.js +71 -0
  23. package/dist/chunks/collapsible-k8urhi16pg90jvxa.js.map +1 -0
  24. package/dist/chunks/{combobox-eaowwt1xr4d23gsn.js → combobox-n9qht9h9ag6kh5sn.js} +86 -74
  25. package/dist/chunks/combobox-n9qht9h9ag6kh5sn.js.map +1 -0
  26. package/dist/chunks/{command-palette-maqtbmpfev9mysqd.js → command-palette-gk9m34ymp2b3hfc5.js} +126 -126
  27. package/dist/chunks/command-palette-gk9m34ymp2b3hfc5.js.map +1 -0
  28. package/dist/chunks/{date-range-picker-j318zxjyqz4o3dak.js → date-range-picker-c9wnx9tbwohai7jy.js} +26 -26
  29. package/dist/chunks/{date-range-picker-j318zxjyqz4o3dak.js.map → date-range-picker-c9wnx9tbwohai7jy.js.map} +1 -1
  30. package/dist/chunks/{dialog-e3m5bhs7fds26p9y.js → dialog-94v7wiz7j3in6528.js} +3 -3
  31. package/dist/chunks/{dialog-e3m5bhs7fds26p9y.js.map → dialog-94v7wiz7j3in6528.js.map} +1 -1
  32. package/dist/chunks/{dropdown-ewte287db3vyt8t5.js → dropdown-zbax0zowy6m9zhmt.js} +87 -87
  33. package/dist/chunks/dropdown-zbax0zowy6m9zhmt.js.map +1 -0
  34. package/dist/chunks/{empty-dr1eckm2z40euns6.js → empty-kpymw59thjf2ip8g.js} +9 -9
  35. package/dist/chunks/{empty-dr1eckm2z40euns6.js.map → empty-kpymw59thjf2ip8g.js.map} +1 -1
  36. package/dist/chunks/{field-bo5gmna16odrrb1q.js → field-lnj619xpe8zjd26r.js} +7 -7
  37. package/dist/chunks/{field-bo5gmna16odrrb1q.js.map → field-lnj619xpe8zjd26r.js.map} +1 -1
  38. package/dist/chunks/{input-area-jkkkjej6luumrqpa.js → input-area-h8xbqturegdfm1mi.js} +4 -4
  39. package/dist/chunks/{input-area-jkkkjej6luumrqpa.js.map → input-area-h8xbqturegdfm1mi.js.map} +1 -1
  40. package/dist/chunks/input-group-dh4pg8p20rh4mdi0.js +505 -0
  41. package/dist/chunks/input-group-dh4pg8p20rh4mdi0.js.map +1 -0
  42. package/dist/chunks/{input-cw05pbqdburghkus.js → input-lpa5fc75tgrraafv.js} +46 -46
  43. package/dist/chunks/input-lpa5fc75tgrraafv.js.map +1 -0
  44. package/dist/chunks/{label-cvyvbqmt4mt757ff.js → label-be8m7qzlakzig2sl.js} +3 -3
  45. package/dist/chunks/{label-cvyvbqmt4mt757ff.js.map → label-be8m7qzlakzig2sl.js.map} +1 -1
  46. package/dist/chunks/{layer-card-ljqth3yxgnk04v2o.js → layer-card-hvivdirwwnyq88wa.js} +5 -5
  47. package/dist/chunks/{layer-card-ljqth3yxgnk04v2o.js.map → layer-card-hvivdirwwnyq88wa.js.map} +1 -1
  48. package/dist/chunks/{link-fjnhtxvfe5ieamjf.js → link-kt74pxkud4olmcer.js} +4 -4
  49. package/dist/chunks/{link-fjnhtxvfe5ieamjf.js.map → link-kt74pxkud4olmcer.js.map} +1 -1
  50. package/dist/chunks/menubar-hwev159bm4rw9ixk.js +96 -0
  51. package/dist/chunks/menubar-hwev159bm4rw9ixk.js.map +1 -0
  52. package/dist/chunks/{meter-duj3micor1lqj3y2.js → meter-bqetlujwg8gm2u7m.js} +2 -2
  53. package/dist/chunks/{meter-duj3micor1lqj3y2.js.map → meter-bqetlujwg8gm2u7m.js.map} +1 -1
  54. package/dist/chunks/{pagination-olaypvwr8swsmn8m.js → pagination-ho8zesqfyp6ckmrl.js} +21 -21
  55. package/dist/chunks/pagination-ho8zesqfyp6ckmrl.js.map +1 -0
  56. package/dist/chunks/{popover-nv9cmzbo7mf6bky0.js → popover-iayd9ya5yhujz6ve.js} +5 -5
  57. package/dist/chunks/{popover-nv9cmzbo7mf6bky0.js.map → popover-iayd9ya5yhujz6ve.js.map} +1 -1
  58. package/dist/chunks/{radio-ihxbe37us2jnqtzf.js → radio-datzh3pilz8ojak1.js} +86 -74
  59. package/dist/chunks/radio-datzh3pilz8ojak1.js.map +1 -0
  60. package/dist/chunks/{select-nx6ded5swra74iar.js → select-kpfbib9l8xrrmzpz.js} +64 -62
  61. package/dist/chunks/select-kpfbib9l8xrrmzpz.js.map +1 -0
  62. package/dist/chunks/{sensitive-input-00fujb510rrn61v9.js → sensitive-input-i1upqytzaw2pus8v.js} +42 -42
  63. package/dist/chunks/sensitive-input-i1upqytzaw2pus8v.js.map +1 -0
  64. package/dist/chunks/{sidebar-ltbfius1eolkl8tb.js → sidebar-kh37grvfxto14ek6.js} +129 -126
  65. package/dist/chunks/sidebar-kh37grvfxto14ek6.js.map +1 -0
  66. package/dist/chunks/{surface-dfgurg5eu3et4vw1.js → surface-o63tktyrifcjejyb.js} +2 -2
  67. package/dist/chunks/{surface-dfgurg5eu3et4vw1.js.map → surface-o63tktyrifcjejyb.js.map} +1 -1
  68. package/dist/chunks/{switch-fbv3iawqo3o3jgap.js → switch-lclhiplr9zqf73tj.js} +86 -78
  69. package/dist/chunks/switch-lclhiplr9zqf73tj.js.map +1 -0
  70. package/dist/chunks/{table-olwwulga2l3hdwlx.js → table-fyy8gl875yyevqs3.js} +89 -71
  71. package/dist/chunks/table-fyy8gl875yyevqs3.js.map +1 -0
  72. package/dist/chunks/table-of-contents-fzyv7uhnnyr13dqu.js +102 -0
  73. package/dist/chunks/table-of-contents-fzyv7uhnnyr13dqu.js.map +1 -0
  74. package/dist/chunks/{tabs-lohcglgppp6gj0hp.js → tabs-jywwt8ebjqjkux75.js} +19 -19
  75. package/dist/chunks/{tabs-lohcglgppp6gj0hp.js.map → tabs-jywwt8ebjqjkux75.js.map} +1 -1
  76. package/dist/chunks/{text-nmyi1rkwdj37f30f.js → text-f7t467waymhb30sx.js} +8 -8
  77. package/dist/chunks/text-f7t467waymhb30sx.js.map +1 -0
  78. package/dist/chunks/{toast-dg52x89yd231mxhe.js → toast-h573o0tc7tefivk2.js} +11 -11
  79. package/dist/chunks/{toast-dg52x89yd231mxhe.js.map → toast-h573o0tc7tefivk2.js.map} +1 -1
  80. package/dist/chunks/{tooltip-hikjvdbg3xghnq1x.js → tooltip-odudhkxe282wxinq.js} +5 -5
  81. package/dist/chunks/{tooltip-hikjvdbg3xghnq1x.js.map → tooltip-odudhkxe282wxinq.js.map} +1 -1
  82. package/dist/chunks/vendor-base-ui-ie71jahf0czyf58j.js +24638 -0
  83. package/dist/chunks/vendor-base-ui-ie71jahf0czyf58j.js.map +1 -0
  84. package/dist/chunks/vendor-floating-ui-dwag5e88viikh2zs.js +1311 -0
  85. package/dist/chunks/vendor-floating-ui-dwag5e88viikh2zs.js.map +1 -0
  86. package/dist/chunks/vendor-utils-ixnhxmehwihk5tr7.js +534 -0
  87. package/dist/chunks/vendor-utils-ixnhxmehwihk5tr7.js.map +1 -0
  88. package/dist/code.js +1 -1
  89. package/dist/components/autocomplete.js +9 -0
  90. package/dist/components/autocomplete.js.map +1 -0
  91. package/dist/components/breadcrumbs.js +1 -1
  92. package/dist/components/button.js +1 -1
  93. package/dist/components/chart.js +1 -1
  94. package/dist/components/checkbox.js +1 -1
  95. package/dist/components/clipboard-text.js +1 -1
  96. package/dist/components/collapsible.js +1 -1
  97. package/dist/components/combobox.js +1 -1
  98. package/dist/components/command-palette.js +1 -1
  99. package/dist/components/date-range-picker.js +1 -1
  100. package/dist/components/dialog.js +1 -1
  101. package/dist/components/dropdown.js +1 -1
  102. package/dist/components/empty.js +1 -1
  103. package/dist/components/field.js +1 -1
  104. package/dist/components/input-group.js +8 -0
  105. package/dist/components/input-group.js.map +1 -0
  106. package/dist/components/input.js +9 -7
  107. package/dist/components/label.js +1 -1
  108. package/dist/components/layer-card.js +1 -1
  109. package/dist/components/link.js +1 -1
  110. package/dist/components/menubar.js +1 -1
  111. package/dist/components/meter.js +1 -1
  112. package/dist/components/pagination.js +1 -1
  113. package/dist/components/popover.js +1 -1
  114. package/dist/components/radio.js +1 -1
  115. package/dist/components/select.js +1 -1
  116. package/dist/components/sensitive-input.js +1 -1
  117. package/dist/components/sidebar.js +1 -1
  118. package/dist/components/surface.js +1 -1
  119. package/dist/components/switch.js +1 -1
  120. package/dist/components/table-of-contents.js +1 -1
  121. package/dist/components/table.js +1 -1
  122. package/dist/components/tabs.js +1 -1
  123. package/dist/components/text.js +1 -1
  124. package/dist/components/toast.js +2 -2
  125. package/dist/components/tooltip.js +1 -1
  126. package/dist/index.js +148 -143
  127. package/dist/index.js.map +1 -1
  128. package/dist/primitives/accordion.js +1 -1
  129. package/dist/primitives/alert-dialog.js +1 -1
  130. package/dist/primitives/autocomplete.js +1 -1
  131. package/dist/primitives/avatar.js +1 -1
  132. package/dist/primitives/button.js +1 -1
  133. package/dist/primitives/checkbox-group.js +1 -1
  134. package/dist/primitives/checkbox.js +1 -1
  135. package/dist/primitives/collapsible.js +1 -1
  136. package/dist/primitives/combobox.js +1 -1
  137. package/dist/primitives/context-menu.js +1 -1
  138. package/dist/primitives/csp-provider.js +1 -1
  139. package/dist/primitives/dialog.js +1 -1
  140. package/dist/primitives/direction-provider.js +1 -1
  141. package/dist/primitives/drawer.js +2 -2
  142. package/dist/primitives/field.js +1 -1
  143. package/dist/primitives/fieldset.js +1 -1
  144. package/dist/primitives/form.js +1 -1
  145. package/dist/primitives/input.js +1 -1
  146. package/dist/primitives/menu.js +1 -1
  147. package/dist/primitives/menubar.js +1 -1
  148. package/dist/primitives/meter.js +1 -1
  149. package/dist/primitives/navigation-menu.js +1 -1
  150. package/dist/primitives/number-field.js +1 -1
  151. package/dist/primitives/otp-field.js +6 -0
  152. package/dist/primitives/otp-field.js.map +1 -0
  153. package/dist/primitives/popover.js +1 -1
  154. package/dist/primitives/preview-card.js +2 -2
  155. package/dist/primitives/progress.js +1 -1
  156. package/dist/primitives/radio-group.js +1 -1
  157. package/dist/primitives/radio.js +1 -1
  158. package/dist/primitives/scroll-area.js +1 -1
  159. package/dist/primitives/select.js +1 -1
  160. package/dist/primitives/separator.js +1 -1
  161. package/dist/primitives/slider.js +1 -1
  162. package/dist/primitives/switch.js +1 -1
  163. package/dist/primitives/tabs.js +1 -1
  164. package/dist/primitives/toast.js +1 -1
  165. package/dist/primitives/toggle-group.js +1 -1
  166. package/dist/primitives/toggle.js +1 -1
  167. package/dist/primitives/toolbar.js +1 -1
  168. package/dist/primitives/tooltip.js +1 -1
  169. package/dist/primitives.js +22 -21
  170. package/dist/scripts/theme-generator/config.d.ts.map +1 -1
  171. package/dist/scripts/theme-generator/config.js +10 -0
  172. package/dist/scripts/theme-generator/config.js.map +1 -1
  173. package/dist/src/components/autocomplete/autocomplete.d.ts +180 -0
  174. package/dist/src/components/autocomplete/autocomplete.d.ts.map +1 -0
  175. package/dist/src/components/autocomplete/index.d.ts +2 -0
  176. package/dist/src/components/autocomplete/index.d.ts.map +1 -0
  177. package/dist/src/components/button/button.d.ts +3 -3
  178. package/dist/src/components/button/button.d.ts.map +1 -1
  179. package/dist/src/components/chart/Color.d.ts +36 -52
  180. package/dist/src/components/chart/Color.d.ts.map +1 -1
  181. package/dist/src/components/checkbox/checkbox.d.ts +37 -14
  182. package/dist/src/components/checkbox/checkbox.d.ts.map +1 -1
  183. package/dist/src/components/checkbox/index.d.ts +1 -1
  184. package/dist/src/components/checkbox/index.d.ts.map +1 -1
  185. package/dist/src/components/clipboard-text/clipboard-text.d.ts.map +1 -1
  186. package/dist/src/components/collapsible/collapsible.d.ts +77 -40
  187. package/dist/src/components/collapsible/collapsible.d.ts.map +1 -1
  188. package/dist/src/components/collapsible/index.d.ts +1 -1
  189. package/dist/src/components/collapsible/index.d.ts.map +1 -1
  190. package/dist/src/components/combobox/combobox.d.ts +3 -1
  191. package/dist/src/components/combobox/combobox.d.ts.map +1 -1
  192. package/dist/src/components/command-palette/command-palette.d.ts +2 -11
  193. package/dist/src/components/command-palette/command-palette.d.ts.map +1 -1
  194. package/dist/src/components/command-palette/index.d.ts +1 -1
  195. package/dist/src/components/command-palette/index.d.ts.map +1 -1
  196. package/dist/src/components/command-palette/types.d.ts +13 -1
  197. package/dist/src/components/command-palette/types.d.ts.map +1 -1
  198. package/dist/src/components/input/index.d.ts +16 -1
  199. package/dist/src/components/input/index.d.ts.map +1 -1
  200. package/dist/src/components/input/input.d.ts +2 -2
  201. package/dist/src/components/input/input.d.ts.map +1 -1
  202. package/dist/src/components/input-group/context.d.ts +96 -0
  203. package/dist/src/components/input-group/context.d.ts.map +1 -0
  204. package/dist/src/components/input-group/index.d.ts +2 -0
  205. package/dist/src/components/input-group/index.d.ts.map +1 -0
  206. package/dist/src/components/input-group/input-group-addon.d.ts +15 -0
  207. package/dist/src/components/input-group/input-group-addon.d.ts.map +1 -0
  208. package/dist/src/components/input-group/input-group-button.d.ts +36 -0
  209. package/dist/src/components/input-group/input-group-button.d.ts.map +1 -0
  210. package/dist/src/components/input-group/input-group-input.d.ts +9 -0
  211. package/dist/src/components/input-group/input-group-input.d.ts.map +1 -0
  212. package/dist/src/components/input-group/input-group-suffix.d.ts +13 -0
  213. package/dist/src/components/input-group/input-group-suffix.d.ts.map +1 -0
  214. package/dist/src/components/input-group/input-group.d.ts +43 -0
  215. package/dist/src/components/input-group/input-group.d.ts.map +1 -0
  216. package/dist/src/components/menubar/menubar.d.ts.map +1 -1
  217. package/dist/src/components/radio/index.d.ts +1 -1
  218. package/dist/src/components/radio/index.d.ts.map +1 -1
  219. package/dist/src/components/radio/radio.d.ts +43 -7
  220. package/dist/src/components/radio/radio.d.ts.map +1 -1
  221. package/dist/src/components/select/select.d.ts +3 -3
  222. package/dist/src/components/select/select.d.ts.map +1 -1
  223. package/dist/src/components/sensitive-input/sensitive-input.d.ts +2 -2
  224. package/dist/src/components/sidebar/sidebar.d.ts.map +1 -1
  225. package/dist/src/components/switch/index.d.ts +1 -1
  226. package/dist/src/components/switch/index.d.ts.map +1 -1
  227. package/dist/src/components/switch/switch.d.ts +31 -3
  228. package/dist/src/components/switch/switch.d.ts.map +1 -1
  229. package/dist/src/components/table/table.d.ts +17 -2
  230. package/dist/src/components/table/table.d.ts.map +1 -1
  231. package/dist/src/components/table-of-contents/table-of-contents.d.ts +9 -7
  232. package/dist/src/components/table-of-contents/table-of-contents.d.ts.map +1 -1
  233. package/dist/src/components/text/text.d.ts +34 -6
  234. package/dist/src/components/text/text.d.ts.map +1 -1
  235. package/dist/src/components/text/text.type-spec.d.ts +44 -0
  236. package/dist/src/components/text/text.type-spec.d.ts.map +1 -0
  237. package/dist/src/components/toast/toast.d.ts +1 -1
  238. package/dist/src/components/toast/toast.d.ts.map +1 -1
  239. package/dist/src/index.d.ts +8 -6
  240. package/dist/src/index.d.ts.map +1 -1
  241. package/dist/src/primitives/index.d.ts +1 -0
  242. package/dist/src/primitives/index.d.ts.map +1 -1
  243. package/dist/src/primitives/otp-field.d.ts +13 -0
  244. package/dist/src/primitives/otp-field.d.ts.map +1 -0
  245. package/dist/styles/kumo-binding.css +18 -0
  246. package/dist/styles/kumo-standalone.css +1 -1
  247. package/dist/styles/kumo.css +2 -2
  248. package/dist/styles/theme-kumo.css +7 -0
  249. package/package.json +14 -2
  250. package/scripts/component-registry/discovery.ts +1 -0
  251. package/scripts/component-registry/index.test.ts +265 -0
  252. package/scripts/component-registry/index.ts +14 -0
  253. package/scripts/component-registry/metadata.ts +55 -7
  254. package/scripts/component-registry/sub-components.ts +81 -50
  255. package/scripts/component-registry/types.ts +2 -0
  256. package/scripts/theme-generator/config.ts +10 -0
  257. package/dist/chunks/Legend-ks7se6149vsa3tze.js +0 -430
  258. package/dist/chunks/Legend-ks7se6149vsa3tze.js.map +0 -1
  259. package/dist/chunks/button-oaqi7ykdisyskoos.js.map +0 -1
  260. package/dist/chunks/checkbox-mwgmohffm22ut13s.js +0 -211
  261. package/dist/chunks/checkbox-mwgmohffm22ut13s.js.map +0 -1
  262. package/dist/chunks/collapsible-jhzee3ks51d3xowb.js +0 -58
  263. package/dist/chunks/collapsible-jhzee3ks51d3xowb.js.map +0 -1
  264. package/dist/chunks/combobox-eaowwt1xr4d23gsn.js.map +0 -1
  265. package/dist/chunks/command-palette-maqtbmpfev9mysqd.js.map +0 -1
  266. package/dist/chunks/dropdown-ewte287db3vyt8t5.js.map +0 -1
  267. package/dist/chunks/input-cw05pbqdburghkus.js.map +0 -1
  268. package/dist/chunks/input-group-lfugneuz71g42n0w.js +0 -111
  269. package/dist/chunks/input-group-lfugneuz71g42n0w.js.map +0 -1
  270. package/dist/chunks/menubar-e5e4zwfagr0wx023.js +0 -96
  271. package/dist/chunks/menubar-e5e4zwfagr0wx023.js.map +0 -1
  272. package/dist/chunks/pagination-olaypvwr8swsmn8m.js.map +0 -1
  273. package/dist/chunks/radio-ihxbe37us2jnqtzf.js.map +0 -1
  274. package/dist/chunks/select-nx6ded5swra74iar.js.map +0 -1
  275. package/dist/chunks/sensitive-input-00fujb510rrn61v9.js.map +0 -1
  276. package/dist/chunks/sidebar-ltbfius1eolkl8tb.js.map +0 -1
  277. package/dist/chunks/switch-fbv3iawqo3o3jgap.js.map +0 -1
  278. package/dist/chunks/table-of-contents-f813ivi7ta23vqdm.js +0 -88
  279. package/dist/chunks/table-of-contents-f813ivi7ta23vqdm.js.map +0 -1
  280. package/dist/chunks/table-olwwulga2l3hdwlx.js.map +0 -1
  281. package/dist/chunks/text-nmyi1rkwdj37f30f.js.map +0 -1
  282. package/dist/chunks/vendor-base-ui-m5pz3e8c4grg5qmj.js +0 -22813
  283. package/dist/chunks/vendor-base-ui-m5pz3e8c4grg5qmj.js.map +0 -1
  284. package/dist/chunks/vendor-floating-ui-gr9m6tsa1cpqwn99.js +0 -1286
  285. package/dist/chunks/vendor-floating-ui-gr9m6tsa1cpqwn99.js.map +0 -1
  286. package/dist/chunks/vendor-utils-fxk97j6xi1g42z2v.js +0 -740
  287. package/dist/chunks/vendor-utils-fxk97j6xi1g42z2v.js.map +0 -1
  288. package/dist/src/components/input/input-group.d.ts +0 -39
  289. package/dist/src/components/input/input-group.d.ts.map +0 -1
@@ -1,10 +1,10 @@
1
1
  "use client";
2
- import { jsx as p } from "react/jsx-runtime";
2
+ import { jsx as u } from "react/jsx-runtime";
3
3
  import { c as d } from "./cn-ct4n7r74mh8y0f48.js";
4
- import { forwardRef as I } from "react";
5
- import { F as N } from "./field-bo5gmna16odrrb1q.js";
6
- import { I as k } from "./vendor-base-ui-m5pz3e8c4grg5qmj.js";
7
- const u = {
4
+ import { forwardRef as v } from "react";
5
+ import { F as k } from "./field-lnj619xpe8zjd26r.js";
6
+ import { I as N } from "./vendor-base-ui-ie71jahf0czyf58j.js";
7
+ const c = {
8
8
  size: {
9
9
  xs: {
10
10
  classes: "h-5 gap-1 rounded-sm px-1.5 text-xs",
@@ -25,81 +25,81 @@ const u = {
25
25
  },
26
26
  variant: {
27
27
  default: {
28
- classes: "focus:ring-kumo-hairline",
28
+ classes: "focus:ring-kumo-focus/50 focus:ring-[1.5px]",
29
29
  description: "Default input appearance"
30
30
  },
31
31
  error: {
32
- classes: "!ring-kumo-danger focus:ring-kumo-danger",
32
+ classes: "!ring-kumo-danger focus:ring-kumo-danger/50 focus:ring-[1.5px]",
33
33
  description: "Error state for validation failures"
34
34
  }
35
35
  }
36
- }, c = {
36
+ }, p = {
37
37
  size: "base",
38
38
  variant: "default"
39
39
  };
40
40
  function y({
41
- variant: r = c.variant,
42
- size: s = c.size,
43
- parentFocusIndicator: i = !1,
44
- focusIndicator: o = !1
41
+ variant: e = p.variant,
42
+ size: a = p.size,
43
+ parentFocusIndicator: o = !1,
44
+ focusIndicator: n = !1
45
45
  } = {}) {
46
46
  return d(
47
47
  // Base styles
48
- "border-0 bg-kumo-control text-kumo-default ring ring-kumo-hairline",
48
+ "border-0 bg-kumo-control text-kumo-default ring ring-kumo-line outline-none focus:outline-none",
49
49
  // Disabled state and placeholder styles (using vanilla CSS class for Chrome compatibility)
50
50
  "kumo-input-placeholder disabled:text-kumo-subtle",
51
51
  // Apply size styles from KUMO_INPUT_VARIANTS
52
- u.size[s].classes,
52
+ c.size[a].classes,
53
53
  // Apply variant styles from KUMO_INPUT_VARIANTS
54
- u.variant[r].classes,
54
+ c.variant[e].classes,
55
55
  // Focus state handling
56
- i && "focus-within:ring-kumo-hairline",
57
- o && "focus:ring-kumo-hairline"
56
+ o && (e === "error" ? "focus-within:ring-kumo-danger/50 focus-within:ring-[1.5px]" : "focus-within:ring-kumo-focus/50 focus-within:ring-[1.5px]"),
57
+ n && (e === "error" ? "focus:ring-kumo-danger/50 focus:ring-[1.5px]" : "focus:ring-kumo-focus/50 focus:ring-[1.5px]")
58
58
  );
59
59
  }
60
- const E = I((r, s) => {
60
+ const E = v((e, a) => {
61
61
  const {
62
- className: i,
63
- size: o = "base",
64
- variant: n,
65
- label: t,
66
- labelTooltip: m,
67
- description: f,
68
- error: e,
69
- ...a
70
- } = r;
71
- process.env.NODE_ENV !== "production" && n === "error" && console.warn(
62
+ className: o,
63
+ size: n = "base",
64
+ variant: t,
65
+ label: i,
66
+ labelTooltip: f,
67
+ description: m,
68
+ error: r,
69
+ ...s
70
+ } = e;
71
+ process.env.NODE_ENV !== "production" && t === "error" && console.warn(
72
72
  '[Kumo Input]: variant="error" is deprecated. Error styling is now automatically applied when the `error` prop is truthy. Simply remove the variant prop and pass an error message instead.'
73
73
  );
74
- const b = n ?? (e ? "error" : "default"), { required: g } = a;
74
+ const g = t ?? (r ? "error" : "default"), { required: b } = s;
75
75
  if (process.env.NODE_ENV !== "production") {
76
- const h = !!t, v = !!a["aria-label"], x = !!a["aria-labelledby"];
77
- !h && !v && !x && console.warn(
76
+ const x = !!i, h = !!s["aria-label"], I = !!s["aria-labelledby"];
77
+ !x && !h && !I && console.warn(
78
78
  `[Kumo Input]: Input must have an accessible name. Provide either:
79
79
  - label prop: <Input label='Email' />
80
80
  - aria-label: <Input aria-label='Email address' />
81
81
  - aria-labelledby for custom label association`
82
82
  );
83
83
  }
84
- const l = /* @__PURE__ */ p(
85
- k,
84
+ const l = /* @__PURE__ */ u(
85
+ N,
86
86
  {
87
- ref: s,
87
+ ref: a,
88
88
  className: d(
89
- y({ size: o, variant: b, focusIndicator: !0 }),
90
- i
89
+ y({ size: n, variant: g, focusIndicator: !0 }),
90
+ o
91
91
  ),
92
- ...a
92
+ ...s
93
93
  }
94
94
  );
95
- return t ? /* @__PURE__ */ p(
96
- N,
95
+ return i ? /* @__PURE__ */ u(
96
+ k,
97
97
  {
98
- label: t,
99
- required: g,
100
- labelTooltip: m,
101
- description: f,
102
- error: e ? typeof e == "string" ? { message: e, match: !0 } : e : void 0,
98
+ label: i,
99
+ required: b,
100
+ labelTooltip: f,
101
+ description: m,
102
+ error: r ? typeof r == "string" ? { message: r, match: !0 } : r : void 0,
103
103
  children: l
104
104
  }
105
105
  ) : l;
@@ -107,7 +107,7 @@ const E = I((r, s) => {
107
107
  E.displayName = "Input";
108
108
  export {
109
109
  E as I,
110
- u as K,
110
+ c as K,
111
111
  y as i
112
112
  };
113
- //# sourceMappingURL=input-cw05pbqdburghkus.js.map
113
+ //# sourceMappingURL=input-lpa5fc75tgrraafv.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"input-lpa5fc75tgrraafv.js","sources":["../../src/components/input/input.tsx"],"sourcesContent":["import { cn } from \"../../utils/cn\";\nimport {\n forwardRef,\n type ComponentPropsWithoutRef,\n type ReactNode,\n} from \"react\";\nimport { Input as BaseInput } from \"@base-ui/react/input\";\nimport { Field, type FieldErrorMatch } from \"../field/field\";\n\n/** Input size and variant definitions mapping names to their Tailwind classes. */\nexport const KUMO_INPUT_VARIANTS = {\n size: {\n xs: {\n classes: \"h-5 gap-1 rounded-sm px-1.5 text-xs\",\n description: \"Extra small input for compact UIs\",\n },\n sm: {\n classes: \"h-6.5 gap-1 rounded-md px-2 text-xs\",\n description: \"Small input for secondary fields\",\n },\n base: {\n classes: \"h-9 gap-1.5 rounded-lg px-3 text-base\",\n description: \"Default input size\",\n },\n lg: {\n classes: \"h-10 gap-2 rounded-lg px-4 text-base\",\n description: \"Large input for prominent fields\",\n },\n },\n variant: {\n default: {\n classes: \"focus:ring-kumo-focus/50 focus:ring-[1.5px]\",\n description: \"Default input appearance\",\n },\n error: {\n classes: \"!ring-kumo-danger focus:ring-kumo-danger/50 focus:ring-[1.5px]\",\n description: \"Error state for validation failures\",\n },\n },\n} as const;\n\nexport const KUMO_INPUT_DEFAULT_VARIANTS = {\n size: \"base\",\n variant: \"default\",\n} as const;\n\nexport const KUMO_INPUT_STYLING = {\n dimensions: {\n xs: { height: 20, paddingX: 6, fontSize: 12, borderRadius: 2, width: 160 },\n sm: { height: 26, paddingX: 8, fontSize: 12, borderRadius: 6, width: 200 },\n base: {\n height: 36,\n paddingX: 12,\n fontSize: 16,\n borderRadius: 8,\n width: 280,\n },\n lg: { height: 40, paddingX: 16, fontSize: 16, borderRadius: 8, width: 320 },\n },\n baseTokens: {\n background: \"color-secondary\",\n text: \"text-color-surface\",\n placeholder: \"text-color-muted\",\n ring: \"color-border\",\n },\n stateTokens: {\n focus: { ring: \"color-active\" },\n error: { ring: \"color-error\" },\n disabled: { opacity: 0.5, text: \"text-color-muted\" },\n },\n} as const;\n\n// Derived types from KUMO_INPUT_VARIANTS\nexport type KumoInputSize = keyof typeof KUMO_INPUT_VARIANTS.size;\nexport type KumoInputVariant = keyof typeof KUMO_INPUT_VARIANTS.variant;\n\nexport interface KumoInputVariantsProps {\n /**\n * Input size.\n * - `\"xs\"` — Extra small for compact UIs\n * - `\"sm\"` — Small for secondary fields\n * - `\"base\"` — Default size\n * - `\"lg\"` — Large for prominent fields\n * @default \"base\"\n */\n size?: KumoInputSize;\n /**\n * Visual variant.\n * - `\"default\"` — Standard input\n * - `\"error\"` — Error state for validation failures\n * @default \"default\"\n */\n variant?: KumoInputVariant;\n parentFocusIndicator?: boolean;\n focusIndicator?: boolean;\n}\n\n// Omit native `size` attribute (number) to avoid conflict with our custom `size` variant\ntype BaseInputProps = Omit<ComponentPropsWithoutRef<typeof BaseInput>, \"size\">;\n\nexport function inputVariants({\n variant = KUMO_INPUT_DEFAULT_VARIANTS.variant,\n size = KUMO_INPUT_DEFAULT_VARIANTS.size,\n parentFocusIndicator = false,\n focusIndicator = false,\n}: KumoInputVariantsProps = {}) {\n return cn(\n // Base styles\n \"border-0 bg-kumo-control text-kumo-default ring ring-kumo-line outline-none focus:outline-none\",\n // Disabled state and placeholder styles (using vanilla CSS class for Chrome compatibility)\n \"kumo-input-placeholder disabled:text-kumo-subtle\",\n // Apply size styles from KUMO_INPUT_VARIANTS\n KUMO_INPUT_VARIANTS.size[size].classes,\n // Apply variant styles from KUMO_INPUT_VARIANTS\n KUMO_INPUT_VARIANTS.variant[variant].classes,\n // Focus state handling\n parentFocusIndicator &&\n (variant === \"error\"\n ? \"focus-within:ring-kumo-danger/50 focus-within:ring-[1.5px]\"\n : \"focus-within:ring-kumo-focus/50 focus-within:ring-[1.5px]\"),\n focusIndicator &&\n (variant === \"error\"\n ? \"focus:ring-kumo-danger/50 focus:ring-[1.5px]\"\n : \"focus:ring-kumo-focus/50 focus:ring-[1.5px]\"),\n );\n}\n\nexport const Input = forwardRef<HTMLInputElement, InputProps>((props, ref) => {\n const {\n className,\n size = \"base\",\n variant: variantProp,\n label,\n labelTooltip,\n description,\n error,\n ...inputProps\n } = props;\n\n // Deprecation warning for variant=\"error\"\n if (process.env.NODE_ENV !== \"production\" && variantProp === \"error\") {\n console.warn(\n '[Kumo Input]: variant=\"error\" is deprecated. ' +\n \"Error styling is now automatically applied when the `error` prop is truthy. \" +\n \"Simply remove the variant prop and pass an error message instead.\",\n );\n }\n\n // Auto-apply error styling when error prop is truthy\n // Explicit variant prop takes precedence for backwards compatibility\n const variant = variantProp ?? (error ? \"error\" : \"default\");\n\n // Extract required from inputProps to pass to Field for label decoration\n const { required } = inputProps;\n\n // A11y enforcement: warn in dev if no accessible name provided\n if (process.env.NODE_ENV !== \"production\") {\n const hasLabel = Boolean(label);\n const hasAriaLabel = Boolean(inputProps[\"aria-label\"]);\n const hasAriaLabelledBy = Boolean(inputProps[\"aria-labelledby\"]);\n\n if (!hasLabel && !hasAriaLabel && !hasAriaLabelledBy) {\n console.warn(\n \"[Kumo Input]: Input must have an accessible name. Provide either:\\n\" +\n \" - label prop: <Input label='Email' />\\n\" +\n \" - aria-label: <Input aria-label='Email address' />\\n\" +\n \" - aria-labelledby for custom label association\",\n );\n }\n }\n\n const input = (\n <BaseInput\n ref={ref}\n className={cn(\n inputVariants({ size, variant, focusIndicator: true }),\n className,\n )}\n {...inputProps}\n />\n );\n\n // Render with Field wrapper if label is provided\n if (label) {\n return (\n <Field\n label={label}\n required={required}\n labelTooltip={labelTooltip}\n description={description}\n error={\n error\n ? typeof error === \"string\"\n ? { message: error, match: true }\n : error\n : undefined\n }\n >\n {input}\n </Field>\n );\n }\n\n // Render bare input without Field wrapper\n return input;\n});\n\nInput.displayName = \"Input\";\n\n/**\n * Input component props with accessibility guidance.\n *\n * **Accessible Name Required:** Input should have one of:\n * 1. `label` prop (recommended) - enables Field wrapper with label/description/error\n * 2. `placeholder` + `aria-label` - for bare inputs with visual placeholder\n * 3. `aria-labelledby` - for custom label association\n *\n * Missing accessible names will trigger console warnings in development.\n *\n * @example\n * // Recommended: Built-in Field wrapper\n * <Input label=\"Email\" placeholder=\"you@example.com\" />\n *\n * @example\n * // Bare input with placeholder and aria-label\n * <Input placeholder=\"Search...\" aria-label=\"Search products\" />\n *\n * @example\n * // Custom label association\n * <label id=\"email-label\">Email</label>\n * <Input aria-labelledby=\"email-label\" />\n *\n * @example\n * // With description and error\n * <Input\n * label=\"Password\"\n * description=\"Must be at least 8 characters\"\n * error=\"Password is too short\"\n * />\n */\nexport type InputProps = Pick<KumoInputVariantsProps, \"size\" | \"variant\"> &\n BaseInputProps & {\n /** Label content for the input (enables Field wrapper) - can be a string or any React node */\n label?: ReactNode;\n /** Tooltip content to display next to the label via an info icon */\n labelTooltip?: ReactNode;\n /** Helper text displayed below the input */\n description?: ReactNode;\n /** Error message or validation error object */\n error?: string | { message: ReactNode; match: FieldErrorMatch };\n };\n"],"names":["KUMO_INPUT_VARIANTS","KUMO_INPUT_DEFAULT_VARIANTS","inputVariants","variant","size","parentFocusIndicator","focusIndicator","cn","Input","forwardRef","props","ref","className","variantProp","label","labelTooltip","description","error","inputProps","required","hasLabel","hasAriaLabel","hasAriaLabelledBy","input","jsx","BaseInput","Field"],"mappings":";;;;;;AAUO,MAAMA,IAAsB;AAAA,EACjC,MAAM;AAAA,IACJ,IAAI;AAAA,MACF,SAAS;AAAA,MACT,aAAa;AAAA,IAAA;AAAA,IAEf,IAAI;AAAA,MACF,SAAS;AAAA,MACT,aAAa;AAAA,IAAA;AAAA,IAEf,MAAM;AAAA,MACJ,SAAS;AAAA,MACT,aAAa;AAAA,IAAA;AAAA,IAEf,IAAI;AAAA,MACF,SAAS;AAAA,MACT,aAAa;AAAA,IAAA;AAAA,EACf;AAAA,EAEF,SAAS;AAAA,IACP,SAAS;AAAA,MACP,SAAS;AAAA,MACT,aAAa;AAAA,IAAA;AAAA,IAEf,OAAO;AAAA,MACL,SAAS;AAAA,MACT,aAAa;AAAA,IAAA;AAAA,EACf;AAEJ,GAEaC,IAA8B;AAAA,EACzC,MAAM;AAAA,EACN,SAAS;AACX;AAwDO,SAASC,EAAc;AAAA,EAC5B,SAAAC,IAAUF,EAA4B;AAAA,EACtC,MAAAG,IAAOH,EAA4B;AAAA,EACnC,sBAAAI,IAAuB;AAAA,EACvB,gBAAAC,IAAiB;AACnB,IAA4B,IAAI;AAC9B,SAAOC;AAAA;AAAA,IAEL;AAAA;AAAA,IAEA;AAAA;AAAA,IAEAP,EAAoB,KAAKI,CAAI,EAAE;AAAA;AAAA,IAE/BJ,EAAoB,QAAQG,CAAO,EAAE;AAAA;AAAA,IAErCE,MACGF,MAAY,UACT,+DACA;AAAA,IACNG,MACGH,MAAY,UACT,iDACA;AAAA,EAAA;AAEV;AAEO,MAAMK,IAAQC,EAAyC,CAACC,GAAOC,MAAQ;AAC5E,QAAM;AAAA,IACJ,WAAAC;AAAA,IACA,MAAAR,IAAO;AAAA,IACP,SAASS;AAAA,IACT,OAAAC;AAAA,IACA,cAAAC;AAAA,IACA,aAAAC;AAAA,IACA,OAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,IACDR;AAGJ,EAAI,QAAQ,IAAI,aAAa,gBAAgBG,MAAgB,WAC3D,QAAQ;AAAA,IACN;AAAA,EAAA;AAQJ,QAAMV,IAAUU,MAAgBI,IAAQ,UAAU,YAG5C,EAAE,UAAAE,MAAaD;AAGrB,MAAI,QAAQ,IAAI,aAAa,cAAc;AACzC,UAAME,IAAW,EAAQN,GACnBO,IAAe,EAAQH,EAAW,YAAY,GAC9CI,IAAoB,EAAQJ,EAAW,iBAAiB;AAE9D,IAAI,CAACE,KAAY,CAACC,KAAgB,CAACC,KACjC,QAAQ;AAAA,MACN;AAAA;AAAA;AAAA;AAAA,IAAA;AAAA,EAMN;AAEA,QAAMC,IACJ,gBAAAC;AAAA,IAACC;AAAAA,IAAA;AAAA,MACC,KAAAd;AAAA,MACA,WAAWJ;AAAA,QACTL,EAAc,EAAE,MAAAE,GAAM,SAAAD,GAAS,gBAAgB,IAAM;AAAA,QACrDS;AAAA,MAAA;AAAA,MAED,GAAGM;AAAA,IAAA;AAAA,EAAA;AAKR,SAAIJ,IAEA,gBAAAU;AAAA,IAACE;AAAA,IAAA;AAAA,MACC,OAAAZ;AAAA,MACA,UAAAK;AAAA,MACA,cAAAJ;AAAA,MACA,aAAAC;AAAA,MACA,OACEC,IACI,OAAOA,KAAU,WACf,EAAE,SAASA,GAAO,OAAO,GAAA,IACzBA,IACF;AAAA,MAGL,UAAAM;AAAA,IAAA;AAAA,EAAA,IAMAA;AACT,CAAC;AAEDf,EAAM,cAAc;"}
@@ -2,8 +2,8 @@
2
2
  import { jsx as e, jsxs as c, Fragment as f } from "react/jsx-runtime";
3
3
  import { Info as p } from "@phosphor-icons/react";
4
4
  import { c as n } from "./cn-ct4n7r74mh8y0f48.js";
5
- import { B as u } from "./button-oaqi7ykdisyskoos.js";
6
- import { T as d } from "./tooltip-hikjvdbg3xghnq1x.js";
5
+ import { B as u } from "./button-6by9ntsa3nj553mq.js";
6
+ import { T as d } from "./tooltip-odudhkxe282wxinq.js";
7
7
  const T = {
8
8
  // Label currently has no variant options but structure is ready for future additions
9
9
  }, g = {};
@@ -65,4 +65,4 @@ export {
65
65
  g as b,
66
66
  b as l
67
67
  };
68
- //# sourceMappingURL=label-cvyvbqmt4mt757ff.js.map
68
+ //# sourceMappingURL=label-be8m7qzlakzig2sl.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"label-cvyvbqmt4mt757ff.js","sources":["../../src/components/label/label.tsx"],"sourcesContent":["import { Info } from \"@phosphor-icons/react\";\nimport type { ReactNode } from \"react\";\nimport { cn } from \"../../utils/cn\";\nimport { Button } from \"../button\";\nimport { Tooltip } from \"../tooltip\";\n\n/** Label variant definitions (currently empty, reserved for future additions). */\nexport const KUMO_LABEL_VARIANTS = {\n // Label currently has no variant options but structure is ready for future additions\n} as const;\n\nexport const KUMO_LABEL_DEFAULT_VARIANTS = {} as const;\n\n// Derived types from KUMO_LABEL_VARIANTS\nexport interface KumoLabelVariantsProps {}\n\nexport function labelVariants(_props: KumoLabelVariantsProps = {}) {\n return cn(\n // Base styles - when used standalone, apply text styling\n // When used inside Field, the parent FieldBase.Label provides these styles\n \"m-0 text-base font-medium text-kumo-default\",\n );\n}\n\nexport function labelContentVariants() {\n return cn(\n // Content wrapper styles - always applied\n \"inline-flex items-center gap-1\",\n );\n}\n\n/**\n * Label component props.\n *\n * @example\n * ```tsx\n * <Label>Email</Label>\n * <Label showOptional>Middle Name</Label>\n * <Label tooltip=\"We'll use this to send you updates\">Email</Label>\n * ```\n */\nexport interface LabelProps extends KumoLabelVariantsProps {\n /** The label content — can be a string or any React node. */\n children: ReactNode;\n /** When `true`, shows gray \"(optional)\" text after the label. */\n showOptional?: boolean;\n /** Tooltip content displayed next to the label via an info icon. */\n tooltip?: ReactNode;\n /** Additional CSS classes merged via `cn()`. */\n className?: string;\n /** The id of the form element this label is associated with */\n htmlFor?: string;\n /**\n * When true, only renders the inline content (indicators, tooltip) without\n * the outer label element with font styling. Useful when composed inside another\n * label element that already provides the text styling.\n * @default false\n */\n asContent?: boolean;\n}\n\n/**\n * Label component for form fields.\n *\n * Provides a standardized way to display labels with optional indicators:\n * - Optional indicator: gray \"(optional)\" text when `showOptional={true}`\n * - Tooltip: info icon with hover tooltip for additional context\n *\n * @example\n * // Basic label\n * <Label>Email</Label>\n *\n * @example\n * // Optional field with indicator\n * <Label showOptional>Middle Name</Label>\n *\n * @example\n * // With tooltip\n * <Label tooltip=\"We'll use this to send you updates\">Email</Label>\n *\n * @example\n * // With ReactNode children\n * <Label>\n * <span>Custom label with <strong>bold</strong> text</span>\n * </Label>\n */\nexport function Label({\n children,\n showOptional = false,\n tooltip,\n className,\n htmlFor,\n asContent = false,\n}: LabelProps) {\n const content = (\n <>\n {children}\n {showOptional && (\n <span className=\"font-normal text-kumo-strong\">(optional)</span>\n )}\n {tooltip && (\n <Tooltip\n content={tooltip}\n render={\n <Button\n variant=\"ghost\"\n size=\"xs\"\n shape=\"square\"\n aria-label=\"More information\"\n >\n <Info className=\"size-4\" />\n </Button>\n }\n />\n )}\n </>\n );\n\n // When used as content inside another styled element, just render inline\n if (asContent) {\n return (\n <span className={cn(labelContentVariants(), className)}>{content}</span>\n );\n }\n\n // When used standalone, render as <label> for accessibility\n return (\n <label\n htmlFor={htmlFor}\n className={cn(labelVariants(), labelContentVariants(), className)}\n >\n {content}\n </label>\n );\n}\n\nLabel.displayName = \"Label\";\n"],"names":["KUMO_LABEL_VARIANTS","KUMO_LABEL_DEFAULT_VARIANTS","labelVariants","_props","cn","labelContentVariants","Label","children","showOptional","tooltip","className","htmlFor","asContent","content","jsxs","Fragment","jsx","Tooltip","Button","Info"],"mappings":";;;;;;AAOO,MAAMA,IAAsB;AAAA;AAEnC,GAEaC,IAA8B,CAAA;AAKpC,SAASC,EAAcC,IAAiC,IAAI;AACjE,SAAOC;AAAA;AAAA;AAAA,IAGL;AAAA,EAAA;AAEJ;AAEO,SAASC,IAAuB;AACrC,SAAOD;AAAA;AAAA,IAEL;AAAA,EAAA;AAEJ;AAyDO,SAASE,EAAM;AAAA,EACpB,UAAAC;AAAA,EACA,cAAAC,IAAe;AAAA,EACf,SAAAC;AAAA,EACA,WAAAC;AAAA,EACA,SAAAC;AAAA,EACA,WAAAC,IAAY;AACd,GAAe;AACb,QAAMC,IACJ,gBAAAC,EAAAC,GAAA,EACG,UAAA;AAAA,IAAAR;AAAA,IACAC,KACC,gBAAAQ,EAAC,QAAA,EAAK,WAAU,gCAA+B,UAAA,cAAU;AAAA,IAE1DP,KACC,gBAAAO;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,SAASR;AAAA,QACT,QACE,gBAAAO;AAAA,UAACE;AAAA,UAAA;AAAA,YACC,SAAQ;AAAA,YACR,MAAK;AAAA,YACL,OAAM;AAAA,YACN,cAAW;AAAA,YAEX,UAAA,gBAAAF,EAACG,GAAA,EAAK,WAAU,SAAA,CAAS;AAAA,UAAA;AAAA,QAAA;AAAA,MAC3B;AAAA,IAAA;AAAA,EAEJ,GAEJ;AAIF,SAAIP,IAEA,gBAAAI,EAAC,UAAK,WAAWZ,EAAGC,KAAwBK,CAAS,GAAI,UAAAG,GAAQ,IAMnE,gBAAAG;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,SAAAL;AAAA,MACA,WAAWP,EAAGF,EAAA,GAAiBG,EAAA,GAAwBK,CAAS;AAAA,MAE/D,UAAAG;AAAA,IAAA;AAAA,EAAA;AAGP;AAEAP,EAAM,cAAc;"}
1
+ {"version":3,"file":"label-be8m7qzlakzig2sl.js","sources":["../../src/components/label/label.tsx"],"sourcesContent":["import { Info } from \"@phosphor-icons/react\";\nimport type { ReactNode } from \"react\";\nimport { cn } from \"../../utils/cn\";\nimport { Button } from \"../button\";\nimport { Tooltip } from \"../tooltip\";\n\n/** Label variant definitions (currently empty, reserved for future additions). */\nexport const KUMO_LABEL_VARIANTS = {\n // Label currently has no variant options but structure is ready for future additions\n} as const;\n\nexport const KUMO_LABEL_DEFAULT_VARIANTS = {} as const;\n\n// Derived types from KUMO_LABEL_VARIANTS\nexport interface KumoLabelVariantsProps {}\n\nexport function labelVariants(_props: KumoLabelVariantsProps = {}) {\n return cn(\n // Base styles - when used standalone, apply text styling\n // When used inside Field, the parent FieldBase.Label provides these styles\n \"m-0 text-base font-medium text-kumo-default\",\n );\n}\n\nexport function labelContentVariants() {\n return cn(\n // Content wrapper styles - always applied\n \"inline-flex items-center gap-1\",\n );\n}\n\n/**\n * Label component props.\n *\n * @example\n * ```tsx\n * <Label>Email</Label>\n * <Label showOptional>Middle Name</Label>\n * <Label tooltip=\"We'll use this to send you updates\">Email</Label>\n * ```\n */\nexport interface LabelProps extends KumoLabelVariantsProps {\n /** The label content — can be a string or any React node. */\n children: ReactNode;\n /** When `true`, shows gray \"(optional)\" text after the label. */\n showOptional?: boolean;\n /** Tooltip content displayed next to the label via an info icon. */\n tooltip?: ReactNode;\n /** Additional CSS classes merged via `cn()`. */\n className?: string;\n /** The id of the form element this label is associated with */\n htmlFor?: string;\n /**\n * When true, only renders the inline content (indicators, tooltip) without\n * the outer label element with font styling. Useful when composed inside another\n * label element that already provides the text styling.\n * @default false\n */\n asContent?: boolean;\n}\n\n/**\n * Label component for form fields.\n *\n * Provides a standardized way to display labels with optional indicators:\n * - Optional indicator: gray \"(optional)\" text when `showOptional={true}`\n * - Tooltip: info icon with hover tooltip for additional context\n *\n * @example\n * // Basic label\n * <Label>Email</Label>\n *\n * @example\n * // Optional field with indicator\n * <Label showOptional>Middle Name</Label>\n *\n * @example\n * // With tooltip\n * <Label tooltip=\"We'll use this to send you updates\">Email</Label>\n *\n * @example\n * // With ReactNode children\n * <Label>\n * <span>Custom label with <strong>bold</strong> text</span>\n * </Label>\n */\nexport function Label({\n children,\n showOptional = false,\n tooltip,\n className,\n htmlFor,\n asContent = false,\n}: LabelProps) {\n const content = (\n <>\n {children}\n {showOptional && (\n <span className=\"font-normal text-kumo-strong\">(optional)</span>\n )}\n {tooltip && (\n <Tooltip\n content={tooltip}\n render={\n <Button\n variant=\"ghost\"\n size=\"xs\"\n shape=\"square\"\n aria-label=\"More information\"\n >\n <Info className=\"size-4\" />\n </Button>\n }\n />\n )}\n </>\n );\n\n // When used as content inside another styled element, just render inline\n if (asContent) {\n return (\n <span className={cn(labelContentVariants(), className)}>{content}</span>\n );\n }\n\n // When used standalone, render as <label> for accessibility\n return (\n <label\n htmlFor={htmlFor}\n className={cn(labelVariants(), labelContentVariants(), className)}\n >\n {content}\n </label>\n );\n}\n\nLabel.displayName = \"Label\";\n"],"names":["KUMO_LABEL_VARIANTS","KUMO_LABEL_DEFAULT_VARIANTS","labelVariants","_props","cn","labelContentVariants","Label","children","showOptional","tooltip","className","htmlFor","asContent","content","jsxs","Fragment","jsx","Tooltip","Button","Info"],"mappings":";;;;;;AAOO,MAAMA,IAAsB;AAAA;AAEnC,GAEaC,IAA8B,CAAA;AAKpC,SAASC,EAAcC,IAAiC,IAAI;AACjE,SAAOC;AAAA;AAAA;AAAA,IAGL;AAAA,EAAA;AAEJ;AAEO,SAASC,IAAuB;AACrC,SAAOD;AAAA;AAAA,IAEL;AAAA,EAAA;AAEJ;AAyDO,SAASE,EAAM;AAAA,EACpB,UAAAC;AAAA,EACA,cAAAC,IAAe;AAAA,EACf,SAAAC;AAAA,EACA,WAAAC;AAAA,EACA,SAAAC;AAAA,EACA,WAAAC,IAAY;AACd,GAAe;AACb,QAAMC,IACJ,gBAAAC,EAAAC,GAAA,EACG,UAAA;AAAA,IAAAR;AAAA,IACAC,KACC,gBAAAQ,EAAC,QAAA,EAAK,WAAU,gCAA+B,UAAA,cAAU;AAAA,IAE1DP,KACC,gBAAAO;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,SAASR;AAAA,QACT,QACE,gBAAAO;AAAA,UAACE;AAAA,UAAA;AAAA,YACC,SAAQ;AAAA,YACR,MAAK;AAAA,YACL,OAAM;AAAA,YACN,cAAW;AAAA,YAEX,UAAA,gBAAAF,EAACG,GAAA,EAAK,WAAU,SAAA,CAAS;AAAA,UAAA;AAAA,QAAA;AAAA,MAC3B;AAAA,IAAA;AAAA,EAEJ,GAEJ;AAIF,SAAIP,IAEA,gBAAAI,EAAC,UAAK,WAAWZ,EAAGC,KAAwBK,CAAS,GAAI,UAAAG,GAAQ,IAMnE,gBAAAG;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,SAAAL;AAAA,MACA,WAAWP,EAAGF,EAAA,GAAiBG,EAAA,GAAwBK,CAAS;AAAA,MAE/D,UAAAG;AAAA,IAAA;AAAA,EAAA;AAGP;AAEAP,EAAM,cAAc;"}
@@ -2,10 +2,10 @@
2
2
  import { jsx as s } from "react/jsx-runtime";
3
3
  import { forwardRef as y, Children as p, isValidElement as C, Fragment as g } from "react";
4
4
  import { c as a } from "./cn-ct4n7r74mh8y0f48.js";
5
- import { aQ as L, aR as S } from "./vendor-base-ui-m5pz3e8c4grg5qmj.js";
6
- const R = "overflow-hidden rounded-lg bg-kumo-base shadow-xs ring ring-kumo-line", A = "flex w-full flex-col overflow-hidden rounded-lg bg-kumo-elevated text-base ring ring-kumo-hairline", _ = "-my-2 flex items-center gap-2 bg-kumo-elevated p-4 text-base font-medium text-kumo-strong", E = "relative flex flex-col gap-2 overflow-hidden rounded-lg bg-kumo-base p-4 pr-3 text-inherit no-underline ring ring-kumo-fill";
5
+ import { aU as L, aV as S } from "./vendor-base-ui-ie71jahf0czyf58j.js";
6
+ const A = "overflow-hidden rounded-lg bg-kumo-base shadow-xs ring ring-kumo-line", R = "flex w-full flex-col overflow-hidden rounded-lg bg-kumo-elevated text-base ring ring-kumo-hairline", _ = "-my-2 flex items-center gap-2 bg-kumo-elevated p-4 text-base font-medium text-kumo-strong", E = "relative flex flex-col gap-2 overflow-hidden rounded-lg bg-kumo-base p-4 pr-3 text-inherit no-underline ring ring-kumo-fill";
7
7
  function x(r = {}) {
8
- return a(R);
8
+ return a(A);
9
9
  }
10
10
  function i(r) {
11
11
  return p.toArray(r).some((e) => C(e) ? e.type === t || e.type === n ? !0 : e.type === g ? i(e.props.children) : !1 : !1);
@@ -13,7 +13,7 @@ function i(r) {
13
13
  const d = y(function({ children: e, className: o, render: l, ...m }, u) {
14
14
  const f = i(e), c = {
15
15
  className: a(
16
- f ? A : x(),
16
+ f ? R : x(),
17
17
  o
18
18
  )
19
19
  };
@@ -43,4 +43,4 @@ const h = Object.assign(d, {
43
43
  export {
44
44
  h as L
45
45
  };
46
- //# sourceMappingURL=layer-card-ljqth3yxgnk04v2o.js.map
46
+ //# sourceMappingURL=layer-card-hvivdirwwnyq88wa.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"layer-card-ljqth3yxgnk04v2o.js","sources":["../../src/components/layer-card/layer-card.tsx"],"sourcesContent":["import {\n Children,\n Fragment,\n forwardRef,\n isValidElement,\n type PropsWithChildren,\n type ReactElement,\n type ReactNode,\n} from \"react\";\nimport { mergeProps } from \"@base-ui/react/merge-props\";\nimport { useRender } from \"@base-ui/react/use-render\";\nimport { cn } from \"../../utils/cn\";\n\nconst LAYER_CARD_SURFACE_CLASSES =\n \"overflow-hidden rounded-lg bg-kumo-base shadow-xs ring ring-kumo-line\";\nconst LAYER_CARD_LAYERED_ROOT_CLASSES =\n \"flex w-full flex-col overflow-hidden rounded-lg bg-kumo-elevated text-base ring ring-kumo-hairline\";\nconst LAYER_CARD_SECONDARY_CLASSES =\n \"-my-2 flex items-center gap-2 bg-kumo-elevated p-4 text-base font-medium text-kumo-strong\";\nconst LAYER_CARD_PRIMARY_CLASSES =\n \"relative flex flex-col gap-2 overflow-hidden rounded-lg bg-kumo-base p-4 pr-3 text-inherit no-underline ring ring-kumo-fill\";\n\n/** LayerCard variant definitions (currently empty, reserved for future additions). */\nexport const KUMO_LAYER_CARD_VARIANTS = {\n // LayerCard currently has no variant options but structure is ready for future additions\n} as const;\n\nexport const KUMO_LAYER_CARD_DEFAULT_VARIANTS = {} as const;\n\n// Derived types from KUMO_LAYER_CARD_VARIANTS\nexport interface KumoLayerCardVariantsProps {}\n\nexport function layerCardVariants(_props: KumoLayerCardVariantsProps = {}) {\n return cn(LAYER_CARD_SURFACE_CLASSES);\n}\n\nfunction hasLayerCardSections(children: ReactNode): boolean {\n return Children.toArray(children).some((child): boolean => {\n if (!isValidElement(child)) {\n return false;\n }\n\n if (child.type === LayerCardPrimary || child.type === LayerCardSecondary) {\n return true;\n }\n\n if (child.type === Fragment) {\n const fragmentChild = child as ReactElement<{ children?: ReactNode }>;\n return hasLayerCardSections(fragmentChild.props.children);\n }\n\n return false;\n });\n}\n\n/**\n * LayerCard component props.\n *\n * @example\n * ```tsx\n * <LayerCard className=\"p-4\">\n * Get started with Kumo\n * </LayerCard>\n *\n * <LayerCard>\n * <LayerCard.Secondary>Next Steps</LayerCard.Secondary>\n * <LayerCard.Primary>Get started with Kumo</LayerCard.Primary>\n * </LayerCard>\n * ```\n */\nexport type LayerCardProps = useRender.ComponentProps<\"div\"> &\n KumoLayerCardVariantsProps;\n\nexport type LayerCardSectionProps = PropsWithChildren<{\n /** Additional CSS classes merged via `cn()`. */\n className?: string;\n}>;\n\n/**\n * Card container for both simple surfaces and layered layouts.\n *\n * Render children directly for a single-surface card, or use\n * `LayerCard.Secondary` and `LayerCard.Primary` for the layered card treatment.\n *\n * @example\n * ```tsx\n * <LayerCard className=\"rounded-lg p-4\">Card content</LayerCard>\n * ```\n *\n * @example\n * ```tsx\n * <LayerCard>\n * <LayerCard.Secondary>Getting Started</LayerCard.Secondary>\n * <LayerCard.Primary>Quick start guide</LayerCard.Primary>\n * </LayerCard>\n * ```\n */\nconst LayerCardRoot = forwardRef<HTMLDivElement, LayerCardProps>(function LayerCard(\n { children, className, render, ...props },\n ref,\n) {\n const hasStructuredLayers = hasLayerCardSections(children);\n\n const defaultProps: useRender.ElementProps<\"div\"> = {\n className: cn(\n hasStructuredLayers ? LAYER_CARD_LAYERED_ROOT_CLASSES : layerCardVariants(),\n className,\n ),\n };\n\n return useRender({\n defaultTagName: \"div\",\n render,\n ref,\n props: mergeProps<\"div\">(defaultProps, props, { children }),\n });\n});\n\nfunction LayerCardSecondary({\n children,\n className,\n}: LayerCardSectionProps) {\n return <div className={cn(LAYER_CARD_SECONDARY_CLASSES, className)}>{children}</div>;\n}\n\nfunction LayerCardPrimary({ children, className }: LayerCardSectionProps) {\n return <div className={cn(LAYER_CARD_PRIMARY_CLASSES, className)}>{children}</div>;\n}\n\nLayerCardRoot.displayName = \"LayerCard\";\nLayerCardSecondary.displayName = \"LayerCard.Secondary\";\nLayerCardPrimary.displayName = \"LayerCard.Primary\";\n\ntype LayerCardComponent = typeof LayerCardRoot & {\n Primary: typeof LayerCardPrimary;\n Secondary: typeof LayerCardSecondary;\n};\n\nconst LayerCard = Object.assign(LayerCardRoot, {\n Primary: LayerCardPrimary,\n Secondary: LayerCardSecondary,\n}) as LayerCardComponent;\n\nexport { LayerCard };\n"],"names":["LAYER_CARD_SURFACE_CLASSES","LAYER_CARD_LAYERED_ROOT_CLASSES","LAYER_CARD_SECONDARY_CLASSES","LAYER_CARD_PRIMARY_CLASSES","layerCardVariants","_props","cn","hasLayerCardSections","children","Children","child","isValidElement","LayerCardPrimary","LayerCardSecondary","Fragment","LayerCardRoot","forwardRef","className","render","props","ref","hasStructuredLayers","defaultProps","useRender","mergeProps","LayerCard"],"mappings":";;;;;AAaA,MAAMA,IACJ,yEACIC,IACJ,sGACIC,IACJ,6FACIC,IACJ;AAYK,SAASC,EAAkBC,IAAqC,IAAI;AACzE,SAAOC,EAAGN,CAA0B;AACtC;AAEA,SAASO,EAAqBC,GAA8B;AAC1D,SAAOC,EAAS,QAAQD,CAAQ,EAAE,KAAK,CAACE,MACjCC,EAAeD,CAAK,IAIrBA,EAAM,SAASE,KAAoBF,EAAM,SAASG,IAC7C,KAGLH,EAAM,SAASI,IAEVP,EADeG,EACoB,MAAM,QAAQ,IAGnD,KAZE,EAaV;AACH;AA4CA,MAAMK,IAAgBC,EAA2C,SAC/D,EAAE,UAAAR,GAAU,WAAAS,GAAW,QAAAC,GAAQ,GAAGC,EAAA,GAClCC,GACA;AACA,QAAMC,IAAsBd,EAAqBC,CAAQ,GAEnDc,IAA8C;AAAA,IAClD,WAAWhB;AAAA,MACTe,IAAsBpB,IAAkCG,EAAA;AAAA,MACxDa;AAAA,IAAA;AAAA,EACF;AAGF,SAAOM,EAAU;AAAA,IACf,gBAAgB;AAAA,IAChB,QAAAL;AAAA,IACA,KAAAE;AAAA,IACA,OAAOI,EAAkBF,GAAcH,GAAO,EAAE,UAAAX,GAAU;AAAA,EAAA,CAC3D;AACH,CAAC;AAED,SAASK,EAAmB;AAAA,EAC1B,UAAAL;AAAA,EACA,WAAAS;AACF,GAA0B;AACxB,2BAAQ,OAAA,EAAI,WAAWX,EAAGJ,GAA8Be,CAAS,GAAI,UAAAT,GAAS;AAChF;AAEA,SAASI,EAAiB,EAAE,UAAAJ,GAAU,WAAAS,KAAoC;AACxE,2BAAQ,OAAA,EAAI,WAAWX,EAAGH,GAA4Bc,CAAS,GAAI,UAAAT,GAAS;AAC9E;AAEAO,EAAc,cAAc;AAC5BF,EAAmB,cAAc;AACjCD,EAAiB,cAAc;AAO/B,MAAMa,IAAY,OAAO,OAAOV,GAAe;AAAA,EAC7C,SAASH;AAAA,EACT,WAAWC;AACb,CAAC;"}
1
+ {"version":3,"file":"layer-card-hvivdirwwnyq88wa.js","sources":["../../src/components/layer-card/layer-card.tsx"],"sourcesContent":["import {\n Children,\n Fragment,\n forwardRef,\n isValidElement,\n type PropsWithChildren,\n type ReactElement,\n type ReactNode,\n} from \"react\";\nimport { mergeProps } from \"@base-ui/react/merge-props\";\nimport { useRender } from \"@base-ui/react/use-render\";\nimport { cn } from \"../../utils/cn\";\n\nconst LAYER_CARD_SURFACE_CLASSES =\n \"overflow-hidden rounded-lg bg-kumo-base shadow-xs ring ring-kumo-line\";\nconst LAYER_CARD_LAYERED_ROOT_CLASSES =\n \"flex w-full flex-col overflow-hidden rounded-lg bg-kumo-elevated text-base ring ring-kumo-hairline\";\nconst LAYER_CARD_SECONDARY_CLASSES =\n \"-my-2 flex items-center gap-2 bg-kumo-elevated p-4 text-base font-medium text-kumo-strong\";\nconst LAYER_CARD_PRIMARY_CLASSES =\n \"relative flex flex-col gap-2 overflow-hidden rounded-lg bg-kumo-base p-4 pr-3 text-inherit no-underline ring ring-kumo-fill\";\n\n/** LayerCard variant definitions (currently empty, reserved for future additions). */\nexport const KUMO_LAYER_CARD_VARIANTS = {\n // LayerCard currently has no variant options but structure is ready for future additions\n} as const;\n\nexport const KUMO_LAYER_CARD_DEFAULT_VARIANTS = {} as const;\n\n// Derived types from KUMO_LAYER_CARD_VARIANTS\nexport interface KumoLayerCardVariantsProps {}\n\nexport function layerCardVariants(_props: KumoLayerCardVariantsProps = {}) {\n return cn(LAYER_CARD_SURFACE_CLASSES);\n}\n\nfunction hasLayerCardSections(children: ReactNode): boolean {\n return Children.toArray(children).some((child): boolean => {\n if (!isValidElement(child)) {\n return false;\n }\n\n if (child.type === LayerCardPrimary || child.type === LayerCardSecondary) {\n return true;\n }\n\n if (child.type === Fragment) {\n const fragmentChild = child as ReactElement<{ children?: ReactNode }>;\n return hasLayerCardSections(fragmentChild.props.children);\n }\n\n return false;\n });\n}\n\n/**\n * LayerCard component props.\n *\n * @example\n * ```tsx\n * <LayerCard className=\"p-4\">\n * Get started with Kumo\n * </LayerCard>\n *\n * <LayerCard>\n * <LayerCard.Secondary>Next Steps</LayerCard.Secondary>\n * <LayerCard.Primary>Get started with Kumo</LayerCard.Primary>\n * </LayerCard>\n * ```\n */\nexport type LayerCardProps = useRender.ComponentProps<\"div\"> &\n KumoLayerCardVariantsProps;\n\nexport type LayerCardSectionProps = PropsWithChildren<{\n /** Additional CSS classes merged via `cn()`. */\n className?: string;\n}>;\n\n/**\n * Card container for both simple surfaces and layered layouts.\n *\n * Render children directly for a single-surface card, or use\n * `LayerCard.Secondary` and `LayerCard.Primary` for the layered card treatment.\n *\n * @example\n * ```tsx\n * <LayerCard className=\"rounded-lg p-4\">Card content</LayerCard>\n * ```\n *\n * @example\n * ```tsx\n * <LayerCard>\n * <LayerCard.Secondary>Getting Started</LayerCard.Secondary>\n * <LayerCard.Primary>Quick start guide</LayerCard.Primary>\n * </LayerCard>\n * ```\n */\nconst LayerCardRoot = forwardRef<HTMLDivElement, LayerCardProps>(function LayerCard(\n { children, className, render, ...props },\n ref,\n) {\n const hasStructuredLayers = hasLayerCardSections(children);\n\n const defaultProps: useRender.ElementProps<\"div\"> = {\n className: cn(\n hasStructuredLayers ? LAYER_CARD_LAYERED_ROOT_CLASSES : layerCardVariants(),\n className,\n ),\n };\n\n return useRender({\n defaultTagName: \"div\",\n render,\n ref,\n props: mergeProps<\"div\">(defaultProps, props, { children }),\n });\n});\n\nfunction LayerCardSecondary({\n children,\n className,\n}: LayerCardSectionProps) {\n return <div className={cn(LAYER_CARD_SECONDARY_CLASSES, className)}>{children}</div>;\n}\n\nfunction LayerCardPrimary({ children, className }: LayerCardSectionProps) {\n return <div className={cn(LAYER_CARD_PRIMARY_CLASSES, className)}>{children}</div>;\n}\n\nLayerCardRoot.displayName = \"LayerCard\";\nLayerCardSecondary.displayName = \"LayerCard.Secondary\";\nLayerCardPrimary.displayName = \"LayerCard.Primary\";\n\ntype LayerCardComponent = typeof LayerCardRoot & {\n Primary: typeof LayerCardPrimary;\n Secondary: typeof LayerCardSecondary;\n};\n\nconst LayerCard = Object.assign(LayerCardRoot, {\n Primary: LayerCardPrimary,\n Secondary: LayerCardSecondary,\n}) as LayerCardComponent;\n\nexport { LayerCard };\n"],"names":["LAYER_CARD_SURFACE_CLASSES","LAYER_CARD_LAYERED_ROOT_CLASSES","LAYER_CARD_SECONDARY_CLASSES","LAYER_CARD_PRIMARY_CLASSES","layerCardVariants","_props","cn","hasLayerCardSections","children","Children","child","isValidElement","LayerCardPrimary","LayerCardSecondary","Fragment","LayerCardRoot","forwardRef","className","render","props","ref","hasStructuredLayers","defaultProps","useRender","mergeProps","LayerCard"],"mappings":";;;;;AAaA,MAAMA,IACJ,yEACIC,IACJ,sGACIC,IACJ,6FACIC,IACJ;AAYK,SAASC,EAAkBC,IAAqC,IAAI;AACzE,SAAOC,EAAGN,CAA0B;AACtC;AAEA,SAASO,EAAqBC,GAA8B;AAC1D,SAAOC,EAAS,QAAQD,CAAQ,EAAE,KAAK,CAACE,MACjCC,EAAeD,CAAK,IAIrBA,EAAM,SAASE,KAAoBF,EAAM,SAASG,IAC7C,KAGLH,EAAM,SAASI,IAEVP,EADeG,EACoB,MAAM,QAAQ,IAGnD,KAZE,EAaV;AACH;AA4CA,MAAMK,IAAgBC,EAA2C,SAC/D,EAAE,UAAAR,GAAU,WAAAS,GAAW,QAAAC,GAAQ,GAAGC,EAAA,GAClCC,GACA;AACA,QAAMC,IAAsBd,EAAqBC,CAAQ,GAEnDc,IAA8C;AAAA,IAClD,WAAWhB;AAAA,MACTe,IAAsBpB,IAAkCG,EAAA;AAAA,MACxDa;AAAA,IAAA;AAAA,EACF;AAGF,SAAOM,EAAU;AAAA,IACf,gBAAgB;AAAA,IAChB,QAAAL;AAAA,IACA,KAAAE;AAAA,IACA,OAAOI,EAAkBF,GAAcH,GAAO,EAAE,UAAAX,GAAU;AAAA,EAAA,CAC3D;AACH,CAAC;AAED,SAASK,EAAmB;AAAA,EAC1B,UAAAL;AAAA,EACA,WAAAS;AACF,GAA0B;AACxB,2BAAQ,OAAA,EAAI,WAAWX,EAAGJ,GAA8Be,CAAS,GAAI,UAAAT,GAAS;AAChF;AAEA,SAASI,EAAiB,EAAE,UAAAJ,GAAU,WAAAS,KAAoC;AACxE,2BAAQ,OAAA,EAAI,WAAWX,EAAGH,GAA4Bc,CAAS,GAAI,UAAAT,GAAS;AAC9E;AAEAO,EAAc,cAAc;AAC5BF,EAAmB,cAAc;AACjCD,EAAiB,cAAc;AAO/B,MAAMa,IAAY,OAAO,OAAOV,GAAe;AAAA,EAC7C,SAASH;AAAA,EACT,WAAWC;AACb,CAAC;"}
@@ -3,7 +3,7 @@ import { jsxs as d, jsx as e } from "react/jsx-runtime";
3
3
  import { forwardRef as k } from "react";
4
4
  import { c as t } from "./cn-ct4n7r74mh8y0f48.js";
5
5
  import { u as p } from "./link-provider-mn2voeohon7cj9o4.js";
6
- import { aQ as f, aR as L } from "./vendor-base-ui-m5pz3e8c4grg5qmj.js";
6
+ import { aU as f, aV as L } from "./vendor-base-ui-ie71jahf0czyf58j.js";
7
7
  const i = (n) => /* @__PURE__ */ d(
8
8
  "svg",
9
9
  {
@@ -67,13 +67,13 @@ const r = k(function({ className: o, variant: s = "inline", render: a, ...l }, c
67
67
  });
68
68
  });
69
69
  r.displayName = "Link";
70
- const V = Object.assign(r, {
70
+ const M = Object.assign(r, {
71
71
  ExternalIcon: i
72
72
  });
73
73
  export {
74
74
  x as K,
75
- V as L,
75
+ M as L,
76
76
  h as a,
77
77
  C as l
78
78
  };
79
- //# sourceMappingURL=link-fjnhtxvfe5ieamjf.js.map
79
+ //# sourceMappingURL=link-kt74pxkud4olmcer.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"link-fjnhtxvfe5ieamjf.js","sources":["../../src/components/link/link.tsx"],"sourcesContent":["import { forwardRef, type SVGProps } from \"react\";\nimport { useRender } from \"@base-ui/react/use-render\";\nimport { mergeProps } from \"@base-ui/react/merge-props\";\nimport { cn } from \"../../utils/cn\";\nimport {\n useLinkComponent,\n type LinkComponentProps,\n} from \"../../utils/link-provider\";\n\n/**\n * ExternalIcon - Visual indicator for links that open in a new tab/window.\n *\n * Use this as a child of Link to indicate external navigation:\n * ```tsx\n * <Link href=\"https://example.com\" target=\"_blank\" rel=\"noopener noreferrer\">\n * Visit Example <Link.ExternalIcon />\n * </Link>\n * ```\n */\nconst ExternalIcon = (props: SVGProps<SVGSVGElement>) => (\n <svg\n width=\"1em\"\n height=\"1em\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n aria-hidden=\"true\"\n className=\"link-external-icon\"\n {...props}\n >\n <path d=\"M9 4H8.8C7.11984 4 6.27976 4 5.63803 4.32698C5.07354 4.6146 4.6146 5.07354 4.32698 5.63803C4 6.27976 4 7.11984 4 8.8V15.2C4 16.8802 4 17.7202 4.32698 18.362C4.6146 18.9265 5.07354 19.3854 5.63803 19.673C6.27976 20 7.11984 20 8.8 20H15.2C16.8802 20 17.7202 20 18.362 19.673C18.9265 19.3854 19.3854 18.9265 19.673 18.362C20 17.7202 20 16.8802 20 15.2V15\" />\n <path d=\"M14 4H20M20 4V10M20 4L11 13\" />\n </svg>\n);\n\nExternalIcon.displayName = \"Link.ExternalIcon\";\n\n/** Link variant definitions mapping variant names to their Tailwind classes. */\nexport const KUMO_LINK_VARIANTS = {\n variant: {\n inline: {\n classes:\n // text-kumo-link provides defensive color that won't be overridden by global `a` styles\n \"text-kumo-link underline underline-offset-[0.15em] decoration-[0.0625em] link-current transition-colors\",\n description: \"Inline text link that flows with content\",\n },\n current: {\n classes:\n \"text-current underline underline-offset-[0.15em] decoration-[0.0625em] link-current transition-colors\",\n description: \"Link that inherits color from parent text\",\n },\n plain: {\n classes:\n // text-kumo-link provides defensive color that won't be overridden by global `a` styles\n \"text-kumo-link hover:text-kumo-link/70 transition-colors\",\n description: \"Link without underline decoration\",\n },\n },\n} as const;\n\nexport const KUMO_LINK_DEFAULT_VARIANTS = {\n variant: \"inline\",\n} as const;\n\nexport type KumoLinkVariant = keyof typeof KUMO_LINK_VARIANTS.variant;\n\nexport interface KumoLinkVariantsProps {\n /**\n * Visual style of the link.\n * - `\"inline\"` — Inline text link that flows with content\n * - `\"current\"` — Link that inherits color from parent text\n * - `\"plain\"` — Link without underline decoration\n * @default \"inline\"\n */\n variant?: KumoLinkVariant;\n}\n\nexport function linkVariants({\n variant = KUMO_LINK_DEFAULT_VARIANTS.variant,\n}: KumoLinkVariantsProps = {}) {\n return cn(KUMO_LINK_VARIANTS.variant[variant].classes);\n}\n\n/**\n * Link component props.\n *\n * @example\n * ```tsx\n * <Link href=\"/docs\">Learn more</Link>\n * <Link href=\"https://cloudflare.com\" target=\"_blank\" rel=\"noopener noreferrer\">\n * Visit Cloudflare <Link.ExternalIcon />\n * </Link>\n * <Link render={<RouterLink to=\"/dashboard\" />}>Dashboard</Link>\n * ```\n */\nexport type LinkProps = useRender.ComponentProps<\"a\"> &\n LinkComponentProps &\n KumoLinkVariantsProps;\n\n/**\n * Link component for consistent inline text links.\n *\n * Supports composition via `render` prop for framework-specific routing:\n * - Without render: renders via LinkProvider (default anchor or configured component)\n * - With render: merges props onto the provided element with proper ref/event handling\n *\n * @example Basic usage\n * ```tsx\n * <Link href=\"/docs\">Learn more</Link>\n * ```\n *\n * @example External link with icon\n * ```tsx\n * <Link href=\"https://cloudflare.com\" target=\"_blank\" rel=\"noopener noreferrer\">\n * Visit Cloudflare <Link.ExternalIcon />\n * </Link>\n * ```\n *\n * @example Composition with React Router\n * ```tsx\n * <Link render={<RouterLink to=\"/dashboard\" />} variant=\"inline\">\n * Dashboard\n * </Link>\n * ```\n */\nconst LinkBase = forwardRef<HTMLAnchorElement, LinkProps>(function Link(\n { className, variant = \"inline\", render, ...props },\n ref,\n) {\n const LinkComponent = useLinkComponent();\n\n const defaultProps: useRender.ElementProps<\"a\"> = {\n className: cn(\n linkVariants({ variant }),\n \"group/link inline-flex items-center gap-[0.1875em]\",\n ),\n };\n\n const element = useRender({\n render: render ?? <LinkComponent />,\n ref,\n props: mergeProps<\"a\">(defaultProps, props, { className }),\n });\n\n return element;\n});\n\nLinkBase.displayName = \"Link\";\n\n// Compound component with ExternalIcon subcomponent\nexport const Link = Object.assign(LinkBase, {\n ExternalIcon,\n});\n"],"names":["ExternalIcon","props","jsxs","jsx","KUMO_LINK_VARIANTS","KUMO_LINK_DEFAULT_VARIANTS","linkVariants","variant","cn","LinkBase","forwardRef","className","render","ref","LinkComponent","useLinkComponent","defaultProps","useRender","mergeProps","Link"],"mappings":";;;;;;AAmBA,MAAMA,IAAe,CAACC,MACpB,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,OAAM;AAAA,IACN,QAAO;AAAA,IACP,SAAQ;AAAA,IACR,MAAK;AAAA,IACL,QAAO;AAAA,IACP,eAAc;AAAA,IACd,gBAAe;AAAA,IACf,eAAY;AAAA,IACZ,WAAU;AAAA,IACT,GAAGD;AAAA,IAEJ,UAAA;AAAA,MAAA,gBAAAE,EAAC,QAAA,EAAK,GAAE,kWAAA,CAAkW;AAAA,MAC1W,gBAAAA,EAAC,QAAA,EAAK,GAAE,8BAAA,CAA8B;AAAA,IAAA;AAAA,EAAA;AACxC;AAGFH,EAAa,cAAc;AAGpB,MAAMI,IAAqB;AAAA,EAChC,SAAS;AAAA,IACP,QAAQ;AAAA,MACN;AAAA;AAAA,QAEE;AAAA;AAAA,MACF,aAAa;AAAA,IAAA;AAAA,IAEf,SAAS;AAAA,MACP,SACE;AAAA,MACF,aAAa;AAAA,IAAA;AAAA,IAEf,OAAO;AAAA,MACL;AAAA;AAAA,QAEE;AAAA;AAAA,MACF,aAAa;AAAA,IAAA;AAAA,EACf;AAEJ,GAEaC,IAA6B;AAAA,EACxC,SAAS;AACX;AAeO,SAASC,EAAa;AAAA,EAC3B,SAAAC,IAAUF,EAA2B;AACvC,IAA2B,IAAI;AAC7B,SAAOG,EAAGJ,EAAmB,QAAQG,CAAO,EAAE,OAAO;AACvD;AA4CA,MAAME,IAAWC,EAAyC,SACxD,EAAE,WAAAC,GAAW,SAAAJ,IAAU,UAAU,QAAAK,GAAQ,GAAGX,EAAA,GAC5CY,GACA;AACA,QAAMC,IAAgBC,EAAA,GAEhBC,IAA4C;AAAA,IAChD,WAAWR;AAAA,MACTF,EAAa,EAAE,SAAAC,GAAS;AAAA,MACxB;AAAA,IAAA;AAAA,EACF;AASF,SANgBU,EAAU;AAAA,IACxB,QAAQL,KAAU,gBAAAT,EAACW,GAAA,CAAA,CAAc;AAAA,IACjC,KAAAD;AAAA,IACA,OAAOK,EAAgBF,GAAcf,GAAO,EAAE,WAAAU,GAAW;AAAA,EAAA,CAC1D;AAGH,CAAC;AAEDF,EAAS,cAAc;AAGhB,MAAMU,IAAO,OAAO,OAAOV,GAAU;AAAA,EAC1C,cAAAT;AACF,CAAC;"}
1
+ {"version":3,"file":"link-kt74pxkud4olmcer.js","sources":["../../src/components/link/link.tsx"],"sourcesContent":["import { forwardRef, type SVGProps } from \"react\";\nimport { useRender } from \"@base-ui/react/use-render\";\nimport { mergeProps } from \"@base-ui/react/merge-props\";\nimport { cn } from \"../../utils/cn\";\nimport {\n useLinkComponent,\n type LinkComponentProps,\n} from \"../../utils/link-provider\";\n\n/**\n * ExternalIcon - Visual indicator for links that open in a new tab/window.\n *\n * Use this as a child of Link to indicate external navigation:\n * ```tsx\n * <Link href=\"https://example.com\" target=\"_blank\" rel=\"noopener noreferrer\">\n * Visit Example <Link.ExternalIcon />\n * </Link>\n * ```\n */\nconst ExternalIcon = (props: SVGProps<SVGSVGElement>) => (\n <svg\n width=\"1em\"\n height=\"1em\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n aria-hidden=\"true\"\n className=\"link-external-icon\"\n {...props}\n >\n <path d=\"M9 4H8.8C7.11984 4 6.27976 4 5.63803 4.32698C5.07354 4.6146 4.6146 5.07354 4.32698 5.63803C4 6.27976 4 7.11984 4 8.8V15.2C4 16.8802 4 17.7202 4.32698 18.362C4.6146 18.9265 5.07354 19.3854 5.63803 19.673C6.27976 20 7.11984 20 8.8 20H15.2C16.8802 20 17.7202 20 18.362 19.673C18.9265 19.3854 19.3854 18.9265 19.673 18.362C20 17.7202 20 16.8802 20 15.2V15\" />\n <path d=\"M14 4H20M20 4V10M20 4L11 13\" />\n </svg>\n);\n\nExternalIcon.displayName = \"Link.ExternalIcon\";\n\n/** Link variant definitions mapping variant names to their Tailwind classes. */\nexport const KUMO_LINK_VARIANTS = {\n variant: {\n inline: {\n classes:\n // text-kumo-link provides defensive color that won't be overridden by global `a` styles\n \"text-kumo-link underline underline-offset-[0.15em] decoration-[0.0625em] link-current transition-colors\",\n description: \"Inline text link that flows with content\",\n },\n current: {\n classes:\n \"text-current underline underline-offset-[0.15em] decoration-[0.0625em] link-current transition-colors\",\n description: \"Link that inherits color from parent text\",\n },\n plain: {\n classes:\n // text-kumo-link provides defensive color that won't be overridden by global `a` styles\n \"text-kumo-link hover:text-kumo-link/70 transition-colors\",\n description: \"Link without underline decoration\",\n },\n },\n} as const;\n\nexport const KUMO_LINK_DEFAULT_VARIANTS = {\n variant: \"inline\",\n} as const;\n\nexport type KumoLinkVariant = keyof typeof KUMO_LINK_VARIANTS.variant;\n\nexport interface KumoLinkVariantsProps {\n /**\n * Visual style of the link.\n * - `\"inline\"` — Inline text link that flows with content\n * - `\"current\"` — Link that inherits color from parent text\n * - `\"plain\"` — Link without underline decoration\n * @default \"inline\"\n */\n variant?: KumoLinkVariant;\n}\n\nexport function linkVariants({\n variant = KUMO_LINK_DEFAULT_VARIANTS.variant,\n}: KumoLinkVariantsProps = {}) {\n return cn(KUMO_LINK_VARIANTS.variant[variant].classes);\n}\n\n/**\n * Link component props.\n *\n * @example\n * ```tsx\n * <Link href=\"/docs\">Learn more</Link>\n * <Link href=\"https://cloudflare.com\" target=\"_blank\" rel=\"noopener noreferrer\">\n * Visit Cloudflare <Link.ExternalIcon />\n * </Link>\n * <Link render={<RouterLink to=\"/dashboard\" />}>Dashboard</Link>\n * ```\n */\nexport type LinkProps = useRender.ComponentProps<\"a\"> &\n LinkComponentProps &\n KumoLinkVariantsProps;\n\n/**\n * Link component for consistent inline text links.\n *\n * Supports composition via `render` prop for framework-specific routing:\n * - Without render: renders via LinkProvider (default anchor or configured component)\n * - With render: merges props onto the provided element with proper ref/event handling\n *\n * @example Basic usage\n * ```tsx\n * <Link href=\"/docs\">Learn more</Link>\n * ```\n *\n * @example External link with icon\n * ```tsx\n * <Link href=\"https://cloudflare.com\" target=\"_blank\" rel=\"noopener noreferrer\">\n * Visit Cloudflare <Link.ExternalIcon />\n * </Link>\n * ```\n *\n * @example Composition with React Router\n * ```tsx\n * <Link render={<RouterLink to=\"/dashboard\" />} variant=\"inline\">\n * Dashboard\n * </Link>\n * ```\n */\nconst LinkBase = forwardRef<HTMLAnchorElement, LinkProps>(function Link(\n { className, variant = \"inline\", render, ...props },\n ref,\n) {\n const LinkComponent = useLinkComponent();\n\n const defaultProps: useRender.ElementProps<\"a\"> = {\n className: cn(\n linkVariants({ variant }),\n \"group/link inline-flex items-center gap-[0.1875em]\",\n ),\n };\n\n const element = useRender({\n render: render ?? <LinkComponent />,\n ref,\n props: mergeProps<\"a\">(defaultProps, props, { className }),\n });\n\n return element;\n});\n\nLinkBase.displayName = \"Link\";\n\n// Compound component with ExternalIcon subcomponent\nexport const Link = Object.assign(LinkBase, {\n ExternalIcon,\n});\n"],"names":["ExternalIcon","props","jsxs","jsx","KUMO_LINK_VARIANTS","KUMO_LINK_DEFAULT_VARIANTS","linkVariants","variant","cn","LinkBase","forwardRef","className","render","ref","LinkComponent","useLinkComponent","defaultProps","useRender","mergeProps","Link"],"mappings":";;;;;;AAmBA,MAAMA,IAAe,CAACC,MACpB,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,OAAM;AAAA,IACN,QAAO;AAAA,IACP,SAAQ;AAAA,IACR,MAAK;AAAA,IACL,QAAO;AAAA,IACP,eAAc;AAAA,IACd,gBAAe;AAAA,IACf,eAAY;AAAA,IACZ,WAAU;AAAA,IACT,GAAGD;AAAA,IAEJ,UAAA;AAAA,MAAA,gBAAAE,EAAC,QAAA,EAAK,GAAE,kWAAA,CAAkW;AAAA,MAC1W,gBAAAA,EAAC,QAAA,EAAK,GAAE,8BAAA,CAA8B;AAAA,IAAA;AAAA,EAAA;AACxC;AAGFH,EAAa,cAAc;AAGpB,MAAMI,IAAqB;AAAA,EAChC,SAAS;AAAA,IACP,QAAQ;AAAA,MACN;AAAA;AAAA,QAEE;AAAA;AAAA,MACF,aAAa;AAAA,IAAA;AAAA,IAEf,SAAS;AAAA,MACP,SACE;AAAA,MACF,aAAa;AAAA,IAAA;AAAA,IAEf,OAAO;AAAA,MACL;AAAA;AAAA,QAEE;AAAA;AAAA,MACF,aAAa;AAAA,IAAA;AAAA,EACf;AAEJ,GAEaC,IAA6B;AAAA,EACxC,SAAS;AACX;AAeO,SAASC,EAAa;AAAA,EAC3B,SAAAC,IAAUF,EAA2B;AACvC,IAA2B,IAAI;AAC7B,SAAOG,EAAGJ,EAAmB,QAAQG,CAAO,EAAE,OAAO;AACvD;AA4CA,MAAME,IAAWC,EAAyC,SACxD,EAAE,WAAAC,GAAW,SAAAJ,IAAU,UAAU,QAAAK,GAAQ,GAAGX,EAAA,GAC5CY,GACA;AACA,QAAMC,IAAgBC,EAAA,GAEhBC,IAA4C;AAAA,IAChD,WAAWR;AAAA,MACTF,EAAa,EAAE,SAAAC,GAAS;AAAA,MACxB;AAAA,IAAA;AAAA,EACF;AASF,SANgBU,EAAU;AAAA,IACxB,QAAQL,KAAU,gBAAAT,EAACW,GAAA,CAAA,CAAc;AAAA,IACjC,KAAAD;AAAA,IACA,OAAOK,EAAgBF,GAAcf,GAAO,EAAE,WAAAU,GAAW;AAAA,EAAA,CAC1D;AAGH,CAAC;AAEDF,EAAS,cAAc;AAGhB,MAAMU,IAAO,OAAO,OAAOV,GAAU;AAAA,EAC1C,cAAAT;AACF,CAAC;"}
@@ -0,0 +1,96 @@
1
+ "use client";
2
+ import { jsx as i } from "react/jsx-runtime";
3
+ import { T as p } from "./tooltip-odudhkxe282wxinq.js";
4
+ import { c as b } from "./cn-ct4n7r74mh8y0f48.js";
5
+ import { IconContext as w } from "@phosphor-icons/react";
6
+ import { useRef as g, useEffect as y } from "react";
7
+ const k = ({
8
+ menuRef: e,
9
+ direction: o = "horizontal"
10
+ }) => {
11
+ const r = g(null);
12
+ y(() => {
13
+ if (!e.current) return;
14
+ const n = Array.from(
15
+ e.current.querySelectorAll(
16
+ 'a, button, input, textarea, select, details, [tabindex]:not([tabindex="-1"])'
17
+ )
18
+ );
19
+ if (n.length === 0) return;
20
+ const t = (u) => {
21
+ if (!r.current) return;
22
+ const l = n.indexOf(r.current);
23
+ let a = l;
24
+ const m = o === "horizontal", h = m ? "ArrowRight" : "ArrowDown", x = m ? "ArrowLeft" : "ArrowUp";
25
+ if (u.key === h)
26
+ u.preventDefault(), a = (l + 1) % n.length;
27
+ else if (u.key === x)
28
+ u.preventDefault(), a = (l - 1 + n.length) % n.length;
29
+ else
30
+ return;
31
+ const v = n[a];
32
+ r.current = v, v.focus();
33
+ }, s = () => document.addEventListener("keydown", t), c = () => document.removeEventListener("keydown", t), d = () => {
34
+ r.current = document.activeElement, s();
35
+ }, f = () => {
36
+ r.current = null, c();
37
+ };
38
+ return e.current.addEventListener("focusin", d), e.current.addEventListener("focusout", f), () => {
39
+ e.current?.removeEventListener("focusin", d), e.current?.removeEventListener("focusout", f), c();
40
+ };
41
+ }, [e, o]);
42
+ }, E = ({
43
+ icon: e,
44
+ id: o,
45
+ isActive: r,
46
+ onClick: n,
47
+ tooltip: t
48
+ }) => {
49
+ const s = /* @__PURE__ */ i(
50
+ "button",
51
+ {
52
+ "aria-label": t,
53
+ className: b(
54
+ "relative -ml-px flex h-full w-11 cursor-pointer items-center justify-center rounded-md border-none bg-kumo-recessed first:rounded-l-lg last:rounded-r-lg transition-colors focus:z-3 focus:outline-none focus:ring-kumo-focus/50 focus-visible:z-3 focus-visible:ring-2 focus-visible:ring-kumo-brand",
55
+ {
56
+ "z-2 bg-kumo-base shadow-xs transition-colors": r === o
57
+ }
58
+ ),
59
+ onClick: n,
60
+ children: /* @__PURE__ */ i(w.Provider, { value: { size: 18 }, children: e })
61
+ }
62
+ );
63
+ return /* @__PURE__ */ i(p, { content: t, render: s });
64
+ }, I = ({
65
+ className: e,
66
+ isActive: o,
67
+ options: r,
68
+ optionIds: n = !1
69
+ // if option needs an extra unique ID
70
+ }) => {
71
+ const t = g(null);
72
+ return k({ menuRef: t, direction: "horizontal" }), /* @__PURE__ */ i(
73
+ "nav",
74
+ {
75
+ className: b(
76
+ "isolate flex rounded-lg ring ring-kumo-line bg-kumo-recessed pl-px shadow-xs transition-colors",
77
+ e
78
+ ),
79
+ ref: t,
80
+ children: r.map((s, c) => /* @__PURE__ */ i(
81
+ E,
82
+ {
83
+ ...s,
84
+ isActive: o,
85
+ id: n ? s.id : c
86
+ },
87
+ c
88
+ ))
89
+ }
90
+ );
91
+ };
92
+ export {
93
+ I as M,
94
+ k as u
95
+ };
96
+ //# sourceMappingURL=menubar-hwev159bm4rw9ixk.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"menubar-hwev159bm4rw9ixk.js","sources":["../../src/components/menubar/use-menu-navigation.ts","../../src/components/menubar/menubar.tsx"],"sourcesContent":["import React, { useEffect, useRef } from \"react\";\n\ntype UseMenuNavigationProps = {\n menuRef: React.RefObject<HTMLElement | null>;\n direction?: \"horizontal\" | \"vertical\"; // Default: horizontal\n};\n\nexport const useMenuNavigation = ({\n menuRef,\n direction = \"horizontal\",\n}: UseMenuNavigationProps) => {\n const activeElementRef = useRef<HTMLElement | null>(null);\n\n useEffect(() => {\n if (!menuRef.current) return;\n\n const focusableElements = Array.from(\n menuRef.current.querySelectorAll(\n 'a, button, input, textarea, select, details, [tabindex]:not([tabindex=\"-1\"])',\n ),\n ) as HTMLElement[];\n\n if (focusableElements.length === 0) return;\n\n const handleKeyDown = (e: KeyboardEvent) => {\n if (!activeElementRef.current) return;\n\n const currentIndex = focusableElements.indexOf(activeElementRef.current);\n let nextIndex = currentIndex;\n\n const isHorizontal = direction === \"horizontal\";\n const forwardKey = isHorizontal ? \"ArrowRight\" : \"ArrowDown\";\n const backwardKey = isHorizontal ? \"ArrowLeft\" : \"ArrowUp\";\n\n if (e.key === forwardKey) {\n e.preventDefault();\n nextIndex = (currentIndex + 1) % focusableElements.length;\n } else if (e.key === backwardKey) {\n e.preventDefault();\n nextIndex =\n (currentIndex - 1 + focusableElements.length) %\n focusableElements.length;\n } else {\n return;\n }\n\n const nextElement = focusableElements[nextIndex];\n activeElementRef.current = nextElement;\n nextElement.focus();\n };\n\n const addKeyListener = () =>\n document.addEventListener(\"keydown\", handleKeyDown);\n const removeKeyListener = () =>\n document.removeEventListener(\"keydown\", handleKeyDown);\n\n const handleFocusIn = () => {\n activeElementRef.current = document.activeElement as HTMLElement;\n addKeyListener();\n };\n\n const handleFocusOut = () => {\n activeElementRef.current = null;\n removeKeyListener();\n };\n\n menuRef.current.addEventListener(\"focusin\", handleFocusIn);\n menuRef.current.addEventListener(\"focusout\", handleFocusOut);\n\n return () => {\n menuRef.current?.removeEventListener(\"focusin\", handleFocusIn);\n menuRef.current?.removeEventListener(\"focusout\", handleFocusOut);\n removeKeyListener();\n };\n }, [menuRef, direction]);\n};\n","import { Tooltip } from \"../tooltip\";\nimport { cn } from \"../../utils/cn\";\nimport { IconContext } from \"@phosphor-icons/react\";\nimport React, { useRef } from \"react\";\nimport { useMenuNavigation } from \"./use-menu-navigation\";\n\n/** MenuBar variant definitions (currently empty, reserved for future additions). */\nexport const KUMO_MENUBAR_VARIANTS = {\n // MenuBar currently has no variant options but structure is ready for future additions\n} as const;\n\nexport const KUMO_MENUBAR_DEFAULT_VARIANTS = {} as const;\n\n// Derived types from KUMO_MENUBAR_VARIANTS\nexport interface KumoMenuBarVariantsProps {}\n\nexport function menuBarVariants(_props: KumoMenuBarVariantsProps = {}) {\n return cn(\n // Base styles\n \"flex rounded-lg border border-kumo-recessed bg-kumo-recessed pl-px shadow-xs transition-colors\",\n );\n}\n\n/** Props for an individual menu option within a MenuBar. */\ntype MenuOptionProps = {\n /** Icon element (typically from `@phosphor-icons/react`) rendered at 18px */\n icon: React.ReactNode;\n /** Unique identifier for the option (used when `optionIds` is true) */\n id?: number | string;\n /** Currently active value from the parent MenuBar */\n isActive?: number | boolean | string | undefined;\n /** Callback when this option is clicked */\n onClick: () => void;\n /** Tooltip text shown on hover */\n tooltip: string;\n};\n\nconst MenuOption = ({\n icon,\n id,\n isActive,\n onClick,\n tooltip,\n}: MenuOptionProps) => {\n const button = (\n <button\n aria-label={tooltip}\n className={cn(\n \"relative -ml-px flex h-full w-11 cursor-pointer items-center justify-center rounded-md border-none bg-kumo-recessed first:rounded-l-lg last:rounded-r-lg transition-colors focus:z-3 focus:outline-none focus:ring-kumo-focus/50 focus-visible:z-3 focus-visible:ring-2 focus-visible:ring-kumo-brand\",\n {\n \"z-2 bg-kumo-base shadow-xs transition-colors\": isActive === id,\n },\n )}\n onClick={onClick}\n >\n <IconContext.Provider value={{ size: 18 }} {...({} as any)}>\n {icon}\n </IconContext.Provider>\n </button>\n );\n\n return <Tooltip content={tooltip} render={button} />;\n};\n\n/**\n * MenuBar component props.\n *\n * Horizontal icon-button toolbar with keyboard navigation and tooltip labels.\n *\n * @example\n * ```tsx\n * <MenuBar\n * isActive={activeIndex}\n * options={[\n * { icon: <ListIcon />, tooltip: \"List view\", onClick: () => setView(\"list\") },\n * { icon: <GridFourIcon />, tooltip: \"Grid view\", onClick: () => setView(\"grid\") },\n * ]}\n * />\n * ```\n */\ntype MenuBarProps = {\n /** Additional CSS classes merged via `cn()`. */\n className?: string;\n /** The currently active option value — matched against option index or `id`. */\n isActive: number | boolean | string | undefined;\n /** Array of menu option configurations. */\n options: MenuOptionProps[];\n /** When true, each option's `id` field is used for matching instead of its array index. */\n optionIds?: boolean;\n};\n\n/**\n * MenuBar — horizontal icon-button toolbar with keyboard arrow-key navigation.\n *\n * Each option renders as a `<button>` with a Tooltip. The active option is\n * visually highlighted with an elevated background.\n *\n * @example\n * ```tsx\n * <MenuBar\n * isActive={0}\n * options={[\n * { icon: <ListIcon />, tooltip: \"List\", onClick: () => {} },\n * { icon: <GridFourIcon />, tooltip: \"Grid\", onClick: () => {} },\n * ]}\n * />\n * ```\n */\nexport const MenuBar = ({\n className,\n isActive,\n options,\n optionIds = false, // if option needs an extra unique ID\n}: MenuBarProps) => {\n const menuRef = useRef<HTMLElement | null>(null);\n\n useMenuNavigation({ menuRef, direction: \"horizontal\" });\n\n return (\n <nav\n className={cn(\n \"isolate flex rounded-lg ring ring-kumo-line bg-kumo-recessed pl-px shadow-xs transition-colors\",\n className,\n )}\n ref={menuRef}\n >\n {options.map((option, index) => (\n <MenuOption\n key={index}\n {...option}\n isActive={isActive}\n id={optionIds ? option.id : index}\n />\n ))}\n </nav>\n );\n};\n"],"names":["useMenuNavigation","menuRef","direction","activeElementRef","useRef","useEffect","focusableElements","handleKeyDown","e","currentIndex","nextIndex","isHorizontal","forwardKey","backwardKey","nextElement","addKeyListener","removeKeyListener","handleFocusIn","handleFocusOut","MenuOption","icon","id","isActive","onClick","tooltip","button","jsx","cn","IconContext","Tooltip","MenuBar","className","options","optionIds","option","index"],"mappings":";;;;;;AAOO,MAAMA,IAAoB,CAAC;AAAA,EAChC,SAAAC;AAAA,EACA,WAAAC,IAAY;AACd,MAA8B;AAC5B,QAAMC,IAAmBC,EAA2B,IAAI;AAExD,EAAAC,EAAU,MAAM;AACd,QAAI,CAACJ,EAAQ,QAAS;AAEtB,UAAMK,IAAoB,MAAM;AAAA,MAC9BL,EAAQ,QAAQ;AAAA,QACd;AAAA,MAAA;AAAA,IACF;AAGF,QAAIK,EAAkB,WAAW,EAAG;AAEpC,UAAMC,IAAgB,CAACC,MAAqB;AAC1C,UAAI,CAACL,EAAiB,QAAS;AAE/B,YAAMM,IAAeH,EAAkB,QAAQH,EAAiB,OAAO;AACvE,UAAIO,IAAYD;AAEhB,YAAME,IAAeT,MAAc,cAC7BU,IAAaD,IAAe,eAAe,aAC3CE,IAAcF,IAAe,cAAc;AAEjD,UAAIH,EAAE,QAAQI;AACZ,QAAAJ,EAAE,eAAA,GACFE,KAAaD,IAAe,KAAKH,EAAkB;AAAA,eAC1CE,EAAE,QAAQK;AACnB,QAAAL,EAAE,eAAA,GACFE,KACGD,IAAe,IAAIH,EAAkB,UACtCA,EAAkB;AAAA;AAEpB;AAGF,YAAMQ,IAAcR,EAAkBI,CAAS;AAC/C,MAAAP,EAAiB,UAAUW,GAC3BA,EAAY,MAAA;AAAA,IACd,GAEMC,IAAiB,MACrB,SAAS,iBAAiB,WAAWR,CAAa,GAC9CS,IAAoB,MACxB,SAAS,oBAAoB,WAAWT,CAAa,GAEjDU,IAAgB,MAAM;AAC1B,MAAAd,EAAiB,UAAU,SAAS,eACpCY,EAAA;AAAA,IACF,GAEMG,IAAiB,MAAM;AAC3B,MAAAf,EAAiB,UAAU,MAC3Ba,EAAA;AAAA,IACF;AAEA,WAAAf,EAAQ,QAAQ,iBAAiB,WAAWgB,CAAa,GACzDhB,EAAQ,QAAQ,iBAAiB,YAAYiB,CAAc,GAEpD,MAAM;AACX,MAAAjB,EAAQ,SAAS,oBAAoB,WAAWgB,CAAa,GAC7DhB,EAAQ,SAAS,oBAAoB,YAAYiB,CAAc,GAC/DF,EAAA;AAAA,IACF;AAAA,EACF,GAAG,CAACf,GAASC,CAAS,CAAC;AACzB,GCtCMiB,IAAa,CAAC;AAAA,EAClB,MAAAC;AAAA,EACA,IAAAC;AAAA,EACA,UAAAC;AAAA,EACA,SAAAC;AAAA,EACA,SAAAC;AACF,MAAuB;AACrB,QAAMC,IACJ,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,cAAYF;AAAA,MACZ,WAAWG;AAAA,QACT;AAAA,QACA;AAAA,UACE,gDAAgDL,MAAaD;AAAA,QAAA;AAAA,MAC/D;AAAA,MAEF,SAAAE;AAAA,MAEA,UAAA,gBAAAG,EAACE,EAAY,UAAZ,EAAqB,OAAO,EAAE,MAAM,GAAA,GAClC,UAAAR,EAAA,CACH;AAAA,IAAA;AAAA,EAAA;AAIJ,SAAO,gBAAAM,EAACG,GAAA,EAAQ,SAASL,GAAS,QAAQC,GAAQ;AACpD,GA8CaK,IAAU,CAAC;AAAA,EACtB,WAAAC;AAAA,EACA,UAAAT;AAAA,EACA,SAAAU;AAAA,EACA,WAAAC,IAAY;AAAA;AACd,MAAoB;AAClB,QAAMhC,IAAUG,EAA2B,IAAI;AAE/C,SAAAJ,EAAkB,EAAE,SAAAC,GAAS,WAAW,aAAA,CAAc,GAGpD,gBAAAyB;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAWC;AAAA,QACT;AAAA,QACAI;AAAA,MAAA;AAAA,MAEF,KAAK9B;AAAA,MAEJ,UAAA+B,EAAQ,IAAI,CAACE,GAAQC,MACpB,gBAAAT;AAAA,QAACP;AAAA,QAAA;AAAA,UAEE,GAAGe;AAAA,UACJ,UAAAZ;AAAA,UACA,IAAIW,IAAYC,EAAO,KAAKC;AAAA,QAAA;AAAA,QAHvBA;AAAA,MAAA,CAKR;AAAA,IAAA;AAAA,EAAA;AAGP;"}
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import { jsxs as r, jsx as e, Fragment as d } from "react/jsx-runtime";
3
3
  import { c as t } from "./cn-ct4n7r74mh8y0f48.js";
4
- import { aS as c, aT as f, aU as x, aV as b, aW as h } from "./vendor-base-ui-m5pz3e8c4grg5qmj.js";
4
+ import { aW as c, aX as f, aY as x, aZ as b, a_ as h } from "./vendor-base-ui-ie71jahf0czyf58j.js";
5
5
  function N({
6
6
  value: l,
7
7
  customValue: a,
@@ -48,4 +48,4 @@ function N({
48
48
  export {
49
49
  N as M
50
50
  };
51
- //# sourceMappingURL=meter-duj3micor1lqj3y2.js.map
51
+ //# sourceMappingURL=meter-bqetlujwg8gm2u7m.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"meter-duj3micor1lqj3y2.js","sources":["../../src/components/meter/meter.tsx"],"sourcesContent":["import { Meter as BaseMeter } from \"@base-ui/react/meter\";\nimport { type ComponentPropsWithoutRef } from \"react\";\nimport { cn } from \"../../utils/cn\";\n\n/** Meter variant definitions (currently empty, reserved for future additions). */\nexport const KUMO_METER_VARIANTS = {\n // Meter currently has no variant options but structure is ready for future additions\n} as const;\n\nexport const KUMO_METER_DEFAULT_VARIANTS = {} as const;\n\n// Derived types from KUMO_METER_VARIANTS\nexport interface KumoMeterVariantsProps {}\n\nexport function meterVariants(_props: KumoMeterVariantsProps = {}) {\n return cn(\n // Base styles\n \"flex w-full flex-col gap-2\",\n );\n}\n\ntype RootProps = ComponentPropsWithoutRef<typeof BaseMeter.Root>;\n\n/**\n * Meter component props.\n *\n * @example\n * ```tsx\n * <Meter label=\"Storage used\" value={65} />\n * <Meter label=\"API requests\" value={75} customValue=\"750 / 1,000\" />\n * ```\n */\nexport interface MeterProps extends RootProps, KumoMeterVariantsProps {\n /** Custom formatted value text (e.g. \"750 / 1,000\") displayed instead of percentage. */\n customValue?: string;\n /** Label text displayed above the meter track. */\n label: string;\n /**\n * Whether to display the percentage value next to the label.\n * @default true\n */\n showValue?: boolean;\n /** Additional CSS classes for the track (background bar). */\n trackClassName?: string;\n /** Additional CSS classes for the indicator (filled bar). */\n indicatorClassName?: string;\n}\n\n/**\n * Progress bar showing a measured value within a known range (e.g. quota usage).\n *\n * @example\n * ```tsx\n * <Meter label=\"Storage\" value={65} />\n * ```\n */\nexport function Meter({\n value,\n customValue,\n label,\n showValue = true,\n className,\n trackClassName,\n indicatorClassName,\n ...props\n}: MeterProps) {\n return (\n <BaseMeter.Root\n value={value}\n {...props}\n className={cn(\"flex w-full flex-col gap-2\", className)}\n >\n <div className=\"flex items-center justify-between gap-4\">\n <BaseMeter.Label className=\"text-xs text-kumo-strong\">\n {label}\n </BaseMeter.Label>\n {customValue ? (\n <span className=\"text-sm font-medium text-kumo-default tabular-nums\">\n {customValue}\n </span>\n ) : (\n <>\n {showValue && (\n <BaseMeter.Value className=\"text-sm font-medium text-kumo-default tabular-nums\" />\n )}\n </>\n )}\n </div>\n <BaseMeter.Track\n className={cn(\n \"relative h-2 w-full overflow-hidden rounded-full bg-kumo-fill\",\n trackClassName,\n )}\n >\n <BaseMeter.Indicator\n className={cn(\n \"absolute inset-y-0 left-0 rounded-full bg-linear-to-r from-kumo-brand via-kumo-brand to-kumo-brand transition-[width] duration-300 ease-out\",\n indicatorClassName,\n )}\n />\n </BaseMeter.Track>\n </BaseMeter.Root>\n );\n}\n"],"names":["Meter","value","customValue","label","showValue","className","trackClassName","indicatorClassName","props","jsxs","BaseMeter.Root","cn","jsx","BaseMeter.Label","Fragment","BaseMeter.Value","BaseMeter.Track","BaseMeter.Indicator"],"mappings":";;;;AAwDO,SAASA,EAAM;AAAA,EACpB,OAAAC;AAAA,EACA,aAAAC;AAAA,EACA,OAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,WAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,oBAAAC;AAAA,EACA,GAAGC;AACL,GAAe;AACb,SACE,gBAAAC;AAAA,IAACC;AAAAA,IAAA;AAAA,MACC,OAAAT;AAAA,MACC,GAAGO;AAAA,MACJ,WAAWG,EAAG,8BAA8BN,CAAS;AAAA,MAErD,UAAA;AAAA,QAAA,gBAAAI,EAAC,OAAA,EAAI,WAAU,2CACb,UAAA;AAAA,UAAA,gBAAAG,EAACC,GAAA,EAAgB,WAAU,4BACxB,UAAAV,GACH;AAAA,UACCD,IACC,gBAAAU,EAAC,QAAA,EAAK,WAAU,sDACb,UAAAV,EAAA,CACH,IAEA,gBAAAU,EAAAE,GAAA,EACG,UAAAV,uBACEW,GAAA,EAAgB,WAAU,sDAAqD,EAAA,CAEpF;AAAA,QAAA,GAEJ;AAAA,QACA,gBAAAH;AAAA,UAACI;AAAAA,UAAA;AAAA,YACC,WAAWL;AAAA,cACT;AAAA,cACAL;AAAA,YAAA;AAAA,YAGF,UAAA,gBAAAM;AAAA,cAACK;AAAAA,cAAA;AAAA,gBACC,WAAWN;AAAA,kBACT;AAAA,kBACAJ;AAAA,gBAAA;AAAA,cACF;AAAA,YAAA;AAAA,UACF;AAAA,QAAA;AAAA,MACF;AAAA,IAAA;AAAA,EAAA;AAGN;"}
1
+ {"version":3,"file":"meter-bqetlujwg8gm2u7m.js","sources":["../../src/components/meter/meter.tsx"],"sourcesContent":["import { Meter as BaseMeter } from \"@base-ui/react/meter\";\nimport { type ComponentPropsWithoutRef } from \"react\";\nimport { cn } from \"../../utils/cn\";\n\n/** Meter variant definitions (currently empty, reserved for future additions). */\nexport const KUMO_METER_VARIANTS = {\n // Meter currently has no variant options but structure is ready for future additions\n} as const;\n\nexport const KUMO_METER_DEFAULT_VARIANTS = {} as const;\n\n// Derived types from KUMO_METER_VARIANTS\nexport interface KumoMeterVariantsProps {}\n\nexport function meterVariants(_props: KumoMeterVariantsProps = {}) {\n return cn(\n // Base styles\n \"flex w-full flex-col gap-2\",\n );\n}\n\ntype RootProps = ComponentPropsWithoutRef<typeof BaseMeter.Root>;\n\n/**\n * Meter component props.\n *\n * @example\n * ```tsx\n * <Meter label=\"Storage used\" value={65} />\n * <Meter label=\"API requests\" value={75} customValue=\"750 / 1,000\" />\n * ```\n */\nexport interface MeterProps extends RootProps, KumoMeterVariantsProps {\n /** Custom formatted value text (e.g. \"750 / 1,000\") displayed instead of percentage. */\n customValue?: string;\n /** Label text displayed above the meter track. */\n label: string;\n /**\n * Whether to display the percentage value next to the label.\n * @default true\n */\n showValue?: boolean;\n /** Additional CSS classes for the track (background bar). */\n trackClassName?: string;\n /** Additional CSS classes for the indicator (filled bar). */\n indicatorClassName?: string;\n}\n\n/**\n * Progress bar showing a measured value within a known range (e.g. quota usage).\n *\n * @example\n * ```tsx\n * <Meter label=\"Storage\" value={65} />\n * ```\n */\nexport function Meter({\n value,\n customValue,\n label,\n showValue = true,\n className,\n trackClassName,\n indicatorClassName,\n ...props\n}: MeterProps) {\n return (\n <BaseMeter.Root\n value={value}\n {...props}\n className={cn(\"flex w-full flex-col gap-2\", className)}\n >\n <div className=\"flex items-center justify-between gap-4\">\n <BaseMeter.Label className=\"text-xs text-kumo-strong\">\n {label}\n </BaseMeter.Label>\n {customValue ? (\n <span className=\"text-sm font-medium text-kumo-default tabular-nums\">\n {customValue}\n </span>\n ) : (\n <>\n {showValue && (\n <BaseMeter.Value className=\"text-sm font-medium text-kumo-default tabular-nums\" />\n )}\n </>\n )}\n </div>\n <BaseMeter.Track\n className={cn(\n \"relative h-2 w-full overflow-hidden rounded-full bg-kumo-fill\",\n trackClassName,\n )}\n >\n <BaseMeter.Indicator\n className={cn(\n \"absolute inset-y-0 left-0 rounded-full bg-linear-to-r from-kumo-brand via-kumo-brand to-kumo-brand transition-[width] duration-300 ease-out\",\n indicatorClassName,\n )}\n />\n </BaseMeter.Track>\n </BaseMeter.Root>\n );\n}\n"],"names":["Meter","value","customValue","label","showValue","className","trackClassName","indicatorClassName","props","jsxs","BaseMeter.Root","cn","jsx","BaseMeter.Label","Fragment","BaseMeter.Value","BaseMeter.Track","BaseMeter.Indicator"],"mappings":";;;;AAwDO,SAASA,EAAM;AAAA,EACpB,OAAAC;AAAA,EACA,aAAAC;AAAA,EACA,OAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,WAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,oBAAAC;AAAA,EACA,GAAGC;AACL,GAAe;AACb,SACE,gBAAAC;AAAA,IAACC;AAAAA,IAAA;AAAA,MACC,OAAAT;AAAA,MACC,GAAGO;AAAA,MACJ,WAAWG,EAAG,8BAA8BN,CAAS;AAAA,MAErD,UAAA;AAAA,QAAA,gBAAAI,EAAC,OAAA,EAAI,WAAU,2CACb,UAAA;AAAA,UAAA,gBAAAG,EAACC,GAAA,EAAgB,WAAU,4BACxB,UAAAV,GACH;AAAA,UACCD,IACC,gBAAAU,EAAC,QAAA,EAAK,WAAU,sDACb,UAAAV,EAAA,CACH,IAEA,gBAAAU,EAAAE,GAAA,EACG,UAAAV,uBACEW,GAAA,EAAgB,WAAU,sDAAqD,EAAA,CAEpF;AAAA,QAAA,GAEJ;AAAA,QACA,gBAAAH;AAAA,UAACI;AAAAA,UAAA;AAAA,YACC,WAAWL;AAAA,cACT;AAAA,cACAL;AAAA,YAAA;AAAA,YAGF,UAAA,gBAAAM;AAAA,cAACK;AAAAA,cAAA;AAAA,gBACC,WAAWN;AAAA,kBACT;AAAA,kBACAJ;AAAA,gBAAA;AAAA,cACF;AAAA,YAAA;AAAA,UACF;AAAA,QAAA;AAAA,MACF;AAAA,IAAA;AAAA,EAAA;AAGN;"}