@eifi1/ui-kit 0.8.1 → 0.9.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 (101) hide show
  1. package/README.md +4 -0
  2. package/dist/components/amount-input.d.ts +2 -0
  3. package/dist/components/calculator.d.ts +2 -0
  4. package/dist/components/chip.d.ts +27 -5
  5. package/dist/components/chip.js +6 -2
  6. package/dist/components/chip.js.map +1 -1
  7. package/dist/components/data-table-filter-popover.d.ts +1 -1
  8. package/dist/components/data-table-filters.d.ts +1 -1
  9. package/dist/components/data-table.d.ts +1 -1
  10. package/dist/components/data-table.js +122 -91
  11. package/dist/components/data-table.js.map +1 -1
  12. package/dist/components/date-picker.d.ts +69 -3
  13. package/dist/components/date-picker.js +152 -65
  14. package/dist/components/date-picker.js.map +1 -1
  15. package/dist/components/disclosure.d.ts +11 -2
  16. package/dist/components/disclosure.js +10 -4
  17. package/dist/components/disclosure.js.map +1 -1
  18. package/dist/components/floating-panel.d.ts +29 -2
  19. package/dist/components/floating-panel.js +16 -2
  20. package/dist/components/floating-panel.js.map +1 -1
  21. package/dist/components/number-field.d.ts +2 -0
  22. package/dist/components/number-input.d.ts +2 -0
  23. package/dist/components/numpad-sheet.d.ts +2 -0
  24. package/dist/components/progress-bar.d.ts +16 -2
  25. package/dist/components/progress-bar.js +4 -2
  26. package/dist/components/progress-bar.js.map +1 -1
  27. package/dist/components/ui.d.ts +37 -14
  28. package/dist/components/ui.js +28 -22
  29. package/dist/components/ui.js.map +1 -1
  30. package/dist/components/use-table-state.d.ts +1 -1
  31. package/dist/{data-table-filters-CF1PXqjQ.d.ts → data-table-filters-Dh9uF_S-.d.ts} +33 -2
  32. package/dist/data-table.d.ts +1 -1
  33. package/dist/hooks/use-overlay-history.js +84 -4
  34. package/dist/hooks/use-overlay-history.js.map +1 -1
  35. package/dist/i18n/defaults.d.ts +2 -0
  36. package/dist/i18n/defaults.js +2 -0
  37. package/dist/i18n/defaults.js.map +1 -1
  38. package/dist/i18n/kit-labels.d.ts +3 -0
  39. package/dist/i18n/kit-labels.js.map +1 -1
  40. package/dist/i18n/locales/de-CH-informal.d.ts +2 -0
  41. package/dist/i18n/locales/de-CH.d.ts +2 -0
  42. package/dist/i18n/locales/de-informal.d.ts +2 -0
  43. package/dist/i18n/locales/de.d.ts +2 -0
  44. package/dist/i18n/locales/de.js +10 -0
  45. package/dist/i18n/locales/de.js.map +1 -1
  46. package/dist/i18n/locales/es.d.ts +2 -0
  47. package/dist/i18n/locales/es.js +10 -0
  48. package/dist/i18n/locales/es.js.map +1 -1
  49. package/dist/i18n/locales/fr.d.ts +2 -0
  50. package/dist/i18n/locales/fr.js +10 -0
  51. package/dist/i18n/locales/fr.js.map +1 -1
  52. package/dist/i18n/locales/hu.d.ts +2 -0
  53. package/dist/i18n/locales/hu.js +10 -0
  54. package/dist/i18n/locales/hu.js.map +1 -1
  55. package/dist/i18n/locales/it.d.ts +2 -0
  56. package/dist/i18n/locales/it.js +10 -0
  57. package/dist/i18n/locales/it.js.map +1 -1
  58. package/dist/i18n/locales/zh.d.ts +2 -0
  59. package/dist/i18n/locales/zh.js +10 -0
  60. package/dist/i18n/locales/zh.js.map +1 -1
  61. package/dist/index.d.ts +5 -3
  62. package/dist/index.js +2 -0
  63. package/dist/index.js.map +1 -1
  64. package/dist/search/command-palette.d.ts +49 -1
  65. package/dist/search/command-palette.js +132 -29
  66. package/dist/search/command-palette.js.map +1 -1
  67. package/dist/search/global-search.d.ts +141 -0
  68. package/dist/search/global-search.js +277 -0
  69. package/dist/search/global-search.js.map +1 -0
  70. package/dist/search/search-index.d.ts +105 -0
  71. package/dist/search/search-index.js +142 -0
  72. package/dist/search/search-index.js.map +1 -0
  73. package/dist/search.d.ts +2 -0
  74. package/dist/search.js +2 -0
  75. package/dist/search.js.map +1 -1
  76. package/dist/wizard/stepper-nav.d.ts +10 -1
  77. package/dist/wizard/stepper-nav.js +2 -1
  78. package/dist/wizard/stepper-nav.js.map +1 -1
  79. package/package.json +12 -3
  80. package/src/components/chip.tsx +36 -6
  81. package/src/components/data-table.tsx +81 -5
  82. package/src/components/date-picker.tsx +328 -117
  83. package/src/components/disclosure.tsx +24 -8
  84. package/src/components/floating-panel.tsx +46 -2
  85. package/src/components/progress-bar.tsx +27 -3
  86. package/src/components/ui.tsx +88 -37
  87. package/src/hooks/use-overlay-history.ts +181 -4
  88. package/src/i18n/defaults.ts +2 -0
  89. package/src/i18n/kit-labels.tsx +2 -0
  90. package/src/i18n/locales/de.ts +10 -0
  91. package/src/i18n/locales/es.ts +10 -0
  92. package/src/i18n/locales/fr.ts +10 -0
  93. package/src/i18n/locales/hu.ts +10 -0
  94. package/src/i18n/locales/it.ts +10 -0
  95. package/src/i18n/locales/zh.ts +10 -0
  96. package/src/index.ts +4 -0
  97. package/src/search/command-palette.tsx +200 -27
  98. package/src/search/global-search.tsx +484 -0
  99. package/src/search/search-index.ts +295 -0
  100. package/src/search.ts +2 -0
  101. package/src/wizard/stepper-nav.tsx +11 -1
@@ -1,5 +1,5 @@
1
1
  import * as react from 'react';
2
- import { ReactNode } from 'react';
2
+ import { ReactNode, TdHTMLAttributes, ThHTMLAttributes } from 'react';
3
3
  import { SortDir, SortState, SortCycle } from './components/data-table-sort.js';
4
4
  import { SwipeAction } from './components/swipeable-row.js';
5
5
  import { DataTableLabels } from './components/data-table-labels.js';
@@ -36,7 +36,38 @@ interface DataTableColumn<T> {
36
36
  * Default `"asc"`.
37
37
  */
38
38
  firstSort?: SortDir;
39
+ /**
40
+ * Extra attributes for this column's `<td>` in a given row — a `data-*` hook, a
41
+ * `title`, an `aria-describedby`, a class. keksdose's accounts page
42
+ * (accounts-page.tsx, the name and IBAN columns) is why it exists: its demo mode
43
+ * blurs everything marked `data-private`, and with nowhere to put the marker on the
44
+ * cell it wrapped every value in an inner `<span data-private>` — which blurs the
45
+ * text but not the cell, and has to be remembered in every `cell` renderer.
46
+ *
47
+ * MERGED under the kit's own, which win: `className` is joined before the column's
48
+ * `className` (so the column's alignment is still the alignment), `style` is laid
49
+ * under a resized column's pinned width, and `data-col` and a `role` stay the
50
+ * table's — `data-col` is how a resize finds the column's cells, and a `<td>` that
51
+ * claims another role leaves its row's cell count wrong for a screen reader.
52
+ *
53
+ * On a phone the card field (`<dd>`, or the primary line) gets the `data-*`
54
+ * attributes only: the rest — padding classes, `colSpan`, a width — describe a
55
+ * table cell and would mean something else, or nothing, on a card.
56
+ */
57
+ cellProps?: (row: T) => DataTableCellProps | undefined;
58
+ /** The same for the column's `<th>`, once. `scope`, `aria-sort`, `data-col` and the
59
+ * width a resize pins stay the table's, and the class list goes before
60
+ * `headClassName` for the same reason as in {@link cellProps}. */
61
+ headProps?: DataTableHeadProps;
39
62
  }
