@eifi1/ui-kit 0.10.0 → 0.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (382) hide show
  1. package/README.md +66 -37
  2. package/dist/chart.d.ts +3 -1
  3. package/dist/chart.js +2 -0
  4. package/dist/chart.js.map +1 -1
  5. package/dist/components/account-settings-labels.d.ts +105 -0
  6. package/dist/components/account-settings-labels.js +81 -0
  7. package/dist/components/account-settings-labels.js.map +1 -0
  8. package/dist/components/account-settings.d.ts +36 -52
  9. package/dist/components/account-settings.js +44 -8
  10. package/dist/components/account-settings.js.map +1 -1
  11. package/dist/components/alert-banner.d.ts +26 -1
  12. package/dist/components/alert-banner.js +10 -7
  13. package/dist/components/alert-banner.js.map +1 -1
  14. package/dist/components/amount-input.d.ts +26 -4
  15. package/dist/components/amount-input.js +5 -2
  16. package/dist/components/amount-input.js.map +1 -1
  17. package/dist/components/authed-image.d.ts +68 -0
  18. package/dist/components/authed-image.js +117 -0
  19. package/dist/components/authed-image.js.map +1 -0
  20. package/dist/components/breadcrumbs.d.ts +2 -1
  21. package/dist/components/breadcrumbs.js +5 -2
  22. package/dist/components/breadcrumbs.js.map +1 -1
  23. package/dist/components/bulk-action-bar.d.ts +51 -5
  24. package/dist/components/bulk-action-bar.js +88 -41
  25. package/dist/components/bulk-action-bar.js.map +1 -1
  26. package/dist/components/button-group.d.ts +107 -3
  27. package/dist/components/button-group.js +60 -5
  28. package/dist/components/button-group.js.map +1 -1
  29. package/dist/components/calculator.d.ts +17 -4
  30. package/dist/components/calendar-heatmap.d.ts +162 -0
  31. package/dist/components/calendar-heatmap.js +336 -0
  32. package/dist/components/calendar-heatmap.js.map +1 -0
  33. package/dist/components/chip.d.ts +2 -1
  34. package/dist/components/chip.js +6 -3
  35. package/dist/components/chip.js.map +1 -1
  36. package/dist/components/choice-card.d.ts +66 -2
  37. package/dist/components/choice-card.js +108 -1
  38. package/dist/components/choice-card.js.map +1 -1
  39. package/dist/components/combobox-core.js +2 -0
  40. package/dist/components/combobox-core.js.map +1 -1
  41. package/dist/components/combobox.d.ts +2 -2
  42. package/dist/components/combobox.js +31 -9
  43. package/dist/components/combobox.js.map +1 -1
  44. package/dist/components/copy-button.d.ts +52 -70
  45. package/dist/components/copy-button.js +1 -1
  46. package/dist/components/copy-button.js.map +1 -1
  47. package/dist/components/data-table-cells.d.ts +63 -0
  48. package/dist/components/data-table-cells.js +64 -0
  49. package/dist/components/data-table-cells.js.map +1 -0
  50. package/dist/components/data-table-filter-popover.d.ts +1 -1
  51. package/dist/components/data-table-filters.d.ts +1 -1
  52. package/dist/components/data-table-filters.js +31 -1
  53. package/dist/components/data-table-filters.js.map +1 -1
  54. package/dist/components/data-table-labels.d.ts +13 -0
  55. package/dist/components/data-table-labels.js +8 -1
  56. package/dist/components/data-table-labels.js.map +1 -1
  57. package/dist/components/data-table.d.ts +1 -1
  58. package/dist/components/data-table.js +104 -12
  59. package/dist/components/data-table.js.map +1 -1
  60. package/dist/components/date-picker.d.ts +3 -1
  61. package/dist/components/date-picker.js +15 -2
  62. package/dist/components/date-picker.js.map +1 -1
  63. package/dist/components/description-list.d.ts +23 -3
  64. package/dist/components/description-list.js +23 -3
  65. package/dist/components/description-list.js.map +1 -1
  66. package/dist/components/dialog-frame.d.ts +1 -0
  67. package/dist/components/entity-combobox.d.ts +1 -1
  68. package/dist/components/entity-combobox.js +18 -3
  69. package/dist/components/entity-combobox.js.map +1 -1
  70. package/dist/components/error-boundary.d.ts +92 -0
  71. package/dist/components/error-boundary.js +111 -0
  72. package/dist/components/error-boundary.js.map +1 -0
  73. package/dist/components/field.d.ts +69 -0
  74. package/dist/components/field.js +75 -0
  75. package/dist/components/field.js.map +1 -0
  76. package/dist/components/file-button.d.ts +51 -208
  77. package/dist/components/file-dropzone.d.ts +50 -2
  78. package/dist/components/floating-panel.d.ts +156 -4
  79. package/dist/components/floating-panel.js +193 -29
  80. package/dist/components/floating-panel.js.map +1 -1
  81. package/dist/components/form-actions.d.ts +53 -0
  82. package/dist/components/form-actions.js +98 -0
  83. package/dist/components/form-actions.js.map +1 -0
  84. package/dist/components/image-grid.d.ts +67 -0
  85. package/dist/components/image-grid.js +112 -0
  86. package/dist/components/image-grid.js.map +1 -0
  87. package/dist/components/lightbox.d.ts +104 -0
  88. package/dist/components/lightbox.js +229 -0
  89. package/dist/components/lightbox.js.map +1 -0
  90. package/dist/components/line-items.d.ts +114 -0
  91. package/dist/components/line-items.js +238 -0
  92. package/dist/components/line-items.js.map +1 -0
  93. package/dist/components/list.d.ts +37 -3
  94. package/dist/components/list.js +39 -14
  95. package/dist/components/list.js.map +1 -1
  96. package/dist/components/loading-state.d.ts +24 -0
  97. package/dist/components/loading-state.js +32 -0
  98. package/dist/components/loading-state.js.map +1 -0
  99. package/dist/components/menu-item.d.ts +13 -2
  100. package/dist/components/menu-item.js +11 -2
  101. package/dist/components/menu-item.js.map +1 -1
  102. package/dist/components/mini-calendar.d.ts +82 -5
  103. package/dist/components/mini-calendar.js +212 -64
  104. package/dist/components/mini-calendar.js.map +1 -1
  105. package/dist/components/modal.d.ts +20 -1
  106. package/dist/components/modal.js +26 -2
  107. package/dist/components/modal.js.map +1 -1
  108. package/dist/components/month-picker.d.ts +21 -1
  109. package/dist/components/month-picker.js +139 -26
  110. package/dist/components/month-picker.js.map +1 -1
  111. package/dist/components/multi-entity-combobox.d.ts +1 -1
  112. package/dist/components/multi-entity-combobox.js +19 -3
  113. package/dist/components/multi-entity-combobox.js.map +1 -1
  114. package/dist/components/nav-pills.d.ts +67 -0
  115. package/dist/components/nav-pills.js +69 -0
  116. package/dist/components/nav-pills.js.map +1 -0
  117. package/dist/components/number-field.d.ts +26 -5
  118. package/dist/components/number-field.js +5 -7
  119. package/dist/components/number-field.js.map +1 -1
  120. package/dist/components/number-input.d.ts +27 -5
  121. package/dist/components/number-input.js +7 -1
  122. package/dist/components/number-input.js.map +1 -1
  123. package/dist/components/numpad-sheet.d.ts +17 -4
  124. package/dist/components/passkeys-setting.d.ts +67 -0
  125. package/dist/components/passkeys-setting.js +214 -0
  126. package/dist/components/passkeys-setting.js.map +1 -0
  127. package/dist/components/picker-sheet.js +2 -1
  128. package/dist/components/picker-sheet.js.map +1 -1
  129. package/dist/components/pie-chart-labels.d.ts +20 -0
  130. package/dist/components/pie-chart-labels.js +12 -0
  131. package/dist/components/pie-chart-labels.js.map +1 -0
  132. package/dist/components/pie-chart.d.ts +101 -0
  133. package/dist/components/pie-chart.js +283 -0
  134. package/dist/components/pie-chart.js.map +1 -0
  135. package/dist/components/progress-bar.d.ts +73 -3
  136. package/dist/components/progress-bar.js +110 -8
  137. package/dist/components/progress-bar.js.map +1 -1
  138. package/dist/components/qr-code.d.ts +34 -0
  139. package/dist/components/qr-code.js +57 -0
  140. package/dist/components/qr-code.js.map +1 -0
  141. package/dist/components/search-field.d.ts +15 -3
  142. package/dist/components/search-field.js +5 -1
  143. package/dist/components/search-field.js.map +1 -1
  144. package/dist/components/series-chart.d.ts +16 -0
  145. package/dist/components/series-chart.js +4 -1
  146. package/dist/components/series-chart.js.map +1 -1
  147. package/dist/components/settings-fields.d.ts +50 -1
  148. package/dist/components/signed-amount.d.ts +121 -0
  149. package/dist/components/signed-amount.js +152 -0
  150. package/dist/components/signed-amount.js.map +1 -0
  151. package/dist/components/skeleton.d.ts +10 -3
  152. package/dist/components/skeleton.js +12 -2
  153. package/dist/components/skeleton.js.map +1 -1
  154. package/dist/components/stat-tile.d.ts +2 -1
  155. package/dist/components/stat-tile.js +5 -2
  156. package/dist/components/stat-tile.js.map +1 -1
  157. package/dist/components/status-dot.d.ts +6 -2
  158. package/dist/components/status-dot.js +6 -1
  159. package/dist/components/status-dot.js.map +1 -1
  160. package/dist/components/table.d.ts +77 -11
  161. package/dist/components/table.js +85 -17
  162. package/dist/components/table.js.map +1 -1
  163. package/dist/components/text-link.d.ts +176 -0
  164. package/dist/components/text-link.js +109 -0
  165. package/dist/components/text-link.js.map +1 -0
  166. package/dist/components/text.d.ts +8 -1
  167. package/dist/components/text.js +1 -0
  168. package/dist/components/text.js.map +1 -1
  169. package/dist/components/time-input.d.ts +50 -1
  170. package/dist/components/toggle-group.d.ts +28 -0
  171. package/dist/components/toggle-group.js +58 -9
  172. package/dist/components/toggle-group.js.map +1 -1
  173. package/dist/components/toggle-legend.d.ts +36 -3
  174. package/dist/components/toggle-legend.js +49 -0
  175. package/dist/components/toggle-legend.js.map +1 -1
  176. package/dist/components/tooltip.d.ts +11 -3
  177. package/dist/components/tooltip.js +2 -0
  178. package/dist/components/tooltip.js.map +1 -1
  179. package/dist/components/ui.d.ts +52 -729
  180. package/dist/components/ui.js +296 -27
  181. package/dist/components/ui.js.map +1 -1
  182. package/dist/components/use-table-state.d.ts +3 -52
  183. package/dist/components/use-table-state.js +128 -30
  184. package/dist/components/use-table-state.js.map +1 -1
  185. package/dist/components/user-avatar.d.ts +25 -3
  186. package/dist/components/user-avatar.js +32 -3
  187. package/dist/components/user-avatar.js.map +1 -1
  188. package/dist/{data-table-filters-Dh9uF_S-.d.ts → data-table-Drun8Fk9.d.ts} +305 -61
  189. package/dist/data-table.d.ts +2 -1
  190. package/dist/data-table.js +5 -1
  191. package/dist/data-table.js.map +1 -1
  192. package/dist/feedback/feedback-dialog.d.ts +26 -3
  193. package/dist/feedback/feedback-dialog.js +16 -2
  194. package/dist/feedback/feedback-dialog.js.map +1 -1
  195. package/dist/feedback/feedback-thread.d.ts +133 -0
  196. package/dist/feedback/feedback-thread.js +237 -0
  197. package/dist/feedback/feedback-thread.js.map +1 -0
  198. package/dist/feedback.d.ts +2 -1
  199. package/dist/feedback.js +1 -0
  200. package/dist/feedback.js.map +1 -1
  201. package/dist/hooks/use-authed-src.d.ts +71 -0
  202. package/dist/hooks/use-authed-src.js +63 -0
  203. package/dist/hooks/use-authed-src.js.map +1 -0
  204. package/dist/hooks/use-file-drop.d.ts +50 -2
  205. package/dist/hooks/use-hotkey.d.ts +59 -0
  206. package/dist/hooks/use-hotkey.js +105 -0
  207. package/dist/hooks/use-hotkey.js.map +1 -0
  208. package/dist/hooks/use-search-param-state.d.ts +83 -0
  209. package/dist/hooks/use-search-param-state.js +94 -0
  210. package/dist/hooks/use-search-param-state.js.map +1 -0
  211. package/dist/i18n/defaults.d.ts +17 -4
  212. package/dist/i18n/defaults.js +33 -1
  213. package/dist/i18n/defaults.js.map +1 -1
  214. package/dist/i18n/kit-labels.d.ts +47 -310
  215. package/dist/i18n/kit-labels.js +20 -5
  216. package/dist/i18n/kit-labels.js.map +1 -1
  217. package/dist/i18n/locales/de-CH-informal.d.ts +17 -4
  218. package/dist/i18n/locales/de-CH.d.ts +17 -4
  219. package/dist/i18n/locales/de-informal.d.ts +17 -4
  220. package/dist/i18n/locales/de.d.ts +17 -4
  221. package/dist/i18n/locales/de.js +165 -4
  222. package/dist/i18n/locales/de.js.map +1 -1
  223. package/dist/i18n/locales/es.d.ts +17 -4
  224. package/dist/i18n/locales/es.js +162 -4
  225. package/dist/i18n/locales/es.js.map +1 -1
  226. package/dist/i18n/locales/fr.d.ts +17 -4
  227. package/dist/i18n/locales/fr.js +162 -4
  228. package/dist/i18n/locales/fr.js.map +1 -1
  229. package/dist/i18n/locales/hu.d.ts +17 -4
  230. package/dist/i18n/locales/hu.js +162 -4
  231. package/dist/i18n/locales/hu.js.map +1 -1
  232. package/dist/i18n/locales/it.d.ts +17 -4
  233. package/dist/i18n/locales/it.js +162 -4
  234. package/dist/i18n/locales/it.js.map +1 -1
  235. package/dist/i18n/locales/zh.d.ts +17 -4
  236. package/dist/i18n/locales/zh.js +162 -4
  237. package/dist/i18n/locales/zh.js.map +1 -1
  238. package/dist/index.d.ts +45 -21
  239. package/dist/index.js +43 -1
  240. package/dist/index.js.map +1 -1
  241. package/dist/kit-labels-v3biUF1L.d.ts +1645 -0
  242. package/dist/lib/clipping.d.ts +21 -5
  243. package/dist/lib/clipping.js +3 -0
  244. package/dist/lib/clipping.js.map +1 -1
  245. package/dist/lib/dates.d.ts +17 -1
  246. package/dist/lib/dates.js +19 -0
  247. package/dist/lib/dates.js.map +1 -1
  248. package/dist/lib/format.d.ts +144 -0
  249. package/dist/lib/format.js +149 -0
  250. package/dist/lib/format.js.map +1 -0
  251. package/dist/lib/qr-encode.d.ts +44 -0
  252. package/dist/lib/qr-encode.js +338 -0
  253. package/dist/lib/qr-encode.js.map +1 -0
  254. package/dist/rhf/fields.d.ts +241 -0
  255. package/dist/rhf/fields.js +601 -0
  256. package/dist/rhf/fields.js.map +1 -0
  257. package/dist/rhf/form.d.ts +50 -1
  258. package/dist/rhf/line-items.d.ts +31 -0
  259. package/dist/rhf/line-items.js +59 -0
  260. package/dist/rhf/line-items.js.map +1 -0
  261. package/dist/rhf/use-rhf-wizard-step.d.ts +22 -0
  262. package/dist/rhf/use-rhf-wizard-step.js +38 -0
  263. package/dist/rhf/use-rhf-wizard-step.js.map +1 -0
  264. package/dist/rhf.d.ts +63 -1
  265. package/dist/rhf.js +3 -0
  266. package/dist/rhf.js.map +1 -1
  267. package/dist/shell/app-shell.d.ts +99 -2
  268. package/dist/shell/app-shell.js +58 -3
  269. package/dist/shell/app-shell.js.map +1 -1
  270. package/dist/shell/auth-layout.d.ts +74 -0
  271. package/dist/shell/auth-layout.js +97 -0
  272. package/dist/shell/auth-layout.js.map +1 -0
  273. package/dist/shell/top-bar-brand.d.ts +81 -0
  274. package/dist/shell/top-bar-brand.js +47 -0
  275. package/dist/shell/top-bar-brand.js.map +1 -0
  276. package/dist/shell/topbar-action-menu.d.ts +84 -3
  277. package/dist/shell/topbar-action-menu.js +115 -27
  278. package/dist/shell/topbar-action-menu.js.map +1 -1
  279. package/dist/shell.d.ts +58 -2
  280. package/dist/shell.js +2 -0
  281. package/dist/shell.js.map +1 -1
  282. package/dist/wizard/stepper-nav.d.ts +49 -1
  283. package/dist/wizard/wizard-context.d.ts +30 -1
  284. package/dist/wizard/wizard-context.js +23 -2
  285. package/dist/wizard/wizard-context.js.map +1 -1
  286. package/dist/wizard/wizard-step.d.ts +20 -5
  287. package/dist/wizard/wizard-step.js +16 -3
  288. package/dist/wizard/wizard-step.js.map +1 -1
  289. package/dist/wizard.d.ts +51 -3
  290. package/package.json +1 -1
  291. package/src/chart.ts +4 -0
  292. package/src/components/account-settings-labels.ts +190 -0
  293. package/src/components/account-settings.tsx +110 -63
  294. package/src/components/alert-banner.tsx +36 -7
  295. package/src/components/amount-input.tsx +13 -1
  296. package/src/components/authed-image.tsx +190 -0
  297. package/src/components/breadcrumbs.tsx +8 -2
  298. package/src/components/bulk-action-bar.tsx +163 -57
  299. package/src/components/button-group.tsx +129 -4
  300. package/src/components/calendar-heatmap.tsx +599 -0
  301. package/src/components/chip.tsx +8 -4
  302. package/src/components/choice-card.tsx +208 -1
  303. package/src/components/combobox-core.tsx +5 -0
  304. package/src/components/combobox.tsx +31 -9
  305. package/src/components/copy-button.tsx +3 -2
  306. package/src/components/data-table-cells.tsx +119 -0
  307. package/src/components/data-table-filters.ts +77 -0
  308. package/src/components/data-table-labels.ts +23 -0
  309. package/src/components/data-table.tsx +231 -13
  310. package/src/components/date-picker.tsx +19 -3
  311. package/src/components/description-list.tsx +52 -3
  312. package/src/components/entity-combobox.tsx +18 -3
  313. package/src/components/error-boundary.tsx +216 -0
  314. package/src/components/field.tsx +188 -0
  315. package/src/components/floating-panel.tsx +380 -16
  316. package/src/components/form-actions.tsx +191 -0
  317. package/src/components/image-grid.tsx +181 -0
  318. package/src/components/lightbox.tsx +374 -0
  319. package/src/components/line-items.tsx +385 -0
  320. package/src/components/list.tsx +93 -18
  321. package/src/components/loading-state.tsx +47 -0
  322. package/src/components/menu-item.tsx +29 -3
  323. package/src/components/mini-calendar.tsx +317 -57
  324. package/src/components/modal.tsx +61 -3
  325. package/src/components/month-picker.tsx +181 -26
  326. package/src/components/multi-entity-combobox.tsx +19 -3
  327. package/src/components/nav-pills.tsx +152 -0
  328. package/src/components/number-field.tsx +15 -10
  329. package/src/components/number-input.tsx +16 -1
  330. package/src/components/passkeys-setting.tsx +331 -0
  331. package/src/components/picker-sheet.tsx +7 -1
  332. package/src/components/pie-chart-labels.ts +32 -0
  333. package/src/components/pie-chart.tsx +479 -0
  334. package/src/components/progress-bar.tsx +241 -13
  335. package/src/components/qr-code.tsx +83 -0
  336. package/src/components/search-field.tsx +20 -4
  337. package/src/components/series-chart.tsx +21 -0
  338. package/src/components/signed-amount.tsx +286 -0
  339. package/src/components/skeleton.tsx +21 -3
  340. package/src/components/stat-tile.tsx +8 -2
  341. package/src/components/status-dot.tsx +10 -2
  342. package/src/components/table.tsx +186 -23
  343. package/src/components/text-link.tsx +248 -0
  344. package/src/components/text.tsx +9 -1
  345. package/src/components/toggle-group.tsx +106 -13
  346. package/src/components/toggle-legend.tsx +87 -2
  347. package/src/components/tooltip.tsx +17 -3
  348. package/src/components/ui.tsx +572 -44
  349. package/src/components/use-table-state.ts +265 -33
  350. package/src/components/user-avatar.tsx +57 -3
  351. package/src/data-table.ts +10 -0
  352. package/src/feedback/feedback-dialog.tsx +42 -3
  353. package/src/feedback/feedback-thread.tsx +434 -0
  354. package/src/feedback.ts +1 -0
  355. package/src/hooks/use-authed-src.ts +161 -0
  356. package/src/hooks/use-hotkey.ts +172 -0
  357. package/src/hooks/use-search-param-state.ts +187 -0
  358. package/src/i18n/defaults.ts +32 -0
  359. package/src/i18n/kit-labels.tsx +104 -8
  360. package/src/i18n/locales/de.ts +162 -0
  361. package/src/i18n/locales/es.ts +159 -0
  362. package/src/i18n/locales/fr.ts +162 -0
  363. package/src/i18n/locales/hu.ts +160 -0
  364. package/src/i18n/locales/it.ts +160 -0
  365. package/src/i18n/locales/zh.ts +159 -0
  366. package/src/index.ts +64 -0
  367. package/src/lib/clipping.ts +22 -4
  368. package/src/lib/dates.ts +37 -0
  369. package/src/lib/format.ts +325 -0
  370. package/src/lib/qr-encode.ts +420 -0
  371. package/src/rhf/fields.tsx +1054 -0
  372. package/src/rhf/line-items.tsx +130 -0
  373. package/src/rhf/use-rhf-wizard-step.ts +113 -0
  374. package/src/rhf.ts +8 -0
  375. package/src/shell/app-shell.tsx +147 -2
  376. package/src/shell/auth-layout.tsx +190 -0
  377. package/src/shell/top-bar-brand.tsx +76 -0
  378. package/src/shell/topbar-action-menu.tsx +260 -49
  379. package/src/shell.ts +2 -0
  380. package/src/wizard/wizard-context.tsx +50 -1
  381. package/src/wizard/wizard-step.tsx +43 -6
  382. package/tokens.css +12 -0
