@eifi1/ui-kit 0.54.0 → 0.55.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 (847) hide show
  1. package/README.md +90 -76
  2. package/dist/admin/plan-change.js +2 -2
  3. package/dist/admin/plan-change.js.map +1 -1
  4. package/dist/admin/user-roster.d.ts +6 -0
  5. package/dist/admin/user-roster.js +4 -0
  6. package/dist/admin/user-roster.js.map +1 -1
  7. package/dist/billing/billing-labels.d.ts +26 -0
  8. package/dist/billing/billing-labels.js +9 -0
  9. package/dist/billing/billing-labels.js.map +1 -1
  10. package/dist/billing/subscription-standing.d.ts +61 -0
  11. package/dist/billing/subscription-standing.js +51 -0
  12. package/dist/billing/subscription-standing.js.map +1 -0
  13. package/dist/billing/usage-meter.d.ts +52 -0
  14. package/dist/billing/usage-meter.js +52 -0
  15. package/dist/billing/usage-meter.js.map +1 -0
  16. package/dist/chart.d.ts +1 -0
  17. package/dist/chart.js +4 -0
  18. package/dist/chart.js.map +1 -1
  19. package/dist/components/alert-banner.js +2 -3
  20. package/dist/components/alert-banner.js.map +1 -1
  21. package/dist/components/amount-input.js +3 -15
  22. package/dist/components/amount-input.js.map +1 -1
  23. package/dist/components/autocomplete.js +2 -2
  24. package/dist/components/autocomplete.js.map +1 -1
  25. package/dist/components/bulk-action-bar.js +2 -1
  26. package/dist/components/bulk-action-bar.js.map +1 -1
  27. package/dist/components/button.d.ts +35 -1
  28. package/dist/components/button.js +5 -9
  29. package/dist/components/button.js.map +1 -1
  30. package/dist/components/calendar-heatmap.js +2 -2
  31. package/dist/components/calendar-heatmap.js.map +1 -1
  32. package/dist/components/camera-button.d.ts +89 -0
  33. package/dist/components/camera-button.js +122 -0
  34. package/dist/components/camera-button.js.map +1 -0
  35. package/dist/components/camera-capture.d.ts +66 -0
  36. package/dist/components/camera-capture.js +190 -0
  37. package/dist/components/camera-capture.js.map +1 -0
  38. package/dist/components/camera-labels.d.ts +20 -0
  39. package/dist/components/camera-labels.js +15 -0
  40. package/dist/components/camera-labels.js.map +1 -0
  41. package/dist/components/chart-edge.d.ts +9 -0
  42. package/dist/components/chart-edge.js +14 -3
  43. package/dist/components/chart-edge.js.map +1 -1
  44. package/dist/components/chart-zoom-core.js +34 -29
  45. package/dist/components/chart-zoom-core.js.map +1 -1
  46. package/dist/components/checkbox-group.js +1 -1
  47. package/dist/components/checkbox-group.js.map +1 -1
  48. package/dist/components/combobox-core.js +3 -2
  49. package/dist/components/combobox-core.js.map +1 -1
  50. package/dist/components/combobox.js +2 -2
  51. package/dist/components/combobox.js.map +1 -1
  52. package/dist/components/consent-again-notice-labels.d.ts +25 -0
  53. package/dist/components/consent-again-notice-labels.js +15 -0
  54. package/dist/components/consent-again-notice-labels.js.map +1 -0
  55. package/dist/components/consent-again-notice.d.ts +85 -0
  56. package/dist/components/consent-again-notice.js +94 -0
  57. package/dist/components/consent-again-notice.js.map +1 -0
  58. package/dist/components/country-select.js +2 -7
  59. package/dist/components/country-select.js.map +1 -1
  60. package/dist/components/currency-select.js +2 -2
  61. package/dist/components/currency-select.js.map +1 -1
  62. package/dist/components/danger-confirm.js +2 -2
  63. package/dist/components/danger-confirm.js.map +1 -1
  64. package/dist/components/data-table-column-settings.js +2 -2
  65. package/dist/components/data-table-column-settings.js.map +1 -1
  66. package/dist/components/data-table-fit.js.map +1 -1
  67. package/dist/components/data-table-virtual.js +13 -3
  68. package/dist/components/data-table-virtual.js.map +1 -1
  69. package/dist/components/date-field.js +2 -2
  70. package/dist/components/date-field.js.map +1 -1
  71. package/dist/components/date-picker.js +2 -2
  72. package/dist/components/date-picker.js.map +1 -1
  73. package/dist/components/date-range-picker.js +2 -6
  74. package/dist/components/date-range-picker.js.map +1 -1
  75. package/dist/components/dialog-frame.d.ts +3 -1
  76. package/dist/components/dialog-frame.js.map +1 -1
  77. package/dist/components/dropdown.js +7 -3
  78. package/dist/components/dropdown.js.map +1 -1
  79. package/dist/components/entity-combobox.js +2 -2
  80. package/dist/components/entity-combobox.js.map +1 -1
  81. package/dist/components/field-parts.d.ts +108 -6
  82. package/dist/components/field-parts.js +59 -6
  83. package/dist/components/field-parts.js.map +1 -1
  84. package/dist/components/field-suggestion-labels.d.ts +2 -0
  85. package/dist/components/field-suggestion-labels.js +10 -0
  86. package/dist/components/field-suggestion-labels.js.map +1 -0
  87. package/dist/components/field.js +1 -1
  88. package/dist/components/field.js.map +1 -1
  89. package/dist/components/file-button.d.ts +1 -1
  90. package/dist/components/file-button.js.map +1 -1
  91. package/dist/components/floating-panel.d.ts +7 -6
  92. package/dist/components/floating-panel.js +3 -17
  93. package/dist/components/floating-panel.js.map +1 -1
  94. package/dist/components/form-actions.d.ts +3 -2
  95. package/dist/components/form-actions.js.map +1 -1
  96. package/dist/components/hover-menu.js +3 -2
  97. package/dist/components/hover-menu.js.map +1 -1
  98. package/dist/components/icon-button.d.ts +23 -5
  99. package/dist/components/icon-button.js +6 -8
  100. package/dist/components/icon-button.js.map +1 -1
  101. package/dist/components/inline-confirm.js +2 -1
  102. package/dist/components/inline-confirm.js.map +1 -1
  103. package/dist/components/inline-entity-combobox.js +2 -2
  104. package/dist/components/inline-entity-combobox.js.map +1 -1
  105. package/dist/components/input.js +2 -2
  106. package/dist/components/input.js.map +1 -1
  107. package/dist/components/jump-calendar.js +3 -3
  108. package/dist/components/jump-calendar.js.map +1 -1
  109. package/dist/components/legal.d.ts +13 -1
  110. package/dist/components/legal.js +12 -0
  111. package/dist/components/legal.js.map +1 -1
  112. package/dist/components/legended-series-chart.d.ts +80 -0
  113. package/dist/components/legended-series-chart.js +70 -0
  114. package/dist/components/legended-series-chart.js.map +1 -0
  115. package/dist/components/lightbox.js +2 -1
  116. package/dist/components/lightbox.js.map +1 -1
  117. package/dist/components/mini-calendar.js +13 -5
  118. package/dist/components/mini-calendar.js.map +1 -1
  119. package/dist/components/modal.d.ts +23 -2
  120. package/dist/components/modal.js +24 -6
  121. package/dist/components/modal.js.map +1 -1
  122. package/dist/components/month-picker.d.ts +1 -1
  123. package/dist/components/month-picker.js +6 -6
  124. package/dist/components/month-picker.js.map +1 -1
  125. package/dist/components/multi-entity-combobox.js +2 -2
  126. package/dist/components/multi-entity-combobox.js.map +1 -1
  127. package/dist/components/multi-select.js +2 -6
  128. package/dist/components/multi-select.js.map +1 -1
  129. package/dist/components/number-input.js +2 -2
  130. package/dist/components/number-input.js.map +1 -1
  131. package/dist/components/page-header-layout.d.ts +18 -0
  132. package/dist/components/page-header-layout.js +23 -0
  133. package/dist/components/page-header-layout.js.map +1 -0
  134. package/dist/components/page-header-skeleton.d.ts +41 -0
  135. package/dist/components/page-header-skeleton.js +52 -0
  136. package/dist/components/page-header-skeleton.js.map +1 -0
  137. package/dist/components/page-header.js +4 -17
  138. package/dist/components/page-header.js.map +1 -1
  139. package/dist/components/popover.js +7 -2
  140. package/dist/components/popover.js.map +1 -1
  141. package/dist/components/release-notes-labels.d.ts +16 -0
  142. package/dist/components/release-notes-labels.js +18 -0
  143. package/dist/components/release-notes-labels.js.map +1 -0
  144. package/dist/components/release-notes.d.ts +65 -0
  145. package/dist/components/release-notes.js +65 -0
  146. package/dist/components/release-notes.js.map +1 -0
  147. package/dist/components/select.js +2 -2
  148. package/dist/components/select.js.map +1 -1
  149. package/dist/components/series-chart-labels.d.ts +9 -0
  150. package/dist/components/series-chart-labels.js +3 -1
  151. package/dist/components/series-chart-labels.js.map +1 -1
  152. package/dist/components/series-chart.d.ts +5 -0
  153. package/dist/components/series-chart.js +89 -36
  154. package/dist/components/series-chart.js.map +1 -1
  155. package/dist/components/toggle-group.js +3 -2
  156. package/dist/components/toggle-group.js.map +1 -1
  157. package/dist/components/treemap-layout.js.map +1 -1
  158. package/dist/components/treemap.d.ts +17 -15
  159. package/dist/components/treemap.js +167 -85
  160. package/dist/components/treemap.js.map +1 -1
  161. package/dist/eslint/index.js +1 -1
  162. package/dist/eslint/role-utilities.d.ts +2 -2
  163. package/dist/eslint/role-utilities.js.map +1 -1
  164. package/dist/feedback/feedback-inbox-page.d.ts +260 -0
  165. package/dist/feedback/feedback-inbox-page.js +207 -0
  166. package/dist/feedback/feedback-inbox-page.js.map +1 -0
  167. package/dist/feedback/feedback-vocabulary.js +2 -2
  168. package/dist/feedback/feedback-vocabulary.js.map +1 -1
  169. package/dist/feedback.d.ts +1 -0
  170. package/dist/feedback.js +6 -0
  171. package/dist/feedback.js.map +1 -1
  172. package/dist/hooks/use-debounce.d.ts +32 -5
  173. package/dist/hooks/use-debounce.js +6 -5
  174. package/dist/hooks/use-debounce.js.map +1 -1
  175. package/dist/hooks/use-file-picker.d.ts +3 -1
  176. package/dist/hooks/use-file-picker.js.map +1 -1
  177. package/dist/hooks/use-focus-trap.d.ts +19 -3
  178. package/dist/hooks/use-focus-trap.js +15 -5
  179. package/dist/hooks/use-focus-trap.js.map +1 -1
  180. package/dist/hooks/use-has-camera.d.ts +36 -0
  181. package/dist/hooks/use-has-camera.js +53 -0
  182. package/dist/hooks/use-has-camera.js.map +1 -0
  183. package/dist/hooks/use-hotkey.js +1 -10
  184. package/dist/hooks/use-hotkey.js.map +1 -1
  185. package/dist/hooks/use-overlay-history.d.ts +6 -1
  186. package/dist/hooks/use-overlay-history.js +10 -2
  187. package/dist/hooks/use-overlay-history.js.map +1 -1
  188. package/dist/i18n/defaults.js +11 -1
  189. package/dist/i18n/defaults.js.map +1 -1
  190. package/dist/i18n/german.js +75 -3
  191. package/dist/i18n/german.js.map +1 -1
  192. package/dist/i18n/kit-labels.d.ts +20 -0
  193. package/dist/i18n/kit-labels.js.map +1 -1
  194. package/dist/i18n/locales/en.js +92 -4
  195. package/dist/i18n/locales/en.js.map +3 -3
  196. package/dist/i18n/locales/es.js +71 -3
  197. package/dist/i18n/locales/es.js.map +1 -1
  198. package/dist/i18n/locales/fr.js +72 -2
  199. package/dist/i18n/locales/fr.js.map +1 -1
  200. package/dist/i18n/locales/hu.js +74 -3
  201. package/dist/i18n/locales/hu.js.map +1 -1
  202. package/dist/i18n/locales/it.js +74 -3
  203. package/dist/i18n/locales/it.js.map +1 -1
  204. package/dist/i18n/locales/zh.js +71 -3
  205. package/dist/i18n/locales/zh.js.map +1 -1
  206. package/dist/i18n/review.js +22 -1
  207. package/dist/i18n/review.js.map +1 -1
  208. package/dist/index.d.ts +24 -5
  209. package/dist/index.js +35 -1
  210. package/dist/index.js.map +1 -1
  211. package/dist/landing/landing-labels.d.ts +8 -0
  212. package/dist/landing/landing-labels.js +2 -1
  213. package/dist/landing/landing-labels.js.map +1 -1
  214. package/dist/lib/changelog.d.ts +130 -0
  215. package/dist/lib/changelog.js +137 -0
  216. package/dist/lib/changelog.js.map +1 -0
  217. package/dist/lib/clipboard-minus.js +2 -2
  218. package/dist/lib/clipboard-minus.js.map +1 -1
  219. package/dist/lib/dates.d.ts +29 -3
  220. package/dist/lib/dates.js +41 -12
  221. package/dist/lib/dates.js.map +1 -1
  222. package/dist/lib/editable-content.d.ts +33 -0
  223. package/dist/lib/editable-content.js +15 -0
  224. package/dist/lib/editable-content.js.map +1 -0
  225. package/dist/lib/focus-left.d.ts +47 -1
  226. package/dist/lib/focus-left.js +11 -2
  227. package/dist/lib/focus-left.js.map +1 -1
  228. package/dist/lib/server-wake.d.ts +49 -9
  229. package/dist/lib/server-wake.js +25 -14
  230. package/dist/lib/server-wake.js.map +1 -1
  231. package/dist/lib/session-refresh.d.ts +53 -0
  232. package/dist/lib/session-refresh.js +27 -1
  233. package/dist/lib/session-refresh.js.map +1 -1
  234. package/dist/rhf/fields.js +3 -3
  235. package/dist/rhf/fields.js.map +1 -1
  236. package/dist/shell/app-shell.d.ts +25 -1
  237. package/dist/shell/app-shell.js +3 -1
  238. package/dist/shell/app-shell.js.map +1 -1
  239. package/dist/shell/dev-menu.d.ts +3 -0
  240. package/dist/shell/dev-menu.js +4 -2
  241. package/dist/shell/dev-menu.js.map +1 -1
  242. package/dist/shell/held-changes-banner-labels.d.ts +23 -0
  243. package/dist/shell/held-changes-banner-labels.js +14 -0
  244. package/dist/shell/held-changes-banner-labels.js.map +1 -0
  245. package/dist/shell/held-changes-banner.d.ts +75 -0
  246. package/dist/shell/held-changes-banner.js +106 -0
  247. package/dist/shell/held-changes-banner.js.map +1 -0
  248. package/dist/shell/sync-status-indicator.d.ts +27 -12
  249. package/dist/shell/sync-status-indicator.js +13 -4
  250. package/dist/shell/sync-status-indicator.js.map +1 -1
  251. package/dist/shell/top-bar-parts-labels.d.ts +5 -0
  252. package/dist/shell/top-bar-parts-labels.js +3 -1
  253. package/dist/shell/top-bar-parts-labels.js.map +1 -1
  254. package/dist/shell.d.ts +2 -0
  255. package/dist/shell.js +3 -0
  256. package/dist/shell.js.map +1 -1
  257. package/dist/sync/engine.d.ts +11 -2
  258. package/dist/sync/engine.js +13 -5
  259. package/dist/sync/engine.js.map +1 -1
  260. package/dist/sync/hooks.d.ts +3 -2
  261. package/dist/sync/hooks.js +4 -2
  262. package/dist/sync/hooks.js.map +1 -1
  263. package/dist/testing/css-variables.generated.d.ts +2 -2
  264. package/dist/testing/css-variables.generated.js +1 -1
  265. package/dist/testing/css-variables.generated.js.map +1 -1
  266. package/dist/theme/chart-palette.d.ts +18 -0
  267. package/dist/theme/chart-palette.js +17 -1
  268. package/dist/theme/chart-palette.js.map +1 -1
  269. package/dist/theme/contrast-tokens.d.ts +3 -3
  270. package/dist/theme/contrast-tokens.js.map +1 -1
  271. package/dist/theme/contrast.d.ts +4 -4
  272. package/dist/theme/contrast.js.map +1 -1
  273. package/dist/tour/tour-overlay.js +2 -1
  274. package/dist/tour/tour-overlay.js.map +1 -1
  275. package/package.json +5 -9
  276. package/tokens.css +19 -54
  277. package/src/account/account-parts.ts +0 -47
  278. package/src/account/account-settings-labels.ts +0 -240
  279. package/src/account/account-settings.tsx +0 -698
  280. package/src/account/data-export-setting-labels.ts +0 -20
  281. package/src/account/data-export-setting.tsx +0 -200
  282. package/src/account/delete-account-setting-labels.ts +0 -33
  283. package/src/account/delete-account-setting.tsx +0 -342
  284. package/src/account/email-change-setting-labels.ts +0 -31
  285. package/src/account/email-change-setting.tsx +0 -443
  286. package/src/account/passkeys-setting.tsx +0 -445
  287. package/src/account/sessions-setting-labels.ts +0 -24
  288. package/src/account/sessions-setting.tsx +0 -283
  289. package/src/admin/admin-action-confirm-labels.ts +0 -19
  290. package/src/admin/admin-action-confirm.tsx +0 -509
  291. package/src/admin/admin-action-log-labels.ts +0 -83
  292. package/src/admin/admin-action-log.tsx +0 -464
  293. package/src/admin/admin-area-labels.ts +0 -114
  294. package/src/admin/admin-forbidden.tsx +0 -75
  295. package/src/admin/admin-overview.tsx +0 -258
  296. package/src/admin/admin-parts.ts +0 -68
  297. package/src/admin/admin-sections.tsx +0 -208
  298. package/src/admin/admin-tool-links.tsx +0 -90
  299. package/src/admin/invitations-panel-labels.ts +0 -31
  300. package/src/admin/invitations-panel.tsx +0 -516
  301. package/src/admin/mail-test-card-labels.ts +0 -19
  302. package/src/admin/mail-test-card.tsx +0 -189
  303. package/src/admin/plan-change-labels.ts +0 -5
  304. package/src/admin/plan-change.tsx +0 -474
  305. package/src/admin/reviewer-scope-editor-labels.ts +0 -16
  306. package/src/admin/reviewer-scope-editor.tsx +0 -224
  307. package/src/admin/role-select-labels.ts +0 -16
  308. package/src/admin/role-select.tsx +0 -282
  309. package/src/admin/transfer-ownership-dialog-labels.ts +0 -20
  310. package/src/admin/transfer-ownership-dialog.tsx +0 -162
  311. package/src/admin/user-roster-labels.ts +0 -17
  312. package/src/admin/user-roster.tsx +0 -559
  313. package/src/auth/accept-invitation-labels.ts +0 -21
  314. package/src/auth/accept-invitation.tsx +0 -210
  315. package/src/auth/auth-errors-labels.ts +0 -23
  316. package/src/auth/auth-errors.ts +0 -439
  317. package/src/auth/complete-name-dialog-labels.ts +0 -16
  318. package/src/auth/complete-name-dialog.tsx +0 -253
  319. package/src/auth/email-tag.ts +0 -75
  320. package/src/auth/forgot-password-form-labels.ts +0 -20
  321. package/src/auth/forgot-password-form.tsx +0 -221
  322. package/src/auth/form-rules.ts +0 -40
  323. package/src/auth/new-password-fields.tsx +0 -85
  324. package/src/auth/not-found-page-labels.ts +0 -12
  325. package/src/auth/not-found-page.tsx +0 -95
  326. package/src/auth/register-form-labels.ts +0 -31
  327. package/src/auth/register-form.tsx +0 -456
  328. package/src/auth/reset-password-form-labels.ts +0 -27
  329. package/src/auth/reset-password-form.tsx +0 -341
  330. package/src/auth/sign-in-form-labels.ts +0 -44
  331. package/src/auth/sign-in-form.tsx +0 -858
  332. package/src/auth/status-parts.tsx +0 -132
  333. package/src/auth/verify-email-labels.ts +0 -26
  334. package/src/auth/verify-email.tsx +0 -445
  335. package/src/billing/billing-banner.tsx +0 -258
  336. package/src/billing/billing-labels.ts +0 -381
  337. package/src/billing/billing-lock.ts +0 -108
  338. package/src/billing/billing-overview.ts +0 -157
  339. package/src/billing/billing-standing.ts +0 -80
  340. package/src/billing/cancel-request.ts +0 -97
  341. package/src/billing/cancel-subscription.tsx +0 -98
  342. package/src/billing/checkout-processing.ts +0 -394
  343. package/src/billing/checkout-return.ts +0 -90
  344. package/src/billing/pay-page.ts +0 -330
  345. package/src/billing/plan-card.tsx +0 -562
  346. package/src/billing/plan-change-labels.ts +0 -66
  347. package/src/billing/plan-limit-notice.tsx +0 -148
  348. package/src/billing/plan-limit-toast.tsx +0 -90
  349. package/src/billing/plan-limit.ts +0 -52
  350. package/src/billing/plan-price.ts +0 -98
  351. package/src/billing/plan-switch.tsx +0 -216
  352. package/src/billing/provider-page.ts +0 -84
  353. package/src/billing/subscription-actions.tsx +0 -247
  354. package/src/billing/subscription-status-chip.tsx +0 -95
  355. package/src/chart.ts +0 -103
  356. package/src/components/account-chips-labels.ts +0 -16
  357. package/src/components/account-chips.tsx +0 -474
  358. package/src/components/alert-banner.tsx +0 -670
  359. package/src/components/amount-input.tsx +0 -816
  360. package/src/components/appearance-labels.ts +0 -63
  361. package/src/components/authed-image-labels.ts +0 -11
  362. package/src/components/authed-image.tsx +0 -209
  363. package/src/components/autocomplete.tsx +0 -645
  364. package/src/components/breadcrumbs-labels.ts +0 -10
  365. package/src/components/breadcrumbs.tsx +0 -205
  366. package/src/components/bulk-action-bar-labels.ts +0 -11
  367. package/src/components/bulk-action-bar.tsx +0 -443
  368. package/src/components/button-group.tsx +0 -223
  369. package/src/components/button-look.ts +0 -256
  370. package/src/components/button.tsx +0 -339
  371. package/src/components/calculator.tsx +0 -341
  372. package/src/components/calendar-heatmap-labels.ts +0 -15
  373. package/src/components/calendar-heatmap.tsx +0 -600
  374. package/src/components/card.tsx +0 -377
  375. package/src/components/chart-edge.ts +0 -106
  376. package/src/components/chart-figure.tsx +0 -35
  377. package/src/components/chart-height.ts +0 -30
  378. package/src/components/chart-zoom-core.tsx +0 -627
  379. package/src/components/chart-zoom.tsx +0 -22
  380. package/src/components/chart.tsx +0 -554
  381. package/src/components/checkbox-group.tsx +0 -247
  382. package/src/components/checkbox.tsx +0 -346
  383. package/src/components/chip-input.tsx +0 -370
  384. package/src/components/chip-labels.ts +0 -13
  385. package/src/components/chip.tsx +0 -843
  386. package/src/components/choice-card.tsx +0 -544
  387. package/src/components/column-mapper-labels.ts +0 -38
  388. package/src/components/column-mapper.tsx +0 -655
  389. package/src/components/combobox-core.tsx +0 -1321
  390. package/src/components/combobox-suggestions.tsx +0 -131
  391. package/src/components/combobox.tsx +0 -716
  392. package/src/components/confirm-context.ts +0 -7
  393. package/src/components/confirm-dialog-labels.ts +0 -13
  394. package/src/components/confirm-dialog.tsx +0 -341
  395. package/src/components/copy-button-labels.ts +0 -13
  396. package/src/components/copy-button.tsx +0 -192
  397. package/src/components/country-select-labels.ts +0 -11
  398. package/src/components/country-select.tsx +0 -539
  399. package/src/components/currency-option-list.tsx +0 -188
  400. package/src/components/currency-select.tsx +0 -343
  401. package/src/components/danger-confirm-labels.ts +0 -20
  402. package/src/components/danger-confirm.tsx +0 -987
  403. package/src/components/data-table-cells.tsx +0 -118
  404. package/src/components/data-table-column-settings.tsx +0 -198
  405. package/src/components/data-table-filter-popover.tsx +0 -289
  406. package/src/components/data-table-filters.ts +0 -315
  407. package/src/components/data-table-fit.ts +0 -301
  408. package/src/components/data-table-groups.tsx +0 -288
  409. package/src/components/data-table-head.tsx +0 -280
  410. package/src/components/data-table-labels.ts +0 -198
  411. package/src/components/data-table-leading-row.tsx +0 -58
  412. package/src/components/data-table-mobile.tsx +0 -1117
  413. package/src/components/data-table-pagination.tsx +0 -202
  414. package/src/components/data-table-resize.ts +0 -188
  415. package/src/components/data-table-row-actions.tsx +0 -302
  416. package/src/components/data-table-row.tsx +0 -496
  417. package/src/components/data-table-selection.ts +0 -71
  418. package/src/components/data-table-shared.tsx +0 -287
  419. package/src/components/data-table-sort.ts +0 -163
  420. package/src/components/data-table-virtual.ts +0 -576
  421. package/src/components/data-table.tsx +0 -2598
  422. package/src/components/date-field.tsx +0 -684
  423. package/src/components/date-format-setting.tsx +0 -64
  424. package/src/components/date-picker.tsx +0 -404
  425. package/src/components/date-range-picker.tsx +0 -518
  426. package/src/components/description-list-labels.ts +0 -9
  427. package/src/components/description-list.tsx +0 -386
  428. package/src/components/dialog-frame-labels.ts +0 -7
  429. package/src/components/dialog-frame.tsx +0 -284
  430. package/src/components/disclosure.tsx +0 -476
  431. package/src/components/dropdown.tsx +0 -461
  432. package/src/components/empty-state.tsx +0 -136
  433. package/src/components/entity-combobox.tsx +0 -422
  434. package/src/components/error-boundary-labels.ts +0 -20
  435. package/src/components/error-boundary.tsx +0 -675
  436. package/src/components/facing-pair.ts +0 -93
  437. package/src/components/field-base-labels.ts +0 -20
  438. package/src/components/field-base.tsx +0 -656
  439. package/src/components/field-parts.tsx +0 -825
  440. package/src/components/field-strip.tsx +0 -129
  441. package/src/components/field.tsx +0 -206
  442. package/src/components/file-button.tsx +0 -295
  443. package/src/components/file-dropzone.tsx +0 -559
  444. package/src/components/floating-panel-labels.ts +0 -10
  445. package/src/components/floating-panel.tsx +0 -828
  446. package/src/components/focus-ring.ts +0 -16
  447. package/src/components/form-actions-labels.ts +0 -11
  448. package/src/components/form-actions.tsx +0 -578
  449. package/src/components/full-bleed-dialog.tsx +0 -294
  450. package/src/components/grouped-picker.tsx +0 -184
  451. package/src/components/help-popover.tsx +0 -117
  452. package/src/components/hover-menu.tsx +0 -343
  453. package/src/components/iban-input-labels.ts +0 -14
  454. package/src/components/iban-input.tsx +0 -236
  455. package/src/components/icon-button.tsx +0 -959
  456. package/src/components/icon-picker-labels.ts +0 -13
  457. package/src/components/icon-picker.tsx +0 -232
  458. package/src/components/image-grid-labels.ts +0 -11
  459. package/src/components/image-grid.tsx +0 -202
  460. package/src/components/inline-confirm.tsx +0 -116
  461. package/src/components/inline-edit-field-labels.ts +0 -11
  462. package/src/components/inline-edit-field.tsx +0 -552
  463. package/src/components/inline-entity-combobox.tsx +0 -849
  464. package/src/components/input.tsx +0 -394
  465. package/src/components/jump-calendar.tsx +0 -265
  466. package/src/components/language-select.tsx +0 -93
  467. package/src/components/legal-labels.ts +0 -105
  468. package/src/components/legal-page.tsx +0 -711
  469. package/src/components/legal.tsx +0 -668
  470. package/src/components/lightbox-labels.ts +0 -18
  471. package/src/components/lightbox.tsx +0 -399
  472. package/src/components/line-items-labels.ts +0 -14
  473. package/src/components/line-items.tsx +0 -602
  474. package/src/components/list-labels.ts +0 -12
  475. package/src/components/list.tsx +0 -870
  476. package/src/components/loading-state.tsx +0 -78
  477. package/src/components/measured-grid-labels.ts +0 -25
  478. package/src/components/measured-grid.tsx +0 -837
  479. package/src/components/menu-item.tsx +0 -241
  480. package/src/components/mini-calendar-labels.ts +0 -17
  481. package/src/components/mini-calendar.tsx +0 -792
  482. package/src/components/modal.tsx +0 -534
  483. package/src/components/money-draft.ts +0 -83
  484. package/src/components/money-field.tsx +0 -76
  485. package/src/components/month-grid.tsx +0 -229
  486. package/src/components/month-picker-labels.ts +0 -22
  487. package/src/components/month-picker.tsx +0 -1087
  488. package/src/components/multi-entity-combobox.tsx +0 -369
  489. package/src/components/multi-select.tsx +0 -376
  490. package/src/components/nav-pills.tsx +0 -198
  491. package/src/components/number-field.tsx +0 -327
  492. package/src/components/number-input.tsx +0 -559
  493. package/src/components/numeric-field.ts +0 -169
  494. package/src/components/numpad-sheet.tsx +0 -285
  495. package/src/components/one-time-code-input.tsx +0 -270
  496. package/src/components/page-contents-labels.ts +0 -9
  497. package/src/components/page-contents.tsx +0 -282
  498. package/src/components/page-header-context.ts +0 -8
  499. package/src/components/page-header.tsx +0 -298
  500. package/src/components/password-strength-labels.ts +0 -22
  501. package/src/components/password-strength.tsx +0 -241
  502. package/src/components/phone-input-labels.ts +0 -10
  503. package/src/components/phone-input.tsx +0 -282
  504. package/src/components/picker-sheet.tsx +0 -330
  505. package/src/components/pie-chart-labels.ts +0 -40
  506. package/src/components/pie-chart.tsx +0 -480
  507. package/src/components/popover-labels.ts +0 -14
  508. package/src/components/popover.tsx +0 -268
  509. package/src/components/progress-bar-labels.ts +0 -10
  510. package/src/components/progress-bar.tsx +0 -479
  511. package/src/components/qr-code.tsx +0 -76
  512. package/src/components/reauth-dialog-labels.ts +0 -13
  513. package/src/components/reauth-dialog.tsx +0 -265
  514. package/src/components/row-actions-labels.ts +0 -12
  515. package/src/components/row-actions.tsx +0 -795
  516. package/src/components/scroll-area.tsx +0 -123
  517. package/src/components/search-field.tsx +0 -192
  518. package/src/components/select.tsx +0 -294
  519. package/src/components/separator.tsx +0 -33
  520. package/src/components/series-chart-axes.ts +0 -342
  521. package/src/components/series-chart-budget.ts +0 -150
  522. package/src/components/series-chart-labels.ts +0 -33
  523. package/src/components/series-chart-thin.ts +0 -180
  524. package/src/components/series-chart-ticks.ts +0 -194
  525. package/src/components/series-chart.tsx +0 -1906
  526. package/src/components/server-wake-labels.ts +0 -11
  527. package/src/components/server-wake.tsx +0 -129
  528. package/src/components/settings-fields.tsx +0 -237
  529. package/src/components/share-card-labels.ts +0 -30
  530. package/src/components/share-card.tsx +0 -675
  531. package/src/components/signature-pad-labels.ts +0 -24
  532. package/src/components/signature-pad.tsx +0 -747
  533. package/src/components/signed-amount-labels.ts +0 -10
  534. package/src/components/signed-amount.tsx +0 -336
  535. package/src/components/skeleton.tsx +0 -80
  536. package/src/components/slider.tsx +0 -338
  537. package/src/components/sparkline-labels.ts +0 -14
  538. package/src/components/sparkline.tsx +0 -322
  539. package/src/components/spinner.tsx +0 -81
  540. package/src/components/stat-tile-labels.ts +0 -15
  541. package/src/components/stat-tile.tsx +0 -754
  542. package/src/components/status-dot.tsx +0 -170
  543. package/src/components/swatch-picker-labels.ts +0 -10
  544. package/src/components/swatch-picker.tsx +0 -283
  545. package/src/components/swipeable-row.tsx +0 -386
  546. package/src/components/switch.tsx +0 -273
  547. package/src/components/table-skeleton.tsx +0 -136
  548. package/src/components/table.tsx +0 -647
  549. package/src/components/tabs-labels.ts +0 -13
  550. package/src/components/tabs.tsx +0 -693
  551. package/src/components/text-link.tsx +0 -359
  552. package/src/components/text.tsx +0 -150
  553. package/src/components/textarea.tsx +0 -330
  554. package/src/components/tile-radio.tsx +0 -332
  555. package/src/components/time-input.tsx +0 -121
  556. package/src/components/toast-labels.ts +0 -12
  557. package/src/components/toast.tsx +0 -519
  558. package/src/components/toggle-group.tsx +0 -752
  559. package/src/components/toggle-legend.tsx +0 -394
  560. package/src/components/tooltip.tsx +0 -1149
  561. package/src/components/translation-review-editor.tsx +0 -290
  562. package/src/components/translation-review-labels.ts +0 -181
  563. package/src/components/translation-review-parts.tsx +0 -272
  564. package/src/components/translation-review.tsx +0 -1240
  565. package/src/components/tree-view.tsx +0 -589
  566. package/src/components/treemap-labels.ts +0 -47
  567. package/src/components/treemap-layout.ts +0 -210
  568. package/src/components/treemap.tsx +0 -1184
  569. package/src/components/trigger-aria.ts +0 -44
  570. package/src/components/use-anchor-dir.ts +0 -20
  571. package/src/components/use-mobile-reveal.ts +0 -62
  572. package/src/components/use-table-state.ts +0 -753
  573. package/src/components/user-avatar.tsx +0 -116
  574. package/src/components/wizard-stepper.tsx +0 -42
  575. package/src/components/write-lock-labels.ts +0 -10
  576. package/src/components/write-lock.tsx +0 -253
  577. package/src/currencies.ts +0 -90
  578. package/src/data-table.ts +0 -42
  579. package/src/demo/demo-banner.tsx +0 -153
  580. package/src/demo/demo-countdown.ts +0 -136
  581. package/src/demo/demo-ended.tsx +0 -90
  582. package/src/demo/demo-labels.ts +0 -78
  583. package/src/demo/demo-session.ts +0 -32
  584. package/src/demo/demo-start.tsx +0 -156
  585. package/src/eslint/index.ts +0 -161
  586. package/src/eslint/role-utilities.generated.ts +0 -146
  587. package/src/eslint/role-utilities.ts +0 -233
  588. package/src/feedback/feedback-attachment-download.tsx +0 -77
  589. package/src/feedback/feedback-attachment-labels.ts +0 -37
  590. package/src/feedback/feedback-attachment.tsx +0 -1239
  591. package/src/feedback/feedback-capture.ts +0 -287
  592. package/src/feedback/feedback-comment-thread.tsx +0 -353
  593. package/src/feedback/feedback-context-labels.ts +0 -11
  594. package/src/feedback/feedback-context.tsx +0 -245
  595. package/src/feedback/feedback-crash.ts +0 -547
  596. package/src/feedback/feedback-diagnostics.tsx +0 -41
  597. package/src/feedback/feedback-dialog-labels.ts +0 -29
  598. package/src/feedback/feedback-dialog.tsx +0 -452
  599. package/src/feedback/feedback-entry-file.tsx +0 -150
  600. package/src/feedback/feedback-inbox.tsx +0 -552
  601. package/src/feedback/feedback-labels.ts +0 -144
  602. package/src/feedback/feedback-menu-labels.ts +0 -12
  603. package/src/feedback/feedback-menu.tsx +0 -177
  604. package/src/feedback/feedback-mutation.ts +0 -20
  605. package/src/feedback/feedback-page-link.ts +0 -90
  606. package/src/feedback/feedback-public-labels.ts +0 -81
  607. package/src/feedback/feedback-public-list.tsx +0 -524
  608. package/src/feedback/feedback-public-switch.tsx +0 -102
  609. package/src/feedback/feedback-public-types.ts +0 -101
  610. package/src/feedback/feedback-record.ts +0 -428
  611. package/src/feedback/feedback-replies-context.ts +0 -9
  612. package/src/feedback/feedback-replies.tsx +0 -343
  613. package/src/feedback/feedback-rework-entry-chip.tsx +0 -18
  614. package/src/feedback/feedback-row-detail-labels.ts +0 -31
  615. package/src/feedback/feedback-row-detail.tsx +0 -871
  616. package/src/feedback/feedback-status-undo.ts +0 -109
  617. package/src/feedback/feedback-submit-dialog.tsx +0 -131
  618. package/src/feedback/feedback-submit.tsx +0 -270
  619. package/src/feedback/feedback-swipe.tsx +0 -192
  620. package/src/feedback/feedback-table-labels.ts +0 -27
  621. package/src/feedback/feedback-table.tsx +0 -912
  622. package/src/feedback/feedback-thread-labels.ts +0 -22
  623. package/src/feedback/feedback-thread-parts-labels.ts +0 -41
  624. package/src/feedback/feedback-thread.tsx +0 -905
  625. package/src/feedback/feedback-vocabulary.ts +0 -263
  626. package/src/feedback/feedback-vote-button.tsx +0 -124
  627. package/src/feedback.ts +0 -116
  628. package/src/hooks/use-anchored-panel.ts +0 -396
  629. package/src/hooks/use-anchored-rect.ts +0 -77
  630. package/src/hooks/use-announce.ts +0 -85
  631. package/src/hooks/use-authed-src.ts +0 -167
  632. package/src/hooks/use-body-scroll-lock.ts +0 -119
  633. package/src/hooks/use-breakpoint.ts +0 -133
  634. package/src/hooks/use-close-transition.ts +0 -107
  635. package/src/hooks/use-copy-to-clipboard.ts +0 -122
  636. package/src/hooks/use-debounce.ts +0 -114
  637. package/src/hooks/use-dismiss.ts +0 -371
  638. package/src/hooks/use-document-title.ts +0 -33
  639. package/src/hooks/use-file-drop.ts +0 -121
  640. package/src/hooks/use-file-picker-labels.ts +0 -28
  641. package/src/hooks/use-file-picker.tsx +0 -359
  642. package/src/hooks/use-focus-trap.ts +0 -199
  643. package/src/hooks/use-hotkey.ts +0 -212
  644. package/src/hooks/use-large-text.ts +0 -41
  645. package/src/hooks/use-long-press.ts +0 -140
  646. package/src/hooks/use-media-query.ts +0 -39
  647. package/src/hooks/use-mounted.ts +0 -39
  648. package/src/hooks/use-noindex.ts +0 -37
  649. package/src/hooks/use-overlay-history.ts +0 -714
  650. package/src/hooks/use-row-swipe.ts +0 -207
  651. package/src/hooks/use-search-param-state.ts +0 -434
  652. package/src/hooks/use-windowed-rows.ts +0 -225
  653. package/src/i18n/defaults.ts +0 -267
  654. package/src/i18n/german.ts +0 -2059
  655. package/src/i18n/kit-labels.tsx +0 -1003
  656. package/src/i18n/languages.ts +0 -349
  657. package/src/i18n/locales/de-CH.ts +0 -24
  658. package/src/i18n/locales/en.ts +0 -267
  659. package/src/i18n/locales/es.ts +0 -1999
  660. package/src/i18n/locales/fr.ts +0 -2037
  661. package/src/i18n/locales/hu.ts +0 -2004
  662. package/src/i18n/locales/it.ts +0 -2014
  663. package/src/i18n/locales/zh.ts +0 -1912
  664. package/src/i18n/plurals.ts +0 -86
  665. package/src/i18n/review.ts +0 -475
  666. package/src/i18n/shared-labels.ts +0 -138
  667. package/src/i18n/swiss.ts +0 -29
  668. package/src/index.ts +0 -1191
  669. package/src/landing/access.ts +0 -93
  670. package/src/landing/landing-actions.tsx +0 -97
  671. package/src/landing/landing-labels.ts +0 -59
  672. package/src/landing/landing-sections.tsx +0 -341
  673. package/src/landing/page-seo.ts +0 -261
  674. package/src/landing/public-header.tsx +0 -121
  675. package/src/landing/public-page.tsx +0 -106
  676. package/src/landing/routing.tsx +0 -225
  677. package/src/lib/broadcast.ts +0 -52
  678. package/src/lib/calc.ts +0 -323
  679. package/src/lib/chip-edge-snap.ts +0 -212
  680. package/src/lib/clipboard-minus.ts +0 -107
  681. package/src/lib/clipping.ts +0 -34
  682. package/src/lib/cn.ts +0 -28
  683. package/src/lib/column-mapping.ts +0 -234
  684. package/src/lib/countries.ts +0 -91
  685. package/src/lib/data-attributes.ts +0 -14
  686. package/src/lib/date-format.ts +0 -227
  687. package/src/lib/dates.ts +0 -288
  688. package/src/lib/day-format.ts +0 -96
  689. package/src/lib/decimal-marks.ts +0 -108
  690. package/src/lib/describe-failure.ts +0 -18
  691. package/src/lib/device-settings.ts +0 -147
  692. package/src/lib/direction.ts +0 -74
  693. package/src/lib/document-navigation.ts +0 -17
  694. package/src/lib/document-title.ts +0 -41
  695. package/src/lib/download.ts +0 -172
  696. package/src/lib/float-clearance.ts +0 -70
  697. package/src/lib/floating-stack.ts +0 -70
  698. package/src/lib/focus-left.ts +0 -156
  699. package/src/lib/format.ts +0 -585
  700. package/src/lib/http-status.ts +0 -38
  701. package/src/lib/iban.ts +0 -251
  702. package/src/lib/ime.ts +0 -24
  703. package/src/lib/intl-cache.ts +0 -27
  704. package/src/lib/iso-day.ts +0 -13
  705. package/src/lib/lazy-with-fallback.ts +0 -82
  706. package/src/lib/logger.ts +0 -69
  707. package/src/lib/minus.ts +0 -50
  708. package/src/lib/path-pattern.ts +0 -55
  709. package/src/lib/person-name.ts +0 -155
  710. package/src/lib/phone.ts +0 -208
  711. package/src/lib/plain-text.ts +0 -22
  712. package/src/lib/presence.ts +0 -18
  713. package/src/lib/qr-encode.ts +0 -444
  714. package/src/lib/quiet-focus.ts +0 -32
  715. package/src/lib/reduced-motion.ts +0 -22
  716. package/src/lib/refs.ts +0 -22
  717. package/src/lib/round.ts +0 -43
  718. package/src/lib/safe-storage.ts +0 -119
  719. package/src/lib/server-wake.ts +0 -315
  720. package/src/lib/session-refresh.ts +0 -472
  721. package/src/lib/share-format.ts +0 -18
  722. package/src/lib/status-tone.ts +0 -43
  723. package/src/lib/strip-fade.ts +0 -287
  724. package/src/lib/table-text.ts +0 -554
  725. package/src/lib/text-case.ts +0 -19
  726. package/src/lib/text-match.ts +0 -169
  727. package/src/lib/thenable.ts +0 -19
  728. package/src/lib/translation-review.ts +0 -769
  729. package/src/notifications/device-zone-report.ts +0 -67
  730. package/src/notifications/feedback-notification-types-labels.ts +0 -33
  731. package/src/notifications/feedback-notification-types.ts +0 -71
  732. package/src/notifications/notification-bell.tsx +0 -119
  733. package/src/notifications/notification-inbox.tsx +0 -309
  734. package/src/notifications/notification-parts.tsx +0 -81
  735. package/src/notifications/notification-types-setting.tsx +0 -406
  736. package/src/notifications/notification-types.ts +0 -89
  737. package/src/notifications/notifications-labels.ts +0 -287
  738. package/src/notifications/push-device-setting.tsx +0 -230
  739. package/src/notifications/push-devices-setting.tsx +0 -374
  740. package/src/notifications/push-worker.ts +0 -168
  741. package/src/notifications/quiet-hours-setting.tsx +0 -238
  742. package/src/notifications/unsubscribe-panel.tsx +0 -200
  743. package/src/notifications/use-push-device.ts +0 -448
  744. package/src/offline/local-first.ts +0 -100
  745. package/src/offline/pwa-update-prompt-labels.ts +0 -9
  746. package/src/offline/pwa-update-prompt.tsx +0 -78
  747. package/src/offline/query-persistence.ts +0 -391
  748. package/src/offline/service-worker-updates.ts +0 -81
  749. package/src/offline/shared-computer-labels.ts +0 -8
  750. package/src/offline/shared-computer.tsx +0 -87
  751. package/src/offline/sign-out-pending-dialog-labels.ts +0 -21
  752. package/src/offline/sign-out-pending-dialog.tsx +0 -135
  753. package/src/offline.ts +0 -37
  754. package/src/push-worker.ts +0 -25
  755. package/src/rhf/fields.tsx +0 -2187
  756. package/src/rhf/form-core.tsx +0 -324
  757. package/src/rhf/form.tsx +0 -12
  758. package/src/rhf/line-items.tsx +0 -135
  759. package/src/rhf/use-rhf-wizard-step.ts +0 -104
  760. package/src/rhf.ts +0 -21
  761. package/src/search/command-palette-labels.ts +0 -16
  762. package/src/search/command-palette.tsx +0 -624
  763. package/src/search/global-search-labels.ts +0 -13
  764. package/src/search/global-search.tsx +0 -660
  765. package/src/search/search-index.ts +0 -283
  766. package/src/search/use-command-key.ts +0 -23
  767. package/src/search.ts +0 -14
  768. package/src/settings/device-reset-setting-labels.ts +0 -20
  769. package/src/settings/device-reset-setting.tsx +0 -116
  770. package/src/settings/settings-card-classes.ts +0 -11
  771. package/src/settings/settings-catalogue.ts +0 -150
  772. package/src/settings/settings-context.ts +0 -33
  773. package/src/settings/settings-heading.tsx +0 -67
  774. package/src/settings/settings-labels.ts +0 -87
  775. package/src/settings/settings-layout.tsx +0 -471
  776. package/src/settings/settings-section.tsx +0 -108
  777. package/src/settings/use-account-appearance.ts +0 -148
  778. package/src/settings/use-account-language.ts +0 -146
  779. package/src/settings/use-settings-focus.ts +0 -128
  780. package/src/settings/use-settings-route.ts +0 -258
  781. package/src/shell/account-menu-language.tsx +0 -130
  782. package/src/shell/account-menu-text-size.tsx +0 -80
  783. package/src/shell/admin-menu.tsx +0 -183
  784. package/src/shell/app-shell-labels.ts +0 -11
  785. package/src/shell/app-shell.tsx +0 -1560
  786. package/src/shell/auth-layout.tsx +0 -186
  787. package/src/shell/company-switcher-labels.ts +0 -13
  788. package/src/shell/company-switcher.tsx +0 -136
  789. package/src/shell/dev-menu.tsx +0 -257
  790. package/src/shell/fill-height.tsx +0 -45
  791. package/src/shell/language-code.ts +0 -5
  792. package/src/shell/option-switcher-menu.tsx +0 -84
  793. package/src/shell/sync-status-indicator.tsx +0 -303
  794. package/src/shell/top-bar-actions.tsx +0 -87
  795. package/src/shell/top-bar-brand.tsx +0 -78
  796. package/src/shell/top-bar-parts-labels.ts +0 -148
  797. package/src/shell/top-bar.tsx +0 -40
  798. package/src/shell/topbar-action-menu.tsx +0 -567
  799. package/src/shell/topbar-controls.tsx +0 -269
  800. package/src/shell/tour-menu.tsx +0 -187
  801. package/src/shell.ts +0 -108
  802. package/src/sync/db.ts +0 -129
  803. package/src/sync/engine.ts +0 -1011
  804. package/src/sync/hooks.ts +0 -98
  805. package/src/sync/testing.ts +0 -73
  806. package/src/sync/wire.ts +0 -61
  807. package/src/sync.ts +0 -37
  808. package/src/table-text.ts +0 -8
  809. package/src/testing/css-variables.generated.ts +0 -112
  810. package/src/testing/css-variables.ts +0 -189
  811. package/src/testing/index.ts +0 -29
  812. package/src/testing/react.ts +0 -58
  813. package/src/testing/tour.ts +0 -41
  814. package/src/testing/viewport.ts +0 -357
  815. package/src/theme/chart-palette.ts +0 -232
  816. package/src/theme/color.ts +0 -272
  817. package/src/theme/contrast-tokens.ts +0 -268
  818. package/src/theme/contrast.ts +0 -250
  819. package/src/theme/palette-derive.ts +0 -825
  820. package/src/theme/palette-presets.ts +0 -544
  821. package/src/theme/palette-store.ts +0 -108
  822. package/src/theme/text-size.ts +0 -289
  823. package/src/theme/theme-store.ts +0 -157
  824. package/src/tour/tour-catalogue-labels.ts +0 -75
  825. package/src/tour/tour-catalogue.tsx +0 -335
  826. package/src/tour/tour-dock.ts +0 -134
  827. package/src/tour/tour-engine.ts +0 -37
  828. package/src/tour/tour-gates.ts +0 -218
  829. package/src/tour/tour-guide-button.tsx +0 -64
  830. package/src/tour/tour-guide-labels.ts +0 -15
  831. package/src/tour/tour-info.ts +0 -144
  832. package/src/tour/tour-labels.ts +0 -23
  833. package/src/tour/tour-overlay.tsx +0 -1170
  834. package/src/tour/tour.tsx +0 -750
  835. package/src/tour/use-tour-progress.ts +0 -671
  836. package/src/tour/use-tour-url-sync.ts +0 -266
  837. package/src/tour.ts +0 -21
  838. package/src/vite-env.d.ts +0 -23
  839. package/src/wizard/stepper-nav.tsx +0 -360
  840. package/src/wizard/types.ts +0 -275
  841. package/src/wizard/use-wizard.ts +0 -560
  842. package/src/wizard/validation.ts +0 -39
  843. package/src/wizard/wizard-context.tsx +0 -74
  844. package/src/wizard/wizard-labels.ts +0 -29
  845. package/src/wizard/wizard-step.tsx +0 -76
  846. package/src/wizard/wizard-summary.tsx +0 -84
  847. package/src/wizard.ts +0 -15
