@jcsoftdev/ui 0.2.2 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (375) hide show
  1. package/CHANGELOG.md +292 -5
  2. package/README.md +2 -1
  3. package/bin/ui-theme.mjs +1151 -25
  4. package/dist/ai/attachment/attachment.js +1 -1
  5. package/dist/ai/chat-list/group.js +3 -1
  6. package/dist/ai/conversation/conversation.js +1 -1
  7. package/dist/ai/internal/use-copy.d.ts +1 -5
  8. package/dist/ai/internal/use-copy.js +1 -32
  9. package/dist/ai/markdown/parse.js +59 -17
  10. package/dist/ai/source/source.js +1 -1
  11. package/dist/atoms/avatar/avatar.d.ts +13 -3
  12. package/dist/atoms/avatar/avatar.js +40 -2
  13. package/dist/atoms/avatar/index.d.ts +1 -1
  14. package/dist/atoms/avatar/index.js +3 -1
  15. package/dist/atoms/button/button.d.ts +4 -1
  16. package/dist/atoms/button/button.js +4 -2
  17. package/dist/atoms/checkbox/checkbox.d.ts +8 -3
  18. package/dist/atoms/checkbox/checkbox.js +33 -6
  19. package/dist/atoms/chip/chip.d.ts +9 -3
  20. package/dist/atoms/chip/chip.js +26 -4
  21. package/dist/atoms/chip/index.d.ts +1 -1
  22. package/dist/atoms/chip/index.js +4 -1
  23. package/dist/atoms/status-dot/index.d.ts +1 -1
  24. package/dist/atoms/status-dot/status-dot.d.ts +4 -2
  25. package/dist/atoms/status-dot/status-dot.js +5 -1
  26. package/dist/charts/bar-chart/bar-race-chart.js +1 -0
  27. package/dist/charts/beeswarm-chart/beeswarm-chart.js +1 -1
  28. package/dist/charts/chord-chart/chord-chart.js +13 -5
  29. package/dist/charts/core/cartesian/cartesian-chart.d.ts +1 -1
  30. package/dist/charts/core/cartesian/cartesian-chart.js +48 -11
  31. package/dist/charts/core/cartesian/layout.d.ts +6 -1
  32. package/dist/charts/core/cartesian/layout.js +14 -5
  33. package/dist/charts/core/cartesian/marks.d.ts +2 -2
  34. package/dist/charts/core/cartesian/marks.js +1 -1
  35. package/dist/charts/core/cartesian/types.d.ts +28 -2
  36. package/dist/charts/core/category-explorer.d.ts +2 -2
  37. package/dist/charts/core/category-explorer.js +8 -4
  38. package/dist/charts/core/chart-dock.d.ts +26 -0
  39. package/dist/charts/core/chart-dock.js +45 -0
  40. package/dist/charts/core/chart-frame.d.ts +9 -2
  41. package/dist/charts/core/chart-frame.js +105 -25
  42. package/dist/charts/core/distribution/explorer.d.ts +5 -2
  43. package/dist/charts/core/distribution/explorer.js +12 -5
  44. package/dist/charts/core/distribution/xy-points.js +1 -1
  45. package/dist/charts/core/index.d.ts +3 -0
  46. package/dist/charts/core/index.js +3 -0
  47. package/dist/charts/core/leave-grace.d.ts +11 -0
  48. package/dist/charts/core/leave-grace.js +26 -0
  49. package/dist/charts/core/nearest.d.ts +14 -0
  50. package/dist/charts/core/nearest.js +22 -0
  51. package/dist/charts/core/plot-overlay.js +9 -3
  52. package/dist/charts/core/pointer.test-utils.d.ts +38 -0
  53. package/dist/charts/core/pointer.test-utils.js +123 -0
  54. package/dist/charts/core/tooltip.d.ts +25 -2
  55. package/dist/charts/core/tooltip.js +115 -40
  56. package/dist/charts/core/touch-select.d.ts +20 -0
  57. package/dist/charts/core/touch-select.js +184 -0
  58. package/dist/charts/core/types.d.ts +8 -4
  59. package/dist/charts/core/types.js +5 -0
  60. package/dist/charts/core/use-index-navigation.d.ts +17 -6
  61. package/dist/charts/core/use-index-navigation.js +47 -10
  62. package/dist/charts/donut-chart/donut-chart.d.ts +5 -1
  63. package/dist/charts/donut-chart/donut-chart.js +40 -1
  64. package/dist/charts/donut-chart/slice-labels.d.ts +20 -0
  65. package/dist/charts/donut-chart/slice-labels.js +20 -0
  66. package/dist/charts/dumbbell-chart/dumbbell-chart.js +6 -3
  67. package/dist/charts/fill-gauge-chart/fill-gauge-chart.js +1 -0
  68. package/dist/charts/funnel-chart/funnel-chart.js +2 -1
  69. package/dist/charts/gauge-chart/gauge-chart.js +2 -1
  70. package/dist/charts/heatmap-chart/heatmap-chart.d.ts +4 -1
  71. package/dist/charts/heatmap-chart/heatmap-chart.js +3 -1
  72. package/dist/charts/heatmap-chart/heatmap-grid.d.ts +4 -1
  73. package/dist/charts/heatmap-chart/heatmap-grid.js +3 -1
  74. package/dist/charts/hex-tile-map/hex-tile-map.js +124 -115
  75. package/dist/charts/hierarchy-morph/hierarchy-morph.js +2 -1
  76. package/dist/charts/icicle-chart/icicle-chart.js +7 -9
  77. package/dist/charts/lollipop-chart/lollipop-chart.js +6 -3
  78. package/dist/charts/maps/geo/map-viewport.js +1 -1
  79. package/dist/charts/polar-area-chart/polar-area-chart.js +42 -12
  80. package/dist/charts/progress-units/progress-units.js +1 -0
  81. package/dist/charts/radar-chart/radar-chart.js +1 -1
  82. package/dist/charts/radial-bar-chart/radial-bar-chart.js +2 -1
  83. package/dist/charts/range-area-chart/range-area-chart.js +3 -2
  84. package/dist/charts/sankey-chart/sankey-chart.js +12 -4
  85. package/dist/charts/tree-chart/tree-chart.js +1 -0
  86. package/dist/charts/treemap-chart/treemap-chart.js +2 -7
  87. package/dist/charts/waterfall-chart/waterfall-chart.js +6 -3
  88. package/dist/containers/action-bar/action-bar.d.ts +11 -2
  89. package/dist/containers/action-bar/action-bar.js +4 -1
  90. package/dist/containers/card/card.d.ts +21 -3
  91. package/dist/containers/card/card.js +20 -5
  92. package/dist/containers/grid/grid.d.ts +15 -0
  93. package/dist/containers/grid/grid.js +24 -0
  94. package/dist/containers/grid/index.d.ts +1 -0
  95. package/dist/containers/grid/index.js +4 -0
  96. package/dist/containers/index.d.ts +3 -0
  97. package/dist/containers/index.js +3 -0
  98. package/dist/containers/kpi/kpi.d.ts +13 -2
  99. package/dist/containers/kpi/kpi.js +86 -24
  100. package/dist/containers/kpi-group/index.d.ts +1 -1
  101. package/dist/containers/kpi-group/index.js +3 -1
  102. package/dist/containers/kpi-group/kpi-group.d.ts +9 -1
  103. package/dist/containers/kpi-group/kpi-group.js +11 -1
  104. package/dist/containers/page/index.d.ts +1 -0
  105. package/dist/containers/page/index.js +4 -0
  106. package/dist/containers/page/page.d.ts +7 -0
  107. package/dist/containers/page/page.js +14 -0
  108. package/dist/containers/page-header/page-header.d.ts +8 -3
  109. package/dist/containers/page-header/page-header.js +35 -8
  110. package/dist/containers/responsive-list/responsive-list.d.ts +1 -1
  111. package/dist/containers/responsive-list/responsive-list.js +6 -3
  112. package/dist/containers/stack/index.d.ts +1 -0
  113. package/dist/containers/stack/index.js +6 -0
  114. package/dist/containers/stack/stack.d.ts +15 -0
  115. package/dist/containers/stack/stack.js +43 -0
  116. package/dist/forms/copy-field/copy-field.d.ts +17 -0
  117. package/dist/forms/copy-field/copy-field.js +72 -0
  118. package/dist/forms/copy-field/index.d.ts +1 -0
  119. package/dist/forms/copy-field/index.js +4 -0
  120. package/dist/forms/emoji-picker/emoji-picker.js +1 -1
  121. package/dist/forms/form/form.d.ts +15 -0
  122. package/dist/forms/form/form.js +29 -0
  123. package/dist/forms/form/index.d.ts +1 -0
  124. package/dist/forms/form/index.js +10 -0
  125. package/dist/forms/index.d.ts +2 -0
  126. package/dist/forms/index.js +2 -0
  127. package/dist/forms/input/index.d.ts +1 -1
  128. package/dist/forms/input/index.js +3 -2
  129. package/dist/forms/input/input.d.ts +6 -2
  130. package/dist/forms/input/input.js +9 -3
  131. package/dist/glass/crystal-map.d.ts +70 -0
  132. package/dist/glass/crystal-map.js +88 -0
  133. package/dist/glass/displacement-map.d.ts +117 -0
  134. package/dist/glass/displacement-map.js +201 -0
  135. package/dist/glass/index.d.ts +8 -0
  136. package/dist/glass/index.js +63 -0
  137. package/dist/glass/lens-crystal.d.ts +29 -0
  138. package/dist/glass/lens-crystal.js +161 -0
  139. package/dist/glass/lens-dispersion.d.ts +11 -0
  140. package/dist/glass/lens-dispersion.js +19 -0
  141. package/dist/glass/liquid-glass.d.ts +41 -0
  142. package/dist/glass/liquid-glass.js +256 -0
  143. package/dist/glass/liquid-motion.d.ts +53 -0
  144. package/dist/glass/liquid-motion.js +302 -0
  145. package/dist/glass/liquid-options.d.ts +162 -0
  146. package/dist/glass/liquid-options.js +179 -0
  147. package/dist/glass/refraction.d.ts +100 -0
  148. package/dist/glass/refraction.js +714 -0
  149. package/dist/glass/specular-map.d.ts +26 -0
  150. package/dist/glass/specular-map.js +75 -0
  151. package/dist/glass/spring.d.ts +79 -0
  152. package/dist/glass/spring.js +58 -0
  153. package/dist/glass/support.d.ts +13 -0
  154. package/dist/glass/support.js +14 -0
  155. package/dist/glass/use-glass-refraction.d.ts +8 -0
  156. package/dist/glass/use-glass-refraction.js +16 -0
  157. package/dist/i18n/strings.d.ts +24 -0
  158. package/dist/i18n/strings.js +18 -2
  159. package/dist/icons/index.d.ts +2 -0
  160. package/dist/icons/index.js +4 -0
  161. package/dist/icons/key.d.ts +2 -0
  162. package/dist/icons/key.js +12 -0
  163. package/dist/icons/webhook.d.ts +2 -0
  164. package/dist/icons/webhook.js +12 -0
  165. package/dist/liquid/index.d.ts +3 -0
  166. package/dist/liquid/index.js +29 -0
  167. package/dist/navigation/breadcrumbs/breadcrumbs.d.ts +29 -0
  168. package/dist/navigation/breadcrumbs/breadcrumbs.js +70 -0
  169. package/dist/navigation/breadcrumbs/index.d.ts +1 -0
  170. package/dist/navigation/breadcrumbs/index.js +6 -0
  171. package/dist/navigation/index.d.ts +1 -0
  172. package/dist/navigation/index.js +1 -0
  173. package/dist/navigation/segmented/index.d.ts +1 -1
  174. package/dist/navigation/segmented/model.d.ts +5 -0
  175. package/dist/navigation/segmented/model.js +6 -0
  176. package/dist/navigation/segmented/segmented.d.ts +17 -3
  177. package/dist/navigation/segmented/segmented.js +20 -4
  178. package/dist/overlays/context-menu/context-menu.d.ts +9 -1
  179. package/dist/overlays/context-menu/context-menu.js +4 -1
  180. package/dist/overlays/dialog/dialog.d.ts +9 -1
  181. package/dist/overlays/dialog/dialog.js +3 -0
  182. package/dist/overlays/drawer/drawer.d.ts +9 -1
  183. package/dist/overlays/drawer/drawer.js +3 -0
  184. package/dist/overlays/dropdown-menu/dropdown-menu.d.ts +9 -1
  185. package/dist/overlays/dropdown-menu/dropdown-menu.js +3 -1
  186. package/dist/overlays/hover-card/hover-card.d.ts +10 -1
  187. package/dist/overlays/hover-card/hover-card.js +4 -1
  188. package/dist/overlays/popover/popover.d.ts +9 -1
  189. package/dist/overlays/popover/popover.js +3 -0
  190. package/dist/palette/command-palette/command-palette.d.ts +12 -2
  191. package/dist/palette/command-palette/command-palette.js +5 -0
  192. package/dist/primitives/command/command.d.ts +3 -2
  193. package/dist/primitives/command/command.js +2 -0
  194. package/dist/primitives/menu/menu.js +1 -1
  195. package/dist/primitives/popper/popper.js +5 -0
  196. package/dist/rich-text/rich-text-editor.js +94 -8
  197. package/dist/rich-text/sanitize.js +70 -20
  198. package/dist/shell/app-shell/app-shell.d.ts +17 -0
  199. package/dist/shell/app-shell/app-shell.js +44 -4
  200. package/dist/shell/bottom-nav/bottom-nav.d.ts +34 -0
  201. package/dist/shell/bottom-nav/bottom-nav.js +124 -0
  202. package/dist/shell/bottom-nav/index.d.ts +2 -0
  203. package/dist/shell/bottom-nav/index.js +9 -0
  204. package/dist/shell/bottom-nav/split.d.ts +11 -0
  205. package/dist/shell/bottom-nav/split.js +10 -0
  206. package/dist/shell/sidebar/sidebar.d.ts +16 -2
  207. package/dist/shell/sidebar/sidebar.js +46 -4
  208. package/dist/shell/topbar/topbar.d.ts +20 -9
  209. package/dist/shell/topbar/topbar.js +16 -9
  210. package/dist/states/empty-state/empty-state.d.ts +3 -1
  211. package/dist/states/empty-state/empty-state.js +9 -1
  212. package/dist/states/error-state/error-state.d.ts +3 -1
  213. package/dist/states/error-state/error-state.js +2 -0
  214. package/dist/states/index.d.ts +1 -0
  215. package/dist/states/index.js +1 -0
  216. package/dist/states/live-status-bar/index.d.ts +1 -0
  217. package/dist/states/live-status-bar/index.js +6 -0
  218. package/dist/states/live-status-bar/live-status-bar.d.ts +17 -0
  219. package/dist/states/live-status-bar/live-status-bar.js +49 -0
  220. package/dist/states/offline-banner/offline-banner.d.ts +3 -1
  221. package/dist/states/offline-banner/offline-banner.js +8 -4
  222. package/dist/utils/class-groups.js +17 -0
  223. package/dist/utils/index.d.ts +1 -0
  224. package/dist/utils/index.js +2 -0
  225. package/dist/utils/material.d.ts +13 -0
  226. package/dist/utils/material.js +6 -0
  227. package/dist/utils/tone.d.ts +8 -0
  228. package/dist/utils/tone.js +17 -0
  229. package/dist/utils/use-copy.d.ts +5 -0
  230. package/dist/utils/use-copy.js +35 -0
  231. package/icons/svg/key.svg +5 -0
  232. package/icons/svg/webhook.svg +5 -0
  233. package/package.json +31 -21
  234. package/scripts/build-theme.d.mts +22 -0
  235. package/scripts/build-theme.mjs +236 -4
  236. package/src/ai/attachment/attachment.tsx +1 -1
  237. package/src/ai/chat-list/group.ts +3 -1
  238. package/src/ai/conversation/conversation.tsx +1 -1
  239. package/src/ai/internal/use-copy.ts +1 -38
  240. package/src/ai/markdown/parse.ts +74 -17
  241. package/src/ai/source/source.tsx +1 -1
  242. package/src/atoms/avatar/avatar.tsx +57 -4
  243. package/src/atoms/avatar/index.ts +8 -1
  244. package/src/atoms/button/button.tsx +8 -3
  245. package/src/atoms/checkbox/checkbox.tsx +44 -10
  246. package/src/atoms/chip/chip.tsx +37 -5
  247. package/src/atoms/chip/index.ts +7 -1
  248. package/src/atoms/status-dot/index.ts +1 -0
  249. package/src/atoms/status-dot/status-dot.tsx +15 -3
  250. package/src/charts/README.md +21 -0
  251. package/src/charts/bar-chart/bar-race-chart.tsx +1 -0
  252. package/src/charts/beeswarm-chart/beeswarm-chart.tsx +1 -1
  253. package/src/charts/chord-chart/chord-chart.tsx +13 -5
  254. package/src/charts/core/cartesian/cartesian-chart.tsx +55 -10
  255. package/src/charts/core/cartesian/layout.ts +29 -10
  256. package/src/charts/core/cartesian/marks.tsx +3 -3
  257. package/src/charts/core/cartesian/types.ts +30 -2
  258. package/src/charts/core/category-explorer.tsx +12 -6
  259. package/src/charts/core/chart-dock.tsx +68 -0
  260. package/src/charts/core/chart-frame.tsx +116 -27
  261. package/src/charts/core/distribution/explorer.tsx +17 -7
  262. package/src/charts/core/distribution/xy-points.tsx +1 -1
  263. package/src/charts/core/index.ts +3 -0
  264. package/src/charts/core/leave-grace.ts +35 -0
  265. package/src/charts/core/nearest.ts +38 -0
  266. package/src/charts/core/plot-overlay.tsx +9 -3
  267. package/src/charts/core/pointer.test-utils.ts +146 -0
  268. package/src/charts/core/tooltip.tsx +129 -15
  269. package/src/charts/core/touch-select.ts +250 -0
  270. package/src/charts/core/types.ts +13 -4
  271. package/src/charts/core/use-index-navigation.ts +70 -11
  272. package/src/charts/donut-chart/donut-chart.tsx +53 -3
  273. package/src/charts/donut-chart/slice-labels.ts +39 -0
  274. package/src/charts/dumbbell-chart/dumbbell-chart.tsx +8 -3
  275. package/src/charts/fill-gauge-chart/fill-gauge-chart.tsx +1 -0
  276. package/src/charts/funnel-chart/funnel-chart.tsx +2 -1
  277. package/src/charts/gauge-chart/gauge-chart.tsx +2 -1
  278. package/src/charts/heatmap-chart/heatmap-chart.tsx +5 -0
  279. package/src/charts/heatmap-chart/heatmap-grid.tsx +5 -1
  280. package/src/charts/hex-tile-map/hex-tile-map.tsx +6 -1
  281. package/src/charts/hierarchy-morph/hierarchy-morph.tsx +2 -1
  282. package/src/charts/icicle-chart/icicle-chart.tsx +8 -9
  283. package/src/charts/lollipop-chart/lollipop-chart.tsx +8 -3
  284. package/src/charts/maps/geo/map-viewport.tsx +1 -1
  285. package/src/charts/polar-area-chart/polar-area-chart.tsx +37 -12
  286. package/src/charts/progress-units/progress-units.tsx +1 -0
  287. package/src/charts/radar-chart/radar-chart.tsx +1 -1
  288. package/src/charts/radial-bar-chart/radial-bar-chart.tsx +2 -1
  289. package/src/charts/range-area-chart/range-area-chart.tsx +3 -2
  290. package/src/charts/sankey-chart/sankey-chart.tsx +12 -4
  291. package/src/charts/tree-chart/tree-chart.tsx +1 -0
  292. package/src/charts/treemap-chart/treemap-chart.tsx +2 -7
  293. package/src/charts/waterfall-chart/waterfall-chart.tsx +8 -3
  294. package/src/containers/action-bar/action-bar.tsx +13 -2
  295. package/src/containers/card/card.tsx +43 -4
  296. package/src/containers/grid/grid.tsx +37 -0
  297. package/src/containers/grid/index.ts +1 -0
  298. package/src/containers/index.ts +3 -0
  299. package/src/containers/kpi/kpi.tsx +116 -22
  300. package/src/containers/kpi-group/index.ts +7 -1
  301. package/src/containers/kpi-group/kpi-group.tsx +26 -1
  302. package/src/containers/page/index.ts +1 -0
  303. package/src/containers/page/page.tsx +17 -0
  304. package/src/containers/page-header/page-header.tsx +38 -8
  305. package/src/containers/responsive-list/responsive-list.tsx +7 -4
  306. package/src/containers/stack/index.ts +7 -0
  307. package/src/containers/stack/stack.tsx +55 -0
  308. package/src/forms/copy-field/copy-field.tsx +88 -0
  309. package/src/forms/copy-field/index.ts +1 -0
  310. package/src/forms/emoji-picker/emoji-picker.tsx +1 -1
  311. package/src/forms/form/form.tsx +46 -0
  312. package/src/forms/form/index.ts +8 -0
  313. package/src/forms/index.ts +2 -0
  314. package/src/forms/input/index.ts +1 -1
  315. package/src/forms/input/input.tsx +14 -3
  316. package/src/glass/crystal-map.ts +150 -0
  317. package/src/glass/displacement-map.ts +317 -0
  318. package/src/glass/index.ts +43 -0
  319. package/src/glass/lens-crystal.ts +226 -0
  320. package/src/glass/lens-dispersion.ts +34 -0
  321. package/src/glass/liquid-glass.tsx +371 -0
  322. package/src/glass/liquid-motion.ts +395 -0
  323. package/src/glass/liquid-options.ts +306 -0
  324. package/src/glass/refraction.ts +1010 -0
  325. package/src/glass/specular-map.ts +95 -0
  326. package/src/glass/spring.ts +98 -0
  327. package/src/glass/support.ts +27 -0
  328. package/src/glass/use-glass-refraction.ts +21 -0
  329. package/src/i18n/strings.ts +24 -0
  330. package/src/icons/index.ts +2 -0
  331. package/src/icons/key.tsx +13 -0
  332. package/src/icons/webhook.tsx +13 -0
  333. package/src/liquid/index.ts +24 -0
  334. package/src/navigation/breadcrumbs/breadcrumbs.tsx +103 -0
  335. package/src/navigation/breadcrumbs/index.ts +8 -0
  336. package/src/navigation/index.ts +1 -0
  337. package/src/navigation/segmented/index.ts +1 -0
  338. package/src/navigation/segmented/model.ts +11 -0
  339. package/src/navigation/segmented/segmented.tsx +45 -6
  340. package/src/overlays/context-menu/context-menu.tsx +11 -1
  341. package/src/overlays/dialog/dialog.tsx +10 -0
  342. package/src/overlays/drawer/drawer.tsx +10 -0
  343. package/src/overlays/dropdown-menu/dropdown-menu.tsx +10 -1
  344. package/src/overlays/hover-card/hover-card.tsx +12 -1
  345. package/src/overlays/popover/popover.tsx +10 -0
  346. package/src/palette/command-palette/command-palette.tsx +15 -1
  347. package/src/primitives/command/command.tsx +4 -0
  348. package/src/primitives/menu/menu.tsx +1 -1
  349. package/src/primitives/popper/popper.tsx +10 -0
  350. package/src/rich-text/rich-text-editor.tsx +116 -13
  351. package/src/rich-text/sanitize.ts +94 -23
  352. package/src/shell/app-shell/app-shell.tsx +60 -4
  353. package/src/shell/bottom-nav/bottom-nav.tsx +187 -0
  354. package/src/shell/bottom-nav/index.ts +8 -0
  355. package/src/shell/bottom-nav/split.ts +20 -0
  356. package/src/shell/sidebar/sidebar.tsx +51 -5
  357. package/src/shell/topbar/topbar.tsx +81 -58
  358. package/src/states/empty-state/empty-state.tsx +11 -1
  359. package/src/states/error-state/error-state.tsx +4 -0
  360. package/src/states/index.ts +1 -0
  361. package/src/states/live-status-bar/index.ts +6 -0
  362. package/src/states/live-status-bar/live-status-bar.tsx +62 -0
  363. package/src/states/offline-banner/offline-banner.tsx +13 -5
  364. package/src/utils/class-groups.ts +17 -0
  365. package/src/utils/index.ts +1 -0
  366. package/src/utils/material.ts +16 -0
  367. package/src/utils/tone.ts +29 -0
  368. package/src/utils/use-copy.ts +38 -0
  369. package/styles/Theme.kt +64 -3
  370. package/styles/base.css +51 -0
  371. package/styles/tailwind.css +833 -0
  372. package/styles/theme.css +546 -4
  373. package/styles/tokens.css +788 -15
  374. package/tokens/default.json +918 -29
  375. package/scripts/build-theme.d.ts +0 -18