63
+ /** A `data-*` attribute, typed so `{ "data-private": "" }` needs no cast. */
64
+ type DataAttributes = {
65
+ [key: `data-${string}`]: string | number | boolean | undefined;
66
+ };
67
+ /** What {@link DataTableColumn.cellProps} may return. */
68
+ type DataTableCellProps = TdHTMLAttributes<HTMLTableCellElement> & DataAttributes;
69
+ /** What {@link DataTableColumn.headProps} takes. */
70
+ type DataTableHeadProps = ThHTMLAttributes<HTMLTableCellElement> & DataAttributes;
40
71
  interface ServerPagination {
41
72
  page: number;
42
73
  pageSize: number;
@@ -383,4 +414,4 @@ declare function decodeFilterValueOfType(type: FilterValue["type"], raw: string)
383
414
  /** Inverse of {@link encodeFilterValue}, typed by the column's filter config. */
384
415
  declare function decodeFilterValue<T>(filter: ColumnFilter<T>, raw: string): FilterValue;
385
416
 
386
- export { type ColumnFilter as C, DataTable as D, type FilterState as F, type MobileSwipeActions as M, type ServerPagination as S, type DataTableChrome as a, type DataTableColumn as b, type DataTableDensity as c, type DataTableProps as d, type FilterValue as e, decodeFilterValue as f, decodeFilterValueOfType as g, defaultFilterState as h, encodeFilterValue as i, isFilterActive as j, rowMatches as k, resolveFilter as r };
417
+ export { type ColumnFilter as C, DataTable as D, type FilterState as F, type MobileSwipeActions as M, type ServerPagination as S, type DataTableChrome as a, type DataTableColumn as b, type DataTableDensity as c, type DataTableProps as d, type FilterValue as e, decodeFilterValue as f, decodeFilterValueOfType as g, defaultFilterState as h, encodeFilterValue as i, isFilterActive as j, rowMatches as k, type DataTableCellProps as l, type DataTableHeadProps as m, resolveFilter as r };
@@ -1,6 +1,6 @@
1
1
  export { DEFAULT_DATA_TABLE_LABELS, DataTableLabels, missingDataTableLabels, resolveDataTableLabels } from './components/data-table-labels.js';
2
2
  export { SortCycle, SortDir, SortState, SortStepOptions, decodeSorts, encodeSorts, nextSorts, normalizeSorts } from './components/data-table-sort.js';
3
- export { C as ColumnFilter, D as DataTable, a as DataTableChrome, b as DataTableColumn, c as DataTableDensity, d as DataTableProps, F as FilterState, e as FilterValue, M as MobileSwipeActions, S as ServerPagination, f as decodeFilterValue, g as decodeFilterValueOfType, h as defaultFilterState, i as encodeFilterValue, j as isFilterActive, r as resolveFilter, k as rowMatches } from './data-table-filters-CF1PXqjQ.js';
3
+ export { C as ColumnFilter, D as DataTable, a as DataTableChrome, b as DataTableColumn, c as DataTableDensity, d as DataTableProps, F as FilterState, e as FilterValue, M as MobileSwipeActions, S as ServerPagination, f as decodeFilterValue, g as decodeFilterValueOfType, h as defaultFilterState, i as encodeFilterValue, j as isFilterActive, r as resolveFilter, k as rowMatches } from './data-table-filters-Dh9uF_S-.js';
4
4
  export { PAGE_SIZE_OPTIONS, Pagination } from './components/data-table-pagination.js';
5
5
  export { FilterPopover } from './components/data-table-filter-popover.js';
6
6
  import 'react';
@@ -3,6 +3,8 @@ import { useEffect, useRef } from "react";
3
3
  const SENTINEL_KEY = "__hbUiOverlayHistory";
4
4
  const stack = [];
5
5
  const pushed = [];
6
+ const buried = /* @__PURE__ */ new Map();
7
+ let lastSeen = null;
6
8
  const consumed = /* @__PURE__ */ new Set();
7
9
  let pendingProgrammatic = 0;
8
10
  let listening = false;
@@ -12,13 +14,81 @@ function runUnwind() {
12
14
  const job = unwind;
13
15
  unwind = null;
14
16
  if (!job) return;
15
- if (currentSentinel() !== job.id || currentHref() !== job.href) return;
17
+ if (currentSentinel() !== job.id || currentHref() !== job.href) {
18
+ if (taggedSentinel() === null) buryUnder(job.entries);
19
+ return;
20
+ }
16
21
  pendingProgrammatic += 1;
17
22
  window.history.go(-job.entries.length);
18
23
  }
19
24
  function currentHref() {
20
25
  return typeof window === "undefined" ? "" : window.location.href;
21
26
  }
27
+ function routerMark() {
28
+ const state = typeof window !== "undefined" ? window.history.state : null;
29
+ if (!state || typeof state !== "object") return { idx: void 0, key: void 0 };
30
+ const { idx, key } = state;
31
+ return { idx: typeof idx === "number" ? idx : void 0, key: typeof key === "string" ? key : void 0 };
32
+ }
33
+ function routeOf(href) {
34
+ try {
35
+ const url = new URL(href);
36
+ const hashRoute = url.hash.startsWith("#/") ? url.hash.split("?")[0] : "";
37
+ return url.origin + url.pathname + hashRoute;
38
+ } catch {
39
+ return href;
40
+ }
41
+ }
42
+ function isStillOn(p) {
43
+ if (routeOf(currentHref()) !== p.route) return false;
44
+ const { idx } = routerMark();
45
+ return idx === void 0 || p.idx === void 0 || idx === p.idx;
46
+ }
47
+ function buryUnder(records) {
48
+ const top = records[records.length - 1];
49
+ const here = routerMark();
50
+ if (!top || top.idx === void 0 || here.idx === void 0) return false;
51
+ let run;
52
+ if (here.idx > top.idx) {
53
+ run = [];
54
+ for (let i = records.length - 1; i >= 0 && records[i].idx === top.idx; i -= 1) run.unshift(records[i]);
55
+ } else if (here.idx === top.idx && !isStillOn(top)) {
56
+ run = [];
57
+ for (let i = records.length - 2; i >= 0 && records[i].idx === top.idx; i -= 1) run.unshift(records[i]);
58
+ } else {
59
+ return false;
60
+ }
61
+ run.forEach((r, i) => {
62
+ buried.set(r.id, {
63
+ idx: top.idx,
64
+ aboveIdx: here.idx,
65
+ belowKey: run[0].key,
66
+ aboveKey: here.key,
67
+ below: i,
68
+ above: run.length - 1 - i
69
+ });
70
+ });
71
+ for (const r of records) forgetPushed(r.id);
72
+ lastSeen = here;
73
+ return true;
74
+ }
75
+ function skipBuried(from) {
76
+ const tag = taggedSentinel();
77
+ const rec = tag !== null ? buried.get(tag) : void 0;
78
+ if (!rec || !from || stack.some((e) => e.id === tag)) return;
79
+ let steps = 0;
80
+ if (from.idx !== void 0 && from.idx > rec.idx || from.key !== void 0 && from.key === rec.aboveKey) {
81
+ steps = -(rec.below + 1);
82
+ } else if (from.idx !== void 0 && // Below the run, or level with it when nothing above it is (a push buried it),
83
+ // or level with it and provably the page beneath (a replace buried it). The
84
+ // router's first entry has no key at all, so an absent key is a key here.
85
+ (from.idx < rec.idx || from.idx === rec.idx && (rec.aboveIdx > rec.idx || from.key === rec.belowKey))) {
86
+ steps = rec.above + 1;
87
+ }
88
+ if (steps === 0) return;
89
+ pendingProgrammatic += 1;
90
+ window.history.go(steps);
91
+ }
22
92
  function forgetPushed(id) {
23
93
  const at = pushed.findIndex((p) => p.id === id);
24
94
  if (at >= 0) pushed.splice(at, 1);
@@ -44,7 +114,8 @@ function currentSentinel() {
44
114
  return tag;
45
115
  }
46
116
  if (standing === null || typeof window === "undefined") return null;
47
- if (!pushed.some((p) => p.id === standing)) {
117
+ const record = pushed.find((p) => p.id === standing);
118
+ if (!record || !isStillOn(record)) {
48
119
  standing = null;
49
120
  return null;
50
121
  }
@@ -53,10 +124,16 @@ function currentSentinel() {
53
124
  }
54
125
  function handlePop() {
55
126
  standing = taggedSentinel();
127
+ const from = lastSeen;
128
+ lastSeen = routerMark();
56
129
  if (pendingProgrammatic > 0) {
57
130
  pendingProgrammatic -= 1;
58
131
  return;
59
132
  }
133
+ closeOnPop();
134
+ skipBuried(from);
135
+ }
136
+ function closeOnPop() {
60
137
  const top = stack[stack.length - 1];
61
138
  if (!top) return;
62
139
  if (currentSentinel() === top.id) return;
@@ -90,13 +167,15 @@ function useOverlayHistory(open, onClose) {
90
167
  unwind = null;
91
168
  window.history.replaceState(marked, "");
92
169
  for (const owed of inherited.slice(0, -1)) pushed.push({ ...owed, dead: true });
93
- pushed.push({ id, href: currentHref(), dead: false });
170
+ const was = inherited[inherited.length - 1];
171
+ pushed.push({ id, href: currentHref(), dead: false, idx: was.idx, key: was.key, route: was.route });
94
172
  standing = id;
95
173
  } else {
96
174
  const under = pushed.findIndex((p) => p.id === currentSentinel());
97
175
  pushed.splice(under + 1);
98
176
  window.history.pushState(marked, "");
99
- pushed.push({ id, href: currentHref(), dead: false });
177
+ const page = routerMark();
178
+ pushed.push({ id, href: currentHref(), dead: false, idx: page.idx, key: page.key, route: routeOf(currentHref()) });
100
179
  standing = id;
101
180
  }
102
181
  return () => {
@@ -105,6 +184,7 @@ function useOverlayHistory(open, onClose) {
105
184
  if (consumed.delete(id)) return;
106
185
  const mine = pushed.findIndex((p) => p.id === id);
107
186
  if (currentSentinel() !== id) {
187
+ if (mine >= 0 && taggedSentinel() === null && buryUnder(pushed.slice(0, pushed.length))) return;
108
188
  if (mine >= 0) pushed[mine].dead = true;
109
189
  return;
110
190
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/hooks/use-overlay-history.ts"],"sourcesContent":["import { useEffect, useRef } from \"react\";\n\n/**\n * Back closes the overlay, not the page (Keksdose feedback #172).\n *\n * On a phone the Back gesture is the universal \"dismiss this\" — so a dialog or a\n * full-screen search surface that ignores it doesn't merely fail to close: the\n * navigation lands somewhere else entirely, and on a route with nothing beneath it\n * that means leaving the app with the overlay still notionally open.\n *\n * The mechanism is one throwaway, SAME-URL history entry pushed while the overlay is\n * up. Back then pops a same-document entry — no route change, no re-render of the\n * page under it — and this hook turns that pop into `onClose()`. Same trick the\n * transactions page already uses for its unsaved-edit trap\n * (`use-soft-leave-guard.ts`); the two coexist because they use different marker\n * keys AND because `handlePop` only claims a pop that actually consumed OUR entry\n * — a foreign sentinel stacked on top of ours pops back ONTO us, and an overlay\n * that closed on that would vanish mid-edit (feedback #424/#426).\n *\n * Not a URL parameter, deliberately. Encoding \"a dialog is open\" in the address bar\n * makes it shareable and restorable, which is wrong for the overlays this covers —\n * nobody wants to send someone a link that opens a confirm dialog — and it would\n * fight the page-owned `?row=` / `f.*` params that ARE meaningful state.\n *\n * ## Ordering\n *\n * The stack is module-level because correctness here is about order ACROSS\n * instances: every mounted overlay hears the same `popstate`, but only the one whose\n * entry was actually popped may close. Overlays nest and unwind last-in-first-out —\n * a dialog opened from a search surface closes before the surface — so the top of\n * this stack is by construction the entry the browser just popped.\n *\n * ## Not undoing a real navigation\n *\n * The cleanup pops our entry when the overlay closes some other way (a button,\n * Escape, a backdrop click) so history doesn't silently accumulate dead entries. It\n * first checks that our marker is still the CURRENT entry: if the user followed a\n * link while the overlay was open, the router has pushed on top of us, and a blind\n * `history.back()` there would undo their navigation.\n *\n * ## The traversal is deferred\n *\n * And it is *scheduled* rather than issued, because `history.go()` lands a task\n * later while everything this module knows is written synchronously. See\n * {@link Unwind}: an overlay opening inside that window adopts the entry instead\n * of stacking a second one on it, which is what makes the hook survive React\n * StrictMode's mount → clean up → mount (steering-design feedback #49).\n */\nconst SENTINEL_KEY = \"__hbUiOverlayHistory\";\n\ninterface OverlayEntry {\n id: string;\n close: () => void;\n}\n\nconst stack: OverlayEntry[] = [];\n\n/**\n * The sentinels we have PUSHED and not yet unwound, oldest first.\n *\n * The stack above tracks live overlays; this tracks live history entries, and the\n * two come apart in exactly one case — which is the bug this list exists for.\n * Nested overlays that close in the same commit unwind parent-first, so the dialog's\n * cleanup runs while the sheet's entry is still on top of its own. It cannot call\n * `history.back()` there (that would consume the SHEET's entry, and the sheet is\n * about to consume it itself), so its entry was simply abandoned: a husk with no\n * live owner sitting between the user and the page.\n *\n * The user paid for it on the next Back press. It popped the husk, `handlePop` found\n * an empty stack and returned, and nothing visible happened — Back had to be pressed\n * twice to leave the page.\n *\n * So an abandoned entry is recorded as `dead` instead, and whichever overlay DOES\n * get to unwind pays the debt with a single `history.go(-n)`. `href` is what keeps\n * that safe: only dead entries pushed at the address we are still sitting at are\n * unwound, so a router navigation that landed between two sentinels is never\n * reversed on the user's behalf.\n */\ninterface PushedEntry {\n id: string;\n href: string;\n /** Its overlay is gone but the entry is not — someone above owes this pop. */\n dead: boolean;\n}\nconst pushed: PushedEntry[] = [];\n\n/** Entries a real Back press already consumed. Their overlay's cleanup still has to\n * run, and it must not mistake \"my entry is not current\" for \"my entry is buried\"\n * — it has no entry left at all. */\nconst consumed = new Set<string>();\n\n/** Pops WE caused (a cleanup unwinding its own entries) — their `popstate` is\n * bookkeeping, not a user gesture, and must not close a second overlay. A\n * `history.go(-n)` traversal fires exactly ONE popstate however far it travels. */\nlet pendingProgrammatic = 0;\nlet listening = false;\nlet nextId = 0;\n\n/**\n * The unwind a cleanup has asked for and not yet issued.\n *\n * **`history.go()` is asynchronous and everything above is written\n * synchronously**, which is the seam the whole of this block exists to close.\n * The traversal lands a task later, so an overlay that opens in the *same* tick\n * as one that closed used to push its sentinel on top of the entry that was\n * about to be popped — and the pop then took the NEW entry. The overlay left on\n * screen had no entry of its own (so Back no longer closed it) and the old one\n * stayed behind as a husk between the user and their page.\n *\n * That is not an exotic race. **React StrictMode remounts every effect** — mount,\n * clean up, mount again, all in one commit — so in development *every* dialog\n * anyone opened left a husk behind, the position drifted one entry further from\n * the page on each open, and the Back press that was meant to leave the page was\n * spent on something invisible instead (steering-design feedback #49).\n *\n * So the traversal is deferred by a task, and an overlay mounting inside that\n * window **adopts** the entry instead of pushing a second one (see the effect).\n * Adoption is `replaceState` on an entry that is already there: no traversal, no\n * window in which the count can be wrong, and the StrictMode remount costs\n * exactly nothing.\n */\ninterface Unwind {\n timer: ReturnType<typeof setTimeout>;\n /** The sentinel on the entry to leave — the top of `entries`. */\n id: string;\n href: string;\n /** That entry plus the abandoned ones directly beneath it, oldest first. */\n entries: PushedEntry[];\n}\nlet unwind: Unwind | null = null;\n\n/** Issue the deferred traversal, if the ground has not moved under it.\n *\n * A real Back press or a router navigation during the deferred task leaves us\n * somewhere that is not the entry we meant to leave, and going back from there\n * would take something that is not ours. The entries are then simply forgotten\n * rather than handed back as `dead`: a forgotten entry costs one dead Back\n * press, while an over-counted one costs the user a navigation they did make. */\nfunction runUnwind(): void {\n const job = unwind;\n unwind = null;\n if (!job) return;\n if (currentSentinel() !== job.id || currentHref() !== job.href) return;\n pendingProgrammatic += 1;\n window.history.go(-job.entries.length);\n}\n\nfunction currentHref(): string {\n return typeof window === \"undefined\" ? \"\" : window.location.href;\n}\n\nfunction forgetPushed(id: string): void {\n const at = pushed.findIndex((p) => p.id === id);\n if (at >= 0) pushed.splice(at, 1);\n}\n\n/**\n * The sentinel this module believes is on the entry we are standing on.\n *\n * `history.state` is where the tag physically sits, because it is the only\n * per-entry storage a browser has — but it is not this module's storage, so\n * since the 2026-09-22 audit it is no longer read as the last word.\n * The ROUTER owns that object and writes it WHOLE: every\n * `setSearchParams(…, { replace: true })` stamps `{usr, key, idx}` over\n * whatever was there. A `DataTable` with `urlSync` does exactly that, on mount\n * and on every filter change — so an overlay opened from such a table had its\n * tag wiped off the entry it was standing on, and then:\n *\n * * its cleanup read \"not my entry\" and abandoned a live entry as a husk;\n * * the push path below could not find itself in `pushed`, so it discarded\n * every record it had (`splice(0)`) and nothing was ever unwound again;\n * * the StrictMode adoption never matched, so in development every dialog\n * pushed a second entry and the deferred `go(-1)` ate the live one — which\n * is Back no longer closing the overlay at all.\n *\n * So `standing` answers when the tag is gone: a MISSING tag on an entry we have\n * not left is a wipe to repair rather than a verdict. The tag is still read\n * FIRST wherever it is there, because it is the one thing that can see a FOREIGN\n * same-URL entry stacked above ours (feedback #424/#426, below) — module-level\n * bookkeeping cannot, since nobody tells us about someone else's `pushState`.\n */\nlet standing: string | null = null;\n\n/** The tag actually on the current entry, with no repair and no belief. */\nfunction taggedSentinel(): string | null {\n const state = typeof window !== \"undefined\" ? window.history.state : null;\n if (!state || typeof state !== \"object\") return null;\n const id = (state as Record<string, unknown>)[SENTINEL_KEY];\n return typeof id === \"string\" ? id : null;\n}\n\n/** Put our tag back on the current entry, keeping whatever the router has since\n * written there — we are a passenger in that object, not its owner. */\nfunction retag(id: string): void {\n const prev = window.history.state;\n window.history.replaceState(\n { ...(prev && typeof prev === \"object\" ? prev : {}), [SENTINEL_KEY]: id },\n \"\",\n );\n}\n\nfunction currentSentinel(): string | null {\n const tag = taggedSentinel();\n if (tag !== null) {\n standing = tag;\n return tag;\n }\n if (standing === null || typeof window === \"undefined\") return null;\n // Only ever re-stamp an entry we still hold a record for. Without that guard a\n // belief left over from an overlay that is long gone — a tab that has since\n // navigated, a test file that ran another case — would be stamped onto a\n // stranger's entry, and the next cleanup would traverse off it.\n if (!pushed.some((p) => p.id === standing)) {\n standing = null;\n return null;\n }\n retag(standing);\n return standing;\n}\n\nfunction handlePop() {\n // A pop MOVES us, so the belief is stale by definition: re-read it from the\n // entry we have landed on before anything below consults it, or the repair in\n // `currentSentinel` would stamp the entry we just left onto the one we are on.\n standing = taggedSentinel();\n if (pendingProgrammatic > 0) {\n pendingProgrammatic -= 1;\n return;\n }\n // Nothing open → an ordinary navigation, which is none of our business.\n const top = stack[stack.length - 1];\n if (!top) return;\n // We landed back ON the top overlay's own entry, so that entry was NOT what the\n // pop consumed — something stacked ABOVE it was (Keksdose feedback #424/#426).\n // The app layers a second same-URL sentinel of its own on top of ours for the\n // unsaved-edit trap (`use-soft-leave-guard.ts`), and it pops that sentinel every\n // time the form goes back to clean — twice-toggling one field was enough to\n // close the whole dialog. A pop is only ours when the entry we came to rest on\n // is no longer ours: either the layer below (a different overlay's marker) or\n // the plain page entry (none at all).\n if (currentSentinel() === top.id) return;\n stack.pop();\n // The browser consumed this entry, so the overlay's own cleanup has nothing left\n // to unwind and nothing to record as owed.\n consumed.add(top.id);\n forgetPushed(top.id);\n top.close();\n}\n\nfunction ensureListening() {\n if (listening || typeof window === \"undefined\") return;\n window.addEventListener(\"popstate\", handlePop);\n listening = true;\n}\n\n/**\n * Make the platform Back gesture dismiss an overlay.\n *\n * @param open whether the overlay is currently showing. Components that mount\n * only while open (the common case) pass `true`.\n * @param onClose the overlay's own close handler — the same one Escape calls.\n */\nexport function useOverlayHistory(open: boolean, onClose: () => void): void {\n // The listener fires outside React's render, so it reads the latest handler\n // through a ref rather than through the closure the effect captured.\n const closeRef = useRef(onClose);\n useEffect(() => {\n closeRef.current = onClose;\n });\n\n useEffect(() => {\n if (!open || typeof window === \"undefined\") return;\n ensureListening();\n const id = `overlay-${(nextId += 1)}`;\n const entry: OverlayEntry = { id, close: () => closeRef.current() };\n stack.push(entry);\n const prev = window.history.state;\n const marked = { ...(prev && typeof prev === \"object\" ? prev : {}), [SENTINEL_KEY]: id };\n // An entry that is on its way out and that we are still standing on is ours\n // to take over: same URL, same slot, only the marker changes. Pushing a\n // second one on top of it is what used to leave a husk on every StrictMode\n // remount — see {@link Unwind}.\n const adopting = unwind && unwind.id === currentSentinel() && unwind.href === currentHref();\n if (adopting && unwind) {\n clearTimeout(unwind.timer);\n const inherited = unwind.entries;\n unwind = null;\n // Preserve react-router's own `{usr,key,idx}` — we only swap the marker,\n // and the entry we are swapping it on is the one the router is already on.\n window.history.replaceState(marked, \"\");\n // The abandoned ones beneath come back owed; ours takes the top slot.\n for (const owed of inherited.slice(0, -1)) pushed.push({ ...owed, dead: true });\n pushed.push({ id, href: currentHref(), dead: false });\n standing = id;\n } else {\n // A push DESTROYS every entry ahead of the one we are on, so anything we\n // still had recorded above our own position is gone. Kept, those would be\n // counted into a later `history.go(-n)` and the overshoot would come out\n // of a navigation the user actually made. Where we cannot tell which of\n // ours are beneath us — we are standing on a plain page entry, or on a\n // husk nobody tracks — none of them can be proven to be, so none survive.\n const under = pushed.findIndex((p) => p.id === currentSentinel());\n pushed.splice(under + 1);\n // Preserve react-router's own `{usr,key,idx}` — we only tack a marker on, and\n // the URL is unchanged, so the router treats popping this as a no-op re-render.\n window.history.pushState(marked, \"\");\n pushed.push({ id, href: currentHref(), dead: false });\n standing = id;\n }\n return () => {\n const at = stack.indexOf(entry);\n if (at >= 0) stack.splice(at, 1);\n\n // A Back press already took this entry; there is nothing to unwind or to owe.\n if (consumed.delete(id)) return;\n\n const mine = pushed.findIndex((p) => p.id === id);\n // Only unwind an entry that is still THE current one. If a router push landed\n // on top of it, going back would undo the user's navigation instead — and if\n // a SIBLING overlay's sentinel landed on top, that overlay is about to unwind\n // and is the one that can take ours with it.\n if (currentSentinel() !== id) {\n if (mine >= 0) pushed[mine].dead = true;\n return;\n }\n\n // Ours plus every abandoned entry lying directly beneath it at this address.\n // One traversal, so one popstate, so one programmatic pop to absorb.\n const here = currentHref();\n let steps = 1;\n while (steps <= mine && pushed[mine - steps].dead && pushed[mine - steps].href === here) {\n steps += 1;\n }\n const leaving = pushed.splice(mine - (steps - 1), steps);\n // Scheduled, not issued: an overlay opening in this same tick takes the\n // entry over instead, which is what makes the hook survive a StrictMode\n // remount. An unwind already waiting is dropped rather than merged — it\n // was the entry ABOVE ours and something has since moved off it, so its\n // count can no longer be proven, and an over-counted traversal costs a\n // navigation the user made while an under-counted one costs one dead Back.\n if (unwind) clearTimeout(unwind.timer);\n unwind = { timer: setTimeout(runUnwind, 0), id, href: here, entries: leaving };\n };\n }, [open]);\n}\n"],"mappings":";AAAA,SAAS,WAAW,cAAc;AAgDlC,MAAM,eAAe;AAOrB,MAAM,QAAwB,CAAC;AA6B/B,MAAM,SAAwB,CAAC;AAK/B,MAAM,WAAW,oBAAI,IAAY;AAKjC,IAAI,sBAAsB;AAC1B,IAAI,YAAY;AAChB,IAAI,SAAS;AAiCb,IAAI,SAAwB;AAS5B,SAAS,YAAkB;AACzB,QAAM,MAAM;AACZ,WAAS;AACT,MAAI,CAAC,IAAK;AACV,MAAI,gBAAgB,MAAM,IAAI,MAAM,YAAY,MAAM,IAAI,KAAM;AAChE,yBAAuB;AACvB,SAAO,QAAQ,GAAG,CAAC,IAAI,QAAQ,MAAM;AACvC;AAEA,SAAS,cAAsB;AAC7B,SAAO,OAAO,WAAW,cAAc,KAAK,OAAO,SAAS;AAC9D;AAEA,SAAS,aAAa,IAAkB;AACtC,QAAM,KAAK,OAAO,UAAU,CAAC,MAAM,EAAE,OAAO,EAAE;AAC9C,MAAI,MA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AAI,QAAQ,EAAG,QAAO,IAAI,EAAE,OAAO;AACnC;AAAA,MACF;AAIA,YAAM,OAAO,YAAY;AACzB,UAAI,QAAQ;AACZ,aAAO,SAAS,QAAQ,OAAO,OAAO,KAAK,EAAE,QAAQ,OAAO,OAAO,KAAK,EAAE,SAAS,MAAM;AACvF,iBAAS;AAAA,MACX;AACA,YAAM,UAAU,OAAO,OAAO,QAAQ,QAAQ,IAAI,KAAK;AAOvD,UAAI,OAAQ,cAAa,OAAO,KAAK;AACrC,eAAS,EAAE,OAAO,WAAW,WAAW,CAAC,GAAG,IAAI,MAAM,MAAM,SAAS,QAAQ;AAAA,IAC/E;AAAA,EACF,GAAG,CAAC,IAAI,CAAC;AACX;","names":[]}
1
+ {"version":3,"sources":["../../src/hooks/use-overlay-history.ts"],"sourcesContent":["import { useEffect, useRef } from \"react\";\n\n/**\n * Back closes the overlay, not the page (Keksdose feedback #172).\n *\n * On a phone the Back gesture is the universal \"dismiss this\" — so a dialog or a\n * full-screen search surface that ignores it doesn't merely fail to close: the\n * navigation lands somewhere else entirely, and on a route with nothing beneath it\n * that means leaving the app with the overlay still notionally open.\n *\n * The mechanism is one throwaway, SAME-URL history entry pushed while the overlay is\n * up. Back then pops a same-document entry — no route change, no re-render of the\n * page under it — and this hook turns that pop into `onClose()`. Same trick the\n * transactions page already uses for its unsaved-edit trap\n * (`use-soft-leave-guard.ts`); the two coexist because they use different marker\n * keys AND because `handlePop` only claims a pop that actually consumed OUR entry\n * — a foreign sentinel stacked on top of ours pops back ONTO us, and an overlay\n * that closed on that would vanish mid-edit (feedback #424/#426).\n *\n * Not a URL parameter, deliberately. Encoding \"a dialog is open\" in the address bar\n * makes it shareable and restorable, which is wrong for the overlays this covers —\n * nobody wants to send someone a link that opens a confirm dialog — and it would\n * fight the page-owned `?row=` / `f.*` params that ARE meaningful state.\n *\n * ## Ordering\n *\n * The stack is module-level because correctness here is about order ACROSS\n * instances: every mounted overlay hears the same `popstate`, but only the one whose\n * entry was actually popped may close. Overlays nest and unwind last-in-first-out —\n * a dialog opened from a search surface closes before the surface — so the top of\n * this stack is by construction the entry the browser just popped.\n *\n * ## Not undoing a real navigation\n *\n * The cleanup pops our entry when the overlay closes some other way (a button,\n * Escape, a backdrop click) so history doesn't silently accumulate dead entries. It\n * first checks that our marker is still the CURRENT entry: if the user followed a\n * link while the overlay was open, the router has pushed on top of us, and a blind\n * `history.back()` there would undo their navigation.\n *\n * ## The traversal is deferred\n *\n * And it is *scheduled* rather than issued, because `history.go()` lands a task\n * later while everything this module knows is written synchronously. See\n * {@link Unwind}: an overlay opening inside that window adopts the entry instead\n * of stacking a second one on it, which is what makes the hook survive React\n * StrictMode's mount → clean up → mount (steering-design feedback #49).\n */\nconst SENTINEL_KEY = \"__hbUiOverlayHistory\";\n\ninterface OverlayEntry {\n id: string;\n close: () => void;\n}\n\nconst stack: OverlayEntry[] = [];\n\n/**\n * The sentinels we have PUSHED and not yet unwound, oldest first.\n *\n * The stack above tracks live overlays; this tracks live history entries, and the\n * two come apart in exactly one case — which is the bug this list exists for.\n * Nested overlays that close in the same commit unwind parent-first, so the dialog's\n * cleanup runs while the sheet's entry is still on top of its own. It cannot call\n * `history.back()` there (that would consume the SHEET's entry, and the sheet is\n * about to consume it itself), so its entry was simply abandoned: a husk with no\n * live owner sitting between the user and the page.\n *\n * The user paid for it on the next Back press. It popped the husk, `handlePop` found\n * an empty stack and returned, and nothing visible happened — Back had to be pressed\n * twice to leave the page.\n *\n * So an abandoned entry is recorded as `dead` instead, and whichever overlay DOES\n * get to unwind pays the debt with a single `history.go(-n)`. `href` is what keeps\n * that safe: only dead entries pushed at the address we are still sitting at are\n * unwound, so a router navigation that landed between two sentinels is never\n * reversed on the user's behalf.\n */\ninterface PushedEntry {\n id: string;\n href: string;\n /** Its overlay is gone but the entry is not — someone above owes this pop. */\n dead: boolean;\n /** The router's `idx` on this entry when the marker went on — see {@link locate}. */\n idx: number | undefined;\n /** The router's `key` copied from the page entry beneath ours. */\n key: string | undefined;\n /** {@link routeOf} the address the marker was placed at. */\n route: string;\n}\nconst pushed: PushedEntry[] = [];\n\n/**\n * Entries of ours that a ROUTER NAVIGATION made from inside the overlay has left\n * behind — ours, still in the history, but no longer on top and no longer anyone's.\n *\n * Nothing can take an entry out from under a newer one, so they cannot be unwound;\n * what can be done is to not let the user land on one. A traversal that comes to\n * rest on a buried entry is carried straight on over the whole run of them, in the\n * direction it was going (see `skipBuried`): Back from the new page lands on the page\n * the overlay was opened from, Forward from there lands on the new page, and no press\n * is spent on an entry with nothing on screen for it.\n *\n * `below` / `above` count the buried entries of the same run on either side. The\n * router's `idx` tells the direction apart — except after a REPLACE navigation, when\n * the page above the run shares the run's `idx`; the two keys decide there.\n */\ninterface BuriedEntry {\n idx: number;\n /** The `idx` of the router entry that buried the run: higher after a push, the\n * same after a replace. */\n aboveIdx: number;\n /** The key of the page entry directly beneath the run. */\n belowKey: string | undefined;\n /** The key of the router entry that buried the run, when it did. */\n aboveKey: string | undefined;\n below: number;\n above: number;\n}\nconst buried = new Map<string, BuriedEntry>();\n\n/** The router `{idx, key}` of the entry the last traversal (or burial) left us on —\n * what `skipBuried` compares against to know which way the user was going. */\nlet lastSeen: { idx: number | undefined; key: string | undefined } | null = null;\n\n/** Entries a real Back press already consumed. Their overlay's cleanup still has to\n * run, and it must not mistake \"my entry is not current\" for \"my entry is buried\"\n * — it has no entry left at all. */\nconst consumed = new Set<string>();\n\n/** Pops WE caused (a cleanup unwinding its own entries) — their `popstate` is\n * bookkeeping, not a user gesture, and must not close a second overlay. A\n * `history.go(-n)` traversal fires exactly ONE popstate however far it travels. */\nlet pendingProgrammatic = 0;\nlet listening = false;\nlet nextId = 0;\n\n/**\n * The unwind a cleanup has asked for and not yet issued.\n *\n * **`history.go()` is asynchronous and everything above is written\n * synchronously**, which is the seam the whole of this block exists to close.\n * The traversal lands a task later, so an overlay that opens in the *same* tick\n * as one that closed used to push its sentinel on top of the entry that was\n * about to be popped — and the pop then took the NEW entry. The overlay left on\n * screen had no entry of its own (so Back no longer closed it) and the old one\n * stayed behind as a husk between the user and their page.\n *\n * That is not an exotic race. **React StrictMode remounts every effect** — mount,\n * clean up, mount again, all in one commit — so in development *every* dialog\n * anyone opened left a husk behind, the position drifted one entry further from\n * the page on each open, and the Back press that was meant to leave the page was\n * spent on something invisible instead (steering-design feedback #49).\n *\n * So the traversal is deferred by a task, and an overlay mounting inside that\n * window **adopts** the entry instead of pushing a second one (see the effect).\n * Adoption is `replaceState` on an entry that is already there: no traversal, no\n * window in which the count can be wrong, and the StrictMode remount costs\n * exactly nothing.\n */\ninterface Unwind {\n timer: ReturnType<typeof setTimeout>;\n /** The sentinel on the entry to leave — the top of `entries`. */\n id: string;\n href: string;\n /** That entry plus the abandoned ones directly beneath it, oldest first. */\n entries: PushedEntry[];\n}\nlet unwind: Unwind | null = null;\n\n/** Issue the deferred traversal, if the ground has not moved under it.\n *\n * A real Back press or a router navigation during the deferred task leaves us\n * somewhere that is not the entry we meant to leave, and going back from there\n * would take something that is not ours. The entries are then simply forgotten\n * rather than handed back as `dead`: a forgotten entry costs one dead Back\n * press, while an over-counted one costs the user a navigation they did make. */\nfunction runUnwind(): void {\n const job = unwind;\n unwind = null;\n if (!job) return;\n if (currentSentinel() !== job.id || currentHref() !== job.href) {\n // A router navigation landed between the cleanup and this task: the entries\n // are under it (or were replaced by it) rather than simply forgotten.\n if (taggedSentinel() === null) buryUnder(job.entries);\n return;\n }\n pendingProgrammatic += 1;\n window.history.go(-job.entries.length);\n}\n\nfunction currentHref(): string {\n return typeof window === \"undefined\" ? \"\" : window.location.href;\n}\n\n/** The router's own `{idx, key}` on the current entry, where a router has put them. */\nfunction routerMark(): { idx: number | undefined; key: string | undefined } {\n const state = typeof window !== \"undefined\" ? (window.history.state as unknown) : null;\n if (!state || typeof state !== \"object\") return { idx: undefined, key: undefined };\n const { idx, key } = state as Record<string, unknown>;\n return { idx: typeof idx === \"number\" ? idx : undefined, key: typeof key === \"string\" ? key : undefined };\n}\n\n/**\n * The part of an address that names the PAGE — the query string left out.\n *\n * A `setSearchParams(…, { replace: true })` rewrites the query on the entry the\n * overlay is standing on; that is a wipe to repair, not a move. Anything else changing\n * is a navigation. Under a hash router the page lives in the hash (`#/table?f.q=x`), so\n * a hash that starts with `#/` counts up to its own `?`; an ordinary `#fragment` does\n * not name a page and is left out.\n */\nfunction routeOf(href: string): string {\n try {\n const url = new URL(href);\n const hashRoute = url.hash.startsWith(\"#/\") ? url.hash.split(\"?\")[0] : \"\";\n return url.origin + url.pathname + hashRoute;\n } catch {\n return href;\n }\n}\n\n/**\n * Is the untagged entry we are standing on still `p`'s — merely wiped by the router —\n * or an entry the router NAVIGATED to from inside the overlay?\n *\n * The router's `idx` is the one per-entry fact that separates the two, because it is\n * the one the router itself keeps straight: a replace leaves it as it was, a push adds\n * one. Our own push copies the page's state, so our entry carries the page's `idx` and\n * a router push on top of it carries one more. The key would not do — every replace\n * mints a new one, so the wipe this repair exists for would already fail it. Neither\n * would the address alone: a push to the address we are already at is still a push.\n *\n * `idx` does not see one move, the router REPLACING our entry with a different page\n * (same `idx`), so the page named by the address must also be unchanged. Where there is\n * no `idx` to compare (no router, or one that keeps none) the address is all there is.\n */\nfunction isStillOn(p: PushedEntry): boolean {\n if (routeOf(currentHref()) !== p.route) return false;\n const { idx } = routerMark();\n return idx === undefined || p.idx === undefined || idx === p.idx;\n}\n\n/**\n * The router has navigated while our entries were on top: record which of `records`\n * (ours, oldest first, ending with the top one) it buried and which it replaced, and\n * drop them from `pushed` — none of them can be unwound any more. Returns whether it\n * recognised a navigation at all; when it cannot tell (no router `idx` to go by), it\n * leaves everything as it was and the caller falls back to marking the entry dead.\n */\nfunction buryUnder(records: PushedEntry[]): boolean {\n const top = records[records.length - 1];\n const here = routerMark();\n if (!top || top.idx === undefined || here.idx === undefined) return false;\n let run: PushedEntry[];\n if (here.idx > top.idx) {\n run = [];\n for (let i = records.length - 1; i >= 0 && records[i].idx === top.idx; i -= 1) run.unshift(records[i]);\n } else if (here.idx === top.idx && !isStillOn(top)) {\n // Replaced: the top entry IS the new page now, and gone as ours. Those beneath it\n // are buried under it.\n run = [];\n for (let i = records.length - 2; i >= 0 && records[i].idx === top.idx; i -= 1) run.unshift(records[i]);\n } else {\n return false;\n }\n run.forEach((r, i) => {\n buried.set(r.id, {\n idx: top.idx as number,\n aboveIdx: here.idx as number,\n belowKey: run[0].key,\n aboveKey: here.key,\n below: i,\n above: run.length - 1 - i,\n });\n });\n for (const r of records) forgetPushed(r.id);\n lastSeen = here;\n return true;\n}\n\n/**\n * A traversal came to rest on one of our buried entries: carry it on over the run, the\n * way it was going. Back from above (a higher `idx`, or the very entry that buried us)\n * continues down to the page beneath; Forward from that page continues up. A landing\n * from anywhere this cannot place is left alone — one idle press is the price of not\n * guessing, and a wrong guess would move the user somewhere they did not ask to go.\n */\nfunction skipBuried(from: typeof lastSeen): void {\n const tag = taggedSentinel();\n const rec = tag !== null ? buried.get(tag) : undefined;\n if (!rec || !from || stack.some((e) => e.id === tag)) return;\n let steps = 0;\n if ((from.idx !== undefined && from.idx > rec.idx) || (from.key !== undefined && from.key === rec.aboveKey)) {\n steps = -(rec.below + 1);\n } else if (\n from.idx !== undefined &&\n // Below the run, or level with it when nothing above it is (a push buried it),\n // or level with it and provably the page beneath (a replace buried it). The\n // router's first entry has no key at all, so an absent key is a key here.\n (from.idx < rec.idx || (from.idx === rec.idx && (rec.aboveIdx > rec.idx || from.key === rec.belowKey)))\n ) {\n steps = rec.above + 1;\n }\n if (steps === 0) return;\n pendingProgrammatic += 1;\n window.history.go(steps);\n}\n\nfunction forgetPushed(id: string): void {\n const at = pushed.findIndex((p) => p.id === id);\n if (at >= 0) pushed.splice(at, 1);\n}\n\n/**\n * The sentinel this module believes is on the entry we are standing on.\n *\n * `history.state` is where the tag physically sits, because it is the only\n * per-entry storage a browser has — but it is not this module's storage, so\n * since the 2026-09-22 audit it is no longer read as the last word.\n * The ROUTER owns that object and writes it WHOLE: every\n * `setSearchParams(…, { replace: true })` stamps `{usr, key, idx}` over\n * whatever was there. A `DataTable` with `urlSync` does exactly that, on mount\n * and on every filter change — so an overlay opened from such a table had its\n * tag wiped off the entry it was standing on, and then:\n *\n * * its cleanup read \"not my entry\" and abandoned a live entry as a husk;\n * * the push path below could not find itself in `pushed`, so it discarded\n * every record it had (`splice(0)`) and nothing was ever unwound again;\n * * the StrictMode adoption never matched, so in development every dialog\n * pushed a second entry and the deferred `go(-1)` ate the live one — which\n * is Back no longer closing the overlay at all.\n *\n * So `standing` answers when the tag is gone: a MISSING tag on an entry we have\n * not left is a wipe to repair rather than a verdict. The tag is still read\n * FIRST wherever it is there, because it is the one thing that can see a FOREIGN\n * same-URL entry stacked above ours (feedback #424/#426, below) — module-level\n * bookkeeping cannot, since nobody tells us about someone else's `pushState`.\n */\nlet standing: string | null = null;\n\n/** The tag actually on the current entry, with no repair and no belief. */\nfunction taggedSentinel(): string | null {\n const state = typeof window !== \"undefined\" ? window.history.state : null;\n if (!state || typeof state !== \"object\") return null;\n const id = (state as Record<string, unknown>)[SENTINEL_KEY];\n return typeof id === \"string\" ? id : null;\n}\n\n/** Put our tag back on the current entry, keeping whatever the router has since\n * written there — we are a passenger in that object, not its owner. */\nfunction retag(id: string): void {\n const prev = window.history.state;\n window.history.replaceState(\n { ...(prev && typeof prev === \"object\" ? prev : {}), [SENTINEL_KEY]: id },\n \"\",\n );\n}\n\nfunction currentSentinel(): string | null {\n const tag = taggedSentinel();\n if (tag !== null) {\n standing = tag;\n return tag;\n }\n if (standing === null || typeof window === \"undefined\") return null;\n // Only ever re-stamp an entry we still hold a record for. Without that guard a\n // belief left over from an overlay that is long gone — a tab that has since\n // navigated, a test file that ran another case — would be stamped onto a\n // stranger's entry, and the next cleanup would traverse off it.\n //\n // And only an entry that is still the one the marker was placed on. A row that\n // NAVIGATES (a palette result, a dialog's link) has the router push the new page\n // before the overlay's cleanup runs; that entry carries no tag either, and\n // re-stamping it made the cleanup \"unwind\" the navigation itself — the page\n // changed and changed straight back. See `isStillOn` for how the two are told apart.\n const record = pushed.find((p) => p.id === standing);\n if (!record || !isStillOn(record)) {\n standing = null;\n return null;\n }\n retag(standing);\n return standing;\n}\n\nfunction handlePop() {\n // A pop MOVES us, so the belief is stale by definition: re-read it from the\n // entry we have landed on before anything below consults it, or the repair in\n // `currentSentinel` would stamp the entry we just left onto the one we are on.\n standing = taggedSentinel();\n const from = lastSeen;\n lastSeen = routerMark();\n if (pendingProgrammatic > 0) {\n pendingProgrammatic -= 1;\n return;\n }\n closeOnPop();\n skipBuried(from);\n}\n\nfunction closeOnPop() {\n // Nothing open → an ordinary navigation, which is none of our business.\n const top = stack[stack.length - 1];\n if (!top) return;\n // We landed back ON the top overlay's own entry, so that entry was NOT what the\n // pop consumed — something stacked ABOVE it was (Keksdose feedback #424/#426).\n // The app layers a second same-URL sentinel of its own on top of ours for the\n // unsaved-edit trap (`use-soft-leave-guard.ts`), and it pops that sentinel every\n // time the form goes back to clean — twice-toggling one field was enough to\n // close the whole dialog. A pop is only ours when the entry we came to rest on\n // is no longer ours: either the layer below (a different overlay's marker) or\n // the plain page entry (none at all).\n if (currentSentinel() === top.id) return;\n stack.pop();\n // The browser consumed this entry, so the overlay's own cleanup has nothing left\n // to unwind and nothing to record as owed.\n consumed.add(top.id);\n forgetPushed(top.id);\n top.close();\n}\n\nfunction ensureListening() {\n if (listening || typeof window === \"undefined\") return;\n window.addEventListener(\"popstate\", handlePop);\n listening = true;\n}\n\n/**\n * Make the platform Back gesture dismiss an overlay.\n *\n * @param open whether the overlay is currently showing. Components that mount\n * only while open (the common case) pass `true`.\n * @param onClose the overlay's own close handler — the same one Escape calls.\n */\nexport function useOverlayHistory(open: boolean, onClose: () => void): void {\n // The listener fires outside React's render, so it reads the latest handler\n // through a ref rather than through the closure the effect captured.\n const closeRef = useRef(onClose);\n useEffect(() => {\n closeRef.current = onClose;\n });\n\n useEffect(() => {\n if (!open || typeof window === \"undefined\") return;\n ensureListening();\n const id = `overlay-${(nextId += 1)}`;\n const entry: OverlayEntry = { id, close: () => closeRef.current() };\n stack.push(entry);\n const prev = window.history.state;\n const marked = { ...(prev && typeof prev === \"object\" ? prev : {}), [SENTINEL_KEY]: id };\n // An entry that is on its way out and that we are still standing on is ours\n // to take over: same URL, same slot, only the marker changes. Pushing a\n // second one on top of it is what used to leave a husk on every StrictMode\n // remount — see {@link Unwind}.\n const adopting = unwind && unwind.id === currentSentinel() && unwind.href === currentHref();\n if (adopting && unwind) {\n clearTimeout(unwind.timer);\n const inherited = unwind.entries;\n unwind = null;\n // Preserve react-router's own `{usr,key,idx}` — we only swap the marker,\n // and the entry we are swapping it on is the one the router is already on.\n window.history.replaceState(marked, \"\");\n // The abandoned ones beneath come back owed; ours takes the top slot.\n for (const owed of inherited.slice(0, -1)) pushed.push({ ...owed, dead: true });\n const was = inherited[inherited.length - 1];\n pushed.push({ id, href: currentHref(), dead: false, idx: was.idx, key: was.key, route: was.route });\n standing = id;\n } else {\n // A push DESTROYS every entry ahead of the one we are on, so anything we\n // still had recorded above our own position is gone. Kept, those would be\n // counted into a later `history.go(-n)` and the overshoot would come out\n // of a navigation the user actually made. Where we cannot tell which of\n // ours are beneath us — we are standing on a plain page entry, or on a\n // husk nobody tracks — none of them can be proven to be, so none survive.\n const under = pushed.findIndex((p) => p.id === currentSentinel());\n pushed.splice(under + 1);\n // Preserve react-router's own `{usr,key,idx}` — we only tack a marker on, and\n // the URL is unchanged, so the router treats popping this as a no-op re-render.\n window.history.pushState(marked, \"\");\n const page = routerMark();\n pushed.push({ id, href: currentHref(), dead: false, idx: page.idx, key: page.key, route: routeOf(currentHref()) });\n standing = id;\n }\n return () => {\n const at = stack.indexOf(entry);\n if (at >= 0) stack.splice(at, 1);\n\n // A Back press already took this entry; there is nothing to unwind or to owe.\n if (consumed.delete(id)) return;\n\n const mine = pushed.findIndex((p) => p.id === id);\n // Only unwind an entry that is still THE current one. If a router push landed\n // on top of it, going back would undo the user's navigation instead — and if\n // a SIBLING overlay's sentinel landed on top, that overlay is about to unwind\n // and is the one that can take ours with it.\n if (currentSentinel() !== id) {\n // A router navigation from inside the overlay: nothing to unwind — the\n // entries it left beneath the new page are skipped over instead.\n if (mine >= 0 && taggedSentinel() === null && buryUnder(pushed.slice(0, pushed.length))) return;\n if (mine >= 0) pushed[mine].dead = true;\n return;\n }\n\n // Ours plus every abandoned entry lying directly beneath it at this address.\n // One traversal, so one popstate, so one programmatic pop to absorb.\n const here = currentHref();\n let steps = 1;\n while (steps <= mine && pushed[mine - steps].dead && pushed[mine - steps].href === here) {\n steps += 1;\n }\n const leaving = pushed.splice(mine - (steps - 1), steps);\n // Scheduled, not issued: an overlay opening in this same tick takes the\n // entry over instead, which is what makes the hook survive a StrictMode\n // remount. An unwind already waiting is dropped rather than merged — it\n // was the entry ABOVE ours and something has since moved off it, so its\n // count can no longer be proven, and an over-counted traversal costs a\n // navigation the user made while an under-counted one costs one dead Back.\n if (unwind) clearTimeout(unwind.timer);\n unwind = { timer: setTimeout(runUnwind, 0), id, href: here, entries: leaving };\n };\n }, [open]);\n}\n"],"mappings":";AAAA,SAAS,WAAW,cAAc;AAgDlC,MAAM,eAAe;AAOrB,MAAM,QAAwB,CAAC;AAmC/B,MAAM,SAAwB,CAAC;AA6B/B,MAAM,SAAS,oBAAI,IAAyB;AAI5C,IAAI,WAAwE;AAK5E,MAAM,WAAW,oBAAI,IAAY;AAKjC,IAAI,sBAAsB;AAC1B,IAAI,YAAY;AAChB,IAAI,SAAS;AAiCb,IAAI,SAAwB;AAS5B,SAAS,YAAkB;AACzB,QAAM,MAAM;AACZ,WAAS;AACT,MAAI,CAAC,IAAK;AACV,MAAI,gBAAgB,MAAM,IAAI,MAAM,YAAY,MAAM,IAAI,MAAM;AAG9D,QAAI,eAAe,MAAM,KAAM,WAAU,IAAI,OAAO;AACpD;AAAA,EACF;AACA,yBAAuB;AACvB,SAAO,QAAQ,GAAG,CAAC,IAAI,QAAQ,MAAM;AACvC;AAEA,SAAS,cAAsB;AAC7B,SAAO,OAAO,WAAW,c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;AACjH,iBAAW;AAAA,IACb;AACA,WAAO,MAAM;AACX,YAAM,KAAK,MAAM,QAAQ,KAAK;AAC9B,UAAI,MAAM,EAAG,OAAM,OAAO,IAAI,CAAC;AAG/B,UAAI,SAAS,OAAO,EAAE,EAAG;AAEzB,YAAM,OAAO,OAAO,UAAU,CAAC,MAAM,EAAE,OAAO,EAAE;AAKhD,UAAI,gBAAgB,MAAM,IAAI;AAG5B,YAAI,QAAQ,KAAK,eAAe,MAAM,QAAQ,UAAU,OAAO,MAAM,GAAG,OAAO,MAAM,CAAC,EAAG;AACzF,YAAI,QAAQ,EAAG,QAAO,IAAI,EAAE,OAAO;AACnC;AAAA,MACF;AAIA,YAAM,OAAO,YAAY;AACzB,UAAI,QAAQ;AACZ,aAAO,SAAS,QAAQ,OAAO,OAAO,KAAK,EAAE,QAAQ,OAAO,OAAO,KAAK,EAAE,SAAS,MAAM;AACvF,iBAAS;AAAA,MACX;AACA,YAAM,UAAU,OAAO,OAAO,QAAQ,QAAQ,IAAI,KAAK;AAOvD,UAAI,OAAQ,cAAa,OAAO,KAAK;AACrC,eAAS,EAAE,OAAO,WAAW,WAAW,CAAC,GAAG,IAAI,MAAM,MAAM,SAAS,QAAQ;AAAA,IAC/E;AAAA,EACF,GAAG,CAAC,IAAI,CAAC;AACX;","names":[]}
@@ -12,6 +12,8 @@ import '../hooks/use-anchored-rect.js';
12
12
  import '../wizard/types.js';
13
13
  import '../tour/tour.js';
14
14
  import '../search/command-palette.js';
15
+ import '../search/global-search.js';
16
+ import '../search/search-index.js';
15
17
  import '../components/month-picker.js';
16
18
  import '../components/page-contents.js';
17
19
  import '../components/series-chart-labels.js';
@@ -10,6 +10,7 @@ import { DEFAULT_PASSWORD_REVEAL_LABELS, DEFAULT_TABS_LABELS } from "../componen
10
10
  import { DEFAULT_WIZARD_LABELS } from "../wizard/types.js";
11
11
  import { DEFAULT_TOUR_LABELS } from "../tour/tour.js";
12
12
  import { DEFAULT_COMMAND_PALETTE_LABELS } from "../search/command-palette.js";
13
+ import { DEFAULT_GLOBAL_SEARCH_LABELS } from "../search/global-search.js";
13
14
  import { DEFAULT_SERIES_CHART_LABELS } from "../components/series-chart-labels.js";
14
15
  import { DEFAULT_SPARKLINE_LABELS } from "../components/sparkline.js";
15
16
  import { DEFAULT_STAT_TILE_LABELS } from "../components/stat-tile.js";
@@ -62,6 +63,7 @@ const DEFAULT_UI_KIT_LABELS = {
62
63
  wizard: DEFAULT_WIZARD_LABELS,
63
64
  tour: DEFAULT_TOUR_LABELS,
64
65
  commandPalette: DEFAULT_COMMAND_PALETTE_LABELS,
66
+ globalSearch: DEFAULT_GLOBAL_SEARCH_LABELS,
65
67
  seriesChart: DEFAULT_SERIES_CHART_LABELS,
66
68
  sparkline: DEFAULT_SPARKLINE_LABELS,
67
69
  statTile: DEFAULT_STAT_TILE_LABELS,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/i18n/defaults.ts"],"sourcesContent":["import { DEFAULT_DATA_TABLE_LABELS } from \"../components/data-table-labels\";\nimport { DEFAULT_MINI_CALENDAR_LABELS } from \"../components/mini-calendar\";\nimport { DEFAULT_MONTH_PICKER_LABELS } from \"../components/month-picker\";\nimport { DEFAULT_PAGE_CONTENTS_LABELS } from \"../components/page-contents\";\nimport { DEFAULT_POPOVER_LABELS } from \"../components/popover\";\nimport { DEFAULT_CHIP_INPUT_LABELS } from \"../components/chip\";\nimport { DEFAULT_FIELD_SYNC_LABELS } from \"../components/field-sync\";\nimport { DEFAULT_PASSWORD_REVEAL_LABELS, DEFAULT_TABS_LABELS } from \"../components/ui\";\nimport { DEFAULT_WIZARD_LABELS } from \"../wizard/types\";\nimport { DEFAULT_TOUR_LABELS } from \"../tour/tour\";\nimport { DEFAULT_COMMAND_PALETTE_LABELS } from \"../search/command-palette\";\nimport { DEFAULT_SERIES_CHART_LABELS } from \"../components/series-chart-labels\";\nimport { DEFAULT_SPARKLINE_LABELS } from \"../components/sparkline\";\nimport { DEFAULT_STAT_TILE_LABELS } from \"../components/stat-tile\";\nimport { DEFAULT_SIGNATURE_PAD_LABELS } from \"../components/signature-pad\";\nimport { DEFAULT_PASSWORD_STRENGTH_LABELS } from \"../components/password-strength\";\nimport { DEFAULT_DANGER_CONFIRM_LABELS } from \"../components/danger-confirm\";\nimport { DEFAULT_SWATCH_PICKER_LABELS } from \"../components/swatch-picker\";\nimport { DEFAULT_ICON_PICKER_LABELS } from \"../components/icon-picker\";\nimport { DEFAULT_DIALOG_FRAME_LABELS } from \"../components/dialog-frame\";\nimport { DEFAULT_FILE_PICKER_LABELS } from \"../components/file-button\";\nimport { DEFAULT_MEASURED_GRID_LABELS } from \"../components/measured-grid\";\nimport { DEFAULT_CONFIRM_DIALOG_LABELS } from \"../components/confirm-dialog\";\nimport { DEFAULT_FLOATING_PANEL_LABELS } from \"../components/floating-panel\";\nimport { DEFAULT_FEEDBACK_ATTACHMENT_LABELS } from \"../feedback/feedback-attachment\";\nimport { DEFAULT_COPY_BUTTON_LABELS } from \"../components/copy-button\";\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} from \"./kit-labels\";\nimport type { UiKitLabels } from \"./kit-labels\";\n\n/**\n * The whole English tree in one object: what a translation is written against, and\n * the `reference` for {@link missingKitLabels}.\n *\n * A separate module from the provider on purpose. Components import the provider's\n * hooks; this file imports the components' defaults. Kept together they would be an\n * import cycle through every component in the kit.\n */\nexport const DEFAULT_UI_KIT_LABELS: UiKitLabels = {\n common: DEFAULT_COMMON_LABELS,\n dataTable: DEFAULT_DATA_TABLE_LABELS,\n miniCalendar: DEFAULT_MINI_CALENDAR_LABELS,\n datePicker: DEFAULT_DATE_PICKER_LABELS,\n monthPicker: DEFAULT_MONTH_PICKER_LABELS,\n popover: DEFAULT_POPOVER_LABELS,\n combobox: DEFAULT_COMBOBOX_LABELS,\n multiSelect: DEFAULT_MULTI_SELECT_LABELS,\n calculator: DEFAULT_CALCULATOR_LABELS,\n currency: DEFAULT_CURRENCY_LABELS,\n chipInput: DEFAULT_CHIP_INPUT_LABELS,\n fieldSync: DEFAULT_FIELD_SYNC_LABELS,\n passwordReveal: DEFAULT_PASSWORD_REVEAL_LABELS,\n tabs: DEFAULT_TABS_LABELS,\n appShell: DEFAULT_APP_SHELL_LABELS,\n pageContents: DEFAULT_PAGE_CONTENTS_LABELS,\n topBar: DEFAULT_TOP_BAR_LABELS,\n pickerSheet: DEFAULT_PICKER_SHEET_LABELS,\n swipeableRow: DEFAULT_SWIPEABLE_ROW_LABELS,\n file: DEFAULT_FILE_LABELS,\n wizard: DEFAULT_WIZARD_LABELS,\n tour: DEFAULT_TOUR_LABELS,\n commandPalette: DEFAULT_COMMAND_PALETTE_LABELS,\n seriesChart: DEFAULT_SERIES_CHART_LABELS,\n sparkline: DEFAULT_SPARKLINE_LABELS,\n statTile: DEFAULT_STAT_TILE_LABELS,\n signaturePad: DEFAULT_SIGNATURE_PAD_LABELS,\n passwordStrength: DEFAULT_PASSWORD_STRENGTH_LABELS,\n dangerConfirm: DEFAULT_DANGER_CONFIRM_LABELS,\n swatchPicker: DEFAULT_SWATCH_PICKER_LABELS,\n iconPicker: DEFAULT_ICON_PICKER_LABELS,\n dialogFrame: DEFAULT_DIALOG_FRAME_LABELS,\n filePicker: DEFAULT_FILE_PICKER_LABELS,\n measuredGrid: DEFAULT_MEASURED_GRID_LABELS,\n feedbackAttachment: DEFAULT_FEEDBACK_ATTACHMENT_LABELS,\n confirmDialog: DEFAULT_CONFIRM_DIALOG_LABELS,\n floatingPanel: DEFAULT_FLOATING_PANEL_LABELS,\n copyButton: DEFAULT_COPY_BUTT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AAA,EAClB,eAAe;AAAA,EACf,cAAc;AAAA,EACd,YAAY;AAAA,EACZ,aAAa;AAAA,EACb,YAAY;AAAA,EACZ,cAAc;AAAA,EACd,oBAAoB;AAAA,EACpB,eAAe;AAAA,EACf,eAAe;AAAA,EACf,YAAY;AACd;","names":[]}
1
+ {"version":3,"sources":["../../src/i18n/defaults.ts"],"sourcesContent":["import { DEFAULT_DATA_TABLE_LABELS } from \"../components/data-table-labels\";\nimport { DEFAULT_MINI_CALENDAR_LABELS } from \"../components/mini-calendar\";\nimport { DEFAULT_MONTH_PICKER_LABELS } from \"../components/month-picker\";\nimport { DEFAULT_PAGE_CONTENTS_LABELS } from \"../components/page-contents\";\nimport { DEFAULT_POPOVER_LABELS } from \"../components/popover\";\nimport { DEFAULT_CHIP_INPUT_LABELS } from \"../components/chip\";\nimport { DEFAULT_FIELD_SYNC_LABELS } from \"../components/field-sync\";\nimport { DEFAULT_PASSWORD_REVEAL_LABELS, DEFAULT_TABS_LABELS } from \"../components/ui\";\nimport { DEFAULT_WIZARD_LABELS } from \"../wizard/types\";\nimport { DEFAULT_TOUR_LABELS } from \"../tour/tour\";\nimport { DEFAULT_COMMAND_PALETTE_LABELS } from \"../search/command-palette\";\nimport { DEFAULT_GLOBAL_SEARCH_LABELS } from \"../search/global-search\";\nimport { DEFAULT_SERIES_CHART_LABELS } from \"../components/series-chart-labels\";\nimport { DEFAULT_SPARKLINE_LABELS } from \"../components/sparkline\";\nimport { DEFAULT_STAT_TILE_LABELS } from \"../components/stat-tile\";\nimport { DEFAULT_SIGNATURE_PAD_LABELS } from \"../components/signature-pad\";\nimport { DEFAULT_PASSWORD_STRENGTH_LABELS } from \"../components/password-strength\";\nimport { DEFAULT_DANGER_CONFIRM_LABELS } from \"../components/danger-confirm\";\nimport { DEFAULT_SWATCH_PICKER_LABELS } from \"../components/swatch-picker\";\nimport { DEFAULT_ICON_PICKER_LABELS } from \"../components/icon-picker\";\nimport { DEFAULT_DIALOG_FRAME_LABELS } from \"../components/dialog-frame\";\nimport { DEFAULT_FILE_PICKER_LABELS } from \"../components/file-button\";\nimport { DEFAULT_MEASURED_GRID_LABELS } from \"../components/measured-grid\";\nimport { DEFAULT_CONFIRM_DIALOG_LABELS } from \"../components/confirm-dialog\";\nimport { DEFAULT_FLOATING_PANEL_LABELS } from \"../components/floating-panel\";\nimport { DEFAULT_FEEDBACK_ATTACHMENT_LABELS } from \"../feedback/feedback-attachment\";\nimport { DEFAULT_COPY_BUTTON_LABELS } from \"../components/copy-button\";\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} from \"./kit-labels\";\nimport type { UiKitLabels } from \"./kit-labels\";\n\n/**\n * The whole English tree in one object: what a translation is written against, and\n * the `reference` for {@link missingKitLabels}.\n *\n * A separate module from the provider on purpose. Components import the provider's\n * hooks; this file imports the components' defaults. Kept together they would be an\n * import cycle through every component in the kit.\n */\nexport const DEFAULT_UI_KIT_LABELS: UiKitLabels = {\n common: DEFAULT_COMMON_LABELS,\n dataTable: DEFAULT_DATA_TABLE_LABELS,\n miniCalendar: DEFAULT_MINI_CALENDAR_LABELS,\n datePicker: DEFAULT_DATE_PICKER_LABELS,\n monthPicker: DEFAULT_MONTH_PICKER_LABELS,\n popover: DEFAULT_POPOVER_LABELS,\n combobox: DEFAULT_COMBOBOX_LABELS,\n multiSelect: DEFAULT_MULTI_SELECT_LABELS,\n calculator: DEFAULT_CALCULATOR_LABELS,\n currency: DEFAULT_CURRENCY_LABELS,\n chipInput: DEFAULT_CHIP_INPUT_LABELS,\n fieldSync: DEFAULT_FIELD_SYNC_LABELS,\n passwordReveal: DEFAULT_PASSWORD_REVEAL_LABELS,\n tabs: DEFAULT_TABS_LABELS,\n appShell: DEFAULT_APP_SHELL_LABELS,\n pageContents: DEFAULT_PAGE_CONTENTS_LABELS,\n topBar: DEFAULT_TOP_BAR_LABELS,\n pickerSheet: DEFAULT_PICKER_SHEET_LABELS,\n swipeableRow: DEFAULT_SWIPEABLE_ROW_LABELS,\n file: DEFAULT_FILE_LABELS,\n wizard: DEFAULT_WIZARD_LABELS,\n tour: DEFAULT_TOUR_LABELS,\n commandPalette: DEFAULT_COMMAND_PALETTE_LABELS,\n globalSearch: DEFAULT_GLOBAL_SEARCH_LABELS,\n seriesChart: DEFAULT_SERIES_CHART_LABELS,\n sparkline: DEFAULT_SPARKLINE_LABELS,\n statTile: DEFAULT_STAT_TILE_LABELS,\n signaturePad: DEFAULT_SIGNATURE_PAD_LABELS,\n passwordStrength: DEFAULT_PASSWORD_STRENGTH_LABELS,\n dangerConfirm: DEFAULT_DANGER_CONFIRM_LABELS,\n swatchPicker: DEFAULT_SWATCH_PICKER_LABELS,\n iconPicker: DEFAULT_ICON_PICKER_LABELS,\n dialogFrame: DEFAULT_DIALOG_FRAME_LABELS,\n filePicker: DEFAULT_FILE_PICKER_LABELS,\n measuredGrid: DEFAULT_MEASURED_GRID_LABELS,\n feedbackAttachment: DEFAULT_FEEDBACK_ATTACHMENT_LABELS,\n confirmDialog: DEFAULT_CONFIRM_DIALOG_LABELS,\n floatingPanel: DEFAULT_FLOATING_PANEL_LABELS,\n copyButton: DEFAULT_COPY_BUTTON_LABELS,\n};\n"],"mappings":";AAAA,SAAS,iCAAiC;AAC1C,SAAS,oCAAoC;AAC7C,SAAS,mCAAmC;AAC5C,SAAS,oCAAoC;AAC7C,SAAS,8BAA8B;AACvC,SAAS,iCAAiC;AAC1C,SAAS,iCAAiC;AAC1C,SAAS,gCAAgC,2BAA2B;AACpE,SAAS,6BAA6B;AACtC,SAAS,2BAA2B;AACpC,SAAS,sCAAs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absLabels } from '../components/ui.js';
9
9
  import { WizardLabels } from '../wizard/types.js';
10
10
  import { TourLabels } from '../tour/tour.js';
11
11
  import { CommandPaletteLabels } from '../search/command-palette.js';
12
+ import { GlobalSearchLabels } from '../search/global-search.js';
12
13
  import { MonthPickerLabels } from '../components/month-picker.js';
13
14
  import { PageContentsLabels } from '../components/page-contents.js';
14
15
  import { SeriesChartLabels } from '../components/series-chart-labels.js';
@@ -29,6 +30,7 @@ import { CopyButtonLabels } from '../components/copy-button.js';
29
30
  import 'lucide-react';
30
31
  import '../components/tooltip.js';
31
32
  import '../hooks/use-anchored-rect.js';
33
+ import '../search/search-index.js';
32
34
  import '../components/tile-radio.js';
33
35
  import '../components/modal.js';
34
36
  import '../feedback/feedback-dialog.js';
@@ -204,6 +206,7 @@ interface UiKitLabels {
204
206
  wizard: WizardLabels;
205
207
  tour: TourLabels;
206
208
  commandPalette: CommandPaletteLabels;
209
+ globalSearch: GlobalSearchLabels;
207
210
  seriesChart: SeriesChartLabels;
208
211
  sparkline: SparklineLabels;
209
212
  statTile: StatTileLabels;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/i18n/kit-labels.tsx"],"sourcesContent":["import { createContext, useContext, useMemo } 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 { PopoverLabels } from \"../components/popover\";\nimport type { ChipInputLabels } from \"../components/chip\";\nimport type { FieldSyncLabels } from \"../components/field-sync\";\nimport type { PasswordRevealLabels, TabsLabels } from \"../components/ui\";\nimport type { WizardLabels } from \"../wizard/types\";\nimport type { TourLabels } from \"../tour/tour\";\nimport type { CommandPaletteLabels } from \"../search/command-palette\";\nimport type { MonthPickerLabels } from \"../components/month-picker\";\nimport type { PageContentsLabels } from \"../components/page-contents\";\nimport type { SeriesChartLabels } from \"../components/series-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 { ConfirmDialogLabels } from \"../components/confirm-dialog\";\nimport type { FloatingPanelLabels } from \"../components/floating-panel\";\nimport type { CopyButtonLabels } from \"../components/copy-button\";\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 ships no catalogue and resolves no strings, and that stays\n * true: the app supplies every word. What was wrong was HOW it had to supply them —\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 writes its translation ONCE, as a `UiKitLabels` (or a partial of it),\n * mounts `<UiKitProvider labels={…} locale={…}>` 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}\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}\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 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 commandPalette: CommandPaletteLabels;\n seriesChart: SeriesChartLabels;\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 confirmDialog: ConfirmDialogLabels;\n floatingPanel: FloatingPanelLabels;\n copyButton: CopyButtonLabels;\n}\n\n/** Any subset of the tree, one level deep — each namespace may be partial, and a\n * namespace that holds a record (`dataTable.presets`) is merged key by key. */\nexport type UiKitLabelOverrides = { [K in keyof UiKitLabels]?: Partial<UiKitLabels[K]> };\n\n/* ── English defaults for the namespaces defined here ────────────────────── */\n\nexport const DEFAULT_COMMON_LABELS: CommonLabels = {\n close: \"Close\",\n clear: \"Clear\",\n search: \"Search\",\n done: \"Done\",\n cancel: \"Cancel\",\n save: \"Save\",\n back: \"Back\",\n next: \"Next\",\n remove: \"Remove\",\n loading: \"Loading…\",\n noResults: \"No results\",\n fieldValue: (field, value) => `${field}: ${value}`,\n dismiss: \"Dismiss\",\n};\n\nexport const DEFAULT_DATE_PICKER_LABELS: DatePickerLabels = {\n panel: \"Choose a date\",\n rangePanel: \"Choose a date range\",\n clear: \"Clear\",\n previousDay: \"Previous day\",\n nextDay: \"Next day\",\n today: \"Today\",\n apply: \"Apply\",\n cancel: \"Cancel\",\n presets: \"Quick ranges\",\n};\n\nexport const DEFAULT_COMBOBOX_LABELS: ComboboxLabels = {\n search: \"Search\",\n noResults: \"No results\",\n clear: \"Clear\",\n loading: \"Loading…\",\n create: (query) => `Create “${query}”`,\n selectedCount: (count) => `${count} selected`,\n loadError: \"Couldn’t load results\",\n resultCount: (count) => (count === 1 ? \"1 result\" : `${count} results`),\n minChars: (count) =>\n count === 1 ? \"Type at least 1 character\" : `Type at least ${count} characters`,\n};\n\nexport const DEFAULT_MULTI_SELECT_LABELS: MultiSelectLabels = {\n search: \"Search\",\n selectAll: \"Select all\",\n clear: \"Clear\",\n all: \"All\",\n selectedCount: (count) => String(count),\n};\n\nexport const DEFAULT_CALCULATOR_LABELS: CalculatorLabels = {\n open: \"Open calculator\",\n panel: \"Calculator\",\n calculation: \"Calculation\",\n backspace: \"Backspace\",\n clear: \"Clear\",\n equals: \"Equals\",\n done: \"Done\",\n plus: \"Plus\",\n minus: \"Minus\",\n times: \"Times\",\n divide: \"Divide\",\n decimal: \"Decimal point\",\n};\n\nexport const DEFAULT_CURRENCY_LABELS: CurrencyLabels = {\n currency: \"Currency\",\n search: \"Search currency\",\n};\n\nexport const DEFAULT_APP_SHELL_LABELS: AppShellLabels = {\n collapse: \"Collapse sidebar\",\n expand: \"Expand sidebar\",\n toggleGroup: (groupLabel) => `${groupLabel}: pages`,\n};\n\nexport const DEFAULT_TOP_BAR_LABELS: TopBarLabels = {\n theme: \"Toggle theme\",\n palette: \"Appearance preset\",\n language: \"Language\",\n switchRole: \"Switch role\",\n role: (value) => `Role: ${value}`,\n};\n\nexport const DEFAULT_PICKER_SHEET_LABELS: PickerSheetLabels = { close: \"Close\" };\n\nexport const DEFAULT_SWIPEABLE_ROW_LABELS: SwipeableRowLabels = { actions: \"Row actions\" };\n\n/** Formats with the locale the provider was given (see {@link useKitFileLabels}).\n * This static default has no locale to hand and falls back to the runtime's. */\nexport const DEFAULT_FILE_LABELS: FileLabels = {\n size: (bytes) => formatFileSize(bytes),\n};\n\n/** \"12 kB\", \"3.4 MB\" — `Intl`'s unit formatting, so the digits, the decimal mark and\n * the unit's spelling all follow `locale`. */\nexport function formatFileSize(bytes: number, locale?: string): string {\n const units = [\"byte\", \"kilobyte\", \"megabyte\", \"gigabyte\"] as const;\n let value = bytes;\n let i = 0;\n while (value >= 1000 && i < units.length - 1) {\n value /= 1000;\n i += 1;\n }\n return new Intl.NumberFormat(locale, {\n style: \"unit\",\n unit: units[i],\n unitDisplay: i === 0 ? \"long\" : \"short\",\n maximumFractionDigits: value < 10 && i > 0 ? 1 : 0,\n }).format(value);\n}\n\n/* ── The provider ────────────────────────────────────────────────────────── */\n\ninterface KitI18n {\n labels?: UiKitLabelOverrides;\n locale?: string;\n weekStartsOn?: WeekDay;\n}\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 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({ labels, locale, weekStartsOn, children }: 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 }),\n [outer, labels, locale, weekStartsOn],\n );\n return <KitI18nContext.Provider value={value}>{children}</KitI18nContext.Provider>;\n}\n\nfunction isRecord(v: unknown): v is Record<string, unknown> {\n return typeof v === \"object\" && v !== null && !Array.isArray(v);\n}\n\n/** Two levels: namespaces, and inside a namespace a record-valued key (presets). */\nfunction mergeNamespace<T extends object>(base: T, over: 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] = isRecord(prev) && isRecord(v) ? { ...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/** What the nearest provider says about one namespace — `undefined` outside one.\n * For a component whose own resolver does more than a merge (the data table\n * derives `columnsCount` from `columns`): feed `{ ...overrides, ...props }` to it. */\nexport function useKitLabelOverrides<K extends keyof UiKitLabels>(\n ns: K,\n): Partial<UiKitLabels[K]> | undefined {\n return useContext(KitI18nContext).labels?.[ns] as Partial<UiKitLabels[K]> | undefined;\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.\n */\nexport function useKitLabels<K extends keyof UiKitLabels>(\n ns: K,\n defaults: UiKitLabels[K],\n prop?: Partial<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()`. */\nexport function useKitWeekStart(): WeekDay | undefined {\n return useContext(KitI18nContext).weekStartsOn;\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(de)).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.\n */\nexport function missingKitLabels(\n labels: UiKitLabelOverrides | undefined,\n reference: UiKitLabels,\n): string[] {\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":";AA8YS;AA9YT,SAAS,eAAe,YAAY,eAAe;AA6O5C,MAAM,wBAAsC;AAAA,EACjD,OAAO;AAAA,EACP,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,MAAM;AAAA,EACN,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,WAAW;AAAA,EACX,YAAY,CAAC,OAAO,UAAU,GAAG,KAAK,KAAK,KAAK;AAAA,EAChD,SAAS;AACX;AAEO,MAAM,6BAA+C;AAAA,EAC1D,OAAO;AAAA,EACP,YAAY;AAAA,EACZ,OAAO;AAAA,EACP,aAAa;AAAA,EACb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AE;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, useMemo } 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 { PopoverLabels } from \"../components/popover\";\nimport type { ChipInputLabels } from \"../components/chip\";\nimport type { FieldSyncLabels } from \"../components/field-sync\";\nimport type { PasswordRevealLabels, TabsLabels } from \"../components/ui\";\nimport type { WizardLabels } from \"../wizard/types\";\nimport type { TourLabels } from \"../tour/tour\";\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 { 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 { ConfirmDialogLabels } from \"../components/confirm-dialog\";\nimport type { FloatingPanelLabels } from \"../components/floating-panel\";\nimport type { CopyButtonLabels } from \"../components/copy-button\";\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 ships no catalogue and resolves no strings, and that stays\n * true: the app supplies every word. What was wrong was HOW it had to supply them —\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 writes its translation ONCE, as a `UiKitLabels` (or a partial of it),\n * mounts `<UiKitProvider labels={…} locale={…}>` 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}\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}\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 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 commandPalette: CommandPaletteLabels;\n globalSearch: GlobalSearchLabels;\n seriesChart: SeriesChartLabels;\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 confirmDialog: ConfirmDialogLabels;\n floatingPanel: FloatingPanelLabels;\n copyButton: CopyButtonLabels;\n}\n\n/** Any subset of the tree, one level deep — each namespace may be partial, and a\n * namespace that holds a record (`dataTable.presets`) is merged key by key. */\nexport type UiKitLabelOverrides = { [K in keyof UiKitLabels]?: Partial<UiKitLabels[K]> };\n\n/* ── English defaults for the namespaces defined here ────────────────────── */\n\nexport const DEFAULT_COMMON_LABELS: CommonLabels = {\n close: \"Close\",\n clear: \"Clear\",\n search: \"Search\",\n done: \"Done\",\n cancel: \"Cancel\",\n save: \"Save\",\n back: \"Back\",\n next: \"Next\",\n remove: \"Remove\",\n loading: \"Loading…\",\n noResults: \"No results\",\n fieldValue: (field, value) => `${field}: ${value}`,\n dismiss: \"Dismiss\",\n};\n\nexport const DEFAULT_DATE_PICKER_LABELS: DatePickerLabels = {\n panel: \"Choose a date\",\n rangePanel: \"Choose a date range\",\n clear: \"Clear\",\n previousDay: \"Previous day\",\n nextDay: \"Next day\",\n today: \"Today\",\n apply: \"Apply\",\n cancel: \"Cancel\",\n presets: \"Quick ranges\",\n};\n\nexport const DEFAULT_COMBOBOX_LABELS: ComboboxLabels = {\n search: \"Search\",\n noResults: \"No results\",\n clear: \"Clear\",\n loading: \"Loading…\",\n create: (query) => `Create “${query}”`,\n selectedCount: (count) => `${count} selected`,\n loadError: \"Couldn’t load results\",\n resultCount: (count) => (count === 1 ? \"1 result\" : `${count} results`),\n minChars: (count) =>\n count === 1 ? \"Type at least 1 character\" : `Type at least ${count} characters`,\n};\n\nexport const DEFAULT_MULTI_SELECT_LABELS: MultiSelectLabels = {\n search: \"Search\",\n selectAll: \"Select all\",\n clear: \"Clear\",\n all: \"All\",\n selectedCount: (count) => String(count),\n};\n\nexport const DEFAULT_CALCULATOR_LABELS: CalculatorLabels = {\n open: \"Open calculator\",\n panel: \"Calculator\",\n calculation: \"Calculation\",\n backspace: \"Backspace\",\n clear: \"Clear\",\n equals: \"Equals\",\n done: \"Done\",\n plus: \"Plus\",\n minus: \"Minus\",\n times: \"Times\",\n divide: \"Divide\",\n decimal: \"Decimal point\",\n};\n\nexport const DEFAULT_CURRENCY_LABELS: CurrencyLabels = {\n currency: \"Currency\",\n search: \"Search currency\",\n};\n\nexport const DEFAULT_APP_SHELL_LABELS: AppShellLabels = {\n collapse: \"Collapse sidebar\",\n expand: \"Expand sidebar\",\n toggleGroup: (groupLabel) => `${groupLabel}: pages`,\n};\n\nexport const DEFAULT_TOP_BAR_LABELS: TopBarLabels = {\n theme: \"Toggle theme\",\n palette: \"Appearance preset\",\n language: \"Language\",\n switchRole: \"Switch role\",\n role: (value) => `Role: ${value}`,\n};\n\nexport const DEFAULT_PICKER_SHEET_LABELS: PickerSheetLabels = { close: \"Close\" };\n\nexport const DEFAULT_SWIPEABLE_ROW_LABELS: SwipeableRowLabels = { actions: \"Row actions\" };\n\n/** Formats with the locale the provider was given (see {@link useKitFileLabels}).\n * This static default has no locale to hand and falls back to the runtime's. */\nexport const DEFAULT_FILE_LABELS: FileLabels = {\n size: (bytes) => formatFileSize(bytes),\n};\n\n/** \"12 kB\", \"3.4 MB\" — `Intl`'s unit formatting, so the digits, the decimal mark and\n * the unit's spelling all follow `locale`. */\nexport function formatFileSize(bytes: number, locale?: string): string {\n const units = [\"byte\", \"kilobyte\", \"megabyte\", \"gigabyte\"] as const;\n let value = bytes;\n let i = 0;\n while (value >= 1000 && i < units.length - 1) {\n value /= 1000;\n i += 1;\n }\n return new Intl.NumberFormat(locale, {\n style: \"unit\",\n unit: units[i],\n unitDisplay: i === 0 ? \"long\" : \"short\",\n maximumFractionDigits: value < 10 && i > 0 ? 1 : 0,\n }).format(value);\n}\n\n/* ── The provider ────────────────────────────────────────────────────────── */\n\ninterface KitI18n {\n labels?: UiKitLabelOverrides;\n locale?: string;\n weekStartsOn?: WeekDay;\n}\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 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({ labels, locale, weekStartsOn, children }: 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 }),\n [outer, labels, locale, weekStartsOn],\n );\n return <KitI18nContext.Provider value={value}>{children}</KitI18nContext.Provider>;\n}\n\nfunction isRecord(v: unknown): v is Record<string, unknown> {\n return typeof v === \"object\" && v !== null && !Array.isArray(v);\n}\n\n/** Two levels: namespaces, and inside a namespace a record-valued key (presets). */\nfunction mergeNamespace<T extends object>(base: T, over: 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] = isRecord(prev) && isRecord(v) ? { ...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/** What the nearest provider says about one namespace — `undefined` outside one.\n * For a component whose own resolver does more than a merge (the data table\n * derives `columnsCount` from `columns`): feed `{ ...overrides, ...props }` to it. */\nexport function useKitLabelOverrides<K extends keyof UiKitLabels>(\n ns: K,\n): Partial<UiKitLabels[K]> | undefined {\n return useContext(KitI18nContext).labels?.[ns] as Partial<UiKitLabels[K]> | undefined;\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.\n */\nexport function useKitLabels<K extends keyof UiKitLabels>(\n ns: K,\n defaults: UiKitLabels[K],\n prop?: Partial<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()`. */\nexport function useKitWeekStart(): WeekDay | undefined {\n return useContext(KitI18nContext).weekStartsOn;\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(de)).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.\n */\nexport function missingKitLabels(\n labels: UiKitLabelOverrides | undefined,\n reference: UiKitLabels,\n): string[] {\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":";AAgZS;AAhZT,SAAS,eAAe,YAAY,eAAe;AA+O5C,MAAM,wBAAsC;AAAA,EACjD,OAAO;AAAA,EACP,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,MAAM;AAAA,EACN,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,WAAW;AAAA,EACX,YAAY,CAAC,OAAO,UAAU,GAAG,KAAK,KAAK,KAAK;AAAA,EAChD,SAAS;AACX;AAEO,MAAM,6BAA+C;AAAA,EAC1D,OAAO;AAAA,EACP,YAAY;AAAA,EACZ,OAAO;AAAA,EACP,aAAa;AAAA,EACb,SAAS;AAAA,EACT,OAAO;AAAA,EACP,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,SAAS;AACX;AAEO,MAAM,0BAA0C;AAAA,EACrD,QAAQ;AAAA,EACR,WAAW;AAAA,EACX,OAAO;AAAA,EACP,SAAS;AAAA,EACT,QAAQ,CAAC,UAAU,gBAAW,KAAK;AAAA,EACnC,eAAe,CAAC,UAAU,GAAG,KAAK;AAAA,EAClC,WAAW;AAAA,EACX,aAAa,CAAC,UAAW,UAAU,IAAI,aAAa,GAAG,KAAK;AAAA,EAC5D,UAAU,CAAC,UAC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EAAE;AAC/C;AAMO,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;AAKO,SAAS,kBAAuC;AACrD,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;AAaO,SAAS,iBACd,QACA,WACU;AACV,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":[]}
@@ -12,6 +12,8 @@ import '../../hooks/use-anchored-rect.js';
12
12
  import '../../wizard/types.js';
13
13
  import '../../tour/tour.js';
14
14
  import '../../search/command-palette.js';
15
+ import '../../search/global-search.js';
16
+ import '../../search/search-index.js';
15
17
  import '../../components/month-picker.js';
16
18
  import '../../components/page-contents.js';
17
19
  import '../../components/series-chart-labels.js';
@@ -12,6 +12,8 @@ import '../../hooks/use-anchored-rect.js';
12
12
  import '../../wizard/types.js';
13
13
  import '../../tour/tour.js';
14
14
  import '../../search/command-palette.js';
15
+ import '../../search/global-search.js';
16
+ import '../../search/search-index.js';
15
17
  import '../../components/month-picker.js';
16
18
  import '../../components/page-contents.js';
17
19
  import '../../components/series-chart-labels.js';
@@ -12,6 +12,8 @@ import '../../hooks/use-anchored-rect.js';
12
12
  import '../../wizard/types.js';
13
13
  import '../../tour/tour.js';
14
14
  import '../../search/command-palette.js';
15
+ import '../../search/global-search.js';
16
+ import '../../search/search-index.js';
15
17
  import '../../components/month-picker.js';
16
18
  import '../../components/page-contents.js';
17
19
  import '../../components/series-chart-labels.js';
@@ -12,6 +12,8 @@ import '../../hooks/use-anchored-rect.js';
12
12
  import '../../wizard/types.js';
13
13
  import '../../tour/tour.js';
14
14
  import '../../search/command-palette.js';
15
+ import '../../search/global-search.js';
16
+ import '../../search/search-index.js';
15
17
  import '../../components/month-picker.js';
16
18
  import '../../components/page-contents.js';
17
19
  import '../../components/series-chart-labels.js';
@@ -279,12 +279,22 @@ function uiKitLabelsDe(numberLocale = "de-DE") {
279
279
  step: (current, total) => `${n(current)} / ${n(total)}`
280
280
  },
281
281
  commandPalette: {
282
+ clear: "Suche l\xF6schen",
283
+ submit: "Suchen",
284
+ close: "Schlie\xDFen",
282
285
  placeholder: "Suchen\u2026",
283
286
  empty: "Keine Ergebnisse",
284
287
  loading: "Wird gesucht\u2026",
285
288
  dialog: "Suche",
286
289
  error: "Die Suche ist fehlgeschlagen. Bitte erneut versuchen."
287
290
  },
291
+ globalSearch: {
292
+ trigger: "Suche",
293
+ placeholder: "Suchen oder springen zu\u2026",
294
+ shortcut: (keys) => `Suche (${keys})`,
295
+ suggestions: "Vorschl\xE4ge",
296
+ results: "Ergebnisse"
297
+ },
288
298
  sparkline: {
289
299
  rising: (first, last) => `Steigend von ${first} auf ${last}`,
290
300
  falling: (first, last) => `Fallend von ${first} auf ${last}`,