@@ -1,730 +1,53 @@
1
- import * as react from 'react';
2
- import { ButtonHTMLAttributes, Ref, ReactNode, SelectHTMLAttributes, InputHTMLAttributes, ComponentPropsWithoutRef, TextareaHTMLAttributes } from 'react';
3
- import { TooltipSide } from './tooltip.js';
1
+ import 'react';
2
+ import './tooltip.js';
3
+ export { B as Button, a as ButtonClassesOptions, b as ButtonLinkProps, c as ButtonProps, d as ButtonSize, e as ButtonTone, f as ButtonVariant, g as Card, h as CardAction, i as CardActionProps, j as CardContent, k as CardContentProps, l as CardDescription, m as CardDescriptionProps, n as CardFooter, o as CardFooterProps, p as CardHeader, q as CardHeaderProps, r as CardProps, s as CardTitle, t as CardTitleProps, u as CardTone, P as DEFAULT_PASSWORD_REVEAL_LABELS, S as DEFAULT_TABS_LABELS, V as EmptyState, W as EmptyStateProps, X as FIELD_BASE, Y as FIELD_DISPLAY, Z as FIELD_FLOATING_PAD, _ as FIELD_INVALID, $ as FIELD_TRIGGER, a0 as FIELD_WRITABLE_LOOK, a1 as FLOATING_INPUT_CLASS, a2 as FLOATING_LABEL_CLASS, a3 as FLOATING_LABEL_STATIC, a4 as FieldChevron, a5 as FieldChevronProps, a6 as FieldHint, a7 as FieldHintProps, a8 as FieldLabel, a9 as FieldLabelProps, ah as FloatingField, ai as FloatingFieldProps, ap as IconButton, aq as IconButtonGlyphSize, ar as IconButtonProps, as as IconButtonSize, at as IconButtonTone, au as IconButtonVariant, av as Input, aw as InputProps, az as Label, aB as LabelProps, aD as PHONE_QUERY, aE as PasswordRevealLabels, aG as Select, aH as SelectProps, aI as Spinner, aJ as SpinnerProps, aL as TabItem, aM as Tabs, aN as TabsLabels, aO as TabsProps, aP as Textarea, aQ as TextareaProps, aY as buttonClasses, b0 as resolvePasswordRevealLabels } from '../kit-labels-v3biUF1L.js';
4
4
  import '../hooks/use-anchored-rect.js';
