streetui 1.8.0 → 2.0.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.
@@ -1,6 +1,6 @@
1
- import { S as StreetApp, a as ComponentDefinition, b as ContainerBuilder } from './compile-CJJQYi71.cjs';
2
- export { V as VERSION } from './compile-CJJQYi71.cjs';
3
- import { R as RenderHandle, H as HydrationDiagnostic } from './hydration-diagnostics-BQeehq3i.cjs';
1
+ import { S as StreetApp, H as HydrationDiagnostic, a as ComponentDefinition, b as ContainerBuilder } from './hydration-diagnostics-CFYDXBlm.cjs';
2
+ export { V as VERSION } from './hydration-diagnostics-CFYDXBlm.cjs';
3
+ import { R as RenderHandle } from './renderer-interface-BUhHV7ja.cjs';
4
4
  export * from 'streetui/diagnostics';
5
5
 
6
6
  /**
@@ -71,6 +71,44 @@ interface WaitForOptions {
71
71
  * deadline. Use for assertions that become true only after async work settles.
72
72
  */
73
73
  declare function waitFor<T>(check: () => T, options?: WaitForOptions): Promise<T>;
74
+ /** A minimal writable-boolean seam (an overlay `open` signal, typically). */
75
+ interface BooleanControl {
76
+ set(value: boolean): void;
77
+ }
78
+ /** Focus `el` (no-op if it exposes no `focus`). Intentful wrapper for tests. */
79
+ declare function focus(el: Element): void;
80
+ /** Blur `el` (no-op if it exposes no `blur`). */
81
+ declare function blur(el: Element): void;
82
+ /**
83
+ * Dispatch a bubbling, cancelable `keydown` for `key` on `el` (defaulting to the
84
+ * currently-focused element). Extra `init` fields (e.g. `{ shiftKey: true }`)
85
+ * are forwarded. Use for keyboard-interaction assertions (Escape, Tab, arrows).
86
+ */
87
+ declare function pressKey(key: string, el?: Element | null, init?: KeyboardEventInit): void;
88
+ /**
89
+ * Simulate a pointer interaction OUTSIDE `container` — a `mousedown` + `click`
90
+ * on `document.body` (or `target` if given). Drives "click-away to dismiss"
91
+ * behaviour without the test constructing events by hand. If `target` is inside
92
+ * `container` this throws, so a mistake is loud rather than a silent no-op.
93
+ */
94
+ declare function clickOutside(container: Element, target?: Element): void;
95
+ /**
96
+ * Open an overlay by flipping its `open` control to `true`, then flush so the
97
+ * panel mounts and its enter/focus wiring runs. Overlay visibility is app-owned
98
+ * state (§18) — a plain signal — so this is a thin, intentful wrapper over
99
+ * `set(true)` + {@link flushUpdates}.
100
+ */
101
+ declare function openOverlay(open: BooleanControl): Promise<void>;
102
+ /** Close an overlay by flipping its `open` control to `false`, then flush. */
103
+ declare function closeOverlay(open: BooleanControl): Promise<void>;
104
+ /**
105
+ * Settle a CSS transition on `el` deterministically: dispatch the
106
+ * `transitionend` the controller listens for (happy-dom fires none of its own),
107
+ * then flush pending work so any deferred leave-teardown (DOM removal, dispose,
108
+ * detach) completes. Await this after toggling a transitioned element to assert
109
+ * its post-animation state without depending on the fallback timeout.
110
+ */
111
+ declare function waitForTransition(el: Element): Promise<void>;
74
112
  /** Find the first leaf element whose text content includes `text`. */
75
113
  declare function findByText(container: Element, text: string): Element;
