@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,100 @@
1
+ export { bH as BillingLabels, cp as DEFAULT_BILLING_LABELS, eW as SUBSCRIPTION_STATUSES, fb as SubscriptionStatus, f$ as useBillingLabels } from '../delete-account-setting-FLyJf-kZ.js';
2
+ import 'react';
3
+ import '../components/tooltip.js';
4
+ import '../hooks/use-anchored-rect.js';
5
+ import '../lib/clipping.js';
6
+ import '../data-table-labels-kpAAVi6g.js';
7
+ import '../components/data-table-sort.js';
8
+ import '../components/swipeable-row.js';
9
+ import '../components/mini-calendar.js';
10
+ import '../components/calendar-heatmap.js';
11
+ import '../components/popover.js';
12
+ import '../hooks/use-breakpoint.js';
13
+ import '../components/chip.js';
14
+ import 'lucide-react';
15
+ import '../components/field-parts.js';
16
+ import '../components/field-sync.js';
17
+ import '../wizard/types.js';
18
+ import '../tour/tour.js';
19
+ import '../search/command-palette.js';
20
+ import '../search/global-search.js';
21
+ import '../search/search-index.js';
22
+ import '../components/month-picker.js';
23
+ import '../components/page-contents.js';
24
+ import '../components/series-chart-labels.js';
25
+ import '../components/pie-chart-labels.js';
26
+ import '../components/sparkline.js';
27
+ import '../components/stat-tile.js';
28
+ import '../components/signature-pad.js';
29
+ import '../components/password-strength.js';
30
+ import '../components/swatch-picker.js';
31
+ import '../components/tile-radio.js';
32
+ import '../components/icon-picker.js';
33
+ import '../components/dialog-frame.js';
34
+ import '../components/modal.js';
35
+ import '../hooks/use-search-param-state.js';
36
+ import '../components/measured-grid.js';
37
+ import '../components/user-avatar.js';
38
+ import '../lib/person-name.js';
39
+ import '../components/status-dot.js';
40
+ import '../components/progress-bar.js';
41
+ import '../components/signed-amount.js';
42
+ import '../shell/topbar-action-menu.js';
43
+ import '../components/menu-item.js';
44
+ import '../components/floating-panel.js';
45
+ import '../hooks/use-authed-src.js';
46
+ import '../components/account-settings-labels.js';
47
+ import '../components/bulk-action-bar.js';
48
+ import '../components/list.js';
49
+ import '../components/breadcrumbs.js';
50
+ import '../components/toast.js';
51
+ import '../components/description-list.js';
52
+ import '../components/line-items.js';
53
+ import '../components/error-boundary.js';
54
+ import '../components/authed-image.js';
55
+ import '../components/image-grid.js';
56
+ import '../components/lightbox.js';
57
+ import '../components/write-lock.js';
58
+ import '../auth/sign-in-form.js';
59
+ import '../landing/access.js';
60
+ import '../landing/landing-labels.js';
61
+ import '../shell/topbar-controls.js';
62
+ import '../theme/palette-presets.js';
63
+ import '../theme/chart-palette.js';
64
+ import '../theme/theme-store.js';
65
+ import 'zustand/middleware';
66
+ import 'zustand';
67
+ import '../auth/complete-name-dialog.js';
68
+ import '../auth/forgot-password-form.js';
69
+ import '../auth/status-parts.js';
70
+ import '../auth/reset-password-form.js';
71
+ import '../auth/verify-email.js';
72
+ import '../auth/not-found-page.js';
73
+ import '../auth/accept-invitation.js';
74
+ import '../shell/company-switcher.js';
75
+ import '../account/email-change-setting.js';
76
+ import '../account/sessions-setting.js';
77
+ import '../lib/format.js';
78
+ import '../account/data-export-setting.js';
79
+ import '../components/account-chips.js';
80
+ import '../admin/admin-parts.js';
81
+ import '../admin/admin-action-log.js';
82
+ import '../settings/settings-labels.js';
83
+ import '../demo/demo-labels.js';
84
+ import '../components/appearance-labels.js';
85
+ import '../theme/contrast.js';
86
+ import '../theme/text-size.js';
87
+ import '../components/reauth-dialog.js';
88
+ import '../components/server-wake.js';
89
+ import '../lib/server-wake.js';
90
+ import '../components/translation-review-labels.js';
91
+ import '../lib/translation-review.js';
92
+ import '../components/country-select.js';
93
+ import '../components/inline-edit-field.js';
94
+ import '../lib/iban.js';
95
+ import '../lib/phone.js';
96
+ import '../components/sign-chip.js';
97
+ import '../components/column-mapper.js';
98
+ import '../lib/column-mapping.js';
99
+ import '../lib/table-text.js';
100
+ import '../components/focus-ring.js';
@@ -0,0 +1,76 @@
1
+ "use client";
2
+ import { useKitLabels } from "../i18n/kit-labels.js";
3
+ const SUBSCRIPTION_STATUSES = Object.freeze([
4
+ "trialing",
5
+ "active",
6
+ "past_due",
7
+ "canceled",
8
+ "expired",
9
+ "comped"
10
+ ]);
11
+ function inDays(days) {
12
+ if (days <= 0) return "today";
13
+ if (days === 1) return "tomorrow";
14
+ return `in ${days} days`;
15
+ }
16
+ const DEFAULT_BILLING_LABELS = {
17
+ group: "Subscription",
18
+ plans: "Plans",
19
+ interval: "Billing period",
20
+ yearly: "Yearly",
21
+ monthly: "Monthly",
22
+ currency: "Currency",
23
+ perYear: "per year",
24
+ perMonth: "per month",
25
+ vatIncluded: "VAT included",
26
+ free: "Free",
27
+ notOffered: "Not offered for this billing period",
28
+ unlimited: "Unlimited",
29
+ limits: "Limits",
30
+ features: "Included",
31
+ current: "Current plan",
32
+ choose: (plan) => `Choose ${plan}`,
33
+ upgrade: (plan) => `Upgrade to ${plan}`,
34
+ downgrade: (plan) => `Switch to ${plan}`,
35
+ isCurrent: "This is your current plan.",
36
+ pickFirst: "Pick a plan first.",
37
+ status: {
38
+ trialing: "Trial",
39
+ active: "Active",
40
+ past_due: "Payment overdue",
41
+ canceled: "Cancelled",
42
+ expired: "Expired",
43
+ comped: "Complimentary"
44
+ },
45
+ trialEnding: (days) => `Your trial ends ${inDays(days)}. After that you can still view everything, but changes need a plan.`,
46
+ grantEnding: (days) => `Your free access ends ${inDays(days)}. After that you can still view everything, but changes need a plan.`,
47
+ paymentFailed: "Your last payment didn\u2019t go through. Update your payment method to keep your plan.",
48
+ planEnded: "Your plan has ended. You can still view and export everything; choose a plan to make changes again.",
49
+ guestReadOnly: (item) => item ? `\u201C${item}\u201D is read-only for now; its owner can lift that.` : "This is read-only for now; its owner can lift that.",
50
+ processing: "Your payment is being processed. Your plan starts as soon as it\u2019s confirmed; this page updates by itself.",
51
+ choosePlan: "Choose a plan",
52
+ updatePayment: "Update payment method",
53
+ checkAgain: "Check again",
54
+ lockReason: "Your plan has ended. Choose a plan to make changes again.",
55
+ limitReached: "Plan limit reached",
56
+ limitUpgrade: "To add more, choose a plan with a higher limit.",
57
+ limitContact: "To add more, ask us for a higher limit.",
58
+ askForMore: "Ask for more",
59
+ usage: (used, limit) => `${used} of ${limit}`,
60
+ contactSubject: (dimension) => `Plan limit: ${dimension}`,
61
+ manage: "Payment and invoices",
62
+ cancel: "Cancel subscription",
63
+ waitingChanges: (count) => count === 1 ? "1 change waiting for a plan" : `${count} changes waiting for a plan`,
64
+ discardWaiting: "Discard waiting changes",
65
+ notConfigured: "Payments aren't set up yet. Please try again later.",
66
+ disabled: "Subscriptions aren't available here."
67
+ };
68
+ function useBillingLabels(labels) {
69
+ return useKitLabels("billing", DEFAULT_BILLING_LABELS, labels);
70
+ }
71
+ export {
72
+ DEFAULT_BILLING_LABELS,
73
+ SUBSCRIPTION_STATUSES,
74
+ useBillingLabels
75
+ };
76
+ //# sourceMappingURL=billing-labels.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/billing/billing-labels.ts"],"sourcesContent":["import { useKitLabels } from \"../i18n/kit-labels\";\nimport type { LabelOverride } from \"../i18n/kit-labels\";\n\n/**\n * The subscription's status vocabulary (docs/billing-harmonization.md §3.2) — server-kit's\n * `SubscriptionStatus`, value for value:\n *\n * - `trialing` — the 30-day trial without a card (§2.7), or a pure guest's row whose trial\n * has not started (§12.9, `trial_ends_at` empty);\n * - `active` — paid;\n * - `past_due` — a payment failed; in good standing during the provider's retries (§3.3);\n * - `canceled` — the payer cancelled; the American spelling is the wire's, the word shown\n * is \"Cancelled\";\n * - `expired` — a trial, a grant or a failed subscription ran out: read-only (§2.3);\n * - `comped` — free by the operator's grant or as a beta user (§3.2, `comped_until`).\n */\nexport type SubscriptionStatus = \"trialing\" | \"active\" | \"past_due\" | \"canceled\" | \"expired\" | \"comped\";\n\n/** Every status, in the order a lifecycle reads: trial, paid, trouble, ended, granted. */\nexport const SUBSCRIPTION_STATUSES: readonly SubscriptionStatus[] = Object.freeze([\n \"trialing\",\n \"active\",\n \"past_due\",\n \"canceled\",\n \"expired\",\n \"comped\",\n]);\n\n/**\n * The words of the subscription parts — the `billing` namespace of `<UiKitProvider labels>`\n * (docs/billing-harmonization.md §7, §10; ui-kit 0.32.0).\n *\n * WORDING (§12.24): the English group is \"Subscription\", never \"Plan\" — keksdose's \"plan\"\n * is the month's budget plan (\"One plan per month\"), and two meanings of one word on one\n * settings page is the clash the review found. \"Plan\" stays the word for WHAT is bought\n * (Free, Pro), \"subscription\" for the standing arrangement. German says \"Tarif\" for the\n * plan and \"Abonnement\" for the subscription (§10).\n *\n * Prices are GROSS (§12.17): Swiss consumer law (PBV) wants a consumer price with the\n * MWST in it, so the cards say so (`vatIncluded`).\n */\nexport interface BillingLabels {\n /** The settings group or admin section the parts live on (§7, §12.24): \"Subscription\". */\n group: string;\n\n /* ── PlanPicker / PlanCard (§7) ── */\n /** The picker's name when it has no visible `legend`: \"Plans\". */\n plans: string;\n /** The name of the billing-period switch: \"Billing period\". */\n interval: string;\n /** The switch's two options — yearly first (§12.17). */\n yearly: string;\n monthly: string;\n /** The name of the currency switch: \"Currency\". */\n currency: string;\n /** After a price: \"per year\", \"per month\". */\n perYear: string;\n perMonth: string;\n /** Under a price (§12.17): \"VAT included\". German: \"inkl. MWST\". */\n vatIncluded: string;\n /** A plan with no price, or a price of 0: \"Free\". */\n free: string;\n /** A plan with prices, but none for this currency and period. */\n notOffered: string;\n /** A limit of `null` (§3.1): \"Unlimited\". */\n unlimited: string;\n /** The accessible names of a card's two lists. */\n limits: string;\n features: string;\n /** The chip on the payer's current plan. */\n current: string;\n /** The picker's button for `plan` (the plan's display name) with no current plan —\n * during a trial, or after a plan ended: \"Choose Pro\". */\n choose: (plan: string) => string;\n /** …for a plan after the current one in the catalogue's order: \"Upgrade to Pro\". */\n upgrade: (plan: string) => string;\n /** …for a plan before it: \"Switch to Free\". */\n downgrade: (plan: string) => string;\n /** Why the button is off while the current plan is the one picked. */\n isCurrent: string;\n /** Why it is off while nothing is picked. */\n pickFirst: string;\n\n /* ── SubscriptionStatusChip (§6) ── */\n /** One word per status. */\n status: Record<SubscriptionStatus, string>;\n\n /* ── BillingBanner (§3.3, §12.6, §12.21) ── */\n /** A trial ends in `days` calendar days — 0 is today, 1 tomorrow. */\n trialEnding: (days: number) => string;\n /** A free grant (`comped_until`: a beta user's 12 months, an operator's grant) ends in\n * `days` calendar days. */\n grantEnding: (days: number) => string;\n /** The first failed payment (`past_due`), while the provider retries. */\n paymentFailed: string;\n /** Out of good standing: read-only, never locked (§2.3). */\n planEnded: string;\n /**\n * A guest in someone else's item that is read-only for billing (§12.6). It never says\n * WHY beyond \"for now\": the owner's payment status is the owner's personal data.\n * `item` is the item's own name (\"Household 2026\"), shown in quotes — or `undefined`.\n */\n guestReadOnly: (item?: string) => string;\n /** Back from checkout before the provider's webhook landed (§12.21). */\n processing: string;\n /** The action of the trial, grant and plan-ended banners, and of `PlanLimitNotice`'s\n * `upgrade` mode: \"Choose a plan\". */\n choosePlan: string;\n /** The payment-failed banner's action, to the provider's portal: \"Update payment method\". */\n updatePayment: string;\n /** The processing banner's action, when the app gives one: \"Check again\". */\n checkAgain: string;\n\n /* ── The read-only lock (§3.3, §12.6) ── */\n /** The `WriteLockProvider` reason for the payer (§3.3, verbatim). A guest's reason is\n * {@link guestReadOnly}. */\n lockReason: string;\n\n /* ── PlanLimitNotice (§3.4) ── */\n /** The notice's first line: \"Plan limit reached\". */\n limitReached: string;\n /** Mode `upgrade`: what the action does. */\n limitUpgrade: string;\n /** Mode `contact` (the operator grants plans by hand, keksdose's today). */\n limitContact: string;\n /** Mode `contact`'s action, a mail to support: \"Ask for more\". */\n askForMore: string;\n /** The meter's value: \"3 of 3\". Both figures are formatted already. */\n usage: (used: string, limit: string) => string;\n /** The subject of the `contact` mail; `dimension` is the app's name for it (\"Budgets\"). */\n contactSubject: (dimension: string) => string;\n\n /* ── The provider's portal (§7, §12.26) ── */\n /** The portal: payment method and invoices (§2.8, the provider hosts both). */\n manage: string;\n /**\n * The visible cancel link on the app's subscription page (§12.26). German: §312k BGB\n * wants the button that leads to the cancellation labelled \"Verträge hier kündigen\" or\n * as unambiguously — a translator should use exactly that.\n */\n cancel: string;\n\n /* ── Offline (§12.5) ── */\n /** Changes refused as `billing_read_only` inside a sync reply, kept queued and sent\n * after payment: \"3 changes waiting for a plan\". */\n waitingChanges: (count: number) => string;\n /** The sign-out guard's way out for someone who will not pay. */\n discardWaiting: string;\n\n /* ── Refusals with no part of their own (0.32.1, kastlan's 0.32 report) ── */\n /**\n * `billing_not_configured`: billing is on but the provider's settings are missing — the\n * operator's mistake, so the words ask the payer to wait, not to act. For the toast or\n * alert after \"Choose a plan\" or \"Payment and invoices\" (`isBillingError(err,\n * \"billing_not_configured\")`). `billing_read_only` and `plan_limit` need none: the\n * write lock, the banner and `PlanLimitNotice` say them.\n */\n notConfigured: string;\n /** `billing_disabled`: billing is switched off on this server (§2.9), for a page or a\n * link that reached it anyway. */\n disabled: string;\n}\n\n/** \"today\", \"tomorrow\", \"in 5 days\". */\nfunction inDays(days: number): string {\n if (days <= 0) return \"today\";\n if (days === 1) return \"tomorrow\";\n return `in ${days} days`;\n}\n\nexport const DEFAULT_BILLING_LABELS: BillingLabels = {\n group: \"Subscription\",\n\n plans: \"Plans\",\n interval: \"Billing period\",\n yearly: \"Yearly\",\n monthly: \"Monthly\",\n currency: \"Currency\",\n perYear: \"per year\",\n perMonth: \"per month\",\n vatIncluded: \"VAT included\",\n free: \"Free\",\n notOffered: \"Not offered for this billing period\",\n unlimited: \"Unlimited\",\n limits: \"Limits\",\n features: \"Included\",\n current: \"Current plan\",\n choose: (plan) => `Choose ${plan}`,\n upgrade: (plan) => `Upgrade to ${plan}`,\n downgrade: (plan) => `Switch to ${plan}`,\n isCurrent: \"This is your current plan.\",\n pickFirst: \"Pick a plan first.\",\n\n status: {\n trialing: \"Trial\",\n active: \"Active\",\n past_due: \"Payment overdue\",\n canceled: \"Cancelled\",\n expired: \"Expired\",\n comped: \"Complimentary\",\n },\n\n trialEnding: (days) =>\n `Your trial ends ${inDays(days)}. After that you can still view everything, but changes need a plan.`,\n grantEnding: (days) =>\n `Your free access ends ${inDays(days)}. After that you can still view everything, but changes need a plan.`,\n paymentFailed: \"Your last payment didn’t go through. Update your payment method to keep your plan.\",\n planEnded: \"Your plan has ended. You can still view and export everything; choose a plan to make changes again.\",\n guestReadOnly: (item) =>\n item ? `“${item}” is read-only for now; its owner can lift that.` : \"This is read-only for now; its owner can lift that.\",\n processing: \"Your payment is being processed. Your plan starts as soon as it’s confirmed; this page updates by itself.\",\n choosePlan: \"Choose a plan\",\n updatePayment: \"Update payment method\",\n checkAgain: \"Check again\",\n\n lockReason: \"Your plan has ended. Choose a plan to make changes again.\",\n\n limitReached: \"Plan limit reached\",\n limitUpgrade: \"To add more, choose a plan with a higher limit.\",\n limitContact: \"To add more, ask us for a higher limit.\",\n askForMore: \"Ask for more\",\n usage: (used, limit) => `${used} of ${limit}`,\n contactSubject: (dimension) => `Plan limit: ${dimension}`,\n\n manage: \"Payment and invoices\",\n cancel: \"Cancel subscription\",\n\n waitingChanges: (count) =>\n count === 1 ? \"1 change waiting for a plan\" : `${count} changes waiting for a plan`,\n discardWaiting: \"Discard waiting changes\",\n\n notConfigured: \"Payments aren't set up yet. Please try again later.\",\n disabled: \"Subscriptions aren't available here.\",\n};\n\n/** The `billing` namespace, resolved: English, then the provider, then `labels` — which\n * may be partial at every depth (`{ status: { comped: \"Beta\" } }`). */\nexport function useBillingLabels(labels?: LabelOverride<BillingLabels>): BillingLabels {\n return useKitLabels(\"billing\", DEFAULT_BILLING_LABELS, labels as Partial<BillingLabels> | undefined);\n}\n"],"mappings":";AAAA,SAAS,oBAAoB;AAmBtB,MAAM,wBAAuD,OAAO,OAAO;AAAA,EAChF;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AA0ID,SAAS,OAAO,MAAsB;AACpC,MAAI,QAAQ,EAAG,QAAO;AACtB,MAAI,SAAS,EAAG,QAAO;AACvB,SAAO,MAAM,IAAI;AACnB;AAEO,MAAM,yBAAwC;AAAA,EACnD,OAAO;AAAA,EAEP,OAAO;AAAA,EACP,UAAU;AAAA,EACV,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,UAAU;AAAA,EACV,SAAS;AAAA,EACT,UAAU;AAAA,EACV,aAAa;AAAA,EACb,MAAM;AAAA,EACN,YAAY;AAAA,EACZ,WAAW;AAAA,EACX,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,SAAS;AAAA,EACT,QAAQ,CAAC,SAAS,UAAU,IAAI;AAAA,EAChC,SAAS,CAAC,SAAS,cAAc,IAAI;AAAA,EACrC,WAAW,CAAC,SAAS,aAAa,IAAI;AAAA,EACtC,WAAW;AAAA,EACX,WAAW;AAAA,EAEX,QAAQ;AAAA,IACN,UAAU;AAAA,IACV,QAAQ;AAAA,IACR,UAAU;AAAA,IACV,UAAU;AAAA,IACV,SAAS;AAAA,IACT,QAAQ;AAAA,EACV;AAAA,EAEA,aAAa,CAAC,SACZ,mBAAmB,OAAO,IAAI,CAAC;AAAA,EACjC,aAAa,CAAC,SACZ,yBAAyB,OAAO,IAAI,CAAC;AAAA,EACvC,eAAe;AAAA,EACf,WAAW;AAAA,EACX,eAAe,CAAC,SACd,OAAO,SAAI,IAAI,0DAAqD;AAAA,EACtE,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ,eAAe;AAAA,EACf,YAAY;AAAA,EAEZ,YAAY;AAAA,EAEZ,cAAc;AAAA,EACd,cAAc;AAAA,EACd,cAAc;AAAA,EACd,YAAY;AAAA,EACZ,OAAO,CAAC,MAAM,UAAU,GAAG,IAAI,OAAO,KAAK;AAAA,EAC3C,gBAAgB,CAAC,cAAc,eAAe,SAAS;AAAA,EAEvD,QAAQ;AAAA,EACR,QAAQ;AAAA,EAER,gBAAgB,CAAC,UACf,UAAU,IAAI,gCAAgC,GAAG,KAAK;AAAA,EACxD,gBAAgB;AAAA,EAEhB,eAAe;AAAA,EACf,UAAU;AACZ;AAIO,SAAS,iBAAiB,QAAsD;AACrF,SAAO,aAAa,WAAW,wBAAwB,MAA4C;AACrG;","names":[]}
@@ -0,0 +1,158 @@
1
+ import { ReactNode } from 'react';
2
+ import { e4 as LabelOverride, bH as BillingLabels } from '../delete-account-setting-FLyJf-kZ.js';
3
+ import '../components/tooltip.js';
4
+ import '../hooks/use-anchored-rect.js';
5
+ import '../lib/clipping.js';
6
+ import '../data-table-labels-kpAAVi6g.js';
7
+ import '../components/data-table-sort.js';
8
+ import '../components/swipeable-row.js';
9
+ import '../components/mini-calendar.js';
10
+ import '../components/calendar-heatmap.js';
11
+ import '../components/popover.js';
12
+ import '../hooks/use-breakpoint.js';
13
+ import '../components/chip.js';
14
+ import 'lucide-react';
15
+ import '../components/field-parts.js';
16
+ import '../components/field-sync.js';
17
+ import '../wizard/types.js';
18
+ import '../tour/tour.js';
19
+ import '../search/command-palette.js';
20
+ import '../search/global-search.js';
21
+ import '../search/search-index.js';
22
+ import '../components/month-picker.js';
23
+ import '../components/page-contents.js';
24
+ import '../components/series-chart-labels.js';
25
+ import '../components/pie-chart-labels.js';
26
+ import '../components/sparkline.js';
27
+ import '../components/stat-tile.js';
28
+ import '../components/signature-pad.js';
29
+ import '../components/password-strength.js';
30
+ import '../components/swatch-picker.js';
31
+ import '../components/tile-radio.js';
32
+ import '../components/icon-picker.js';
33
+ import '../components/dialog-frame.js';
34
+ import '../components/modal.js';
35
+ import '../hooks/use-search-param-state.js';
36
+ import '../components/measured-grid.js';
37
+ import '../components/user-avatar.js';
38
+ import '../lib/person-name.js';
39
+ import '../components/status-dot.js';
40
+ import '../components/progress-bar.js';
41
+ import '../components/signed-amount.js';
42
+ import '../shell/topbar-action-menu.js';
43
+ import '../components/menu-item.js';
44
+ import '../components/floating-panel.js';
45
+ import '../hooks/use-authed-src.js';
46
+ import '../components/account-settings-labels.js';
47
+ import '../components/bulk-action-bar.js';
48
+ import '../components/list.js';
49
+ import '../components/breadcrumbs.js';
50
+ import '../components/toast.js';
51
+ import '../components/description-list.js';
52
+ import '../components/line-items.js';
53
+ import '../components/error-boundary.js';
54
+ import '../components/authed-image.js';
55
+ import '../components/image-grid.js';
56
+ import '../components/lightbox.js';
57
+ import '../components/write-lock.js';
58
+ import '../auth/sign-in-form.js';
59
+ import '../landing/access.js';
60
+ import '../landing/landing-labels.js';
61
+ import '../shell/topbar-controls.js';
62
+ import '../theme/palette-presets.js';
63
+ import '../theme/chart-palette.js';
64
+ import '../theme/theme-store.js';
65
+ import 'zustand/middleware';
66
+ import 'zustand';
67
+ import '../auth/complete-name-dialog.js';
68
+ import '../auth/forgot-password-form.js';
69
+ import '../auth/status-parts.js';
70
+ import '../auth/reset-password-form.js';
71
+ import '../auth/verify-email.js';
72
+ import '../auth/not-found-page.js';
73
+ import '../auth/accept-invitation.js';
74
+ import '../shell/company-switcher.js';
75
+ import '../account/email-change-setting.js';
76
+ import '../account/sessions-setting.js';
77
+ import '../lib/format.js';
78
+ import '../account/data-export-setting.js';
79
+ import '../components/account-chips.js';
80
+ import '../admin/admin-parts.js';
81
+ import '../admin/admin-action-log.js';
82
+ import '../settings/settings-labels.js';
83
+ import '../demo/demo-labels.js';
84
+ import '../components/appearance-labels.js';
85
+ import '../theme/contrast.js';
86
+ import '../theme/text-size.js';
87
+ import '../components/reauth-dialog.js';
88
+ import '../components/server-wake.js';
89
+ import '../lib/server-wake.js';
90
+ import '../components/translation-review-labels.js';
91
+ import '../lib/translation-review.js';
92
+ import '../components/country-select.js';
93
+ import '../components/inline-edit-field.js';
94
+ import '../lib/iban.js';
95
+ import '../lib/phone.js';
96
+ import '../components/sign-chip.js';
97
+ import '../components/column-mapper.js';
98
+ import '../lib/column-mapping.js';
99
+ import '../lib/table-text.js';
100
+ import '../components/focus-ring.js';
101
+
102
+ /** One reason an app may lock writing: whether it locks now, and its one sentence. */
103
+ interface WriteLockSource {
104
+ locked: boolean;
105
+ /** The sentence a locked commit shows ("Not possible in the demo."). */
106
+ reason?: ReactNode;
107
+ }
108
+ /** What {@link combineWriteLocks} answers: the props of one `WriteLockProvider`. */
109
+ interface CombinedWriteLock {
110
+ locked: boolean;
111
+ /** The first locked source's reason; `undefined` while nothing locks. */
112
+ reason: ReactNode | undefined;
113
+ }
114
+ /**
115
+ * Several reasons to lock writing, as ONE `WriteLockProvider` (docs/billing-harmonization.md
116
+ * §12.6): the demo's read-only data and billing's read-only lapse, in keksdose's case on
117
+ * the same budget page.
118
+ *
119
+ * const demo = useDemoLabels();
120
+ * const billingReason = useBillingLockReason({ guest: !isOwner, item: budget.name });
121
+ * <WriteLockProvider {...combineWriteLocks([
122
+ * { locked: demoReadOnly, reason: demo.writeLocked },
123
+ * { locked: budget.locked === "billing", reason: billingReason },
124
+ * ])}>
125
+ *
126
+ * WHY NOT TWO NESTED PROVIDERS: the nearest provider wins (write-lock.tsx), and an inner
127
+ * `locked={false}` REOPENS an outer lock on purpose — a viewer's own notes on a shared
128
+ * curve. So `<Demo locked><Billing locked={false}>` would unlock the demo's data, and an
129
+ * app would have to mount the inner provider only while it locks. One provider fed by
130
+ * this function has no such order to get wrong.
131
+ *
132
+ * Locked when any source is; the reason is the FIRST locked source's, so list them in the
133
+ * order the server refuses them (§12.3): the demo's 403 before billing's 402. One sentence,
134
+ * not two joined: a tooltip answers "why can't I?" once, and in practice one source locks
135
+ * at a time — demo users have no subscription row and are never gated (§12.7). `null`,
136
+ * `undefined` and `false` entries are skipped, for `cond && { … }`.
137
+ */
138
+ declare function combineWriteLocks(sources: ReadonlyArray<WriteLockSource | null | undefined | false>): CombinedWriteLock;
139
+ interface BillingLockReasonOptions {
140
+ /**
141
+ * The reader is a GUEST in someone else's item (§12.6): the reason never says why
142
+ * beyond "for now", because the owner's payment status is the owner's personal data —
143
+ * "This budget is read-only for now; its owner can lift that." Default false: the
144
+ * reader is the payer, "Your plan has ended. Choose a plan to make changes again."
145
+ */
146
+ guest?: boolean;
147
+ /** A guest's item, by its own name ("Household 2026"). Ignored for the payer. */
148
+ item?: string;
149
+ labels?: LabelOverride<BillingLabels>;
150
+ }
151
+ /**
152
+ * The billing lock's sentence for a `WriteLockProvider` (§3.3), in the `billing` words of
153
+ * the nearest provider: the payer's `lockReason`, or a guest's `guestReadOnly`. Feed it
154
+ * to {@link combineWriteLocks} beside the demo's.
155
+ */
156
+ declare function useBillingLockReason(options?: BillingLockReasonOptions): string;
157
+
158
+ export { type BillingLockReasonOptions, type CombinedWriteLock, type WriteLockSource, combineWriteLocks, useBillingLockReason };
@@ -0,0 +1,17 @@
1
+ "use client";
2
+ import { useBillingLabels } from "./billing-labels.js";
3
+ function combineWriteLocks(sources) {
4
+ for (const source of sources) {
5
+ if (source && source.locked) return { locked: true, reason: source.reason };
6
+ }
7
+ return { locked: false, reason: void 0 };
8
+ }
9
+ function useBillingLockReason(options = {}) {
10
+ const labels = useBillingLabels(options.labels);
11
+ return options.guest ? labels.guestReadOnly(options.item) : labels.lockReason;
12
+ }
13
+ export {
14
+ combineWriteLocks,
15
+ useBillingLockReason
16
+ };
17
+ //# sourceMappingURL=billing-lock.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/billing/billing-lock.ts"],"sourcesContent":["import type { ReactNode } from \"react\";\n\nimport type { LabelOverride } from \"../i18n/kit-labels\";\nimport { useBillingLabels } from \"./billing-labels\";\nimport type { BillingLabels } from \"./billing-labels\";\n\n/** One reason an app may lock writing: whether it locks now, and its one sentence. */\nexport interface WriteLockSource {\n locked: boolean;\n /** The sentence a locked commit shows (\"Not possible in the demo.\"). */\n reason?: ReactNode;\n}\n\n/** What {@link combineWriteLocks} answers: the props of one `WriteLockProvider`. */\nexport interface CombinedWriteLock {\n locked: boolean;\n /** The first locked source's reason; `undefined` while nothing locks. */\n reason: ReactNode | undefined;\n}\n\n/**\n * Several reasons to lock writing, as ONE `WriteLockProvider` (docs/billing-harmonization.md\n * §12.6): the demo's read-only data and billing's read-only lapse, in keksdose's case on\n * the same budget page.\n *\n * const demo = useDemoLabels();\n * const billingReason = useBillingLockReason({ guest: !isOwner, item: budget.name });\n * <WriteLockProvider {...combineWriteLocks([\n * { locked: demoReadOnly, reason: demo.writeLocked },\n * { locked: budget.locked === \"billing\", reason: billingReason },\n * ])}>\n *\n * WHY NOT TWO NESTED PROVIDERS: the nearest provider wins (write-lock.tsx), and an inner\n * `locked={false}` REOPENS an outer lock on purpose — a viewer's own notes on a shared\n * curve. So `<Demo locked><Billing locked={false}>` would unlock the demo's data, and an\n * app would have to mount the inner provider only while it locks. One provider fed by\n * this function has no such order to get wrong.\n *\n * Locked when any source is; the reason is the FIRST locked source's, so list them in the\n * order the server refuses them (§12.3): the demo's 403 before billing's 402. One sentence,\n * not two joined: a tooltip answers \"why can't I?\" once, and in practice one source locks\n * at a time — demo users have no subscription row and are never gated (§12.7). `null`,\n * `undefined` and `false` entries are skipped, for `cond && { … }`.\n */\nexport function combineWriteLocks(\n sources: ReadonlyArray<WriteLockSource | null | undefined | false>,\n): CombinedWriteLock {\n for (const source of sources) {\n if (source && source.locked) return { locked: true, reason: source.reason };\n }\n return { locked: false, reason: undefined };\n}\n\nexport interface BillingLockReasonOptions {\n /**\n * The reader is a GUEST in someone else's item (§12.6): the reason never says why\n * beyond \"for now\", because the owner's payment status is the owner's personal data —\n * \"This budget is read-only for now; its owner can lift that.\" Default false: the\n * reader is the payer, \"Your plan has ended. Choose a plan to make changes again.\"\n */\n guest?: boolean;\n /** A guest's item, by its own name (\"Household 2026\"). Ignored for the payer. */\n item?: string;\n labels?: LabelOverride<BillingLabels>;\n}\n\n/**\n * The billing lock's sentence for a `WriteLockProvider` (§3.3), in the `billing` words of\n * the nearest provider: the payer's `lockReason`, or a guest's `guestReadOnly`. Feed it\n * to {@link combineWriteLocks} beside the demo's.\n */\nexport function useBillingLockReason(options: BillingLockReasonOptions = {}): string {\n const labels = useBillingLabels(options.labels);\n return options.guest ? labels.guestReadOnly(options.item) : labels.lockReason;\n}\n"],"mappings":";AAGA,SAAS,wBAAwB;AAyC1B,SAAS,kBACd,SACmB;AACnB,aAAW,UAAU,SAAS;AAC5B,QAAI,UAAU,OAAO,OAAQ,QAAO,EAAE,QAAQ,MAAM,QAAQ,OAAO,OAAO;AAAA,EAC5E;AACA,SAAO,EAAE,QAAQ,OAAO,QAAQ,OAAU;AAC5C;AAoBO,SAAS,qBAAqB,UAAoC,CAAC,GAAW;AACnF,QAAM,SAAS,iBAAiB,QAAQ,MAAM;AAC9C,SAAO,QAAQ,QAAQ,OAAO,cAAc,QAAQ,IAAI,IAAI,OAAO;AACrE;","names":[]}
@@ -0,0 +1,149 @@
1
+ import { DateInput } from '../lib/format.js';
2
+ import { fb as SubscriptionStatus } from '../delete-account-setting-FLyJf-kZ.js';
3
+ import 'react';
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 '../account/data-export-setting.js';
79
+ import '../components/account-chips.js';
80
+ import '../admin/admin-parts.js';
81
+ import '../admin/admin-action-log.js';
82
+ import '../settings/settings-labels.js';
83
+ import '../demo/demo-labels.js';
84
+ import '../components/appearance-labels.js';
85
+ import '../theme/contrast.js';
86
+ import '../theme/text-size.js';
87
+ import '../components/reauth-dialog.js';
88
+ import '../components/server-wake.js';
89
+ import '../lib/server-wake.js';
90
+ import '../components/translation-review-labels.js';
91
+ import '../lib/translation-review.js';
92
+ import '../components/country-select.js';
93
+ import '../components/inline-edit-field.js';
94
+ import '../lib/iban.js';
95
+ import '../lib/phone.js';
96
+ import '../components/sign-chip.js';
97
+ import '../components/column-mapper.js';
98
+ import '../lib/column-mapping.js';
99
+ import '../lib/table-text.js';
100
+ import '../components/focus-ring.js';
101
+
102
+ /**
103
+ * What a device knows of the payer's standing — the fields of `GET /billing/overview`
104
+ * (docs/billing-harmonization.md §4) that decide the read-only lock, under their wire
105
+ * names. Pass the overview as it came; the other fields are ignored.
106
+ */
107
+ interface BillingStanding {
108
+ status: SubscriptionStatus;
109
+ /** The server's answer at the time of the read (§3.3). */
110
+ in_good_standing: boolean;
111
+ /** When a trial ends (§3.2). Empty for a pure guest whose trial has not started (§12.9). */
112
+ trial_ends_at?: DateInput;
113
+ /** When a free grant ends: a beta user's 12 months, an operator's grant. Empty for a
114
+ * grant without an end (§12.8). */
115
+ comped_until?: DateInput;
116
+ }
117
+ /**
118
+ * The moment this payer's data becomes read-only by itself, known IN ADVANCE — or `null`
119
+ * when no date says so (docs/billing-harmonization.md §12.5).
120
+ *
121
+ * A device writes locally first and sends later (keksdose's outbox, an encrypted budget
122
+ * always), so a lock that only arrives with the server's 402 comes after the UI already
123
+ * said "saved" — keksdose's phantom save (dev#496). The two dates that end good standing
124
+ * on a schedule are in the overview, so the device locks itself on time, offline too:
125
+ * a trial at `trial_ends_at`, a grant at `comped_until`. Only `past_due` → `expired`
126
+ * depends on the provider's retries and waits for the next sync.
127
+ */
128
+ declare function billingLockAt(standing: BillingStanding): Date | null;
129
+ /**
130
+ * Whether the payer's data is read-only at `now` (default: the present moment): the
131
+ * server already said so (`in_good_standing: false`), or a date from
132
+ * {@link billingLockAt} has passed since the overview was read. Mirror it into the app's
133
+ * offline write gate and its `WriteLockProvider` (§3.3, §12.5).
134
+ *
135
+ * A GUEST's device cannot do this for the owner: the owner's dates are the owner's
136
+ * personal data (§12.6). An item shared with a guest carries `locked: "billing" | null`,
137
+ * which the guest's device mirrors as it comes.
138
+ */
139
+ declare function isBillingReadOnly(standing: BillingStanding, now?: number | Date): boolean;
140
+ /**
141
+ * Whole calendar days from `now` to `endsAt`, in the device's time zone — 0 on the day
142
+ * itself (and after it), 1 the day before — or `null` for no readable date. The count a
143
+ * trial or grant banner says ("ends tomorrow", "ends in 5 days"), from the day a reader
144
+ * lives in rather than from 24-hour blocks: a trial ending at 01:00 tomorrow ends
145
+ * "tomorrow", not "today".
146
+ */
147
+ declare function billingDaysLeft(endsAt: DateInput, now?: number | Date): number | null;
148
+
149
+ export { type BillingStanding, billingDaysLeft, billingLockAt, isBillingReadOnly };
@@ -0,0 +1,28 @@
1
+ "use client";
2
+ import { toDate } from "../lib/format.js";
3
+ function billingLockAt(standing) {
4
+ if (standing.status === "trialing") return toDate(standing.trial_ends_at ?? null);
5
+ if (standing.status === "comped") return toDate(standing.comped_until ?? null);
6
+ return null;
7
+ }
8
+ function isBillingReadOnly(standing, now = Date.now()) {
9
+ if (!standing.in_good_standing) return true;
10
+ const at = billingLockAt(standing);
11
+ const instant = typeof now === "number" ? now : now.getTime();
12
+ return at !== null && at.getTime() <= instant;
13
+ }
14
+ const DAY = 864e5;
15
+ function billingDaysLeft(endsAt, now = Date.now()) {
16
+ const end = toDate(endsAt);
17
+ if (!end) return null;
18
+ const from = typeof now === "number" ? new Date(now) : now;
19
+ const endDay = new Date(end.getFullYear(), end.getMonth(), end.getDate()).getTime();
20
+ const fromDay = new Date(from.getFullYear(), from.getMonth(), from.getDate()).getTime();
21
+ return Math.max(0, Math.round((endDay - fromDay) / DAY));
22
+ }
23
+ export {
24
+ billingDaysLeft,
25
+ billingLockAt,
26
+ isBillingReadOnly
27
+ };
28
+ //# sourceMappingURL=billing-standing.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/billing/billing-standing.ts"],"sourcesContent":["import { toDate } from \"../lib/format\";\nimport type { DateInput } from \"../lib/format\";\nimport type { SubscriptionStatus } from \"./billing-labels\";\n\n/**\n * What a device knows of the payer's standing — the fields of `GET /billing/overview`\n * (docs/billing-harmonization.md §4) that decide the read-only lock, under their wire\n * names. Pass the overview as it came; the other fields are ignored.\n */\nexport interface BillingStanding {\n status: SubscriptionStatus;\n /** The server's answer at the time of the read (§3.3). */\n in_good_standing: boolean;\n /** When a trial ends (§3.2). Empty for a pure guest whose trial has not started (§12.9). */\n trial_ends_at?: DateInput;\n /** When a free grant ends: a beta user's 12 months, an operator's grant. Empty for a\n * grant without an end (§12.8). */\n comped_until?: DateInput;\n}\n\n/**\n * The moment this payer's data becomes read-only by itself, known IN ADVANCE — or `null`\n * when no date says so (docs/billing-harmonization.md §12.5).\n *\n * A device writes locally first and sends later (keksdose's outbox, an encrypted budget\n * always), so a lock that only arrives with the server's 402 comes after the UI already\n * said \"saved\" — keksdose's phantom save (dev#496). The two dates that end good standing\n * on a schedule are in the overview, so the device locks itself on time, offline too:\n * a trial at `trial_ends_at`, a grant at `comped_until`. Only `past_due` → `expired`\n * depends on the provider's retries and waits for the next sync.\n */\nexport function billingLockAt(standing: BillingStanding): Date | null {\n if (standing.status === \"trialing\") return toDate(standing.trial_ends_at ?? null);\n if (standing.status === \"comped\") return toDate(standing.comped_until ?? null);\n return null;\n}\n\n/**\n * Whether the payer's data is read-only at `now` (default: the present moment): the\n * server already said so (`in_good_standing: false`), or a date from\n * {@link billingLockAt} has passed since the overview was read. Mirror it into the app's\n * offline write gate and its `WriteLockProvider` (§3.3, §12.5).\n *\n * A GUEST's device cannot do this for the owner: the owner's dates are the owner's\n * personal data (§12.6). An item shared with a guest carries `locked: \"billing\" | null`,\n * which the guest's device mirrors as it comes.\n */\nexport function isBillingReadOnly(standing: BillingStanding, now: number | Date = Date.now()): boolean {\n if (!standing.in_good_standing) return true;\n const at = billingLockAt(standing);\n const instant = typeof now === \"number\" ? now : now.getTime();\n return at !== null && at.getTime() <= instant;\n}\n\nconst DAY = 86_400_000;\n\n/**\n * Whole calendar days from `now` to `endsAt`, in the device's time zone — 0 on the day\n * itself (and after it), 1 the day before — or `null` for no readable date. The count a\n * trial or grant banner says (\"ends tomorrow\", \"ends in 5 days\"), from the day a reader\n * lives in rather than from 24-hour blocks: a trial ending at 01:00 tomorrow ends\n * \"tomorrow\", not \"today\".\n */\nexport function billingDaysLeft(endsAt: DateInput, now: number | Date = Date.now()): number | null {\n const end = toDate(endsAt);\n if (!end) return null;\n const from = typeof now === \"number\" ? new Date(now) : now;\n const endDay = new Date(end.getFullYear(), end.getMonth(), end.getDate()).getTime();\n const fromDay = new Date(from.getFullYear(), from.getMonth(), from.getDate()).getTime();\n // `round`, not `floor`: a day across a DST change is 23 or 25 hours long.\n return Math.max(0, Math.round((endDay - fromDay) / DAY));\n}\n"],"mappings":";AAAA,SAAS,cAAc;AA+BhB,SAAS,cAAc,UAAwC;AACpE,MAAI,SAAS,WAAW,WAAY,QAAO,OAAO,SAAS,iBAAiB,IAAI;AAChF,MAAI,SAAS,WAAW,SAAU,QAAO,OAAO,SAAS,gBAAgB,IAAI;AAC7E,SAAO;AACT;AAYO,SAAS,kBAAkB,UAA2B,MAAqB,KAAK,IAAI,GAAY;AACrG,MAAI,CAAC,SAAS,iBAAkB,QAAO;AACvC,QAAM,KAAK,cAAc,QAAQ;AACjC,QAAM,UAAU,OAAO,QAAQ,WAAW,MAAM,IAAI,QAAQ;AAC5D,SAAO,OAAO,QAAQ,GAAG,QAAQ,KAAK;AACxC;AAEA,MAAM,MAAM;AASL,SAAS,gBAAgB,QAAmB,MAAqB,KAAK,IAAI,GAAkB;AACjG,QAAM,MAAM,OAAO,MAAM;AACzB,MAAI,CAAC,IAAK,QAAO;AACjB,QAAM,OAAO,OAAO,QAAQ,WAAW,IAAI,KAAK,GAAG,IAAI;AACvD,QAAM,SAAS,IAAI,KAAK,IAAI,YAAY,GAAG,IAAI,SAAS,GAAG,IAAI,QAAQ,CAAC,EAAE,QAAQ;AAClF,QAAM,UAAU,IAAI,KAAK,KAAK,YAAY,GAAG,KAAK,SAAS,GAAG,KAAK,QAAQ,CAAC,EAAE,QAAQ;AAEtF,SAAO,KAAK,IAAI,GAAG,KAAK,OAAO,SAAS,WAAW,GAAG,CAAC;AACzD;","names":[]}