@zonsh/ui 0.0.0 → 0.4.1

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 (425) hide show
  1. package/LICENSE +43 -0
  2. package/README.md +81 -1
  3. package/assets/illustrations/drawing/bracket-construction-dark.svg +77 -0
  4. package/assets/illustrations/drawing/bracket-construction-filled-dark.svg +50 -0
  5. package/assets/illustrations/drawing/bracket-construction-filled.svg +50 -0
  6. package/assets/illustrations/drawing/bracket-construction.svg +77 -0
  7. package/assets/illustrations/drawing/crescent-dark.svg +28 -0
  8. package/assets/illustrations/drawing/crescent-guides-dark.svg +33 -0
  9. package/assets/illustrations/drawing/crescent-guides.svg +33 -0
  10. package/assets/illustrations/drawing/crescent.svg +28 -0
  11. package/assets/illustrations/drawing/eclipse-dark.svg +187 -0
  12. package/assets/illustrations/drawing/eclipse-guides-dark.svg +191 -0
  13. package/assets/illustrations/drawing/eclipse-guides.svg +191 -0
  14. package/assets/illustrations/drawing/eclipse.svg +187 -0
  15. package/assets/illustrations/drawing/elevation-guides-dark.svg +31 -0
  16. package/assets/illustrations/drawing/elevation-guides-plain-dark.svg +9 -0
  17. package/assets/illustrations/drawing/elevation-guides-plain.svg +9 -0
  18. package/assets/illustrations/drawing/elevation-guides.svg +31 -0
  19. package/assets/illustrations/drawing/horizon-dark.svg +30 -0
  20. package/assets/illustrations/drawing/horizon.svg +30 -0
  21. package/assets/illustrations/drawing/nib-study-dark.svg +107 -0
  22. package/assets/illustrations/drawing/nib-study-plain-dark.svg +93 -0
  23. package/assets/illustrations/drawing/nib-study-plain.svg +93 -0
  24. package/assets/illustrations/drawing/nib-study.svg +107 -0
  25. package/assets/illustrations/editorial/assistant-640.webp +0 -0
  26. package/assets/illustrations/editorial/assistant.webp +0 -0
  27. package/assets/illustrations/editorial/automation-640.webp +0 -0
  28. package/assets/illustrations/editorial/automation.webp +0 -0
  29. package/assets/illustrations/editorial/bracket-left-640.webp +0 -0
  30. package/assets/illustrations/editorial/bracket-left.webp +0 -0
  31. package/assets/illustrations/editorial/bracket-right-640.webp +0 -0
  32. package/assets/illustrations/editorial/bracket-right.webp +0 -0
  33. package/assets/illustrations/editorial/custom-software-640.webp +0 -0
  34. package/assets/illustrations/editorial/custom-software.webp +0 -0
  35. package/assets/illustrations/editorial/digitalization-640.webp +0 -0
  36. package/assets/illustrations/editorial/digitalization.webp +0 -0
  37. package/assets/illustrations/editorial/integration-640.webp +0 -0
  38. package/assets/illustrations/editorial/integration.webp +0 -0
  39. package/assets/illustrations/editorial/problem-640.webp +0 -0
  40. package/assets/illustrations/editorial/problem.webp +0 -0
  41. package/assets/illustrations/editorial/process-analysis-640.webp +0 -0
  42. package/assets/illustrations/editorial/process-analysis.webp +0 -0
  43. package/assets/illustrations/editorial/process-concept-640.webp +0 -0
  44. package/assets/illustrations/editorial/process-concept.webp +0 -0
  45. package/assets/illustrations/editorial/process-development-640.webp +0 -0
  46. package/assets/illustrations/editorial/process-development.webp +0 -0
  47. package/assets/illustrations/editorial/process-discovery-640.webp +0 -0
  48. package/assets/illustrations/editorial/process-discovery.webp +0 -0
  49. package/assets/illustrations/editorial/process-maintenance-640.webp +0 -0
  50. package/assets/illustrations/editorial/process-maintenance.webp +0 -0
  51. package/assets/illustrations/editorial/process-prototype-640.webp +0 -0
  52. package/assets/illustrations/editorial/process-prototype.webp +0 -0
  53. package/assets/illustrations/editorial/process-testing-640.webp +0 -0
  54. package/assets/illustrations/editorial/process-testing.webp +0 -0
  55. package/assets/illustrations/iso/automation-dark.svg +6 -0
  56. package/assets/illustrations/iso/automation.svg +6 -0
  57. package/assets/illustrations/iso/bar-chart-dark.svg +6 -0
  58. package/assets/illustrations/iso/bar-chart.svg +6 -0
  59. package/assets/illustrations/iso/brackets-classic-dark.svg +6 -0
  60. package/assets/illustrations/iso/brackets-classic.svg +6 -0
  61. package/assets/illustrations/iso/brackets-dark.svg +6 -0
  62. package/assets/illustrations/iso/brackets.svg +6 -0
  63. package/assets/illustrations/iso/city-dark.svg +6 -0
  64. package/assets/illustrations/iso/city.svg +6 -0
  65. package/assets/illustrations/iso/conveyor-dark.svg +6 -0
  66. package/assets/illustrations/iso/conveyor.svg +6 -0
  67. package/assets/illustrations/iso/database-dark.svg +6 -0
  68. package/assets/illustrations/iso/database.svg +6 -0
  69. package/assets/illustrations/iso/documents-dark.svg +6 -0
  70. package/assets/illustrations/iso/documents.svg +6 -0
  71. package/assets/illustrations/iso/inbox-dark.svg +6 -0
  72. package/assets/illustrations/iso/inbox.svg +6 -0
  73. package/assets/illustrations/iso/laptop-dark.svg +6 -0
  74. package/assets/illustrations/iso/laptop.svg +6 -0
  75. package/assets/illustrations/iso/monitor-dark.svg +6 -0
  76. package/assets/illustrations/iso/monitor.svg +6 -0
  77. package/assets/illustrations/iso/pipeline-dark.svg +6 -0
  78. package/assets/illustrations/iso/pipeline.svg +6 -0
  79. package/assets/illustrations/iso/platform-dark.svg +6 -0
  80. package/assets/illustrations/iso/platform.svg +6 -0
  81. package/assets/illustrations/iso/server-dark.svg +6 -0
  82. package/assets/illustrations/iso/server.svg +6 -0
  83. package/assets/illustrations/iso/spreadsheet-dark.svg +6 -0
  84. package/assets/illustrations/iso/spreadsheet.svg +6 -0
  85. package/assets/illustrations/iso/timeline-dark.svg +6 -0
  86. package/assets/illustrations/iso/timeline.svg +6 -0
  87. package/assets/illustrations/sheet/construction.svg +115 -0
  88. package/assets/illustrations/sheet/crescent.svg +40 -0
  89. package/assets/illustrations/sheet/limb.svg +42 -0
  90. package/assets/illustrations/sheet/stress-axis.svg +119 -0
  91. package/assets/illustrations/sheet/totality.svg +215 -0
  92. package/assets/illustrations/sheet/vertical-metrics.svg +43 -0
  93. package/assets/logo-left.svg +1 -0
  94. package/assets/logo-right.svg +1 -0
  95. package/assets/logo.svg +1 -0
  96. package/dist/components/_overlay.d.ts +47 -0
  97. package/dist/components/_overlay.js +59 -0
  98. package/dist/components/accordion.d.ts +32 -0
  99. package/dist/components/accordion.js +39 -0
  100. package/dist/components/alert-dialog.d.ts +45 -0
  101. package/dist/components/alert-dialog.js +56 -0
  102. package/dist/components/alert.d.ts +35 -0
  103. package/dist/components/alert.js +42 -0
  104. package/dist/components/ascii-field.d.ts +34 -0
  105. package/dist/components/ascii-field.js +410 -0
  106. package/dist/components/aspect-ratio.d.ts +14 -0
  107. package/dist/components/aspect-ratio.js +17 -0
  108. package/dist/components/avatar.d.ts +42 -0
  109. package/dist/components/avatar.js +55 -0
  110. package/dist/components/badge.d.ts +70 -0
  111. package/dist/components/badge.js +62 -0
  112. package/dist/components/bottom-nav.d.ts +86 -0
  113. package/dist/components/bottom-nav.js +175 -0
  114. package/dist/components/breadcrumb.d.ts +31 -0
  115. package/dist/components/breadcrumb.js +37 -0
  116. package/dist/components/button-group.d.ts +30 -0
  117. package/dist/components/button-group.js +47 -0
  118. package/dist/components/button.d.ts +53 -0
  119. package/dist/components/button.js +130 -0
  120. package/dist/components/calendar.d.ts +26 -0
  121. package/dist/components/calendar.js +179 -0
  122. package/dist/components/card.d.ts +42 -0
  123. package/dist/components/card.js +76 -0
  124. package/dist/components/carousel.d.ts +109 -0
  125. package/dist/components/carousel.js +231 -0
  126. package/dist/components/chart.d.ts +189 -0
  127. package/dist/components/chart.js +323 -0
  128. package/dist/components/checkbox.d.ts +23 -0
  129. package/dist/components/checkbox.js +43 -0
  130. package/dist/components/code-block.d.ts +55 -0
  131. package/dist/components/code-block.js +100 -0
  132. package/dist/components/collapsible.d.ts +20 -0
  133. package/dist/components/collapsible.js +32 -0
  134. package/dist/components/color-picker.d.ts +107 -0
  135. package/dist/components/color-picker.js +428 -0
  136. package/dist/components/combobox.d.ts +99 -0
  137. package/dist/components/combobox.js +172 -0
  138. package/dist/components/command.d.ts +132 -0
  139. package/dist/components/command.js +257 -0
  140. package/dist/components/context-menu.d.ts +29 -0
  141. package/dist/components/context-menu.js +35 -0
  142. package/dist/components/conversation.d.ts +36 -0
  143. package/dist/components/conversation.js +303 -0
  144. package/dist/components/copy-button.d.ts +55 -0
  145. package/dist/components/copy-button.js +133 -0
  146. package/dist/components/data-table.d.ts +235 -0
  147. package/dist/components/data-table.js +655 -0
  148. package/dist/components/date-picker.d.ts +160 -0
  149. package/dist/components/date-picker.js +338 -0
  150. package/dist/components/dialog.d.ts +57 -0
  151. package/dist/components/dialog.js +95 -0
  152. package/dist/components/direction.d.ts +16 -0
  153. package/dist/components/direction.js +18 -0
  154. package/dist/components/drawer.d.ts +69 -0
  155. package/dist/components/drawer.js +79 -0
  156. package/dist/components/empty.d.ts +31 -0
  157. package/dist/components/empty.js +50 -0
  158. package/dist/components/feature-list.d.ts +54 -0
  159. package/dist/components/feature-list.js +43 -0
  160. package/dist/components/field.d.ts +34 -0
  161. package/dist/components/field.js +81 -0
  162. package/dist/components/file-drop.d.ts +77 -0
  163. package/dist/components/file-drop.js +258 -0
  164. package/dist/components/filter-bar.d.ts +153 -0
  165. package/dist/components/filter-bar.js +334 -0
  166. package/dist/components/form.d.ts +35 -0
  167. package/dist/components/form.js +56 -0
  168. package/dist/components/graph.d.ts +146 -0
  169. package/dist/components/graph.js +825 -0
  170. package/dist/components/illustration.d.ts +85 -0
  171. package/dist/components/illustration.js +165 -0
  172. package/dist/components/input-group.d.ts +138 -0
  173. package/dist/components/input-group.js +312 -0
  174. package/dist/components/input.d.ts +16 -0
  175. package/dist/components/input.js +25 -0
  176. package/dist/components/item.d.ts +64 -0
  177. package/dist/components/item.js +116 -0
  178. package/dist/components/kbd.d.ts +50 -0
  179. package/dist/components/kbd.js +45 -0
  180. package/dist/components/label.d.ts +12 -0
  181. package/dist/components/label.js +24 -0
  182. package/dist/components/layout.d.ts +136 -0
  183. package/dist/components/layout.js +162 -0
  184. package/dist/components/lightbox.d.ts +100 -0
  185. package/dist/components/lightbox.js +439 -0
  186. package/dist/components/locale.d.ts +44 -0
  187. package/dist/components/locale.js +37 -0
  188. package/dist/components/logo.d.ts +54 -0
  189. package/dist/components/logo.js +96 -0
  190. package/dist/components/menu.d.ts +60 -0
  191. package/dist/components/menu.js +140 -0
  192. package/dist/components/menubar.d.ts +62 -0
  193. package/dist/components/menubar.js +223 -0
  194. package/dist/components/message.d.ts +42 -0
  195. package/dist/components/message.js +59 -0
  196. package/dist/components/meter.d.ts +31 -0
  197. package/dist/components/meter.js +27 -0
  198. package/dist/components/money-input.d.ts +80 -0
  199. package/dist/components/money-input.js +253 -0
  200. package/dist/components/native-select.d.ts +26 -0
  201. package/dist/components/native-select.js +35 -0
  202. package/dist/components/navigation-menu.d.ts +42 -0
  203. package/dist/components/navigation-menu.js +97 -0
  204. package/dist/components/number-field.d.ts +55 -0
  205. package/dist/components/number-field.js +164 -0
  206. package/dist/components/otp-field.d.ts +48 -0
  207. package/dist/components/otp-field.js +102 -0
  208. package/dist/components/pagination.d.ts +37 -0
  209. package/dist/components/pagination.js +81 -0
  210. package/dist/components/pdf-viewer.d.ts +134 -0
  211. package/dist/components/pdf-viewer.js +996 -0
  212. package/dist/components/phone-input.d.ts +79 -0
  213. package/dist/components/phone-input.js +282 -0
  214. package/dist/components/popover.d.ts +33 -0
  215. package/dist/components/popover.js +48 -0
  216. package/dist/components/preview-card.d.ts +25 -0
  217. package/dist/components/preview-card.js +22 -0
  218. package/dist/components/progress.d.ts +27 -0
  219. package/dist/components/progress.js +25 -0
  220. package/dist/components/prompt-input.d.ts +156 -0
  221. package/dist/components/prompt-input.js +415 -0
  222. package/dist/components/quote.d.ts +22 -0
  223. package/dist/components/quote.js +15 -0
  224. package/dist/components/radio-group.d.ts +18 -0
  225. package/dist/components/radio-group.js +34 -0
  226. package/dist/components/rating.d.ts +73 -0
  227. package/dist/components/rating.js +124 -0
  228. package/dist/components/reasoning.d.ts +46 -0
  229. package/dist/components/reasoning.js +73 -0
  230. package/dist/components/resizable.d.ts +47 -0
  231. package/dist/components/resizable.js +44 -0
  232. package/dist/components/response.d.ts +41 -0
  233. package/dist/components/response.js +566 -0
  234. package/dist/components/scroll-area.d.ts +33 -0
  235. package/dist/components/scroll-area.js +31 -0
  236. package/dist/components/select.d.ts +35 -0
  237. package/dist/components/select.js +71 -0
  238. package/dist/components/separator.d.ts +14 -0
  239. package/dist/components/separator.js +17 -0
  240. package/dist/components/sidebar.d.ts +163 -0
  241. package/dist/components/sidebar.js +505 -0
  242. package/dist/components/site-header.d.ts +93 -0
  243. package/dist/components/site-header.js +121 -0
  244. package/dist/components/skeleton.d.ts +31 -0
  245. package/dist/components/skeleton.js +29 -0
  246. package/dist/components/slider.d.ts +24 -0
  247. package/dist/components/slider.js +131 -0
  248. package/dist/components/sortable.d.ts +178 -0
  249. package/dist/components/sortable.js +1258 -0
  250. package/dist/components/sources.d.ts +40 -0
  251. package/dist/components/sources.js +42 -0
  252. package/dist/components/spinner.d.ts +48 -0
  253. package/dist/components/spinner.js +75 -0
  254. package/dist/components/stat.d.ts +91 -0
  255. package/dist/components/stat.js +141 -0
  256. package/dist/components/stepper.d.ts +71 -0
  257. package/dist/components/stepper.js +101 -0
  258. package/dist/components/suggestions.d.ts +20 -0
  259. package/dist/components/suggestions.js +18 -0
  260. package/dist/components/switch.d.ts +14 -0
  261. package/dist/components/switch.js +26 -0
  262. package/dist/components/table.d.ts +172 -0
  263. package/dist/components/table.js +895 -0
  264. package/dist/components/tabs.d.ts +25 -0
  265. package/dist/components/tabs.js +162 -0
  266. package/dist/components/tag.d.ts +41 -0
  267. package/dist/components/tag.js +88 -0
  268. package/dist/components/tags-input.d.ts +56 -0
  269. package/dist/components/tags-input.js +271 -0
  270. package/dist/components/textarea.d.ts +13 -0
  271. package/dist/components/textarea.js +16 -0
  272. package/dist/components/theme.d.ts +55 -0
  273. package/dist/components/theme.js +120 -0
  274. package/dist/components/time-field.d.ts +70 -0
  275. package/dist/components/time-field.js +450 -0
  276. package/dist/components/timeline.d.ts +92 -0
  277. package/dist/components/timeline.js +108 -0
  278. package/dist/components/tippy.d.ts +48 -0
  279. package/dist/components/tippy.js +648 -0
  280. package/dist/components/toast.d.ts +88 -0
  281. package/dist/components/toast.js +205 -0
  282. package/dist/components/toggle-group.d.ts +41 -0
  283. package/dist/components/toggle-group.js +140 -0
  284. package/dist/components/toggle.d.ts +23 -0
  285. package/dist/components/toggle.js +35 -0
  286. package/dist/components/tool-call.d.ts +63 -0
  287. package/dist/components/tool-call.js +68 -0
  288. package/dist/components/toolbar.d.ts +17 -0
  289. package/dist/components/toolbar.js +39 -0
  290. package/dist/components/tooltip.d.ts +42 -0
  291. package/dist/components/tooltip.js +47 -0
  292. package/dist/components/tour.d.ts +127 -0
  293. package/dist/components/tour.js +648 -0
  294. package/dist/components/tree.d.ts +75 -0
  295. package/dist/components/tree.js +649 -0
  296. package/dist/components/typography.d.ts +134 -0
  297. package/dist/components/typography.js +176 -0
  298. package/dist/components/video-player.d.ts +284 -0
  299. package/dist/components/video-player.js +1392 -0
  300. package/dist/illustration.d.ts +2 -0
  301. package/dist/illustration.js +7 -0
  302. package/dist/index.d.ts +93 -0
  303. package/dist/index.js +94 -0
  304. package/dist/lib/cn.d.ts +20 -0
  305. package/dist/lib/cn.js +38 -0
  306. package/dist/lib/code-highlight.d.ts +18 -0
  307. package/dist/lib/code-highlight.js +174 -0
  308. package/dist/lib/code-theme.d.ts +19 -0
  309. package/dist/lib/code-theme.js +140 -0
  310. package/dist/lib/collapse-row.d.ts +9 -0
  311. package/dist/lib/collapse-row.js +129 -0
  312. package/dist/lib/digit-roll.d.ts +21 -0
  313. package/dist/lib/digit-roll.js +31 -0
  314. package/dist/lib/editorial-assets.d.ts +16 -0
  315. package/dist/lib/editorial-assets.js +56 -0
  316. package/dist/lib/field-errors.d.ts +28 -0
  317. package/dist/lib/field-errors.js +24 -0
  318. package/dist/lib/field-value.d.ts +13 -0
  319. package/dist/lib/field-value.js +44 -0
  320. package/dist/lib/figure/catalog.d.ts +127 -0
  321. package/dist/lib/figure/catalog.js +130 -0
  322. package/dist/lib/figure/figures/automation.d.ts +7 -0
  323. package/dist/lib/figure/figures/automation.js +143 -0
  324. package/dist/lib/figure/figures/bar-chart.d.ts +7 -0
  325. package/dist/lib/figure/figures/bar-chart.js +99 -0
  326. package/dist/lib/figure/figures/brackets-classic.d.ts +11 -0
  327. package/dist/lib/figure/figures/brackets-classic.js +170 -0
  328. package/dist/lib/figure/figures/brackets.d.ts +8 -0
  329. package/dist/lib/figure/figures/brackets.js +84 -0
  330. package/dist/lib/figure/figures/city.d.ts +7 -0
  331. package/dist/lib/figure/figures/city.js +93 -0
  332. package/dist/lib/figure/figures/conveyor.d.ts +7 -0
  333. package/dist/lib/figure/figures/conveyor.js +97 -0
  334. package/dist/lib/figure/figures/database.d.ts +7 -0
  335. package/dist/lib/figure/figures/database.js +65 -0
  336. package/dist/lib/figure/figures/documents.d.ts +7 -0
  337. package/dist/lib/figure/figures/documents.js +83 -0
  338. package/dist/lib/figure/figures/inbox.d.ts +7 -0
  339. package/dist/lib/figure/figures/inbox.js +92 -0
  340. package/dist/lib/figure/figures/laptop.d.ts +7 -0
  341. package/dist/lib/figure/figures/laptop.js +67 -0
  342. package/dist/lib/figure/figures/monitor.d.ts +7 -0
  343. package/dist/lib/figure/figures/monitor.js +59 -0
  344. package/dist/lib/figure/figures/pipeline.d.ts +8 -0
  345. package/dist/lib/figure/figures/pipeline.js +117 -0
  346. package/dist/lib/figure/figures/platform.d.ts +7 -0
  347. package/dist/lib/figure/figures/platform.js +117 -0
  348. package/dist/lib/figure/figures/server.d.ts +7 -0
  349. package/dist/lib/figure/figures/server.js +115 -0
  350. package/dist/lib/figure/figures/spreadsheet.d.ts +7 -0
  351. package/dist/lib/figure/figures/spreadsheet.js +87 -0
  352. package/dist/lib/figure/figures/timeline.d.ts +7 -0
  353. package/dist/lib/figure/figures/timeline.js +65 -0
  354. package/dist/lib/figure/kernel.d.ts +152 -0
  355. package/dist/lib/figure/kernel.js +576 -0
  356. package/dist/lib/figure/parts.d.ts +42 -0
  357. package/dist/lib/figure/parts.js +126 -0
  358. package/dist/lib/form-reset.d.ts +11 -0
  359. package/dist/lib/form-reset.js +22 -0
  360. package/dist/lib/glide.d.ts +53 -0
  361. package/dist/lib/glide.js +138 -0
  362. package/dist/lib/graph-layout.d.ts +58 -0
  363. package/dist/lib/graph-layout.js +209 -0
  364. package/dist/lib/illustration-drawings.d.ts +89 -0
  365. package/dist/lib/illustration-drawings.js +539 -0
  366. package/dist/lib/illustration-info.d.ts +37 -0
  367. package/dist/lib/illustration-info.js +22 -0
  368. package/dist/lib/illustration-library.d.ts +87 -0
  369. package/dist/lib/illustration-library.js +352 -0
  370. package/dist/lib/logo-geometry.d.ts +29 -0
  371. package/dist/lib/logo-geometry.js +67 -0
  372. package/dist/lib/markdown-guard.d.ts +16 -0
  373. package/dist/lib/markdown-guard.js +123 -0
  374. package/dist/lib/merge-refs.d.ts +10 -0
  375. package/dist/lib/merge-refs.js +26 -0
  376. package/dist/lib/money.d.ts +73 -0
  377. package/dist/lib/money.js +343 -0
  378. package/dist/lib/motion.d.ts +6 -0
  379. package/dist/lib/motion.js +12 -0
  380. package/dist/lib/pdf-worker.d.ts +1 -0
  381. package/dist/lib/pdf-worker.js +6 -0
  382. package/dist/lib/pdf.d.ts +19 -0
  383. package/dist/lib/pdf.js +58 -0
  384. package/dist/lib/phone-countries.d.ts +1 -0
  385. package/dist/lib/phone-countries.js +281 -0
  386. package/dist/lib/phone.d.ts +90 -0
  387. package/dist/lib/phone.js +286 -0
  388. package/dist/lib/platform.d.ts +38 -0
  389. package/dist/lib/platform.js +75 -0
  390. package/dist/lib/room.d.ts +25 -0
  391. package/dist/lib/room.js +46 -0
  392. package/dist/lib/row-index.d.ts +15 -0
  393. package/dist/lib/row-index.js +136 -0
  394. package/dist/lib/table-fit.d.ts +143 -0
  395. package/dist/lib/table-fit.js +596 -0
  396. package/dist/lib/theme-script.d.ts +31 -0
  397. package/dist/lib/theme-script.js +49 -0
  398. package/dist/lib/tippy/pixels.d.ts +47 -0
  399. package/dist/lib/tippy/pixels.js +187 -0
  400. package/dist/lib/tippy/sprite.d.ts +86 -0
  401. package/dist/lib/tippy/sprite.js +753 -0
  402. package/dist/messages/de.d.ts +12 -0
  403. package/dist/messages/de.js +326 -0
  404. package/dist/styles/expressive.css +203 -0
  405. package/dist/styles/fonts.css +145 -0
  406. package/dist/styles/index.css +207 -0
  407. package/dist/styles/material.css +317 -0
  408. package/dist/styles/parts/ai.css +361 -0
  409. package/dist/styles/parts/brand.css +75 -0
  410. package/dist/styles/parts/controls.css +774 -0
  411. package/dist/styles/parts/data.css +222 -0
  412. package/dist/styles/parts/editorial.css +120 -0
  413. package/dist/styles/parts/feedback.css +340 -0
  414. package/dist/styles/parts/foundations.css +166 -0
  415. package/dist/styles/parts/graph.css +214 -0
  416. package/dist/styles/parts/inputs.css +261 -0
  417. package/dist/styles/parts/isometric.css +124 -0
  418. package/dist/styles/parts/navigation.css +424 -0
  419. package/dist/styles/parts/overlays.css +250 -0
  420. package/dist/styles/parts/pdf.css +154 -0
  421. package/dist/styles/parts/react-flow.css +519 -0
  422. package/dist/styles/tokens.css +299 -0
  423. package/dist/vite.d.ts +66 -0
  424. package/dist/vite.js +29 -0
  425. package/package.json +183 -5
