@vertz/ui 0.2.22 → 0.2.24

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 (36) hide show
  1. package/dist/shared/{chunk-pdqr78k9.js → chunk-18frwfc4.js} +1 -1
  2. package/dist/shared/chunk-2eh4p2n7.js +39 -0
  3. package/dist/shared/{chunk-67z8b0q8.js → chunk-2wag9c7v.js} +182 -53
  4. package/dist/shared/{chunk-c61572xp.js → chunk-2y9f9j62.js} +1 -1
  5. package/dist/shared/{chunk-szk0hyjg.js → chunk-4gen306a.js} +212 -155
  6. package/dist/shared/{chunk-yb4a0smw.js → chunk-4gmtsf6v.js} +1 -1
  7. package/dist/shared/{chunk-2qe6aqhb.js → chunk-656n0x6y.js} +48 -48
  8. package/dist/shared/{chunk-bybgyjye.js → chunk-da2w7j7w.js} +1 -1
  9. package/dist/shared/{chunk-4cmt1ve8.js → chunk-f4d5nphq.js} +1 -1
  10. package/dist/shared/chunk-ge2e6y2s.js +102 -0
  11. package/dist/shared/{chunk-4xkw6h1s.js → chunk-h1fsr8kv.js} +67 -1
  12. package/dist/shared/{chunk-7g722pdh.js → chunk-jtma4sh4.js} +2 -2
  13. package/dist/shared/{chunk-vwz86vg9.js → chunk-mbnda3pv.js} +96 -18
  14. package/dist/shared/{chunk-pq8khh47.js → chunk-t3rnfxc0.js} +64 -23
  15. package/dist/src/auth/public.d.ts +35 -1
  16. package/dist/src/auth/public.js +72 -3
  17. package/dist/src/components/index.d.ts +2 -2
  18. package/dist/src/components/index.js +51 -46
  19. package/dist/src/css/public.d.ts +7 -3
  20. package/dist/src/css/public.js +5 -5
  21. package/dist/src/form/public.js +2 -2
  22. package/dist/src/index.d.ts +211 -39
  23. package/dist/src/index.js +372 -153
  24. package/dist/src/internals.d.ts +70 -6
  25. package/dist/src/internals.js +161 -34
  26. package/dist/src/jsx-runtime/index.js +3 -5
  27. package/dist/src/query/public.d.ts +7 -3
  28. package/dist/src/query/public.js +5 -4
  29. package/dist/src/router/public.d.ts +27 -4
  30. package/dist/src/router/public.js +9 -10
  31. package/dist/src/test/index.d.ts +12 -3
  32. package/dist/src/test/index.js +3 -3
  33. package/package.json +4 -3
  34. package/reactivity.json +1 -1
  35. package/dist/shared/chunk-kjwp5q5s.js +0 -53
  36. package/dist/shared/chunk-prj7nm08.js +0 -67
@@ -13,32 +13,38 @@ function createComponentProxy(name) {
13
13
  return fn(...args);
14
14
  };
15
15
  }
