@eifi1/ui-kit 0.31.0 → 0.32.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (565) hide show
  1. package/README.md +53 -30
  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-parts.d.ts +8 -1
  5. package/dist/admin/admin-parts.js +1 -1
  6. package/dist/admin/admin-parts.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/auth/reset-password-form.d.ts +1 -1
  21. package/dist/auth/reset-password-form.js +2 -1
  22. package/dist/auth/reset-password-form.js.map +1 -1
  23. package/dist/auth/verify-email.d.ts +4 -0
  24. package/dist/auth/verify-email.js +3 -2
  25. package/dist/auth/verify-email.js.map +1 -1
  26. package/dist/billing/billing-banner.d.ts +184 -0
  27. package/dist/billing/billing-banner.js +98 -0
  28. package/dist/billing/billing-banner.js.map +1 -0
  29. package/dist/billing/billing-labels.d.ts +100 -0
  30. package/dist/billing/billing-labels.js +74 -0
  31. package/dist/billing/billing-labels.js.map +1 -0
  32. package/dist/billing/billing-lock.d.ts +158 -0
  33. package/dist/billing/billing-lock.js +17 -0
  34. package/dist/billing/billing-lock.js.map +1 -0
  35. package/dist/billing/billing-standing.d.ts +149 -0
  36. package/dist/billing/billing-standing.js +28 -0
  37. package/dist/billing/billing-standing.js.map +1 -0
  38. package/dist/billing/plan-card.d.ts +248 -0
  39. package/dist/billing/plan-card.js +248 -0
  40. package/dist/billing/plan-card.js.map +1 -0
  41. package/dist/billing/plan-limit-notice.d.ts +156 -0
  42. package/dist/billing/plan-limit-notice.js +76 -0
  43. package/dist/billing/plan-limit-notice.js.map +1 -0
  44. package/dist/billing/plan-limit.d.ts +34 -0
  45. package/dist/billing/plan-limit.js +20 -0
  46. package/dist/billing/plan-limit.js.map +1 -0
  47. package/dist/billing/plan-price.d.ts +61 -0
  48. package/dist/billing/plan-price.js +45 -0
  49. package/dist/billing/plan-price.js.map +1 -0
  50. package/dist/billing/subscription-actions.d.ts +133 -0
  51. package/dist/billing/subscription-actions.js +28 -0
  52. package/dist/billing/subscription-actions.js.map +1 -0
  53. package/dist/billing/subscription-status-chip.d.ts +149 -0
  54. package/dist/billing/subscription-status-chip.js +48 -0
  55. package/dist/billing/subscription-status-chip.js.map +1 -0
  56. package/dist/chart.d.ts +9 -3
  57. package/dist/components/account-chips.d.ts +16 -4
  58. package/dist/components/account-chips.js +21 -3
  59. package/dist/components/account-chips.js.map +1 -1
  60. package/dist/components/alert-banner.d.ts +6 -1
  61. package/dist/components/alert-banner.js +4 -3
  62. package/dist/components/alert-banner.js.map +1 -1
  63. package/dist/components/amount-input.d.ts +8 -3
  64. package/dist/components/amount-input.js +5 -5
  65. package/dist/components/amount-input.js.map +1 -1
  66. package/dist/components/appearance-labels.d.ts +32 -0
  67. package/dist/components/appearance-labels.js +18 -0
  68. package/dist/components/appearance-labels.js.map +1 -0
  69. package/dist/components/autocomplete.js +2 -2
  70. package/dist/components/autocomplete.js.map +1 -1
  71. package/dist/components/breadcrumbs.js +3 -2
  72. package/dist/components/breadcrumbs.js.map +1 -1
  73. package/dist/components/bulk-action-bar.d.ts +2 -2
  74. package/dist/components/bulk-action-bar.js +7 -12
  75. package/dist/components/bulk-action-bar.js.map +1 -1
  76. package/dist/components/button-group.d.ts +8 -3
  77. package/dist/components/calculator.d.ts +8 -3
  78. package/dist/components/calculator.js +4 -3
  79. package/dist/components/calculator.js.map +1 -1
  80. package/dist/components/calendar-heatmap.js +5 -5
  81. package/dist/components/calendar-heatmap.js.map +1 -1
  82. package/dist/components/chart-height.d.ts +23 -0
  83. package/dist/components/chart-height.js +15 -0
  84. package/dist/components/chart-height.js.map +1 -0
  85. package/dist/components/chart-zoom.js +6 -1
  86. package/dist/components/chart-zoom.js.map +1 -1
  87. package/dist/components/checkbox-group.js +2 -2
  88. package/dist/components/checkbox-group.js.map +1 -1
  89. package/dist/components/checkbox.d.ts +10 -0
  90. package/dist/components/checkbox.js +25 -10
  91. package/dist/components/checkbox.js.map +1 -1
  92. package/dist/components/chip.d.ts +19 -3
  93. package/dist/components/chip.js +47 -21
  94. package/dist/components/chip.js.map +1 -1
  95. package/dist/components/choice-card.d.ts +1 -1
  96. package/dist/components/choice-card.js +8 -7
  97. package/dist/components/choice-card.js.map +1 -1
  98. package/dist/components/column-mapper.js +1 -1
  99. package/dist/components/column-mapper.js.map +1 -1
  100. package/dist/components/combobox-core.js +8 -7
  101. package/dist/components/combobox-core.js.map +1 -1
  102. package/dist/components/combobox.js +8 -8
  103. package/dist/components/combobox.js.map +1 -1
  104. package/dist/components/confirm-dialog.d.ts +8 -3
  105. package/dist/components/confirm-dialog.js +7 -1
  106. package/dist/components/confirm-dialog.js.map +1 -1
  107. package/dist/components/copy-button.d.ts +10 -5
  108. package/dist/components/country-select.js +1 -1
  109. package/dist/components/country-select.js.map +1 -1
  110. package/dist/components/currency-select.js +3 -3
  111. package/dist/components/currency-select.js.map +1 -1
  112. package/dist/components/danger-confirm.d.ts +8 -3
  113. package/dist/components/data-table-cells.d.ts +1 -1
  114. package/dist/components/data-table-filter-popover.d.ts +1 -1
  115. package/dist/components/data-table-filter-popover.js +4 -1
  116. package/dist/components/data-table-filter-popover.js.map +1 -1
  117. package/dist/components/data-table-filters.d.ts +1 -1
  118. package/dist/components/data-table-labels.d.ts +1 -1
  119. package/dist/components/data-table-pagination.d.ts +1 -1
  120. package/dist/components/data-table.d.ts +1 -1
  121. package/dist/components/data-table.js +123 -52
  122. package/dist/components/data-table.js.map +1 -1
  123. package/dist/components/date-picker.d.ts +1 -1
  124. package/dist/components/date-picker.js +7 -5
  125. package/dist/components/date-picker.js.map +1 -1
  126. package/dist/components/description-list.js +2 -2
  127. package/dist/components/description-list.js.map +1 -1
  128. package/dist/components/dialog-frame.js +2 -1
  129. package/dist/components/dialog-frame.js.map +1 -1
  130. package/dist/components/disclosure.js +3 -2
  131. package/dist/components/disclosure.js.map +1 -1
  132. package/dist/components/dropdown.d.ts +1 -1
  133. package/dist/components/dropdown.js +7 -1
  134. package/dist/components/dropdown.js.map +1 -1
  135. package/dist/components/facing-pair.d.ts +19 -6
  136. package/dist/components/facing-pair.js +3 -2
  137. package/dist/components/facing-pair.js.map +1 -1
  138. package/dist/components/field-parts.d.ts +102 -6
  139. package/dist/components/field-parts.js +81 -6
  140. package/dist/components/field-parts.js.map +1 -1
  141. package/dist/components/field-sync.d.ts +4 -1
  142. package/dist/components/field-sync.js +12 -2
  143. package/dist/components/field-sync.js.map +1 -1
  144. package/dist/components/field.js +2 -2
  145. package/dist/components/field.js.map +1 -1
  146. package/dist/components/file-button.d.ts +8 -3
  147. package/dist/components/file-dropzone.d.ts +8 -3
  148. package/dist/components/floating-panel.js +7 -4
  149. package/dist/components/floating-panel.js.map +1 -1
  150. package/dist/components/focus-ring.d.ts +12 -0
  151. package/dist/components/focus-ring.js +8 -0
  152. package/dist/components/focus-ring.js.map +1 -0
  153. package/dist/components/form-actions.d.ts +8 -3
  154. package/dist/components/form-actions.js +33 -19
  155. package/dist/components/form-actions.js.map +1 -1
  156. package/dist/components/full-bleed-dialog.d.ts +11 -1
  157. package/dist/components/full-bleed-dialog.js +3 -1
  158. package/dist/components/full-bleed-dialog.js.map +1 -1
  159. package/dist/components/iban-input.d.ts +8 -3
  160. package/dist/components/image-grid.js +1 -1
  161. package/dist/components/image-grid.js.map +1 -1
  162. package/dist/components/inline-edit-field.js +6 -3
  163. package/dist/components/inline-edit-field.js.map +1 -1
  164. package/dist/components/language-select.d.ts +8 -3
  165. package/dist/components/legal-page.d.ts +26 -5
  166. package/dist/components/legal-page.js +3 -1
  167. package/dist/components/legal-page.js.map +1 -1
  168. package/dist/components/legal.d.ts +8 -3
  169. package/dist/components/legal.js +2 -1
  170. package/dist/components/legal.js.map +1 -1
  171. package/dist/components/lightbox.js +24 -2
  172. package/dist/components/lightbox.js.map +1 -1
  173. package/dist/components/line-items.js +2 -1
  174. package/dist/components/line-items.js.map +1 -1
  175. package/dist/components/list.d.ts +5 -0
  176. package/dist/components/list.js +13 -9
  177. package/dist/components/list.js.map +1 -1
  178. package/dist/components/measured-grid.d.ts +3 -1
  179. package/dist/components/measured-grid.js +38 -20
  180. package/dist/components/measured-grid.js.map +1 -1
  181. package/dist/components/menu-item.js +2 -1
  182. package/dist/components/menu-item.js.map +1 -1
  183. package/dist/components/mini-calendar.js +8 -4
  184. package/dist/components/mini-calendar.js.map +1 -1
  185. package/dist/components/money-field.d.ts +8 -3
  186. package/dist/components/month-picker.js +9 -5
  187. package/dist/components/month-picker.js.map +1 -1
  188. package/dist/components/nav-pills.js +1 -1
  189. package/dist/components/nav-pills.js.map +1 -1
  190. package/dist/components/number-field.d.ts +8 -3
  191. package/dist/components/number-input.d.ts +11 -4
  192. package/dist/components/number-input.js +8 -6
  193. package/dist/components/number-input.js.map +1 -1
  194. package/dist/components/numpad-sheet.d.ts +8 -3
  195. package/dist/components/numpad-sheet.js +2 -1
  196. package/dist/components/numpad-sheet.js.map +1 -1
  197. package/dist/components/one-time-code-input.js +2 -2
  198. package/dist/components/one-time-code-input.js.map +1 -1
  199. package/dist/components/page-contents.js +2 -2
  200. package/dist/components/page-contents.js.map +1 -1
  201. package/dist/components/phone-input.d.ts +8 -3
  202. package/dist/components/phone-input.js +2 -2
  203. package/dist/components/phone-input.js.map +1 -1
  204. package/dist/components/pie-chart.d.ts +8 -2
  205. package/dist/components/pie-chart.js +11 -7
  206. package/dist/components/pie-chart.js.map +1 -1
  207. package/dist/components/popover.d.ts +9 -1
  208. package/dist/components/popover.js +8 -4
  209. package/dist/components/popover.js.map +1 -1
  210. package/dist/components/row-actions.d.ts +100 -0
  211. package/dist/components/row-actions.js +165 -0
  212. package/dist/components/row-actions.js.map +1 -0
  213. package/dist/components/scroll-area.js +1 -1
  214. package/dist/components/scroll-area.js.map +1 -1
  215. package/dist/components/search-field.js +3 -2
  216. package/dist/components/search-field.js.map +1 -1
  217. package/dist/components/series-chart-budget.d.ts +30 -7
  218. package/dist/components/series-chart-budget.js +12 -4
  219. package/dist/components/series-chart-budget.js.map +1 -1
  220. package/dist/components/series-chart-ticks.d.ts +7 -1
  221. package/dist/components/series-chart-ticks.js +6 -0
  222. package/dist/components/series-chart-ticks.js.map +1 -1
  223. package/dist/components/series-chart.d.ts +58 -28
  224. package/dist/components/series-chart.js +42 -32
  225. package/dist/components/series-chart.js.map +1 -1
  226. package/dist/components/settings-fields.d.ts +51 -6
  227. package/dist/components/settings-fields.js +37 -0
  228. package/dist/components/settings-fields.js.map +1 -1
  229. package/dist/components/share-card.d.ts +11 -6
  230. package/dist/components/share-card.js +2 -0
  231. package/dist/components/share-card.js.map +1 -1
  232. package/dist/components/sign-chip.d.ts +4 -0
  233. package/dist/components/sign-chip.js +17 -4
  234. package/dist/components/sign-chip.js.map +1 -1
  235. package/dist/components/signature-pad.d.ts +3 -1
  236. package/dist/components/signature-pad.js +8 -5
  237. package/dist/components/signature-pad.js.map +1 -1
  238. package/dist/components/slider.js +7 -6
  239. package/dist/components/slider.js.map +1 -1
  240. package/dist/components/sparkline.d.ts +5 -1
  241. package/dist/components/sparkline.js +4 -2
  242. package/dist/components/sparkline.js.map +1 -1
  243. package/dist/components/stat-tile.d.ts +17 -1
  244. package/dist/components/stat-tile.js +48 -20
  245. package/dist/components/stat-tile.js.map +1 -1
  246. package/dist/components/status-dot.d.ts +4 -0
  247. package/dist/components/swipeable-row.js +2 -1
  248. package/dist/components/swipeable-row.js.map +1 -1
  249. package/dist/components/switch.d.ts +21 -7
  250. package/dist/components/switch.js +24 -11
  251. package/dist/components/switch.js.map +1 -1
  252. package/dist/components/table.js +2 -2
  253. package/dist/components/table.js.map +1 -1
  254. package/dist/components/text-link.d.ts +8 -3
  255. package/dist/components/text-link.js +1 -1
  256. package/dist/components/text-link.js.map +1 -1
  257. package/dist/components/text.d.ts +7 -2
  258. package/dist/components/text.js +5 -5
  259. package/dist/components/text.js.map +1 -1
  260. package/dist/components/tile-radio.js +2 -1
  261. package/dist/components/tile-radio.js.map +1 -1
  262. package/dist/components/time-input.d.ts +8 -3
  263. package/dist/components/toast.d.ts +18 -2
  264. package/dist/components/toast.js +8 -5
  265. package/dist/components/toast.js.map +1 -1
  266. package/dist/components/toggle-group.d.ts +16 -1
  267. package/dist/components/toggle-group.js +40 -11
  268. package/dist/components/toggle-group.js.map +1 -1
  269. package/dist/components/toggle-legend.d.ts +10 -1
  270. package/dist/components/toggle-legend.js +21 -7
  271. package/dist/components/toggle-legend.js.map +1 -1
  272. package/dist/components/translation-review-parts.d.ts +4 -0
  273. package/dist/components/translation-review.d.ts +4 -0
  274. package/dist/components/translation-review.js +3 -3
  275. package/dist/components/translation-review.js.map +1 -1
  276. package/dist/components/tree-view.js +3 -2
  277. package/dist/components/tree-view.js.map +1 -1
  278. package/dist/components/treemap.d.ts +5 -2
  279. package/dist/components/treemap.js +33 -16
  280. package/dist/components/treemap.js.map +1 -1
  281. package/dist/components/ui.d.ts +8 -3
  282. package/dist/components/ui.js +202 -114
  283. package/dist/components/ui.js.map +1 -1
  284. package/dist/components/use-table-state.d.ts +1 -1
  285. package/dist/components/user-avatar.d.ts +5 -1
  286. package/dist/components/user-avatar.js +1 -1
  287. package/dist/components/user-avatar.js.map +1 -1
  288. package/dist/{data-table-labels-DUELeXpa.d.ts → data-table-labels-kpAAVi6g.d.ts} +26 -2
  289. package/dist/data-table.d.ts +1 -1
  290. package/dist/{delete-account-setting-DCFS5Vof.d.ts → delete-account-setting-BvdQdbv3.d.ts} +613 -58
  291. package/dist/demo/demo-banner.js +1 -0
  292. package/dist/demo/demo-banner.js.map +1 -1
  293. package/dist/feedback/feedback-attachment.d.ts +8 -3
  294. package/dist/feedback/feedback-context.d.ts +8 -3
  295. package/dist/feedback/feedback-crash.d.ts +8 -3
  296. package/dist/feedback/feedback-dialog.d.ts +8 -3
  297. package/dist/feedback/feedback-dialog.js +3 -3
  298. package/dist/feedback/feedback-dialog.js.map +1 -1
  299. package/dist/feedback/feedback-inbox.d.ts +8 -3
  300. package/dist/feedback/feedback-inbox.js +2 -2
  301. package/dist/feedback/feedback-inbox.js.map +1 -1
  302. package/dist/feedback/feedback-labels.d.ts +8 -3
  303. package/dist/feedback/feedback-menu.d.ts +9 -4
  304. package/dist/feedback/feedback-record.d.ts +8 -3
  305. package/dist/feedback/feedback-row-detail.d.ts +8 -3
  306. package/dist/feedback/feedback-status-undo.d.ts +8 -3
  307. package/dist/feedback/feedback-submit.d.ts +8 -3
  308. package/dist/feedback/feedback-swipe.d.ts +8 -3
  309. package/dist/feedback/feedback-table.d.ts +8 -3
  310. package/dist/feedback/feedback-thread.d.ts +8 -3
  311. package/dist/feedback/feedback-thread.js +3 -3
  312. package/dist/feedback/feedback-thread.js.map +1 -1
  313. package/dist/feedback.d.ts +8 -3
  314. package/dist/hooks/use-anchored-panel.d.ts +32 -3
  315. package/dist/hooks/use-anchored-panel.js +21 -3
  316. package/dist/hooks/use-anchored-panel.js.map +1 -1
  317. package/dist/hooks/use-breakpoint.d.ts +77 -0
  318. package/dist/hooks/use-breakpoint.js +50 -0
  319. package/dist/hooks/use-breakpoint.js.map +1 -0
  320. package/dist/hooks/use-file-drop.d.ts +8 -3
  321. package/dist/hooks/use-large-text.d.ts +29 -0
  322. package/dist/hooks/use-large-text.js +20 -0
  323. package/dist/hooks/use-large-text.js.map +1 -0
  324. package/dist/hooks/use-windowed-rows.d.ts +52 -8
  325. package/dist/hooks/use-windowed-rows.js +94 -5
  326. package/dist/hooks/use-windowed-rows.js.map +1 -1
  327. package/dist/i18n/defaults.d.ts +8 -3
  328. package/dist/i18n/defaults.js +8 -0
  329. package/dist/i18n/defaults.js.map +1 -1
  330. package/dist/i18n/german.d.ts +8 -3
  331. package/dist/i18n/german.js +91 -3
  332. package/dist/i18n/german.js.map +1 -1
  333. package/dist/i18n/kit-labels.d.ts +8 -3
  334. package/dist/i18n/kit-labels.js.map +1 -1
  335. package/dist/i18n/languages.d.ts +10 -5
  336. package/dist/i18n/locales/de-CH.d.ts +8 -3
  337. package/dist/i18n/locales/en.d.ts +8 -3
  338. package/dist/i18n/locales/es.d.ts +8 -3
  339. package/dist/i18n/locales/es.js +86 -3
  340. package/dist/i18n/locales/es.js.map +1 -1
  341. package/dist/i18n/locales/fr.d.ts +8 -3
  342. package/dist/i18n/locales/fr.js +88 -3
  343. package/dist/i18n/locales/fr.js.map +1 -1
  344. package/dist/i18n/locales/hu.d.ts +8 -3
  345. package/dist/i18n/locales/hu.js +88 -3
  346. package/dist/i18n/locales/hu.js.map +1 -1
  347. package/dist/i18n/locales/it.d.ts +8 -3
  348. package/dist/i18n/locales/it.js +89 -3
  349. package/dist/i18n/locales/it.js.map +1 -1
  350. package/dist/i18n/locales/zh.d.ts +8 -3
  351. package/dist/i18n/locales/zh.js +86 -3
  352. package/dist/i18n/locales/zh.js.map +1 -1
  353. package/dist/i18n/review.d.ts +8 -3
  354. package/dist/i18n/review.js +16 -1
  355. package/dist/i18n/review.js.map +1 -1
  356. package/dist/index.d.ts +29 -13
  357. package/dist/index.js +77 -5
  358. package/dist/index.js.map +1 -1
  359. package/dist/landing/landing-actions.d.ts +12 -5
  360. package/dist/landing/landing-actions.js +1 -1
  361. package/dist/landing/landing-actions.js.map +1 -1
  362. package/dist/landing/landing-sections.d.ts +8 -3
  363. package/dist/landing/public-header.d.ts +9 -4
  364. package/dist/landing/public-header.js +3 -3
  365. package/dist/landing/public-header.js.map +1 -1
  366. package/dist/landing/routing.d.ts +27 -9
  367. package/dist/landing/routing.js +5 -2
  368. package/dist/landing/routing.js.map +1 -1
  369. package/dist/lib/cn.js +3 -2
  370. package/dist/lib/cn.js.map +1 -1
  371. package/dist/rhf/fields.d.ts +8 -3
  372. package/dist/rhf/fields.js +1 -1
  373. package/dist/rhf/fields.js.map +1 -1
  374. package/dist/rhf/form.d.ts +8 -3
  375. package/dist/rhf/form.js +2 -2
  376. package/dist/rhf/form.js.map +1 -1
  377. package/dist/rhf.d.ts +8 -3
  378. package/dist/search/command-palette.d.ts +1 -1
  379. package/dist/search/command-palette.js +9 -8
  380. package/dist/search/command-palette.js.map +1 -1
  381. package/dist/settings/settings-labels.d.ts +8 -1
  382. package/dist/settings/settings-labels.js +7 -2
  383. package/dist/settings/settings-labels.js.map +1 -1
  384. package/dist/settings/settings-layout.js +2 -1
  385. package/dist/settings/settings-layout.js.map +1 -1
  386. package/dist/settings/settings-section.d.ts +8 -3
  387. package/dist/settings/use-account-appearance.d.ts +92 -0
  388. package/dist/settings/use-account-appearance.js +63 -0
  389. package/dist/settings/use-account-appearance.js.map +1 -0
  390. package/dist/settings/use-settings-route.d.ts +1 -1
  391. package/dist/settings/use-settings-route.js +2 -3
  392. package/dist/settings/use-settings-route.js.map +1 -1
  393. package/dist/shell/app-shell.d.ts +12 -171
  394. package/dist/shell/app-shell.js +144 -28
  395. package/dist/shell/app-shell.js.map +1 -1
  396. package/dist/shell/auth-layout.js +1 -1
  397. package/dist/shell/auth-layout.js.map +1 -1
  398. package/dist/shell/option-switcher-menu.js +1 -1
  399. package/dist/shell/option-switcher-menu.js.map +1 -1
  400. package/dist/shell/top-bar-brand.d.ts +8 -3
  401. package/dist/shell/top-bar-brand.js +3 -1
  402. package/dist/shell/top-bar-brand.js.map +1 -1
  403. package/dist/shell/topbar-action-menu.d.ts +4 -0
  404. package/dist/shell/topbar-action-menu.js +3 -3
  405. package/dist/shell/topbar-action-menu.js.map +1 -1
  406. package/dist/shell/topbar-controls.js +4 -4
  407. package/dist/shell/topbar-controls.js.map +1 -1
  408. package/dist/shell.d.ts +10 -6
  409. package/dist/shell.js.map +1 -1
  410. package/dist/theme/contrast-tokens.d.ts +41 -0
  411. package/dist/theme/contrast-tokens.js +59 -0
  412. package/dist/theme/contrast-tokens.js.map +1 -0
  413. package/dist/theme/contrast.d.ts +109 -0
  414. package/dist/theme/contrast.js +128 -0
  415. package/dist/theme/contrast.js.map +1 -0
  416. package/dist/theme/palette-presets.d.ts +12 -1
  417. package/dist/theme/palette-presets.js +9 -4
  418. package/dist/theme/palette-presets.js.map +1 -1
  419. package/dist/theme/palette-store.js.map +1 -1
  420. package/dist/theme/text-size.d.ts +157 -0
  421. package/dist/theme/text-size.js +121 -0
  422. package/dist/theme/text-size.js.map +1 -0
  423. package/dist/wizard/stepper-nav.d.ts +8 -3
  424. package/dist/wizard.d.ts +8 -3
  425. package/package.json +1 -1
  426. package/src/admin/admin-parts.ts +9 -2
  427. package/src/admin/invitations-panel.tsx +36 -29
  428. package/src/admin/user-roster.tsx +17 -72
  429. package/src/auth/auth-errors.ts +68 -7
  430. package/src/auth/reset-password-form.tsx +6 -2
  431. package/src/auth/verify-email.tsx +14 -2
  432. package/src/billing/billing-banner.tsx +205 -0
  433. package/src/billing/billing-labels.ts +224 -0
  434. package/src/billing/billing-lock.ts +75 -0
  435. package/src/billing/billing-standing.ts +72 -0
  436. package/src/billing/plan-card.tsx +458 -0
  437. package/src/billing/plan-limit-notice.tsx +145 -0
  438. package/src/billing/plan-limit.ts +53 -0
  439. package/src/billing/plan-price.ts +101 -0
  440. package/src/billing/subscription-actions.tsx +76 -0
  441. package/src/billing/subscription-status-chip.tsx +95 -0
  442. package/src/components/account-chips.tsx +36 -10
  443. package/src/components/alert-banner.tsx +11 -6
  444. package/src/components/amount-input.tsx +5 -5
  445. package/src/components/appearance-labels.ts +40 -0
  446. package/src/components/autocomplete.tsx +2 -2
  447. package/src/components/breadcrumbs.tsx +3 -3
  448. package/src/components/bulk-action-bar.tsx +11 -14
  449. package/src/components/calculator.tsx +4 -3
  450. package/src/components/calendar-heatmap.tsx +5 -5
  451. package/src/components/chart-height.ts +30 -0
  452. package/src/components/chart-zoom.tsx +6 -1
  453. package/src/components/checkbox-group.tsx +2 -2
  454. package/src/components/checkbox.tsx +62 -20
  455. package/src/components/chip.tsx +105 -24
  456. package/src/components/choice-card.tsx +15 -10
  457. package/src/components/column-mapper.tsx +1 -1
  458. package/src/components/combobox-core.tsx +8 -7
  459. package/src/components/combobox.tsx +8 -8
  460. package/src/components/confirm-dialog.tsx +20 -1
  461. package/src/components/country-select.tsx +1 -1
  462. package/src/components/currency-select.tsx +3 -3
  463. package/src/components/data-table-filter-popover.tsx +7 -1
  464. package/src/components/data-table.tsx +160 -43
  465. package/src/components/date-picker.tsx +12 -9
  466. package/src/components/description-list.tsx +2 -2
  467. package/src/components/dialog-frame.tsx +2 -1
  468. package/src/components/disclosure.tsx +3 -2
  469. package/src/components/dropdown.tsx +10 -2
  470. package/src/components/facing-pair.ts +12 -5
  471. package/src/components/field-parts.tsx +190 -7
  472. package/src/components/field-sync.tsx +17 -3
  473. package/src/components/field.tsx +2 -2
  474. package/src/components/floating-panel.tsx +7 -4
  475. package/src/components/focus-ring.ts +12 -0
  476. package/src/components/form-actions.tsx +55 -18
  477. package/src/components/full-bleed-dialog.tsx +18 -4
  478. package/src/components/image-grid.tsx +1 -1
  479. package/src/components/inline-edit-field.tsx +6 -3
  480. package/src/components/legal-page.tsx +28 -2
  481. package/src/components/legal.tsx +19 -1
  482. package/src/components/lightbox.tsx +24 -2
  483. package/src/components/line-items.tsx +7 -1
  484. package/src/components/list.tsx +36 -10
  485. package/src/components/measured-grid.tsx +49 -24
  486. package/src/components/menu-item.tsx +2 -2
  487. package/src/components/mini-calendar.tsx +8 -4
  488. package/src/components/month-picker.tsx +9 -5
  489. package/src/components/nav-pills.tsx +1 -1
  490. package/src/components/number-input.tsx +14 -7
  491. package/src/components/numpad-sheet.tsx +2 -2
  492. package/src/components/one-time-code-input.tsx +2 -2
  493. package/src/components/page-contents.tsx +2 -2
  494. package/src/components/phone-input.tsx +2 -2
  495. package/src/components/pie-chart.tsx +19 -9
  496. package/src/components/popover.tsx +22 -5
  497. package/src/components/row-actions.tsx +344 -0
  498. package/src/components/scroll-area.tsx +1 -1
  499. package/src/components/search-field.tsx +4 -2
  500. package/src/components/series-chart-budget.ts +40 -8
  501. package/src/components/series-chart-ticks.ts +10 -0
  502. package/src/components/series-chart.tsx +123 -72
  503. package/src/components/settings-fields.tsx +81 -2
  504. package/src/components/share-card.tsx +10 -0
  505. package/src/components/sign-chip.tsx +28 -4
  506. package/src/components/signature-pad.tsx +13 -7
  507. package/src/components/slider.tsx +22 -9
  508. package/src/components/sparkline.tsx +11 -3
  509. package/src/components/stat-tile.tsx +70 -14
  510. package/src/components/swipeable-row.tsx +2 -1
  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 +99 -12
  518. package/src/components/toggle-legend.tsx +53 -8
  519. package/src/components/translation-review.tsx +10 -5
  520. package/src/components/tree-view.tsx +3 -2
  521. package/src/components/treemap.tsx +27 -10
  522. package/src/components/ui.tsx +331 -145
  523. package/src/components/user-avatar.tsx +1 -1
  524. package/src/demo/demo-banner.tsx +5 -0
  525. package/src/feedback/feedback-dialog.tsx +3 -3
  526. package/src/feedback/feedback-inbox.tsx +2 -2
  527. package/src/feedback/feedback-thread.tsx +3 -3
  528. package/src/hooks/use-anchored-panel.ts +67 -5
  529. package/src/hooks/use-breakpoint.ts +121 -0
  530. package/src/hooks/use-large-text.ts +41 -0
  531. package/src/hooks/use-windowed-rows.ts +168 -12
  532. package/src/i18n/defaults.ts +8 -0
  533. package/src/i18n/german.ts +105 -1
  534. package/src/i18n/kit-labels.tsx +12 -0
  535. package/src/i18n/locales/es.ts +96 -1
  536. package/src/i18n/locales/fr.ts +100 -1
  537. package/src/i18n/locales/hu.ts +98 -1
  538. package/src/i18n/locales/it.ts +101 -1
  539. package/src/i18n/locales/zh.ts +92 -1
  540. package/src/i18n/review.ts +15 -0
  541. package/src/index.ts +82 -8
  542. package/src/landing/landing-actions.tsx +9 -5
  543. package/src/landing/public-header.tsx +4 -4
  544. package/src/landing/routing.tsx +22 -5
  545. package/src/lib/cn.ts +13 -2
  546. package/src/rhf/fields.tsx +1 -1
  547. package/src/rhf/form.tsx +2 -2
  548. package/src/search/command-palette.tsx +10 -9
  549. package/src/settings/settings-labels.ts +13 -1
  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/shell.ts +7 -1
  560. package/src/theme/contrast-tokens.ts +112 -0
  561. package/src/theme/contrast.ts +224 -0
  562. package/src/theme/palette-presets.ts +24 -4
  563. package/src/theme/palette-store.ts +6 -1
  564. package/src/theme/text-size.ts +267 -0
  565. package/tokens.css +143 -1
