@eifi1/ui-kit 0.48.2 → 0.49.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 (292) hide show
  1. package/README.md +26 -12
  2. package/dist/admin/admin-action-confirm.js +1 -1
  3. package/dist/admin/admin-action-confirm.js.map +1 -1
  4. package/dist/admin/invitations-panel.js +5 -1
  5. package/dist/admin/invitations-panel.js.map +1 -1
  6. package/dist/admin/user-roster.d.ts +11 -5
  7. package/dist/admin/user-roster.js +15 -4
  8. package/dist/admin/user-roster.js.map +1 -1
  9. package/dist/auth/accept-invitation.js +2 -2
  10. package/dist/auth/accept-invitation.js.map +1 -1
  11. package/dist/auth/not-found-page.js +1 -1
  12. package/dist/auth/not-found-page.js.map +1 -1
  13. package/dist/auth/reset-password-form.js +2 -2
  14. package/dist/auth/reset-password-form.js.map +1 -1
  15. package/dist/auth/verify-email.js +2 -2
  16. package/dist/auth/verify-email.js.map +1 -1
  17. package/dist/billing/plan-card.js +2 -2
  18. package/dist/billing/plan-card.js.map +1 -1
  19. package/dist/components/breadcrumbs.d.ts +19 -1
  20. package/dist/components/breadcrumbs.js +11 -4
  21. package/dist/components/breadcrumbs.js.map +1 -1
  22. package/dist/components/button-look.d.ts +37 -7
  23. package/dist/components/button-look.js +33 -6
  24. package/dist/components/button-look.js.map +1 -1
  25. package/dist/components/button.d.ts +4 -1
  26. package/dist/components/button.js +2 -2
  27. package/dist/components/button.js.map +1 -1
  28. package/dist/components/calendar-heatmap.js +2 -1
  29. package/dist/components/calendar-heatmap.js.map +1 -1
  30. package/dist/components/chart-edge.d.ts +10 -0
  31. package/dist/components/chart-edge.js +57 -0
  32. package/dist/components/chart-edge.js.map +1 -0
  33. package/dist/components/chart.js +2 -1
  34. package/dist/components/chart.js.map +1 -1
  35. package/dist/components/chip.d.ts +8 -1
  36. package/dist/components/chip.js +4 -1
  37. package/dist/components/chip.js.map +1 -1
  38. package/dist/components/confirm-context.d.ts +5 -0
  39. package/dist/components/confirm-context.js +7 -0
  40. package/dist/components/confirm-context.js.map +1 -0
  41. package/dist/components/confirm-dialog.js +3 -3
  42. package/dist/components/confirm-dialog.js.map +1 -1
  43. package/dist/components/danger-confirm.d.ts +2 -2
  44. package/dist/components/danger-confirm.js +1 -1
  45. package/dist/components/danger-confirm.js.map +1 -1
  46. package/dist/components/data-table-fit.js +21 -3
  47. package/dist/components/data-table-fit.js.map +1 -1
  48. package/dist/components/data-table-mobile.d.ts +48 -2
  49. package/dist/components/data-table-mobile.js +87 -10
  50. package/dist/components/data-table-mobile.js.map +1 -1
  51. package/dist/components/data-table-row-actions.d.ts +2 -1
  52. package/dist/components/data-table-row-actions.js +7 -0
  53. package/dist/components/data-table-row-actions.js.map +1 -1
  54. package/dist/components/data-table-row.d.ts +1 -1
  55. package/dist/components/data-table-row.js.map +1 -1
  56. package/dist/components/data-table.d.ts +34 -1
  57. package/dist/components/data-table.js +34 -9
  58. package/dist/components/data-table.js.map +1 -1
  59. package/dist/components/error-boundary.js +2 -2
  60. package/dist/components/error-boundary.js.map +1 -1
  61. package/dist/components/floating-panel.d.ts +36 -13
  62. package/dist/components/floating-panel.js +27 -7
  63. package/dist/components/floating-panel.js.map +1 -1
  64. package/dist/components/form-actions.d.ts +1 -1
  65. package/dist/components/form-actions.js +1 -1
  66. package/dist/components/form-actions.js.map +1 -1
  67. package/dist/components/icon-button.d.ts +11 -0
  68. package/dist/components/icon-button.js +7 -5
  69. package/dist/components/icon-button.js.map +1 -1
  70. package/dist/components/nav-pills.d.ts +8 -1
  71. package/dist/components/nav-pills.js +61 -38
  72. package/dist/components/nav-pills.js.map +1 -1
  73. package/dist/components/page-header-context.d.ts +8 -0
  74. package/dist/components/page-header-context.js +7 -0
  75. package/dist/components/page-header-context.js.map +1 -0
  76. package/dist/components/page-header.d.ts +14 -2
  77. package/dist/components/page-header.js +10 -1
  78. package/dist/components/page-header.js.map +1 -1
  79. package/dist/components/pie-chart.js +2 -1
  80. package/dist/components/pie-chart.js.map +1 -1
  81. package/dist/components/progress-bar.js +5 -4
  82. package/dist/components/progress-bar.js.map +1 -1
  83. package/dist/components/reauth-dialog.js +1 -1
  84. package/dist/components/reauth-dialog.js.map +1 -1
  85. package/dist/components/row-actions-labels.js +3 -1
  86. package/dist/components/row-actions-labels.js.map +1 -1
  87. package/dist/components/row-actions.d.ts +43 -9
  88. package/dist/components/row-actions.js +78 -15
  89. package/dist/components/row-actions.js.map +1 -1
  90. package/dist/components/section-nav.d.ts +37 -0
  91. package/dist/components/section-nav.js +33 -0
  92. package/dist/components/section-nav.js.map +1 -0
  93. package/dist/components/series-chart.js +8 -3
  94. package/dist/components/series-chart.js.map +1 -1
  95. package/dist/components/share-card.js +1 -1
  96. package/dist/components/share-card.js.map +1 -1
  97. package/dist/components/signature-pad.js +1 -1
  98. package/dist/components/signature-pad.js.map +1 -1
  99. package/dist/components/sparkline.js +2 -1
  100. package/dist/components/sparkline.js.map +1 -1
  101. package/dist/components/stat-tile.js +14 -7
  102. package/dist/components/stat-tile.js.map +1 -1
  103. package/dist/components/status-dot.d.ts +5 -1
  104. package/dist/components/status-dot.js +4 -1
  105. package/dist/components/status-dot.js.map +1 -1
  106. package/dist/components/tooltip.js +1 -1
  107. package/dist/components/tooltip.js.map +1 -1
  108. package/dist/components/translation-review-editor.js +2 -2
  109. package/dist/components/translation-review-editor.js.map +1 -1
  110. package/dist/components/translation-review.js +2 -2
  111. package/dist/components/translation-review.js.map +1 -1
  112. package/dist/components/treemap.d.ts +5 -2
  113. package/dist/components/treemap.js +26 -6
  114. package/dist/components/treemap.js.map +1 -1
  115. package/dist/components/use-table-state.js +37 -6
  116. package/dist/components/use-table-state.js.map +1 -1
  117. package/dist/data-table.js.map +1 -1
  118. package/dist/demo/demo-banner.js +1 -1
  119. package/dist/demo/demo-banner.js.map +1 -1
  120. package/dist/demo/demo-ended.js +1 -1
  121. package/dist/demo/demo-ended.js.map +1 -1
  122. package/dist/demo/demo-start.js +1 -1
  123. package/dist/demo/demo-start.js.map +1 -1
  124. package/dist/eslint/index.js +1 -1
  125. package/dist/feedback/feedback-inbox.js +1 -1
  126. package/dist/feedback/feedback-inbox.js.map +1 -1
  127. package/dist/hooks/use-dismiss.d.ts +9 -1
  128. package/dist/hooks/use-dismiss.js +25 -5
  129. package/dist/hooks/use-dismiss.js.map +1 -1
  130. package/dist/hooks/use-document-title.d.ts +14 -0
  131. package/dist/hooks/use-document-title.js +22 -0
  132. package/dist/hooks/use-document-title.js.map +1 -0
  133. package/dist/i18n/german.js +6 -2
  134. package/dist/i18n/german.js.map +1 -1
  135. package/dist/i18n/kit-labels.d.ts +31 -1
  136. package/dist/i18n/kit-labels.js +43 -2
  137. package/dist/i18n/kit-labels.js.map +1 -1
  138. package/dist/i18n/locales/en.js +6 -2
  139. package/dist/i18n/locales/en.js.map +2 -2
  140. package/dist/i18n/locales/es.js +6 -2
  141. package/dist/i18n/locales/es.js.map +1 -1
  142. package/dist/i18n/locales/fr.js +6 -2
  143. package/dist/i18n/locales/fr.js.map +1 -1
  144. package/dist/i18n/locales/hu.js +6 -2
  145. package/dist/i18n/locales/hu.js.map +1 -1
  146. package/dist/i18n/locales/it.js +6 -2
  147. package/dist/i18n/locales/it.js.map +1 -1
  148. package/dist/i18n/locales/zh.js +6 -2
  149. package/dist/i18n/locales/zh.js.map +1 -1
  150. package/dist/i18n/review.js +2 -0
  151. package/dist/i18n/review.js.map +1 -1
  152. package/dist/i18n/shared-labels.js +1 -0
  153. package/dist/i18n/shared-labels.js.map +1 -1
  154. package/dist/index.d.ts +8 -1
  155. package/dist/index.js +11 -0
  156. package/dist/index.js.map +1 -1
  157. package/dist/landing/landing-actions.js +2 -2
  158. package/dist/landing/landing-actions.js.map +1 -1
  159. package/dist/landing/public-header.js +2 -2
  160. package/dist/landing/public-header.js.map +1 -1
  161. package/dist/lib/clipboard-minus.d.ts +27 -0
  162. package/dist/lib/clipboard-minus.js +63 -0
  163. package/dist/lib/clipboard-minus.js.map +1 -0
  164. package/dist/lib/document-title.d.ts +17 -0
  165. package/dist/lib/document-title.js +29 -0
  166. package/dist/lib/document-title.js.map +1 -0
  167. package/dist/lib/float-clearance.js +8 -2
  168. package/dist/lib/float-clearance.js.map +1 -1
  169. package/dist/lib/format.d.ts +35 -10
  170. package/dist/lib/format.js +55 -11
  171. package/dist/lib/format.js.map +1 -1
  172. package/dist/lib/minus.d.ts +22 -0
  173. package/dist/lib/minus.js +14 -0
  174. package/dist/lib/minus.js.map +1 -0
  175. package/dist/lib/status-tone.d.ts +30 -0
  176. package/dist/lib/status-tone.js +17 -0
  177. package/dist/lib/status-tone.js.map +1 -0
  178. package/dist/settings/settings-layout.js +3 -2
  179. package/dist/settings/settings-layout.js.map +1 -1
  180. package/dist/shell/account-menu-language.d.ts +1 -1
  181. package/dist/shell/account-menu-language.js +9 -1
  182. package/dist/shell/account-menu-language.js.map +1 -1
  183. package/dist/shell/app-shell-labels.js +2 -1
  184. package/dist/shell/app-shell-labels.js.map +1 -1
  185. package/dist/shell/app-shell.d.ts +58 -16
  186. package/dist/shell/app-shell.js +151 -43
  187. package/dist/shell/app-shell.js.map +1 -1
  188. package/dist/shell/language-code.d.ts +3 -0
  189. package/dist/shell/language-code.js +8 -0
  190. package/dist/shell/language-code.js.map +1 -0
  191. package/dist/shell/topbar-controls.d.ts +14 -6
  192. package/dist/shell/topbar-controls.js +14 -17
  193. package/dist/shell/topbar-controls.js.map +1 -1
  194. package/dist/testing/css-variables.generated.d.ts +1 -1
  195. package/dist/testing/css-variables.generated.js +1 -1
  196. package/dist/testing/css-variables.generated.js.map +1 -1
  197. package/dist/theme/chart-palette.d.ts +82 -15
  198. package/dist/theme/chart-palette.js +51 -24
  199. package/dist/theme/chart-palette.js.map +1 -1
  200. package/dist/theme/palette-presets.d.ts +9 -0
  201. package/dist/theme/palette-presets.js +77 -62
  202. package/dist/theme/palette-presets.js.map +1 -1
  203. package/dist/tour/tour.js +1 -1
  204. package/dist/tour/tour.js.map +1 -1
  205. package/dist/wizard/stepper-nav.d.ts +1 -1
  206. package/dist/wizard/stepper-nav.js +3 -3
  207. package/dist/wizard/stepper-nav.js.map +1 -1
  208. package/package.json +1 -1
  209. package/src/admin/admin-action-confirm.tsx +1 -1
  210. package/src/admin/invitations-panel.tsx +7 -3
  211. package/src/admin/user-roster.tsx +23 -6
  212. package/src/auth/accept-invitation.tsx +3 -3
  213. package/src/auth/not-found-page.tsx +1 -1
  214. package/src/auth/reset-password-form.tsx +3 -3
  215. package/src/auth/verify-email.tsx +3 -3
  216. package/src/billing/plan-card.tsx +2 -2
  217. package/src/components/breadcrumbs.tsx +32 -4
  218. package/src/components/button-look.ts +86 -15
  219. package/src/components/button.tsx +6 -3
  220. package/src/components/calendar-heatmap.tsx +2 -1
  221. package/src/components/chart-edge.ts +73 -0
  222. package/src/components/chart.tsx +3 -1
  223. package/src/components/chip.tsx +10 -1
  224. package/src/components/confirm-context.ts +7 -0
  225. package/src/components/confirm-dialog.tsx +3 -3
  226. package/src/components/danger-confirm.tsx +3 -3
  227. package/src/components/data-table-fit.ts +41 -6
  228. package/src/components/data-table-mobile.tsx +162 -11
  229. package/src/components/data-table-row-actions.tsx +9 -1
  230. package/src/components/data-table-row.tsx +2 -0
  231. package/src/components/data-table.tsx +82 -18
  232. package/src/components/error-boundary.tsx +2 -2
  233. package/src/components/floating-panel.tsx +67 -16
  234. package/src/components/form-actions.tsx +2 -2
  235. package/src/components/icon-button.tsx +21 -8
  236. package/src/components/nav-pills.tsx +29 -2
  237. package/src/components/page-header-context.ts +8 -0
  238. package/src/components/page-header.tsx +34 -2
  239. package/src/components/pie-chart.tsx +2 -1
  240. package/src/components/progress-bar.tsx +6 -3
  241. package/src/components/reauth-dialog.tsx +1 -1
  242. package/src/components/row-actions-labels.ts +2 -0
  243. package/src/components/row-actions.tsx +154 -33
  244. package/src/components/section-nav.tsx +65 -0
  245. package/src/components/series-chart.tsx +12 -3
  246. package/src/components/share-card.tsx +1 -1
  247. package/src/components/signature-pad.tsx +1 -1
  248. package/src/components/sparkline.tsx +2 -1
  249. package/src/components/stat-tile.tsx +19 -7
  250. package/src/components/status-dot.tsx +7 -1
  251. package/src/components/tooltip.tsx +3 -1
  252. package/src/components/translation-review-editor.tsx +2 -2
  253. package/src/components/translation-review.tsx +2 -2
  254. package/src/components/treemap.tsx +34 -8
  255. package/src/components/use-table-state.ts +63 -8
  256. package/src/data-table.ts +3 -3
  257. package/src/demo/demo-banner.tsx +1 -1
  258. package/src/demo/demo-ended.tsx +1 -1
  259. package/src/demo/demo-start.tsx +1 -1
  260. package/src/feedback/feedback-inbox.tsx +1 -1
  261. package/src/hooks/use-dismiss.ts +43 -4
  262. package/src/hooks/use-document-title.ts +31 -0
  263. package/src/i18n/german.ts +4 -0
  264. package/src/i18n/kit-labels.tsx +76 -1
  265. package/src/i18n/locales/es.ts +4 -0
  266. package/src/i18n/locales/fr.ts +4 -0
  267. package/src/i18n/locales/hu.ts +4 -0
  268. package/src/i18n/locales/it.ts +4 -0
  269. package/src/i18n/locales/zh.ts +4 -0
  270. package/src/i18n/review.ts +2 -0
  271. package/src/i18n/shared-labels.ts +1 -0
  272. package/src/index.ts +13 -0
  273. package/src/landing/landing-actions.tsx +2 -2
  274. package/src/landing/public-header.tsx +2 -2
  275. package/src/lib/clipboard-minus.ts +94 -0
  276. package/src/lib/document-title.ts +41 -0
  277. package/src/lib/float-clearance.ts +19 -3
  278. package/src/lib/format.ts +115 -30
  279. package/src/lib/minus.ts +40 -0
  280. package/src/lib/status-tone.ts +43 -0
  281. package/src/settings/settings-layout.tsx +3 -2
  282. package/src/shell/account-menu-language.tsx +14 -2
  283. package/src/shell/app-shell-labels.ts +1 -0
  284. package/src/shell/app-shell.tsx +291 -68
  285. package/src/shell/language-code.ts +5 -0
  286. package/src/shell/topbar-controls.tsx +35 -15
  287. package/src/testing/css-variables.generated.ts +6 -6
  288. package/src/theme/chart-palette.ts +102 -20
  289. package/src/theme/palette-presets.ts +121 -84
  290. package/src/tour/tour.tsx +1 -1
  291. package/src/wizard/stepper-nav.tsx +4 -4
  292. package/tokens.css +28 -18