16
- function createSuiteProxy(name, subComponents) {
17
- const suite = {};
16
+ function createCompoundProxy(name, subComponents) {
17
+ const root = (...args) => {
18
+ const fn = _getPrimitive(name);
19
+ if (typeof fn !== "function") {
20
+ throw new Error(`Primitive "${name}" is not callable in the registered theme. ` + `Check that your theme package provides this component.`);
21
+ }
22
+ return fn(...args);
23
+ };
18
24
  for (const sub of subComponents) {
19
- Object.defineProperty(suite, sub, {
25
+ Object.defineProperty(root, sub, {
20
26
  get: () => {
21
- const parent = _getComponent(name);
27
+ const parent = _getPrimitive(name);
22
28
  return Reflect.get(parent, sub);
23
29
  },
24
30
  enumerable: true,
25
31
  configurable: true
26
32
  });
27
33
  }
28
- return suite;
34
+ return root;
29
35
  }
30
- function createCompoundProxy(name, subComponents) {
36
+ function createCallableSuiteProxy(name, subComponents) {
31
37
  const root = (...args) => {
32
- const fn = _getPrimitive(name);
38
+ const fn = _getComponent(name);
33
39
  if (typeof fn !== "function") {
34
- throw new Error(`Primitive "${name}" is not callable in the registered theme. ` + `Check that your theme package provides this component.`);
40
+ throw new Error(`Component "${name}" is not callable in the registered theme. ` + `Check that your theme package provides this component.`);
35
41
  }
36
42
  return fn(...args);
37
43
  };
38
44
  for (const sub of subComponents) {
39
45
  Object.defineProperty(root, sub, {
40
46
  get: () => {
41
- const parent = _getPrimitive(name);
47
+ const parent = _getComponent(name);
42
48
  return Reflect.get(parent, sub);
43
49
  },
44
50
  enumerable: true,
@@ -47,6 +53,20 @@ function createCompoundProxy(name, subComponents) {
47
53
  }
48
54
  return root;
49
55
  }
56
+ function createPrimitiveSuiteProxy(name, subComponents) {
57
+ const suite = {};
58
+ for (const sub of subComponents) {
59
+ Object.defineProperty(suite, sub, {
60
+ get: () => {
61
+ const parent = _getPrimitive(name);
62
+ return Reflect.get(parent, sub);
63
+ },
64
+ enumerable: true,
65
+ configurable: true
66
+ });
67
+ }
68
+ return suite;
69
+ }
50
70
  function createPrimitiveProxy(name) {
51
71
  return (...args) => {
52
72
  const fn = _getPrimitive(name);
@@ -62,49 +82,34 @@ var Input = /* @__PURE__ */ createComponentProxy("Input");
62
82
  var Textarea = /* @__PURE__ */ createComponentProxy("Textarea");
63
83
  var Label = /* @__PURE__ */ createComponentProxy("Label");
64
84
  var Separator = /* @__PURE__ */ createComponentProxy("Separator");
65
- var Breadcrumb = /* @__PURE__ */ createComponentProxy("Breadcrumb");
85
+ var Breadcrumb = /* @__PURE__ */ createCallableSuiteProxy("Breadcrumb", ["Item"]);
66
86
  var Pagination = /* @__PURE__ */ createComponentProxy("Pagination");
67
- var Alert = /* @__PURE__ */ createSuiteProxy("Alert", [
68
- "Alert",
69
- "AlertTitle",
70
- "AlertDescription"
71
- ]);
72
- var Card = /* @__PURE__ */ createSuiteProxy("Card", [
73
- "Card",
74
- "CardHeader",
75
- "CardTitle",
76
- "CardDescription",
77
- "CardContent",
78
- "CardFooter",
79
- "CardAction"
80
- ]);
81
- var FormGroup = /* @__PURE__ */ createSuiteProxy("FormGroup", ["FormGroup", "FormError"]);
82
- var Avatar = /* @__PURE__ */ createSuiteProxy("Avatar", [
83
- "Avatar",
84
- "AvatarImage",
85
- "AvatarFallback"
86
- ]);
87
- var Skeleton = /* @__PURE__ */ createSuiteProxy("Skeleton", ["Skeleton"]);
88
- var Table = /* @__PURE__ */ createSuiteProxy("Table", [
89
- "Table",
90
- "TableHeader",
91
- "TableBody",
92
- "TableRow",
93
- "TableHead",
94
- "TableCell",
95
- "TableCaption",
96
- "TableFooter"
87
+ var Alert = /* @__PURE__ */ createCallableSuiteProxy("Alert", [
88
+ "Title",
89
+ "Description"
97
90
  ]);
98
- var AlertDialog = /* @__PURE__ */ createCompoundProxy("AlertDialog", ["Trigger", "Content", "Header", "Title", "Description", "Footer", "Cancel", "Action"]);
99
- var Dialog = /* @__PURE__ */ createCompoundProxy("Dialog", [
100
- "Trigger",
101
- "Content",
91
+ var Card = /* @__PURE__ */ createCallableSuiteProxy("Card", [
102
92
  "Header",
103
93
  "Title",
104
94
  "Description",
95
+ "Content",
105
96
  "Footer",
106
- "Close"
97
+ "Action"
98
+ ]);
99
+ var FormGroup = /* @__PURE__ */ createCallableSuiteProxy("FormGroup", ["FormError"]);
100
+ var Avatar = /* @__PURE__ */ createCallableSuiteProxy("Avatar", ["Image", "Fallback"]);
101
+ var EmptyState = /* @__PURE__ */ createCallableSuiteProxy("EmptyState", ["Icon", "Title", "Description", "Action"]);
102
+ var Skeleton = /* @__PURE__ */ createCallableSuiteProxy("Skeleton", ["Text", "Circle"]);
103
+ var Table = /* @__PURE__ */ createCallableSuiteProxy("Table", [
104
+ "Header",
105
+ "Body",
106
+ "Row",
107
+ "Head",
108
+ "Cell",
109
+ "Caption",
110
+ "Footer"
107
111
  ]);
112
+ var Dialog = /* @__PURE__ */ createPrimitiveSuiteProxy("Dialog", ["Header", "Title", "Description", "Footer", "Body", "Close", "Cancel"]);
108
113
  var DropdownMenu = /* @__PURE__ */ createCompoundProxy("DropdownMenu", ["Trigger", "Content", "Item", "Group", "Label", "Separator"]);
109
114
  var Select = /* @__PURE__ */ createCompoundProxy("Select", [
110
115
  "Trigger",
@@ -192,6 +197,7 @@ export {
192
197
  Input,
193
198
  HoverCard,
194
199
  FormGroup,
200
+ EmptyState,
195
201
  DropdownMenu,
196
202
  Drawer,
197
203
  Dialog,
@@ -207,7 +213,6 @@ export {
207
213
  Breadcrumb,
208
214
  Badge,
209
215
  Avatar,
210
- AlertDialog,
211
216
  Alert,
212
217
  Accordion
213
218
  };
@@ -1,6 +1,6 @@
1
1
  /** All keyword names. */
2
- type Keyword = "flex" | "grid" | "block" | "inline" | "hidden" | "inline-flex" | "flex-1" | "flex-col" | "flex-row" | "flex-wrap" | "flex-nowrap" | "fixed" | "absolute" | "relative" | "sticky" | "uppercase" | "lowercase" | "capitalize" | "outline-none" | "overflow-hidden" | "select-none" | "pointer-events-none" | "whitespace-nowrap" | "shrink-0" | "italic" | "not-italic";
3
- type BaseUtility = Keyword | `${SpacingProperty}:${SpacingValue}` | `${BgColorProperty}:${ColorToken}` | `${SizeProperty}:${SizeKeyword | SpacingValue | "screen"}` | `${RadiusProperty}:${RadiusValue}` | `${ShadowProperty}:${ShadowValue}` | `${AlignmentProperty}:${AlignmentValue}` | `${FontWeightProperty}:${FontWeightValue}` | `${LineHeightProperty}:${LineHeightValue}` | `${ContentProperty}:${ContentValue}` | `${RawProperty}:${string}` | `ring:${`${number}` | ColorToken}` | `text:${FontSizeValue | TextAlignKeyword | ColorToken}` | `font:${FontSizeValue | FontWeightValue}` | `border:${`${number}` | ColorToken}` | `list:${ListKeyword}`;
2
+ type Keyword = "flex" | "grid" | "block" | "inline" | "hidden" | "inline-flex" | "flex-1" | "flex-col" | "flex-row" | "flex-wrap" | "flex-nowrap" | "fixed" | "absolute" | "relative" | "sticky" | "uppercase" | "lowercase" | "capitalize" | "outline-none" | "overflow-hidden" | "select-none" | "pointer-events-none" | "whitespace-nowrap" | "shrink-0" | "italic" | "not-italic" | "scale-0" | "scale-75" | "scale-90" | "scale-95" | "scale-100" | "scale-105" | "scale-110" | "scale-125" | "scale-150";
3
+ type BaseUtility = Keyword | `${SpacingProperty}:${SpacingValue}` | `${BgColorProperty}:${ColorToken}` | `${SizeProperty}:${SizeKeyword | SpacingValue | "screen" | `${number}/${number}`}` | `${RadiusProperty}:${RadiusValue}` | `${ShadowProperty}:${ShadowValue}` | `${AlignmentProperty}:${AlignmentValue}` | `${FontWeightProperty}:${FontWeightValue}` | `${LineHeightProperty}:${LineHeightValue}` | `${ContentProperty}:${ContentValue}` | `${RawProperty}:${string}` | `ring:${`${number}` | ColorToken}` | `text:${FontSizeValue | TextAlignKeyword | ColorToken}` | `font:${FontSizeValue | FontWeightValue}` | `border:${`${number}` | ColorToken}` | `list:${ListKeyword}`;
4
4
  type PseudoUtility = `${PseudoPrefix}:${Keyword}` | `${PseudoPrefix}:${PropertyName}:${string}`;
5
5
  /**
6
6
  * Union of all valid CSS utility class strings.
@@ -253,8 +253,12 @@ interface ThemeProviderProps {
253
253
  *
254
254
  * Uses __element() directly (instead of jsx()) so the hydration cursor
255
255
  * walker can claim the existing SSR node during mount().
256
+ *
257
+ * Accepts `props` without destructuring so that the compiler-generated
258
+ * getter for `theme` stays alive — `__attr()` reads it inside a domEffect,
259
+ * making the attribute reactive when the parent passes a signal-backed value.
256
260
  */
257
- declare function ThemeProvider({ theme, children }: ThemeProviderProps): HTMLElement;
261
+ declare function ThemeProvider(props: ThemeProviderProps): HTMLElement;
258
262
  /**
259
263
  * A record of variant names to their possible values (each value maps to style entries).
260
264
  *
@@ -8,11 +8,11 @@ import {
8
8
  globalCss,
9
9
  s,
10
10
  variants
11
- } from "../../shared/chunk-pq8khh47.js";
12
- import"../../shared/chunk-vwz86vg9.js";
13
- import"../../shared/chunk-prj7nm08.js";
14
- import"../../shared/chunk-c61572xp.js";
15
- import"../../shared/chunk-2qe6aqhb.js";
11
+ } from "../../shared/chunk-t3rnfxc0.js";
12
+ import"../../shared/chunk-mbnda3pv.js";
13
+ import"../../shared/chunk-h1fsr8kv.js";
14
+ import"../../shared/chunk-2y9f9j62.js";
15
+ import"../../shared/chunk-656n0x6y.js";
16
16
  export {
17
17
  variants,
18
18
  s,
@@ -3,8 +3,8 @@ import {
3
3
  form,
4
4
  formDataToObject,
5
5
  validate
6
- } from "../../shared/chunk-yb4a0smw.js";
7
- import"../../shared/chunk-2qe6aqhb.js";
6
+ } from "../../shared/chunk-4gmtsf6v.js";
7
+ import"../../shared/chunk-656n0x6y.js";
8
8
  export {
9
9
  validate,
10
10
  formDataToObject,
@@ -117,6 +117,24 @@ declare function createContext<T>(defaultValue?: T, __stableId?: string): Contex
117
117
  * Returns the default value if no Provider is active.
118
118
  */
119
119
  declare function useContext<T>(ctx: Context<T>): UnwrapSignals<T> | undefined;
120
+ /** Props for error fallback components (shared by DefaultErrorFallback and route errorComponent). */
121
+ interface ErrorFallbackProps {
122
+ error: Error;
123
+ retry: () => void;
124
+ }
125
+ /**
126
+ * Framework-provided error fallback component.
127
+ *
128
+ * Renders a simple error display with the error message and a "Try again" button.
129
+ * Works without any theme registered — uses inline styles for a clean default look.
130
+ *
131
+ * Exported from `@vertz/ui` (not `@vertz/ui/components`) because it is a
132
+ * framework-level component, not a theme-provided one.
133
+ *
134
+ * Uses imperative DOM instead of JSX because `@vertz/ui` is a core package
135
+ * without the Vertz compiler plugin — `.ts` files don't go through JSX transforms.
136
+ */
137
+ declare function DefaultErrorFallback({ error, retry }: ErrorFallbackProps): HTMLElement;
120
138
  /** DOM element types accepted by JSX (mirrors JSX.Element). */
121
139
  type JsxElement = HTMLElement | SVGElement | DocumentFragment;
122
140
  /** Props for the ErrorBoundary component. */
@@ -139,6 +157,60 @@ interface ErrorBoundaryProps {
139
157
  */
140
158
  declare function ErrorBoundary(props: ErrorBoundaryProps): JsxElement;
141
159
  /**
160
+ * Props for the Foreign component.
161
+ *
162
+ * `<Foreign>` renders a container element whose children are owned by
163
+ * external (non-Vertz) code. During hydration, the container is claimed
164
+ * but its children are not walked — external content is preserved.
165
+ */
166
+ interface ForeignProps {
167
+ /**
168
+ * HTML tag for the container element.
169
+ * @default 'div'
170
+ */
171
+ tag?: keyof HTMLElementTagNameMap | keyof SVGElementTagNameMap;
172
+ /**
173
+ * Called when the container is ready for external DOM manipulation.
174
+ * Runs after hydration is complete (post-hydration onMount timing).
175
+ * Return a cleanup function for unmount.
176
+ *
177
+ * This is the sole way to access the container element.
178
+ * For SVG tags, cast to the appropriate SVG element type.
179
+ */
180
+ onReady?: (container: HTMLElement | SVGElement) => (() => void) | void;
181
+ /**
182
+ * Pre-rendered HTML content to inject during SSR.
183
+ * Only takes effect during server-side rendering — on the client,
184
+ * the SSR content is already in the DOM and preserved by hydration.
185
+ *
186
+ * Use this for content that can be pre-rendered on the server
187
+ * (e.g. syntax-highlighted code) to avoid a flash on first paint.
188
+ */
189
+ html?: string;
190
+ /** Element id */
191
+ id?: string;
192
+ /** CSS class name */
193
+ className?: string;
194
+ /** Inline styles (camelCase object) */
195
+ style?: Partial<CSSStyleDeclaration>;
196
+ /**
197
+ * Children are not supported. Foreign renders an empty container
198
+ * whose children are managed by external code via onReady.
199
+ */
200
+ children?: never;
201
+ }
202
+ /**
203
+ * Foreign component — renders an unmanaged subtree container.
204
+ *
205
+ * Claims the container element during hydration without entering its children.
206
+ * External code owns the container's children via the `onReady` callback,
207
+ * which fires in post-hydration `onMount` timing.
208
+ *
209
+ * Implemented as a hand-written `.ts` component (no JSX, no compiler transforms)
210
+ * because it's a framework primitive that uses `__element()` directly.
211
+ */
212
+ declare function Foreign({ tag, onReady, html, id, className, style }: ForeignProps): Element;
213
+ /**
142
214
  * Runs callback once on mount. Never re-executes.
143
215
  * Return a function to register cleanup that runs on unmount.
144
216
  *
@@ -224,8 +296,8 @@ declare const slideOutToRight: string;
224
296
  declare const accordionDown: string;
225
297
  declare const accordionUp: string;
226
298
  /** All keyword names. */
227
- type Keyword = "flex" | "grid" | "block" | "inline" | "hidden" | "inline-flex" | "flex-1" | "flex-col" | "flex-row" | "flex-wrap" | "flex-nowrap" | "fixed" | "absolute" | "relative" | "sticky" | "uppercase" | "lowercase" | "capitalize" | "outline-none" | "overflow-hidden" | "select-none" | "pointer-events-none" | "whitespace-nowrap" | "shrink-0" | "italic" | "not-italic";
228
- type BaseUtility = Keyword | `${SpacingProperty}:${SpacingValue}` | `${BgColorProperty}:${ColorToken}` | `${SizeProperty}:${SizeKeyword | SpacingValue | "screen"}` | `${RadiusProperty}:${RadiusValue}` | `${ShadowProperty}:${ShadowValue}` | `${AlignmentProperty}:${AlignmentValue}` | `${FontWeightProperty}:${FontWeightValue}` | `${LineHeightProperty}:${LineHeightValue}` | `${ContentProperty}:${ContentValue}` | `${RawProperty}:${string}` | `ring:${`${number}` | ColorToken}` | `text:${FontSizeValue | TextAlignKeyword | ColorToken}` | `font:${FontSizeValue | FontWeightValue}` | `border:${`${number}` | ColorToken}` | `list:${ListKeyword}`;
299
+ type Keyword = "flex" | "grid" | "block" | "inline" | "hidden" | "inline-flex" | "flex-1" | "flex-col" | "flex-row" | "flex-wrap" | "flex-nowrap" | "fixed" | "absolute" | "relative" | "sticky" | "uppercase" | "lowercase" | "capitalize" | "outline-none" | "overflow-hidden" | "select-none" | "pointer-events-none" | "whitespace-nowrap" | "shrink-0" | "italic" | "not-italic" | "scale-0" | "scale-75" | "scale-90" | "scale-95" | "scale-100" | "scale-105" | "scale-110" | "scale-125" | "scale-150";
300
+ type BaseUtility = Keyword | `${SpacingProperty}:${SpacingValue}` | `${BgColorProperty}:${ColorToken}` | `${SizeProperty}:${SizeKeyword | SpacingValue | "screen" | `${number}/${number}`}` | `${RadiusProperty}:${RadiusValue}` | `${ShadowProperty}:${ShadowValue}` | `${AlignmentProperty}:${AlignmentValue}` | `${FontWeightProperty}:${FontWeightValue}` | `${LineHeightProperty}:${LineHeightValue}` | `${ContentProperty}:${ContentValue}` | `${RawProperty}:${string}` | `ring:${`${number}` | ColorToken}` | `text:${FontSizeValue | TextAlignKeyword | ColorToken}` | `font:${FontSizeValue | FontWeightValue}` | `border:${`${number}` | ColorToken}` | `list:${ListKeyword}`;
229
301
  type PseudoUtility = `${PseudoPrefix}:${Keyword}` | `${PseudoPrefix}:${PropertyName}:${string}`;
230
302
  /**
231
303
  * Union of all valid CSS utility class strings.
@@ -540,8 +612,12 @@ interface ThemeProviderProps {
540
612
  *
541
613
  * Uses __element() directly (instead of jsx()) so the hydration cursor
542
614
  * walker can claim the existing SSR node during mount().
615
+ *
616
+ * Accepts `props` without destructuring so that the compiler-generated
617
+ * getter for `theme` stays alive — `__attr()` reads it inside a domEffect,
618
+ * making the attribute reactive when the parent passes a signal-backed value.
543
619
  */
544
- declare function ThemeProvider({ theme, children }: ThemeProviderProps): HTMLElement;
620
+ declare function ThemeProvider(props: ThemeProviderProps): HTMLElement;
545
621
  /**
546
622
  * A record of variant names to their possible values (each value maps to style entries).
547
623
  *
@@ -581,6 +657,9 @@ interface VariantFunction<V extends VariantDefinitions> {
581
657
  */
582
658
  declare function variants<V extends VariantDefinitions>(config: VariantsConfig<V>): VariantFunction<V>;
583
659
  declare const DialogStackContext: Context<DialogStack>;
660
+ declare const DialogHandleContext: Context<DialogHandle<unknown>>;
661
+ declare const DialogIdContext: Context<string>;
662
+ declare function useDialog<T = void>(): DialogHandle<T>;
584
663
  declare function useDialogStack(): DialogStack;
585
664
  interface DialogHandle<TResult> {
586
665
  close(...args: void extends TResult ? [] : [result: TResult]): void;
@@ -597,19 +676,42 @@ type DialogResult<T> = {
597
676
  } | {
598
677
  readonly ok: false;
599
678
  };
679
+ interface DialogOpenOptions {
680
+ /** Whether the dialog can be dismissed by backdrop click or Escape. Default: true */
681
+ dismissible?: boolean;
682
+ }
683
+ interface ConfirmOptions {
684
+ title: string;
685
+ description?: string;
686
+ confirm?: string;
687
+ cancel?: string;
688
+ intent?: "primary" | "danger";
689
+ dismissible?: boolean;
690
+ }
600
691
  interface DialogStack {
601
692
  open<
602
693
  TResult,
603
694
  TProps
604
- >(component: DialogComponent<TResult, TProps>, props: TProps): Promise<DialogResult<TResult>>;
695
+ >(component: DialogComponent<TResult, TProps>, props: TProps, options?: DialogOpenOptions): Promise<DialogResult<TResult>>;
605
696
  /** @internal — used by useDialogStack() to pass captured context scope */
606
697
  openWithScope<
607
698
  TResult,
608
699
  TProps
609
- >(component: DialogComponent<TResult, TProps>, props: TProps, scope: ContextScope | null): Promise<DialogResult<TResult>>;
700
+ >(component: DialogComponent<TResult, TProps>, props: TProps, scope: ContextScope | null, options?: DialogOpenOptions): Promise<DialogResult<TResult>>;
701
+ confirm(options: ConfirmOptions): Promise<boolean>;
610
702
  readonly size: number;
611
703
  closeAll(): void;
612
704
  }
705
+ /**
706
+ * Manages the dialog container element and provides DialogStack via context.
707
+ *
708
+ * Creates a hydration-safe container div via `__element`, initializes the
709
+ * dialog stack, and wraps children in `DialogStackContext.Provider`.
710
+ * The container renders after children — dialogs portal into it.
711
+ */
712
+ declare function DialogStackProvider({ children }: {
713
+ children?: unknown;
714
+ }): HTMLElement;
613
715
  declare function createDialogStack(container: HTMLElement): DialogStack;
614
716
  /**
615
717
  * Brand symbol for render nodes.
@@ -661,18 +763,18 @@ declare function getAdapter(): RenderAdapter;
661
763
  */
662
764
  declare function setAdapter(adapter: RenderAdapter | null): void;
663
765
  /**
664
- * Create a DOM adapter that delegates to real browser DOM APIs.
665
- * Zero overhead — no branding, no wrapping.
666
- * Browser `Node` instances pass `isRenderNode()` via the `instanceof Node` fallback.
667
- */
668
- declare function createDOMAdapter(): RenderAdapter;
669
- /**
670
766
  * Wait for all CSS animations on an element to complete, then call back.
671
767
  * If no animations are running, calls back immediately.
672
768
  * Respects prefers-reduced-motion by skipping the wait.
673
769
  */
674
770
  declare function onAnimationsComplete(el: Element, callback: () => void): void;
675
771
  /**
772
+ * Create a DOM adapter that delegates to real browser DOM APIs.
773
+ * Zero overhead — no branding, no wrapping.
774
+ * Browser `Node` instances pass `isRenderNode()` via the `instanceof Node` fallback.
775
+ */
776
+ declare function createDOMAdapter(): RenderAdapter;
777
+ /**
676
778
  * Create a DOM element with optional static properties.
677
779
  *
678
780
  * This is a compiler output target — the compiler generates calls
@@ -885,6 +987,37 @@ interface FormDataOptions {
885
987
  * "true"/"false" become booleans.
886
988
  */
887
989
  declare function formDataToObject(formData: FormData, options?: FormDataOptions): Record<string, unknown>;
990
+ type DateInput = Date | string | number;
991
+ interface FormatRelativeTimeOptions {
992
+ /** BCP 47 locale tag. Defaults to user's locale via Intl defaults. */
993
+ locale?: string;
994
+ /** Intl.RelativeTimeFormat numeric option. Defaults to 'auto'. */
995
+ numeric?: "auto" | "always";
996
+ /** Reference time for "now". Defaults to `new Date()`. Useful for testing. */
997
+ now?: Date;
998
+ }
999
+ declare function formatRelativeTime(date: DateInput, options?: FormatRelativeTimeOptions): string;
1000
+ interface RelativeTimeProps {
1001
+ /** The date to format. Accepts Date, ISO string, or epoch ms. */
1002
+ date: DateInput;
1003
+ /** BCP 47 locale tag. */
1004
+ locale?: string;
1005
+ /** Intl.RelativeTimeFormat numeric option. Defaults to 'auto'. */
1006
+ numeric?: "auto" | "always";
1007
+ /** Update interval in ms. Defaults to adaptive. */
1008
+ updateInterval?: number;
1009
+ /** CSS class name for the <time> element. */
1010
+ className?: string;
1011
+ /** Title attribute (shown on hover). Defaults to full formatted date. Set to false to disable. */
1012
+ title?: string | false;
1013
+ }
1014
+ /**
1015
+ * Auto-updating relative time component.
1016
+ * Renders a `<time>` element with the formatted relative time.
1017
+ * Uses `setTimeout` chains with adaptive intervals for live updates.
1018
+ * Timer starts in `onMount()` — safe for SSR (skipped on server).
1019
+ */
1020
+ declare function RelativeTime({ date, locale, numeric, updateInterval, className, title }: RelativeTimeProps): HTMLTimeElement;
888
1021
  /** A function returning a dynamic import of a component module. */
889
1022
  type ComponentLoader = () => Promise<{
890
1023
  default: ComponentFunction;
@@ -1027,6 +1160,16 @@ declare function invalidate<
1027
1160
  T,
1028
1161
  E
1029
1162
  >(descriptor: QueryDescriptor<T, E>): void;
1163
+ /**
1164
+ * Invalidate all active queries targeting tenant-scoped entities.
1165
+ * Clears cached data first (no SWR stale window), then refetches.
1166
+ *
1167
+ * Called automatically by TenantProvider after switchTenant() succeeds.
1168
+ * Can also be called manually if needed.
1169
+ *
1170
+ * No-op during SSR.
1171
+ */
1172
+ declare function invalidateTenantQueries(): void;
1030
1173
  import { EntityQueryMeta as EntityQueryMeta2, QueryDescriptor as QueryDescriptor2 } from "@vertz/fetch";
1031
1174
  /** Options for query(). */
1032
1175
  interface QueryOptions<T> {
@@ -1034,8 +1177,6 @@ interface QueryOptions<T> {
1034
1177
  initialData?: T;
1035
1178
  /** Debounce re-fetches triggered by reactive dependency changes (ms). */
1036
1179
  debounce?: number;
1037
- /** When false, the query will not fetch. Defaults to true. */
1038
- enabled?: boolean;
1039
1180
  /** Explicit cache key. When omitted, derived from the thunk. */
1040
1181
  key?: string;
1041
1182
  /** Custom cache store. Defaults to a shared in-memory Map. */
@@ -1069,6 +1210,8 @@ interface QueryResult<
1069
1210
  readonly revalidating: Unwrapped<ReadonlySignal<boolean>>;
1070
1211
  /** The error from the latest failed fetch, or undefined. */
1071
1212
  readonly error: Unwrapped<ReadonlySignal<E | undefined>>;
1213
+ /** True when the query has never fetched (thunk returned null or not yet run). */
1214
+ readonly idle: Unwrapped<ReadonlySignal<boolean>>;
1072
1215
  /** Manually trigger a refetch (clears cache for this key). */
1073
1216
  refetch: () => void;
1074
1217
  /** Alias for refetch — revalidate the cached data. */
@@ -1090,7 +1233,11 @@ declare function query<
1090
1233
  T,
1091
1234
  E
1092
1235
  >(descriptor: QueryDescriptor2<T, E>, options?: Omit<QueryOptions<T>, "key">): QueryResult<T, E>;
1093
- declare function query<T>(thunk: () => Promise<T>, options?: QueryOptions<T>): QueryResult<T>;
1236
+ declare function query<
1237
+ T,
1238
+ E
1239
+ >(thunk: () => QueryDescriptor2<T, E> | null, options?: Omit<QueryOptions<T>, "key">): QueryResult<T, E>;
1240
+ declare function query<T>(thunk: () => Promise<T> | null, options?: QueryOptions<T>): QueryResult<T>;
1094
1241
  interface QueryMatchHandlers<
1095
1242
  T,
1096
1243
  E
@@ -1215,7 +1362,10 @@ interface RouteConfig<
1215
1362
  signal: AbortSignal;
1216
1363
  }) => Promise<TLoaderData> | TLoaderData;
1217
1364
  /** Optional error component rendered when loader throws. */
1218
- errorComponent?: (error: Error) => Node;
1365
+ errorComponent?: (props: {
1366
+ error: Error;
1367
+ retry: () => void;
1368
+ }) => Node;
1219
1369
  /** Optional path params schema for validation/parsing. */
1220
1370
  params?: ParamSchema<TParams>;
1221
1371
  /** Optional search params schema for validation/coercion. */
@@ -1253,7 +1403,10 @@ interface RouteConfigLike {
1253
1403
  params: Record<string, string>;
1254
1404
  signal: AbortSignal;
1255
1405
  }): unknown;
1256
- errorComponent?: (error: Error) => Node;
1406
+ errorComponent?: (props: {
1407
+ error: Error;
1408
+ retry: () => void;
1409
+ }) => Node;
1257
1410
  params?: ParamSchema<unknown>;
1258
1411
  searchParams?: SearchParamSchema<unknown>;
1259
1412
  children?: Record<string, RouteConfigLike>;
@@ -1287,7 +1440,10 @@ interface CompiledRoute {
1287
1440
  params: Record<string, string>;
1288
1441
  signal: AbortSignal;
1289
1442
  }) => Promise<unknown> | unknown;
1290
- errorComponent?: RouteConfig["errorComponent"];
1443
+ errorComponent?: (props: {
1444
+ error: Error;
1445
+ retry: () => void;
1446
+ }) => Node;
1291
1447
  /** Optional path params schema for validation/parsing. */
1292
1448
  params?: ParamSchema<unknown>;
1293
1449
  searchParams?: RouteConfig["searchParams"];
@@ -1505,9 +1661,18 @@ declare function useRouter<T extends Record<string, RouteConfigLike> = RouteDefi
1505
1661
  */
1506
1662
  declare function useParams<TPath extends string = string>(): ExtractParams<TPath>;
1507
1663
  declare function useParams<T extends Record<string, unknown>>(): T;
1664
+ /** Error fallback component signature, reuses ErrorFallbackProps from DefaultErrorFallback. */
1665
+ type ErrorFallbackFn = (props: ErrorFallbackProps) => Node;
1508
1666
  interface RouterViewProps {
1509
1667
  router: Router;
1668
+ /** Rendered when no route matches (404). */
1510
1669
  fallback?: () => Node;
1670
+ /**
1671
+ * Global error fallback for all routes. When set, every route component is
1672
+ * automatically wrapped in an ErrorBoundary using this fallback.
1673
+ * Per-route `errorComponent` takes precedence over this.
1674
+ */
1675
+ errorFallback?: ErrorFallbackFn;
1511
1676
  }
1512
1677
  /**
1513
1678
  * Renders the matched route's component inside a container div.
@@ -1520,7 +1685,7 @@ interface RouterViewProps {
1520
1685
  * domEffect runs the component factory (to attach reactivity/event handlers)
1521
1686
  * but skips clearing the container.
1522
1687
  */
1523
- declare function RouterView({ router, fallback }: RouterViewProps): HTMLElement;
1688
+ declare function RouterView({ router, fallback, errorFallback }: RouterViewProps): HTMLElement;
1524
1689
  /**
1525
1690
  * Parse URLSearchParams into a typed object, optionally through a schema.
1526
1691
  *
@@ -1537,26 +1702,6 @@ declare function parseSearchParams<T = Record<string, string>>(urlParams: URLSea
1537
1702
  * @returns The current search params value
1538
1703
  */
1539
1704
  declare function useSearchParams<T>(searchSignal: ReadonlySignal<T>): T;
1540
- /** Input type for registerTheme(). Compatible with configureTheme() output. */
1541
- interface RegisterThemeInput {
1542
- components: {
1543
- primitives?: object;
1544
- };
1545
- }
1546
- /**
1547
- * Register a theme for use with `@vertz/ui/components`.
1548
- *
1549
- * Call once at app startup, before any component from `@vertz/ui/components` is used.
1550
- * Calling again replaces the previously registered theme.
1551
- *
1552
- * @example
1553
- * ```ts
1554
- * import { registerTheme } from '@vertz/ui';
1555
- * import { configureTheme } from '@vertz/theme-shadcn';
1556
- * registerTheme(configureTheme({ palette: 'zinc', radius: 'md' }));
1557
- * ```
1558
- */
1559
- declare function registerTheme(resolved: RegisterThemeInput): void;
1560
1705
  /**
1561
1706
  * Error thrown when `onCleanup()` is called outside a disposal scope.
1562
1707
  * Similar to React's invalid hook call error — fail-fast so developers
@@ -1566,6 +1711,12 @@ declare class DisposalScopeError extends Error {
1566
1711
  constructor();
1567
1712
  }
1568
1713
  /**
1714
+ * Register a cleanup function with the current disposal scope.
1715
+ * Throws `DisposalScopeError` if no scope is active — fail-fast
1716
+ * so developers know their cleanup callback was not registered.
1717
+ */
1718
+ declare function onCleanup(fn: DisposeFn): void;
1719
+ /**
1569
1720
  * Group multiple signal writes into a single update flush.
1570
1721
  * Nested batches are supported — only the outermost batch triggers the flush.
1571
1722
  */
@@ -1805,6 +1956,7 @@ declare class QueryEnvelopeStore {
1805
1956
  private _envelopes;
1806
1957
  get(queryKey: string): QueryEnvelope | undefined;
1807
1958
  set(queryKey: string, envelope: QueryEnvelope): void;
1959
+ delete(queryKey: string): void;
1808
1960
  clear(): void;
1809
1961
  }
1810
1962
  /** Get the global EntityStore singleton. */
@@ -1909,4 +2061,24 @@ declare function resetRelationSchemas_TEST_ONLY(): void;
1909
2061
  * ```
1910
2062
  */
1911
2063
  declare function createTestStore(data: Record<string, Record<string, unknown>>): EntityStore;
1912
- export { zoomOut, zoomIn, variants, validate, useSearchParams, useRouter, useParams, useDialogStack, useContext, untrack, slideOutToTop, slideOutToRight, slideOutToLeft, slideOutToBottom, slideInFromTop, slideInFromRight, slideInFromLeft, slideInFromBottom, signal, setAdapter, s, resolveChildren, resetRelationSchemas_TEST_ONLY, resetInjectedStyles, registerTheme, registerRelationSchema, ref, queryMatch, query, parseSearchParams, palettes, onMount2 as onMount, onAnimationsComplete, mount, keyframes, isRenderNode, isQueryDescriptor, isBrowser, invalidate, injectCSS, hydrateIslands, hydrate, globalCss, getRelationSchema, getQueryEnvelopeStore, getInjectedCSS, getEntityStore, getAdapter, formDataToObject, form, font, fadeOut, fadeIn, defineTheme, defineRoutes, css, createTestStore, createRouter, createOptimisticHandler, createLink, createFieldState, createDialogStack, createDOMAdapter, createContext, configureImageOptimizer, computed, compileTheme, compileFonts, children, buildOptimizedUrl, batch, accordionUp, accordionDown, __staticText, __exitChildren, __enterChildren, __element, __append, VariantsConfig, VariantProps, VariantFunction, ValidationResult, UnwrapSignals, TypedRoutes, TypedRouter, ThemeProviderProps, ThemeProvider, ThemeInput, Theme, SuspenseProps, Suspense, StyleValue, StyleEntry, Signal, SerializedStore, SearchParamSchema, SdkMethodWithMeta, SdkMethod, RouterViewProps, RouterView, RouterOptions, RouterContext, Router, RoutePattern, RoutePaths, RouteMatch, RouteDefinitionMap, RouteConfig, RenderText, RenderNode, RenderElement, RenderAdapter, RelationSchema, RelationFieldDef, RegisterThemeInput, Ref, ReadonlySignal, RENDER_NODE_BRAND, QueryResult, QueryOptions, QueryMatchHandlers, QueryEnvelopeStore, QueryEnvelope, QueryDescriptor3 as QueryDescriptor, PresenceProps, Presence, PreloadItem, PathWithParams, ParamSchema, OutletContextValue, OutletContext, Outlet, NavigateOptions, NavigateInput, MountOptions, MountHandle, MergeSelectOptions, MatchedRoute, LoaderData, ListTransitionProps, ListTransition, LinkProps, LinkFactoryOptions, Link, IslandRegistry, IslandProps, Island, InferRouteMap, ImageProps, Image, GlobalCSSOutput, GlobalCSSInput, FormSchema, FormOptions, FormInstance, FormDataOptions, FontSrc, FontOptions, FontFallbackMetrics, FontDescriptor, FieldState, FieldSelectionTracker, FallbackFontName, ExtractParams, ErrorBoundaryProps, ErrorBoundary, EntityStoreOptions, EntityStore, DisposeFn, DisposalScopeError, DialogStackContext, DialogStack, DialogResult, DialogHandle, DialogComponent, Context, Computed, ComponentRegistry, ComponentLoader, ComponentFunction, CompiledTheme, CompiledRoute, CompiledFonts, CompileThemeOptions, CompileFontsOptions, ColorPalette, ChildrenAccessor, ChildValue, CacheStore, CSSOutput, CSSInput, ANIMATION_EASING, ANIMATION_DURATION };
2064
+ /** Input type for registerTheme(). Compatible with configureTheme() output. */
2065
+ interface RegisterThemeInput {
2066
+ components: {
2067
+ primitives?: object;
2068
+ };
2069
+ }
2070
+ /**
2071
+ * Register a theme for use with `@vertz/ui/components`.
2072
+ *
2073
+ * Call once at app startup, before any component from `@vertz/ui/components` is used.
2074
+ * Calling again replaces the previously registered theme.
2075
+ *
2076
+ * @example
2077
+ * ```ts
2078
+ * import { registerTheme } from '@vertz/ui';
2079
+ * import { configureTheme } from '@vertz/theme-shadcn';
2080
+ * registerTheme(configureTheme({ palette: 'zinc', radius: 'md' }));
2081
+ * ```
2082
+ */
2083
+ declare function registerTheme(resolved: RegisterThemeInput): void;
2084
+ export { zoomOut, zoomIn, variants, validate, useSearchParams, useRouter, useParams, useDialogStack, useDialog, useContext, untrack, slideOutToTop, slideOutToRight, slideOutToLeft, slideOutToBottom, slideInFromTop, slideInFromRight, slideInFromLeft, slideInFromBottom, signal, setAdapter, s, resolveChildren, resetRelationSchemas_TEST_ONLY, resetInjectedStyles, registerTheme, registerRelationSchema, ref, queryMatch, query, parseSearchParams, palettes, onMount2 as onMount, onCleanup, onAnimationsComplete, mount, keyframes, isRenderNode, isQueryDescriptor, isBrowser, invalidateTenantQueries, invalidate, injectCSS, hydrateIslands, hydrate, globalCss, getRelationSchema, getQueryEnvelopeStore, getInjectedCSS, getEntityStore, getAdapter, formatRelativeTime, formDataToObject, form, font, fadeOut, fadeIn, defineTheme, defineRoutes, css, createTestStore, createRouter, createOptimisticHandler, createLink, createFieldState, createDialogStack, createDOMAdapter, createContext, configureImageOptimizer, computed, compileTheme, compileFonts, children, buildOptimizedUrl, batch, accordionUp, accordionDown, __staticText, __exitChildren, __enterChildren, __element, __append, VariantsConfig, VariantProps, VariantFunction, ValidationResult, UnwrapSignals, TypedRoutes, TypedRouter, ThemeProviderProps, ThemeProvider, ThemeInput, Theme, SuspenseProps, Suspense, StyleValue, StyleEntry, Signal, SerializedStore, SearchParamSchema, SdkMethodWithMeta, SdkMethod, RouterViewProps, RouterView, RouterOptions, RouterContext, Router, RoutePattern, RoutePaths, RouteMatch, RouteDefinitionMap, RouteConfig, RenderText, RenderNode, RenderElement, RenderAdapter, RelativeTimeProps, RelativeTime, RelationSchema, RelationFieldDef, RegisterThemeInput, Ref, ReadonlySignal, RENDER_NODE_BRAND, QueryResult, QueryOptions, QueryMatchHandlers, QueryEnvelopeStore, QueryEnvelope, QueryDescriptor3 as QueryDescriptor, PresenceProps, Presence, PreloadItem, PathWithParams, ParamSchema, OutletContextValue, OutletContext, Outlet, NavigateOptions, NavigateInput, MountOptions, MountHandle, MergeSelectOptions, MatchedRoute, LoaderData, ListTransitionProps, ListTransition, LinkProps, LinkFactoryOptions, Link, IslandRegistry, IslandProps, Island, InferRouteMap, ImageProps, Image, GlobalCSSOutput, GlobalCSSInput, FormatRelativeTimeOptions, FormSchema, FormOptions, FormInstance, FormDataOptions, ForeignProps, Foreign, FontSrc, FontOptions, FontFallbackMetrics, FontDescriptor, FieldState, FieldSelectionTracker, FallbackFontName, ExtractParams, ErrorFallbackProps, ErrorBoundaryProps, ErrorBoundary, EntityStoreOptions, EntityStore, DisposeFn, DisposalScopeError, DialogStackProvider, DialogStackContext, DialogStack, DialogResult, DialogOpenOptions, DialogIdContext, DialogHandleContext, DialogHandle, DialogComponent, DefaultErrorFallback, DateInput, Context, ConfirmOptions, Computed, ComponentRegistry, ComponentLoader, ComponentFunction, CompiledTheme, CompiledRoute, CompiledFonts, CompileThemeOptions, CompileFontsOptions, ColorPalette, ChildrenAccessor, ChildValue, CacheStore, CSSOutput, CSSInput, ANIMATION_EASING, ANIMATION_DURATION };