@vertz/ui 0.2.22 → 0.2.23

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.
@@ -3,10 +3,10 @@ import {
3
3
  __element,
4
4
  __enterChildren,
5
5
  __exitChildren
6
- } from "./chunk-vwz86vg9.js";
6
+ } from "./chunk-13tvh4wq.js";
7
7
  import {
8
8
  getSSRContext
9
- } from "./chunk-2qe6aqhb.js";
9
+ } from "./chunk-656n0x6y.js";
10
10
 
11
11
  // src/component/children.ts
12
12
  var MAX_RESOLVE_DEPTH = 100;
@@ -84,6 +84,9 @@ var PROPERTY_MAP = {
84
84
  decoration: { properties: ["text-decoration"], valueType: "raw" },
85
85
  list: { properties: ["list-style"], valueType: "raw" },
86
86
  ring: { properties: ["outline"], valueType: "ring" },
87
+ overflow: { properties: ["overflow"], valueType: "raw" },
88
+ "overflow-x": { properties: ["overflow-x"], valueType: "raw" },
89
+ "overflow-y": { properties: ["overflow-y"], valueType: "raw" },
87
90
  cursor: { properties: ["cursor"], valueType: "raw" },
88
91
  transition: { properties: ["transition"], valueType: "raw" },
89
92
  resize: { properties: ["resize"], valueType: "raw" },
@@ -120,7 +123,16 @@ var KEYWORD_MAP = {
120
123
  "whitespace-nowrap": [{ property: "white-space", value: "nowrap" }],
121
124
  "shrink-0": [{ property: "flex-shrink", value: "0" }],
122
125
  italic: [{ property: "font-style", value: "italic" }],
123
- "not-italic": [{ property: "font-style", value: "normal" }]
126
+ "not-italic": [{ property: "font-style", value: "normal" }],
127
+ "scale-0": [{ property: "transform", value: "scale(0)" }],
128
+ "scale-75": [{ property: "transform", value: "scale(0.75)" }],
129
+ "scale-90": [{ property: "transform", value: "scale(0.9)" }],
130
+ "scale-95": [{ property: "transform", value: "scale(0.95)" }],
131
+ "scale-100": [{ property: "transform", value: "scale(1)" }],
132
+ "scale-105": [{ property: "transform", value: "scale(1.05)" }],
133
+ "scale-110": [{ property: "transform", value: "scale(1.1)" }],
134
+ "scale-125": [{ property: "transform", value: "scale(1.25)" }],
135
+ "scale-150": [{ property: "transform", value: "scale(1.5)" }]
124
136
  };
125
137
  var DISPLAY_MAP = {
126
138
  flex: "flex",
@@ -450,23 +462,38 @@ function resolveSpacing(value, property) {
450
462
  return scaled;
451
463
  throw new TokenResolveError(`Invalid spacing value '${value}' for '${property}'. Use a spacing scale number (0, 1, 2, 4, 8, etc.) or 'auto'.`, `${property}:${value}`);
452
464
  }
465
+ var OPACITY_PATTERN = /^(.+)\/(\d+)$/;
453
466
  function resolveColor(value, property) {
454
- const dotIndex = value.indexOf(".");
467
+ const opacityMatch = OPACITY_PATTERN.exec(value);
468
+ if (opacityMatch && opacityMatch[1] && opacityMatch[2]) {
469
+ const colorPart = opacityMatch[1];
470
+ const opacityStr = opacityMatch[2];
471
+ const opacity = Number(opacityStr);
472
+ if (opacity < 0 || opacity > 100) {
473
+ throw new TokenResolveError(`Invalid opacity '${opacityStr}' in '${value}'. Opacity must be an integer between 0 and 100.`, `${property}:${value}`);
474
+ }
475
+ const resolvedColor = resolveColorToken(colorPart, property, value);
476
+ return `color-mix(in oklch, ${resolvedColor} ${opacity}%, transparent)`;
477
+ }
478
+ return resolveColorToken(value, property, value);
479
+ }
480
+ function resolveColorToken(token, property, fullValue) {
481
+ const dotIndex = token.indexOf(".");
455
482
  if (dotIndex !== -1) {
456
- const namespace = value.substring(0, dotIndex);
457
- const shade = value.substring(dotIndex + 1);
483
+ const namespace = token.substring(0, dotIndex);
484
+ const shade = token.substring(dotIndex + 1);
458
485
  if (COLOR_NAMESPACES.has(namespace)) {
459
486
  return `var(--color-${namespace}-${shade})`;
460
487
  }
461
- throw new TokenResolveError(`Unknown color token '${value}'. Known namespaces: ${[...COLOR_NAMESPACES].join(", ")}`, `${property}:${value}`);
488
+ throw new TokenResolveError(`Unknown color token '${fullValue}'. Known namespaces: ${[...COLOR_NAMESPACES].join(", ")}`, `${property}:${fullValue}`);
462
489
  }
463
- if (COLOR_NAMESPACES.has(value)) {
464
- return `var(--color-${value})`;
490
+ if (COLOR_NAMESPACES.has(token)) {
491
+ return `var(--color-${token})`;
465
492
  }
466
- if (CSS_COLOR_KEYWORDS.has(value)) {
467
- return value;
493
+ if (CSS_COLOR_KEYWORDS.has(token)) {
494
+ return token;
468
495
  }
469
- throw new TokenResolveError(`Unknown color token '${value}'. Use a design token name (e.g. 'primary', 'background') or 'primary.700' for shades.`, `${property}:${value}`);
496
+ throw new TokenResolveError(`Unknown color token '${fullValue}'. Use a design token name (e.g. 'primary', 'background') or 'primary.700' for shades.`, `${property}:${fullValue}`);
470
497
  }
471
498
  function resolveRadius(value, property) {
472
499
  const scaled = RADIUS_SCALE[value];
@@ -480,6 +507,7 @@ function resolveShadow(value, property) {
480
507
  return scaled;
481
508
  throw new TokenResolveError(`Invalid shadow value '${value}' for '${property}'. Use: ${Object.keys(SHADOW_SCALE).join(", ")}`, `${property}:${value}`);
482
509
  }
510
+ var FRACTION_PATTERN = /^(\d+)\/(\d+)$/;
483
511
  function resolveSize(value, property) {
484
512
  const spaced = SPACING_SCALE[value];
485
513
  if (spaced !== undefined)
@@ -490,7 +518,18 @@ function resolveSize(value, property) {
490
518
  const keyword = SIZE_KEYWORDS[value];
491
519
  if (keyword !== undefined)
492
520
  return keyword;
493
- throw new TokenResolveError(`Invalid size value '${value}' for '${property}'. Use a spacing scale number or keyword (full, screen, min, max, fit, auto).`, `${property}:${value}`);
521
+ const fractionMatch = FRACTION_PATTERN.exec(value);
522
+ if (fractionMatch) {
523
+ const numerator = Number(fractionMatch[1]);
524
+ const denominator = Number(fractionMatch[2]);
525
+ if (denominator === 0) {
526
+ throw new TokenResolveError(`Invalid fraction '${value}' for '${property}'. Denominator cannot be zero.`, `${property}:${value}`);
527
+ }
528
+ const percent = numerator / denominator * 100;
529
+ const formatted = percent % 1 === 0 ? `${percent}` : percent.toFixed(6);
530
+ return `${formatted}%`;
531
+ }
532
+ throw new TokenResolveError(`Invalid size value '${value}' for '${property}'. Use a spacing scale number, keyword (full, screen, min, max, fit, auto), or fraction (1/2, 2/3, etc.).`, `${property}:${value}`);
494
533
  }
495
534
  function resolveAlignment(value, property) {
496
535
  const mapped = ALIGNMENT_MAP[value];
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  RouterContext
3
- } from "../../shared/chunk-4cmt1ve8.js";
3
+ } from "../../shared/chunk-f4d5nphq.js";
4
4
  import {
5
5
  isBrowser
6
- } from "../../shared/chunk-bybgyjye.js";
6
+ } from "../../shared/chunk-da2w7j7w.js";
7
7
  import {
8
8
  _tryOnCleanup,
9
9
  computed,
@@ -11,7 +11,7 @@ import {
11
11
  getSSRContext,
12
12
  signal,
13
13
  useContext
14
- } from "../../shared/chunk-2qe6aqhb.js";
14
+ } from "../../shared/chunk-656n0x6y.js";
15
15
 
16
16
  // src/auth/access-context.ts
17
17
  var AccessContext = createContext(undefined, "@vertz/ui::AccessContext");
@@ -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.
@@ -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";
11
+ } from "../../shared/chunk-xhc7arn9.js";
12
+ import"../../shared/chunk-13tvh4wq.js";
13
13
  import"../../shared/chunk-prj7nm08.js";
14
- import"../../shared/chunk-c61572xp.js";
15
- import"../../shared/chunk-2qe6aqhb.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,
@@ -139,6 +139,51 @@ interface ErrorBoundaryProps {
139
139
  */
140
140
  declare function ErrorBoundary(props: ErrorBoundaryProps): JsxElement;
141
141
  /**
142
+ * Props for the Foreign component.
143
+ *
144
+ * `<Foreign>` renders a container element whose children are owned by
145
+ * external (non-Vertz) code. During hydration, the container is claimed
146
+ * but its children are not walked — external content is preserved.
147
+ */
148
+ interface ForeignProps {
149
+ /**
150
+ * HTML tag for the container element.
151
+ * @default 'div'
152
+ */
153
+ tag?: keyof HTMLElementTagNameMap | keyof SVGElementTagNameMap;
154
+ /**
155
+ * Called when the container is ready for external DOM manipulation.
156
+ * Runs after hydration is complete (post-hydration onMount timing).
157
+ * Return a cleanup function for unmount.
158
+ *
159
+ * This is the sole way to access the container element.
160
+ * For SVG tags, cast to the appropriate SVG element type.
161
+ */
162
+ onReady?: (container: HTMLElement | SVGElement) => (() => void) | void;
163
+ /** Element id */
164
+ id?: string;
165
+ /** CSS class name */
166
+ className?: string;
167
+ /** Inline styles (camelCase object) */
168
+ style?: Partial<CSSStyleDeclaration>;
169
+ /**
170
+ * Children are not supported. Foreign renders an empty container
171
+ * whose children are managed by external code via onReady.
172
+ */
173
+ children?: never;
174
+ }
175
+ /**
176
+ * Foreign component — renders an unmanaged subtree container.
177
+ *
178
+ * Claims the container element during hydration without entering its children.
179
+ * External code owns the container's children via the `onReady` callback,
180
+ * which fires in post-hydration `onMount` timing.
181
+ *
182
+ * Implemented as a hand-written `.ts` component (no JSX, no compiler transforms)
183
+ * because it's a framework primitive that uses `__element()` directly.
184
+ */
185
+ declare function Foreign({ tag, onReady, id, className, style }: ForeignProps): Element;
186
+ /**
142
187
  * Runs callback once on mount. Never re-executes.
143
188
  * Return a function to register cleanup that runs on unmount.
144
189
  *
@@ -224,8 +269,8 @@ declare const slideOutToRight: string;
224
269
  declare const accordionDown: string;
225
270
  declare const accordionUp: string;
226
271
  /** 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}`;
272
+ 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";
273
+ 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
274
  type PseudoUtility = `${PseudoPrefix}:${Keyword}` | `${PseudoPrefix}:${PropertyName}:${string}`;
230
275
  /**
231
276
  * Union of all valid CSS utility class strings.
@@ -661,18 +706,18 @@ declare function getAdapter(): RenderAdapter;
661
706
  */
662
707
  declare function setAdapter(adapter: RenderAdapter | null): void;
663
708
  /**
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
709
  * Wait for all CSS animations on an element to complete, then call back.
671
710
  * If no animations are running, calls back immediately.
672
711
  * Respects prefers-reduced-motion by skipping the wait.
673
712
  */
674
713
  declare function onAnimationsComplete(el: Element, callback: () => void): void;
675
714
  /**
715
+ * Create a DOM adapter that delegates to real browser DOM APIs.
716
+ * Zero overhead — no branding, no wrapping.
717
+ * Browser `Node` instances pass `isRenderNode()` via the `instanceof Node` fallback.
718
+ */
719
+ declare function createDOMAdapter(): RenderAdapter;
720
+ /**
676
721
  * Create a DOM element with optional static properties.
677
722
  *
678
723
  * This is a compiler output target — the compiler generates calls
@@ -1537,26 +1582,6 @@ declare function parseSearchParams<T = Record<string, string>>(urlParams: URLSea
1537
1582
  * @returns The current search params value
1538
1583
  */
1539
1584
  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
1585
  /**
1561
1586
  * Error thrown when `onCleanup()` is called outside a disposal scope.
1562
1587
  * Similar to React's invalid hook call error — fail-fast so developers
@@ -1909,4 +1934,24 @@ declare function resetRelationSchemas_TEST_ONLY(): void;
1909
1934
  * ```
1910
1935
  */
1911
1936
  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 };
1937
+ /** Input type for registerTheme(). Compatible with configureTheme() output. */
1938
+ interface RegisterThemeInput {
1939
+ components: {
1940
+ primitives?: object;
1941
+ };
1942
+ }
1943
+ /**
1944
+ * Register a theme for use with `@vertz/ui/components`.
1945
+ *
1946
+ * Call once at app startup, before any component from `@vertz/ui/components` is used.
1947
+ * Calling again replaces the previously registered theme.
1948
+ *
1949
+ * @example
1950
+ * ```ts
1951
+ * import { registerTheme } from '@vertz/ui';
1952
+ * import { configureTheme } from '@vertz/theme-shadcn';
1953
+ * registerTheme(configureTheme({ palette: 'zinc', radius: 'md' }));
1954
+ * ```
1955
+ */
1956
+ declare function registerTheme(resolved: RegisterThemeInput): void;
1957
+ 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, ForeignProps, Foreign, 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 };
package/dist/src/index.js CHANGED
@@ -24,7 +24,7 @@ import {
24
24
  slideOutToTop,
25
25
  zoomIn,
26
26
  zoomOut
27
- } from "../shared/chunk-pdqr78k9.js";
27
+ } from "../shared/chunk-p3fz6qqp.js";
28
28
  import {
29
29
  Link,
30
30
  Outlet,
@@ -33,12 +33,17 @@ import {
33
33
  createLink,
34
34
  parseSearchParams,
35
35
  useSearchParams
36
- } from "../shared/chunk-67z8b0q8.js";
37
- import"../shared/chunk-kjwp5q5s.js";
36
+ } from "../shared/chunk-016m1fq0.js";
37
+ import {
38
+ beginDeferringMounts,
39
+ discardDeferredMounts,
40
+ flushDeferredMounts,
41
+ onMount
42
+ } from "../shared/chunk-2kyhn86t.js";
38
43
  import"../shared/chunk-4xkw6h1s.js";
39
44
  import {
40
45
  createRouter
41
- } from "../shared/chunk-7g722pdh.js";
46
+ } from "../shared/chunk-jtma4sh4.js";
42
47
  import {
43
48
  defineRoutes
44
49
  } from "../shared/chunk-am9zaw4h.js";
