@refraction-ui/react 0.18.3 → 0.18.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dist-IBD7CHHX.js +649 -0
- package/dist/dist-IBD7CHHX.js.map +1 -0
- package/dist/index.cjs +3593 -1235
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +1608 -1
- package/dist/index.js.map +1 -1
- package/dist/internal/ai/index.d.cts +111 -0
- package/dist/internal/ai/index.d.ts +111 -0
- package/dist/internal/charts/index.d.cts +95 -0
- package/dist/internal/charts/index.d.ts +95 -0
- package/dist/internal/command-input/index.d.cts +41 -0
- package/dist/internal/command-input/index.d.ts +41 -0
- package/dist/internal/diff-viewer/index.d.cts +118 -0
- package/dist/internal/diff-viewer/index.d.ts +118 -0
- package/dist/internal/react-ai/index.d.cts +59 -0
- package/dist/internal/react-ai/index.d.ts +59 -0
- package/dist/internal/react-charts/index.d.cts +108 -0
- package/dist/internal/react-charts/index.d.ts +108 -0
- package/dist/internal/react-command-input/index.d.cts +21 -0
- package/dist/internal/react-command-input/index.d.ts +21 -0
- package/dist/internal/react-diff-viewer/index.d.cts +45 -0
- package/dist/internal/react-diff-viewer/index.d.ts +45 -0
- package/dist/internal/react-location-selector/index.d.cts +14 -0
- package/dist/internal/react-location-selector/index.d.ts +14 -0
- package/dist/theme.cjs +10 -10
- package/dist/theme.cjs.map +1 -1
- package/dist/theme.js +10 -10
- package/dist/theme.js.map +1 -1
- package/package.json +2 -1
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { AccessibilityProps, TokenContract } from '../shared/index.js';
|
|
2
|
+
|
|
3
|
+
type DiffViewerTheme = 'light' | 'dark';
|
|
4
|
+
type DiffViewMode = 'side-by-side' | 'inline';
|
|
5
|
+
type DiffFileStatus = 'added' | 'modified' | 'deleted' | 'renamed';
|
|
6
|
+
interface DiffFile {
|
|
7
|
+
/** File path */
|
|
8
|
+
path: string;
|
|
9
|
+
/** Change status */
|
|
10
|
+
status: DiffFileStatus;
|
|
11
|
+
/** Lines added */
|
|
12
|
+
additions: number;
|
|
13
|
+
/** Lines deleted */
|
|
14
|
+
deletions: number;
|
|
15
|
+
/** Unified diff content for this file */
|
|
16
|
+
diff?: string;
|
|
17
|
+
/** Old path for renamed files */
|
|
18
|
+
oldPath?: string;
|
|
19
|
+
}
|
|
20
|
+
interface DiffViewerProps {
|
|
21
|
+
/** Files in this diff */
|
|
22
|
+
files?: DiffFile[];
|
|
23
|
+
/** Index of the active file */
|
|
24
|
+
activeFileIndex?: number;
|
|
25
|
+
/** View mode */
|
|
26
|
+
viewMode?: DiffViewMode;
|
|
27
|
+
/** Theme */
|
|
28
|
+
theme?: DiffViewerTheme;
|
|
29
|
+
/** Language for syntax highlighting */
|
|
30
|
+
language?: string;
|
|
31
|
+
/** Whether the sidebar is visible */
|
|
32
|
+
sidebarOpen?: boolean;
|
|
33
|
+
/** Callback when active file changes */
|
|
34
|
+
onFileSelect?: (index: number) => void;
|
|
35
|
+
/** Callback when view mode changes */
|
|
36
|
+
onViewModeChange?: (mode: DiffViewMode) => void;
|
|
37
|
+
/** Callback when sidebar toggled */
|
|
38
|
+
onSidebarToggle?: () => void;
|
|
39
|
+
}
|
|
40
|
+
interface DiffViewerState {
|
|
41
|
+
activeFileIndex: number;
|
|
42
|
+
viewMode: DiffViewMode;
|
|
43
|
+
theme: DiffViewerTheme;
|
|
44
|
+
language: string;
|
|
45
|
+
sidebarOpen: boolean;
|
|
46
|
+
files: DiffFile[];
|
|
47
|
+
}
|
|
48
|
+
interface DiffViewerAPI {
|
|
49
|
+
/** Current viewer state */
|
|
50
|
+
state: DiffViewerState;
|
|
51
|
+
/** ARIA attributes for the root element */
|
|
52
|
+
ariaProps: Partial<AccessibilityProps> & Record<string, unknown>;
|
|
53
|
+
/** Data attributes for CSS styling hooks */
|
|
54
|
+
dataAttributes: Record<string, string>;
|
|
55
|
+
/** Select a file by index */
|
|
56
|
+
selectFile: (index: number) => void;
|
|
57
|
+
/** Move to next file */
|
|
58
|
+
nextFile: () => void;
|
|
59
|
+
/** Move to previous file */
|
|
60
|
+
prevFile: () => void;
|
|
61
|
+
/** Toggle view mode */
|
|
62
|
+
toggleViewMode: () => void;
|
|
63
|
+
/** Toggle sidebar */
|
|
64
|
+
toggleSidebar: () => void;
|
|
65
|
+
/** Get language label for a file path */
|
|
66
|
+
getLanguageForFile: (path: string) => string;
|
|
67
|
+
/** Get human-readable file status icon */
|
|
68
|
+
getFileStatusIcon: (status: DiffFileStatus) => string;
|
|
69
|
+
/** Get total additions across all files */
|
|
70
|
+
totalAdditions: () => number;
|
|
71
|
+
/** Get total deletions across all files */
|
|
72
|
+
totalDeletions: () => number;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Create a headless diff viewer API.
|
|
76
|
+
*
|
|
77
|
+
* Manages file selection, view mode, sidebar state, and produces ARIA/data
|
|
78
|
+
* attributes. The actual rendering (Monaco DiffEditor, custom renderer, etc.)
|
|
79
|
+
* is handled by framework-specific wrappers.
|
|
80
|
+
*/
|
|
81
|
+
declare function createDiffViewer(props?: DiffViewerProps): DiffViewerAPI;
|
|
82
|
+
|
|
83
|
+
declare const diffViewerTokens: TokenContract;
|
|
84
|
+
declare const diffViewerVariants: (props?: ({
|
|
85
|
+
theme?: "light" | "dark" | undefined;
|
|
86
|
+
fullscreen?: "true" | "false" | undefined;
|
|
87
|
+
} & {
|
|
88
|
+
className?: string;
|
|
89
|
+
}) | undefined) => string;
|
|
90
|
+
declare const sidebarVariants: (props?: ({
|
|
91
|
+
theme?: "light" | "dark" | undefined;
|
|
92
|
+
} & {
|
|
93
|
+
className?: string;
|
|
94
|
+
}) | undefined) => string;
|
|
95
|
+
declare const sidebarItemVariants: (props?: ({
|
|
96
|
+
active?: "true" | "false" | undefined;
|
|
97
|
+
theme?: "light" | "dark" | undefined;
|
|
98
|
+
} & {
|
|
99
|
+
className?: string;
|
|
100
|
+
}) | undefined) => string;
|
|
101
|
+
declare const tabBarVariants: (props?: ({
|
|
102
|
+
theme?: "light" | "dark" | undefined;
|
|
103
|
+
} & {
|
|
104
|
+
className?: string;
|
|
105
|
+
}) | undefined) => string;
|
|
106
|
+
declare const tabVariants: (props?: ({
|
|
107
|
+
active?: "true" | "false" | undefined;
|
|
108
|
+
theme?: "light" | "dark" | undefined;
|
|
109
|
+
} & {
|
|
110
|
+
className?: string;
|
|
111
|
+
}) | undefined) => string;
|
|
112
|
+
declare const statusBarVariants: (props?: ({
|
|
113
|
+
theme?: "light" | "dark" | undefined;
|
|
114
|
+
} & {
|
|
115
|
+
className?: string;
|
|
116
|
+
}) | undefined) => string;
|
|
117
|
+
|
|
118
|
+
export { type DiffFile, type DiffFileStatus, type DiffViewMode, type DiffViewerAPI, type DiffViewerProps, type DiffViewerState, type DiffViewerTheme, createDiffViewer, diffViewerTokens, diffViewerVariants, sidebarItemVariants, sidebarVariants, statusBarVariants, tabBarVariants, tabVariants };
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { GenerateOptions, AIConfig, AIProvider as AIProvider$1, TTSOptions, TTSConfig, TTSProvider as TTSProvider$1 } from '../ai/index.cjs';
|
|
3
|
+
export { AIProvider as AIProviderInterface, GenerateOptions, RouterFn, TTSOptions, TTSProvider as TTSProviderInterface } from '../ai/index.cjs';
|
|
4
|
+
|
|
5
|
+
interface AIContextValue {
|
|
6
|
+
generateText: (prompt: string, opts?: GenerateOptions) => Promise<string>;
|
|
7
|
+
generateJSON: <T = unknown>(prompt: string, opts?: GenerateOptions) => Promise<T>;
|
|
8
|
+
providers: string[];
|
|
9
|
+
isGenerating: boolean;
|
|
10
|
+
}
|
|
11
|
+
interface AIProviderProps extends AIConfig {
|
|
12
|
+
children: React.ReactNode;
|
|
13
|
+
/** Pre-register providers by name */
|
|
14
|
+
providers?: Record<string, AIProvider$1>;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* AIProvider — wraps your app with AI context.
|
|
18
|
+
*
|
|
19
|
+
* ```tsx
|
|
20
|
+
* <AIProvider default="openai" providers={{ openai: myOpenAIProvider }}>
|
|
21
|
+
* <App />
|
|
22
|
+
* </AIProvider>
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
declare function AIProvider({ children, providers: providerMap, ...config }: AIProviderProps): React.FunctionComponentElement<React.ProviderProps<AIContextValue | null>>;
|
|
26
|
+
/**
|
|
27
|
+
* useAI — access AI generation methods and state.
|
|
28
|
+
* Must be used within <AIProvider>.
|
|
29
|
+
*/
|
|
30
|
+
declare function useAI(): AIContextValue;
|
|
31
|
+
|
|
32
|
+
interface TTSContextValue {
|
|
33
|
+
speak: (text: string, opts?: TTSOptions) => void;
|
|
34
|
+
stop: () => void;
|
|
35
|
+
isSpeaking: boolean;
|
|
36
|
+
providers: string[];
|
|
37
|
+
}
|
|
38
|
+
interface TTSProviderProps extends TTSConfig {
|
|
39
|
+
children: React.ReactNode;
|
|
40
|
+
/** Pre-register providers by name */
|
|
41
|
+
providers?: Record<string, TTSProvider$1>;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* TTSProvider — wraps your app with TTS context.
|
|
45
|
+
*
|
|
46
|
+
* ```tsx
|
|
47
|
+
* <TTSProvider providers={{ browser: myBrowserTTS }}>
|
|
48
|
+
* <App />
|
|
49
|
+
* </TTSProvider>
|
|
50
|
+
* ```
|
|
51
|
+
*/
|
|
52
|
+
declare function TTSProvider({ children, providers: providerMap, ...config }: TTSProviderProps): React.FunctionComponentElement<React.ProviderProps<TTSContextValue | null>>;
|
|
53
|
+
/**
|
|
54
|
+
* useTTS — access TTS methods and state.
|
|
55
|
+
* Must be used within <TTSProvider>.
|
|
56
|
+
*/
|
|
57
|
+
declare function useTTS(): TTSContextValue;
|
|
58
|
+
|
|
59
|
+
export { type AIContextValue, AIProvider, type AIProviderProps, type TTSContextValue, TTSProvider, type TTSProviderProps, useAI, useTTS };
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { GenerateOptions, AIConfig, AIProvider as AIProvider$1, TTSOptions, TTSConfig, TTSProvider as TTSProvider$1 } from '../ai/index.js';
|
|
3
|
+
export { AIProvider as AIProviderInterface, GenerateOptions, RouterFn, TTSOptions, TTSProvider as TTSProviderInterface } from '../ai/index.js';
|
|
4
|
+
|
|
5
|
+
interface AIContextValue {
|
|
6
|
+
generateText: (prompt: string, opts?: GenerateOptions) => Promise<string>;
|
|
7
|
+
generateJSON: <T = unknown>(prompt: string, opts?: GenerateOptions) => Promise<T>;
|
|
8
|
+
providers: string[];
|
|
9
|
+
isGenerating: boolean;
|
|
10
|
+
}
|
|
11
|
+
interface AIProviderProps extends AIConfig {
|
|
12
|
+
children: React.ReactNode;
|
|
13
|
+
/** Pre-register providers by name */
|
|
14
|
+
providers?: Record<string, AIProvider$1>;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* AIProvider — wraps your app with AI context.
|
|
18
|
+
*
|
|
19
|
+
* ```tsx
|
|
20
|
+
* <AIProvider default="openai" providers={{ openai: myOpenAIProvider }}>
|
|
21
|
+
* <App />
|
|
22
|
+
* </AIProvider>
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
declare function AIProvider({ children, providers: providerMap, ...config }: AIProviderProps): React.FunctionComponentElement<React.ProviderProps<AIContextValue | null>>;
|
|
26
|
+
/**
|
|
27
|
+
* useAI — access AI generation methods and state.
|
|
28
|
+
* Must be used within <AIProvider>.
|
|
29
|
+
*/
|
|
30
|
+
declare function useAI(): AIContextValue;
|
|
31
|
+
|
|
32
|
+
interface TTSContextValue {
|
|
33
|
+
speak: (text: string, opts?: TTSOptions) => void;
|
|
34
|
+
stop: () => void;
|
|
35
|
+
isSpeaking: boolean;
|
|
36
|
+
providers: string[];
|
|
37
|
+
}
|
|
38
|
+
interface TTSProviderProps extends TTSConfig {
|
|
39
|
+
children: React.ReactNode;
|
|
40
|
+
/** Pre-register providers by name */
|
|
41
|
+
providers?: Record<string, TTSProvider$1>;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* TTSProvider — wraps your app with TTS context.
|
|
45
|
+
*
|
|
46
|
+
* ```tsx
|
|
47
|
+
* <TTSProvider providers={{ browser: myBrowserTTS }}>
|
|
48
|
+
* <App />
|
|
49
|
+
* </TTSProvider>
|
|
50
|
+
* ```
|
|
51
|
+
*/
|
|
52
|
+
declare function TTSProvider({ children, providers: providerMap, ...config }: TTSProviderProps): React.FunctionComponentElement<React.ProviderProps<TTSContextValue | null>>;
|
|
53
|
+
/**
|
|
54
|
+
* useTTS — access TTS methods and state.
|
|
55
|
+
* Must be used within <TTSProvider>.
|
|
56
|
+
*/
|
|
57
|
+
declare function useTTS(): TTSContextValue;
|
|
58
|
+
|
|
59
|
+
export { type AIContextValue, AIProvider, type AIProviderProps, type TTSContextValue, TTSProvider, type TTSProviderProps, useAI, useTTS };
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { Margin, Dimensions } from '../charts/index.cjs';
|
|
4
|
+
|
|
5
|
+
interface ChartProps {
|
|
6
|
+
width?: number;
|
|
7
|
+
height?: number;
|
|
8
|
+
margin?: Partial<Margin>;
|
|
9
|
+
children?: React.ReactNode;
|
|
10
|
+
}
|
|
11
|
+
declare function Chart({ width, height, margin, children, }: ChartProps): react_jsx_runtime.JSX.Element;
|
|
12
|
+
|
|
13
|
+
interface BarsProps<T = unknown> {
|
|
14
|
+
data: T[];
|
|
15
|
+
x: (d: T) => string;
|
|
16
|
+
y: (d: T) => number;
|
|
17
|
+
fill?: string;
|
|
18
|
+
}
|
|
19
|
+
declare function Bars<T>({ data, x, y, fill }: BarsProps<T>): react_jsx_runtime.JSX.Element;
|
|
20
|
+
|
|
21
|
+
interface LineProps<T = unknown> {
|
|
22
|
+
data: T[];
|
|
23
|
+
x: (d: T) => number;
|
|
24
|
+
y: (d: T) => number;
|
|
25
|
+
stroke?: string;
|
|
26
|
+
strokeWidth?: number;
|
|
27
|
+
fill?: string;
|
|
28
|
+
}
|
|
29
|
+
declare function Line<T>({ data, x, y, stroke, strokeWidth, fill, }: LineProps<T>): react_jsx_runtime.JSX.Element;
|
|
30
|
+
|
|
31
|
+
interface CirclesProps<T = unknown> {
|
|
32
|
+
data: T[];
|
|
33
|
+
cx: (d: T) => number;
|
|
34
|
+
cy: (d: T) => number;
|
|
35
|
+
r?: number;
|
|
36
|
+
fill?: string;
|
|
37
|
+
}
|
|
38
|
+
declare function Circles<T>({ data, cx, cy, r, fill, }: CirclesProps<T>): react_jsx_runtime.JSX.Element;
|
|
39
|
+
|
|
40
|
+
interface XAxisProps {
|
|
41
|
+
ticks: (number | string)[];
|
|
42
|
+
scale: (value: number | string) => number;
|
|
43
|
+
height: number;
|
|
44
|
+
tickSize?: number;
|
|
45
|
+
}
|
|
46
|
+
declare function XAxis({ ticks, scale, height, tickSize, }: XAxisProps): react_jsx_runtime.JSX.Element;
|
|
47
|
+
|
|
48
|
+
interface YAxisProps {
|
|
49
|
+
ticks: (number | string)[];
|
|
50
|
+
scale: (value: number | string) => number;
|
|
51
|
+
tickSize?: number;
|
|
52
|
+
}
|
|
53
|
+
declare function YAxis({ ticks, scale, tickSize, }: YAxisProps): react_jsx_runtime.JSX.Element;
|
|
54
|
+
|
|
55
|
+
interface GradientProps {
|
|
56
|
+
id: string;
|
|
57
|
+
from: string;
|
|
58
|
+
to: string;
|
|
59
|
+
direction?: 'vertical' | 'horizontal';
|
|
60
|
+
}
|
|
61
|
+
declare function Gradient({ id, from, to, direction, }: GradientProps): react_jsx_runtime.JSX.Element;
|
|
62
|
+
|
|
63
|
+
interface HistogramProps {
|
|
64
|
+
data: number[];
|
|
65
|
+
width?: number;
|
|
66
|
+
height?: number;
|
|
67
|
+
bins?: number;
|
|
68
|
+
fill?: string;
|
|
69
|
+
margin?: Partial<Margin>;
|
|
70
|
+
}
|
|
71
|
+
declare function Histogram({ data, width, height, bins: binCount, fill, margin, }: HistogramProps): react_jsx_runtime.JSX.Element;
|
|
72
|
+
|
|
73
|
+
interface ScatterPlotProps<T = unknown> {
|
|
74
|
+
data: T[];
|
|
75
|
+
x: (d: T) => number;
|
|
76
|
+
y: (d: T) => number;
|
|
77
|
+
width?: number;
|
|
78
|
+
height?: number;
|
|
79
|
+
r?: number;
|
|
80
|
+
fill?: string;
|
|
81
|
+
margin?: Partial<Margin>;
|
|
82
|
+
}
|
|
83
|
+
declare function ScatterPlot<T>({ data, x, y, width, height, r, fill, margin, }: ScatterPlotProps<T>): react_jsx_runtime.JSX.Element;
|
|
84
|
+
|
|
85
|
+
interface PieChartProps<T = unknown> {
|
|
86
|
+
data: T[];
|
|
87
|
+
value: (d: T) => number;
|
|
88
|
+
width?: number;
|
|
89
|
+
height?: number;
|
|
90
|
+
colors?: string[];
|
|
91
|
+
}
|
|
92
|
+
declare function PieChart<T>({ data, value, width, height, colors, }: PieChartProps<T>): react_jsx_runtime.JSX.Element;
|
|
93
|
+
|
|
94
|
+
interface ChartContextValue {
|
|
95
|
+
dimensions: Dimensions;
|
|
96
|
+
/**
|
|
97
|
+
* Internal marker: `true` only on the context *default* (i.e. no `<Chart>`
|
|
98
|
+
* provider above this consumer). `<Chart>` always supplies a value without
|
|
99
|
+
* this flag. Used purely to detect the silent-default footgun — never read
|
|
100
|
+
* for rendering, and stripped from the public type surface.
|
|
101
|
+
*
|
|
102
|
+
* @internal
|
|
103
|
+
*/
|
|
104
|
+
__isDefault?: boolean;
|
|
105
|
+
}
|
|
106
|
+
declare const ChartContext: React.Context<ChartContextValue>;
|
|
107
|
+
|
|
108
|
+
export { Bars, type BarsProps, Chart, ChartContext, type ChartContextValue, type ChartProps, Circles, type CirclesProps, Gradient, type GradientProps, Histogram, type HistogramProps, Line, type LineProps, PieChart, type PieChartProps, ScatterPlot, type ScatterPlotProps, XAxis, type XAxisProps, YAxis, type YAxisProps };
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { Margin, Dimensions } from '../charts/index.js';
|
|
4
|
+
|
|
5
|
+
interface ChartProps {
|
|
6
|
+
width?: number;
|
|
7
|
+
height?: number;
|
|
8
|
+
margin?: Partial<Margin>;
|
|
9
|
+
children?: React.ReactNode;
|
|
10
|
+
}
|
|
11
|
+
declare function Chart({ width, height, margin, children, }: ChartProps): react_jsx_runtime.JSX.Element;
|
|
12
|
+
|
|
13
|
+
interface BarsProps<T = unknown> {
|
|
14
|
+
data: T[];
|
|
15
|
+
x: (d: T) => string;
|
|
16
|
+
y: (d: T) => number;
|
|
17
|
+
fill?: string;
|
|
18
|
+
}
|
|
19
|
+
declare function Bars<T>({ data, x, y, fill }: BarsProps<T>): react_jsx_runtime.JSX.Element;
|
|
20
|
+
|
|
21
|
+
interface LineProps<T = unknown> {
|
|
22
|
+
data: T[];
|
|
23
|
+
x: (d: T) => number;
|
|
24
|
+
y: (d: T) => number;
|
|
25
|
+
stroke?: string;
|
|
26
|
+
strokeWidth?: number;
|
|
27
|
+
fill?: string;
|
|
28
|
+
}
|
|
29
|
+
declare function Line<T>({ data, x, y, stroke, strokeWidth, fill, }: LineProps<T>): react_jsx_runtime.JSX.Element;
|
|
30
|
+
|
|
31
|
+
interface CirclesProps<T = unknown> {
|
|
32
|
+
data: T[];
|
|
33
|
+
cx: (d: T) => number;
|
|
34
|
+
cy: (d: T) => number;
|
|
35
|
+
r?: number;
|
|
36
|
+
fill?: string;
|
|
37
|
+
}
|
|
38
|
+
declare function Circles<T>({ data, cx, cy, r, fill, }: CirclesProps<T>): react_jsx_runtime.JSX.Element;
|
|
39
|
+
|
|
40
|
+
interface XAxisProps {
|
|
41
|
+
ticks: (number | string)[];
|
|
42
|
+
scale: (value: number | string) => number;
|
|
43
|
+
height: number;
|
|
44
|
+
tickSize?: number;
|
|
45
|
+
}
|
|
46
|
+
declare function XAxis({ ticks, scale, height, tickSize, }: XAxisProps): react_jsx_runtime.JSX.Element;
|
|
47
|
+
|
|
48
|
+
interface YAxisProps {
|
|
49
|
+
ticks: (number | string)[];
|
|
50
|
+
scale: (value: number | string) => number;
|
|
51
|
+
tickSize?: number;
|
|
52
|
+
}
|
|
53
|
+
declare function YAxis({ ticks, scale, tickSize, }: YAxisProps): react_jsx_runtime.JSX.Element;
|
|
54
|
+
|
|
55
|
+
interface GradientProps {
|
|
56
|
+
id: string;
|
|
57
|
+
from: string;
|
|
58
|
+
to: string;
|
|
59
|
+
direction?: 'vertical' | 'horizontal';
|
|
60
|
+
}
|
|
61
|
+
declare function Gradient({ id, from, to, direction, }: GradientProps): react_jsx_runtime.JSX.Element;
|
|
62
|
+
|
|
63
|
+
interface HistogramProps {
|
|
64
|
+
data: number[];
|
|
65
|
+
width?: number;
|
|
66
|
+
height?: number;
|
|
67
|
+
bins?: number;
|
|
68
|
+
fill?: string;
|
|
69
|
+
margin?: Partial<Margin>;
|
|
70
|
+
}
|
|
71
|
+
declare function Histogram({ data, width, height, bins: binCount, fill, margin, }: HistogramProps): react_jsx_runtime.JSX.Element;
|
|
72
|
+
|
|
73
|
+
interface ScatterPlotProps<T = unknown> {
|
|
74
|
+
data: T[];
|
|
75
|
+
x: (d: T) => number;
|
|
76
|
+
y: (d: T) => number;
|
|
77
|
+
width?: number;
|
|
78
|
+
height?: number;
|
|
79
|
+
r?: number;
|
|
80
|
+
fill?: string;
|
|
81
|
+
margin?: Partial<Margin>;
|
|
82
|
+
}
|
|
83
|
+
declare function ScatterPlot<T>({ data, x, y, width, height, r, fill, margin, }: ScatterPlotProps<T>): react_jsx_runtime.JSX.Element;
|
|
84
|
+
|
|
85
|
+
interface PieChartProps<T = unknown> {
|
|
86
|
+
data: T[];
|
|
87
|
+
value: (d: T) => number;
|
|
88
|
+
width?: number;
|
|
89
|
+
height?: number;
|
|
90
|
+
colors?: string[];
|
|
91
|
+
}
|
|
92
|
+
declare function PieChart<T>({ data, value, width, height, colors, }: PieChartProps<T>): react_jsx_runtime.JSX.Element;
|
|
93
|
+
|
|
94
|
+
interface ChartContextValue {
|
|
95
|
+
dimensions: Dimensions;
|
|
96
|
+
/**
|
|
97
|
+
* Internal marker: `true` only on the context *default* (i.e. no `<Chart>`
|
|
98
|
+
* provider above this consumer). `<Chart>` always supplies a value without
|
|
99
|
+
* this flag. Used purely to detect the silent-default footgun — never read
|
|
100
|
+
* for rendering, and stripped from the public type surface.
|
|
101
|
+
*
|
|
102
|
+
* @internal
|
|
103
|
+
*/
|
|
104
|
+
__isDefault?: boolean;
|
|
105
|
+
}
|
|
106
|
+
declare const ChartContext: React.Context<ChartContextValue>;
|
|
107
|
+
|
|
108
|
+
export { Bars, type BarsProps, Chart, ChartContext, type ChartContextValue, type ChartProps, Circles, type CirclesProps, Gradient, type GradientProps, Histogram, type HistogramProps, Line, type LineProps, PieChart, type PieChartProps, ScatterPlot, type ScatterPlotProps, XAxis, type XAxisProps, YAxis, type YAxisProps };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React, { HTMLAttributes } from 'react';
|
|
2
|
+
import { Trigger } from '../command-input/index.cjs';
|
|
3
|
+
|
|
4
|
+
interface CommandInputProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onChange'> {
|
|
5
|
+
value?: string;
|
|
6
|
+
onChange?: (value: string) => void;
|
|
7
|
+
triggers?: Trigger[];
|
|
8
|
+
renderPopover?: (props: {
|
|
9
|
+
isOpen: boolean;
|
|
10
|
+
trigger: string;
|
|
11
|
+
search: string;
|
|
12
|
+
close: () => void;
|
|
13
|
+
position: {
|
|
14
|
+
top: number;
|
|
15
|
+
left: number;
|
|
16
|
+
};
|
|
17
|
+
}) => React.ReactNode;
|
|
18
|
+
}
|
|
19
|
+
declare const CommandInput: React.ForwardRefExoticComponent<CommandInputProps & React.RefAttributes<HTMLDivElement>>;
|
|
20
|
+
|
|
21
|
+
export { CommandInput, type CommandInputProps };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React, { HTMLAttributes } from 'react';
|
|
2
|
+
import { Trigger } from '../command-input/index.js';
|
|
3
|
+
|
|
4
|
+
interface CommandInputProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onChange'> {
|
|
5
|
+
value?: string;
|
|
6
|
+
onChange?: (value: string) => void;
|
|
7
|
+
triggers?: Trigger[];
|
|
8
|
+
renderPopover?: (props: {
|
|
9
|
+
isOpen: boolean;
|
|
10
|
+
trigger: string;
|
|
11
|
+
search: string;
|
|
12
|
+
close: () => void;
|
|
13
|
+
position: {
|
|
14
|
+
top: number;
|
|
15
|
+
left: number;
|
|
16
|
+
};
|
|
17
|
+
}) => React.ReactNode;
|
|
18
|
+
}
|
|
19
|
+
declare const CommandInput: React.ForwardRefExoticComponent<CommandInputProps & React.RefAttributes<HTMLDivElement>>;
|
|
20
|
+
|
|
21
|
+
export { CommandInput, type CommandInputProps };
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { DiffFile, DiffViewerTheme, DiffViewMode } from '../diff-viewer/index.cjs';
|
|
3
|
+
export { DiffFile, DiffFileStatus, DiffViewMode, DiffViewerAPI, DiffViewerState, DiffViewerTheme, createDiffViewer, diffViewerTokens, diffViewerVariants, sidebarItemVariants, sidebarVariants, statusBarVariants, tabBarVariants, tabVariants } from '../diff-viewer/index.cjs';
|
|
4
|
+
|
|
5
|
+
interface DiffViewerProps {
|
|
6
|
+
/** Files in this diff */
|
|
7
|
+
files: DiffFile[];
|
|
8
|
+
/** Original file content (left side) */
|
|
9
|
+
original?: string;
|
|
10
|
+
/** Modified file content (right side) */
|
|
11
|
+
modified?: string;
|
|
12
|
+
/** Language for syntax highlighting (auto-detected from file if omitted) */
|
|
13
|
+
language?: string;
|
|
14
|
+
/** Monaco theme name */
|
|
15
|
+
monacoTheme?: string;
|
|
16
|
+
/** Color theme */
|
|
17
|
+
theme?: DiffViewerTheme;
|
|
18
|
+
/** View mode */
|
|
19
|
+
viewMode?: DiffViewMode;
|
|
20
|
+
/** Whether to show the file sidebar */
|
|
21
|
+
showSidebar?: boolean;
|
|
22
|
+
/** Whether to show the tab bar */
|
|
23
|
+
showTabs?: boolean;
|
|
24
|
+
/** Whether to show the status bar */
|
|
25
|
+
showStatusBar?: boolean;
|
|
26
|
+
/** Sidebar width in pixels */
|
|
27
|
+
sidebarWidth?: number;
|
|
28
|
+
/** Active file index */
|
|
29
|
+
activeFileIndex?: number;
|
|
30
|
+
/** Called when the active file changes */
|
|
31
|
+
onFileSelect?: (index: number) => void;
|
|
32
|
+
/** Called when view mode changes */
|
|
33
|
+
onViewModeChange?: (mode: DiffViewMode) => void;
|
|
34
|
+
/** Title shown in the status bar */
|
|
35
|
+
statusBarTitle?: string;
|
|
36
|
+
/** Status text shown in the status bar */
|
|
37
|
+
statusBarStatus?: string;
|
|
38
|
+
/** Additional class name */
|
|
39
|
+
className?: string;
|
|
40
|
+
/** Monaco DiffEditor options override */
|
|
41
|
+
editorOptions?: Record<string, unknown>;
|
|
42
|
+
}
|
|
43
|
+
declare const DiffViewer: React.ForwardRefExoticComponent<DiffViewerProps & React.RefAttributes<HTMLDivElement>>;
|
|
44
|
+
|
|
45
|
+
export { DiffViewer, type DiffViewerProps };
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { DiffFile, DiffViewerTheme, DiffViewMode } from '../diff-viewer/index.js';
|
|
3
|
+
export { DiffFile, DiffFileStatus, DiffViewMode, DiffViewerAPI, DiffViewerState, DiffViewerTheme, createDiffViewer, diffViewerTokens, diffViewerVariants, sidebarItemVariants, sidebarVariants, statusBarVariants, tabBarVariants, tabVariants } from '../diff-viewer/index.js';
|
|
4
|
+
|
|
5
|
+
interface DiffViewerProps {
|
|
6
|
+
/** Files in this diff */
|
|
7
|
+
files: DiffFile[];
|
|
8
|
+
/** Original file content (left side) */
|
|
9
|
+
original?: string;
|
|
10
|
+
/** Modified file content (right side) */
|
|
11
|
+
modified?: string;
|
|
12
|
+
/** Language for syntax highlighting (auto-detected from file if omitted) */
|
|
13
|
+
language?: string;
|
|
14
|
+
/** Monaco theme name */
|
|
15
|
+
monacoTheme?: string;
|
|
16
|
+
/** Color theme */
|
|
17
|
+
theme?: DiffViewerTheme;
|
|
18
|
+
/** View mode */
|
|
19
|
+
viewMode?: DiffViewMode;
|
|
20
|
+
/** Whether to show the file sidebar */
|
|
21
|
+
showSidebar?: boolean;
|
|
22
|
+
/** Whether to show the tab bar */
|
|
23
|
+
showTabs?: boolean;
|
|
24
|
+
/** Whether to show the status bar */
|
|
25
|
+
showStatusBar?: boolean;
|
|
26
|
+
/** Sidebar width in pixels */
|
|
27
|
+
sidebarWidth?: number;
|
|
28
|
+
/** Active file index */
|
|
29
|
+
activeFileIndex?: number;
|
|
30
|
+
/** Called when the active file changes */
|
|
31
|
+
onFileSelect?: (index: number) => void;
|
|
32
|
+
/** Called when view mode changes */
|
|
33
|
+
onViewModeChange?: (mode: DiffViewMode) => void;
|
|
34
|
+
/** Title shown in the status bar */
|
|
35
|
+
statusBarTitle?: string;
|
|
36
|
+
/** Status text shown in the status bar */
|
|
37
|
+
statusBarStatus?: string;
|
|
38
|
+
/** Additional class name */
|
|
39
|
+
className?: string;
|
|
40
|
+
/** Monaco DiffEditor options override */
|
|
41
|
+
editorOptions?: Record<string, unknown>;
|
|
42
|
+
}
|
|
43
|
+
declare const DiffViewer: React.ForwardRefExoticComponent<DiffViewerProps & React.RefAttributes<HTMLDivElement>>;
|
|
44
|
+
|
|
45
|
+
export { DiffViewer, type DiffViewerProps };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
interface LocationSelectorProps {
|
|
4
|
+
defaultCountry?: string;
|
|
5
|
+
defaultLanguage?: string;
|
|
6
|
+
onCountryChange?: (country: string) => void;
|
|
7
|
+
onLanguageChange?: (language: string) => void;
|
|
8
|
+
className?: string;
|
|
9
|
+
}
|
|
10
|
+
declare function LocationSelector({ defaultCountry, defaultLanguage, onCountryChange, onLanguageChange, className, }: LocationSelectorProps): React.DetailedReactHTMLElement<{
|
|
11
|
+
className: string;
|
|
12
|
+
}, HTMLElement>;
|
|
13
|
+
|
|
14
|
+
export { LocationSelector, type LocationSelectorProps };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
interface LocationSelectorProps {
|
|
4
|
+
defaultCountry?: string;
|
|
5
|
+
defaultLanguage?: string;
|
|
6
|
+
onCountryChange?: (country: string) => void;
|
|
7
|
+
onLanguageChange?: (language: string) => void;
|
|
8
|
+
className?: string;
|
|
9
|
+
}
|
|
10
|
+
declare function LocationSelector({ defaultCountry, defaultLanguage, onCountryChange, onLanguageChange, className, }: LocationSelectorProps): React.DetailedReactHTMLElement<{
|
|
11
|
+
className: string;
|
|
12
|
+
}, HTMLElement>;
|
|
13
|
+
|
|
14
|
+
export { LocationSelector, type LocationSelectorProps };
|
package/dist/theme.cjs
CHANGED
|
@@ -286,6 +286,16 @@ var icons = {
|
|
|
286
286
|
};
|
|
287
287
|
function ThemeToggle({ className, variant = "segmented" }) {
|
|
288
288
|
const { mode, setMode } = useTheme();
|
|
289
|
+
const [open, setOpen] = React2__namespace.useState(false);
|
|
290
|
+
const ref = React2__namespace.useRef(null);
|
|
291
|
+
React2__namespace.useEffect(() => {
|
|
292
|
+
if (!open) return;
|
|
293
|
+
const handler = (e) => {
|
|
294
|
+
if (ref.current && !ref.current.contains(e.target)) setOpen(false);
|
|
295
|
+
};
|
|
296
|
+
document.addEventListener("mousedown", handler);
|
|
297
|
+
return () => document.removeEventListener("mousedown", handler);
|
|
298
|
+
}, [open]);
|
|
289
299
|
if (variant === "segmented") {
|
|
290
300
|
return React2__namespace.createElement(
|
|
291
301
|
"div",
|
|
@@ -307,16 +317,6 @@ function ThemeToggle({ className, variant = "segmented" }) {
|
|
|
307
317
|
)
|
|
308
318
|
);
|
|
309
319
|
}
|
|
310
|
-
const [open, setOpen] = React2__namespace.useState(false);
|
|
311
|
-
const ref = React2__namespace.useRef(null);
|
|
312
|
-
React2__namespace.useEffect(() => {
|
|
313
|
-
if (!open) return;
|
|
314
|
-
const handler = (e) => {
|
|
315
|
-
if (ref.current && !ref.current.contains(e.target)) setOpen(false);
|
|
316
|
-
};
|
|
317
|
-
document.addEventListener("mousedown", handler);
|
|
318
|
-
return () => document.removeEventListener("mousedown", handler);
|
|
319
|
-
}, [open]);
|
|
320
320
|
const currentIcon = modes.find((m) => m.value === mode)?.icon ?? "monitor";
|
|
321
321
|
return React2__namespace.createElement(
|
|
322
322
|
"div",
|