@@ -13,6 +13,7 @@ import {
13
13
  FIELD_CAPTION_CLASS,
14
14
  FIELD_ERROR_CLASS,
15
15
  fieldHelpMark,
16
+ isSuggestionHint,
16
17
  isTextHint,
17
18
  LabelStrip,
18
19
  useDisabledReasonLine,
@@ -68,8 +69,8 @@ function ToggleGroup(props) {
68
69
  const reasonLine = useDisabledReasonLine(disabledReasonDisplay) && locked;
69
70
  const helpMark = fieldHelpMark(hasContent(label) ? help : void 0, label);
70
71
  const withHelp = helpMark !== void 0;
71
- const inlineHint = useInlineHint(hint, withHelp);
72
- const hintAsCaption = withHelp ? hasContent(inlineHint) ? inlineHint : void 0 : isTextHint(hint) ? hint : inlineHint !== hint ? inlineHint : void 0;
72
+ const inlineHint = useInlineHint(hint, withHelp, label);
73
+ const hintAsCaption = withHelp ? hasContent(inlineHint) ? inlineHint : void 0 : isTextHint(hint) ? hint : isSuggestionHint(hint) || inlineHint !== hint ? inlineHint : void 0;
73
74
  const labelHint = helpMark ?? (hintAsCaption === void 0 ? hint : void 0);
74
75
  const dimmed = disabled || locked;
75
76
  const labelled = hasContent(label);
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/components/toggle-group.tsx"],"sourcesContent":["import { useCallback, useId } from \"react\";\nimport type { ComponentPropsWithoutRef, KeyboardEvent, ReactElement, ReactNode, Ref } from \"react\";\nimport { cn } from \"../lib/cn\";\nimport { horizontalStep } from \"../lib/direction\";\nimport { FIELD_INVALID, FloatingField, Label } from \"./field-base\";\nimport { Tooltip } from \"./tooltip\";\nimport { useCommitReason, type CommitScope } from \"./write-lock\";\nimport { hasContent } from \"../lib/presence\";\nimport {\n assignRef,\n DISABLED_REASON_LINE_CLASS,\n FIELD_CAPTION_CLASS,\n FIELD_ERROR_CLASS,\n fieldHelpMark,\n isTextHint,\n LabelStrip,\n useDisabledReasonLine,\n useInlineHint,\n type DisabledReasonDisplay,\n type FieldHelpProps,\n} from \"./field-parts\";\nimport { FOCUS_RING_WIDTH } from \"./focus-ring\";\n\nexport interface ToggleOption<T extends string> {\n value: T;\n label: string;\n className?: string;\n}\n\n/**\n * `onChange` is the group's own — the chosen VALUE, not a DOM event — so the div's\n * `onChange` is omitted rather than shadowed: leaving both in scope would give the\n * prop two incompatible meanings depending on which overload TypeScript picked.\n *\n * `children` is omitted too: this renders its `options` and nothing else, so a `children` the type\n * accepted and the component ignored would be a prop that silently does nothing —\n * worse than one that does not compile.\n */\nexport interface ToggleGroupBaseProps<T extends string>\n extends Omit<ComponentPropsWithoutRef<\"div\">, \"onChange\" | \"children\">, FieldHelpProps {\n options: ToggleOption<T>[];\n className?: string;\n /** Applied to every option button (e.g. to tune height/rounding to match\n * adjacent fields). Per-option `className` still wins over this. */\n optionClassName?: string;\n /**\n * What happens when the options do not fit the group's width. `\"truncate\"`\n * (default): one row, and the labels that do not fit end in an ellipsis — the height\n * never changes. `\"wrap\"`: the segments flow onto a second row and every label stays\n * whole (\"Bewegung\", not \"Beweg…\"), at the price of a taller group on a narrow\n * screen (lenkbank L4: five signal types on a 390px control page). From the width\n * where they fit, both look the same.\n *\n * Since 0.32 a group in the field chrome (`label`, the default placement) with four or\n * more options wraps at Large and Extra large under `\"truncate\"` too, inside its frame:\n * the type is bigger there and the field would otherwise run past a phone's edge\n * (docs/text-size-harmonization.md §4). The keyboard is the same either way.\n */\n overflow?: \"truncate\" | \"wrap\";\n /**\n * Show, refuse the change (Keksdose live #288: a payment dated in the future has no\n * state to set).\n *\n * Whatever `value` says stays pressed and keeps its own fill rather than going grey\n * with the rest — a reader who cannot see WHICH option is chosen has been told less\n * than before it was disabled. A caller with nothing to show passes no value, and\n * the group renders dimmed with nothing pressed, which is the shape Keksdose's\n * status picker uses for a row whose status does not exist yet.\n *\n * On the whole GROUP, not per option: a segmented control where some segments are\n * live and others are not is a menu with holes in it, and no caller here wants one.\n */\n disabled?: boolean;\n /**\n * `sm`: 12px options with `px-2 py-1` — the compact group keksdose's rule editor\n * (rule-editor:204) writes as `optionClassName=\"px-2 py-1 text-xs\"` beside a small\n * caption. `md` (default) is the size every other group has.\n *\n * Honoured inside the field chrome and the strip too (keksdose K1): the 12px type\n * stays, and the field is still 42px — see `CHROME_PAD`.\n */\n size?: \"sm\" | \"md\";\n /**\n * Stand in a form row as a FIELD: with a label the group wears the field's chrome —\n * border, surface, the top strip with a small static label in it, a labelled\n * {@link Select}'s height — so beside an Input or a Select it reads as one of them\n * rather than as a control with a caption over it. lenkbank builds exactly this by\n * hand as `ToggleField` (features/gear/common.tsx:97, feedback #69), and its notes\n * are why the chrome STRETCHES to its row as well as matching the select's padding:\n * a native select's height is the browser's, so a toggle a few pixels short of it\n * is levelled up by the row rather than by arithmetic.\n *\n * The label names the group (`aria-labelledby`), so `aria-label` is not needed. With\n * a label, `className` styles the field's wrapper — as on {@link Select} — and the\n * group's own box is dropped: two nested borders read as a control in a control.\n */\n label?: ReactNode;\n /**\n * Where `label` goes. `\"field\"` (default): the field chrome described under `label`.\n * `\"above\"`: the kit's {@link Label} over the bare group — the shape of a {@link Field}\n * — with `hint` beside the label and `error` under the group, for a form that sets\n * its labels above its fields (kastlan's international-rent-calculator.tsx, whose DE\n * cap pair sits in a `Field` column between two labelled-above inputs, where the\n * chrome's inner label would be the only one of its kind).\n *\n * `\"strip\"`: the 11px static label (and `hint`) in a strip OVER the bare group, for a\n * group that stands in a row of fields but is not one (keksdose K2 — the transaction\n * row's cleared-status picker, live #288 / #431 / dev#468). No field border: the group\n * keeps its own box, and its segments drop their vertical padding and set a 16px line,\n * so the 20px strip plus the 22px group is exactly a labelled {@link Input}'s 42px,\n * the label on the same line as theirs and clear of the group's border (keksdose\n * dev#593 — see `STRIP_SEGMENT`). `error` and `caption` go under the group, as in the\n * other two.\n *\n * Inside a `Field`, pass no `label` at all and spread the render-prop instead —\n * `{(ids, { labelId }) => <ToggleGroup {...ids} aria-labelledby={labelId} … />}` —\n * so the Field's label names the group and its hint and error describe it.\n */\n labelPlacement?: \"field\" | \"above\" | \"strip\";\n /**\n * Classes for the field chrome's own box — the bordered, padded box round the\n * segments — merged last, so they win. `className` styles the wrapper the chrome sits\n * in; this reaches the box itself. Only with `label` in the `\"field\"` placement.\n *\n * For a field JOINED flush to a neighbour (keksdose K1): reports-filters.tsx joins its\n * \"group by\" field to the range select on its start edge from `md` up, and squares the\n * shared corners by hand chrome today — here that is\n * `chromeClassName=\"md:rounded-s-none\"` with `className=\"md:-ms-px\"` (the wrapper\n * overlaps the neighbour by the one border they share). A class rather than a\n * `joined=\"start\"` because every such join keksdose has is responsive: on a phone the\n * two stack and both keep their corners.\n */\n chromeClassName?: string;\n /**\n * As on a labelled {@link Select}: a {@link FieldHint} \"?\" on the label line, and plain\n * text (a string) as a caption under the group. Only with `label`.\n *\n * 0.32.1 (keksdose's 0.32 report): text went on the label line in every placement, so\n * `TextSizeSetting`'s hint with `labelPlacement=\"above\"` sat beside the label in body\n * type, and at Extra large became a column one word wide — on the setting a reader who\n * needs large text opens first. The label line holds the \"?\" only (`isTextHint`).\n */\n hint?: ReactNode;\n /** The message under the field when it is wrong: paints the field's border with\n * `--danger`, marks the group `aria-invalid` and describes it with the message, as\n * {@link Select}'s `error` does. Only with `label`. */\n error?: ReactNode;\n /**\n * Why the group cannot be changed right now — {@link Button}'s `disabledReason`, for\n * a group that saves itself on change (keksdose K3: the last `SaveGuard` sites are\n * self-committing controls like this one, and SaveGuard's native `disabled` took\n * them out of the tab order so the reason never reached a keyboard).\n *\n * The group stays reachable — its segments are `aria-disabled`, not `disabled`, and\n * a radio group's arrow keys still walk them — but nothing reaches `onChange`, and\n * the reason shows in the kit {@link Tooltip} over the segments on hover or focus and\n * describes each segment. The chosen option keeps its fill, as under `disabled`.\n * Wins over `disabled`, as on Button: passing both keeps the group reachable.\n */\n disabledReason?: ReactNode;\n /**\n * Where `disabledReason` shows (0.32, §4 \"No fact only in a tooltip\"): by default, at\n * Large and on a touch screen, as a line under the group (where its caption goes), and\n * in the tooltip over the segments otherwise. See {@link DisabledReasonDisplay}.\n */\n disabledReasonDisplay?: DisabledReasonDisplay;\n /**\n * This group COMMITS — choosing an option saves it. Under a locked\n * {@link WriteLockProvider} it takes the `disabledReason` path with the lock's\n * reason (which wins over a `disabledReason` of its own): *\"everything renders; only\n * the commit is locked\"* (keksdose dev#496/#497), and a control that is its own commit\n * must render refused, never live-and-discarding. No provider, or an unlocked one:\n * no effect.\n */\n commit?: CommitScope;\n /**\n * The group — the `radiogroup` (or the pressed shape's `group`) the rest of the props go\n * on — as a React 19 ref prop (0.34, API-3, refactor audit 2026-10). The group itself\n * takes no focus, so its `focus()` lands where a keyboard would: the radio shape's one\n * tab stop (the checked option, else the first), or in the pressed shape the pressed\n * button, else the first. That is react-hook-form's focus-on-error, which /rhf's\n * adapter reached by an id lookup carrying this same rule until now.\n */\n ref?: Ref<HTMLDivElement>;\n}\n\n/**\n * The field chrome's vertical geometry — keksdose K1, the kit reintroducing feedback\n * #117 that keksdose's hand-built chrome had fixed.\n *\n * In px at Normal, as measured; since 0.32 every term but the two borders is rem\n * (§3.2), so the sum stays a labelled Select's at 125 and 150 % too — the Select's own\n * `pt-4 pb-1` and 1.25rem line grow by the same factor (52 px at Large, 62 at Extra\n * large). The md line was `leading-[18px]` and is `leading-[1.125rem]`.\n *\n * The label is the field's static label: `top-1` and 11px in a `leading-tight` line, so\n * its line box runs from 4px to 17.75px. Until 0.22 the chrome was `pt-4` over a 20px\n * (`leading-5`) segment, so the ACTIVE segment's fill — painted from the top of the\n * segment — started at 17px (1px border + 16px), 0.75px INSIDE the label's line box:\n * the highlight touched the word above it, exactly what #117's rework had measured and\n * cured with `pt-5`.\n *\n * Now the strip is `pt-5` and the fill starts at 21px, 3.25px clear, and the segment\n * gives the 4px back so the field stays a labelled Select's 42px: `md` sets its 14px\n * text in an 18px line with a 2px moat under it (the bare group's own `p-0.5` moat),\n * `sm` sets 12px text in a 16px line over `pb-1` — keksdose's measured chrome\n * (price-level-picker, reports-filters: `pt-5 pb-1`, `text-xs md:py-0`), byte for byte.\n * Before, `size=\"sm\"` inside the chrome was overridden to the md 20px line.\n *\n * md: 1 + 20 + 18 + 2 + 1 = 42 sm: 1 + 20 + 16 + 4 + 1 = 42\n */\n// At Large the chrome's label stands above it (0.33, §10.17): no strip, the same moat top\n// and bottom.\nconst CHROME_PAD: Record<\"sm\" | \"md\", string> = { md: \"pt-5 pb-0.5 large:pt-0.5\", sm: \"pt-5 pb-1 large:pt-1\" };\nconst CHROME_SEGMENT: Record<\"sm\" | \"md\", string> = { md: \"py-0 leading-[1.125rem]\", sm: \"py-0 leading-4\" };\n\n/**\n * A group at Large and Extra large (0.32,\n * docs/text-size-harmonization.md §4 \"nothing truncates\", §3.3): the segments flow onto a\n * second row inside the group's frame instead of overflowing it. At 125 % a 390 px phone\n * is 312 px of Normal type, and \"Month / Quarter / Half-year / Year\" in one row of the\n * field ran 7 px past it: a one-row flex group is as wide as all its labels end to end\n * when a grid or a stretched column asks how small it can get, however its segments\n * truncate. Wrapped, it is as wide as its longest label.\n *\n * Wrap, not a stacked select-like list: a wrapped radio group is the same radio group —\n * one Tab stop, and the arrow keys walk the options in reading order whichever row\n * they are on (←/↑ back, →/↓ on, Home/End) — so nothing about the keyboard changes with\n * the text size. A list in its place would be a second widget with its own keys.\n *\n * Only where it has to: `flex-wrap` breaks a row only when the segments do not fit, so\n * a wide field at Large stays one row, and a segment shares out what its row leaves\n * (`flex-1`); a label wider than the whole row still truncates as the last resort.\n * A `large:` class, so it costs no render and is right on the first paint.\n * `overflow=\"wrap\"` wraps at every size already.\n *\n * 0.32.1 (Kurvenschmiede's 0.32 report): every count and every placement, not only a\n * field of four or more. Since a row breaks only where its labels do not fit, a wrap\n * only ever replaces a truncation — and three options in a card at Extra large on a\n * 360 px phone read \"Syst… Li… D…\".\n *\n * 0.34 (round 0.34 T1, text size §10.17): the strip too, which 0.32.1 kept to one row so\n * its 26 px group lined up with the 42 px fields beside it (`STRIP_SEGMENT`). The size\n * sweep read \"Op…\" in its segments at 360 px / Extra large — the same \"Syst… Li… D…\" —\n * and a row of fields that grows to a taller cell (keksdose's status strip sits in an\n * `items-start` grid) is the smaller loss. At Normal, and wherever it fits, it is the\n * one row it was.\n */\nconst WRAP_AT_LARGE = \"large:flex-wrap\";\n\n/**\n * The strip placement's segments (keksdose dev#593, kk K4): a 22px group under the 20px\n * strip, which is a labelled Input's 42px at Normal —\n *\n * strip 20 + group (1 + 2 + 16 + 2 + 1) 22 = 42 = Input (1 + 16 + 20 + 4 + 1)\n *\n * — both sizes setting their text in a 16px line with no padding (`md`'s 14px, `sm`'s\n * 12px). Until 0.34 the strip was 16px over a 26px group (a 20px line), and the label\n * row, which ends 18px down, crossed the group's top border by 2px; see\n * `LABEL_STRIP_PAD` in field-parts.tsx for the label row's sum. keksdose had the same\n * fix locally: `pt-5` and `@3xl:leading-4`.\n *\n * At Large and Extra large the label stands above the group and there is no strip to\n * share out, so the segments keep the line they had: `md` its text-sm line\n * (`large:leading-5` — a label that wraps there, WRAP_AT_LARGE, needs it), `sm` its 2px\n * either side.\n */\nconst STRIP_SEGMENT: Record<\"sm\" | \"md\", string> = {\n md: \"py-0 leading-4 large:leading-5\",\n sm: \"py-0 leading-4 large:py-0.5\",\n};\n\n/**\n * The strip placement's group is BLOCK-level (keksdose dev#593). Drawn `inline-flex`, it\n * sat on a line box of the strip's own line height, and a 22px box on a taller line\n * gained a pixel of leading above and below — 44px, not 42. Block-level, the group is\n * exactly its box. keksdose wrote it as `[&>[role=radiogroup]]:flex` on the strip.\n */\nconst STRIP_GROUP = \"flex\";\n\n/**\n * Where the group's `focus()` lands (see {@link ToggleGroupBaseProps.ref}): the radio\n * shape's one tab stop, or the pressed shape's pressed button — else the first option a\n * keyboard can reach. The rule /rhf's ToggleGroup adapter applied by id until 0.34.\n */\nfunction groupFocusTarget(group: HTMLElement): HTMLElement | null {\n return (\n group.querySelector<HTMLElement>('button[tabindex=\"0\"], button[aria-pressed=\"true\"]') ??\n group.querySelector<HTMLElement>(\"button:not(:disabled)\")\n );\n}\n\n/**\n * A line under the group saying what the CHOSEN option means — lenkbank's ToggleField\n * `hint` (features/gear/common.tsx:97): not help behind a \"?\" but a caption, and one\n * that changes as the choice does. Pass a function of the value for that; it is\n * attached with `aria-describedby`, and a function caption is also a polite live\n * region, because a description is read when the group is entered and not again when\n * an arrow key changes the choice underneath it.\n *\n * In muted caption-size text under the field (or the bare group), above an `error`.\n */\ntype ToggleGroupCaption<V> = ReactNode | ((value: V) => ReactNode);\n\n/** The group as it has always been: one option is always the answer. */\nexport interface ToggleGroupRequiredProps<T extends string> extends ToggleGroupBaseProps<T> {\n allowEmpty?: false;\n /**\n * What the options ARE to a screen reader, separately from whether the group can be\n * emptied (kastlan feedback #47).\n *\n * - `\"radio\"` (default) — a `radiogroup` of radios: one Tab stop, arrow keys MOVE the\n * choice. Right for a choice between answers (\"Monthly / Yearly\").\n * - `\"pressed\"` — a `group` of toggle buttons (`aria-pressed`), each its own Tab stop,\n * Space/Enter to press; still one option always pressed. Right for a row that reads\n * as a set of switches — a view mode, a toolbar-like filter — where arrows moving the\n * selection on focus would be a surprise.\n *\n * Before this the only way to `aria-pressed` was `allowEmpty`, which also let a second\n * press clear the choice — so kastlan took the clearable shape and threw the `null`\n * away in `onChange` (`(v) => v && setMode(v)`), a group announcing that a press would\n * unpress what it would not. Here a press on the pressed option re-sends its value, as\n * the radio shape does, and nothing is ever unpressed. A clearable group\n * (`allowEmpty`) is always `\"pressed\"`: a radio cannot be unchecked by activating it.\n */\n semantics?: \"radio\" | \"pressed\";\n value: T;\n onChange: (value: T) => void;\n /** See {@link ToggleGroupCaption}. */\n caption?: ToggleGroupCaption<T>;\n}\n\n/**\n * A group that can be emptied: clicking the active option clears it, and `onChange`\n * receives `null` (Keksdose's support-panel filters, where \"no filter\" is reached by\n * clicking the filter that is on).\n *\n * The options become TOGGLE BUTTONS (`aria-pressed`, in a `role=\"group\"`) rather than\n * radios. A radio cannot be unchecked by activating it — no screen reader user expects\n * a second press on \"Open, radio, checked\" to leave nothing checked, and nothing would\n * tell them it had. \"Open, toggle button, pressed\" says exactly what a press will do.\n */\nexport interface ToggleGroupClearableProps<T extends string> extends ToggleGroupBaseProps<T> {\n allowEmpty: true;\n /** Always toggle buttons — see {@link ToggleGroupRequiredProps.semantics}. Accepted so\n * a wrapper can forward one `semantics` to either shape. */\n semantics?: \"pressed\";\n value: T | null;\n onChange: (value: T | null) => void;\n /** See {@link ToggleGroupCaption}. `null` while nothing is chosen. */\n caption?: ToggleGroupCaption<T | null>;\n}\n\n/** `allowEmpty` picks the shape, so `onChange` is typed `(T) => void` unless the group\n * can actually emit `null` — no existing caller has a `null` to handle. */\nexport type ToggleGroupProps<T extends string> = ToggleGroupRequiredProps<T> | ToggleGroupClearableProps<T>;\n\n/**\n * Overloaded rather than typed by the union alone (keksdose, \"Gaps found adopting\n * 0.6.0\" #7). Inferring `T` through a union of prop shapes let TypeScript settle on\n * `string`, so `<ToggleGroup allowEmpty value={filter} onChange={setFilter} />` over a\n * `useState<Status | null>` did not compile unless the caller spelled\n * `<ToggleGroup<Status>>`. One signature per mode lets each infer `T` from its own\n * `value`/`onChange`/`options`; the third keeps a caller that forwards a\n * {@link ToggleGroupProps} union (a wrapper component) compiling.\n */\nexport function ToggleGroup<T extends string>(props: ToggleGroupClearableProps<T>): ReactElement;\nexport function ToggleGroup<T extends string>(props: ToggleGroupRequiredProps<T>): ReactElement;\nexport function ToggleGroup<T extends string>(props: ToggleGroupProps<T>): ReactElement;\nexport function ToggleGroup<T extends string>(props: ToggleGroupProps<T>): ReactElement {\n const {\n value,\n options,\n className,\n optionClassName,\n overflow = \"truncate\",\n disabled = false,\n size = \"md\",\n label,\n labelPlacement = \"field\",\n chromeClassName,\n hint,\n help,\n error,\n disabledReason: ownDisabledReason,\n disabledReasonDisplay,\n commit,\n \"aria-label\": ariaLabelAttr,\n ref,\n ...restWithMode\n } = props;\n const labelId = useId();\n const errorId = useId();\n const reasonId = useId();\n const hintCaptionId = useId();\n // The group's `focus()` is a no-op on a div with no tabindex; the caller's ref gets one\n // that lands where the keyboard would (see `ref`).\n const setGroup = useCallback(\n (el: HTMLDivElement | null) => {\n if (el) el.focus = (options?: FocusOptions) => groupFocusTarget(el)?.focus(options);\n assignRef(ref, el);\n },\n [ref],\n );\n // The lock's reason under a locked provider (with `commit`), else the group's own.\n const disabledReason = useCommitReason(commit, ownDisabledReason);\n const locked = hasContent(disabledReason);\n // §4: at Large and on touch the reason is a line under the group, not a bubble.\n const reasonLine = useDisabledReasonLine(disabledReasonDisplay) && locked;\n // §4: likewise a FieldHint \"?\" on the label line becomes a caption under the group at\n // Large and on touch; text is a caption at every size, as Select's (see `hint`). With\n // a `help` (0.36, only with `label`, as `hint`), its \"?\" is the label line's only one,\n // and the hint — a FieldHint's words included — is the caption at every size.\n const helpMark = fieldHelpMark(hasContent(label) ? help : undefined, label);\n const withHelp = helpMark !== undefined;\n const inlineHint = useInlineHint(hint, withHelp);\n const hintAsCaption = withHelp\n ? hasContent(inlineHint)\n ? inlineHint\n : undefined\n : isTextHint(hint)\n ? hint\n : inlineHint !== hint\n ? inlineHint\n : undefined;\n const labelHint = helpMark ?? (hintAsCaption === undefined ? hint : undefined);\n // Locked looks disabled — the dimmed group, the not-allowed cursor, no hover offer —\n // but stays focusable; `disabled` alone also takes the segments out of the tab order.\n const dimmed = disabled || locked;\n const labelled = hasContent(label);\n // `field` is the chrome; a label placed above or in a strip keeps the bare group's\n // own box.\n const field = labelled && labelPlacement === \"field\";\n const above = labelled && labelPlacement === \"above\";\n const strip = labelled && labelPlacement === \"strip\";\n // At Large and Extra large a truncating group wraps instead, the strip too since 0.34\n // (see WRAP_AT_LARGE).\n const wrapAtLarge = overflow === \"truncate\";\n const hasError = labelled && hasContent(error);\n // Taken off the rest so neither reaches the DOM; `props` keeps them paired, which is\n // what lets the `onChange` below be called with `null` only in the mode that allows it.\n const { allowEmpty: _allowEmpty, onChange: _onChange, caption, semantics: _semantics, ...rest } = restWithMode;\n // Invalid from outside too: a `Field` hands the bare group `aria-invalid`, and the\n // border has to say what the attribute says.\n const outsideInvalid = rest[\"aria-invalid\"] === true || rest[\"aria-invalid\"] === \"true\";\n const captionId = useId();\n const captionIsLive = typeof caption === \"function\";\n const captionNode = captionIsLive ? (caption as (v: T | null) => ReactNode)(value) : caption;\n const hasCaption = hasContent(captionNode);\n const choose = (next: T) => {\n // A locked group swallows the change: it saves on change, and a lock that let the\n // value move and then discarded it would show a state that was never stored.\n if (locked) return;\n if (props.allowEmpty) props.onChange(next === value ? null : next);\n else props.onChange(next);\n };\n // `pressed`: toggle buttons. Every clearable group is; a required one is when it asks\n // (kastlan #47) — the role, and not whether a second press clears, is what this flag\n // decides from here on, so `choose` above still keys off `allowEmpty` alone.\n const pressed = props.allowEmpty === true || props.semantics === \"pressed\";\n // A radio group is ONE tab stop (the checked radio, else the first) and arrows move\n // the choice — the pattern `role=\"radiogroup\"` promises a screen-reader user. Before\n // 0.7.0 each segment was its own tab stop with no arrow keys. The toggle-button shape\n // is a row of buttons, where separate tab stops are the pattern.\n const tabStop = options.some((o) => o.value === value) ? value : options[0]?.value;\n const onRadioKey = (e: KeyboardEvent<HTMLButtonElement>, index: number) => {\n const last = options.length - 1;\n let next: number | null = null;\n const step = horizontalStep(e.key, e.currentTarget);\n if (step !== 0) next = index + step;\n else if (e.key === \"ArrowDown\") next = index + 1;\n else if (e.key === \"ArrowUp\") next = index - 1;\n else if (e.key === \"Home\") next = 0;\n else if (e.key === \"End\") next = last;\n if (next === null) return;\n e.preventDefault();\n next = next < 0 ? last : next > last ? 0 : next;\n // The segments' own parent: the group, or under a lock the tooltip's row inside it.\n const buttons = e.currentTarget.parentElement?.querySelectorAll<HTMLButtonElement>(\":scope > button\");\n buttons?.[next]?.focus();\n // Locked: the focus walks (each segment says why on arrival), the choice does not.\n choose(options[next].value);\n };\n const segments = options.map((opt, index) => {\n const active = opt.value === value;\n return (\n <button\n key={opt.value}\n type=\"button\"\n role={pressed ? undefined : \"radio\"}\n aria-checked={pressed ? undefined : active}\n aria-pressed={pressed ? active : undefined}\n // A reason wins over `disabled` (as on Button): reachable, and refusing.\n disabled={disabled && !locked}\n aria-disabled={locked || undefined}\n // On each segment rather than the group: the segment is what takes focus, and\n // a group's description is not read reliably when focus lands inside it.\n aria-describedby={locked ? reasonId : undefined}\n tabIndex={pressed ? undefined : opt.value === tabStop ? 0 : -1}\n onKeyDown={pressed ? undefined : (e) => onRadioKey(e, index)}\n onClick={() => choose(opt.value)}\n className={cn(\n // `truncate` (which carries whitespace-nowrap) rather than letting a\n // label wrap: a segmented control sizes its whole row to the tallest\n // option, so one two-word option — Keksdose feedback #147's \"Where I\n // am\" — silently doubles the height of every segment beside it.\n //\n // `basis-auto` is what keeps that ellipsis a LAST resort rather than\n // the normal state (Keksdose dev#475). With flex-1's `basis-0`, a\n // shrink-to-fit group (`w-auto`) still resolves to the sum of the\n // labels' widths — and then splits it EQUALLY, so the short option\n // got 66px it did not need and \"Where I am\" got 66 of the 81 it did:\n // truncated at 1778px of free screen. Basing each segment on its own\n // content and sharing only the LEFTOVER space keeps a full-width\n // group's segments near-equal and an auto-width group's exact.\n //\n // `focus-visible` + `ring-inset`, not `focus` + an outset ring. A ring\n // is a box-shadow that spreads OUTWARD, so on a flush group it painted\n // 2px of ring over both neighbours and over the container's own border\n // — and on a phone it appeared on every TAP, because a tap focuses the\n // button. That is the other half of what live #268's rework saw\n // overlaying the selected segment's boundary. Inset keeps the ring\n // inside the segment it belongs to; focus-visible keeps it for the\n // keyboard, which is the only input that needs it.\n //\n // The ring is the kit's focus frame (0.32, §5): `--focus-ring-width` wide.\n //\n // From Large up the group wraps its ROW first (WRAP_AT_LARGE), so a segment's\n // own text breaks only when one label is wider than a whole row — and then it\n // wraps rather than ending in an ellipsis (`truncate-until-large`, text size\n // §10.17; round 0.34 T1: the sweep read 'confirmVariant=\"da…' at 360 px).\n overflow === \"wrap\" ? \"whitespace-nowrap\" : \"min-w-0 truncate-until-large\",\n \"flex-1 basis-auto rounded px-3 py-1.5 text-sm font-medium transition-colors focus:outline-none focus-visible:ring-inset focus-visible:ring-strong\",\n FOCUS_RING_WIDTH,\n size === \"sm\" && \"px-2 py-1 text-xs\",\n // In the field chrome: no vertical padding, and the line that makes the\n // field 42px under a strip that clears the label — see CHROME_PAD. `sm`\n // keeps its 12px type here (it used to be overridden to the md line).\n field && CHROME_SEGMENT[size],\n // In the strip placement: a 22px group under a 20px strip — STRIP_SEGMENT.\n strip && STRIP_SEGMENT[size],\n active ? \"bg-inverse text-inverse\" : \"text-secondary hover:bg-hover\",\n // No hover fill on a group that cannot be changed — a segment that\n // lights up under the pointer is an offer, and there is none here. Not on\n // the chosen segment: its fill IS its state, and its inverse text would\n // vanish on a transparent hover.\n dimmed && \"cursor-not-allowed\",\n dimmed && !active && \"hover:bg-transparent dark:hover:bg-transparent\",\n optionClassName,\n opt.className,\n )}\n >\n {opt.label}\n </button>\n );\n });\n const group = (\n <div\n // The audit's named example of a closed prop list (§\"Public API design\"): the\n // tour locates a step by CSS SELECTOR, so a component that drops every attribute\n // it was not expecting cannot be spotlighted at all — and Keksdose's rule editor\n // carries a comment explaining that it wraps this group in a bare <div> for\n // exactly that reason.\n //\n // `...rest` first, then the attributes the group cannot do without: a caller\n // hanging an anchor or a test id on the group must not be able to overwrite the\n // radiogroup role or the disabled state by accident. `className` is destructured\n // out entirely and merged through `cn`, so it is never in here.\n {...rest}\n ref={setGroup}\n role={pressed ? \"group\" : \"radiogroup\"}\n aria-label={ariaLabelAttr}\n aria-labelledby={labelled && ariaLabelAttr === undefined ? labelId : rest[\"aria-labelledby\"]}\n aria-invalid={hasError || rest[\"aria-invalid\"] || undefined}\n aria-describedby={\n [\n rest[\"aria-describedby\"],\n hintAsCaption !== undefined && hintCaptionId,\n hasCaption && captionId,\n hasError && errorId,\n ]\n .filter(Boolean)\n .join(\" \") || undefined\n }\n // `aria-disabled` on the group as well as on (or `disabled` on) each button: a\n // radio group is what the user is being refused, and a screen reader announcing\n // three separately-disabled radios does not say that.\n aria-disabled={dimmed || undefined}\n className={cn(\n // `gap-0.5` — the same 2px as the container's own padding, so EVERY segment\n // sits in a uniform 2px moat and no two fills ever touch. Flush segments were\n // Keksdose live #268's rework: the pressed segment wears a saturated fill and\n // an unpressed neighbour wears a pale hover fill, and with a shared edge the\n // two rectangles read as one smeared shape — *\"the boundary of the selected\n // option and hovering next to it overlays the boundary of the selected\n // button\"*. A gap is what makes each segment its own chip; it cannot be\n // undone by a caller's per-option colour, which a hover-only fix could.\n //\n // (The hover fill is the DESKTOP half of that report: Tailwind v4 wraps every\n // `hover:` in `@media (hover: hover)`, so a phone never paints it. The half a\n // phone does see is the focus ring — see the segment's own note below.)\n \"inline-flex w-full gap-0.5 rounded-md border border-strong bg-surface p-0.5 shadow-sm\",\n // Block-level under the strip, so it adds no line box's leading — STRIP_GROUP.\n strip && STRIP_GROUP,\n overflow === \"wrap\" && \"flex-wrap\",\n wrapAtLarge && WRAP_AT_LARGE,\n // The whole group fades, the way every other disabled control in this\n // package does; `cursor-not-allowed` is on the buttons, which is what a\n // pointer is actually over.\n dimmed && \"opacity-60\",\n // The bare group (no chrome to paint) wears the invalid border itself.\n !field && (outsideInvalid || ((above || strip) && hasError)) && FIELD_INVALID,\n // Inside the field's chrome the group is only a row of segments: no border, no\n // surface, no padding of its own, and the field (not the group) is what dims.\n field && \"border-0 bg-transparent p-0 shadow-none opacity-100\",\n !labelled && className,\n )}\n >\n {locked && !reasonLine ? (\n // The reason's bubble wraps the SEGMENTS, inside the group, not the group: a\n // wrapper outside it would become the flex or grid item in the caller's row in\n // the group's place, and a `w-full` / `md:w-auto` on the group would size the\n // wrong box. This row inherits the group's gap and wrap, so the segments lay out\n // exactly as they do unlocked, and `:scope > button` above still finds them. A\n // fragment child, so the Tooltip describes nothing itself — each segment points\n // at the hidden copy, the way a locked Button does.\n <Tooltip label={disabledReason} className=\"flex min-w-0 flex-1 gap-[inherit] [flex-wrap:inherit]\">\n <>\n {segments}\n <span id={reasonId} hidden>\n {disabledReason}\n </span>\n </>\n </Tooltip>\n ) : (\n segments\n )}\n </div>\n );\n // Rendered whenever the caption is — `aria-live` must be on the element BEFORE its\n // text changes, or the change is not announced — but empty (no height, no margin)\n // when there is nothing to say, so a function caption that returns null for some\n // options leaves no gap. Empty rather than `hidden`: some readers do not announce\n // text that appears inside an element coming back from `display: none`.\n const captionEl =\n hasCaption || captionIsLive ? (\n <p\n id={captionId}\n aria-live={captionIsLive ? \"polite\" : undefined}\n className={cn(\"text-caption leading-snug text-muted\", hasCaption && \"mt-1\")}\n >\n {hasCaption ? captionNode : null}\n </p>\n ) : null;\n const errorEl = hasError ? (\n <p id={errorId} className={FIELD_ERROR_CLASS}>\n {error}\n </p>\n ) : null;\n // §4: the FieldHint's words and the lock's reason, under the group, before the caption\n // (standing advice first) and the error (the news). The reason line IS what each\n // segment's `aria-describedby` names.\n const belowEl =\n hintAsCaption !== undefined || reasonLine ? (\n <>\n {hintAsCaption !== undefined && (\n <p id={hintCaptionId} className={FIELD_CAPTION_CLASS}>\n {hintAsCaption}\n </p>\n )}\n {reasonLine && (\n <p id={reasonId} className={DISABLED_REASON_LINE_CLASS}>\n {disabledReason}\n </p>\n )}\n </>\n ) : null;\n if (above) {\n // `relative` so a caller's `sr-only` label cannot escape (sr-only-containment).\n return (\n <div className={cn(\"relative grid min-w-0 gap-1.5\", className)}>\n <div className=\"flex items-center gap-1\">\n {/* A `<label>` with no `htmlFor`: a group is not labelable, so it is named\n by `aria-labelledby` on the group; the element keeps the Field look. */}\n <Label\n id={labelId}\n disabled={dimmed}\n data-error={hasError || undefined}\n className=\"data-[error=true]:text-danger\"\n >\n {label}\n </Label>\n {labelHint}\n </div>\n <div className=\"min-w-0\">\n {group}\n {belowEl}\n {captionEl}\n {errorEl}\n </div>\n </div>\n );\n }\n if (strip) {\n return (\n <LabelStrip labelId={labelId} label={label} hint={labelHint} disabled={dimmed} className={className}>\n {group}\n {belowEl}\n {captionEl}\n {errorEl}\n </LabelStrip>\n );\n }\n if (!field) {\n if (!captionEl && !belowEl) return group;\n // The group keeps its `className`, as without a caption; the wrapper only stacks.\n return (\n <div className=\"min-w-0\">\n {group}\n {belowEl}\n {captionEl}\n </div>\n );\n }\n return (\n // `h-full` + `flex-1`: the chrome fills a grid or stretched flex row, which is what\n // levels it with a select beside it whatever the browser makes of the select.\n <div className={cn(\"flex h-full flex-col\", className)}>\n <FloatingField\n className=\"flex flex-1 flex-col\"\n label={<span id={labelId}>{label}</span>}\n staticLabel\n hint={labelHint}\n >\n <div\n className={cn(\n \"flex flex-1 flex-col justify-center rounded-md border border-subtle bg-surface px-1 shadow-sm\",\n CHROME_PAD[size],\n dimmed && \"bg-surface-2 opacity-60\",\n hasError && FIELD_INVALID,\n chromeClassName,\n )}\n >\n {group}\n </div>\n </FloatingField>\n {belowEl}\n {captionEl}\n {errorEl}\n </div>\n );\n}\n"],"mappings":";AAseM,SA6II,UA7IJ,KA6II,YA7IJ;AAteN,SAAS,aAAa,aAAa;AAEnC,SAA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UACC,WAAU;AAAA,UACV,OAAO,oBAAC,UAAK,IAAI,SAAU,iBAAM;AAAA,UACjC,aAAW;AAAA,UACX,MAAM;AAAA,UAEN;AAAA,YAAC;AAAA;AAAA,cACC,WAAW;AAAA,gBACT;AAAA,gBACA,WAAW,IAAI;AAAA,gBACf,UAAU;AAAA,gBACV,YAAY;AAAA,gBACZ;AAAA,cACF;AAAA,cAEC;AAAA;AAAA,UACH;AAAA;AAAA,MACF;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,OACH;AAAA;AAEJ;","names":["options"]}
1
+ {"version":3,"sources":["../../src/components/toggle-group.tsx"],"sourcesContent":["import { useCallback, useId } from \"react\";\nimport type { ComponentPropsWithoutRef, KeyboardEvent, ReactElement, ReactNode, Ref } from \"react\";\nimport { cn } from \"../lib/cn\";\nimport { horizontalStep } from \"../lib/direction\";\nimport { FIELD_INVALID, FloatingField, Label } from \"./field-base\";\nimport { Tooltip } from \"./tooltip\";\nimport { useCommitReason, type CommitScope } from \"./write-lock\";\nimport { hasContent } from \"../lib/presence\";\nimport {\n assignRef,\n DISABLED_REASON_LINE_CLASS,\n FIELD_CAPTION_CLASS,\n FIELD_ERROR_CLASS,\n fieldHelpMark,\n isSuggestionHint,\n isTextHint,\n LabelStrip,\n useDisabledReasonLine,\n useInlineHint,\n type DisabledReasonDisplay,\n type FieldHelpProps,\n} from \"./field-parts\";\nimport { FOCUS_RING_WIDTH } from \"./focus-ring\";\n\nexport interface ToggleOption<T extends string> {\n value: T;\n label: string;\n className?: string;\n}\n\n/**\n * `onChange` is the group's own — the chosen VALUE, not a DOM event — so the div's\n * `onChange` is omitted rather than shadowed: leaving both in scope would give the\n * prop two incompatible meanings depending on which overload TypeScript picked.\n *\n * `children` is omitted too: this renders its `options` and nothing else, so a `children` the type\n * accepted and the component ignored would be a prop that silently does nothing —\n * worse than one that does not compile.\n */\nexport interface ToggleGroupBaseProps<T extends string>\n extends Omit<ComponentPropsWithoutRef<\"div\">, \"onChange\" | \"children\">, FieldHelpProps {\n options: ToggleOption<T>[];\n className?: string;\n /** Applied to every option button (e.g. to tune height/rounding to match\n * adjacent fields). Per-option `className` still wins over this. */\n optionClassName?: string;\n /**\n * What happens when the options do not fit the group's width. `\"truncate\"`\n * (default): one row, and the labels that do not fit end in an ellipsis — the height\n * never changes. `\"wrap\"`: the segments flow onto a second row and every label stays\n * whole (\"Bewegung\", not \"Beweg…\"), at the price of a taller group on a narrow\n * screen (lenkbank L4: five signal types on a 390px control page). From the width\n * where they fit, both look the same.\n *\n * Since 0.32 a group in the field chrome (`label`, the default placement) with four or\n * more options wraps at Large and Extra large under `\"truncate\"` too, inside its frame:\n * the type is bigger there and the field would otherwise run past a phone's edge\n * (docs/text-size-harmonization.md §4). The keyboard is the same either way.\n */\n overflow?: \"truncate\" | \"wrap\";\n /**\n * Show, refuse the change (Keksdose live #288: a payment dated in the future has no\n * state to set).\n *\n * Whatever `value` says stays pressed and keeps its own fill rather than going grey\n * with the rest — a reader who cannot see WHICH option is chosen has been told less\n * than before it was disabled. A caller with nothing to show passes no value, and\n * the group renders dimmed with nothing pressed, which is the shape Keksdose's\n * status picker uses for a row whose status does not exist yet.\n *\n * On the whole GROUP, not per option: a segmented control where some segments are\n * live and others are not is a menu with holes in it, and no caller here wants one.\n */\n disabled?: boolean;\n /**\n * `sm`: 12px options with `px-2 py-1` — the compact group keksdose's rule editor\n * (rule-editor:204) writes as `optionClassName=\"px-2 py-1 text-xs\"` beside a small\n * caption. `md` (default) is the size every other group has.\n *\n * Honoured inside the field chrome and the strip too (keksdose K1): the 12px type\n * stays, and the field is still 42px — see `CHROME_PAD`.\n */\n size?: \"sm\" | \"md\";\n /**\n * Stand in a form row as a FIELD: with a label the group wears the field's chrome —\n * border, surface, the top strip with a small static label in it, a labelled\n * {@link Select}'s height — so beside an Input or a Select it reads as one of them\n * rather than as a control with a caption over it. lenkbank builds exactly this by\n * hand as `ToggleField` (features/gear/common.tsx:97, feedback #69), and its notes\n * are why the chrome STRETCHES to its row as well as matching the select's padding:\n * a native select's height is the browser's, so a toggle a few pixels short of it\n * is levelled up by the row rather than by arithmetic.\n *\n * The label names the group (`aria-labelledby`), so `aria-label` is not needed. With\n * a label, `className` styles the field's wrapper — as on {@link Select} — and the\n * group's own box is dropped: two nested borders read as a control in a control.\n */\n label?: ReactNode;\n /**\n * Where `label` goes. `\"field\"` (default): the field chrome described under `label`.\n * `\"above\"`: the kit's {@link Label} over the bare group — the shape of a {@link Field}\n * — with `hint` beside the label and `error` under the group, for a form that sets\n * its labels above its fields (kastlan's international-rent-calculator.tsx, whose DE\n * cap pair sits in a `Field` column between two labelled-above inputs, where the\n * chrome's inner label would be the only one of its kind).\n *\n * `\"strip\"`: the 11px static label (and `hint`) in a strip OVER the bare group, for a\n * group that stands in a row of fields but is not one (keksdose K2 — the transaction\n * row's cleared-status picker, live #288 / #431 / dev#468). No field border: the group\n * keeps its own box, and its segments drop their vertical padding and set a 16px line,\n * so the 20px strip plus the 22px group is exactly a labelled {@link Input}'s 42px,\n * the label on the same line as theirs and clear of the group's border (keksdose\n * dev#593 — see `STRIP_SEGMENT`). `error` and `caption` go under the group, as in the\n * other two.\n *\n * Inside a `Field`, pass no `label` at all and spread the render-prop instead —\n * `{(ids, { labelId }) => <ToggleGroup {...ids} aria-labelledby={labelId} … />}` —\n * so the Field's label names the group and its hint and error describe it.\n */\n labelPlacement?: \"field\" | \"above\" | \"strip\";\n /**\n * Classes for the field chrome's own box — the bordered, padded box round the\n * segments — merged last, so they win. `className` styles the wrapper the chrome sits\n * in; this reaches the box itself. Only with `label` in the `\"field\"` placement.\n *\n * For a field JOINED flush to a neighbour (keksdose K1): reports-filters.tsx joins its\n * \"group by\" field to the range select on its start edge from `md` up, and squares the\n * shared corners by hand chrome today — here that is\n * `chromeClassName=\"md:rounded-s-none\"` with `className=\"md:-ms-px\"` (the wrapper\n * overlaps the neighbour by the one border they share). A class rather than a\n * `joined=\"start\"` because every such join keksdose has is responsive: on a phone the\n * two stack and both keep their corners.\n */\n chromeClassName?: string;\n /**\n * As on a labelled {@link Select}: a {@link FieldHint} \"?\" on the label line, and plain\n * text (a string) as a caption under the group. Only with `label`.\n *\n * 0.32.1 (keksdose's 0.32 report): text went on the label line in every placement, so\n * `TextSizeSetting`'s hint with `labelPlacement=\"above\"` sat beside the label in body\n * type, and at Extra large became a column one word wide — on the setting a reader who\n * needs large text opens first. The label line holds the \"?\" only (`isTextHint`).\n */\n hint?: ReactNode;\n /** The message under the field when it is wrong: paints the field's border with\n * `--danger`, marks the group `aria-invalid` and describes it with the message, as\n * {@link Select}'s `error` does. Only with `label`. */\n error?: ReactNode;\n /**\n * Why the group cannot be changed right now — {@link Button}'s `disabledReason`, for\n * a group that saves itself on change (keksdose K3: the last `SaveGuard` sites are\n * self-committing controls like this one, and SaveGuard's native `disabled` took\n * them out of the tab order so the reason never reached a keyboard).\n *\n * The group stays reachable — its segments are `aria-disabled`, not `disabled`, and\n * a radio group's arrow keys still walk them — but nothing reaches `onChange`, and\n * the reason shows in the kit {@link Tooltip} over the segments on hover or focus and\n * describes each segment. The chosen option keeps its fill, as under `disabled`.\n * Wins over `disabled`, as on Button: passing both keeps the group reachable.\n */\n disabledReason?: ReactNode;\n /**\n * Where `disabledReason` shows (0.32, §4 \"No fact only in a tooltip\"): by default, at\n * Large and on a touch screen, as a line under the group (where its caption goes), and\n * in the tooltip over the segments otherwise. See {@link DisabledReasonDisplay}.\n */\n disabledReasonDisplay?: DisabledReasonDisplay;\n /**\n * This group COMMITS — choosing an option saves it. Under a locked\n * {@link WriteLockProvider} it takes the `disabledReason` path with the lock's\n * reason (which wins over a `disabledReason` of its own): *\"everything renders; only\n * the commit is locked\"* (keksdose dev#496/#497), and a control that is its own commit\n * must render refused, never live-and-discarding. No provider, or an unlocked one:\n * no effect.\n */\n commit?: CommitScope;\n /**\n * The group — the `radiogroup` (or the pressed shape's `group`) the rest of the props go\n * on — as a React 19 ref prop (0.34, API-3, refactor audit 2026-10). The group itself\n * takes no focus, so its `focus()` lands where a keyboard would: the radio shape's one\n * tab stop (the checked option, else the first), or in the pressed shape the pressed\n * button, else the first. That is react-hook-form's focus-on-error, which /rhf's\n * adapter reached by an id lookup carrying this same rule until now.\n */\n ref?: Ref<HTMLDivElement>;\n}\n\n/**\n * The field chrome's vertical geometry — keksdose K1, the kit reintroducing feedback\n * #117 that keksdose's hand-built chrome had fixed.\n *\n * In px at Normal, as measured; since 0.32 every term but the two borders is rem\n * (§3.2), so the sum stays a labelled Select's at 125 and 150 % too — the Select's own\n * `pt-4 pb-1` and 1.25rem line grow by the same factor (52 px at Large, 62 at Extra\n * large). The md line was `leading-[18px]` and is `leading-[1.125rem]`.\n *\n * The label is the field's static label: `top-1` and 11px in a `leading-tight` line, so\n * its line box runs from 4px to 17.75px. Until 0.22 the chrome was `pt-4` over a 20px\n * (`leading-5`) segment, so the ACTIVE segment's fill — painted from the top of the\n * segment — started at 17px (1px border + 16px), 0.75px INSIDE the label's line box:\n * the highlight touched the word above it, exactly what #117's rework had measured and\n * cured with `pt-5`.\n *\n * Now the strip is `pt-5` and the fill starts at 21px, 3.25px clear, and the segment\n * gives the 4px back so the field stays a labelled Select's 42px: `md` sets its 14px\n * text in an 18px line with a 2px moat under it (the bare group's own `p-0.5` moat),\n * `sm` sets 12px text in a 16px line over `pb-1` — keksdose's measured chrome\n * (price-level-picker, reports-filters: `pt-5 pb-1`, `text-xs md:py-0`), byte for byte.\n * Before, `size=\"sm\"` inside the chrome was overridden to the md 20px line.\n *\n * md: 1 + 20 + 18 + 2 + 1 = 42 sm: 1 + 20 + 16 + 4 + 1 = 42\n */\n// At Large the chrome's label stands above it (0.33, §10.17): no strip, the same moat top\n// and bottom.\nconst CHROME_PAD: Record<\"sm\" | \"md\", string> = { md: \"pt-5 pb-0.5 large:pt-0.5\", sm: \"pt-5 pb-1 large:pt-1\" };\nconst CHROME_SEGMENT: Record<\"sm\" | \"md\", string> = { md: \"py-0 leading-[1.125rem]\", sm: \"py-0 leading-4\" };\n\n/**\n * A group at Large and Extra large (0.32,\n * docs/text-size-harmonization.md §4 \"nothing truncates\", §3.3): the segments flow onto a\n * second row inside the group's frame instead of overflowing it. At 125 % a 390 px phone\n * is 312 px of Normal type, and \"Month / Quarter / Half-year / Year\" in one row of the\n * field ran 7 px past it: a one-row flex group is as wide as all its labels end to end\n * when a grid or a stretched column asks how small it can get, however its segments\n * truncate. Wrapped, it is as wide as its longest label.\n *\n * Wrap, not a stacked select-like list: a wrapped radio group is the same radio group —\n * one Tab stop, and the arrow keys walk the options in reading order whichever row\n * they are on (←/↑ back, →/↓ on, Home/End) — so nothing about the keyboard changes with\n * the text size. A list in its place would be a second widget with its own keys.\n *\n * Only where it has to: `flex-wrap` breaks a row only when the segments do not fit, so\n * a wide field at Large stays one row, and a segment shares out what its row leaves\n * (`flex-1`); a label wider than the whole row still truncates as the last resort.\n * A `large:` class, so it costs no render and is right on the first paint.\n * `overflow=\"wrap\"` wraps at every size already.\n *\n * 0.32.1 (Kurvenschmiede's 0.32 report): every count and every placement, not only a\n * field of four or more. Since a row breaks only where its labels do not fit, a wrap\n * only ever replaces a truncation — and three options in a card at Extra large on a\n * 360 px phone read \"Syst… Li… D…\".\n *\n * 0.34 (round 0.34 T1, text size §10.17): the strip too, which 0.32.1 kept to one row so\n * its 26 px group lined up with the 42 px fields beside it (`STRIP_SEGMENT`). The size\n * sweep read \"Op…\" in its segments at 360 px / Extra large — the same \"Syst… Li… D…\" —\n * and a row of fields that grows to a taller cell (keksdose's status strip sits in an\n * `items-start` grid) is the smaller loss. At Normal, and wherever it fits, it is the\n * one row it was.\n */\nconst WRAP_AT_LARGE = \"large:flex-wrap\";\n\n/**\n * The strip placement's segments (keksdose dev#593, kk K4): a 22px group under the 20px\n * strip, which is a labelled Input's 42px at Normal —\n *\n * strip 20 + group (1 + 2 + 16 + 2 + 1) 22 = 42 = Input (1 + 16 + 20 + 4 + 1)\n *\n * — both sizes setting their text in a 16px line with no padding (`md`'s 14px, `sm`'s\n * 12px). Until 0.34 the strip was 16px over a 26px group (a 20px line), and the label\n * row, which ends 18px down, crossed the group's top border by 2px; see\n * `LABEL_STRIP_PAD` in field-parts.tsx for the label row's sum. keksdose had the same\n * fix locally: `pt-5` and `@3xl:leading-4`.\n *\n * At Large and Extra large the label stands above the group and there is no strip to\n * share out, so the segments keep the line they had: `md` its text-sm line\n * (`large:leading-5` — a label that wraps there, WRAP_AT_LARGE, needs it), `sm` its 2px\n * either side.\n */\nconst STRIP_SEGMENT: Record<\"sm\" | \"md\", string> = {\n md: \"py-0 leading-4 large:leading-5\",\n sm: \"py-0 leading-4 large:py-0.5\",\n};\n\n/**\n * The strip placement's group is BLOCK-level (keksdose dev#593). Drawn `inline-flex`, it\n * sat on a line box of the strip's own line height, and a 22px box on a taller line\n * gained a pixel of leading above and below — 44px, not 42. Block-level, the group is\n * exactly its box. keksdose wrote it as `[&>[role=radiogroup]]:flex` on the strip.\n */\nconst STRIP_GROUP = \"flex\";\n\n/**\n * Where the group's `focus()` lands (see {@link ToggleGroupBaseProps.ref}): the radio\n * shape's one tab stop, or the pressed shape's pressed button — else the first option a\n * keyboard can reach. The rule /rhf's ToggleGroup adapter applied by id until 0.34.\n */\nfunction groupFocusTarget(group: HTMLElement): HTMLElement | null {\n return (\n group.querySelector<HTMLElement>('button[tabindex=\"0\"], button[aria-pressed=\"true\"]') ??\n group.querySelector<HTMLElement>(\"button:not(:disabled)\")\n );\n}\n\n/**\n * A line under the group saying what the CHOSEN option means — lenkbank's ToggleField\n * `hint` (features/gear/common.tsx:97): not help behind a \"?\" but a caption, and one\n * that changes as the choice does. Pass a function of the value for that; it is\n * attached with `aria-describedby`, and a function caption is also a polite live\n * region, because a description is read when the group is entered and not again when\n * an arrow key changes the choice underneath it.\n *\n * In muted caption-size text under the field (or the bare group), above an `error`.\n */\ntype ToggleGroupCaption<V> = ReactNode | ((value: V) => ReactNode);\n\n/** The group as it has always been: one option is always the answer. */\nexport interface ToggleGroupRequiredProps<T extends string> extends ToggleGroupBaseProps<T> {\n allowEmpty?: false;\n /**\n * What the options ARE to a screen reader, separately from whether the group can be\n * emptied (kastlan feedback #47).\n *\n * - `\"radio\"` (default) — a `radiogroup` of radios: one Tab stop, arrow keys MOVE the\n * choice. Right for a choice between answers (\"Monthly / Yearly\").\n * - `\"pressed\"` — a `group` of toggle buttons (`aria-pressed`), each its own Tab stop,\n * Space/Enter to press; still one option always pressed. Right for a row that reads\n * as a set of switches — a view mode, a toolbar-like filter — where arrows moving the\n * selection on focus would be a surprise.\n *\n * Before this the only way to `aria-pressed` was `allowEmpty`, which also let a second\n * press clear the choice — so kastlan took the clearable shape and threw the `null`\n * away in `onChange` (`(v) => v && setMode(v)`), a group announcing that a press would\n * unpress what it would not. Here a press on the pressed option re-sends its value, as\n * the radio shape does, and nothing is ever unpressed. A clearable group\n * (`allowEmpty`) is always `\"pressed\"`: a radio cannot be unchecked by activating it.\n */\n semantics?: \"radio\" | \"pressed\";\n value: T;\n onChange: (value: T) => void;\n /** See {@link ToggleGroupCaption}. */\n caption?: ToggleGroupCaption<T>;\n}\n\n/**\n * A group that can be emptied: clicking the active option clears it, and `onChange`\n * receives `null` (Keksdose's support-panel filters, where \"no filter\" is reached by\n * clicking the filter that is on).\n *\n * The options become TOGGLE BUTTONS (`aria-pressed`, in a `role=\"group\"`) rather than\n * radios. A radio cannot be unchecked by activating it — no screen reader user expects\n * a second press on \"Open, radio, checked\" to leave nothing checked, and nothing would\n * tell them it had. \"Open, toggle button, pressed\" says exactly what a press will do.\n */\nexport interface ToggleGroupClearableProps<T extends string> extends ToggleGroupBaseProps<T> {\n allowEmpty: true;\n /** Always toggle buttons — see {@link ToggleGroupRequiredProps.semantics}. Accepted so\n * a wrapper can forward one `semantics` to either shape. */\n semantics?: \"pressed\";\n value: T | null;\n onChange: (value: T | null) => void;\n /** See {@link ToggleGroupCaption}. `null` while nothing is chosen. */\n caption?: ToggleGroupCaption<T | null>;\n}\n\n/** `allowEmpty` picks the shape, so `onChange` is typed `(T) => void` unless the group\n * can actually emit `null` — no existing caller has a `null` to handle. */\nexport type ToggleGroupProps<T extends string> = ToggleGroupRequiredProps<T> | ToggleGroupClearableProps<T>;\n\n/**\n * Overloaded rather than typed by the union alone (keksdose, \"Gaps found adopting\n * 0.6.0\" #7). Inferring `T` through a union of prop shapes let TypeScript settle on\n * `string`, so `<ToggleGroup allowEmpty value={filter} onChange={setFilter} />` over a\n * `useState<Status | null>` did not compile unless the caller spelled\n * `<ToggleGroup<Status>>`. One signature per mode lets each infer `T` from its own\n * `value`/`onChange`/`options`; the third keeps a caller that forwards a\n * {@link ToggleGroupProps} union (a wrapper component) compiling.\n */\nexport function ToggleGroup<T extends string>(props: ToggleGroupClearableProps<T>): ReactElement;\nexport function ToggleGroup<T extends string>(props: ToggleGroupRequiredProps<T>): ReactElement;\nexport function ToggleGroup<T extends string>(props: ToggleGroupProps<T>): ReactElement;\nexport function ToggleGroup<T extends string>(props: ToggleGroupProps<T>): ReactElement {\n const {\n value,\n options,\n className,\n optionClassName,\n overflow = \"truncate\",\n disabled = false,\n size = \"md\",\n label,\n labelPlacement = \"field\",\n chromeClassName,\n hint,\n help,\n error,\n disabledReason: ownDisabledReason,\n disabledReasonDisplay,\n commit,\n \"aria-label\": ariaLabelAttr,\n ref,\n ...restWithMode\n } = props;\n const labelId = useId();\n const errorId = useId();\n const reasonId = useId();\n const hintCaptionId = useId();\n // The group's `focus()` is a no-op on a div with no tabindex; the caller's ref gets one\n // that lands where the keyboard would (see `ref`).\n const setGroup = useCallback(\n (el: HTMLDivElement | null) => {\n if (el) el.focus = (options?: FocusOptions) => groupFocusTarget(el)?.focus(options);\n assignRef(ref, el);\n },\n [ref],\n );\n // The lock's reason under a locked provider (with `commit`), else the group's own.\n const disabledReason = useCommitReason(commit, ownDisabledReason);\n const locked = hasContent(disabledReason);\n // §4: at Large and on touch the reason is a line under the group, not a bubble.\n const reasonLine = useDisabledReasonLine(disabledReasonDisplay) && locked;\n // §4: likewise a FieldHint \"?\" on the label line becomes a caption under the group at\n // Large and on touch; text is a caption at every size, as Select's (see `hint`). With\n // a `help` (0.36, only with `label`, as `hint`), its \"?\" is the label line's only one,\n // and the hint — a FieldHint's words included — is the caption at every size.\n const helpMark = fieldHelpMark(hasContent(label) ? help : undefined, label);\n const withHelp = helpMark !== undefined;\n const inlineHint = useInlineHint(hint, withHelp, label);\n // A FieldSuggestion (0.55) is a caption at every size, as text is.\n const hintAsCaption = withHelp\n ? hasContent(inlineHint)\n ? inlineHint\n : undefined\n : isTextHint(hint)\n ? hint\n : isSuggestionHint(hint) || inlineHint !== hint\n ? inlineHint\n : undefined;\n const labelHint = helpMark ?? (hintAsCaption === undefined ? hint : undefined);\n // Locked looks disabled — the dimmed group, the not-allowed cursor, no hover offer —\n // but stays focusable; `disabled` alone also takes the segments out of the tab order.\n const dimmed = disabled || locked;\n const labelled = hasContent(label);\n // `field` is the chrome; a label placed above or in a strip keeps the bare group's\n // own box.\n const field = labelled && labelPlacement === \"field\";\n const above = labelled && labelPlacement === \"above\";\n const strip = labelled && labelPlacement === \"strip\";\n // At Large and Extra large a truncating group wraps instead, the strip too since 0.34\n // (see WRAP_AT_LARGE).\n const wrapAtLarge = overflow === \"truncate\";\n const hasError = labelled && hasContent(error);\n // Taken off the rest so neither reaches the DOM; `props` keeps them paired, which is\n // what lets the `onChange` below be called with `null` only in the mode that allows it.\n const { allowEmpty: _allowEmpty, onChange: _onChange, caption, semantics: _semantics, ...rest } = restWithMode;\n // Invalid from outside too: a `Field` hands the bare group `aria-invalid`, and the\n // border has to say what the attribute says.\n const outsideInvalid = rest[\"aria-invalid\"] === true || rest[\"aria-invalid\"] === \"true\";\n const captionId = useId();\n const captionIsLive = typeof caption === \"function\";\n const captionNode = captionIsLive ? (caption as (v: T | null) => ReactNode)(value) : caption;\n const hasCaption = hasContent(captionNode);\n const choose = (next: T) => {\n // A locked group swallows the change: it saves on change, and a lock that let the\n // value move and then discarded it would show a state that was never stored.\n if (locked) return;\n if (props.allowEmpty) props.onChange(next === value ? null : next);\n else props.onChange(next);\n };\n // `pressed`: toggle buttons. Every clearable group is; a required one is when it asks\n // (kastlan #47) — the role, and not whether a second press clears, is what this flag\n // decides from here on, so `choose` above still keys off `allowEmpty` alone.\n const pressed = props.allowEmpty === true || props.semantics === \"pressed\";\n // A radio group is ONE tab stop (the checked radio, else the first) and arrows move\n // the choice — the pattern `role=\"radiogroup\"` promises a screen-reader user. Before\n // 0.7.0 each segment was its own tab stop with no arrow keys. The toggle-button shape\n // is a row of buttons, where separate tab stops are the pattern.\n const tabStop = options.some((o) => o.value === value) ? value : options[0]?.value;\n const onRadioKey = (e: KeyboardEvent<HTMLButtonElement>, index: number) => {\n const last = options.length - 1;\n let next: number | null = null;\n const step = horizontalStep(e.key, e.currentTarget);\n if (step !== 0) next = index + step;\n else if (e.key === \"ArrowDown\") next = index + 1;\n else if (e.key === \"ArrowUp\") next = index - 1;\n else if (e.key === \"Home\") next = 0;\n else if (e.key === \"End\") next = last;\n if (next === null) return;\n e.preventDefault();\n next = next < 0 ? last : next > last ? 0 : next;\n // The segments' own parent: the group, or under a lock the tooltip's row inside it.\n const buttons = e.currentTarget.parentElement?.querySelectorAll<HTMLButtonElement>(\":scope > button\");\n buttons?.[next]?.focus();\n // Locked: the focus walks (each segment says why on arrival), the choice does not.\n choose(options[next].value);\n };\n const segments = options.map((opt, index) => {\n const active = opt.value === value;\n return (\n <button\n key={opt.value}\n type=\"button\"\n role={pressed ? undefined : \"radio\"}\n aria-checked={pressed ? undefined : active}\n aria-pressed={pressed ? active : undefined}\n // A reason wins over `disabled` (as on Button): reachable, and refusing.\n disabled={disabled && !locked}\n aria-disabled={locked || undefined}\n // On each segment rather than the group: the segment is what takes focus, and\n // a group's description is not read reliably when focus lands inside it.\n aria-describedby={locked ? reasonId : undefined}\n tabIndex={pressed ? undefined : opt.value === tabStop ? 0 : -1}\n onKeyDown={pressed ? undefined : (e) => onRadioKey(e, index)}\n onClick={() => choose(opt.value)}\n className={cn(\n // `truncate` (which carries whitespace-nowrap) rather than letting a\n // label wrap: a segmented control sizes its whole row to the tallest\n // option, so one two-word option — Keksdose feedback #147's \"Where I\n // am\" — silently doubles the height of every segment beside it.\n //\n // `basis-auto` is what keeps that ellipsis a LAST resort rather than\n // the normal state (Keksdose dev#475). With flex-1's `basis-0`, a\n // shrink-to-fit group (`w-auto`) still resolves to the sum of the\n // labels' widths — and then splits it EQUALLY, so the short option\n // got 66px it did not need and \"Where I am\" got 66 of the 81 it did:\n // truncated at 1778px of free screen. Basing each segment on its own\n // content and sharing only the LEFTOVER space keeps a full-width\n // group's segments near-equal and an auto-width group's exact.\n //\n // `focus-visible` + `ring-inset`, not `focus` + an outset ring. A ring\n // is a box-shadow that spreads OUTWARD, so on a flush group it painted\n // 2px of ring over both neighbours and over the container's own border\n // — and on a phone it appeared on every TAP, because a tap focuses the\n // button. That is the other half of what live #268's rework saw\n // overlaying the selected segment's boundary. Inset keeps the ring\n // inside the segment it belongs to; focus-visible keeps it for the\n // keyboard, which is the only input that needs it.\n //\n // The ring is the kit's focus frame (0.32, §5): `--focus-ring-width` wide.\n //\n // From Large up the group wraps its ROW first (WRAP_AT_LARGE), so a segment's\n // own text breaks only when one label is wider than a whole row — and then it\n // wraps rather than ending in an ellipsis (`truncate-until-large`, text size\n // §10.17; round 0.34 T1: the sweep read 'confirmVariant=\"da…' at 360 px).\n overflow === \"wrap\" ? \"whitespace-nowrap\" : \"min-w-0 truncate-until-large\",\n \"flex-1 basis-auto rounded px-3 py-1.5 text-sm font-medium transition-colors focus:outline-none focus-visible:ring-inset focus-visible:ring-strong\",\n FOCUS_RING_WIDTH,\n size === \"sm\" && \"px-2 py-1 text-xs\",\n // In the field chrome: no vertical padding, and the line that makes the\n // field 42px under a strip that clears the label — see CHROME_PAD. `sm`\n // keeps its 12px type here (it used to be overridden to the md line).\n field && CHROME_SEGMENT[size],\n // In the strip placement: a 22px group under a 20px strip — STRIP_SEGMENT.\n strip && STRIP_SEGMENT[size],\n active ? \"bg-inverse text-inverse\" : \"text-secondary hover:bg-hover\",\n // No hover fill on a group that cannot be changed — a segment that\n // lights up under the pointer is an offer, and there is none here. Not on\n // the chosen segment: its fill IS its state, and its inverse text would\n // vanish on a transparent hover.\n dimmed && \"cursor-not-allowed\",\n dimmed && !active && \"hover:bg-transparent dark:hover:bg-transparent\",\n optionClassName,\n opt.className,\n )}\n >\n {opt.label}\n </button>\n );\n });\n const group = (\n <div\n // The audit's named example of a closed prop list (§\"Public API design\"): the\n // tour locates a step by CSS SELECTOR, so a component that drops every attribute\n // it was not expecting cannot be spotlighted at all — and Keksdose's rule editor\n // carries a comment explaining that it wraps this group in a bare <div> for\n // exactly that reason.\n //\n // `...rest` first, then the attributes the group cannot do without: a caller\n // hanging an anchor or a test id on the group must not be able to overwrite the\n // radiogroup role or the disabled state by accident. `className` is destructured\n // out entirely and merged through `cn`, so it is never in here.\n {...rest}\n ref={setGroup}\n role={pressed ? \"group\" : \"radiogroup\"}\n aria-label={ariaLabelAttr}\n aria-labelledby={labelled && ariaLabelAttr === undefined ? labelId : rest[\"aria-labelledby\"]}\n aria-invalid={hasError || rest[\"aria-invalid\"] || undefined}\n aria-describedby={\n [\n rest[\"aria-describedby\"],\n hintAsCaption !== undefined && hintCaptionId,\n hasCaption && captionId,\n hasError && errorId,\n ]\n .filter(Boolean)\n .join(\" \") || undefined\n }\n // `aria-disabled` on the group as well as on (or `disabled` on) each button: a\n // radio group is what the user is being refused, and a screen reader announcing\n // three separately-disabled radios does not say that.\n aria-disabled={dimmed || undefined}\n className={cn(\n // `gap-0.5` — the same 2px as the container's own padding, so EVERY segment\n // sits in a uniform 2px moat and no two fills ever touch. Flush segments were\n // Keksdose live #268's rework: the pressed segment wears a saturated fill and\n // an unpressed neighbour wears a pale hover fill, and with a shared edge the\n // two rectangles read as one smeared shape — *\"the boundary of the selected\n // option and hovering next to it overlays the boundary of the selected\n // button\"*. A gap is what makes each segment its own chip; it cannot be\n // undone by a caller's per-option colour, which a hover-only fix could.\n //\n // (The hover fill is the DESKTOP half of that report: Tailwind v4 wraps every\n // `hover:` in `@media (hover: hover)`, so a phone never paints it. The half a\n // phone does see is the focus ring — see the segment's own note below.)\n \"inline-flex w-full gap-0.5 rounded-md border border-strong bg-surface p-0.5 shadow-sm\",\n // Block-level under the strip, so it adds no line box's leading — STRIP_GROUP.\n strip && STRIP_GROUP,\n overflow === \"wrap\" && \"flex-wrap\",\n wrapAtLarge && WRAP_AT_LARGE,\n // The whole group fades, the way every other disabled control in this\n // package does; `cursor-not-allowed` is on the buttons, which is what a\n // pointer is actually over.\n dimmed && \"opacity-60\",\n // The bare group (no chrome to paint) wears the invalid border itself.\n !field && (outsideInvalid || ((above || strip) && hasError)) && FIELD_INVALID,\n // Inside the field's chrome the group is only a row of segments: no border, no\n // surface, no padding of its own, and the field (not the group) is what dims.\n field && \"border-0 bg-transparent p-0 shadow-none opacity-100\",\n !labelled && className,\n )}\n >\n {locked && !reasonLine ? (\n // The reason's bubble wraps the SEGMENTS, inside the group, not the group: a\n // wrapper outside it would become the flex or grid item in the caller's row in\n // the group's place, and a `w-full` / `md:w-auto` on the group would size the\n // wrong box. This row inherits the group's gap and wrap, so the segments lay out\n // exactly as they do unlocked, and `:scope > button` above still finds them. A\n // fragment child, so the Tooltip describes nothing itself — each segment points\n // at the hidden copy, the way a locked Button does.\n <Tooltip label={disabledReason} className=\"flex min-w-0 flex-1 gap-[inherit] [flex-wrap:inherit]\">\n <>\n {segments}\n <span id={reasonId} hidden>\n {disabledReason}\n </span>\n </>\n </Tooltip>\n ) : (\n segments\n )}\n </div>\n );\n // Rendered whenever the caption is — `aria-live` must be on the element BEFORE its\n // text changes, or the change is not announced — but empty (no height, no margin)\n // when there is nothing to say, so a function caption that returns null for some\n // options leaves no gap. Empty rather than `hidden`: some readers do not announce\n // text that appears inside an element coming back from `display: none`.\n const captionEl =\n hasCaption || captionIsLive ? (\n <p\n id={captionId}\n aria-live={captionIsLive ? \"polite\" : undefined}\n className={cn(\"text-caption leading-snug text-muted\", hasCaption && \"mt-1\")}\n >\n {hasCaption ? captionNode : null}\n </p>\n ) : null;\n const errorEl = hasError ? (\n <p id={errorId} className={FIELD_ERROR_CLASS}>\n {error}\n </p>\n ) : null;\n // §4: the FieldHint's words and the lock's reason, under the group, before the caption\n // (standing advice first) and the error (the news). The reason line IS what each\n // segment's `aria-describedby` names.\n const belowEl =\n hintAsCaption !== undefined || reasonLine ? (\n <>\n {hintAsCaption !== undefined && (\n <p id={hintCaptionId} className={FIELD_CAPTION_CLASS}>\n {hintAsCaption}\n </p>\n )}\n {reasonLine && (\n <p id={reasonId} className={DISABLED_REASON_LINE_CLASS}>\n {disabledReason}\n </p>\n )}\n </>\n ) : null;\n if (above) {\n // `relative` so a caller's `sr-only` label cannot escape (sr-only-containment).\n return (\n <div className={cn(\"relative grid min-w-0 gap-1.5\", className)}>\n <div className=\"flex items-center gap-1\">\n {/* A `<label>` with no `htmlFor`: a group is not labelable, so it is named\n by `aria-labelledby` on the group; the element keeps the Field look. */}\n <Label\n id={labelId}\n disabled={dimmed}\n data-error={hasError || undefined}\n className=\"data-[error=true]:text-danger\"\n >\n {label}\n </Label>\n {labelHint}\n </div>\n <div className=\"min-w-0\">\n {group}\n {belowEl}\n {captionEl}\n {errorEl}\n </div>\n </div>\n );\n }\n if (strip) {\n return (\n <LabelStrip labelId={labelId} label={label} hint={labelHint} disabled={dimmed} className={className}>\n {group}\n {belowEl}\n {captionEl}\n {errorEl}\n </LabelStrip>\n );\n }\n if (!field) {\n if (!captionEl && !belowEl) return group;\n // The group keeps its `className`, as without a caption; the wrapper only stacks.\n return (\n <div className=\"min-w-0\">\n {group}\n {belowEl}\n {captionEl}\n </div>\n );\n }\n return (\n // `h-full` + `flex-1`: the chrome fills a grid or stretched flex row, which is what\n // levels it with a select beside it whatever the browser makes of the select.\n <div className={cn(\"flex h-full flex-col\", className)}>\n <FloatingField\n className=\"flex flex-1 flex-col\"\n label={<span id={labelId}>{label}</span>}\n staticLabel\n hint={labelHint}\n >\n <div\n className={cn(\n \"flex flex-1 flex-col justify-center rounded-md border border-subtle bg-surface px-1 shadow-sm\",\n CHROME_PAD[size],\n dimmed && \"bg-surface-2 opacity-60\",\n hasError && FIELD_INVALID,\n chromeClassName,\n )}\n >\n {group}\n </div>\n </FloatingField>\n {belowEl}\n {captionEl}\n {errorEl}\n </div>\n );\n}\n"],"mappings":";AAweM,SA6II,UA7IJ,KA6II,YA7IJ;AAxeN,SAAS,aAAa,aAAa;AAEnC,SAAS,UAAU;AACnB,SAAS,sBAAsB;AAC/B,SAAS,eAAe,eAAe,aAAa;AACpD,SAAS,eAAe;AACxB,SAAS,uBAAyC;AAClD,SAAS,kBAAkB;AAC3B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAGK;AACP,SAAS,wBAAwB;AAgMjC,MAAM,aAA0C,EAAE,IAAI,4BAA4B,IAAI,uBAAuB;AAC7G,MAAM,iBAA8C,EAAE,IAAI,2BAA2B,IAAI,iBAAiB;AAkC1G,MAAM,gBAAgB;AAmBtB,MAAM,gBAA6C;AAAA,EACjD,IAAI;AAAA,EACJ,IAAI;AACN;AAQA,MAAM,cAAc;AAOpB,SAAS,iBAAiB,OAAwC;AAChE,SACE,MAAM,cAA2B,mDAAmD,KACpF,MAAM,cAA2B,uBAAuB;AAE5D;AA+EO,SAAS,YAA8B,OAA0C;AACtF,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,WAAW;AAAA,IACX,WAAW;AAAA,IACX,OAAO;AAAA,IACP;AAAA,IACA,iBAAiB;AAAA,IACjB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,gBAAgB;AAAA,IAChB;AAAA,IACA;AAAA,IACA,cAAc;AAAA,IACd;AAAA,IACA,GAAG;AAAA,EACL,IAAI;AACJ,QAAM,UAAU,MAAM;AACtB,QAAM,UAAU,MAAM;AACtB,QA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AAAA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,OACH;AAAA,EAEJ;AACA,MAAI,CAAC,OAAO;AACV,QAAI,CAAC,aAAa,CAAC,QAAS,QAAO;AAEnC,WACE,qBAAC,SAAI,WAAU,WACZ;AAAA;AAAA,MACA;AAAA,MACA;AAAA,OACH;AAAA,EAEJ;AACA;AAAA;AAAA;AAAA,IAGE,qBAAC,SAAI,WAAW,GAAG,wBAAwB,SAAS,GAClD;AAAA;AAAA,QAAC;AAAA;AAAA,UACC,WAAU;AAAA,UACV,OAAO,oBAAC,UAAK,IAAI,SAAU,iBAAM;AAAA,UACjC,aAAW;AAAA,UACX,MAAM;AAAA,UAEN;AAAA,YAAC;AAAA;AAAA,cACC,WAAW;AAAA,gBACT;AAAA,gBACA,WAAW,IAAI;AAAA,gBACf,UAAU;AAAA,gBACV,YAAY;AAAA,gBACZ;AAAA,cACF;AAAA,cAEC;AAAA;AAAA,UACH;AAAA;AAAA,MACF;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,OACH;AAAA;AAEJ;","names":["options"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/components/treemap-layout.ts"],"sourcesContent":["// Where `Treemap` draws each node — a pure function of the nodes, the chart's size and the\n// text size, with no recharts in it (0.52 code review of treemap.tsx, findings 1 and 8).\n//\n// recharts lays nested data out itself, edge to edge, and 0.52 first made the groups' room\n// afterwards: a group's cell took its band and margin out of its rectangle and each child's\n// cell SQUEEZED the rectangle recharts gave it into what was left. Two faults followed.\n// A fixed 23px is a different share of every group, so a €100 tile in a 61px group was\n// drawn at two thirds of a €100 tile in a 300px one — in a chart whose one promise is that\n// area is share. And the squeeze ran through a cache the group's cell wrote during render\n// for its children's cells to read, which held only because recharts renders a group\n// before its children.\n//\n// So the layout is made here, up front: squarified as recharts does it, with each group\n// asking for its tiles' area PLUS its frame's, and its tiles laid out in its body. A\n// frame's area depends on the rectangle it gets, so the layout is run again with each\n// group's frame as measured until no frame moves by a pixel — two or three rounds.\n\nexport interface Box {\n x: number;\n y: number;\n width: number;\n height: number;\n}\n\n/** What the layout needs of a node: its key, its value, and a group's nodes. */\nexport interface LayoutNode {\n path: string;\n size: number;\n children?: readonly LayoutNode[];\n}\n\n/** A node as drawn: its rectangle, and for a group the body its nodes fill and whether\n * its band is drawn. Whole pixels, on shared edges, so neighbours meet without a seam. */\nexport interface Placed {\n box: Box;\n body?: Box;\n banded?: boolean;\n}\n\nconst PHI = (1 + Math.sqrt(5)) / 2;\n\n/**\n * A group's band, in px at Normal, × the text size's scale: the 20px floor a tile keeps\n * for its own name, so the group's name sits in it as a tile's does in a tile.\n */\nexport const BAND = 20;\n/**\n * The frame's margin round its body, in px. Each tile keeps its 2px gutter, half of it\n * inside the tile, so 3 leaves one pixel of the frame's own colour between the group's\n * gutter and its tiles' — the frame reads as one outline round the group, not as a gutter\n * that happens to be wider.\n */\nexport const FRAME_MARGIN = 3;\n/**\n * The least of a group's height its body keeps under the band: 1/φ. At Normal that is a\n * group of 61px (20 band + 3 margin = 0.382 of it), whose body of 38px still holds a\n * tile's name and its second line (the note's 36px floor) — so a single row of tiles under\n * the band keeps both. A smaller group draws no band, and its name is in its tiles'\n * accessible names and its tooltip rather than over their area. Since the frame's area is\n * given to the group (above), this bounds the frame's share of the picture, not the tiles'.\n */\nexport const BODY_SHARE = 1 / PHI;\n\n/** A group drawn at `box`: whether it has the room for its band (see {@link BODY_SHARE};\n * and 44px across, the floor of a word), and the body its nodes are drawn into. */\nexport function groupBody(box: Box, scale: number): { banded: boolean; body: Box } {\n const band = BAND * scale;\n const margin = Math.min(FRAME_MARGIN, Math.floor(box.width / 4), Math.floor(box.height / 4));\n const banded = box.width >= 44 * scale && box.height - band - margin >= box.height * BODY_SHARE;\n const top = banded ? band : margin;\n return {\n banded,\n body: {\n x: box.x + margin,\n y: box.y + top,\n width: Math.max(0, box.width - 2 * margin),\n height: Math.max(0, box.height - top - margin),\n },\n };\n}\n\n/** The worst aspect ratio in a row of `area` along `side`, against the target `ratio`. */\nfunction worst(area: number, min: number, max: number, side: number, ratio: number): number {\n const along = side * side;\n const across = area * area;\n if (across === 0 || min === 0) return Infinity;\n return Math.max((along * max * ratio) / across, across / (along * min * ratio));\n}\n\n/**\n * Bruls, Huizing and van Wijk's squarified layout, as recharts runs it: `weights` share\n * out `rect` in order, a row at a time along its shorter side, and a row closes when the\n * next node would make its worst tile further from φ:1 (recharts' default ratio). Returns\n * one rectangle per weight, in order, in fractional pixels.\n */\nexport function squarify(weights: readonly number[], rect: Box, ratio = PHI): Box[] {\n const out: Box[] = weights.map(() => ({ x: rect.x, y: rect.y, width: 0, height: 0 }));\n const sum = weights.reduce((acc, w) => acc + Math.max(0, w), 0);\n if (!(sum > 0) || rect.width <= 0 || rect.height <= 0) return out;\n const areas = weights.map((w) => (Math.max(0, w) * rect.width * rect.height) / sum);\n let { x, y, width, height } = rect;\n let i = 0;\n while (i < areas.length) {\n const side = Math.min(width, height);\n let rowArea = 0;\n let min = Infinity;\n let max = 0;\n let best = Infinity;\n let j = i;\n while (j < areas.length) {\n const a = areas[j]!;\n const score = worst(rowArea + a, Math.min(min, a), Math.max(max, a), side, ratio);\n if (j > i && score > best) break;\n rowArea += a;\n min = Math.min(min, a);\n max = Math.max(max, a);\n best = score;\n j += 1;\n }\n // The last row takes what is left, so rounding never leaves a sliver unpainted.\n const last = j === areas.length;\n if (side === width) {\n // A row along the top, as wide as the space.\n const thick = last ? height : rowArea / width;\n let at = x;\n for (let k = i; k < j; k++) {\n const len = k === j - 1 ? x + width - at : (areas[k]! / rowArea) * width;\n out[k] = { x: at, y, width: len, height: thick };\n at += len;\n }\n y += thick;\n height -= thick;\n } else {\n // A column at the left, as tall as the space.\n const thick = last ? width : rowArea / height;\n let at = y;\n for (let k = i; k < j; k++) {\n const len = k === j - 1 ? y + height - at : (areas[k]! / rowArea) * height;\n out[k] = { x, y: at, width: thick, height: len };\n at += len;\n }\n x += thick;\n width -= thick;\n }\n i = j;\n }\n return out;\n}\n\n/** Whole pixels on the EDGES: neighbours share an edge, so they round it alike. */\nfunction snap(b: Box): Box {\n const x = Math.round(b.x);\n const y = Math.round(b.y);\n return { x, y, width: Math.round(b.x + b.width) - x, height: Math.round(b.y + b.height) - y };\n}\n\n/** The rounds the frames get to settle; three is usual, more only when a band switches. */\nconst ROUNDS = 8;\n\n/**\n * Every node of `nodes` placed in a `width` × `height` chart, by path.\n *\n * Each tile's area is its value's share of what is left for tiles once the frames have\n * theirs — the same density in every group and at the top. A group asks for its tiles'\n * area and its own frame's (band and margin, as {@link groupBody} measures them on the\n * rectangle it got last round), so its body holds exactly its tiles.\n */\nexport function layoutTreemap(\n nodes: readonly LayoutNode[],\n width: number,\n height: number,\n scale: number,\n): Map<string, Placed> {\n const total = nodes.reduce((acc, n) => acc + n.size, 0);\n const frames = new Map<string, number>();\n let placed = new Map<string, Placed>();\n for (let round = 0; round < ROUNDS; round++) {\n const framed = [...frames.values()].reduce((acc, a) => acc + a, 0);\n const spare = width * height - framed;\n // Frames that would take the whole chart (a tiny chart of many groups) leave nothing\n // to share; the tiles then take the density they would have without frames.\n const density = total > 0 ? (spare > 0 ? spare : width * height) / total : 0;\n const need = (n: LayoutNode): number =>\n n.children ? (frames.get(n.path) ?? 0) + n.children.reduce((acc, c) => acc + need(c), 0) : n.size * density;\n let moved = 0;\n placed = new Map();\n const place = (list: readonly LayoutNode[], rect: Box) => {\n const boxes = squarify(\n list.map((n) => need(n)),\n rect,\n );\n list.forEach((n, i) => {\n const box = snap(boxes[i]!);\n if (!n.children) {\n placed.set(n.path, { box });\n return;\n }\n const { banded, body } = groupBody(box, scale);\n placed.set(n.path, { box, body, banded });\n const frame = box.width * box.height - body.width * body.height;\n moved = Math.max(moved, Math.abs(frame - (frames.get(n.path) ?? 0)));\n frames.set(n.path, frame);\n place(n.children, body);\n });\n };\n place(nodes, { x: 0, y: 0, width, height });\n if (moved < 1) break;\n }\n return placed;\n}\n"],"mappings":";AAuCA,MAAM,OAAO,IAAI,KAAK,KAAK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,EAAE,IAAI,CAAC;AAC1B;AAAA,QACF;AACA,cAAM,EAAE,QAAQ,KAAK,IAAI,UAAU,KAAK,KAAK;AAC7C,eAAO,IAAI,EAAE,MAAM,EAAE,KAAK,MAAM,OAAO,CAAC;AACxC,cAAM,QAAQ,IAAI,QAAQ,IAAI,SAAS,KAAK,QAAQ,KAAK;AACzD,gBAAQ,KAAK,IAAI,OAAO,KAAK,IAAI,SAAS,OAAO,IAAI,EAAE,IAAI,KAAK,EAAE,CAAC;AACnE,eAAO,IAAI,EAAE,MAAM,KAAK;AACxB,cAAM,EAAE,UAAU,IAAI;AAAA,MACxB,CAAC;AAAA,IACH;AACA,UAAM,OAAO,EAAE,GAAG,GAAG,GAAG,GAAG,OAAO,OAAO,CAAC;AAC1C,QAAI,QAAQ,EAAG;AAAA,EACjB;AACA,SAAO;AACT;","names":[]}
1
+ {"version":3,"sources":["../../src/components/treemap-layout.ts"],"sourcesContent":["// Where `Treemap` draws each node — a pure function of the nodes, the chart's size and the\n// text size, with no recharts in it (0.52 code review of treemap.tsx, findings 1 and 8).\n//\n// recharts lays nested data out itself, edge to edge, and 0.52 first made the groups' room\n// afterwards: a group's cell took its band and margin out of its rectangle and each child's\n// cell SQUEEZED the rectangle recharts gave it into what was left. Two faults followed.\n// A fixed 23px is a different share of every group, so a €100 tile in a 61px group was\n// drawn at two thirds of a €100 tile in a 300px one — in a chart whose one promise is that\n// area is share. And the squeeze ran through a cache the group's cell wrote during render\n// for its children's cells to read, which held only because recharts renders a group\n// before its children.\n//\n// So the layout is made here, up front: squarified as recharts does it, with each group\n// asking for its tiles' area PLUS its frame's, and its tiles laid out in its body. A\n// frame's area depends on the rectangle it gets, so the layout is run again with each\n// group's frame as measured until no frame moves by a pixel — two or three rounds.\n//\n// Since 0.55 it is the only layout the map has: the map draws its nodes itself, where this\n// puts them (treemap.tsx, \"The picture\"), and recharts lays nothing out for it any more.\n\nexport interface Box {\n x: number;\n y: number;\n width: number;\n height: number;\n}\n\n/** What the layout needs of a node: its key, its value, and a group's nodes. */\nexport interface LayoutNode {\n path: string;\n size: number;\n children?: readonly LayoutNode[];\n}\n\n/** A node as drawn: its rectangle, and for a group the body its nodes fill and whether\n * its band is drawn. Whole pixels, on shared edges, so neighbours meet without a seam. */\nexport interface Placed {\n box: Box;\n body?: Box;\n banded?: boolean;\n}\n\nconst PHI = (1 + Math.sqrt(5)) / 2;\n\n/**\n * A group's band, in px at Normal, × the text size's scale: the 20px floor a tile keeps\n * for its own name, so the group's name sits in it as a tile's does in a tile.\n */\nexport const BAND = 20;\n/**\n * The frame's margin round its body, in px. Each tile keeps its 2px gutter, half of it\n * inside the tile, so 3 leaves one pixel of the frame's own colour between the group's\n * gutter and its tiles' — the frame reads as one outline round the group, not as a gutter\n * that happens to be wider.\n */\nexport const FRAME_MARGIN = 3;\n/**\n * The least of a group's height its body keeps under the band: 1/φ. At Normal that is a\n * group of 61px (20 band + 3 margin = 0.382 of it), whose body of 38px still holds a\n * tile's name and its second line (the note's 36px floor) — so a single row of tiles under\n * the band keeps both. A smaller group draws no band, and its name is in its tiles'\n * accessible names and its tooltip rather than over their area. Since the frame's area is\n * given to the group (above), this bounds the frame's share of the picture, not the tiles'.\n */\nexport const BODY_SHARE = 1 / PHI;\n\n/** A group drawn at `box`: whether it has the room for its band (see {@link BODY_SHARE};\n * and 44px across, the floor of a word), and the body its nodes are drawn into. */\nexport function groupBody(box: Box, scale: number): { banded: boolean; body: Box } {\n const band = BAND * scale;\n const margin = Math.min(FRAME_MARGIN, Math.floor(box.width / 4), Math.floor(box.height / 4));\n const banded = box.width >= 44 * scale && box.height - band - margin >= box.height * BODY_SHARE;\n const top = banded ? band : margin;\n return {\n banded,\n body: {\n x: box.x + margin,\n y: box.y + top,\n width: Math.max(0, box.width - 2 * margin),\n height: Math.max(0, box.height - top - margin),\n },\n };\n}\n\n/** The worst aspect ratio in a row of `area` along `side`, against the target `ratio`. */\nfunction worst(area: number, min: number, max: number, side: number, ratio: number): number {\n const along = side * side;\n const across = area * area;\n if (across === 0 || min === 0) return Infinity;\n return Math.max((along * max * ratio) / across, across / (along * min * ratio));\n}\n\n/**\n * Bruls, Huizing and van Wijk's squarified layout, as recharts runs it: `weights` share\n * out `rect` in order, a row at a time along its shorter side, and a row closes when the\n * next node would make its worst tile further from φ:1 (recharts' default ratio). Returns\n * one rectangle per weight, in order, in fractional pixels.\n */\nexport function squarify(weights: readonly number[], rect: Box, ratio = PHI): Box[] {\n const out: Box[] = weights.map(() => ({ x: rect.x, y: rect.y, width: 0, height: 0 }));\n const sum = weights.reduce((acc, w) => acc + Math.max(0, w), 0);\n if (!(sum > 0) || rect.width <= 0 || rect.height <= 0) return out;\n const areas = weights.map((w) => (Math.max(0, w) * rect.width * rect.height) / sum);\n let { x, y, width, height } = rect;\n let i = 0;\n while (i < areas.length) {\n const side = Math.min(width, height);\n let rowArea = 0;\n let min = Infinity;\n let max = 0;\n let best = Infinity;\n let j = i;\n while (j < areas.length) {\n const a = areas[j]!;\n const score = worst(rowArea + a, Math.min(min, a), Math.max(max, a), side, ratio);\n if (j > i && score > best) break;\n rowArea += a;\n min = Math.min(min, a);\n max = Math.max(max, a);\n best = score;\n j += 1;\n }\n // The last row takes what is left, so rounding never leaves a sliver unpainted.\n const last = j === areas.length;\n if (side === width) {\n // A row along the top, as wide as the space.\n const thick = last ? height : rowArea / width;\n let at = x;\n for (let k = i; k < j; k++) {\n const len = k === j - 1 ? x + width - at : (areas[k]! / rowArea) * width;\n out[k] = { x: at, y, width: len, height: thick };\n at += len;\n }\n y += thick;\n height -= thick;\n } else {\n // A column at the left, as tall as the space.\n const thick = last ? width : rowArea / height;\n let at = y;\n for (let k = i; k < j; k++) {\n const len = k === j - 1 ? y + height - at : (areas[k]! / rowArea) * height;\n out[k] = { x, y: at, width: thick, height: len };\n at += len;\n }\n x += thick;\n width -= thick;\n }\n i = j;\n }\n return out;\n}\n\n/** Whole pixels on the EDGES: neighbours share an edge, so they round it alike. */\nfunction snap(b: Box): Box {\n const x = Math.round(b.x);\n const y = Math.round(b.y);\n return { x, y, width: Math.round(b.x + b.width) - x, height: Math.round(b.y + b.height) - y };\n}\n\n/** The rounds the frames get to settle; three is usual, more only when a band switches. */\nconst ROUNDS = 8;\n\n/**\n * Every node of `nodes` placed in a `width` × `height` chart, by path.\n *\n * Each tile's area is its value's share of what is left for tiles once the frames have\n * theirs — the same density in every group and at the top. A group asks for its tiles'\n * area and its own frame's (band and margin, as {@link groupBody} measures them on the\n * rectangle it got last round), so its body holds exactly its tiles.\n */\nexport function layoutTreemap(\n nodes: readonly LayoutNode[],\n width: number,\n height: number,\n scale: number,\n): Map<string, Placed> {\n const total = nodes.reduce((acc, n) => acc + n.size, 0);\n const frames = new Map<string, number>();\n let placed = new Map<string, Placed>();\n for (let round = 0; round < ROUNDS; round++) {\n const framed = [...frames.values()].reduce((acc, a) => acc + a, 0);\n const spare = width * height - framed;\n // Frames that would take the whole chart (a tiny chart of many groups) leave nothing\n // to share; the tiles then take the density they would have without frames.\n const density = total > 0 ? (spare > 0 ? spare : width * height) / total : 0;\n const need = (n: LayoutNode): number =>\n n.children ? (frames.get(n.path) ?? 0) + n.children.reduce((acc, c) => acc + need(c), 0) : n.size * density;\n let moved = 0;\n placed = new Map();\n const place = (list: readonly LayoutNode[], rect: Box) => {\n const boxes = squarify(\n list.map((n) => need(n)),\n rect,\n );\n list.forEach((n, i) => {\n const box = snap(boxes[i]!);\n if (!n.children) {\n placed.set(n.path, { box });\n return;\n }\n const { banded, body } = groupBody(box, scale);\n placed.set(n.path, { box, body, banded });\n const frame = box.width * box.height - body.width * body.height;\n moved = Math.max(moved, Math.abs(frame - (frames.get(n.path) ?? 0)));\n frames.set(n.path, frame);\n place(n.children, body);\n });\n };\n place(nodes, { x: 0, y: 0, width, height });\n if (moved < 1) break;\n }\n return placed;\n}\n"],"mappings":";AA0CA,MAAM,OAAO,IAAI,KAAK,KAAK,CAAC,KAAK;AAM1B,MAAM,OAAO;AAOb,MAAM,eAAe;AASrB,MAAM,a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AK,IAAI,UAAU,KAAK,KAAK;AAC7C,eAAO,IAAI,EAAE,MAAM,EAAE,KAAK,MAAM,OAAO,CAAC;AACxC,cAAM,QAAQ,IAAI,QAAQ,IAAI,SAAS,KAAK,QAAQ,KAAK;AACzD,gBAAQ,KAAK,IAAI,OAAO,KAAK,IAAI,SAAS,OAAO,IAAI,EAAE,IAAI,KAAK,EAAE,CAAC;AACnE,eAAO,IAAI,EAAE,MAAM,KAAK;AACxB,cAAM,EAAE,UAAU,IAAI;AAAA,MACxB,CAAC;AAAA,IACH;AACA,UAAM,OAAO,EAAE,GAAG,GAAG,GAAG,GAAG,OAAO,OAAO,CAAC;AAC1C,QAAI,QAAQ,EAAG;AAAA,EACjB;AACA,SAAO;AACT;","names":[]}
@@ -20,8 +20,8 @@ export interface TreemapNode {
20
20
  id: string;
21
21
  name: string;
22
22
  /** The tile's area. A node whose value is not a positive finite number is NOT
23
- * drawn — an area cannot be negative, and recharts lays a negative size out as
24
- * nonsense rather than refusing it. Saying so is the caller's job: a group that
23
+ * drawn — an area cannot be negative, and a squarified layout handed a negative size
24
+ * draws nonsense rather than refusing it. Saying so is the caller's job: a group that
25
25
  * vanishes silently between two views of the same data is a bug report.
26
26
  *
27
27
  * A GROUP's own `value` is not read: its area is its drawn children's together. Pass
@@ -256,11 +256,11 @@ export interface TreemapCellProps {
256
256
  onNodeClick?: (id: string, name: string, groups?: readonly string[]) => void;
257
257
  /** A group's cell's click; see {@link TreemapProps.onGroupClick}. */
258
258
  onGroupClick?: (id: string, name: string, groups?: readonly string[]) => void;
259
- /** The ids of the groups round the node, outermost first. `Treemap` puts it on every
260
- * node it hands recharts; a cell drawn in a caller's own map has it if the data does. */
259
+ /** The ids of the groups round the node, outermost first. `Treemap` gives it every tile
260
+ * it draws; a cell drawn in a caller's own map has it if the data does. */
261
261
  groups?: readonly string[];
262
- /** The node's place in the tree, which `Treemap` puts on every node it hands recharts:
263
- * its key in the map's keyboard, where an id may repeat between a group and a tile. */
262
+ /** The node's place in the tree, which `Treemap` gives every tile it draws: its key in
263
+ * the map's keyboard, where an id may repeat between a group and a tile. */
264
264
  path?: string;
265
265
  /** Filled in by recharts for a GROUP: the nodes laid out inside it. A cell with
266
266
  * children draws a frame, not a tile (0.52). */
@@ -278,8 +278,8 @@ export interface TreemapCellProps {
278
278
  edges?: TreemapEdges;
279
279
  }
280
280
  /**
281
- * One tile. Exported so a caller drawing its own recharts `<Treemap>` gets the same
282
- * label rules.
281
+ * One tile, for a caller drawing its own recharts `<Treemap>`: the `content` that gives it
282
+ * the map's label rules. `Treemap` itself draws the same tile (0.55, "The picture").
283
283
  *
284
284
  * recharts' default cell inherits the chart-level `stroke`, an SVG presentation
285
285
  * attribute that lands on the `<svg>` root and cascades into the label — so the glyphs
@@ -288,15 +288,15 @@ export interface TreemapCellProps {
288
288
  * (`paint-order: stroke`), which defeats any inherited stroke and keeps the text solid
289
289
  * where it overlaps a lighter or darker part of its own tile.
290
290
  *
291
- * Inside a `Treemap` it is one stop of the map's keyboard, named with its value and
292
- * share (0.52); drawn on its own it is a stop only as a button (`onNodeClick`), named by
293
- * `name`.
291
+ * Drawn on its own it is a stop only as a button (`onNodeClick`), named by `name`; a
292
+ * `Treemap`'s tile is one stop of the map's keyboard, named with its value and share
293
+ * (0.52).
294
294
  *
295
295
  * A node with `children` is a GROUP (0.52): the cell draws a frame in the well's colour
296
296
  * (`--bg-surface-2`), with the group's name in a band along its top where the group has
297
- * the room (61px at Normal, treemap-layout's `BODY_SHARE`). Inside a `Treemap` its tiles are laid out
298
- * in the frame's body; in a caller's own nested recharts `<Treemap>` they are drawn where
299
- * recharts lays them, over the frame — only `Treemap` makes the room.
297
+ * the room (61px at Normal, treemap-layout's `BODY_SHARE`). In a caller's own nested
298
+ * recharts `<Treemap>` the group's tiles are drawn where recharts lays them, over the
299
+ * frame — only `Treemap` makes the room, laying them out in the frame's body.
300
300
  */
301
301
  export declare function TreemapCell(props: TreemapCellProps): import("react").JSX.Element;
302
302
  /**
@@ -312,6 +312,8 @@ export declare function TreemapCell(props: TreemapCellProps): import("react").JS
312
312
  * Renders nothing when no node has a positive value — an empty box is a hole in the
313
313
  * card, and the caller's own sentence is the better answer there.
314
314
  *
315
- * Needs `recharts`, like everything behind `@eifi1/ui-kit/chart`.
315
+ * Drawn by the kit (0.55): the layout, the SVG and the tooltip are the map's own, inside the
316
+ * chart shell every chart shares, `ChartContainer` — whose `ResponsiveContainer` is all of
317
+ * `recharts` it still needs.
316
318
  */
317
319
  export declare function Treemap({ data, valueFormatter, height, onNodeClick, onGroupClick, redactNames, shareInValue, nodeNote, maxTiles, colors, edges, description, labels: labelsProp, style, ...rest }: TreemapProps): import("react").JSX.Element | null;