@eifi1/ui-kit 0.31.1 → 0.32.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 (565) hide show
  1. package/README.md +51 -28
  2. package/dist/account/delete-account-setting.d.ts +8 -3
  3. package/dist/admin/admin-action-confirm.d.ts +8 -3
  4. package/dist/admin/admin-action-log.d.ts +1 -1
  5. package/dist/admin/admin-action-log.js +4 -2
  6. package/dist/admin/admin-action-log.js.map +1 -1
  7. package/dist/admin/invitations-panel.d.ts +8 -3
  8. package/dist/admin/invitations-panel.js +29 -26
  9. package/dist/admin/invitations-panel.js.map +1 -1
  10. package/dist/admin/reviewer-scope-editor.d.ts +8 -3
  11. package/dist/admin/role-select.d.ts +10 -5
  12. package/dist/admin/transfer-ownership-dialog.d.ts +8 -3
  13. package/dist/admin/user-roster.d.ts +10 -5
  14. package/dist/admin/user-roster.js +8 -47
  15. package/dist/admin/user-roster.js.map +1 -1
  16. package/dist/auth/auth-errors.d.ts +43 -8
  17. package/dist/auth/auth-errors.js +24 -1
  18. package/dist/auth/auth-errors.js.map +1 -1
  19. package/dist/auth/register-form.d.ts +8 -3
  20. package/dist/billing/billing-banner.d.ts +184 -0
  21. package/dist/billing/billing-banner.js +98 -0
  22. package/dist/billing/billing-banner.js.map +1 -0
  23. package/dist/billing/billing-labels.d.ts +100 -0
  24. package/dist/billing/billing-labels.js +76 -0
  25. package/dist/billing/billing-labels.js.map +1 -0
  26. package/dist/billing/billing-lock.d.ts +158 -0
  27. package/dist/billing/billing-lock.js +17 -0
  28. package/dist/billing/billing-lock.js.map +1 -0
  29. package/dist/billing/billing-standing.d.ts +149 -0
  30. package/dist/billing/billing-standing.js +28 -0
  31. package/dist/billing/billing-standing.js.map +1 -0
  32. package/dist/billing/plan-card.d.ts +248 -0
  33. package/dist/billing/plan-card.js +248 -0
  34. package/dist/billing/plan-card.js.map +1 -0
  35. package/dist/billing/plan-limit-notice.d.ts +156 -0
  36. package/dist/billing/plan-limit-notice.js +76 -0
  37. package/dist/billing/plan-limit-notice.js.map +1 -0
  38. package/dist/billing/plan-limit.d.ts +34 -0
  39. package/dist/billing/plan-limit.js +20 -0
  40. package/dist/billing/plan-limit.js.map +1 -0
  41. package/dist/billing/plan-price.d.ts +61 -0
  42. package/dist/billing/plan-price.js +45 -0
  43. package/dist/billing/plan-price.js.map +1 -0
  44. package/dist/billing/subscription-actions.d.ts +133 -0
  45. package/dist/billing/subscription-actions.js +28 -0
  46. package/dist/billing/subscription-actions.js.map +1 -0
  47. package/dist/billing/subscription-status-chip.d.ts +149 -0
  48. package/dist/billing/subscription-status-chip.js +48 -0
  49. package/dist/billing/subscription-status-chip.js.map +1 -0
  50. package/dist/chart.d.ts +9 -3
  51. package/dist/chart.js.map +1 -1
  52. package/dist/components/account-chips.d.ts +16 -4
  53. package/dist/components/account-chips.js +21 -3
  54. package/dist/components/account-chips.js.map +1 -1
  55. package/dist/components/alert-banner.d.ts +6 -1
  56. package/dist/components/alert-banner.js +5 -4
  57. package/dist/components/alert-banner.js.map +1 -1
  58. package/dist/components/amount-input.d.ts +8 -3
  59. package/dist/components/amount-input.js +5 -5
  60. package/dist/components/amount-input.js.map +1 -1
  61. package/dist/components/appearance-labels.d.ts +38 -0
  62. package/dist/components/appearance-labels.js +19 -0
  63. package/dist/components/appearance-labels.js.map +1 -0
  64. package/dist/components/autocomplete.js +2 -2
  65. package/dist/components/autocomplete.js.map +1 -1
  66. package/dist/components/breadcrumbs.js +3 -2
  67. package/dist/components/breadcrumbs.js.map +1 -1
  68. package/dist/components/bulk-action-bar.d.ts +2 -2
  69. package/dist/components/bulk-action-bar.js +7 -12
  70. package/dist/components/bulk-action-bar.js.map +1 -1
  71. package/dist/components/button-group.d.ts +8 -3
  72. package/dist/components/button-group.js +7 -1
  73. package/dist/components/button-group.js.map +1 -1
  74. package/dist/components/calculator.d.ts +8 -3
  75. package/dist/components/calculator.js +4 -3
  76. package/dist/components/calculator.js.map +1 -1
  77. package/dist/components/calendar-heatmap.js +5 -5
  78. package/dist/components/calendar-heatmap.js.map +1 -1
  79. package/dist/components/chart-height.d.ts +23 -0
  80. package/dist/components/chart-height.js +15 -0
  81. package/dist/components/chart-height.js.map +1 -0
  82. package/dist/components/chart-zoom.js +6 -1
  83. package/dist/components/chart-zoom.js.map +1 -1
  84. package/dist/components/checkbox-group.js +2 -2
  85. package/dist/components/checkbox-group.js.map +1 -1
  86. package/dist/components/checkbox.d.ts +10 -0
  87. package/dist/components/checkbox.js +25 -10
  88. package/dist/components/checkbox.js.map +1 -1
  89. package/dist/components/chip.d.ts +19 -3
  90. package/dist/components/chip.js +54 -23
  91. package/dist/components/chip.js.map +1 -1
  92. package/dist/components/choice-card.d.ts +1 -1
  93. package/dist/components/choice-card.js +9 -8
  94. package/dist/components/choice-card.js.map +1 -1
  95. package/dist/components/column-mapper.js +1 -1
  96. package/dist/components/column-mapper.js.map +1 -1
  97. package/dist/components/combobox-core.js +8 -7
  98. package/dist/components/combobox-core.js.map +1 -1
  99. package/dist/components/combobox.js +8 -8
  100. package/dist/components/combobox.js.map +1 -1
  101. package/dist/components/confirm-dialog.d.ts +8 -3
  102. package/dist/components/copy-button.d.ts +10 -5
  103. package/dist/components/country-select.js +1 -1
  104. package/dist/components/country-select.js.map +1 -1
  105. package/dist/components/currency-select.js +3 -3
  106. package/dist/components/currency-select.js.map +1 -1
  107. package/dist/components/danger-confirm.d.ts +8 -3
  108. package/dist/components/data-table-cells.d.ts +1 -1
  109. package/dist/components/data-table-filter-popover.d.ts +1 -1
  110. package/dist/components/data-table-filter-popover.js +4 -1
  111. package/dist/components/data-table-filter-popover.js.map +1 -1
  112. package/dist/components/data-table-filters.d.ts +1 -1
  113. package/dist/components/data-table-labels.d.ts +1 -1
  114. package/dist/components/data-table-pagination.d.ts +3 -2
  115. package/dist/components/data-table-pagination.js +15 -6
  116. package/dist/components/data-table-pagination.js.map +1 -1
  117. package/dist/components/data-table.d.ts +1 -1
  118. package/dist/components/data-table.js +123 -52
  119. package/dist/components/data-table.js.map +1 -1
  120. package/dist/components/date-picker.d.ts +1 -1
  121. package/dist/components/date-picker.js +18 -6
  122. package/dist/components/date-picker.js.map +1 -1
  123. package/dist/components/description-list.js +2 -2
  124. package/dist/components/description-list.js.map +1 -1
  125. package/dist/components/dialog-frame.js +2 -1
  126. package/dist/components/dialog-frame.js.map +1 -1
  127. package/dist/components/disclosure.js +3 -2
  128. package/dist/components/disclosure.js.map +1 -1
  129. package/dist/components/dropdown.d.ts +1 -1
  130. package/dist/components/dropdown.js +7 -1
  131. package/dist/components/dropdown.js.map +1 -1
  132. package/dist/components/facing-pair.d.ts +19 -6
  133. package/dist/components/facing-pair.js +3 -2
  134. package/dist/components/facing-pair.js.map +1 -1
  135. package/dist/components/field-parts.d.ts +102 -6
  136. package/dist/components/field-parts.js +81 -6
  137. package/dist/components/field-parts.js.map +1 -1
  138. package/dist/components/field-sync.d.ts +4 -1
  139. package/dist/components/field-sync.js +12 -2
  140. package/dist/components/field-sync.js.map +1 -1
  141. package/dist/components/field.js +2 -2
  142. package/dist/components/field.js.map +1 -1
  143. package/dist/components/file-button.d.ts +8 -3
  144. package/dist/components/file-dropzone.d.ts +8 -3
  145. package/dist/components/floating-panel.js +7 -4
  146. package/dist/components/floating-panel.js.map +1 -1
  147. package/dist/components/focus-ring.d.ts +12 -0
  148. package/dist/components/focus-ring.js +8 -0
  149. package/dist/components/focus-ring.js.map +1 -0
  150. package/dist/components/form-actions.d.ts +8 -3
  151. package/dist/components/form-actions.js +33 -19
  152. package/dist/components/form-actions.js.map +1 -1
  153. package/dist/components/full-bleed-dialog.d.ts +11 -1
  154. package/dist/components/full-bleed-dialog.js +3 -1
  155. package/dist/components/full-bleed-dialog.js.map +1 -1
  156. package/dist/components/iban-input.d.ts +8 -3
  157. package/dist/components/image-grid.js +1 -1
  158. package/dist/components/image-grid.js.map +1 -1
  159. package/dist/components/inline-edit-field.js +10 -4
  160. package/dist/components/inline-edit-field.js.map +1 -1
  161. package/dist/components/language-select.d.ts +8 -3
  162. package/dist/components/legal-page.d.ts +26 -5
  163. package/dist/components/legal-page.js +3 -1
  164. package/dist/components/legal-page.js.map +1 -1
  165. package/dist/components/legal.d.ts +8 -3
  166. package/dist/components/legal.js +2 -1
  167. package/dist/components/legal.js.map +1 -1
  168. package/dist/components/lightbox.js +24 -2
  169. package/dist/components/lightbox.js.map +1 -1
  170. package/dist/components/line-items.js +2 -1
  171. package/dist/components/line-items.js.map +1 -1
  172. package/dist/components/list.d.ts +5 -0
  173. package/dist/components/list.js +13 -9
  174. package/dist/components/list.js.map +1 -1
  175. package/dist/components/measured-grid.d.ts +3 -1
  176. package/dist/components/measured-grid.js +38 -20
  177. package/dist/components/measured-grid.js.map +1 -1
  178. package/dist/components/menu-item.js +2 -1
  179. package/dist/components/menu-item.js.map +1 -1
  180. package/dist/components/mini-calendar.js +8 -4
  181. package/dist/components/mini-calendar.js.map +1 -1
  182. package/dist/components/money-field.d.ts +8 -3
  183. package/dist/components/month-picker.js +50 -39
  184. package/dist/components/month-picker.js.map +1 -1
  185. package/dist/components/nav-pills.js +1 -1
  186. package/dist/components/nav-pills.js.map +1 -1
  187. package/dist/components/number-field.d.ts +8 -3
  188. package/dist/components/number-input.d.ts +11 -4
  189. package/dist/components/number-input.js +8 -6
  190. package/dist/components/number-input.js.map +1 -1
  191. package/dist/components/numpad-sheet.d.ts +8 -3
  192. package/dist/components/numpad-sheet.js +2 -1
  193. package/dist/components/numpad-sheet.js.map +1 -1
  194. package/dist/components/one-time-code-input.js +2 -2
  195. package/dist/components/one-time-code-input.js.map +1 -1
  196. package/dist/components/page-contents.js +2 -2
  197. package/dist/components/page-contents.js.map +1 -1
  198. package/dist/components/phone-input.d.ts +8 -3
  199. package/dist/components/phone-input.js +4 -4
  200. package/dist/components/phone-input.js.map +1 -1
  201. package/dist/components/pie-chart.d.ts +8 -2
  202. package/dist/components/pie-chart.js +11 -7
  203. package/dist/components/pie-chart.js.map +1 -1
  204. package/dist/components/popover.d.ts +9 -1
  205. package/dist/components/popover.js +8 -4
  206. package/dist/components/popover.js.map +1 -1
  207. package/dist/components/row-actions.d.ts +100 -0
  208. package/dist/components/row-actions.js +231 -0
  209. package/dist/components/row-actions.js.map +1 -0
  210. package/dist/components/scroll-area.js +1 -1
  211. package/dist/components/scroll-area.js.map +1 -1
  212. package/dist/components/search-field.js +3 -2
  213. package/dist/components/search-field.js.map +1 -1
  214. package/dist/components/series-chart-budget.d.ts +30 -7
  215. package/dist/components/series-chart-budget.js +12 -4
  216. package/dist/components/series-chart-budget.js.map +1 -1
  217. package/dist/components/series-chart-ticks.d.ts +7 -1
  218. package/dist/components/series-chart-ticks.js +6 -0
  219. package/dist/components/series-chart-ticks.js.map +1 -1
  220. package/dist/components/series-chart.d.ts +58 -28
  221. package/dist/components/series-chart.js +42 -32
  222. package/dist/components/series-chart.js.map +1 -1
  223. package/dist/components/settings-fields.d.ts +57 -8
  224. package/dist/components/settings-fields.js +39 -1
  225. package/dist/components/settings-fields.js.map +1 -1
  226. package/dist/components/share-card.d.ts +11 -6
  227. package/dist/components/share-card.js +8 -2
  228. package/dist/components/share-card.js.map +1 -1
  229. package/dist/components/sign-chip.d.ts +4 -0
  230. package/dist/components/sign-chip.js +17 -4
  231. package/dist/components/sign-chip.js.map +1 -1
  232. package/dist/components/signature-pad.d.ts +3 -1
  233. package/dist/components/signature-pad.js +8 -5
  234. package/dist/components/signature-pad.js.map +1 -1
  235. package/dist/components/slider.js +7 -6
  236. package/dist/components/slider.js.map +1 -1
  237. package/dist/components/sparkline.d.ts +5 -1
  238. package/dist/components/sparkline.js +4 -2
  239. package/dist/components/sparkline.js.map +1 -1
  240. package/dist/components/stat-tile.d.ts +17 -1
  241. package/dist/components/stat-tile.js +48 -20
  242. package/dist/components/stat-tile.js.map +1 -1
  243. package/dist/components/status-dot.d.ts +4 -0
  244. package/dist/components/status-dot.js +9 -2
  245. package/dist/components/status-dot.js.map +1 -1
  246. package/dist/components/swipeable-row.js +10 -2
  247. package/dist/components/swipeable-row.js.map +1 -1
  248. package/dist/components/switch.d.ts +21 -7
  249. package/dist/components/switch.js +24 -11
  250. package/dist/components/switch.js.map +1 -1
  251. package/dist/components/table.js +2 -2
  252. package/dist/components/table.js.map +1 -1
  253. package/dist/components/text-link.d.ts +8 -3
  254. package/dist/components/text-link.js +1 -1
  255. package/dist/components/text-link.js.map +1 -1
  256. package/dist/components/text.d.ts +7 -2
  257. package/dist/components/text.js +5 -5
  258. package/dist/components/text.js.map +1 -1
  259. package/dist/components/tile-radio.js +2 -1
  260. package/dist/components/tile-radio.js.map +1 -1
  261. package/dist/components/time-input.d.ts +8 -3
  262. package/dist/components/toast.d.ts +18 -2
  263. package/dist/components/toast.js +8 -5
  264. package/dist/components/toast.js.map +1 -1
  265. package/dist/components/toggle-group.d.ts +25 -3
  266. package/dist/components/toggle-group.js +40 -11
  267. package/dist/components/toggle-group.js.map +1 -1
  268. package/dist/components/toggle-legend.d.ts +10 -1
  269. package/dist/components/toggle-legend.js +21 -7
  270. package/dist/components/toggle-legend.js.map +1 -1
  271. package/dist/components/translation-review-editor.js +1 -1
  272. package/dist/components/translation-review-editor.js.map +1 -1
  273. package/dist/components/translation-review-parts.d.ts +4 -0
  274. package/dist/components/translation-review.d.ts +4 -0
  275. package/dist/components/translation-review.js +3 -3
  276. package/dist/components/translation-review.js.map +1 -1
  277. package/dist/components/tree-view.js +3 -2
  278. package/dist/components/tree-view.js.map +1 -1
  279. package/dist/components/treemap.d.ts +5 -2
  280. package/dist/components/treemap.js +33 -16
  281. package/dist/components/treemap.js.map +1 -1
  282. package/dist/components/ui.d.ts +8 -3
  283. package/dist/components/ui.js +207 -119
  284. package/dist/components/ui.js.map +1 -1
  285. package/dist/components/use-table-state.d.ts +1 -1
  286. package/dist/components/user-avatar.d.ts +5 -1
  287. package/dist/components/user-avatar.js +1 -1
  288. package/dist/components/user-avatar.js.map +1 -1
  289. package/dist/components/wizard-stepper.js +20 -14
  290. package/dist/components/wizard-stepper.js.map +1 -1
  291. package/dist/{data-table-labels-DUELeXpa.d.ts → data-table-labels-kpAAVi6g.d.ts} +26 -2
  292. package/dist/data-table.d.ts +1 -1
  293. package/dist/{delete-account-setting-CpIhzxxZ.d.ts → delete-account-setting-FLyJf-kZ.d.ts} +642 -60
  294. package/dist/demo/demo-banner.js +1 -0
  295. package/dist/demo/demo-banner.js.map +1 -1
  296. package/dist/feedback/feedback-attachment.d.ts +8 -3
  297. package/dist/feedback/feedback-context.d.ts +8 -3
  298. package/dist/feedback/feedback-crash.d.ts +8 -3
  299. package/dist/feedback/feedback-dialog.d.ts +8 -3
  300. package/dist/feedback/feedback-dialog.js +3 -3
  301. package/dist/feedback/feedback-dialog.js.map +1 -1
  302. package/dist/feedback/feedback-inbox.d.ts +8 -3
  303. package/dist/feedback/feedback-inbox.js +2 -2
  304. package/dist/feedback/feedback-inbox.js.map +1 -1
  305. package/dist/feedback/feedback-labels.d.ts +8 -3
  306. package/dist/feedback/feedback-menu.d.ts +9 -4
  307. package/dist/feedback/feedback-record.d.ts +8 -3
  308. package/dist/feedback/feedback-row-detail.d.ts +8 -3
  309. package/dist/feedback/feedback-status-undo.d.ts +8 -3
  310. package/dist/feedback/feedback-submit.d.ts +8 -3
  311. package/dist/feedback/feedback-swipe.d.ts +8 -3
  312. package/dist/feedback/feedback-table.d.ts +8 -3
  313. package/dist/feedback/feedback-thread.d.ts +8 -3
  314. package/dist/feedback/feedback-thread.js +3 -3
  315. package/dist/feedback/feedback-thread.js.map +1 -1
  316. package/dist/feedback.d.ts +8 -3
  317. package/dist/hooks/use-anchored-panel.d.ts +32 -3
  318. package/dist/hooks/use-anchored-panel.js +21 -3
  319. package/dist/hooks/use-anchored-panel.js.map +1 -1
  320. package/dist/hooks/use-breakpoint.d.ts +88 -0
  321. package/dist/hooks/use-breakpoint.js +50 -0
  322. package/dist/hooks/use-breakpoint.js.map +1 -0
  323. package/dist/hooks/use-file-drop.d.ts +8 -3
  324. package/dist/hooks/use-large-text.d.ts +29 -0
  325. package/dist/hooks/use-large-text.js +20 -0
  326. package/dist/hooks/use-large-text.js.map +1 -0
  327. package/dist/hooks/use-windowed-rows.d.ts +52 -8
  328. package/dist/hooks/use-windowed-rows.js +94 -5
  329. package/dist/hooks/use-windowed-rows.js.map +1 -1
  330. package/dist/i18n/defaults.d.ts +8 -3
  331. package/dist/i18n/defaults.js +8 -0
  332. package/dist/i18n/defaults.js.map +1 -1
  333. package/dist/i18n/german.d.ts +8 -3
  334. package/dist/i18n/german.js +94 -3
  335. package/dist/i18n/german.js.map +1 -1
  336. package/dist/i18n/kit-labels.d.ts +8 -3
  337. package/dist/i18n/kit-labels.js.map +1 -1
  338. package/dist/i18n/languages.d.ts +10 -5
  339. package/dist/i18n/locales/de-CH.d.ts +8 -3
  340. package/dist/i18n/locales/en.d.ts +8 -3
  341. package/dist/i18n/locales/es.d.ts +8 -3
  342. package/dist/i18n/locales/es.js +89 -3
  343. package/dist/i18n/locales/es.js.map +1 -1
  344. package/dist/i18n/locales/fr.d.ts +8 -3
  345. package/dist/i18n/locales/fr.js +91 -3
  346. package/dist/i18n/locales/fr.js.map +1 -1
  347. package/dist/i18n/locales/hu.d.ts +8 -3
  348. package/dist/i18n/locales/hu.js +91 -3
  349. package/dist/i18n/locales/hu.js.map +1 -1
  350. package/dist/i18n/locales/it.d.ts +8 -3
  351. package/dist/i18n/locales/it.js +92 -3
  352. package/dist/i18n/locales/it.js.map +1 -1
  353. package/dist/i18n/locales/zh.d.ts +8 -3
  354. package/dist/i18n/locales/zh.js +89 -3
  355. package/dist/i18n/locales/zh.js.map +1 -1
  356. package/dist/i18n/review.d.ts +8 -3
  357. package/dist/i18n/review.js +15 -1
  358. package/dist/i18n/review.js.map +1 -1
  359. package/dist/index.d.ts +27 -11
  360. package/dist/index.js +77 -4
  361. package/dist/index.js.map +1 -1
  362. package/dist/landing/landing-actions.d.ts +8 -3
  363. package/dist/landing/landing-sections.d.ts +8 -3
  364. package/dist/landing/landing-sections.js +7 -3
  365. package/dist/landing/landing-sections.js.map +1 -1
  366. package/dist/landing/public-header.d.ts +9 -4
  367. package/dist/landing/public-header.js +3 -3
  368. package/dist/landing/public-header.js.map +1 -1
  369. package/dist/landing/routing.d.ts +8 -3
  370. package/dist/lib/cn.js +3 -2
  371. package/dist/lib/cn.js.map +1 -1
  372. package/dist/rhf/fields.d.ts +8 -3
  373. package/dist/rhf/fields.js +1 -1
  374. package/dist/rhf/fields.js.map +1 -1
  375. package/dist/rhf/form.d.ts +8 -3
  376. package/dist/rhf/form.js +2 -2
  377. package/dist/rhf/form.js.map +1 -1
  378. package/dist/rhf.d.ts +8 -3
  379. package/dist/search/command-palette.d.ts +1 -1
  380. package/dist/search/command-palette.js +9 -8
  381. package/dist/search/command-palette.js.map +1 -1
  382. package/dist/settings/settings-layout.js +2 -1
  383. package/dist/settings/settings-layout.js.map +1 -1
  384. package/dist/settings/settings-section.d.ts +8 -3
  385. package/dist/settings/use-account-appearance.d.ts +92 -0
  386. package/dist/settings/use-account-appearance.js +63 -0
  387. package/dist/settings/use-account-appearance.js.map +1 -0
  388. package/dist/settings/use-settings-route.d.ts +1 -1
  389. package/dist/settings/use-settings-route.js +2 -3
  390. package/dist/settings/use-settings-route.js.map +1 -1
  391. package/dist/shell/app-shell.d.ts +12 -171
  392. package/dist/shell/app-shell.js +144 -28
  393. package/dist/shell/app-shell.js.map +1 -1
  394. package/dist/shell/auth-layout.js +1 -1
  395. package/dist/shell/auth-layout.js.map +1 -1
  396. package/dist/shell/option-switcher-menu.js +1 -1
  397. package/dist/shell/option-switcher-menu.js.map +1 -1
  398. package/dist/shell/top-bar-brand.d.ts +8 -3
  399. package/dist/shell/top-bar-brand.js +3 -1
  400. package/dist/shell/top-bar-brand.js.map +1 -1
  401. package/dist/shell/topbar-action-menu.d.ts +4 -0
  402. package/dist/shell/topbar-action-menu.js +3 -3
  403. package/dist/shell/topbar-action-menu.js.map +1 -1
  404. package/dist/shell/topbar-controls.js +4 -4
  405. package/dist/shell/topbar-controls.js.map +1 -1
  406. package/dist/shell.d.ts +9 -5
  407. package/dist/theme/contrast-tokens.d.ts +41 -0
  408. package/dist/theme/contrast-tokens.js +59 -0
  409. package/dist/theme/contrast-tokens.js.map +1 -0
  410. package/dist/theme/contrast.d.ts +110 -0
  411. package/dist/theme/contrast.js +128 -0
  412. package/dist/theme/contrast.js.map +1 -0
  413. package/dist/theme/palette-presets.d.ts +12 -1
  414. package/dist/theme/palette-presets.js +9 -4
  415. package/dist/theme/palette-presets.js.map +1 -1
  416. package/dist/theme/palette-store.js.map +1 -1
  417. package/dist/theme/text-size.d.ts +173 -0
  418. package/dist/theme/text-size.js +121 -0
  419. package/dist/theme/text-size.js.map +1 -0
  420. package/dist/wizard/stepper-nav.d.ts +8 -3
  421. package/dist/wizard/wizard-summary.js +1 -1
  422. package/dist/wizard/wizard-summary.js.map +1 -1
  423. package/dist/wizard.d.ts +8 -3
  424. package/package.json +1 -1
  425. package/src/admin/admin-action-log.tsx +6 -1
  426. package/src/admin/invitations-panel.tsx +36 -29
  427. package/src/admin/user-roster.tsx +17 -72
  428. package/src/auth/auth-errors.ts +68 -7
  429. package/src/billing/billing-banner.tsx +205 -0
  430. package/src/billing/billing-labels.ts +240 -0
  431. package/src/billing/billing-lock.ts +75 -0
  432. package/src/billing/billing-standing.ts +72 -0
  433. package/src/billing/plan-card.tsx +458 -0
  434. package/src/billing/plan-limit-notice.tsx +145 -0
  435. package/src/billing/plan-limit.ts +53 -0
  436. package/src/billing/plan-price.ts +101 -0
  437. package/src/billing/subscription-actions.tsx +76 -0
  438. package/src/billing/subscription-status-chip.tsx +95 -0
  439. package/src/chart.ts +2 -0
  440. package/src/components/account-chips.tsx +36 -10
  441. package/src/components/alert-banner.tsx +16 -7
  442. package/src/components/amount-input.tsx +5 -5
  443. package/src/components/appearance-labels.ts +47 -0
  444. package/src/components/autocomplete.tsx +2 -2
  445. package/src/components/breadcrumbs.tsx +3 -3
  446. package/src/components/bulk-action-bar.tsx +11 -14
  447. package/src/components/button-group.tsx +21 -0
  448. package/src/components/calculator.tsx +4 -3
  449. package/src/components/calendar-heatmap.tsx +5 -5
  450. package/src/components/chart-height.ts +30 -0
  451. package/src/components/chart-zoom.tsx +6 -1
  452. package/src/components/checkbox-group.tsx +2 -2
  453. package/src/components/checkbox.tsx +62 -20
  454. package/src/components/chip.tsx +139 -30
  455. package/src/components/choice-card.tsx +16 -11
  456. package/src/components/column-mapper.tsx +1 -1
  457. package/src/components/combobox-core.tsx +8 -7
  458. package/src/components/combobox.tsx +8 -8
  459. package/src/components/country-select.tsx +1 -1
  460. package/src/components/currency-select.tsx +3 -3
  461. package/src/components/data-table-filter-popover.tsx +7 -1
  462. package/src/components/data-table-pagination.tsx +60 -31
  463. package/src/components/data-table.tsx +164 -43
  464. package/src/components/date-picker.tsx +44 -10
  465. package/src/components/description-list.tsx +2 -2
  466. package/src/components/dialog-frame.tsx +2 -1
  467. package/src/components/disclosure.tsx +3 -2
  468. package/src/components/dropdown.tsx +10 -2
  469. package/src/components/facing-pair.ts +12 -5
  470. package/src/components/field-parts.tsx +190 -7
  471. package/src/components/field-sync.tsx +17 -3
  472. package/src/components/field.tsx +2 -2
  473. package/src/components/floating-panel.tsx +7 -4
  474. package/src/components/focus-ring.ts +12 -0
  475. package/src/components/form-actions.tsx +55 -18
  476. package/src/components/full-bleed-dialog.tsx +18 -4
  477. package/src/components/image-grid.tsx +1 -1
  478. package/src/components/inline-edit-field.tsx +26 -4
  479. package/src/components/legal-page.tsx +28 -2
  480. package/src/components/legal.tsx +19 -1
  481. package/src/components/lightbox.tsx +24 -2
  482. package/src/components/line-items.tsx +7 -1
  483. package/src/components/list.tsx +36 -10
  484. package/src/components/measured-grid.tsx +49 -24
  485. package/src/components/menu-item.tsx +2 -2
  486. package/src/components/mini-calendar.tsx +8 -4
  487. package/src/components/month-picker.tsx +15 -6
  488. package/src/components/nav-pills.tsx +1 -1
  489. package/src/components/number-input.tsx +14 -7
  490. package/src/components/numpad-sheet.tsx +2 -2
  491. package/src/components/one-time-code-input.tsx +2 -2
  492. package/src/components/page-contents.tsx +2 -2
  493. package/src/components/phone-input.tsx +9 -4
  494. package/src/components/pie-chart.tsx +19 -9
  495. package/src/components/popover.tsx +22 -5
  496. package/src/components/row-actions.tsx +450 -0
  497. package/src/components/scroll-area.tsx +1 -1
  498. package/src/components/search-field.tsx +4 -2
  499. package/src/components/series-chart-budget.ts +40 -8
  500. package/src/components/series-chart-ticks.ts +10 -0
  501. package/src/components/series-chart.tsx +123 -72
  502. package/src/components/settings-fields.tsx +89 -5
  503. package/src/components/share-card.tsx +31 -2
  504. package/src/components/sign-chip.tsx +28 -4
  505. package/src/components/signature-pad.tsx +13 -7
  506. package/src/components/slider.tsx +22 -9
  507. package/src/components/sparkline.tsx +11 -3
  508. package/src/components/stat-tile.tsx +70 -14
  509. package/src/components/status-dot.tsx +25 -2
  510. package/src/components/swipeable-row.tsx +10 -2
  511. package/src/components/switch.tsx +57 -23
  512. package/src/components/table.tsx +2 -2
  513. package/src/components/text-link.tsx +1 -1
  514. package/src/components/text.tsx +11 -6
  515. package/src/components/tile-radio.tsx +4 -1
  516. package/src/components/toast.tsx +27 -7
  517. package/src/components/toggle-group.tsx +115 -14
  518. package/src/components/toggle-legend.tsx +53 -8
  519. package/src/components/translation-review-editor.tsx +1 -1
  520. package/src/components/translation-review.tsx +11 -5
  521. package/src/components/tree-view.tsx +3 -2
  522. package/src/components/treemap.tsx +27 -10
  523. package/src/components/ui.tsx +353 -153
  524. package/src/components/user-avatar.tsx +1 -1
  525. package/src/components/wizard-stepper.tsx +5 -1
  526. package/src/demo/demo-banner.tsx +5 -0
  527. package/src/feedback/feedback-dialog.tsx +3 -3
  528. package/src/feedback/feedback-inbox.tsx +2 -2
  529. package/src/feedback/feedback-thread.tsx +3 -3
  530. package/src/hooks/use-anchored-panel.ts +67 -5
  531. package/src/hooks/use-breakpoint.ts +132 -0
  532. package/src/hooks/use-large-text.ts +41 -0
  533. package/src/hooks/use-windowed-rows.ts +168 -12
  534. package/src/i18n/defaults.ts +8 -0
  535. package/src/i18n/german.ts +107 -0
  536. package/src/i18n/kit-labels.tsx +12 -0
  537. package/src/i18n/locales/es.ts +98 -0
  538. package/src/i18n/locales/fr.ts +102 -0
  539. package/src/i18n/locales/hu.ts +100 -0
  540. package/src/i18n/locales/it.ts +103 -0
  541. package/src/i18n/locales/zh.ts +94 -0
  542. package/src/i18n/review.ts +14 -0
  543. package/src/index.ts +76 -6
  544. package/src/landing/landing-sections.tsx +7 -3
  545. package/src/landing/public-header.tsx +4 -4
  546. package/src/lib/cn.ts +13 -2
  547. package/src/rhf/fields.tsx +1 -1
  548. package/src/rhf/form.tsx +2 -2
  549. package/src/search/command-palette.tsx +10 -9
  550. package/src/settings/settings-layout.tsx +2 -1
  551. package/src/settings/use-account-appearance.ts +148 -0
  552. package/src/settings/use-settings-route.ts +3 -4
  553. package/src/shell/app-shell.tsx +278 -54
  554. package/src/shell/auth-layout.tsx +1 -1
  555. package/src/shell/option-switcher-menu.tsx +1 -1
  556. package/src/shell/top-bar-brand.tsx +3 -1
  557. package/src/shell/topbar-action-menu.tsx +3 -3
  558. package/src/shell/topbar-controls.tsx +4 -4
  559. package/src/theme/contrast-tokens.ts +112 -0
  560. package/src/theme/contrast.ts +225 -0
  561. package/src/theme/palette-presets.ts +24 -4
  562. package/src/theme/palette-store.ts +6 -1
  563. package/src/theme/text-size.ts +283 -0
  564. package/src/wizard/wizard-summary.tsx +4 -2
  565. package/tokens.css +158 -8
