@eifi1/ui-kit 0.21.0 → 0.22.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 (278) hide show
  1. package/dist/chart.d.ts +10 -8
  2. package/dist/components/account-chips.d.ts +10 -3
  3. package/dist/components/account-chips.js +5 -2
  4. package/dist/components/account-chips.js.map +1 -1
  5. package/dist/components/account-settings.d.ts +33 -2
  6. package/dist/components/account-settings.js +43 -21
  7. package/dist/components/account-settings.js.map +1 -1
  8. package/dist/components/amount-input.d.ts +27 -8
  9. package/dist/components/amount-input.js +15 -28
  10. package/dist/components/amount-input.js.map +1 -1
  11. package/dist/components/autocomplete.d.ts +8 -0
  12. package/dist/components/autocomplete.js +9 -4
  13. package/dist/components/autocomplete.js.map +1 -1
  14. package/dist/components/button-group.d.ts +10 -8
  15. package/dist/components/calculator.d.ts +10 -8
  16. package/dist/components/checkbox-group.d.ts +104 -0
  17. package/dist/components/checkbox-group.js +111 -0
  18. package/dist/components/checkbox-group.js.map +1 -0
  19. package/dist/components/checkbox.d.ts +19 -0
  20. package/dist/components/checkbox.js +30 -7
  21. package/dist/components/checkbox.js.map +1 -1
  22. package/dist/components/chip.d.ts +18 -0
  23. package/dist/components/chip.js +47 -10
  24. package/dist/components/chip.js.map +1 -1
  25. package/dist/components/combobox.d.ts +13 -2
  26. package/dist/components/combobox.js +17 -8
  27. package/dist/components/combobox.js.map +1 -1
  28. package/dist/components/confirm-dialog.d.ts +66 -161
  29. package/dist/components/copy-button.d.ts +10 -8
  30. package/dist/components/country-select.d.ts +124 -0
  31. package/dist/components/country-select.js +237 -0
  32. package/dist/components/country-select.js.map +1 -0
  33. package/dist/components/currency-select.d.ts +17 -1
  34. package/dist/components/currency-select.js +56 -23
  35. package/dist/components/currency-select.js.map +1 -1
  36. package/dist/components/danger-confirm.d.ts +66 -166
  37. package/dist/components/danger-confirm.js +133 -49
  38. package/dist/components/danger-confirm.js.map +1 -1
  39. package/dist/components/data-table-cells.d.ts +1 -2
  40. package/dist/components/data-table-filter-popover.d.ts +1 -2
  41. package/dist/components/data-table-filters.d.ts +1 -2
  42. package/dist/components/data-table-labels.d.ts +4 -97
  43. package/dist/components/data-table-labels.js +9 -1
  44. package/dist/components/data-table-labels.js.map +1 -1
  45. package/dist/components/data-table-pagination.d.ts +3 -1
  46. package/dist/components/data-table.d.ts +1 -2
  47. package/dist/components/data-table.js +98 -3
  48. package/dist/components/data-table.js.map +1 -1
  49. package/dist/components/date-picker.d.ts +25 -5
  50. package/dist/components/date-picker.js +110 -59
  51. package/dist/components/date-picker.js.map +1 -1
  52. package/dist/components/entity-combobox.d.ts +8 -1
  53. package/dist/components/entity-combobox.js +9 -4
  54. package/dist/components/entity-combobox.js.map +1 -1
  55. package/dist/components/facing-pair.d.ts +10 -8
  56. package/dist/components/field-anatomy.d.ts +95 -0
  57. package/dist/components/field-anatomy.js +84 -0
  58. package/dist/components/field-anatomy.js.map +1 -0
  59. package/dist/components/field-parts.d.ts +114 -0
  60. package/dist/components/field-parts.js +72 -0
  61. package/dist/components/field-parts.js.map +1 -0
  62. package/dist/components/file-button.d.ts +10 -8
  63. package/dist/components/file-button.js +13 -3
  64. package/dist/components/file-button.js.map +1 -1
  65. package/dist/components/file-dropzone.d.ts +32 -9
  66. package/dist/components/file-dropzone.js +57 -34
  67. package/dist/components/file-dropzone.js.map +1 -1
  68. package/dist/components/form-actions.d.ts +10 -8
  69. package/dist/components/form-actions.js +61 -3
  70. package/dist/components/form-actions.js.map +1 -1
  71. package/dist/components/iban-input.d.ts +66 -0
  72. package/dist/components/iban-input.js +125 -0
  73. package/dist/components/iban-input.js.map +1 -0
  74. package/dist/components/icon-picker.d.ts +12 -2
  75. package/dist/components/icon-picker.js +9 -2
  76. package/dist/components/icon-picker.js.map +1 -1
  77. package/dist/components/inline-edit-field.d.ts +167 -0
  78. package/dist/components/inline-edit-field.js +293 -0
  79. package/dist/components/inline-edit-field.js.map +1 -0
  80. package/dist/components/language-select.d.ts +127 -0
  81. package/dist/components/language-select.js +18 -0
  82. package/dist/components/language-select.js.map +1 -0
  83. package/dist/components/line-items.d.ts +25 -3
  84. package/dist/components/line-items.js +55 -46
  85. package/dist/components/line-items.js.map +1 -1
  86. package/dist/components/list.d.ts +25 -0
  87. package/dist/components/list.js +16 -5
  88. package/dist/components/list.js.map +1 -1
  89. package/dist/components/money-field.d.ts +20 -8
  90. package/dist/components/money-field.js.map +1 -1
  91. package/dist/components/month-picker.d.ts +52 -4
  92. package/dist/components/month-picker.js +290 -86
  93. package/dist/components/month-picker.js.map +1 -1
  94. package/dist/components/multi-select.d.ts +8 -1
  95. package/dist/components/multi-select.js +9 -4
  96. package/dist/components/multi-select.js.map +1 -1
  97. package/dist/components/number-field.d.ts +25 -13
  98. package/dist/components/number-field.js +6 -20
  99. package/dist/components/number-field.js.map +1 -1
  100. package/dist/components/number-input.d.ts +70 -13
  101. package/dist/components/number-input.js +90 -38
  102. package/dist/components/number-input.js.map +1 -1
  103. package/dist/components/numpad-sheet.d.ts +10 -8
  104. package/dist/components/one-time-code-input.d.ts +100 -0
  105. package/dist/components/one-time-code-input.js +137 -0
  106. package/dist/components/one-time-code-input.js.map +1 -0
  107. package/dist/components/phone-input.d.ts +66 -0
  108. package/dist/components/phone-input.js +171 -0
  109. package/dist/components/phone-input.js.map +1 -0
  110. package/dist/components/series-chart.d.ts +10 -8
  111. package/dist/components/settings-fields.d.ts +10 -8
  112. package/dist/components/share-card.d.ts +8 -6
  113. package/dist/components/sign-chip.d.ts +66 -0
  114. package/dist/components/sign-chip.js +39 -0
  115. package/dist/components/sign-chip.js.map +1 -0
  116. package/dist/components/swatch-picker.d.ts +27 -2
  117. package/dist/components/swatch-picker.js +73 -31
  118. package/dist/components/swatch-picker.js.map +1 -1
  119. package/dist/components/switch.d.ts +19 -0
  120. package/dist/components/switch.js +24 -6
  121. package/dist/components/switch.js.map +1 -1
  122. package/dist/components/text-link.d.ts +10 -8
  123. package/dist/components/tile-radio.d.ts +68 -13
  124. package/dist/components/tile-radio.js +3 -3
  125. package/dist/components/tile-radio.js.map +1 -1
  126. package/dist/components/time-input.d.ts +15 -9
  127. package/dist/components/time-input.js.map +1 -1
  128. package/dist/components/toggle-group.d.ts +47 -1
  129. package/dist/components/toggle-group.js +110 -69
  130. package/dist/components/toggle-group.js.map +1 -1
  131. package/dist/components/ui.d.ts +10 -8
  132. package/dist/components/ui.js +280 -78
  133. package/dist/components/ui.js.map +1 -1
  134. package/dist/components/use-table-state.d.ts +1 -2
  135. package/dist/{data-table-3mi2R3so.d.ts → data-table-labels-B7OdnM0S.d.ts} +140 -3
  136. package/dist/data-table.d.ts +1 -2
  137. package/dist/data-table.js +2 -1
  138. package/dist/data-table.js.map +1 -1
  139. package/dist/feedback/feedback-attachment.d.ts +1 -1
  140. package/dist/feedback/feedback-attachment.js +210 -3
  141. package/dist/feedback/feedback-attachment.js.map +1 -1
  142. package/dist/feedback/feedback-dialog.d.ts +1 -1
  143. package/dist/feedback/feedback-dialog.js.map +1 -1
  144. package/dist/feedback/feedback-inbox.d.ts +1 -1
  145. package/dist/feedback/feedback-thread.d.ts +37 -3
  146. package/dist/feedback/feedback-thread.js +38 -9
  147. package/dist/feedback/feedback-thread.js.map +1 -1
  148. package/dist/{feedback-attachment-WFiXJ8We.d.ts → feedback-attachment-NhUm7Zga.d.ts} +70 -5
  149. package/dist/feedback.d.ts +2 -2
  150. package/dist/hooks/use-file-drop.d.ts +10 -8
  151. package/dist/i18n/defaults.d.ts +10 -8
  152. package/dist/i18n/defaults.js +17 -2
  153. package/dist/i18n/defaults.js.map +1 -1
  154. package/dist/i18n/german.d.ts +10 -8
  155. package/dist/i18n/german.js +50 -5
  156. package/dist/i18n/german.js.map +1 -1
  157. package/dist/i18n/kit-labels.d.ts +10 -8
  158. package/dist/i18n/kit-labels.js +8 -2
  159. package/dist/i18n/kit-labels.js.map +1 -1
  160. package/dist/i18n/languages.d.ts +10 -8
  161. package/dist/i18n/locales/de-CH.d.ts +10 -8
  162. package/dist/i18n/locales/en.d.ts +10 -8
  163. package/dist/i18n/locales/en.js +9 -0
  164. package/dist/i18n/locales/en.js.map +1 -1
  165. package/dist/i18n/locales/es.d.ts +10 -8
  166. package/dist/i18n/locales/es.js +48 -5
  167. package/dist/i18n/locales/es.js.map +1 -1
  168. package/dist/i18n/locales/fr.d.ts +10 -8
  169. package/dist/i18n/locales/fr.js +48 -5
  170. package/dist/i18n/locales/fr.js.map +1 -1
  171. package/dist/i18n/locales/hu.d.ts +10 -8
  172. package/dist/i18n/locales/hu.js +49 -5
  173. package/dist/i18n/locales/hu.js.map +1 -1
  174. package/dist/i18n/locales/it.d.ts +10 -8
  175. package/dist/i18n/locales/it.js +49 -5
  176. package/dist/i18n/locales/it.js.map +1 -1
  177. package/dist/i18n/locales/zh.d.ts +10 -8
  178. package/dist/i18n/locales/zh.js +48 -5
  179. package/dist/i18n/locales/zh.js.map +1 -1
  180. package/dist/i18n/review.d.ts +10 -8
  181. package/dist/i18n/review.js +8 -1
  182. package/dist/i18n/review.js.map +1 -1
  183. package/dist/index.d.ts +17 -10
  184. package/dist/index.js +57 -2
  185. package/dist/index.js.map +1 -1
  186. package/dist/{kit-labels-D1J2_jyD.d.ts → kit-labels-R8mIAc9N.d.ts} +811 -8
  187. package/dist/lib/countries.d.ts +43 -0
  188. package/dist/lib/countries.js +39 -0
  189. package/dist/lib/countries.js.map +1 -0
  190. package/dist/lib/decimal-marks.d.ts +46 -0
  191. package/dist/lib/decimal-marks.js +40 -0
  192. package/dist/lib/decimal-marks.js.map +1 -0
  193. package/dist/lib/iban.d.ts +98 -0
  194. package/dist/lib/iban.js +154 -0
  195. package/dist/lib/iban.js.map +1 -0
  196. package/dist/lib/isin.d.ts +30 -0
  197. package/dist/lib/isin.js +36 -0
  198. package/dist/lib/isin.js.map +1 -0
  199. package/dist/lib/phone.d.ts +69 -0
  200. package/dist/lib/phone.js +121 -0
  201. package/dist/lib/phone.js.map +1 -0
  202. package/dist/rhf/fields.d.ts +148 -11
  203. package/dist/rhf/fields.js +332 -3
  204. package/dist/rhf/fields.js.map +1 -1
  205. package/dist/rhf/form.d.ts +10 -8
  206. package/dist/rhf.d.ts +13 -9
  207. package/dist/rhf.js.map +1 -1
  208. package/dist/shell/app-shell.d.ts +10 -8
  209. package/dist/shell/top-bar-brand.d.ts +10 -8
  210. package/dist/shell.d.ts +10 -8
  211. package/dist/tour/tour.js +20 -24
  212. package/dist/tour/tour.js.map +1 -1
  213. package/dist/wizard/stepper-nav.d.ts +10 -8
  214. package/dist/wizard.d.ts +10 -8
  215. package/package.json +1 -1
  216. package/src/components/account-chips.tsx +17 -3
  217. package/src/components/account-settings.tsx +92 -26
  218. package/src/components/amount-input.tsx +49 -56
  219. package/src/components/autocomplete.tsx +133 -110
  220. package/src/components/checkbox-group.tsx +229 -0
  221. package/src/components/checkbox.tsx +72 -8
  222. package/src/components/chip.tsx +80 -10
  223. package/src/components/combobox.tsx +292 -253
  224. package/src/components/country-select.tsx +443 -0
  225. package/src/components/currency-select.tsx +109 -33
  226. package/src/components/danger-confirm.tsx +345 -77
  227. package/src/components/data-table-labels.ts +16 -1
  228. package/src/components/data-table.tsx +175 -6
  229. package/src/components/date-picker.tsx +173 -62
  230. package/src/components/entity-combobox.tsx +107 -87
  231. package/src/components/field-anatomy.tsx +190 -0
  232. package/src/components/field-parts.tsx +184 -0
  233. package/src/components/file-button.tsx +36 -3
  234. package/src/components/file-dropzone.tsx +106 -38
  235. package/src/components/form-actions.tsx +115 -2
  236. package/src/components/iban-input.tsx +231 -0
  237. package/src/components/icon-picker.tsx +26 -4
  238. package/src/components/inline-edit-field.tsx +533 -0
  239. package/src/components/language-select.tsx +78 -0
  240. package/src/components/line-items.tsx +35 -2
  241. package/src/components/list.tsx +55 -6
  242. package/src/components/money-field.tsx +10 -0
  243. package/src/components/month-picker.tsx +399 -63
  244. package/src/components/multi-select.tsx +80 -58
  245. package/src/components/number-field.tsx +28 -46
  246. package/src/components/number-input.tsx +210 -43
  247. package/src/components/one-time-code-input.tsx +288 -0
  248. package/src/components/phone-input.tsx +299 -0
  249. package/src/components/sign-chip.tsx +103 -0
  250. package/src/components/swatch-picker.tsx +118 -30
  251. package/src/components/switch.tsx +58 -7
  252. package/src/components/tile-radio.tsx +71 -16
  253. package/src/components/time-input.tsx +8 -1
  254. package/src/components/toggle-group.tsx +206 -73
  255. package/src/components/ui.tsx +472 -105
  256. package/src/data-table.ts +2 -1
  257. package/src/feedback/feedback-attachment.tsx +313 -9
  258. package/src/feedback/feedback-dialog.tsx +2 -0
  259. package/src/feedback/feedback-thread.tsx +66 -5
  260. package/src/i18n/defaults.ts +16 -1
  261. package/src/i18n/german.ts +47 -0
  262. package/src/i18n/kit-labels.tsx +78 -2
  263. package/src/i18n/locales/en.ts +10 -0
  264. package/src/i18n/locales/es.ts +46 -0
  265. package/src/i18n/locales/fr.ts +45 -0
  266. package/src/i18n/locales/hu.ts +46 -0
  267. package/src/i18n/locales/it.ts +47 -0
  268. package/src/i18n/locales/zh.ts +44 -0
  269. package/src/i18n/review.ts +7 -0
  270. package/src/index.ts +53 -3
  271. package/src/lib/countries.ts +91 -0
  272. package/src/lib/decimal-marks.ts +99 -0
  273. package/src/lib/iban.ts +171 -0
  274. package/src/lib/isin.ts +62 -0
  275. package/src/lib/phone.ts +211 -0
  276. package/src/rhf/fields.tsx +606 -9
  277. package/src/rhf.ts +2 -1
  278. package/src/tour/tour.tsx +66 -28