@@ -1,19 +1,24 @@
1
1
  import * as react from 'react';
2
2
  import { ReactNode } from 'react';
3
- import { eD as SelectProps } from '../delete-account-setting-DCFS5Vof.js';
3
+ import { eY as SelectProps } from '../delete-account-setting-BvdQdbv3.js';
4
4
  import { ToggleGroupBaseProps } from './toggle-group.js';
5
5
  import { ThemePreference } from '../theme/theme-store.js';
6
+ import { TextSize } from '../theme/text-size.js';
7
+ import { ContrastMode } from '../theme/contrast.js';
8
+ import { AppearanceLabels } from './appearance-labels.js';
6
9
  import './tooltip.js';
7
10
  import '../hooks/use-anchored-rect.js';
8
11
  import '../lib/clipping.js';
9
- import '../data-table-labels-DUELeXpa.js';
12
+ import '../data-table-labels-kpAAVi6g.js';
10
13
  import './data-table-sort.js';
11
14
  import './swipeable-row.js';
12
15
  import './mini-calendar.js';
13
16
  import './calendar-heatmap.js';
14
17
  import './popover.js';
18
+ import '../hooks/use-breakpoint.js';
15
19
  import './chip.js';
16
20
  import 'lucide-react';
21
+ import './field-parts.js';
17
22
  import './field-sync.js';
