@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,10 +1,45 @@
1
1
  import type { ComponentPropsWithoutRef, ReactNode } from "react";
2
2
  import type { ClassNames } from "../../utils/class-names.js";
3
3
  import { cn } from "../../utils/cn.js";
4
+ import { customToneStyle, isCustomTone } from "../../utils/tone.js";
4
5
 
5
6
  export type KpiVariant = "default" | "danger";
6
7
 
7
- export type KpiPart = "root" | "label" | "value" | "suffix" | "description";
8
+ export type KpiBuiltinTone = "neutral" | "accent" | "success" | "warning" | "danger" | "info";
9
+
10
+ /** A built-in tone, or the name of a tone declared in `tonePalettes`. */
11
+ export type KpiTone = KpiBuiltinTone | (string & {});
12
+
13
+ const valueToneClasses: Record<KpiBuiltinTone, string> = {
14
+ neutral: "text-ink",
15
+ accent: "text-accent-ink",
16
+ success: "text-success",
17
+ warning: "text-warning",
18
+ danger: "text-danger",
19
+ info: "text-info",
20
+ };
21
+
22
+ const dotToneClasses: Record<KpiBuiltinTone, string> = {
23
+ neutral: "bg-ink-3",
24
+ accent: "bg-accent",
25
+ success: "bg-success",
26
+ warning: "bg-warning",
27
+ danger: "bg-danger",
28
+ info: "bg-info",
29
+ };
30
+
31
+ const builtinTones = new Set<string>(Object.keys(valueToneClasses));
32
+
33
+ export type KpiPart =
34
+ | "root"
35
+ | "header"
36
+ | "label"
37
+ | "dot"
38
+ | "icon"
39
+ | "value"
40
+ | "suffix"
41
+ | "trend"
42
+ | "description";
8
43
 
9
44
  export interface KpiProps extends Omit<ComponentPropsWithoutRef<"div">, "children"> {
10
45
  /** Short label describing the metric. */
@@ -16,6 +51,14 @@ export interface KpiProps extends Omit<ComponentPropsWithoutRef<"div">, "childre
16
51
  /** Optional subtext. */
17
52
  description?: ReactNode;
18
53
  variant?: KpiVariant;
54
+ /** Colours the value and the label dot. Wins over `variant`. */
55
+ tone?: KpiTone;
56
+ /** Leading dot on the label, in the tone's colour. */
57
+ dot?: boolean;
58
+ /** Icon at the end of the label row. */
59
+ icon?: ReactNode;
60
+ /** Change indicator next to the value, e.g. a `TrendChip`. */
61
+ trend?: ReactNode;
19
62
  /** Per-part classes merged with `cn`; consumer classes win. `className` still targets the root and is merged last. */
20
63
  classNames?: ClassNames<KpiPart>;
21
64
  }