@@ -254,6 +254,9 @@ export interface TopBarLabels {
254
254
  theme: string;
255
255
  palette: string;
256
256
  language: string;
257
+ /** 0.49 KIT-10: the language menu's trigger, given the current language's name —
258
+ * "Choose language, current: Deutsch". */
259
+ languageCurrent: (name: string) => string;
257
260
  switchRole: string;
258
261
  /** The role switcher's tooltip, given the active role's name. */
259
262
  role: (value: string) => string;
@@ -623,6 +626,25 @@ export interface UiKitProviderProps {
623
626
  * it names in every zone). Left out, timestamps follow the device, as before.
624
627
  */
625
628
  timeZone?: string;
629
+ /**
630
+ * 0.49 KIT-9: how `useDocumentTitle` and every `PageHeader`'s `h1` write the window's
631
+ * title, from `{page}`, `{section}` and `{app}`. Default
632
+ * `"{page} · {section} · {app}"` (`DEFAULT_DOCUMENT_TITLE_FORMAT`); a missing part
633
+ * drops with its separator.
634
+ */
635
+ documentTitleFormat?: string;
636
+ /** 0.49 KIT-9: the app's name, the `{app}` of the window's title ("Kastlan"). Left
637
+ * out, titles end at the page or section. */
638
+ appName?: string;
639
+ /**
640
+ * 0.49 KIT-1b: while a person copies a selection in the page, a U+2212 minus standing
641
+ * before a number ("−CHF 1,250.50") goes to the clipboard as "-", in `text/plain` and
642
+ * `text/html` (what Excel pastes), so a spreadsheet reads a number; the page keeps "−".
643
+ * A copy out of an input, a textarea or an editable element is left alone. Installed
644
+ * once per document, by the first provider that has it on. Default `true`; `false` on
645
+ * the outermost provider leaves the clipboard to the browser.
646
+ */
647
+ copyAsciiMinus?: boolean;
626
648
  children: ReactNode;
627
649
  }
628
650
  /**
@@ -633,7 +655,7 @@ export interface UiKitProviderProps {
633
655
  * it names, so a page can re-label one table's `dataTable.table` without restating
634
656
  * the language.
635
657
  */
636
- export declare function UiKitProvider({ labels, locale, weekStartsOn, linkComponent, chartTooltipPlacement, formatDate, tableStorageKeyPrefix, timeZone, children, }: UiKitProviderProps): import("react").JSX.Element;
658
+ export declare function UiKitProvider({ labels, locale, weekStartsOn, linkComponent, chartTooltipPlacement, formatDate, tableStorageKeyPrefix, timeZone, documentTitleFormat, appName, copyAsciiMinus, children, }: UiKitProviderProps): import("react").JSX.Element;
637
659
  /**
638
660
  * What the nearest provider says about one namespace — `undefined` outside one. Nested
639
661
  * providers' words come merged, at every depth; no English default is filled in.
@@ -677,6 +699,14 @@ export declare function useKitTableStorageKeyPrefix(): string | undefined;
677
699
  /** The nearest provider's `timeZone` (0.46), or `undefined` — the device's. A call's own
678
700
  * `timeZone` wins over it. */
679
701
  export declare function useKitTimeZone(): string | undefined;
702
+ /** The nearest provider's `documentTitleFormat` and `appName`, or `undefined` each —
703
+ * what `useDocumentTitle` writes with (the format's default is
704
+ * `DEFAULT_DOCUMENT_TITLE_FORMAT`, applied there: this module reaches nothing outside
705
+ * i18n/). */
706
+ export declare function useKitDocumentTitle(): {
707
+ format: string | undefined;
708
+ appName: string | undefined;
709
+ };
680
710
  /** {@link DEFAULT_FILE_LABELS}, but formatting in the provider's locale. */
681
711
  export declare function useKitFileLabels(prop?: Partial<FileLabels>): FileLabels;
682
712
  /**
@@ -25,6 +25,9 @@ function UiKitProvider({
25
25
  formatDate,
26
26
  tableStorageKeyPrefix,
27
27
  timeZone,
28
+ documentTitleFormat,
29
+ appName,
30
+ copyAsciiMinus = true,
28
31
  children
29
32
  }) {
30
33
  const outer = useContext(KitI18nContext);
@@ -37,11 +40,26 @@ function UiKitProvider({
37
40
  chartTooltipPlacement: chartTooltipPlacement ?? outer.chartTooltipPlacement,
38
41
  formatDate: formatDate ?? outer.formatDate,
39
42
  tableStorageKeyPrefix: tableStorageKeyPrefix ?? outer.tableStorageKeyPrefix,
40
- timeZone: timeZone ?? outer.timeZone
43
+ timeZone: timeZone ?? outer.timeZone,
44
+ documentTitleFormat: documentTitleFormat ?? outer.documentTitleFormat,
45
+ appName: appName ?? outer.appName
41
46
  }),
42
- [outer, labels, locale, weekStartsOn, linkComponent, chartTooltipPlacement, formatDate, tableStorageKeyPrefix, timeZone]
47
+ [
48
+ outer,
49
+ labels,
50
+ locale,
51
+ weekStartsOn,
52
+ linkComponent,
53
+ chartTooltipPlacement,
54
+ formatDate,
55
+ tableStorageKeyPrefix,
56
+ timeZone,
57
+ documentTitleFormat,
58
+ appName
59
+ ]
43
60
  );
44
61
  useTableViewsJoin(value.tableStorageKeyPrefix ?? DEFAULT_TABLE_STORAGE_KEY_PREFIX);
62
+ useClipboardMinus(copyAsciiMinus);
45
63
  return /* @__PURE__ */ jsx(KitI18nContext.Provider, { value, children });
46
64
  }
47
65
  const DEFAULT_TABLE_STORAGE_KEY_PREFIX = "hbui-table:";
@@ -63,6 +81,24 @@ function useTableViewsJoin(prefix) {
63
81
  };
64
82
  }, [prefix]);
65
83
  }
84
+ function useClipboardMinus(on) {
85
+ useEffect(() => {
86
+ if (!on || typeof document === "undefined") return;
87
+ let uninstall;
88
+ let gone = false;
89
+ import("../lib/clipboard-minus.js").then(
90
+ ({ installClipboardMinus }) => {
91
+ if (!gone) uninstall = installClipboardMinus(document);
92
+ },
93
+ // Not loaded: copying works as the browser does it.
94
+ () => void 0
95
+ );
96
+ return () => {
97
+ gone = true;
98
+ uninstall?.();
99
+ };
100
+ }, [on]);
101
+ }
66
102
  function isRecord(v) {
67
103
  return typeof v === "object" && v !== null && !Array.isArray(v);
68
104
  }
