@eifi1/ui-kit 0.50.0 → 0.51.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 (143) hide show
  1. package/README.md +14 -12
  2. package/dist/admin/user-roster.js +31 -12
  3. package/dist/admin/user-roster.js.map +1 -1
  4. package/dist/auth/verify-email.d.ts +4 -0
  5. package/dist/auth/verify-email.js.map +1 -1
  6. package/dist/components/alert-banner.d.ts +9 -0
  7. package/dist/components/alert-banner.js +9 -5
  8. package/dist/components/alert-banner.js.map +1 -1
  9. package/dist/components/autocomplete.js +13 -0
  10. package/dist/components/autocomplete.js.map +1 -1
  11. package/dist/components/button-look.d.ts +4 -19
  12. package/dist/components/button-look.js +3 -30
  13. package/dist/components/button-look.js.map +1 -1
  14. package/dist/components/combobox.js +3 -1
  15. package/dist/components/combobox.js.map +1 -1
  16. package/dist/components/data-table-fit.js.map +1 -1
  17. package/dist/components/data-table-virtual.js +1 -0
  18. package/dist/components/data-table-virtual.js.map +1 -1
  19. package/dist/components/field-base.d.ts +31 -1
  20. package/dist/components/field-base.js +28 -0
  21. package/dist/components/field-base.js.map +1 -1
  22. package/dist/components/floating-panel.d.ts +6 -13
  23. package/dist/components/floating-panel.js +2 -9
  24. package/dist/components/floating-panel.js.map +1 -1
  25. package/dist/components/icon-button.js +3 -5
  26. package/dist/components/icon-button.js.map +1 -1
  27. package/dist/components/inline-entity-combobox.js +12 -0
  28. package/dist/components/inline-entity-combobox.js.map +1 -1
  29. package/dist/components/select.js +3 -2
  30. package/dist/components/select.js.map +1 -1
  31. package/dist/components/stat-tile.d.ts +8 -1
  32. package/dist/components/stat-tile.js +7 -3
  33. package/dist/components/stat-tile.js.map +1 -1
  34. package/dist/eslint/index.js +1 -1
  35. package/dist/i18n/german.js +2 -0
  36. package/dist/i18n/german.js.map +1 -1
  37. package/dist/i18n/kit-labels.d.ts +2 -2
  38. package/dist/i18n/kit-labels.js.map +1 -1
  39. package/dist/i18n/locales/en.js +2 -0
  40. package/dist/i18n/locales/en.js.map +2 -2
  41. package/dist/i18n/locales/es.js +2 -0
  42. package/dist/i18n/locales/es.js.map +1 -1
  43. package/dist/i18n/locales/fr.js +2 -0
  44. package/dist/i18n/locales/fr.js.map +1 -1
  45. package/dist/i18n/locales/hu.js +2 -0
  46. package/dist/i18n/locales/hu.js.map +1 -1
  47. package/dist/i18n/locales/it.js +2 -0
  48. package/dist/i18n/locales/it.js.map +1 -1
  49. package/dist/i18n/locales/zh.js +2 -0
  50. package/dist/i18n/locales/zh.js.map +1 -1
  51. package/dist/index.d.ts +3 -1
  52. package/dist/index.js +2 -0
  53. package/dist/index.js.map +1 -1
  54. package/dist/landing/page-seo.d.ts +19 -11
  55. package/dist/landing/page-seo.js +11 -7
  56. package/dist/landing/page-seo.js.map +1 -1
  57. package/dist/landing/public-page.d.ts +57 -0
  58. package/dist/landing/public-page.js +45 -0
  59. package/dist/landing/public-page.js.map +1 -0
  60. package/dist/lib/quiet-focus.d.ts +4 -0
  61. package/dist/lib/quiet-focus.js +19 -0
  62. package/dist/lib/quiet-focus.js.map +1 -0
  63. package/dist/lib/server-wake.d.ts +3 -2
  64. package/dist/lib/server-wake.js +19 -13
  65. package/dist/lib/server-wake.js.map +1 -1
  66. package/dist/shell/app-shell.d.ts +2 -15
  67. package/dist/shell/app-shell.js +7 -26
  68. package/dist/shell/app-shell.js.map +1 -1
  69. package/dist/shell/dev-menu.d.ts +98 -0
  70. package/dist/shell/dev-menu.js +133 -0
  71. package/dist/shell/dev-menu.js.map +1 -0
  72. package/dist/shell/dev-switchers.d.ts +6 -53
  73. package/dist/shell/dev-switchers.js +5 -100
  74. package/dist/shell/dev-switchers.js.map +1 -1
  75. package/dist/shell/top-bar-actions.d.ts +4 -1
  76. package/dist/shell/top-bar-actions.js.map +1 -1
  77. package/dist/shell/top-bar-parts-labels.d.ts +18 -9
  78. package/dist/shell/top-bar-parts-labels.js +2 -0
  79. package/dist/shell/top-bar-parts-labels.js.map +1 -1
  80. package/dist/shell/topbar-action-menu.d.ts +17 -2
  81. package/dist/shell/topbar-action-menu.js +3 -1
  82. package/dist/shell/topbar-action-menu.js.map +1 -1
  83. package/dist/shell.d.ts +3 -1
  84. package/dist/shell.js +3 -1
  85. package/dist/shell.js.map +1 -1
  86. package/dist/testing/index.d.ts +1 -0
  87. package/dist/testing/index.js +4 -0
  88. package/dist/testing/index.js.map +1 -1
  89. package/dist/testing/tour.d.ts +31 -0
  90. package/dist/testing/tour.js +12 -0
  91. package/dist/testing/tour.js.map +1 -0
  92. package/dist/theme/palette-presets.d.ts +0 -3
  93. package/dist/theme/palette-presets.js +0 -2
  94. package/dist/theme/palette-presets.js.map +1 -1
  95. package/dist/tour/tour-engine.d.ts +12 -0
  96. package/dist/tour/tour-engine.js +31 -0
  97. package/dist/tour/tour-engine.js.map +1 -0
  98. package/dist/tour/tour.d.ts +14 -3
  99. package/dist/tour/tour.js +60 -45
  100. package/dist/tour/tour.js.map +1 -1
  101. package/dist/tour/use-tour-url-sync.d.ts +5 -3
  102. package/dist/tour/use-tour-url-sync.js +21 -1
  103. package/dist/tour/use-tour-url-sync.js.map +1 -1
  104. package/package.json +1 -1
  105. package/src/admin/user-roster.tsx +30 -10
  106. package/src/auth/verify-email.tsx +4 -0
  107. package/src/components/alert-banner.tsx +37 -10
  108. package/src/components/autocomplete.tsx +18 -0
  109. package/src/components/button-look.ts +7 -57
  110. package/src/components/combobox.tsx +5 -1
  111. package/src/components/data-table-fit.ts +4 -1
  112. package/src/components/data-table-virtual.ts +14 -1
  113. package/src/components/field-base.tsx +53 -1
  114. package/src/components/floating-panel.tsx +6 -28
  115. package/src/components/icon-button.tsx +6 -8
  116. package/src/components/inline-entity-combobox.tsx +17 -0
  117. package/src/components/select.tsx +3 -6
  118. package/src/components/stat-tile.tsx +27 -9
  119. package/src/i18n/german.ts +2 -0
  120. package/src/i18n/kit-labels.tsx +2 -2
  121. package/src/i18n/locales/es.ts +2 -0
  122. package/src/i18n/locales/fr.ts +2 -0
  123. package/src/i18n/locales/hu.ts +2 -0
  124. package/src/i18n/locales/it.ts +2 -0
  125. package/src/i18n/locales/zh.ts +2 -0
  126. package/src/index.ts +4 -1
  127. package/src/landing/page-seo.ts +28 -16
  128. package/src/landing/public-page.tsx +106 -0
  129. package/src/lib/quiet-focus.ts +32 -0
  130. package/src/lib/server-wake.ts +41 -17
  131. package/src/shell/app-shell.tsx +11 -48
  132. package/src/shell/dev-menu.tsx +259 -0
  133. package/src/shell/dev-switchers.tsx +13 -174
  134. package/src/shell/top-bar-actions.tsx +4 -1
  135. package/src/shell/top-bar-parts-labels.ts +20 -9
  136. package/src/shell/topbar-action-menu.tsx +28 -2
  137. package/src/shell.ts +5 -1
  138. package/src/testing/index.ts +8 -0
  139. package/src/testing/tour.ts +41 -0
  140. package/src/theme/palette-presets.ts +0 -4
  141. package/src/tour/tour-engine.ts +41 -0
  142. package/src/tour/tour.tsx +64 -24
  143. package/src/tour/use-tour-url-sync.ts +33 -4