@@ -47,7 +52,7 @@ import {
47
52
  form,
48
53
  formDataToObject,
49
54
  validate
50
- } from "../shared/chunk-yb4a0smw.js";
55
+ } from "../shared/chunk-4gmtsf6v.js";
51
56
  import {
52
57
  EntityStore,
53
58
  FieldSelectionTracker,
@@ -61,7 +66,7 @@ import {
61
66
  queryMatch,
62
67
  registerRelationSchema,
63
68
  resetRelationSchemas_TEST_ONLY
64
- } from "../shared/chunk-szk0hyjg.js";
69
+ } from "../shared/chunk-g6fb5yc2.js";
65
70
  import"../shared/chunk-jrtrk5z4.js";
66
71
  import {
67
72
  ThemeProvider,
@@ -78,14 +83,14 @@ import {
78
83
  resolveChildren,
79
84
  s,
80
85
  variants
81
- } from "../shared/chunk-pq8khh47.js";
86
+ } from "../shared/chunk-xhc7arn9.js";
82
87
  import {
83
88
  __append,
84
89
  __element,
85
90
  __enterChildren,
86
91
  __exitChildren,
87
92
  __staticText
88
- } from "../shared/chunk-vwz86vg9.js";
93
+ } from "../shared/chunk-13tvh4wq.js";
89
94
  import"../shared/chunk-prj7nm08.js";
