@epoch32/visage 1.0.0 → 1.1.1
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/api/client.d.ts +5 -0
- package/dist/api/file-router.d.ts +29 -0
- package/dist/api/handler.d.ts +15 -0
- package/dist/api/index.d.ts +12 -0
- package/dist/{src/api → api}/index.js +87 -2
- package/dist/api/middleware.d.ts +11 -0
- package/dist/api/pragma.d.ts +21 -0
- package/dist/api/procedure.d.ts +66 -0
- package/dist/api/types.d.ts +181 -0
- package/dist/charts/Area.d.ts +18 -0
- package/dist/charts/Axis.d.ts +21 -0
- package/dist/charts/Bar.d.ts +10 -0
- package/dist/charts/CartesianGrid.d.ts +10 -0
- package/dist/charts/Chart.d.ts +16 -0
- package/dist/charts/Cursor.d.ts +8 -0
- package/dist/charts/Legend.d.ts +9 -0
- package/dist/charts/Line.d.ts +18 -0
- package/dist/charts/Pie.d.ts +12 -0
- package/dist/charts/Tooltip.d.ts +12 -0
- package/dist/charts/context.d.ts +20 -0
- package/dist/charts/index.d.ts +14 -0
- package/dist/{src/charts → charts}/index.js +87 -2
- package/dist/charts/path.d.ts +27 -0
- package/dist/charts/scale.d.ts +23 -0
- package/dist/charts/types.d.ts +43 -0
- package/dist/devtools/DomTab.d.ts +6 -0
- package/dist/devtools/GraphInspector.d.ts +11 -0
- package/dist/devtools/GraphTab.d.ts +10 -0
- package/dist/devtools/QueryTab.d.ts +10 -0
- package/dist/devtools/RpcTab.d.ts +10 -0
- package/dist/devtools/SignalsTab.d.ts +10 -0
- package/dist/devtools/component.d.ts +2 -0
- package/dist/devtools/highlighter.d.ts +2 -0
- package/dist/devtools/hub.d.ts +41 -0
- package/dist/devtools/index.d.ts +9 -0
- package/dist/{src/devtools → devtools}/index.js +87 -2
- package/dist/devtools/styles.d.ts +1 -0
- package/dist/devtools/types.d.ts +44 -0
- package/dist/dom/async.d.ts +41 -0
- package/dist/dom/control-flow.d.ts +53 -0
- package/dist/dom/index.d.ts +3 -0
- package/dist/{src/dom → dom}/index.js +87 -2
- package/dist/dom/lazy.d.ts +30 -0
- package/dist/dom/render.d.ts +23 -0
- package/dist/dom/resource.d.ts +34 -0
- package/dist/form/form.d.ts +41 -0
- package/dist/form/index.d.ts +2 -0
- package/dist/{src/form → form}/index.js +87 -2
- package/dist/form/schema.d.ts +96 -0
- package/dist/index.d.ts +15 -0
- package/dist/{src/index.js → index.js} +87 -2
- package/dist/jsx-dev-runtime/index.d.ts +1 -0
- package/dist/jsx-runtime/index.d.ts +8 -0
- package/dist/{src/jsx-runtime → jsx-runtime}/index.js +87 -2
- package/dist/jsx-runtime/jsx.d.ts +278 -0
- package/dist/query/create-mutation.d.ts +3 -0
- package/dist/query/create-query.d.ts +4 -0
- package/dist/query/focus-manager.d.ts +14 -0
- package/dist/query/index.d.ts +9 -0
- package/dist/{src/query → query}/index.js +87 -2
- package/dist/query/mutation-cache.d.ts +24 -0
- package/dist/query/online-manager.d.ts +14 -0
- package/dist/query/query-cache.d.ts +69 -0
- package/dist/query/query-client.d.ts +46 -0
- package/dist/query/types.d.ts +131 -0
- package/dist/query/utils.d.ts +16 -0
- package/dist/router/index.d.ts +1 -0
- package/dist/{src/router → router}/index.js +87 -2
- package/dist/router/router.d.ts +91 -0
- package/dist/rpc/client.d.ts +2 -0
- package/dist/rpc/error.d.ts +16 -0
- package/dist/rpc/index.d.ts +7 -0
- package/dist/{src/rpc → rpc}/index.js +87 -2
- package/dist/rpc/procedure.d.ts +8 -0
- package/dist/rpc/router.d.ts +19 -0
- package/dist/rpc/server.d.ts +3 -0
- package/dist/rpc/types.d.ts +200 -0
- package/dist/server/hydrate.d.ts +5 -0
- package/dist/server/index.d.ts +3 -0
- package/dist/{src/server → server}/index.js +87 -2
- package/dist/server/render-to-stream.d.ts +9 -0
- package/dist/server/render-to-string.d.ts +6 -0
- package/dist/signals/computed.d.ts +61 -0
- package/dist/signals/context.d.ts +44 -0
- package/dist/signals/effect.d.ts +56 -0
- package/dist/signals/index.d.ts +8 -0
- package/dist/{src/signals → signals}/index.js +87 -2
- package/dist/signals/scope.d.ts +61 -0
- package/dist/signals/signal.d.ts +40 -0
- package/dist/signals/store.d.ts +45 -0
- package/dist/signals/system.d.ts +56 -0
- package/dist/signals/types.d.ts +58 -0
- package/dist/style/component.d.ts +49 -0
- package/dist/style/create-style.d.ts +63 -0
- package/dist/style/cx.d.ts +18 -0
- package/dist/style/hash.d.ts +8 -0
- package/dist/style/index.d.ts +8 -0
- package/dist/{src/style → style}/index.js +87 -2
- package/dist/style/layout.d.ts +129 -0
- package/dist/style/manager.d.ts +31 -0
- package/dist/style/parser.d.ts +12 -0
- package/dist/style/scale.d.ts +82 -0
- package/dist/template/index.d.ts +1 -0
- package/dist/{src/template → template}/index.js +87 -2
- package/dist/template/template.d.ts +8 -0
- package/dist/ui/accordion.d.ts +81 -0
- package/dist/ui/command-dialog.d.ts +10 -0
- package/dist/ui/command.d.ts +103 -0
- package/dist/ui/data-table.d.ts +38 -0
- package/dist/ui/dialog.d.ts +102 -0
- package/dist/ui/dropdown-menu.d.ts +92 -0
- package/dist/ui/icon.d.ts +18 -0
- package/dist/ui/index.d.ts +14 -0
- package/dist/{src/ui → ui}/index.js +87 -2
- package/dist/ui/layout.d.ts +1 -0
- package/dist/ui/popover.d.ts +68 -0
- package/dist/ui/switch.d.ts +31 -0
- package/dist/ui/tabs.d.ts +71 -0
- package/dist/ui/toast.d.ts +91 -0
- package/dist/ui/tooltip.d.ts +64 -0
- package/dist/ui/utils.d.ts +21 -0
- package/dist/virtual/index.d.ts +2 -0
- package/dist/{src/virtual → virtual}/index.js +87 -2
- package/dist/virtual/virtual-list.d.ts +21 -0
- package/dist/virtual/virtualizer.d.ts +31 -0
- package/dist/vite/hmr.d.ts +7 -0
- package/dist/vite/index.d.ts +3 -0
- package/dist/{src/vite → vite}/index.js +4 -0
- package/dist/vite/lucide.d.ts +27 -0
- package/dist/vite/plugin.d.ts +3 -0
- package/dist/vite/rpc-middleware.d.ts +5 -0
- package/dist/vite/types.d.ts +59 -0
- package/package.json +40 -40
- package/src/signals/index.ts +1 -0
- package/src/signals/signal.ts +110 -2
- package/src/signals/types.ts +9 -0
- package/src/vite/plugin.ts +4 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface ScopeOptions {
|
|
2
|
+
scopeId: string;
|
|
3
|
+
passToChildren?: boolean;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Scope a single CSS selector string with the given scope identifier
|
|
7
|
+
*/
|
|
8
|
+
export declare function scopeSelector(selector: string, options: ScopeOptions): string;
|
|
9
|
+
/**
|
|
10
|
+
* Full CSS block scoping transformer
|
|
11
|
+
*/
|
|
12
|
+
export declare function scopeCSS(css: string, options: ScopeOptions): string;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Visage Spatial Engine & Style Primitives
|
|
3
|
+
*
|
|
4
|
+
* Eliminates measurement fatigue, layout bugs, and manual viewport calculations.
|
|
5
|
+
* Standardizes on a crisp 4px spatial scale, semantic viewport intents,
|
|
6
|
+
* fluid clamp calculations, and typed visual design tokens.
|
|
7
|
+
*/
|
|
8
|
+
export declare const UNITLESS_PROPERTIES: Set<string>;
|
|
9
|
+
export declare const DIMENSION_KEYWORDS: Record<string, string>;
|
|
10
|
+
/**
|
|
11
|
+
* Resolves a spatial scale step or dimensional intent to a valid CSS measurement.
|
|
12
|
+
* Numbers map to the 4px engineering grid (1 = 4px, 2 = 8px, 4 = 16px, 8 = 32px).
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* space(1) // "4px"
|
|
16
|
+
* space(2) // "8px"
|
|
17
|
+
* space(4) // "16px"
|
|
18
|
+
* space(6) // "24px"
|
|
19
|
+
* space("full") // "100%"
|
|
20
|
+
* space("screen") // "100dvh"
|
|
21
|
+
*/
|
|
22
|
+
export declare function space(val: number | string | undefined | null): string;
|
|
23
|
+
/**
|
|
24
|
+
* Resolves width, height, or grid sizing into valid CSS.
|
|
25
|
+
* Small numbers (<= 48) map to the 4px scale, while larger numbers (> 48)
|
|
26
|
+
* are treated as explicit pixel dimensions.
|
|
27
|
+
*/
|
|
28
|
+
export declare function resolveDimension(val: number | string | undefined | null): string;
|
|
29
|
+
/**
|
|
30
|
+
* Explicit raw pixel measurement helper.
|
|
31
|
+
*/
|
|
32
|
+
export declare function px(val: number): string;
|
|
33
|
+
/**
|
|
34
|
+
* Explicit rem measurement helper.
|
|
35
|
+
*/
|
|
36
|
+
export declare function rem(val: number): string;
|
|
37
|
+
/**
|
|
38
|
+
* Explicit em measurement helper.
|
|
39
|
+
*/
|
|
40
|
+
export declare function em(val: number): string;
|
|
41
|
+
/**
|
|
42
|
+
* Computes an optimal fluid clamp() expression.
|
|
43
|
+
* Eliminates the math nightmare of manual linear viewport interpolation slopes.
|
|
44
|
+
*
|
|
45
|
+
* @param minPx Minimum size in pixels at mobile viewport
|
|
46
|
+
* @param maxPx Maximum size in pixels at desktop viewport
|
|
47
|
+
* @param options Min/max viewport bounds (defaults to 375px mobile and 1280px desktop)
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* fluid(16, 32)
|
|
51
|
+
* // clamp(16px, 9.38px + 1.77vw, 32px)
|
|
52
|
+
*/
|
|
53
|
+
export declare function fluid(minPx: number, maxPx: number, options?: {
|
|
54
|
+
minVw?: number;
|
|
55
|
+
maxVw?: number;
|
|
56
|
+
}): string;
|
|
57
|
+
export type ShadowVariant = "none" | "sm" | "md" | "lg" | "xl" | "soft" | "glow" | "inner";
|
|
58
|
+
export declare const SHADOW_PRESETS: Record<ShadowVariant, string>;
|
|
59
|
+
/**
|
|
60
|
+
* Returns typed box-shadow tokens designed for high-contrast optical depth.
|
|
61
|
+
*/
|
|
62
|
+
export declare function shadow(variant: ShadowVariant | string): string;
|
|
63
|
+
export type RadiusVariant = "none" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "full" | number;
|
|
64
|
+
export declare const RADIUS_PRESETS: Record<string, string>;
|
|
65
|
+
/**
|
|
66
|
+
* Returns typed border-radius tokens or scale numbers.
|
|
67
|
+
*/
|
|
68
|
+
export declare function radius(variant: RadiusVariant): string;
|
|
69
|
+
export interface GlassOptions {
|
|
70
|
+
blur?: number | string;
|
|
71
|
+
tint?: string;
|
|
72
|
+
border?: string;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Generates tactile glassmorphism CSS styles with backdrop filters and frosted borders.
|
|
76
|
+
*/
|
|
77
|
+
export declare function glass(options?: GlassOptions): Record<string, string>;
|
|
78
|
+
/**
|
|
79
|
+
* Formats a style property value for direct DOM binding or SSR generation.
|
|
80
|
+
* Handles automatic unit resolution, dimension keywords, and custom CSS variables.
|
|
81
|
+
*/
|
|
82
|
+
export declare function formatStyleProp(prop: string, val: any): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { html, template } from "./template";
|
|
@@ -431,10 +431,12 @@ class Signal {
|
|
|
431
431
|
_value;
|
|
432
432
|
_subscribers = new Set;
|
|
433
433
|
_equals;
|
|
434
|
+
_onSet;
|
|
434
435
|
version = 0;
|
|
435
|
-
constructor(initialValue, equals) {
|
|
436
|
+
constructor(initialValue, equals, onSet) {
|
|
436
437
|
this._value = initialValue;
|
|
437
438
|
this._equals = equals ?? Object.is;
|
|
439
|
+
this._onSet = onSet;
|
|
438
440
|
}
|
|
439
441
|
get() {
|
|
440
442
|
if (currentSubscriber !== null && currentSubscriber.state !== 3 /* DISPOSED */) {
|
|
@@ -459,6 +461,9 @@ class Signal {
|
|
|
459
461
|
}
|
|
460
462
|
this._value = newValue;
|
|
461
463
|
this.version++;
|
|
464
|
+
if (this._onSet) {
|
|
465
|
+
this._onSet(newValue);
|
|
466
|
+
}
|
|
462
467
|
batch(() => {
|
|
463
468
|
this.notify();
|
|
464
469
|
});
|
|
@@ -484,11 +489,91 @@ class Signal {
|
|
|
484
489
|
}
|
|
485
490
|
}
|
|
486
491
|
}
|
|
492
|
+
function resolveStorage(storageOption) {
|
|
493
|
+
if (storageOption && typeof storageOption === "object") {
|
|
494
|
+
return storageOption;
|
|
495
|
+
}
|
|
496
|
+
if (storageOption === "session") {
|
|
497
|
+
try {
|
|
498
|
+
if (typeof sessionStorage !== "undefined")
|
|
499
|
+
return sessionStorage;
|
|
500
|
+
} catch {}
|
|
501
|
+
try {
|
|
502
|
+
if (typeof window !== "undefined" && window.sessionStorage) {
|
|
503
|
+
return window.sessionStorage;
|
|
504
|
+
}
|
|
505
|
+
} catch {}
|
|
506
|
+
try {
|
|
507
|
+
if (typeof globalThis !== "undefined" && globalThis.sessionStorage) {
|
|
508
|
+
return globalThis.sessionStorage;
|
|
509
|
+
}
|
|
510
|
+
} catch {}
|
|
511
|
+
return null;
|
|
512
|
+
}
|
|
513
|
+
try {
|
|
514
|
+
if (typeof localStorage !== "undefined")
|
|
515
|
+
return localStorage;
|
|
516
|
+
} catch {}
|
|
517
|
+
try {
|
|
518
|
+
if (typeof window !== "undefined" && window.localStorage) {
|
|
519
|
+
return window.localStorage;
|
|
520
|
+
}
|
|
521
|
+
} catch {}
|
|
522
|
+
try {
|
|
523
|
+
if (typeof globalThis !== "undefined" && globalThis.localStorage) {
|
|
524
|
+
return globalThis.localStorage;
|
|
525
|
+
}
|
|
526
|
+
} catch {}
|
|
527
|
+
return null;
|
|
528
|
+
}
|
|
487
529
|
function signal(initialValue, optionsOrEquals) {
|
|
488
530
|
const equals = typeof optionsOrEquals === "function" ? optionsOrEquals : optionsOrEquals?.equals;
|
|
489
531
|
const isInternal = typeof optionsOrEquals === "object" ? optionsOrEquals?.internal : false;
|
|
490
532
|
const customName = typeof optionsOrEquals === "object" ? optionsOrEquals?.name : undefined;
|
|
491
|
-
const
|
|
533
|
+
const persistOption = typeof optionsOrEquals === "object" ? optionsOrEquals?.persist : undefined;
|
|
534
|
+
const persistConfig = persistOption ? typeof persistOption === "string" ? { key: persistOption } : persistOption : undefined;
|
|
535
|
+
let effectiveInitial = initialValue;
|
|
536
|
+
const storage = persistConfig ? resolveStorage(persistConfig.storage) : null;
|
|
537
|
+
const serialize = persistConfig?.serialize ?? JSON.stringify;
|
|
538
|
+
const deserialize = persistConfig?.deserialize ?? JSON.parse;
|
|
539
|
+
if (persistConfig && storage) {
|
|
540
|
+
try {
|
|
541
|
+
const stored = storage.getItem(persistConfig.key);
|
|
542
|
+
if (stored !== null) {
|
|
543
|
+
effectiveInitial = deserialize(stored);
|
|
544
|
+
}
|
|
545
|
+
} catch {}
|
|
546
|
+
}
|
|
547
|
+
let isSyncing = false;
|
|
548
|
+
const onSet = persistConfig && storage ? (val) => {
|
|
549
|
+
if (isSyncing)
|
|
550
|
+
return;
|
|
551
|
+
try {
|
|
552
|
+
storage.setItem(persistConfig.key, serialize(val));
|
|
553
|
+
} catch {}
|
|
554
|
+
} : undefined;
|
|
555
|
+
const s = new Signal(effectiveInitial, equals, onSet);
|
|
556
|
+
if (persistConfig && storage && (persistConfig.syncTabs ?? true) && typeof window !== "undefined" && typeof window.addEventListener === "function") {
|
|
557
|
+
const onStorage = (e) => {
|
|
558
|
+
if (e.key === persistConfig.key) {
|
|
559
|
+
try {
|
|
560
|
+
const nextVal = e.newValue !== null ? deserialize(e.newValue) : initialValue;
|
|
561
|
+
isSyncing = true;
|
|
562
|
+
try {
|
|
563
|
+
s.set(nextVal);
|
|
564
|
+
} finally {
|
|
565
|
+
isSyncing = false;
|
|
566
|
+
}
|
|
567
|
+
} catch {}
|
|
568
|
+
}
|
|
569
|
+
};
|
|
570
|
+
window.addEventListener("storage", onStorage);
|
|
571
|
+
if (currentScope) {
|
|
572
|
+
currentScope.addCleanup(() => {
|
|
573
|
+
window.removeEventListener("storage", onStorage);
|
|
574
|
+
});
|
|
575
|
+
}
|
|
576
|
+
}
|
|
492
577
|
const accessor = (...args) => {
|
|
493
578
|
if (args.length === 0) {
|
|
494
579
|
return s.get();
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cache and clone pre-parsed HTML template strings with native browser cloneNode(true)
|
|
3
|
+
*/
|
|
4
|
+
export declare function template<T extends HTMLElement = HTMLElement>(htmlString: string): () => T;
|
|
5
|
+
/**
|
|
6
|
+
* Tagged template literal for ultra-fast HTML string rendering with reactive signal bindings
|
|
7
|
+
*/
|
|
8
|
+
export declare function html(strings: TemplateStringsArray, ...values: any[]): HTMLElement | DocumentFragment;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import type { Child } from "../dom/render";
|
|
2
|
+
export interface AccordionContextValue {
|
|
3
|
+
isExpanded: (value: string) => boolean;
|
|
4
|
+
toggleItem: (value: string) => void;
|
|
5
|
+
type: "single" | "multiple";
|
|
6
|
+
collapsible: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare const AccordionContext: import("..").Context<AccordionContextValue | null>;
|
|
9
|
+
export declare function useAccordionContext(): AccordionContextValue | null;
|
|
10
|
+
export interface AccordionItemData {
|
|
11
|
+
value: string;
|
|
12
|
+
trigger: Child | (() => Child);
|
|
13
|
+
content: Child | (() => Child);
|
|
14
|
+
disabled?: boolean | (() => boolean);
|
|
15
|
+
}
|
|
16
|
+
export interface AccordionBaseProps {
|
|
17
|
+
items?: AccordionItemData[];
|
|
18
|
+
itemClass?: any;
|
|
19
|
+
triggerClass?: any;
|
|
20
|
+
contentClass?: any;
|
|
21
|
+
as?: string;
|
|
22
|
+
class?: any;
|
|
23
|
+
style?: any;
|
|
24
|
+
children?: Child | (() => Child);
|
|
25
|
+
[key: string]: any;
|
|
26
|
+
}
|
|
27
|
+
export interface AccordionSingleProps extends AccordionBaseProps {
|
|
28
|
+
type: "single";
|
|
29
|
+
value?: () => string | undefined;
|
|
30
|
+
defaultValue?: string;
|
|
31
|
+
onValueChange?: (value: string) => void;
|
|
32
|
+
collapsible?: boolean;
|
|
33
|
+
}
|
|
34
|
+
export interface AccordionMultipleProps extends AccordionBaseProps {
|
|
35
|
+
type: "multiple";
|
|
36
|
+
value?: () => string[] | undefined;
|
|
37
|
+
defaultValue?: string[];
|
|
38
|
+
onValueChange?: (value: string[]) => void;
|
|
39
|
+
}
|
|
40
|
+
export type AccordionProps = AccordionSingleProps | AccordionMultipleProps;
|
|
41
|
+
export declare function AccordionRoot(props: AccordionProps): Child;
|
|
42
|
+
export interface AccordionItemContextValue {
|
|
43
|
+
value: string;
|
|
44
|
+
itemId: string;
|
|
45
|
+
}
|
|
46
|
+
export declare const AccordionItemContext: import("..").Context<AccordionItemContextValue | null>;
|
|
47
|
+
export declare function useAccordionItemContext(): AccordionItemContextValue | null;
|
|
48
|
+
export interface AccordionItemProps {
|
|
49
|
+
value: string;
|
|
50
|
+
disabled?: boolean | (() => boolean);
|
|
51
|
+
as?: string;
|
|
52
|
+
class?: any;
|
|
53
|
+
style?: any;
|
|
54
|
+
children: Child | (() => Child);
|
|
55
|
+
[key: string]: any;
|
|
56
|
+
}
|
|
57
|
+
export declare function AccordionItem(props: AccordionItemProps): Child;
|
|
58
|
+
export interface AccordionTriggerProps {
|
|
59
|
+
as?: string;
|
|
60
|
+
class?: any;
|
|
61
|
+
style?: any;
|
|
62
|
+
onClick?: (e: MouseEvent) => void;
|
|
63
|
+
children: Child | (() => Child);
|
|
64
|
+
[key: string]: any;
|
|
65
|
+
}
|
|
66
|
+
export declare function AccordionTrigger(props: AccordionTriggerProps): Child;
|
|
67
|
+
export interface AccordionContentProps {
|
|
68
|
+
forceMount?: boolean;
|
|
69
|
+
as?: string;
|
|
70
|
+
class?: any;
|
|
71
|
+
style?: any;
|
|
72
|
+
children: Child | (() => Child);
|
|
73
|
+
[key: string]: any;
|
|
74
|
+
}
|
|
75
|
+
export declare function AccordionContent(props: AccordionContentProps): Child;
|
|
76
|
+
export declare const Accordion: typeof AccordionRoot & {
|
|
77
|
+
Root: typeof AccordionRoot;
|
|
78
|
+
Item: typeof AccordionItem;
|
|
79
|
+
Trigger: typeof AccordionTrigger;
|
|
80
|
+
Content: typeof AccordionContent;
|
|
81
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Child } from "../dom/render";
|
|
2
|
+
import type { CommandProps } from "./command";
|
|
3
|
+
export interface CommandDialogProps extends CommandProps {
|
|
4
|
+
open?: () => boolean | undefined;
|
|
5
|
+
defaultOpen?: boolean;
|
|
6
|
+
onOpenChange?: (open: boolean) => void;
|
|
7
|
+
overlayClass?: any;
|
|
8
|
+
contentClass?: any;
|
|
9
|
+
}
|
|
10
|
+
export declare function CommandDialog(props: CommandDialogProps): Child;
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import type { Child } from "../dom/render";
|
|
2
|
+
import type { ReadonlySignal } from "../signals";
|
|
3
|
+
import { CommandDialog, type CommandDialogProps } from "./command-dialog";
|
|
4
|
+
export type { CommandDialogProps };
|
|
5
|
+
export { CommandDialog };
|
|
6
|
+
export interface CommandItemData {
|
|
7
|
+
value?: string;
|
|
8
|
+
label: Child | (() => Child);
|
|
9
|
+
icon?: Child | (() => Child);
|
|
10
|
+
shortcut?: string;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
onSelect?: () => void;
|
|
13
|
+
keywords?: string[];
|
|
14
|
+
class?: any;
|
|
15
|
+
}
|
|
16
|
+
export interface CommandGroupData {
|
|
17
|
+
heading?: string;
|
|
18
|
+
items: CommandItemData[];
|
|
19
|
+
}
|
|
20
|
+
export interface CommandContextValue {
|
|
21
|
+
search: ReadonlySignal<string>;
|
|
22
|
+
setSearch: (query: string) => void;
|
|
23
|
+
activeValue: ReadonlySignal<string>;
|
|
24
|
+
setActiveValue: (val: string) => void;
|
|
25
|
+
filterMatches: (text: string, keywords?: string[]) => boolean;
|
|
26
|
+
commandId: string;
|
|
27
|
+
}
|
|
28
|
+
export declare const CommandContext: import("..").Context<CommandContextValue | null>;
|
|
29
|
+
export declare function useCommandContext(): CommandContextValue | null;
|
|
30
|
+
export interface CommandProps {
|
|
31
|
+
value?: () => string | undefined;
|
|
32
|
+
defaultValue?: string;
|
|
33
|
+
onValueChange?: (value: string) => void;
|
|
34
|
+
search?: () => string | undefined;
|
|
35
|
+
onSearchChange?: (query: string) => void;
|
|
36
|
+
placeholder?: string;
|
|
37
|
+
groups?: CommandGroupData[];
|
|
38
|
+
items?: CommandItemData[];
|
|
39
|
+
emptyText?: string;
|
|
40
|
+
class?: any;
|
|
41
|
+
style?: any;
|
|
42
|
+
inputClass?: any;
|
|
43
|
+
listClass?: any;
|
|
44
|
+
itemClass?: any;
|
|
45
|
+
as?: string;
|
|
46
|
+
children?: Child | (() => Child);
|
|
47
|
+
[key: string]: any;
|
|
48
|
+
}
|
|
49
|
+
export declare function CommandRoot(props: CommandProps): Child;
|
|
50
|
+
export interface CommandInputProps {
|
|
51
|
+
placeholder?: string;
|
|
52
|
+
class?: any;
|
|
53
|
+
style?: any;
|
|
54
|
+
[key: string]: any;
|
|
55
|
+
}
|
|
56
|
+
export declare function CommandInput(props: CommandInputProps): Child;
|
|
57
|
+
export interface CommandListProps {
|
|
58
|
+
as?: string;
|
|
59
|
+
class?: any;
|
|
60
|
+
style?: any;
|
|
61
|
+
children: Child | (() => Child);
|
|
62
|
+
[key: string]: any;
|
|
63
|
+
}
|
|
64
|
+
export declare function CommandList(props: CommandListProps): Child;
|
|
65
|
+
export interface CommandEmptyProps {
|
|
66
|
+
as?: string;
|
|
67
|
+
class?: any;
|
|
68
|
+
style?: any;
|
|
69
|
+
children: Child | (() => Child);
|
|
70
|
+
[key: string]: any;
|
|
71
|
+
}
|
|
72
|
+
export declare function CommandEmpty(props: CommandEmptyProps): Child;
|
|
73
|
+
export interface CommandGroupProps {
|
|
74
|
+
heading?: string;
|
|
75
|
+
as?: string;
|
|
76
|
+
class?: any;
|
|
77
|
+
style?: any;
|
|
78
|
+
children: Child | (() => Child);
|
|
79
|
+
[key: string]: any;
|
|
80
|
+
}
|
|
81
|
+
export declare function CommandGroup(props: CommandGroupProps): Child;
|
|
82
|
+
export interface CommandItemProps {
|
|
83
|
+
value?: string;
|
|
84
|
+
shortcut?: string;
|
|
85
|
+
disabled?: boolean;
|
|
86
|
+
onSelect?: () => void;
|
|
87
|
+
keywords?: string[];
|
|
88
|
+
as?: string;
|
|
89
|
+
class?: any;
|
|
90
|
+
style?: any;
|
|
91
|
+
children: Child | (() => Child);
|
|
92
|
+
[key: string]: any;
|
|
93
|
+
}
|
|
94
|
+
export declare function CommandItem(props: CommandItemProps): Child;
|
|
95
|
+
export declare const Command: typeof CommandRoot & {
|
|
96
|
+
Root: typeof CommandRoot;
|
|
97
|
+
Dialog: typeof CommandDialog;
|
|
98
|
+
Input: typeof CommandInput;
|
|
99
|
+
List: typeof CommandList;
|
|
100
|
+
Empty: typeof CommandEmpty;
|
|
101
|
+
Group: typeof CommandGroup;
|
|
102
|
+
Item: typeof CommandItem;
|
|
103
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { Child } from "../dom/render";
|
|
2
|
+
export type SortDirection = "asc" | "desc" | null;
|
|
3
|
+
export interface SortState {
|
|
4
|
+
column: string;
|
|
5
|
+
direction: SortDirection;
|
|
6
|
+
}
|
|
7
|
+
export interface ColumnDef<T = any> {
|
|
8
|
+
id: string;
|
|
9
|
+
header: Child | (() => Child);
|
|
10
|
+
accessorKey?: keyof T;
|
|
11
|
+
cell?: (row: T, index: number) => Child;
|
|
12
|
+
sortable?: boolean;
|
|
13
|
+
width?: string;
|
|
14
|
+
align?: "left" | "center" | "right";
|
|
15
|
+
}
|
|
16
|
+
export interface DataTableProps<T = any> {
|
|
17
|
+
data: T[] | (() => T[]);
|
|
18
|
+
columns: ColumnDef<T>[];
|
|
19
|
+
sort?: () => SortState | undefined;
|
|
20
|
+
onSortChange?: (sort: SortState) => void;
|
|
21
|
+
filter?: () => string | undefined;
|
|
22
|
+
selection?: "none" | "single" | "multi";
|
|
23
|
+
selectedKeys?: () => string[] | undefined;
|
|
24
|
+
onSelectionChange?: (keys: string[]) => void;
|
|
25
|
+
getRowId?: (row: T, index: number) => string;
|
|
26
|
+
pageSize?: number;
|
|
27
|
+
onRowClick?: (row: T, index: number) => void;
|
|
28
|
+
emptyText?: string;
|
|
29
|
+
class?: any;
|
|
30
|
+
style?: any;
|
|
31
|
+
tableClass?: any;
|
|
32
|
+
headerClass?: any;
|
|
33
|
+
rowClass?: any;
|
|
34
|
+
cellClass?: any;
|
|
35
|
+
paginationClass?: any;
|
|
36
|
+
[key: string]: any;
|
|
37
|
+
}
|
|
38
|
+
export declare function DataTable<T extends Record<string, any>>(props: DataTableProps<T>): Child;
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import type { Child } from "../dom/render";
|
|
2
|
+
import type { ReadonlySignal } from "../signals";
|
|
3
|
+
export interface DialogContextValue {
|
|
4
|
+
open: ReadonlySignal<boolean>;
|
|
5
|
+
setOpen: (open: boolean) => void;
|
|
6
|
+
titleId: string;
|
|
7
|
+
descriptionId: string;
|
|
8
|
+
contentRef: {
|
|
9
|
+
current: HTMLElement | null;
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
export declare const DialogContext: import("..").Context<DialogContextValue | null>;
|
|
13
|
+
export declare function useDialogContext(): DialogContextValue;
|
|
14
|
+
export interface DialogProps {
|
|
15
|
+
open?: () => boolean | undefined;
|
|
16
|
+
defaultOpen?: boolean;
|
|
17
|
+
onOpenChange?: (open: boolean) => void;
|
|
18
|
+
trigger?: Child | (() => Child);
|
|
19
|
+
title?: Child | (() => Child);
|
|
20
|
+
description?: Child | (() => Child);
|
|
21
|
+
footer?: Child | (() => Child);
|
|
22
|
+
triggerClass?: any;
|
|
23
|
+
overlayClass?: any;
|
|
24
|
+
contentClass?: any;
|
|
25
|
+
titleClass?: any;
|
|
26
|
+
descriptionClass?: any;
|
|
27
|
+
footerClass?: any;
|
|
28
|
+
portalled?: boolean;
|
|
29
|
+
children?: Child | (() => Child);
|
|
30
|
+
}
|
|
31
|
+
export declare function DialogRoot(props: DialogProps): Child;
|
|
32
|
+
export interface DialogTriggerProps {
|
|
33
|
+
as?: string;
|
|
34
|
+
class?: any;
|
|
35
|
+
style?: any;
|
|
36
|
+
onClick?: (e: MouseEvent) => void;
|
|
37
|
+
children: Child | (() => Child);
|
|
38
|
+
[key: string]: any;
|
|
39
|
+
}
|
|
40
|
+
export declare function DialogTrigger(props: DialogTriggerProps): Child;
|
|
41
|
+
export interface DialogPortalProps {
|
|
42
|
+
mount?: HTMLElement | null;
|
|
43
|
+
children: Child | (() => Child);
|
|
44
|
+
}
|
|
45
|
+
export declare function DialogPortal(props: DialogPortalProps): Child;
|
|
46
|
+
export interface DialogOverlayProps {
|
|
47
|
+
as?: string;
|
|
48
|
+
portalled?: boolean;
|
|
49
|
+
mount?: HTMLElement | null;
|
|
50
|
+
class?: any;
|
|
51
|
+
style?: any;
|
|
52
|
+
onClick?: (e: MouseEvent) => void;
|
|
53
|
+
children?: Child | (() => Child);
|
|
54
|
+
[key: string]: any;
|
|
55
|
+
}
|
|
56
|
+
export declare function DialogOverlay(props: DialogOverlayProps): Child;
|
|
57
|
+
export interface DialogContentProps {
|
|
58
|
+
as?: string;
|
|
59
|
+
portalled?: boolean;
|
|
60
|
+
mount?: HTMLElement | null;
|
|
61
|
+
class?: any;
|
|
62
|
+
style?: any;
|
|
63
|
+
onKeyDown?: (e: KeyboardEvent) => void;
|
|
64
|
+
children: Child | (() => Child);
|
|
65
|
+
[key: string]: any;
|
|
66
|
+
}
|
|
67
|
+
export declare function DialogContent(props: DialogContentProps): Child;
|
|
68
|
+
export interface DialogTitleProps {
|
|
69
|
+
as?: string;
|
|
70
|
+
class?: any;
|
|
71
|
+
style?: any;
|
|
72
|
+
children: Child | (() => Child);
|
|
73
|
+
[key: string]: any;
|
|
74
|
+
}
|
|
75
|
+
export declare function DialogTitle(props: DialogTitleProps): Child;
|
|
76
|
+
export interface DialogDescriptionProps {
|
|
77
|
+
as?: string;
|
|
78
|
+
class?: any;
|
|
79
|
+
style?: any;
|
|
80
|
+
children: Child | (() => Child);
|
|
81
|
+
[key: string]: any;
|
|
82
|
+
}
|
|
83
|
+
export declare function DialogDescription(props: DialogDescriptionProps): Child;
|
|
84
|
+
export interface DialogCloseProps {
|
|
85
|
+
as?: string;
|
|
86
|
+
class?: any;
|
|
87
|
+
style?: any;
|
|
88
|
+
onClick?: (e: MouseEvent) => void;
|
|
89
|
+
children: Child | (() => Child);
|
|
90
|
+
[key: string]: any;
|
|
91
|
+
}
|
|
92
|
+
export declare function DialogClose(props: DialogCloseProps): Child;
|
|
93
|
+
export declare const Dialog: typeof DialogRoot & {
|
|
94
|
+
Root: typeof DialogRoot;
|
|
95
|
+
Trigger: typeof DialogTrigger;
|
|
96
|
+
Portal: typeof DialogPortal;
|
|
97
|
+
Overlay: typeof DialogOverlay;
|
|
98
|
+
Content: typeof DialogContent;
|
|
99
|
+
Title: typeof DialogTitle;
|
|
100
|
+
Description: typeof DialogDescription;
|
|
101
|
+
Close: typeof DialogClose;
|
|
102
|
+
};
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import type { Child } from "../dom/render";
|
|
2
|
+
import { type ReadonlySignal } from "../signals";
|
|
3
|
+
export interface DropdownMenuContextValue {
|
|
4
|
+
open: ReadonlySignal<boolean>;
|
|
5
|
+
setOpen: (open: boolean) => void;
|
|
6
|
+
triggerRef: {
|
|
7
|
+
current: HTMLElement | null;
|
|
8
|
+
};
|
|
9
|
+
contentRef: {
|
|
10
|
+
current: HTMLElement | null;
|
|
11
|
+
};
|
|
12
|
+
menuId: string;
|
|
13
|
+
}
|
|
14
|
+
export declare const DropdownMenuContext: import("..").Context<DropdownMenuContextValue | null>;
|
|
15
|
+
export declare function useDropdownMenuContext(): DropdownMenuContextValue | null;
|
|
16
|
+
export interface DropdownMenuItemData {
|
|
17
|
+
label?: Child | (() => Child);
|
|
18
|
+
icon?: Child | (() => Child);
|
|
19
|
+
disabled?: boolean | (() => boolean);
|
|
20
|
+
danger?: boolean;
|
|
21
|
+
separator?: boolean;
|
|
22
|
+
onSelect?: (e: Event) => void;
|
|
23
|
+
class?: any;
|
|
24
|
+
}
|
|
25
|
+
export interface DropdownMenuProps {
|
|
26
|
+
open?: () => boolean | undefined;
|
|
27
|
+
defaultOpen?: boolean;
|
|
28
|
+
onOpenChange?: (open: boolean) => void;
|
|
29
|
+
trigger?: Child | (() => Child);
|
|
30
|
+
items?: DropdownMenuItemData[];
|
|
31
|
+
triggerClass?: any;
|
|
32
|
+
contentClass?: any;
|
|
33
|
+
itemClass?: any;
|
|
34
|
+
separatorClass?: any;
|
|
35
|
+
portalled?: boolean;
|
|
36
|
+
children?: Child | (() => Child);
|
|
37
|
+
}
|
|
38
|
+
export declare function DropdownMenuRoot(props: DropdownMenuProps): Child;
|
|
39
|
+
export interface DropdownMenuTriggerProps {
|
|
40
|
+
as?: string;
|
|
41
|
+
class?: any;
|
|
42
|
+
style?: any;
|
|
43
|
+
onClick?: (e: MouseEvent) => void;
|
|
44
|
+
onKeyDown?: (e: KeyboardEvent) => void;
|
|
45
|
+
children: Child | (() => Child);
|
|
46
|
+
[key: string]: any;
|
|
47
|
+
}
|
|
48
|
+
export declare function DropdownMenuTrigger(props: DropdownMenuTriggerProps): Child;
|
|
49
|
+
export interface DropdownMenuPortalProps {
|
|
50
|
+
mount?: HTMLElement | null;
|
|
51
|
+
children: Child | (() => Child);
|
|
52
|
+
}
|
|
53
|
+
export declare function DropdownMenuPortal(props: DropdownMenuPortalProps): Child;
|
|
54
|
+
export interface DropdownMenuContentProps {
|
|
55
|
+
as?: string;
|
|
56
|
+
portalled?: boolean;
|
|
57
|
+
mount?: HTMLElement | null;
|
|
58
|
+
class?: any;
|
|
59
|
+
style?: any;
|
|
60
|
+
onKeyDown?: (e: KeyboardEvent) => void;
|
|
61
|
+
children: Child | (() => Child);
|
|
62
|
+
[key: string]: any;
|
|
63
|
+
}
|
|
64
|
+
export declare function DropdownMenuContent(props: DropdownMenuContentProps): Child;
|
|
65
|
+
export interface DropdownMenuItemProps {
|
|
66
|
+
disabled?: boolean | (() => boolean);
|
|
67
|
+
closeOnSelect?: boolean;
|
|
68
|
+
as?: string;
|
|
69
|
+
class?: any;
|
|
70
|
+
style?: any;
|
|
71
|
+
onSelect?: (e: Event) => void;
|
|
72
|
+
onClick?: (e: MouseEvent) => void;
|
|
73
|
+
onKeyDown?: (e: KeyboardEvent) => void;
|
|
74
|
+
children: Child | (() => Child);
|
|
75
|
+
[key: string]: any;
|
|
76
|
+
}
|
|
77
|
+
export declare function DropdownMenuItem(props: DropdownMenuItemProps): Child;
|
|
78
|
+
export interface DropdownMenuSeparatorProps {
|
|
79
|
+
as?: string;
|
|
80
|
+
class?: any;
|
|
81
|
+
style?: any;
|
|
82
|
+
[key: string]: any;
|
|
83
|
+
}
|
|
84
|
+
export declare function DropdownMenuSeparator(props: DropdownMenuSeparatorProps): Child;
|
|
85
|
+
export declare const DropdownMenu: typeof DropdownMenuRoot & {
|
|
86
|
+
Root: typeof DropdownMenuRoot;
|
|
87
|
+
Trigger: typeof DropdownMenuTrigger;
|
|
88
|
+
Portal: typeof DropdownMenuPortal;
|
|
89
|
+
Content: typeof DropdownMenuContent;
|
|
90
|
+
Item: typeof DropdownMenuItem;
|
|
91
|
+
Separator: typeof DropdownMenuSeparator;
|
|
92
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { Child } from "../dom/render";
|
|
2
|
+
export type IconNode = [string, Record<string, any>][];
|
|
3
|
+
export interface IconProps {
|
|
4
|
+
size?: number | string | (() => number | string);
|
|
5
|
+
color?: string | (() => string);
|
|
6
|
+
strokeWidth?: number | string | (() => number | string);
|
|
7
|
+
class?: any;
|
|
8
|
+
style?: any;
|
|
9
|
+
children?: Child | (() => Child);
|
|
10
|
+
[key: string]: any;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Creates a native Visage SVG component from a Lucide / SVG icon node definition
|
|
14
|
+
*/
|
|
15
|
+
export declare function createIcon(name: string, iconNode: IconNode): {
|
|
16
|
+
(props?: IconProps): Child;
|
|
17
|
+
displayName: string;
|
|
18
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export { Accordion, AccordionContent, AccordionItem, type AccordionItemProps, type AccordionMultipleProps, type AccordionProps, type AccordionSingleProps, AccordionTrigger, useAccordionContext, useAccordionItemContext } from "./accordion";
|
|
2
|
+
export { Command, CommandDialog, type CommandDialogProps, CommandEmpty, CommandGroup, type CommandGroupData, CommandInput, type CommandInputProps, CommandItem, type CommandItemData, type CommandItemProps, CommandList, type CommandProps, useCommandContext } from "./command";
|
|
3
|
+
export { type ColumnDef, DataTable, type DataTableProps, type SortDirection, type SortState } from "./data-table";
|
|
4
|
+
export { Dialog, DialogClose, DialogContent, type DialogContentProps, DialogDescription, DialogOverlay, DialogPortal, type DialogProps, DialogTitle, DialogTrigger, useDialogContext } from "./dialog";
|
|
5
|
+
export { DropdownMenu, DropdownMenuContent, DropdownMenuItem, type DropdownMenuItemProps, DropdownMenuPortal, type DropdownMenuProps, DropdownMenuSeparator, DropdownMenuTrigger, useDropdownMenuContext } from "./dropdown-menu";
|
|
6
|
+
export { createIcon, type IconNode, type IconProps } from "./icon";
|
|
7
|
+
export { type BaseLayoutProps, Center, type CenterProps, Grid, type GridProps, Row, type RowProps, Spacer, type SpacerProps, Stack, type StackProps } from "./layout";
|
|
8
|
+
export { Popover, PopoverClose, PopoverContent, type PopoverContentProps, PopoverPortal, type PopoverProps, PopoverTrigger, usePopoverContext } from "./popover";
|
|
9
|
+
export { Switch, type SwitchProps, SwitchThumb, type SwitchThumbProps } from "./switch";
|
|
10
|
+
export { Tabs, TabsContent, type TabsContentProps, TabsList, type TabsProps, TabsTrigger, useTabsContext } from "./tabs";
|
|
11
|
+
export type { ToastData, ToastManager, ToastOptions, ToastProps, ToastVariant } from "./toast";
|
|
12
|
+
export { createToastManager, defaultToastManager, Toast, ToastClose, ToastDescription, ToastProvider, type ToastProviderProps, ToastTitle, ToastViewport, type ToastViewportProps, toast, useToast } from "./toast";
|
|
13
|
+
export { Tooltip, TooltipContent, type TooltipContentProps, TooltipPortal, type TooltipProps, TooltipTrigger, useTooltipContext } from "./tooltip";
|
|
14
|
+
export { createControllableSignal, createId, onClickOutside, trapFocus } from "./utils";
|