@@ -0,0 +1,59 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import * as React from "react";
4
+ import { cn } from "../lib/cn.js";
5
+ import { Avatar } from "./avatar.js";
6
+ import { Button } from "./button.js";
7
+ import { Tooltip, TooltipContent, TooltipTrigger } from "./tooltip.js";
8
+ const MessageContext = React.createContext("assistant");
9
+ /**
10
+ * Message — one turn in an AI conversation. A **user** message sits at the end — on the right,
11
+ * on the left in a right-to-left page — in a 20px card, sized to its text; an **assistant**
12
+ * message runs full width on the page, with no bubble, so long answers read like a document.
13
+ *
14
+ * Compose `MessageAvatar` (optional), `MessageContent` and `MessageActions`. The rule people
15
+ * break: putting the assistant in a bubble too — the reply is the content, not a quote.
16
+ */
17
+ export function Message({ from, className, ...props }) {
18
+ return (_jsx(MessageContext.Provider, { value: from, children: _jsx("div", { "data-slot": "message", "data-from": from, className: cn("group/message flex w-full min-w-0 gap-3", from === "user" ? "flex-row-reverse" : "flex-row", className), ...props }) }));
19
+ }
20
+ /**
21
+ * The author's picture: an `Avatar` (a name gives mono initials), or any 32px mark as children —
22
+ * the assistant is often a `LogoMark` on a raised key.
23
+ */
24
+ export function MessageAvatar({ className, children, ...props }) {
25
+ if (children != null) {
26
+ // A mark is always 32px; the Avatar's own props have nothing to do, the element's are kept.
27
+ const { src: _src, name: _name, fallback: _fallback, size: _size, imageProps: _image, ...rest } = props;
28
+ return (_jsx("span", { ...rest, "data-slot": "message-avatar", "aria-hidden": true, className: cn("inline-flex size-8 shrink-0 items-center justify-center rounded-full bg-control-surface bg-linear-to-b from-control-inner-edge to-transparent text-foreground shadow-key", className), children: children }));
29
+ }
30
+ return _jsx(Avatar, { "data-slot": "message-avatar", className: cn("shrink-0", className), ...props });
31
+ }
32
+ /**
33
+ * The message body and, below it, its actions. User text sits in a card at most 80% wide;
34
+ * assistant content takes the full width (put a `Response` in it for markdown).
35
+ */
36
+ export function MessageContent({ className, ...props }) {
37
+ const from = React.useContext(MessageContext);
38
+ return (_jsx("div", { "data-slot": "message-content", className: cn("flex min-w-0 flex-col gap-2 text-[15px] leading-relaxed", from === "user" ? "max-w-[80%] items-end" : "flex-1 text-foreground-soft", className), ...props }));
39
+ }
40
+ /**
41
+ * Plain message text, kept as written: line breaks stay, long words wrap. In a user message it
42
+ * is the card; in an assistant message it is a paragraph.
43
+ */
44
+ export function MessageText({ className, ...props }) {
45
+ const from = React.useContext(MessageContext);
46
+ return (_jsx("div", { "data-slot": "message-text", className: cn("[overflow-wrap:anywhere] whitespace-pre-wrap text-foreground", from === "user" && "surface-card [--card-padding:10px_16px]", className), ...props }));
47
+ }
48
+ /** A row of `MessageAction`s under the content: copy, retry, rate. */
49
+ export function MessageActions({ className, ...props }) {
50
+ const from = React.useContext(MessageContext);
51
+ return (_jsx("div", { "data-slot": "message-actions", className: cn("-ms-1.5 flex items-center gap-0.5",
52
+ // User actions appear on hover or focus, so a long thread stays quiet.
53
+ from === "user" &&
54
+ "ms-0 -me-1.5 opacity-0 transition-opacity duration-(--duration) ease-(--ease) group-focus-within/message:opacity-100 group-hover/message:opacity-100", className), ...props }));
55
+ }
56
+ /** One action under a message: a 30px ghost icon button with a tooltip. */
57
+ export function MessageAction({ label, className, children, ...props }) {
58
+ return (_jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { render: _jsx(Button, { "data-slot": "message-action", variant: "ghost", size: "icon-sm", "aria-label": label, className: cn("text-muted-foreground [&_svg:not([class*='size-'])]:size-3.5", className), ...props }), children: children }), _jsx(TooltipContent, { children: label })] }));
59
+ }
@@ -0,0 +1,31 @@
1
+ import { Meter as BaseMeter } from "@base-ui/react/meter";
2
+ import type * as React from "react";
3
+ declare const toneFill: {
4
+ readonly default: "bg-foreground";
5
+ readonly success: "bg-success";
6
+ readonly warning: "bg-warning";
7
+ readonly info: "bg-info";
8
+ readonly destructive: "bg-destructive";
9
+ };
10
+ export type MeterTone = keyof typeof toneFill;
11
+ export interface MeterProps extends BaseMeter.Root.Props {
12
+ /** A visible mono label above the track. Without one, pass `aria-label`. */
13
+ label?: React.ReactNode;
14
+ /** Show the formatted value (e.g. `64%`) at the end of the label row. */
15
+ showValue?: boolean;
16
+ /**
17
+ * The indicator's colour. A status, or a function of the value that returns one — a disk that
18
+ * turns amber past 75% and red past 90%. Say the state in the label or value too.
19
+ */
20
+ tone?: MeterTone | ((value: number) => MeterTone);
21
+ }
22
+ /**
23
+ * Meter — a static quantity within a known range: capacity used, a completeness score.
24
+ *
25
+ * The same recessed 6px track and `--foreground` indicator as `Progress`, with an optional
26
+ * mono label and value. The rule people break: using it for work in progress. Something that
27
+ * will finish is a `Progress`. Red is not a "high" colour: give the meter a `tone` only when the
28
+ * value crosses a line that matters (nearly full, over budget), and say so in words as well.
29
+ */
30
+ export declare function Meter({ label, showValue, tone, className, children, ...props }: MeterProps): React.JSX.Element;
31
+ export {};
@@ -0,0 +1,27 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { Meter as BaseMeter } from "@base-ui/react/meter";
4
+ import { sx } from "../lib/cn.js";
5
+ import { useLocale } from "./locale.js";
6
+ const toneFill = {
7
+ default: "bg-foreground",
8
+ success: "bg-success",
9
+ warning: "bg-warning",
10
+ info: "bg-info",
11
+ destructive: "bg-destructive",
12
+ };
13
+ /**
14
+ * Meter — a static quantity within a known range: capacity used, a completeness score.
15
+ *
16
+ * The same recessed 6px track and `--foreground` indicator as `Progress`, with an optional
17
+ * mono label and value. The rule people break: using it for work in progress. Something that
18
+ * will finish is a `Progress`. Red is not a "high" colour: give the meter a `tone` only when the
19
+ * value crosses a line that matters (nearly full, over budget), and say so in words as well.
20
+ */
21
+ export function Meter({ label, showValue = false, tone = "default", className, children, ...props }) {
22
+ const resolved = typeof tone === "function" ? tone(props.value) : tone;
23
+ const locale = useLocale();
24
+ return (_jsxs(BaseMeter.Root, { "data-slot": "meter", "data-tone": resolved, className: sx("grid w-full grid-cols-[minmax(0,1fr)_auto] items-baseline gap-x-3 gap-y-2", className), locale: locale, ...props, children: [label != null && (_jsx(BaseMeter.Label, { "data-slot": "meter-label",
25
+ // A long name (a file, a URL) wraps instead of pushing the track wider than its column.
26
+ className: "col-start-1 font-mono text-[12px] [overflow-wrap:anywhere] text-foreground-soft", children: label })), showValue && (_jsx(BaseMeter.Value, { "data-slot": "meter-value", className: "col-start-2 text-end font-mono text-[12px] text-muted-foreground tabular-nums" })), _jsx(BaseMeter.Track, { "data-slot": "meter-track", className: "relative col-span-2 h-1.5 overflow-hidden rounded-full border border-field-edge bg-field-surface shadow-field", children: _jsx(BaseMeter.Indicator, { "data-slot": "meter-indicator", className: sx("block h-full rounded-full transition-[width,background-color] duration-(--duration) ease-(--ease)", toneFill[resolved]) }) }), children] }));
27
+ }
@@ -0,0 +1,80 @@
1
+ import * as React from "react";
2
+ export interface MoneyInputMessages {
3
+ /** The text isn't an amount; `example` is one written for the locale ("1,234.56"). */
4
+ invalid: (example: string) => string;
5
+ /** More decimal places than the currency has. */
6
+ precision: (fractionDigits: number) => string;
7
+ /** A negative amount where `allowNegative` is off. */
8
+ negative: string;
9
+ /** Below `min`, formatted with the currency ("€10.00"). */
10
+ rangeUnderflow: (min: string) => string;
11
+ /** Above `max`, formatted with the currency. */
12
+ rangeOverflow: (max: string) => string;
13
+ }
14
+ declare module "./locale" {
15
+ interface Messages {
16
+ moneyInput: MoneyInputMessages;
17
+ }
18
+ }
19
+ declare const sizes: {
20
+ readonly sm: {
21
+ readonly group: "sm";
22
+ readonly className: "";
23
+ };
24
+ readonly default: {
25
+ readonly group: "default";
26
+ readonly className: "";
27
+ };
28
+ readonly lg: {
29
+ readonly group: "default";
30
+ readonly className: "min-h-(--control-h-lg) text-lg sm:text-lg";
31
+ };
32
+ };
33
+ export interface MoneyInputChangeDetails {
34
+ /** The same amount as an integer of minor units (cents): `"12.34"` → `1234n`; null with no amount. */
35
+ minorUnits: bigint | null;
36
+ }
37
+ export interface MoneyInputProps extends Omit<React.ComponentProps<"input">, "value" | "defaultValue" | "onChange" | "size" | "min" | "max" | "type" | "children"> {
38
+ /** The ISO 4217 code: `"EUR"`, `"JPY"`, `"KWD"`. It sets the symbol and the decimal places. */
39
+ currency: string;
40
+ /**
41
+ * The amount as an exact decimal string in major units, with the currency's decimal places:
42
+ * `"1234.50"`, `"-0.05"`, `"1500"` (JPY); `null` while empty or not an amount. Never a float.
43
+ */
44
+ value?: string | null;
45
+ defaultValue?: string | null;
46
+ /** Called as the amount changes, with the same amount in minor units. */
47
+ onValueChange?: (value: string | null, details: MoneyInputChangeDetails) => void;
48
+ /** A BCP 47 locale for the separators and the symbol's side. Default: the LocaleProvider's, then the browser's. */
49
+ locale?: string;
50
+ /** `symbol` (€, US$ or $ as the locale writes it), `narrowSymbol` ($) or `code` (EUR). Default `symbol`. */
51
+ currencyDisplay?: "symbol" | "narrowSymbol" | "code";
52
+ /** Override the currency's decimal places, e.g. `0` for whole euros. */
53
+ fractionDigits?: number;
54
+ /** Let people enter amounts below zero. Off by default. */
55
+ allowNegative?: boolean;
56
+ /** The smallest and largest amounts, as decimal strings (or numbers). Outside them the field is invalid; nothing is changed for you. */
57
+ min?: string | number;
58
+ max?: string | number;
59
+ /** `sm` (30px), `default` (38px) or `lg` (46px) for an amount that is the point of the screen. */
60
+ size?: keyof typeof sizes;
61
+ /** Error messages; a LocaleProvider sets them for every MoneyInput. */
62
+ labels?: Partial<MoneyInputMessages>;
63
+ }
64
+ /**
65
+ * MoneyInput — an amount of money in one currency: a recessed field like `Input` with Licht
66
+ * Mono tabular digits and the currency's symbol or code as a mono addon, on the side the locale
67
+ * writes it (`€1,234.50` in en-US, `1.234,50 €` in de-DE).
68
+ *
69
+ * The value is an exact decimal string with the currency's decimal places — `"1234.50"`, never
70
+ * a float — and the decimal places come from the currency (JPY none, EUR two, KWD three). While
71
+ * focused, the amount is plain to edit (`1234.50`); on blur it is grouped for reading.
72
+ * The rule people break: storing the value as a JavaScript number. Keep the string, or its
73
+ * minor units from `onValueChange`, all the way to the server.
74
+ */
75
+ export declare function MoneyInput({ currency, value: valueProp, defaultValue, onValueChange, locale: localeProp, currencyDisplay, fractionDigits: digitsProp, allowNegative, min, max, size, labels, id: idProp, name, required, disabled: disabledProp, readOnly, placeholder, className, onFocus, onBlur, onPaste, "aria-describedby": describedByProp, ref: refProp, ...props }: MoneyInputProps): React.JSX.Element;
76
+ /** The amount as an integer of minor units (cents) for a currency: `toMinorUnits("12.34", "EUR")` → `1234n`. */
77
+ export declare function toMinorUnits(amount: string, currency: string): bigint;
78
+ /** An integer of minor units as the amount string: `fromMinorUnits(1234n, "EUR")` → `"12.34"`. */
79
+ export declare function fromMinorUnits(minorUnits: bigint | number | string, currency: string): string;
80
+ export {};
@@ -0,0 +1,253 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { Field as BaseField } from "@base-ui/react/field";
4
+ import * as React from "react";
5
+ import { cn } from "../lib/cn.js";
6
+ import { mergeRefs } from "../lib/merge-refs.js";
7
+ import { FieldValueInput, useFormatLocale, useFormResetEffect } from "../lib/field-value.js";
8
+ import { amountFromMinor, amountToMinor, compareAmounts, currencyAffix, currencyFractionDigits, formatAmount, normalizeAmount, parseAmount, stripCurrency, } from "../lib/money.js";
9
+ import { InputGroup, InputGroupAddon, InputGroupText } from "./input-group.js";
10
+ import { useLocale, useMessages } from "./locale.js";
11
+ const defaultMessages = {
12
+ invalid: (example) => `Enter an amount, like ${example}.`,
13
+ precision: (digits) => digits === 0
14
+ ? "Enter a whole amount, without decimals."
15
+ : `Use no more than ${digits} decimal ${digits === 1 ? "place" : "places"}.`,
16
+ negative: "Enter an amount of zero or more.",
17
+ rangeUnderflow: (min) => `Enter ${min} or more.`,
18
+ rangeOverflow: (max) => `Enter ${max} or less.`,
19
+ };
20
+ const sizes = {
21
+ sm: { group: "sm", className: "" },
22
+ default: { group: "default", className: "" },
23
+ lg: { group: "default", className: "min-h-(--control-h-lg) text-lg sm:text-lg" },
24
+ };
25
+ const countDigits = (text) => text.match(/\p{Nd}/gu)?.length ?? 0;
26
+ /** Where the caret goes after the `count`-th digit of `text` (any script). */
27
+ function caretAfterDigits(text, count) {
28
+ if (count <= 0)
29
+ return /^\D*-/.test(text) ? text.indexOf("-") + 1 : 0;
30
+ let seen = 0;
31
+ const chars = [...text];
32
+ let at = 0;
33
+ for (const ch of chars) {
34
+ at += ch.length;
35
+ if (/\p{Nd}/u.test(ch) && ++seen === count)
36
+ return at;
37
+ }
38
+ return text.length;
39
+ }
40
+ /** What may be typed: digits of any script, separators, spaces and a minus. */
41
+ const TYPABLE = /^[\p{Nd}\p{Zs}.,'’٫٬\-−]*$/u;
42
+ /**
43
+ * MoneyInput — an amount of money in one currency: a recessed field like `Input` with Licht
44
+ * Mono tabular digits and the currency's symbol or code as a mono addon, on the side the locale
45
+ * writes it (`€1,234.50` in en-US, `1.234,50 €` in de-DE).
46
+ *
47
+ * The value is an exact decimal string with the currency's decimal places — `"1234.50"`, never
48
+ * a float — and the decimal places come from the currency (JPY none, EUR two, KWD three). While
49
+ * focused, the amount is plain to edit (`1234.50`); on blur it is grouped for reading.
50
+ * The rule people break: storing the value as a JavaScript number. Keep the string, or its
51
+ * minor units from `onValueChange`, all the way to the server.
52
+ */
53
+ export function MoneyInput({ currency, value: valueProp, defaultValue, onValueChange, locale: localeProp, currencyDisplay = "symbol", fractionDigits: digitsProp, allowNegative = false, min, max, size = "default", labels, id: idProp, name, required, disabled: disabledProp, readOnly, placeholder, className, onFocus, onBlur, onPaste, "aria-describedby": describedByProp, ref: refProp, ...props }) {
54
+ const locale = useFormatLocale(localeProp ?? useLocale());
55
+ const text = useMessages("moneyInput", defaultMessages, labels);
56
+ const digits = digitsProp ?? currencyFractionDigits(currency);
57
+ const generatedId = React.useId();
58
+ const id = idProp ?? generatedId;
59
+ const controlled = valueProp !== undefined;
60
+ const [own, setOwn] = React.useState(() => normalizeAmount(defaultValue, digits));
61
+ const amount = controlled ? normalizeAmount(valueProp, digits) : own;
62
+ /*
63
+ * The text being edited, or kept because it isn't an amount: null shows the amount formatted.
64
+ * Focus puts the amount in plain (no grouping), blur formats it again.
65
+ */
66
+ const [draft, setDraft] = React.useState(null);
67
+ const visible = React.useRef(null);
68
+ const visibleRefs = React.useMemo(() => mergeRefs(visible, refProp), [refProp]);
69
+ const valueInput = React.useRef(null);
70
+ // A refused keystroke re-renders, so React puts the text back and the caret follows.
71
+ const [, rerender] = React.useReducer((n) => n + 1, 0);
72
+ const caret = React.useRef(null);
73
+ const focused = React.useRef(false);
74
+ /** The last amount reported: a controlled value that differs came from outside. */
75
+ const emitted = React.useRef(amount);
76
+ const [seen, setSeen] = React.useState(amount);
77
+ if (amount !== seen) {
78
+ setSeen(amount);
79
+ if (amount !== emitted.current) {
80
+ emitted.current = amount;
81
+ setDraft(focused.current && amount !== null ? plain(amount) : null);
82
+ }
83
+ }
84
+ function plain(v) {
85
+ return formatAmount(v, { locale, fractionDigits: digits, grouping: false });
86
+ }
87
+ const emit = (next) => {
88
+ if (next === emitted.current)
89
+ return;
90
+ emitted.current = next;
91
+ if (!controlled)
92
+ setOwn(next);
93
+ onValueChange?.(next, { minorUnits: next === null ? null : amountToMinor(next, digits) });
94
+ };
95
+ const commitText = (next) => {
96
+ const parsed = parseAmount(next, { locale, fractionDigits: digits });
97
+ setDraft(next);
98
+ emit(parsed.kind === "ok" ? parsed.value : null);
99
+ };
100
+ const shown = draft ?? (amount === null ? "" : formatAmount(amount, { locale, fractionDigits: digits }));
101
+ // Put the caret back where it was after a paste or a filtered edit re-renders the text.
102
+ React.useLayoutEffect(() => {
103
+ const at = caret.current;
104
+ caret.current = null;
105
+ if (at !== null && visible.current && document.activeElement === visible.current)
106
+ visible.current.setSelectionRange(at, at);
107
+ });
108
+ /* The validity message the Field shows, for the text and the amount as they stand. */
109
+ const bounds = React.useMemo(() => ({
110
+ min: normalizeAmount(min, digits),
111
+ max: normalizeAmount(max, digits),
112
+ }), [min, max, digits]);
113
+ const withCurrency = (v) => formatAmount(v, { locale, fractionDigits: digits, currency, currencyDisplay });
114
+ let message = "";
115
+ const parsed = draft !== null ? parseAmount(draft, { locale, fractionDigits: digits }) : null;
116
+ if (parsed?.kind === "invalid")
117
+ message = text.invalid(formatAmount(`1234${digits ? "." + "5678".slice(0, digits) : ""}`, { locale, fractionDigits: digits }));
118
+ else if (parsed?.kind === "precision")
119
+ message = text.precision(digits);
120
+ else if (amount !== null) {
121
+ if (!allowNegative && amount.startsWith("-"))
122
+ message = text.negative;
123
+ else if (bounds.min !== null && compareAmounts(amount, bounds.min) < 0)
124
+ message = text.rangeUnderflow(withCurrency(bounds.min));
125
+ else if (bounds.max !== null && compareAmounts(amount, bounds.max) > 0)
126
+ message = text.rangeOverflow(withCurrency(bounds.max));
127
+ }
128
+ // The visible field carries the message too, for a plain form's own validation bubble.
129
+ React.useLayoutEffect(() => {
130
+ visible.current?.setCustomValidity(disabledProp ? "" : message);
131
+ }, [message, disabledProp]);
132
+ const affix = currencyAffix(currency, locale, currencyDisplay);
133
+ const currencyName = React.useMemo(() => {
134
+ try {
135
+ return (new Intl.DisplayNames(locale ? [locale] : undefined, { type: "currency" }).of(currency) ?? currency);
136
+ }
137
+ catch {
138
+ return currency;
139
+ }
140
+ }, [locale, currency]);
141
+ const currencyId = `${id}-currency`;
142
+ /* A form's reset puts back the default amount, as it does a native input's (uncontrolled). */
143
+ useFormResetEffect(visible, () => {
144
+ if (controlled)
145
+ return;
146
+ const initial = normalizeAmount(defaultValue, digits);
147
+ emitted.current = initial;
148
+ setOwn(initial);
149
+ setDraft(null);
150
+ });
151
+ const handleChange = (event) => {
152
+ const next = event.currentTarget.value.replace(/\p{Cf}/gu, "");
153
+ // Letters, symbols and a second minus are not typed. A minus only goes in front.
154
+ const minus = next.match(/[-−]/g)?.length ?? 0;
155
+ const signOk = minus === 0 || (allowNegative && minus === 1 && /^\s*[-−]/.test(next));
156
+ const parsedNext = parseAmount(next, { locale, fractionDigits: digits });
157
+ // A digit past the currency's decimal places is refused as it is typed — unless more digits
158
+ // could still make the separator a thousands one ("1,5" on its way to "1,500" for yen).
159
+ const tooPrecise = parsedNext.kind === "precision" && parsedNext.definite;
160
+ if (!TYPABLE.test(next) || !signOk || tooPrecise) {
161
+ // Keep the text and the caret where they were.
162
+ caret.current = Math.max(0, (event.currentTarget.selectionStart ?? 1) - (next.length - shown.length));
163
+ setDraft(shown);
164
+ rerender();
165
+ return;
166
+ }
167
+ commitText(next);
168
+ };
169
+ const handlePaste = (event) => {
170
+ onPaste?.(event);
171
+ if (event.defaultPrevented || readOnly)
172
+ return;
173
+ const pasted = event.clipboardData.getData("text/plain");
174
+ event.preventDefault();
175
+ const cleaned = stripCurrency(pasted);
176
+ if (cleaned === null || !/\p{Nd}/u.test(cleaned))
177
+ return;
178
+ const input = event.currentTarget;
179
+ const start = input.selectionStart ?? input.value.length;
180
+ const end = input.selectionEnd ?? start;
181
+ const combined = input.value.slice(0, start) + cleaned + input.value.slice(end);
182
+ const result = parseAmount(combined, { locale, fractionDigits: digits });
183
+ if (result.kind === "ok") {
184
+ // A whole amount pasted in reads as one: "€ 1.234,56" becomes 1234.56 to edit.
185
+ const next = plain(result.value);
186
+ caret.current = start === 0 && end === input.value.length ? next.length : start + cleaned.length;
187
+ setDraft(next);
188
+ emit(result.value);
189
+ }
190
+ else {
191
+ caret.current = start + cleaned.length;
192
+ commitText(combined);
193
+ }
194
+ };
195
+ const sizing = sizes[size];
196
+ return (_jsx(BaseField.Control, { id: id, name: name, value: amount ?? "", disabled: disabledProp, render: (control) => {
197
+ const { ref, id: controlId, name: controlName, value: controlValue, disabled, "aria-labelledby": labelledBy, "aria-describedby": describedBy, "aria-invalid": invalid, onChange: fieldChange, onFocus: fieldFocus, onBlur: fieldBlur, onKeyDown: _fieldKeyDown, className: _className, defaultValue: _defaultValue, autoFocus: _autoFocus, ...state } = control;
198
+ const off = Boolean(disabled);
199
+ return (_jsxs(InputGroup, { size: sizing.group, "data-slot": "money-input", "data-size": size, ...state, className: cn(sizing.className, className), children: [_jsx(InputGroupAddon, { align: affix.before ? "inline-start" : "inline-end", "aria-hidden": true, children: _jsx(InputGroupText, { "data-slot": "money-input-currency", className: size === "lg" ? "text-[15px]" : "", children: affix.symbol }) }), _jsx("input", { ...props, ref: visibleRefs, id: controlId, "data-slot": "input-group-control", type: "text", inputMode: allowNegative ? "text" : "decimal", autoCorrect: "off", spellCheck: false, value: shown, placeholder: placeholder, disabled: off, readOnly: readOnly, required: required, "aria-labelledby": labelledBy ?? props["aria-labelledby"], "aria-describedby": [describedBy, describedByProp, currencyId].filter(Boolean).join(" "), "aria-invalid": invalid, onChange: handleChange, onPaste: handlePaste, onFocus: (event) => {
200
+ focused.current = true;
201
+ if (draft === null && amount !== null && !readOnly) {
202
+ // The amount goes plain at once, in the DOM too, keeping the selection: Tab selects
203
+ // the whole text, and typing should still replace it.
204
+ const input = event.currentTarget;
205
+ const next = plain(amount);
206
+ // Focus from `select()` or `focus()` comes with the caret at 0, before a click
207
+ // puts it where it lands: select all then too.
208
+ const all = input.selectionStart === 0 &&
209
+ (input.selectionEnd === input.value.length || input.selectionEnd === 0);
210
+ const before = countDigits(input.value.slice(0, input.selectionStart ?? input.value.length));
211
+ input.value = next;
212
+ if (all)
213
+ input.setSelectionRange(0, next.length);
214
+ else {
215
+ const at = caretAfterDigits(next, before);
216
+ input.setSelectionRange(at, at);
217
+ }
218
+ setDraft(next);
219
+ }
220
+ onFocus?.(event);
221
+ fieldFocus?.(event);
222
+ }, onBlur: (event) => {
223
+ focused.current = false;
224
+ const result = parseAmount(draft ?? "", { locale, fractionDigits: digits });
225
+ if (draft !== null) {
226
+ if (result.kind === "ok") {
227
+ emit(result.value);
228
+ setDraft(null);
229
+ }
230
+ else if (result.kind === "empty") {
231
+ emit(null);
232
+ setDraft(null);
233
+ }
234
+ // Not an amount: the text stays, with its message, to be put right.
235
+ }
236
+ onBlur?.(event);
237
+ // The Field hears the blur from its own input, which holds the amount.
238
+ if (valueInput.current)
239
+ fieldBlur?.({
240
+ ...event,
241
+ currentTarget: valueInput.current,
242
+ });
243
+ }, className: cn("min-w-0 flex-1 self-stretch border-0 bg-transparent font-mono text-foreground tabular-nums shadow-none outline-none", "placeholder:text-control-muted focus-visible:outline-none disabled:cursor-not-allowed", "px-3.5 group-data-[size=sm]/input-group:px-2.5", "group-has-[>[data-align=inline-end]]/input-group:pe-2 group-has-[>[data-align=inline-start]]/input-group:ps-2", size === "lg" && "px-4") }), _jsx("span", { id: currencyId, className: "sr-only", children: currencyName }), _jsx(FieldValueInput, { ref: ref, valueRef: valueInput, "data-slot": "money-input-value", name: controlName, value: controlValue ?? "", onChange: fieldChange, required: required, disabled: off, message: off ? "" : message, onFocus: () => visible.current?.focus() })] }));
244
+ } }));
245
+ }
246
+ /** The amount as an integer of minor units (cents) for a currency: `toMinorUnits("12.34", "EUR")` → `1234n`. */
247
+ export function toMinorUnits(amount, currency) {
248
+ return amountToMinor(amount, currencyFractionDigits(currency));
249
+ }
250
+ /** An integer of minor units as the amount string: `fromMinorUnits(1234n, "EUR")` → `"12.34"`. */
251
+ export function fromMinorUnits(minorUnits, currency) {
252
+ return amountFromMinor(minorUnits, currencyFractionDigits(currency));
253
+ }
@@ -0,0 +1,26 @@
1
+ import type * as React from "react";
2
+ declare const sizes: {
3
+ readonly sm: "min-h-(--control-h-sm) pe-8 ps-2.5 text-[13px]";
4
+ readonly default: "min-h-(--control-h) pe-10 ps-3.5 text-base sm:text-[15px]";
5
+ };
6
+ export interface NativeSelectProps extends Omit<React.ComponentProps<"select">, "size"> {
7
+ /** `sm` (30px) for dense surfaces; `default` (38px) everywhere else. */
8
+ size?: keyof typeof sizes;
9
+ /** Classes for the wrapper that positions the chevron (width, margins, grid placement). */
10
+ wrapperClassName?: string;
11
+ }
12
+ /**
13
+ * NativeSelect — a real `<select>` in the field material: recessed, 10px corners, 38px (30px
14
+ * dense), with the same two-way chevron as `Select`. The browser draws the option list, so it
15
+ * is the platform's own picker on phones and works before JavaScript loads.
16
+ *
17
+ * Prefer it for plain forms, long lists (countries, years) and mobile-first screens. Reach for
18
+ * `Select` when the options need custom rendering, groups with rich labels or a styled popup.
19
+ * The rule people break: styling `<option>` — browsers ignore most of it; keep options as text.
20
+ */
21
+ export declare function NativeSelect({ size, className, wrapperClassName, children, ...props }: NativeSelectProps): React.JSX.Element;
22
+ /** One `<option>`. Plain text only: browsers ignore most styling on options. */
23
+ export declare function NativeSelectOption(props: React.ComponentProps<"option">): React.JSX.Element;
24
+ /** A labelled group of options (`<optgroup>`). */
25
+ export declare function NativeSelectOptGroup(props: React.ComponentProps<"optgroup">): React.JSX.Element;
26
+ export {};
@@ -0,0 +1,35 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { Field as BaseField } from "@base-ui/react/field";
4
+ import { ChevronsUpDownIcon } from "lucide-react";
5
+ import { cn } from "../lib/cn.js";
6
+ const sizes = {
7
+ sm: "min-h-(--control-h-sm) pe-8 ps-2.5 text-[13px]",
8
+ default: "min-h-(--control-h) pe-10 ps-3.5 text-base sm:text-[15px]",
9
+ };
10
+ /**
11
+ * NativeSelect — a real `<select>` in the field material: recessed, 10px corners, 38px (30px
12
+ * dense), with the same two-way chevron as `Select`. The browser draws the option list, so it
13
+ * is the platform's own picker on phones and works before JavaScript loads.
14
+ *
15
+ * Prefer it for plain forms, long lists (countries, years) and mobile-first screens. Reach for
16
+ * `Select` when the options need custom rendering, groups with rich labels or a styled popup.
17
+ * The rule people break: styling `<option>` — browsers ignore most of it; keep options as text.
18
+ */
19
+ export function NativeSelect({ size = "default", className, wrapperClassName, children, ...props }) {
20
+ return (_jsxs("div", { "data-slot": "native-select-wrapper", "data-size": size, className: cn("group/native-select relative inline-flex w-full min-w-0", wrapperClassName), children: [_jsx(BaseField.Control, { "data-slot": "native-select", "data-size": size, render: _jsx("select", {}), className: cn("w-full min-w-0 material-field cursor-pointer appearance-none rounded-control font-body leading-none text-foreground outline-none", "disabled:cursor-not-allowed",
21
+ // An empty first option is the placeholder: show it muted while it is chosen.
22
+ "has-[option[value='']:checked]:text-control-muted",
23
+ // The listbox the browser draws follows the theme.
24
+ "[&_optgroup]:bg-field-surface [&_option]:bg-field-surface [&_option]:text-foreground", sizes[size], className), ...props, children: children }), _jsx(ChevronsUpDownIcon, { "aria-hidden": true, "data-slot": "native-select-icon", className: cn("pointer-events-none absolute top-1/2 -translate-y-1/2 text-muted-foreground transition-colors duration-(--duration) ease-brand", "group-has-[select:disabled]/native-select:opacity-55 group-has-[select:enabled:hover]/native-select:text-foreground",
25
+ // At the end, where a select's own arrow sits: the left in a right-to-left page.
26
+ size === "sm" ? "end-2 size-3.5" : "end-3 size-4") })] }));
27
+ }
28
+ /** One `<option>`. Plain text only: browsers ignore most styling on options. */
29
+ export function NativeSelectOption(props) {
30
+ return _jsx("option", { "data-slot": "native-select-option", ...props });
31
+ }
32
+ /** A labelled group of options (`<optgroup>`). */
33
+ export function NativeSelectOptGroup(props) {
34
+ return _jsx("optgroup", { "data-slot": "native-select-optgroup", ...props });
35
+ }
@@ -0,0 +1,42 @@
1
+ import { NavigationMenu as BaseNavigationMenu } from "@base-ui/react/navigation-menu";
2
+ import * as React from "react";
3
+ /** `text`: mono links that brighten. `pill`: one raised surface glides between them. `underline`: a 1px rule does. */
4
+ export type NavigationMenuVariant = "text" | "pill" | "underline";
5
+ export interface NavigationMenuProps extends BaseNavigationMenu.Root.Props {
6
+ /** The bar's design. Default `text`. */
7
+ variant?: NavigationMenuVariant;
8
+ /** Positioner props for the shared popup: side, align, sideOffset, collisionPadding … */
9
+ positioner?: Omit<BaseNavigationMenu.Positioner.Props, "children">;
10
+ }
11
+ /**
12
+ * NavigationMenu — the site header's links, with optional dropdown panels.
13
+ *
14
+ * Top-level entries are Licht Mono 13px in `foreground-soft`, turning `foreground` on hover,
15
+ * open or current. Panels open in one shared `material-menu` popup (12px) that resizes between
16
+ * items. The popup, portal and viewport are rendered for you. The rule people break: putting
17
+ * actions ("Sign up") inside the menu — navigation goes to places; actions are `Button`s.
18
+ */
19
+ export declare function NavigationMenu({ variant, positioner, className, children, dir, ...props }: NavigationMenuProps): React.JSX.Element;
20
+ /**
21
+ * The row of top-level items. In the `pill` and `underline` designs it also draws the one
22
+ * indicator that glides between them (see `useGlide`).
23
+ */
24
+ export declare function NavigationMenuList({ className, children, ref, ...props }: BaseNavigationMenu.List.Props): React.JSX.Element;
25
+ /** One top-level entry: a `NavigationMenuLink`, or a `NavigationMenuTrigger` + `NavigationMenuContent`. */
26
+ export declare function NavigationMenuItem({ className, ...props }: BaseNavigationMenu.Item.Props): React.JSX.Element;
27
+ /** A top-level item that opens a panel. The chevron is included. */
28
+ export declare function NavigationMenuTrigger({ className, children, ...props }: BaseNavigationMenu.Trigger.Props): React.JSX.Element;
29
+ /** The panel for one trigger. It is moved into the shared popup when open. */
30
+ export declare function NavigationMenuContent({ className, ...props }: BaseNavigationMenu.Content.Props): React.JSX.Element;
31
+ export interface NavigationMenuLinkProps extends BaseNavigationMenu.Link.Props {
32
+ /**
33
+ * `bar` (default): a top-level mono link in the header row.
34
+ * `row`: a 38px+ row inside a panel — flat at rest, raised on hover and when `active`.
35
+ */
36
+ variant?: "bar" | "row";
37
+ }
38
+ /**
39
+ * A navigation link. Set `active` on the current page (it sets `aria-current="page"`).
40
+ * For client-side routing pass your router's link through `render`.
41
+ */
42
+ export declare function NavigationMenuLink({ variant, className, ...props }: NavigationMenuLinkProps): React.JSX.Element;