90
95
  import {
91
96
  RENDER_NODE_BRAND,
@@ -93,15 +98,15 @@ import {
93
98
  getAdapter,
94
99
  isRenderNode,
95
100
  setAdapter
96
- } from "../shared/chunk-c61572xp.js";
101
+ } from "../shared/chunk-2y9f9j62.js";
97
102
  import {
98
103
  RouterContext,
99
104
  useParams,
100
105
  useRouter
101
- } from "../shared/chunk-4cmt1ve8.js";
106
+ } from "../shared/chunk-f4d5nphq.js";
102
107
  import {
103
108
  isBrowser
104
- } from "../shared/chunk-bybgyjye.js";
109
+ } from "../shared/chunk-da2w7j7w.js";
105
110
  import {
106
111
  DisposalScopeError,
107
112
  _tryOnCleanup,
@@ -125,7 +130,7 @@ import {
125
130
  startHydration,
126
131
  untrack,
127
132
  useContext
128
- } from "../shared/chunk-2qe6aqhb.js";
133
+ } from "../shared/chunk-656n0x6y.js";
129
134
  // src/component/error-boundary-context.ts
130
135
  var handlerStack = [];
131
136
  function pushErrorHandler(handler) {
@@ -183,22 +188,19 @@ function ErrorBoundary(props) {
183
188
  return fallbackNode;
184
189
  }
185
190
  }
