@tarve/core 0.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/LICENSE +201 -0
- package/PERFORMANCE.md +82 -0
- package/README.md +549 -0
- package/RELEASE.md +72 -0
- package/dist/npm/build.js +259 -0
- package/dist/npm/cli.js +285 -0
- package/dist/npm/embedded-assets.js +52 -0
- package/dist/npm/index.js +7077 -0
- package/dist/npm/jsx-dev-runtime.js +17 -0
- package/dist/npm/jsx-runtime.js +27 -0
- package/dist/npm/native-runtime.json +7 -0
- package/dist/npm/protocol.js +8 -0
- package/dist/npm/runtime.js +98 -0
- package/dist/types/core/build.d.ts +13 -0
- package/dist/types/core/cli.d.ts +2 -0
- package/dist/types/core/native-runtime.d.ts +22 -0
- package/dist/types/core/src/advanced-controls.d.ts +120 -0
- package/dist/types/core/src/app.d.ts +59 -0
- package/dist/types/core/src/assets.d.ts +4 -0
- package/dist/types/core/src/bridge/binding.d.ts +34 -0
- package/dist/types/core/src/bridge/index.d.ts +41 -0
- package/dist/types/core/src/bridge/runtime.d.ts +4 -0
- package/dist/types/core/src/chat-controls.d.ts +40 -0
- package/dist/types/core/src/component-adapter.d.ts +11 -0
- package/dist/types/core/src/components/button.d.ts +12 -0
- package/dist/types/core/src/components/icon.d.ts +13 -0
- package/dist/types/core/src/components/image.d.ts +43 -0
- package/dist/types/core/src/components/input.d.ts +22 -0
- package/dist/types/core/src/components/layout.d.ts +22 -0
- package/dist/types/core/src/components/link.d.ts +10 -0
- package/dist/types/core/src/components/modal.d.ts +15 -0
- package/dist/types/core/src/components/pressable.d.ts +19 -0
- package/dist/types/core/src/components/rich-content.d.ts +45 -0
- package/dist/types/core/src/components/scroll.d.ts +12 -0
- package/dist/types/core/src/components/svg.d.ts +61 -0
- package/dist/types/core/src/components/text.d.ts +9 -0
- package/dist/types/core/src/components/titlebar.d.ts +10 -0
- package/dist/types/core/src/components/window.d.ts +20 -0
- package/dist/types/core/src/components.d.ts +34 -0
- package/dist/types/core/src/controls.d.ts +84 -0
- package/dist/types/core/src/desktop-controls.d.ts +62 -0
- package/dist/types/core/src/dev-overlay.d.ts +9 -0
- package/dist/types/core/src/embedded-assets.d.ts +4 -0
- package/dist/types/core/src/extra-controls.d.ts +182 -0
- package/dist/types/core/src/form-controls.d.ts +118 -0
- package/dist/types/core/src/hotkeys.d.ts +3 -0
- package/dist/types/core/src/index.d.ts +36 -0
- package/dist/types/core/src/intrinsic-style.d.ts +3 -0
- package/dist/types/core/src/jsx-dev-runtime.d.ts +2 -0
- package/dist/types/core/src/jsx-runtime.d.ts +279 -0
- package/dist/types/core/src/list.d.ts +10 -0
- package/dist/types/core/src/motion.d.ts +19 -0
- package/dist/types/core/src/popups.d.ts +115 -0
- package/dist/types/core/src/reconciler.d.ts +54 -0
- package/dist/types/core/src/render-scope.d.ts +3 -0
- package/dist/types/core/src/select.d.ts +17 -0
- package/dist/types/core/src/style.d.ts +7 -0
- package/dist/types/core/src/test-renderer.d.ts +84 -0
- package/dist/types/core/src/text-search.d.ts +37 -0
- package/dist/types/core/src/theme.d.ts +91 -0
- package/dist/types/core/src/virtual-list.d.ts +31 -0
- package/dist/types/core/src/visual-testing.d.ts +24 -0
- package/dist/types/core/targets.d.ts +16 -0
- package/dist/types/protocol/src/index.d.ts +534 -0
- package/native/linux-x64/libtarve_native.so +0 -0
- package/native/linux-x64/runtime.json +10 -0
- package/native/win32-x64/runtime.json +10 -0
- package/native/win32-x64/tarve_native.dll +0 -0
- package/package.json +131 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type BaseProps, type Child, type VNode } from "../jsx-runtime";
|
|
2
|
+
export interface ModalProps extends BaseProps {
|
|
3
|
+
open: boolean;
|
|
4
|
+
onOpenChange?: (open: boolean) => void;
|
|
5
|
+
title?: string;
|
|
6
|
+
description?: string;
|
|
7
|
+
footer?: Child;
|
|
8
|
+
width?: number;
|
|
9
|
+
closeOnOverlay?: boolean;
|
|
10
|
+
closeOnEscape?: boolean;
|
|
11
|
+
showClose?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export declare function Modal({ open, onOpenChange, title, description, footer, width, closeOnOverlay, closeOnEscape, showClose, children, style, ...props }: ModalProps): VNode;
|
|
14
|
+
export declare const Dialog: typeof Modal;
|
|
15
|
+
export type DialogProps = ModalProps;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { Control } from "../../../protocol/src/index";
|
|
2
|
+
import type { VNode } from "../jsx-runtime";
|
|
3
|
+
import { type ViewProps } from "./layout";
|
|
4
|
+
export interface PressableProps extends ViewProps {
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
onClick?: () => void;
|
|
7
|
+
onContextMenu?: (position: {
|
|
8
|
+
x: number;
|
|
9
|
+
y: number;
|
|
10
|
+
}) => void;
|
|
11
|
+
onHover?: (hovered: boolean) => void;
|
|
12
|
+
control?: Control;
|
|
13
|
+
focusable?: boolean;
|
|
14
|
+
onEscape?: () => void;
|
|
15
|
+
onKeyDown?: (key: string) => void;
|
|
16
|
+
onBlur?: () => void;
|
|
17
|
+
modal?: boolean;
|
|
18
|
+
}
|
|
19
|
+
export declare function Pressable(props: PressableProps): VNode;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { type BaseProps, type VNode } from "../jsx-runtime";
|
|
2
|
+
import type { SyntaxTheme } from "../../../protocol/src/index";
|
|
3
|
+
interface RichProps extends Omit<BaseProps, "children"> {
|
|
4
|
+
/** Overrides syntax colours without changing parsing or layout. */
|
|
5
|
+
syntaxTheme?: Partial<SyntaxTheme>;
|
|
6
|
+
}
|
|
7
|
+
export interface MarkdownProps extends RichProps {
|
|
8
|
+
source: string;
|
|
9
|
+
/** Overrides the default platform URI action for a clicked Markdown link. */
|
|
10
|
+
onLinkClick?: (href: string) => void;
|
|
11
|
+
}
|
|
12
|
+
export interface CodeProps extends RichProps {
|
|
13
|
+
code: string;
|
|
14
|
+
/** Syntect syntax name, token, or file extension. */
|
|
15
|
+
language?: string;
|
|
16
|
+
/** Optional path used for extension-based language detection. */
|
|
17
|
+
path?: string;
|
|
18
|
+
/** Paint line numbers as non-selectable chrome. */
|
|
19
|
+
showLineNumbers?: boolean;
|
|
20
|
+
}
|
|
21
|
+
export interface DiffProps extends RichProps {
|
|
22
|
+
/** A unified or git diff. */
|
|
23
|
+
source?: string;
|
|
24
|
+
/** Supply both oldText and newText to calculate a diff natively. */
|
|
25
|
+
oldText?: string;
|
|
26
|
+
newText?: string;
|
|
27
|
+
/** Enables/disables word-level emphasis inside paired changed lines. Default: true. */
|
|
28
|
+
wordDiff?: boolean;
|
|
29
|
+
/** File paths rendered as headers only. */
|
|
30
|
+
collapsedPaths?: string[];
|
|
31
|
+
/** Maximum changed/context lines to render per file before a Show more row. */
|
|
32
|
+
maxLines?: number;
|
|
33
|
+
onToggleFile?: (path: string) => void;
|
|
34
|
+
onShowMore?: (hidden: number, path?: string) => void;
|
|
35
|
+
onLineClick?: (event: {
|
|
36
|
+
text: string;
|
|
37
|
+
path?: string;
|
|
38
|
+
oldLine?: number;
|
|
39
|
+
newLine?: number;
|
|
40
|
+
}) => void;
|
|
41
|
+
}
|
|
42
|
+
export declare function Markdown(props: MarkdownProps): VNode;
|
|
43
|
+
export declare function Code(props: CodeProps): VNode;
|
|
44
|
+
export declare function Diff(props: DiffProps): VNode;
|
|
45
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { VNode } from "../jsx-runtime";
|
|
2
|
+
import type { ScrollOrientation, ScrollPosition } from "../../../protocol/src/index";
|
|
3
|
+
import { type ViewProps } from "./layout";
|
|
4
|
+
export interface ScrollProps extends ViewProps {
|
|
5
|
+
speed?: number;
|
|
6
|
+
orientation?: ScrollOrientation;
|
|
7
|
+
onScroll?: (offset: number, max: number) => void;
|
|
8
|
+
onScrollPosition?: (position: ScrollPosition) => void;
|
|
9
|
+
}
|
|
10
|
+
export declare function Scroll({ speed, orientation, ...props }: ScrollProps): VNode;
|
|
11
|
+
export declare const ScrollArea: typeof Scroll;
|
|
12
|
+
export type ScrollAreaProps = ScrollProps;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type { SvgAttributes, SvgNode } from "../../../protocol/src/index";
|
|
2
|
+
import { type BaseProps, type VNode } from "../jsx-runtime";
|
|
3
|
+
export interface SvgProps extends BaseProps {
|
|
4
|
+
size?: number;
|
|
5
|
+
width?: number;
|
|
6
|
+
height?: number;
|
|
7
|
+
viewBox?: string | readonly [number, number, number, number];
|
|
8
|
+
color?: string;
|
|
9
|
+
fill?: string;
|
|
10
|
+
stroke?: string;
|
|
11
|
+
strokeWidth?: number;
|
|
12
|
+
strokeLinecap?: "butt" | "round" | "square";
|
|
13
|
+
strokeLinejoin?: "miter" | "round" | "bevel";
|
|
14
|
+
nodes?: readonly SvgNode[];
|
|
15
|
+
}
|
|
16
|
+
interface SvgElementProps {
|
|
17
|
+
[key: string]: SvgAttributes[string] | undefined;
|
|
18
|
+
}
|
|
19
|
+
export interface PathProps extends SvgElementProps {
|
|
20
|
+
d: string;
|
|
21
|
+
}
|
|
22
|
+
export interface CircleProps extends SvgElementProps {
|
|
23
|
+
cx: number | string;
|
|
24
|
+
cy: number | string;
|
|
25
|
+
r: number | string;
|
|
26
|
+
}
|
|
27
|
+
export interface EllipseProps extends SvgElementProps {
|
|
28
|
+
cx: number | string;
|
|
29
|
+
cy: number | string;
|
|
30
|
+
rx: number | string;
|
|
31
|
+
ry: number | string;
|
|
32
|
+
}
|
|
33
|
+
export interface LineProps extends SvgElementProps {
|
|
34
|
+
x1: number | string;
|
|
35
|
+
y1: number | string;
|
|
36
|
+
x2: number | string;
|
|
37
|
+
y2: number | string;
|
|
38
|
+
}
|
|
39
|
+
export interface PolylineProps extends SvgElementProps {
|
|
40
|
+
points: string;
|
|
41
|
+
}
|
|
42
|
+
export interface PolygonProps extends SvgElementProps {
|
|
43
|
+
points: string;
|
|
44
|
+
}
|
|
45
|
+
export interface RectProps extends SvgElementProps {
|
|
46
|
+
x?: number | string;
|
|
47
|
+
y?: number | string;
|
|
48
|
+
width: number | string;
|
|
49
|
+
height: number | string;
|
|
50
|
+
rx?: number | string;
|
|
51
|
+
ry?: number | string;
|
|
52
|
+
}
|
|
53
|
+
export declare const Path: (props: PathProps) => VNode;
|
|
54
|
+
export declare const Circle: (props: CircleProps) => VNode;
|
|
55
|
+
export declare const Ellipse: (props: EllipseProps) => VNode;
|
|
56
|
+
export declare const Line: (props: LineProps) => VNode;
|
|
57
|
+
export declare const Polyline: (props: PolylineProps) => VNode;
|
|
58
|
+
export declare const Polygon: (props: PolygonProps) => VNode;
|
|
59
|
+
export declare const SvgRect: (props: RectProps) => VNode;
|
|
60
|
+
export declare function Svg({ size, width, height, viewBox, color, fill, stroke, strokeWidth, strokeLinecap, strokeLinejoin, nodes, children, style, ...props }: SvgProps): VNode;
|
|
61
|
+
export type { SvgAttributes, SvgNode };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type BaseProps, type Child, type IntrinsicStyle, type VNode } from "../jsx-runtime";
|
|
2
|
+
export interface TextProps extends Omit<BaseProps, "style"> {
|
|
3
|
+
size?: number;
|
|
4
|
+
weight?: number;
|
|
5
|
+
color?: string;
|
|
6
|
+
style?: IntrinsicStyle;
|
|
7
|
+
children?: Child;
|
|
8
|
+
}
|
|
9
|
+
export declare function Text({ size, weight, color, style, ...props }: TextProps): VNode;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type VNode } from "../jsx-runtime";
|
|
2
|
+
import { type ViewProps } from "./layout";
|
|
3
|
+
export interface TitleBarProps extends ViewProps {
|
|
4
|
+
title?: string;
|
|
5
|
+
height?: number;
|
|
6
|
+
showMinimize?: boolean;
|
|
7
|
+
showMaximize?: boolean;
|
|
8
|
+
showClose?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare function TitleBar({ title, height, showMinimize, showMaximize, showClose, children, style, ...props }: TitleBarProps): VNode;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { WindowPosition } from "../../../protocol/src/index";
|
|
2
|
+
import type { VNode } from "../jsx-runtime";
|
|
3
|
+
import { type ThemeDefinition } from "../theme";
|
|
4
|
+
import { type ViewProps } from "./layout";
|
|
5
|
+
export interface WindowProps extends ViewProps {
|
|
6
|
+
title?: string;
|
|
7
|
+
width?: number;
|
|
8
|
+
height?: number;
|
|
9
|
+
minWidth?: number;
|
|
10
|
+
minHeight?: number;
|
|
11
|
+
resizable?: boolean;
|
|
12
|
+
position?: WindowPosition;
|
|
13
|
+
theme?: ThemeDefinition;
|
|
14
|
+
onCloseRequest?: (event: WindowCloseRequestEvent) => void;
|
|
15
|
+
}
|
|
16
|
+
export interface WindowCloseRequestEvent {
|
|
17
|
+
readonly defaultPrevented: boolean;
|
|
18
|
+
preventDefault(): void;
|
|
19
|
+
}
|
|
20
|
+
export declare function Window(props: WindowProps): VNode;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Public primitive-component barrel.
|
|
3
|
+
*
|
|
4
|
+
* Implementations live under ./components/ so unrelated primitives can evolve
|
|
5
|
+
* independently while existing imports from "./components" remain stable.
|
|
6
|
+
*/
|
|
7
|
+
export { View, Row, Column, Portal } from "./components/layout";
|
|
8
|
+
export type { ViewProps, PortalProps } from "./components/layout";
|
|
9
|
+
export { Window } from "./components/window";
|
|
10
|
+
export type { WindowProps, WindowCloseRequestEvent } from "./components/window";
|
|
11
|
+
export { Pressable } from "./components/pressable";
|
|
12
|
+
export type { PressableProps } from "./components/pressable";
|
|
13
|
+
export { Link } from "./components/link";
|
|
14
|
+
export type { LinkProps } from "./components/link";
|
|
15
|
+
export { Icon } from "./components/icon";
|
|
16
|
+
export type { IconName, IconProps } from "./components/icon";
|
|
17
|
+
export { Svg, Path, Circle, Ellipse, Line, Polyline, Polygon, SvgRect } from "./components/svg";
|
|
18
|
+
export type { SvgProps, PathProps, CircleProps, EllipseProps, LineProps, PolylineProps, PolygonProps, RectProps, SvgAttributes, SvgNode, } from "./components/svg";
|
|
19
|
+
export { Text } from "./components/text";
|
|
20
|
+
export type { TextProps } from "./components/text";
|
|
21
|
+
export { Markdown, Code, Diff } from "./components/rich-content";
|
|
22
|
+
export type { MarkdownProps, CodeProps, DiffProps } from "./components/rich-content";
|
|
23
|
+
export { Button } from "./components/button";
|
|
24
|
+
export type { ButtonProps } from "./components/button";
|
|
25
|
+
export { Image, clearImageSourceCache, loadImageSource } from "./components/image";
|
|
26
|
+
export type { ImageBytesSource, ImageHttpCacheMode, ImageProps, ImageRgbaSource, ImageSource, LoadImageSourceOptions } from "./components/image";
|
|
27
|
+
export { Scroll, ScrollArea } from "./components/scroll";
|
|
28
|
+
export type { ScrollProps, ScrollAreaProps } from "./components/scroll";
|
|
29
|
+
export { Input, TextArea } from "./components/input";
|
|
30
|
+
export type { InputType, InputProps, TextAreaProps } from "./components/input";
|
|
31
|
+
export { TitleBar } from "./components/titlebar";
|
|
32
|
+
export type { TitleBarProps } from "./components/titlebar";
|
|
33
|
+
export { Modal, Dialog } from "./components/modal";
|
|
34
|
+
export type { ModalProps, DialogProps } from "./components/modal";
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { type BaseProps, type Child, type VNode } from "./jsx-runtime";
|
|
2
|
+
import { type ViewProps } from "./components";
|
|
3
|
+
export interface CheckboxProps extends BaseProps {
|
|
4
|
+
checked: boolean;
|
|
5
|
+
label: string;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
onCheckedChange?: (checked: boolean) => void;
|
|
8
|
+
}
|
|
9
|
+
export declare function Checkbox({ checked, label, disabled, onCheckedChange, style, ...props }: CheckboxProps): VNode;
|
|
10
|
+
export interface SwitchProps extends BaseProps {
|
|
11
|
+
checked: boolean;
|
|
12
|
+
label: string;
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
onCheckedChange?: (checked: boolean) => void;
|
|
15
|
+
}
|
|
16
|
+
export declare function Switch({ checked, label, disabled, onCheckedChange, style, ...props }: SwitchProps): VNode;
|
|
17
|
+
export interface RadioOption {
|
|
18
|
+
value: string;
|
|
19
|
+
label: string;
|
|
20
|
+
disabled?: boolean;
|
|
21
|
+
}
|
|
22
|
+
export interface RadioGroupProps extends BaseProps {
|
|
23
|
+
value: string;
|
|
24
|
+
options: RadioOption[];
|
|
25
|
+
orientation?: "horizontal" | "vertical";
|
|
26
|
+
disabled?: boolean;
|
|
27
|
+
onValueChange?: (value: string) => void;
|
|
28
|
+
}
|
|
29
|
+
export declare function RadioGroup({ value, options, orientation, disabled, onValueChange, style, ...props }: RadioGroupProps): VNode;
|
|
30
|
+
export interface SliderProps extends BaseProps {
|
|
31
|
+
value: number;
|
|
32
|
+
min?: number;
|
|
33
|
+
max?: number;
|
|
34
|
+
step?: number;
|
|
35
|
+
label?: string;
|
|
36
|
+
orientation?: "horizontal" | "vertical";
|
|
37
|
+
disabled?: boolean;
|
|
38
|
+
onValueChange?: (value: number) => void;
|
|
39
|
+
}
|
|
40
|
+
export declare function Slider({ value, min, max, step, label, orientation, disabled, onValueChange, style, ...props }: SliderProps): VNode;
|
|
41
|
+
export interface CardProps extends ViewProps {
|
|
42
|
+
title?: string;
|
|
43
|
+
description?: string;
|
|
44
|
+
footer?: Child;
|
|
45
|
+
}
|
|
46
|
+
export declare function Card({ title, description, footer, children, style, ...props }: CardProps): VNode;
|
|
47
|
+
export interface BadgeProps extends BaseProps {
|
|
48
|
+
variant?: "default" | "secondary" | "outline" | "destructive";
|
|
49
|
+
}
|
|
50
|
+
export declare function Badge({ variant, style, ...props }: BadgeProps): VNode;
|
|
51
|
+
export interface SeparatorProps extends BaseProps {
|
|
52
|
+
orientation?: "horizontal" | "vertical";
|
|
53
|
+
}
|
|
54
|
+
export declare function Separator({ orientation, style, ...props }: SeparatorProps): VNode;
|
|
55
|
+
export interface ProgressProps extends BaseProps {
|
|
56
|
+
value: number;
|
|
57
|
+
max?: number;
|
|
58
|
+
label?: string;
|
|
59
|
+
}
|
|
60
|
+
export declare function Progress({ value, max, label, style, ...props }: ProgressProps): VNode;
|
|
61
|
+
export interface TabItem {
|
|
62
|
+
value: string;
|
|
63
|
+
label: string;
|
|
64
|
+
content: Child;
|
|
65
|
+
disabled?: boolean;
|
|
66
|
+
}
|
|
67
|
+
export interface TabsProps extends BaseProps {
|
|
68
|
+
value: string;
|
|
69
|
+
items: TabItem[];
|
|
70
|
+
onValueChange?: (value: string) => void;
|
|
71
|
+
}
|
|
72
|
+
export declare function Tabs({ value, items, onValueChange, style, ...props }: TabsProps): VNode;
|
|
73
|
+
export interface AccordionItem {
|
|
74
|
+
value: string;
|
|
75
|
+
title: string;
|
|
76
|
+
content: Child;
|
|
77
|
+
disabled?: boolean;
|
|
78
|
+
}
|
|
79
|
+
export interface AccordionProps extends BaseProps {
|
|
80
|
+
value?: string;
|
|
81
|
+
items: AccordionItem[];
|
|
82
|
+
onValueChange?: (value: string | undefined) => void;
|
|
83
|
+
}
|
|
84
|
+
export declare function Accordion({ value, items, onValueChange, style, ...props }: AccordionProps): VNode;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import type { Style } from "../../protocol/src/index";
|
|
2
|
+
import { type BaseProps, type Child, type VNode } from "./jsx-runtime";
|
|
3
|
+
import { type IconName } from "./components";
|
|
4
|
+
export interface TreeNode<T = unknown> {
|
|
5
|
+
id: string;
|
|
6
|
+
label: string;
|
|
7
|
+
children?: readonly TreeNode<T>[];
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
icon?: IconName;
|
|
10
|
+
data?: T;
|
|
11
|
+
}
|
|
12
|
+
export interface TreeViewProps<T = unknown> extends BaseProps {
|
|
13
|
+
nodes: readonly TreeNode<T>[];
|
|
14
|
+
expandedIds?: readonly string[];
|
|
15
|
+
selectedId?: string;
|
|
16
|
+
indent?: number;
|
|
17
|
+
rowHeight?: number;
|
|
18
|
+
onExpandedChange?: (ids: string[]) => void;
|
|
19
|
+
onSelectedChange?: (id: string, node: TreeNode<T>) => void;
|
|
20
|
+
onActivate?: (id: string, node: TreeNode<T>) => void;
|
|
21
|
+
}
|
|
22
|
+
/** Controlled desktop tree with roving keyboard focus and explicit expansion/selection state. */
|
|
23
|
+
export declare function TreeView<T>({ nodes, expandedIds, selectedId, indent, rowHeight, onExpandedChange, onSelectedChange, onActivate, style, id, ...props }: TreeViewProps<T>): VNode;
|
|
24
|
+
export type DataGridKey = string | number;
|
|
25
|
+
export type DataGridSortDirection = "asc" | "desc";
|
|
26
|
+
export interface DataGridSort {
|
|
27
|
+
column: string;
|
|
28
|
+
direction: DataGridSortDirection;
|
|
29
|
+
}
|
|
30
|
+
export interface DataGridColumn<T> {
|
|
31
|
+
key: string;
|
|
32
|
+
header: Child;
|
|
33
|
+
value?: (row: T, index: number) => unknown;
|
|
34
|
+
render?: (row: T, index: number) => Child;
|
|
35
|
+
width?: Style["width"];
|
|
36
|
+
align?: Style["align"];
|
|
37
|
+
sortable?: boolean;
|
|
38
|
+
searchable?: boolean;
|
|
39
|
+
compare?: (a: T, b: T) => number;
|
|
40
|
+
}
|
|
41
|
+
export interface DataGridProps<T> extends BaseProps {
|
|
42
|
+
columns: readonly DataGridColumn<T>[];
|
|
43
|
+
rows: readonly T[];
|
|
44
|
+
rowKey: (row: T, index: number) => DataGridKey;
|
|
45
|
+
height?: number;
|
|
46
|
+
rowHeight?: number;
|
|
47
|
+
offset?: number;
|
|
48
|
+
overscan?: number;
|
|
49
|
+
sort?: DataGridSort;
|
|
50
|
+
sortMode?: "local" | "manual";
|
|
51
|
+
filter?: string;
|
|
52
|
+
filterMode?: "local" | "manual";
|
|
53
|
+
selectionMode?: "none" | "single" | "multiple";
|
|
54
|
+
selectedKeys?: readonly DataGridKey[];
|
|
55
|
+
empty?: Child;
|
|
56
|
+
onSortChange?: (sort: DataGridSort | undefined) => void;
|
|
57
|
+
onSelectionChange?: (keys: DataGridKey[]) => void;
|
|
58
|
+
onRowActivate?: (row: T, index: number) => void;
|
|
59
|
+
onScroll?: (offset: number, max: number) => void;
|
|
60
|
+
}
|
|
61
|
+
/** Virtualized controlled data grid with local/manual sort, filtering and row selection. */
|
|
62
|
+
export declare function DataGrid<T>({ columns, rows, rowKey, height, rowHeight, offset, overscan, sort, sortMode, filter, filterMode, selectionMode, selectedKeys, empty, onSortChange, onSelectionChange, onRowActivate, onScroll, style, id, ...props }: DataGridProps<T>): VNode;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type VNode } from "./jsx-runtime";
|
|
2
|
+
import type { AppErrorEvent } from "./app";
|
|
3
|
+
export declare const DEV_ERROR_DISMISS_ID = "__tarve-dev-error-dismiss";
|
|
4
|
+
/** Development-only error screen rendered in place of the app view. */
|
|
5
|
+
export declare function DevErrorOverlay(props: {
|
|
6
|
+
event: AppErrorEvent;
|
|
7
|
+
onDismiss: () => void;
|
|
8
|
+
decorations?: boolean;
|
|
9
|
+
}): VNode;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/** Native APIs cannot open Bun's virtual files. Resolve them once before sending the scene. */
|
|
2
|
+
export declare function nativeAssetPath(source: string): string;
|
|
3
|
+
/** Give native libraries a physical path for an asset embedded in a Bun executable. */
|
|
4
|
+
export declare function materializeAsset(source: string, filename: string): string;
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
import type { Style } from "../../protocol/src/index";
|
|
2
|
+
import { type BaseProps, type Child, type VNode } from "./jsx-runtime";
|
|
3
|
+
import { type ButtonProps } from "./components";
|
|
4
|
+
export interface SkeletonProps extends BaseProps {
|
|
5
|
+
width?: Style["width"];
|
|
6
|
+
height?: Style["height"];
|
|
7
|
+
radius?: number;
|
|
8
|
+
}
|
|
9
|
+
export declare function Skeleton({ width, height, radius, style, ...props }: SkeletonProps): VNode;
|
|
10
|
+
export interface SpinnerProps extends BaseProps {
|
|
11
|
+
size?: number;
|
|
12
|
+
label?: string;
|
|
13
|
+
}
|
|
14
|
+
/** A renderer-only loading indicator. Animation can be added once transforms/animation exist natively. */
|
|
15
|
+
export declare function Spinner({ size, label, style, ...props }: SpinnerProps): VNode;
|
|
16
|
+
export interface AvatarProps extends BaseProps {
|
|
17
|
+
src?: string;
|
|
18
|
+
fallback?: string;
|
|
19
|
+
size?: number;
|
|
20
|
+
fit?: "cover" | "contain";
|
|
21
|
+
}
|
|
22
|
+
export declare function Avatar({ src, fallback, size, fit, style, id, ...props }: AvatarProps): VNode;
|
|
23
|
+
export interface BreadcrumbItem {
|
|
24
|
+
label: string;
|
|
25
|
+
disabled?: boolean;
|
|
26
|
+
onClick?: () => void;
|
|
27
|
+
}
|
|
28
|
+
export interface BreadcrumbProps extends BaseProps {
|
|
29
|
+
items: BreadcrumbItem[];
|
|
30
|
+
separator?: Child;
|
|
31
|
+
}
|
|
32
|
+
export declare function Breadcrumb({ items, separator, style, id, ...props }: BreadcrumbProps): VNode;
|
|
33
|
+
export interface PaginationProps extends BaseProps {
|
|
34
|
+
page: number;
|
|
35
|
+
pageCount: number;
|
|
36
|
+
siblingCount?: number;
|
|
37
|
+
disabled?: boolean;
|
|
38
|
+
onPageChange?: (page: number) => void;
|
|
39
|
+
}
|
|
40
|
+
export declare function Pagination({ page, pageCount, siblingCount, disabled, onPageChange, style, id, ...props }: PaginationProps): VNode;
|
|
41
|
+
export type CalendarWeekStartsOn = 0 | 1 | 2 | 3 | 4 | 5 | 6;
|
|
42
|
+
export interface CalendarProps extends BaseProps {
|
|
43
|
+
month: string;
|
|
44
|
+
value?: string;
|
|
45
|
+
min?: string;
|
|
46
|
+
max?: string;
|
|
47
|
+
weekStartsOn?: CalendarWeekStartsOn;
|
|
48
|
+
disabled?: boolean;
|
|
49
|
+
isDateDisabled?: (date: string) => boolean;
|
|
50
|
+
onValueChange?: (date: string) => void;
|
|
51
|
+
onMonthChange?: (month: string) => void;
|
|
52
|
+
}
|
|
53
|
+
export declare function Calendar({ month, value, min, max, weekStartsOn, disabled, isDateDisabled, onValueChange, onMonthChange, style, id, ...props }: CalendarProps): VNode;
|
|
54
|
+
export interface DatePickerProps extends BaseProps {
|
|
55
|
+
open: boolean;
|
|
56
|
+
month: string;
|
|
57
|
+
value?: string;
|
|
58
|
+
placeholder?: string;
|
|
59
|
+
min?: string;
|
|
60
|
+
max?: string;
|
|
61
|
+
weekStartsOn?: CalendarWeekStartsOn;
|
|
62
|
+
disabled?: boolean;
|
|
63
|
+
isDateDisabled?: (date: string) => boolean;
|
|
64
|
+
formatValue?: (date: string) => string;
|
|
65
|
+
onOpenChange?: (open: boolean) => void;
|
|
66
|
+
onValueChange?: (date: string) => void;
|
|
67
|
+
onMonthChange?: (month: string) => void;
|
|
68
|
+
}
|
|
69
|
+
export declare function DatePicker({ open, month, value, placeholder, min, max, weekStartsOn, disabled, isDateDisabled, formatValue, onOpenChange, onValueChange, onMonthChange, style, id, ...props }: DatePickerProps): VNode;
|
|
70
|
+
export interface CollapsibleProps extends BaseProps {
|
|
71
|
+
open: boolean;
|
|
72
|
+
trigger: Child;
|
|
73
|
+
label?: string;
|
|
74
|
+
disabled?: boolean;
|
|
75
|
+
onOpenChange?: (open: boolean) => void;
|
|
76
|
+
}
|
|
77
|
+
export declare function Collapsible({ open, trigger, label, disabled, onOpenChange, children, style, id, ...props }: CollapsibleProps): VNode;
|
|
78
|
+
export interface TableColumn<T> {
|
|
79
|
+
key: string;
|
|
80
|
+
header: Child;
|
|
81
|
+
accessor?: keyof T | ((row: T, index: number) => Child);
|
|
82
|
+
render?: (row: T, index: number) => Child;
|
|
83
|
+
width?: Style["width"];
|
|
84
|
+
align?: Style["align"];
|
|
85
|
+
}
|
|
86
|
+
export interface TableProps<T> extends BaseProps {
|
|
87
|
+
columns: TableColumn<T>[];
|
|
88
|
+
data: T[];
|
|
89
|
+
rowKey?: (row: T, index: number) => string | number;
|
|
90
|
+
empty?: Child;
|
|
91
|
+
onRowClick?: (row: T, index: number) => void;
|
|
92
|
+
}
|
|
93
|
+
export declare function Table<T>({ columns, data, rowKey, empty, onRowClick, style, id, ...props }: TableProps<T>): VNode;
|
|
94
|
+
export type DataTableProps<T> = TableProps<T>;
|
|
95
|
+
export declare function DataTable<T>(props: DataTableProps<T>): VNode;
|
|
96
|
+
export interface AlertDialogProps extends BaseProps {
|
|
97
|
+
open: boolean;
|
|
98
|
+
title: string;
|
|
99
|
+
description?: string;
|
|
100
|
+
cancelLabel?: string;
|
|
101
|
+
actionLabel?: string;
|
|
102
|
+
actionVariant?: ButtonProps["variant"];
|
|
103
|
+
actionDisabled?: boolean;
|
|
104
|
+
closeOnEscape?: boolean;
|
|
105
|
+
onCancel?: () => void;
|
|
106
|
+
onAction?: () => void;
|
|
107
|
+
onOpenChange?: (open: boolean) => void;
|
|
108
|
+
}
|
|
109
|
+
export declare function AlertDialog({ open, title, description, cancelLabel, actionLabel, actionVariant, actionDisabled, closeOnEscape, onCancel, onAction, onOpenChange, children, style, id, ...props }: AlertDialogProps): VNode;
|
|
110
|
+
export type SheetSide = "left" | "right" | "top" | "bottom";
|
|
111
|
+
export interface SheetProps extends BaseProps {
|
|
112
|
+
open: boolean;
|
|
113
|
+
side?: SheetSide;
|
|
114
|
+
size?: Style["width"];
|
|
115
|
+
title?: string;
|
|
116
|
+
description?: string;
|
|
117
|
+
footer?: Child;
|
|
118
|
+
closeOnOverlay?: boolean;
|
|
119
|
+
closeOnEscape?: boolean;
|
|
120
|
+
showClose?: boolean;
|
|
121
|
+
onOpenChange?: (open: boolean) => void;
|
|
122
|
+
}
|
|
123
|
+
export declare function Sheet({ open, side, size, title, description, footer, closeOnOverlay, closeOnEscape, showClose, onOpenChange, children, style, id, ...props }: SheetProps): VNode;
|
|
124
|
+
export type ToastVariant = "default" | "success" | "destructive";
|
|
125
|
+
export interface ToastAction {
|
|
126
|
+
label: string;
|
|
127
|
+
onClick: () => void;
|
|
128
|
+
}
|
|
129
|
+
export interface ToastItem {
|
|
130
|
+
id: string;
|
|
131
|
+
title: string;
|
|
132
|
+
description?: string;
|
|
133
|
+
variant?: ToastVariant;
|
|
134
|
+
action?: ToastAction;
|
|
135
|
+
}
|
|
136
|
+
export interface ToastProps extends BaseProps {
|
|
137
|
+
id: string;
|
|
138
|
+
title: string;
|
|
139
|
+
description?: string;
|
|
140
|
+
variant?: ToastVariant;
|
|
141
|
+
action?: ToastAction;
|
|
142
|
+
onDismiss?: (id: string) => void;
|
|
143
|
+
}
|
|
144
|
+
export declare function Toast({ id, title, description, variant, action, onDismiss, style, ...props }: ToastProps): VNode;
|
|
145
|
+
export type ToasterPosition = "top-left" | "top-right" | "bottom-left" | "bottom-right";
|
|
146
|
+
export interface ToasterProps extends BaseProps {
|
|
147
|
+
toasts: ToastItem[];
|
|
148
|
+
position?: ToasterPosition;
|
|
149
|
+
onDismiss?: (id: string) => void;
|
|
150
|
+
}
|
|
151
|
+
/** Render-driven toaster: callers own the toast array and remove items in onDismiss. */
|
|
152
|
+
export declare function Toaster({ toasts, position, onDismiss, style, id, ...props }: ToasterProps): VNode;
|
|
153
|
+
export interface MenubarItem {
|
|
154
|
+
value: string;
|
|
155
|
+
label: string;
|
|
156
|
+
disabled?: boolean;
|
|
157
|
+
checked?: boolean;
|
|
158
|
+
shortcut?: string;
|
|
159
|
+
onSelect?: () => void;
|
|
160
|
+
}
|
|
161
|
+
export interface MenubarMenu {
|
|
162
|
+
value: string;
|
|
163
|
+
label: string;
|
|
164
|
+
disabled?: boolean;
|
|
165
|
+
items: MenubarItem[];
|
|
166
|
+
}
|
|
167
|
+
export interface MenubarProps extends BaseProps {
|
|
168
|
+
menus: MenubarMenu[];
|
|
169
|
+
openMenu?: string;
|
|
170
|
+
onOpenMenuChange?: (value: string | undefined) => void;
|
|
171
|
+
onSelect?: (menuValue: string, itemValue: string) => void;
|
|
172
|
+
}
|
|
173
|
+
export declare function Menubar({ menus, openMenu, onOpenMenuChange, onSelect, style, id, ...props }: MenubarProps): VNode;
|
|
174
|
+
export type HoverCardSide = "top" | "right" | "bottom" | "left";
|
|
175
|
+
export interface HoverCardProps extends BaseProps {
|
|
176
|
+
open: boolean;
|
|
177
|
+
trigger: Child;
|
|
178
|
+
side?: HoverCardSide;
|
|
179
|
+
width?: Style["width"];
|
|
180
|
+
onOpenChange?: (open: boolean) => void;
|
|
181
|
+
}
|
|
182
|
+
export declare function HoverCard({ open, trigger, side, width, onOpenChange, children, style, id, ...props }: HoverCardProps): VNode;
|