@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,79 @@
1
+ import * as React from "react";
2
+ export interface PhoneInputMessages {
3
+ /** The country picker's name, before the country it shows: "Country". */
4
+ country: string;
5
+ /** The search field over the countries. */
6
+ search: string;
7
+ /** Shown when no country matches the search. */
8
+ empty: string;
9
+ /** Read out when typing or pasting a number switches the country. */
10
+ countryChanged: (country: string) => string;
11
+ /** The number has fewer digits than a number in the country: its name and calling code ("44"). */
12
+ tooShort: (country: string, callingCode: string) => string;
13
+ /** The number has more digits than any number in the country. */
14
+ tooLong: (country: string, callingCode: string) => string;
15
+ /** A "+" and digits that start with no calling code. */
16
+ unknownCode: string;
17
+ }
18
+ declare module "./locale" {
19
+ interface Messages {
20
+ phoneInput: PhoneInputMessages;
21
+ }
22
+ }
23
+ declare const sizes: {
24
+ readonly sm: {
25
+ readonly group: "sm";
26
+ readonly button: "sm";
27
+ readonly className: "";
28
+ };
29
+ readonly default: {
30
+ readonly group: "default";
31
+ readonly button: "default";
32
+ readonly className: "";
33
+ };
34
+ readonly lg: {
35
+ readonly group: "default";
36
+ readonly button: "default";
37
+ readonly className: "min-h-(--control-h-lg) text-lg sm:text-lg";
38
+ };
39
+ };
40
+ export interface PhoneInputChangeDetails {
41
+ /** The country the number is in. */
42
+ country: string;
43
+ /** The national number, digits only, without the trunk prefix: "2079460018". */
44
+ nationalNumber: string;
45
+ /** Whether the number has one of the country's lengths. Not whether it is in use. */
46
+ valid: boolean;
47
+ }
48
+ export interface PhoneInputProps extends Omit<React.ComponentProps<"input">, "value" | "defaultValue" | "onChange" | "size" | "type" | "children"> {
49
+ /** The number in E.164: `"+4915112345678"`; `null` while there are no digits. */
50
+ value?: string | null;
51
+ defaultValue?: string | null;
52
+ /** Called as the number changes, with its country and whether its length fits. */
53
+ onValueChange?: (value: string | null, details: PhoneInputChangeDetails) => void;
54
+ /** The country, as an ISO 3166 code ("DE"), when you control it. */
55
+ country?: string;
56
+ /** The country to start in. Default: the value's, else the locale's region, else US. */
57
+ defaultCountry?: string;
58
+ onCountryChange?: (country: string) => void;
59
+ /** Only these countries, as ISO codes, in the picker. Default: every one. */
60
+ countries?: readonly string[];
61
+ /** A BCP 47 locale for the country names. Default: the LocaleProvider's, then the browser's. */
62
+ locale?: string;
63
+ /** `sm` (30px), `default` (38px) or `lg` (46px). */
64
+ size?: keyof typeof sizes;
65
+ /** Interface text; a LocaleProvider sets it for every PhoneInput. */
66
+ labels?: Partial<PhoneInputMessages>;
67
+ }
68
+ /**
69
+ * PhoneInput — an international phone number: a country picker joined to the number in one
70
+ * recessed field. The picker shows the ISO code and the calling code in mono (`DE +49`) and
71
+ * opens a searchable list of countries named in the locale; the number is grouped in mono as it
72
+ * is typed (`163 7568602`). Typing or pasting a full `+44 20 7946 0018` switches the country.
73
+ *
74
+ * The value is E.164 (`"+4915112345678"`), the form every SMS and voice provider takes. Lengths
75
+ * are checked per country against libphonenumber's metadata — a sanity check, not proof the number
76
+ * exists. The rule people break: storing the number as typed. Keep the E.164 value.
77
+ */
78
+ export declare function PhoneInput({ value: valueProp, defaultValue, onValueChange, country: countryProp, defaultCountry, onCountryChange, countries, locale: localeProp, size, labels, id: idProp, name, required, disabled: disabledProp, readOnly, placeholder, className, onFocus, onBlur, onKeyDown, onPaste, ref: refProp, ...props }: PhoneInputProps): React.JSX.Element;
79
+ export {};
@@ -0,0 +1,282 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { Combobox as BaseCombobox } from "@base-ui/react/combobox";
4
+ import { Field as BaseField } from "@base-ui/react/field";
5
+ import { ChevronDownIcon } from "lucide-react";
6
+ import * as React from "react";
7
+ import { cn } from "../lib/cn.js";
8
+ import { FieldValueInput, useFormatLocale, useFormResetEffect } from "../lib/field-value.js";
9
+ import { mergeRefs } from "../lib/merge-refs.js";
10
+ import { checkPhoneLength, E164_MAX_DIGITS, formatNational, internationalDigits, nationalNumber, parsePhoneNumber, PHONE_COUNTRIES, phoneCountry, phoneDigits, regionOfLocale, splitInternational, toE164, } from "../lib/phone.js";
11
+ import { ComboboxContent, ComboboxEmpty, ComboboxInput, ComboboxItem, ComboboxList } from "./combobox.js";
12
+ import { InputGroup, InputGroupAddon, InputGroupButton } from "./input-group.js";
13
+ import { useLocale, useMessages } from "./locale.js";
14
+ const defaultMessages = {
15
+ country: "Country",
16
+ search: "Search countries",
17
+ empty: "No country matches. Try its name, or its code like +44.",
18
+ countryChanged: (country) => `Country changed to ${country}.`,
19
+ tooShort: (country, code) => `This number is too short for +${code} (${country}).`,
20
+ tooLong: (country, code) => `This number is too long for +${code} (${country}).`,
21
+ unknownCode: "This number starts with no country code we know. Check the digits after the +.",
22
+ };
23
+ const sizes = {
24
+ sm: { group: "sm", button: "sm", className: "" },
25
+ default: { group: "default", button: "default", className: "" },
26
+ lg: {
27
+ group: "default",
28
+ button: "default",
29
+ className: "min-h-(--control-h-lg) text-lg sm:text-lg",
30
+ },
31
+ };
32
+ const fold = (s) => s.normalize("NFD").replace(/\p{M}/gu, "").toLowerCase();
33
+ /** Where the caret goes after the `count`-th digit of `text`. */
34
+ function caretAfterDigits(text, count) {
35
+ if (count <= 0)
36
+ return text.startsWith("+") ? 1 : 0;
37
+ let seen = 0;
38
+ for (let i = 0; i < text.length; i++)
39
+ if (/\d/.test(text[i]) && ++seen === count)
40
+ return i + 1;
41
+ return text.length;
42
+ }
43
+ /**
44
+ * PhoneInput — an international phone number: a country picker joined to the number in one
45
+ * recessed field. The picker shows the ISO code and the calling code in mono (`DE +49`) and
46
+ * opens a searchable list of countries named in the locale; the number is grouped in mono as it
47
+ * is typed (`163 7568602`). Typing or pasting a full `+44 20 7946 0018` switches the country.
48
+ *
49
+ * The value is E.164 (`"+4915112345678"`), the form every SMS and voice provider takes. Lengths
50
+ * are checked per country against libphonenumber's metadata — a sanity check, not proof the number
51
+ * exists. The rule people break: storing the number as typed. Keep the E.164 value.
52
+ */
53
+ export function PhoneInput({ value: valueProp, defaultValue, onValueChange, country: countryProp, defaultCountry, onCountryChange, countries, locale: localeProp, size = "default", labels, id: idProp, name, required, disabled: disabledProp, readOnly, placeholder, className, onFocus, onBlur, onKeyDown, onPaste, ref: refProp, ...props }) {
54
+ const contextLocale = useLocale();
55
+ const locale = useFormatLocale(localeProp ?? contextLocale);
56
+ const text = useMessages("phoneInput", defaultMessages, labels);
57
+ const generatedId = React.useId();
58
+ const id = idProp ?? generatedId;
59
+ /* The countries in the picker, named in the locale and in its alphabetical order. */
60
+ const options = React.useMemo(() => {
61
+ let names = null;
62
+ try {
63
+ names = new Intl.DisplayNames(locale ? [locale] : undefined, { type: "region" });
64
+ }
65
+ catch {
66
+ /* no DisplayNames: the ISO codes */
67
+ }
68
+ const allowed = countries ? new Set(countries.map((c) => c.toUpperCase())) : null;
69
+ const collator = new Intl.Collator(locale);
70
+ return PHONE_COUNTRIES.filter((c) => !allowed || allowed.has(c.iso))
71
+ .map((c) => {
72
+ const name = names?.of(c.iso) ?? c.iso;
73
+ return { iso: c.iso, dial: c.dial, name, search: fold(name) };
74
+ })
75
+ .sort((a, b) => collator.compare(a.name, b.name));
76
+ }, [locale, countries]);
77
+ const optionOf = (iso) => options.find((o) => o.iso === iso);
78
+ /* The country: controlled, chosen here, or from the value, the default or the locale. */
79
+ const initial = valueProp !== undefined ? valueProp : defaultValue;
80
+ const [chosen, setChosen] = React.useState(() => parsePhoneNumber(initial, defaultCountry?.toUpperCase())?.country.iso ?? null);
81
+ // The locale's region: en-US until hydrated without a locale (see useFormatLocale), then the browser's.
82
+ const fallbackCountry = phoneCountry(defaultCountry)?.iso ??
83
+ regionOfLocale(locale ?? (typeof navigator === "undefined" ? undefined : navigator.language)) ??
84
+ "US";
85
+ const countryIso = (countryProp && phoneCountry(countryProp)?.iso) || chosen || fallbackCountry;
86
+ const country = phoneCountry(countryIso) ?? phoneCountry("US");
87
+ const countryName = optionOf(country.iso)?.name ?? country.iso;
88
+ /*
89
+ * What has been typed: national digits (a trunk prefix included, as typed), or while a "+" is
90
+ * typed and no calling code matches yet, that text.
91
+ */
92
+ const [typed, setTyped] = React.useState(() => parsePhoneNumber(initial, country.iso)?.national ?? "");
93
+ const [pending, setPending] = React.useState(null);
94
+ const [announce, setAnnounce] = React.useState("");
95
+ const controlled = valueProp !== undefined;
96
+ const national = nationalNumber(typed, country);
97
+ const e164 = pending !== null ? null : toE164(country, national);
98
+ /** The last value reported: a controlled value that differs came from outside. */
99
+ const emitted = React.useRef(e164);
100
+ const [seen, setSeen] = React.useState(valueProp);
101
+ if (controlled && valueProp !== seen) {
102
+ setSeen(valueProp);
103
+ if ((valueProp ?? null) !== emitted.current) {
104
+ emitted.current = valueProp ?? null;
105
+ const parsed = parsePhoneNumber(valueProp, country.iso);
106
+ setPending(null);
107
+ setTyped(parsed?.national ?? "");
108
+ if (parsed && parsed.country.iso !== country.iso)
109
+ setChosen(parsed.country.iso);
110
+ }
111
+ }
112
+ const visible = React.useRef(null);
113
+ const visibleRefs = React.useMemo(() => mergeRefs(visible, refProp), [refProp]);
114
+ const valueInput = React.useRef(null);
115
+ const groupRef = React.useRef(null);
116
+ const caret = React.useRef(null);
117
+ const [, rerender] = React.useReducer((n) => n + 1, 0);
118
+ const report = (next, digits, nextPending) => {
119
+ const nsn = nationalNumber(digits, next);
120
+ const v = nextPending !== null ? null : toE164(next, nsn);
121
+ if (next.iso !== country.iso) {
122
+ if (!countryProp)
123
+ setChosen(next.iso);
124
+ onCountryChange?.(next.iso);
125
+ }
126
+ if (v === emitted.current)
127
+ return;
128
+ emitted.current = v;
129
+ onValueChange?.(v, {
130
+ country: next.iso,
131
+ nationalNumber: nsn,
132
+ valid: v !== null && checkPhoneLength(nsn, next) === "ok",
133
+ });
134
+ };
135
+ const shown = pending ?? formatNational(typed, country);
136
+ React.useLayoutEffect(() => {
137
+ const at = caret.current;
138
+ caret.current = null;
139
+ if (at !== null && visible.current && document.activeElement === visible.current)
140
+ visible.current.setSelectionRange(at, at);
141
+ });
142
+ /** Reads the field's new text: an international number switches the country. */
143
+ const take = (raw, caretAt) => {
144
+ const intl = internationalDigits(raw, country);
145
+ if (intl !== null) {
146
+ const digits = intl.slice(0, E164_MAX_DIGITS);
147
+ const split = splitInternational(digits, country.iso);
148
+ if (split) {
149
+ const allowed = !countries || countries.some((c) => c.toUpperCase() === split.country.iso);
150
+ if (allowed) {
151
+ setPending(null);
152
+ setTyped(split.national);
153
+ if (split.country.iso !== country.iso)
154
+ setAnnounce(text.countryChanged(optionOf(split.country.iso)?.name ?? split.country.iso));
155
+ caret.current = formatNational(split.national, split.country).length;
156
+ report(split.country, split.national, null);
157
+ return;
158
+ }
159
+ }
160
+ // No calling code yet, or one outside `countries`: the "+" and its digits, as typed.
161
+ setPending(`+${digits}`);
162
+ caret.current = digits.length + 1;
163
+ report(country, typed, `+${digits}`);
164
+ return;
165
+ }
166
+ const digits = phoneDigits(raw);
167
+ if (nationalNumber(digits, country).length > E164_MAX_DIGITS - country.dial.length) {
168
+ // Longer than any number can be: the keystroke is refused.
169
+ caret.current = caretAt === null ? null : Math.max(0, caretAt - (raw.length - shown.length));
170
+ rerender();
171
+ return;
172
+ }
173
+ const before = caretAt === null ? digits.length : phoneDigits(raw.slice(0, caretAt)).length;
174
+ setPending(null);
175
+ setTyped(digits);
176
+ caret.current = caretAfterDigits(formatNational(digits, country), before);
177
+ if (digits === typed)
178
+ rerender();
179
+ report(country, digits, null);
180
+ };
181
+ /* The validity message the Field shows. */
182
+ let message = "";
183
+ if (pending !== null && pending.length > 1)
184
+ message = text.unknownCode;
185
+ else if (national) {
186
+ const fit = checkPhoneLength(national, country);
187
+ if (fit === "short")
188
+ message = text.tooShort(countryName, country.dial);
189
+ else if (fit === "long")
190
+ message = text.tooLong(countryName, country.dial);
191
+ }
192
+ React.useLayoutEffect(() => {
193
+ visible.current?.setCustomValidity(disabledProp ? "" : message);
194
+ }, [message, disabledProp]);
195
+ useFormResetEffect(visible, () => {
196
+ if (controlled)
197
+ return;
198
+ const parsed = parsePhoneNumber(defaultValue, defaultCountry?.toUpperCase());
199
+ emitted.current = parsed ? toE164(parsed.country, parsed.national) : null;
200
+ setPending(null);
201
+ setTyped(parsed?.national ?? "");
202
+ if (!countryProp)
203
+ setChosen(parsed?.country.iso ?? null);
204
+ });
205
+ const pickCountry = (option) => {
206
+ if (!option)
207
+ return;
208
+ const next = phoneCountry(option.iso);
209
+ setPending(null);
210
+ report(next, typed, null);
211
+ // Back to the number, to go on typing it.
212
+ requestAnimationFrame(() => visible.current?.focus());
213
+ };
214
+ const filter = (option, query) => {
215
+ const q = fold(query.trim());
216
+ if (!q)
217
+ return true;
218
+ if (/^\+?[\d\s]+$/.test(q))
219
+ return option.dial.startsWith(q.replace(/\D/g, ""));
220
+ return option.search.includes(q) || option.iso.toLowerCase() === q;
221
+ };
222
+ const sizing = sizes[size];
223
+ const selected = optionOf(country.iso) ?? {
224
+ iso: country.iso,
225
+ dial: country.dial,
226
+ name: countryName,
227
+ search: "",
228
+ };
229
+ return (_jsx(BaseField.Control, { id: id, name: name, value: e164 ?? "", disabled: disabledProp, render: (control) => {
230
+ 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;
231
+ const off = Boolean(disabled);
232
+ return (_jsx("div", { "data-slot": "phone-input", "data-size": size, className: cn("w-full min-w-0", className), children: _jsxs(InputGroup, { ref: groupRef, size: sizing.group, ...state, className: sizing.className, children: [_jsx(InputGroupAddon, { align: "inline-start", className: "ps-[3px] group-data-[size=sm]/input-group:ps-0.5", children: _jsx(BaseField.Root, { disabled: off || readOnly, render: _jsx("span", { className: "contents" }), children: _jsxs(BaseCombobox.Root, { items: options, value: selected, onValueChange: pickCountry, isItemEqualToValue: (a, b) => a.iso === b.iso, itemToStringLabel: (o) => o.name, filter: filter, autoHighlight: true, children: [_jsxs(BaseCombobox.Trigger
233
+ // It stays an input-group-button, so the field rounds and insets it like any.
234
+ , { "data-phone-input-country": "", "aria-label": `${text.country}: ${countryName}, +${country.dial}`, render: _jsx(InputGroupButton, { variant: "ghost", size: sizing.button, ...(size === "lg" ? { "data-size": "lg" } : {}), className: cn(
235
+ // The field already dims when disabled: not the button twice.
236
+ "gap-1.5 font-mono tabular-nums data-disabled:opacity-100", size === "lg" && "min-h-[calc(var(--control-h-lg)-8px)] px-3 text-sm", size === "sm" ? "text-xs" : "text-[13px]",
237
+ // After the text size, which would reset it: one line as tall as the type.
238
+ "leading-none") }), children: [_jsx("span", { className: "text-muted-foreground", children: country.iso }), _jsxs("span", { className: "text-foreground", children: ["+", country.dial] }), _jsx(ChevronDownIcon, { "aria-hidden": true, className: "size-3.5 text-muted-foreground transition-transform duration-(--duration) ease-(--ease) in-data-popup-open:rotate-180" })] }), _jsxs(ComboboxContent, { "aria-label": text.country, positioner: { anchor: groupRef, align: "start" }, className: "min-w-[min(18rem,var(--available-width))]", children: [_jsx("div", { className: "pb-1", children: _jsx(ComboboxInput, { size: "sm", showTrigger: false, placeholder: text.search, "aria-label": text.search }) }), _jsx(ComboboxEmpty, { children: text.empty }), _jsx(ComboboxList, { children: (option) => (_jsx(ComboboxItem, { value: option, "data-country": option.iso, children: _jsxs("span", { className: "flex min-w-0 items-baseline gap-3", children: [_jsx("span", { className: "w-6 shrink-0 font-mono text-xs text-muted-foreground", children: option.iso }), _jsx("span", { className: "min-w-0 flex-1 truncate", children: option.name }), _jsxs("span", { className: "shrink-0 font-mono text-xs text-muted-foreground tabular-nums", children: ["+", option.dial] })] }) }, option.iso)) })] })] }) }) }), _jsx("input", { ...props, ref: visibleRefs, id: controlId, "data-slot": "input-group-control", type: "tel", inputMode: "tel", autoComplete: props.autoComplete ?? "tel", value: shown, placeholder: placeholder, disabled: off, readOnly: readOnly, required: required, "aria-labelledby": labelledBy ?? props["aria-labelledby"], "aria-describedby": [describedBy, props["aria-describedby"]].filter(Boolean).join(" ") || undefined, "aria-invalid": invalid, onChange: (event) => take(event.currentTarget.value, event.currentTarget.selectionStart), onPaste: (event) => {
239
+ onPaste?.(event);
240
+ if (event.defaultPrevented || readOnly)
241
+ return;
242
+ const pasted = event.clipboardData.getData("text/plain");
243
+ // A whole international number replaces the field and picks its country.
244
+ if (internationalDigits(pasted, country) !== null) {
245
+ event.preventDefault();
246
+ take(pasted, null);
247
+ }
248
+ }, onKeyDown: (event) => {
249
+ onKeyDown?.(event);
250
+ if (event.defaultPrevented)
251
+ return;
252
+ // Backspace or Delete next to a space removes the digit beyond it, not the space
253
+ // (which the grouping would put straight back).
254
+ const input = event.currentTarget;
255
+ const at = input.selectionStart ?? 0;
256
+ if (at !== input.selectionEnd || readOnly)
257
+ return;
258
+ const back = event.key === "Backspace" && input.value[at - 1] === " ";
259
+ const forward = event.key === "Delete" && input.value[at] === " ";
260
+ if (!back && !forward)
261
+ return;
262
+ event.preventDefault();
263
+ const raw = back
264
+ ? input.value.slice(0, at - 2) + input.value.slice(at)
265
+ : input.value.slice(0, at) + input.value.slice(at + 2);
266
+ take(raw, back ? at - 2 : at);
267
+ }, onFocus: (event) => {
268
+ onFocus?.(event);
269
+ fieldFocus?.(event);
270
+ }, onBlur: (event) => {
271
+ // Left as read: the national number grouped, without the trunk prefix (+44 is beside it).
272
+ if (pending === null && national !== typed)
273
+ setTyped(national);
274
+ onBlur?.(event);
275
+ if (valueInput.current)
276
+ fieldBlur?.({
277
+ ...event,
278
+ currentTarget: valueInput.current,
279
+ });
280
+ }, 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", "ps-2 pe-3.5 group-data-[size=sm]/input-group:ps-1.5 group-data-[size=sm]/input-group:pe-2.5", size === "lg" && "pe-4") }), _jsx("span", { "aria-live": "polite", className: "sr-only", children: announce }), _jsx(FieldValueInput, { ref: ref, valueRef: valueInput, "data-slot": "phone-input-value", name: controlName, value: controlValue ?? "", onChange: fieldChange, required: required, disabled: off, message: off ? "" : message, onFocus: () => visible.current?.focus() })] }) }));
281
+ } }));
282
+ }
@@ -0,0 +1,33 @@
1
+ import { Popover as BasePopover } from "@base-ui/react/popover";
2
+ import * as React from "react";
3
+ /**
4
+ * Popover — a small panel anchored to a control: a hint with a link, a short form, a few
5
+ * settings. Menu material at 12px.
6
+ *
7
+ * The rule people break: putting a whole task in it. If it needs a heading, a scroll and a
8
+ * footer, it is a `Dialog`. If it only lists actions, it is a `Menu`.
9
+ */
10
+ export declare function Popover(props: BasePopover.Root.Props): React.JSX.Element;
11
+ /**
12
+ * Opens the popover. Compose with a button: `render={<Button variant="secondary" />}`.
13
+ * Pass `openOnHover` (with `delay`) for hover-intent popovers.
14
+ */
15
+ export declare function PopoverTrigger({ ref, ...props }: BasePopover.Trigger.Props): React.JSX.Element;
16
+ export interface PopoverContentProps extends BasePopover.Popup.Props {
17
+ side?: BasePopover.Positioner.Props["side"];
18
+ align?: BasePopover.Positioner.Props["align"];
19
+ sideOffset?: BasePopover.Positioner.Props["sideOffset"];
20
+ alignOffset?: BasePopover.Positioner.Props["alignOffset"];
21
+ /** Any other positioner props: `collisionPadding`, `anchor`, `sticky` … */
22
+ positioner?: Omit<BasePopover.Positioner.Props, "children">;
23
+ /** Props for the portal (e.g. `container`, `keepMounted`). */
24
+ portal?: Omit<BasePopover.Portal.Props, "children">;
25
+ /** Draw a small notch pointing at the trigger. */
26
+ arrow?: boolean;
27
+ }
28
+ /** Portal + Positioner + Popup. Fades and scales from the trigger (`popup-motion`). */
29
+ export declare function PopoverContent({ side, align, sideOffset, alignOffset, positioner, portal, arrow, className, children, dir, ...props }: PopoverContentProps): React.JSX.Element;
30
+ export declare function PopoverTitle({ className, ...props }: BasePopover.Title.Props): React.JSX.Element;
31
+ export declare function PopoverDescription({ className, ...props }: BasePopover.Description.Props): React.JSX.Element;
32
+ /** Closes the popover. Compose with a button: `render={<Button variant="ghost" size="sm" />}`. */
33
+ export declare function PopoverClose(props: BasePopover.Close.Props): React.JSX.Element;
@@ -0,0 +1,48 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { Popover as BasePopover } from "@base-ui/react/popover";
4
+ import * as React from "react";
5
+ import { sx, triggerSlot } from "../lib/cn.js";
6
+ import { mergeRefs } from "../lib/merge-refs.js";
7
+ import { roomBounds, TriggerRoomContext, useTriggerRoom } from "../lib/room.js";
8
+ import { overlayArrow, overlayPopup, usePopupDir } from "./_overlay.js";
9
+ /**
10
+ * Popover — a small panel anchored to a control: a hint with a link, a short form, a few
11
+ * settings. Menu material at 12px.
12
+ *
13
+ * The rule people break: putting a whole task in it. If it needs a heading, a scroll and a
14
+ * footer, it is a `Dialog`. If it only lists actions, it is a `Menu`.
15
+ */
16
+ export function Popover(props) {
17
+ // The trigger registers here, so the content can keep inside the trigger's room.
18
+ const room = useTriggerRoom();
19
+ return (_jsx(TriggerRoomContext.Provider, { value: room, children: _jsx(BasePopover.Root, { ...props }) }));
20
+ }
21
+ /**
22
+ * Opens the popover. Compose with a button: `render={<Button variant="secondary" />}`.
23
+ * Pass `openOnHover` (with `delay`) for hover-intent popovers.
24
+ */
25
+ export function PopoverTrigger({ ref, ...props }) {
26
+ const setTrigger = React.useContext(TriggerRoomContext)?.setTrigger;
27
+ const refs = React.useMemo(() => mergeRefs(setTrigger, ref), [setTrigger, ref]);
28
+ return _jsx(BasePopover.Trigger, { ref: refs, ...triggerSlot("popover-trigger", props.render), ...props });
29
+ }
30
+ /** Portal + Positioner + Popup. Fades and scales from the trigger (`popup-motion`). */
31
+ export function PopoverContent({ side = "bottom", align = "center", sideOffset = 8, alignOffset = 0, positioner, portal, arrow = false, className, children, dir, ...props }) {
32
+ // Across, keep inside the trigger's room (a narrow panel), not only the window. Found once per
33
+ // trigger, not on every render of a closed popover.
34
+ const trigger = React.useContext(TriggerRoomContext)?.trigger ?? null;
35
+ const bounds = React.useMemo(() => roomBounds(trigger), [trigger]);
36
+ const popupDir = usePopupDir(dir);
37
+ return (_jsx(BasePopover.Portal, { ...portal, children: _jsx(BasePopover.Positioner, { side: side, align: align, sideOffset: sideOffset, alignOffset: alignOffset, arrowPadding: 14, collisionPadding: 16, collisionBoundary: bounds, dir: popupDir, ...positioner, className: "z-50 outline-none", children: _jsxs(BasePopover.Popup, { "data-slot": "popover-content", className: sx(["relative flex w-72 max-w-(--available-width) flex-col gap-1.5 p-4 text-sm", overlayPopup], className), ...props, children: [arrow && _jsx(BasePopover.Arrow, { "data-slot": "popover-arrow", className: overlayArrow }), children] }) }) }));
38
+ }
39
+ export function PopoverTitle({ className, ...props }) {
40
+ return (_jsx(BasePopover.Title, { "data-slot": "popover-title", className: sx("font-body text-[15px] leading-snug font-medium tracking-normal text-foreground", className), ...props }));
41
+ }
42
+ export function PopoverDescription({ className, ...props }) {
43
+ return (_jsx(BasePopover.Description, { "data-slot": "popover-description", className: sx("text-[13px] leading-normal text-muted-foreground", className), ...props }));
44
+ }
45
+ /** Closes the popover. Compose with a button: `render={<Button variant="ghost" size="sm" />}`. */
46
+ export function PopoverClose(props) {
47
+ return _jsx(BasePopover.Close, { ...triggerSlot("popover-close", props.render), ...props });
48
+ }
@@ -0,0 +1,25 @@
1
+ import { PreviewCard as BasePreviewCard } from "@base-ui/react/preview-card";
2
+ /**
3
+ * PreviewCard — a hover card that previews what a link points to (a person, an article, a
4
+ * doc page) before the reader commits to the click.
5
+ *
6
+ * The rule people break: putting the only copy of something in it. It opens on hover and focus
7
+ * only, so the link must make sense on its own and the card must hold nothing essential.
8
+ */
9
+ export declare const PreviewCard: <Payload>(props: BasePreviewCard.Root.Props<Payload>) => React.JSX.Element;
10
+ /** The link that opens the card. Renders an `<a>`; style it with the `link` utility. */
11
+ export declare function PreviewCardTrigger(props: BasePreviewCard.Trigger.Props): import("react").JSX.Element;
12
+ export interface PreviewCardContentProps extends BasePreviewCard.Popup.Props {
13
+ side?: BasePreviewCard.Positioner.Props["side"];
14
+ align?: BasePreviewCard.Positioner.Props["align"];
15
+ sideOffset?: BasePreviewCard.Positioner.Props["sideOffset"];
16
+ alignOffset?: BasePreviewCard.Positioner.Props["alignOffset"];
17
+ /** Any other positioner props: `collisionPadding`, `sticky` … */
18
+ positioner?: Omit<BasePreviewCard.Positioner.Props, "children">;
19
+ /** Props for the portal (e.g. `container`). */
20
+ portal?: Omit<BasePreviewCard.Portal.Props, "children">;
21
+ /** Draw a small notch pointing at the link. */
22
+ arrow?: boolean;
23
+ }
24
+ /** Portal + Positioner + Popup. Menu material at 12px, 320px wide, `popup-motion`. */
25
+ export declare function PreviewCardContent({ side, align, sideOffset, alignOffset, positioner, portal, arrow, className, children, dir, ...props }: PreviewCardContentProps): import("react").JSX.Element;
@@ -0,0 +1,22 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { PreviewCard as BasePreviewCard } from "@base-ui/react/preview-card";
4
+ import { sx, triggerSlot } from "../lib/cn.js";
5
+ import { overlayArrow, overlayPopup, usePopupDir } from "./_overlay.js";
6
+ /**
7
+ * PreviewCard — a hover card that previews what a link points to (a person, an article, a
8
+ * doc page) before the reader commits to the click.
9
+ *
10
+ * The rule people break: putting the only copy of something in it. It opens on hover and focus
11
+ * only, so the link must make sense on its own and the card must hold nothing essential.
12
+ */
13
+ export const PreviewCard = BasePreviewCard.Root;
14
+ /** The link that opens the card. Renders an `<a>`; style it with the `link` utility. */
15
+ export function PreviewCardTrigger(props) {
16
+ return _jsx(BasePreviewCard.Trigger, { ...triggerSlot("preview-card-trigger", props.render), ...props });
17
+ }
18
+ /** Portal + Positioner + Popup. Menu material at 12px, 320px wide, `popup-motion`. */
19
+ export function PreviewCardContent({ side = "bottom", align = "center", sideOffset = 8, alignOffset = 0, positioner, portal, arrow = false, className, children, dir, ...props }) {
20
+ const popupDir = usePopupDir(dir);
21
+ return (_jsx(BasePreviewCard.Portal, { ...portal, children: _jsx(BasePreviewCard.Positioner, { side: side, align: align, sideOffset: sideOffset, alignOffset: alignOffset, arrowPadding: 14, collisionPadding: 16, dir: popupDir, ...positioner, className: "z-50 outline-none", children: _jsxs(BasePreviewCard.Popup, { "data-slot": "preview-card-content", className: sx(["relative flex w-80 max-w-(--available-width) flex-col gap-3 p-4 text-sm", overlayPopup], className), ...props, children: [arrow && _jsx(BasePreviewCard.Arrow, { "data-slot": "preview-card-arrow", className: overlayArrow }), children] }) }) }));
22
+ }
@@ -0,0 +1,27 @@
1
+ import { Progress as BaseProgress } from "@base-ui/react/progress";
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 ProgressTone = keyof typeof toneFill;
11
+ export interface ProgressProps extends BaseProgress.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
+ /** The indicator's colour: `destructive` for a failed upload, `success` once it is done. */
17
+ tone?: ProgressTone;
18
+ }
19
+ /**
20
+ * Progress — how far a task has got: an upload, an import, a multi-step setup.
21
+ *
22
+ * A recessed 6px track with a `--foreground` indicator, plus an optional mono label and
23
+ * value. Pass `value={null}` for indeterminate work. The rule people break: using it for a
24
+ * static quantity (storage used, a score). That is a `Meter`.
25
+ */
26
+ export declare function Progress({ label, showValue, tone, className, children, ...props }: ProgressProps): React.JSX.Element;
27
+ export {};
@@ -0,0 +1,25 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { Progress as BaseProgress } from "@base-ui/react/progress";
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
+ * Progress — how far a task has got: an upload, an import, a multi-step setup.
15
+ *
16
+ * A recessed 6px track with a `--foreground` indicator, plus an optional mono label and
17
+ * value. Pass `value={null}` for indeterminate work. The rule people break: using it for a
18
+ * static quantity (storage used, a score). That is a `Meter`.
19
+ */
20
+ export function Progress({ label, showValue = false, tone = "default", className, children, ...props }) {
21
+ const locale = useLocale();
22
+ return (_jsxs(BaseProgress.Root, { "data-slot": "progress", "data-tone": tone, 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(BaseProgress.Label, { "data-slot": "progress-label",
23
+ // A long name (a file, a URL) wraps instead of pushing the track wider than its column.
24
+ className: "col-start-1 font-mono text-[12px] [overflow-wrap:anywhere] text-foreground-soft", children: label })), showValue && (_jsx(BaseProgress.Value, { "data-slot": "progress-value", className: "col-start-2 text-end font-mono text-[12px] text-muted-foreground tabular-nums" })), _jsx(BaseProgress.Track, { "data-slot": "progress-track", className: "relative col-span-2 h-1.5 overflow-hidden rounded-full border border-field-edge bg-field-surface shadow-field", children: _jsx(BaseProgress.Indicator, { "data-slot": "progress-indicator", className: sx("block h-full rounded-full transition-[width,background-color] duration-(--duration) ease-(--ease)", toneFill[tone]) }) }), children] }));
25
+ }