186
- // src/component/lifecycle.ts
187
- function onMount(callback) {
188
- if (getSSRContext())
189
- return;
190
- const scope = pushScope();
191
- try {
192
- const cleanup = untrack(callback);
193
- if (typeof cleanup === "function") {
194
- _tryOnCleanup(cleanup);
195
- }
196
- } finally {
197
- popScope();
198
- if (scope.length > 0) {
199
- _tryOnCleanup(() => runCleanups(scope));
200
- }
191
+ // src/component/foreign.ts
192
+ function Foreign({ tag = "div", onReady, id, className, style }) {
193
+ const el = __element(tag);
194
+ if (id)
195
+ el.id = id;
196
+ if (className)
197
+ el.setAttribute("class", className);
198
+ if (style)
199
+ Object.assign(el.style, style);
200
+ if (onReady && !getSSRContext()) {
201
+ onMount(() => onReady(el));
201
202
  }
203
+ return el;
202
204
  }
203
205
  // src/dom/list-transition.ts
204
206
  function createItemProxy(itemSignal) {
@@ -788,11 +790,29 @@ function mount(app, options) {
788
790
  }
789
791
  if (root.firstChild) {
790
792
  const scope2 = pushScope();
793
+ let hydrationOk = false;
791
794
  try {
795
+ beginDeferringMounts();
792
796
  startHydration(root);
793
797
  app();
794
798
  endHydration();
799
+ hydrationOk = true;
800
+ } catch (e) {
801
+ discardDeferredMounts();
802
+ discardDeferredEffects();
803
+ endHydration();
795
804
  popScope();
805
+ runCleanups(scope2);
806
+ if (typeof process !== "undefined" && true) {
807
+ console.warn("[mount] Hydration failed — re-rendering from scratch (no data loss):", e);
808
+ }
809
+ }
810
+ if (hydrationOk) {
811
+ try {
812
+ flushDeferredMounts();
813
+ } finally {
814
+ popScope();
815
+ }
796
816
  options?.onMount?.(root);
797
817
  const handle2 = {
798
818
  unmount: () => {
@@ -804,14 +824,6 @@ function mount(app, options) {
804
824
  };
805
825
  mountedRoots.set(root, handle2);
806
826
  return handle2;
807
- } catch (e) {
808
- discardDeferredEffects();
809
- endHydration();
810
- popScope();
811
- runCleanups(scope2);
812
- if (typeof process !== "undefined" && true) {
813
- console.warn("[mount] Hydration failed — re-rendering from scratch (no data loss):", e);
814
- }
815
827
  }
816
828
  }
817
829
  const scope = pushScope();
@@ -966,6 +978,7 @@ export {
966
978
  Link,
967
979
  Island,
968
980
  Image,
981
+ Foreign,
969
982
  FieldSelectionTracker,
970
983
  ErrorBoundary,
971
984
  EntityStore,
@@ -81,6 +81,31 @@ declare function getContextScope(): ContextScope | null;
81
81
  */
82
82
  declare function setContextScope(scope: ContextScope | null): ContextScope | null;
83
83
  /**
84
+ * Compiler-injected: push a new mount frame at component body start.
85
+ * Returns the stack depth AFTER pushing — used by __discardMountFrame
86
+ * to avoid popping a parent frame if __flushMountFrame already popped ours.
87
+ */
88
+ declare function __pushMountFrame(): number;
89
+ /**
90
+ * Compiler-injected: flush the current mount frame after JSX evaluation.
91
+ * Pops the frame first (so the stack is clean even if a callback throws),
92
+ * then executes all deferred callbacks. All callbacks run even if one throws —
93
+ * the first error is rethrown after all have executed.
94
+ *
95
+ * During hydration (postHydrationQueue is non-null), callbacks are pushed
96
+ * to the queue instead of executing — they run after endHydration() via
97
+ * flushDeferredMounts(). This prevents onMount DOM manipulation from
98
+ * corrupting the hydration cursor.
99
+ */
100
+ declare function __flushMountFrame(): void;
101
+ /**
102
+ * Compiler-injected: discard the current mount frame in error paths.
103
+ * Only pops if the stack depth still matches `expectedDepth` (the value
104
+ * returned by __pushMountFrame). This prevents popping a parent frame
105
+ * when __flushMountFrame already popped ours (e.g., a callback threw).
106
+ */
107
+ declare function __discardMountFrame(expectedDepth: number): void;
108
+ /**
84
109
  * Shared CSS token lookup tables.
85
110
  *
86
111
  * This is the single source of truth for all CSS token resolution data.
@@ -295,6 +320,16 @@ declare function onAnimationsComplete(el: Element, callback: () => void): void;
295
320
  */
296
321
  declare function __attr(el: HTMLElement, name: string, fn: () => string | boolean | Record<string, string | number> | null | undefined): DisposeFn;
297
322
  /**
323
+ * Create a reactive DOM property binding.
324
+ * Unlike __attr (which uses setAttribute), this directly assigns to the
325
+ * element's IDL property (e.g., el.value, el.checked). This is required
326
+ * for form-related properties where setAttribute doesn't control the
327
+ * displayed state (e.g., <select>.value, <input>.checked).
328
+ *
329
+ * Uses deferredDomEffect so the first run is skipped during hydration.
330
+ */
331
+ declare function __prop(el: HTMLElement, name: string, fn: () => unknown): DisposeFn;
332
+ /**
298
333
  * Reactive display toggle.
299
334
  * When fn() returns false, the element is hidden (display: none).
300
335
  * When fn() returns true, the element is shown (display restored).
@@ -1058,4 +1093,4 @@ declare function getSSRContext(): SSRRenderContext | undefined;
1058
1093
  * clears during HMR module re-evaluation.
1059
1094
  */
1060
1095
  declare function hasSSRResolver(): boolean;
1061
- export { stopSignalCollection, startSignalCollection, setContextScope, setAdapter, runCleanups, resolveComponent, removeNode, registerSSRResolver, pushScope, popScope, onCleanup, onAnimationsComplete, matchRoute, matchPath, lifecycleEffect, isRenderNode, isBrowser, insertBefore, hasSSRResolver, getSSRContext, getContextScope, getAdapter, executeLoaders, domEffect, deserializeProps, deriveKey, createDOMAdapter, compileTheme, clearChildren, _tryOnCleanup, __text, styleObjectToString as __styleStr, __staticText, __show, __on, __list, __insert, __exitChildren, __enterChildren, __element, __conditional, __classList, __child, __attr, __append, SSRRenderContext, SSRQueryEntry, SSRAuth, SPACING_SCALE, SIZE_KEYWORDS, SHADOW_SCALE, RenderText, RenderNode, RenderElement, RenderAdapter, RENDER_NODE_BRAND, RADIUS_SCALE, QueryEnvelopeStore, PropertyMapping, PSEUDO_PREFIXES, PSEUDO_MAP, PROPERTY_MAP, MemoryCache, MatchResult, LINE_HEIGHT_SCALE, KEYWORD_MAP, HEIGHT_AXIS_PROPERTIES, FONT_WEIGHT_SCALE, FONT_SIZE_SCALE, EntityStore, DISPLAY_MAP, CSS_COLOR_KEYWORDS, CSSDeclarationEntry, CONTENT_MAP, COLOR_NAMESPACES, ALIGNMENT_MAP };
1096
+ export { stopSignalCollection, startSignalCollection, setContextScope, setAdapter, runCleanups, resolveComponent, removeNode, registerSSRResolver, pushScope, popScope, onCleanup, onAnimationsComplete, matchRoute, matchPath, lifecycleEffect, isRenderNode, isBrowser, insertBefore, hasSSRResolver, getSSRContext, getContextScope, getAdapter, executeLoaders, domEffect, deserializeProps, deriveKey, createDOMAdapter, compileTheme, clearChildren, _tryOnCleanup, __text, styleObjectToString as __styleStr, __staticText, __show, __pushMountFrame, __prop, __on, __list, __insert, __flushMountFrame, __exitChildren, __enterChildren, __element, __discardMountFrame, __conditional, __classList, __child, __attr, __append, SSRRenderContext, SSRQueryEntry, SSRAuth, SPACING_SCALE, SIZE_KEYWORDS, SHADOW_SCALE, RenderText, RenderNode, RenderElement, RenderAdapter, RENDER_NODE_BRAND, RADIUS_SCALE, QueryEnvelopeStore, PropertyMapping, PSEUDO_PREFIXES, PSEUDO_MAP, PROPERTY_MAP, MemoryCache, MatchResult, LINE_HEIGHT_SCALE, KEYWORD_MAP, HEIGHT_AXIS_PROPERTIES, FONT_WEIGHT_SCALE, FONT_SIZE_SCALE, EntityStore, DISPLAY_MAP, CSS_COLOR_KEYWORDS, CSSDeclarationEntry, CONTENT_MAP, COLOR_NAMESPACES, ALIGNMENT_MAP };