@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,118 @@
|
|
|
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
|
+
import { type SelectOption } from "./select";
|
|
5
|
+
export type AlertVariant = "default" | "destructive" | "success";
|
|
6
|
+
export interface AlertProps extends BaseProps {
|
|
7
|
+
title?: string;
|
|
8
|
+
description?: string;
|
|
9
|
+
variant?: AlertVariant;
|
|
10
|
+
icon?: Child;
|
|
11
|
+
}
|
|
12
|
+
export declare function Alert({ title, description, variant, icon, children, style, ...props }: AlertProps): VNode;
|
|
13
|
+
export interface AspectRatioProps extends BaseProps {
|
|
14
|
+
ratio: number;
|
|
15
|
+
width?: Style["width"];
|
|
16
|
+
}
|
|
17
|
+
export declare function AspectRatio({ ratio, width, style, children, ...props }: AspectRatioProps): VNode;
|
|
18
|
+
export interface ButtonGroupProps extends BaseProps {
|
|
19
|
+
orientation?: "horizontal" | "vertical";
|
|
20
|
+
gap?: number;
|
|
21
|
+
}
|
|
22
|
+
export declare function ButtonGroup({ orientation, gap, style, children, ...props }: ButtonGroupProps): VNode;
|
|
23
|
+
export interface EmptyProps extends BaseProps {
|
|
24
|
+
title: string;
|
|
25
|
+
description?: string;
|
|
26
|
+
icon?: Child;
|
|
27
|
+
action?: Child;
|
|
28
|
+
}
|
|
29
|
+
export declare function Empty({ title, description, icon, action, children, style, ...props }: EmptyProps): VNode;
|
|
30
|
+
export interface LabelProps extends BaseProps {
|
|
31
|
+
required?: boolean;
|
|
32
|
+
disabled?: boolean;
|
|
33
|
+
onClick?: () => void;
|
|
34
|
+
}
|
|
35
|
+
export declare function Label({ required, disabled, onClick, children, style, ...props }: LabelProps): VNode;
|
|
36
|
+
export interface FieldProps extends BaseProps {
|
|
37
|
+
label?: string;
|
|
38
|
+
description?: string;
|
|
39
|
+
error?: string;
|
|
40
|
+
required?: boolean;
|
|
41
|
+
disabled?: boolean;
|
|
42
|
+
}
|
|
43
|
+
export declare function Field({ label, description, error, required, disabled, children, style, id, ...props }: FieldProps): VNode;
|
|
44
|
+
export interface InputGroupProps extends BaseProps {
|
|
45
|
+
prefix?: Child;
|
|
46
|
+
suffix?: Child;
|
|
47
|
+
disabled?: boolean;
|
|
48
|
+
}
|
|
49
|
+
export declare function InputGroup({ prefix, suffix, disabled, children, style, ...props }: InputGroupProps): VNode;
|
|
50
|
+
export interface InputOTPProps extends BaseProps {
|
|
51
|
+
value: string;
|
|
52
|
+
length?: number;
|
|
53
|
+
disabled?: boolean;
|
|
54
|
+
mask?: boolean;
|
|
55
|
+
pattern?: RegExp;
|
|
56
|
+
onValueChange?: (value: string) => void;
|
|
57
|
+
slotWidth?: number;
|
|
58
|
+
}
|
|
59
|
+
export declare function InputOTP({ value, length, disabled, mask, pattern, onValueChange, slotWidth, style, id, ...props }: InputOTPProps): VNode;
|
|
60
|
+
export interface ItemProps extends BaseProps {
|
|
61
|
+
title: string;
|
|
62
|
+
description?: string;
|
|
63
|
+
leading?: Child;
|
|
64
|
+
trailing?: Child;
|
|
65
|
+
disabled?: boolean;
|
|
66
|
+
selected?: boolean;
|
|
67
|
+
onClick?: () => void;
|
|
68
|
+
}
|
|
69
|
+
export declare function Item({ title, description, leading, trailing, disabled, selected, onClick, style, ...props }: ItemProps): VNode;
|
|
70
|
+
export interface KbdProps extends BaseProps {
|
|
71
|
+
}
|
|
72
|
+
export declare function Kbd({ children, style, ...props }: KbdProps): VNode;
|
|
73
|
+
export interface NativeSelectProps extends Omit<BaseProps, "children"> {
|
|
74
|
+
id: string;
|
|
75
|
+
value?: string;
|
|
76
|
+
options: readonly SelectOption[];
|
|
77
|
+
placeholder?: string;
|
|
78
|
+
disabled?: boolean;
|
|
79
|
+
open?: boolean;
|
|
80
|
+
onOpenChange?: (open: boolean) => void;
|
|
81
|
+
onValueChange?: (value: string) => void;
|
|
82
|
+
}
|
|
83
|
+
export declare function NativeSelect(props: NativeSelectProps): VNode;
|
|
84
|
+
export interface ToggleProps extends BaseProps {
|
|
85
|
+
pressed: boolean;
|
|
86
|
+
label?: string;
|
|
87
|
+
disabled?: boolean;
|
|
88
|
+
variant?: "default" | "outline";
|
|
89
|
+
size?: ButtonProps["size"];
|
|
90
|
+
onPressedChange?: (pressed: boolean) => void;
|
|
91
|
+
}
|
|
92
|
+
export declare function Toggle({ pressed, label, disabled, variant, size, onPressedChange, children, style, ...props }: ToggleProps): VNode;
|
|
93
|
+
export interface ToggleGroupItem {
|
|
94
|
+
value: string;
|
|
95
|
+
label: string;
|
|
96
|
+
content?: Child;
|
|
97
|
+
disabled?: boolean;
|
|
98
|
+
}
|
|
99
|
+
export interface ToggleGroupProps extends BaseProps {
|
|
100
|
+
type?: "single" | "multiple";
|
|
101
|
+
value: string | string[];
|
|
102
|
+
items: readonly ToggleGroupItem[];
|
|
103
|
+
disabled?: boolean;
|
|
104
|
+
onValueChange?: (value: string | string[]) => void;
|
|
105
|
+
}
|
|
106
|
+
export declare function ToggleGroup({ type, value, items, disabled, onValueChange, style, id, ...props }: ToggleGroupProps): VNode;
|
|
107
|
+
export type TypographyVariant = "h1" | "h2" | "h3" | "h4" | "p" | "lead" | "large" | "small" | "muted" | "code" | "blockquote";
|
|
108
|
+
export interface TypographyProps extends BaseProps {
|
|
109
|
+
variant?: TypographyVariant;
|
|
110
|
+
}
|
|
111
|
+
export declare function Typography({ variant, children, style, ...props }: TypographyProps): VNode;
|
|
112
|
+
export interface DirectionProps extends BaseProps {
|
|
113
|
+
dir?: "ltr" | "rtl";
|
|
114
|
+
orientation?: "horizontal" | "vertical";
|
|
115
|
+
gap?: number;
|
|
116
|
+
}
|
|
117
|
+
/** Layout direction helper. RTL reverses visual horizontal flow while preserving logical/focus order. Text bidi is not changed. */
|
|
118
|
+
export declare function Direction({ dir, orientation, gap, children, style, ...props }: DirectionProps): VNode;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export { Window, View, Row, Column, Portal, Pressable, Link, Icon, Svg, Path, Circle, Ellipse, Line, Polyline, Polygon, SvgRect, Text, Markdown, Code, Diff, Button, Image, clearImageSourceCache, loadImageSource, Scroll, ScrollArea, Input, TextArea, TitleBar, Modal, Dialog } from "./components";
|
|
2
|
+
export type { WindowProps, WindowCloseRequestEvent, ViewProps, PortalProps, PressableProps, LinkProps, IconName, IconProps, SvgProps, SvgNode, SvgAttributes, PathProps, CircleProps, EllipseProps, LineProps, PolylineProps, PolygonProps, RectProps, TextProps, MarkdownProps, CodeProps, DiffProps, ButtonProps, ImageBytesSource, ImageHttpCacheMode, ImageProps, ImageRgbaSource, ImageSource, LoadImageSourceOptions, ScrollProps, ScrollAreaProps, InputType, InputProps, TextAreaProps, TitleBarProps, ModalProps, DialogProps } from "./components";
|
|
3
|
+
export { Checkbox, Switch, RadioGroup, Slider, Card, Badge, Separator, Progress, Tabs, Accordion } from "./controls";
|
|
4
|
+
export type { CheckboxProps, SwitchProps, RadioOption, RadioGroupProps, SliderProps, CardProps, BadgeProps, SeparatorProps, ProgressProps, TabItem, TabsProps, AccordionItem, AccordionProps } from "./controls";
|
|
5
|
+
export { VirtualList } from "./virtual-list";
|
|
6
|
+
export type { VirtualListProps } from "./virtual-list";
|
|
7
|
+
export { AnimatePresence } from "./motion";
|
|
8
|
+
export type { AnimatePresenceProps } from "./motion";
|
|
9
|
+
export { List } from "./list";
|
|
10
|
+
export type { ListProps } from "./list";
|
|
11
|
+
export { Select } from "./select";
|
|
12
|
+
export type { SelectProps, SelectOption } from "./select";
|
|
13
|
+
export * from "./popups";
|
|
14
|
+
export * from "./extra-controls";
|
|
15
|
+
export * from "./form-controls";
|
|
16
|
+
export * from "./advanced-controls";
|
|
17
|
+
export * from "./chat-controls";
|
|
18
|
+
export * from "./desktop-controls";
|
|
19
|
+
export { normalizeHotkey } from "./hotkeys";
|
|
20
|
+
export { createTextSearchController, findRanges } from "./text-search";
|
|
21
|
+
export type { FindRangesOptions, TextSearchOptions, TextSearchController, TextSearchSnapshot } from "./text-search";
|
|
22
|
+
export type { HotkeyHandler } from "./hotkeys";
|
|
23
|
+
export { createApp, render } from "./app";
|
|
24
|
+
export type { AppErrorEvent, AppErrorSource, AppHandle, AppOptions } from "./app";
|
|
25
|
+
export { TestRenderer, Locator, createTestRenderer, launchTestProcess, waitFor } from "./test-renderer";
|
|
26
|
+
export type { Point, RoleLocatorOptions, TestProcess, TestProcessOptions, TestRendererOptions, TextLocatorOptions, WaitForOptions, WheelOptions } from "./test-renderer";
|
|
27
|
+
export { assertPngMatches, comparePngCaptures, compareRgbaImages, readPngRgba } from "./visual-testing";
|
|
28
|
+
export type { PixelComparison, PixelComparisonOptions, RgbaImage } from "./visual-testing";
|
|
29
|
+
export type { ComponentAdapter, ComponentAdapterInput } from "./component-adapter";
|
|
30
|
+
export { theme, Theme, lightTheme, darkTheme, createTheme, buttonVariants } from "./theme";
|
|
31
|
+
export type { ThemeColors, ThemeFocusOutline, ThemeDefinition, ThemeOverrides, ButtonVariant } from "./theme";
|
|
32
|
+
export { Style } from "./style";
|
|
33
|
+
export type { StateStyle, OutlineStyle, UserSelect, TextDecoration, Renderer, WindowPosition, WindowPositionPreset, FileDialogFilter, FileDialogOptions, ScrollOrientation, ScrollPosition, MotionProperty, MotionEasing, MotionTransition, MotionTransitions, MotionValues } from "../../protocol/src/index";
|
|
34
|
+
export type { VNode, Child, PastePayload } from "./jsx-runtime";
|
|
35
|
+
export { BunFfiBridge, openExternal } from "./bridge";
|
|
36
|
+
export type { NativeBridge, BunFfiBridgeOptions } from "./bridge";
|
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
import type { Control, MotionProperty, MotionValues, StateStyle, Style, SvgNode, TextHighlight } from "../../protocol/src/index";
|
|
2
|
+
import type { ImageSource } from "./components/image";
|
|
3
|
+
export type Child = VNode | string | number | boolean | null | undefined | Child[];
|
|
4
|
+
/** Clipboard content delivered to the focused element when the clipboard holds no text. */
|
|
5
|
+
export type PastePayload = {
|
|
6
|
+
kind: "files";
|
|
7
|
+
files: string[];
|
|
8
|
+
} | {
|
|
9
|
+
kind: "image";
|
|
10
|
+
width: number;
|
|
11
|
+
height: number;
|
|
12
|
+
rgba: Uint8Array;
|
|
13
|
+
};
|
|
14
|
+
export interface BaseProps {
|
|
15
|
+
id?: string;
|
|
16
|
+
key?: string | number;
|
|
17
|
+
children?: Child;
|
|
18
|
+
style?: Style;
|
|
19
|
+
rovingGroup?: boolean;
|
|
20
|
+
highlight?: TextHighlight;
|
|
21
|
+
onHighlight?: (event: {
|
|
22
|
+
matchCount: number;
|
|
23
|
+
}) => void;
|
|
24
|
+
/** Initial numeric values for a native enter transition. */
|
|
25
|
+
motionFrom?: MotionValues;
|
|
26
|
+
onTransitionEnd?: (event: {
|
|
27
|
+
property: MotionProperty;
|
|
28
|
+
}) => void;
|
|
29
|
+
/** Receives non-text clipboard content (files or a bitmap) pasted while focused. */
|
|
30
|
+
onPaste?: (payload: PastePayload) => void;
|
|
31
|
+
}
|
|
32
|
+
export type IntrinsicStateStyle = StateStyle & {
|
|
33
|
+
backgroundColor?: string;
|
|
34
|
+
color?: string;
|
|
35
|
+
};
|
|
36
|
+
export type IntrinsicStyle = Omit<Style, "hover" | "focus" | "focusVisible" | "active" | "disabled"> & {
|
|
37
|
+
/** CSS-like alias for Tarve's native `direction`. */
|
|
38
|
+
flexDirection?: Style["direction"];
|
|
39
|
+
/** CSS-like alias for Tarve's native `background`. */
|
|
40
|
+
backgroundColor?: string;
|
|
41
|
+
/** CSS-like alias for Tarve's native `foreground`. */
|
|
42
|
+
color?: string;
|
|
43
|
+
hover?: IntrinsicStateStyle;
|
|
44
|
+
focus?: IntrinsicStateStyle;
|
|
45
|
+
focusVisible?: IntrinsicStateStyle;
|
|
46
|
+
active?: IntrinsicStateStyle;
|
|
47
|
+
disabled?: IntrinsicStateStyle;
|
|
48
|
+
};
|
|
49
|
+
export type DivStyle = IntrinsicStyle;
|
|
50
|
+
export interface DivProps extends Omit<BaseProps, "style"> {
|
|
51
|
+
style?: IntrinsicStyle;
|
|
52
|
+
gap?: number;
|
|
53
|
+
padding?: Style["padding"];
|
|
54
|
+
flex?: number;
|
|
55
|
+
align?: Style["align"];
|
|
56
|
+
justify?: Style["justify"];
|
|
57
|
+
portal?: boolean;
|
|
58
|
+
dismissOnOutside?: boolean;
|
|
59
|
+
onOutsideClick?: () => void;
|
|
60
|
+
dragRegion?: boolean;
|
|
61
|
+
windowAction?: "minimize" | "toggleMaximize" | "close";
|
|
62
|
+
focusable?: boolean;
|
|
63
|
+
onClick?: () => void;
|
|
64
|
+
onContextMenu?: (position: {
|
|
65
|
+
x: number;
|
|
66
|
+
y: number;
|
|
67
|
+
}) => void;
|
|
68
|
+
onHover?: (entered: boolean) => void;
|
|
69
|
+
onMouseEnter?: () => void;
|
|
70
|
+
onMouseLeave?: () => void;
|
|
71
|
+
onKeyDown?: (key: string) => void;
|
|
72
|
+
onBlur?: () => void;
|
|
73
|
+
onEscape?: () => void;
|
|
74
|
+
}
|
|
75
|
+
export interface SpanProps extends Omit<BaseProps, "style"> {
|
|
76
|
+
style?: IntrinsicStyle;
|
|
77
|
+
size?: number;
|
|
78
|
+
weight?: number;
|
|
79
|
+
color?: string;
|
|
80
|
+
}
|
|
81
|
+
export type ParagraphProps = SpanProps;
|
|
82
|
+
export type HeadingProps = SpanProps;
|
|
83
|
+
export interface IntrinsicLabelProps extends Omit<BaseProps, "style"> {
|
|
84
|
+
style?: IntrinsicStyle;
|
|
85
|
+
htmlFor?: string;
|
|
86
|
+
required?: boolean;
|
|
87
|
+
disabled?: boolean;
|
|
88
|
+
onClick?: () => void;
|
|
89
|
+
}
|
|
90
|
+
export interface ImgProps extends Omit<BaseProps, "style" | "children"> {
|
|
91
|
+
style?: IntrinsicStyle;
|
|
92
|
+
src: ImageSource;
|
|
93
|
+
width?: number;
|
|
94
|
+
height?: number;
|
|
95
|
+
fit?: "cover" | "contain";
|
|
96
|
+
}
|
|
97
|
+
export type IntrinsicInputType = "text" | "password" | "email" | "number" | "search" | "tel" | "url";
|
|
98
|
+
export interface IntrinsicInputProps extends Omit<BaseProps, "style" | "children"> {
|
|
99
|
+
style?: IntrinsicStyle;
|
|
100
|
+
type?: IntrinsicInputType;
|
|
101
|
+
value?: string;
|
|
102
|
+
placeholder?: string;
|
|
103
|
+
disabled?: boolean;
|
|
104
|
+
onChange?: (value: string) => void;
|
|
105
|
+
onSubmit?: (value: string) => void;
|
|
106
|
+
}
|
|
107
|
+
export interface IntrinsicTextareaProps extends Omit<BaseProps, "style" | "children"> {
|
|
108
|
+
style?: IntrinsicStyle;
|
|
109
|
+
value?: string;
|
|
110
|
+
placeholder?: string;
|
|
111
|
+
disabled?: boolean;
|
|
112
|
+
submitOnEnter?: boolean;
|
|
113
|
+
onChange?: (value: string) => void;
|
|
114
|
+
onSubmit?: (value: string) => void;
|
|
115
|
+
}
|
|
116
|
+
export interface IntrinsicButtonProps extends Omit<BaseProps, "style"> {
|
|
117
|
+
style?: IntrinsicStyle;
|
|
118
|
+
variant?: "default" | "secondary" | "outline" | "ghost" | "destructive";
|
|
119
|
+
size?: "sm" | "default" | "lg";
|
|
120
|
+
disabled?: boolean;
|
|
121
|
+
control?: Control;
|
|
122
|
+
onClick?: () => void;
|
|
123
|
+
onHover?: (hovered: boolean) => void;
|
|
124
|
+
}
|
|
125
|
+
export interface IntrinsicAnchorProps extends Omit<BaseProps, "style"> {
|
|
126
|
+
style?: IntrinsicStyle;
|
|
127
|
+
href: string;
|
|
128
|
+
ariaLabel?: string;
|
|
129
|
+
disabled?: boolean;
|
|
130
|
+
onClick?: () => void;
|
|
131
|
+
onHover?: (hovered: boolean) => void;
|
|
132
|
+
}
|
|
133
|
+
export interface IntrinsicSvgProps extends Omit<BaseProps, "style"> {
|
|
134
|
+
style?: IntrinsicStyle;
|
|
135
|
+
size?: number;
|
|
136
|
+
width?: number;
|
|
137
|
+
height?: number;
|
|
138
|
+
viewBox?: string | readonly [number, number, number, number];
|
|
139
|
+
color?: string;
|
|
140
|
+
fill?: string;
|
|
141
|
+
stroke?: string;
|
|
142
|
+
strokeWidth?: number;
|
|
143
|
+
strokeLinecap?: "butt" | "round" | "square";
|
|
144
|
+
strokeLinejoin?: "miter" | "round" | "bevel";
|
|
145
|
+
nodes?: readonly SvgNode[];
|
|
146
|
+
}
|
|
147
|
+
export interface IntrinsicSvgElementProps {
|
|
148
|
+
key?: string | number;
|
|
149
|
+
id?: string;
|
|
150
|
+
fill?: string;
|
|
151
|
+
fillRule?: "nonzero" | "evenodd";
|
|
152
|
+
fillOpacity?: number | string;
|
|
153
|
+
stroke?: string;
|
|
154
|
+
strokeWidth?: number | string;
|
|
155
|
+
strokeLinecap?: "butt" | "round" | "square";
|
|
156
|
+
strokeLinejoin?: "miter" | "round" | "bevel";
|
|
157
|
+
strokeOpacity?: number | string;
|
|
158
|
+
strokeDasharray?: number | string;
|
|
159
|
+
strokeDashoffset?: number | string;
|
|
160
|
+
opacity?: number | string;
|
|
161
|
+
transform?: string;
|
|
162
|
+
vectorEffect?: string;
|
|
163
|
+
}
|
|
164
|
+
export interface IntrinsicSvgPathProps extends IntrinsicSvgElementProps {
|
|
165
|
+
d: string;
|
|
166
|
+
}
|
|
167
|
+
export interface IntrinsicSvgCircleProps extends IntrinsicSvgElementProps {
|
|
168
|
+
cx: number | string;
|
|
169
|
+
cy: number | string;
|
|
170
|
+
r: number | string;
|
|
171
|
+
}
|
|
172
|
+
export interface IntrinsicSvgEllipseProps extends IntrinsicSvgElementProps {
|
|
173
|
+
cx: number | string;
|
|
174
|
+
cy: number | string;
|
|
175
|
+
rx: number | string;
|
|
176
|
+
ry: number | string;
|
|
177
|
+
}
|
|
178
|
+
export interface IntrinsicSvgLineProps extends IntrinsicSvgElementProps {
|
|
179
|
+
x1: number | string;
|
|
180
|
+
y1: number | string;
|
|
181
|
+
x2: number | string;
|
|
182
|
+
y2: number | string;
|
|
183
|
+
}
|
|
184
|
+
export interface IntrinsicSvgPolylineProps extends IntrinsicSvgElementProps {
|
|
185
|
+
points: string;
|
|
186
|
+
}
|
|
187
|
+
export interface IntrinsicSvgPolygonProps extends IntrinsicSvgElementProps {
|
|
188
|
+
points: string;
|
|
189
|
+
}
|
|
190
|
+
export interface IntrinsicSvgRectProps extends IntrinsicSvgElementProps {
|
|
191
|
+
x?: number | string;
|
|
192
|
+
y?: number | string;
|
|
193
|
+
width: number | string;
|
|
194
|
+
height: number | string;
|
|
195
|
+
rx?: number | string;
|
|
196
|
+
ry?: number | string;
|
|
197
|
+
}
|
|
198
|
+
export interface IntrinsicSvgGroupProps extends IntrinsicSvgElementProps {
|
|
199
|
+
children?: Child;
|
|
200
|
+
}
|
|
201
|
+
export interface IntrinsicOptionProps {
|
|
202
|
+
key?: string | number;
|
|
203
|
+
value: string;
|
|
204
|
+
disabled?: boolean;
|
|
205
|
+
children?: Child;
|
|
206
|
+
}
|
|
207
|
+
export interface IntrinsicSelectProps extends Omit<BaseProps, "style"> {
|
|
208
|
+
style?: IntrinsicStyle;
|
|
209
|
+
value?: string;
|
|
210
|
+
placeholder?: string;
|
|
211
|
+
disabled?: boolean;
|
|
212
|
+
open?: boolean;
|
|
213
|
+
onOpenChange?: (open: boolean) => void;
|
|
214
|
+
onChange?: (value: string) => void;
|
|
215
|
+
onValueChange?: (value: string) => void;
|
|
216
|
+
}
|
|
217
|
+
export interface IntrinsicProgressProps extends Omit<BaseProps, "style" | "children"> {
|
|
218
|
+
style?: IntrinsicStyle;
|
|
219
|
+
value: number;
|
|
220
|
+
max?: number;
|
|
221
|
+
label?: string;
|
|
222
|
+
}
|
|
223
|
+
export interface IntrinsicHrProps extends Omit<BaseProps, "style" | "children"> {
|
|
224
|
+
style?: IntrinsicStyle;
|
|
225
|
+
orientation?: "horizontal" | "vertical";
|
|
226
|
+
}
|
|
227
|
+
export type Component<P = any> = (props: P) => VNode;
|
|
228
|
+
export interface VNode {
|
|
229
|
+
type: Component | string;
|
|
230
|
+
props: Record<string, any>;
|
|
231
|
+
key?: string | number;
|
|
232
|
+
}
|
|
233
|
+
export declare function jsx(type: VNode["type"], props: Record<string, any> | null, key?: string | number): VNode;
|
|
234
|
+
export declare function _nativeJsx(type: string, props: Record<string, any> | null, key?: string | number): VNode;
|
|
235
|
+
export declare function _isNativeVNode(vnode: VNode): boolean;
|
|
236
|
+
export declare const jsxs: typeof jsx;
|
|
237
|
+
export declare const jsxDEV: typeof jsx;
|
|
238
|
+
export declare function Fragment(props: {
|
|
239
|
+
children?: Child;
|
|
240
|
+
}): VNode;
|
|
241
|
+
export declare namespace JSX {
|
|
242
|
+
type Element = VNode;
|
|
243
|
+
interface ElementChildrenAttribute {
|
|
244
|
+
children: {};
|
|
245
|
+
}
|
|
246
|
+
interface IntrinsicAttributes {
|
|
247
|
+
key?: string | number;
|
|
248
|
+
}
|
|
249
|
+
interface IntrinsicElements {
|
|
250
|
+
div: DivProps;
|
|
251
|
+
span: SpanProps;
|
|
252
|
+
p: ParagraphProps;
|
|
253
|
+
h1: HeadingProps;
|
|
254
|
+
h2: HeadingProps;
|
|
255
|
+
h3: HeadingProps;
|
|
256
|
+
h4: HeadingProps;
|
|
257
|
+
h5: HeadingProps;
|
|
258
|
+
h6: HeadingProps;
|
|
259
|
+
label: IntrinsicLabelProps;
|
|
260
|
+
img: ImgProps;
|
|
261
|
+
input: IntrinsicInputProps;
|
|
262
|
+
textarea: IntrinsicTextareaProps;
|
|
263
|
+
button: IntrinsicButtonProps;
|
|
264
|
+
a: IntrinsicAnchorProps;
|
|
265
|
+
svg: IntrinsicSvgProps;
|
|
266
|
+
path: IntrinsicSvgPathProps;
|
|
267
|
+
circle: IntrinsicSvgCircleProps;
|
|
268
|
+
ellipse: IntrinsicSvgEllipseProps;
|
|
269
|
+
line: IntrinsicSvgLineProps;
|
|
270
|
+
polyline: IntrinsicSvgPolylineProps;
|
|
271
|
+
polygon: IntrinsicSvgPolygonProps;
|
|
272
|
+
rect: IntrinsicSvgRectProps;
|
|
273
|
+
g: IntrinsicSvgGroupProps;
|
|
274
|
+
select: IntrinsicSelectProps;
|
|
275
|
+
option: IntrinsicOptionProps;
|
|
276
|
+
progress: IntrinsicProgressProps;
|
|
277
|
+
hr: IntrinsicHrProps;
|
|
278
|
+
}
|
|
279
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type Child, type VNode } from "./jsx-runtime";
|
|
2
|
+
import { type ScrollProps } from "./components";
|
|
3
|
+
export interface ListProps<T> extends ScrollProps {
|
|
4
|
+
items?: readonly T[];
|
|
5
|
+
renderItem?: (item: T, index: number) => Child;
|
|
6
|
+
keyForItem?: (item: T, index: number) => string | number;
|
|
7
|
+
gap?: number;
|
|
8
|
+
}
|
|
9
|
+
/** A regular, non-virtual list. Every item stays mounted and can have any height. */
|
|
10
|
+
export declare function List<T>({ items, renderItem, keyForItem, gap, children, ...props }: ListProps<T>): VNode;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { MotionTransitions, MotionValues } from "../../protocol/src/index";
|
|
2
|
+
import { type VNode } from "./jsx-runtime";
|
|
3
|
+
export interface AnimatePresenceProps {
|
|
4
|
+
/** Stable identity for this presence boundary. */
|
|
5
|
+
id: string;
|
|
6
|
+
present: boolean;
|
|
7
|
+
children: VNode;
|
|
8
|
+
/** Initial numeric values applied when the native node is first mounted. */
|
|
9
|
+
enter?: MotionValues;
|
|
10
|
+
/** Numeric targets held until their native transitions finish. */
|
|
11
|
+
exit: MotionValues;
|
|
12
|
+
/** Overrides the child's style.transition for enter/exit motion. */
|
|
13
|
+
transition?: MotionTransitions;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Keeps one native child alive while its exit targets are animated by the Rust renderer.
|
|
17
|
+
* Keep the boundary itself mounted and toggle `present` so Tarve can retain native identity.
|
|
18
|
+
*/
|
|
19
|
+
export declare function AnimatePresence({ id, present, children, enter, exit, transition, }: AnimatePresenceProps): VNode;
|
|
@@ -0,0 +1,115 @@
|
|
|
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 type PopupSide = "top" | "right" | "bottom" | "left";
|
|
5
|
+
export interface TooltipProps extends BaseProps {
|
|
6
|
+
id: string;
|
|
7
|
+
open: boolean;
|
|
8
|
+
trigger: Child;
|
|
9
|
+
content: Child;
|
|
10
|
+
side?: PopupSide;
|
|
11
|
+
label?: string;
|
|
12
|
+
onOpenChange?: (open: boolean) => void;
|
|
13
|
+
contentStyle?: Style;
|
|
14
|
+
}
|
|
15
|
+
export declare function Tooltip({ id, open, trigger, content, side, label, onOpenChange, contentStyle, style, }: TooltipProps): VNode;
|
|
16
|
+
export interface PopoverProps extends BaseProps {
|
|
17
|
+
id: string;
|
|
18
|
+
open: boolean;
|
|
19
|
+
trigger: Child;
|
|
20
|
+
label?: string;
|
|
21
|
+
side?: PopupSide;
|
|
22
|
+
disabled?: boolean;
|
|
23
|
+
onOpenChange?: (open: boolean) => void;
|
|
24
|
+
triggerStyle?: Style;
|
|
25
|
+
contentStyle?: Style;
|
|
26
|
+
}
|
|
27
|
+
export declare function Popover({ id, open, trigger, label, side, disabled, onOpenChange, triggerStyle, contentStyle, children, style, }: PopoverProps): VNode;
|
|
28
|
+
export interface DropdownMenuItem {
|
|
29
|
+
value: string;
|
|
30
|
+
label: string;
|
|
31
|
+
icon?: IconName;
|
|
32
|
+
shortcut?: string;
|
|
33
|
+
disabled?: boolean;
|
|
34
|
+
checked?: boolean;
|
|
35
|
+
}
|
|
36
|
+
export interface DropdownMenuProps extends BaseProps {
|
|
37
|
+
id: string;
|
|
38
|
+
open: boolean;
|
|
39
|
+
trigger: Child;
|
|
40
|
+
items: readonly DropdownMenuItem[];
|
|
41
|
+
label?: string;
|
|
42
|
+
side?: PopupSide;
|
|
43
|
+
disabled?: boolean;
|
|
44
|
+
onOpenChange?: (open: boolean) => void;
|
|
45
|
+
onSelect?: (value: string) => void;
|
|
46
|
+
triggerStyle?: Style;
|
|
47
|
+
contentStyle?: Style;
|
|
48
|
+
}
|
|
49
|
+
export declare function DropdownMenu({ id, open, trigger, items, label, side, disabled, onOpenChange, onSelect, triggerStyle, contentStyle, style, }: DropdownMenuProps): VNode;
|
|
50
|
+
export interface ContextMenuProps extends BaseProps {
|
|
51
|
+
id: string;
|
|
52
|
+
open: boolean;
|
|
53
|
+
trigger: Child;
|
|
54
|
+
items: readonly DropdownMenuItem[];
|
|
55
|
+
label?: string;
|
|
56
|
+
side?: PopupSide;
|
|
57
|
+
disabled?: boolean;
|
|
58
|
+
onOpenChange?: (open: boolean) => void;
|
|
59
|
+
onSelect?: (value: string) => void;
|
|
60
|
+
contentStyle?: Style;
|
|
61
|
+
}
|
|
62
|
+
export declare function ContextMenu({ id, open, trigger, items, label, side, disabled, onOpenChange, onSelect, contentStyle, children, style, }: ContextMenuProps): VNode;
|
|
63
|
+
export interface ComboboxOption {
|
|
64
|
+
value: string;
|
|
65
|
+
label: string;
|
|
66
|
+
keywords?: readonly string[];
|
|
67
|
+
disabled?: boolean;
|
|
68
|
+
}
|
|
69
|
+
export interface ComboboxProps extends BaseProps {
|
|
70
|
+
id: string;
|
|
71
|
+
open: boolean;
|
|
72
|
+
query: string;
|
|
73
|
+
options: readonly ComboboxOption[];
|
|
74
|
+
value?: string;
|
|
75
|
+
placeholder?: string;
|
|
76
|
+
searchPlaceholder?: string;
|
|
77
|
+
emptyText?: string;
|
|
78
|
+
disabled?: boolean;
|
|
79
|
+
onOpenChange?: (open: boolean) => void;
|
|
80
|
+
onQueryChange?: (query: string) => void;
|
|
81
|
+
onValueChange?: (value: string) => void;
|
|
82
|
+
contentStyle?: Style;
|
|
83
|
+
}
|
|
84
|
+
export declare function Combobox({ id, open, query, options, value, placeholder, searchPlaceholder, emptyText, disabled, onOpenChange, onQueryChange, onValueChange, contentStyle, style, }: ComboboxProps): VNode;
|
|
85
|
+
export interface CommandItem {
|
|
86
|
+
value: string;
|
|
87
|
+
label: string;
|
|
88
|
+
keywords?: readonly string[];
|
|
89
|
+
icon?: IconName;
|
|
90
|
+
group?: string;
|
|
91
|
+
shortcut?: string;
|
|
92
|
+
disabled?: boolean;
|
|
93
|
+
}
|
|
94
|
+
export interface CommandProps extends BaseProps {
|
|
95
|
+
id: string;
|
|
96
|
+
query: string;
|
|
97
|
+
items: readonly CommandItem[];
|
|
98
|
+
value?: string;
|
|
99
|
+
placeholder?: string;
|
|
100
|
+
emptyText?: string;
|
|
101
|
+
onQueryChange?: (query: string) => void;
|
|
102
|
+
onValueChange?: (value: string) => void;
|
|
103
|
+
onSelect?: (value: string) => void;
|
|
104
|
+
onEscape?: () => void;
|
|
105
|
+
}
|
|
106
|
+
export declare function Command({ id, query, items, value, placeholder, emptyText, onQueryChange, onValueChange, onSelect, onEscape, style, }: CommandProps): VNode;
|
|
107
|
+
export interface CommandPaletteProps extends Omit<CommandProps, "style" | "onSelect"> {
|
|
108
|
+
open: boolean;
|
|
109
|
+
onOpenChange?: (open: boolean) => void;
|
|
110
|
+
onSelect?: (value: string) => void;
|
|
111
|
+
closeOnSelect?: boolean;
|
|
112
|
+
closeOnOverlay?: boolean;
|
|
113
|
+
width?: number;
|
|
114
|
+
}
|
|
115
|
+
export declare function CommandPalette({ id, open, onOpenChange, onSelect, closeOnSelect, closeOnOverlay, width, ...commandProps }: CommandPaletteProps): VNode;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { type MotionProperty, type NativeNode, type Renderer, type SceneDocument, type ScrollPosition, type TreeMutation, type VirtualListMeasurement } from "../../protocol/src/index";
|
|
2
|
+
import { type PastePayload, type VNode } from "./jsx-runtime";
|
|
3
|
+
import type { WindowCloseRequestEvent } from "./components";
|
|
4
|
+
import type { ComponentAdapter } from "./component-adapter";
|
|
5
|
+
export interface Handlers {
|
|
6
|
+
onClick?: () => void;
|
|
7
|
+
onMarkdownLink?: (href: string) => void;
|
|
8
|
+
onDiffToggleFile?: (path: string) => void;
|
|
9
|
+
onDiffShowMore?: (hidden: number, path?: string) => void;
|
|
10
|
+
onDiffLineClick?: (event: {
|
|
11
|
+
text: string;
|
|
12
|
+
path?: string;
|
|
13
|
+
oldLine?: number;
|
|
14
|
+
newLine?: number;
|
|
15
|
+
}) => void;
|
|
16
|
+
onHighlight?: (event: {
|
|
17
|
+
matchCount: number;
|
|
18
|
+
}) => void;
|
|
19
|
+
onContextMenu?: (position: {
|
|
20
|
+
x: number;
|
|
21
|
+
y: number;
|
|
22
|
+
}) => void;
|
|
23
|
+
onOutsideClick?: () => void;
|
|
24
|
+
onHover?: (value: boolean) => void;
|
|
25
|
+
onChange?: (value: string) => void;
|
|
26
|
+
onSubmit?: (value: string) => void;
|
|
27
|
+
onPaste?: (payload: PastePayload) => void;
|
|
28
|
+
onValueChange?: (value: number) => void;
|
|
29
|
+
onScroll?: (offset: number, max: number) => void;
|
|
30
|
+
onScrollPosition?: (position: ScrollPosition) => void;
|
|
31
|
+
onVirtualListLayout?: (items: VirtualListMeasurement[]) => void;
|
|
32
|
+
onVirtualListScrollToItem?: (index: number, offset: number) => void;
|
|
33
|
+
onVirtualListFocus?: (key: string | null) => void;
|
|
34
|
+
onEscape?: () => void;
|
|
35
|
+
onKeyDown?: (key: string) => void;
|
|
36
|
+
onBlur?: () => void;
|
|
37
|
+
onCloseRequest?: (event: WindowCloseRequestEvent) => void;
|
|
38
|
+
onTransitionEnd?: (event: {
|
|
39
|
+
property: MotionProperty;
|
|
40
|
+
}) => void;
|
|
41
|
+
}
|
|
42
|
+
export interface CompiledTree {
|
|
43
|
+
document: SceneDocument;
|
|
44
|
+
handlers: Map<string, Handlers>;
|
|
45
|
+
nodes: Map<string, NativeNode>;
|
|
46
|
+
}
|
|
47
|
+
export declare function compileTree(element: VNode, debug?: boolean, renderer?: Renderer, componentAdapters?: readonly ComponentAdapter[], renderScope?: object, visible?: boolean): CompiledTree;
|
|
48
|
+
/** null requests a structural replacement; an empty list means no native work is needed. */
|
|
49
|
+
export declare function diffTrees(previous: CompiledTree, next: CompiledTree): NativeNode[] | null;
|
|
50
|
+
/**
|
|
51
|
+
* Computes one atomic retained-tree mutation batch. A null result is reserved for
|
|
52
|
+
* identity-incompatible replacements (root ID or an existing keyed node kind changed).
|
|
53
|
+
*/
|
|
54
|
+
export declare function diffTreeMutations(previous: CompiledTree, next: CompiledTree): TreeMutation[] | null;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type BaseProps, type VNode } from "./jsx-runtime";
|
|
2
|
+
export interface SelectOption {
|
|
3
|
+
value: string;
|
|
4
|
+
label: string;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export interface SelectProps extends BaseProps {
|
|
8
|
+
id: string;
|
|
9
|
+
value?: string;
|
|
10
|
+
options: readonly SelectOption[];
|
|
11
|
+
placeholder?: string;
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
open?: boolean;
|
|
14
|
+
onOpenChange?: (open: boolean) => void;
|
|
15
|
+
onValueChange?: (value: string) => void;
|
|
16
|
+
}
|
|
17
|
+
export declare function Select({ id, value, options, placeholder, disabled, open, onOpenChange, onValueChange, style }: SelectProps): VNode;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Style as ProtocolStyle } from "../../protocol/src/index";
|
|
2
|
+
export type Style = ProtocolStyle;
|
|
3
|
+
/** Typed style helpers. `create` is allocation-free; `merge` deep-merges visual state objects. */
|
|
4
|
+
export declare const Style: {
|
|
5
|
+
readonly create: <const T extends ProtocolStyle | Record<string, ProtocolStyle>>(value: T) => T;
|
|
6
|
+
readonly merge: (...styles: (ProtocolStyle | null | undefined | false)[]) => ProtocolStyle;
|
|
7
|
+
};
|