@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,97 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { NavigationMenu as BaseNavigationMenu } from "@base-ui/react/navigation-menu";
4
+ import { ChevronDownIcon } from "lucide-react";
5
+ import * as React from "react";
6
+ import { cn, sx } from "../lib/cn.js";
7
+ import { glideMotion, useGlide, useMergedRef } from "../lib/glide.js";
8
+ import { usePopupDir } from "./_overlay.js";
9
+ const VariantContext = React.createContext("text");
10
+ /**
11
+ * NavigationMenu — the site header's links, with optional dropdown panels.
12
+ *
13
+ * Top-level entries are Licht Mono 13px in `foreground-soft`, turning `foreground` on hover,
14
+ * open or current. Panels open in one shared `material-menu` popup (12px) that resizes between
15
+ * items. The popup, portal and viewport are rendered for you. The rule people break: putting
16
+ * actions ("Sign up") inside the menu — navigation goes to places; actions are `Button`s.
17
+ */
18
+ export function NavigationMenu({ variant = "text", positioner, className, children, dir, ...props }) {
19
+ // The shared popup is portalled out of the bar: it takes the bar's direction itself.
20
+ const popupDir = usePopupDir(dir);
21
+ return (_jsxs(BaseNavigationMenu.Root, { "data-slot": "navigation-menu", "data-variant": variant, dir: dir, className: sx("relative", className), ...props, children: [_jsx(VariantContext.Provider, { value: variant, children: children }), _jsx(BaseNavigationMenu.Portal, { children: _jsx(BaseNavigationMenu.Positioner, { sideOffset: 8, collisionPadding: { top: 8, bottom: 8, left: 16, right: 16 }, collisionAvoidance: { side: "none" }, dir: popupDir, ...positioner, className: sx([
22
+ "z-50 h-(--positioner-height) w-(--positioner-width) max-w-(--available-width) outline-none",
23
+ "transition-[top,left,right,bottom] duration-(--duration) ease-(--ease) data-instant:transition-none",
24
+ // Hover bridge across the side offset so the pointer can travel into the popup.
25
+ "before:absolute before:content-[''] data-[side=bottom]:before:inset-x-0 data-[side=bottom]:before:-top-2 data-[side=bottom]:before:h-2 data-[side=top]:before:inset-x-0 data-[side=top]:before:-bottom-2 data-[side=top]:before:h-2",
26
+ ], positioner?.className), children: _jsx(BaseNavigationMenu.Popup, { "data-slot": "navigation-menu-popup", className: [
27
+ "relative h-(--popup-height) w-(--popup-width) origin-(--transform-origin) overflow-hidden rounded-button material-menu outline-none",
28
+ "transition-[opacity,scale,width,height] duration-(--duration) ease-(--ease)",
29
+ "data-ending-style:scale-[0.97] data-ending-style:opacity-0 data-starting-style:scale-[0.97] data-starting-style:opacity-0",
30
+ ].join(" "), children: _jsx(BaseNavigationMenu.Viewport, { "data-slot": "navigation-menu-viewport", className: "relative h-full w-full overflow-hidden" }) }) }) })] }));
31
+ }
32
+ const BAR = ':is([data-slot="navigation-menu-trigger"], [data-slot="navigation-menu-link"][data-variant="bar"])';
33
+ /** The item the pill or underline covers: the open trigger, else the pointed or focused item, else the current page. */
34
+ const lit = (root) => root.querySelector('[data-slot="navigation-menu-trigger"][data-popup-open]') ??
35
+ root.querySelector(`${BAR}:is(:hover, :focus-visible)`) ??
36
+ root.querySelector(`${BAR}:is([data-active], [aria-current="page"])`);
37
+ /**
38
+ * The row of top-level items. In the `pill` and `underline` designs it also draws the one
39
+ * indicator that glides between them (see `useGlide`).
40
+ */
41
+ export function NavigationMenuList({ className, children, ref, ...props }) {
42
+ const variant = React.useContext(VariantContext);
43
+ const [listRef, setRef] = useMergedRef(ref);
44
+ const glide = useGlide(listRef, lit, {
45
+ enabled: variant !== "text",
46
+ attributes: ["data-popup-open", "data-active", "aria-current"],
47
+ events: ["pointerover", "pointerout", "focusin", "focusout"],
48
+ items: '[data-slot="navigation-menu-item"]',
49
+ // Crossing the gap between two items keeps the indicator, so it glides instead of blinking.
50
+ linger: 120,
51
+ });
52
+ const rect = glide.rect;
53
+ return (_jsxs(BaseNavigationMenu.List, { ref: setRef, "data-slot": "navigation-menu-list",
54
+ // Too narrow for every item: the row wraps rather than running off the screen.
55
+ className: sx("relative m-0 flex list-none flex-wrap items-center gap-1 p-0", className), ...props, children: [variant !== "text" && (_jsx("span", { "aria-hidden": true, "data-slot": "navigation-menu-indicator", "data-visible": glide.visible ? "" : undefined, "data-instant": glide.instant ? "" : undefined, className: cn(glideMotion, variant === "pill"
56
+ ? "rounded-button bg-control-surface bg-linear-to-b from-control-inner-edge to-transparent shadow-raised"
57
+ : "h-px bg-foreground"), style: rect
58
+ ? variant === "pill"
59
+ ? { translate: `${rect.x}px ${rect.y}px`, width: rect.width, height: rect.height }
60
+ : // The rule sits on the item's bottom edge, in whichever row the item is.
61
+ { translate: `${rect.x}px ${rect.y + rect.height - 1}px`, width: rect.width }
62
+ : undefined })), children] }));
63
+ }
64
+ /** One top-level entry: a `NavigationMenuLink`, or a `NavigationMenuTrigger` + `NavigationMenuContent`. */
65
+ export function NavigationMenuItem({ className, ...props }) {
66
+ return _jsx(BaseNavigationMenu.Item, { "data-slot": "navigation-menu-item", className: className, ...props });
67
+ }
68
+ // `relative`: the items paint above the list's gliding indicator.
69
+ const barItem = [
70
+ "relative gap-1.5 px-3 inline-flex min-h-(--control-h) cursor-pointer items-center rounded-button font-mono text-[13px] leading-none whitespace-nowrap text-foreground-soft no-underline focus-ring select-none",
71
+ "transition-colors duration-(--duration) ease-(--ease) hover:text-foreground",
72
+ "data-active:text-foreground data-popup-open:text-foreground aria-[current=page]:text-foreground",
73
+ "data-disabled:pointer-events-none data-disabled:opacity-50",
74
+ ].join(" ");
75
+ /** A top-level item that opens a panel. The chevron is included. */
76
+ export function NavigationMenuTrigger({ className, children, ...props }) {
77
+ return (_jsxs(BaseNavigationMenu.Trigger, { "data-slot": "navigation-menu-trigger", className: sx(barItem, className), ...props, children: [children, _jsx(BaseNavigationMenu.Icon, { "data-slot": "navigation-menu-icon", className: "flex transition-[rotate] duration-(--duration) ease-(--ease) data-popup-open:rotate-180", children: _jsx(ChevronDownIcon, { "aria-hidden": true, className: "size-3.5" }) })] }));
78
+ }
79
+ /** The panel for one trigger. It is moved into the shared popup when open. */
80
+ export function NavigationMenuContent({ className, ...props }) {
81
+ return (_jsx(BaseNavigationMenu.Content, { "data-slot": "navigation-menu-content", className: sx([
82
+ "w-[calc(100vw-32px)] p-2 sm:w-max sm:max-w-[520px]",
83
+ "transition-[opacity,translate] duration-(--duration) ease-(--ease)",
84
+ "data-ending-style:opacity-0 data-starting-style:opacity-0",
85
+ "data-starting-style:data-[activation-direction=left]:-translate-x-1/4 data-starting-style:data-[activation-direction=right]:translate-x-1/4",
86
+ "data-ending-style:data-[activation-direction=left]:translate-x-1/4 data-ending-style:data-[activation-direction=right]:-translate-x-1/4",
87
+ ], className), ...props }));
88
+ }
89
+ /**
90
+ * A navigation link. Set `active` on the current page (it sets `aria-current="page"`).
91
+ * For client-side routing pass your router's link through `render`.
92
+ */
93
+ export function NavigationMenuLink({ variant = "bar", className, ...props }) {
94
+ return (_jsx(BaseNavigationMenu.Link, { "data-slot": "navigation-menu-link", "data-variant": variant, className: sx(variant === "bar"
95
+ ? barItem
96
+ : "flex min-h-(--control-h) flex-col justify-center gap-1 rounded-button material-row px-3 py-2.5 font-body text-sm no-underline focus-ring [&_small]:text-[13px] [&_small]:leading-snug [&_small]:text-muted-foreground", className), ...props }));
97
+ }
@@ -0,0 +1,55 @@
1
+ import { NumberField as BaseNumberField } from "@base-ui/react/number-field";
2
+ import * as React from "react";
3
+ export interface NumberFieldMessages {
4
+ /** The − (or ▼) stepper. */
5
+ decrement: string;
6
+ /** The + (or ▲) stepper. */
7
+ increment: string;
8
+ /** What screen readers call the field instead of "text field". */
9
+ roleDescription: string;
10
+ }
11
+ declare module "./locale" {
12
+ interface Messages {
13
+ numberField: NumberFieldMessages;
14
+ }
15
+ }
16
+ declare const groupSizes: {
17
+ readonly sm: "min-h-(--control-h-sm) p-0.5";
18
+ readonly default: "min-h-(--control-h) p-[3px]";
19
+ };
20
+ export interface NumberFieldProps extends BaseNumberField.Root.Props {
21
+ /** `sm` (30px) for dense surfaces; `default` (38px) everywhere else. */
22
+ size?: keyof typeof groupSizes;
23
+ /**
24
+ * A visible label rendered as a scrub area: drag across it horizontally to change the value.
25
+ * Omit it when the field already sits under a `<FieldLabel>`.
26
+ */
27
+ label?: React.ReactNode;
28
+ /** Placeholder for the input while it is empty. */
29
+ placeholder?: string;
30
+ /**
31
+ * `sides`: a round − before the number and a + after it, the number centred. `stacked`: the
32
+ * number at the start like an Input's text, with ▲ and ▼ stacked at the end of the field.
33
+ */
34
+ steppers?: "sides" | "stacked";
35
+ /**
36
+ * Accessible names for the steppers.
37
+ * @deprecated Use `labels.decrement` and `labels.increment`.
38
+ */
39
+ decrementLabel?: string;
40
+ /** @deprecated Use `labels.increment`. */
41
+ incrementLabel?: string;
42
+ /** Accessible names: the steppers and the field's role. A LocaleProvider sets them for every NumberField. */
43
+ labels?: Partial<NumberFieldMessages>;
44
+ }
45
+ /**
46
+ * NumberField — a recessed field for exact numbers, with raised −/+ steppers and mono, tabular
47
+ * digits so values do not jitter as they change.
48
+ *
49
+ * Use it for counts, quantities and amounts where the exact value matters. Pass `format`
50
+ * (`Intl.NumberFormatOptions`) for currency or units instead of typing them into the label.
51
+ * The rule people break: no `min`/`max` — set the bounds so the steppers stop where the
52
+ * business rule does.
53
+ */
54
+ export declare function NumberField({ size, steppers, label, placeholder, decrementLabel, incrementLabel, labels, id: idProp, className, value: valueProp, defaultValue, onValueChange, locale: localeProp, ...props }: NumberFieldProps): React.JSX.Element;
55
+ export {};
@@ -0,0 +1,164 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { NumberField as BaseNumberField } from "@base-ui/react/number-field";
4
+ import { ChevronDownIcon, ChevronUpIcon, MinusIcon, MoveHorizontalIcon, PlusIcon } from "lucide-react";
5
+ import * as React from "react";
6
+ import { cn, sx } from "../lib/cn.js";
7
+ import { DigitRoll, reducedMotion } from "../lib/digit-roll.js";
8
+ import { useLocale, useMessages } from "./locale.js";
9
+ const defaultMessages = {
10
+ decrement: "Decrease",
11
+ increment: "Increase",
12
+ roleDescription: "Number field",
13
+ };
14
+ const groupSizes = {
15
+ sm: "min-h-(--control-h-sm) p-0.5",
16
+ default: "min-h-(--control-h) p-[3px]",
17
+ };
18
+ const stepperSizes = {
19
+ sm: "size-(--control-inset-sm) material-row",
20
+ default: "size-(--control-inset) material-raised",
21
+ };
22
+ /** The stacked pair: one key split in two, as tall as a side stepper, the halves meeting square. */
23
+ const stackSizes = {
24
+ sm: "h-(--control-inset-sm) w-5",
25
+ default: "h-(--control-inset) w-6",
26
+ };
27
+ /**
28
+ * The number starts where an Input's text does: its padding, less the group's inset — at the
29
+ * left, or at the right in a right-to-left field, with the steppers at the other end.
30
+ */
31
+ const stackedInput = { sm: "text-start ps-2", default: "text-start ps-[11px]" };
32
+ /** The digit roll over it, at the same start. */
33
+ const stackedRoll = { sm: "justify-start ps-2", default: "justify-start ps-[11px]" };
34
+ /** Keys that step the value without editing the text: they leave a hidden caret hidden. */
35
+ const STEP_KEYS = new Set([
36
+ "ArrowUp",
37
+ "ArrowDown",
38
+ "PageUp",
39
+ "PageDown",
40
+ "Home",
41
+ "End",
42
+ "Shift",
43
+ "Alt",
44
+ "Control",
45
+ "Meta",
46
+ "Tab",
47
+ "Escape",
48
+ ]);
49
+ /**
50
+ * Changes that step the value — the steppers, keys, wheel and scrubbing the label roll the digits;
51
+ * typing, pasting and blur formatting don't.
52
+ */
53
+ const STEP_REASONS = new Set(["increment-press", "decrement-press", "keyboard", "wheel", "scrub"]);
54
+ /**
55
+ * NumberField — a recessed field for exact numbers, with raised −/+ steppers and mono, tabular
56
+ * digits so values do not jitter as they change.
57
+ *
58
+ * Use it for counts, quantities and amounts where the exact value matters. Pass `format`
59
+ * (`Intl.NumberFormatOptions`) for currency or units instead of typing them into the label.
60
+ * The rule people break: no `min`/`max` — set the bounds so the steppers stop where the
61
+ * business rule does.
62
+ */
63
+ export function NumberField({ size = "default", steppers = "sides", label, placeholder, decrementLabel, incrementLabel, labels, id: idProp, className, value: valueProp, defaultValue, onValueChange, locale: localeProp, ...props }) {
64
+ const text = useMessages("numberField", defaultMessages, labels);
65
+ const locale = useLocale();
66
+ const generatedId = React.useId();
67
+ const id = idProp ?? generatedId;
68
+ // A tight line, so the number fits the field in a theme with smaller controls too.
69
+ const textSize = size === "sm" ? "text-[13px] leading-[1.2]" : "text-base leading-[1.2] sm:text-[15px] sm:leading-[1.2]";
70
+ const stacked = steppers === "stacked";
71
+ // The roll overlay sits where the input's text does.
72
+ const textAlign = stacked ? stackedRoll[size] : "";
73
+ /*
74
+ * Uncontrolled, the value is kept here rather than inside Base UI, which has no reset of its own:
75
+ * a form's reset puts the default back, as it does a native input's.
76
+ */
77
+ const controlled = valueProp !== undefined;
78
+ const [own, setOwn] = React.useState(defaultValue ?? null);
79
+ const value = controlled ? valueProp : own;
80
+ const input = React.useRef(null);
81
+ const reset = React.useRef(() => { });
82
+ reset.current = () => {
83
+ if (!controlled)
84
+ setOwn(defaultValue ?? null);
85
+ };
86
+ React.useEffect(() => {
87
+ const form = input.current?.form;
88
+ if (!form)
89
+ return;
90
+ const onReset = () => reset.current();
91
+ form.addEventListener("reset", onReset);
92
+ return () => form.removeEventListener("reset", onReset);
93
+ }, []);
94
+ /* The digit roll: remember the text and direction of a step, read the new text once it renders. */
95
+ const pending = React.useRef(null);
96
+ const [roll, setRoll] = React.useState(null);
97
+ // A step re-renders this wrapper so the effect below runs, even if a controlling parent doesn't.
98
+ const [, setStepped] = React.useState(0);
99
+ const endRoll = React.useCallback(() => setRoll(null), []);
100
+ React.useLayoutEffect(() => {
101
+ const step = pending.current;
102
+ const el = input.current;
103
+ if (!step || !el)
104
+ return;
105
+ pending.current = null;
106
+ if (el.value !== step.from)
107
+ setRoll({ from: step.from, to: el.value, dir: step.dir, key: performance.now() });
108
+ });
109
+ /*
110
+ * The caret. A mouse press on a stepper or the scrub label moves focus into the input (Base UI
111
+ * does this so the arrow keys keep stepping), but a blinking caret there reads as "type here".
112
+ * It stays hidden until the number itself is clicked or the text is edited.
113
+ */
114
+ const [caretHidden, setCaretHidden] = React.useState(false);
115
+ const hideCaret = (e) => {
116
+ if (e.pointerType !== "touch")
117
+ setCaretHidden(true);
118
+ };
119
+ const showCaret = () => setCaretHidden(false);
120
+ const handleValueChange = (next, details) => {
121
+ const before = value;
122
+ if (input.current &&
123
+ STEP_REASONS.has(details.reason) &&
124
+ next != null &&
125
+ before != null &&
126
+ next !== before &&
127
+ !reducedMotion()) {
128
+ // During a running roll the input text is the value it is rolling to: the next roll starts there.
129
+ pending.current = { from: input.current.value, dir: next > before ? 1 : -1 };
130
+ setStepped((n) => n + 1);
131
+ }
132
+ onValueChange?.(next, details);
133
+ if (!controlled && !details.isCanceled)
134
+ setOwn(next);
135
+ };
136
+ const stepper = cn("inline-flex shrink-0 cursor-pointer items-center justify-center text-foreground focus-ring", "data-disabled:pointer-events-none data-disabled:opacity-50");
137
+ // Stacked, the halves keep the key's 7px outer corners and meet square in the middle.
138
+ const decrement = (_jsx(BaseNumberField.Decrement, { "data-slot": "number-field-decrement", "aria-label": decrementLabel ?? text.decrement, onPointerDown: hideCaret, className: cn(stepper, stacked
139
+ ? cn("min-h-0 w-full flex-1 rounded-b-item",
140
+ // 12px, or half the key in a theme with smaller controls.
141
+ size === "sm"
142
+ ? "[&_svg]:size-[min(12px,calc(var(--control-inset-sm)/2))]"
143
+ : "[&_svg]:size-[min(12px,calc(var(--control-inset)/2))]", size === "sm" ? "material-row" : "material-raised")
144
+ : cn("rounded-full [&_svg]:size-3.5", stepperSizes[size])), children: stacked ? _jsx(ChevronDownIcon, {}) : _jsx(MinusIcon, {}) }));
145
+ const increment = (_jsx(BaseNumberField.Increment, { "data-slot": "number-field-increment", "aria-label": incrementLabel ?? text.increment, onPointerDown: hideCaret, className: cn(stepper, stacked
146
+ ? cn("min-h-0 w-full flex-1 rounded-t-item",
147
+ // 12px, or half the key in a theme with smaller controls.
148
+ size === "sm"
149
+ ? "[&_svg]:size-[min(12px,calc(var(--control-inset-sm)/2))]"
150
+ : "[&_svg]:size-[min(12px,calc(var(--control-inset)/2))]", size === "sm" ? "material-row" : "material-raised")
151
+ : cn("rounded-full [&_svg]:size-3.5", stepperSizes[size])), children: stacked ? _jsx(ChevronUpIcon, {}) : _jsx(PlusIcon, {}) }));
152
+ return (_jsxs(BaseNumberField.Root, { "data-slot": "number-field", "data-size": size, "data-steppers": steppers, id: id, className: sx("flex flex-col items-start gap-2", className), value: value, onValueChange: handleValueChange, locale: localeProp ?? locale, ...props, children: [label != null && (_jsxs(BaseNumberField.ScrubArea, { "data-slot": "number-field-scrub-area", onPointerDown: hideCaret, className: "cursor-ew-resize select-none data-disabled:cursor-not-allowed data-disabled:opacity-55", children: [_jsx("label", { htmlFor: id, className: "cursor-ew-resize text-sm leading-snug font-medium text-foreground select-none", children: label }), _jsx(BaseNumberField.ScrubAreaCursor, { className: "text-foreground drop-shadow-[0_1px_1px_#0006]", children: _jsx(MoveHorizontalIcon, { className: "size-5" }) })] })), _jsxs(BaseNumberField.Group, { "data-slot": "number-field-group", className: cn("flex w-full material-field items-center gap-1 rounded-control",
153
+ // The whole group already dims when disabled; do not dim the steppers twice.
154
+ "data-disabled:[&_button]:opacity-100", groupSizes[size]), children: [!stacked && decrement, _jsxs("span", { className: "relative flex min-w-0 flex-1 items-center self-stretch", children: [_jsx(BaseNumberField.Input, { ref: input, "data-slot": "number-field-input", placeholder: placeholder, "aria-roledescription": text.roleDescription, onPointerDown: showCaret, onBlur: showCaret, onKeyDown: (e) => {
155
+ // While an IME composes (229 marks it in Safari), its keys pick characters: they
156
+ // don't step, or commit a half-typed number.
157
+ if (e.nativeEvent.isComposing || e.keyCode === 229)
158
+ return e.preventBaseUIHandler();
159
+ if (caretHidden && !STEP_KEYS.has(e.key))
160
+ showCaret();
161
+ }, className: cn("w-full min-w-0 bg-transparent font-mono text-foreground tabular-nums outline-none placeholder:text-control-muted", stacked ? stackedInput[size] : "text-center", caretHidden ? "caret-transparent" : "caret-foreground", textSize,
162
+ // While the digits roll, the overlay draws them; the input keeps its caret and value.
163
+ roll && "text-transparent") }), roll && (_jsx(DigitRoll, { roll: roll, slot: "number-field-roll", className: cn(textSize, textAlign), onDone: endRoll }, roll.key))] }), stacked ? (_jsxs("span", { "data-slot": "number-field-steppers", className: cn("flex shrink-0 flex-col", stackSizes[size]), children: [increment, decrement] })) : (increment)] })] }));
164
+ }
@@ -0,0 +1,48 @@
1
+ import { OTPField as BaseOTPField } from "@base-ui/react/otp-field";
2
+ import * as React from "react";
3
+ export interface OtpFieldMessages {
4
+ /** The name of every generated slot after the first, which takes the field's label. */
5
+ character: (index: number, length: number) => string;
6
+ }
7
+ declare module "./locale" {
8
+ interface Messages {
9
+ otpField: OtpFieldMessages;
10
+ }
11
+ }
12
+ declare const slotSizes: {
13
+ readonly default: "h-(--control-h) max-w-(--control-h) text-base";
14
+ readonly lg: "h-(--control-h-lg) max-w-(--control-h-lg) text-lg";
15
+ };
16
+ type OtpFieldSize = keyof typeof slotSizes;
17
+ export interface OtpFieldProps extends BaseOTPField.Root.Props {
18
+ /** `default` 38px slots; `lg` 46px slots for a code entry that is the whole screen. */
19
+ size?: OtpFieldSize;
20
+ /**
21
+ * Split the generated slots into chunks of this many, with a separator between them
22
+ * (`3` renders a 6-digit code as 123 – 456). Ignored when you pass your own children.
23
+ */
24
+ groupSize?: number;
25
+ /** The generated slots' names. A LocaleProvider sets them for every OtpField. */
26
+ labels?: Partial<OtpFieldMessages>;
27
+ ref?: React.Ref<HTMLDivElement>;
28
+ /** The first slot's input. Hand it a form library's ref (React Hook Form's `field.ref`) so it can focus the code. */
29
+ inputRef?: React.Ref<HTMLInputElement>;
30
+ }
31
+ /**
32
+ * OtpField — a one-time code entry: one recessed square per character, mono digits.
33
+ *
34
+ * With no children it renders `length` slots for you, labelled "Character n of N" after the
35
+ * first. Label it with `<FieldLabel>` inside a `<Field>` (or a native `<label htmlFor={id}>`)
36
+ * and say where the code was sent in a `<FieldDescription>`. The rule people break: hiding
37
+ * paste — users copy codes from email, so never block it or split it across separate fields.
38
+ * The focus ring is one indicator that glides from slot to slot as the code is typed or erased.
39
+ * The slots read left to right on a right-to-left page too, as the code does in the message.
40
+ */
41
+ export declare function OtpField({ size, groupSize, length, className, children, ref, inputRef, value: valueProp, defaultValue, onValueChange, labels, ...props }: OtpFieldProps): React.JSX.Element;
42
+ export interface OtpFieldSlotProps extends BaseOTPField.Input.Props {
43
+ }
44
+ /** One character slot. Use directly only for custom layouts; `OtpField` renders them by default. */
45
+ export declare function OtpFieldSlot({ className, ...props }: OtpFieldSlotProps): React.JSX.Element;
46
+ /** A short rule between groups of slots. Decorative for sighted users, announced as a separator. */
47
+ export declare function OtpFieldSeparator({ className, ...props }: React.ComponentProps<typeof BaseOTPField.Separator>): React.JSX.Element;
48
+ export {};
@@ -0,0 +1,102 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { DirectionProvider } from "@base-ui/react/direction-provider";
4
+ import { OTPField as BaseOTPField } from "@base-ui/react/otp-field";
5
+ import * as React from "react";
6
+ import { cn, sx } from "../lib/cn.js";
7
+ import { glideMotion, glideStyle, useGlide, useMergedRef } from "../lib/glide.js";
8
+ import { useMessages } from "./locale.js";
9
+ const defaultMessages = {
10
+ character: (index, length) => `Character ${index} of ${length}`,
11
+ };
12
+ const SLOT = '[data-slot="otp-field-slot"]';
13
+ const findFocused = (root) => root.querySelector(`${SLOT}:focus`);
14
+ /* Square while there is room; narrower (never shorter) where the row has less, as on a phone. */
15
+ const slotSizes = {
16
+ default: "h-(--control-h) max-w-(--control-h) text-base",
17
+ lg: "h-(--control-h-lg) max-w-(--control-h-lg) text-lg",
18
+ };
19
+ const SizeContext = React.createContext("default");
20
+ /**
21
+ * OtpField — a one-time code entry: one recessed square per character, mono digits.
22
+ *
23
+ * With no children it renders `length` slots for you, labelled "Character n of N" after the
24
+ * first. Label it with `<FieldLabel>` inside a `<Field>` (or a native `<label htmlFor={id}>`)
25
+ * and say where the code was sent in a `<FieldDescription>`. The rule people break: hiding
26
+ * paste — users copy codes from email, so never block it or split it across separate fields.
27
+ * The focus ring is one indicator that glides from slot to slot as the code is typed or erased.
28
+ * The slots read left to right on a right-to-left page too, as the code does in the message.
29
+ */
30
+ export function OtpField({ size = "default", groupSize, length, className, children, ref, inputRef, value: valueProp, defaultValue, onValueChange, labels, ...props }) {
31
+ const text = useMessages("otpField", defaultMessages, labels);
32
+ const [rootRef, setRootRef] = useMergedRef(ref);
33
+ React.useImperativeHandle(inputRef, () => rootRef.current.querySelector(SLOT), [
34
+ rootRef,
35
+ ]);
36
+ const glide = useGlide(rootRef, findFocused, { events: ["focusin", "focusout"], items: SLOT });
37
+ /*
38
+ * Uncontrolled, the code is kept here rather than inside Base UI, which has no reset of its own:
39
+ * a form's reset puts the default back, as it does a native input's.
40
+ */
41
+ const controlled = valueProp !== undefined;
42
+ const [own, setOwn] = React.useState(defaultValue ?? "");
43
+ const reset = React.useRef(() => { });
44
+ reset.current = () => {
45
+ if (!controlled)
46
+ setOwn(defaultValue ?? "");
47
+ };
48
+ React.useEffect(() => {
49
+ const form = rootRef.current?.querySelector("input")?.form;
50
+ if (!form)
51
+ return;
52
+ const onReset = () => reset.current();
53
+ form.addEventListener("reset", onReset);
54
+ return () => form.removeEventListener("reset", onReset);
55
+ }, [rootRef]);
56
+ let content = children;
57
+ if (content == null) {
58
+ const slots = Array.from({ length }, (_, index) => (_jsx(OtpFieldSlot, { "aria-label": index === 0 ? undefined : text.character(index + 1, length) }, index)));
59
+ if (groupSize && groupSize > 0 && groupSize < length) {
60
+ const chunks = [];
61
+ for (let start = 0; start < length; start += groupSize) {
62
+ if (start > 0)
63
+ chunks.push(_jsx(OtpFieldSeparator, {}, `separator-${start}`));
64
+ chunks.push(_jsx("div", { "data-slot": "otp-field-group", className: "flex min-w-0 gap-2", children: slots.slice(start, start + groupSize) }, `group-${start}`));
65
+ }
66
+ content = chunks;
67
+ }
68
+ else {
69
+ content = slots;
70
+ }
71
+ }
72
+ return (_jsx(SizeContext.Provider, { value: size, children: _jsxs(BaseOTPField.Root, { "data-slot": "otp-field", "data-size": size, "data-glide": glide.visible ? "" : undefined, ref: setRootRef, length: length, value: controlled ? valueProp : own, onValueChange: (next, details) => {
73
+ onValueChange?.(next, details);
74
+ if (!controlled && !details.isCanceled)
75
+ setOwn(next);
76
+ },
77
+ // A code reads left to right, as in the email it came in, also on a right-to-left page:
78
+ // the slots keep that order, and sit at the field's start (the right) there.
79
+ dir: "ltr", className: sx("group/otp relative flex min-w-0 items-center gap-2 data-disabled:opacity-55 [:dir(rtl)>&]:justify-end", className), ...props, children: [_jsx("span", { "aria-hidden": true, "data-slot": "otp-field-indicator", "data-visible": glide.visible ? "" : undefined, "data-instant": glide.instant ? "" : undefined, className: cn(glideMotion, "z-10 rounded-control border border-control-focus outline-2 outline-control-focus duration-[calc(var(--duration)*1.3)]"), style: glideStyle(glide) }), _jsx(DirectionProvider, { direction: "ltr", children: content })] }) }));
80
+ }
81
+ /** One character slot. Use directly only for custom layouts; `OtpField` renders them by default. */
82
+ export function OtpFieldSlot({ className, ...props }) {
83
+ const size = React.useContext(SizeContext);
84
+ return (_jsx(BaseOTPField.Input, { "data-slot": "otp-field-slot", className: sx([
85
+ "m-0 material-field rounded-control p-0 text-center font-mono text-foreground tabular-nums caret-transparent",
86
+ // A percentage width with a cap: 38px (46px) where it fits, and a share of a narrower row
87
+ // — a form control's percentage width doesn't count towards the row's minimum width, so
88
+ // eight slots on a 360px phone narrow instead of pushing the page sideways.
89
+ "w-full min-w-0",
90
+ "data-disabled:cursor-not-allowed",
91
+ // A filled slot selects its character on focus so typing replaces it; the focus ring
92
+ // already marks the slot, so the selection itself stays unpainted.
93
+ "selection:bg-transparent selection:text-foreground",
94
+ // The gliding indicator draws the focus ring once it is placed.
95
+ "group-data-glide/otp:focus:border-field-edge group-data-glide/otp:focus:outline-none",
96
+ slotSizes[size],
97
+ ], className), ...props }));
98
+ }
99
+ /** A short rule between groups of slots. Decorative for sighted users, announced as a separator. */
100
+ export function OtpFieldSeparator({ className, ...props }) {
101
+ return (_jsx(BaseOTPField.Separator, { "data-slot": "otp-field-separator", className: sx("h-px w-3 shrink-0 bg-field-edge", className), ...props }));
102
+ }
@@ -0,0 +1,37 @@
1
+ import * as React from "react";
2
+ export interface PaginationMessages {
3
+ nav: string;
4
+ previous: string;
5
+ next: string;
6
+ page: (page: number) => string;
7
+ }
8
+ declare module "./locale" {
9
+ interface Messages {
10
+ pagination: PaginationMessages;
11
+ }
12
+ }
13
+ export interface PaginationProps extends Omit<React.ComponentProps<"nav">, "onChange"> {
14
+ /** The current page, 1-based. */
15
+ page: number;
16
+ /** Total number of pages. */
17
+ pageCount: number;
18
+ /** Called with the new page. Omit when every page is a link (`getHref`). */
19
+ onPageChange?: (page: number) => void;
20
+ /** Render pages as links instead of buttons. */
21
+ getHref?: (page: number) => string;
22
+ /** Pages shown on each side of the current one. Defaults to 1. */
23
+ siblingCount?: number;
24
+ /** `sm` 30px for dense tables and admin screens; `default` 38px. */
25
+ size?: "sm" | "default";
26
+ /** Accessible names; a LocaleProvider sets them for every Pagination. */
27
+ labels?: Partial<PaginationMessages>;
28
+ }
29
+ /**
30
+ * Pagination — move through a long list one page at a time.
31
+ *
32
+ * Raised 30 or 38px squares with mono, tabular numbers. The current page is raised on the
33
+ * hovered fill and carries the `--control-focus` edge, which glides to the new page on change. The rule people break: paginating
34
+ * something short. Under ~50 rows, show them all; a table with `dense` rows is easier to scan
35
+ * than a page switcher.
36
+ */
37
+ export declare function Pagination({ page, pageCount, onPageChange, getHref, siblingCount, size, labels, className, ref, ...props }: PaginationProps): React.JSX.Element;
@@ -0,0 +1,81 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { ChevronLeftIcon, ChevronRightIcon } from "lucide-react";
4
+ import * as React from "react";
5
+ import { cn } from "../lib/cn.js";
6
+ import { glideMotion, glideStyle, useGlide, useMergedRef } from "../lib/glide.js";
7
+ import { Button } from "./button.js";
8
+ import { useMessages } from "./locale.js";
9
+ const defaultMessages = {
10
+ nav: "Pagination",
11
+ previous: "Previous page",
12
+ next: "Next page",
13
+ page: (page) => `Page ${page}`,
14
+ };
15
+ const PAGE = '[data-slot="pagination-page"]';
16
+ const findCurrent = (nav) => nav.querySelector(`${PAGE}[aria-current="page"]`);
17
+ function getPages(page, count, siblings) {
18
+ // first, last, current ± siblings, two ellipses → a constant width
19
+ const total = siblings * 2 + 5;
20
+ if (count <= total)
21
+ return Array.from({ length: count }, (_, i) => i + 1);
22
+ const start = Math.max(2, page - siblings);
23
+ const end = Math.min(count - 1, page + siblings);
24
+ const showStart = start > 3;
25
+ const showEnd = end < count - 2;
26
+ const range = (a, b) => Array.from({ length: b - a + 1 }, (_, i) => a + i);
27
+ if (!showStart && showEnd)
28
+ return [...range(1, siblings * 2 + 3), "ellipsis-end", count];
29
+ if (showStart && !showEnd)
30
+ return [1, "ellipsis-start", ...range(count - (siblings * 2 + 2), count)];
31
+ return [1, "ellipsis-start", ...range(start, end), "ellipsis-end", count];
32
+ }
33
+ /**
34
+ * Pagination — move through a long list one page at a time.
35
+ *
36
+ * Raised 30 or 38px squares with mono, tabular numbers. The current page is raised on the
37
+ * hovered fill and carries the `--control-focus` edge, which glides to the new page on change. The rule people break: paginating
38
+ * something short. Under ~50 rows, show them all; a table with `dense` rows is easier to scan
39
+ * than a page switcher.
40
+ */
41
+ export function Pagination({ page, pageCount, onPageChange, getHref, siblingCount = 1, size = "default", labels, className, ref, ...props }) {
42
+ const [navRef, setNavRef] = useMergedRef(ref);
43
+ const glide = useGlide(navRef, findCurrent, { attributes: ["aria-current"], items: PAGE });
44
+ // A count straight from a division (95 rows / 10) rounds up; one that is not a number yet, or
45
+ // not finite (a page size of 0), or below zero is no pages at all.
46
+ const count = Number.isFinite(pageCount)
47
+ ? Math.min(Math.max(Math.ceil(pageCount), 0), Number.MAX_SAFE_INTEGER)
48
+ : 0;
49
+ // A page outside 1…pageCount (a filter shrank the list under it), or not a whole number, shows as
50
+ // the nearest one, so a page still reads as current and Previous and Next still lead somewhere.
51
+ // Choosing a page reports it whenever it differs from `page` itself.
52
+ const current = Number.isNaN(page) ? 1 : Math.min(Math.max(Math.floor(page), 1), Math.max(count, 1));
53
+ const siblings = siblingCount >= 0 ? Math.floor(siblingCount) : 1;
54
+ const pages = getPages(current, count, siblings);
55
+ const square = size === "sm" ? "min-w-(--control-h-sm) px-2" : "min-w-(--control-h) px-2.5";
56
+ // Previous and Next are exactly square at any control height, not as wide as chevron + padding.
57
+ const arrow = size === "sm" ? "w-(--control-h-sm) px-0" : "w-(--control-h) px-0";
58
+ const text = useMessages("pagination", defaultMessages, labels);
59
+ const control = (target, content, extra) => {
60
+ const disabled = target < 1 || target > count;
61
+ const asLink = getHref && !disabled;
62
+ return (_jsx(Button, { variant: "secondary", size: size, disabled: disabled,
63
+ // Previous and Next stay focusable when they run out, so pressing Next onto the last
64
+ // page leaves keyboard focus on it instead of dropping it to the page.
65
+ focusableWhenDisabled: true, nativeButton: !asLink, render: asLink ? _jsx("a", { href: getHref(target) }) : undefined, onClick: () => !disabled && target !== page && onPageChange?.(target), className: cn(square, "font-mono text-[13px] leading-none font-normal tabular-nums"), ...extra, children: content }));
66
+ };
67
+ return (_jsxs("nav", { "aria-label": text.nav, "data-slot": "pagination", "data-size": size, "data-glide": glide.visible ? "" : undefined, ref: setNavRef, className: cn("group/pagination relative flex", className), ...props, children: [_jsx("span", { "aria-hidden": true, "data-slot": "pagination-indicator", "data-visible": glide.visible ? "" : undefined, "data-instant": glide.instant ? "" : undefined, className: cn(glideMotion, "z-10 rounded-button ring-1 ring-control-focus duration-[calc(var(--duration)*1.3)]"), style: glideStyle(glide) }), _jsxs("ul", { className: "m-0 flex list-none flex-wrap items-center gap-1.5 p-0 [&>li]:flex", children: [_jsx("li", { children: control(current - 1, _jsx(ChevronLeftIcon, { className: "rtl:-scale-x-100" }), {
68
+ "aria-label": text.previous,
69
+ className: arrow,
70
+ }) }), pages.map((p) => typeof p === "number" ? (_jsx("li", { children: control(p, p, {
71
+ "aria-label": text.page(p),
72
+ "aria-current": p === current ? "page" : undefined,
73
+ "data-slot": "pagination-page",
74
+ className: cn(square, "font-mono text-[13px] leading-none font-normal tabular-nums", "aria-[current=page]:bg-control-hover aria-[current=page]:shadow-raised-current",
75
+ // The gliding indicator carries the focus edge once it is placed.
76
+ "group-data-glide/pagination:aria-[current=page]:shadow-raised"),
77
+ }) }, p)) : (_jsx("li", { "aria-hidden": true, "data-slot": "pagination-ellipsis", className: cn("inline-flex items-center justify-center font-mono text-[13px] text-muted-foreground", square), children: "\u2026" }, p))), _jsx("li", { children: control(current + 1, _jsx(ChevronRightIcon, { className: "rtl:-scale-x-100" }), {
78
+ "aria-label": text.next,
79
+ className: arrow,
80
+ }) })] })] }));
81
+ }