@@ -120,6 +156,10 @@ function useKitTableStorageKeyPrefix() {
120
156
  function useKitTimeZone() {
121
157
  return useContext(KitI18nContext).timeZone;
122
158
  }
159
+ function useKitDocumentTitle() {
160
+ const { documentTitleFormat, appName } = useContext(KitI18nContext);
161
+ return { format: documentTitleFormat, appName };
162
+ }
123
163
  function useKitFileLabels(prop) {
124
164
  const locale = useKitLocale();
125
165
  const defaults = useMemo(
@@ -167,6 +207,7 @@ export {
167
207
  missingKitLabels,
168
208
  useKitChartTooltipPlacement,
169
209
  useKitDateFormatter,
210
+ useKitDocumentTitle,
170
211
  useKitFileLabels,
171
212
  useKitLabelOverrides,
172
213
  useKitLabels,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/i18n/kit-labels.tsx"],"sourcesContent":["import { createContext, useContext, useEffect, useMemo } from \"react\";\nimport {\n DEFAULT_APP_SHELL_LABELS,\n DEFAULT_CALCULATOR_LABELS,\n DEFAULT_COMBOBOX_LABELS,\n DEFAULT_COMMON_LABELS,\n DEFAULT_CURRENCY_LABELS,\n DEFAULT_DATE_PICKER_LABELS,\n DEFAULT_FILE_LABELS,\n DEFAULT_MULTI_SELECT_LABELS,\n DEFAULT_PICKER_SHEET_LABELS,\n DEFAULT_SWIPEABLE_ROW_LABELS,\n DEFAULT_TOP_BAR_LABELS,\n formatFileSize,\n} from \"./shared-labels\";\nimport type { AnchorHTMLAttributes, ReactElement, Ref } from \"react\";\nimport type { ReactNode } from \"react\";\nimport type { DataTableLabels } from \"../components/data-table-labels\";\nimport type { MiniCalendarLabels, WeekDay } from \"../components/mini-calendar\";\nimport type { CalendarHeatmapLabels } from \"../components/calendar-heatmap\";\nimport type { PopoverLabels } from \"../components/popover\";\nimport type { ChipInputLabels } from \"../components/chip\";\nimport type { FieldSyncLabels } from \"../components/field-sync\";\nimport type { CharacterCountLabels, PasswordRevealLabels } from \"../components/field-base\";\nimport type { TabsLabels } from \"../components/tabs\";\nimport type { WizardLabels } from \"../wizard/types\";\nimport type { TourLabels } from \"../tour/tour\";\nimport type { TourCatalogueLabels } from \"../tour/tour-catalogue-labels\";\nimport type { CommandPaletteLabels } from \"../search/command-palette\";\nimport type { GlobalSearchLabels } from \"../search/global-search\";\nimport type { MonthPickerLabels } from \"../components/month-picker\";\nimport type { PageContentsLabels } from \"../components/page-contents\";\nimport type { SeriesChartLabels } from \"../components/series-chart-labels\";\nimport type { PieChartLabels } from \"../components/pie-chart-labels\";\nimport type { SparklineLabels } from \"../components/sparkline\";\nimport type { StatTileLabels } from \"../components/stat-tile\";\nimport type { SignaturePadLabels } from \"../components/signature-pad\";\nimport type { PasswordStrengthLabels } from \"../components/password-strength\";\nimport type { DangerConfirmLabels } from \"../components/danger-confirm\";\nimport type { SwatchPickerLabels } from \"../components/swatch-picker\";\nimport type { IconPickerLabels } from \"../components/icon-picker\";\nimport type { DialogFrameLabels } from \"../components/dialog-frame\";\nimport type { FilePickerLabels } from \"../components/file-button\";\nimport type { MeasuredGridLabels } from \"../components/measured-grid\";\nimport type { FeedbackAttachmentFieldLabels } from \"../feedback/feedback-attachment\";\nimport type { FeedbackDialogTextLabels } from \"../feedback/feedback-dialog\";\nimport type { FeedbackComposerLabels, FeedbackThreadLabels } from \"../feedback/feedback-thread\";\nimport type {\n FeedbackCategoryLabels,\n FeedbackStatusLabels,\n FeedbackToastLabels,\n} from \"../feedback/feedback-labels\";\nimport type { FeedbackMenuLabels } from \"../feedback/feedback-menu\";\nimport type { FeedbackPublicLabels } from \"../feedback/feedback-public-labels\";\nimport type { FeedbackNotificationTypesLabels } from \"../notifications/feedback-notification-types-labels\";\nimport type { FeedbackContextLabels } from \"../feedback/feedback-context\";\nimport type { FeedbackPageLabels } from \"../feedback/feedback-table\";\nimport type { FeedbackDetailLabels } from \"../feedback/feedback-row-detail\";\nimport type { FeedbackVoteLabels } from \"../feedback/feedback-vote-button\";\nimport type { FeedbackCommentsLabels } from \"../feedback/feedback-comment-thread\";\nimport type { FeedbackRepliesLabels } from \"../feedback/feedback-replies\";\nimport type { AccountSettingsLabels } from \"../account/account-settings-labels\";\nimport type { ConfirmDialogLabels } from \"../components/confirm-dialog\";\nimport type { FloatingPanelLabels } from \"../components/floating-panel\";\nimport type { CopyButtonLabels } from \"../components/copy-button\";\nimport type { BulkActionBarLabels } from \"../components/bulk-action-bar\";\nimport type { ListLabels } from \"../components/list\";\nimport type { BreadcrumbsLabels } from \"../components/breadcrumbs\";\nimport type { ToastLabels } from \"../components/toast\";\nimport type { FormActionsLabels } from \"../components/form-actions\";\nimport type { DescriptionListLabels } from \"../components/description-list\";\nimport type { LineItemsLabels } from \"../components/line-items\";\nimport type { ProgressBarLabels } from \"../components/progress-bar\";\nimport type { SignedAmountLabels } from \"../components/signed-amount\";\nimport type { ErrorBoundaryLabels } from \"../components/error-boundary\";\nimport type { AuthedImageLabels } from \"../components/authed-image\";\nimport type { ImageGridLabels } from \"../components/image-grid\";\nimport type { LightboxLabels } from \"../components/lightbox\";\nimport type { WriteLockLabels } from \"../components/write-lock\";\nimport type { LegalLabels } from \"../components/legal\";\nimport type { SignInLabels } from \"../auth/sign-in-form\";\nimport type { RegisterLabels } from \"../auth/register-form\";\nimport type { CompleteNameLabels } from \"../auth/complete-name-dialog\";\nimport type { ForgotPasswordLabels } from \"../auth/forgot-password-form\";\nimport type { ResetPasswordLabels } from \"../auth/reset-password-form\";\nimport type { VerifyEmailLabels } from \"../auth/verify-email\";\nimport type { NotFoundLabels } from \"../auth/not-found-page\";\nimport type { AcceptInvitationLabels } from \"../auth/accept-invitation\";\nimport type { CompanySwitcherLabels } from \"../shell/company-switcher\";\nimport type { EmailChangeLabels } from \"../account/email-change-setting\";\nimport type { SessionsLabels } from \"../account/sessions-setting\";\nimport type { DeleteAccountLabels } from \"../account/delete-account-setting\";\nimport type { DataExportLabels } from \"../account/data-export-setting\";\nimport type { UserRosterLabels } from \"../admin/user-roster\";\nimport type { RoleSelectLabels } from \"../admin/role-select\";\nimport type { ReviewerScopeLabels } from \"../admin/reviewer-scope-editor\";\nimport type { AdminActionLabels } from \"../admin/admin-action-confirm\";\nimport type { AdminActionLogLabels } from \"../admin/admin-action-log\";\nimport type { TransferOwnershipLabels } from \"../admin/transfer-ownership-dialog\";\nimport type { InvitationsLabels } from \"../admin/invitations-panel\";\nimport type { SettingsLabels } from \"../settings/settings-labels\";\nimport type { LandingLabels } from \"../landing/landing-labels\";\nimport type { DemoLabels } from \"../demo/demo-labels\";\nimport type { BillingLabels } from \"../billing/billing-labels\";\nimport type { PlanChangeLabels } from \"../admin/plan-change\";\nimport type { AppearanceLabels } from \"../components/appearance-labels\";\nimport type { DeviceResetLabels } from \"../settings/device-reset-setting\";\nimport type { RowActionsLabels } from \"../components/row-actions\";\nimport type { AppShellMoreLabels } from \"../shell/app-shell\";\nimport type { AccountStateLabels } from \"../components/account-chips\";\nimport type { ShareCardLabels } from \"../components/share-card\";\nimport type { ReauthDialogLabels } from \"../components/reauth-dialog\";\nimport type { ServerWakeLabels } from \"../components/server-wake\";\nimport type { TranslationReviewLabels } from \"../components/translation-review-labels\";\nimport type { CountrySelectLabels } from \"../components/country-select\";\nimport type { InlineEditLabels } from \"../components/inline-edit-field\";\nimport type { IbanInputLabels } from \"../components/iban-input\";\nimport type { PhoneInputLabels } from \"../components/phone-input\";\nimport type { SignChipLabels } from \"../components/sign-chip\";\nimport type { ColumnMapperLabels } from \"../components/column-mapper\";\nimport type { NotificationsLabels } from \"../notifications/notifications-labels\";\nimport type { AdminAreaLabels } from \"../admin/admin-area-labels\";\nimport type { MailTestCardLabels } from \"../admin/mail-test-card\";\nimport type { TopBarPartsLabels } from \"../shell/top-bar-parts-labels\";\nimport type { SignOutPendingDialogLabels } from \"../offline/sign-out-pending-dialog\";\nimport type { PwaUpdatePromptLabels } from \"../offline/pwa-update-prompt\";\nimport type { SharedComputerLabels } from \"../offline/shared-computer\";\n\n/**\n * EVERY string the kit renders, as one typed tree — and an optional provider that\n * hands it to every component at once.\n *\n * WHY THIS EXISTS. The kit renders only labels; it ships seven catalogues (since 0.7.0,\n * `@eifi1/ui-kit/i18n/<code>`); the app decides the language and hands the words in.\n * What was wrong was HOW it had to hand them in —\n * one `labels` prop per component instance, under a different prop name per\n * component (`labels`, `calendarLabels`, `passwordLabels`, `clearLabel`,\n * `searchPlaceholder`, `ariaLabel` …). A translated app therefore rendered English\n * wherever one call site forgot one prop, and nothing told it so: a German showcase\n * still said \"Rows per page\", \"Collapse sidebar\" and \"Popover\" in seven languages.\n *\n * Now there is one key per string, addressed by a dot path (`dataTable.pageSize`,\n * `datePicker.today`), and three sources in a fixed order of precedence:\n *\n * the component's own prop > <UiKitProvider labels> > English default\n *\n * A consumer loads a shipped catalogue (`loadUiKitLabels(code)`) or writes its own\n * `UiKitLabels` (or a partial of one), mounts `<UiKitProvider labels={…} locale={…}>`\n * at the root, and every kit component\n * below speaks that language — including the ones nested inside other kit components\n * (the calendar inside the data table's date filter, the popover inside the date\n * picker), which no prop at the outer call site could reach before.\n *\n * Messages that carry a value are FUNCTIONS of that value, never a template to fill:\n * a number glued into an English sentence is untranslatable, because the grammar\n * around it moves with it in most languages.\n */\n\n/* ── Namespaces that had no labels type of their own ─────────────────────── */\n\n/** The words several components share. A component's own namespace wins over these\n * where both exist; these are what a new component reaches for first. */\nexport interface CommonLabels {\n close: string;\n clear: string;\n search: string;\n done: string;\n cancel: string;\n save: string;\n back: string;\n next: string;\n remove: string;\n loading: string;\n noResults: string;\n /** \"Name: value\" — how a field's accessible name is composed with its value.\n * A colon-and-space is not universal punctuation (French puts a space before\n * the colon, Chinese uses a full-width one). */\n fieldValue: (field: string, value: string) => string;\n /** The × that puts away a banner or a notice (`AlertBanner onDismiss`). Not `close`:\n * nothing opened, and \"Close\" on a banner reads as closing the page it sits on. */\n dismiss: string;\n /** Read after a link that opens a new tab (`<Button href external>`, TextLink):\n * nothing else tells a screen reader the page is about to change tabs. */\n opensInNewTab: string;\n /** The name of a field's `help` \"?\" and its panel (round 0.36): \"About “<field>”\", the\n * field's label as the argument, quoted so a capitalised label reads as a name — \"About\n * “Jerk shape”\" (round 0.37; the other locales quoted it already). A `HelpPopover`\n * passed as `help` keeps its own name. */\n aboutField: (field: string) => string;\n /** …and of a `help` \"?\" on a field with no label and no `aria-label` to name it by. */\n help: string;\n /** 0.48: the toggle that shows the rest of a clamped text (`AlertBanner clampMobile`)… */\n showMore: string;\n /** …and folds it back to its one line. */\n showLess: string;\n}\n\n/** `DatePicker` / `DateRangePicker` chrome. The calendar inside has its own\n * namespace, `miniCalendar`. */\nexport interface DatePickerLabels {\n /** Accessible name of the popover panel the calendar opens in. */\n panel: string;\n /** The same, for `DateRangePicker`'s panel. */\n rangePanel: string;\n clear: string;\n previousDay: string;\n nextDay: string;\n today: string;\n /** `DateRangePicker commit=\"apply\"`: the button that commits the drafted range. */\n apply: string;\n /** …and the one that discards it. */\n cancel: string;\n /** Accessible name of `DateRangePicker`'s preset column. */\n presets: string;\n}\n\n/** The whole combobox family: `Combobox`, `EntityCombobox`,\n * `MultiEntityCombobox`, `InlineEntityCombobox`, `Autocomplete`. */\nexport interface ComboboxLabels {\n search: string;\n noResults: string;\n clear: string;\n loading: string;\n /** The \"add this\" row when free entry is allowed. */\n create: (query: string) => string;\n /** Trigger summary once more than one value is picked. */\n selectedCount: (count: number) => string;\n /** An async lookup (`loadOptions`) failed. */\n loadError: string;\n /** Announced (live region) when the list settles on `count` > 0 rows. */\n resultCount: (count: number) => string;\n /** The query is shorter than the `minChars` a lookup needs. */\n minChars: (count: number) => string;\n}\n\nexport interface MultiSelectLabels {\n search: string;\n selectAll: string;\n clear: string;\n /** Trigger text when nothing is picked, which a multi-select reads as \"all\". */\n all: string;\n /** Trigger summary once some (but not all) values are picked. The English\n * default is the bare count, which is what the trigger has always shown. */\n selectedCount: (count: number) => string;\n}\n\n/** `CalculatorButton` (desktop popover keypad) and `NumberPadSheet` (phone sheet). */\nexport interface CalculatorLabels {\n /** The button that opens the calculator. */\n open: string;\n /** The popover / sheet itself. */\n panel: string;\n calculation: string;\n backspace: string;\n clear: string;\n equals: string;\n /** The primary key of the phone pad — visible text, not an aria-label. */\n done: string;\n /** Names of the operator keys and the decimal key. Their glyphs are not names a\n * screen reader agrees on — \"÷\" is read as \"division sign\", \"divided by\" or\n * nothing at all depending on the reader — so each says what it does. */\n plus: string;\n minus: string;\n times: string;\n divide: string;\n decimal: string;\n}\n\n/** `CurrencySelect` and the currency half of `AmountInput`. */\nexport interface CurrencyLabels {\n currency: string;\n search: string;\n}\n\nexport interface AppShellLabels {\n collapse: string;\n expand: string;\n /** Accessible name of an inline group's disclosure button (`subNav=\"inline\"`). */\n toggleGroup: (groupLabel: string) => string;\n}\n\nexport interface TopBarLabels {\n theme: string;\n palette: string;\n language: string;\n switchRole: string;\n /** The role switcher's tooltip, given the active role's name. */\n role: (value: string) => string;\n}\n\nexport interface PickerSheetLabels {\n close: string;\n /** The sticky footer button that closes a multi-select sheet once the rows are ticked\n * (0.40) — the ticks are already applied, so it confirms rather than saves. */\n done: string;\n}\n\nexport interface SwipeableRowLabels {\n actions: string;\n}\n\nexport interface FileLabels {\n /** A file size for display, given its size in BYTES. The default uses\n * `Intl.NumberFormat`'s unit formatting in the provider's locale. */\n size: (bytes: number) => string;\n}\n\n/** The complete tree. `UiKitProvider` takes any partial of it. */\nexport interface UiKitLabels {\n common: CommonLabels;\n dataTable: DataTableLabels;\n miniCalendar: MiniCalendarLabels;\n calendarHeatmap: CalendarHeatmapLabels;\n datePicker: DatePickerLabels;\n monthPicker: MonthPickerLabels;\n popover: PopoverLabels;\n combobox: ComboboxLabels;\n multiSelect: MultiSelectLabels;\n calculator: CalculatorLabels;\n currency: CurrencyLabels;\n chipInput: ChipInputLabels;\n fieldSync: FieldSyncLabels;\n passwordReveal: PasswordRevealLabels;\n tabs: TabsLabels;\n appShell: AppShellLabels;\n pageContents: PageContentsLabels;\n topBar: TopBarLabels;\n pickerSheet: PickerSheetLabels;\n swipeableRow: SwipeableRowLabels;\n file: FileLabels;\n wizard: WizardLabels;\n tour: TourLabels;\n /** 0.43.0: the tours page — `TourCatalogue` and its card (docs/tours-harmonization.md §3). */\n tourCatalogue: TourCatalogueLabels;\n commandPalette: CommandPaletteLabels;\n globalSearch: GlobalSearchLabels;\n seriesChart: SeriesChartLabels;\n pieChart: PieChartLabels;\n sparkline: SparklineLabels;\n statTile: StatTileLabels;\n signaturePad: SignaturePadLabels;\n passwordStrength: PasswordStrengthLabels;\n dangerConfirm: DangerConfirmLabels;\n swatchPicker: SwatchPickerLabels;\n iconPicker: IconPickerLabels;\n dialogFrame: DialogFrameLabels;\n filePicker: FilePickerLabels;\n measuredGrid: MeasuredGridLabels;\n feedbackAttachment: FeedbackAttachmentFieldLabels;\n /** 0.12.0: `FeedbackDialog`'s own strings; `FeedbackThread` / `FeedbackComposer`. */\n feedbackDialog: FeedbackDialogTextLabels;\n feedbackThread: FeedbackThreadLabels;\n feedbackComposer: FeedbackComposerLabels;\n /** 0.27.0: the feedback harmonisation (docs/feedback-harmonization.md §4) — a report's\n * status and category words, keyed by the enum value; the toasts a feedback page\n * shows; `FeedbackMenu`; `FeedbackContextBox`; the two pages' table; the row detail.\n * keksdose's wording is the canon, in every language. */\n feedbackStatus: FeedbackStatusLabels;\n feedbackCategory: FeedbackCategoryLabels;\n feedbackToast: FeedbackToastLabels;\n feedbackMenu: FeedbackMenuLabels;\n /** 0.38.0: the public feedback pages — `FeedbackPublicList`, `FeedbackPublicDetail`,\n * `FeedbackPublicSwitch` (docs/feedback-harmonization.md §9.15). */\n feedbackPublic: FeedbackPublicLabels;\n /** 0.38.0: `useFeedbackNotificationTypes` — the two feedback types' setting words\n * (§9.11). */\n feedbackNotificationTypes: FeedbackNotificationTypesLabels;\n feedbackContext: FeedbackContextLabels;\n feedbackPage: FeedbackPageLabels;\n feedbackDetail: FeedbackDetailLabels;\n /** 0.38.0: public feedback (docs/feedback-harmonization.md §9.15) — the vote button,\n * the comment thread, the replies' timeline and composer. */\n feedbackVote: FeedbackVoteLabels;\n feedbackComments: FeedbackCommentsLabels;\n feedbackReplies: FeedbackRepliesLabels;\n /** 0.12.0: `ProfileSetting`, `PasswordSetting`, `TwoFactorSetting`, `PasskeysSetting`\n * — one record per section. The provider takes a whole section record; the\n * components merge it key by key, as a prop. */\n accountSettings: AccountSettingsLabels;\n confirmDialog: ConfirmDialogLabels;\n floatingPanel: FloatingPanelLabels;\n copyButton: CopyButtonLabels;\n bulkActionBar: BulkActionBarLabels;\n list: ListLabels;\n breadcrumbs: BreadcrumbsLabels;\n toast: ToastLabels;\n form: FormActionsLabels;\n descriptionList: DescriptionListLabels;\n lineItems: LineItemsLabels;\n progressBar: ProgressBarLabels;\n signedAmount: SignedAmountLabels;\n errorBoundary: ErrorBoundaryLabels;\n authedImage: AuthedImageLabels;\n imageGrid: ImageGridLabels;\n lightbox: LightboxLabels;\n /** 0.18.0: `WriteLockProvider`'s fallback reason, `AccountStateChip`, `SharePanel` /\n * `ShareCard` / `ShareDialog`, `ReauthDialog`. */\n writeLock: WriteLockLabels;\n accountState: AccountStateLabels;\n shareCard: ShareCardLabels;\n reauthDialog: ReauthDialogLabels;\n /** 0.18.0: `ServerWakeNotice` — keksdose's cold-start notice, for every app. */\n serverWake: ServerWakeLabels;\n /** 0.19.0: the translation-review parts (`TranslationReviewPanel`, its editor, chip,\n * progress, locale tabs and export) — keksdose's /translations, for every app. */\n translationReview: TranslationReviewLabels;\n /** 0.19.0: `LegalLinks`' navigation name. 0.28.0: every kit-owned word of the legal\n * pages — the link labels, titles, back link, terms checkbox and notices, and the\n * sections that are the same in every app, filled in with the app's operator\n * (docs/legal-harmonization.md §4.3/§4.4). */\n legal: LegalLabels;\n /** 0.29.0: sign-in form: credentials, passkey, 2FA, forced new password (docs/auth-harmonization.md §5). */\n signIn: SignInLabels;\n /** 0.29.0: the sign-up form, with the +app address tag (§4.1, §4.5). */\n register: RegisterLabels;\n /** 0.29.0: asking a migrated account for first and last name once (§3.3). */\n completeName: CompleteNameLabels;\n /** 0.29.0: requesting a reset link (always the same answer). */\n forgotPassword: ForgotPasswordLabels;\n /** 0.29.0: choosing a new password from a reset link; not a sign-in (§6.3). */\n resetPassword: ResetPasswordLabels;\n /** 0.29.0: the verify-email page and the unverified banner. */\n verifyEmail: VerifyEmailLabels;\n /** 0.29.0: the 404 page. */\n notFound: NotFoundLabels;\n /** 0.29.0: accepting an invitation with an account (§4.4). */\n acceptInvitation: AcceptInvitationLabels;\n /** 0.29.0: kastlan's switcher between a user's companies (§5.3). */\n companySwitcher: CompanySwitcherLabels;\n /** 0.30.0: changing the account's address with re-verification (docs/user-admin-harmonization.md §6.2). */\n emailChange: EmailChangeLabels;\n /** 0.30.0: sign out everywhere, and kastlan's device list (§6.3). */\n sessions: SessionsLabels;\n /** 0.30.0: deletion in two stages (§6.4). */\n deleteAccount: DeleteAccountLabels;\n /** 0.30.0: the self-service JSON export (§6.5). */\n dataExport: DataExportLabels;\n /** 0.30.0: the admin user list's columns (§3). */\n userRoster: UserRosterLabels;\n /** 0.30.0: picking one or several roles, with the reasons a choice is locked (§4.1). */\n roleSelect: RoleSelectLabels;\n /** 0.30.0: a translation reviewer's languages and areas. */\n reviewerScope: ReviewerScopeLabels;\n /** 0.30.0: an admin action's confirmation and refusals (§4.2). */\n adminAction: AdminActionLabels;\n /** 0.30.0: the admin_actions list (§4.3). */\n adminActionLog: AdminActionLogLabels;\n /** 0.30.0: handing an account's work to another (Kurvenschmiede). */\n transferOwnership: TransferOwnershipLabels;\n /** 0.30.0: the invitations panel (§5). */\n invitations: InvitationsLabels;\n /** 0.31.0: the settings and admin pages' shell (docs/settings-harmonization.md §4.3). */\n settings: SettingsLabels;\n /** 0.31.0: the public landing page's kit words (docs/landing-demo-harmonization.md §4). */\n landing: LandingLabels;\n /** 0.31.0: the demo's start, banner and end (§5). */\n demo: DemoLabels;\n /** 0.32.0: plans, standing, banners and the limit notice (docs/billing-harmonization.md §7). */\n billing: BillingLabels;\n /** 0.33.0: the operator's plan parts — `planColumn`, `PlanChangeConfirm` and the\n * lines of `usePlanChangeResult` (docs/billing-harmonization.md §14.12). */\n planChange: PlanChangeLabels;\n /** 0.32.0: the text-size and contrast settings (docs/text-size-harmonization.md §6). */\n appearance: AppearanceLabels;\n /** 0.36.0: resetting this device's settings, the appearance group's last card\n * (docs/settings-harmonization.md §11.3). */\n deviceReset: DeviceResetLabels;\n /** 0.32.0: a row's actions folded into a \"⋯\" menu at Large (text size §10.8). */\n rowActions: RowActionsLabels;\n /** 0.32.0: the phone bar's \"More\" cell and sheet (text size §10.7). */\n appShellMore: AppShellMoreLabels;\n /** 0.22.0: the screen-reader words of `Input` / `Textarea`'s `showCount` counter. */\n characterCount: CharacterCountLabels;\n /** 0.22.0: `CountrySelect`. Its list's \"no results\" and counts are `combobox`'s. */\n countrySelect: CountrySelectLabels;\n /** 0.22.0: `InlineEditField` — keksdose K9. */\n inlineEdit: InlineEditLabels;\n /** 0.22.0: `IbanInput`'s messages, one per problem. */\n ibanInput: IbanInputLabels;\n /** 0.22.0: `PhoneInput`'s country-code select. */\n phoneInput: PhoneInputLabels;\n /** 0.22.0: `SignChip` — the outflow / inflow toggle beside an amount. */\n signChip: SignChipLabels;\n /** 0.23.0: `ColumnMapper` / `ColumnRoleTable` — a pasted or dropped table, a role per\n * column. */\n columnMapper: ColumnMapperLabels;\n /** 0.36.0: the notification cards — the types, quiet hours and the zone picker, this\n * device's push, the device list, and the unsubscribe page\n * (docs/notifications-harmonization.md §4.2). */\n notifications: NotificationsLabels;\n /** 0.42.0: the admin area's shared words — the account menu's \"Administration\" row, the\n * 403 page, the shared sections, the overview's tiles and the Tools list\n * (docs/admin-harmonization.md §3.1). */\n adminArea: AdminAreaLabels;\n /** 0.42.0: the top bar's shared parts — `TourMenu`, `SyncStatusIndicator`, `DevSwitchers`\n * (docs/top-bar-harmonization.md §3.1). */\n topBarParts: TopBarPartsLabels;\n /** 0.45.0: \"Send a test mail to me\" (docs/admin-harmonization.md §9.2.4). */\n mailTestCard: MailTestCardLabels;\n /** 0.45.0: the sign-out question while changes wait to sync (`@eifi1/ui-kit/offline`,\n * docs/local-first-harmonization.md §1.6). */\n signOutPending: SignOutPendingDialogLabels;\n /** 0.45.0: the service-worker update toast (local-first §1.5 D8). */\n pwaUpdate: PwaUpdatePromptLabels;\n /** 0.45.0: \"This is a shared computer\" on the sign-in form (local-first §1.5 D6). */\n sharedComputer: SharedComputerLabels;\n}\n\n/**\n * A label override, as deep as the labels go: an object of labels (a namespace, or a\n * record inside one such as `accountSettings.passkeys` or `dataTable.presets`) may be\n * partial at every level, because the provider merges it key by key at every level.\n * A leaf stays as it is: a string, a function-valued label (`(n) => …`), and anything\n * that is not purely an object (a `ReactNode` union) is given whole.\n */\nexport type LabelOverride<T> = [T] extends [(...args: never[]) => unknown]\n ? T\n : [T] extends [readonly unknown[]]\n ? T\n : [T] extends [object]\n ? { [K in keyof T]?: LabelOverride<T[K]> }\n : T;\n\n/** Any subset of the tree — each namespace may be partial, and so may any record\n * inside one (`accountSettings.passkeys`, `dataTable.presets`): they are merged key\n * by key, at every depth. */\nexport type UiKitLabelOverrides = { [K in keyof UiKitLabels]?: LabelOverride<UiKitLabels[K]> };\n\n/* ── English defaults for the namespaces defined here ────────────────────── */\n\n// They live in ./shared-labels, a module of words, as every component's defaults live in\n// its `*-labels.ts` (round 0.34). Imported and exported as this module's own, as each\n// component does with its defaults: the names, and where the README lists them, stay.\nexport {\n DEFAULT_APP_SHELL_LABELS,\n DEFAULT_CALCULATOR_LABELS,\n DEFAULT_COMBOBOX_LABELS,\n DEFAULT_COMMON_LABELS,\n DEFAULT_CURRENCY_LABELS,\n DEFAULT_DATE_PICKER_LABELS,\n DEFAULT_FILE_LABELS,\n DEFAULT_MULTI_SELECT_LABELS,\n DEFAULT_PICKER_SHEET_LABELS,\n DEFAULT_SWIPEABLE_ROW_LABELS,\n DEFAULT_TOP_BAR_LABELS,\n formatFileSize,\n};\n\n/* ── The provider ────────────────────────────────────────────────────────── */\n\ninterface KitI18n {\n labels?: UiKitLabelOverrides;\n locale?: string;\n weekStartsOn?: WeekDay;\n linkComponent?: KitLinkComponent;\n chartTooltipPlacement?: ChartTooltipPlacement;\n formatDate?: KitDateFormatter;\n tableStorageKeyPrefix?: string;\n timeZone?: string;\n}\n\n/** What a {@link KitDateFormatter} is told about the date it is formatting. */\nexport interface KitDateFormatContext {\n /**\n * How much of a date the string is: `\"day\"` — the `iso` is `\"YYYY-MM-DD\"`; `\"month\"` —\n * `\"YYYY-MM\"` (a `MonthPicker`); `\"year\"` — `\"YYYY\"` (`MonthPicker mode=\"year\"`).\n */\n unit: \"day\" | \"month\" | \"year\";\n /** Which kit surface asks: the trigger of a `DatePicker`, of a `DateRangePicker`\n * (called once per end), of a `MonthPicker`, or a `DateMark`. */\n source: \"datePicker\" | \"dateRangePicker\" | \"monthPicker\" | \"dateMark\";\n /** The locale the kit would have formatted in — the component's `locale` prop, else\n * the provider's — or `undefined` for the runtime's. */\n locale: string | undefined;\n /**\n * The kit's suggestion: whether this date stands alone where the day of the week\n * helps — `true` for a `DatePicker`'s trigger and a `DateMark`, `false` for the two\n * ends of a range (twice the width, in a sentence-like \"from – to\") and for a month\n * or a year. keksdose's rule, which this follows: *\"A date in a COLUMN carries the\n * weekday. A date in a SENTENCE does not.\"* (date-cell.tsx, dev#546). A formatter\n * is free to ignore it.\n */\n weekday: boolean;\n}\n\n/**\n * The app's ONE answer to \"what does a date look like here\" — keksdose K12. Returns the\n * text for an ISO date (see {@link KitDateFormatContext.unit} for the three shapes).\n * Return `\"\"` to fall back to the kit's own formatting for that date.\n */\nexport type KitDateFormatter = (iso: string, context: KitDateFormatContext) => string;\n\n/** Where a chart shows the values under the pointer — see `SeriesChartTooltip.placement`. */\nexport type ChartTooltipPlacement = \"cursor\" | \"above\" | \"below\" | \"auto\";\n\n/**\n * What every kit link receives: the anchor attributes the kit decided (href, class,\n * aria-current, handlers, children, ref). An app's router link maps them —\n * `({ href, ...p }) => <Link to={href} {...p} />` — ONCE, on the provider.\n *\n * `replace` is the one prop that is not an anchor attribute: see there. Map it\n * explicitly if your router link is not react-router's —\n * `({ href, replace, ...p }) => <Link to={href} replace={replace} {...p} />` — and never\n * spread it onto a DOM `<a>`, where React warns about an unknown attribute.\n */\nexport type KitLinkProps = AnchorHTMLAttributes<HTMLAnchorElement> & {\n href: string;\n ref?: Ref<HTMLAnchorElement>;\n /**\n * Navigate by REPLACING the current history entry, so Back skips it — keksdose F1:\n * a one-shot URL (a magic-link landing, `?checkout=done`, a wizard's \"finish\" hop)\n * that must not come back when the user presses Back. Present ONLY when the kit link\n * was given `replace` (`true`), so a provider link that spreads its props onto a\n * plain `<a>` keeps working for every link that never asks for it. react-router's\n * `<Link>` takes the same prop, so `({ href, ...p }) => <Link to={href} {...p} />`\n * honours it with no change; any other router maps it to its own replace option.\n * The kit never puts it on a DOM element itself.\n */\n replace?: boolean;\n};\nexport type KitLinkComponent = (props: KitLinkProps) => ReactElement;\n\nconst KitI18nContext = createContext<KitI18n>({});\n\nexport interface UiKitProviderProps {\n /** Any part of {@link UiKitLabels}. Missing keys fall back to English. */\n labels?: UiKitLabelOverrides;\n /**\n * BCP 47 tag used by every kit component that formats something — dates, numbers,\n * month and weekday names, file sizes — when it is not handed a `locale` prop of\n * its own. Without a provider, and without a prop, those use the runtime default.\n */\n locale?: string;\n /**\n * The first day of the week (0 = Sunday, 1 = Monday …) for every calendar below —\n * `MiniCalendar` and the pickers built on it — that is not handed a `weekStartsOn`\n * of its own. Without it the week start follows `locale`'s week info.\n *\n * Separate from `locale` because the two are separate decisions: a German-built\n * app running in English (`locale=\"en\"`) would otherwise start its weeks on Sunday,\n * and switching it to `en-GB` to get Monday changes every date and number format.\n */\n weekStartsOn?: WeekDay;\n /**\n * The app's router link, used by every kit component that renders an in-app link\n * and was not handed its own `renderLink` — so `renderLink` stops being repeated on\n * each ListItem, Breadcrumbs, StatTile, Chip… (kastlan). A component's own\n * `renderLink` wins; external links and in-page `#anchor`s stay plain `<a>`, and a\n * hash-router `#/path` is handed to it like `/path` (see `pickLinkRenderer`).\n */\n linkComponent?: KitLinkComponent;\n /**\n * Where every `SeriesChart` below shows its tooltip when it does not say so itself\n * (`tooltip.placement`) — set once so an app's phone charts stop putting the box under\n * the reader's finger (keksdose #359). Default: `\"cursor\"`, the box that follows the\n * pointer, as before.\n */\n chartTooltipPlacement?: ChartTooltipPlacement;\n /**\n * How every kit date below is written, when the component is not told otherwise —\n * keksdose K12. keksdose has a date-format preference (Settings ▸ date format, feedback\n * #180) that is not the UI language, and a weekday in the UI language beside digits\n * in the preference's order (live #246, dev#546): two locales in one string, which\n * no `locale` + `Intl` options can say. Its `DateField` wraps every `DatePicker` to\n * pass `formatValue`, and its report range field formats both ends by hand; with this\n * set once on the provider, those wrappers thin to nothing.\n *\n * Used for the trigger text of `DatePicker`, `DateRangePicker` and `MonthPicker`\n * (month and year mode), and for `DateMark display=\"date\"`. A component's own\n * `formatValue` or `formatOptions` (`dateStyle` on a DateMark) wins: prop >\n * provider > the kit's `Intl` default, the order every kit setting resolves in. Left\n * out (or returning `\"\"`), everything formats exactly as before.\n *\n * Keep it stable (`useCallback`, or a module function): it is in the provider's\n * context value, so a new function every render re-renders every consumer.\n */\n formatDate?: KitDateFormatter;\n /**\n * The `localStorage` prefix every kit table below keeps its view under (sort, filters,\n * page size, widths, hidden columns), when the table is not handed a\n * `storageKeyPrefix` of its own — round 0.34 C5, KS U4. Left out, it is the kit's\n * `\"hbui-table:\"`, as before.\n *\n * Set once here rather than per table because not every table is the app's to pass a\n * prop to: `TranslationReviewPanel` wraps a `DataTable`, and until this the panel's\n * view landed under the kit's prefix whatever the app's was — so an app that lists\n * what it stores (a privacy page) had to list the kit's prefix as a key of its own.\n * Resolves like every kit setting: the table's own prop > this > the default. The\n * key is the prefix plus the table's `storageKey`, verbatim, so an app that wrapped\n * `DataTable` to pass its prefix (Keksdose's `keksdose-table:`) keeps every stored\n * view when it moves the prefix here.\n */\n tableStorageKeyPrefix?: string;\n /**\n * 0.46 (docs/notifications-harmonization.md §10.3): the IANA zone (\"Europe/Zurich\") every\n * TIMESTAMP below is shown in through `useKitFormat().formatDate` /\n * `formatRelativeTime`, when the call names none — the account's picked zone, for an app\n * that shows times in it. A bare \"YYYY-MM-DD\" is never shifted (a calendar day is the day\n * it names in every zone). Left out, timestamps follow the device, as before.\n */\n timeZone?: string;\n children: ReactNode;\n}\n\n/**\n * Hand every kit component below this point its strings and its locale.\n *\n * Optional: a component outside any provider behaves exactly as it did before the\n * provider existed. Nesting works as a merge — an inner provider overrides only what\n * it names, so a page can re-label one table's `dataTable.table` without restating\n * the language.\n */\nexport function UiKitProvider({\n labels,\n locale,\n weekStartsOn,\n linkComponent,\n chartTooltipPlacement,\n formatDate,\n tableStorageKeyPrefix,\n timeZone,\n children,\n}: UiKitProviderProps) {\n const outer = useContext(KitI18nContext);\n const value = useMemo<KitI18n>(\n () => ({\n locale: locale ?? outer.locale,\n weekStartsOn: weekStartsOn ?? outer.weekStartsOn,\n labels: mergeOverrides(outer.labels, labels),\n linkComponent: linkComponent ?? outer.linkComponent,\n chartTooltipPlacement: chartTooltipPlacement ?? outer.chartTooltipPlacement,\n formatDate: formatDate ?? outer.formatDate,\n tableStorageKeyPrefix: tableStorageKeyPrefix ?? outer.tableStorageKeyPrefix,\n timeZone: timeZone ?? outer.timeZone,\n }),\n [outer, labels, locale, weekStartsOn, linkComponent, chartTooltipPlacement, formatDate, tableStorageKeyPrefix, timeZone],\n );\n useTableViewsJoin(value.tableStorageKeyPrefix ?? DEFAULT_TABLE_STORAGE_KEY_PREFIX);\n return <KitI18nContext.Provider value={value}>{children}</KitI18nContext.Provider>;\n}\n\n/** The kit's own table prefix: `DEFAULT_PERSIST_PREFIX` of components/use-table-state,\n * restated because that module imports the router (a test pins the two equal). */\nconst DEFAULT_TABLE_STORAGE_KEY_PREFIX = \"hbui-table:\";\n\n/**\n * Reset this device's settings (docs/settings-harmonization.md §11.4): the tables below a\n * provider keep their views under its prefix, so the provider joins the registry with\n * that prefix — a view, no `reset`, since a table reads its view when it next mounts —\n * while it is mounted. Nested providers with one prefix hold one entry.\n *\n * Through a literal `import()`, not a static import: every catalogue reaches this module,\n * and a catalogue may reach nothing outside i18n/ (scripts/check-module-graph.mjs,\n * english-catalogue-graph.test.ts). The theme stores and the shell import the registry\n * statically, so it is loaded already and the join lands a microtask after the mount.\n */\nfunction useTableViewsJoin(prefix: string): void {\n useEffect(() => {\n let leave: (() => void) | undefined;\n let gone = false;\n import(\"../lib/device-settings\").then(\n ({ registerDeviceSetting }) => {\n if (!gone) leave = registerDeviceSetting({ key: prefix, prefix: true, kind: \"view\" });\n },\n // A module of the kit's own that fails to load has nothing to join; the provider\n // and its tables work as before.\n () => undefined,\n );\n return () => {\n gone = true;\n leave?.();\n };\n }, [prefix]);\n}\n\nfunction isRecord(v: unknown): v is Record<string, unknown> {\n return typeof v === \"object\" && v !== null && !Array.isArray(v);\n}\n\n/** A record of labels to merge into — not a React element, which is an object too but\n * is a label given whole. */\nfunction isLabelRecord(v: unknown): v is Record<string, unknown> {\n return isRecord(v) && !(\"$$typeof\" in v);\n}\n\n/** Merged key by key at EVERY depth — a namespace, a record inside it\n * (`accountSettings.passkeys`, `dataTable.presets`), and so on down — to match\n * {@link LabelOverride}. An `undefined` is skipped at every depth, so it never blanks\n * out what is under it. */\nfunction mergeNamespace<T extends object>(base: T, over: LabelOverride<T> | Partial<T> | undefined): T {\n if (!over) return base;\n const out = { ...base } as Record<string, unknown>;\n for (const [k, v] of Object.entries(over)) {\n if (v === undefined) continue;\n const prev = out[k];\n out[k] = isLabelRecord(prev) && isLabelRecord(v) ? mergeNamespace(prev, v) : v;\n }\n return out as T;\n}\n\nfunction mergeOverrides(\n a: UiKitLabelOverrides | undefined,\n b: UiKitLabelOverrides | undefined,\n): UiKitLabelOverrides | undefined {\n if (!a) return b;\n if (!b) return a;\n const out: Record<string, unknown> = { ...a };\n for (const [ns, v] of Object.entries(b)) {\n out[ns] = mergeNamespace((out[ns] as object | undefined) ?? {}, v as object);\n }\n return out as UiKitLabelOverrides;\n}\n\n/**\n * What the nearest provider says about one namespace — `undefined` outside one. Nested\n * providers' words come merged, at every depth; no English default is filled in.\n *\n * A {@link LabelOverride}, partial at every depth, like the components' `labels` props\n * that take it: a provider that names one key of a section (`accountSettings.passkeys`)\n * or one preset (`dataTable.presets`) hands over just that (round 0.35 R3 — until then\n * it was typed partial at the top only, so a nested section read as complete).\n *\n * For a component whose own resolver does more than a merge (the data table derives\n * `columnsCount` from `columns`): merge the component's prop over it — a record key by\n * key — and feed the result to that resolver.\n */\nexport function useKitLabelOverrides<K extends keyof UiKitLabels>(\n ns: K,\n): LabelOverride<UiKitLabels[K]> | undefined {\n return useContext(KitI18nContext).labels?.[ns];\n}\n\n/**\n * One namespace, resolved: `defaults`, then the provider, then the component's own\n * `prop`. Record-valued keys are merged key by key at each step — so `prop` is a\n * {@link LabelOverride}, partial at every depth as the provider's labels are, and a\n * component's `labels` prop, typed the same, is handed over without a cast (refactor\n * audit 2026-10, API-9).\n */\nexport function useKitLabels<K extends keyof UiKitLabels>(\n ns: K,\n defaults: UiKitLabels[K],\n prop?: LabelOverride<UiKitLabels[K]>,\n): UiKitLabels[K] {\n const fromProvider = useKitLabelOverrides(ns);\n return useMemo(\n () => mergeNamespace(mergeNamespace(defaults, fromProvider), prop),\n [defaults, fromProvider, prop],\n );\n}\n\n/** The component's own `locale` prop, else the provider's, else `undefined` (which\n * every `Intl` API reads as \"the runtime's default\"). */\nexport function useKitLocale(prop?: string): string | undefined {\n const fromProvider = useContext(KitI18nContext).locale;\n return prop ?? fromProvider;\n}\n\n/** The week start the nearest `<UiKitProvider weekStartsOn>` pins, else `undefined`\n * (the caller then asks the locale). A component's own prop goes first:\n * `prop ?? useKitWeekStart()`. */\n/** The provider's router link, or `undefined` — a component's own `renderLink` should\n * win over it: `const Link = renderLink ?? useKitLink()`. */\nexport function useKitLink(): KitLinkComponent | undefined {\n return useContext(KitI18nContext).linkComponent;\n}\n\nexport function useKitWeekStart(): WeekDay | undefined {\n return useContext(KitI18nContext).weekStartsOn;\n}\n\n/** The provider's `chartTooltipPlacement`, or `undefined` — a chart's own prop wins. */\nexport function useKitChartTooltipPlacement(): ChartTooltipPlacement | undefined {\n return useContext(KitI18nContext).chartTooltipPlacement;\n}\n\n/** The nearest provider's `formatDate`, or `undefined` — a component's own\n * `formatValue` / `formatOptions` wins over it. See {@link KitDateFormatter}. */\nexport function useKitDateFormatter(): KitDateFormatter | undefined {\n return useContext(KitI18nContext).formatDate;\n}\n\n/** The nearest provider's `tableStorageKeyPrefix`, or `undefined` — a table's own\n * `storageKeyPrefix` wins over it, and the kit's `\"hbui-table:\"` comes after both. */\nexport function useKitTableStorageKeyPrefix(): string | undefined {\n return useContext(KitI18nContext).tableStorageKeyPrefix;\n}\n\n/** The nearest provider's `timeZone` (0.46), or `undefined` — the device's. A call's own\n * `timeZone` wins over it. */\nexport function useKitTimeZone(): string | undefined {\n return useContext(KitI18nContext).timeZone;\n}\n\n/** {@link DEFAULT_FILE_LABELS}, but formatting in the provider's locale. */\nexport function useKitFileLabels(prop?: Partial<FileLabels>): FileLabels {\n const locale = useKitLocale();\n const defaults = useMemo<FileLabels>(\n () => ({ size: (bytes) => formatFileSize(bytes, locale) }),\n [locale],\n );\n return useKitLabels(\"file\", defaults, prop);\n}\n\n/**\n * The dot paths of every key `labels` does NOT supply — the ones a translated app is\n * still showing in English. Assert on it in the app's own test:\n *\n * expect(missingKitLabels(labels, DEFAULT_UI_KIT_LABELS)).toEqual([]);\n *\n * `reference` is the complete tree to check against — pass\n * {@link DEFAULT_UI_KIT_LABELS} (src/i18n/defaults.ts). It is a parameter rather than an import\n * because the defaults live beside their components, and this module is imported BY\n * those components. Left out (a test file is not type-checked), it throws saying so\n * rather than \"Cannot convert undefined or null to object\" (keksdose, 0.18).\n */\nexport function missingKitLabels(\n labels: UiKitLabelOverrides | undefined,\n reference: UiKitLabels,\n): string[] {\n if (!isRecord(reference)) {\n throw new TypeError(\n \"missingKitLabels(labels, reference): pass DEFAULT_UI_KIT_LABELS as the reference — \" +\n \"it is the tree the labels are checked against.\",\n );\n }\n const missing: string[] = [];\n for (const [ns, keys] of Object.entries(reference)) {\n const given = (labels as Record<string, Record<string, unknown> | undefined> | undefined)?.[ns];\n for (const [key, value] of Object.entries(keys as Record<string, unknown>)) {\n const got = given?.[key];\n if (got === undefined) {\n missing.push(`${ns}.${key}`);\n } else if (isRecord(value) && isRecord(got)) {\n for (const sub of Object.keys(value)) {\n if (got[sub] === undefined) missing.push(`${ns}.${key}.${sub}`);\n }\n }\n }\n }\n return missing;\n}\n"],"mappings":";AAkuBS;AAluBT,SAAS,eAAe,YAAY,WAAW,eAAe;AAC9D;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAgmBP,MAAM,iBAAiB,cAAuB,CAAC,CAAC;AA0FzC,SAAS,cAAc;AAAA,EAC5B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAuB;AACrB,QAAM,QAAQ,WAAW,cAAc;AACvC,QAAM,QAAQ;AAAA,IACZ,OAAO;AAAA,MACL,QAAQ,UAAU,MAAM;AAAA,MACxB,cAAc,gBAAgB,MAAM;AAAA,MACpC,QAAQ,eAAe,MAAM,QAAQ,MAAM;AAAA,MAC3C,eAAe,iBAAiB,MAAM;AAAA,MACtC,uBAAuB,yBAAyB,MAAM;AAAA,MACtD,YAAY,cAAc,MAAM;AAAA,MAChC,uBAAuB,yBAAyB,MAAM;AAAA,MACtD,UAAU,YAAY,MAAM;AAAA,IAC9B;AAAA,IACA,CAAC,OAAO,QAAQ,QAAQ,cAAc,eAAe,uBAAuB,YAAY,uBAAuB,QAAQ;AAAA,EACzH;AACA,oBAAkB,MAAM,yBAAyB,gCAAgC;AACjF,SAAO,oBAAC,eAAe,UAAf,EAAwB,OAAe,UAAS;AAC1D;AAIA,MAAM,mCAAmC;AAazC,SAAS,kBAAkB,QAAsB;AAC/C,YAAU,MAAM;AACd,QAAI;AACJ,QAAI,OAAO;AACX,WAAO,wBAAwB,EAAE;AAAA,MAC/B,CAAC,EAAE,sBAAsB,MAAM;AAC7B,YAAI,CAAC,KAAM,SAAQ,sBAAsB,EAAE,KAAK,QAAQ,QAAQ,MAAM,MAAM,OAAO,CAAC;AAAA,MACtF;AAAA;AAAA;AAAA,MAGA,MAAM;AAAA,IACR;AACA,WAAO,MAAM;AACX,aAAO;AACP,cAAQ;AAAA,IACV;AAAA,EACF,GAAG,CAAC,MAAM,CAAC;AACb;AAEA,SAAS,SAAS,GAA0C;AAC1D,SAAO,OAAO,MAAM,YAAY,MAAM,QAAQ,CAAC,MAAM,QAAQ,CAAC;AAChE;AAIA,SAAS,cAAc,GAA0C;AAC/D,SAAO,SAAS,CAAC,KAAK,EAAE,cAAc;AACxC;AAMA,SAAS,eAAiC,MAAS,MAAoD;AACrG,MAAI,CAAC,KAAM,QAAO;AAClB,QAAM,MAAM,EAAE,GAAG,KAAK;AACtB,aAAW,CAAC,GAAG,CAAC,KAAK,OAAO,QAAQ,IAAI,GAAG;AACzC,QAAI,MAAM,OAAW;AACrB,UAAM,OAAO,IAAI,CAAC;AAClB,QAAI,CAAC,IAAI,cAAc,IAAI,KAAK,cAAc,CAAC,IAAI,eAAe,MAAM,CAAC,IAAI;AAAA,EAC/E;AACA,SAAO;AACT;AAEA,SAAS,eACP,GACA,GACiC;AACjC,MAAI,CAAC,EAAG,QAAO;AACf,MAAI,CAAC,EAAG,QAAO;AACf,QAAM,MAA+B,EAAE,GAAG,EAAE;AAC5C,aAAW,CAAC,IAAI,CAAC,KAAK,OAAO,QAAQ,CAAC,GAAG;AACvC,QAAI,EAAE,IAAI,eAAgB,IAAI,EAAE,KAA4B,CAAC,GAAG,CAAW;AAAA,EAC7E;AACA,SAAO;AACT;AAeO,SAAS,qBACd,IAC2C;AAC3C,SAAO,WAAW,cAAc,EAAE,SAAS,EAAE;AAC/C;AASO,SAAS,aACd,IACA,UACA,MACgB;AAChB,QAAM,eAAe,qBAAqB,EAAE;AAC5C,SAAO;AAAA,IACL,MAAM,eAAe,eAAe,UAAU,YAAY,GAAG,IAAI;AAAA,IACjE,CAAC,UAAU,cAAc,IAAI;AAAA,EAC/B;AACF;AAIO,SAAS,aAAa,MAAmC;AAC9D,QAAM,eAAe,WAAW,cAAc,EAAE;AAChD,SAAO,QAAQ;AACjB;AAOO,SAAS,aAA2C;AACzD,SAAO,WAAW,cAAc,EAAE;AACpC;AAEO,SAAS,kBAAuC;AACrD,SAAO,WAAW,cAAc,EAAE;AACpC;AAGO,SAAS,8BAAiE;AAC/E,SAAO,WAAW,cAAc,EAAE;AACpC;AAIO,SAAS,sBAAoD;AAClE,SAAO,WAAW,cAAc,EAAE;AACpC;AAIO,SAAS,8BAAkD;AAChE,SAAO,WAAW,cAAc,EAAE;AACpC;AAIO,SAAS,iBAAqC;AACnD,SAAO,WAAW,cAAc,EAAE;AACpC;AAGO,SAAS,iBAAiB,MAAwC;AACvE,QAAM,SAAS,aAAa;AAC5B,QAAM,WAAW;AAAA,IACf,OAAO,EAAE,MAAM,CAAC,UAAU,eAAe,OAAO,MAAM,EAAE;AAAA,IACxD,CAAC,MAAM;AAAA,EACT;AACA,SAAO,aAAa,QAAQ,UAAU,IAAI;AAC5C;AAcO,SAAS,iBACd,QACA,WACU;AACV,MAAI,CAAC,SAAS,SAAS,GAAG;AACxB,UAAM,IAAI;AAAA,MACR;AAAA,IAEF;AAAA,EACF;AACA,QAAM,UAAoB,CAAC;AAC3B,aAAW,CAAC,IAAI,IAAI,KAAK,OAAO,QAAQ,SAAS,GAAG;AAClD,UAAM,QAAS,SAA6E,EAAE;AAC9F,eAAW,CAAC,KAAK,KAAK,KAAK,OAAO,QAAQ,IAA+B,GAAG;AAC1E,YAAM,MAAM,QAAQ,GAAG;AACvB,UAAI,QAAQ,QAAW;AACrB,gBAAQ,KAAK,GAAG,EAAE,IAAI,GAAG,EAAE;AAAA,MAC7B,WAAW,SAAS,KAAK,KAAK,SAAS,GAAG,GAAG;AAC3C,mBAAW,OAAO,OAAO,KAAK,KAAK,GAAG;AACpC,cAAI,IAAI,GAAG,MAAM,OAAW,SAAQ,KAAK,GAAG,EAAE,IAAI,GAAG,IAAI,GAAG,EAAE;AAAA,QAChE;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACA,SAAO;AACT;","names":[]}
1
+ {"version":3,"sources":["../../src/i18n/kit-labels.tsx"],"sourcesContent":["import { createContext, useContext, useEffect, useMemo } from \"react\";\nimport {\n DEFAULT_APP_SHELL_LABELS,\n DEFAULT_CALCULATOR_LABELS,\n DEFAULT_COMBOBOX_LABELS,\n DEFAULT_COMMON_LABELS,\n DEFAULT_CURRENCY_LABELS,\n DEFAULT_DATE_PICKER_LABELS,\n DEFAULT_FILE_LABELS,\n DEFAULT_MULTI_SELECT_LABELS,\n DEFAULT_PICKER_SHEET_LABELS,\n DEFAULT_SWIPEABLE_ROW_LABELS,\n DEFAULT_TOP_BAR_LABELS,\n formatFileSize,\n} from \"./shared-labels\";\nimport type { AnchorHTMLAttributes, ReactElement, Ref } from \"react\";\nimport type { ReactNode } from \"react\";\nimport type { DataTableLabels } from \"../components/data-table-labels\";\nimport type { MiniCalendarLabels, WeekDay } from \"../components/mini-calendar\";\nimport type { CalendarHeatmapLabels } from \"../components/calendar-heatmap\";\nimport type { PopoverLabels } from \"../components/popover\";\nimport type { ChipInputLabels } from \"../components/chip\";\nimport type { FieldSyncLabels } from \"../components/field-sync\";\nimport type { CharacterCountLabels, PasswordRevealLabels } from \"../components/field-base\";\nimport type { TabsLabels } from \"../components/tabs\";\nimport type { WizardLabels } from \"../wizard/types\";\nimport type { TourLabels } from \"../tour/tour\";\nimport type { TourCatalogueLabels } from \"../tour/tour-catalogue-labels\";\nimport type { CommandPaletteLabels } from \"../search/command-palette\";\nimport type { GlobalSearchLabels } from \"../search/global-search\";\nimport type { MonthPickerLabels } from \"../components/month-picker\";\nimport type { PageContentsLabels } from \"../components/page-contents\";\nimport type { SeriesChartLabels } from \"../components/series-chart-labels\";\nimport type { PieChartLabels } from \"../components/pie-chart-labels\";\nimport type { SparklineLabels } from \"../components/sparkline\";\nimport type { StatTileLabels } from \"../components/stat-tile\";\nimport type { SignaturePadLabels } from \"../components/signature-pad\";\nimport type { PasswordStrengthLabels } from \"../components/password-strength\";\nimport type { DangerConfirmLabels } from \"../components/danger-confirm\";\nimport type { SwatchPickerLabels } from \"../components/swatch-picker\";\nimport type { IconPickerLabels } from \"../components/icon-picker\";\nimport type { DialogFrameLabels } from \"../components/dialog-frame\";\nimport type { FilePickerLabels } from \"../components/file-button\";\nimport type { MeasuredGridLabels } from \"../components/measured-grid\";\nimport type { FeedbackAttachmentFieldLabels } from \"../feedback/feedback-attachment\";\nimport type { FeedbackDialogTextLabels } from \"../feedback/feedback-dialog\";\nimport type { FeedbackComposerLabels, FeedbackThreadLabels } from \"../feedback/feedback-thread\";\nimport type {\n FeedbackCategoryLabels,\n FeedbackStatusLabels,\n FeedbackToastLabels,\n} from \"../feedback/feedback-labels\";\nimport type { FeedbackMenuLabels } from \"../feedback/feedback-menu\";\nimport type { FeedbackPublicLabels } from \"../feedback/feedback-public-labels\";\nimport type { FeedbackNotificationTypesLabels } from \"../notifications/feedback-notification-types-labels\";\nimport type { FeedbackContextLabels } from \"../feedback/feedback-context\";\nimport type { FeedbackPageLabels } from \"../feedback/feedback-table\";\nimport type { FeedbackDetailLabels } from \"../feedback/feedback-row-detail\";\nimport type { FeedbackVoteLabels } from \"../feedback/feedback-vote-button\";\nimport type { FeedbackCommentsLabels } from \"../feedback/feedback-comment-thread\";\nimport type { FeedbackRepliesLabels } from \"../feedback/feedback-replies\";\nimport type { AccountSettingsLabels } from \"../account/account-settings-labels\";\nimport type { ConfirmDialogLabels } from \"../components/confirm-dialog\";\nimport type { FloatingPanelLabels } from \"../components/floating-panel\";\nimport type { CopyButtonLabels } from \"../components/copy-button\";\nimport type { BulkActionBarLabels } from \"../components/bulk-action-bar\";\nimport type { ListLabels } from \"../components/list\";\nimport type { BreadcrumbsLabels } from \"../components/breadcrumbs\";\nimport type { ToastLabels } from \"../components/toast\";\nimport type { FormActionsLabels } from \"../components/form-actions\";\nimport type { DescriptionListLabels } from \"../components/description-list\";\nimport type { LineItemsLabels } from \"../components/line-items\";\nimport type { ProgressBarLabels } from \"../components/progress-bar\";\nimport type { SignedAmountLabels } from \"../components/signed-amount\";\nimport type { ErrorBoundaryLabels } from \"../components/error-boundary\";\nimport type { AuthedImageLabels } from \"../components/authed-image\";\nimport type { ImageGridLabels } from \"../components/image-grid\";\nimport type { LightboxLabels } from \"../components/lightbox\";\nimport type { WriteLockLabels } from \"../components/write-lock\";\nimport type { LegalLabels } from \"../components/legal\";\nimport type { SignInLabels } from \"../auth/sign-in-form\";\nimport type { RegisterLabels } from \"../auth/register-form\";\nimport type { CompleteNameLabels } from \"../auth/complete-name-dialog\";\nimport type { ForgotPasswordLabels } from \"../auth/forgot-password-form\";\nimport type { ResetPasswordLabels } from \"../auth/reset-password-form\";\nimport type { VerifyEmailLabels } from \"../auth/verify-email\";\nimport type { NotFoundLabels } from \"../auth/not-found-page\";\nimport type { AcceptInvitationLabels } from \"../auth/accept-invitation\";\nimport type { CompanySwitcherLabels } from \"../shell/company-switcher\";\nimport type { EmailChangeLabels } from \"../account/email-change-setting\";\nimport type { SessionsLabels } from \"../account/sessions-setting\";\nimport type { DeleteAccountLabels } from \"../account/delete-account-setting\";\nimport type { DataExportLabels } from \"../account/data-export-setting\";\nimport type { UserRosterLabels } from \"../admin/user-roster\";\nimport type { RoleSelectLabels } from \"../admin/role-select\";\nimport type { ReviewerScopeLabels } from \"../admin/reviewer-scope-editor\";\nimport type { AdminActionLabels } from \"../admin/admin-action-confirm\";\nimport type { AdminActionLogLabels } from \"../admin/admin-action-log\";\nimport type { TransferOwnershipLabels } from \"../admin/transfer-ownership-dialog\";\nimport type { InvitationsLabels } from \"../admin/invitations-panel\";\nimport type { SettingsLabels } from \"../settings/settings-labels\";\nimport type { LandingLabels } from \"../landing/landing-labels\";\nimport type { DemoLabels } from \"../demo/demo-labels\";\nimport type { BillingLabels } from \"../billing/billing-labels\";\nimport type { PlanChangeLabels } from \"../admin/plan-change\";\nimport type { AppearanceLabels } from \"../components/appearance-labels\";\nimport type { DeviceResetLabels } from \"../settings/device-reset-setting\";\nimport type { RowActionsLabels } from \"../components/row-actions\";\nimport type { AppShellMoreLabels } from \"../shell/app-shell\";\nimport type { AccountStateLabels } from \"../components/account-chips\";\nimport type { ShareCardLabels } from \"../components/share-card\";\nimport type { ReauthDialogLabels } from \"../components/reauth-dialog\";\nimport type { ServerWakeLabels } from \"../components/server-wake\";\nimport type { TranslationReviewLabels } from \"../components/translation-review-labels\";\nimport type { CountrySelectLabels } from \"../components/country-select\";\nimport type { InlineEditLabels } from \"../components/inline-edit-field\";\nimport type { IbanInputLabels } from \"../components/iban-input\";\nimport type { PhoneInputLabels } from \"../components/phone-input\";\nimport type { SignChipLabels } from \"../components/sign-chip\";\nimport type { ColumnMapperLabels } from \"../components/column-mapper\";\nimport type { NotificationsLabels } from \"../notifications/notifications-labels\";\nimport type { AdminAreaLabels } from \"../admin/admin-area-labels\";\nimport type { MailTestCardLabels } from \"../admin/mail-test-card\";\nimport type { TopBarPartsLabels } from \"../shell/top-bar-parts-labels\";\nimport type { SignOutPendingDialogLabels } from \"../offline/sign-out-pending-dialog\";\nimport type { PwaUpdatePromptLabels } from \"../offline/pwa-update-prompt\";\nimport type { SharedComputerLabels } from \"../offline/shared-computer\";\n\n/**\n * EVERY string the kit renders, as one typed tree — and an optional provider that\n * hands it to every component at once.\n *\n * WHY THIS EXISTS. The kit renders only labels; it ships seven catalogues (since 0.7.0,\n * `@eifi1/ui-kit/i18n/<code>`); the app decides the language and hands the words in.\n * What was wrong was HOW it had to hand them in —\n * one `labels` prop per component instance, under a different prop name per\n * component (`labels`, `calendarLabels`, `passwordLabels`, `clearLabel`,\n * `searchPlaceholder`, `ariaLabel` …). A translated app therefore rendered English\n * wherever one call site forgot one prop, and nothing told it so: a German showcase\n * still said \"Rows per page\", \"Collapse sidebar\" and \"Popover\" in seven languages.\n *\n * Now there is one key per string, addressed by a dot path (`dataTable.pageSize`,\n * `datePicker.today`), and three sources in a fixed order of precedence:\n *\n * the component's own prop > <UiKitProvider labels> > English default\n *\n * A consumer loads a shipped catalogue (`loadUiKitLabels(code)`) or writes its own\n * `UiKitLabels` (or a partial of one), mounts `<UiKitProvider labels={…} locale={…}>`\n * at the root, and every kit component\n * below speaks that language — including the ones nested inside other kit components\n * (the calendar inside the data table's date filter, the popover inside the date\n * picker), which no prop at the outer call site could reach before.\n *\n * Messages that carry a value are FUNCTIONS of that value, never a template to fill:\n * a number glued into an English sentence is untranslatable, because the grammar\n * around it moves with it in most languages.\n */\n\n/* ── Namespaces that had no labels type of their own ─────────────────────── */\n\n/** The words several components share. A component's own namespace wins over these\n * where both exist; these are what a new component reaches for first. */\nexport interface CommonLabels {\n close: string;\n clear: string;\n search: string;\n done: string;\n cancel: string;\n save: string;\n back: string;\n next: string;\n remove: string;\n loading: string;\n noResults: string;\n /** \"Name: value\" — how a field's accessible name is composed with its value.\n * A colon-and-space is not universal punctuation (French puts a space before\n * the colon, Chinese uses a full-width one). */\n fieldValue: (field: string, value: string) => string;\n /** The × that puts away a banner or a notice (`AlertBanner onDismiss`). Not `close`:\n * nothing opened, and \"Close\" on a banner reads as closing the page it sits on. */\n dismiss: string;\n /** Read after a link that opens a new tab (`<Button href external>`, TextLink):\n * nothing else tells a screen reader the page is about to change tabs. */\n opensInNewTab: string;\n /** The name of a field's `help` \"?\" and its panel (round 0.36): \"About “<field>”\", the\n * field's label as the argument, quoted so a capitalised label reads as a name — \"About\n * “Jerk shape”\" (round 0.37; the other locales quoted it already). A `HelpPopover`\n * passed as `help` keeps its own name. */\n aboutField: (field: string) => string;\n /** …and of a `help` \"?\" on a field with no label and no `aria-label` to name it by. */\n help: string;\n /** 0.48: the toggle that shows the rest of a clamped text (`AlertBanner clampMobile`)… */\n showMore: string;\n /** …and folds it back to its one line. */\n showLess: string;\n}\n\n/** `DatePicker` / `DateRangePicker` chrome. The calendar inside has its own\n * namespace, `miniCalendar`. */\nexport interface DatePickerLabels {\n /** Accessible name of the popover panel the calendar opens in. */\n panel: string;\n /** The same, for `DateRangePicker`'s panel. */\n rangePanel: string;\n clear: string;\n previousDay: string;\n nextDay: string;\n today: string;\n /** `DateRangePicker commit=\"apply\"`: the button that commits the drafted range. */\n apply: string;\n /** …and the one that discards it. */\n cancel: string;\n /** Accessible name of `DateRangePicker`'s preset column. */\n presets: string;\n}\n\n/** The whole combobox family: `Combobox`, `EntityCombobox`,\n * `MultiEntityCombobox`, `InlineEntityCombobox`, `Autocomplete`. */\nexport interface ComboboxLabels {\n search: string;\n noResults: string;\n clear: string;\n loading: string;\n /** The \"add this\" row when free entry is allowed. */\n create: (query: string) => string;\n /** Trigger summary once more than one value is picked. */\n selectedCount: (count: number) => string;\n /** An async lookup (`loadOptions`) failed. */\n loadError: string;\n /** Announced (live region) when the list settles on `count` > 0 rows. */\n resultCount: (count: number) => string;\n /** The query is shorter than the `minChars` a lookup needs. */\n minChars: (count: number) => string;\n}\n\nexport interface MultiSelectLabels {\n search: string;\n selectAll: string;\n clear: string;\n /** Trigger text when nothing is picked, which a multi-select reads as \"all\". */\n all: string;\n /** Trigger summary once some (but not all) values are picked. The English\n * default is the bare count, which is what the trigger has always shown. */\n selectedCount: (count: number) => string;\n}\n\n/** `CalculatorButton` (desktop popover keypad) and `NumberPadSheet` (phone sheet). */\nexport interface CalculatorLabels {\n /** The button that opens the calculator. */\n open: string;\n /** The popover / sheet itself. */\n panel: string;\n calculation: string;\n backspace: string;\n clear: string;\n equals: string;\n /** The primary key of the phone pad — visible text, not an aria-label. */\n done: string;\n /** Names of the operator keys and the decimal key. Their glyphs are not names a\n * screen reader agrees on — \"÷\" is read as \"division sign\", \"divided by\" or\n * nothing at all depending on the reader — so each says what it does. */\n plus: string;\n minus: string;\n times: string;\n divide: string;\n decimal: string;\n}\n\n/** `CurrencySelect` and the currency half of `AmountInput`. */\nexport interface CurrencyLabels {\n currency: string;\n search: string;\n}\n\nexport interface AppShellLabels {\n collapse: string;\n expand: string;\n /** Accessible name of an inline group's disclosure button (`subNav=\"inline\"`). */\n toggleGroup: (groupLabel: string) => string;\n}\n\nexport interface TopBarLabels {\n theme: string;\n palette: string;\n language: string;\n /** 0.49 KIT-10: the language menu's trigger, given the current language's name —\n * \"Choose language, current: Deutsch\". */\n languageCurrent: (name: string) => string;\n switchRole: string;\n /** The role switcher's tooltip, given the active role's name. */\n role: (value: string) => string;\n}\n\nexport interface PickerSheetLabels {\n close: string;\n /** The sticky footer button that closes a multi-select sheet once the rows are ticked\n * (0.40) — the ticks are already applied, so it confirms rather than saves. */\n done: string;\n}\n\nexport interface SwipeableRowLabels {\n actions: string;\n}\n\nexport interface FileLabels {\n /** A file size for display, given its size in BYTES. The default uses\n * `Intl.NumberFormat`'s unit formatting in the provider's locale. */\n size: (bytes: number) => string;\n}\n\n/** The complete tree. `UiKitProvider` takes any partial of it. */\nexport interface UiKitLabels {\n common: CommonLabels;\n dataTable: DataTableLabels;\n miniCalendar: MiniCalendarLabels;\n calendarHeatmap: CalendarHeatmapLabels;\n datePicker: DatePickerLabels;\n monthPicker: MonthPickerLabels;\n popover: PopoverLabels;\n combobox: ComboboxLabels;\n multiSelect: MultiSelectLabels;\n calculator: CalculatorLabels;\n currency: CurrencyLabels;\n chipInput: ChipInputLabels;\n fieldSync: FieldSyncLabels;\n passwordReveal: PasswordRevealLabels;\n tabs: TabsLabels;\n appShell: AppShellLabels;\n pageContents: PageContentsLabels;\n topBar: TopBarLabels;\n pickerSheet: PickerSheetLabels;\n swipeableRow: SwipeableRowLabels;\n file: FileLabels;\n wizard: WizardLabels;\n tour: TourLabels;\n /** 0.43.0: the tours page — `TourCatalogue` and its card (docs/tours-harmonization.md §3). */\n tourCatalogue: TourCatalogueLabels;\n commandPalette: CommandPaletteLabels;\n globalSearch: GlobalSearchLabels;\n seriesChart: SeriesChartLabels;\n pieChart: PieChartLabels;\n sparkline: SparklineLabels;\n statTile: StatTileLabels;\n signaturePad: SignaturePadLabels;\n passwordStrength: PasswordStrengthLabels;\n dangerConfirm: DangerConfirmLabels;\n swatchPicker: SwatchPickerLabels;\n iconPicker: IconPickerLabels;\n dialogFrame: DialogFrameLabels;\n filePicker: FilePickerLabels;\n measuredGrid: MeasuredGridLabels;\n feedbackAttachment: FeedbackAttachmentFieldLabels;\n /** 0.12.0: `FeedbackDialog`'s own strings; `FeedbackThread` / `FeedbackComposer`. */\n feedbackDialog: FeedbackDialogTextLabels;\n feedbackThread: FeedbackThreadLabels;\n feedbackComposer: FeedbackComposerLabels;\n /** 0.27.0: the feedback harmonisation (docs/feedback-harmonization.md §4) — a report's\n * status and category words, keyed by the enum value; the toasts a feedback page\n * shows; `FeedbackMenu`; `FeedbackContextBox`; the two pages' table; the row detail.\n * keksdose's wording is the canon, in every language. */\n feedbackStatus: FeedbackStatusLabels;\n feedbackCategory: FeedbackCategoryLabels;\n feedbackToast: FeedbackToastLabels;\n feedbackMenu: FeedbackMenuLabels;\n /** 0.38.0: the public feedback pages — `FeedbackPublicList`, `FeedbackPublicDetail`,\n * `FeedbackPublicSwitch` (docs/feedback-harmonization.md §9.15). */\n feedbackPublic: FeedbackPublicLabels;\n /** 0.38.0: `useFeedbackNotificationTypes` — the two feedback types' setting words\n * (§9.11). */\n feedbackNotificationTypes: FeedbackNotificationTypesLabels;\n feedbackContext: FeedbackContextLabels;\n feedbackPage: FeedbackPageLabels;\n feedbackDetail: FeedbackDetailLabels;\n /** 0.38.0: public feedback (docs/feedback-harmonization.md §9.15) — the vote button,\n * the comment thread, the replies' timeline and composer. */\n feedbackVote: FeedbackVoteLabels;\n feedbackComments: FeedbackCommentsLabels;\n feedbackReplies: FeedbackRepliesLabels;\n /** 0.12.0: `ProfileSetting`, `PasswordSetting`, `TwoFactorSetting`, `PasskeysSetting`\n * — one record per section. The provider takes a whole section record; the\n * components merge it key by key, as a prop. */\n accountSettings: AccountSettingsLabels;\n confirmDialog: ConfirmDialogLabels;\n floatingPanel: FloatingPanelLabels;\n copyButton: CopyButtonLabels;\n bulkActionBar: BulkActionBarLabels;\n list: ListLabels;\n breadcrumbs: BreadcrumbsLabels;\n toast: ToastLabels;\n form: FormActionsLabels;\n descriptionList: DescriptionListLabels;\n lineItems: LineItemsLabels;\n progressBar: ProgressBarLabels;\n signedAmount: SignedAmountLabels;\n errorBoundary: ErrorBoundaryLabels;\n authedImage: AuthedImageLabels;\n imageGrid: ImageGridLabels;\n lightbox: LightboxLabels;\n /** 0.18.0: `WriteLockProvider`'s fallback reason, `AccountStateChip`, `SharePanel` /\n * `ShareCard` / `ShareDialog`, `ReauthDialog`. */\n writeLock: WriteLockLabels;\n accountState: AccountStateLabels;\n shareCard: ShareCardLabels;\n reauthDialog: ReauthDialogLabels;\n /** 0.18.0: `ServerWakeNotice` — keksdose's cold-start notice, for every app. */\n serverWake: ServerWakeLabels;\n /** 0.19.0: the translation-review parts (`TranslationReviewPanel`, its editor, chip,\n * progress, locale tabs and export) — keksdose's /translations, for every app. */\n translationReview: TranslationReviewLabels;\n /** 0.19.0: `LegalLinks`' navigation name. 0.28.0: every kit-owned word of the legal\n * pages — the link labels, titles, back link, terms checkbox and notices, and the\n * sections that are the same in every app, filled in with the app's operator\n * (docs/legal-harmonization.md §4.3/§4.4). */\n legal: LegalLabels;\n /** 0.29.0: sign-in form: credentials, passkey, 2FA, forced new password (docs/auth-harmonization.md §5). */\n signIn: SignInLabels;\n /** 0.29.0: the sign-up form, with the +app address tag (§4.1, §4.5). */\n register: RegisterLabels;\n /** 0.29.0: asking a migrated account for first and last name once (§3.3). */\n completeName: CompleteNameLabels;\n /** 0.29.0: requesting a reset link (always the same answer). */\n forgotPassword: ForgotPasswordLabels;\n /** 0.29.0: choosing a new password from a reset link; not a sign-in (§6.3). */\n resetPassword: ResetPasswordLabels;\n /** 0.29.0: the verify-email page and the unverified banner. */\n verifyEmail: VerifyEmailLabels;\n /** 0.29.0: the 404 page. */\n notFound: NotFoundLabels;\n /** 0.29.0: accepting an invitation with an account (§4.4). */\n acceptInvitation: AcceptInvitationLabels;\n /** 0.29.0: kastlan's switcher between a user's companies (§5.3). */\n companySwitcher: CompanySwitcherLabels;\n /** 0.30.0: changing the account's address with re-verification (docs/user-admin-harmonization.md §6.2). */\n emailChange: EmailChangeLabels;\n /** 0.30.0: sign out everywhere, and kastlan's device list (§6.3). */\n sessions: SessionsLabels;\n /** 0.30.0: deletion in two stages (§6.4). */\n deleteAccount: DeleteAccountLabels;\n /** 0.30.0: the self-service JSON export (§6.5). */\n dataExport: DataExportLabels;\n /** 0.30.0: the admin user list's columns (§3). */\n userRoster: UserRosterLabels;\n /** 0.30.0: picking one or several roles, with the reasons a choice is locked (§4.1). */\n roleSelect: RoleSelectLabels;\n /** 0.30.0: a translation reviewer's languages and areas. */\n reviewerScope: ReviewerScopeLabels;\n /** 0.30.0: an admin action's confirmation and refusals (§4.2). */\n adminAction: AdminActionLabels;\n /** 0.30.0: the admin_actions list (§4.3). */\n adminActionLog: AdminActionLogLabels;\n /** 0.30.0: handing an account's work to another (Kurvenschmiede). */\n transferOwnership: TransferOwnershipLabels;\n /** 0.30.0: the invitations panel (§5). */\n invitations: InvitationsLabels;\n /** 0.31.0: the settings and admin pages' shell (docs/settings-harmonization.md §4.3). */\n settings: SettingsLabels;\n /** 0.31.0: the public landing page's kit words (docs/landing-demo-harmonization.md §4). */\n landing: LandingLabels;\n /** 0.31.0: the demo's start, banner and end (§5). */\n demo: DemoLabels;\n /** 0.32.0: plans, standing, banners and the limit notice (docs/billing-harmonization.md §7). */\n billing: BillingLabels;\n /** 0.33.0: the operator's plan parts — `planColumn`, `PlanChangeConfirm` and the\n * lines of `usePlanChangeResult` (docs/billing-harmonization.md §14.12). */\n planChange: PlanChangeLabels;\n /** 0.32.0: the text-size and contrast settings (docs/text-size-harmonization.md §6). */\n appearance: AppearanceLabels;\n /** 0.36.0: resetting this device's settings, the appearance group's last card\n * (docs/settings-harmonization.md §11.3). */\n deviceReset: DeviceResetLabels;\n /** 0.32.0: a row's actions folded into a \"⋯\" menu at Large (text size §10.8). */\n rowActions: RowActionsLabels;\n /** 0.32.0: the phone bar's \"More\" cell and sheet (text size §10.7). */\n appShellMore: AppShellMoreLabels;\n /** 0.22.0: the screen-reader words of `Input` / `Textarea`'s `showCount` counter. */\n characterCount: CharacterCountLabels;\n /** 0.22.0: `CountrySelect`. Its list's \"no results\" and counts are `combobox`'s. */\n countrySelect: CountrySelectLabels;\n /** 0.22.0: `InlineEditField` — keksdose K9. */\n inlineEdit: InlineEditLabels;\n /** 0.22.0: `IbanInput`'s messages, one per problem. */\n ibanInput: IbanInputLabels;\n /** 0.22.0: `PhoneInput`'s country-code select. */\n phoneInput: PhoneInputLabels;\n /** 0.22.0: `SignChip` — the outflow / inflow toggle beside an amount. */\n signChip: SignChipLabels;\n /** 0.23.0: `ColumnMapper` / `ColumnRoleTable` — a pasted or dropped table, a role per\n * column. */\n columnMapper: ColumnMapperLabels;\n /** 0.36.0: the notification cards — the types, quiet hours and the zone picker, this\n * device's push, the device list, and the unsubscribe page\n * (docs/notifications-harmonization.md §4.2). */\n notifications: NotificationsLabels;\n /** 0.42.0: the admin area's shared words — the account menu's \"Administration\" row, the\n * 403 page, the shared sections, the overview's tiles and the Tools list\n * (docs/admin-harmonization.md §3.1). */\n adminArea: AdminAreaLabels;\n /** 0.42.0: the top bar's shared parts — `TourMenu`, `SyncStatusIndicator`, `DevSwitchers`\n * (docs/top-bar-harmonization.md §3.1). */\n topBarParts: TopBarPartsLabels;\n /** 0.45.0: \"Send a test mail to me\" (docs/admin-harmonization.md §9.2.4). */\n mailTestCard: MailTestCardLabels;\n /** 0.45.0: the sign-out question while changes wait to sync (`@eifi1/ui-kit/offline`,\n * docs/local-first-harmonization.md §1.6). */\n signOutPending: SignOutPendingDialogLabels;\n /** 0.45.0: the service-worker update toast (local-first §1.5 D8). */\n pwaUpdate: PwaUpdatePromptLabels;\n /** 0.45.0: \"This is a shared computer\" on the sign-in form (local-first §1.5 D6). */\n sharedComputer: SharedComputerLabels;\n}\n\n/**\n * A label override, as deep as the labels go: an object of labels (a namespace, or a\n * record inside one such as `accountSettings.passkeys` or `dataTable.presets`) may be\n * partial at every level, because the provider merges it key by key at every level.\n * A leaf stays as it is: a string, a function-valued label (`(n) => …`), and anything\n * that is not purely an object (a `ReactNode` union) is given whole.\n */\nexport type LabelOverride<T> = [T] extends [(...args: never[]) => unknown]\n ? T\n : [T] extends [readonly unknown[]]\n ? T\n : [T] extends [object]\n ? { [K in keyof T]?: LabelOverride<T[K]> }\n : T;\n\n/** Any subset of the tree — each namespace may be partial, and so may any record\n * inside one (`accountSettings.passkeys`, `dataTable.presets`): they are merged key\n * by key, at every depth. */\nexport type UiKitLabelOverrides = { [K in keyof UiKitLabels]?: LabelOverride<UiKitLabels[K]> };\n\n/* ── English defaults for the namespaces defined here ────────────────────── */\n\n// They live in ./shared-labels, a module of words, as every component's defaults live in\n// its `*-labels.ts` (round 0.34). Imported and exported as this module's own, as each\n// component does with its defaults: the names, and where the README lists them, stay.\nexport {\n DEFAULT_APP_SHELL_LABELS,\n DEFAULT_CALCULATOR_LABELS,\n DEFAULT_COMBOBOX_LABELS,\n DEFAULT_COMMON_LABELS,\n DEFAULT_CURRENCY_LABELS,\n DEFAULT_DATE_PICKER_LABELS,\n DEFAULT_FILE_LABELS,\n DEFAULT_MULTI_SELECT_LABELS,\n DEFAULT_PICKER_SHEET_LABELS,\n DEFAULT_SWIPEABLE_ROW_LABELS,\n DEFAULT_TOP_BAR_LABELS,\n formatFileSize,\n};\n\n/* ── The provider ────────────────────────────────────────────────────────── */\n\ninterface KitI18n {\n labels?: UiKitLabelOverrides;\n locale?: string;\n weekStartsOn?: WeekDay;\n linkComponent?: KitLinkComponent;\n chartTooltipPlacement?: ChartTooltipPlacement;\n formatDate?: KitDateFormatter;\n tableStorageKeyPrefix?: string;\n timeZone?: string;\n documentTitleFormat?: string;\n appName?: string;\n}\n\n/** What a {@link KitDateFormatter} is told about the date it is formatting. */\nexport interface KitDateFormatContext {\n /**\n * How much of a date the string is: `\"day\"` — the `iso` is `\"YYYY-MM-DD\"`; `\"month\"` —\n * `\"YYYY-MM\"` (a `MonthPicker`); `\"year\"` — `\"YYYY\"` (`MonthPicker mode=\"year\"`).\n */\n unit: \"day\" | \"month\" | \"year\";\n /** Which kit surface asks: the trigger of a `DatePicker`, of a `DateRangePicker`\n * (called once per end), of a `MonthPicker`, or a `DateMark`. */\n source: \"datePicker\" | \"dateRangePicker\" | \"monthPicker\" | \"dateMark\";\n /** The locale the kit would have formatted in — the component's `locale` prop, else\n * the provider's — or `undefined` for the runtime's. */\n locale: string | undefined;\n /**\n * The kit's suggestion: whether this date stands alone where the day of the week\n * helps — `true` for a `DatePicker`'s trigger and a `DateMark`, `false` for the two\n * ends of a range (twice the width, in a sentence-like \"from – to\") and for a month\n * or a year. keksdose's rule, which this follows: *\"A date in a COLUMN carries the\n * weekday. A date in a SENTENCE does not.\"* (date-cell.tsx, dev#546). A formatter\n * is free to ignore it.\n */\n weekday: boolean;\n}\n\n/**\n * The app's ONE answer to \"what does a date look like here\" — keksdose K12. Returns the\n * text for an ISO date (see {@link KitDateFormatContext.unit} for the three shapes).\n * Return `\"\"` to fall back to the kit's own formatting for that date.\n */\nexport type KitDateFormatter = (iso: string, context: KitDateFormatContext) => string;\n\n/** Where a chart shows the values under the pointer — see `SeriesChartTooltip.placement`. */\nexport type ChartTooltipPlacement = \"cursor\" | \"above\" | \"below\" | \"auto\";\n\n/**\n * What every kit link receives: the anchor attributes the kit decided (href, class,\n * aria-current, handlers, children, ref). An app's router link maps them —\n * `({ href, ...p }) => <Link to={href} {...p} />` — ONCE, on the provider.\n *\n * `replace` is the one prop that is not an anchor attribute: see there. Map it\n * explicitly if your router link is not react-router's —\n * `({ href, replace, ...p }) => <Link to={href} replace={replace} {...p} />` — and never\n * spread it onto a DOM `<a>`, where React warns about an unknown attribute.\n */\nexport type KitLinkProps = AnchorHTMLAttributes<HTMLAnchorElement> & {\n href: string;\n ref?: Ref<HTMLAnchorElement>;\n /**\n * Navigate by REPLACING the current history entry, so Back skips it — keksdose F1:\n * a one-shot URL (a magic-link landing, `?checkout=done`, a wizard's \"finish\" hop)\n * that must not come back when the user presses Back. Present ONLY when the kit link\n * was given `replace` (`true`), so a provider link that spreads its props onto a\n * plain `<a>` keeps working for every link that never asks for it. react-router's\n * `<Link>` takes the same prop, so `({ href, ...p }) => <Link to={href} {...p} />`\n * honours it with no change; any other router maps it to its own replace option.\n * The kit never puts it on a DOM element itself.\n */\n replace?: boolean;\n};\nexport type KitLinkComponent = (props: KitLinkProps) => ReactElement;\n\nconst KitI18nContext = createContext<KitI18n>({});\n\nexport interface UiKitProviderProps {\n /** Any part of {@link UiKitLabels}. Missing keys fall back to English. */\n labels?: UiKitLabelOverrides;\n /**\n * BCP 47 tag used by every kit component that formats something — dates, numbers,\n * month and weekday names, file sizes — when it is not handed a `locale` prop of\n * its own. Without a provider, and without a prop, those use the runtime default.\n */\n locale?: string;\n /**\n * The first day of the week (0 = Sunday, 1 = Monday …) for every calendar below —\n * `MiniCalendar` and the pickers built on it — that is not handed a `weekStartsOn`\n * of its own. Without it the week start follows `locale`'s week info.\n *\n * Separate from `locale` because the two are separate decisions: a German-built\n * app running in English (`locale=\"en\"`) would otherwise start its weeks on Sunday,\n * and switching it to `en-GB` to get Monday changes every date and number format.\n */\n weekStartsOn?: WeekDay;\n /**\n * The app's router link, used by every kit component that renders an in-app link\n * and was not handed its own `renderLink` — so `renderLink` stops being repeated on\n * each ListItem, Breadcrumbs, StatTile, Chip… (kastlan). A component's own\n * `renderLink` wins; external links and in-page `#anchor`s stay plain `<a>`, and a\n * hash-router `#/path` is handed to it like `/path` (see `pickLinkRenderer`).\n */\n linkComponent?: KitLinkComponent;\n /**\n * Where every `SeriesChart` below shows its tooltip when it does not say so itself\n * (`tooltip.placement`) — set once so an app's phone charts stop putting the box under\n * the reader's finger (keksdose #359). Default: `\"cursor\"`, the box that follows the\n * pointer, as before.\n */\n chartTooltipPlacement?: ChartTooltipPlacement;\n /**\n * How every kit date below is written, when the component is not told otherwise —\n * keksdose K12. keksdose has a date-format preference (Settings ▸ date format, feedback\n * #180) that is not the UI language, and a weekday in the UI language beside digits\n * in the preference's order (live #246, dev#546): two locales in one string, which\n * no `locale` + `Intl` options can say. Its `DateField` wraps every `DatePicker` to\n * pass `formatValue`, and its report range field formats both ends by hand; with this\n * set once on the provider, those wrappers thin to nothing.\n *\n * Used for the trigger text of `DatePicker`, `DateRangePicker` and `MonthPicker`\n * (month and year mode), and for `DateMark display=\"date\"`. A component's own\n * `formatValue` or `formatOptions` (`dateStyle` on a DateMark) wins: prop >\n * provider > the kit's `Intl` default, the order every kit setting resolves in. Left\n * out (or returning `\"\"`), everything formats exactly as before.\n *\n * Keep it stable (`useCallback`, or a module function): it is in the provider's\n * context value, so a new function every render re-renders every consumer.\n */\n formatDate?: KitDateFormatter;\n /**\n * The `localStorage` prefix every kit table below keeps its view under (sort, filters,\n * page size, widths, hidden columns), when the table is not handed a\n * `storageKeyPrefix` of its own — round 0.34 C5, KS U4. Left out, it is the kit's\n * `\"hbui-table:\"`, as before.\n *\n * Set once here rather than per table because not every table is the app's to pass a\n * prop to: `TranslationReviewPanel` wraps a `DataTable`, and until this the panel's\n * view landed under the kit's prefix whatever the app's was — so an app that lists\n * what it stores (a privacy page) had to list the kit's prefix as a key of its own.\n * Resolves like every kit setting: the table's own prop > this > the default. The\n * key is the prefix plus the table's `storageKey`, verbatim, so an app that wrapped\n * `DataTable` to pass its prefix (Keksdose's `keksdose-table:`) keeps every stored\n * view when it moves the prefix here.\n */\n tableStorageKeyPrefix?: string;\n /**\n * 0.46 (docs/notifications-harmonization.md §10.3): the IANA zone (\"Europe/Zurich\") every\n * TIMESTAMP below is shown in through `useKitFormat().formatDate` /\n * `formatRelativeTime`, when the call names none — the account's picked zone, for an app\n * that shows times in it. A bare \"YYYY-MM-DD\" is never shifted (a calendar day is the day\n * it names in every zone). Left out, timestamps follow the device, as before.\n */\n timeZone?: string;\n /**\n * 0.49 KIT-9: how `useDocumentTitle` and every `PageHeader`'s `h1` write the window's\n * title, from `{page}`, `{section}` and `{app}`. Default\n * `\"{page} · {section} · {app}\"` (`DEFAULT_DOCUMENT_TITLE_FORMAT`); a missing part\n * drops with its separator.\n */\n documentTitleFormat?: string;\n /** 0.49 KIT-9: the app's name, the `{app}` of the window's title (\"Kastlan\"). Left\n * out, titles end at the page or section. */\n appName?: string;\n /**\n * 0.49 KIT-1b: while a person copies a selection in the page, a U+2212 minus standing\n * before a number (\"−CHF 1,250.50\") goes to the clipboard as \"-\", in `text/plain` and\n * `text/html` (what Excel pastes), so a spreadsheet reads a number; the page keeps \"−\".\n * A copy out of an input, a textarea or an editable element is left alone. Installed\n * once per document, by the first provider that has it on. Default `true`; `false` on\n * the outermost provider leaves the clipboard to the browser.\n */\n copyAsciiMinus?: boolean;\n children: ReactNode;\n}\n\n/**\n * Hand every kit component below this point its strings and its locale.\n *\n * Optional: a component outside any provider behaves exactly as it did before the\n * provider existed. Nesting works as a merge — an inner provider overrides only what\n * it names, so a page can re-label one table's `dataTable.table` without restating\n * the language.\n */\nexport function UiKitProvider({\n labels,\n locale,\n weekStartsOn,\n linkComponent,\n chartTooltipPlacement,\n formatDate,\n tableStorageKeyPrefix,\n timeZone,\n documentTitleFormat,\n appName,\n copyAsciiMinus = true,\n children,\n}: UiKitProviderProps) {\n const outer = useContext(KitI18nContext);\n const value = useMemo<KitI18n>(\n () => ({\n locale: locale ?? outer.locale,\n weekStartsOn: weekStartsOn ?? outer.weekStartsOn,\n labels: mergeOverrides(outer.labels, labels),\n linkComponent: linkComponent ?? outer.linkComponent,\n chartTooltipPlacement: chartTooltipPlacement ?? outer.chartTooltipPlacement,\n formatDate: formatDate ?? outer.formatDate,\n tableStorageKeyPrefix: tableStorageKeyPrefix ?? outer.tableStorageKeyPrefix,\n timeZone: timeZone ?? outer.timeZone,\n documentTitleFormat: documentTitleFormat ?? outer.documentTitleFormat,\n appName: appName ?? outer.appName,\n }),\n [\n outer,\n labels,\n locale,\n weekStartsOn,\n linkComponent,\n chartTooltipPlacement,\n formatDate,\n tableStorageKeyPrefix,\n timeZone,\n documentTitleFormat,\n appName,\n ],\n );\n useTableViewsJoin(value.tableStorageKeyPrefix ?? DEFAULT_TABLE_STORAGE_KEY_PREFIX);\n useClipboardMinus(copyAsciiMinus);\n return <KitI18nContext.Provider value={value}>{children}</KitI18nContext.Provider>;\n}\n\n/** The kit's own table prefix: `DEFAULT_PERSIST_PREFIX` of components/use-table-state,\n * restated because that module imports the router (a test pins the two equal). */\nconst DEFAULT_TABLE_STORAGE_KEY_PREFIX = \"hbui-table:\";\n\n/**\n * Reset this device's settings (docs/settings-harmonization.md §11.4): the tables below a\n * provider keep their views under its prefix, so the provider joins the registry with\n * that prefix — a view, no `reset`, since a table reads its view when it next mounts —\n * while it is mounted. Nested providers with one prefix hold one entry.\n *\n * Through a literal `import()`, not a static import: every catalogue reaches this module,\n * and a catalogue may reach nothing outside i18n/ (scripts/check-module-graph.mjs,\n * english-catalogue-graph.test.ts). The theme stores and the shell import the registry\n * statically, so it is loaded already and the join lands a microtask after the mount.\n */\nfunction useTableViewsJoin(prefix: string): void {\n useEffect(() => {\n let leave: (() => void) | undefined;\n let gone = false;\n import(\"../lib/device-settings\").then(\n ({ registerDeviceSetting }) => {\n if (!gone) leave = registerDeviceSetting({ key: prefix, prefix: true, kind: \"view\" });\n },\n // A module of the kit's own that fails to load has nothing to join; the provider\n // and its tables work as before.\n () => undefined,\n );\n return () => {\n gone = true;\n leave?.();\n };\n }, [prefix]);\n}\n\n/**\n * The copy handler (lib/clipboard-minus, 0.49 KIT-1b), through a literal `import()` for\n * the reason {@link useTableViewsJoin} gives: a catalogue may reach nothing outside i18n/.\n * It is in place a microtask after the mount — long before a person selects and copies.\n */\nfunction useClipboardMinus(on: boolean): void {\n useEffect(() => {\n if (!on || typeof document === \"undefined\") return;\n let uninstall: (() => void) | undefined;\n let gone = false;\n import(\"../lib/clipboard-minus\").then(\n ({ installClipboardMinus }) => {\n if (!gone) uninstall = installClipboardMinus(document);\n },\n // Not loaded: copying works as the browser does it.\n () => undefined,\n );\n return () => {\n gone = true;\n uninstall?.();\n };\n }, [on]);\n}\n\nfunction isRecord(v: unknown): v is Record<string, unknown> {\n return typeof v === \"object\" && v !== null && !Array.isArray(v);\n}\n\n/** A record of labels to merge into — not a React element, which is an object too but\n * is a label given whole. */\nfunction isLabelRecord(v: unknown): v is Record<string, unknown> {\n return isRecord(v) && !(\"$$typeof\" in v);\n}\n\n/** Merged key by key at EVERY depth — a namespace, a record inside it\n * (`accountSettings.passkeys`, `dataTable.presets`), and so on down — to match\n * {@link LabelOverride}. An `undefined` is skipped at every depth, so it never blanks\n * out what is under it. */\nfunction mergeNamespace<T extends object>(base: T, over: LabelOverride<T> | Partial<T> | undefined): T {\n if (!over) return base;\n const out = { ...base } as Record<string, unknown>;\n for (const [k, v] of Object.entries(over)) {\n if (v === undefined) continue;\n const prev = out[k];\n out[k] = isLabelRecord(prev) && isLabelRecord(v) ? mergeNamespace(prev, v) : v;\n }\n return out as T;\n}\n\nfunction mergeOverrides(\n a: UiKitLabelOverrides | undefined,\n b: UiKitLabelOverrides | undefined,\n): UiKitLabelOverrides | undefined {\n if (!a) return b;\n if (!b) return a;\n const out: Record<string, unknown> = { ...a };\n for (const [ns, v] of Object.entries(b)) {\n out[ns] = mergeNamespace((out[ns] as object | undefined) ?? {}, v as object);\n }\n return out as UiKitLabelOverrides;\n}\n\n/**\n * What the nearest provider says about one namespace — `undefined` outside one. Nested\n * providers' words come merged, at every depth; no English default is filled in.\n *\n * A {@link LabelOverride}, partial at every depth, like the components' `labels` props\n * that take it: a provider that names one key of a section (`accountSettings.passkeys`)\n * or one preset (`dataTable.presets`) hands over just that (round 0.35 R3 — until then\n * it was typed partial at the top only, so a nested section read as complete).\n *\n * For a component whose own resolver does more than a merge (the data table derives\n * `columnsCount` from `columns`): merge the component's prop over it — a record key by\n * key — and feed the result to that resolver.\n */\nexport function useKitLabelOverrides<K extends keyof UiKitLabels>(\n ns: K,\n): LabelOverride<UiKitLabels[K]> | undefined {\n return useContext(KitI18nContext).labels?.[ns];\n}\n\n/**\n * One namespace, resolved: `defaults`, then the provider, then the component's own\n * `prop`. Record-valued keys are merged key by key at each step — so `prop` is a\n * {@link LabelOverride}, partial at every depth as the provider's labels are, and a\n * component's `labels` prop, typed the same, is handed over without a cast (refactor\n * audit 2026-10, API-9).\n */\nexport function useKitLabels<K extends keyof UiKitLabels>(\n ns: K,\n defaults: UiKitLabels[K],\n prop?: LabelOverride<UiKitLabels[K]>,\n): UiKitLabels[K] {\n const fromProvider = useKitLabelOverrides(ns);\n return useMemo(\n () => mergeNamespace(mergeNamespace(defaults, fromProvider), prop),\n [defaults, fromProvider, prop],\n );\n}\n\n/** The component's own `locale` prop, else the provider's, else `undefined` (which\n * every `Intl` API reads as \"the runtime's default\"). */\nexport function useKitLocale(prop?: string): string | undefined {\n const fromProvider = useContext(KitI18nContext).locale;\n return prop ?? fromProvider;\n}\n\n/** The week start the nearest `<UiKitProvider weekStartsOn>` pins, else `undefined`\n * (the caller then asks the locale). A component's own prop goes first:\n * `prop ?? useKitWeekStart()`. */\n/** The provider's router link, or `undefined` — a component's own `renderLink` should\n * win over it: `const Link = renderLink ?? useKitLink()`. */\nexport function useKitLink(): KitLinkComponent | undefined {\n return useContext(KitI18nContext).linkComponent;\n}\n\nexport function useKitWeekStart(): WeekDay | undefined {\n return useContext(KitI18nContext).weekStartsOn;\n}\n\n/** The provider's `chartTooltipPlacement`, or `undefined` — a chart's own prop wins. */\nexport function useKitChartTooltipPlacement(): ChartTooltipPlacement | undefined {\n return useContext(KitI18nContext).chartTooltipPlacement;\n}\n\n/** The nearest provider's `formatDate`, or `undefined` — a component's own\n * `formatValue` / `formatOptions` wins over it. See {@link KitDateFormatter}. */\nexport function useKitDateFormatter(): KitDateFormatter | undefined {\n return useContext(KitI18nContext).formatDate;\n}\n\n/** The nearest provider's `tableStorageKeyPrefix`, or `undefined` — a table's own\n * `storageKeyPrefix` wins over it, and the kit's `\"hbui-table:\"` comes after both. */\nexport function useKitTableStorageKeyPrefix(): string | undefined {\n return useContext(KitI18nContext).tableStorageKeyPrefix;\n}\n\n/** The nearest provider's `timeZone` (0.46), or `undefined` — the device's. A call's own\n * `timeZone` wins over it. */\nexport function useKitTimeZone(): string | undefined {\n return useContext(KitI18nContext).timeZone;\n}\n\n/** The nearest provider's `documentTitleFormat` and `appName`, or `undefined` each —\n * what `useDocumentTitle` writes with (the format's default is\n * `DEFAULT_DOCUMENT_TITLE_FORMAT`, applied there: this module reaches nothing outside\n * i18n/). */\nexport function useKitDocumentTitle(): { format: string | undefined; appName: string | undefined } {\n const { documentTitleFormat, appName } = useContext(KitI18nContext);\n return { format: documentTitleFormat, appName };\n}\n\n/** {@link DEFAULT_FILE_LABELS}, but formatting in the provider's locale. */\nexport function useKitFileLabels(prop?: Partial<FileLabels>): FileLabels {\n const locale = useKitLocale();\n const defaults = useMemo<FileLabels>(\n () => ({ size: (bytes) => formatFileSize(bytes, locale) }),\n [locale],\n );\n return useKitLabels(\"file\", defaults, prop);\n}\n\n/**\n * The dot paths of every key `labels` does NOT supply — the ones a translated app is\n * still showing in English. Assert on it in the app's own test:\n *\n * expect(missingKitLabels(labels, DEFAULT_UI_KIT_LABELS)).toEqual([]);\n *\n * `reference` is the complete tree to check against — pass\n * {@link DEFAULT_UI_KIT_LABELS} (src/i18n/defaults.ts). It is a parameter rather than an import\n * because the defaults live beside their components, and this module is imported BY\n * those components. Left out (a test file is not type-checked), it throws saying so\n * rather than \"Cannot convert undefined or null to object\" (keksdose, 0.18).\n */\nexport function missingKitLabels(\n labels: UiKitLabelOverrides | undefined,\n reference: UiKitLabels,\n): string[] {\n if (!isRecord(reference)) {\n throw new TypeError(\n \"missingKitLabels(labels, reference): pass DEFAULT_UI_KIT_LABELS as the reference — \" +\n \"it is the tree the labels are checked against.\",\n );\n }\n const missing: string[] = [];\n for (const [ns, keys] of Object.entries(reference)) {\n const given = (labels as Record<string, Record<string, unknown> | undefined> | undefined)?.[ns];\n for (const [key, value] of Object.entries(keys as Record<string, unknown>)) {\n const got = given?.[key];\n if (got === undefined) {\n missing.push(`${ns}.${key}`);\n } else if (isRecord(value) && isRecord(got)) {\n for (const sub of Object.keys(value)) {\n if (got[sub] === undefined) missing.push(`${ns}.${key}.${sub}`);\n }\n }\n }\n }\n return missing;\n}\n"],"mappings":"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","names":[]}
@@ -1564,13 +1564,16 @@ var DEFAULT_DEVICE_RESET_LABELS = {
1564
1564
  // src/components/row-actions-labels.ts
1565
1565
  var DEFAULT_ROW_ACTIONS_LABELS = {
1566
1566
  actions: "Actions",
1567
- actionsFor: (name) => `Actions for ${name}`
1567
+ actionsFor: (name) => `Actions for ${name}`,
1568
+ confirmTitle: (action, name) => name ? `${action} \u201C${name}\u201D?` : `${action}?`,
1569
+ confirmBody: "This cannot be undone."
1568
1570
  };
1569
1571
 
1570
1572
  // src/shell/app-shell-labels.ts
1571
1573
  var DEFAULT_APP_SHELL_MORE_LABELS = {
1572
1574
  more: "More",
1573
- moreTitle: "More pages"
1575
+ moreTitle: "More pages",
1576
+ overview: "Overview"
1574
1577
  };
1575
1578
 
1576
1579
  // src/components/account-chips-labels.ts
@@ -2031,6 +2034,7 @@ var DEFAULT_TOP_BAR_LABELS = {
2031
2034
  theme: "Toggle theme",
2032
2035
  palette: "Appearance preset",
2033
2036
  language: "Language",
2037
+ languageCurrent: (name) => `Choose language, current: ${name}`,
2034
2038
  switchRole: "Switch role",
2035
2039
  role: (value) => `Role: ${value}`
2036
2040
  };