5
-
6
- type ButtonVariant = "primary" | "secondary" | "ghost" | "danger" | "brand" | "link";
7
- type ButtonSize = "sm" | "md";
8
- /**
9
- * The text colour of a `link` or `ghost` button, over the variant's own.
10
- *
11
- * `muted` is the QUIET link keksdose hand-rolls in six places (tours-page:321's "Mark
12
- * undone", transaction-fields:176/215's "Add line" / "Fill total",
13
- * invoice-lines-table:376, invoice-review:464): secondary text that darkens to the
14
- * body colour under the pointer, for an action that must be findable but not compete
15
- * with the brand-coloured one beside it. `danger` is the same quiet look turning
16
- * `--danger` on hover — transaction-editor:401's "Remove split", which is a text
17
- * action that destroys something.
18
- *
19
- * A `tone` rather than a `link-muted` variant, because it is the axis IconButton
20
- * already has (`tone="muted"`, `tone="danger"`, same quiet-until-hover meaning), and
21
- * because the same two looks are wanted on `ghost`. The filled and bordered variants
22
- * carry their meaning in the box, not the text, so a tone on them does nothing.
23
- */
24
- type ButtonTone = "default" | "muted" | "danger";
25
- /** The second argument of {@link buttonClasses} in its options form. */
26
- interface ButtonClassesOptions {
27
- /** See {@link ButtonProps.size}. */
28
- size?: ButtonSize;
29
- className?: string;
30
- }
31
- /**
32
- * Button classes for the rare case where the styling must land on a non-`<button>`
33
- * element that {@link Button} can't render — e.g. a router `<Link>` or a Radix
34
- * AlertDialog Action/Cancel (which must stay the Radix element). Everywhere a real
35
- * button works, prefer `<Button>`. Draws from the same base, size and variant maps as
36
- * `<Button>`, so the two stay in lockstep.
37
- *
38
- * The second argument is either the extra classes (the pre-0.8.0 form) or
39
- * `{ size, className }` — `buttonClasses("secondary", { size: "sm" })` for keksdose's
40
- * compact toolbar links.
41
- */
42
- declare function buttonClasses(variant?: ButtonVariant, classNameOrOptions?: string | ButtonClassesOptions): string;
43
- /**
44
- * ⚠️ No default `type`: like a native `<button>`, a `Button` inside a `<form>` SUBMITS
45
- * it unless you pass `type="button"`. Kept native on purpose — a form's own submit
46
- * button relies on it, and changing the default would silently stop those forms from
47
- * submitting. Pass `type="button"` for every other action in a form (keksdose had six
48
- * link buttons submitting their form).
49
- */
50
- interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
51
- variant?: ButtonVariant;
52
- /** `md` (default) is the page's action button. `sm` is the compact one — 12px text
53
- * and `px-2 py-1` — for the secondary actions in a toolbar, a card header or a
54
- * table's header row (keksdose writes `px-2 py-1 text-xs` over `secondary` by hand
55
- * there). Every variant takes either size. */
56
- size?: ButtonSize;
57
- /** In a flex row next to a taller labelled field, fill the field's height so the
58
- * two line up. No effect outside a flex row. */
59
- stretch?: boolean;
60
- /** The `<button>` element. React 19 passes `ref` to a function component as an
61
- * ordinary prop, so it rides `...rest` onto the element with no `forwardRef` —
62
- * declared here only because `ButtonHTMLAttributes` does not carry it. */
63
- ref?: Ref<HTMLButtonElement>;
64
- /** Text colour for `link` and `ghost`: `muted` (quiet, body colour on hover) or
65
- * `danger` (quiet, `--danger` on hover). Ignored by the other variants. See
66
- * {@link ButtonTone}. */
67
- tone?: ButtonTone;
68
- /**
69
- * Make it a toggle button, as {@link IconButton}'s `pressed` does. `true` sets
70
- * `aria-pressed="true"` and draws the "on" look — on a `link`, the brand colour and a
71
- * medium weight; on the boxed variants, the quiet brand fill IconButton uses — and
72
- * `false` sets `aria-pressed="false"` with the ordinary look. Left out, no
73
- * `aria-pressed` (or the caller's own). For lenkbank's "All speeds" text toggle
74
- * (gear/hysteresis-charts.tsx:482), which is a hand-rolled `<button aria-pressed>`
75
- * swapping two class strings; with `variant="link" tone="muted"` it is this.
76
- */
77
- pressed?: boolean;
78
- /**
79
- * Why the action is not available — the button's half of DangerConfirm's
80
- * `lockedReason` (kastlan handover-detail-page.tsx:197 locks a signed handover).
81
- *
82
- * A disabled button that cannot say why is a dead end: the native `disabled` takes it
83
- * out of the tab order, so a keyboard user never lands on it, and a pointer gets a
84
- * `not-allowed` cursor and nothing else. With a reason the button is `aria-disabled`
85
- * instead — still focusable, still hoverable — clicks (and the Enter/Space and form
86
- * submission they stand for) do nothing, and the reason is shown in the kit
87
- * {@link Tooltip} and attached with `aria-describedby`, so a screen reader hears it
88
- * on focus. It wins over `disabled`: passing both keeps the button reachable, which is
89
- * the point of giving a reason.
90
- *
91
- * The description is a `hidden` copy of the reason rather than the bubble itself: the
92
- * bubble exists only while hovered or focused once it is portalled, and a description
93
- * that comes and goes is read inconsistently. The bubble is kept visual, the way
94
- * DangerConfirm keeps its own.
95
- */
96
- disabledReason?: ReactNode;
97
- }
98
- declare function Button({ variant, size, stretch, tone, pressed, disabledReason, className, onClick, ...rest }: ButtonProps): react.JSX.Element;
99
- type IconButtonSize = "lg" | "md" | "sm" | "xs" | "2xs";
100
- type IconButtonTone = "default" | "muted" | "danger" | "warning" | "info";
101
- interface IconButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
102
- /** Any {@link ButtonVariant}, or `overlay` — a round translucent disc for use over
103
- * an image (see `ICON_BUTTON_OVERLAY`). */
104
- variant?: ButtonVariant | "overlay";
105
- /** Box size: lg = 44px (a phone's touch target), md = 36px (matches the top bar),
106
- * sm = 32px — all three with a 20px icon;
107
- * xs = 28px with a 16px icon (an action in a list row), 2xs = 24px with a 14px
108
- * icon (an action on a chip or a tab). */
109
- size?: IconButtonSize;
110
- /** Glyph colour over the variant. `muted`: placeholder grey, full text colour on
111
- * hover. `danger`: the same grey at rest, `--danger` on hover and focus — for a
112
- * remove/delete that repeats down a list. `warning`: amber at rest — a flag that
113
- * wants attention. `info`: sky at rest — a notice-worthy but harmless action
114
- * (keksdose's reconcile). Default: the variant's own colours. See `quiet` for
115
- * turning a coloured tone's resting look the other way. */
116
- tone?: IconButtonTone;
117
- /**
118
- * Whether a coloured tone (`danger`, `warning`, `info`) waits for the pointer:
119
- * `true` is placeholder grey at rest and the tone's colour on hover and focus;
120
- * `false` wears the tone's colour at rest. Left out, each tone keeps its own
121
- * default — `danger` quiet, `warning` and `info` not. Ignored for `muted` (quiet by
122
- * definition) and `default` (no tone).
123
- *
124
- * `quiet={false}` on `danger` is for a destructive action that stands ALONE, where
125
- * hover-to-reveal hides it: keksdose's phone bulk bar (mobile-bulk-bar.tsx) has one
126
- * "delete all" and a touch screen that never hovers, so it painted rose by hand.
127
- * `quiet` on `warning`/`info` is the same switch the other way, for a flag repeated
128
- * down a list. A boolean over the tone rather than a new tone (`danger-solid`) or an
129
- * `emphasis` scale: there are exactly two resting looks, every coloured tone has
130
- * both, and which one fits is a question about the SITE (alone or repeated, touch or
131
- * pointer), not about the tone — so it is one switch the family shares.
132
- */
133
- quiet?: boolean;
134
- /**
135
- * Make it a toggle button. `true` sets `aria-pressed="true"` and draws the "on" look
136
- * (brand glyph on the quiet brand fill); `false` sets `aria-pressed="false"` with the
137
- * normal look, so a screen reader still hears a toggle that is off. Left out, it is
138
- * an ordinary button with no `aria-pressed` — or whatever `aria-pressed` the caller
139
- * passes. For keksdose's budget share toggle (budgets-page:291), which paints its own
140
- * brand colour over a ghost button today. Keep the `aria-label` the same in both
141
- * states ("Share budget"): the pressed state already says whether it is on.
142
- */
143
- pressed?: boolean;
144
- /** Keep the click (and the Enter/Space that produces it) from reaching an
145
- * ancestor's handler — for an action inside a clickable table row or card.
146
- *
147
- * **Not a licence to put this inside another `<button>`.** HTML forbids any
148
- * interactive content, and any element with a `tabindex`, inside a button — so
149
- * the `<span role="button" tabIndex={0}>` workaround is invalid too — and ARIA
150
- * makes a button's children presentational, so a screen reader flattens the
151
- * inner one into the outer one's name and it cannot be reached at all. Make the
152
- * row's main action a button that fills the row and put this one BESIDE it, on
153
- * top:
154
- *
155
- * ```tsx
156
- * <div className="relative">
157
- * <button className="w-full pe-16 …" onClick={open}>…row…</button>
158
- * <div className="absolute inset-y-0 end-2 flex items-center gap-0.5">
159
- * <IconButton size="xs" tone="danger" aria-label="Delete" onClick={remove}>
160
- * <Trash2 />
161
- * </IconButton>
162
- * </div>
163
- * </div>
164
- * ```
165
- *
166
- * The pair look exactly like the nested version, click exactly like it, and
167
- * are two tab stops a screen reader can tell apart. */
168
- stopPropagation?: boolean;
169
- /**
170
- * The button's name, said once: it becomes the `aria-label` AND the text of a kit
171
- * {@link Tooltip} round the button.
172
- *
173
- * Every app writes the pair by hand. lenkbank's nine icon actions all carry
174
- * `aria-label={t(x)} title={t(x)}` (shared/lib/table-columns.tsx:103,
175
- * projects-page.tsx:83, setpoint/segment-list.tsx:198/207, profile-bar.tsx:128/142,
176
- * shortcut-dialog.tsx:815/857/1007) — and `title` is the browser's own tooltip,
177
- * which shows late, never on focus and never on touch, and looks like no other
178
- * label in the kit. kastlan's RowAction (shared/components/data-table/row-action.tsx)
179
- * and keksdose's icon wrappers each exist to put a Tooltip round an IconButton.
180
- *
181
- * A caller's own `aria-label` still wins, for the rare name that should be longer
182
- * than the bubble. The bubble is visual only: it would otherwise describe the button
183
- * with its own name, and a screen reader would read the same word twice. Tooltip's
184
- * default placement applies — in place, or portalled inside a scroll container —
185
- * unless `tooltipPortal` says otherwise.
186
- */
187
- label?: string;
188
- /** Show `label` as a tooltip. Default `true`; `false` keeps `label` as the
189
- * accessible name only — for a button whose glyph is universally read (a close ✕ in
190
- * a dialog header) or that already sits under a tooltip of its own. */
191
- tooltip?: boolean;
192
- /** Where the `label` tooltip opens. See {@link Tooltip}'s `side`. */
193
- tooltipSide?: TooltipSide;
194
- /** Passed to the `label` tooltip's `portal`. Left out, Tooltip decides (see there). */
195
- tooltipPortal?: boolean;
196
- }
197
- declare const IconButton: react.ForwardRefExoticComponent<IconButtonProps & react.RefAttributes<HTMLButtonElement>>;
198
- declare const FIELD_BASE: string;
199
- /** Cancels FIELD_BASE's read-only treatment for a field that is `readOnly` for a
200
- * reason other than "you may not edit this". Attribute-scoped for the same reason
201
- * FIELD_BASE is — the two have to cancel on the identical selector or twMerge
202
- * cannot make the later one win. */
203
- declare const FIELD_WRITABLE_LOOK = "[&[readonly]]:bg-[var(--bg-surface)] [&[readonly]]:text-[var(--text-primary)]";
204
- declare const FIELD_FLOATING_PAD = "pt-4 pb-1";
205
- declare const FIELD_INVALID = "border-[var(--danger-border)] ring-1 ring-[var(--danger-border)] focus:border-[var(--danger)] focus:ring-[var(--danger)]";
206
- declare const FLOATING_INPUT_CLASS: string;
207
- /** The phone breakpoint the display treatment below keys off — the same one the
208
- * numpad sheet uses, kept in one place so the two can't drift apart. */
209
- declare const PHONE_QUERY = "(max-width: 767px)";
210
- /**
211
- * The PHONE display treatment (Keksdose feedback #176, carried across the entry
212
- * forms by #179): the field chrome removed so the ONE input a form is actually
213
- * about reads as the thing itself, not as another boxed row in a stack.
214
- *
215
- * Every control that takes `variant="display"` — {@link Input}, `NumberInput`,
216
- * `AmountInput` — means exactly the same thing by it: the treatment applies below
217
- * {@link PHONE_QUERY} and the field is untouched above it, so a caller never has
218
- * to ask the viewport, and a form can't end up half-treated across breakpoints.
219
- *
220
- * What stays, deliberately:
221
- * - A hairline baseline. With the box gone something still has to say "you can
222
- * type here"; it takes the brand colour on focus, where a bordered field would
223
- * light its whole outline. Each edge is set exactly once (`border-x-0
224
- * border-t-0 border-b`) so the rule can't hinge on utility order.
225
- * - The muted placeholder colour, because a display field is usually empty at
226
- * the moment it matters most and has nothing else to show.
227
- * - The label, moved to `sr-only` rather than dropped: display type is legible
228
- * to the eye, not to a screen reader.
229
- *
230
- * Size and weight are NOT here — an amount wants display type, a subject line
231
- * wants a heading — so each control adds its own on top.
232
- */
233
- declare const FIELD_DISPLAY = "block w-full border-x-0 border-t-0 border-b border-[var(--border)] bg-transparent px-0 pt-0 pb-1 text-[var(--text-primary)] shadow-none placeholder:text-[var(--text-placeholder)] focus:border-[var(--brand)] focus:outline-none focus:ring-0 disabled:opacity-60";
234
- declare const FIELD_TRIGGER: string;
235
- /** An alias rather than an interface: the chevron adds nothing of its own to an
236
- * `<svg>`'s props, and an interface declaring no members is the same type wearing a
237
- * name that suggests otherwise. */
238
- type FieldChevronProps = Omit<ComponentPropsWithoutRef<"svg">, "children">;
239
- /** The dropdown chevron, shared by the native {@link Select} and every custom
240
- * {@link FIELD_TRIGGER} control.
241
- *
242
- * Absolutely positioned and centred on the FIELD box. As an ordinary flex child
243
- * it centres on the *content* box instead, and `FIELD_FLOATING_PAD` (pt-4 pb-1)
244
- * pushes that box's midline down — so a labelled currency/multi-select chevron
245
- * sat visibly lower than the native select's right beside it (feedback #400).
246
- * Pair it with `pe-9` on the trigger so the value can't run underneath. At the
247
- * inline END, not the right: a right-to-left form reads the value from the right,
248
- * and a chevron parked on top of its first word hid exactly the part that says
249
- * what was picked. */
250
- declare function FieldChevron({ className, ...rest }: FieldChevronProps): react.JSX.Element;
251
- declare const FLOATING_LABEL_CLASS: string;
252
- declare const FLOATING_LABEL_STATIC: string;
253
- /**
254
- * The one place that assembles a labelled field: a `relative` wrapper around the
255
- * control (`children`) plus a floating label inside the top strip. Pass `staticLabel`
256
- * for controls that always have a value (selects); omit it for free-text fields whose
257
- * label animates from centred→up. Used by Input/Select/Textarea/NumberInput; the
258
- * dropdown controls that need a ref + menu keep their own wrapper but the same label
259
- * (via {@link FieldLabel}) and trigger ({@link FIELD_TRIGGER}) styles.
260
- */
261
- interface FloatingFieldProps extends ComponentPropsWithoutRef<"div"> {
262
- htmlFor?: string;
263
- label?: ReactNode;
264
- staticLabel?: boolean;
265
- /** Keep the label in the accessibility tree but out of the layout — what
266
- * {@link FIELD_DISPLAY} needs, since a floating label inside a field with no
267
- * field left would have nothing to float in. */
268
- srOnlyLabel?: boolean;
269
- /** Something interactive that belongs to the LABEL rather than to the value —
270
- * in practice a {@link FieldHint} "?" (dev#468). It is rendered in a flex row
271
- * with the label, so it is centred on the label's line by the layout instead
272
- * of by a hand-tuned `top-…`, and it can never drift when the type changes.
273
- *
274
- * It rides an ANIMATED label too, and the two cases place it differently on
275
- * purpose. A static label has a field-wide strip to itself, so the hint sits
276
- * at the far end of it and a long label truncates into the gap. An animated
277
- * one belongs to a control with something at the end edge of the field — a
278
- * calculator, a stepper — so the hint follows the label instead, and it is
279
- * the label that gives way (steering-design feedback #48). */
280
- hint?: ReactNode;
281
- children: ReactNode;
282
- }
283
- declare function FloatingField({ className, htmlFor, label, staticLabel, srOnlyLabel, hint, children, ...rest }: FloatingFieldProps): react.JSX.Element;
284
- /**
285
- * The "?" that explains a field, on the field's own label line (dev#468).
286
- *
287
- * Pass it to a labelled {@link Select} / {@link Input} as `hint`. It exists as a
288
- * component rather than as a snippet each form repeats because the previous
289
- * version was exactly that snippet — an absolutely-positioned button whose
290
- * `top-1.5` was one guess at where an 11px label sits — and the reporter's
291
- * follow-up was *"question mark is not centered. Is it part of the hoc?
292
- * positioning problems seem quite frequently."* It was not part of the HOC. Now
293
- * it is, and there is one place left where the answer can be wrong.
294
- *
295
- * A `<button>` rather than a bare icon: hover alone puts the explanation out of
296
- * reach of a keyboard and of every touch device, and the tooltip shows on focus
297
- * too. The text is also its accessible name, so a screen reader gets it without
298
- * the bubble ever opening.
299
- */
300
- interface FieldHintProps extends Omit<ComponentPropsWithoutRef<"button">, "children"> {
301
- /** The explanation. It is both the tooltip's text and, by default, the button's
302
- * accessible name, so a screen reader gets it without the bubble ever opening. */
303
- label: string;
304
- /** Default `"start"`: before the hint in the reading direction (the left in LTR, the
305
- * right in RTL). `left` / `right` stay physical. */
306
- side?: TooltipSide;
307
- }
308
- declare function FieldHint({ label, side, className, "aria-label": ariaLabel, ...rest }: FieldHintProps): react.JSX.Element;
309
- /**
310
- * The floating label for a custom-dropdown trigger (a `<span>`, since the trigger is a
311
- * button not a labelable input). Same placement as {@link FloatingField}'s static label,
312
- * so every labelled field lines up. Render inside a `relative` wrapper, before the trigger.
313
- */
314
- interface FieldLabelProps extends ComponentPropsWithoutRef<"span"> {
315
- children: ReactNode;
316
- }
317
- declare function FieldLabel({ children, className, ...rest }: FieldLabelProps): react.JSX.Element;
318
- interface LabelProps extends ComponentPropsWithoutRef<"label"> {
319
- /** Draw the required mark after the text. The mark is `aria-hidden`: what a
320
- * screen reader hears is the control's own `required` / `aria-required`, which
321
- * the caller still sets — a "star" read out as the last word of every name is
322
- * noise, and a control that is not marked required is not required however its
323
- * label looks. */
324
- required?: boolean;
325
- /** `sm` for a toolbar or a dense filter row (12px), `md` otherwise (14px). */
326
- size?: "sm" | "md";
327
- /** Dim the label with its control. A label ABOVE its field is not the field's
328
- * `peer`, so `peer-disabled:` cannot reach it the way it reaches a floating one. */
329
- disabled?: boolean;
330
- }
331
- /**
332
- * The label ABOVE a field, for the places a floating label does not fit: a control
333
- * the kit did not render (a third-party picker, a range slider, a group of radios),
334
- * a filter bar whose fields are unlabelled {@link Select}s, a form that sets labels
335
- * above its fields throughout.
336
- *
337
- * A new component rather than a mode of {@link FieldLabel}, because the two share
338
- * nothing but the word. `FieldLabel` is an absolutely positioned `<span>` inside a
339
- * trigger's `relative` box and has to stay exactly that for every dropdown that
340
- * already lines up with it; this is a real `<label>` in normal flow, with `htmlFor`,
341
- * that a click focuses the control through. Spacing below it belongs to the caller's
342
- * layout (`space-y-1.5` on the pair, typically), as it would for any block.
343
- */
344
- declare function Label({ required, size, disabled, className, children, ...rest }: LabelProps): react.JSX.Element;
345
- /** The two names the password reveal toggle can wear. See {@link Input}. */
346
- interface PasswordRevealLabels {
347
- /** While the value is hidden — activating the toggle will show it. */
348
- show: string;
349
- /** While the value is shown. */
350
- hide: string;
351
- }
352
- declare const DEFAULT_PASSWORD_REVEAL_LABELS: PasswordRevealLabels;
353
- /** Caller's labels over the English defaults — the same shape as
354
- * `resolveDataTableLabels`, so a consumer translates every kit string one way. */
355
- declare function resolvePasswordRevealLabels(partial?: Partial<PasswordRevealLabels>): PasswordRevealLabels;
356
- interface InputProps extends InputHTMLAttributes<HTMLInputElement> {
357
- label?: ReactNode;
358
- /** Classes for the `<input>` itself, as distinct from `className`, which
359
- * styles the field WRAPPER once a `label` turns this into a FloatingField.
360
- * Without it a labelled Input had no way to reach its own element — so
361
- * `tabular-nums` on a numeric text field, which NumberInput has supported
362
- * all along through the identically named prop, was simply unavailable. */
363
- inputClassName?: string;
364
- /** {@link FIELD_DISPLAY} — on a phone, drop the chrome and set the value as a
365
- * heading. For the one field a form is about (a feedback subject, an account
366
- * name), never for a stack of them. Labelled fields only: the label is what
367
- * the placeholder falls back to once it goes `sr-only`. */
368
- variant?: "field" | "display";
369
- /** The field is required and unanswered, or holds something that cannot be
370
- * saved — {@link FIELD_INVALID}, the same rose border/ring `Select` has worn
371
- * since feedback #235.
372
- *
373
- * It exists here because writing `aria-invalid` by hand did NOT do this. The
374
- * attribute spreads onto the element and nothing styles it — there is no
375
- * `[aria-invalid]` rule in this package or in either consumer's stylesheet —
376
- * so three Keksdose dialogs flagged a mismatched passphrase to a screen reader
377
- * and painted the field exactly as if it were fine. Setting the prop sets the
378
- * attribute too, so the two can no longer be spelled separately. */
379
- invalid?: boolean;
380
- /** What is wrong with the value, in the caller's own words ("That IBAN has 21
381
- * digits"). Rendered under the field, pointed at by the control's
382
- * `aria-describedby` — MERGED with any the caller already passed — and implies
383
- * `invalid`, so the field paints as well as announces. `invalid` alone still
384
- * covers the case where the message lives elsewhere. See {@link useFieldError}. */
385
- error?: ReactNode;
386
- /** Names for the password reveal toggle, English by default — it is the one
387
- * string this component renders on its own behalf, and a German form was
388
- * reading it out in English. See {@link PasswordRevealLabels}. */
389
- passwordLabels?: Partial<PasswordRevealLabels>;
390
- }
391
- declare const Input: react.ForwardRefExoticComponent<InputProps & react.RefAttributes<HTMLInputElement>>;
392
- interface SelectProps extends Omit<SelectHTMLAttributes<HTMLSelectElement>, "size"> {
393
- label?: ReactNode;
394
- /** See {@link Input}'s `invalid`. */
395
- invalid?: boolean;
396
- /** See {@link Input}'s `error`. */
397
- error?: ReactNode;
398
- /** A {@link FieldHint} for the label line — see {@link FloatingField}. */
399
- hint?: ReactNode;
400
- /**
401
- * `"sm"`: a 28px, 12px-type select for a toolbar or a table header, where the
402
- * 36px field stands a head taller than the buttons beside it. `"md"` (default)
403
- * is the field every form uses. Unlabelled selects only — a floating label needs
404
- * the tall box to float in, so a labelled Select ignores `"sm"`.
405
- *
406
- * A NUMBER is still the native attribute (the rows of a list box) and is passed
407
- * straight through, so the one HTML meaning of `size` keeps working. Above 1 (as
408
- * with `multiple`) the browser draws a list box, and the Select drops its chevron
409
- * and the end padding reserved for it.
410
- */
411
- size?: "sm" | "md" | number;
412
- /** Classes for the `<select>` itself. `className` styles the WRAPPER — the box
413
- * the chevron is positioned against — so it could set a width and nothing
414
- * else; this is the way to the element. See {@link Input}'s `inputClassName`. */
415
- selectClassName?: string;
416
- }
417
- declare const Select: react.ForwardRefExoticComponent<SelectProps & react.RefAttributes<HTMLSelectElement>>;
418
- interface TextareaProps extends TextareaHTMLAttributes<HTMLTextAreaElement> {
419
- label?: ReactNode;
420
- /** See {@link Input}'s `invalid`. */
421
- invalid?: boolean;
422
- /** See {@link Input}'s `error`. */
423
- error?: ReactNode;
424
- }
425
- declare const Textarea: react.ForwardRefExoticComponent<TextareaProps & react.RefAttributes<HTMLTextAreaElement>>;
426
- interface CardProps extends ComponentPropsWithoutRef<"div"> {
427
- children: ReactNode;
428
- /**
429
- * When true, drop the card chrome (border, rounded corners, shadow) on mobile so the
430
- * card spans edge-to-edge. Chrome reappears at the `md` breakpoint. Use for primary
431
- * content cards on data pages; leave off for centered dialog/panel cards.
432
- */
433
- flush?: boolean;
434
- /**
435
- * `inset`: a panel INSIDE a card rather than a card on the page — the raised
436
- * `--bg-surface-2`, a small radius, `p-3` of its own and no border or shadow, since
437
- * it is already sitting on the card that has them. Lenkbank's results blocks and
438
- * corner panels write this by hand (`rounded-md bg-surface-2 p-3`) under a Card of
439
- * their own. Unlike the default card it carries its padding, because every one of
440
- * those copies wanted the same one; a caller's `p-*` still wins. `flush` is ignored:
441
- * an inset panel never runs edge to edge.
442
- */
443
- variant?: "default" | "inset";
444
- }
445
- declare function Card({ className, children, flush, variant, ...rest }: CardProps): react.JSX.Element;
446
- /** The sub-parts add nothing to a `<div>`'s props — they are the SAME element with a
447
- * `data-slot` and a padding rhythm — so each name is an alias rather than an empty
448
- * interface pretending to be more. They exist so a consumer's own wrapper can say
449
- * `CardHeaderProps` instead of `ComponentProps<typeof CardHeader>`. */
450
- type CardHeaderProps = ComponentPropsWithoutRef<"div">;
451
- type CardTitleProps = ComponentPropsWithoutRef<"div">;
452
- type CardDescriptionProps = ComponentPropsWithoutRef<"div">;
453
- type CardActionProps = ComponentPropsWithoutRef<"div">;
454
- type CardContentProps = ComponentPropsWithoutRef<"div">;
455
- type CardFooterProps = ComponentPropsWithoutRef<"div">;
456
- declare function CardHeader({ className, ...props }: CardHeaderProps): react.JSX.Element;
457
- declare function CardTitle({ className, ...props }: CardTitleProps): react.JSX.Element;
458
- declare function CardDescription({ className, ...props }: CardDescriptionProps): react.JSX.Element;
459
- declare function CardAction({ className, ...props }: CardActionProps): react.JSX.Element;
460
- declare function CardContent({ className, ...props }: CardContentProps): react.JSX.Element;
461
- declare function CardFooter({ className, ...props }: CardFooterProps): react.JSX.Element;
462
- /** A `<span>`'s props plus the words a reader hears — see {@link CardHeaderProps}.
463
- * The ring is drawn with a border, so there is nothing inside it to put children in. */
464
- interface SpinnerProps extends Omit<ComponentPropsWithoutRef<"span">, "children"> {
465
- /**
466
- * What the spinner means, for a screen reader. Default: `common.loading` from the
467
- * {@link UiKitProvider}, else "Loading…".
468
- *
469
- * `null` makes it DECORATIVE — no role, no text, hidden from assistive tech. Use it
470
- * whenever words are already there: beside visible "Loading…" text (otherwise it is
471
- * announced twice), inside a labelled button (otherwise its text joins the button's
472
- * name), or inside a live region of the app's own (otherwise that region and this
473
- * one both announce).
474
- */
475
- label?: string | null;
476
- }
477
- /**
478
- * A spinning ring that also SAYS it is loading.
479
- *
480
- * It used to be a bordered span and nothing else, so a reader met no element at all
481
- * where a sighted user saw the page working — or, beside an emptied list, met the
482
- * empty list and concluded there was nothing there. `role="status"` makes it a polite
483
- * live region, and the text inside is what that region announces. Text rather than
484
- * `aria-label`: a live region's announcement is its CONTENT, and several readers
485
- * ignore a name on one.
486
- *
487
- * `relative` so the `sr-only` text has a local containing block (see
488
- * sr-only-containment.test). Where the words are already on screen, pass
489
- * `label={null}`: announcing is right for a spinner standing alone and wrong for one
490
- * beside text, inside a button, or inside the app's own live region.
491
- */
492
- declare function Spinner({ className, label, ...rest }: SpinnerProps): react.JSX.Element;
493
- interface EmptyStateProps extends Omit<ComponentPropsWithoutRef<"div">, "children" | "title"> {
494
- /** The box renders `title` and `hint` in its own two-line rhythm, which is what makes
495
- * every empty state in three apps look like the same thing — so there is no
496
- * `children` slot to put arbitrary content in. The two slots below are the only
497
- * other things an empty state has turned out to need, and each has a fixed place. */
498
- /** Nodes rather than strings, so a title can carry a code, a link or an emphasised
499
- * word — keksdose's error boundary shows the error's name in `<code>` — while the
500
- * box still sets the type. */
501
- title: ReactNode;
502
- hint?: ReactNode;
503
- /**
504
- * Render the title as a heading of this level. Left out it is a `<div>`, as before:
505
- * most empty states are a message inside a section that already has its heading.
506
- * keksdose's error boundary IS the page when it trips, and its `<h2>` went missing
507
- * when it moved onto EmptyState — so the page's heading outline lost the one line
508
- * that says what happened. Only the element changes; the look is the box's.
509
- */
510
- headingAs?: "h2" | "h3" | "h4" | "h5" | "h6";
511
- /** A glyph ABOVE the title — kastlan's InboxEmptyState (an inbox), keksdose's
512
- * offline card (a cloud with a slash). Sized by the box (`[&_svg]:size-8`) and
513
- * muted, so five call sites cannot pick five sizes; hidden from assistive tech,
514
- * because the title already says what it shows. */
515
- icon?: ReactNode;
516
- /** What to do about it, BELOW the hint: keksdose's query-state cards (Retry), its
517
- * error boundary (Retry / Reload / Go home — pass all three in a fragment, they
518
- * wrap and centre as one row), kastlan's "Create a rule". Buttons or links the
519
- * caller renders; the box only places them. */
520
- action?: ReactNode;
521
- /**
522
- * `box` (default): the dashed, padded card that stands in for a whole section.
523
- * `inline`: one quiet line with no box — for the empty state INSIDE something that
524
- * already has its own frame, where a dashed card would be a box in a box. keksdose
525
- * writes that line by hand five times as a muted `<p className="py-6 text-center">`:
526
- * the notification inbox (notification-inbox:140), a support thread
527
- * (support-thread:144), the assistant (assistant-page:321), the admin support panel
528
- * (support-panel:265) and the funding dialog (funding-dialog:89). The icon shrinks
529
- * to the text's size and sits before the title, the hint follows on the same line,
530
- * and the row wraps only when it must. Centred like the box; `className="justify-start"`
531
- * for a list that reads from the start edge (funding-dialog).
532
- */
533
- variant?: "box" | "inline";
534
- /**
535
- * Colour the icon and the title: `danger` for an error standing where the content
536
- * should be — kastlan's ErrorState (shared/components/feedback/error-state.tsx) and
537
- * its error boundary's fallback (error-boundary.tsx:16), both a red triangle over a
538
- * message — and `success` for an empty state that is GOOD news, kastlan's "No defects
539
- * recorded for this room" (handover defects-step.tsx:142, a green check). Left out,
540
- * both stay muted. The hint stays muted either way: it is the explanation, not the
541
- * verdict.
542
- */
543
- tone?: "danger" | "success";
544
- }
545
- declare function EmptyState({ title, hint, icon, action, headingAs, variant, tone, className, ...rest }: EmptyStateProps): react.JSX.Element;
546
- /** One tab of a {@link Tabs} strip. */
547
- interface TabItem<T extends string> {
548
- id: T;
549
- /** A ReactNode so a tab can pair an icon with text. */
550
- label: ReactNode;
551
- /** Optional trailing node (e.g. a count pill). */
552
- badge?: ReactNode;
553
- /** Marks a tab that IS a route — see {@link TabsProps}. */
554
- href?: string;
555
- /** Leading decoration: an icon, or the colour swatches of the lines this tab
556
- * draws in a chart above the strip. Hidden from assistive tech — it repeats
557
- * what the label says, or it says something the label must say instead. */
558
- icon?: ReactNode;
559
- /** A second, smaller line under the label — the one fact that tells two tabs
560
- * with similar labels apart ("80 km/h", "Level 3"). Part of the tab's name. */
561
- detail?: ReactNode;
562
- /** A tab that exists as a slot with nothing in it yet, drawn with a dashed
563
- * outline so a gap in a sequence looks like a gap. Visual only: say "empty" in
564
- * the label or `detail` if a screen reader needs to know. */
565
- empty?: boolean;
566
- /** `false` keeps this one tab when the strip has `onRemove` — the one sheet a
567
- * workbook cannot be without. Default: removable. */
568
- removable?: boolean;
569
- /** Plain-text name for the labels the strip composes about this tab ("Remove
570
- * …"), for when `label` is not a string. Default: `label` if it is a string,
571
- * else the id. */
572
- name?: string;
573
- }
574
- /** The strings the strip renders on its own behalf — only when it can add or
575
- * remove tabs. */
576
- interface TabsLabels {
577
- /** The "add" button's visible text when the caller gives no `addLabel`. */
578
- add: string;
579
- /** Accessible name of a tab's × — "Remove <tab>". */
580
- remove: (tab: string) => string;
581
- }
582
- declare const DEFAULT_TABS_LABELS: TabsLabels;
583
- /**
584
- * The strip's own props sit on a `<div>`: the tablist IS the root element, so anything
585
- * a caller hangs on it — a `data-tour` anchor for the kit's guided tour, a test id, an
586
- * `aria-describedby` — lands there. `onChange` is omitted from the div's props because
587
- * this component's `onChange` hands over the chosen TAB ID, not a DOM event, and
588
- * `children` because the strip renders `tabs` — a caller who wants a PANEL wires it up
589
- * through `panelId`, which is the whole point of that prop.
590
- */
591
- interface TabsProps<T extends string> extends Omit<ComponentPropsWithoutRef<"div">, "onChange" | "children"> {
592
- /** `label` is a ReactNode so tabs can pair an icon with text; `badge` is an
593
- * optional trailing node (e.g. a count pill). `href` marks a tab that IS a route:
594
- * it renders as an anchor so it can be middle-/⌘-clicked into a new tab (Keksdose
595
- * feedback #451), while a plain click still goes through `onChange` and stays
596
- * client-side. Tabs that only flip local state leave it unset — a link to a URL
597
- * that does not select the tab would be worse than no link. */
598
- tabs: TabItem<T>[];
599
- active: T;
600
- onChange: (id: T) => void;
601
- className?: string;
602
- /** Let the strip WRAP onto as many rows as it needs below `md`, instead of
603
- * scrolling sideways — for a strip carrying more tabs than fit on a phone row.
604
- * Keksdose live #262: ten reports on a 406px screen showed about three, and the
605
- * round-2 answer (a <select> below `md`) cost a tap to open and a tap to choose.
606
- * *"I would rather keep the tabs but have multirow tabs depending on the screen
607
- * size, I will not loose the function to see all reports at once and navigate by
608
- * single click rather by double click."*
609
- *
610
- * The active MARKER has to change with the layout, which is why this cannot be
611
- * done from a call site with a `className`: the default marker is a `border-b-2`
612
- * underline riding the container's own bottom rule, and a tab sitting in a row
613
- * that does not touch that rule cannot wear it — every row but the last would
614
- * show a stray line floating mid-strip, and `-mb-px` would pull each chip a
615
- * pixel into the row beneath it. A wrapped strip marks the active tab with a
616
- * filled brand chip instead, which is also the only thing findable at a glance
617
- * among ten same-weight labels on three rows.
618
- *
619
- * From `md` up NOTHING changes: same single-line underline strip, same paddings,
620
- * same colours as every other strip in the app.
621
- *
622
- * Opt-in on purpose. The three-tab strips (invoices, statements, bank imports)
623
- * already fit a phone row, and turning those into chips would be an unrequested
624
- * redesign of three other pages. */
625
- wrap?: boolean;
626
- /**
627
- * Accessible name for the `role="tablist"` container. Every tab carries its own
628
- * text, so this names the GROUP, not the tabs; leave it unset where a visible
629
- * heading immediately above already does that job.
630
- *
631
- * @deprecated Pass `aria-label` instead. This kit had three spellings for one idea
632
- * — `ariaLabel`, `aria-label` and this `label` — and settled on the DOM one, which
633
- * is also the one that arrives for free now that the strip spreads its rest props.
634
- * `label` still works and is unchanged; it names the strip only when `aria-label`
635
- * is absent.
636
- */
637
- label?: string;
638
- /**
639
- * `id` of the element the caller renders the open tab's content into — the missing
640
- * half of `role="tab"`. A tab that controls nothing is a tab in name only: a screen
641
- * reader announces "tab, 2 of 5" and then has no way to take the user to what it
642
- * opened, and no way back.
643
- *
644
- * **This component does not render the panel, on purpose.** `Tabs` is the STRIP; the
645
- * content lives wherever the caller put it — three Keksdose pages render it in a
646
- * sibling `<Card>`, one renders it through a router outlet, and a tab can BE a route
647
- * (`href`), in which case the panel is a whole page this component never sees.
648
- * Wrapping `children` here would mean either moving that content into the strip's
649
- * subtree — a layout change on every page that uses tabs — or shipping a wrapper
650
- * that only some callers could use. So the two halves are joined by an id instead.
651
- *
652
- * Wire the other end yourself:
653
- *
654
- * ```tsx
655
- * <Tabs tabs={tabs} active={active} onChange={setActive} panelId="report-panel" />
656
- * <div id="report-panel" role="tabpanel" aria-labelledby="report-panel-tab" tabIndex={-1}>
657
- * ```
658
- *
659
- * `aria-controls` goes on the OPEN tab only, and `${panelId}-tab` is its id — the
660
- * closed tabs' panels are not in the document, and a dangling `aria-controls`
661
- * describes a tab as opening something that is not there.
662
- */
663
- panelId?: string;
664
- /**
665
- * Makes the tabs removable: an × on the OPEN tab, and Delete on a focused tab
666
- * (only on the open one with `removeOn="active"`).
667
- *
668
- * The × is on the open tab only — a row of tabs each carrying one is a row of
669
- * things to hit by accident, and the tab you can remove should be the one you
670
- * are looking at — but its room is reserved on every removable tab, so opening a
671
- * tab never widens it and never pushes the rest of the strip along (lenkbank
672
- * feedback #72). It is named "Remove <tab>" and is not a tab stop of its own: the
673
- * strip stays one stop, and the keyboard path is Delete (announced through
674
- * `aria-keyshortcuts`), which removes whichever tab has focus (see `removeOn`).
675
- *
676
- * The strip only ASKS: it calls this, and the tab goes when the caller drops it
677
- * from `tabs` — after a confirmation, a request, whatever it needs. When it does,
678
- * focus that was on the removed tab (or its ×) moves to the open tab if the
679
- * removed one was open, else to its neighbour, instead of falling to the page.
680
- */
681
- onRemove?: (id: T) => void;
682
- /**
683
- * Which tabs the Delete key removes.
684
- *
685
- * - `"every"` (default): any focused removable tab — the ARIA pattern's reading.
686
- * - `"active"`: only the OPEN tab, the same one that wears the ×. For a strip whose
687
- * remove is immediate and unconfirmed (lenkbank's sheet tabs delete a measurement
688
- * sheet at once), so arrowing across the strip and pressing Delete cannot take
689
- * out a sheet the user is not looking at. Delete on a closed tab does nothing,
690
- * and only the open tab announces the shortcut (`aria-keyshortcuts`).
691
- *
692
- * Either way the × is drawn on the open tab only and its room stays reserved on
693
- * every removable tab, so the strip never relayouts when the selection moves.
694
- */
695
- removeOn?: "every" | "active";
696
- /** Renders an "add" button after the last tab, outside the tablist — it is an
697
- * action, not a tab, and a tablist may own only tabs. */
698
- onAdd?: () => void;
699
- /** The add button's text. Say what is added — "Add loop", "Add report" says
700
- * more than "Add". Default: `tabs.add` from the {@link UiKitProvider}. */
701
- addLabel?: string;
702
- /** Overrides for this strip's strings. See {@link TabsLabels}. */
703
- labels?: Partial<TabsLabels>;
704
- /** An add or a remove is in flight: the × and the add button are disabled and
705
- * Delete is ignored, so a double click cannot remove two tabs. Nothing moves. */
706
- busy?: boolean;
707
- /**
708
- * `"vertical"`: the same strip as a SIDE NAV — one item per row, the open one
709
- * filled, ↑/↓ walking it (Home/End as before) and `aria-orientation="vertical"` on
710
- * the tablist. For keksdose's admin page and settings page, which each hand-built
711
- * the identical sidebar with none of this strip's keyboard, roving tab stop or
712
- * routed-`href` handling. Everything else — `href` tabs, `badge`, `panelId`,
713
- * `onRemove`, `onAdd` — means exactly what it means on the horizontal strip; the
714
- * badge moves to the row's end.
715
- *
716
- * **On a phone ({@link PHONE_QUERY}) it becomes the horizontal strip**, `wrap` and
717
- * all, rather than staying a column. A side nav only works beside its content; on
718
- * a phone it has to go ABOVE it, and eight full-width rows there push the panel
719
- * the user picked below the fold on every visit — the two keksdose pages both
720
- * collapsed theirs into a scrolling row by hand for exactly that reason. The
721
- * orientation is switched in JavaScript, not with `md:` classes, so the
722
- * `aria-orientation` a screen reader hears and the arrow keys that work always
723
- * match the layout on screen. The caller's own two-column layout has to stack at
724
- * the same breakpoint (`md:grid-cols-[14rem_1fr]`).
725
- */
726
- orientation?: "horizontal" | "vertical";
727
- }
728
- declare function Tabs<T extends string>({ tabs, active, onChange, className, wrap, label, panelId, onRemove, removeOn, onAdd, addLabel, labels, busy, orientation, "aria-label": ariaLabel, ...rest }: TabsProps<T>): react.JSX.Element;
729
-
730
- export { Button, type ButtonClassesOptions, type ButtonProps, type ButtonSize, type ButtonTone, type ButtonVariant, Card, CardAction, type CardActionProps, CardContent, type CardContentProps, CardDescription, type CardDescriptionProps, CardFooter, type CardFooterProps, CardHeader, type CardHeaderProps, type CardProps, CardTitle, type CardTitleProps, DEFAULT_PASSWORD_REVEAL_LABELS, DEFAULT_TABS_LABELS, EmptyState, type EmptyStateProps, FIELD_BASE, FIELD_DISPLAY, FIELD_FLOATING_PAD, FIELD_INVALID, FIELD_TRIGGER, FIELD_WRITABLE_LOOK, FLOATING_INPUT_CLASS, FLOATING_LABEL_CLASS, FLOATING_LABEL_STATIC, FieldChevron, type FieldChevronProps, FieldHint, type FieldHintProps, FieldLabel, type FieldLabelProps, FloatingField, type FloatingFieldProps, IconButton, type IconButtonProps, type IconButtonSize, type IconButtonTone, Input, type InputProps, Label, type LabelProps, PHONE_QUERY, type PasswordRevealLabels, Select, type SelectProps, Spinner, type SpinnerProps, type TabItem, Tabs, type TabsLabels, type TabsProps, Textarea, type TextareaProps, buttonClasses, resolvePasswordRevealLabels };
5
+ import '../lib/clipping.js';
6
+ import './data-table-labels.js';
7
+ import './mini-calendar.js';
8
+ import './calendar-heatmap.js';
9
+ import './popover.js';
10
+ import './chip.js';
11
+ import 'lucide-react';
12
+ import './field-sync.js';
13
+ import '../wizard/types.js';
14
+ import '../tour/tour.js';
15
+ import '../search/command-palette.js';
16
+ import '../search/global-search.js';
17
+ import '../search/search-index.js';
18
+ import './month-picker.js';
19
+ import './page-contents.js';
20
+ import './series-chart-labels.js';
21
+ import './pie-chart-labels.js';
22
+ import './sparkline.js';
23
+ import './stat-tile.js';
24
+ import './signature-pad.js';
25
+ import './password-strength.js';
26
+ import './danger-confirm.js';
27
+ import './swatch-picker.js';
28
+ import './tile-radio.js';
29
+ import './icon-picker.js';
30
+ import './dialog-frame.js';
31
+ import './modal.js';
32
+ import '../hooks/use-search-param-state.js';
33
+ import './measured-grid.js';
34
+ import '../feedback/feedback-attachment.js';
35
+ import '../feedback/feedback-dialog.js';
36
+ import '../feedback/feedback-thread.js';
37
+ import '../feedback/feedback-inbox.js';
38
+ import './account-settings-labels.js';
39
+ import './confirm-dialog.js';
40
+ import './floating-panel.js';
41
+ import './bulk-action-bar.js';
42
+ import './list.js';
43
+ import './breadcrumbs.js';
44
+ import './toast.js';
45
+ import './description-list.js';
46
+ import './line-items.js';
47
+ import './progress-bar.js';
48
+ import './signed-amount.js';
49
+ import './error-boundary.js';
50
+ import './authed-image.js';
51
+ import '../hooks/use-authed-src.js';
52
+ import './image-grid.js';
53
+ import './lightbox.js';