package/dist/tour/tour.js CHANGED
@@ -21,11 +21,26 @@ import { useDismissLayer } from "../hooks/use-dismiss.js";
21
21
  import { sameRect } from "../hooks/use-anchored-rect.js";
22
22
  import { dirOf, horizontalStep } from "../lib/direction.js";
23
23
  import { isComposing } from "../lib/ime.js";
24
+ import { focusQuietly } from "../lib/quiet-focus.js";
24
25
  import { DEFAULT_TOUR_LABELS } from "./tour-labels.js";
25
26
  import { completeStored, rememberAccount, rememberMigrate } from "./use-tour-progress.js";
26
27
  import { createGateRegistry, devWarnings, TourInternalContext } from "./tour-gates.js";
28
+ import { liveEngine } from "./tour-engine.js";
27
29
  import { DOCK_MAX_WIDTH, dockEdge, dockStyle, readBand, scrollIntoFreeHalf } from "./tour-dock.js";
28
30
  import { useTourGate, useTourGateRelease } from "./tour-gates.js";
31
+ const ENGINE_KEYS = [
32
+ "active",
33
+ "activeId",
34
+ "start",
35
+ "stop",
36
+ "next",
37
+ "prev",
38
+ "goToStep",
39
+ "index",
40
+ "total",
41
+ "position",
42
+ "count"
43
+ ];
29
44
  const TourContext = createContext(null);