76
114
  interface ByRoleOptions {
@@ -170,4 +208,4 @@ declare function getComponentName(el: Element): string | null;
170
208
  */
171
209
  declare function trigger(el: Element, type: string, init?: Record<string, unknown>): void;
172
210
 
173
- export { type ByRoleOptions, type HydrateTestOptions, type HydrateTestResult, type RenderComponentResult, type RenderResult, type WaitForOptions, findAllByRole, findAllComponents, findByRole, findByText, findComponent, flushUpdates, getComponentName, hydrateComponent, render, renderComponent, renderOnce, renderServerThenHydrate, trigger, waitFor };
211
+ export { type BooleanControl, type ByRoleOptions, type HydrateTestOptions, type HydrateTestResult, type RenderComponentResult, type RenderResult, type WaitForOptions, blur, clickOutside, closeOverlay, findAllByRole, findAllComponents, findByRole, findByText, findComponent, flushUpdates, focus, getComponentName, hydrateComponent, openOverlay, pressKey, render, renderComponent, renderOnce, renderServerThenHydrate, trigger, waitFor, waitForTransition };
package/dist/testing.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- import { S as StreetApp, a as ComponentDefinition, b as ContainerBuilder } from './compile-CJJQYi71.js';
2
- export { V as VERSION } from './compile-CJJQYi71.js';
3
- import { R as RenderHandle, H as HydrationDiagnostic } from './hydration-diagnostics-DNAJumYF.js';
1
+ import { S as StreetApp, H as HydrationDiagnostic, a as ComponentDefinition, b as ContainerBuilder } from './hydration-diagnostics-CFYDXBlm.js';
2
+ export { V as VERSION } from './hydration-diagnostics-CFYDXBlm.js';
3
+ import { R as RenderHandle } from './renderer-interface-B_-hWnKk.js';
4
4
  export * from 'streetui/diagnostics';
5
5
 
6
6
  /**
@@ -71,6 +71,44 @@ interface WaitForOptions {
71
71
  * deadline. Use for assertions that become true only after async work settles.
72
72
  */
73
73
  declare function waitFor<T>(check: () => T, options?: WaitForOptions): Promise<T>;
74
+ /** A minimal writable-boolean seam (an overlay `open` signal, typically). */
75
+ interface BooleanControl {
76
+ set(value: boolean): void;
77
+ }
78
+ /** Focus `el` (no-op if it exposes no `focus`). Intentful wrapper for tests. */
79
+ declare function focus(el: Element): void;
80
+ /** Blur `el` (no-op if it exposes no `blur`). */
81
+ declare function blur(el: Element): void;
82
+ /**
83
+ * Dispatch a bubbling, cancelable `keydown` for `key` on `el` (defaulting to the
84
+ * currently-focused element). Extra `init` fields (e.g. `{ shiftKey: true }`)
85
+ * are forwarded. Use for keyboard-interaction assertions (Escape, Tab, arrows).
86
+ */
87
+ declare function pressKey(key: string, el?: Element | null, init?: KeyboardEventInit): void;
88
+ /**
89
+ * Simulate a pointer interaction OUTSIDE `container` — a `mousedown` + `click`
90
+ * on `document.body` (or `target` if given). Drives "click-away to dismiss"
91
+ * behaviour without the test constructing events by hand. If `target` is inside
92
+ * `container` this throws, so a mistake is loud rather than a silent no-op.
93
+ */
94
+ declare function clickOutside(container: Element, target?: Element): void;
95
+ /**
96
+ * Open an overlay by flipping its `open` control to `true`, then flush so the
97
+ * panel mounts and its enter/focus wiring runs. Overlay visibility is app-owned
98
+ * state (§18) — a plain signal — so this is a thin, intentful wrapper over
99
+ * `set(true)` + {@link flushUpdates}.
100
+ */
101
+ declare function openOverlay(open: BooleanControl): Promise<void>;
102
+ /** Close an overlay by flipping its `open` control to `false`, then flush. */
103
+ declare function closeOverlay(open: BooleanControl): Promise<void>;
104
+ /**
105
+ * Settle a CSS transition on `el` deterministically: dispatch the
106
+ * `transitionend` the controller listens for (happy-dom fires none of its own),
107
+ * then flush pending work so any deferred leave-teardown (DOM removal, dispose,
108
+ * detach) completes. Await this after toggling a transitioned element to assert
109
+ * its post-animation state without depending on the fallback timeout.
110
+ */
111
+ declare function waitForTransition(el: Element): Promise<void>;
74
112
  /** Find the first leaf element whose text content includes `text`. */
75
113
  declare function findByText(container: Element, text: string): Element;
76
114
  interface ByRoleOptions {
@@ -170,4 +208,4 @@ declare function getComponentName(el: Element): string | null;
170
208
  */
171
209
  declare function trigger(el: Element, type: string, init?: Record<string, unknown>): void;
172
210
 
173
- export { type ByRoleOptions, type HydrateTestOptions, type HydrateTestResult, type RenderComponentResult, type RenderResult, type WaitForOptions, findAllByRole, findAllComponents, findByRole, findByText, findComponent, flushUpdates, getComponentName, hydrateComponent, render, renderComponent, renderOnce, renderServerThenHydrate, trigger, waitFor };
211
+ export { type BooleanControl, type ByRoleOptions, type HydrateTestOptions, type HydrateTestResult, type RenderComponentResult, type RenderResult, type WaitForOptions, blur, clickOutside, closeOverlay, findAllByRole, findAllComponents, findByRole, findByText, findComponent, flushUpdates, focus, getComponentName, hydrateComponent, openOverlay, pressKey, render, renderComponent, renderOnce, renderServerThenHydrate, trigger, waitFor, waitForTransition };