@vertz/ui 0.2.23 → 0.2.25

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-09ntccdx.js +39 -0
  2. package/dist/shared/{chunk-g6fb5yc2.js → chunk-1jgws7rs.js} +210 -258
  3. package/dist/shared/{chunk-016m1fq0.js → chunk-2krx4aqe.js} +119 -15
  4. package/dist/shared/{chunk-f4d5nphq.js → chunk-7nr2ebrf.js} +1 -1
  5. package/dist/shared/{chunk-4gmtsf6v.js → chunk-bk7mmn92.js} +1 -1
  6. package/dist/shared/chunk-djvarb8r.js +333 -0
  7. package/dist/shared/{chunk-jtma4sh4.js → chunk-e09mdqcx.js} +2 -2
  8. package/dist/shared/{chunk-4xkw6h1s.js → chunk-h1fsr8kv.js} +67 -1
  9. package/dist/shared/{chunk-xhc7arn9.js → chunk-j1a7t906.js} +14 -12
  10. package/dist/shared/{chunk-656n0x6y.js → chunk-ppr06jgn.js} +8 -2
  11. package/dist/shared/{chunk-2kyhn86t.js → chunk-svvqjmyy.js} +5 -63
  12. package/dist/shared/{chunk-da2w7j7w.js → chunk-xs5s8gqe.js} +1 -1
  13. package/dist/shared/{chunk-p3fz6qqp.js → chunk-ymc3wwam.js} +8 -2
  14. package/dist/src/auth/public.d.ts +35 -1
  15. package/dist/src/auth/public.js +72 -3
  16. package/dist/src/components/index.d.ts +3 -2
  17. package/dist/src/components/index.js +56 -46
  18. package/dist/src/css/public.d.ts +5 -1
  19. package/dist/src/css/public.js +4 -5
  20. package/dist/src/form/public.js +2 -2
  21. package/dist/src/index.d.ts +162 -53
  22. package/dist/src/index.js +341 -320
  23. package/dist/src/internals.d.ts +85 -10
  24. package/dist/src/internals.js +380 -90
  25. package/dist/src/jsx-runtime/index.js +3 -5
  26. package/dist/src/query/public.d.ts +6 -33
  27. package/dist/src/query/public.js +5 -7
  28. package/dist/src/router/public.d.ts +27 -4
  29. package/dist/src/router/public.js +8 -10
  30. package/dist/src/test/index.d.ts +12 -3
  31. package/dist/src/test/index.js +3 -3
  32. package/package.json +4 -3
  33. package/reactivity.json +1 -1
  34. package/dist/shared/chunk-13tvh4wq.js +0 -229
  35. package/dist/shared/chunk-2y9f9j62.js +0 -40
  36. package/dist/shared/chunk-prj7nm08.js +0 -67
@@ -142,7 +142,12 @@ declare const KEYWORD_MAP: Record<string, CSSDeclarationEntry[]>;
142
142
  declare const DISPLAY_MAP: Record<string, string>;
143
143
  /** Spacing scale: number -> rem. 1=0.25rem, 2=0.5rem, 4=1rem, 8=2rem, etc. */
144
144
  declare const SPACING_SCALE: Record<string, string>;
145
- /** Border radius scale — matches Tailwind v4 / shadcn. */
145
+ /**
146
+ * Border radius scale — derived from the `--radius` CSS custom property.
147
+ *
148
+ * All levels (except none/full) are proportional to `--radius` (default 0.375rem).
149
+ * Changing `--radius` on a theme element scales every component's border-radius.
150
+ */
146
151
  declare const RADIUS_SCALE: Record<string, string>;
147
152
  /** Shadow scale. */
148
153
  declare const SHADOW_SCALE: Record<string, string>;