30
45
  function useTour() {
31
46
  const ctx = useContext(TourContext);
@@ -133,6 +148,8 @@ function TourProvider({
133
148
  [arrive, forward, backward]
134
149
  );
135
150
  const ownStartRef = useRef(null);
151
+ const [live] = useState(() => liveEngine(ENGINE_KEYS));
152
+ const engine = live.engine;
136
153
  const start = useCallback(
137
154
  (what, opts) => {
138
155
  if (typeof what !== "string") {
@@ -144,11 +161,11 @@ function TourProvider({
144
161
  if (devWarnings()) console.warn(`[ui-kit] start("${what}") needs TourProvider's \`launch\` prop.`);
145
162
  return;
146
163
  }
147
- void Promise.resolve(run(what, { at: opts?.at }, ownStartRef.current)).catch(
164
+ void Promise.resolve(run(what, { at: opts?.at }, ownStartRef.current, engine)).catch(
148
165
  (error) => console.error(error)
149
166
  );
150
167
  },
151
- [startSteps]
168
+ [startSteps, engine]
152
169
  );
153
170
  useLayoutEffect(() => {
154
171
  ownStartRef.current = start;
@@ -228,46 +245,44 @@ function TourProvider({
228
245
  else arrive(s, to, "next");
229
246
  });
230
247
  }, [active, gates, arrive, forward, finish]);
231
- return /* @__PURE__ */ jsx(TourInternalContext.Provider, { value: internals, children: /* @__PURE__ */ jsxs(
232
- TourContext.Provider,
233
- {
234
- value: {
235
- active,
236
- activeId,
237
- start,
238
- stop,
239
- next,
240
- prev,
241
- goToStep,
248
+ const value = {
249
+ active,
250
+ activeId,
251
+ start,
252
+ stop,
253
+ next,
254
+ prev,
255
+ goToStep,
256
+ index,
257
+ total,
258
+ position: active ? nav.position : 0,
259
+ count: active ? nav.count : 0
260
+ };
261
+ useLayoutEffect(() => {
262
+ live.set(value);
263
+ });
264
+ return /* @__PURE__ */ jsx(TourInternalContext.Provider, { value: internals, children: /* @__PURE__ */ jsxs(TourContext.Provider, { value, children: [
265
+ children,
266
+ active && /* @__PURE__ */ jsx(
267
+ TourOverlay,
268
+ {
269
+ steps,
242
270
  index,
243
- total,
244
- position: active ? nav.position : 0,
245
- count: active ? nav.count : 0
246
- },
247
- children: [
248
- children,
249
- active && /* @__PURE__ */ jsx(
250
- TourOverlay,
251
- {
252
- steps,
253
- index,
254
- via: nav.via,
255
- floor: nav.floor,
256
- position: nav.position,
257
- count: nav.count,
258
- refusal: refusal?.step === steps[index] ? refusal : null,
259
- onGoTo: goToStep,
260
- labels: merged,
261
- gates,
262
- dockOnPhones,
263
- onNext: next,
264
- onPrev: prev,
265
- onSkip: skip
266
- }
267
- )
268
- ]
269
- }
270
- ) });
271
+ via: nav.via,
272
+ floor: nav.floor,
273
+ position: nav.position,
274
+ count: nav.count,
275
+ refusal: refusal?.step === steps[index] ? refusal : null,
276
+ onGoTo: goToStep,
277
+ labels: merged,
278
+ gates,
279
+ dockOnPhones,
280
+ onNext: next,
281
+ onPrev: prev,
282
+ onSkip: skip
283
+ }
284
+ )
285
+ ] }) });
271
286
  }
272
287
  const NO_NAV = { index: 0, floor: 0, via: "start", position: 0, count: 0 };
273
288
  const NOOP = () => {
@@ -558,11 +573,11 @@ function TourOverlay({
558
573
  if (!ready || !guided || !step.target) return;
559
574
  const el = queryVisibleTarget(step.target);
560
575
  const control = el ? firstFocusable(el) : null;
576
+ const previous = control ? control.getAttribute("aria-describedby") : null;
577
+ if (control) control.setAttribute("aria-describedby", previous ? `${previous} ${bodyId}` : bodyId);
561
578
  if (coarsePointer() || !control) cardRef.current?.focus();
562
- else if (!el.contains(document.activeElement)) control.focus();
579
+ else if (!el.contains(document.activeElement)) focusQuietly(control);
563
580
  if (!control) return;
564
- const previous = control.getAttribute("aria-describedby");
565
- control.setAttribute("aria-describedby", previous ? `${previous} ${bodyId}` : bodyId);
566
581
  return () => {
567
582
  if (previous === null) control.removeAttribute("aria-describedby");
568
583
  else control.setAttribute("aria-describedby", previous);
@@ -672,7 +687,7 @@ function TourOverlay({
672
687
  const lockedNext = useCallback(() => {
673
688
  const el = step.target ? queryVisibleTarget(step.target) : null;
674
689
  const control = el ? firstFocusable(el) : null;
675
- control?.focus();
690
+ if (control) focusQuietly(control);
676
691
  announce(gateHint);
677
692
  }, [step.target, announce, gateHint]);
678
693
  const tryNext = awaitsRelease ? NOOP : locked ? lockedNext : onNext;