@flesler/cursor-canvas-web 1.0.1 → 1.1.0
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/README.md +9 -8
- package/dist/cursor-canvas.cjs +1 -1
- package/dist/cursor-canvas.js +530 -701
- package/dist/host-tokens-Cjzmp0z_.cjs +1 -0
- package/dist/host-tokens-Dh2BFFjv.js +412 -0
- package/dist/runtime/index.d.ts +5 -7
- package/dist/runtime.cjs +1 -1
- package/dist/runtime.js +101 -14
- package/package.json +22 -12
- package/src/vendor/canvas/SKILL.md +113 -0
- package/src/vendor/canvas-sdk/callout-tone-icons.d.ts +10 -0
- package/src/vendor/canvas-sdk/canvas-tokens.d.ts +259 -0
- package/src/vendor/canvas-sdk/chart-primitives.d.ts +272 -0
- package/src/vendor/canvas-sdk/collapsible-section.d.ts +66 -0
- package/src/vendor/canvas-sdk/dag-layout.d.ts +101 -0
- package/src/vendor/canvas-sdk/diff-view.d.ts +129 -0
- package/src/vendor/canvas-sdk/form-primitives.d.ts +194 -0
- package/src/vendor/canvas-sdk/hooks.d.ts +173 -0
- package/src/vendor/canvas-sdk/index.d.ts +65 -0
- package/src/vendor/canvas-sdk/internal/canvas-action-dispatch.d.ts +17 -0
- package/src/vendor/canvas-sdk/manifest.json +5 -0
- package/src/vendor/canvas-sdk/swatch.d.ts +39 -0
- package/src/vendor/canvas-sdk/theme.d.ts +107 -0
- package/src/vendor/canvas-sdk/todo-list.d.ts +48 -0
- package/src/vendor/canvas-sdk/ui-primitives.d.ts +569 -0
- package/src/vendor/canvas-sdk/usage-bar.d.ts +55 -0
- package/dist/shim/charts.d.ts +0 -62
- package/dist/shim/cursor-canvas.d.ts +0 -278
- package/dist/shim/dag.d.ts +0 -55
- package/dist/shim/diff.d.ts +0 -23
- package/dist/shim/theme.d.ts +0 -319
- package/dist/shim/todo.d.ts +0 -22
- package/dist/shim/use-tokens.d.ts +0 -6
|
@@ -1,278 +0,0 @@
|
|
|
1
|
-
import { CSSProperties, ReactNode } from 'react';
|
|
2
|
-
import { Color } from './theme';
|
|
3
|
-
export { useEffect, useMemo, useRef, useState } from 'react';
|
|
4
|
-
export type { CSSProperties, RefObject } from 'react';
|
|
5
|
-
export { BarChart, LineChart, PieChart, reshapeLineChartData } from './charts';
|
|
6
|
-
export type { BarChartProps, ChartDataPoint, ChartReferenceLine, ChartSeries, ChartTone, LineChartProps, PieChartProps } from './charts';
|
|
7
|
-
export { computeDAGLayout } from './dag';
|
|
8
|
-
export type { DAGLayoutEdge, DAGLayoutNode, DAGLayoutOptions, DAGLayoutRank, DAGLayoutResult } from './dag';
|
|
9
|
-
export { DiffStats, DiffView } from './diff';
|
|
10
|
-
export type { DiffLineData, DiffLineType, DiffStatsProps, DiffViewProps } from './diff';
|
|
11
|
-
export { canvasPaletteDark, canvasPaletteLight, canvasTokens, canvasTokensLight, categoryPaletteDark, categoryPaletteLight, colorPalette, usageColorSequence } from './theme';
|
|
12
|
-
export type { CanvasHostTheme, CanvasPalette, CanvasTokens, CategoryPalette, Color } from './theme';
|
|
13
|
-
export { TodoList, TodoListCard } from './todo';
|
|
14
|
-
export type { TodoItem, TodoListCardProps, TodoListProps, TodoStatus } from './todo';
|
|
15
|
-
export { useHostTheme } from './use-tokens';
|
|
16
|
-
export type SetCanvasState<T> = (action: T | ((prev: T) => T)) => void;
|
|
17
|
-
/**
|
|
18
|
-
* Persistent state hook. The real SDK stores values in a `.canvas.data.json`
|
|
19
|
-
* sidecar; on the web we persist to `localStorage` under `canvas:<key>`.
|
|
20
|
-
*/
|
|
21
|
-
export declare function useCanvasState<T>(key: string, defaultValue: T): [T, SetCanvasState<T>];
|
|
22
|
-
export type CanvasAction = {
|
|
23
|
-
type: 'openAgent';
|
|
24
|
-
agentId: string;
|
|
25
|
-
} | {
|
|
26
|
-
type: 'newComposerChat';
|
|
27
|
-
userPrompt?: string;
|
|
28
|
-
} | {
|
|
29
|
-
type: 'openFile';
|
|
30
|
-
path: string;
|
|
31
|
-
selection?: {
|
|
32
|
-
startLineNumber: number;
|
|
33
|
-
startColumn: number;
|
|
34
|
-
endLineNumber?: number;
|
|
35
|
-
endColumn?: number;
|
|
36
|
-
};
|
|
37
|
-
};
|
|
38
|
-
/**
|
|
39
|
-
* IDE actions are not available on the web host, so the returned dispatch is a
|
|
40
|
-
* no-op (it logs in dev). Exists for API parity with the real SDK.
|
|
41
|
-
*/
|
|
42
|
-
export declare function useCanvasAction(): (action: CanvasAction) => void;
|
|
43
|
-
/** Shallow-merge two style objects, `override` winning. */
|
|
44
|
-
export declare function mergeStyle(base: CSSProperties, override?: CSSProperties): CSSProperties;
|
|
45
|
-
export interface H1Props {
|
|
46
|
-
children?: ReactNode;
|
|
47
|
-
style?: CSSProperties;
|
|
48
|
-
}
|
|
49
|
-
export declare function H1({ children, style }: H1Props): import("react").JSX.Element;
|
|
50
|
-
export interface H2Props {
|
|
51
|
-
children?: ReactNode;
|
|
52
|
-
style?: CSSProperties;
|
|
53
|
-
}
|
|
54
|
-
export declare function H2({ children, style }: H2Props): import("react").JSX.Element;
|
|
55
|
-
export interface H3Props {
|
|
56
|
-
children?: ReactNode;
|
|
57
|
-
style?: CSSProperties;
|
|
58
|
-
}
|
|
59
|
-
export declare function H3({ children, style }: H3Props): import("react").JSX.Element;
|
|
60
|
-
export type TextWeight = 'normal' | 'medium' | 'semibold' | 'bold';
|
|
61
|
-
export type TextTone = 'primary' | 'secondary' | 'tertiary' | 'quaternary';
|
|
62
|
-
export interface TextProps {
|
|
63
|
-
children?: ReactNode;
|
|
64
|
-
tone?: TextTone;
|
|
65
|
-
size?: 'body' | 'small';
|
|
66
|
-
as?: 'p' | 'span';
|
|
67
|
-
weight?: TextWeight;
|
|
68
|
-
italic?: boolean;
|
|
69
|
-
truncate?: boolean | 'start' | 'end';
|
|
70
|
-
style?: CSSProperties;
|
|
71
|
-
}
|
|
72
|
-
export declare function Text({ children, tone, size, as, weight, italic, truncate, style, }: TextProps): import("react").JSX.Element;
|
|
73
|
-
export interface CodeProps {
|
|
74
|
-
children?: ReactNode;
|
|
75
|
-
style?: CSSProperties;
|
|
76
|
-
}
|
|
77
|
-
export declare function Code({ children, style }: CodeProps): import("react").JSX.Element;
|
|
78
|
-
export interface LinkProps {
|
|
79
|
-
children?: ReactNode;
|
|
80
|
-
href: string;
|
|
81
|
-
style?: CSSProperties;
|
|
82
|
-
}
|
|
83
|
-
export declare function Link({ children, href, style }: LinkProps): import("react").JSX.Element;
|
|
84
|
-
export interface StackProps {
|
|
85
|
-
children?: ReactNode;
|
|
86
|
-
gap?: number;
|
|
87
|
-
style?: CSSProperties;
|
|
88
|
-
}
|
|
89
|
-
export declare function Stack({ children, gap, style }: StackProps): import("react").JSX.Element;
|
|
90
|
-
export interface RowProps {
|
|
91
|
-
children?: ReactNode;
|
|
92
|
-
gap?: number;
|
|
93
|
-
align?: 'start' | 'center' | 'end' | 'stretch';
|
|
94
|
-
justify?: 'start' | 'center' | 'end' | 'space-between';
|
|
95
|
-
wrap?: boolean;
|
|
96
|
-
style?: CSSProperties;
|
|
97
|
-
}
|
|
98
|
-
export declare function Row({ children, gap, align, justify, wrap, style, }: RowProps): import("react").JSX.Element;
|
|
99
|
-
/** Flexible filler that pushes siblings apart inside a `Row`. */
|
|
100
|
-
export declare function Spacer(): import("react").JSX.Element;
|
|
101
|
-
export interface GridProps {
|
|
102
|
-
children?: ReactNode;
|
|
103
|
-
columns: number | string;
|
|
104
|
-
gap?: number;
|
|
105
|
-
align?: 'start' | 'center' | 'end' | 'stretch';
|
|
106
|
-
style?: CSSProperties;
|
|
107
|
-
}
|
|
108
|
-
export declare function Grid({ children, columns, gap, align, style }: GridProps): import("react").JSX.Element;
|
|
109
|
-
export interface DividerProps {
|
|
110
|
-
style?: CSSProperties;
|
|
111
|
-
}
|
|
112
|
-
export declare function Divider({ style }: DividerProps): import("react").JSX.Element;
|
|
113
|
-
export type CardVariant = 'default' | 'borderless';
|
|
114
|
-
export type CardSize = 'base' | 'lg';
|
|
115
|
-
export interface CardProps {
|
|
116
|
-
children?: ReactNode;
|
|
117
|
-
variant?: CardVariant;
|
|
118
|
-
size?: CardSize;
|
|
119
|
-
stickyHeader?: boolean;
|
|
120
|
-
collapsible?: boolean;
|
|
121
|
-
defaultOpen?: boolean;
|
|
122
|
-
open?: boolean;
|
|
123
|
-
onOpenChange?: (open: boolean) => void;
|
|
124
|
-
style?: CSSProperties;
|
|
125
|
-
}
|
|
126
|
-
export declare function Card({ children, variant, collapsible, defaultOpen, open: openProp, onOpenChange, style, }: CardProps): import("react").JSX.Element;
|
|
127
|
-
export interface CardHeaderProps {
|
|
128
|
-
children?: ReactNode;
|
|
129
|
-
trailing?: ReactNode;
|
|
130
|
-
style?: CSSProperties;
|
|
131
|
-
}
|
|
132
|
-
export declare function CardHeader({ children, trailing, style }: CardHeaderProps): import("react").JSX.Element;
|
|
133
|
-
export interface CardBodyProps {
|
|
134
|
-
children?: ReactNode;
|
|
135
|
-
style?: CSSProperties;
|
|
136
|
-
}
|
|
137
|
-
export declare function CardBody({ children, style }: CardBodyProps): import("react").JSX.Element | null;
|
|
138
|
-
export type StatTone = 'success' | 'danger' | 'warning' | 'info';
|
|
139
|
-
export interface StatProps {
|
|
140
|
-
value: ReactNode;
|
|
141
|
-
label: string;
|
|
142
|
-
tone?: StatTone;
|
|
143
|
-
style?: CSSProperties;
|
|
144
|
-
}
|
|
145
|
-
export declare function Stat({ value, label, tone, style }: StatProps): import("react").JSX.Element;
|
|
146
|
-
export type PillTone = 'neutral' | 'added' | 'deleted' | 'renamed' | 'success' | 'warning' | 'info';
|
|
147
|
-
export type PillSize = 'sm' | 'md';
|
|
148
|
-
export interface PillProps {
|
|
149
|
-
children?: ReactNode;
|
|
150
|
-
active?: boolean;
|
|
151
|
-
tone?: PillTone;
|
|
152
|
-
size?: PillSize;
|
|
153
|
-
leadingContent?: ReactNode;
|
|
154
|
-
keyboardHint?: string;
|
|
155
|
-
disabled?: boolean;
|
|
156
|
-
title?: string;
|
|
157
|
-
style?: CSSProperties;
|
|
158
|
-
onClick?: () => void;
|
|
159
|
-
}
|
|
160
|
-
export declare function Pill({ children, active, tone, size, leadingContent, keyboardHint, title, style, onClick, }: PillProps): import("react").JSX.Element;
|
|
161
|
-
export type CalloutTone = 'info' | 'success' | 'warning' | 'danger' | 'neutral';
|
|
162
|
-
export interface CalloutProps {
|
|
163
|
-
children?: ReactNode;
|
|
164
|
-
tone?: CalloutTone;
|
|
165
|
-
title?: ReactNode;
|
|
166
|
-
icon?: ReactNode;
|
|
167
|
-
style?: CSSProperties;
|
|
168
|
-
}
|
|
169
|
-
export declare function Callout({ children, tone, title, icon, style, }: CalloutProps): import("react").JSX.Element;
|
|
170
|
-
export type TableColumnAlign = 'left' | 'center' | 'right';
|
|
171
|
-
export type TableRowTone = 'success' | 'danger' | 'warning' | 'info' | 'neutral';
|
|
172
|
-
export interface TableProps {
|
|
173
|
-
headers: readonly ReactNode[];
|
|
174
|
-
rows: readonly (readonly ReactNode[])[];
|
|
175
|
-
columnAlign?: readonly (TableColumnAlign | undefined)[];
|
|
176
|
-
rowTone?: readonly (TableRowTone | undefined)[];
|
|
177
|
-
framed?: boolean;
|
|
178
|
-
striped?: boolean;
|
|
179
|
-
stickyHeader?: boolean;
|
|
180
|
-
style?: CSSProperties;
|
|
181
|
-
emptyMessage?: ReactNode;
|
|
182
|
-
}
|
|
183
|
-
export declare function Table({ headers, rows, columnAlign, rowTone, framed, striped, stickyHeader, style, emptyMessage, }: TableProps): import("react").JSX.Element;
|
|
184
|
-
export interface ButtonProps {
|
|
185
|
-
children?: ReactNode;
|
|
186
|
-
variant?: 'primary' | 'secondary' | 'ghost';
|
|
187
|
-
disabled?: boolean;
|
|
188
|
-
type?: 'button' | 'submit' | 'reset';
|
|
189
|
-
style?: CSSProperties;
|
|
190
|
-
onClick?: () => void;
|
|
191
|
-
}
|
|
192
|
-
export declare function Button({ children, variant, disabled, type, style, onClick, }: ButtonProps): import("react").JSX.Element;
|
|
193
|
-
export interface IconButtonProps {
|
|
194
|
-
children: ReactNode;
|
|
195
|
-
onClick?: () => void;
|
|
196
|
-
disabled?: boolean;
|
|
197
|
-
title?: string;
|
|
198
|
-
variant?: 'default' | 'circle';
|
|
199
|
-
size?: 'sm' | 'md';
|
|
200
|
-
style?: CSSProperties;
|
|
201
|
-
}
|
|
202
|
-
export declare function IconButton({ children, onClick, disabled, title, variant, size, style, }: IconButtonProps): import("react").JSX.Element;
|
|
203
|
-
export interface SelectOption {
|
|
204
|
-
value: string;
|
|
205
|
-
label: string;
|
|
206
|
-
disabled?: boolean;
|
|
207
|
-
}
|
|
208
|
-
export interface SelectProps {
|
|
209
|
-
value?: string;
|
|
210
|
-
onChange?: (value: string) => void;
|
|
211
|
-
options: SelectOption[];
|
|
212
|
-
placeholder?: string;
|
|
213
|
-
disabled?: boolean;
|
|
214
|
-
style?: CSSProperties;
|
|
215
|
-
}
|
|
216
|
-
export declare function Select({ value, onChange, options, placeholder, disabled, style, }: SelectProps): import("react").JSX.Element;
|
|
217
|
-
export interface CheckboxProps {
|
|
218
|
-
checked?: boolean;
|
|
219
|
-
onChange?: (checked: boolean) => void;
|
|
220
|
-
disabled?: boolean;
|
|
221
|
-
label?: ReactNode;
|
|
222
|
-
style?: CSSProperties;
|
|
223
|
-
}
|
|
224
|
-
export declare function Checkbox({ checked, onChange, disabled, label, style, }: CheckboxProps): import("react").JSX.Element;
|
|
225
|
-
export interface ToggleProps {
|
|
226
|
-
checked?: boolean;
|
|
227
|
-
onChange?: (checked: boolean) => void;
|
|
228
|
-
disabled?: boolean;
|
|
229
|
-
size?: 'sm' | 'md';
|
|
230
|
-
style?: CSSProperties;
|
|
231
|
-
}
|
|
232
|
-
export declare function Toggle({ checked, onChange, disabled, size, style, }: ToggleProps): import("react").JSX.Element;
|
|
233
|
-
export interface TextInputProps {
|
|
234
|
-
value?: string;
|
|
235
|
-
onChange?: (value: string) => void;
|
|
236
|
-
placeholder?: string;
|
|
237
|
-
disabled?: boolean;
|
|
238
|
-
type?: 'text' | 'email' | 'password' | 'number' | 'url' | 'search';
|
|
239
|
-
style?: CSSProperties;
|
|
240
|
-
}
|
|
241
|
-
export declare function TextInput({ value, onChange, placeholder, disabled, type, style, }: TextInputProps): import("react").JSX.Element;
|
|
242
|
-
export interface TextAreaProps {
|
|
243
|
-
value?: string;
|
|
244
|
-
onChange?: (value: string) => void;
|
|
245
|
-
placeholder?: string;
|
|
246
|
-
disabled?: boolean;
|
|
247
|
-
rows?: number;
|
|
248
|
-
style?: CSSProperties;
|
|
249
|
-
}
|
|
250
|
-
export declare function TextArea({ value, onChange, placeholder, disabled, rows, style, }: TextAreaProps): import("react").JSX.Element;
|
|
251
|
-
export interface SwatchProps {
|
|
252
|
-
color: Color;
|
|
253
|
-
style?: CSSProperties;
|
|
254
|
-
}
|
|
255
|
-
export declare function Swatch({ color, style }: SwatchProps): import("react").JSX.Element;
|
|
256
|
-
export interface UsageBarSegment {
|
|
257
|
-
readonly id: string;
|
|
258
|
-
readonly value: number;
|
|
259
|
-
readonly color?: Color;
|
|
260
|
-
}
|
|
261
|
-
export interface UsageBarProps {
|
|
262
|
-
readonly segments: readonly UsageBarSegment[];
|
|
263
|
-
readonly total: number;
|
|
264
|
-
readonly topLeftLabel?: ReactNode;
|
|
265
|
-
readonly topRightLabel?: ReactNode;
|
|
266
|
-
readonly style?: CSSProperties;
|
|
267
|
-
}
|
|
268
|
-
export declare function UsageBar({ segments, total, topLeftLabel, topRightLabel, style, }: UsageBarProps): import("react").JSX.Element;
|
|
269
|
-
export interface CollapsibleSectionProps {
|
|
270
|
-
title: string;
|
|
271
|
-
leading?: ReactNode;
|
|
272
|
-
count?: number;
|
|
273
|
-
trailing?: ReactNode;
|
|
274
|
-
children?: ReactNode;
|
|
275
|
-
defaultOpen?: boolean;
|
|
276
|
-
style?: CSSProperties;
|
|
277
|
-
}
|
|
278
|
-
export declare function CollapsibleSection({ title, leading, count, trailing, children, defaultOpen, style, }: CollapsibleSectionProps): import("react").JSX.Element;
|
package/dist/shim/dag.d.ts
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Pure layered DAG layout, matching the SDK's `computeDAGLayout` contract.
|
|
3
|
-
*
|
|
4
|
-
* Back-edges (cycles) are detected via DFS, excluded from ranking, and flagged
|
|
5
|
-
* in the output so callers can render them differently. Rendering is the
|
|
6
|
-
* caller's responsibility — this returns only coordinates and anchor points.
|
|
7
|
-
*/
|
|
8
|
-
export type DAGLayoutOptions = {
|
|
9
|
-
nodes: Array<{
|
|
10
|
-
id: string;
|
|
11
|
-
}>;
|
|
12
|
-
edges: Array<{
|
|
13
|
-
from: string;
|
|
14
|
-
to: string;
|
|
15
|
-
}>;
|
|
16
|
-
direction?: 'vertical' | 'horizontal';
|
|
17
|
-
nodeWidth?: number;
|
|
18
|
-
nodeHeight?: number;
|
|
19
|
-
rankGap?: number;
|
|
20
|
-
nodeGap?: number;
|
|
21
|
-
padding?: number;
|
|
22
|
-
};
|
|
23
|
-
export type DAGLayoutNode = {
|
|
24
|
-
id: string;
|
|
25
|
-
x: number;
|
|
26
|
-
y: number;
|
|
27
|
-
rank: number;
|
|
28
|
-
order: number;
|
|
29
|
-
};
|
|
30
|
-
export type DAGLayoutEdge = {
|
|
31
|
-
from: string;
|
|
32
|
-
to: string;
|
|
33
|
-
sourceX: number;
|
|
34
|
-
sourceY: number;
|
|
35
|
-
targetX: number;
|
|
36
|
-
targetY: number;
|
|
37
|
-
isBackEdge: boolean;
|
|
38
|
-
};
|
|
39
|
-
export type DAGLayoutRank = {
|
|
40
|
-
rank: number;
|
|
41
|
-
x: number;
|
|
42
|
-
y: number;
|
|
43
|
-
width: number;
|
|
44
|
-
height: number;
|
|
45
|
-
nodeIds: string[];
|
|
46
|
-
};
|
|
47
|
-
export type DAGLayoutResult = {
|
|
48
|
-
nodes: DAGLayoutNode[];
|
|
49
|
-
edges: DAGLayoutEdge[];
|
|
50
|
-
ranks: DAGLayoutRank[];
|
|
51
|
-
direction: 'vertical' | 'horizontal';
|
|
52
|
-
width: number;
|
|
53
|
-
height: number;
|
|
54
|
-
};
|
|
55
|
-
export declare function computeDAGLayout(options: DAGLayoutOptions): DAGLayoutResult;
|
package/dist/shim/diff.d.ts
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { CSSProperties } from 'react';
|
|
2
|
-
export type DiffStatsProps = {
|
|
3
|
-
additions?: number;
|
|
4
|
-
deletions?: number;
|
|
5
|
-
style?: CSSProperties;
|
|
6
|
-
};
|
|
7
|
-
export declare function DiffStats({ additions, deletions, style, }: DiffStatsProps): import("react").JSX.Element | null;
|
|
8
|
-
export type DiffLineType = 'added' | 'removed' | 'unchanged';
|
|
9
|
-
export type DiffLineData = {
|
|
10
|
-
type: DiffLineType;
|
|
11
|
-
content: string;
|
|
12
|
-
lineNumber?: number;
|
|
13
|
-
};
|
|
14
|
-
export type DiffViewProps = {
|
|
15
|
-
lines: DiffLineData[];
|
|
16
|
-
path?: string;
|
|
17
|
-
language?: string;
|
|
18
|
-
showLineNumbers?: boolean;
|
|
19
|
-
coloredLineNumbers?: boolean;
|
|
20
|
-
showAccentStrip?: boolean;
|
|
21
|
-
style?: CSSProperties;
|
|
22
|
-
};
|
|
23
|
-
export declare function DiffView({ lines, showLineNumbers, coloredLineNumbers, showAccentStrip, style, }: DiffViewProps): import("react").JSX.Element;
|
package/dist/shim/theme.d.ts
DELETED
|
@@ -1,319 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Design tokens + tone mappings for the shim.
|
|
3
|
-
*
|
|
4
|
-
* Mirrors the real `cursor/canvas` token surface (`canvasPaletteDark/Light`,
|
|
5
|
-
* `canvasTokens`, `colorPalette`, `usageColorSequence`, `Color`) so canvases
|
|
6
|
-
* that read tokens via `useHostTheme()` or import the palettes work unchanged.
|
|
7
|
-
* Values are aligned with the Cursor dark/light themes from the SDK.
|
|
8
|
-
*/
|
|
9
|
-
export declare const canvasPaletteDark: {
|
|
10
|
-
readonly foreground: "#E4E4E4EB";
|
|
11
|
-
readonly foregroundSecondary: "#E4E4E48D";
|
|
12
|
-
readonly foregroundTertiary: "#E4E4E45E";
|
|
13
|
-
readonly foregroundQuaternary: "#E4E4E442";
|
|
14
|
-
readonly editor: "#181818";
|
|
15
|
-
readonly chrome: "#141414";
|
|
16
|
-
readonly sidebar: "#141414";
|
|
17
|
-
readonly elevated: "#181818";
|
|
18
|
-
readonly fillPrimary: "#E4E4E430";
|
|
19
|
-
readonly fillSecondary: "#E4E4E41E";
|
|
20
|
-
readonly fillTertiary: "#E4E4E411";
|
|
21
|
-
readonly fillQuaternary: "#E4E4E40A";
|
|
22
|
-
readonly strokePrimary: "#E4E4E433";
|
|
23
|
-
readonly strokeSecondary: "#E4E4E41F";
|
|
24
|
-
readonly strokeTertiary: "#E4E4E414";
|
|
25
|
-
readonly strokeFocused: "#599CE7";
|
|
26
|
-
readonly accent: "#599CE7";
|
|
27
|
-
readonly buttonBackground: "#599CE7";
|
|
28
|
-
readonly buttonForeground: "#191c22";
|
|
29
|
-
readonly buttonHoverBackground: "#6AABE9";
|
|
30
|
-
readonly link: "#87c3ff";
|
|
31
|
-
readonly diffInsertedLine: "#3FA26633";
|
|
32
|
-
readonly diffRemovedLine: "#B8004933";
|
|
33
|
-
readonly diffStripAdded: "#3FA2668F";
|
|
34
|
-
readonly diffStripRemoved: "#FC6B838F";
|
|
35
|
-
};
|
|
36
|
-
export declare const canvasPaletteLight: {
|
|
37
|
-
readonly foreground: "#141414F0";
|
|
38
|
-
readonly foregroundSecondary: "#141414BD";
|
|
39
|
-
readonly foregroundTertiary: "#1414148A";
|
|
40
|
-
readonly foregroundQuaternary: "#1414145C";
|
|
41
|
-
readonly editor: "#FCFCFC";
|
|
42
|
-
readonly chrome: "#F8F8F8";
|
|
43
|
-
readonly sidebar: "#F3F3F3";
|
|
44
|
-
readonly elevated: "#FCFCFC";
|
|
45
|
-
readonly fillPrimary: "#14141433";
|
|
46
|
-
readonly fillSecondary: "#14141424";
|
|
47
|
-
readonly fillTertiary: "#14141414";
|
|
48
|
-
readonly fillQuaternary: "#1414140F";
|
|
49
|
-
readonly strokePrimary: "#14141433";
|
|
50
|
-
readonly strokeSecondary: "#1414141F";
|
|
51
|
-
readonly strokeTertiary: "#14141414";
|
|
52
|
-
readonly strokeFocused: "#3685BF";
|
|
53
|
-
readonly accent: "#3685BF";
|
|
54
|
-
readonly buttonBackground: "#3685BF";
|
|
55
|
-
readonly buttonForeground: "#FCFCFC";
|
|
56
|
-
readonly buttonHoverBackground: "#2E76AB";
|
|
57
|
-
readonly link: "#3685BF";
|
|
58
|
-
readonly diffInsertedLine: "#1F8A651F";
|
|
59
|
-
readonly diffRemovedLine: "#CF2D5614";
|
|
60
|
-
readonly diffStripAdded: "#1F8A65CC";
|
|
61
|
-
readonly diffStripRemoved: "#CF2D56CC";
|
|
62
|
-
};
|
|
63
|
-
export interface CanvasPalette {
|
|
64
|
-
readonly foreground: string;
|
|
65
|
-
readonly foregroundSecondary: string;
|
|
66
|
-
readonly foregroundTertiary: string;
|
|
67
|
-
readonly foregroundQuaternary: string;
|
|
68
|
-
readonly editor: string;
|
|
69
|
-
readonly chrome: string;
|
|
70
|
-
readonly sidebar: string;
|
|
71
|
-
readonly elevated: string;
|
|
72
|
-
readonly fillPrimary: string;
|
|
73
|
-
readonly fillSecondary: string;
|
|
74
|
-
readonly fillTertiary: string;
|
|
75
|
-
readonly fillQuaternary: string;
|
|
76
|
-
readonly strokePrimary: string;
|
|
77
|
-
readonly strokeSecondary: string;
|
|
78
|
-
readonly strokeTertiary: string;
|
|
79
|
-
readonly strokeFocused: string;
|
|
80
|
-
readonly accent: string;
|
|
81
|
-
readonly buttonBackground: string;
|
|
82
|
-
readonly buttonForeground: string;
|
|
83
|
-
readonly buttonHoverBackground: string;
|
|
84
|
-
readonly link: string;
|
|
85
|
-
readonly diffInsertedLine: string;
|
|
86
|
-
readonly diffRemovedLine: string;
|
|
87
|
-
readonly diffStripAdded: string;
|
|
88
|
-
readonly diffStripRemoved: string;
|
|
89
|
-
}
|
|
90
|
-
export type Color = 'gray' | 'purple' | 'green' | 'yellow' | 'cyan' | 'pink' | 'blue' | 'orange' | 'red';
|
|
91
|
-
export type CategoryPalette = Readonly<Record<Color, string>>;
|
|
92
|
-
export declare const categoryPaletteDark: CategoryPalette;
|
|
93
|
-
export declare const categoryPaletteLight: CategoryPalette;
|
|
94
|
-
declare function buildTokens(palette: CanvasPalette, category: CategoryPalette): {
|
|
95
|
-
bg: {
|
|
96
|
-
editor: string;
|
|
97
|
-
chrome: string;
|
|
98
|
-
elevated: string;
|
|
99
|
-
};
|
|
100
|
-
text: {
|
|
101
|
-
primary: string;
|
|
102
|
-
secondary: string;
|
|
103
|
-
tertiary: string;
|
|
104
|
-
quaternary: string;
|
|
105
|
-
link: string;
|
|
106
|
-
onAccent: string;
|
|
107
|
-
};
|
|
108
|
-
stroke: {
|
|
109
|
-
primary: string;
|
|
110
|
-
secondary: string;
|
|
111
|
-
tertiary: string;
|
|
112
|
-
focused: string;
|
|
113
|
-
};
|
|
114
|
-
fill: {
|
|
115
|
-
primary: string;
|
|
116
|
-
secondary: string;
|
|
117
|
-
tertiary: string;
|
|
118
|
-
quaternary: string;
|
|
119
|
-
};
|
|
120
|
-
accent: {
|
|
121
|
-
primary: string;
|
|
122
|
-
control: string;
|
|
123
|
-
controlHover: string;
|
|
124
|
-
};
|
|
125
|
-
diff: {
|
|
126
|
-
insertedLine: string;
|
|
127
|
-
removedLine: string;
|
|
128
|
-
stripAdded: string;
|
|
129
|
-
stripRemoved: string;
|
|
130
|
-
};
|
|
131
|
-
category: Readonly<Record<Color, string>>;
|
|
132
|
-
};
|
|
133
|
-
export type CanvasTokens = ReturnType<typeof buildTokens>;
|
|
134
|
-
export declare const canvasTokens: {
|
|
135
|
-
bg: {
|
|
136
|
-
editor: string;
|
|
137
|
-
chrome: string;
|
|
138
|
-
elevated: string;
|
|
139
|
-
};
|
|
140
|
-
text: {
|
|
141
|
-
primary: string;
|
|
142
|
-
secondary: string;
|
|
143
|
-
tertiary: string;
|
|
144
|
-
quaternary: string;
|
|
145
|
-
link: string;
|
|
146
|
-
onAccent: string;
|
|
147
|
-
};
|
|
148
|
-
stroke: {
|
|
149
|
-
primary: string;
|
|
150
|
-
secondary: string;
|
|
151
|
-
tertiary: string;
|
|
152
|
-
focused: string;
|
|
153
|
-
};
|
|
154
|
-
fill: {
|
|
155
|
-
primary: string;
|
|
156
|
-
secondary: string;
|
|
157
|
-
tertiary: string;
|
|
158
|
-
quaternary: string;
|
|
159
|
-
};
|
|
160
|
-
accent: {
|
|
161
|
-
primary: string;
|
|
162
|
-
control: string;
|
|
163
|
-
controlHover: string;
|
|
164
|
-
};
|
|
165
|
-
diff: {
|
|
166
|
-
insertedLine: string;
|
|
167
|
-
removedLine: string;
|
|
168
|
-
stripAdded: string;
|
|
169
|
-
stripRemoved: string;
|
|
170
|
-
};
|
|
171
|
-
category: Readonly<Record<Color, string>>;
|
|
172
|
-
};
|
|
173
|
-
export declare const canvasTokensLight: {
|
|
174
|
-
bg: {
|
|
175
|
-
editor: string;
|
|
176
|
-
chrome: string;
|
|
177
|
-
elevated: string;
|
|
178
|
-
};
|
|
179
|
-
text: {
|
|
180
|
-
primary: string;
|
|
181
|
-
secondary: string;
|
|
182
|
-
tertiary: string;
|
|
183
|
-
quaternary: string;
|
|
184
|
-
link: string;
|
|
185
|
-
onAccent: string;
|
|
186
|
-
};
|
|
187
|
-
stroke: {
|
|
188
|
-
primary: string;
|
|
189
|
-
secondary: string;
|
|
190
|
-
tertiary: string;
|
|
191
|
-
focused: string;
|
|
192
|
-
};
|
|
193
|
-
fill: {
|
|
194
|
-
primary: string;
|
|
195
|
-
secondary: string;
|
|
196
|
-
tertiary: string;
|
|
197
|
-
quaternary: string;
|
|
198
|
-
};
|
|
199
|
-
accent: {
|
|
200
|
-
primary: string;
|
|
201
|
-
control: string;
|
|
202
|
-
controlHover: string;
|
|
203
|
-
};
|
|
204
|
-
diff: {
|
|
205
|
-
insertedLine: string;
|
|
206
|
-
removedLine: string;
|
|
207
|
-
stripAdded: string;
|
|
208
|
-
stripRemoved: string;
|
|
209
|
-
};
|
|
210
|
-
category: Readonly<Record<Color, string>>;
|
|
211
|
-
};
|
|
212
|
-
/** Legacy name; prefer `useHostTheme().category`. */
|
|
213
|
-
export declare const colorPalette: Readonly<Record<Color, string>>;
|
|
214
|
-
/** Auto-color rotation for `UsageBar` segments without an explicit color. */
|
|
215
|
-
export declare const usageColorSequence: readonly Color[];
|
|
216
|
-
/** Chart palette keys (IDE `canvas-tokens.d.ts` — not re-exported from SDK `index.d.ts`). */
|
|
217
|
-
export declare const chartPalette: {
|
|
218
|
-
readonly green: "#1F8A65E8";
|
|
219
|
-
readonly darkGreen: "#0D855AE0";
|
|
220
|
-
readonly lightGreen: "#52B896E0";
|
|
221
|
-
readonly mintGreen: "#7DCAB0E0";
|
|
222
|
-
readonly blue: "#2E79B5E0";
|
|
223
|
-
readonly lightBlue: "#70B0D8E0";
|
|
224
|
-
readonly indigo: "#5A6CC0F0";
|
|
225
|
-
readonly lightIndigo: "#9AAADCE0";
|
|
226
|
-
readonly purple: "#7B64B8F0";
|
|
227
|
-
readonly lightPurple: "#AA98D8E0";
|
|
228
|
-
readonly warmPink: "#C85898E0";
|
|
229
|
-
readonly lightPink: "#E8A0C4E0";
|
|
230
|
-
readonly brightOrange: "#F0A040E0";
|
|
231
|
-
readonly deepOrange: "#C06028E0";
|
|
232
|
-
readonly goldenYellow: "#E8C030E0";
|
|
233
|
-
readonly darkAmber: "#C04848E0";
|
|
234
|
-
readonly warmPeach: "#F0A088E0";
|
|
235
|
-
readonly vibrantTeal: "#2A9A8AE0";
|
|
236
|
-
readonly muted: "#8888A8E0";
|
|
237
|
-
readonly neutralLine: "#888899D0";
|
|
238
|
-
};
|
|
239
|
-
export type ChartPalette = typeof chartPalette;
|
|
240
|
-
/** Typography / spacing / radius from IDE `theme.d.ts` (available on `useHostTheme()`). */
|
|
241
|
-
export declare const canvasTypography: {
|
|
242
|
-
readonly h1: {
|
|
243
|
-
readonly fontSize: "24px";
|
|
244
|
-
readonly lineHeight: "30px";
|
|
245
|
-
readonly fontWeight: 590;
|
|
246
|
-
};
|
|
247
|
-
readonly h2: {
|
|
248
|
-
readonly fontSize: "18px";
|
|
249
|
-
readonly lineHeight: "24px";
|
|
250
|
-
readonly fontWeight: 590;
|
|
251
|
-
};
|
|
252
|
-
readonly h3: {
|
|
253
|
-
readonly fontSize: "16px";
|
|
254
|
-
readonly lineHeight: "22px";
|
|
255
|
-
readonly fontWeight: 590;
|
|
256
|
-
};
|
|
257
|
-
readonly body: {
|
|
258
|
-
readonly fontSize: "14px";
|
|
259
|
-
readonly lineHeight: "20px";
|
|
260
|
-
readonly fontWeight: 400;
|
|
261
|
-
};
|
|
262
|
-
readonly small: {
|
|
263
|
-
readonly fontSize: "12px";
|
|
264
|
-
readonly lineHeight: "16px";
|
|
265
|
-
readonly fontWeight: 400;
|
|
266
|
-
};
|
|
267
|
-
};
|
|
268
|
-
export declare const canvasSpacing: {
|
|
269
|
-
readonly '0.5': 2;
|
|
270
|
-
readonly '1': 4;
|
|
271
|
-
readonly '1.5': 6;
|
|
272
|
-
readonly '2': 8;
|
|
273
|
-
readonly '2.5': 10;
|
|
274
|
-
readonly '3': 12;
|
|
275
|
-
readonly '3.5': 14;
|
|
276
|
-
readonly '4': 16;
|
|
277
|
-
readonly '4.5': 18;
|
|
278
|
-
readonly '5': 20;
|
|
279
|
-
readonly '6': 24;
|
|
280
|
-
readonly '7': 28;
|
|
281
|
-
readonly '8': 32;
|
|
282
|
-
readonly '9': 36;
|
|
283
|
-
readonly '10': 40;
|
|
284
|
-
};
|
|
285
|
-
export declare const canvasRadius: {
|
|
286
|
-
readonly none: 0;
|
|
287
|
-
readonly xs: 2;
|
|
288
|
-
readonly sm: 4;
|
|
289
|
-
readonly md: 6;
|
|
290
|
-
readonly lg: 8;
|
|
291
|
-
readonly xl: 12;
|
|
292
|
-
readonly full: 9999;
|
|
293
|
-
};
|
|
294
|
-
/** Ordered hues for automatic chart-series coloring. */
|
|
295
|
-
export declare const chartColorSequence: readonly string[];
|
|
296
|
-
/**
|
|
297
|
-
* Maps every semantic tone literal used across primitives to a hex color, so
|
|
298
|
-
* a `Stat tone="success"` and a `ChartSeries tone="success"` match.
|
|
299
|
-
*/
|
|
300
|
-
export declare const toneHex: Record<string, string>;
|
|
301
|
-
/** Maps a semantic tone to a Mantine color name (for components that use it). */
|
|
302
|
-
export declare const toneColor: Record<string, string>;
|
|
303
|
-
/** Host theme returned by `useHostTheme()`. Extends the token groups. */
|
|
304
|
-
export interface CanvasHostTheme extends CanvasTokens {
|
|
305
|
-
readonly kind: string;
|
|
306
|
-
readonly tokens: CanvasTokens;
|
|
307
|
-
readonly palette: CanvasPalette;
|
|
308
|
-
readonly category: CategoryPalette;
|
|
309
|
-
/** Used by some IDE canvases for custom SVG; see COMPAT.md. */
|
|
310
|
-
readonly chart: {
|
|
311
|
-
readonly palette: ChartPalette;
|
|
312
|
-
readonly sequence: readonly string[];
|
|
313
|
-
};
|
|
314
|
-
readonly radius: typeof canvasRadius;
|
|
315
|
-
readonly typography: typeof canvasTypography;
|
|
316
|
-
readonly spacing: typeof canvasSpacing;
|
|
317
|
-
}
|
|
318
|
-
export declare function buildHostTheme(kind: 'light' | 'dark'): CanvasHostTheme;
|
|
319
|
-
export {};
|
package/dist/shim/todo.d.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { CSSProperties } from 'react';
|
|
2
|
-
export type TodoStatus = 'pending' | 'in_progress' | 'completed' | 'cancelled';
|
|
3
|
-
export interface TodoItem {
|
|
4
|
-
readonly id: string;
|
|
5
|
-
readonly content: string;
|
|
6
|
-
readonly status: TodoStatus;
|
|
7
|
-
}
|
|
8
|
-
export type TodoListProps = {
|
|
9
|
-
todos: readonly TodoItem[];
|
|
10
|
-
dimmedTodoIds?: ReadonlySet<string>;
|
|
11
|
-
onTodoClick?: (todo: TodoItem) => void;
|
|
12
|
-
style?: CSSProperties;
|
|
13
|
-
};
|
|
14
|
-
export declare function TodoList({ todos, dimmedTodoIds, onTodoClick, style, }: TodoListProps): import("react").JSX.Element | null;
|
|
15
|
-
export type TodoListCardProps = {
|
|
16
|
-
todos: readonly TodoItem[];
|
|
17
|
-
dimmedTodoIds?: ReadonlySet<string>;
|
|
18
|
-
defaultExpanded?: boolean;
|
|
19
|
-
onTodoClick?: (todo: TodoItem) => void;
|
|
20
|
-
style?: CSSProperties;
|
|
21
|
-
};
|
|
22
|
-
export declare function TodoListCard({ todos, dimmedTodoIds, defaultExpanded, onTodoClick, style, }: TodoListCardProps): import("react").JSX.Element | null;
|