@@ -0,0 +1,156 @@
1
+ import * as react from 'react';
2
+ import { ComponentPropsWithoutRef } from 'react';
3
+ import { e4 as LabelOverride, bH as BillingLabels } from '../delete-account-setting-FLyJf-kZ.js';
4
+ import { AlertTone } from '../components/alert-banner.js';
5
+ import '../components/tooltip.js';
6
+ import '../hooks/use-anchored-rect.js';
7
+ import '../lib/clipping.js';
8
+ import '../data-table-labels-kpAAVi6g.js';
9
+ import '../components/data-table-sort.js';
10
+ import '../components/swipeable-row.js';
11
+ import '../components/mini-calendar.js';
12
+ import '../components/calendar-heatmap.js';
13
+ import '../components/popover.js';
14
+ import '../hooks/use-breakpoint.js';
15
+ import '../components/chip.js';
16
+ import 'lucide-react';
17
+ import '../components/field-parts.js';
18
+ import '../components/field-sync.js';
19
+ import '../wizard/types.js';
20
+ import '../tour/tour.js';
21
+ import '../search/command-palette.js';
22
+ import '../search/global-search.js';
23
+ import '../search/search-index.js';
24
+ import '../components/month-picker.js';
25
+ import '../components/page-contents.js';
26
+ import '../components/series-chart-labels.js';
27
+ import '../components/pie-chart-labels.js';
28
+ import '../components/sparkline.js';
29
+ import '../components/stat-tile.js';
30
+ import '../components/signature-pad.js';
31
+ import '../components/password-strength.js';
32
+ import '../components/swatch-picker.js';
33
+ import '../components/tile-radio.js';
34
+ import '../components/icon-picker.js';
35
+ import '../components/dialog-frame.js';
36
+ import '../components/modal.js';
37
+ import '../hooks/use-search-param-state.js';
38
+ import '../components/measured-grid.js';
39
+ import '../components/user-avatar.js';
40
+ import '../lib/person-name.js';
41
+ import '../components/status-dot.js';
42
+ import '../components/progress-bar.js';
43
+ import '../components/signed-amount.js';
44
+ import '../shell/topbar-action-menu.js';
45
+ import '../components/menu-item.js';
46
+ import '../components/floating-panel.js';
47
+ import '../hooks/use-authed-src.js';
48
+ import '../components/account-settings-labels.js';
49
+ import '../components/bulk-action-bar.js';
50
+ import '../components/list.js';
51
+ import '../components/breadcrumbs.js';
52
+ import '../components/toast.js';
53
+ import '../components/description-list.js';
54
+ import '../components/line-items.js';
55
+ import '../components/error-boundary.js';
56
+ import '../components/authed-image.js';
57
+ import '../components/image-grid.js';
58
+ import '../components/lightbox.js';
59
+ import '../components/write-lock.js';
60
+ import '../auth/sign-in-form.js';
61
+ import '../landing/access.js';
62
+ import '../landing/landing-labels.js';
63
+ import '../shell/topbar-controls.js';
64
+ import '../theme/palette-presets.js';
65
+ import '../theme/chart-palette.js';
66
+ import '../theme/theme-store.js';
67
+ import 'zustand/middleware';
68
+ import 'zustand';
69
+ import '../auth/complete-name-dialog.js';
70
+ import '../auth/forgot-password-form.js';
71
+ import '../auth/status-parts.js';
72
+ import '../auth/reset-password-form.js';
73
+ import '../auth/verify-email.js';
74
+ import '../auth/not-found-page.js';
75
+ import '../auth/accept-invitation.js';
76
+ import '../shell/company-switcher.js';
77
+ import '../account/email-change-setting.js';
78
+ import '../account/sessions-setting.js';
79
+ import '../lib/format.js';
80
+ import '../account/data-export-setting.js';
81
+ import '../components/account-chips.js';
82
+ import '../admin/admin-parts.js';
83
+ import '../admin/admin-action-log.js';
84
+ import '../settings/settings-labels.js';
85
+ import '../demo/demo-labels.js';
86
+ import '../components/appearance-labels.js';
87
+ import '../theme/contrast.js';
88
+ import '../theme/text-size.js';
89
+ import '../components/reauth-dialog.js';
90
+ import '../components/server-wake.js';
91
+ import '../lib/server-wake.js';
92
+ import '../components/translation-review-labels.js';
93
+ import '../lib/translation-review.js';
94
+ import '../components/country-select.js';
95
+ import '../components/inline-edit-field.js';
96
+ import '../lib/iban.js';
97
+ import '../lib/phone.js';
98
+ import '../components/sign-chip.js';
99
+ import '../components/column-mapper.js';
100
+ import '../lib/column-mapping.js';
101
+ import '../lib/table-text.js';
102
+ import '../components/focus-ring.js';
103
+
104
+ /** The `contact` mode's mail: to support, its subject naming the dimension. */
105
+ declare function planLimitMailto(email: string, subject: string): string;
106
+ interface PlanLimitNoticeBaseProps extends Omit<ComponentPropsWithoutRef<"div">, "children" | "onClick"> {
107
+ /** The dimension as the refusal names it (`"budgets"`, `"seats"`) — `isPlanLimit(err)`'s
108
+ * `dimension`. Carried as `data-dimension`. */
109
+ dimension: string;
110
+ /** The app's name for it, in the reader's language: "Budgets". Default: the key. */
111
+ dimensionLabel?: string;
112
+ /** How many there are. Left out (keksdose's legacy `plan_budget_limit` body has no
113
+ * `used`), it is read as `limit`: the create was refused for being at it. */
114
+ used?: number;
115
+ /** The plan's limit for the dimension. Left out — a body without one — the notice says
116
+ * its words and draws no meter. */
117
+ limit?: number;
118
+ /** The payer's plan code, as `isPlanLimit` reads it — carried as `data-plan`, so the
119
+ * refusal can be spread in whole: `<PlanLimitNotice {...isPlanLimit(err)} …/>`. */
120
+ plan?: string;
121
+ /** How a figure is written — kastlan's storage limit is bytes (`formatFileSize`).
122
+ * Default: a number in the kit's locale. */
123
+ formatValue?: (value: number) => string;
124
+ /** Over the provider's locale, for the default figures. */
125
+ locale?: string;
126
+ /** Default `warning`. */
127
+ tone?: AlertTone;
128
+ /** Prop > `<UiKitProvider labels={{ billing }}>` > English. */
129
+ labels?: LabelOverride<BillingLabels>;
130
+ }
131
+ type PlanLimitNoticeProps = PlanLimitNoticeBaseProps & ({
132
+ /** Plans are bought: "Choose a plan" → the app's subscription page. */
133
+ mode: "upgrade";
134
+ /** The subscription page. */
135
+ href: string;
136
+ email?: never;
137
+ } | {
138
+ /** The operator grants plans by hand (keksdose's today): "Ask for more" → a mail. */
139
+ mode: "contact";
140
+ /** The support address: `support@` the app's domain. */
141
+ email: string;
142
+ href?: never;
143
+ });
144
+ /**
145
+ * A create refused at the plan's limit (docs/billing-harmonization.md §3.4): "Plan limit
146
+ * reached", what to do, the dimension's meter ("Budgets — 3 of 3") and the app's way to
147
+ * more — `upgrade`, a link to the subscription page, or `contact`, a mail to support.
148
+ *
149
+ * A limit gates CREATION only: a downgrade never deletes or hides what is over the new
150
+ * limit (§3.4), so `used` may be past `limit`; the meter then fills and turns red. Feed it
151
+ * the refusal: `const hit = isPlanLimit(err); hit && <PlanLimitNotice {...hit} …/>`. The
152
+ * kit sends nothing — the mail opens the reader's own client.
153
+ */
154
+ declare function PlanLimitNotice(props: PlanLimitNoticeProps): react.JSX.Element;
155
+
156
+ export { PlanLimitNotice, type PlanLimitNoticeProps, planLimitMailto };
@@ -0,0 +1,76 @@
1
+ "use client";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import { useKitLocale } from "../i18n/kit-labels.js";
4
+ import { formatNumber } from "../lib/format.js";
5
+ import { AlertBanner } from "../components/alert-banner.js";
6
+ import { ProgressBar } from "../components/progress-bar.js";
7
+ import { Button } from "../components/ui.js";
8
+ import { useBillingLabels } from "./billing-labels.js";
9
+ function encodeStrict(value) {
10
+ return encodeURIComponent(value).replace(/[!'()*]/g, (c) => `%${c.charCodeAt(0).toString(16).toUpperCase()}`);
11
+ }
12
+ function planLimitMailto(email, subject) {
13
+ const to = encodeStrict(email).replace(/%40/g, "@");
14
+ return `mailto:${to}?subject=${encodeStrict(subject)}`;
15
+ }
16
+ function PlanLimitNotice(props) {
17
+ const {
18
+ dimension,
19
+ dimensionLabel,
20
+ used: usedProp,
21
+ limit,
22
+ plan,
23
+ formatValue,
24
+ locale: localeProp,
25
+ tone = "warning",
26
+ labels: labelsProp,
27
+ mode,
28
+ href,
29
+ email,
30
+ className,
31
+ ...rest
32
+ } = props;
33
+ const labels = useBillingLabels(labelsProp);
34
+ const locale = useKitLocale(localeProp);
35
+ const used = usedProp ?? limit ?? 0;
36
+ const name = dimensionLabel ?? dimension;
37
+ const figure = (value) => formatValue ? formatValue(value) : formatNumber(value, { locale });
38
+ const action = mode === "upgrade" ? /* @__PURE__ */ jsx(Button, { href, variant: "secondary", size: "sm", children: labels.choosePlan }) : /* @__PURE__ */ jsx(Button, { href: planLimitMailto(email, labels.contactSubject(name)), variant: "secondary", size: "sm", children: labels.askForMore });
39
+ return /* @__PURE__ */ jsxs(
40
+ AlertBanner,
41
+ {
42
+ ...rest,
43
+ tone,
44
+ action,
45
+ "data-plan-limit-mode": mode,
46
+ "data-dimension": dimension,
47
+ "data-plan": plan,
48
+ className,
49
+ children: [
50
+ /* @__PURE__ */ jsx("span", { className: "block font-medium", children: labels.limitReached }),
51
+ /* @__PURE__ */ jsx("span", { className: "block", children: mode === "upgrade" ? labels.limitUpgrade : labels.limitContact }),
52
+ limit !== void 0 && /* @__PURE__ */ jsx(
53
+ ProgressBar,
54
+ {
55
+ as: "span",
56
+ variant: "meter",
57
+ size: "slim",
58
+ value: used,
59
+ max: limit,
60
+ label: name,
61
+ showValue: true,
62
+ formatValue: () => labels.usage(figure(used), figure(limit)),
63
+ tone: used > limit ? "danger" : "warning",
64
+ className: "mt-2",
65
+ locale
66
+ }
67
+ )
68
+ ]
69
+ }
70
+ );
71
+ }
72
+ export {
73
+ PlanLimitNotice,
74
+ planLimitMailto
75
+ };
76
+ //# sourceMappingURL=plan-limit-notice.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/billing/plan-limit-notice.tsx"],"sourcesContent":["import type { ComponentPropsWithoutRef } from \"react\";\n\nimport { useKitLocale } from \"../i18n/kit-labels\";\nimport type { LabelOverride } from \"../i18n/kit-labels\";\nimport { formatNumber } from \"../lib/format\";\nimport { AlertBanner } from \"../components/alert-banner\";\nimport type { AlertTone } from \"../components/alert-banner\";\nimport { ProgressBar } from \"../components/progress-bar\";\nimport { Button } from \"../components/ui\";\nimport { useBillingLabels } from \"./billing-labels\";\nimport type { BillingLabels } from \"./billing-labels\";\n\n/** RFC 3986 percent-encoding, `!'()*` too — a mail client that splits on `'` is the one\n * that breaks \"Plan limit: Ada's plots\" (landing/access.ts keeps the same rule). */\nfunction encodeStrict(value: string): string {\n return encodeURIComponent(value).replace(/[!'()*]/g, (c) => `%${c.charCodeAt(0).toString(16).toUpperCase()}`);\n}\n\n/** The `contact` mode's mail: to support, its subject naming the dimension. */\nexport function planLimitMailto(email: string, subject: string): string {\n const to = encodeStrict(email).replace(/%40/g, \"@\");\n return `mailto:${to}?subject=${encodeStrict(subject)}`;\n}\n\ninterface PlanLimitNoticeBaseProps extends Omit<ComponentPropsWithoutRef<\"div\">, \"children\" | \"onClick\"> {\n /** The dimension as the refusal names it (`\"budgets\"`, `\"seats\"`) — `isPlanLimit(err)`'s\n * `dimension`. Carried as `data-dimension`. */\n dimension: string;\n /** The app's name for it, in the reader's language: \"Budgets\". Default: the key. */\n dimensionLabel?: string;\n /** How many there are. Left out (keksdose's legacy `plan_budget_limit` body has no\n * `used`), it is read as `limit`: the create was refused for being at it. */\n used?: number;\n /** The plan's limit for the dimension. Left out — a body without one — the notice says\n * its words and draws no meter. */\n limit?: number;\n /** The payer's plan code, as `isPlanLimit` reads it — carried as `data-plan`, so the\n * refusal can be spread in whole: `<PlanLimitNotice {...isPlanLimit(err)} …/>`. */\n plan?: string;\n /** How a figure is written — kastlan's storage limit is bytes (`formatFileSize`).\n * Default: a number in the kit's locale. */\n formatValue?: (value: number) => string;\n /** Over the provider's locale, for the default figures. */\n locale?: string;\n /** Default `warning`. */\n tone?: AlertTone;\n /** Prop > `<UiKitProvider labels={{ billing }}>` > English. */\n labels?: LabelOverride<BillingLabels>;\n}\n\nexport type PlanLimitNoticeProps = PlanLimitNoticeBaseProps &\n (\n | {\n /** Plans are bought: \"Choose a plan\" → the app's subscription page. */\n mode: \"upgrade\";\n /** The subscription page. */\n href: string;\n email?: never;\n }\n | {\n /** The operator grants plans by hand (keksdose's today): \"Ask for more\" → a mail. */\n mode: \"contact\";\n /** The support address: `support@` the app's domain. */\n email: string;\n href?: never;\n }\n );\n\n/**\n * A create refused at the plan's limit (docs/billing-harmonization.md §3.4): \"Plan limit\n * reached\", what to do, the dimension's meter (\"Budgets — 3 of 3\") and the app's way to\n * more — `upgrade`, a link to the subscription page, or `contact`, a mail to support.\n *\n * A limit gates CREATION only: a downgrade never deletes or hides what is over the new\n * limit (§3.4), so `used` may be past `limit`; the meter then fills and turns red. Feed it\n * the refusal: `const hit = isPlanLimit(err); hit && <PlanLimitNotice {...hit} …/>`. The\n * kit sends nothing — the mail opens the reader's own client.\n */\nexport function PlanLimitNotice(props: PlanLimitNoticeProps) {\n const {\n dimension,\n dimensionLabel,\n used: usedProp,\n limit,\n plan,\n formatValue,\n locale: localeProp,\n tone = \"warning\",\n labels: labelsProp,\n mode,\n href,\n email,\n className,\n ...rest\n } = props;\n const labels = useBillingLabels(labelsProp);\n const locale = useKitLocale(localeProp);\n const used = usedProp ?? limit ?? 0;\n const name = dimensionLabel ?? dimension;\n const figure = (value: number) => (formatValue ? formatValue(value) : formatNumber(value, { locale }));\n\n const action =\n mode === \"upgrade\" ? (\n <Button href={href} variant=\"secondary\" size=\"sm\">\n {labels.choosePlan}\n </Button>\n ) : (\n <Button href={planLimitMailto(email, labels.contactSubject(name))} variant=\"secondary\" size=\"sm\">\n {labels.askForMore}\n </Button>\n );\n\n return (\n <AlertBanner\n {...rest}\n tone={tone}\n action={action}\n data-plan-limit-mode={mode}\n data-dimension={dimension}\n data-plan={plan}\n className={className}\n >\n <span className=\"block font-medium\">{labels.limitReached}</span>\n <span className=\"block\">{mode === \"upgrade\" ? labels.limitUpgrade : labels.limitContact}</span>\n {limit !== undefined && (\n <ProgressBar\n as=\"span\"\n variant=\"meter\"\n size=\"slim\"\n value={used}\n max={limit}\n label={name}\n showValue\n // The bar is clamped at `max` and hands its formatter the clamped value; the\n // figures are the real ones, so \"5 of 3\" after a downgrade says what the bar\n // cannot draw.\n formatValue={() => labels.usage(figure(used), figure(limit))}\n tone={used > limit ? \"danger\" : \"warning\"}\n className=\"mt-2\"\n locale={locale}\n />\n )}\n </AlertBanner>\n );\n}\n"],"mappings":";AAuGM,cAUF,YAVE;AArGN,SAAS,oBAAoB;AAE7B,SAAS,oBAAoB;AAC7B,SAAS,mBAAmB;AAE5B,SAAS,mBAAmB;AAC5B,SAAS,cAAc;AACvB,SAAS,wBAAwB;AAKjC,SAAS,aAAa,OAAuB;AAC3C,SAAO,mBAAmB,KAAK,EAAE,QAAQ,YAAY,CAAC,MAAM,IAAI,EAAE,WAAW,CAAC,EAAE,SAAS,EAAE,EAAE,YAAY,CAAC,EAAE;AAC9G;AAGO,SAAS,gBAAgB,OAAe,SAAyB;AACtE,QAAM,KAAK,aAAa,KAAK,EAAE,QAAQ,QAAQ,GAAG;AAClD,SAAO,UAAU,EAAE,YAAY,aAAa,OAAO,CAAC;AACtD;AAwDO,SAAS,gBAAgB,OAA6B;AAC3D,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA,MAAM;AAAA,IACN;AAAA,IACA;AAAA,IACA;AAAA,IACA,QAAQ;AAAA,IACR,OAAO;AAAA,IACP,QAAQ;AAAA,IACR;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EACL,IAAI;AACJ,QAAM,SAAS,iBAAiB,UAAU;AAC1C,QAAM,SAAS,aAAa,UAAU;AACtC,QAAM,OAAO,YAAY,SAAS;AAClC,QAAM,OAAO,kBAAkB;AAC/B,QAAM,SAAS,CAAC,UAAmB,cAAc,YAAY,KAAK,IAAI,aAAa,OAAO,EAAE,OAAO,CAAC;AAEpG,QAAM,SACJ,SAAS,YACP,oBAAC,UAAO,MAAY,SAAQ,aAAY,MAAK,MAC1C,iBAAO,YACV,IAEA,oBAAC,UAAO,MAAM,gBAAgB,OAAO,OAAO,eAAe,IAAI,CAAC,GAAG,SAAQ,aAAY,MAAK,MACzF,iBAAO,YACV;AAGJ,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ;AAAA,MACA;AAAA,MACA,wBAAsB;AAAA,MACtB,kBAAgB;AAAA,MAChB,aAAW;AAAA,MACX;AAAA,MAEA;AAAA,4BAAC,UAAK,WAAU,qBAAqB,iBAAO,cAAa;AAAA,QACzD,oBAAC,UAAK,WAAU,SAAS,mBAAS,YAAY,OAAO,eAAe,OAAO,cAAa;AAAA,QACvF,UAAU,UACT;AAAA,UAAC;AAAA;AAAA,YACC,IAAG;AAAA,YACH,SAAQ;AAAA,YACR,MAAK;AAAA,YACL,OAAO;AAAA,YACP,KAAK;AAAA,YACL,OAAO;AAAA,YACP,WAAS;AAAA,YAIT,aAAa,MAAM,OAAO,MAAM,OAAO,IAAI,GAAG,OAAO,KAAK,CAAC;AAAA,YAC3D,MAAM,OAAO,QAAQ,WAAW;AAAA,YAChC,WAAU;AAAA,YACV;AAAA;AAAA,QACF;AAAA;AAAA;AAAA,EAEJ;AAEJ;","names":[]}
@@ -0,0 +1,34 @@
1
+ /** What {@link isPlanLimit} reads off a `plan_limit` refusal (docs/billing-harmonization.md
2
+ * §3.4): `402 {detail, code: "plan_limit", dimension, plan, limit, used}`. */
3
+ interface PlanLimitRefusal {
4
+ /** The limited dimension, as the app's catalogue names it: `"budgets"`, `"seats"`. */
5
+ dimension: string;
6
+ /** The payer's plan code, lowercased (§12.16: reads compare without case, and
7
+ * keksdose's legacy body still says `"FREE"`). `undefined` when the body has none. */
8
+ plan: string | undefined;
9
+ /** The plan's limit for the dimension. `undefined` when the body has none. */
10
+ limit: number | undefined;
11
+ /** How many there are. `undefined` when the body has none — keksdose's legacy
12
+ * `plan_budget_limit` body never had it. */
13
+ used: number | undefined;
14
+ }
15
+ /**
16
+ * The plan-limit refusal `err` carries — `{dimension, plan, limit, used}` — or
17
+ * `undefined` when it is not one (docs/billing-harmonization.md §3.4):
18
+ *
19
+ * catch (err) {
20
+ * const hit = isPlanLimit(err);
21
+ * if (hit) return setLimit(hit); // → <PlanLimitNotice {...hit} mode="upgrade" href="/settings/subscription" />
22
+ * }
23
+ *
24
+ * The body is found where `authErrorCode` finds a code — axios' `err.response.data`,
25
+ * ofetch's `err.data`, a generated client's `err.body`, or `err` itself — and FastAPI's
26
+ * nested `{detail: {code, …}}` too; the extra fields are read beside the code.
27
+ *
28
+ * keksdose's old code, `plan_budget_limit`, is read as `dimension: "budgets"` (§12.16):
29
+ * its frontend accepts both codes for a release, because installed PWAs run the previous
30
+ * bundle while the server switches.
31
+ */
32
+ declare function isPlanLimit(err: unknown): PlanLimitRefusal | undefined;
33
+
34
+ export { type PlanLimitRefusal, isPlanLimit };
@@ -0,0 +1,20 @@
1
+ "use client";
2
+ import { errorBodyWithCode } from "../auth/auth-errors.js";
3
+ const LEGACY_BUDGET_LIMIT = "plan_budget_limit";
4
+ const text = (value) => typeof value === "string" && value !== "" ? value : void 0;
5
+ const count = (value) => typeof value === "number" && Number.isFinite(value) ? value : void 0;
6
+ function isPlanLimit(err) {
7
+ const body = errorBodyWithCode(err, (code) => code === "plan_limit" || code === LEGACY_BUDGET_LIMIT);
8
+ if (!body) return void 0;
9
+ const legacy = body.code === LEGACY_BUDGET_LIMIT;
10
+ return {
11
+ dimension: text(body.dimension) ?? (legacy ? "budgets" : ""),
12
+ plan: text(body.plan)?.toLowerCase(),
13
+ limit: count(body.limit),
14
+ used: count(body.used)
15
+ };
16
+ }
17
+ export {
18
+ isPlanLimit
19
+ };
20
+ //# sourceMappingURL=plan-limit.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/billing/plan-limit.ts"],"sourcesContent":["import { errorBodyWithCode } from \"../auth/auth-errors\";\n\n/** What {@link isPlanLimit} reads off a `plan_limit` refusal (docs/billing-harmonization.md\n * §3.4): `402 {detail, code: \"plan_limit\", dimension, plan, limit, used}`. */\nexport interface PlanLimitRefusal {\n /** The limited dimension, as the app's catalogue names it: `\"budgets\"`, `\"seats\"`. */\n dimension: string;\n /** The payer's plan code, lowercased (§12.16: reads compare without case, and\n * keksdose's legacy body still says `\"FREE\"`). `undefined` when the body has none. */\n plan: string | undefined;\n /** The plan's limit for the dimension. `undefined` when the body has none. */\n limit: number | undefined;\n /** How many there are. `undefined` when the body has none — keksdose's legacy\n * `plan_budget_limit` body never had it. */\n used: number | undefined;\n}\n\n/** keksdose's code before §3.4: `402 {detail, code: \"plan_budget_limit\", plan, limit}`. */\nconst LEGACY_BUDGET_LIMIT = \"plan_budget_limit\";\n\nconst text = (value: unknown): string | undefined =>\n typeof value === \"string\" && value !== \"\" ? value : undefined;\nconst count = (value: unknown): number | undefined =>\n typeof value === \"number\" && Number.isFinite(value) ? value : undefined;\n\n/**\n * The plan-limit refusal `err` carries — `{dimension, plan, limit, used}` — or\n * `undefined` when it is not one (docs/billing-harmonization.md §3.4):\n *\n * catch (err) {\n * const hit = isPlanLimit(err);\n * if (hit) return setLimit(hit); // → <PlanLimitNotice {...hit} mode=\"upgrade\" href=\"/settings/subscription\" />\n * }\n *\n * The body is found where `authErrorCode` finds a code — axios' `err.response.data`,\n * ofetch's `err.data`, a generated client's `err.body`, or `err` itself — and FastAPI's\n * nested `{detail: {code, …}}` too; the extra fields are read beside the code.\n *\n * keksdose's old code, `plan_budget_limit`, is read as `dimension: \"budgets\"` (§12.16):\n * its frontend accepts both codes for a release, because installed PWAs run the previous\n * bundle while the server switches.\n */\nexport function isPlanLimit(err: unknown): PlanLimitRefusal | undefined {\n const body = errorBodyWithCode(err, (code) => code === \"plan_limit\" || code === LEGACY_BUDGET_LIMIT);\n if (!body) return undefined;\n const legacy = body.code === LEGACY_BUDGET_LIMIT;\n return {\n dimension: text(body.dimension) ?? (legacy ? \"budgets\" : \"\"),\n plan: text(body.plan)?.toLowerCase(),\n limit: count(body.limit),\n used: count(body.used),\n };\n}\n"],"mappings":";AAAA,SAAS,yBAAyB;AAkBlC,MAAM,sBAAsB;AAE5B,MAAM,OAAO,CAAC,UACZ,OAAO,UAAU,YAAY,UAAU,KAAK,QAAQ;AACtD,MAAM,QAAQ,CAAC,UACb,OAAO,UAAU,YAAY,OAAO,SAAS,KAAK,IAAI,QAAQ;AAmBzD,SAAS,YAAY,KAA4C;AACtE,QAAM,OAAO,kBAAkB,KAAK,CAAC,SAAS,SAAS,gBAAgB,SAAS,mBAAmB;AACnG,MAAI,CAAC,KAAM,QAAO;AAClB,QAAM,SAAS,KAAK,SAAS;AAC7B,SAAO;AAAA,IACL,WAAW,KAAK,KAAK,SAAS,MAAM,SAAS,YAAY;AAAA,IACzD,MAAM,KAAK,KAAK,IAAI,GAAG,YAAY;AAAA,IACnC,OAAO,MAAM,KAAK,KAAK;AAAA,IACvB,MAAM,MAAM,KAAK,IAAI;AAAA,EACvB;AACF;","names":[]}
@@ -0,0 +1,61 @@
1
+ /**
2
+ * Money and periods of the plan catalogue (docs/billing-harmonization.md §3.1, §4, §12.17).
3
+ *
4
+ * Money crosses the wire as INTEGER MINOR UNITS plus an ISO currency, never as a float
5
+ * (§4): 4900 CHF is CHF 49.00. The kit turns it into the reader's notation with
6
+ * `formatMoney`, so no app divides by 100 by hand.
7
+ */
8
+ /** A billing period: the provider charges per month or per year. */
9
+ type BillingInterval = "month" | "year";
10
+ /** The two currencies every app sells in (§2.6). */
11
+ type BillingCurrency = "CHF" | "EUR";
12
+ /**
13
+ * The periods in the order the picker offers them — YEARLY FIRST (§12.17): a Merchant of
14
+ * Record takes about 5 % + 0.50 per transaction, so a small monthly price loses a fifth
15
+ * of itself (CHF 3 a month loses about 22 %). The page leads with the yearly price.
16
+ */
17
+ declare const BILLING_INTERVALS: readonly BillingInterval[];
18
+ /** One currency's prices, in minor units, per period. A period left out is not offered. */
19
+ type PlanIntervalPrices = Partial<Record<BillingInterval, number>>;
20
+ /** A plan's prices as server-kit's `PlanSpec.prices` sends them: currency → period →
21
+ * minor units, GROSS (§12.17). */
22
+ type PlanPrices = Partial<Record<BillingCurrency, PlanIntervalPrices>>;
23
+ /**
24
+ * What one plan costs in one currency and period:
25
+ * - `price` — a gross amount in minor units;
26
+ * - `free` — a plan with no prices at all (keksdose's free plan), or a price of 0;
27
+ * - `not-offered` — a plan with prices, but none for this currency and period.
28
+ */
29
+ type PlanPriceAnswer = {
30
+ kind: "price";
31
+ minor: number;
32
+ } | {
33
+ kind: "free";
34
+ } | {
35
+ kind: "not-offered";
36
+ };
37
+ /** What `prices` says for `currency` and `interval` — see {@link PlanPriceAnswer}. */
38
+ declare function planPrice(prices: PlanPrices | null | undefined, currency: BillingCurrency, interval: BillingInterval): PlanPriceAnswer;
39
+ /** Minor units as the amount: 4900 CHF → 49, 1250 EUR → 12.5. The currency's minor unit
40
+ * comes from `Intl` (CHF and EUR have 2); a code `Intl` cannot read counts as 2. */
41
+ declare function minorToMajor(minor: number, currency: string): number;
42
+ /**
43
+ * A price in minor units, in the reader's notation: "CHF 49", "CHF 4.90", "49 €",
44
+ * "4,90 €". A whole amount drops its decimals — a price list reads "CHF 49" — and any
45
+ * other keeps all of them ("CHF 4.90", never "CHF 4.9").
46
+ */
47
+ declare function formatPlanPrice(minor: number, currency: string, options?: {
48
+ locale?: string;
49
+ }): string;
50
+ /**
51
+ * The currency a payer starts with when the app stores none (§12.18): francs where the
52
+ * locale's region is Switzerland or Liechtenstein, euros everywhere else — "de-CH" and
53
+ * "fr-CH" CHF, "de" (Germany, once `Intl` fills the region in) and "it" EUR.
54
+ *
55
+ * Only the fallback: an account's stored currency comes first (keksdose's
56
+ * `reporting_currency` — a de-CH speaker living in Germany pays in euros), and the payer
57
+ * may switch in the picker either way; checkout takes the one they leave it on (§4).
58
+ */
59
+ declare function billingCurrencyFor(locale?: string): BillingCurrency;
60
+
61
+ export { BILLING_INTERVALS, type BillingCurrency, type BillingInterval, type PlanIntervalPrices, type PlanPriceAnswer, type PlanPrices, billingCurrencyFor, formatPlanPrice, minorToMajor, planPrice };
@@ -0,0 +1,45 @@
1
+ "use client";
2
+ import { currencyMinorDigits, formatMoney } from "../lib/format.js";
3
+ const BILLING_INTERVALS = Object.freeze(["year", "month"]);
4
+ function hasAnyPrice(prices) {
5
+ if (!prices) return false;
6
+ return Object.values(prices).some(
7
+ (byInterval) => byInterval && Object.values(byInterval).some((v) => typeof v === "number")
8
+ );
9
+ }
10
+ function planPrice(prices, currency, interval) {
11
+ const minor = prices?.[currency]?.[interval];
12
+ if (typeof minor === "number" && Number.isFinite(minor)) {
13
+ return minor === 0 ? { kind: "free" } : { kind: "price", minor };
14
+ }
15
+ return hasAnyPrice(prices) ? { kind: "not-offered" } : { kind: "free" };
16
+ }
17
+ function minorToMajor(minor, currency) {
18
+ const digits = currencyMinorDigits(currency) ?? 2;
19
+ return minor / 10 ** digits;
20
+ }
21
+ function formatPlanPrice(minor, currency, options = {}) {
22
+ const digits = currencyMinorDigits(currency) ?? 2;
23
+ const whole = Number.isInteger(minor) && minor % 10 ** digits === 0;
24
+ return formatMoney(minorToMajor(minor, currency), currency, {
25
+ locale: options.locale,
26
+ digits: whole ? 0 : digits
27
+ });
28
+ }
29
+ function billingCurrencyFor(locale) {
30
+ if (!locale) return "EUR";
31
+ try {
32
+ const region = new Intl.Locale(locale).maximize().region;
33
+ return region === "CH" || region === "LI" ? "CHF" : "EUR";
34
+ } catch {
35
+ return "EUR";
36
+ }
37
+ }
38
+ export {
39
+ BILLING_INTERVALS,
40
+ billingCurrencyFor,
41
+ formatPlanPrice,
42
+ minorToMajor,
43
+ planPrice
44
+ };
45
+ //# sourceMappingURL=plan-price.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/billing/plan-price.ts"],"sourcesContent":["import { currencyMinorDigits, formatMoney } from \"../lib/format\";\n\n/**\n * Money and periods of the plan catalogue (docs/billing-harmonization.md §3.1, §4, §12.17).\n *\n * Money crosses the wire as INTEGER MINOR UNITS plus an ISO currency, never as a float\n * (§4): 4900 CHF is CHF 49.00. The kit turns it into the reader's notation with\n * `formatMoney`, so no app divides by 100 by hand.\n */\n\n/** A billing period: the provider charges per month or per year. */\nexport type BillingInterval = \"month\" | \"year\";\n\n/** The two currencies every app sells in (§2.6). */\nexport type BillingCurrency = \"CHF\" | \"EUR\";\n\n/**\n * The periods in the order the picker offers them — YEARLY FIRST (§12.17): a Merchant of\n * Record takes about 5 % + 0.50 per transaction, so a small monthly price loses a fifth\n * of itself (CHF 3 a month loses about 22 %). The page leads with the yearly price.\n */\nexport const BILLING_INTERVALS: readonly BillingInterval[] = Object.freeze([\"year\", \"month\"]);\n\n/** One currency's prices, in minor units, per period. A period left out is not offered. */\nexport type PlanIntervalPrices = Partial<Record<BillingInterval, number>>;\n\n/** A plan's prices as server-kit's `PlanSpec.prices` sends them: currency → period →\n * minor units, GROSS (§12.17). */\nexport type PlanPrices = Partial<Record<BillingCurrency, PlanIntervalPrices>>;\n\n/**\n * What one plan costs in one currency and period:\n * - `price` — a gross amount in minor units;\n * - `free` — a plan with no prices at all (keksdose's free plan), or a price of 0;\n * - `not-offered` — a plan with prices, but none for this currency and period.\n */\nexport type PlanPriceAnswer =\n | { kind: \"price\"; minor: number }\n | { kind: \"free\" }\n | { kind: \"not-offered\" };\n\n/** Whether a price table holds any figure at all. */\nfunction hasAnyPrice(prices: PlanPrices | null | undefined): boolean {\n if (!prices) return false;\n return Object.values(prices).some(\n (byInterval) => byInterval && Object.values(byInterval).some((v) => typeof v === \"number\"),\n );\n}\n\n/** What `prices` says for `currency` and `interval` — see {@link PlanPriceAnswer}. */\nexport function planPrice(\n prices: PlanPrices | null | undefined,\n currency: BillingCurrency,\n interval: BillingInterval,\n): PlanPriceAnswer {\n const minor = prices?.[currency]?.[interval];\n if (typeof minor === \"number\" && Number.isFinite(minor)) {\n return minor === 0 ? { kind: \"free\" } : { kind: \"price\", minor };\n }\n return hasAnyPrice(prices) ? { kind: \"not-offered\" } : { kind: \"free\" };\n}\n\n/** Minor units as the amount: 4900 CHF → 49, 1250 EUR → 12.5. The currency's minor unit\n * comes from `Intl` (CHF and EUR have 2); a code `Intl` cannot read counts as 2. */\nexport function minorToMajor(minor: number, currency: string): number {\n const digits = currencyMinorDigits(currency) ?? 2;\n return minor / 10 ** digits;\n}\n\n/**\n * A price in minor units, in the reader's notation: \"CHF 49\", \"CHF 4.90\", \"49 €\",\n * \"4,90 €\". A whole amount drops its decimals — a price list reads \"CHF 49\" — and any\n * other keeps all of them (\"CHF 4.90\", never \"CHF 4.9\").\n */\nexport function formatPlanPrice(minor: number, currency: string, options: { locale?: string } = {}): string {\n const digits = currencyMinorDigits(currency) ?? 2;\n const whole = Number.isInteger(minor) && minor % 10 ** digits === 0;\n return formatMoney(minorToMajor(minor, currency), currency, {\n locale: options.locale,\n digits: whole ? 0 : digits,\n });\n}\n\n/**\n * The currency a payer starts with when the app stores none (§12.18): francs where the\n * locale's region is Switzerland or Liechtenstein, euros everywhere else — \"de-CH\" and\n * \"fr-CH\" CHF, \"de\" (Germany, once `Intl` fills the region in) and \"it\" EUR.\n *\n * Only the fallback: an account's stored currency comes first (keksdose's\n * `reporting_currency` — a de-CH speaker living in Germany pays in euros), and the payer\n * may switch in the picker either way; checkout takes the one they leave it on (§4).\n */\nexport function billingCurrencyFor(locale?: string): BillingCurrency {\n if (!locale) return \"EUR\";\n try {\n const region = new Intl.Locale(locale).maximize().region;\n return region === \"CH\" || region === \"LI\" ? \"CHF\" : \"EUR\";\n } catch {\n return \"EUR\";\n }\n}\n"],"mappings":";AAAA,SAAS,qBAAqB,mBAAmB;AAqB1C,MAAM,oBAAgD,OAAO,OAAO,CAAC,QAAQ,OAAO,CAAC;AAqB5F,SAAS,YAAY,QAAgD;AACnE,MAAI,CAAC,OAAQ,QAAO;AACpB,SAAO,OAAO,OAAO,MAAM,EAAE;AAAA,IAC3B,CAAC,eAAe,cAAc,OAAO,OAAO,UAAU,EAAE,KAAK,CAAC,MAAM,OAAO,MAAM,QAAQ;AAAA,EAC3F;AACF;AAGO,SAAS,UACd,QACA,UACA,UACiB;AACjB,QAAM,QAAQ,SAAS,QAAQ,IAAI,QAAQ;AAC3C,MAAI,OAAO,UAAU,YAAY,OAAO,SAAS,KAAK,GAAG;AACvD,WAAO,UAAU,IAAI,EAAE,MAAM,OAAO,IAAI,EAAE,MAAM,SAAS,MAAM;AAAA,EACjE;AACA,SAAO,YAAY,MAAM,IAAI,EAAE,MAAM,cAAc,IAAI,EAAE,MAAM,OAAO;AACxE;AAIO,SAAS,aAAa,OAAe,UAA0B;AACpE,QAAM,SAAS,oBAAoB,QAAQ,KAAK;AAChD,SAAO,QAAQ,MAAM;AACvB;AAOO,SAAS,gBAAgB,OAAe,UAAkB,UAA+B,CAAC,GAAW;AAC1G,QAAM,SAAS,oBAAoB,QAAQ,KAAK;AAChD,QAAM,QAAQ,OAAO,UAAU,KAAK,KAAK,QAAQ,MAAM,WAAW;AAClE,SAAO,YAAY,aAAa,OAAO,QAAQ,GAAG,UAAU;AAAA,IAC1D,QAAQ,QAAQ;AAAA,IAChB,QAAQ,QAAQ,IAAI;AAAA,EACtB,CAAC;AACH;AAWO,SAAS,mBAAmB,QAAkC;AACnE,MAAI,CAAC,OAAQ,QAAO;AACpB,MAAI;AACF,UAAM,SAAS,IAAI,KAAK,OAAO,MAAM,EAAE,SAAS,EAAE;AAClD,WAAO,WAAW,QAAQ,WAAW,OAAO,QAAQ;AAAA,EACtD,QAAQ;AACN,WAAO;AAAA,EACT;AACF;","names":[]}
@@ -0,0 +1,133 @@
1
+ import * as react from 'react';
2
+ import { ComponentPropsWithoutRef } from 'react';
3
+ import { e4 as LabelOverride, bH as BillingLabels } from '../delete-account-setting-FLyJf-kZ.js';
4
+ import '../components/tooltip.js';
5
+ import '../hooks/use-anchored-rect.js';
6
+ import '../lib/clipping.js';
7
+ import '../data-table-labels-kpAAVi6g.js';
8
+ import '../components/data-table-sort.js';
9
+ import '../components/swipeable-row.js';
10
+ import '../components/mini-calendar.js';
11
+ import '../components/calendar-heatmap.js';
12
+ import '../components/popover.js';
13
+ import '../hooks/use-breakpoint.js';
14
+ import '../components/chip.js';
15
+ import 'lucide-react';
16
+ import '../components/field-parts.js';
17
+ import '../components/field-sync.js';
18
+ import '../wizard/types.js';
19
+ import '../tour/tour.js';
20
+ import '../search/command-palette.js';
21
+ import '../search/global-search.js';
22
+ import '../search/search-index.js';
23
+ import '../components/month-picker.js';
24
+ import '../components/page-contents.js';
25
+ import '../components/series-chart-labels.js';
26
+ import '../components/pie-chart-labels.js';
27
+ import '../components/sparkline.js';
28
+ import '../components/stat-tile.js';
29
+ import '../components/signature-pad.js';
30
+ import '../components/password-strength.js';
31
+ import '../components/swatch-picker.js';
32
+ import '../components/tile-radio.js';
33
+ import '../components/icon-picker.js';
34
+ import '../components/dialog-frame.js';
35
+ import '../components/modal.js';
36
+ import '../hooks/use-search-param-state.js';
37
+ import '../components/measured-grid.js';
38
+ import '../components/user-avatar.js';
39
+ import '../lib/person-name.js';
40
+ import '../components/status-dot.js';
41
+ import '../components/progress-bar.js';
42
+ import '../components/signed-amount.js';
43
+ import '../shell/topbar-action-menu.js';
44
+ import '../components/menu-item.js';
45
+ import '../components/floating-panel.js';
46
+ import '../hooks/use-authed-src.js';
47
+ import '../components/account-settings-labels.js';
48
+ import '../components/bulk-action-bar.js';
49
+ import '../components/list.js';
50
+ import '../components/breadcrumbs.js';
51
+ import '../components/toast.js';
52
+ import '../components/description-list.js';
53
+ import '../components/line-items.js';
54
+ import '../components/error-boundary.js';
55
+ import '../components/authed-image.js';
56
+ import '../components/image-grid.js';
57
+ import '../components/lightbox.js';
58
+ import '../components/write-lock.js';
59
+ import '../auth/sign-in-form.js';
60
+ import '../landing/access.js';
61
+ import '../landing/landing-labels.js';
62
+ import '../shell/topbar-controls.js';
63
+ import '../theme/palette-presets.js';
64
+ import '../theme/chart-palette.js';
65
+ import '../theme/theme-store.js';
66
+ import 'zustand/middleware';
67
+ import 'zustand';
68
+ import '../auth/complete-name-dialog.js';
69
+ import '../auth/forgot-password-form.js';
70
+ import '../auth/status-parts.js';
71
+ import '../auth/reset-password-form.js';
72
+ import '../auth/verify-email.js';
73
+ import '../auth/not-found-page.js';
74
+ import '../auth/accept-invitation.js';
75
+ import '../shell/company-switcher.js';
76
+ import '../account/email-change-setting.js';
77
+ import '../account/sessions-setting.js';
78
+ import '../lib/format.js';
79
+ import '../account/data-export-setting.js';
80
+ import '../components/account-chips.js';
81
+ import '../admin/admin-parts.js';
82
+ import '../admin/admin-action-log.js';
83
+ import '../settings/settings-labels.js';
84
+ import '../demo/demo-labels.js';
85
+ import '../components/appearance-labels.js';
86
+ import '../theme/contrast.js';
87
+ import '../theme/text-size.js';
88
+ import '../components/reauth-dialog.js';
89
+ import '../components/server-wake.js';
90
+ import '../lib/server-wake.js';
91
+ import '../components/translation-review-labels.js';
92
+ import '../lib/translation-review.js';
93
+ import '../components/country-select.js';
94
+ import '../components/inline-edit-field.js';
95
+ import '../lib/iban.js';
96
+ import '../lib/phone.js';
97
+ import '../components/sign-chip.js';
98
+ import '../components/column-mapper.js';
99
+ import '../lib/column-mapping.js';
100
+ import '../lib/table-text.js';
101
+ import '../components/focus-ring.js';
102
+
103
+ interface SubscriptionActionsProps extends Omit<ComponentPropsWithoutRef<"div">, "children"> {
104
+ /** "Payment and invoices", as a link — or {@link onManage}. Without either, none. */
105
+ manageHref?: string;
106
+ /** "Payment and invoices", as the app's call: `POST /billing/portal`, then off to its
107
+ * `url` (§4). The kit sends no request. */
108
+ onManage?: () => void;
109
+ /** "Cancel subscription", as a link — or {@link onCancel}. Without either, none. */
110
+ cancelHref?: string;
111
+ /** "Cancel subscription", as the app's call — usually the portal again, where the
112
+ * provider's cancel and withdrawal functions are (§12.26). */
113
+ onCancel?: () => void;
114
+ /** Which of the two is under way: its spinner, no second press. */
115
+ pending?: "manage" | "cancel" | null;
116
+ /** Prop > `<UiKitProvider labels={{ billing }}>` > English. */
117
+ labels?: LabelOverride<BillingLabels>;
118
+ }
119
+ /**
120
+ * The two ways to the provider's hosted portal on the subscription page
121
+ * (docs/billing-harmonization.md §2.8, §7, §12.26): "Payment and invoices" — the payment
122
+ * method and the invoices live there, never in the app — and a VISIBLE "Cancel
123
+ * subscription". Consumer law wants the second in plain sight: Germany's cancellation
124
+ * button (§312k BGB) and the EU withdrawal function (Directive (EU) 2023/2673, from
125
+ * 19 June 2026) are in the portal, and the app's page must not hide the way there behind
126
+ * "manage".
127
+ *
128
+ * Neither takes the write lock: a read-only payer must be able to pay, leave or cancel
129
+ * (§3.3).
130
+ */
131
+ declare function SubscriptionActions({ manageHref, onManage, cancelHref, onCancel, pending, labels: labelsProp, className, ...rest }: SubscriptionActionsProps): react.JSX.Element | null;
132
+
133
+ export { SubscriptionActions, type SubscriptionActionsProps };
@@ -0,0 +1,28 @@
1
+ "use client";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import { cn } from "../lib/cn.js";
4
+ import { Button } from "../components/ui.js";
5
+ import { useBillingLabels } from "./billing-labels.js";
6
+ function SubscriptionActions({
7
+ manageHref,
8
+ onManage,
9
+ cancelHref,
10
+ onCancel,
11
+ pending,
12
+ labels: labelsProp,
13
+ className,
14
+ ...rest
15
+ }) {
16
+ const labels = useBillingLabels(labelsProp);
17
+ const manage = manageHref !== void 0 ? /* @__PURE__ */ jsx(Button, { href: manageHref, variant: "secondary", children: labels.manage }) : onManage !== void 0 ? /* @__PURE__ */ jsx(Button, { type: "button", variant: "secondary", onClick: onManage, pending: pending === "manage", children: labels.manage }) : null;
18
+ const cancel = cancelHref !== void 0 ? /* @__PURE__ */ jsx(Button, { href: cancelHref, variant: "link", tone: "danger", children: labels.cancel }) : onCancel !== void 0 ? /* @__PURE__ */ jsx(Button, { type: "button", variant: "link", tone: "danger", onClick: onCancel, pending: pending === "cancel", children: labels.cancel }) : null;
19
+ if (!manage && !cancel) return null;
20
+ return /* @__PURE__ */ jsxs("div", { ...rest, className: cn("flex flex-wrap items-center gap-x-4 gap-y-2", className), children: [
21
+ manage,
22
+ cancel
23
+ ] });
24
+ }
25
+ export {
26
+ SubscriptionActions
27
+ };
28
+ //# sourceMappingURL=subscription-actions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/billing/subscription-actions.tsx"],"sourcesContent":["import type { ComponentPropsWithoutRef } from \"react\";\n\nimport type { LabelOverride } from \"../i18n/kit-labels\";\nimport { cn } from \"../lib/cn\";\nimport { Button } from \"../components/ui\";\nimport { useBillingLabels } from \"./billing-labels\";\nimport type { BillingLabels } from \"./billing-labels\";\n\nexport interface SubscriptionActionsProps extends Omit<ComponentPropsWithoutRef<\"div\">, \"children\"> {\n /** \"Payment and invoices\", as a link — or {@link onManage}. Without either, none. */\n manageHref?: string;\n /** \"Payment and invoices\", as the app's call: `POST /billing/portal`, then off to its\n * `url` (§4). The kit sends no request. */\n onManage?: () => void;\n /** \"Cancel subscription\", as a link — or {@link onCancel}. Without either, none. */\n cancelHref?: string;\n /** \"Cancel subscription\", as the app's call — usually the portal again, where the\n * provider's cancel and withdrawal functions are (§12.26). */\n onCancel?: () => void;\n /** Which of the two is under way: its spinner, no second press. */\n pending?: \"manage\" | \"cancel\" | null;\n /** Prop > `<UiKitProvider labels={{ billing }}>` > English. */\n labels?: LabelOverride<BillingLabels>;\n}\n\n/**\n * The two ways to the provider's hosted portal on the subscription page\n * (docs/billing-harmonization.md §2.8, §7, §12.26): \"Payment and invoices\" — the payment\n * method and the invoices live there, never in the app — and a VISIBLE \"Cancel\n * subscription\". Consumer law wants the second in plain sight: Germany's cancellation\n * button (§312k BGB) and the EU withdrawal function (Directive (EU) 2023/2673, from\n * 19 June 2026) are in the portal, and the app's page must not hide the way there behind\n * \"manage\".\n *\n * Neither takes the write lock: a read-only payer must be able to pay, leave or cancel\n * (§3.3).\n */\nexport function SubscriptionActions({\n manageHref,\n onManage,\n cancelHref,\n onCancel,\n pending,\n labels: labelsProp,\n className,\n ...rest\n}: SubscriptionActionsProps) {\n const labels = useBillingLabels(labelsProp);\n const manage =\n manageHref !== undefined ? (\n <Button href={manageHref} variant=\"secondary\">\n {labels.manage}\n </Button>\n ) : onManage !== undefined ? (\n <Button type=\"button\" variant=\"secondary\" onClick={onManage} pending={pending === \"manage\"}>\n {labels.manage}\n </Button>\n ) : null;\n const cancel =\n cancelHref !== undefined ? (\n <Button href={cancelHref} variant=\"link\" tone=\"danger\">\n {labels.cancel}\n </Button>\n ) : onCancel !== undefined ? (\n <Button type=\"button\" variant=\"link\" tone=\"danger\" onClick={onCancel} pending={pending === \"cancel\"}>\n {labels.cancel}\n </Button>\n ) : null;\n if (!manage && !cancel) return null;\n return (\n <div {...rest} className={cn(\"flex flex-wrap items-center gap-x-4 gap-y-2\", className)}>\n {manage}\n {cancel}\n </div>\n );\n}\n"],"mappings":";AAkDM,cAoBF,YApBE;AA/CN,SAAS,UAAU;AACnB,SAAS,cAAc;AACvB,SAAS,wBAAwB;AAgC1B,SAAS,oBAAoB;AAAA,EAClC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,QAAQ;AAAA,EACR;AAAA,EACA,GAAG;AACL,GAA6B;AAC3B,QAAM,SAAS,iBAAiB,UAAU;AAC1C,QAAM,SACJ,eAAe,SACb,oBAAC,UAAO,MAAM,YAAY,SAAQ,aAC/B,iBAAO,QACV,IACE,aAAa,SACf,oBAAC,UAAO,MAAK,UAAS,SAAQ,aAAY,SAAS,UAAU,SAAS,YAAY,UAC/E,iBAAO,QACV,IACE;AACN,QAAM,SACJ,eAAe,SACb,oBAAC,UAAO,MAAM,YAAY,SAAQ,QAAO,MAAK,UAC3C,iBAAO,QACV,IACE,aAAa,SACf,oBAAC,UAAO,MAAK,UAAS,SAAQ,QAAO,MAAK,UAAS,SAAS,UAAU,SAAS,YAAY,UACxF,iBAAO,QACV,IACE;AACN,MAAI,CAAC,UAAU,CAAC,OAAQ,QAAO;AAC/B,SACE,qBAAC,SAAK,GAAG,MAAM,WAAW,GAAG,+CAA+C,SAAS,GAClF;AAAA;AAAA,IACA;AAAA,KACH;AAEJ;","names":[]}