18
23
  import '../wizard/types.js';
19
24
  import '../tour/tour.js';
@@ -94,12 +99,14 @@ import './sign-chip.js';
94
99
  import './column-mapper.js';
95
100
  import '../lib/column-mapping.js';
96
101
  import '../lib/table-text.js';
97
- import './field-parts.js';
102
+ import './focus-ring.js';
98
103
 
99
104
  /**
100
105
  * App-agnostic settings-field components (feedback #333): the language + theme
101
- * controls that every app's settings page needs, so they live in @hb/ui and the
102
- * app just supplies the current value, a change handler and translated labels.
106
+ * controls that every app's settings page needs — and, since 0.32, the text size and
107
+ * the contrast (docs/text-size-harmonization.md §6), whose words are the kit's own
108
+ * `appearance` namespace — so they live in @hb/ui and the app just supplies the
109
+ * current value, a change handler and translated labels.
103
110
  * The app owns WHERE these render (its own settings page) and any app-specific
104
111
  * fields around them.
105
112
  */
@@ -168,5 +175,43 @@ interface LanguageSettingProps extends Omit<SelectProps, "value" | "onChange" |
168
175
  id?: string;
169
176
  }
170
177
  declare function LanguageSetting({ value, onChange, label, options, id, ...rest }: LanguageSettingProps): react.JSX.Element;
178
+ /**
179
+ * What {@link TextSizeSetting} and {@link ContrastSetting} take: a {@link ToggleGroup}'s
180
+ * props — `labelPlacement`, `disabledReason`, `commit`, `size`, `overflow` — minus the
181
+ * options and the value, which they own, as {@link ThemeSettingToggleProps} does.
182
+ */
183
+ type AppearanceToggleProps<T extends string> = Omit<ToggleGroupBaseProps<T>, "options" | "label" | "ariaLabel"> & {
184
+ value: T;
185
+ onChange: (value: T) => void;
186
+ /**
187
+ * The field's visible label. Leave it out inside a row already titled with the
188
+ * setting's name: the group is then named by `aria-label` / `aria-labelledby` if
189
+ * given, else by the kit's own word ("Text size", "Contrast").
190
+ */
191
+ label?: ReactNode;
192
+ /** The `appearance` namespace, for this instance. */
193
+ labels?: Partial<AppearanceLabels>;
194
+ };
195
+ type TextSizeSettingProps = AppearanceToggleProps<TextSize>;
196
+ /**
197
+ * The text size (0.32, docs/text-size-harmonization.md §6): Normal, Large, Extra large as
198
+ * one segmented control, in the core `appearance` group after the theme. Bind it to the
199
+ * size IN FORCE — `useAccountAppearance().textSize` — and hand a pick to its
200
+ * `pickTextSize`, which stores the device's choice and, signed in, the account's.
201
+ *
202
+ * The options wrap rather than truncate (`overflow="wrap"`): at Extra large on a 360 px
203
+ * phone the group has 240 px, and "Extra large" cut to "Extra l…" would be the one
204
+ * setting that cannot read its own value.
205
+ */
206
+ declare function TextSizeSetting({ value, onChange, label, labels: labelsProp, overflow, ...rest }: TextSizeSettingProps): react.JSX.Element;
207
+ type ContrastSettingProps = AppearanceToggleProps<ContrastMode>;
208
+ /**
209
+ * More contrast (0.32, §5, §6): System, Standard, More as one segmented control, beside
210
+ * the text size. Bind it to the stored MODE, "system" included — never to whether more
211
+ * contrast is on at the moment, or a device that asks for more contrast would show
212
+ * "More" and could not say "follow the device" (the theme's lesson, §8 of the settings
213
+ * contract). `useAccountAppearance().contrast` is that mode.
214
+ */
215
+ declare function ContrastSetting({ value, onChange, label, labels: labelsProp, overflow, ...rest }: ContrastSettingProps): react.JSX.Element;
171
216
 
172
- export { LanguageSetting, type LanguageSettingProps, ThemeSetting, type ThemeSettingProps, type ThemeSettingToggleProps };
217
+ export { ContrastSetting, type ContrastSettingProps, LanguageSetting, type LanguageSettingProps, TextSizeSetting, type TextSizeSettingProps, ThemeSetting, type ThemeSettingProps, type ThemeSettingToggleProps };
@@ -2,6 +2,9 @@
2
2
  import { jsx, jsxs } from "react/jsx-runtime";
3
3
  import { Select } from "./ui.js";
4
4
  import { ToggleGroup } from "./toggle-group.js";