package/dist/tour/tour.js CHANGED
@@ -117,6 +117,10 @@ function sameRect(a, b) {
117
117
  if (!a || !b) return false;
118
118
  return a.top === b.top && a.left === b.left && a.width === b.width && a.height === b.height;
119
119
  }
120
+ function rectOf(el) {
121
+ const r = el.getBoundingClientRect();
122
+ return { top: r.top, left: r.left, width: r.width, height: r.height };
123
+ }
120
124
  function TourOverlay({
121
125
  steps,
122
126
  index,
@@ -128,25 +132,21 @@ function TourOverlay({
128
132
  const step = steps[index];
129
133
  const isFirst = index === 0;
130
134
  const isLast = index === steps.length - 1;
131
- const [rect, setRect] = useState(null);
132
- const [ready, setReady] = useState(false);
133
- const [locating, setLocating] = useState({ index, step });
134
- if (locating.index !== index || locating.step !== step) {
135
- setLocating({ index, step });
136
- setReady(false);
137
- setRect(null);
138
- }
139
- const [dir, setDir] = useState(() => dirOf(null));
135
+ const [located, setLocated] = useState(null);
136
+ const current = located !== null && located.index === index && located.step === step ? located : null;
137
+ const ready = current !== null;
138
+ const rect = current?.rect ?? null;
139
+ const dir = current?.dir ?? "ltr";
140
140
  const rootRef = useRef(null);
141
141
  useEffect(() => {
142
142
  let cancelled = false;
143
143
  let raf = 0;
144
+ const settle = (el) => setLocated({ index, step, rect: el ? rectOf(el) : null, dir: dirOf(el) });
144
145
  void (async () => {
145
146
  await step.beforeStep?.();
146
147
  if (cancelled) return;
147
148
  if (!step.target) {
148
- setDir(dirOf(null));
149
- setReady(true);
149
+ settle(null);
150
150
  return;
151
151
  }
152
152
  let tries = 0;
@@ -155,17 +155,11 @@ function TourOverlay({
155
155
  const el = queryVisibleTarget(step.target);
156
156
  if (el) {
157
157
  el.scrollIntoView({ block: "center", behavior: "smooth" });
158
- const r = el.getBoundingClientRect();
159
- setRect({ top: r.top, left: r.left, width: r.width, height: r.height });
160
- setDir(dirOf(el));
161
- setReady(true);
158
+ settle(el);
162
159
  return;
163
160
  }
164
161
  if (tries++ < 45) raf = requestAnimationFrame(find);
165
- else {
166
- setDir(dirOf(null));
167
- setReady(true);
168
- }
162
+ else settle(null);
169
163
  };
170
164
  find();
171
165
  })();
@@ -179,9 +173,10 @@ function TourOverlay({
179
173
  const update = () => {
180
174
  const el = queryVisibleTarget(step.target);
181
175
  if (el) {
182
- const r = el.getBoundingClientRect();
183
- const next = { top: r.top, left: r.left, width: r.width, height: r.height };
184
- setRect((prev) => sameRect(prev, next) ? prev : next);
176
+ const next = rectOf(el);
177
+ setLocated(
178
+ (prev) => prev && prev.index === index && prev.step === step && !sameRect(prev.rect, next) ? { ...prev, rect: next } : prev
179
+ );
185
180
  }
186
181
  };
187
182
  window.addEventListener("scroll", update, true);
@@ -193,14 +188,15 @@ function TourOverlay({
193
188
  clearInterval(id);
194
189
  };
195
190
  }, [index, step]);
191
+ const spotted = rect !== null;
196
192
  useEffect(() => {
197
- if (!ready || !step.awaitClick || !step.target) return;
193
+ if (!ready || !spotted || !step.awaitClick || !step.target) return;
198
194
  const el = queryVisibleTarget(step.target);
199
195
  if (!el) return;
200
196
  const onClick = () => window.setTimeout(() => onNext(), 0);
201
197
  el.addEventListener("click", onClick, { once: true });
202
198
  return () => el.removeEventListener("click", onClick);
203
- }, [ready, index, step, onNext]);
199
+ }, [ready, spotted, index, step, onNext]);
204
200
  useEffect(() => {
205
201
  const onKey = (e) => {
206
202
  if (e.key === "Escape") {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/tour/tour.tsx"],"sourcesContent":["import {\n createContext,\n useCallback,\n useContext,\n useEffect,\n useLayoutEffect,\n useRef,\n useState,\n} from \"react\";\nimport type { CSSProperties, ReactNode } from \"react\";\nimport { createPortal } from \"react-dom\";\nimport { cn } from \"../lib/cn\";\nimport { useKitLabels } from \"../i18n/kit-labels\";\nimport { Button } from \"../components/ui\";\nimport { useFocusTrap } from \"../hooks/use-focus-trap\";\nimport { dirOf, horizontalStep } from \"../lib/direction\";\nimport type { Direction } from \"../lib/direction\";\n\n/**\n * `start`/`end` follow the reading direction (`end` is the right side in LTR and the\n * left side in RTL) and are what a translated app wants. `left`/`right` stay physical\n * for the steps that genuinely mean a screen side.\n */\nexport type TourPlacement = \"top\" | \"right\" | \"bottom\" | \"left\" | \"start\" | \"end\" | \"center\";\n\nexport interface TourStep {\n /** CSS selector for the element to spotlight. Omit for a centered step\n * (welcome/finish). If the target isn't found/visible, the step centers. */\n target?: string;\n title: string;\n body: ReactNode;\n /** Extra footer content, e.g. a \"load sample data\" shortcut. */\n action?: ReactNode;\n /** Spotlight padding around the target, px (default 8). */\n padding?: number;\n /** Where the card sits relative to the target. Omit for auto placement\n * (below → above → centered). \"center\" ignores the target and centers on\n * screen. \"start\"/\"end\" are the logical sides and flip in RTL; \"left\"/\"right\"\n * are physical. An explicit side flips to the opposite side if it would\n * overflow, then clamps into the viewport. */\n placement?: TourPlacement;\n /** Advance only when the user clicks the spotlighted target itself (not the\n * card's Next button). Requires `target`: the real control's own handler runs\n * first, then the tour steps forward on a microtask. The spotlight hole stays\n * click-through to the target; the rest of the page does not. */\n awaitClick?: boolean;\n /** Runs before the step is shown — e.g. navigate to a route, open a panel.\n * May be async; the step waits for it, then locates the target. */\n beforeStep?: () => void | Promise<void>;\n}\n\nexport interface TourLabels {\n next: string;\n back: string;\n skip: string;\n done: string;\n /** Shown in place of the Next button on an `awaitClick` step. */\n awaitClickHint: string;\n /** Step counter, e.g. (2, 7) => \"2 / 7\". */\n step: (current: number, total: number) => string;\n}\n\nexport const DEFAULT_TOUR_LABELS: TourLabels = {\n next: \"Next\",\n back: \"Back\",\n skip: \"Skip\",\n done: \"Done\",\n awaitClickHint: \"Click the highlighted element to continue\",\n step: (c, t) => `${c} / ${t}`,\n};\n\ninterface StartOptions {\n /** Stable id of the tour, surfaced as `activeId` so the app can mirror it to\n * the URL (deep-link / evaluation tracking) and record completion. */\n id?: string;\n /** Start at this step index instead of 0 (clamped) — for URL/deep-link resume. */\n startIndex?: number;\n /** Fires synchronously when the tour starts (e.g. enable a mock interceptor). */\n onStart?: () => void;\n onFinish?: () => void;\n onSkip?: () => void;\n}\n\ninterface TourContextValue {\n active: boolean;\n /** Id of the running tour (from {@link StartOptions.id}), else null. */\n activeId: string | null;\n /** Start a tour with the given steps. */\n start: (steps: TourStep[], opts?: StartOptions) => void;\n /** End the current tour (no callbacks fire). */\n stop: () => void;\n /** Advance one step; past the last step it finishes the tour (fires onFinish). */\n next: () => void;\n /** Go back one step (no-op on the first). */\n prev: () => void;\n /** Jump to a step by index, clamped to range — e.g. for URL/deep-link resume. */\n goToStep: (index: number) => void;\n /** Current step (0-based; 0 while inactive). */\n index: number;\n /** Total steps (0 while inactive). */\n total: number;\n}\n\nconst TourContext = createContext<TourContextValue | null>(null);\n\nexport function useTour(): TourContextValue {\n const ctx = useContext(TourContext);\n if (!ctx) throw new Error(\"useTour must be used within <TourProvider>\");\n return ctx;\n}\n\n/**\n * The tour engine if it is there, `null` if it is not — for a control that is a\n * DECORATION rather than a participant.\n *\n * {@link useTour}'s throw is correct and stays: a component that runs a tour cannot do\n * its job without the provider, and failing loudly is how that gets fixed. But the\n * throw's blast radius is whatever error boundary is above it, and for a launcher in\n * the app shell that is the whole app.\n *\n * Keksdose feedback dev#524 is what that costs: an `@hb/ui` module was edited while a\n * dev server was running, vite re-evaluated it, and the module's freshly created\n * context object was no longer the one the mounted provider was providing. React's\n * `useContext` then answers `null` for a provider that is, structurally, right there —\n * and the top bar's tour menu took the entire shell down with it. **Build-time module\n * graphs cannot produce that**, so it is a development-only failure; a menu that\n * disappears for a second is the proportionate response to it either way.\n *\n * Only for controls that can honestly render nothing. If a component would show a\n * broken half of itself without the tour, it wants {@link useTour}.\n */\nexport function useTourOptional(): TourContextValue | null {\n return useContext(TourContext);\n}\n\n/**\n * Provides the guided-tour engine: a dimmed spotlight overlay + step card driven\n * by a list of {@link TourStep}s. Domain-free — the app supplies the steps (copy,\n * selectors, per-step navigation, placement) and the translated {@link TourLabels}.\n * Mount once inside the router; start a tour from anywhere via {@link useTour},\n * which also exposes step control (`next`/`prev`/`goToStep`) and the current\n * `index`/`total` for URL mirroring, `awaitClick` and deep-link resume.\n */\nexport function TourProvider({\n children,\n labels,\n}: {\n children: ReactNode;\n labels?: Partial<TourLabels>;\n}) {\n // `labels` over the provider's `tour` over English. Resolved once here and handed\n // down: the step card is portalled, but context crosses portals anyway — this is\n // simply the one place that already owned the merge.\n const merged = useKitLabels(\"tour\", DEFAULT_TOUR_LABELS, labels);\n const [steps, setSteps] = useState<TourStep[] | null>(null);\n const [index, setIndex] = useState(0);\n const [activeId, setActiveId] = useState<string | null>(null);\n const optsRef = useRef<StartOptions>({});\n // Live mirrors so the step-control callbacks can stay stable (identity-safe for\n // consumers) while still reading the current steps/index. Synced in a layout\n // effect — after the commit, before paint and before any passive effect or event\n // can call them — rather than written during render.\n const stepsRef = useRef<TourStep[] | null>(null);\n const indexRef = useRef(0);\n useLayoutEffect(() => {\n stepsRef.current = steps;\n indexRef.current = index;\n }, [steps, index]);\n const active = !!steps && steps.length > 0;\n const total = steps?.length ?? 0;\n\n const start = useCallback((s: TourStep[], opts?: StartOptions) => {\n optsRef.current = opts ?? {};\n optsRef.current.onStart?.();\n setIndex(Math.min(Math.max(0, opts?.startIndex ?? 0), Math.max(0, s.length - 1)));\n setActiveId(opts?.id ?? null);\n setSteps(s);\n }, []);\n const stop = useCallback(() => {\n setSteps(null);\n setActiveId(null);\n }, []);\n const finish = useCallback(() => {\n optsRef.current.onFinish?.();\n setSteps(null);\n setActiveId(null);\n }, []);\n const skip = useCallback(() => {\n optsRef.current.onSkip?.();\n setSteps(null);\n setActiveId(null);\n }, []);\n\n const goToStep = useCallback((i: number) => {\n const len = stepsRef.current?.length ?? 0;\n if (len === 0) return;\n setIndex(Math.min(Math.max(0, i), len - 1));\n }, []);\n const next = useCallback(() => {\n const len = stepsRef.current?.length ?? 0;\n if (len === 0) return;\n if (indexRef.current >= len - 1) finish();\n else setIndex(indexRef.current + 1);\n }, [finish]);\n const prev = useCallback(() => {\n if (indexRef.current > 0) setIndex(indexRef.current - 1);\n }, []);\n\n return (\n <TourContext.Provider value={{ active, activeId, start, stop, next, prev, goToStep, index, total }}>\n {children}\n {active && (\n <TourOverlay\n steps={steps!}\n index={index}\n labels={merged}\n onNext={next}\n onPrev={prev}\n onSkip={skip}\n />\n )}\n </TourContext.Provider>\n );\n}\n\ninterface Rect {\n top: number;\n left: number;\n width: number;\n height: number;\n}\n\nfunction isVisible(el: Element): boolean {\n // A non-zero box already rules out display:none on the element or any ancestor\n // (an unrendered element measures 0x0). We deliberately do NOT test\n // offsetParent: it is null for position:fixed elements even when fully visible,\n // which made the mobile bottom-nav bar (fixed) un-highlightable on mobile\n // (feedback #313). visibility:hidden keeps a box, so check it explicitly.\n const r = el.getBoundingClientRect();\n if (r.width <= 0 || r.height <= 0) return false;\n const style = getComputedStyle(el);\n return style.visibility !== \"hidden\" && style.display !== \"none\";\n}\n\n// The first VISIBLE element matching the selector, not merely the first in DOM\n// order. This lets a step target the same control across layouts with one\n// combined selector — e.g. the desktop sidebar link AND the mobile bottom-bar\n// link — where the off-layout copy is present but `display:none` (feedback\n// #313). Returns null while none is visible so the finder keeps retrying.\nfunction queryVisibleTarget(selector: string): Element | null {\n const els = document.querySelectorAll(selector);\n for (const el of els) {\n if (isVisible(el)) return el;\n }\n return null;\n}\n\nfunction sameRect(a: Rect | null, b: Rect | null): boolean {\n if (a === b) return true;\n if (!a || !b) return false;\n return a.top === b.top && a.left === b.left && a.width === b.width && a.height === b.height;\n}\n\nfunction TourOverlay({\n steps,\n index,\n labels,\n onNext,\n onPrev,\n onSkip,\n}: {\n steps: TourStep[];\n index: number;\n labels: TourLabels;\n onNext: () => void;\n onPrev: () => void;\n onSkip: () => void;\n}) {\n const step = steps[index];\n const isFirst = index === 0;\n const isLast = index === steps.length - 1;\n const [rect, setRect] = useState<Rect | null>(null);\n const [ready, setReady] = useState(false);\n // A new step starts unlocated: reset during render when the step changes, so the\n // previous step's spotlight never paints over the new one. The effect below then\n // locates it.\n const [locating, setLocating] = useState({ index, step });\n if (locating.index !== index || locating.step !== step) {\n setLocating({ index, step });\n setReady(false);\n setRect(null);\n }\n // The overlay is portalled to <body>, out of whatever `dir` subtree the app set, so it\n // takes the direction of the element it spotlights (the document's for a centered\n // step). Arrow keys and start/end placement read it.\n const [dir, setDir] = useState<Direction>(() => dirOf(null));\n const rootRef = useRef<HTMLDivElement>(null);\n\n // Run beforeStep, then locate the target (retrying across route/render lag).\n useEffect(() => {\n let cancelled = false;\n let raf = 0;\n void (async () => {\n await step.beforeStep?.();\n if (cancelled) return;\n if (!step.target) {\n setDir(dirOf(null));\n setReady(true);\n return;\n }\n let tries = 0;\n const find = () => {\n if (cancelled) return;\n const el = queryVisibleTarget(step.target!);\n if (el) {\n el.scrollIntoView({ block: \"center\", behavior: \"smooth\" });\n const r = el.getBoundingClientRect();\n setRect({ top: r.top, left: r.left, width: r.width, height: r.height });\n setDir(dirOf(el));\n setReady(true);\n return;\n }\n if (tries++ < 45) raf = requestAnimationFrame(find);\n else {\n setDir(dirOf(null));\n setReady(true); // give up → render centered\n }\n };\n find();\n })();\n return () => {\n cancelled = true;\n cancelAnimationFrame(raf);\n };\n }, [index, step]);\n\n // Follow the target as the page scrolls / reflows.\n useEffect(() => {\n if (!step.target) return;\n const update = () => {\n const el = queryVisibleTarget(step.target!);\n if (el) {\n const r = el.getBoundingClientRect();\n const next = { top: r.top, left: r.left, width: r.width, height: r.height };\n setRect((prev) => (sameRect(prev, next) ? prev : next));\n }\n };\n window.addEventListener(\"scroll\", update, true);\n window.addEventListener(\"resize\", update);\n const id = window.setInterval(update, 250);\n return () => {\n window.removeEventListener(\"scroll\", update, true);\n window.removeEventListener(\"resize\", update);\n clearInterval(id);\n };\n }, [index, step]);\n\n // awaitClick: advance when the *real* target is clicked. The spotlight hole is\n // click-through (see the shields in the render below) so the element's own\n // handler runs first; we step forward on the next macrotask.\n useEffect(() => {\n if (!ready || !step.awaitClick || !step.target) return;\n const el = queryVisibleTarget(step.target);\n if (!el) return;\n const onClick = () => window.setTimeout(() => onNext(), 0);\n el.addEventListener(\"click\", onClick, { once: true });\n return () => el.removeEventListener(\"click\", onClick);\n }, [ready, index, step, onNext]);\n\n // Keyboard: Esc skips, Enter and the reading-direction arrow advance (→ in LTR,\n // ← in RTL), the other arrow goes back. On awaitClick steps Enter is ignored (it\n // would fire the target's click AND advance) — the forward arrow stays as an escape\n // hatch.\n //\n // Enter on a focused control belongs to that control. This used to advance from\n // anywhere, so Enter on a focused Skip or Back ran the button's own click AND stepped\n // forward: Back moved nowhere, Skip skipped and then called `next` on a dead tour.\n // The same goes for arrows in a text field a step's `action` might contain.\n useEffect(() => {\n const onKey = (e: KeyboardEvent) => {\n if (e.key === \"Escape\") {\n onSkip();\n return;\n }\n if (e.key === \"Enter\") {\n if (step.awaitClick || ownsKey(e.target, \"Enter\")) return;\n e.preventDefault();\n onNext();\n return;\n }\n if (ownsKey(e.target, e.key)) return;\n // The overlay root carries `dir`; before it paints, the document's answers.\n const delta = horizontalStep(e.key, rootRef.current);\n if (delta === 1) {\n e.preventDefault();\n onNext();\n } else if (delta === -1) {\n if (!isFirst) onPrev();\n }\n };\n document.addEventListener(\"keydown\", onKey);\n return () => document.removeEventListener(\"keydown\", onKey);\n }, [isFirst, step, onNext, onPrev, onSkip]);\n\n if (!ready) return null;\n\n const pad = step.padding ?? 8;\n const spot: Rect | null = rect\n ? { top: rect.top - pad, left: rect.left - pad, width: rect.width + pad * 2, height: rect.height + pad * 2 }\n : null;\n\n // `aria-modal` promises the page behind is out of reach, and the card's focus trap\n // keeps that promise for the keyboard. The pointer used to get no such treatment: the\n // root is `pointer-events-none` so that the spotlight hole can stay live for\n // `awaitClick`, and the scrim is a box-shadow, which takes no clicks — so every\n // control on the dimmed page stayed clickable. Four shields now tile the viewport\n // around the hole: the page is blocked, the card and the spotlighted target are not.\n // Keeping `aria-modal` (rather than dropping it) is the coherent half: the tour\n // really is modal — focus is trapped and Esc/Skip is the way out.\n return createPortal(\n <div\n ref={rootRef}\n className=\"pointer-events-none fixed inset-0 z-[60]\"\n role=\"dialog\"\n aria-modal=\"true\"\n aria-label={step.title}\n dir={dir}\n >\n {spot && <SpotlightShields spot={spot} />}\n {spot ? (\n <div\n className=\"pointer-events-none fixed rounded-lg transition-all duration-200 ease-out\"\n style={{\n top: spot.top,\n left: spot.left,\n width: spot.width,\n height: spot.height,\n // A two-tone frame, not a single translucent ring.\n //\n // The old treatment was `ring-2 ring-white/80` over a 55% scrim, and it\n // \"was barely visible\" on the app's blue-tinted surfaces. Two reasons,\n // and a single ring can't fix either: at 55% the surround stays bright\n // enough that the un-dimmed hole barely reads AS a hole, and a 80%-white\n // ring sitting on the edge of a light card is white-on-near-white.\n //\n // So: an opaque white band immediately around the target, a dark keyline\n // outside it, then the scrim. Whatever the target's own colour is, one of\n // the two bands is always in contrast with it and the other is always in\n // contrast with the dimmed surround — there is no background that can\n // swallow both. The blurred layer between them softens the step so the\n // frame reads as lighting rather than as a pasted-on rectangle.\n boxShadow: [\n \"0 0 0 3px rgba(255,255,255,0.98)\",\n \"0 0 0 5px rgba(15,23,42,0.92)\",\n \"0 0 18px 6px rgba(15,23,42,0.45)\",\n \"0 0 0 9999px rgba(15,23,42,0.70)\",\n ].join(\", \"),\n }}\n />\n ) : (\n <div className=\"pointer-events-auto fixed inset-0 bg-black/70\" />\n )}\n <TourCard\n step={step}\n index={index}\n total={steps.length}\n labels={labels}\n isFirst={isFirst}\n isLast={isLast}\n rect={spot}\n dir={dir}\n onBack={onPrev}\n onNext={onNext}\n onSkip={onSkip}\n />\n </div>,\n document.body,\n );\n}\n\n/** Does the focused element handle `key` itself? Enter on a button or link, and any\n * editing key in a text field or select, is the control's — not the tour's. */\nfunction ownsKey(target: EventTarget | null, key: string): boolean {\n if (!(target instanceof HTMLElement)) return false;\n if (target.isContentEditable) return true;\n const tag = target.tagName;\n if (tag === \"TEXTAREA\" || tag === \"SELECT\") return true;\n if (tag === \"INPUT\") {\n const type = (target as HTMLInputElement).type;\n // Enter on a checkbox does nothing natively, but ←/→ on a radio moves it.\n return key !== \"Enter\" || type !== \"checkbox\";\n }\n if (key !== \"Enter\") return false;\n return (\n tag === \"BUTTON\" ||\n (tag === \"A\" && target.hasAttribute(\"href\")) ||\n target.getAttribute(\"role\") === \"button\" ||\n target.getAttribute(\"role\") === \"link\"\n );\n}\n\n/**\n * Transparent pointer blockers tiling the viewport around the spotlight hole: one\n * full-width band above and below, one on each side at the hole's own height. The hole\n * itself stays uncovered, so the target keeps its clicks.\n */\nfunction SpotlightShields({ spot }: { spot: Rect }) {\n const shield = \"pointer-events-auto fixed\";\n const bottom = spot.top + spot.height;\n return (\n <>\n <div data-tour-shield=\"\" className={shield} style={{ top: 0, left: 0, right: 0, height: Math.max(0, spot.top) }} />\n <div data-tour-shield=\"\" className={shield} style={{ top: bottom, left: 0, right: 0, bottom: 0 }} />\n <div\n data-tour-shield=\"\"\n className={shield}\n style={{ top: spot.top, left: 0, width: Math.max(0, spot.left), height: spot.height }}\n />\n <div\n data-tour-shield=\"\"\n className={shield}\n style={{ top: spot.top, left: spot.left + spot.width, right: 0, height: spot.height }}\n />\n </>\n );\n}\n\n/**\n * Card position (viewport px) for the given placement relative to the padded\n * spotlight `rect`. Omitted placement keeps the original auto behavior\n * (below → above → vertically centered); an explicit side flips to its opposite\n * if it would overflow, then clamps into the viewport. \"center\" (or no rect)\n * centers on screen.\n */\nfunction placeCard(\n rect: Rect | null,\n cw: number,\n ch: number,\n vw: number,\n vh: number,\n m: number,\n placement?: TourPlacement,\n dir: Direction = \"ltr\",\n): { top: number; left: number } {\n // The logical sides resolve to a physical one here, and only here.\n if (placement === \"start\") placement = dir === \"rtl\" ? \"right\" : \"left\";\n else if (placement === \"end\") placement = dir === \"rtl\" ? \"left\" : \"right\";\n if (!rect || placement === \"center\") {\n return { top: Math.max(m, (vh - ch) / 2), left: Math.max(m, (vw - cw) / 2) };\n }\n const clampX = (x: number) => Math.min(Math.max(m, x), Math.max(m, vw - cw - m));\n const clampY = (y: number) => Math.min(Math.max(m, y), Math.max(m, vh - ch - m));\n const centerX = clampX(rect.left + rect.width / 2 - cw / 2);\n const centerY = clampY(rect.top + rect.height / 2 - ch / 2);\n const belowTop = rect.top + rect.height + m;\n const aboveTop = rect.top - ch - m;\n const rightLeft = rect.left + rect.width + m;\n const leftLeft = rect.left - cw - m;\n const fitsBelow = belowTop + ch <= vh;\n const fitsAbove = aboveTop >= 0;\n const fitsRight = rightLeft + cw <= vw;\n const fitsLeft = leftLeft >= 0;\n\n switch (placement) {\n case \"top\":\n return { top: fitsAbove ? aboveTop : fitsBelow ? belowTop : clampY(aboveTop), left: centerX };\n case \"bottom\":\n return { top: fitsBelow ? belowTop : fitsAbove ? aboveTop : clampY(belowTop), left: centerX };\n case \"right\":\n return { top: centerY, left: fitsRight ? rightLeft : fitsLeft ? leftLeft : clampX(rightLeft) };\n case \"left\":\n return { top: centerY, left: fitsLeft ? leftLeft : fitsRight ? rightLeft : clampX(leftLeft) };\n default:\n if (fitsBelow) return { top: belowTop, left: centerX };\n if (fitsAbove) return { top: aboveTop, left: centerX };\n return { top: Math.max(m, (vh - ch) / 2), left: centerX };\n }\n}\n\nfunction TourCard({\n step,\n index,\n total,\n labels,\n isFirst,\n isLast,\n rect,\n dir,\n onBack,\n onNext,\n onSkip,\n}: {\n step: TourStep;\n index: number;\n total: number;\n labels: TourLabels;\n isFirst: boolean;\n isLast: boolean;\n rect: Rect | null;\n dir: Direction;\n onBack: () => void;\n onNext: () => void;\n onSkip: () => void;\n}) {\n const ref = useRef<HTMLDivElement>(null);\n const [style, setStyle] = useState<CSSProperties>({ opacity: 0 });\n\n /**\n * The card holds the focus, because the card is what the tour IS.\n *\n * The overlay above declares `role=\"dialog\" aria-modal=\"true\"` — it always has — and\n * then left focus wherever the page had put it. For a tour that is the most pointed\n * version of the audit's *\"Only Modal manages focus\"*: the whole component exists to\n * say \"look here\", and for a keyboard user \"here\" is the focus ring. They were told\n * the page was hidden, given no way to reach the Next button without Tabbing through\n * it, and left on a control the screen reader would no longer describe.\n *\n * It re-engages on every step, without any bookkeeping here, because `TourOverlay`\n * returns null while it re-locates the next target: the card genuinely unmounts and\n * remounts between steps. That is what keeps focus honest when the BUTTONS change —\n * \"Back\" does not exist on the first step, so stepping back onto it destroys the\n * control the press came from, and focus would otherwise fall to `<body>`, outside\n * this trap's own listener, where Tab walks straight into the page the overlay claims\n * to have hidden.\n *\n * **The cost, written down:** on an `awaitClick` step the user is asked to click the\n * spotlighted element, and they can no longer Tab to it. ArrowRight still advances\n * (the key handler in `TourOverlay` is on the document and does not care where focus\n * is), which is the escape hatch that step already documents for the case where the\n * target cannot be found. Containment is worth that: an `awaitClick` step is a\n * minority of steps, while focus stranded behind `aria-modal` is every step.\n */\n useFocusTrap(ref, { active: true });\n\n useLayoutEffect(() => {\n const card = ref.current;\n if (!card) return;\n setStyle(\n placeCard(rect, card.offsetWidth, card.offsetHeight, window.innerWidth, window.innerHeight, 12, step.placement, dir),\n );\n }, [rect, index, step.placement, dir]);\n\n return (\n <div\n ref={ref}\n // Focusable but not tabbable: the trap above focuses the card itself rather than\n // its first button, so a screen reader reads the step's title and body before it\n // reads \"Next\" — and without this the container cannot take focus at all and the\n // trap silently does nothing.\n tabIndex={-1}\n style={style}\n className=\"pointer-events-auto fixed z-[61] w-80 max-w-[calc(100vw-1.5rem)] rounded-lg border border-[var(--border)] bg-[var(--bg-surface)] p-4 shadow-xl outline-none transition-all duration-200 ease-out\"\n >\n <div className=\"text-sm font-semibold text-[var(--text-primary)]\">{step.title}</div>\n <div className=\"mt-1 text-sm leading-relaxed text-[var(--text-secondary)]\">{step.body}</div>\n {step.action && <div className=\"mt-3\">{step.action}</div>}\n <div className=\"mt-4 space-y-2\">\n <div className=\"flex items-center justify-between gap-2\">\n <button\n type=\"button\"\n onClick={onSkip}\n className=\"text-xs text-[var(--text-placeholder)] hover:text-[var(--text-secondary)]\"\n >\n {labels.skip}\n </button>\n <div className=\"flex items-center gap-2\">\n <span className=\"whitespace-nowrap text-xs tabular-nums text-[var(--text-placeholder)]\">\n {labels.step(index + 1, total)}\n </span>\n {!isFirst && (\n <Button variant=\"secondary\" onClick={onBack} className=\"px-2.5 py-1 text-xs\">\n {labels.back}\n </Button>\n )}\n {/* On an awaitClick step the Next button is replaced by a hint on its\n own row below, so it doesn't cram the counter + buttons and wrap.\n Only when the target was actually FOUND, though — `rect` is null\n when the finder gave up, and the click listener early-returns on\n the same absence. Keyed on `step.target` alone this hid the only\n way forward on any step whose anchor happens not to be rendered\n for this user (a guest sees no \"add account\" button), leaving the\n undocumented ArrowRight key as the sole escape. */}\n {!(step.awaitClick && step.target && rect) && (\n <Button variant=\"brand\" onClick={onNext} className={cn(\"px-2.5 py-1 text-xs\")}>\n {isLast ? labels.done : labels.next}\n </Button>\n )}\n </div>\n </div>\n {step.awaitClick && step.target && rect && (\n <div className=\"text-center text-xs italic text-[var(--text-placeholder)]\">\n {labels.awaitClickHint}\n </div>\n )}\n </div>\n </div>\n );\n}\n"],"mappings":";AAiNI,SA6SA,UA1SI,KAHJ;AAjNJ;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP,SAAS,oBAAoB;AAC7B,SAAS,UAAU;AACnB,SAAS,oBAAoB;AAC7B,SAAS,cAAc;AACvB,SAAS,oBAAoB;AAC7B,SAAS,OAAO,sBAAsB;AA+C/B,MAAM,sBAAkC;AAAA,EAC7C,MAAM;AAAA,EACN,MAAM;AAAA,EACN,MAAM;AAAA,EACN,MAAM;AAAA,EACN,gBAAgB;AAAA,EAChB,MAAM,CAAC,GAAG,MAAM,GAAG,CAAC,MAAM,CAAC;AAC7B;AAkCA,MAAM,cAAc,cAAuC,IAAI;AAExD,SAAS,UAA4B;AAC1C,QAAM,MAAM,WAAW,WAAW;AAClC,MAAI,CAAC,IAAK,OAAM,IAAI,MAAM,4CAA4C;AACtE,SAAO;AACT;AAsBO,SAAS,kBAA2C;AACzD,SAAO,WAAW,WAAW;AAC/B;AAUO,SAAS,aAAa;AAAA,EAC3B;AAAA,EACA;AACF,GAGG;AAID,QAAM,SAAS,aAAa,QAAQ,qBAAqB,MAAM;AAC/D,QAAM,CAAC,OAAO,QAAQ,IAAI,SAA4B,IAAI;AAC1D,QAAM,CAAC,OAAO,QAAQ,IAAI,SAAS,CAAC;AACpC,QAAM,CAAC,UAAU,WAAW,IAAI,SAAwB,IAAI;AAC5D,QAAM,UAAU,OAAqB,CAAC,CAAC;AAKvC,QAAM,WAAW,OAA0B,IAAI;AAC/C,QAAM,WAAW,OAAO,CAAC;AACzB,kBAAgB,MAAM;AACpB,aAA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AC,SAAI,WAAU,kBACb;AAAA,+BAAC,SAAI,WAAU,2CACb;AAAA;AAAA,cAAC;AAAA;AAAA,gBACC,MAAK;AAAA,gBACL,SAAS;AAAA,gBACT,WAAU;AAAA,gBAET,iBAAO;AAAA;AAAA,YACV;AAAA,YACA,qBAAC,SAAI,WAAU,2BACb;AAAA,kCAAC,UAAK,WAAU,yEACb,iBAAO,KAAK,QAAQ,GAAG,KAAK,GAC/B;AAAA,cACC,CAAC,WACA,oBAAC,UAAO,SAAQ,aAAY,SAAS,QAAQ,WAAU,uBACpD,iBAAO,MACV;AAAA,cAUD,EAAE,KAAK,cAAc,KAAK,UAAU,SACnC,oBAAC,UAAO,SAAQ,SAAQ,SAAS,QAAQ,WAAW,GAAG,qBAAqB,GACzE,mBAAS,OAAO,OAAO,OAAO,MACjC;AAAA,eAEJ;AAAA,aACF;AAAA,UACC,KAAK,cAAc,KAAK,UAAU,QACjC,oBAAC,SAAI,WAAU,6DACZ,iBAAO,gBACV;AAAA,WAEJ;AAAA;AAAA;AAAA,EACF;AAEJ;","names":[]}
1
+ {"version":3,"sources":["../../src/tour/tour.tsx"],"sourcesContent":["import {\n createContext,\n useCallback,\n useContext,\n useEffect,\n useLayoutEffect,\n useRef,\n useState,\n} from \"react\";\nimport type { CSSProperties, ReactNode } from \"react\";\nimport { createPortal } from \"react-dom\";\nimport { cn } from \"../lib/cn\";\nimport { useKitLabels } from \"../i18n/kit-labels\";\nimport { Button } from \"../components/ui\";\nimport { useFocusTrap } from \"../hooks/use-focus-trap\";\nimport { dirOf, horizontalStep } from \"../lib/direction\";\nimport type { Direction } from \"../lib/direction\";\n\n/**\n * `start`/`end` follow the reading direction (`end` is the right side in LTR and the\n * left side in RTL) and are what a translated app wants. `left`/`right` stay physical\n * for the steps that genuinely mean a screen side.\n */\nexport type TourPlacement = \"top\" | \"right\" | \"bottom\" | \"left\" | \"start\" | \"end\" | \"center\";\n\nexport interface TourStep {\n /** CSS selector for the element to spotlight. Omit for a centered step\n * (welcome/finish). If the target isn't found/visible, the step centers. */\n target?: string;\n title: string;\n body: ReactNode;\n /** Extra footer content, e.g. a \"load sample data\" shortcut. */\n action?: ReactNode;\n /** Spotlight padding around the target, px (default 8). */\n padding?: number;\n /** Where the card sits relative to the target. Omit for auto placement\n * (below → above → centered). \"center\" ignores the target and centers on\n * screen. \"start\"/\"end\" are the logical sides and flip in RTL; \"left\"/\"right\"\n * are physical. An explicit side flips to the opposite side if it would\n * overflow, then clamps into the viewport. */\n placement?: TourPlacement;\n /** Advance only when the user clicks the spotlighted target itself (not the\n * card's Next button). Requires `target`: the real control's own handler runs\n * first, then the tour steps forward on a microtask. The spotlight hole stays\n * click-through to the target; the rest of the page does not. */\n awaitClick?: boolean;\n /** Runs before the step is shown — e.g. navigate to a route, open a panel.\n * May be async; the step waits for it, then locates the target. */\n beforeStep?: () => void | Promise<void>;\n}\n\nexport interface TourLabels {\n next: string;\n back: string;\n skip: string;\n done: string;\n /** Shown in place of the Next button on an `awaitClick` step. */\n awaitClickHint: string;\n /** Step counter, e.g. (2, 7) => \"2 / 7\". */\n step: (current: number, total: number) => string;\n}\n\nexport const DEFAULT_TOUR_LABELS: TourLabels = {\n next: \"Next\",\n back: \"Back\",\n skip: \"Skip\",\n done: \"Done\",\n awaitClickHint: \"Click the highlighted element to continue\",\n step: (c, t) => `${c} / ${t}`,\n};\n\ninterface StartOptions {\n /** Stable id of the tour, surfaced as `activeId` so the app can mirror it to\n * the URL (deep-link / evaluation tracking) and record completion. */\n id?: string;\n /** Start at this step index instead of 0 (clamped) — for URL/deep-link resume. */\n startIndex?: number;\n /** Fires synchronously when the tour starts (e.g. enable a mock interceptor). */\n onStart?: () => void;\n onFinish?: () => void;\n onSkip?: () => void;\n}\n\ninterface TourContextValue {\n active: boolean;\n /** Id of the running tour (from {@link StartOptions.id}), else null. */\n activeId: string | null;\n /** Start a tour with the given steps. */\n start: (steps: TourStep[], opts?: StartOptions) => void;\n /** End the current tour (no callbacks fire). */\n stop: () => void;\n /** Advance one step; past the last step it finishes the tour (fires onFinish). */\n next: () => void;\n /** Go back one step (no-op on the first). */\n prev: () => void;\n /** Jump to a step by index, clamped to range — e.g. for URL/deep-link resume. */\n goToStep: (index: number) => void;\n /** Current step (0-based; 0 while inactive). */\n index: number;\n /** Total steps (0 while inactive). */\n total: number;\n}\n\nconst TourContext = createContext<TourContextValue | null>(null);\n\nexport function useTour(): TourContextValue {\n const ctx = useContext(TourContext);\n if (!ctx) throw new Error(\"useTour must be used within <TourProvider>\");\n return ctx;\n}\n\n/**\n * The tour engine if it is there, `null` if it is not — for a control that is a\n * DECORATION rather than a participant.\n *\n * {@link useTour}'s throw is correct and stays: a component that runs a tour cannot do\n * its job without the provider, and failing loudly is how that gets fixed. But the\n * throw's blast radius is whatever error boundary is above it, and for a launcher in\n * the app shell that is the whole app.\n *\n * Keksdose feedback dev#524 is what that costs: an `@hb/ui` module was edited while a\n * dev server was running, vite re-evaluated it, and the module's freshly created\n * context object was no longer the one the mounted provider was providing. React's\n * `useContext` then answers `null` for a provider that is, structurally, right there —\n * and the top bar's tour menu took the entire shell down with it. **Build-time module\n * graphs cannot produce that**, so it is a development-only failure; a menu that\n * disappears for a second is the proportionate response to it either way.\n *\n * Only for controls that can honestly render nothing. If a component would show a\n * broken half of itself without the tour, it wants {@link useTour}.\n */\nexport function useTourOptional(): TourContextValue | null {\n return useContext(TourContext);\n}\n\n/**\n * Provides the guided-tour engine: a dimmed spotlight overlay + step card driven\n * by a list of {@link TourStep}s. Domain-free — the app supplies the steps (copy,\n * selectors, per-step navigation, placement) and the translated {@link TourLabels}.\n * Mount once inside the router; start a tour from anywhere via {@link useTour},\n * which also exposes step control (`next`/`prev`/`goToStep`) and the current\n * `index`/`total` for URL mirroring, `awaitClick` and deep-link resume.\n */\nexport function TourProvider({\n children,\n labels,\n}: {\n children: ReactNode;\n labels?: Partial<TourLabels>;\n}) {\n // `labels` over the provider's `tour` over English. Resolved once here and handed\n // down: the step card is portalled, but context crosses portals anyway — this is\n // simply the one place that already owned the merge.\n const merged = useKitLabels(\"tour\", DEFAULT_TOUR_LABELS, labels);\n const [steps, setSteps] = useState<TourStep[] | null>(null);\n const [index, setIndex] = useState(0);\n const [activeId, setActiveId] = useState<string | null>(null);\n const optsRef = useRef<StartOptions>({});\n // Live mirrors so the step-control callbacks can stay stable (identity-safe for\n // consumers) while still reading the current steps/index. Synced in a layout\n // effect — after the commit, before paint and before any passive effect or event\n // can call them — rather than written during render.\n const stepsRef = useRef<TourStep[] | null>(null);\n const indexRef = useRef(0);\n useLayoutEffect(() => {\n stepsRef.current = steps;\n indexRef.current = index;\n }, [steps, index]);\n const active = !!steps && steps.length > 0;\n const total = steps?.length ?? 0;\n\n const start = useCallback((s: TourStep[], opts?: StartOptions) => {\n optsRef.current = opts ?? {};\n optsRef.current.onStart?.();\n setIndex(Math.min(Math.max(0, opts?.startIndex ?? 0), Math.max(0, s.length - 1)));\n setActiveId(opts?.id ?? null);\n setSteps(s);\n }, []);\n const stop = useCallback(() => {\n setSteps(null);\n setActiveId(null);\n }, []);\n const finish = useCallback(() => {\n optsRef.current.onFinish?.();\n setSteps(null);\n setActiveId(null);\n }, []);\n const skip = useCallback(() => {\n optsRef.current.onSkip?.();\n setSteps(null);\n setActiveId(null);\n }, []);\n\n const goToStep = useCallback((i: number) => {\n const len = stepsRef.current?.length ?? 0;\n if (len === 0) return;\n setIndex(Math.min(Math.max(0, i), len - 1));\n }, []);\n const next = useCallback(() => {\n const len = stepsRef.current?.length ?? 0;\n if (len === 0) return;\n if (indexRef.current >= len - 1) finish();\n else setIndex(indexRef.current + 1);\n }, [finish]);\n const prev = useCallback(() => {\n if (indexRef.current > 0) setIndex(indexRef.current - 1);\n }, []);\n\n return (\n <TourContext.Provider value={{ active, activeId, start, stop, next, prev, goToStep, index, total }}>\n {children}\n {active && (\n <TourOverlay\n steps={steps!}\n index={index}\n labels={merged}\n onNext={next}\n onPrev={prev}\n onSkip={skip}\n />\n )}\n </TourContext.Provider>\n );\n}\n\ninterface Rect {\n top: number;\n left: number;\n width: number;\n height: number;\n}\n\nfunction isVisible(el: Element): boolean {\n // A non-zero box already rules out display:none on the element or any ancestor\n // (an unrendered element measures 0x0). We deliberately do NOT test\n // offsetParent: it is null for position:fixed elements even when fully visible,\n // which made the mobile bottom-nav bar (fixed) un-highlightable on mobile\n // (feedback #313). visibility:hidden keeps a box, so check it explicitly.\n const r = el.getBoundingClientRect();\n if (r.width <= 0 || r.height <= 0) return false;\n const style = getComputedStyle(el);\n return style.visibility !== \"hidden\" && style.display !== \"none\";\n}\n\n// The first VISIBLE element matching the selector, not merely the first in DOM\n// order. This lets a step target the same control across layouts with one\n// combined selector — e.g. the desktop sidebar link AND the mobile bottom-bar\n// link — where the off-layout copy is present but `display:none` (feedback\n// #313). Returns null while none is visible so the finder keeps retrying.\nfunction queryVisibleTarget(selector: string): Element | null {\n const els = document.querySelectorAll(selector);\n for (const el of els) {\n if (isVisible(el)) return el;\n }\n return null;\n}\n\nfunction sameRect(a: Rect | null, b: Rect | null): boolean {\n if (a === b) return true;\n if (!a || !b) return false;\n return a.top === b.top && a.left === b.left && a.width === b.width && a.height === b.height;\n}\n\nfunction rectOf(el: Element): Rect {\n const r = el.getBoundingClientRect();\n return { top: r.top, left: r.left, width: r.width, height: r.height };\n}\n\n/**\n * What the finder established for ONE step: where its target is (`null` = no target,\n * or not on the page), and the reading direction the card takes from it.\n *\n * It carries the step it was found for, and the overlay only believes it for that\n * step — which is the whole fix for keksdose's tours audit 2026-10-02, §1.0 A (\"stale\n * spotlight on the step after a spotlighted one\", 15 steps in 16 tours, desktop and\n * phone, mouse and keyboard). When step N spotlit a target and step N+1 had none (or\n * its anchor was missing), N+1 kept N's hole and parked its card beside it, so a\n * centred \"You're all set\" read as pointing at the Import & Export link; Back→Next kept\n * it for as long as anyone watched.\n *\n * The overlay used to hold `rect` and `ready` as separate states and reset them\n * DURING RENDER when the step changed. React 19 does not keep a render-phase update\n * while an earlier, lower-priority update to the same hook is still queued — it only\n * writes the result to the base state \"unless the queue is empty\" — and the follow\n * interval below queues exactly such an update every 250 ms (eagerly bailed out because\n * the rect had not moved, but left in the queue for rebasing). So the click's render\n * showed the reset, and the very next render (the finder saying \"ready\") re-based on\n * the old rect. A deep link was fine because nothing had queued anything yet.\n *\n * Keying the result to its step does not depend on any of that ordering: a rect found\n * for another step is not this step's rect, whatever the queue does with it, and a\n * missing anchor reads as \"no target\" instead of as the last thing that was lit.\n */\ninterface Located {\n index: number;\n step: TourStep;\n rect: Rect | null;\n dir: Direction;\n}\n\nfunction TourOverlay({\n steps,\n index,\n labels,\n onNext,\n onPrev,\n onSkip,\n}: {\n steps: TourStep[];\n index: number;\n labels: TourLabels;\n onNext: () => void;\n onPrev: () => void;\n onSkip: () => void;\n}) {\n const step = steps[index];\n const isFirst = index === 0;\n const isLast = index === steps.length - 1;\n // A new step starts unlocated: whatever was found for another step (see `Located`)\n // is ignored, so the overlay renders nothing until the effect below has located THIS\n // step, and never the previous step's spotlight.\n const [located, setLocated] = useState<Located | null>(null);\n const current = located !== null && located.index === index && located.step === step ? located : null;\n const ready = current !== null;\n const rect = current?.rect ?? null;\n // The overlay is portalled to <body>, out of whatever `dir` subtree the app set, so it\n // takes the direction of the element it spotlights (the document's for a centered\n // step). Arrow keys and start/end placement read it.\n const dir: Direction = current?.dir ?? \"ltr\";\n const rootRef = useRef<HTMLDivElement>(null);\n\n // Run beforeStep, then locate the target (retrying across route/render lag).\n useEffect(() => {\n let cancelled = false;\n let raf = 0;\n // `null` = untargeted, or the finder gave up → the card centres, with no hole.\n const settle = (el: Element | null) =>\n setLocated({ index, step, rect: el ? rectOf(el) : null, dir: dirOf(el) });\n void (async () => {\n await step.beforeStep?.();\n if (cancelled) return;\n if (!step.target) {\n settle(null);\n return;\n }\n let tries = 0;\n const find = () => {\n if (cancelled) return;\n const el = queryVisibleTarget(step.target!);\n if (el) {\n el.scrollIntoView({ block: \"center\", behavior: \"smooth\" });\n settle(el);\n return;\n }\n if (tries++ < 45) raf = requestAnimationFrame(find);\n else settle(null); // give up → render centered\n };\n find();\n })();\n return () => {\n cancelled = true;\n cancelAnimationFrame(raf);\n };\n }, [index, step]);\n\n // Follow the target as the page scrolls / reflows — only once THIS step is located,\n // and only into this step's result.\n useEffect(() => {\n if (!step.target) return;\n const update = () => {\n const el = queryVisibleTarget(step.target!);\n if (el) {\n const next = rectOf(el);\n setLocated((prev) =>\n prev && prev.index === index && prev.step === step && !sameRect(prev.rect, next)\n ? { ...prev, rect: next }\n : prev,\n );\n }\n };\n window.addEventListener(\"scroll\", update, true);\n window.addEventListener(\"resize\", update);\n const id = window.setInterval(update, 250);\n return () => {\n window.removeEventListener(\"scroll\", update, true);\n window.removeEventListener(\"resize\", update);\n clearInterval(id);\n };\n }, [index, step]);\n\n // awaitClick: advance when the *real* target is clicked. The spotlight hole is\n // click-through (see the shields in the render below) so the element's own\n // handler runs first; we step forward on the next macrotask.\n //\n // Re-armed when the target turns up after the finder gave up (the follow effect\n // lights it late): the card swaps Next for the \"click the highlighted element\" hint\n // as soon as there is a rect, so the click must work from that moment too.\n const spotted = rect !== null;\n useEffect(() => {\n if (!ready || !spotted || !step.awaitClick || !step.target) return;\n const el = queryVisibleTarget(step.target);\n if (!el) return;\n const onClick = () => window.setTimeout(() => onNext(), 0);\n el.addEventListener(\"click\", onClick, { once: true });\n return () => el.removeEventListener(\"click\", onClick);\n }, [ready, spotted, index, step, onNext]);\n\n // Keyboard: Esc skips, Enter and the reading-direction arrow advance (→ in LTR,\n // ← in RTL), the other arrow goes back. On awaitClick steps Enter is ignored (it\n // would fire the target's click AND advance) — the forward arrow stays as an escape\n // hatch.\n //\n // Enter on a focused control belongs to that control. This used to advance from\n // anywhere, so Enter on a focused Skip or Back ran the button's own click AND stepped\n // forward: Back moved nowhere, Skip skipped and then called `next` on a dead tour.\n // The same goes for arrows in a text field a step's `action` might contain.\n useEffect(() => {\n const onKey = (e: KeyboardEvent) => {\n if (e.key === \"Escape\") {\n onSkip();\n return;\n }\n if (e.key === \"Enter\") {\n if (step.awaitClick || ownsKey(e.target, \"Enter\")) return;\n e.preventDefault();\n onNext();\n return;\n }\n if (ownsKey(e.target, e.key)) return;\n // The overlay root carries `dir`; before it paints, the document's answers.\n const delta = horizontalStep(e.key, rootRef.current);\n if (delta === 1) {\n e.preventDefault();\n onNext();\n } else if (delta === -1) {\n if (!isFirst) onPrev();\n }\n };\n document.addEventListener(\"keydown\", onKey);\n return () => document.removeEventListener(\"keydown\", onKey);\n }, [isFirst, step, onNext, onPrev, onSkip]);\n\n if (!ready) return null;\n\n const pad = step.padding ?? 8;\n const spot: Rect | null = rect\n ? { top: rect.top - pad, left: rect.left - pad, width: rect.width + pad * 2, height: rect.height + pad * 2 }\n : null;\n\n // `aria-modal` promises the page behind is out of reach, and the card's focus trap\n // keeps that promise for the keyboard. The pointer used to get no such treatment: the\n // root is `pointer-events-none` so that the spotlight hole can stay live for\n // `awaitClick`, and the scrim is a box-shadow, which takes no clicks — so every\n // control on the dimmed page stayed clickable. Four shields now tile the viewport\n // around the hole: the page is blocked, the card and the spotlighted target are not.\n // Keeping `aria-modal` (rather than dropping it) is the coherent half: the tour\n // really is modal — focus is trapped and Esc/Skip is the way out.\n return createPortal(\n <div\n ref={rootRef}\n className=\"pointer-events-none fixed inset-0 z-[60]\"\n role=\"dialog\"\n aria-modal=\"true\"\n aria-label={step.title}\n dir={dir}\n >\n {spot && <SpotlightShields spot={spot} />}\n {spot ? (\n <div\n className=\"pointer-events-none fixed rounded-lg transition-all duration-200 ease-out\"\n style={{\n top: spot.top,\n left: spot.left,\n width: spot.width,\n height: spot.height,\n // A two-tone frame, not a single translucent ring.\n //\n // The old treatment was `ring-2 ring-white/80` over a 55% scrim, and it\n // \"was barely visible\" on the app's blue-tinted surfaces. Two reasons,\n // and a single ring can't fix either: at 55% the surround stays bright\n // enough that the un-dimmed hole barely reads AS a hole, and a 80%-white\n // ring sitting on the edge of a light card is white-on-near-white.\n //\n // So: an opaque white band immediately around the target, a dark keyline\n // outside it, then the scrim. Whatever the target's own colour is, one of\n // the two bands is always in contrast with it and the other is always in\n // contrast with the dimmed surround — there is no background that can\n // swallow both. The blurred layer between them softens the step so the\n // frame reads as lighting rather than as a pasted-on rectangle.\n boxShadow: [\n \"0 0 0 3px rgba(255,255,255,0.98)\",\n \"0 0 0 5px rgba(15,23,42,0.92)\",\n \"0 0 18px 6px rgba(15,23,42,0.45)\",\n \"0 0 0 9999px rgba(15,23,42,0.70)\",\n ].join(\", \"),\n }}\n />\n ) : (\n <div className=\"pointer-events-auto fixed inset-0 bg-black/70\" />\n )}\n <TourCard\n step={step}\n index={index}\n total={steps.length}\n labels={labels}\n isFirst={isFirst}\n isLast={isLast}\n rect={spot}\n dir={dir}\n onBack={onPrev}\n onNext={onNext}\n onSkip={onSkip}\n />\n </div>,\n document.body,\n );\n}\n\n/** Does the focused element handle `key` itself? Enter on a button or link, and any\n * editing key in a text field or select, is the control's — not the tour's. */\nfunction ownsKey(target: EventTarget | null, key: string): boolean {\n if (!(target instanceof HTMLElement)) return false;\n if (target.isContentEditable) return true;\n const tag = target.tagName;\n if (tag === \"TEXTAREA\" || tag === \"SELECT\") return true;\n if (tag === \"INPUT\") {\n const type = (target as HTMLInputElement).type;\n // Enter on a checkbox does nothing natively, but ←/→ on a radio moves it.\n return key !== \"Enter\" || type !== \"checkbox\";\n }\n if (key !== \"Enter\") return false;\n return (\n tag === \"BUTTON\" ||\n (tag === \"A\" && target.hasAttribute(\"href\")) ||\n target.getAttribute(\"role\") === \"button\" ||\n target.getAttribute(\"role\") === \"link\"\n );\n}\n\n/**\n * Transparent pointer blockers tiling the viewport around the spotlight hole: one\n * full-width band above and below, one on each side at the hole's own height. The hole\n * itself stays uncovered, so the target keeps its clicks.\n */\nfunction SpotlightShields({ spot }: { spot: Rect }) {\n const shield = \"pointer-events-auto fixed\";\n const bottom = spot.top + spot.height;\n return (\n <>\n <div data-tour-shield=\"\" className={shield} style={{ top: 0, left: 0, right: 0, height: Math.max(0, spot.top) }} />\n <div data-tour-shield=\"\" className={shield} style={{ top: bottom, left: 0, right: 0, bottom: 0 }} />\n <div\n data-tour-shield=\"\"\n className={shield}\n style={{ top: spot.top, left: 0, width: Math.max(0, spot.left), height: spot.height }}\n />\n <div\n data-tour-shield=\"\"\n className={shield}\n style={{ top: spot.top, left: spot.left + spot.width, right: 0, height: spot.height }}\n />\n </>\n );\n}\n\n/**\n * Card position (viewport px) for the given placement relative to the padded\n * spotlight `rect`. Omitted placement keeps the original auto behavior\n * (below → above → vertically centered); an explicit side flips to its opposite\n * if it would overflow, then clamps into the viewport. \"center\" (or no rect)\n * centers on screen.\n */\nfunction placeCard(\n rect: Rect | null,\n cw: number,\n ch: number,\n vw: number,\n vh: number,\n m: number,\n placement?: TourPlacement,\n dir: Direction = \"ltr\",\n): { top: number; left: number } {\n // The logical sides resolve to a physical one here, and only here.\n if (placement === \"start\") placement = dir === \"rtl\" ? \"right\" : \"left\";\n else if (placement === \"end\") placement = dir === \"rtl\" ? \"left\" : \"right\";\n if (!rect || placement === \"center\") {\n return { top: Math.max(m, (vh - ch) / 2), left: Math.max(m, (vw - cw) / 2) };\n }\n const clampX = (x: number) => Math.min(Math.max(m, x), Math.max(m, vw - cw - m));\n const clampY = (y: number) => Math.min(Math.max(m, y), Math.max(m, vh - ch - m));\n const centerX = clampX(rect.left + rect.width / 2 - cw / 2);\n const centerY = clampY(rect.top + rect.height / 2 - ch / 2);\n const belowTop = rect.top + rect.height + m;\n const aboveTop = rect.top - ch - m;\n const rightLeft = rect.left + rect.width + m;\n const leftLeft = rect.left - cw - m;\n const fitsBelow = belowTop + ch <= vh;\n const fitsAbove = aboveTop >= 0;\n const fitsRight = rightLeft + cw <= vw;\n const fitsLeft = leftLeft >= 0;\n\n switch (placement) {\n case \"top\":\n return { top: fitsAbove ? aboveTop : fitsBelow ? belowTop : clampY(aboveTop), left: centerX };\n case \"bottom\":\n return { top: fitsBelow ? belowTop : fitsAbove ? aboveTop : clampY(belowTop), left: centerX };\n case \"right\":\n return { top: centerY, left: fitsRight ? rightLeft : fitsLeft ? leftLeft : clampX(rightLeft) };\n case \"left\":\n return { top: centerY, left: fitsLeft ? leftLeft : fitsRight ? rightLeft : clampX(leftLeft) };\n default:\n if (fitsBelow) return { top: belowTop, left: centerX };\n if (fitsAbove) return { top: aboveTop, left: centerX };\n return { top: Math.max(m, (vh - ch) / 2), left: centerX };\n }\n}\n\nfunction TourCard({\n step,\n index,\n total,\n labels,\n isFirst,\n isLast,\n rect,\n dir,\n onBack,\n onNext,\n onSkip,\n}: {\n step: TourStep;\n index: number;\n total: number;\n labels: TourLabels;\n isFirst: boolean;\n isLast: boolean;\n rect: Rect | null;\n dir: Direction;\n onBack: () => void;\n onNext: () => void;\n onSkip: () => void;\n}) {\n const ref = useRef<HTMLDivElement>(null);\n const [style, setStyle] = useState<CSSProperties>({ opacity: 0 });\n\n /**\n * The card holds the focus, because the card is what the tour IS.\n *\n * The overlay above declares `role=\"dialog\" aria-modal=\"true\"` — it always has — and\n * then left focus wherever the page had put it. For a tour that is the most pointed\n * version of the audit's *\"Only Modal manages focus\"*: the whole component exists to\n * say \"look here\", and for a keyboard user \"here\" is the focus ring. They were told\n * the page was hidden, given no way to reach the Next button without Tabbing through\n * it, and left on a control the screen reader would no longer describe.\n *\n * It re-engages on every step, without any bookkeeping here, because `TourOverlay`\n * returns null while it re-locates the next target: the card genuinely unmounts and\n * remounts between steps. That is what keeps focus honest when the BUTTONS change —\n * \"Back\" does not exist on the first step, so stepping back onto it destroys the\n * control the press came from, and focus would otherwise fall to `<body>`, outside\n * this trap's own listener, where Tab walks straight into the page the overlay claims\n * to have hidden.\n *\n * **The cost, written down:** on an `awaitClick` step the user is asked to click the\n * spotlighted element, and they can no longer Tab to it. ArrowRight still advances\n * (the key handler in `TourOverlay` is on the document and does not care where focus\n * is), which is the escape hatch that step already documents for the case where the\n * target cannot be found. Containment is worth that: an `awaitClick` step is a\n * minority of steps, while focus stranded behind `aria-modal` is every step.\n */\n useFocusTrap(ref, { active: true });\n\n useLayoutEffect(() => {\n const card = ref.current;\n if (!card) return;\n setStyle(\n placeCard(rect, card.offsetWidth, card.offsetHeight, window.innerWidth, window.innerHeight, 12, step.placement, dir),\n );\n }, [rect, index, step.placement, dir]);\n\n return (\n <div\n ref={ref}\n // Focusable but not tabbable: the trap above focuses the card itself rather than\n // its first button, so a screen reader reads the step's title and body before it\n // reads \"Next\" — and without this the container cannot take focus at all and the\n // trap silently does nothing.\n tabIndex={-1}\n style={style}\n className=\"pointer-events-auto fixed z-[61] w-80 max-w-[calc(100vw-1.5rem)] rounded-lg border border-[var(--border)] bg-[var(--bg-surface)] p-4 shadow-xl outline-none transition-all duration-200 ease-out\"\n >\n <div className=\"text-sm font-semibold text-[var(--text-primary)]\">{step.title}</div>\n <div className=\"mt-1 text-sm leading-relaxed text-[var(--text-secondary)]\">{step.body}</div>\n {step.action && <div className=\"mt-3\">{step.action}</div>}\n <div className=\"mt-4 space-y-2\">\n <div className=\"flex items-center justify-between gap-2\">\n <button\n type=\"button\"\n onClick={onSkip}\n className=\"text-xs text-[var(--text-placeholder)] hover:text-[var(--text-secondary)]\"\n >\n {labels.skip}\n </button>\n <div className=\"flex items-center gap-2\">\n <span className=\"whitespace-nowrap text-xs tabular-nums text-[var(--text-placeholder)]\">\n {labels.step(index + 1, total)}\n </span>\n {!isFirst && (\n <Button variant=\"secondary\" onClick={onBack} className=\"px-2.5 py-1 text-xs\">\n {labels.back}\n </Button>\n )}\n {/* On an awaitClick step the Next button is replaced by a hint on its\n own row below, so it doesn't cram the counter + buttons and wrap.\n Only when the target was actually FOUND, though — `rect` is null\n when the finder gave up, and the click listener early-returns on\n the same absence. Keyed on `step.target` alone this hid the only\n way forward on any step whose anchor happens not to be rendered\n for this user (a guest sees no \"add account\" button), leaving the\n undocumented ArrowRight key as the sole escape. */}\n {!(step.awaitClick && step.target && rect) && (\n <Button variant=\"brand\" onClick={onNext} className={cn(\"px-2.5 py-1 text-xs\")}>\n {isLast ? labels.done : labels.next}\n </Button>\n )}\n </div>\n </div>\n {step.awaitClick && step.target && rect && (\n <div className=\"text-center text-xs italic text-[var(--text-placeholder)]\">\n {labels.awaitClickHint}\n </div>\n )}\n </div>\n </div>\n );\n}\n"],"mappings":";AAiNI,SAmVA,UAhVI,KAHJ;AAjNJ;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP,SAAS,oBAAoB;AAC7B,SAAS,UAAU;AACnB,SAAS,oBAAoB;AAC7B,SAAS,cAAc;AACvB,SAAS,oBAAoB;AAC7B,SAAS,OAAO,sBAAsB;AA+C/B,MAAM,sBAAkC;AAAA,EAC7C,MAAM;AAAA,EACN,MAAM;AAAA,EACN,MAAM;AAAA,EACN,MAAM;AAAA,EACN,gBAAgB;AAAA,EAChB,MAAM,CAAC,GAAG,MAAM,GAAG,CAAC,MAAM,CAAC;AAC7B;AAkCA,MAAM,cAAc,cAAuC,IAAI;AAExD,SAAS,UAA4B;AAC1C,QAAM,MAAM,WAAW,WAAW;AAClC,MAAI,CAAC,IAAK,OAAM,IAAI,MAAM,4CAA4C;AACtE,SAAO;AACT;AAsBO,SAAS,kBAA2C;AACzD,SAAO,WAAW,WAAW;AAC/B;AAUO,SAAS,aAAa;AAAA,EAC3B;AAAA,EACA;AACF,GAGG;AAID,QAAM,SAAS,aAAa,QAAQ,qBAAqB,MAAM;AAC/D,QAAM,CAAC,OAAO,QAAQ,IAAI,SAA4B,IAAI;AAC1D,QAAM,CAAC,OAAO,QAAQ,IAAI,SAAS,CAAC;AACpC,QAAM,CAAC,UAAU,WAAW,IAAI,SAAwB,IAAI;AAC5D,QAAM,UAAU,OAAqB,CAAC,CAAC;AAKvC,QAAM,WAAW,OAA0B,IAAI;AAC/C,QAAM,WAAW,OAAO,CAAC;AACzB,kBAAgB,MAAM;AACpB,aAAS,UAAU;AACnB,aAAS,UAAU;AAAA,EACrB,GAAG,CAAC,OAAO,KAAK,CAAC;A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AAAA;AAAA,YACV;AAAA,YACA,qBAAC,SAAI,WAAU,2BACb;AAAA,kCAAC,UAAK,WAAU,yEACb,iBAAO,KAAK,QAAQ,GAAG,KAAK,GAC/B;AAAA,cACC,CAAC,WACA,oBAAC,UAAO,SAAQ,aAAY,SAAS,QAAQ,WAAU,uBACpD,iBAAO,MACV;AAAA,cAUD,EAAE,KAAK,cAAc,KAAK,UAAU,SACnC,oBAAC,UAAO,SAAQ,SAAQ,SAAS,QAAQ,WAAW,GAAG,qBAAqB,GACzE,mBAAS,OAAO,OAAO,OAAO,MACjC;AAAA,eAEJ;AAAA,aACF;AAAA,UACC,KAAK,cAAc,KAAK,UAAU,QACjC,oBAAC,SAAI,WAAU,6DACZ,iBAAO,gBACV;AAAA,WAEJ;AAAA;AAAA;AAAA,EACF;AAEJ;","names":[]}
@@ -1,8 +1,10 @@
1
1
  import * as react from 'react';
2
2
  import { ReactNode, ReactElement } from 'react';
3
- import { f as ButtonVariant } from '../kit-labels-D1J2_jyD.js';
3
+ import { f as ButtonVariant } from '../kit-labels-R8mIAc9N.js';
4
4
  import { UseWizardReturn, WizardLabels } from './types.js';
5
- import '../components/data-table-labels.js';
5
+ import '../data-table-labels-B7OdnM0S.js';
6
+ import '../components/data-table-sort.js';
7
+ import '../components/swipeable-row.js';
6
8
  import '../components/mini-calendar.js';
7
9
  import '../components/calendar-heatmap.js';
8
10
  import '../components/popover.js';
@@ -24,7 +26,6 @@ import '../components/sparkline.js';
24
26
  import '../components/stat-tile.js';
25
27
  import '../components/signature-pad.js';
26
28
  import '../components/password-strength.js';
27
- import '../components/danger-confirm.js';
28
29
  import '../components/swatch-picker.js';
29
30
  import '../components/tile-radio.js';
30
31
  import '../components/icon-picker.js';
@@ -32,11 +33,10 @@ import '../components/dialog-frame.js';
32
33
  import '../components/modal.js';
33
34
  import '../hooks/use-search-param-state.js';
34
35
  import '../components/measured-grid.js';
35
- import '../feedback-attachment-WFiXJ8We.js';
36
+ import '../feedback-attachment-NhUm7Zga.js';
36
37
  import '../feedback/feedback-thread.js';
37
38
  import '../feedback/feedback-inbox.js';
38
39
  import '../components/account-settings-labels.js';
39
- import '../components/confirm-dialog.js';
40
40
  import '../components/floating-panel.js';
41
41
  import '../components/bulk-action-bar.js';
42
42
  import '../components/list.js';
@@ -55,14 +55,16 @@ import '../components/write-lock.js';
55
55
  import '../components/legal.js';
56
56
  import '../components/account-chips.js';
57
57
  import '../lib/format.js';
58
- import '../data-table-3mi2R3so.js';
59
- import '../components/data-table-sort.js';
60
- import '../components/swipeable-row.js';
61
58
  import '../components/reauth-dialog.js';
62
59
  import '../components/server-wake.js';
63
60
  import '../lib/server-wake.js';
64
61
  import '../components/translation-review-labels.js';
65
62
  import '../lib/translation-review.js';
63
+ import '../components/country-select.js';
64
+ import '../components/inline-edit-field.js';
65
+ import '../lib/iban.js';
66
+ import '../lib/phone.js';
67
+ import '../components/sign-chip.js';
66
68
 
67
69
  /**
68
70
  * The chrome around a wizard: the step indicator, the step content, and the
package/dist/wizard.d.ts CHANGED
@@ -6,8 +6,10 @@ export { WizardStep, WizardStepProps } from './wizard/wizard-step.js';
6
6
  export { WizardSummary } from './wizard/wizard-summary.js';
7
7
  export { StepperNav } from './wizard/stepper-nav.js';
8
8
  import 'react';
9
- import './kit-labels-D1J2_jyD.js';
10
- import './components/data-table-labels.js';
9
+ import './kit-labels-R8mIAc9N.js';
10
+ import './data-table-labels-B7OdnM0S.js';
11
+ import './components/data-table-sort.js';
12
+ import './components/swipeable-row.js';
11
13
  import './components/mini-calendar.js';
12
14
  import './components/calendar-heatmap.js';
13
15
  import './components/popover.js';
@@ -29,7 +31,6 @@ import './components/sparkline.js';
29
31
  import './components/stat-tile.js';
30
32
  import './components/signature-pad.js';
31
33
  import './components/password-strength.js';
32
- import './components/danger-confirm.js';
33
34
  import './components/swatch-picker.js';
34
35
  import './components/tile-radio.js';
35
36
  import './components/icon-picker.js';
@@ -37,11 +38,10 @@ import './components/dialog-frame.js';
37
38
  import './components/modal.js';
38
39
  import './hooks/use-search-param-state.js';
39
40
  import './components/measured-grid.js';
40
- import './feedback-attachment-WFiXJ8We.js';
41
+ import './feedback-attachment-NhUm7Zga.js';
41
42
  import './feedback/feedback-thread.js';
42
43
  import './feedback/feedback-inbox.js';
43
44
  import './components/account-settings-labels.js';
44
- import './components/confirm-dialog.js';
45
45
  import './components/floating-panel.js';
46
46
  import './components/bulk-action-bar.js';
47
47
  import './components/list.js';
@@ -60,11 +60,13 @@ import './components/write-lock.js';
60
60
  import './components/legal.js';
61
61
  import './components/account-chips.js';
62
62
  import './lib/format.js';
63
- import './data-table-3mi2R3so.js';
64
- import './components/data-table-sort.js';
65
- import './components/swipeable-row.js';
66
63
  import './components/reauth-dialog.js';
67
64
  import './components/server-wake.js';
68
65
  import './lib/server-wake.js';
69
66
  import './components/translation-review-labels.js';
70
67
  import './lib/translation-review.js';
68
+ import './components/country-select.js';
69
+ import './components/inline-edit-field.js';
70
+ import './lib/iban.js';
71
+ import './lib/phone.js';
72
+ import './components/sign-chip.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eifi1/ui-kit",
3
- "version": "0.21.0",
3
+ "version": "0.22.0",
4
4
  "type": "module",
5
5
  "description": "App-agnostic shared design system: domain-free React components, theme and tokens.",
6
6
  "_sideEffects": "The barrel (src/index.ts) re-exports EVERY component, including components/chart, which statically imports recharts. Without this field a bundler must assume each of those modules has side effects, so it cannot drop the unused ones: importing a Button from '@eifi1/ui-kit' dragged all 433KB of recharts into the consumer's ENTRY chunk, and Keksdose was preloading it on every page load, login included. Nothing in src/ imports for side effects (no bare imports, no CSS imports from JS, no module-level global writes) — the token stylesheet is its own './tokens.css' export — so this is safe. CSS is still listed so any future stylesheet survives. Re-checked when `flag-icons` left `dependencies` and tsup started emitting a `\"use client\"` banner: neither touches this. The flag stylesheet was never imported from JS in the first place (that was the finding), and a directive prologue is a string literal every bundler lifts out before it decides whether a module is inert.",
@@ -3,7 +3,8 @@ import type { LucideIcon } from "lucide-react";
3
3
  import { cn } from "../lib/cn";
4
4
  import { formatDate, formatRelativeTime, toDate, EMPTY_FORMATTED_VALUE } from "../lib/format";
5
5
  import type { DateInput, FormatDateStyle, FormatRelativeTimeOptions } from "../lib/format";
6
- import { useKitLabels, useKitLocale } from "../i18n/kit-labels";
6
+ import { useKitDateFormatter, useKitLabels, useKitLocale } from "../i18n/kit-labels";
7
+ import { toLocalIso } from "../lib/dates";
7
8
  import { Chip } from "./chip";
8
9
  import type { ChipShape, ChipSize, ChipTone, ChipVariant } from "./chip";
9
10
  import { Tooltip } from "./tooltip";
@@ -201,7 +202,8 @@ export interface DateMarkProps {
201
202
  */
202
203
  display?: "date" | "relative";
203
204
  /** Default `medium`. Under `"relative"`, the style of the tooltip's date (default
204
- * `dateTime`) and of the date `relative.absoluteAfterDays` switches to. */
205
+ * `dateTime`) and of the date `relative.absoluteAfterDays` switches to. Given, it wins
206
+ * over the provider's `formatDate`. */
205
207
  dateStyle?: FormatDateStyle | Intl.DateTimeFormatOptions;
206
208
  /** `formatRelativeTime` options: `numeric`, `style`, `absoluteAfterDays`, `now`. */
207
209
  relative?: Omit<FormatRelativeTimeOptions, "locale" | "empty" | "absoluteStyle">;
@@ -216,6 +218,13 @@ export interface DateMarkProps {
216
218
  /**
217
219
  * A date in a table cell: a `<time>` with a machine-readable `dateTime`, nowrap and
218
220
  * tabular figures, in the provider's locale — or `empty` when there is none.
221
+ *
222
+ * `display="date"` without a `dateStyle` is written by `<UiKitProvider formatDate>` when
223
+ * the app set one (keksdose K12: its `DateCell` exists to put every column's date in the
224
+ * app's date-format preference, weekday and all — dev#546), called with the LOCAL
225
+ * calendar day of the value as `"YYYY-MM-DD"` and `weekday: true`. Without one, or for
226
+ * an empty answer, it is `Intl`'s `medium` date as before. The relative display is not
227
+ * a calendar day and keeps `formatRelativeTime`.
219
228
  */
220
229
  export function DateMark({
221
230
  value,
@@ -227,13 +236,18 @@ export function DateMark({
227
236
  className,
228
237
  }: DateMarkProps) {
229
238
  const locale = useKitLocale(localeProp);
239
+ const fromProvider = useKitDateFormatter();
230
240
  const date = toDate(value);
231
241
  const cls = cn("whitespace-nowrap tabular-nums", className);
232
242
  if (!date) return <span className={cn(cls, "text-[var(--text-muted)]")}>{empty}</span>;
233
243
  if (display === "date") {
244
+ const own =
245
+ dateStyle === undefined && fromProvider
246
+ ? fromProvider(toLocalIso(date), { unit: "day", source: "dateMark", locale, weekday: true })
247
+ : "";
234
248
  return (
235
249
  <time dateTime={date.toISOString()} className={cls}>
236
- {formatDate(date, dateStyle ?? "medium", { locale })}
250
+ {own || formatDate(date, dateStyle ?? "medium", { locale })}
237
251
  </time>
238
252
  );
239
253
  }