@@ -382,6 +387,10 @@ interface DisposableText extends Text {
382
387
  * Returns a Text node with a `dispose` property for cleanup.
383
388
  */
384
389
  declare function __text(fn: () => string): DisposableText;
390
+ /** A Node that also carries a dispose function for cleanup. */
391
+ interface DisposableChild extends Node {
392
+ dispose: DisposeFn;
393
+ }
385
394
  /**
386
395
  * Create a reactive child node that updates when dependencies change.
387
396
  * Unlike __text(), this handles both Node values (appended directly)
@@ -390,11 +399,12 @@ declare function __text(fn: () => string): DisposableText;
390
399
  * This prevents HTMLElements from being stringified to "[object HTMLElement]"
391
400
  * when used as JSX expression children like {someElement}.
392
401
  *
393
- * Returns a wrapper element with `display: contents` and a `dispose` property.
402
+ * Uses a comment anchor (<!--child-->) with sibling-based content management.
403
+ * Content nodes are inserted after the anchor and tracked for cleanup.
404
+ * Returns a DocumentFragment (CSR) or the claimed comment (hydration),
405
+ * with a `dispose` property for lifecycle management.
394
406
  */
395
- declare function __child(fn: () => Node | string | number | boolean | null | undefined): HTMLElement & {
396
- dispose: DisposeFn;
397
- };
407
+ declare function __child(fn: () => Node | string | number | boolean | null | undefined): DisposableChild;
398
408
  /**
399
409
  * Insert a static (non-reactive) child value into a parent node.
400
410
  * This is used for static JSX expression children to avoid the performance
@@ -443,6 +453,11 @@ declare function __exitChildren(): void;
443
453
  * Bind an event handler to an element.
444
454
  * Returns a cleanup function to remove the listener.
445
455
  *
456
+ * Registers the cleanup with the current disposal scope (if any) so that
457
+ * event listeners are automatically removed when the owning component or
458
+ * dialog is unmounted. Without this, listeners on dynamically-mounted
459
+ * elements (e.g., forms inside useDialogStack dialogs) would leak.
460
+ *
446
461
  * Compiler output target for event bindings (onClick, onInput, etc.).
447
462
  */
448
463
  declare function __on(el: HTMLElement, event: string, handler: EventListener): () => void;
@@ -475,11 +490,64 @@ declare function clearChildren(container: Node): void;
475
490
  * @param items - A signal or getter function containing the array of items.
476
491
  * The compiler generates `() => signal.value` as a getter; the runtime
477
492
  * also accepts a raw Signal for direct use in tests.
478
- * @param keyFn - Extracts a unique key from each item (receives item and index)
493
+ * @param keyFn - Extracts a unique key from each item (receives item and index).
494
+ * Pass `null` for unkeyed lists — triggers full-replacement mode (safe but slower).
479
495
  * @param renderFn - Creates a DOM node for an item (called once per key)
480
496
  * @returns A dispose function to stop the reactive list reconciliation
481
497
  */
482
- declare function __list<T>(container: HTMLElement, items: Signal<T[]> | (() => T[]), keyFn: (item: T, index: number) => string | number, renderFn: (item: T) => Node): DisposeFn;
498
+ declare function __list<T>(container: HTMLElement, items: Signal<T[]> | (() => T[]), keyFn: ((item: T, index: number) => string | number) | null, renderFn: (item: T) => Node): DisposeFn;
499
+ /**
500
+ * Lifecycle hooks for list animation (enter/exit/reorder).
501
+ *
502
+ * Provided by `<List animate>` via ListAnimationContext.
503
+ * Consumed by `__listValue()` during reconciliation.
504
+ */
505
+ interface ListAnimationHooks {
506
+ /** Called before reconciliation starts. Use to snapshot element rects for FLIP. */
507
+ onBeforeReconcile: () => void;
508
+ /** Called after reconciliation finishes. Use to play FLIP animations. */
509
+ onAfterReconcile: () => void;
510
+ /** Called when a new item enters (after first render). */
511
+ onItemEnter: (node: Node, key: string | number) => void;
512
+ /** Called when an item exits. Must call `done()` when animation finishes so the node can be removed. */
513
+ onItemExit: (node: Node, key: string | number, done: () => void) => void;
514
+ }
515
+ /**
516
+ * Context for list animation hooks.
517
+ *
518
+ * When provided, `__listValue()` calls these hooks during reconciliation
519
+ * to enable enter/exit animations and FLIP reordering.
520
+ *
521
+ * When not provided, `__listValue()` behaves as a plain keyed list.
522
+ */
523
+ declare const ListAnimationContext: Context<ListAnimationHooks | undefined>;
524
+ /**
525
+ * Keyed list reconciliation that returns a DisposableNode (DocumentFragment).
526
+ *
527
+ * Unlike `__list()` which appends to an existing container element,
528
+ * `__listValue()` manages items between comment markers in a DocumentFragment.
529
+ * This makes it suitable for use in component children thunks where there is
530
+ * no parent element variable at compile time.
531
+ *
532
+ * Compiler output target for .map() expressions in component children JSX.
533
+ *
534
+ * @param items - A signal or getter function containing the array of items
535
+ * @param keyFn - Extracts a unique key from each item. Pass null for unkeyed mode.
536
+ * @param renderFn - Creates a DOM node for an item (called once per key)
537
+ * @returns A DisposableNode (DocumentFragment with dispose method)
538
+ */
539
+ declare function __listValue<T>(items: Signal<T[]> | (() => T[]), keyFn: ((item: T, index: number) => string | number) | null, renderFn: (item: T) => Node): DisposableNode;
540
+ /**
541
+ * Apply a spread props object to a DOM element.
542
+ *
543
+ * Compiler output target for JSX spread attributes on intrinsic elements:
544
+ * <button {...rest} /> → __spread(el, rest)
545
+ *
546
+ * Handles event handlers (on*), ref, style, class/className, htmlFor,
547
+ * SVG attribute normalization, and standard HTML attributes.
548
+ * Uses replace (not merge) semantics — last-wins, matching source order.
549
+ */
550
+ declare function __spread(el: Element, props: Record<string, unknown>): void;
483
551
  declare function styleObjectToString(style: Record<string, string | number | null | undefined>): string;
484
552
  /**
485
553
  * Returns true when running in a real browser environment.
@@ -625,7 +693,10 @@ interface RouteConfig<
625
693
  signal: AbortSignal;
626
694
  }) => Promise<TLoaderData> | TLoaderData;
627
695
  /** Optional error component rendered when loader throws. */
628
- errorComponent?: (error: Error) => Node;
696
+ errorComponent?: (props: {
697
+ error: Error;
698
+ retry: () => void;
699
+ }) => Node;
629
700
  /** Optional path params schema for validation/parsing. */
630
701
  params?: ParamSchema<TParams>;
631
702
  /** Optional search params schema for validation/coercion. */
@@ -653,7 +724,10 @@ interface CompiledRoute {
653
724
  params: Record<string, string>;
654
725
  signal: AbortSignal;
655
726
  }) => Promise<unknown> | unknown;
656
- errorComponent?: RouteConfig["errorComponent"];
727
+ errorComponent?: (props: {
728
+ error: Error;
729
+ retry: () => void;
730
+ }) => Node;
657
731
  /** Optional path params schema for validation/parsing. */
658
732
  params?: ParamSchema<unknown>;
659
733
  searchParams?: RouteConfig["searchParams"];
@@ -993,6 +1067,7 @@ declare class QueryEnvelopeStore {
993
1067
  private _envelopes;
994
1068
  get(queryKey: string): QueryEnvelope | undefined;
995
1069
  set(queryKey: string, envelope: QueryEnvelope): void;
1070
+ delete(queryKey: string): void;
996
1071
  clear(): void;
997
1072
  }
998
1073
  /** Entry registered by query() during SSR for renderToHTML() to await. */
@@ -1093,4 +1168,4 @@ declare function getSSRContext(): SSRRenderContext | undefined;
1093
1168
  * clears during HMR module re-evaluation.
1094
1169
  */
1095
1170
  declare function hasSSRResolver(): boolean;
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 };
1171
+ 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, __spread, __show, __pushMountFrame, __prop, __on, __listValue, __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, ListAnimationHooks, ListAnimationContext, 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 };