5
+ import { TEXT_SIZES } from "../theme/text-size.js";
6
+ import { CONTRAST_MODES } from "../theme/contrast.js";
7
+ import { useAppearanceLabels } from "./appearance-labels.js";
5
8
  function ThemeSetting(props) {
6
9
  if (props.variant === "toggle") {
7
10
  const { variant: _variant2, value: value2, onChange: onChange2, label: label2, optionLabels: optionLabels2, ...rest2 } = props;
@@ -40,8 +43,42 @@ function ThemeSetting(props) {
40
43
  function LanguageSetting({ value, onChange, label, options, id, ...rest }) {
41
44
  return /* @__PURE__ */ jsx(Select, { ...rest, id, label, value, onChange: (e) => onChange(e.target.value), children: options.map((o) => /* @__PURE__ */ jsx("option", { value: o.code, children: o.label }, o.code)) });
42
45
  }
46
+ function TextSizeSetting({ value, onChange, label, labels: labelsProp, overflow = "wrap", ...rest }) {
47
+ const labels = useAppearanceLabels(labelsProp);
48
+ const named = label !== void 0 && label !== null && label !== false;
49
+ return /* @__PURE__ */ jsx(
50
+ ToggleGroup,
51
+ {
52
+ ...rest,
53
+ "aria-label": named || rest["aria-labelledby"] ? rest["aria-label"] : rest["aria-label"] ?? labels.textSize,
54
+ label,
55
+ overflow,
56
+ value,
57
+ onChange,
58
+ options: TEXT_SIZES.map((size) => ({ value: size, label: labels.textSizes[size] }))
59
+ }
60
+ );
61
+ }
62
+ function ContrastSetting({ value, onChange, label, labels: labelsProp, overflow = "wrap", ...rest }) {
63
+ const labels = useAppearanceLabels(labelsProp);
64
+ const named = label !== void 0 && label !== null && label !== false;
65
+ return /* @__PURE__ */ jsx(
66
+ ToggleGroup,
67
+ {
68
+ ...rest,
69
+ "aria-label": named || rest["aria-labelledby"] ? rest["aria-label"] : rest["aria-label"] ?? labels.contrast,
70
+ label,
71
+ overflow,
72
+ value,
73
+ onChange,
74
+ options: CONTRAST_MODES.map((mode) => ({ value: mode, label: labels.contrastModes[mode] }))
75
+ }
76
+ );
77
+ }
43
78
  export {
79
+ ContrastSetting,
44
80
  LanguageSetting,
81
+ TextSizeSetting,
45
82
  ThemeSetting
46
83
  };
47
84
  //# sourceMappingURL=settings-fields.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/components/settings-fields.tsx"],"sourcesContent":["import type { ReactNode } from \"react\";\nimport { Select } from \"./ui\";\nimport type { SelectProps } from \"./ui\";\nimport { ToggleGroup } from \"./toggle-group\";\nimport type { ToggleGroupBaseProps } from \"./toggle-group\";\nimport type { ThemePreference } from \"../theme/theme-store\";\n\n/**\n * App-agnostic settings-field components (feedback #333): the language + theme\n * controls that every app's settings page needs, so they live in @hb/ui and the\n * app just supplies the current value, a change handler and translated labels.\n * The app owns WHERE these render (its own settings page) and any app-specific\n * fields around them.\n */\n\n/**\n * Everything a {@link Select} takes, minus the two this component owns: the value is a\n * {@link ThemePreference} rather than a string, and `onChange` hands over the preference\n * itself because no caller of this wants the event. The rest — `disabled`, `required`,\n * `invalid`, `error`, a `data-tour` anchor — passes straight through, which is what makes\n * this a settings FIELD rather than a fixed widget.\n */\nexport interface ThemeSettingProps\n extends Omit<SelectProps, \"value\" | \"onChange\" | \"children\"> {\n /** The `Select` (default). See {@link ThemeSettingToggleProps} for `\"toggle\"`. */\n variant?: \"select\";\n value: ThemePreference;\n onChange: (value: ThemePreference) => void;\n label: ReactNode;\n /** Translated option labels. */\n optionLabels: { system: string; light: string; dark: string };\n id?: string;\n}\n\n/**\n * `variant=\"toggle\"` (0.31.0, docs/settings-harmonization.md §2.8): the three choices as\n * one segmented control instead of a select — system, light and dark side by side, the\n * choice visible without opening anything, in every app (keksdose offered light and dark\n * only; its store already knew \"system\"). A {@link ToggleGroup}'s props pass through —\n * `labelPlacement`, `disabledReason`, `commit`, `size` — minus the options and the value,\n * which this owns.\n *\n * Bind it to the PREFERENCE (`\"system\"` included), never to the resolved mode: on a\n * system-dark device a control bound to the mode shows \"dark\" and cannot say \"follow the\n * system\" (keksdose's control, §8).\n */\nexport interface ThemeSettingToggleProps\n extends Omit<ToggleGroupBaseProps<ThemePreference>, \"options\" | \"label\" | \"ariaLabel\"> {\n variant: \"toggle\";\n value: ThemePreference;\n onChange: (value: ThemePreference) => void;\n /**\n * Names the group: the field's label, or the label above it (`labelPlacement`). Leave\n * it out inside a card already titled \"Theme\" and name the group with `aria-label` or\n * `aria-labelledby` instead, so the card does not say \"Theme\" twice.\n */\n label?: ReactNode;\n /** Translated option labels. */\n optionLabels: { system: string; light: string; dark: string };\n id?: string;\n}\n\nexport function ThemeSetting(props: ThemeSettingProps | ThemeSettingToggleProps) {\n if (props.variant === \"toggle\") {\n const { variant: _variant, value, onChange, label, optionLabels, ...rest } = props;\n return (\n <ToggleGroup<ThemePreference>\n {...rest}\n label={label}\n value={value}\n onChange={onChange}\n options={[\n { value: \"system\", label: optionLabels.system },\n { value: \"light\", label: optionLabels.light },\n { value: \"dark\", label: optionLabels.dark },\n ]}\n />\n );\n }\n const { variant: _variant, value, onChange, label, optionLabels, id, ...rest } = props;\n return (\n <Select\n {...rest}\n id={id}\n label={label}\n value={value}\n onChange={(e) => onChange(e.target.value as ThemePreference)}\n >\n <option value=\"system\">{optionLabels.system}</option>\n <option value=\"light\">{optionLabels.light}</option>\n <option value=\"dark\">{optionLabels.dark}</option>\n </Select>\n );\n}\n\n/** See {@link ThemeSettingProps}: a `Select`'s props with the value and the change\n * handler re-typed to the language CODE the caller stores. */\nexport interface LanguageSettingProps\n extends Omit<SelectProps, \"value\" | \"onChange\" | \"children\"> {\n value: string;\n onChange: (code: string) => void;\n label: ReactNode;\n options: { code: string; label: string }[];\n id?: string;\n}\n\nexport function LanguageSetting({ value, onChange, label, options, id, ...rest }: LanguageSettingProps) {\n return (\n <Select {...rest} id={id} label={label} value={value} onChange={(e) => onChange(e.target.value)}>\n {options.map((o) => (\n <option key={o.code} value={o.code}>\n {o.label}\n </option>\n ))}\n </Select>\n );\n}\n"],"mappings":";AAkEM,cAeF,YAfE;AAjEN,SAAS,cAAc;AAEvB,SAAS,mBAAmB;AA2DrB,SAAS,aAAa,OAAoD;AAC/E,MAAI,MAAM,YAAY,UAAU;AAC9B,UAAM,EAAE,SAASA,WAAU,OAAAC,QAAO,UAAAC,WAAU,OAAAC,QAAO,cAAAC,eAAc,GAAGC,MAAK,IAAI;AAC7E,WACE;AAAA,MAAC;AAAA;AAAA,QACE,GAAGA;AAAA,QACJ,OAAOF;AAAA,QACP,OAAOF;AAAA,QACP,UAAUC;AAAA,QACV,SAAS;AAAA,UACP,EAAE,OAAO,UAAU,OAAOE,cAAa,OAAO;AAAA,UAC9C,EAAE,OAAO,SAAS,OAAOA,cAAa,MAAM;AAAA,UAC5C,EAAE,OAAO,QAAQ,OAAOA,cAAa,KAAK;AAAA,QAC5C;AAAA;AAAA,IACF;AAAA,EAEJ;AACA,QAAM,EAAE,SAAS,UAAU,OAAO,UAAU,OAAO,cAAc,IAAI,GAAG,KAAK,IAAI;AACjF,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ;AAAA,MACA;AAAA,MACA;AAAA,MACA,UAAU,CAAC,MAAM,SAAS,EAAE,OAAO,KAAwB;AAAA,MAE3D;AAAA,4BAAC,YAAO,OAAM,UAAU,uBAAa,QAAO;AAAA,QAC5C,oBAAC,YAAO,OAAM,SAAS,uBAAa,OAAM;AAAA,QAC1C,oBAAC,YAAO,OAAM,QAAQ,uBAAa,MAAK;AAAA;AAAA;AAAA,EAC1C;AAEJ;AAaO,SAAS,gBAAgB,EAAE,OAAO,UAAU,OAAO,SAAS,IAAI,GAAG,KAAK,GAAyB;AACtG,SACE,oBAAC,UAAQ,GAAG,MAAM,IAAQ,OAAc,OAAc,UAAU,CAAC,MAAM,SAAS,EAAE,OAAO,KAAK,GAC3F,kBAAQ,IAAI,CAAC,MACZ,oBAAC,YAAoB,OAAO,EAAE,MAC3B,YAAE,SADQ,EAAE,IAEf,CACD,GACH;AAEJ;","names":["_variant","value","onChange","label","optionLabels","rest"]}
1
+ {"version":3,"sources":["../../src/components/settings-fields.tsx"],"sourcesContent":["import type { ReactNode } from \"react\";\nimport { Select } from \"./ui\";\nimport type { SelectProps } from \"./ui\";\nimport { ToggleGroup } from \"./toggle-group\";\nimport type { ToggleGroupBaseProps } from \"./toggle-group\";\nimport type { ThemePreference } from \"../theme/theme-store\";\nimport { TEXT_SIZES } from \"../theme/text-size\";\nimport type { TextSize } from \"../theme/text-size\";\nimport { CONTRAST_MODES } from \"../theme/contrast\";\nimport type { ContrastMode } from \"../theme/contrast\";\nimport { useAppearanceLabels } from \"./appearance-labels\";\nimport type { AppearanceLabels } from \"./appearance-labels\";\n\n/**\n * App-agnostic settings-field components (feedback #333): the language + theme\n * controls that every app's settings page needs — and, since 0.32, the text size and\n * the contrast (docs/text-size-harmonization.md §6), whose words are the kit's own\n * `appearance` namespace — so they live in @hb/ui and the app just supplies the\n * current value, a change handler and translated labels.\n * The app owns WHERE these render (its own settings page) and any app-specific\n * fields around them.\n */\n\n/**\n * Everything a {@link Select} takes, minus the two this component owns: the value is a\n * {@link ThemePreference} rather than a string, and `onChange` hands over the preference\n * itself because no caller of this wants the event. The rest — `disabled`, `required`,\n * `invalid`, `error`, a `data-tour` anchor — passes straight through, which is what makes\n * this a settings FIELD rather than a fixed widget.\n */\nexport interface ThemeSettingProps\n extends Omit<SelectProps, \"value\" | \"onChange\" | \"children\"> {\n /** The `Select` (default). See {@link ThemeSettingToggleProps} for `\"toggle\"`. */\n variant?: \"select\";\n value: ThemePreference;\n onChange: (value: ThemePreference) => void;\n label: ReactNode;\n /** Translated option labels. */\n optionLabels: { system: string; light: string; dark: string };\n id?: string;\n}\n\n/**\n * `variant=\"toggle\"` (0.31.0, docs/settings-harmonization.md §2.8): the three choices as\n * one segmented control instead of a select — system, light and dark side by side, the\n * choice visible without opening anything, in every app (keksdose offered light and dark\n * only; its store already knew \"system\"). A {@link ToggleGroup}'s props pass through —\n * `labelPlacement`, `disabledReason`, `commit`, `size` — minus the options and the value,\n * which this owns.\n *\n * Bind it to the PREFERENCE (`\"system\"` included), never to the resolved mode: on a\n * system-dark device a control bound to the mode shows \"dark\" and cannot say \"follow the\n * system\" (keksdose's control, §8).\n */\nexport interface ThemeSettingToggleProps\n extends Omit<ToggleGroupBaseProps<ThemePreference>, \"options\" | \"label\" | \"ariaLabel\"> {\n variant: \"toggle\";\n value: ThemePreference;\n onChange: (value: ThemePreference) => void;\n /**\n * Names the group: the field's label, or the label above it (`labelPlacement`). Leave\n * it out inside a card already titled \"Theme\" and name the group with `aria-label` or\n * `aria-labelledby` instead, so the card does not say \"Theme\" twice.\n */\n label?: ReactNode;\n /** Translated option labels. */\n optionLabels: { system: string; light: string; dark: string };\n id?: string;\n}\n\nexport function ThemeSetting(props: ThemeSettingProps | ThemeSettingToggleProps) {\n if (props.variant === \"toggle\") {\n const { variant: _variant, value, onChange, label, optionLabels, ...rest } = props;\n return (\n <ToggleGroup<ThemePreference>\n {...rest}\n label={label}\n value={value}\n onChange={onChange}\n options={[\n { value: \"system\", label: optionLabels.system },\n { value: \"light\", label: optionLabels.light },\n { value: \"dark\", label: optionLabels.dark },\n ]}\n />\n );\n }\n const { variant: _variant, value, onChange, label, optionLabels, id, ...rest } = props;\n return (\n <Select\n {...rest}\n id={id}\n label={label}\n value={value}\n onChange={(e) => onChange(e.target.value as ThemePreference)}\n >\n <option value=\"system\">{optionLabels.system}</option>\n <option value=\"light\">{optionLabels.light}</option>\n <option value=\"dark\">{optionLabels.dark}</option>\n </Select>\n );\n}\n\n/** See {@link ThemeSettingProps}: a `Select`'s props with the value and the change\n * handler re-typed to the language CODE the caller stores. */\nexport interface LanguageSettingProps\n extends Omit<SelectProps, \"value\" | \"onChange\" | \"children\"> {\n value: string;\n onChange: (code: string) => void;\n label: ReactNode;\n options: { code: string; label: string }[];\n id?: string;\n}\n\nexport function LanguageSetting({ value, onChange, label, options, id, ...rest }: LanguageSettingProps) {\n return (\n <Select {...rest} id={id} label={label} value={value} onChange={(e) => onChange(e.target.value)}>\n {options.map((o) => (\n <option key={o.code} value={o.code}>\n {o.label}\n </option>\n ))}\n </Select>\n );\n}\n\n/**\n * What {@link TextSizeSetting} and {@link ContrastSetting} take: a {@link ToggleGroup}'s\n * props — `labelPlacement`, `disabledReason`, `commit`, `size`, `overflow` — minus the\n * options and the value, which they own, as {@link ThemeSettingToggleProps} does.\n */\ntype AppearanceToggleProps<T extends string> = Omit<ToggleGroupBaseProps<T>, \"options\" | \"label\" | \"ariaLabel\"> & {\n value: T;\n onChange: (value: T) => void;\n /**\n * The field's visible label. Leave it out inside a row already titled with the\n * setting's name: the group is then named by `aria-label` / `aria-labelledby` if\n * given, else by the kit's own word (\"Text size\", \"Contrast\").\n */\n label?: ReactNode;\n /** The `appearance` namespace, for this instance. */\n labels?: Partial<AppearanceLabels>;\n};\n\nexport type TextSizeSettingProps = AppearanceToggleProps<TextSize>;\n\n/**\n * The text size (0.32, docs/text-size-harmonization.md §6): Normal, Large, Extra large as\n * one segmented control, in the core `appearance` group after the theme. Bind it to the\n * size IN FORCE — `useAccountAppearance().textSize` — and hand a pick to its\n * `pickTextSize`, which stores the device's choice and, signed in, the account's.\n *\n * The options wrap rather than truncate (`overflow=\"wrap\"`): at Extra large on a 360 px\n * phone the group has 240 px, and \"Extra large\" cut to \"Extra l…\" would be the one\n * setting that cannot read its own value.\n */\nexport function TextSizeSetting({ value, onChange, label, labels: labelsProp, overflow = \"wrap\", ...rest }: TextSizeSettingProps) {\n const labels = useAppearanceLabels(labelsProp);\n const named = label !== undefined && label !== null && label !== false;\n return (\n <ToggleGroup<TextSize>\n {...rest}\n aria-label={named || rest[\"aria-labelledby\"] ? rest[\"aria-label\"] : (rest[\"aria-label\"] ?? labels.textSize)}\n label={label}\n overflow={overflow}\n value={value}\n onChange={onChange}\n options={TEXT_SIZES.map((size) => ({ value: size, label: labels.textSizes[size] }))}\n />\n );\n}\n\nexport type ContrastSettingProps = AppearanceToggleProps<ContrastMode>;\n\n/**\n * More contrast (0.32, §5, §6): System, Standard, More as one segmented control, beside\n * the text size. Bind it to the stored MODE, \"system\" included — never to whether more\n * contrast is on at the moment, or a device that asks for more contrast would show\n * \"More\" and could not say \"follow the device\" (the theme's lesson, §8 of the settings\n * contract). `useAccountAppearance().contrast` is that mode.\n */\nexport function ContrastSetting({ value, onChange, label, labels: labelsProp, overflow = \"wrap\", ...rest }: ContrastSettingProps) {\n const labels = useAppearanceLabels(labelsProp);\n const named = label !== undefined && label !== null && label !== false;\n return (\n <ToggleGroup<ContrastMode>\n {...rest}\n aria-label={named || rest[\"aria-labelledby\"] ? rest[\"aria-label\"] : (rest[\"aria-label\"] ?? labels.contrast)}\n label={label}\n overflow={overflow}\n value={value}\n onChange={onChange}\n options={CONTRAST_MODES.map((mode) => ({ value: mode, label: labels.contrastModes[mode] }))}\n />\n );\n}\n"],"mappings":";AA0EM,cAeF,YAfE;AAzEN,SAAS,cAAc;AAEvB,SAAS,mBAAmB;AAG5B,SAAS,kBAAkB;AAE3B,SAAS,sBAAsB;AAE/B,SAAS,2BAA2B;AA4D7B,SAAS,aAAa,OAAoD;AAC/E,MAAI,MAAM,YAAY,UAAU;AAC9B,UAAM,EAAE,SAASA,WAAU,OAAAC,QAAO,UAAAC,WAAU,OAAAC,QAAO,cAAAC,eAAc,GAAGC,MAAK,IAAI;AAC7E,WACE;AAAA,MAAC;AAAA;AAAA,QACE,GAAGA;AAAA,QACJ,OAAOF;AAAA,QACP,OAAOF;AAAA,QACP,UAAUC;AAAA,QACV,SAAS;AAAA,UACP,EAAE,OAAO,UAAU,OAAOE,cAAa,OAAO;AAAA,UAC9C,EAAE,OAAO,SAAS,OAAOA,cAAa,MAAM;AAAA,UAC5C,EAAE,OAAO,QAAQ,OAAOA,cAAa,KAAK;AAAA,QAC5C;AAAA;AAAA,IACF;AAAA,EAEJ;AACA,QAAM,EAAE,SAAS,UAAU,OAAO,UAAU,OAAO,cAAc,IAAI,GAAG,KAAK,IAAI;AACjF,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ;AAAA,MACA;AAAA,MACA;AAAA,MACA,UAAU,CAAC,MAAM,SAAS,EAAE,OAAO,KAAwB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K,KAAK,YAAY,KAAK,OAAO;AAAA,MAClG;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,SAAS,eAAe,IAAI,CAAC,UAAU,EAAE,OAAO,MAAM,OAAO,OAAO,cAAc,IAAI,EAAE,EAAE;AAAA;AAAA,EAC5F;AAEJ;","names":["_variant","value","onChange","label","optionLabels","rest"]}
@@ -1,21 +1,23 @@
1
1
  import 'react';
2
2
  import './account-chips.js';
3
3
  import './dialog-frame.js';
4
- export { cE as DEFAULT_SHARE_CARD_LABELS, eE as ShareAddRequest, eF as ShareCandidate, eG as ShareCard, eH as ShareCardLabels, eI as ShareCardProps, eJ as ShareDialog, eK as ShareDialogProps, eL as ShareGrantee, eM as SharePanel, eN as SharePanelProps, eO as SharePendingGrant, eP as ShareRole } from '../delete-account-setting-DCFS5Vof.js';
4
+ export { cP as DEFAULT_SHARE_CARD_LABELS, eZ as ShareAddRequest, e_ as ShareCandidate, e$ as ShareCard, f0 as ShareCardLabels, f1 as ShareCardProps, f2 as ShareDialog, f3 as ShareDialogProps, f4 as ShareGrantee, f5 as SharePanel, f6 as SharePanelProps, f7 as SharePendingGrant, f8 as ShareRole } from '../delete-account-setting-BvdQdbv3.js';
5
5
  import 'lucide-react';
6
6
  import '../lib/format.js';
7
7
  import './chip.js';
8
- import '../data-table-labels-DUELeXpa.js';
8
+ import './field-parts.js';
9
+ import './tooltip.js';
10
+ import '../hooks/use-anchored-rect.js';
11
+ import '../lib/clipping.js';
12
+ import '../data-table-labels-kpAAVi6g.js';
9
13
  import './data-table-sort.js';
10
14
  import './swipeable-row.js';
11
15
  import './modal.js';
12
16
  import '../hooks/use-search-param-state.js';
13
- import './tooltip.js';
14
- import '../hooks/use-anchored-rect.js';
15
- import '../lib/clipping.js';
16
17
  import './mini-calendar.js';
17
18
  import './calendar-heatmap.js';
18
19
  import './popover.js';
20
+ import '../hooks/use-breakpoint.js';
19
21
  import './field-sync.js';
20
22
  import '../wizard/types.js';
21
23
  import '../tour/tour.js';
@@ -79,6 +81,9 @@ import '../admin/admin-parts.js';
79
81
  import '../admin/admin-action-log.js';
80
82
  import '../settings/settings-labels.js';
81
83
  import '../demo/demo-labels.js';
84
+ import './appearance-labels.js';
85
+ import '../theme/contrast.js';
86
+ import '../theme/text-size.js';
82
87
  import './reauth-dialog.js';
83
88
  import './server-wake.js';
84
89
  import '../lib/server-wake.js';
@@ -92,4 +97,4 @@ import './sign-chip.js';
92
97
  import './column-mapper.js';
93
98
  import '../lib/column-mapping.js';
94
99
  import '../lib/table-text.js';
95
- import './field-parts.js';
100
+ import './focus-ring.js';
@@ -251,6 +251,7 @@ function SharePanel({
251
251
  size: "xs",
252
252
  commit: true,
253
253
  label: labels.remove,
254
+ labelVisible: false,
254
255
  pending: busy === key,
255
256
  disabled: busy !== null,
256
257
  onClick: async () => {
@@ -299,6 +300,7 @@ function SharePanel({
299
300
  size: "xs",
300
301
  commit: true,
301
302
  label: labels.revokePending,
303
+ labelVisible: false,
302
304
  pending: busy === key,
303
305
  disabled: busy !== null,
304
306
  onClick: async () => {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/components/share-card.tsx"],"sourcesContent":["import { useState } from \"react\";\nimport type { ReactNode } from \"react\";\nimport { Trash2, UserPlus, UsersRound } from \"lucide-react\";\n\nimport { useKitLabels } from \"../i18n/kit-labels\";\nimport { cn } from \"../lib/cn\";\nimport { AlertBanner } from \"./alert-banner\";\nimport { Autocomplete } from \"./autocomplete\";\nimport type { ComboOption } from \"./combobox-core\";\nimport { Chip } from \"./chip\";\nimport { RoleChip } from \"./account-chips\";\nimport type { RoleDefinition } from \"./account-chips\";\nimport { useConfirm } from \"./confirm-dialog\";\nimport { CopyButton } from \"./copy-button\";\nimport { DialogFrame } from \"./dialog-frame\";\nimport type { DialogFrameProps } from \"./dialog-frame\";\nimport { Caption, SectionLabel } from \"./text\";\nimport { ToggleGroup } from \"./toggle-group\";\nimport { Tooltip } from \"./tooltip\";\nimport { Button, Card, IconButton, Spinner } from \"./ui\";\nimport { useWriteLock } from \"./write-lock\";\nimport type { CardProps } from \"./ui\";\n\n/**\n * Who holds one record, and the owner's every way of changing that — Kurvenschmiede's\n * `features/sharing/share-dialog.tsx` and keksdose's `features/budgets/budget-share-card.tsx`,\n * which are the same component twice (Kurvenschmiede's own doc comment says so).\n *\n * Presentational: the kit draws the rows, asks before a removal (the kit's\n * {@link useConfirm}), keeps the field and the busy state, and checks only that an\n * address is SHAPED like one. Everything that is policy stays with the app — who may\n * share, whether an address has an account (that is what makes a grant pending), what\n * a role permits, every request — through the callbacks, which may return a promise.\n */\n\n// ── Labels ────────────────────────────────────────────────────────────────────\n\nexport interface ShareCardLabels {\n /** ShareDialog's heading. */\n dialogTitle: string;\n /** ShareDialog's close button. */\n close: string;\n /** The add field's label. */\n email: string;\n /** The add field's label when `addWithoutEmail` lets it stay empty. */\n emailOptional: string;\n emailPlaceholder: string;\n /** Under the field when what was typed is not an address. */\n invalidEmail: string;\n /** Accessible name of the role choice beside the field. */\n role: string;\n /** Accessible name of one grantee's role choice. */\n roleOf: (name: string) => string;\n /** The add button. */\n add: string;\n /** Heading over the list. */\n whoHasAccess: string;\n /** The list is empty. */\n nobodyYet: string;\n /** Chip on a grant whose address has no account yet. */\n pending: string;\n /** A pending grant with no address — a link anybody holding it can redeem. */\n openInvite: string;\n copyLink: string;\n /** A candidate that is a team (its sublabel, and the line under a team row). */\n team: string;\n /** Under the field while a team is the one named. */\n teamHint: (name: string) => string;\n /** The remove button on a grantee. */\n remove: string;\n removeConfirm: (name: string) => string;\n /** The remove button on a pending grant. */\n revokePending: string;\n revokePendingConfirm: (name: string) => string;\n /** A callback rejected and no `formatError` says better. */\n failed: string;\n /** Shown while `loading`. */\n loading: string;\n}\n\nexport const DEFAULT_SHARE_CARD_LABELS: ShareCardLabels = {\n dialogTitle: \"Share\",\n close: \"Close\",\n email: \"Email address\",\n emailOptional: \"Email address (optional)\",\n emailPlaceholder: \"name@example.com\",\n invalidEmail: \"Enter a complete email address.\",\n role: \"Role\",\n roleOf: (name) => `Role of ${name}`,\n add: \"Share\",\n whoHasAccess: \"Who has access\",\n nobodyYet: \"Nobody else has access yet.\",\n pending: \"Pending\",\n openInvite: \"Open invite link\",\n copyLink: \"Copy link\",\n team: \"Team\",\n teamHint: (name) => `Everyone in ${name} gets access.`,\n remove: \"Remove access\",\n removeConfirm: (name) => `Remove access for ${name}?`,\n revokePending: \"Withdraw invitation\",\n revokePendingConfirm: (name) => `Withdraw the invitation for ${name}?`,\n failed: \"That did not work. Please try again.\",\n loading: \"Loading…\",\n};\n\n// ── Data shapes ───────────────────────────────────────────────────────────────\n\n/**\n * One role of the app's vocabulary: Kurvenschmiede's viewer/editor, keksdose's guest.\n *\n * The admin roster's {@link RoleDefinition} (label, tone, icon) plus the key it is\n * filed under — an ARRAY here rather than the keyed `RoleVocabulary` record,\n * because the order is the order of the role choice's segments.\n */\nexport type ShareRole = RoleDefinition & {\n key: string;\n /** What the role allows — under the role choice once chosen, and the chip's tooltip. */\n description?: string;\n};\n\n/** Somebody (or a team) who holds the record now. */\nexport interface ShareGrantee {\n id: string | number;\n name: string;\n /** The second line. A team row says {@link ShareCardLabels.team} instead. */\n email?: string | null;\n /** A {@link ShareRole.key}. */\n role: string;\n /** `team`: the grant reaches everybody in it (Kurvenschmiede). Default `person`. */\n kind?: \"person\" | \"team\";\n /** Shown, but neither its role nor its access can be changed here (an owner row). */\n locked?: boolean;\n /** The app's own line under the row — keksdose's per-guest key delivery. */\n extra?: ReactNode;\n}\n\n/** A grant waiting for its address to have an account — or, with no address, an\n * open invite link (keksdose). */\nexport interface SharePendingGrant {\n id: string | number;\n email?: string | null;\n /** A {@link ShareRole.key}; left out when the app has only one role. */\n role?: string;\n /** The invite link, offered with a copy button. */\n link?: string;\n}\n\n/** A completion offered while typing: a past grantee, or one of the sharer's teams. */\nexport interface ShareCandidate {\n id: string | number;\n name: string;\n /** A person's address: taking the row fills the field with it, and the grant is\n * then an ordinary address grant. */\n email?: string | null;\n /** `team` (or a person with no address): taking the row names THIS candidate, and\n * `onAdd` receives it instead of an address. */\n kind?: \"person\" | \"team\";\n icon?: ReactNode;\n}\n\n/** What the add button asks for. Exactly one of `email` / `candidate` is set, except\n * under `addWithoutEmail`, where both may be null (an open invite). */\nexport interface ShareAddRequest {\n email: string | null;\n candidate: ShareCandidate | null;\n /** A {@link ShareRole.key}. */\n role: string;\n}\n\ntype MaybePromise = void | Promise<unknown>;\n\n// ── Props ─────────────────────────────────────────────────────────────────────\n\nexport interface SharePanelProps {\n grantees: ShareGrantee[];\n /** The role vocabulary, in display order. One role: no choice is offered and each\n * row shows its chip. */\n roles: ShareRole[];\n pending?: SharePendingGrant[];\n /** Completions for the field. Left out: the field is a plain address field. */\n candidates?: ShareCandidate[];\n /** The role a new grant starts with. Default: the first of `roles`. */\n defaultRole?: string;\n /** Resolve to clear the field; reject to keep it and show the error. Left out (or\n * `readOnly`): no add form. */\n onAdd?: (request: ShareAddRequest) => MaybePromise;\n /** Left out: roles are shown as chips. */\n onRoleChange?: (grantee: ShareGrantee, role: string) => MaybePromise;\n /** Called after the kit's confirm. Left out: no remove button. */\n onRemove?: (grantee: ShareGrantee) => MaybePromise;\n /** Called after the kit's confirm. Left out: no withdraw button. */\n onRevokePending?: (grant: SharePendingGrant) => MaybePromise;\n /** keksdose: an empty field is a request too — an invite link with no address. */\n addWithoutEmail?: boolean;\n /** Under the add field: whatever the app needs said there (Kurvenschmiede's \"your\n * pending grant does not let anybody register\"). A function receives the taken\n * candidate, so it can say something else while a team is named. */\n caption?: ReactNode | ((candidate: ShareCandidate | null) => ReactNode);\n /** Above everything — what sharing means here (keksdose's guest explanation). */\n intro?: ReactNode;\n /** The list is being fetched: a spinner instead of the rows. */\n loading?: boolean;\n /** The app's own error, shown in the error box (wins over a caught rejection). */\n error?: ReactNode;\n /** Turns a callback's rejection into words. Default {@link ShareCardLabels.failed}. */\n formatError?: (error: unknown) => ReactNode;\n /** Look, do not touch: no form, chips for roles, no remove buttons. Copying an\n * invite link still works. */\n readOnly?: boolean;\n /** Focus the field on mount — a dialog that exists to add somebody. */\n autoFocus?: boolean;\n labels?: Partial<ShareCardLabels>;\n}\n\n// Shape only. Whether the address exists, is allowed, or is the sharer's own is the\n// app's question — the field must never become a way to probe for accounts.\nconst EMAIL_SHAPE = /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/;\n\n/** The kit's {@link RoleChip}, so a role looks the same here as in the admin roster,\n * with the role's description in a tooltip. */\nfunction ShareRoleChip({ role }: { role: ShareRole | undefined }) {\n if (!role) return null;\n const chip = <RoleChip value={role.key} roles={{ [role.key]: role }} />;\n return role.description ? <Tooltip label={role.description}>{chip}</Tooltip> : chip;\n}\n\n/**\n * A row's role choice saves on change, so it is a commit that cannot take `commit`:\n * under a write lock it is disabled, and the lock's reason is put in the kit Tooltip\n * around it — the same sentence the locked buttons beside it give.\n */\nfunction LockedRoleChoice({ reason, children }: { reason: ReactNode; children: ReactNode }) {\n return reason === undefined ? children : <Tooltip label={reason}>{children}</Tooltip>;\n}\n\n/**\n * The body both forms share: the add form, then the list. Exported for an app that\n * frames it itself (a settings section, a sheet).\n */\nexport function SharePanel({\n grantees,\n roles,\n pending = [],\n candidates,\n defaultRole,\n onAdd,\n onRoleChange,\n onRemove,\n onRevokePending,\n addWithoutEmail = false,\n caption,\n intro,\n loading = false,\n error,\n formatError,\n readOnly = false,\n autoFocus,\n labels: labelsProp,\n}: SharePanelProps) {\n // The `shareCard` namespace: prop > `<UiKitProvider labels>` > English.\n const labels = useKitLabels(\"shareCard\", DEFAULT_SHARE_CARD_LABELS, labelsProp);\n const confirm = useConfirm();\n // Every commit below opts into the surrounding WriteLockProvider with `commit`; the\n // role choices save on change, cannot take it, and read the lock themselves.\n const lock = useWriteLock();\n const [email, setEmail] = useState(\"\");\n // A candidate taken from the completion. Typing again lets it go: the field then\n // names an address again, and a chosen team beside free text would be two answers\n // to \"who\" (Kurvenschmiede's rule).\n const [target, setTarget] = useState<ShareCandidate | null>(null);\n const [newRole, setNewRole] = useState(defaultRole ?? roles[0]?.key ?? \"\");\n const [invalid, setInvalid] = useState(false);\n // One action at a time, for the whole panel: two in flight against one record's\n // grants can answer out of order. The key says which control draws the spinner.\n const [busy, setBusy] = useState<string | null>(null);\n const [failure, setFailure] = useState<ReactNode>(null);\n\n const roleOf = (key: string | undefined) => roles.find((r) => r.key === key);\n const choosable = roles.length > 1;\n const canAdd = !readOnly && onAdd !== undefined;\n\n const run = async (key: string, action: () => MaybePromise): Promise<boolean> => {\n setBusy(key);\n setFailure(null);\n try {\n await action();\n return true;\n } catch (caught) {\n setFailure(formatError ? formatError(caught) : labels.failed);\n return false;\n } finally {\n setBusy(null);\n }\n };\n\n const address = email.trim();\n const empty = !target && address === \"\";\n\n const submit = async () => {\n // Enter in the field is a commit too — the button's lock does not see it.\n if (!onAdd || busy || lock.locked) return;\n if (empty && !addWithoutEmail) return;\n if (!target && address !== \"\" && !EMAIL_SHAPE.test(address)) {\n setInvalid(true);\n return;\n }\n const request: ShareAddRequest = {\n email: target ? null : address || null,\n candidate: target,\n role: newRole,\n };\n if (await run(\"add\", () => onAdd(request))) {\n setEmail(\"\");\n setTarget(null);\n }\n };\n\n const options: ComboOption<string>[] = (candidates ?? []).map((c) => ({\n value: String(c.id),\n label: c.name,\n sublabel: c.kind === \"team\" ? labels.team : (c.email ?? undefined),\n icon: c.icon ?? (c.kind === \"team\" ? <UsersRound className=\"size-4\" /> : undefined),\n }));\n\n // The completion is a convenience, not a search: an address that matches nobody is\n // the ordinary case (somebody new), so no \"No results\" box opens over the field —\n // and over its error. The same narrowing Autocomplete applies, asked first.\n const needle = (target ? \"\" : email).trim().toLowerCase();\n const offers =\n needle !== \"\" &&\n options.some((o) => o.label.toLowerCase().includes(needle) || (o.sublabel ?? \"\").toLowerCase().includes(needle));\n\n const captionNode = typeof caption === \"function\" ? caption(target) : caption;\n const shownError = error ?? failure;\n const nobody = grantees.length === 0 && pending.length === 0;\n\n return (\n <div className=\"space-y-3\">\n {intro && <div className=\"text-xs text-[var(--text-muted)]\">{intro}</div>}\n\n {canAdd && (\n <div className=\"space-y-2\">\n <div\n className={cn(\n \"grid grid-cols-1 gap-2\",\n choosable && \"sm:grid-cols-[minmax(0,1fr)_auto] sm:items-start\",\n )}\n >\n <Autocomplete<string>\n label={addWithoutEmail ? labels.emailOptional : labels.email}\n placeholder={labels.emailPlaceholder}\n value={target ? target.name : email}\n options={options}\n open={offers ? undefined : false}\n fillOnSelect={false}\n // eslint-disable-next-line jsx-a11y/no-autofocus -- a documented prop the caller opts into (off by default); the field never takes focus on its own.\n autoFocus={autoFocus}\n inputMode=\"email\"\n autoComplete=\"off\"\n autoCapitalize=\"none\"\n spellCheck={false}\n disabled={busy !== null}\n error={invalid ? labels.invalidEmail : undefined}\n onChange={(text) => {\n setTarget(null);\n setInvalid(false);\n setFailure(null);\n setEmail(text);\n }}\n onSelect={(option) => {\n const chosen = (candidates ?? []).find((c) => String(c.id) === option.value);\n if (!chosen) return;\n setInvalid(false);\n if (chosen.kind !== \"team\" && chosen.email) {\n setTarget(null);\n setEmail(chosen.email);\n } else {\n setTarget(chosen);\n setEmail(\"\");\n }\n }}\n onKeyDown={(event) => {\n if (event.key === \"Enter\") void submit();\n }}\n />\n {choosable && (\n <ToggleGroup<string>\n aria-label={labels.role}\n options={roles.map((r) => ({ value: r.key, label: r.label }))}\n value={newRole}\n onChange={setNewRole}\n disabled={busy !== null}\n caption={\n roles.some((r) => r.description) ? (key: string) => roleOf(key)?.description : undefined\n }\n // Level with the floating field beside it, as the two apps do by hand.\n optionClassName=\"sm:min-h-10\"\n />\n )}\n </div>\n <div className=\"flex flex-wrap items-center justify-between gap-2\">\n <div className=\"min-w-0 flex-1 basis-48 space-y-1\">\n {target?.kind === \"team\" && <Caption>{labels.teamHint(target.name)}</Caption>}\n {captionNode && <Caption as=\"div\">{captionNode}</Caption>}\n </div>\n <Button\n variant=\"brand\"\n commit\n pending={busy === \"add\"}\n disabled={busy !== null || (empty && !addWithoutEmail)}\n onClick={() => void submit()}\n className=\"ms-auto\"\n >\n <UserPlus className=\"size-4\" aria-hidden />\n {labels.add}\n </Button>\n </div>\n </div>\n )}\n\n {shownError && (\n <AlertBanner tone=\"danger\" size=\"sm\">\n {shownError}\n </AlertBanner>\n )}\n\n {loading ? (\n <div className=\"flex justify-center py-3\">\n <Spinner label={labels.loading} />\n </div>\n ) : (\n <div className=\"space-y-2\">\n <SectionLabel as=\"h4\">{labels.whoHasAccess}</SectionLabel>\n {nobody && <Caption>{labels.nobodyYet}</Caption>}\n <ul className=\"divide-y divide-[var(--border)]\">\n {grantees.map((g) => {\n const editable = !readOnly && !g.locked;\n const changeable = editable && onRoleChange !== undefined && choosable;\n const key = `grantee:${g.id}`;\n return (\n <li key={key} className=\"space-y-1.5 py-2 first:pt-0 last:pb-0\">\n {/* Wraps rather than squeezes: on a phone the controls drop under\n the name, full row, instead of truncating it to a letter. */}\n <div className=\"flex flex-wrap items-center justify-between gap-x-3 gap-y-1.5\">\n <div className=\"min-w-0 flex-1 basis-40\">\n <div className=\"flex min-w-0 items-center gap-1.5 text-sm font-medium text-[var(--text-primary)]\">\n {g.kind === \"team\" && <UsersRound className=\"size-4 shrink-0\" aria-hidden />}\n <span data-private className=\"truncate\">\n {g.name}\n </span>\n {!changeable && <ShareRoleChip role={roleOf(g.role)} />}\n </div>\n {(g.kind === \"team\" || g.email) && (\n <div data-private className=\"truncate text-xs text-[var(--text-muted)]\">\n {g.kind === \"team\" ? labels.team : g.email}\n </div>\n )}\n </div>\n {(changeable || (editable && onRemove)) && (\n <div className=\"ms-auto flex shrink-0 items-center gap-1\">\n {changeable && (\n <LockedRoleChoice reason={lock.locked ? lock.reason : undefined}>\n <ToggleGroup<string>\n size=\"sm\"\n aria-label={labels.roleOf(g.name)}\n options={roles.map((r) => ({ value: r.key, label: r.label }))}\n value={g.role}\n disabled={busy !== null || lock.locked}\n onChange={(next) => {\n if (next !== g.role) void run(`role:${g.id}`, () => onRoleChange(g, next));\n }}\n />\n </LockedRoleChoice>\n )}\n {editable && onRemove && (\n <IconButton\n tone=\"danger\"\n size=\"xs\"\n commit\n label={labels.remove}\n pending={busy === key}\n disabled={busy !== null}\n onClick={async () => {\n const yes = await confirm({\n title: labels.removeConfirm(g.name),\n confirmLabel: labels.remove,\n tone: \"danger\",\n });\n if (yes) await run(key, () => onRemove(g));\n }}\n >\n <Trash2 />\n </IconButton>\n )}\n </div>\n )}\n </div>\n {g.extra}\n </li>\n );\n })}\n {pending.map((p) => {\n const key = `pending:${p.id}`;\n const name = p.email || labels.openInvite;\n return (\n <li key={key} className=\"py-2 first:pt-0 last:pb-0\">\n <div className=\"flex flex-wrap items-center justify-between gap-x-3 gap-y-1.5\">\n <div className=\"min-w-0 flex-1 basis-40\">\n <div\n data-private={p.email ? true : undefined}\n className={cn(\n \"truncate text-sm\",\n p.email ? \"text-[var(--text-primary)]\" : \"text-[var(--text-muted)]\",\n )}\n >\n {name}\n </div>\n <div className=\"mt-0.5 flex flex-wrap items-center gap-1\">\n <Chip size=\"sm\" shape=\"square\" tone=\"warning\" caps>\n {labels.pending}\n </Chip>\n <ShareRoleChip role={roleOf(p.role)} />\n </div>\n </div>\n {(p.link || (!readOnly && onRevokePending)) && (\n <div className=\"ms-auto flex shrink-0 items-center gap-1\">\n {p.link && <CopyButton size=\"xs\" tone=\"muted\" text={p.link} label={labels.copyLink} />}\n {!readOnly && onRevokePending && (\n <IconButton\n tone=\"danger\"\n size=\"xs\"\n commit\n label={labels.revokePending}\n pending={busy === key}\n disabled={busy !== null}\n onClick={async () => {\n const yes = await confirm({\n title: labels.revokePendingConfirm(name),\n confirmLabel: labels.revokePending,\n tone: \"danger\",\n });\n if (yes) await run(key, () => onRevokePending(p));\n }}\n >\n <Trash2 />\n </IconButton>\n )}\n </div>\n )}\n </div>\n </li>\n );\n })}\n </ul>\n </div>\n )}\n </div>\n );\n}\n\n// ── The two frames ────────────────────────────────────────────────────────────\n\nexport interface ShareCardProps extends SharePanelProps {\n /** A heading over the card. */\n title?: ReactNode;\n /** The Card's variant. Default `outline` — a block inside a section, as keksdose's\n * card under a budget row is. */\n variant?: CardProps[\"variant\"];\n className?: string;\n}\n\n/** {@link SharePanel} in a card — keksdose's inline form, under the row it shares. */\nexport function ShareCard({ title, variant = \"outline\", className, ...panel }: ShareCardProps) {\n return (\n <Card variant={variant} padding=\"sm\" className={cn(\"space-y-3\", className)}>\n {title && <h3 className=\"text-sm font-semibold text-[var(--text-primary)]\">{title}</h3>}\n <SharePanel {...panel} />\n </Card>\n );\n}\n\nexport interface ShareDialogProps\n extends SharePanelProps,\n Pick<DialogFrameProps, \"open\" | \"onClose\" | \"size\" | \"className\"> {\n /** The heading. Default {@link ShareCardLabels.dialogTitle}. */\n title?: ReactNode;\n /** Under the heading — what is being shared (Kurvenschmiede passes its name). */\n description?: ReactNode;\n}\n\n/**\n * {@link SharePanel} in the kit's {@link DialogFrame} with a Close button —\n * Kurvenschmiede's form. Sharing commits as it goes, so there is nothing to save or\n * cancel: Close is the only action.\n */\nexport function ShareDialog({ open, onClose, size, className, title, description, ...panel }: ShareDialogProps) {\n const labels = useKitLabels(\"shareCard\", DEFAULT_SHARE_CARD_LABELS, panel.labels);\n return (\n <DialogFrame\n open={open}\n onClose={onClose}\n size={size}\n className={className}\n title={title ?? labels.dialogTitle}\n description={description}\n actions={(close) => (\n <Button variant=\"secondary\" onClick={close}>\n {labels.close}\n </Button>\n )}\n >\n <SharePanel {...panel} />\n </DialogFrame>\n );\n}\n"],"mappings":";AA8Ne,cAwHL,YAxHK;AA9Nf,SAAS,gBAAgB;AAEzB,SAAS,QAAQ,UAAU,kBAAkB;AAE7C,SAAS,oBAAoB;AAC7B,SAAS,UAAU;AACnB,SAAS,mBAAmB;AAC5B,SAAS,oBAAoB;AAE7B,SAAS,YAAY;AACrB,SAAS,gBAAgB;AAEzB,SAAS,kBAAkB;AAC3B,SAAS,kBAAkB;AAC3B,SAAS,mBAAmB;AAE5B,SAAS,SAAS,oBAAoB;AACtC,SAAS,mBAAmB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BAAC,QAAG,WAAU,oDAAoD,iBAAM;AAAA,IAClF,oBAAC,cAAY,GAAG,OAAO;AAAA,KACzB;AAEJ;AAgBO,SAAS,YAAY,EAAE,MAAM,SAAS,MAAM,WAAW,OAAO,aAAa,GAAG,MAAM,GAAqB;AAC9G,QAAM,SAAS,aAAa,aAAa,2BAA2B,MAAM,MAAM;AAChF,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,OAAO,SAAS,OAAO;AAAA,MACvB;AAAA,MACA,SAAS,CAAC,UACR,oBAAC,UAAO,SAAQ,aAAY,SAAS,OAClC,iBAAO,OACV;AAAA,MAGF,8BAAC,cAAY,GAAG,OAAO;AAAA;AAAA,EACzB;AAEJ;","names":[]}
1
+ {"version":3,"sources":["../../src/components/share-card.tsx"],"sourcesContent":["import { useState } from \"react\";\nimport type { ReactNode } from \"react\";\nimport { Trash2, UserPlus, UsersRound } from \"lucide-react\";\n\nimport { useKitLabels } from \"../i18n/kit-labels\";\nimport { cn } from \"../lib/cn\";\nimport { AlertBanner } from \"./alert-banner\";\nimport { Autocomplete } from \"./autocomplete\";\nimport type { ComboOption } from \"./combobox-core\";\nimport { Chip } from \"./chip\";\nimport { RoleChip } from \"./account-chips\";\nimport type { RoleDefinition } from \"./account-chips\";\nimport { useConfirm } from \"./confirm-dialog\";\nimport { CopyButton } from \"./copy-button\";\nimport { DialogFrame } from \"./dialog-frame\";\nimport type { DialogFrameProps } from \"./dialog-frame\";\nimport { Caption, SectionLabel } from \"./text\";\nimport { ToggleGroup } from \"./toggle-group\";\nimport { Tooltip } from \"./tooltip\";\nimport { Button, Card, IconButton, Spinner } from \"./ui\";\nimport { useWriteLock } from \"./write-lock\";\nimport type { CardProps } from \"./ui\";\n\n/**\n * Who holds one record, and the owner's every way of changing that — Kurvenschmiede's\n * `features/sharing/share-dialog.tsx` and keksdose's `features/budgets/budget-share-card.tsx`,\n * which are the same component twice (Kurvenschmiede's own doc comment says so).\n *\n * Presentational: the kit draws the rows, asks before a removal (the kit's\n * {@link useConfirm}), keeps the field and the busy state, and checks only that an\n * address is SHAPED like one. Everything that is policy stays with the app — who may\n * share, whether an address has an account (that is what makes a grant pending), what\n * a role permits, every request — through the callbacks, which may return a promise.\n */\n\n// ── Labels ────────────────────────────────────────────────────────────────────\n\nexport interface ShareCardLabels {\n /** ShareDialog's heading. */\n dialogTitle: string;\n /** ShareDialog's close button. */\n close: string;\n /** The add field's label. */\n email: string;\n /** The add field's label when `addWithoutEmail` lets it stay empty. */\n emailOptional: string;\n emailPlaceholder: string;\n /** Under the field when what was typed is not an address. */\n invalidEmail: string;\n /** Accessible name of the role choice beside the field. */\n role: string;\n /** Accessible name of one grantee's role choice. */\n roleOf: (name: string) => string;\n /** The add button. */\n add: string;\n /** Heading over the list. */\n whoHasAccess: string;\n /** The list is empty. */\n nobodyYet: string;\n /** Chip on a grant whose address has no account yet. */\n pending: string;\n /** A pending grant with no address — a link anybody holding it can redeem. */\n openInvite: string;\n copyLink: string;\n /** A candidate that is a team (its sublabel, and the line under a team row). */\n team: string;\n /** Under the field while a team is the one named. */\n teamHint: (name: string) => string;\n /** The remove button on a grantee. */\n remove: string;\n removeConfirm: (name: string) => string;\n /** The remove button on a pending grant. */\n revokePending: string;\n revokePendingConfirm: (name: string) => string;\n /** A callback rejected and no `formatError` says better. */\n failed: string;\n /** Shown while `loading`. */\n loading: string;\n}\n\nexport const DEFAULT_SHARE_CARD_LABELS: ShareCardLabels = {\n dialogTitle: \"Share\",\n close: \"Close\",\n email: \"Email address\",\n emailOptional: \"Email address (optional)\",\n emailPlaceholder: \"name@example.com\",\n invalidEmail: \"Enter a complete email address.\",\n role: \"Role\",\n roleOf: (name) => `Role of ${name}`,\n add: \"Share\",\n whoHasAccess: \"Who has access\",\n nobodyYet: \"Nobody else has access yet.\",\n pending: \"Pending\",\n openInvite: \"Open invite link\",\n copyLink: \"Copy link\",\n team: \"Team\",\n teamHint: (name) => `Everyone in ${name} gets access.`,\n remove: \"Remove access\",\n removeConfirm: (name) => `Remove access for ${name}?`,\n revokePending: \"Withdraw invitation\",\n revokePendingConfirm: (name) => `Withdraw the invitation for ${name}?`,\n failed: \"That did not work. Please try again.\",\n loading: \"Loading…\",\n};\n\n// ── Data shapes ───────────────────────────────────────────────────────────────\n\n/**\n * One role of the app's vocabulary: Kurvenschmiede's viewer/editor, keksdose's guest.\n *\n * The admin roster's {@link RoleDefinition} (label, tone, icon) plus the key it is\n * filed under — an ARRAY here rather than the keyed `RoleVocabulary` record,\n * because the order is the order of the role choice's segments.\n */\nexport type ShareRole = RoleDefinition & {\n key: string;\n /** What the role allows — under the role choice once chosen, and the chip's tooltip. */\n description?: string;\n};\n\n/** Somebody (or a team) who holds the record now. */\nexport interface ShareGrantee {\n id: string | number;\n name: string;\n /** The second line. A team row says {@link ShareCardLabels.team} instead. */\n email?: string | null;\n /** A {@link ShareRole.key}. */\n role: string;\n /** `team`: the grant reaches everybody in it (Kurvenschmiede). Default `person`. */\n kind?: \"person\" | \"team\";\n /** Shown, but neither its role nor its access can be changed here (an owner row). */\n locked?: boolean;\n /** The app's own line under the row — keksdose's per-guest key delivery. */\n extra?: ReactNode;\n}\n\n/** A grant waiting for its address to have an account — or, with no address, an\n * open invite link (keksdose). */\nexport interface SharePendingGrant {\n id: string | number;\n email?: string | null;\n /** A {@link ShareRole.key}; left out when the app has only one role. */\n role?: string;\n /** The invite link, offered with a copy button. */\n link?: string;\n}\n\n/** A completion offered while typing: a past grantee, or one of the sharer's teams. */\nexport interface ShareCandidate {\n id: string | number;\n name: string;\n /** A person's address: taking the row fills the field with it, and the grant is\n * then an ordinary address grant. */\n email?: string | null;\n /** `team` (or a person with no address): taking the row names THIS candidate, and\n * `onAdd` receives it instead of an address. */\n kind?: \"person\" | \"team\";\n icon?: ReactNode;\n}\n\n/** What the add button asks for. Exactly one of `email` / `candidate` is set, except\n * under `addWithoutEmail`, where both may be null (an open invite). */\nexport interface ShareAddRequest {\n email: string | null;\n candidate: ShareCandidate | null;\n /** A {@link ShareRole.key}. */\n role: string;\n}\n\ntype MaybePromise = void | Promise<unknown>;\n\n// ── Props ─────────────────────────────────────────────────────────────────────\n\nexport interface SharePanelProps {\n grantees: ShareGrantee[];\n /** The role vocabulary, in display order. One role: no choice is offered and each\n * row shows its chip. */\n roles: ShareRole[];\n pending?: SharePendingGrant[];\n /** Completions for the field. Left out: the field is a plain address field. */\n candidates?: ShareCandidate[];\n /** The role a new grant starts with. Default: the first of `roles`. */\n defaultRole?: string;\n /** Resolve to clear the field; reject to keep it and show the error. Left out (or\n * `readOnly`): no add form. */\n onAdd?: (request: ShareAddRequest) => MaybePromise;\n /** Left out: roles are shown as chips. */\n onRoleChange?: (grantee: ShareGrantee, role: string) => MaybePromise;\n /** Called after the kit's confirm. Left out: no remove button. */\n onRemove?: (grantee: ShareGrantee) => MaybePromise;\n /** Called after the kit's confirm. Left out: no withdraw button. */\n onRevokePending?: (grant: SharePendingGrant) => MaybePromise;\n /** keksdose: an empty field is a request too — an invite link with no address. */\n addWithoutEmail?: boolean;\n /** Under the add field: whatever the app needs said there (Kurvenschmiede's \"your\n * pending grant does not let anybody register\"). A function receives the taken\n * candidate, so it can say something else while a team is named. */\n caption?: ReactNode | ((candidate: ShareCandidate | null) => ReactNode);\n /** Above everything — what sharing means here (keksdose's guest explanation). */\n intro?: ReactNode;\n /** The list is being fetched: a spinner instead of the rows. */\n loading?: boolean;\n /** The app's own error, shown in the error box (wins over a caught rejection). */\n error?: ReactNode;\n /** Turns a callback's rejection into words. Default {@link ShareCardLabels.failed}. */\n formatError?: (error: unknown) => ReactNode;\n /** Look, do not touch: no form, chips for roles, no remove buttons. Copying an\n * invite link still works. */\n readOnly?: boolean;\n /** Focus the field on mount — a dialog that exists to add somebody. */\n autoFocus?: boolean;\n labels?: Partial<ShareCardLabels>;\n}\n\n// Shape only. Whether the address exists, is allowed, or is the sharer's own is the\n// app's question — the field must never become a way to probe for accounts.\nconst EMAIL_SHAPE = /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/;\n\n/** The kit's {@link RoleChip}, so a role looks the same here as in the admin roster,\n * with the role's description in a tooltip. */\nfunction ShareRoleChip({ role }: { role: ShareRole | undefined }) {\n if (!role) return null;\n const chip = <RoleChip value={role.key} roles={{ [role.key]: role }} />;\n return role.description ? <Tooltip label={role.description}>{chip}</Tooltip> : chip;\n}\n\n/**\n * A row's role choice saves on change, so it is a commit that cannot take `commit`:\n * under a write lock it is disabled, and the lock's reason is put in the kit Tooltip\n * around it — the same sentence the locked buttons beside it give.\n */\nfunction LockedRoleChoice({ reason, children }: { reason: ReactNode; children: ReactNode }) {\n return reason === undefined ? children : <Tooltip label={reason}>{children}</Tooltip>;\n}\n\n/**\n * The body both forms share: the add form, then the list. Exported for an app that\n * frames it itself (a settings section, a sheet).\n */\nexport function SharePanel({\n grantees,\n roles,\n pending = [],\n candidates,\n defaultRole,\n onAdd,\n onRoleChange,\n onRemove,\n onRevokePending,\n addWithoutEmail = false,\n caption,\n intro,\n loading = false,\n error,\n formatError,\n readOnly = false,\n autoFocus,\n labels: labelsProp,\n}: SharePanelProps) {\n // The `shareCard` namespace: prop > `<UiKitProvider labels>` > English.\n const labels = useKitLabels(\"shareCard\", DEFAULT_SHARE_CARD_LABELS, labelsProp);\n const confirm = useConfirm();\n // Every commit below opts into the surrounding WriteLockProvider with `commit`; the\n // role choices save on change, cannot take it, and read the lock themselves.\n const lock = useWriteLock();\n const [email, setEmail] = useState(\"\");\n // A candidate taken from the completion. Typing again lets it go: the field then\n // names an address again, and a chosen team beside free text would be two answers\n // to \"who\" (Kurvenschmiede's rule).\n const [target, setTarget] = useState<ShareCandidate | null>(null);\n const [newRole, setNewRole] = useState(defaultRole ?? roles[0]?.key ?? \"\");\n const [invalid, setInvalid] = useState(false);\n // One action at a time, for the whole panel: two in flight against one record's\n // grants can answer out of order. The key says which control draws the spinner.\n const [busy, setBusy] = useState<string | null>(null);\n const [failure, setFailure] = useState<ReactNode>(null);\n\n const roleOf = (key: string | undefined) => roles.find((r) => r.key === key);\n const choosable = roles.length > 1;\n const canAdd = !readOnly && onAdd !== undefined;\n\n const run = async (key: string, action: () => MaybePromise): Promise<boolean> => {\n setBusy(key);\n setFailure(null);\n try {\n await action();\n return true;\n } catch (caught) {\n setFailure(formatError ? formatError(caught) : labels.failed);\n return false;\n } finally {\n setBusy(null);\n }\n };\n\n const address = email.trim();\n const empty = !target && address === \"\";\n\n const submit = async () => {\n // Enter in the field is a commit too — the button's lock does not see it.\n if (!onAdd || busy || lock.locked) return;\n if (empty && !addWithoutEmail) return;\n if (!target && address !== \"\" && !EMAIL_SHAPE.test(address)) {\n setInvalid(true);\n return;\n }\n const request: ShareAddRequest = {\n email: target ? null : address || null,\n candidate: target,\n role: newRole,\n };\n if (await run(\"add\", () => onAdd(request))) {\n setEmail(\"\");\n setTarget(null);\n }\n };\n\n const options: ComboOption<string>[] = (candidates ?? []).map((c) => ({\n value: String(c.id),\n label: c.name,\n sublabel: c.kind === \"team\" ? labels.team : (c.email ?? undefined),\n icon: c.icon ?? (c.kind === \"team\" ? <UsersRound className=\"size-4\" /> : undefined),\n }));\n\n // The completion is a convenience, not a search: an address that matches nobody is\n // the ordinary case (somebody new), so no \"No results\" box opens over the field —\n // and over its error. The same narrowing Autocomplete applies, asked first.\n const needle = (target ? \"\" : email).trim().toLowerCase();\n const offers =\n needle !== \"\" &&\n options.some((o) => o.label.toLowerCase().includes(needle) || (o.sublabel ?? \"\").toLowerCase().includes(needle));\n\n const captionNode = typeof caption === \"function\" ? caption(target) : caption;\n const shownError = error ?? failure;\n const nobody = grantees.length === 0 && pending.length === 0;\n\n return (\n <div className=\"space-y-3\">\n {intro && <div className=\"text-xs text-[var(--text-muted)]\">{intro}</div>}\n\n {canAdd && (\n <div className=\"space-y-2\">\n <div\n className={cn(\n \"grid grid-cols-1 gap-2\",\n choosable && \"sm:grid-cols-[minmax(0,1fr)_auto] sm:items-start\",\n )}\n >\n <Autocomplete<string>\n label={addWithoutEmail ? labels.emailOptional : labels.email}\n placeholder={labels.emailPlaceholder}\n value={target ? target.name : email}\n options={options}\n open={offers ? undefined : false}\n fillOnSelect={false}\n // eslint-disable-next-line jsx-a11y/no-autofocus -- a documented prop the caller opts into (off by default); the field never takes focus on its own.\n autoFocus={autoFocus}\n inputMode=\"email\"\n autoComplete=\"off\"\n autoCapitalize=\"none\"\n spellCheck={false}\n disabled={busy !== null}\n error={invalid ? labels.invalidEmail : undefined}\n onChange={(text) => {\n setTarget(null);\n setInvalid(false);\n setFailure(null);\n setEmail(text);\n }}\n onSelect={(option) => {\n const chosen = (candidates ?? []).find((c) => String(c.id) === option.value);\n if (!chosen) return;\n setInvalid(false);\n if (chosen.kind !== \"team\" && chosen.email) {\n setTarget(null);\n setEmail(chosen.email);\n } else {\n setTarget(chosen);\n setEmail(\"\");\n }\n }}\n onKeyDown={(event) => {\n if (event.key === \"Enter\") void submit();\n }}\n />\n {choosable && (\n <ToggleGroup<string>\n aria-label={labels.role}\n options={roles.map((r) => ({ value: r.key, label: r.label }))}\n value={newRole}\n onChange={setNewRole}\n disabled={busy !== null}\n caption={\n roles.some((r) => r.description) ? (key: string) => roleOf(key)?.description : undefined\n }\n // Level with the floating field beside it, as the two apps do by hand.\n optionClassName=\"sm:min-h-10\"\n />\n )}\n </div>\n <div className=\"flex flex-wrap items-center justify-between gap-2\">\n <div className=\"min-w-0 flex-1 basis-48 space-y-1\">\n {target?.kind === \"team\" && <Caption>{labels.teamHint(target.name)}</Caption>}\n {captionNode && <Caption as=\"div\">{captionNode}</Caption>}\n </div>\n <Button\n variant=\"brand\"\n commit\n pending={busy === \"add\"}\n disabled={busy !== null || (empty && !addWithoutEmail)}\n onClick={() => void submit()}\n className=\"ms-auto\"\n >\n <UserPlus className=\"size-4\" aria-hidden />\n {labels.add}\n </Button>\n </div>\n </div>\n )}\n\n {shownError && (\n <AlertBanner tone=\"danger\" size=\"sm\">\n {shownError}\n </AlertBanner>\n )}\n\n {loading ? (\n <div className=\"flex justify-center py-3\">\n <Spinner label={labels.loading} />\n </div>\n ) : (\n <div className=\"space-y-2\">\n <SectionLabel as=\"h4\">{labels.whoHasAccess}</SectionLabel>\n {nobody && <Caption>{labels.nobodyYet}</Caption>}\n <ul className=\"divide-y divide-[var(--border)]\">\n {grantees.map((g) => {\n const editable = !readOnly && !g.locked;\n const changeable = editable && onRoleChange !== undefined && choosable;\n const key = `grantee:${g.id}`;\n return (\n <li key={key} className=\"space-y-1.5 py-2 first:pt-0 last:pb-0\">\n {/* Wraps rather than squeezes: on a phone the controls drop under\n the name, full row, instead of truncating it to a letter. */}\n <div className=\"flex flex-wrap items-center justify-between gap-x-3 gap-y-1.5\">\n <div className=\"min-w-0 flex-1 basis-40\">\n <div className=\"flex min-w-0 items-center gap-1.5 text-sm font-medium text-[var(--text-primary)]\">\n {g.kind === \"team\" && <UsersRound className=\"size-4 shrink-0\" aria-hidden />}\n <span data-private className=\"truncate\">\n {g.name}\n </span>\n {!changeable && <ShareRoleChip role={roleOf(g.role)} />}\n </div>\n {(g.kind === \"team\" || g.email) && (\n <div data-private className=\"truncate text-xs text-[var(--text-muted)]\">\n {g.kind === \"team\" ? labels.team : g.email}\n </div>\n )}\n </div>\n {(changeable || (editable && onRemove)) && (\n <div className=\"ms-auto flex shrink-0 items-center gap-1\">\n {changeable && (\n <LockedRoleChoice reason={lock.locked ? lock.reason : undefined}>\n <ToggleGroup<string>\n size=\"sm\"\n aria-label={labels.roleOf(g.name)}\n options={roles.map((r) => ({ value: r.key, label: r.label }))}\n value={g.role}\n disabled={busy !== null || lock.locked}\n onChange={(next) => {\n if (next !== g.role) void run(`role:${g.id}`, () => onRoleChange(g, next));\n }}\n />\n </LockedRoleChoice>\n )}\n {editable && onRemove && (\n <IconButton\n tone=\"danger\"\n size=\"xs\"\n commit\n label={labels.remove}\n // The icon alone at every text size (§10.8): the row's one\n // control beside its role toggle, where \"Remove access\" as\n // text at Large would not fit a 240 px row. It carries a\n // spinner and the write lock, which a \"⋯\" menu entry\n // cannot, and its confirmation names the action in words.\n labelVisible={false}\n pending={busy === key}\n disabled={busy !== null}\n onClick={async () => {\n const yes = await confirm({\n title: labels.removeConfirm(g.name),\n confirmLabel: labels.remove,\n tone: \"danger\",\n });\n if (yes) await run(key, () => onRemove(g));\n }}\n >\n <Trash2 />\n </IconButton>\n )}\n </div>\n )}\n </div>\n {g.extra}\n </li>\n );\n })}\n {pending.map((p) => {\n const key = `pending:${p.id}`;\n const name = p.email || labels.openInvite;\n return (\n <li key={key} className=\"py-2 first:pt-0 last:pb-0\">\n <div className=\"flex flex-wrap items-center justify-between gap-x-3 gap-y-1.5\">\n <div className=\"min-w-0 flex-1 basis-40\">\n <div\n data-private={p.email ? true : undefined}\n className={cn(\n \"truncate text-sm\",\n p.email ? \"text-[var(--text-primary)]\" : \"text-[var(--text-muted)]\",\n )}\n >\n {name}\n </div>\n <div className=\"mt-0.5 flex flex-wrap items-center gap-1\">\n <Chip size=\"sm\" shape=\"square\" tone=\"warning\" caps>\n {labels.pending}\n </Chip>\n <ShareRoleChip role={roleOf(p.role)} />\n </div>\n </div>\n {(p.link || (!readOnly && onRevokePending)) && (\n <div className=\"ms-auto flex shrink-0 items-center gap-1\">\n {p.link && <CopyButton size=\"xs\" tone=\"muted\" text={p.link} label={labels.copyLink} />}\n {!readOnly && onRevokePending && (\n <IconButton\n tone=\"danger\"\n size=\"xs\"\n commit\n label={labels.revokePending}\n // As the grantee's remove above: one action beside the\n // copy icon (which is an icon at every size), and the\n // confirmation says it in words.\n labelVisible={false}\n pending={busy === key}\n disabled={busy !== null}\n onClick={async () => {\n const yes = await confirm({\n title: labels.revokePendingConfirm(name),\n confirmLabel: labels.revokePending,\n tone: \"danger\",\n });\n if (yes) await run(key, () => onRevokePending(p));\n }}\n >\n <Trash2 />\n </IconButton>\n )}\n </div>\n )}\n </div>\n </li>\n );\n })}\n </ul>\n </div>\n )}\n </div>\n );\n}\n\n// ── The two frames ────────────────────────────────────────────────────────────\n\nexport interface ShareCardProps extends SharePanelProps {\n /** A heading over the card. */\n title?: ReactNode;\n /** The Card's variant. Default `outline` — a block inside a section, as keksdose's\n * card under a budget row is. */\n variant?: CardProps[\"variant\"];\n className?: string;\n}\n\n/** {@link SharePanel} in a card — keksdose's inline form, under the row it shares. */\nexport function ShareCard({ title, variant = \"outline\", className, ...panel }: ShareCardProps) {\n return (\n <Card variant={variant} padding=\"sm\" className={cn(\"space-y-3\", className)}>\n {title && <h3 className=\"text-sm font-semibold text-[var(--text-primary)]\">{title}</h3>}\n <SharePanel {...panel} />\n </Card>\n );\n}\n\nexport interface ShareDialogProps\n extends SharePanelProps,\n Pick<DialogFrameProps, \"open\" | \"onClose\" | \"size\" | \"className\"> {\n /** The heading. Default {@link ShareCardLabels.dialogTitle}. */\n title?: ReactNode;\n /** Under the heading — what is being shared (Kurvenschmiede passes its name). */\n description?: ReactNode;\n}\n\n/**\n * {@link SharePanel} in the kit's {@link DialogFrame} with a Close button —\n * Kurvenschmiede's form. Sharing commits as it goes, so there is nothing to save or\n * cancel: Close is the only action.\n */\nexport function ShareDialog({ open, onClose, size, className, title, description, ...panel }: ShareDialogProps) {\n const labels = useKitLabels(\"shareCard\", DEFAULT_SHARE_CARD_LABELS, panel.labels);\n return (\n <DialogFrame\n open={open}\n onClose={onClose}\n size={size}\n className={className}\n title={title ?? labels.dialogTitle}\n description={description}\n actions={(close) => (\n <Button variant=\"secondary\" onClick={close}>\n {labels.close}\n </Button>\n )}\n >\n <SharePanel {...panel} />\n </DialogFrame>\n );\n}\n"],"mappings":";AA8Ne,cAwHL,YAxHK;AA9Nf,SAAS,gBAAgB;AAEzB,SAAS,QAAQ,UAAU,kBAAkB;AAE7C,SAAS,oBAAoB;AAC7B,SAAS,UAAU;AACnB,SAAS,mBAAmB;AAC5B,SAAS,oBAAoB;AAE7B,SAAS,YAAY;AACrB,SAAS,gBAAgB;AAEzB,SAAS,kBAAkB;AAC3B,SAAS,kBAAkB;AAC3B,SAAS,mBAAmB;AAE5B,SAAS,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QAAK,SAAkB,SAAQ,MAAK,WAAW,GAAG,aAAa,SAAS,GACtE;AAAA,aAAS,oBAAC,QAAG,WAAU,oDAAoD,iBAAM;AAAA,IAClF,oBAAC,cAAY,GAAG,OAAO;AAAA,KACzB;AAEJ;AAgBO,SAAS,YAAY,EAAE,MAAM,SAAS,MAAM,WAAW,OAAO,aAAa,GAAG,MAAM,GAAqB;AAC9G,QAAM,SAAS,aAAa,aAAa,2BAA2B,MAAM,MAAM;AAChF,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,OAAO,SAAS,OAAO;AAAA,MACvB;AAAA,MACA,SAAS,CAAC,UACR,oBAAC,UAAO,SAAQ,aAAY,SAAS,OAClC,iBAAO,OACV;AAAA,MAGF,8BAAC,cAAY,GAAG,OAAO;AAAA;AAAA,EACzB;AAEJ;","names":[]}
@@ -11,6 +11,10 @@ interface SignChipLabels {
11
11
  * turns it into — `current` and `next` are the two words above. The other option is
12
12
  * nowhere on screen to be read, so the name has to say both. */
13
13
  direction: (current: string, next: string) => string;
14
+ /** 0.32: what a press does, in words under the chip at Large and Extra large —
15
+ * `next` is the other direction's word ("Switch to Inflow"). The tooltip's half of
16
+ * `direction`, shown, since a fact may not live only in a tooltip there (§4). */
17
+ switchTo: (next: string) => string;
14
18
  }
15
19
  declare const DEFAULT_SIGN_CHIP_LABELS: SignChipLabels;
16
20
  interface SignChipProps {
@@ -5,17 +5,20 @@ import { Chip } from "./chip.js";
5
5
  import { Tooltip } from "./tooltip.js";
6
6
  import { cn } from "../lib/cn.js";
7
7
  import { useKitLabels } from "../i18n/kit-labels.js";
8
+ import { useLargeText } from "../hooks/use-large-text.js";
8
9
  const DEFAULT_SIGN_CHIP_LABELS = {
9
10
  outflow: "Outflow",
10
11
  inflow: "Inflow",
11
- direction: (current, next) => `Direction: ${current} \u2014 switch to ${next}`
12
+ direction: (current, next) => `Direction: ${current} \u2014 switch to ${next}`,
13
+ switchTo: (next) => `Switch to ${next}`
12
14
  };
13
15
  function SignChip({ negative, onNegativeChange, disabled, labels: labelsProp, className }) {
14
16
  const labels = useKitLabels("signChip", DEFAULT_SIGN_CHIP_LABELS, labelsProp);
15
17
  const current = negative ? labels.outflow : labels.inflow;
16
18
  const next = negative ? labels.inflow : labels.outflow;
17
19
  const name = labels.direction(current, next);
18
- return /* @__PURE__ */ jsx(Tooltip, { label: name, lazy: true, children: /* @__PURE__ */ jsxs(
20
+ const large = useLargeText();
21
+ const chip = /* @__PURE__ */ jsxs(
19
22
  Chip,
20
23
  {
21
24
  size: "lg",
@@ -24,13 +27,23 @@ function SignChip({ negative, onNegativeChange, disabled, labels: labelsProp, cl
24
27
  onClick: () => onNegativeChange(!negative),
25
28
  disabled,
26
29
  "aria-label": name,
27
- className: cn("shrink-0 gap-1.5 whitespace-nowrap px-3 font-medium md:min-h-0 md:py-2.5", className),
30
+ className: cn("shrink-0 gap-1.5 whitespace-nowrap px-3 font-medium md:min-h-0 md:py-2.5", !large && className),
28
31
  children: [
29
32
  current,
30
33
  /* @__PURE__ */ jsx(ArrowUpDown, { className: "ms-1.5 inline size-3.5 align-[-0.2em] opacity-60", "aria-hidden": true })
31
34
  ]
32
35
  }
33
- ) });
36
+ );
37
+ if (!large) {
38
+ return /* @__PURE__ */ jsx(Tooltip, { label: name, lazy: true, children: chip });
39
+ }
40
+ return (
41
+ // The caller's placement (`self-end`…) moves to the pair, which is now the row's item.
42
+ /* @__PURE__ */ jsxs("span", { "data-slot": "sign-chip", className: cn("inline-flex shrink-0 flex-col items-start gap-0.5", className), children: [
43
+ chip,
44
+ /* @__PURE__ */ jsx("span", { "aria-hidden": true, className: "text-xs text-[var(--text-muted)]", children: labels.switchTo(next) })
45
+ ] })
46
+ );
34
47
  }
35
48
  export {
36
49
  DEFAULT_SIGN_CHIP_LABELS,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/components/sign-chip.tsx"],"sourcesContent":["import { ArrowUpDown, Minus, Plus } from \"lucide-react\";\nimport { Chip } from \"./chip\";\nimport { Tooltip } from \"./tooltip\";\nimport { cn } from \"../lib/cn\";\nimport { useKitLabels } from \"../i18n/kit-labels\";\n\n// ── Labels ────────────────────────────────────────────────────────────────────\n\n/** The words a {@link SignChip} says — the `signChip` namespace of\n * `<UiKitProvider labels>`, and per chip through its `labels` prop. */\nexport interface SignChipLabels {\n /** The chip's text while the figure is negative — money going out. */\n outflow: string;\n /** The chip's text while the figure is positive — money coming in. */\n inflow: string;\n /** The chip's accessible name and its tooltip: the state it is in, and what a press\n * turns it into — `current` and `next` are the two words above. The other option is\n * nowhere on screen to be read, so the name has to say both. */\n direction: (current: string, next: string) => string;\n}\n\nexport const DEFAULT_SIGN_CHIP_LABELS: SignChipLabels = {\n outflow: \"Outflow\",\n inflow: \"Inflow\",\n direction: (current, next) => `Direction: ${current} — switch to ${next}`,\n};\n\nexport interface SignChipProps {\n /** The figure is negative (an outflow) — the same flag {@link AmountInput}'s\n * `negative` is, so one state feeds both: `<AmountInput negative={neg}\n * onNegativeChange={setNeg} />` and `<SignChip negative={neg}\n * onNegativeChange={setNeg} />`. */\n negative: boolean;\n /** A press: the other direction. */\n onNegativeChange: (negative: boolean) => void;\n disabled?: boolean;\n /** Per-chip overrides of the `signChip` namespace. */\n labels?: Partial<SignChipLabels>;\n /** On the chip. Place it in its row from here — keksdose's form passes `self-end`\n * to sit it on the display figure's baseline strip. */\n className?: string;\n}\n\n/**\n * The SIGN of an amount, as one chip that shows only the state it is in — keksdose\n * K15, its `DirectionToggle` (feedback #417, #430, #431, dev#434) made a kit piece,\n * so the figure and its direction come from one package and wear one palette.\n *\n * WHY A CHIP, NOT A SEGMENTED CONTROL. A two-option toggle spends half its width\n * telling you what the figure is NOT, and at a phone's width it was the widest thing on\n * the form after the figure itself (#417). This sits beside the amount and reads as one\n * phrase with it — \"−42,50 Outflow\" — and a press flips it. Hiding the alternative costs\n * discoverability, so two things pay it back: the ± glyph and the swap arrows say \"this\n * is a control\", not a badge; and the name and tooltip spell out both the current state\n * and what a press will do.\n *\n * NOT A PRESSED/UNPRESSED TOGGLE. A {@link Chip} toggle has a FIXED label naming its\n * on-state, with `aria-pressed` carrying the state. Here the word IS the state, so it\n * is an action button with no `aria-pressed`: \"Direction: Inflow, not pressed\" would\n * name no on-state for \"not pressed\" to be the absence of. The name changing under\n * focus is the echo.\n *\n * THE COLOUR is the money pairing — the chip's `expense` / `income` tones, the same\n * `--money-expense` / `--money-income` that {@link AmountInput}'s `tone` paints the\n * figure with (dev#434): only the text and the border carry the tint, on a neutral\n * surface, because a filled pill next to a tinted figure reads as one smear.\n *\n * SIZE. `lg` on a phone — the 44px touch target beside a display figure that has no\n * field height to match — and from `md` up exactly a labelled field's 42px, so it never\n * stands taller than the fields in its grid row (#431).\n *\n * An exported chip rather than an `AmountInput signControl` slot: the slot would have\n * to own the row the two share, and every form lays that row out differently (beside\n * the figure on a phone, in a grid column on a desktop). The chip is the part that was\n * being re-written; the row stays the form's.\n */\nexport function SignChip({ negative, onNegativeChange, disabled, labels: labelsProp, className }: SignChipProps) {\n const labels = useKitLabels(\"signChip\", DEFAULT_SIGN_CHIP_LABELS, labelsProp);\n const current = negative ? labels.outflow : labels.inflow;\n const next = negative ? labels.inflow : labels.outflow;\n const name = labels.direction(current, next);\n return (\n <Tooltip label={name} lazy>\n <Chip\n size=\"lg\"\n tone={negative ? \"expense\" : \"income\"}\n icon={negative ? Minus : Plus}\n onClick={() => onNegativeChange(!negative)}\n disabled={disabled}\n aria-label={name}\n // `gap-1.5 px-3`: the chip's narrower body, because on a 375px screen every\n // pixel of it is taken from the figure beside it (#430). `md:py-2.5` with the\n // hairline border is the 42px a labelled field measures (#431).\n className={cn(\"shrink-0 gap-1.5 whitespace-nowrap px-3 font-medium md:min-h-0 md:py-2.5\", className)}\n >\n {current}\n {/* The swap arrows after the word, in the label's own row: decoration (the\n name already says what a press does), set a little apart from the word. */}\n <ArrowUpDown className=\"ms-1.5 inline size-3.5 align-[-0.2em] opacity-60\" aria-hidden />\n </Chip>\n </Tooltip>\n );\n}\n"],"mappings":";AAmFM,SAeE,KAfF;AAnFN,SAAS,aAAa,OAAO,YAAY;AACzC,SAAS,YAAY;AACrB,SAAS,eAAe;AACxB,SAAS,UAAU;AACnB,SAAS,oBAAoB;AAiBtB,MAAM,2BAA2C;AAAA,EACtD,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,WAAW,CAAC,SAAS,SAAS,cAAc,OAAO,qBAAgB,IAAI;AACzE;AAmDO,SAAS,SAAS,EAAE,UAAU,kBAAkB,UAAU,QAAQ,YAAY,UAAU,GAAkB;AAC/G,QAAM,SAAS,aAAa,YAAY,0BAA0B,UAAU;AAC5E,QAAM,UAAU,WAAW,OAAO,UAAU,OAAO;AACnD,QAAM,OAAO,WAAW,OAAO,SAAS,OAAO;AAC/C,QAAM,OAAO,OAAO,UAAU,SAAS,IAAI;AAC3C,SACE,oBAAC,WAAQ,OAAO,MAAM,MAAI,MACxB;AAAA,IAAC;AAAA;AAAA,MACC,MAAK;AAAA,MACL,MAAM,WAAW,YAAY;AAAA,MAC7B,MAAM,WAAW,QAAQ;AAAA,MACzB,SAAS,MAAM,iBAAiB,CAAC,QAAQ;AAAA,MACzC;AAAA,MACA,cAAY;AAAA,MAIZ,WAAW,GAAG,4EAA4E,SAAS;AAAA,MAElG;AAAA;AAAA,QAGD,oBAAC,eAAY,WAAU,oDAAmD,eAAW,MAAC;AAAA;AAAA;AAAA,EACxF,GACF;AAEJ;","names":[]}
1
+ {"version":3,"sources":["../../src/components/sign-chip.tsx"],"sourcesContent":["import { ArrowUpDown, Minus, Plus } from \"lucide-react\";\nimport { Chip } from \"./chip\";\nimport { Tooltip } from \"./tooltip\";\nimport { cn } from \"../lib/cn\";\nimport { useKitLabels } from \"../i18n/kit-labels\";\nimport { useLargeText } from \"../hooks/use-large-text\";\n\n// ── Labels ────────────────────────────────────────────────────────────────────\n\n/** The words a {@link SignChip} says — the `signChip` namespace of\n * `<UiKitProvider labels>`, and per chip through its `labels` prop. */\nexport interface SignChipLabels {\n /** The chip's text while the figure is negative — money going out. */\n outflow: string;\n /** The chip's text while the figure is positive — money coming in. */\n inflow: string;\n /** The chip's accessible name and its tooltip: the state it is in, and what a press\n * turns it into — `current` and `next` are the two words above. The other option is\n * nowhere on screen to be read, so the name has to say both. */\n direction: (current: string, next: string) => string;\n /** 0.32: what a press does, in words under the chip at Large and Extra large —\n * `next` is the other direction's word (\"Switch to Inflow\"). The tooltip's half of\n * `direction`, shown, since a fact may not live only in a tooltip there (§4). */\n switchTo: (next: string) => string;\n}\n\nexport const DEFAULT_SIGN_CHIP_LABELS: SignChipLabels = {\n outflow: \"Outflow\",\n inflow: \"Inflow\",\n direction: (current, next) => `Direction: ${current} — switch to ${next}`,\n switchTo: (next) => `Switch to ${next}`,\n};\n\nexport interface SignChipProps {\n /** The figure is negative (an outflow) — the same flag {@link AmountInput}'s\n * `negative` is, so one state feeds both: `<AmountInput negative={neg}\n * onNegativeChange={setNeg} />` and `<SignChip negative={neg}\n * onNegativeChange={setNeg} />`. */\n negative: boolean;\n /** A press: the other direction. */\n onNegativeChange: (negative: boolean) => void;\n disabled?: boolean;\n /** Per-chip overrides of the `signChip` namespace. */\n labels?: Partial<SignChipLabels>;\n /** On the chip. Place it in its row from here — keksdose's form passes `self-end`\n * to sit it on the display figure's baseline strip. */\n className?: string;\n}\n\n/**\n * The SIGN of an amount, as one chip that shows only the state it is in — keksdose\n * K15, its `DirectionToggle` (feedback #417, #430, #431, dev#434) made a kit piece,\n * so the figure and its direction come from one package and wear one palette.\n *\n * WHY A CHIP, NOT A SEGMENTED CONTROL. A two-option toggle spends half its width\n * telling you what the figure is NOT, and at a phone's width it was the widest thing on\n * the form after the figure itself (#417). This sits beside the amount and reads as one\n * phrase with it — \"−42,50 Outflow\" — and a press flips it. Hiding the alternative costs\n * discoverability, so two things pay it back: the ± glyph and the swap arrows say \"this\n * is a control\", not a badge; and the name and tooltip spell out both the current state\n * and what a press will do.\n *\n * NOT A PRESSED/UNPRESSED TOGGLE. A {@link Chip} toggle has a FIXED label naming its\n * on-state, with `aria-pressed` carrying the state. Here the word IS the state, so it\n * is an action button with no `aria-pressed`: \"Direction: Inflow, not pressed\" would\n * name no on-state for \"not pressed\" to be the absence of. The name changing under\n * focus is the echo.\n *\n * THE COLOUR is the money pairing — the chip's `expense` / `income` tones, the same\n * `--money-expense` / `--money-income` that {@link AmountInput}'s `tone` paints the\n * figure with (dev#434): only the text and the border carry the tint, on a neutral\n * surface, because a filled pill next to a tinted figure reads as one smear.\n *\n * SIZE. `lg` on a phone — the 44px touch target beside a display figure that has no\n * field height to match — and from `md` up exactly a labelled field's 42px, so it never\n * stands taller than the fields in its grid row (#431).\n *\n * An exported chip rather than an `AmountInput signControl` slot: the slot would have\n * to own the row the two share, and every form lays that row out differently (beside\n * the figure on a phone, in a grid column on a desktop). The chip is the part that was\n * being re-written; the row stays the form's.\n */\nexport function SignChip({ negative, onNegativeChange, disabled, labels: labelsProp, className }: SignChipProps) {\n const labels = useKitLabels(\"signChip\", DEFAULT_SIGN_CHIP_LABELS, labelsProp);\n const current = negative ? labels.outflow : labels.inflow;\n const next = negative ? labels.inflow : labels.outflow;\n const name = labels.direction(current, next);\n // §4: at Large the chip's word is joined by what a press does, as a line under it —\n // and the bubble that said only that goes.\n const large = useLargeText();\n const chip = (\n <Chip\n size=\"lg\"\n tone={negative ? \"expense\" : \"income\"}\n icon={negative ? Minus : Plus}\n onClick={() => onNegativeChange(!negative)}\n disabled={disabled}\n aria-label={name}\n // `gap-1.5 px-3`: the chip's narrower body, because on a 375px screen every\n // pixel of it is taken from the figure beside it (#430). `md:py-2.5` with the\n // hairline border is the 42px a labelled field measures (#431).\n className={cn(\"shrink-0 gap-1.5 whitespace-nowrap px-3 font-medium md:min-h-0 md:py-2.5\", !large && className)}\n >\n {current}\n {/* The swap arrows after the word, in the label's own row: decoration (the\n name already says what a press does), set a little apart from the word. */}\n <ArrowUpDown className=\"ms-1.5 inline size-3.5 align-[-0.2em] opacity-60\" aria-hidden />\n </Chip>\n );\n if (!large) {\n return (\n <Tooltip label={name} lazy>\n {chip}\n </Tooltip>\n );\n }\n return (\n // The caller's placement (`self-end`…) moves to the pair, which is now the row's item.\n <span data-slot=\"sign-chip\" className={cn(\"inline-flex shrink-0 flex-col items-start gap-0.5\", className)}>\n {chip}\n {/* Hidden from the accessibility tree: the chip's name already says it. */}\n <span aria-hidden className=\"text-xs text-[var(--text-muted)]\">\n {labels.switchTo(next)}\n </span>\n </span>\n );\n}\n"],"mappings":";AA2FM,SAeE,KAfF;AA3FN,SAAS,aAAa,OAAO,YAAY;AACzC,SAAS,YAAY;AACrB,SAAS,eAAe;AACxB,SAAS,UAAU;AACnB,SAAS,oBAAoB;AAC7B,SAAS,oBAAoB;AAqBtB,MAAM,2BAA2C;AAAA,EACtD,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,WAAW,CAAC,SAAS,SAAS,cAAc,OAAO,qBAAgB,IAAI;AAAA,EACvE,UAAU,CAAC,SAAS,aAAa,IAAI;AACvC;AAmDO,SAAS,SAAS,EAAE,UAAU,kBAAkB,UAAU,QAAQ,YAAY,UAAU,GAAkB;AAC/G,QAAM,SAAS,aAAa,YAAY,0BAA0B,UAAU;AAC5E,QAAM,UAAU,WAAW,OAAO,UAAU,OAAO;AACnD,QAAM,OAAO,WAAW,OAAO,SAAS,OAAO;AAC/C,QAAM,OAAO,OAAO,UAAU,SAAS,IAAI;AAG3C,QAAM,QAAQ,aAAa;AAC3B,QAAM,OACF;AAAA,IAAC;AAAA;AAAA,MACC,MAAK;AAAA,MACL,MAAM,WAAW,YAAY;AAAA,MAC7B,MAAM,WAAW,QAAQ;AAAA,MACzB,SAAS,MAAM,iBAAiB,CAAC,QAAQ;AAAA,MACzC;AAAA,MACA,cAAY;AAAA,MAIZ,WAAW,GAAG,4EAA4E,CAAC,SAAS,SAAS;AAAA,MAE5G;AAAA;AAAA,QAGD,oBAAC,eAAY,WAAU,oDAAmD,eAAW,MAAC;AAAA;AAAA;AAAA,EACxF;AAEJ,MAAI,CAAC,OAAO;AACV,WACE,oBAAC,WAAQ,OAAO,MAAM,MAAI,MACvB,gBACH;AAAA,EAEJ;AACA;AAAA;AAAA,IAEE,qBAAC,UAAK,aAAU,aAAY,WAAW,GAAG,qDAAqD,SAAS,GACrG;AAAA;AAAA,MAED,oBAAC,UAAK,eAAW,MAAC,WAAU,oCACzB,iBAAO,SAAS,IAAI,GACvB;AAAA,OACF;AAAA;AAEJ;","names":[]}
@@ -113,7 +113,9 @@ interface SignaturePadProps extends Omit<ComponentPropsWithoutRef<"div">, "onCha
113
113
  exportInk?: string;
114
114
  /** Fill behind the exported PNG. Default transparent. */
115
115
  exportBackground?: string;
116
- /** Base stroke width in CSS pixels. Default 2.5. */
116
+ /** Base stroke width in CSS pixels at Normal text size. Default 2.5. It grows with the
117
+ * text size (× 1.25 / × 1.5, docs/text-size-harmonization.md §10.11), as the pad's
118
+ * rem height does, so a signature keeps its weight on a larger pad. */
117
119
  lineWidth?: number;
118
120
  /** Classes for the canvas — its height, chiefly (default `h-40`). */
119
121
  canvasClassName?: string;
@@ -5,6 +5,7 @@ import { Eraser, Keyboard, PenLine, Undo2 } from "lucide-react";
5
5
  import { cn } from "../lib/cn.js";
6
6
  import { useAnnounce } from "../hooks/use-announce.js";
7
7
  import { useKitLabels } from "../i18n/kit-labels.js";
8
+ import { useTextSize } from "../theme/text-size.js";
8
9
  import { Button, FIELD_INVALID, Input } from "./ui.js";
9
10
  const DEFAULT_SIGNATURE_PAD_LABELS = {
10
11
  label: "Signature",
@@ -109,10 +110,12 @@ const SignaturePad = forwardRef(function SignaturePad2({
109
110
  const [typedName, setTypedName] = useState("");
110
111
  const typed = mode === "typed";
111
112
  const isEmpty = typed ? typedName.trim() === "" : strokeCount === 0;
112
- const opts = useRef({ lineWidth, exportInk, exportBackground });
113
+ const { scale: textScale } = useTextSize();
114
+ const strokeWidth = lineWidth * textScale;
115
+ const opts = useRef({ lineWidth: strokeWidth, exportInk, exportBackground });
113
116
  useEffect(() => {
114
- opts.current = { lineWidth, exportInk, exportBackground };
115
- }, [lineWidth, exportInk, exportBackground]);
117
+ opts.current = { lineWidth: strokeWidth, exportInk, exportBackground };
118
+ }, [strokeWidth, exportInk, exportBackground]);
116
119
  const sceneEmpty = () => {
117
120
  const s = scene.current;
118
121
  return s.mode === "typed" ? s.name.trim() === "" : s.strokes.length === 0;
@@ -164,7 +167,7 @@ const SignaturePad = forwardRef(function SignaturePad2({
164
167
  }, [resize]);
165
168
  useEffect(() => {
166
169
  repaint();
167
- }, [lineWidth, repaint]);
170
+ }, [strokeWidth, repaint]);
168
171
  useEffect(() => {
169
172
  const canvas = canvasRef.current;
170
173
  if (!canvas) return;
@@ -396,7 +399,7 @@ const SignaturePad = forwardRef(function SignaturePad2({
396
399
  ),
397
400
  onSave && /* @__PURE__ */ jsx(Button, { type: "button", variant: "brand", onClick: save, disabled: disabled || isEmpty, className: "ms-auto", children: labels.save })
398
401
  ] }),
399
- hasError && /* @__PURE__ */ jsx("p", { id: errorId, className: "mt-1 text-[11px] leading-tight text-[var(--danger)]", children: error }),
402
+ hasError && /* @__PURE__ */ jsx("p", { id: errorId, className: "mt-1 text-caption leading-tight text-[var(--danger)]", children: error }),
400
403
  /* @__PURE__ */ jsx("div", { ...regionProps })
401
404
  ] });
402
405
  });