@vertz/ui 0.2.20 → 0.2.21
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.
- package/dist/shared/{chunk-4fwcwxn6.js → chunk-2qe6aqhb.js} +235 -1
- package/dist/shared/{chunk-mtsvrj9e.js → chunk-4cmt1ve8.js} +1 -1
- package/dist/shared/chunk-4xkw6h1s.js +73 -0
- package/dist/shared/{chunk-j5qtsm0b.js → chunk-67z8b0q8.js} +97 -21
- package/dist/shared/{chunk-fkbgbf3n.js → chunk-7g722pdh.js} +70 -12
- package/dist/shared/{chunk-6wd36w21.js → chunk-am9zaw4h.js} +3 -1
- package/dist/shared/{chunk-14eqne2a.js → chunk-bybgyjye.js} +1 -1
- package/dist/shared/{chunk-afawz764.js → chunk-c61572xp.js} +1 -1
- package/dist/shared/{chunk-07bh4m1e.js → chunk-kjwp5q5s.js} +10 -5
- package/dist/shared/chunk-mwc4v48d.js +36 -0
- package/dist/shared/{chunk-yjs76c7v.js → chunk-pdqr78k9.js} +1 -1
- package/dist/shared/{chunk-c3r237f0.js → chunk-pq8khh47.js} +32 -11
- package/dist/shared/{chunk-fs3eec4b.js → chunk-szk0hyjg.js} +3 -3
- package/dist/shared/chunk-vwz86vg9.js +208 -0
- package/dist/shared/{chunk-j09yyh34.js → chunk-yb4a0smw.js} +1 -1
- package/dist/src/auth/public.d.ts +30 -2
- package/dist/src/auth/public.js +95 -136
- package/dist/src/components/index.d.ts +70 -0
- package/dist/src/components/index.js +210 -0
- package/dist/src/css/public.d.ts +48 -14
- package/dist/src/css/public.js +4 -4
- package/dist/src/form/public.js +2 -2
- package/dist/src/index.d.ts +125 -20
- package/dist/src/index.js +44 -36
- package/dist/src/internals.d.ts +110 -62
- package/dist/src/internals.js +18 -14
- package/dist/src/jsx-runtime/index.d.ts +20 -0
- package/dist/src/jsx-runtime/index.js +13 -3
- package/dist/src/query/public.js +4 -4
- package/dist/src/router/public.d.ts +47 -1
- package/dist/src/router/public.js +10 -9
- package/dist/src/test/index.d.ts +33 -0
- package/dist/src/test/index.js +4 -4
- package/package.json +7 -3
- package/dist/shared/chunk-mgfrrrjq.js +0 -384
package/dist/src/css/public.d.ts
CHANGED
|
@@ -1,16 +1,44 @@
|
|
|
1
|
-
/**
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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}`;
|
|
4
|
+
type PseudoUtility = `${PseudoPrefix}:${Keyword}` | `${PseudoPrefix}:${PropertyName}:${string}`;
|
|
5
|
+
/**
|
|
6
|
+
* Union of all valid CSS utility class strings.
|
|
7
|
+
*
|
|
8
|
+
* Used by `css()` and `variants()` to validate string entries at compile time.
|
|
9
|
+
* Invalid utility class names produce TypeScript errors with autocomplete
|
|
10
|
+
* suggestions for valid alternatives.
|
|
11
|
+
*
|
|
12
|
+
* Properties that accept arbitrary CSS values (cursor, z, opacity, transition,
|
|
13
|
+
* etc.) use `${string}` for their value portion — these won't validate values
|
|
14
|
+
* but will still validate the property name prefix.
|
|
15
|
+
*/
|
|
16
|
+
type UtilityClass = BaseUtility | PseudoUtility;
|
|
17
|
+
/**
|
|
18
|
+
* A value within a nested selector array: utility class string or CSS declarations map.
|
|
19
|
+
*
|
|
20
|
+
* Use a utility string for design token shorthands: 'p:4', 'bg:primary'
|
|
21
|
+
* Use Record<string, string> for raw CSS: { 'flex-direction': 'row' }
|
|
22
|
+
*/
|
|
23
|
+
type StyleValue = UtilityClass | Record<string, string>;
|
|
24
|
+
/**
|
|
25
|
+
* A style entry: utility class string or nested selectors map.
|
|
26
|
+
*
|
|
27
|
+
* Nested selector values can be:
|
|
28
|
+
* - Array form: ['text:foreground', { 'background-color': 'red' }]
|
|
29
|
+
* - Direct object: { 'flex-direction': 'row', 'align-items': 'center' }
|
|
30
|
+
*/
|
|
31
|
+
type StyleEntry = UtilityClass | Record<string, StyleValue[] | Record<string, string>>;
|
|
10
32
|
/** Input to css(): a record of named style blocks. */
|
|
11
33
|
type CSSInput = Record<string, StyleEntry[]>;
|
|
12
|
-
/**
|
|
13
|
-
|
|
34
|
+
/**
|
|
35
|
+
* Output of css(): block names as top-level properties, plus non-enumerable `css`.
|
|
36
|
+
*
|
|
37
|
+
* The generic constraint uses `Record<string, unknown[]>` instead of `CSSInput`
|
|
38
|
+
* because CSSOutput only uses the keys of T (to map them to string class names).
|
|
39
|
+
* This allows theme component types to use `string[]` block values for simplicity.
|
|
40
|
+
*/
|
|
41
|
+
type CSSOutput<T extends Record<string, unknown[]> = CSSInput> = { readonly [K in keyof T & string] : string } & {
|
|
14
42
|
readonly css: string;
|
|
15
43
|
};
|
|
16
44
|
/**
|
|
@@ -227,8 +255,14 @@ interface ThemeProviderProps {
|
|
|
227
255
|
* walker can claim the existing SSR node during mount().
|
|
228
256
|
*/
|
|
229
257
|
declare function ThemeProvider({ theme, children }: ThemeProviderProps): HTMLElement;
|
|
230
|
-
/**
|
|
231
|
-
|
|
258
|
+
/**
|
|
259
|
+
* A record of variant names to their possible values (each value maps to style entries).
|
|
260
|
+
*
|
|
261
|
+
* Uses `unknown[]` for the style array type to allow both `StyleEntry[]` (constrained)
|
|
262
|
+
* and `string[]` (legacy theme component types). Only the keys (variant names and
|
|
263
|
+
* option names) are used for type inference; style values are handled at runtime.
|
|
264
|
+
*/
|
|
265
|
+
type VariantDefinitions = Record<string, Record<string, unknown[]>>;
|
|
232
266
|
/** Extract the variant props type from a variant definitions object. */
|
|
233
267
|
type VariantProps<V extends VariantDefinitions> = { [K in keyof V]? : keyof V[K] };
|
|
234
268
|
/** A compound variant rule: matches when all specified variant values are active. */
|
|
@@ -259,4 +293,4 @@ interface VariantFunction<V extends VariantDefinitions> {
|
|
|
259
293
|
* @returns A function that accepts variant props and returns a className string.
|
|
260
294
|
*/
|
|
261
295
|
declare function variants<V extends VariantDefinitions>(config: VariantsConfig<V>): VariantFunction<V>;
|
|
262
|
-
export { variants, s, globalCss, font, defineTheme, css, compileTheme, compileFonts, VariantsConfig, VariantProps, VariantFunction, ThemeProviderProps, ThemeProvider, ThemeInput, Theme, StyleEntry, PreloadItem, GlobalCSSOutput, GlobalCSSInput, FontSrc, FontOptions, FontFallbackMetrics, FontDescriptor, FallbackFontName, CompiledTheme, CompiledFonts, CompileThemeOptions, CompileFontsOptions, CSSOutput, CSSInput };
|
|
296
|
+
export { variants, s, globalCss, font, defineTheme, css, compileTheme, compileFonts, VariantsConfig, VariantProps, VariantFunction, UtilityClass, ThemeProviderProps, ThemeProvider, ThemeInput, Theme, StyleValue, StyleEntry, PreloadItem, GlobalCSSOutput, GlobalCSSInput, FontSrc, FontOptions, FontFallbackMetrics, FontDescriptor, FallbackFontName, CompiledTheme, CompiledFonts, CompileThemeOptions, CompileFontsOptions, CSSOutput, CSSInput };
|
package/dist/src/css/public.js
CHANGED
|
@@ -8,11 +8,11 @@ import {
|
|
|
8
8
|
globalCss,
|
|
9
9
|
s,
|
|
10
10
|
variants
|
|
11
|
-
} from "../../shared/chunk-
|
|
12
|
-
import"../../shared/chunk-
|
|
11
|
+
} from "../../shared/chunk-pq8khh47.js";
|
|
12
|
+
import"../../shared/chunk-vwz86vg9.js";
|
|
13
13
|
import"../../shared/chunk-prj7nm08.js";
|
|
14
|
-
import"../../shared/chunk-
|
|
15
|
-
import"../../shared/chunk-
|
|
14
|
+
import"../../shared/chunk-c61572xp.js";
|
|
15
|
+
import"../../shared/chunk-2qe6aqhb.js";
|
|
16
16
|
export {
|
|
17
17
|
variants,
|
|
18
18
|
s,
|
package/dist/src/form/public.js
CHANGED
package/dist/src/index.d.ts
CHANGED
|
@@ -223,19 +223,47 @@ declare const slideOutToLeft: string;
|
|
|
223
223
|
declare const slideOutToRight: string;
|
|
224
224
|
declare const accordionDown: string;
|
|
225
225
|
declare const accordionUp: string;
|
|
226
|
-
/**
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
226
|
+
/** 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}`;
|
|
229
|
+
type PseudoUtility = `${PseudoPrefix}:${Keyword}` | `${PseudoPrefix}:${PropertyName}:${string}`;
|
|
230
|
+
/**
|
|
231
|
+
* Union of all valid CSS utility class strings.
|
|
232
|
+
*
|
|
233
|
+
* Used by `css()` and `variants()` to validate string entries at compile time.
|
|
234
|
+
* Invalid utility class names produce TypeScript errors with autocomplete
|
|
235
|
+
* suggestions for valid alternatives.
|
|
236
|
+
*
|
|
237
|
+
* Properties that accept arbitrary CSS values (cursor, z, opacity, transition,
|
|
238
|
+
* etc.) use `${string}` for their value portion — these won't validate values
|
|
239
|
+
* but will still validate the property name prefix.
|
|
240
|
+
*/
|
|
241
|
+
type UtilityClass = BaseUtility | PseudoUtility;
|
|
242
|
+
/**
|
|
243
|
+
* A value within a nested selector array: utility class string or CSS declarations map.
|
|
244
|
+
*
|
|
245
|
+
* Use a utility string for design token shorthands: 'p:4', 'bg:primary'
|
|
246
|
+
* Use Record<string, string> for raw CSS: { 'flex-direction': 'row' }
|
|
247
|
+
*/
|
|
248
|
+
type StyleValue = UtilityClass | Record<string, string>;
|
|
249
|
+
/**
|
|
250
|
+
* A style entry: utility class string or nested selectors map.
|
|
251
|
+
*
|
|
252
|
+
* Nested selector values can be:
|
|
253
|
+
* - Array form: ['text:foreground', { 'background-color': 'red' }]
|
|
254
|
+
* - Direct object: { 'flex-direction': 'row', 'align-items': 'center' }
|
|
255
|
+
*/
|
|
256
|
+
type StyleEntry = UtilityClass | Record<string, StyleValue[] | Record<string, string>>;
|
|
235
257
|
/** Input to css(): a record of named style blocks. */
|
|
236
258
|
type CSSInput = Record<string, StyleEntry[]>;
|
|
237
|
-
/**
|
|
238
|
-
|
|
259
|
+
/**
|
|
260
|
+
* Output of css(): block names as top-level properties, plus non-enumerable `css`.
|
|
261
|
+
*
|
|
262
|
+
* The generic constraint uses `Record<string, unknown[]>` instead of `CSSInput`
|
|
263
|
+
* because CSSOutput only uses the keys of T (to map them to string class names).
|
|
264
|
+
* This allows theme component types to use `string[]` block values for simplicity.
|
|
265
|
+
*/
|
|
266
|
+
type CSSOutput<T extends Record<string, unknown[]> = CSSInput> = { readonly [K in keyof T & string] : string } & {
|
|
239
267
|
readonly css: string;
|
|
240
268
|
};
|
|
241
269
|
/**
|
|
@@ -514,8 +542,14 @@ interface ThemeProviderProps {
|
|
|
514
542
|
* walker can claim the existing SSR node during mount().
|
|
515
543
|
*/
|
|
516
544
|
declare function ThemeProvider({ theme, children }: ThemeProviderProps): HTMLElement;
|
|
517
|
-
/**
|
|
518
|
-
|
|
545
|
+
/**
|
|
546
|
+
* A record of variant names to their possible values (each value maps to style entries).
|
|
547
|
+
*
|
|
548
|
+
* Uses `unknown[]` for the style array type to allow both `StyleEntry[]` (constrained)
|
|
549
|
+
* and `string[]` (legacy theme component types). Only the keys (variant names and
|
|
550
|
+
* option names) are used for type inference; style values are handled at runtime.
|
|
551
|
+
*/
|
|
552
|
+
type VariantDefinitions = Record<string, Record<string, unknown[]>>;
|
|
519
553
|
/** Extract the variant props type from a variant definitions object. */
|
|
520
554
|
type VariantProps<V extends VariantDefinitions> = { [K in keyof V]? : keyof V[K] };
|
|
521
555
|
/** A compound variant rule: matches when all specified variant values are active. */
|
|
@@ -557,19 +591,22 @@ type DialogComponent<
|
|
|
557
591
|
> = (props: TProps & {
|
|
558
592
|
dialog: DialogHandle<TResult>;
|
|
559
593
|
}) => Node;
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
594
|
+
type DialogResult<T> = {
|
|
595
|
+
readonly ok: true;
|
|
596
|
+
readonly data: T;
|
|
597
|
+
} | {
|
|
598
|
+
readonly ok: false;
|
|
599
|
+
};
|
|
563
600
|
interface DialogStack {
|
|
564
601
|
open<
|
|
565
602
|
TResult,
|
|
566
603
|
TProps
|
|
567
|
-
>(component: DialogComponent<TResult, TProps>, props: TProps): Promise<TResult
|
|
604
|
+
>(component: DialogComponent<TResult, TProps>, props: TProps): Promise<DialogResult<TResult>>;
|
|
568
605
|
/** @internal — used by useDialogStack() to pass captured context scope */
|
|
569
606
|
openWithScope<
|
|
570
607
|
TResult,
|
|
571
608
|
TProps
|
|
572
|
-
>(component: DialogComponent<TResult, TProps>, props: TProps, scope: ContextScope | null): Promise<TResult
|
|
609
|
+
>(component: DialogComponent<TResult, TProps>, props: TProps, scope: ContextScope | null): Promise<DialogResult<TResult>>;
|
|
573
610
|
readonly size: number;
|
|
574
611
|
closeAll(): void;
|
|
575
612
|
}
|
|
@@ -888,6 +925,8 @@ interface ImageProps {
|
|
|
888
925
|
width: number;
|
|
889
926
|
height: number;
|
|
890
927
|
alt: string;
|
|
928
|
+
className?: string;
|
|
929
|
+
/** @deprecated Use `className` instead. */
|
|
891
930
|
class?: string;
|
|
892
931
|
pictureClass?: string;
|
|
893
932
|
style?: string;
|
|
@@ -1123,6 +1162,24 @@ type RoutePattern<TRouteMap extends Record<string, unknown>> = keyof TRouteMap &
|
|
|
1123
1162
|
* ```
|
|
1124
1163
|
*/
|
|
1125
1164
|
type RoutePaths<TRouteMap extends Record<string, unknown>> = { [K in RoutePattern<TRouteMap>] : PathWithParams<K> }[RoutePattern<TRouteMap>];
|
|
1165
|
+
/**
|
|
1166
|
+
* View Transitions API integration.
|
|
1167
|
+
*
|
|
1168
|
+
* Provides a utility to wrap DOM updates in browser view transitions,
|
|
1169
|
+
* with graceful degradation for unsupported browsers, reduced motion
|
|
1170
|
+
* preferences, and SSR environments.
|
|
1171
|
+
*/
|
|
1172
|
+
/** View transition configuration. */
|
|
1173
|
+
interface ViewTransitionConfig {
|
|
1174
|
+
/**
|
|
1175
|
+
* CSS class name added to `<html>` during the transition,
|
|
1176
|
+
* enabling per-transition CSS animation rules via
|
|
1177
|
+
* `.className::view-transition-old(root)` etc.
|
|
1178
|
+
*
|
|
1179
|
+
* Omit for the default cross-fade.
|
|
1180
|
+
*/
|
|
1181
|
+
className?: string;
|
|
1182
|
+
}
|
|
1126
1183
|
/** Schema interface for parsing and validating values (search params, path params). */
|
|
1127
1184
|
interface SearchParamSchema<T> {
|
|
1128
1185
|
parse(data: unknown): {
|
|
@@ -1161,6 +1218,10 @@ interface RouteConfig<
|
|
|
1161
1218
|
children?: RouteDefinitionMap;
|
|
1162
1219
|
/** Whether to pre-render this route at build time (default: true for static routes). */
|
|
1163
1220
|
prerender?: boolean;
|
|
1221
|
+
/** Generate param combinations for pre-rendering dynamic routes at build time. */
|
|
1222
|
+
generateParams?: () => Array<Record<string, string>> | Promise<Array<Record<string, string>>>;
|
|
1223
|
+
/** Per-route view transition config. Overrides global RouterOptions.viewTransition. */
|
|
1224
|
+
viewTransition?: boolean | ViewTransitionConfig;
|
|
1164
1225
|
}
|
|
1165
1226
|
/** A map of path patterns to route configs (user input format). */
|
|
1166
1227
|
interface RouteDefinitionMap {
|
|
@@ -1191,6 +1252,8 @@ interface RouteConfigLike {
|
|
|
1191
1252
|
searchParams?: SearchParamSchema<unknown>;
|
|
1192
1253
|
children?: Record<string, RouteConfigLike>;
|
|
1193
1254
|
prerender?: boolean;
|
|
1255
|
+
generateParams?: () => Array<Record<string, string>> | Promise<Array<Record<string, string>>>;
|
|
1256
|
+
viewTransition?: boolean | ViewTransitionConfig;
|
|
1194
1257
|
}
|
|
1195
1258
|
/**
|
|
1196
1259
|
* Phantom branded array that carries the route map type `T`.
|
|
@@ -1226,6 +1289,10 @@ interface CompiledRoute {
|
|
|
1226
1289
|
children?: CompiledRoute[];
|
|
1227
1290
|
/** Whether to pre-render this route at build time (default: true for static routes). */
|
|
1228
1291
|
prerender?: boolean;
|
|
1292
|
+
/** Generate param combinations for pre-rendering dynamic routes at build time. */
|
|
1293
|
+
generateParams?: () => Array<Record<string, string>> | Promise<Array<Record<string, string>>>;
|
|
1294
|
+
/** Per-route view transition config. */
|
|
1295
|
+
viewTransition?: boolean | ViewTransitionConfig;
|
|
1229
1296
|
}
|
|
1230
1297
|
/** A single matched route entry in the matched chain. */
|
|
1231
1298
|
interface MatchedRoute {
|
|
@@ -1276,6 +1343,11 @@ interface LinkProps<T extends Record<string, RouteConfigLike> = RouteDefinitionM
|
|
|
1276
1343
|
activeClass?: string;
|
|
1277
1344
|
/** Static class name for the anchor element. */
|
|
1278
1345
|
className?: string;
|
|
1346
|
+
/**
|
|
1347
|
+
* Static class for the anchor element.
|
|
1348
|
+
* @deprecated Use `className` instead.
|
|
1349
|
+
*/
|
|
1350
|
+
class?: string;
|
|
1279
1351
|
/** Prefetch strategy. 'hover' triggers server pre-fetch on mouseenter/focus. */
|
|
1280
1352
|
prefetch?: "hover";
|
|
1281
1353
|
}
|
|
@@ -1298,7 +1370,7 @@ declare function createLink(currentPath: ReadonlySignal<string>, navigate: (url:
|
|
|
1298
1370
|
* Reads the router from `RouterContext` automatically — no manual wiring needed.
|
|
1299
1371
|
* Just use `<Link href="/about">About</Link>` inside a router-provided tree.
|
|
1300
1372
|
*/
|
|
1301
|
-
declare function Link({ href, children, activeClass, className }: LinkProps): HTMLAnchorElement;
|
|
1373
|
+
declare function Link({ href, children, activeClass, class: classProp, className }: LinkProps): HTMLAnchorElement;
|
|
1302
1374
|
type NavigateSearchValue = string | number | boolean | null | undefined;
|
|
1303
1375
|
type NavigateSearch = string | URLSearchParams | Record<string, NavigateSearchValue | readonly NavigateSearchValue[]>;
|
|
1304
1376
|
/** Options for router.navigate(). */
|
|
@@ -1309,6 +1381,11 @@ interface NavigateOptions {
|
|
|
1309
1381
|
params?: Record<string, string>;
|
|
1310
1382
|
/** Search params appended to the final URL. */
|
|
1311
1383
|
search?: NavigateSearch;
|
|
1384
|
+
/**
|
|
1385
|
+
* Override view transition for this navigation only.
|
|
1386
|
+
* `false` explicitly disables even if route/global config enables transitions.
|
|
1387
|
+
*/
|
|
1388
|
+
viewTransition?: boolean | ViewTransitionConfig;
|
|
1312
1389
|
}
|
|
1313
1390
|
type NavigateOptionsFor<TPath extends string> = string extends TPath ? NavigateOptions : TPath extends `${string}:${string}` | `${string}*` ? Omit<NavigateOptions, "params"> & {
|
|
1314
1391
|
params: ExtractParams<TPath>;
|
|
@@ -1336,6 +1413,14 @@ interface RouterOptions {
|
|
|
1336
1413
|
_prefetchNavData?: (url: string, options?: {
|
|
1337
1414
|
timeout?: number;
|
|
1338
1415
|
}) => PrefetchHandle;
|
|
1416
|
+
/**
|
|
1417
|
+
* Global view transition setting.
|
|
1418
|
+
* - `true` → all navigations use the default cross-fade
|
|
1419
|
+
* - `ViewTransitionConfig` → all navigations use the config
|
|
1420
|
+
* - Per-route and per-navigation overrides take precedence
|
|
1421
|
+
* - Default: `undefined` (no transitions)
|
|
1422
|
+
*/
|
|
1423
|
+
viewTransition?: boolean | ViewTransitionConfig;
|
|
1339
1424
|
}
|
|
1340
1425
|
/**
|
|
1341
1426
|
* The router instance returned by createRouter.
|
|
@@ -1446,6 +1531,26 @@ declare function parseSearchParams<T = Record<string, string>>(urlParams: URLSea
|
|
|
1446
1531
|
* @returns The current search params value
|
|
1447
1532
|
*/
|
|
1448
1533
|
declare function useSearchParams<T>(searchSignal: ReadonlySignal<T>): T;
|
|
1534
|
+
/** Input type for registerTheme(). Compatible with configureTheme() output. */
|
|
1535
|
+
interface RegisterThemeInput {
|
|
1536
|
+
components: {
|
|
1537
|
+
primitives?: object;
|
|
1538
|
+
};
|
|
1539
|
+
}
|
|
1540
|
+
/**
|
|
1541
|
+
* Register a theme for use with `@vertz/ui/components`.
|
|
1542
|
+
*
|
|
1543
|
+
* Call once at app startup, before any component from `@vertz/ui/components` is used.
|
|
1544
|
+
* Calling again replaces the previously registered theme.
|
|
1545
|
+
*
|
|
1546
|
+
* @example
|
|
1547
|
+
* ```ts
|
|
1548
|
+
* import { registerTheme } from '@vertz/ui';
|
|
1549
|
+
* import { configureTheme } from '@vertz/theme-shadcn';
|
|
1550
|
+
* registerTheme(configureTheme({ palette: 'zinc', radius: 'md' }));
|
|
1551
|
+
* ```
|
|
1552
|
+
*/
|
|
1553
|
+
declare function registerTheme(resolved: RegisterThemeInput): void;
|
|
1449
1554
|
/**
|
|
1450
1555
|
* Error thrown when `onCleanup()` is called outside a disposal scope.
|
|
1451
1556
|
* Similar to React's invalid hook call error — fail-fast so developers
|
|
@@ -1798,4 +1903,4 @@ declare function resetRelationSchemas_TEST_ONLY(): void;
|
|
|
1798
1903
|
* ```
|
|
1799
1904
|
*/
|
|
1800
1905
|
declare function createTestStore(data: Record<string, Record<string, unknown>>): EntityStore;
|
|
1801
|
-
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, registerRelationSchema, ref, queryMatch, query, parseSearchParams, palettes, onMount2 as onMount, 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, Ref, ReadonlySignal,
|
|
1906
|
+
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, 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 };
|
package/dist/src/index.js
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import {
|
|
2
|
+
registerTheme
|
|
3
|
+
} from "../shared/chunk-mwc4v48d.js";
|
|
1
4
|
import {
|
|
2
5
|
ANIMATION_DURATION,
|
|
3
6
|
ANIMATION_EASING,
|
|
@@ -21,7 +24,7 @@ import {
|
|
|
21
24
|
slideOutToTop,
|
|
22
25
|
zoomIn,
|
|
23
26
|
zoomOut
|
|
24
|
-
} from "../shared/chunk-
|
|
27
|
+
} from "../shared/chunk-pdqr78k9.js";
|
|
25
28
|
import {
|
|
26
29
|
Link,
|
|
27
30
|
Outlet,
|
|
@@ -30,20 +33,21 @@ import {
|
|
|
30
33
|
createLink,
|
|
31
34
|
parseSearchParams,
|
|
32
35
|
useSearchParams
|
|
33
|
-
} from "../shared/chunk-
|
|
34
|
-
import"../shared/chunk-
|
|
36
|
+
} from "../shared/chunk-67z8b0q8.js";
|
|
37
|
+
import"../shared/chunk-kjwp5q5s.js";
|
|
38
|
+
import"../shared/chunk-4xkw6h1s.js";
|
|
35
39
|
import {
|
|
36
40
|
createRouter
|
|
37
|
-
} from "../shared/chunk-
|
|
41
|
+
} from "../shared/chunk-7g722pdh.js";
|
|
38
42
|
import {
|
|
39
43
|
defineRoutes
|
|
40
|
-
} from "../shared/chunk-
|
|
44
|
+
} from "../shared/chunk-am9zaw4h.js";
|
|
41
45
|
import {
|
|
42
46
|
createFieldState,
|
|
43
47
|
form,
|
|
44
48
|
formDataToObject,
|
|
45
49
|
validate
|
|
46
|
-
} from "../shared/chunk-
|
|
50
|
+
} from "../shared/chunk-yb4a0smw.js";
|
|
47
51
|
import {
|
|
48
52
|
EntityStore,
|
|
49
53
|
FieldSelectionTracker,
|
|
@@ -57,7 +61,7 @@ import {
|
|
|
57
61
|
queryMatch,
|
|
58
62
|
registerRelationSchema,
|
|
59
63
|
resetRelationSchemas_TEST_ONLY
|
|
60
|
-
} from "../shared/chunk-
|
|
64
|
+
} from "../shared/chunk-szk0hyjg.js";
|
|
61
65
|
import"../shared/chunk-jrtrk5z4.js";
|
|
62
66
|
import {
|
|
63
67
|
ThemeProvider,
|
|
@@ -74,20 +78,14 @@ import {
|
|
|
74
78
|
resolveChildren,
|
|
75
79
|
s,
|
|
76
80
|
variants
|
|
77
|
-
} from "../shared/chunk-
|
|
81
|
+
} from "../shared/chunk-pq8khh47.js";
|
|
78
82
|
import {
|
|
79
83
|
__append,
|
|
80
84
|
__element,
|
|
81
85
|
__enterChildren,
|
|
82
86
|
__exitChildren,
|
|
83
|
-
__staticText
|
|
84
|
-
|
|
85
|
-
endHydration,
|
|
86
|
-
enterChildren,
|
|
87
|
-
exitChildren,
|
|
88
|
-
getIsHydrating,
|
|
89
|
-
startHydration
|
|
90
|
-
} from "../shared/chunk-mgfrrrjq.js";
|
|
87
|
+
__staticText
|
|
88
|
+
} from "../shared/chunk-vwz86vg9.js";
|
|
91
89
|
import"../shared/chunk-prj7nm08.js";
|
|
92
90
|
import {
|
|
93
91
|
RENDER_NODE_BRAND,
|
|
@@ -95,32 +93,39 @@ import {
|
|
|
95
93
|
getAdapter,
|
|
96
94
|
isRenderNode,
|
|
97
95
|
setAdapter
|
|
98
|
-
} from "../shared/chunk-
|
|
96
|
+
} from "../shared/chunk-c61572xp.js";
|
|
99
97
|
import {
|
|
100
98
|
RouterContext,
|
|
101
99
|
useParams,
|
|
102
100
|
useRouter
|
|
103
|
-
} from "../shared/chunk-
|
|
101
|
+
} from "../shared/chunk-4cmt1ve8.js";
|
|
104
102
|
import {
|
|
105
103
|
isBrowser
|
|
106
|
-
} from "../shared/chunk-
|
|
104
|
+
} from "../shared/chunk-bybgyjye.js";
|
|
107
105
|
import {
|
|
108
106
|
DisposalScopeError,
|
|
109
107
|
_tryOnCleanup,
|
|
110
108
|
batch,
|
|
109
|
+
claimElement,
|
|
111
110
|
computed,
|
|
112
111
|
createContext,
|
|
112
|
+
discardDeferredEffects,
|
|
113
113
|
domEffect,
|
|
114
|
+
endHydration,
|
|
115
|
+
enterChildren,
|
|
116
|
+
exitChildren,
|
|
114
117
|
getContextScope,
|
|
118
|
+
getIsHydrating,
|
|
115
119
|
getSSRContext,
|
|
116
120
|
popScope,
|
|
117
121
|
pushScope,
|
|
118
122
|
runCleanups,
|
|
119
123
|
setContextScope,
|
|
120
124
|
signal,
|
|
125
|
+
startHydration,
|
|
121
126
|
untrack,
|
|
122
127
|
useContext
|
|
123
|
-
} from "../shared/chunk-
|
|
128
|
+
} from "../shared/chunk-2qe6aqhb.js";
|
|
124
129
|
// src/component/error-boundary-context.ts
|
|
125
130
|
var handlerStack = [];
|
|
126
131
|
function pushErrorHandler(handler) {
|
|
@@ -516,18 +521,11 @@ function useDialogStack() {
|
|
|
516
521
|
}
|
|
517
522
|
};
|
|
518
523
|
}
|
|
519
|
-
|
|
520
|
-
class DialogDismissedError extends Error {
|
|
521
|
-
constructor() {
|
|
522
|
-
super("Dialog was dismissed");
|
|
523
|
-
this.name = "DialogDismissedError";
|
|
524
|
-
}
|
|
525
|
-
}
|
|
526
524
|
function createDialogStack(container) {
|
|
527
525
|
const entries = [];
|
|
528
526
|
let nextId = 0;
|
|
529
527
|
function open(component, props, capturedScope) {
|
|
530
|
-
return new Promise((resolve
|
|
528
|
+
return new Promise((resolve) => {
|
|
531
529
|
if (entries.length > 0) {
|
|
532
530
|
entries[entries.length - 1].wrapper.setAttribute("data-state", "background");
|
|
533
531
|
}
|
|
@@ -540,9 +538,9 @@ function createDialogStack(container) {
|
|
|
540
538
|
wrapper,
|
|
541
539
|
node: null,
|
|
542
540
|
resolve,
|
|
543
|
-
reject,
|
|
544
541
|
cleanups: [],
|
|
545
|
-
dismissible: true
|
|
542
|
+
dismissible: true,
|
|
543
|
+
settled: false
|
|
546
544
|
};
|
|
547
545
|
const prevScope = setContextScope(capturedScope ?? null);
|
|
548
546
|
const scope = pushScope();
|
|
@@ -571,9 +569,12 @@ function createDialogStack(container) {
|
|
|
571
569
|
});
|
|
572
570
|
}
|
|
573
571
|
function closeEntry(entry, result) {
|
|
572
|
+
if (entry.settled)
|
|
573
|
+
return;
|
|
574
574
|
const idx = entries.indexOf(entry);
|
|
575
575
|
if (idx === -1)
|
|
576
576
|
return;
|
|
577
|
+
entry.settled = true;
|
|
577
578
|
entry.wrapper.setAttribute("data-state", "closed");
|
|
578
579
|
onAnimationsComplete(entry.wrapper, () => {
|
|
579
580
|
runCleanups(entry.cleanups);
|
|
@@ -588,7 +589,7 @@ function createDialogStack(container) {
|
|
|
588
589
|
entries[entries.length - 1].wrapper.setAttribute("data-state", "open");
|
|
589
590
|
}
|
|
590
591
|
updateDepthAttributes();
|
|
591
|
-
entry.resolve(result);
|
|
592
|
+
entry.resolve({ ok: true, data: result });
|
|
592
593
|
});
|
|
593
594
|
}
|
|
594
595
|
function updateDepthAttributes() {
|
|
@@ -613,9 +614,12 @@ function createDialogStack(container) {
|
|
|
613
614
|
}
|
|
614
615
|
};
|
|
615
616
|
function dismissEntry(entry) {
|
|
617
|
+
if (entry.settled)
|
|
618
|
+
return;
|
|
616
619
|
const idx = entries.indexOf(entry);
|
|
617
620
|
if (idx === -1)
|
|
618
621
|
return;
|
|
622
|
+
entry.settled = true;
|
|
619
623
|
entry.wrapper.setAttribute("data-state", "closed");
|
|
620
624
|
onAnimationsComplete(entry.wrapper, () => {
|
|
621
625
|
runCleanups(entry.cleanups);
|
|
@@ -630,7 +634,7 @@ function createDialogStack(container) {
|
|
|
630
634
|
entries[entries.length - 1].wrapper.setAttribute("data-state", "open");
|
|
631
635
|
}
|
|
632
636
|
updateDepthAttributes();
|
|
633
|
-
entry.
|
|
637
|
+
entry.resolve({ ok: false });
|
|
634
638
|
});
|
|
635
639
|
}
|
|
636
640
|
}
|
|
@@ -662,6 +666,7 @@ var BUILD_ONLY_PROPS = new Set([
|
|
|
662
666
|
"width",
|
|
663
667
|
"height",
|
|
664
668
|
"alt",
|
|
669
|
+
"className",
|
|
665
670
|
"class",
|
|
666
671
|
"style",
|
|
667
672
|
"loading",
|
|
@@ -677,7 +682,8 @@ function Image({
|
|
|
677
682
|
width,
|
|
678
683
|
height,
|
|
679
684
|
alt,
|
|
680
|
-
|
|
685
|
+
className,
|
|
686
|
+
class: classProp,
|
|
681
687
|
style,
|
|
682
688
|
loading = "lazy",
|
|
683
689
|
decoding = "async",
|
|
@@ -702,10 +708,11 @@ function Image({
|
|
|
702
708
|
el.setAttribute("alt", alt);
|
|
703
709
|
el.setAttribute("loading", resolvedLoading);
|
|
704
710
|
el.setAttribute("decoding", resolvedDecoding);
|
|
711
|
+
const effectiveClass = className ?? classProp;
|
|
705
712
|
if (resolvedFetchpriority)
|
|
706
713
|
el.setAttribute("fetchpriority", resolvedFetchpriority);
|
|
707
|
-
if (
|
|
708
|
-
el.setAttribute("class",
|
|
714
|
+
if (effectiveClass)
|
|
715
|
+
el.setAttribute("class", effectiveClass);
|
|
709
716
|
if (style)
|
|
710
717
|
el.setAttribute("style", style);
|
|
711
718
|
for (const [key, value] of Object.entries(rest)) {
|
|
@@ -798,6 +805,7 @@ function mount(app, options) {
|
|
|
798
805
|
mountedRoots.set(root, handle2);
|
|
799
806
|
return handle2;
|
|
800
807
|
} catch (e) {
|
|
808
|
+
discardDeferredEffects();
|
|
801
809
|
endHydration();
|
|
802
810
|
popScope();
|
|
803
811
|
runCleanups(scope2);
|
|
@@ -891,6 +899,7 @@ export {
|
|
|
891
899
|
resolveChildren,
|
|
892
900
|
resetRelationSchemas_TEST_ONLY,
|
|
893
901
|
resetInjectedStyles,
|
|
902
|
+
registerTheme,
|
|
894
903
|
registerRelationSchema,
|
|
895
904
|
ref,
|
|
896
905
|
queryMatch,
|
|
@@ -961,7 +970,6 @@ export {
|
|
|
961
970
|
EntityStore,
|
|
962
971
|
DisposalScopeError,
|
|
963
972
|
DialogStackContext,
|
|
964
|
-
DialogDismissedError,
|
|
965
973
|
ANIMATION_EASING,
|
|
966
974
|
ANIMATION_DURATION
|
|
967
975
|
};
|