@@ -26,41 +69,92 @@ export function Kpi({
26
69
  suffix,
27
70
  description,
28
71
  variant = "default",
72
+ tone: toneProp,
73
+ dot,
74
+ icon,
75
+ trend,
29
76
  className,
30
77
  classNames,
78
+ style,
31
79
  ...props
32
80
  }: KpiProps) {
81
+ const tone: KpiTone = toneProp ?? (variant === "danger" ? "danger" : "neutral");
82
+ const custom = isCustomTone(tone, builtinTones);
83
+ const valueTone = custom
84
+ ? "text-(--tone-c-ink)"
85
+ : (valueToneClasses[tone as KpiBuiltinTone] ?? valueToneClasses.neutral);
86
+ const dotTone = custom
87
+ ? "bg-(--tone-c)"
88
+ : (dotToneClasses[tone as KpiBuiltinTone] ?? dotToneClasses.neutral);
89
+ const labelNode = (
90
+ <span
91
+ className={cn(
92
+ "break-words font-semibold text-fs-120 text-ink-2",
93
+ dot && "inline-flex items-center gap-1.5",
94
+ classNames?.label,
95
+ )}
96
+ >
97
+ {dot ? (
98
+ <span
99
+ aria-hidden="true"
100
+ className={cn("size-1.5 shrink-0 rounded-pill", dotTone, classNames?.dot)}
101
+ />
102
+ ) : null}
103
+ {label}
104
+ </span>
105
+ );
106
+ const valueNode = (
107
+ <span
108
+ className={cn(
109
+ "break-words text-kpi-number tabular-nums @max-[9rem]/kpi:text-fs-220",
110
+ valueTone,
111
+ classNames?.value,
112
+ )}
113
+ >
114
+ {value}
115
+ {suffix ? (
116
+ <small
117
+ className={cn(
118
+ "ml-1 font-semibold text-fs-140 text-ink-3 tracking-normal",
119
+ classNames?.suffix,
120
+ )}
121
+ >
122
+ {suffix}
123
+ </small>
124
+ ) : null}
125
+ </span>
126
+ );
33
127
  return (
34
128
  <div
35
129
  {...props}
130
+ style={customToneStyle(tone, builtinTones, style)}
36
131
  className={cn(
37
132
  "@container/kpi flex min-w-0 flex-col gap-0.5 bg-surface px-4.5 py-3.5",
38
133
  classNames?.root,
39
134
  className,
40
135
  )}
41
136
  >
42
- <span className={cn("break-words font-semibold text-fs-120 text-ink-2", classNames?.label)}>
43
- {label}
44
- </span>
45
- <span
46
- className={cn(
47
- "break-words text-kpi-number tabular-nums @max-[9rem]/kpi:text-fs-220",
48
- variant === "danger" ? "text-danger" : "text-ink",
49
- classNames?.value,
50
- )}
51
- >
52
- {value}
53
- {suffix ? (
54
- <small
55
- className={cn(
56
- "ml-1 font-semibold text-fs-140 text-ink-3 tracking-normal",
57
- classNames?.suffix,
58
- )}
137
+ {icon ? (
138
+ <div className={cn("flex items-center justify-between gap-2", classNames?.header)}>
139
+ {labelNode}
140
+ <span
141
+ aria-hidden="true"
142
+ className={cn("shrink-0 text-ink-3 [&_svg]:size-4", classNames?.icon)}
59
143
  >
60
- {suffix}
61
- </small>
62
- ) : null}
63
- </span>
144
+ {icon}
145
+ </span>
146
+ </div>
147
+ ) : (
148
+ labelNode
149
+ )}
150
+ {trend ? (
151
+ <div className="flex flex-wrap items-baseline gap-x-2 gap-y-1">
152
+ {valueNode}
153
+ <span className={cn("shrink-0", classNames?.trend)}>{trend}</span>
154
+ </div>
155
+ ) : (
156
+ valueNode
157
+ )}
64
158
  {description ? (
65
159
  <span className={cn("break-words text-fs-120 text-ink-3", classNames?.description)}>
66
160
  {description}
@@ -1 +1,7 @@
1
- export { KpiGroup, type KpiGroupItem, type KpiGroupPart, type KpiGroupProps } from "./kpi-group.js";
1
+ export {
2
+ KpiGroup,
3
+ type KpiGroupItem,
4
+ type KpiGroupLayout,
5
+ type KpiGroupPart,
6
+ type KpiGroupProps,
7
+ } from "./kpi-group.js";
@@ -19,10 +19,19 @@ export interface KpiGroupItem {
19
19
  description?: ReactNode;
20
20
  }
21
21
 
22
+ export type KpiGroupLayout = "divided" | "auto-fit";
23
+
22
24
  export type KpiGroupPart = "root" | "list" | "item" | "label" | "value" | "trend" | "description";
23
25
 
24
26
  export interface KpiGroupProps extends Omit<ComponentPropsWithoutRef<"dl">, "children"> {
25
27
  items: KpiGroupItem[];
28
+ /**
29
+ * `divided` (default): one card, 1, 2 or 4 columns by container width. `auto-fit`: separate
30
+ * cards in as many columns as fit `minItemWidth`.
31
+ */
32
+ layout?: KpiGroupLayout;
33
+ /** Minimum tile width in px for `layout="auto-fit"`. */
34
+ minItemWidth?: number;
26
35
  /** Animate numeric values counting up. */
27
36
  animate?: boolean;
28
37
  /** Per-part classes merged with `cn`; consumer classes win. `className` still targets the root wrapper and is merged last. */
@@ -35,17 +44,32 @@ export interface KpiGroupProps extends Omit<ComponentPropsWithoutRef<"dl">, "chi
35
44
  */
36
45
  export function KpiGroup({
37
46
  items,
47
+ layout = "divided",
48
+ minItemWidth = 150,
38
49
  animate = true,
39
50
  className,
40
51
  classNames,
52
+ style,
41
53
  ...props
42
54
  }: KpiGroupProps) {
55
+ const autoFit = layout === "auto-fit";
43
56
  return (
44
57
  <div className={cn("@container/kpi-group min-w-0", classNames?.root, className)}>
45
58
  <dl
46
59
  {...props}
60
+ style={
61
+ autoFit
62
+ ? {
63
+ gridTemplateColumns: `repeat(auto-fit, minmax(min(100%, ${minItemWidth}px), 1fr))`,
64
+ ...style,
65
+ }
66
+ : style
67
+ }
47
68
  className={cn(
48
- "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",
69
+ "m-0 grid",
70
+ autoFit
71
+ ? "gap-density"
72
+ : "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",
49
73
  classNames?.list,
50
74
  )}
51
75
  >
@@ -54,6 +78,7 @@ export function KpiGroup({
54
78
  key={item.id}
55
79
  className={cn(
56
80
  "surface-card flex min-w-0 flex-col gap-density-sm p-card",
81
+ autoFit && "rounded-card border-card shadow-card",
57
82
  classNames?.item,
58
83
  )}
59
84
  >
@@ -0,0 +1 @@
1
+ export { Page, type PageProps } from "./page.js";
@@ -0,0 +1,17 @@
1
+ import type { ComponentPropsWithoutRef } from "react";
2
+ import { cn } from "../../utils/cn.js";
3
+
4
+ export type PageProps = ComponentPropsWithoutRef<"div">;
5
+
6
+ /**
7
+ * Vertical flow of page sections. It is the `page` container, so `Cols` and `SettingsLayout`
8
+ * inside it react to the page width instead of the viewport.
9
+ */
10
+ export function Page({ className, ...props }: PageProps) {
11
+ return (
12
+ <div
13
+ className={cn("@container/page flex w-full min-w-0 flex-col gap-6", className)}
14
+ {...props}
15
+ />
16
+ );
17
+ }
@@ -1,26 +1,50 @@
1
- import type { ComponentPropsWithoutRef } from "react";
1
+ import type { ComponentPropsWithoutRef, ReactNode } from "react";
2
2
  import { cn } from "../../utils/cn.js";
3
3
 
4
- export type PageHeaderProps = ComponentPropsWithoutRef<"header">;
4
+ export interface PageHeaderProps extends ComponentPropsWithoutRef<"header"> {
5
+ /** Trail shown on its own row above the title, usually a `Breadcrumbs`. */
6
+ breadcrumbs?: ReactNode;
7
+ /** Tighter, centred header with a smaller title and a body-size lede. */
8
+ compact?: boolean;
9
+ }
5
10
 
6
11
  /**
7
12
  * Page header. No required parts: compose an eyebrow / title / lede block in
8
13
  * a plain `<div>` and, when the view has buttons, `PageHeaderActions` as the
9
14
  * second child. Actions wrap under the title when the container is too narrow.
10
15
  */
11
- export function PageHeader({ className, ...props }: PageHeaderProps) {
16
+ export function PageHeader({
17
+ breadcrumbs,
18
+ className,
19
+ compact,
20
+ children,
21
+ ...props
22
+ }: PageHeaderProps) {
12
23
  return (
13
24
  <header
14
- className={cn("flex flex-wrap items-end justify-between gap-x-6 gap-y-3.5", className)}
25
+ data-compact={compact ? "" : undefined}
26
+ className={cn(
27
+ "flex flex-wrap items-end justify-between gap-x-6 gap-y-3.5",
28
+ compact && "flex-col items-center justify-center gap-y-2 text-center",
29
+ className,
30
+ )}
15
31
  {...props}
16
- />
32
+ >
33
+ {breadcrumbs ? <div className="basis-full">{breadcrumbs}</div> : null}
34
+ {children}
35
+ </header>
17
36
  );
18
37
  }
19
38
 
20
39
  export type PageHeaderEyebrowProps = ComponentPropsWithoutRef<"div">;
21
40
 
22
41
  export function PageHeaderEyebrow({ className, ...props }: PageHeaderEyebrowProps) {
23
- return <div className={cn("mb-1 font-semibold text-fs-120 text-ink-3", className)} {...props} />;
42
+ return (
43
+ <div
44
+ className={cn("mb-1 font-semibold text-fs-120 text-ink-3 in-data-compact:mb-0.5", className)}
45
+ {...props}
46
+ />
47
+ );
24
48
  }
25
49
 
26
50
  export type PageHeaderTitleProps = ComponentPropsWithoutRef<"h1">;
@@ -29,7 +53,10 @@ export type PageHeaderTitleProps = ComponentPropsWithoutRef<"h1">;
29
53
  export function PageHeaderTitle({ className, ...props }: PageHeaderTitleProps) {
30
54
  return (
31
55
  <h1
32
- className={cn("m-0 break-words text-page-title [text-wrap:balance]", className)}
56
+ className={cn(
57
+ "m-0 break-words text-page-title [text-wrap:balance] in-data-compact:text-fs-220",
58
+ className,
59
+ )}
33
60
  {...props}
34
61
  />
35
62
  );
@@ -40,7 +67,10 @@ export type PageHeaderLedeProps = ComponentPropsWithoutRef<"p">;
40
67
  export function PageHeaderLede({ className, ...props }: PageHeaderLedeProps) {
41
68
  return (
42
69
  <p
43
- className={cn("mt-1.25 max-w-[68ch] break-words text-lede text-ink-2", className)}
70
+ className={cn(
71
+ "mt-1.25 max-w-[68ch] break-words text-lede text-ink-2 in-data-compact:mt-0.5 in-data-compact:text-body",
72
+ className,
73
+ )}
44
74
  {...props}
45
75
  />
46
76
  );
@@ -50,7 +50,7 @@ export interface ResponsiveListProps<T> {
50
50
  classNames?: ClassNames<ResponsiveListPart>;
51
51
  }
52
52
 
53
- /** A table from `md` up and a stack of cards below it, from one column definition. */
53
+ /** A table once its own container is 42rem wide and a stack of cards below that, from one column definition. */
54
54
  export function ResponsiveList<T>({
55
55
  caption,
56
56
  items,
@@ -67,10 +67,10 @@ export function ResponsiveList<T>({
67
67
  const details = columns.filter((column) => column !== primary);
68
68
 
69
69
  return (
70
- <div className={cn("min-w-0", classNames?.root, className)}>
70
+ <div className={cn("@container/responsive-list min-w-0", classNames?.root, className)}>
71
71
  <div
72
72
  className={cn(
73
- "hidden rounded-card border-card shadow-card surface-card md:block",
73
+ "hidden rounded-card border-card shadow-card surface-card @min-[42rem]/responsive-list:block",
74
74
  classNames?.tableWrapper,
75
75
  )}
76
76
  >
@@ -116,7 +116,10 @@ export function ResponsiveList<T>({
116
116
  </div>
117
117
  <ul
118
118
  aria-label={caption}
119
- className={cn("m-0 flex list-none flex-col gap-density p-0 md:hidden", classNames?.cards)}
119
+ className={cn(
120
+ "m-0 flex list-none flex-col gap-density p-0 @min-[42rem]/responsive-list:hidden",
121
+ classNames?.cards,
122
+ )}
120
123
  >
121
124
  {items.map((item) => (
122
125
  <li
@@ -0,0 +1,7 @@
1
+ export {
2
+ Stack,
3
+ type StackAlign,
4
+ type StackDirection,
5
+ type StackGap,
6
+ type StackProps,
7
+ } from "./stack.js";
@@ -0,0 +1,55 @@
1
+ import type { ComponentPropsWithoutRef } from "react";
2
+ import { cn } from "../../utils/cn.js";
3
+
4
+ export type StackDirection = "column" | "row";
5
+ export type StackGap = "none" | "xs" | "sm" | "md" | "lg" | "xl";
6
+ export type StackAlign = "start" | "center" | "end" | "stretch" | "baseline";
7
+
8
+ export const stackGapClasses: Record<StackGap, string> = {
9
+ none: "gap-0",
10
+ xs: "gap-1",
11
+ sm: "gap-2",
12
+ md: "gap-4",
13
+ lg: "gap-6",
14
+ xl: "gap-8",
15
+ };
16
+
17
+ const alignClasses: Record<StackAlign, string> = {
18
+ start: "items-start",
19
+ center: "items-center",
20
+ end: "items-end",
21
+ stretch: "items-stretch",
22
+ baseline: "items-baseline",
23
+ };
24
+
25
+ export interface StackProps extends ComponentPropsWithoutRef<"div"> {
26
+ /** `column` stacks children vertically, `row` lays them out inline and wraps. Defaults to `column`. */
27
+ direction?: StackDirection;
28
+ /** Space between children. Defaults to `md`. */
29
+ gap?: StackGap;
30
+ /** Cross-axis alignment. Defaults to `stretch` for a column and `center` for a row. */
31
+ align?: StackAlign;
32
+ }
33
+
34
+ /** One-axis flex layout with token gaps. A row wraps instead of overflowing. */
35
+ export function Stack({
36
+ direction = "column",
37
+ gap = "md",
38
+ align,
39
+ className,
40
+ ...props
41
+ }: StackProps) {
42
+ const row = direction === "row";
43
+ return (
44
+ <div
45
+ className={cn(
46
+ "flex min-w-0",
47
+ row ? "flex-row flex-wrap" : "flex-col",
48
+ alignClasses[align ?? (row ? "center" : "stretch")],
49
+ stackGapClasses[gap],
50
+ className,
51
+ )}
52
+ {...props}
53
+ />
54
+ );
55
+ }
@@ -0,0 +1,88 @@
1
+ "use client";
2
+
3
+ import { type ComponentPropsWithoutRef, type ReactNode, useId } from "react";
4
+ import { useUiStrings } from "../../i18n/index.js";
5
+ import { Check, Copy } from "../../icons/index.js";
6
+ import type { ClassNames } from "../../utils/class-names.js";
7
+ import { cn } from "../../utils/cn.js";
8
+ import { useCopy } from "../../utils/use-copy.js";
9
+
10
+ export type CopyFieldPart = "root" | "label" | "box" | "value" | "button";
11
+
12
+ export interface CopyFieldProps
13
+ extends Omit<ComponentPropsWithoutRef<"div">, "children" | "onCopy"> {
14
+ label: ReactNode;
15
+ /** Text shown in monospace and written to the clipboard. */
16
+ value: string;
17
+ /** Called after the value was copied. */
18
+ onCopy?: (value: string) => void;
19
+ /** Accessible name of the button; defaults to the UI string `copy`. */
20
+ copyLabel?: string;
21
+ /** Announced and shown on the button after copying; defaults to the UI string `copied`. */
22
+ copiedLabel?: string;
23
+ /** Per-part classes merged with `cn`; consumer classes win. `className` still targets the root and is merged last. */
24
+ classNames?: ClassNames<CopyFieldPart>;
25
+ }
26
+
27
+ export function CopyField({
28
+ label,
29
+ value,
30
+ onCopy,
31
+ copyLabel,
32
+ copiedLabel,
33
+ className,
34
+ classNames,
35
+ ...props
36
+ }: CopyFieldProps) {
37
+ const strings = useUiStrings();
38
+ const id = useId();
39
+ const { copied, copy } = useCopy(1500);
40
+ const buttonLabel = copied ? (copiedLabel ?? strings.copied) : (copyLabel ?? strings.copy);
41
+
42
+ return (
43
+ <div {...props} className={cn("flex min-w-0 flex-col gap-1.5", classNames?.root, className)}>
44
+ <label htmlFor={id} className={cn("font-semibold text-ink-2 text-meta", classNames?.label)}>
45
+ {label}
46
+ </label>
47
+ <div
48
+ className={cn(
49
+ "flex min-w-0 items-center gap-2 rounded-input border-control bg-surface-control pr-1 pl-3",
50
+ classNames?.box,
51
+ )}
52
+ >
53
+ <input
54
+ id={id}
55
+ readOnly
56
+ value={value}
57
+ onFocus={(event) => event.currentTarget.select()}
58
+ className={cn(
59
+ "h-input min-w-0 flex-1 truncate bg-transparent font-mono text-control text-ink focus:outline-none",
60
+ classNames?.value,
61
+ )}
62
+ />
63
+ <button
64
+ type="button"
65
+ onClick={() => {
66
+ void copy(value);
67
+ onCopy?.(value);
68
+ }}
69
+ className={cn(
70
+ "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",
71
+ copied && "text-success",
72
+ classNames?.button,
73
+ )}
74
+ >
75
+ {copied ? (
76
+ <Check aria-hidden="true" className="size-4" />
77
+ ) : (
78
+ <Copy aria-hidden="true" className="size-4" />
79
+ )}
80
+ <span>{buttonLabel}</span>
81
+ </button>
82
+ </div>
83
+ <span role="status" className="sr-only">
84
+ {copied ? (copiedLabel ?? strings.copied) : null}
85
+ </span>
86
+ </div>
87
+ );
88
+ }
@@ -0,0 +1 @@
1
+ export { CopyField, type CopyFieldPart, type CopyFieldProps } from "./copy-field.js";
@@ -79,7 +79,7 @@ export function EmojiPicker({
79
79
  return (
80
80
  <div
81
81
  className={cn(
82
- "@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",
82
+ "@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",
83
83
  classNames?.root,
84
84
  className,
85
85
  )}
@@ -0,0 +1,46 @@
1
+ import type { ComponentPropsWithoutRef, ReactNode } from "react";
2
+ import { cn } from "../../utils/cn.js";
3
+
4
+ export type FormProps = ComponentPropsWithoutRef<"form">;
5
+
6
+ /** Vertical form layout; every `<form>` attribute and handler passes through. */
7
+ export function Form({ className, ...props }: FormProps) {
8
+ return <form className={cn("flex min-w-0 flex-col gap-4", className)} {...props} />;
9
+ }
10
+
11
+ interface FormMessageProps extends Omit<ComponentPropsWithoutRef<"p">, "role" | "children"> {
12
+ /** Message text; `null`, `undefined` and an empty string render nothing. */
13
+ message: ReactNode | null | undefined;
14
+ }
15
+
16
+ function hasMessage(message: ReactNode): boolean {
17
+ return message !== null && message !== undefined && message !== false && message !== "";
18
+ }
19
+
20
+ export type FormErrorProps = FormMessageProps;
21
+
22
+ /** Submit-level error. `role="alert"`, so assistive tech announces it as soon as it appears. */
23
+ export function FormError({ message, className, ...props }: FormErrorProps) {
24
+ if (!hasMessage(message)) return null;
25
+ return (
26
+ <p role="alert" className={cn("m-0 font-semibold text-danger text-meta", className)} {...props}>
27
+ {message}
28
+ </p>
29
+ );
30
+ }
31
+
32
+ export type FormStatusProps = FormMessageProps;
33
+
34
+ /** Submit-level confirmation. `role="status"`, a polite live region that does not interrupt. */
35
+ export function FormStatus({ message, className, ...props }: FormStatusProps) {
36
+ if (!hasMessage(message)) return null;
37
+ return (
38
+ <p
39
+ role="status"
40
+ className={cn("m-0 font-semibold text-meta text-success", className)}
41
+ {...props}
42
+ >
43
+ {message}
44
+ </p>
45
+ );
46
+ }
@@ -0,0 +1,8 @@
1
+ export {
2
+ Form,
3
+ FormError,
4
+ type FormErrorProps,
5
+ type FormProps,
6
+ FormStatus,
7
+ type FormStatusProps,
8
+ } from "./form.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,13 +1,24 @@
1
1
  import type { ComponentPropsWithoutRef } from "react";
2
2
  import { cn } from "../../utils/cn.js";
3
3
 
4
- export interface InputProps extends ComponentPropsWithoutRef<"input"> {}
4
+ export type InputSize = "md" | "lg";
5
5
 
6
- export function Input({ className, ...props }: InputProps) {
6
+ export const inputSizeClasses: Readonly<Record<InputSize, string>> = {
7
+ md: "h-input px-3",
8
+ lg: "h-control-lg px-4 text-fs-140",
9
+ };
10
+
11
+ export interface InputProps extends Omit<ComponentPropsWithoutRef<"input">, "size"> {
12
+ /** `lg` is the thumb-friendly height of the large `Button`. */
13
+ size?: InputSize;
14
+ }
15
+
16
+ export function Input({ size = "md", className, ...props }: InputProps) {
7
17
  return (
8
18
  <input
9
19
  className={cn(
10
- "h-input w-full min-w-0 rounded-input border-control bg-surface-control px-3 text-control text-ink placeholder:text-ink-3 focus:border-transparent focus:outline-2 focus:outline-accent-ink focus:-outline-offset-1 aria-[invalid=true]:border-danger",
20
+ "w-full min-w-0 rounded-input border-control bg-surface-control text-control text-ink placeholder:text-ink-3 focus:border-transparent focus:outline-2 focus:outline-accent-ink focus:-outline-offset-1 aria-[invalid=true]:border-danger",
21
+ inputSizeClasses[size],
11
22
  className,
12
23
  )}
13
24
  {...props}