@@ -1,49 +1,111 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { cn } from "../../utils/cn.js";
3
+ import { customToneStyle, isCustomTone } from "../../utils/tone.js";
4
+ const valueToneClasses = {
5
+ neutral: "text-ink",
6
+ accent: "text-accent-ink",
7
+ success: "text-success",
8
+ warning: "text-warning",
9
+ danger: "text-danger",
10
+ info: "text-info"
11
+ };
12
+ const dotToneClasses = {
13
+ neutral: "bg-ink-3",
14
+ accent: "bg-accent",
15
+ success: "bg-success",
16
+ warning: "bg-warning",
17
+ danger: "bg-danger",
18
+ info: "bg-info"
19
+ };
20
+ const builtinTones = new Set(Object.keys(valueToneClasses));
3
21
  function Kpi({
4
22
  label,
5
23
  value,
6
24
  suffix,
7
25
  description,
8
26
  variant = "default",
27
+ tone: toneProp,
28
+ dot,
29
+ icon,
30
+ trend,
9
31
  className,
10
32
  classNames,
33
+ style,
11
34
  ...props
12
35
  }) {
36
+ const tone = toneProp ?? (variant === "danger" ? "danger" : "neutral");
37
+ const custom = isCustomTone(tone, builtinTones);
38
+ const valueTone = custom ? "text-(--tone-c-ink)" : valueToneClasses[tone] ?? valueToneClasses.neutral;
39
+ const dotTone = custom ? "bg-(--tone-c)" : dotToneClasses[tone] ?? dotToneClasses.neutral;
40
+ const labelNode = /* @__PURE__ */ jsxs(
41
+ "span",
42
+ {
43
+ className: cn(
44
+ "break-words font-semibold text-fs-120 text-ink-2",
45
+ dot && "inline-flex items-center gap-1.5",
46
+ classNames?.label
47
+ ),
48
+ children: [
49
+ dot ? /* @__PURE__ */ jsx(
50
+ "span",
51
+ {
52
+ "aria-hidden": "true",
53
+ className: cn("size-1.5 shrink-0 rounded-pill", dotTone, classNames?.dot)
54
+ }
55
+ ) : null,
56
+ label
57
+ ]
58
+ }
59
+ );
60
+ const valueNode = /* @__PURE__ */ jsxs(
61
+ "span",
62
+ {
63
+ className: cn(
64
+ "break-words text-kpi-number tabular-nums @max-[9rem]/kpi:text-fs-220",
65
+ valueTone,
66
+ classNames?.value
67
+ ),
68
+ children: [
69
+ value,
70
+ suffix ? /* @__PURE__ */ jsx(
71
+ "small",
72
+ {
73
+ className: cn(
74
+ "ml-1 font-semibold text-fs-140 text-ink-3 tracking-normal",
75
+ classNames?.suffix
76
+ ),
77
+ children: suffix
78
+ }
79
+ ) : null
80
+ ]
81
+ }
82
+ );
13
83
  return /* @__PURE__ */ jsxs(
14
84
  "div",
15
85
  {
16
86
  ...props,
87
+ style: customToneStyle(tone, builtinTones, style),
17
88
  className: cn(
18
89
  "@container/kpi flex min-w-0 flex-col gap-0.5 bg-surface px-4.5 py-3.5",
19
90
  classNames?.root,
20
91
  className
21
92
  ),
22
93
  children: [
23
- /* @__PURE__ */ jsx("span", { className: cn("break-words font-semibold text-fs-120 text-ink-2", classNames?.label), children: label }),
24
- /* @__PURE__ */ jsxs(
25
- "span",
26
- {
27
- className: cn(
28
- "break-words text-kpi-number tabular-nums @max-[9rem]/kpi:text-fs-220",
29
- variant === "danger" ? "text-danger" : "text-ink",
30
- classNames?.value
31
- ),
32
- children: [
33
- value,
34
- suffix ? /* @__PURE__ */ jsx(
35
- "small",
36
- {
37
- className: cn(
38
- "ml-1 font-semibold text-fs-140 text-ink-3 tracking-normal",
39
- classNames?.suffix
40
- ),
41
- children: suffix
42
- }
43
- ) : null
44
- ]
45
- }
46
- ),
94
+ icon ? /* @__PURE__ */ jsxs("div", { className: cn("flex items-center justify-between gap-2", classNames?.header), children: [
95
+ labelNode,
96
+ /* @__PURE__ */ jsx(
97
+ "span",
98
+ {
99
+ "aria-hidden": "true",
100
+ className: cn("shrink-0 text-ink-3 [&_svg]:size-4", classNames?.icon),
101
+ children: icon
102
+ }
103
+ )
104
+ ] }) : labelNode,
105
+ trend ? /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-baseline gap-x-2 gap-y-1", children: [
106
+ valueNode,
107
+ /* @__PURE__ */ jsx("span", { className: cn("shrink-0", classNames?.trend), children: trend })
108
+ ] }) : valueNode,
47
109
  description ? /* @__PURE__ */ jsx("span", { className: cn("break-words text-fs-120 text-ink-3", classNames?.description), children: description }) : null
48
110
  ]
49
111
  }
@@ -1 +1 @@
1
- export { KpiGroup, type KpiGroupItem, type KpiGroupPart, type KpiGroupProps } from "./kpi-group.js";
1
+ export { KpiGroup, type KpiGroupItem, type KpiGroupLayout, type KpiGroupPart, type KpiGroupProps, } from "./kpi-group.js";
@@ -1,4 +1,6 @@
1
- import { KpiGroup } from "./kpi-group.js";
1
+ import {
2
+ KpiGroup
3
+ } from "./kpi-group.js";
2
4
  export {
3
5
  KpiGroup
4
6
  };
@@ -14,9 +14,17 @@ export interface KpiGroupItem {
14
14
  invertTrend?: boolean;
15
15
  description?: ReactNode;
16
16
  }
17
+ export type KpiGroupLayout = "divided" | "auto-fit";
17
18
  export type KpiGroupPart = "root" | "list" | "item" | "label" | "value" | "trend" | "description";
18
19
  export interface KpiGroupProps extends Omit<ComponentPropsWithoutRef<"dl">, "children"> {
19
20
  items: KpiGroupItem[];
21
+ /**
22
+ * `divided` (default): one card, 1, 2 or 4 columns by container width. `auto-fit`: separate
23
+ * cards in as many columns as fit `minItemWidth`.
24
+ */
25
+ layout?: KpiGroupLayout;
26
+ /** Minimum tile width in px for `layout="auto-fit"`. */
27
+ minItemWidth?: number;
20
28
  /** Animate numeric values counting up. */
21
29
  animate?: boolean;
22
30
  /** Per-part classes merged with `cn`; consumer classes win. `className` still targets the root wrapper and is merged last. */
@@ -26,4 +34,4 @@ export interface KpiGroupProps extends Omit<ComponentPropsWithoutRef<"dl">, "chi
26
34
  * Metrics that belong together in one card, divided by hairlines. Columns follow the
27
35
  * container width: 1, 2 or 4 across.
28
36
  */
29
- export declare function KpiGroup({ items, animate, className, classNames, ...props }: KpiGroupProps): import("react").JSX.Element;
37
+ export declare function KpiGroup({ items, layout, minItemWidth, animate, className, classNames, style, ...props }: KpiGroupProps): import("react").JSX.Element;
@@ -4,17 +4,26 @@ import { TrendChip } from "../../atoms/trend-chip/trend-chip.js";
4
4
  import { cn } from "../../utils/cn.js";
5
5
  function KpiGroup({
6
6
  items,
7
+ layout = "divided",
8
+ minItemWidth = 150,
7
9
  animate = true,
8
10
  className,
9
11
  classNames,
12
+ style,
10
13
  ...props
11
14
  }) {
15
+ const autoFit = layout === "auto-fit";
12
16
  return /* @__PURE__ */ jsx("div", { className: cn("@container/kpi-group min-w-0", classNames?.root, className), children: /* @__PURE__ */ jsx(
13
17
  "dl",
14
18
  {
15
19
  ...props,
20
+ style: autoFit ? {
21
+ gridTemplateColumns: `repeat(auto-fit, minmax(min(100%, ${minItemWidth}px), 1fr))`,
22
+ ...style
23
+ } : style,
16
24
  className: cn(
17
- "m-0 grid grid-cols-1 gap-px overflow-hidden rounded-card border-card bg-divider shadow-card @sm/kpi-group:grid-cols-2 @3xl/kpi-group:grid-cols-4",
25
+ "m-0 grid",
26
+ autoFit ? "gap-density" : "grid-cols-1 gap-px overflow-hidden rounded-card border-card bg-divider shadow-card @sm/kpi-group:grid-cols-2 @3xl/kpi-group:grid-cols-4",
18
27
  classNames?.list
19
28
  ),
20
29
  children: items.map((item) => /* @__PURE__ */ jsxs(
@@ -22,6 +31,7 @@ function KpiGroup({
22
31
  {
23
32
  className: cn(
24
33
  "surface-card flex min-w-0 flex-col gap-density-sm p-card",
34
+ autoFit && "rounded-card border-card shadow-card",
25
35
  classNames?.item
26
36
  ),
27
37
  children: [
@@ -0,0 +1 @@
1
+ export { Page, type PageProps } from "./page.js";
@@ -0,0 +1,4 @@
1
+ import { Page } from "./page.js";
2
+ export {
3
+ Page
4
+ };
@@ -0,0 +1,7 @@
1
+ import type { ComponentPropsWithoutRef } from "react";
2
+ export type PageProps = ComponentPropsWithoutRef<"div">;
3
+ /**
4
+ * Vertical flow of page sections. It is the `page` container, so `Cols` and `SettingsLayout`
5
+ * inside it react to the page width instead of the viewport.
6
+ */
7
+ export declare function Page({ className, ...props }: PageProps): import("react").JSX.Element;
@@ -0,0 +1,14 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { cn } from "../../utils/cn.js";
3
+ function Page({ className, ...props }) {
4
+ return /* @__PURE__ */ jsx(
5
+ "div",
6
+ {
7
+ className: cn("@container/page flex w-full min-w-0 flex-col gap-6", className),
8
+ ...props
9
+ }
10
+ );
11
+ }
12
+ export {
13
+ Page
14
+ };
@@ -1,11 +1,16 @@
1
- import type { ComponentPropsWithoutRef } from "react";
2
- export type PageHeaderProps = ComponentPropsWithoutRef<"header">;
1
+ import type { ComponentPropsWithoutRef, ReactNode } from "react";
2
+ export interface PageHeaderProps extends ComponentPropsWithoutRef<"header"> {
3
+ /** Trail shown on its own row above the title, usually a `Breadcrumbs`. */
4
+ breadcrumbs?: ReactNode;
5
+ /** Tighter, centred header with a smaller title and a body-size lede. */
6
+ compact?: boolean;
7
+ }
3
8
  /**
4
9
  * Page header. No required parts: compose an eyebrow / title / lede block in
5
10
  * a plain `<div>` and, when the view has buttons, `PageHeaderActions` as the
6
11
  * second child. Actions wrap under the title when the container is too narrow.
7
12
  */
8
- export declare function PageHeader({ className, ...props }: PageHeaderProps): import("react").JSX.Element;
13
+ export declare function PageHeader({ breadcrumbs, className, compact, children, ...props }: PageHeaderProps): import("react").JSX.Element;
9
14
  export type PageHeaderEyebrowProps = ComponentPropsWithoutRef<"div">;
10
15
  export declare function PageHeaderEyebrow({ className, ...props }: PageHeaderEyebrowProps): import("react").JSX.Element;
11
16
  export type PageHeaderTitleProps = ComponentPropsWithoutRef<"h1">;
@@ -1,22 +1,46 @@
1
- import { jsx } from "react/jsx-runtime";
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { cn } from "../../utils/cn.js";
3
- function PageHeader({ className, ...props }) {
4
- return /* @__PURE__ */ jsx(
3
+ function PageHeader({
4
+ breadcrumbs,
5
+ className,
6
+ compact,
7
+ children,
8
+ ...props
9
+ }) {
10
+ return /* @__PURE__ */ jsxs(
5
11
  "header",
6
12
  {
7
- className: cn("flex flex-wrap items-end justify-between gap-x-6 gap-y-3.5", className),
8
- ...props
13
+ "data-compact": compact ? "" : void 0,
14
+ className: cn(
15
+ "flex flex-wrap items-end justify-between gap-x-6 gap-y-3.5",
16
+ compact && "flex-col items-center justify-center gap-y-2 text-center",
17
+ className
18
+ ),
19
+ ...props,
20
+ children: [
21
+ breadcrumbs ? /* @__PURE__ */ jsx("div", { className: "basis-full", children: breadcrumbs }) : null,
22
+ children
23
+ ]
9
24
  }
10
25
  );
11
26
  }
12
27
  function PageHeaderEyebrow({ className, ...props }) {
13
- return /* @__PURE__ */ jsx("div", { className: cn("mb-1 font-semibold text-fs-120 text-ink-3", className), ...props });
28
+ return /* @__PURE__ */ jsx(
29
+ "div",
30
+ {
31
+ className: cn("mb-1 font-semibold text-fs-120 text-ink-3 in-data-compact:mb-0.5", className),
32
+ ...props
33
+ }
34
+ );
14
35
  }
15
36
  function PageHeaderTitle({ className, ...props }) {
16
37
  return /* @__PURE__ */ jsx(
17
38
  "h1",
18
39
  {
19
- className: cn("m-0 break-words text-page-title [text-wrap:balance]", className),
40
+ className: cn(
41
+ "m-0 break-words text-page-title [text-wrap:balance] in-data-compact:text-fs-220",
42
+ className
43
+ ),
20
44
  ...props
21
45
  }
22
46
  );
@@ -25,7 +49,10 @@ function PageHeaderLede({ className, ...props }) {
25
49
  return /* @__PURE__ */ jsx(
26
50
  "p",
27
51
  {
28
- className: cn("mt-1.25 max-w-[68ch] break-words text-lede text-ink-2", className),
52
+ className: cn(
53
+ "mt-1.25 max-w-[68ch] break-words text-lede text-ink-2 in-data-compact:mt-0.5 in-data-compact:text-body",
54
+ className
55
+ ),
29
56
  ...props
30
57
  }
31
58
  );
@@ -24,5 +24,5 @@ export interface ResponsiveListProps<T> {
24
24
  /** Per-part classes merged with `cn`; consumer classes win. `className` still targets the root and is merged last. */
25
25
  classNames?: ClassNames<ResponsiveListPart>;
26
26
  }
27
- /** A table from `md` up and a stack of cards below it, from one column definition. */
27
+ /** A table once its own container is 42rem wide and a stack of cards below that, from one column definition. */
28
28
  export declare function ResponsiveList<T>({ caption, items, columns, rowKey, renderActions, actionsHeader, rowClassName, className, classNames, }: ResponsiveListProps<T>): import("react").JSX.Element;
@@ -24,12 +24,12 @@ function ResponsiveList({
24
24
  const strings = useUiStrings();
25
25
  const primary = columns.find((column) => column.primary) ?? columns[0];
26
26
  const details = columns.filter((column) => column !== primary);
27
- return /* @__PURE__ */ jsxs("div", { className: cn("min-w-0", classNames?.root, className), children: [
27
+ return /* @__PURE__ */ jsxs("div", { className: cn("@container/responsive-list min-w-0", classNames?.root, className), children: [
28
28
  /* @__PURE__ */ jsx(
29
29
  "div",
30
30
  {
31
31
  className: cn(
32
- "hidden rounded-card border-card shadow-card surface-card md:block",
32
+ "hidden rounded-card border-card shadow-card surface-card @min-[42rem]/responsive-list:block",
33
33
  classNames?.tableWrapper
34
34
  ),
35
35
  children: /* @__PURE__ */ jsxs(Table, { children: [
@@ -57,7 +57,10 @@ function ResponsiveList({
57
57
  "ul",
58
58
  {
59
59
  "aria-label": caption,
60
- className: cn("m-0 flex list-none flex-col gap-density p-0 md:hidden", classNames?.cards),
60
+ className: cn(
61
+ "m-0 flex list-none flex-col gap-density p-0 @min-[42rem]/responsive-list:hidden",
62
+ classNames?.cards
63
+ ),
61
64
  children: items.map((item) => /* @__PURE__ */ jsxs(
62
65
  "li",
63
66
  {
@@ -0,0 +1 @@
1
+ export { Stack, type StackAlign, type StackDirection, type StackGap, type StackProps, } from "./stack.js";
@@ -0,0 +1,6 @@
1
+ import {
2
+ Stack
3
+ } from "./stack.js";
4
+ export {
5
+ Stack
6
+ };
@@ -0,0 +1,15 @@
1
+ import type { ComponentPropsWithoutRef } from "react";
2
+ export type StackDirection = "column" | "row";
3
+ export type StackGap = "none" | "xs" | "sm" | "md" | "lg" | "xl";
4
+ export type StackAlign = "start" | "center" | "end" | "stretch" | "baseline";
5
+ export declare const stackGapClasses: Record<StackGap, string>;
6
+ export interface StackProps extends ComponentPropsWithoutRef<"div"> {
7
+ /** `column` stacks children vertically, `row` lays them out inline and wraps. Defaults to `column`. */
8
+ direction?: StackDirection;
9
+ /** Space between children. Defaults to `md`. */
10
+ gap?: StackGap;
11
+ /** Cross-axis alignment. Defaults to `stretch` for a column and `center` for a row. */
12
+ align?: StackAlign;
13
+ }
14
+ /** One-axis flex layout with token gaps. A row wraps instead of overflowing. */
15
+ export declare function Stack({ direction, gap, align, className, ...props }: StackProps): import("react").JSX.Element;
@@ -0,0 +1,43 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { cn } from "../../utils/cn.js";
3
+ const stackGapClasses = {
4
+ none: "gap-0",
5
+ xs: "gap-1",
6
+ sm: "gap-2",
7
+ md: "gap-4",
8
+ lg: "gap-6",
9
+ xl: "gap-8"
10
+ };
11
+ const alignClasses = {
12
+ start: "items-start",
13
+ center: "items-center",
14
+ end: "items-end",
15
+ stretch: "items-stretch",
16
+ baseline: "items-baseline"
17
+ };
18
+ function Stack({
19
+ direction = "column",
20
+ gap = "md",
21
+ align,
22
+ className,
23
+ ...props
24
+ }) {
25
+ const row = direction === "row";
26
+ return /* @__PURE__ */ jsx(
27
+ "div",
28
+ {
29
+ className: cn(
30
+ "flex min-w-0",
31
+ row ? "flex-row flex-wrap" : "flex-col",
32
+ alignClasses[align ?? (row ? "center" : "stretch")],
33
+ stackGapClasses[gap],
34
+ className
35
+ ),
36
+ ...props
37
+ }
38
+ );
39
+ }
40
+ export {
41
+ Stack,
42
+ stackGapClasses
43
+ };
@@ -0,0 +1,17 @@
1
+ import { type ComponentPropsWithoutRef, type ReactNode } from "react";
2
+ import type { ClassNames } from "../../utils/class-names.js";
3
+ export type CopyFieldPart = "root" | "label" | "box" | "value" | "button";
4
+ export interface CopyFieldProps extends Omit<ComponentPropsWithoutRef<"div">, "children" | "onCopy"> {
5
+ label: ReactNode;
6
+ /** Text shown in monospace and written to the clipboard. */
7
+ value: string;
8
+ /** Called after the value was copied. */
9
+ onCopy?: (value: string) => void;
10
+ /** Accessible name of the button; defaults to the UI string `copy`. */
11
+ copyLabel?: string;
12
+ /** Announced and shown on the button after copying; defaults to the UI string `copied`. */
13
+ copiedLabel?: string;
14
+ /** Per-part classes merged with `cn`; consumer classes win. `className` still targets the root and is merged last. */
15
+ classNames?: ClassNames<CopyFieldPart>;
16
+ }
17
+ export declare function CopyField({ label, value, onCopy, copyLabel, copiedLabel, className, classNames, ...props }: CopyFieldProps): import("react").JSX.Element;
@@ -0,0 +1,72 @@
1
+ "use client";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import { useId } from "react";
4
+ import { useUiStrings } from "../../i18n/index.js";
5
+ import { Check, Copy } from "../../icons/index.js";
6
+ import { cn } from "../../utils/cn.js";
7
+ import { useCopy } from "../../utils/use-copy.js";
8
+ function CopyField({
9
+ label,
10
+ value,
11
+ onCopy,
12
+ copyLabel,
13
+ copiedLabel,
14
+ className,
15
+ classNames,
16
+ ...props
17
+ }) {
18
+ const strings = useUiStrings();
19
+ const id = useId();
20
+ const { copied, copy } = useCopy(1500);
21
+ const buttonLabel = copied ? copiedLabel ?? strings.copied : copyLabel ?? strings.copy;
22
+ return /* @__PURE__ */ jsxs("div", { ...props, className: cn("flex min-w-0 flex-col gap-1.5", classNames?.root, className), children: [
23
+ /* @__PURE__ */ jsx("label", { htmlFor: id, className: cn("font-semibold text-ink-2 text-meta", classNames?.label), children: label }),
24
+ /* @__PURE__ */ jsxs(
25
+ "div",
26
+ {
27
+ className: cn(
28
+ "flex min-w-0 items-center gap-2 rounded-input border-control bg-surface-control pr-1 pl-3",
29
+ classNames?.box
30
+ ),
31
+ children: [
32
+ /* @__PURE__ */ jsx(
33
+ "input",
34
+ {
35
+ id,
36
+ readOnly: true,
37
+ value,
38
+ onFocus: (event) => event.currentTarget.select(),
39
+ className: cn(
40
+ "h-input min-w-0 flex-1 truncate bg-transparent font-mono text-control text-ink focus:outline-none",
41
+ classNames?.value
42
+ )
43
+ }
44
+ ),
45
+ /* @__PURE__ */ jsxs(
46
+ "button",
47
+ {
48
+ type: "button",
49
+ onClick: () => {
50
+ void copy(value);
51
+ onCopy?.(value);
52
+ },
53
+ className: cn(
54
+ "inline-flex h-control-sm shrink-0 cursor-pointer items-center gap-1.5 rounded-button px-2.5 font-semibold text-ink-2 text-meta hover:bg-surface-2 hover:text-ink focus-visible:focus-ring in-data-[density=touch]:h-11",
55
+ copied && "text-success",
56
+ classNames?.button
57
+ ),
58
+ children: [
59
+ copied ? /* @__PURE__ */ jsx(Check, { "aria-hidden": "true", className: "size-4" }) : /* @__PURE__ */ jsx(Copy, { "aria-hidden": "true", className: "size-4" }),
60
+ /* @__PURE__ */ jsx("span", { children: buttonLabel })
61
+ ]
62
+ }
63
+ )
64
+ ]
65
+ }
66
+ ),
67
+ /* @__PURE__ */ jsx("span", { role: "status", className: "sr-only", children: copied ? copiedLabel ?? strings.copied : null })
68
+ ] });
69
+ }
70
+ export {
71
+ CopyField
72
+ };
@@ -0,0 +1 @@
1
+ export { CopyField, type CopyFieldPart, type CopyFieldProps } from "./copy-field.js";
@@ -0,0 +1,4 @@
1
+ import { CopyField } from "./copy-field.js";
2
+ export {
3
+ CopyField
4
+ };
@@ -44,7 +44,7 @@ function EmojiPicker({
44
44
  "div",
45
45
  {
46
46
  className: cn(
47
- "@container/emoji flex w-full max-w-xs min-w-0 flex-col gap-density-sm rounded-popover border-card bg-surface-overlay p-card text-ink",
47
+ "@container/emoji flex w-full max-w-xs min-w-0 flex-col gap-density-sm rounded-popover border-card surface-overlay p-card text-ink",
48
48
  classNames?.root,
49
49
  className
50
50
  ),
@@ -0,0 +1,15 @@
1
+ import type { ComponentPropsWithoutRef, ReactNode } from "react";
2
+ export type FormProps = ComponentPropsWithoutRef<"form">;
3
+ /** Vertical form layout; every `<form>` attribute and handler passes through. */
4
+ export declare function Form({ className, ...props }: FormProps): import("react").JSX.Element;
5
+ interface FormMessageProps extends Omit<ComponentPropsWithoutRef<"p">, "role" | "children"> {
6
+ /** Message text; `null`, `undefined` and an empty string render nothing. */
7
+ message: ReactNode | null | undefined;
8
+ }
9
+ export type FormErrorProps = FormMessageProps;
10
+ /** Submit-level error. `role="alert"`, so assistive tech announces it as soon as it appears. */
11
+ export declare function FormError({ message, className, ...props }: FormErrorProps): import("react").JSX.Element | null;
12
+ export type FormStatusProps = FormMessageProps;
13
+ /** Submit-level confirmation. `role="status"`, a polite live region that does not interrupt. */
14
+ export declare function FormStatus({ message, className, ...props }: FormStatusProps): import("react").JSX.Element | null;
15
+ export {};
@@ -0,0 +1,29 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { cn } from "../../utils/cn.js";
3
+ function Form({ className, ...props }) {
4
+ return /* @__PURE__ */ jsx("form", { className: cn("flex min-w-0 flex-col gap-4", className), ...props });
5
+ }
6
+ function hasMessage(message) {
7
+ return message !== null && message !== void 0 && message !== false && message !== "";
8
+ }
9
+ function FormError({ message, className, ...props }) {
10
+ if (!hasMessage(message)) return null;
11
+ return /* @__PURE__ */ jsx("p", { role: "alert", className: cn("m-0 font-semibold text-danger text-meta", className), ...props, children: message });
12
+ }
13
+ function FormStatus({ message, className, ...props }) {
14
+ if (!hasMessage(message)) return null;
15
+ return /* @__PURE__ */ jsx(
16
+ "p",
17
+ {
18
+ role: "status",
19
+ className: cn("m-0 font-semibold text-meta text-success", className),
20
+ ...props,
21
+ children: message
22
+ }
23
+ );
24
+ }
25
+ export {
26
+ Form,
27
+ FormError,
28
+ FormStatus
29
+ };
@@ -0,0 +1 @@
1
+ export { Form, FormError, type FormErrorProps, type FormProps, FormStatus, type FormStatusProps, } from "./form.js";
@@ -0,0 +1,10 @@
1
+ import {
2
+ Form,
3
+ FormError,
4
+ FormStatus
5
+ } from "./form.js";
6
+ export {
7
+ Form,
8
+ FormError,
9
+ FormStatus
10
+ };
@@ -1,9 +1,11 @@
1
1
  export * from "./accent-picker/index.js";
2
2
  export * from "./checkbox-button-group/index.js";
3
+ export * from "./copy-field/index.js";
3
4
  export * from "./dropzone/index.js";
4
5
  export * from "./emoji-picker/index.js";
5
6
  export * from "./emoji-reaction-button/index.js";
6
7
  export * from "./field/index.js";
8
+ export * from "./form/index.js";
7
9
  export * from "./form-grid/index.js";
8
10
  export * from "./inline-select/index.js";
9
11
  export * from "./input/index.js";
@@ -1,9 +1,11 @@
1
1
  export * from "./accent-picker/index.js";
2
2
  export * from "./checkbox-button-group/index.js";
3
+ export * from "./copy-field/index.js";
3
4
  export * from "./dropzone/index.js";
4
5
  export * from "./emoji-picker/index.js";
5
6
  export * from "./emoji-reaction-button/index.js";
6
7
  export * from "./field/index.js";
8
+ export * from "./form/index.js";
7
9
  export * from "./form-grid/index.js";
8
10
  export * from "./inline-select/index.js";
9
11
  export * from "./input/index.js";
@@ -1 +1 @@
1
- export { Input, type InputProps } from "./input.js";
1
+ export { Input, type InputProps, type InputSize, inputSizeClasses } from "./input.js";
@@ -1,4 +1,5 @@
1
- import { Input } from "./input.js";
1
+ import { Input, inputSizeClasses } from "./input.js";
2
2
  export {
3
- Input
3
+ Input,
4
+ inputSizeClasses
4
5
  };