@salilvnair/dui 1.0.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/LICENSE +21 -0
- package/README.md +185 -0
- package/dist/chunks/EditorView.shell-BGH2VhWM.js +460 -0
- package/dist/chunks/EditorView.shell-BGH2VhWM.js.map +1 -0
- package/dist/chunks/daakia-icons-DxWnX_IQ.js +1726 -0
- package/dist/chunks/daakia-icons-DxWnX_IQ.js.map +1 -0
- package/dist/icons/daakia-icons.d.ts +304 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +17032 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/components/button/AIButtonView.d.ts +20 -0
- package/dist/lib/components/button/ButtonView.d.ts +28 -0
- package/dist/lib/components/button/DropDownButtonView.d.ts +19 -0
- package/dist/lib/components/button/IconButtonView.d.ts +22 -0
- package/dist/lib/components/button/SegmentedView.d.ts +17 -0
- package/dist/lib/components/button/SplitButtonView.d.ts +23 -0
- package/dist/lib/components/chips/ChipView.d.ts +21 -0
- package/dist/lib/components/display/CodeBlockView.d.ts +11 -0
- package/dist/lib/components/display/ColoredTextView.d.ts +18 -0
- package/dist/lib/components/display/CopyButtonView.d.ts +11 -0
- package/dist/lib/components/display/DataTableView.d.ts +27 -0
- package/dist/lib/components/display/DottedCardView.d.ts +10 -0
- package/dist/lib/components/display/EmptyStateView.d.ts +14 -0
- package/dist/lib/components/display/ExpandableLogEntryView.d.ts +14 -0
- package/dist/lib/components/display/FeatureCategoryView.d.ts +18 -0
- package/dist/lib/components/display/HudView.d.ts +25 -0
- package/dist/lib/components/display/JsonTreeView.d.ts +11 -0
- package/dist/lib/components/display/LiveColorCustomizer.d.ts +21 -0
- package/dist/lib/components/display/LoaderView.d.ts +12 -0
- package/dist/lib/components/display/MarkdownView.d.ts +19 -0
- package/dist/lib/components/display/PromptCardView.d.ts +33 -0
- package/dist/lib/components/display/PromptLibraryEditorView.d.ts +32 -0
- package/dist/lib/components/display/PromptLibraryListView.d.ts +30 -0
- package/dist/lib/components/display/StageView.d.ts +26 -0
- package/dist/lib/components/display/StatsCardView.d.ts +15 -0
- package/dist/lib/components/display/StatusIndicatorView.d.ts +14 -0
- package/dist/lib/components/display/ToastView.d.ts +19 -0
- package/dist/lib/components/display/YamlKeyChip.d.ts +15 -0
- package/dist/lib/components/input/CheckboxView.d.ts +15 -0
- package/dist/lib/components/input/DebugEditorView.d.ts +26 -0
- package/dist/lib/components/input/DiffEditorView.d.ts +18 -0
- package/dist/lib/components/input/DiffEditorView.fallback.d.ts +2 -0
- package/dist/lib/components/input/DiffEditorView.monaco.d.ts +2 -0
- package/dist/lib/components/input/DurationInputView.d.ts +15 -0
- package/dist/lib/components/input/EditorView.d.ts +222 -0
- package/dist/lib/components/input/EditorView.fallback.d.ts +10 -0
- package/dist/lib/components/input/EditorView.monaco.d.ts +2 -0
- package/dist/lib/components/input/EditorView.shell.d.ts +13 -0
- package/dist/lib/components/input/FormDataTableView.d.ts +22 -0
- package/dist/lib/components/input/HiddenKeyValueItemView.d.ts +22 -0
- package/dist/lib/components/input/HighlightedInputView.d.ts +26 -0
- package/dist/lib/components/input/KeyValueTableRowView.d.ts +31 -0
- package/dist/lib/components/input/KeyValueTableView.d.ts +59 -0
- package/dist/lib/components/input/MergedInputView.d.ts +43 -0
- package/dist/lib/components/input/MultilineInputView.d.ts +15 -0
- package/dist/lib/components/input/SearchInputView.d.ts +17 -0
- package/dist/lib/components/input/SegmentedControlView.d.ts +23 -0
- package/dist/lib/components/input/SelectInputView.d.ts +31 -0
- package/dist/lib/components/input/SelectTextInputView.d.ts +44 -0
- package/dist/lib/components/input/SliderView.d.ts +15 -0
- package/dist/lib/components/input/TabView.d.ts +28 -0
- package/dist/lib/components/input/TagInputView.d.ts +10 -0
- package/dist/lib/components/input/TextInputView.d.ts +36 -0
- package/dist/lib/components/input/ThemeCardSelectorView.d.ts +18 -0
- package/dist/lib/components/input/ToggleSwitchView.d.ts +19 -0
- package/dist/lib/components/layout/BottomPanelView.d.ts +16 -0
- package/dist/lib/components/layout/CollapsibleSectionView.d.ts +14 -0
- package/dist/lib/components/layout/DebugView.d.ts +63 -0
- package/dist/lib/components/layout/FolderView.d.ts +85 -0
- package/dist/lib/components/layout/ResizablePanelView.d.ts +10 -0
- package/dist/lib/components/layout/SettingsNavView.d.ts +29 -0
- package/dist/lib/components/layout/SideNavView.d.ts +39 -0
- package/dist/lib/components/layout/SpacerView.d.ts +7 -0
- package/dist/lib/components/layout/SplitPanelView.d.ts +33 -0
- package/dist/lib/components/modal/ContextMenuView.d.ts +28 -0
- package/dist/lib/components/modal/InfoPopupView.d.ts +17 -0
- package/dist/lib/components/modal/ModalView.d.ts +41 -0
- package/dist/lib/components/rearrange/RearrangeView.d.ts +34 -0
- package/dist/lib/components/tabs/PilledTabView.d.ts +19 -0
- package/dist/lib/components/tabs/TabBarView.d.ts +28 -0
- package/dist/lib/components/tabs/TabView.d.ts +34 -0
- package/dist/lib/core/ButtonBase.d.ts +28 -0
- package/dist/lib/core/CardBase.d.ts +21 -0
- package/dist/lib/core/ChipBase.d.ts +21 -0
- package/dist/lib/core/DisplayBase.d.ts +21 -0
- package/dist/lib/core/DuiContext.d.ts +53 -0
- package/dist/lib/core/DuiTokens.d.ts +115 -0
- package/dist/lib/core/DuiTypes.d.ts +29 -0
- package/dist/lib/core/EditorBase.d.ts +13 -0
- package/dist/lib/core/InputBase.d.ts +25 -0
- package/dist/lib/core/MenuBase.d.ts +23 -0
- package/dist/lib/core/NavBase.d.ts +26 -0
- package/dist/lib/core/OverlayBase.d.ts +20 -0
- package/dist/lib/core/SelectBase.d.ts +22 -0
- package/dist/lib/core/TabBase.d.ts +25 -0
- package/dist/lib/core/TableBase.d.ts +19 -0
- package/dist/lib/core/ToggleBase.d.ts +19 -0
- package/dist/lib/core/index.d.ts +25 -0
- package/dist/lib/index.d.ts +159 -0
- package/dist/lib/monaco-runtime.d.ts +29 -0
- package/dist/lib/theme/core.d.ts +8 -0
- package/dist/lib/theme/editor.d.ts +11 -0
- package/dist/lib/theme/utils.d.ts +6 -0
- package/dist/monaco-setup.d.ts +4 -0
- package/dist/monaco-setup.js +883 -0
- package/dist/monaco-setup.js.map +1 -0
- package/dist/style.css +1 -0
- package/dist/style.js +2 -0
- package/dist/style.js.map +1 -0
- package/dist/theme/core.js +191 -0
- package/dist/theme/core.js.map +1 -0
- package/dist/theme/editor.js +104 -0
- package/dist/theme/editor.js.map +1 -0
- package/dist/theme/utils.js +67 -0
- package/dist/theme/utils.js.map +1 -0
- package/package.json +81 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { DuiSize } from '../../core/DuiTypes';
|
|
2
|
+
export type DurationUnit = 'ms' | 's' | 'm' | 'hr';
|
|
3
|
+
export interface DurationInputViewProps {
|
|
4
|
+
/** Current value in milliseconds */
|
|
5
|
+
value: number;
|
|
6
|
+
/** Called with new value in milliseconds */
|
|
7
|
+
onChange: (ms: number) => void;
|
|
8
|
+
placeholder?: string;
|
|
9
|
+
accentColor?: string;
|
|
10
|
+
/** Falls back to DuiProvider size when omitted. */
|
|
11
|
+
size?: DuiSize;
|
|
12
|
+
width?: number;
|
|
13
|
+
className?: string;
|
|
14
|
+
}
|
|
15
|
+
export declare function DurationInputView({ value, onChange, placeholder, size, width, className, }: DurationInputViewProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
import { DuiSize } from '../../core/DuiTypes';
|
|
2
|
+
import { ContextMenuItem } from '../modal/ContextMenuView';
|
|
3
|
+
/**
|
|
4
|
+
* 'native' — Monaco's built-in context menu (default).
|
|
5
|
+
* 'dui' — suppress Monaco's menu, show DUI's ContextMenuView instead.
|
|
6
|
+
* 'none' — suppress the context menu entirely (e.g. a REPL input where
|
|
7
|
+
* right-click doesn't make sense).
|
|
8
|
+
*/
|
|
9
|
+
export type EditorContextMenuMode = 'native' | 'dui' | 'none';
|
|
10
|
+
export declare const EditorLineNumbers: {
|
|
11
|
+
readonly ON: "on";
|
|
12
|
+
readonly OFF: "off";
|
|
13
|
+
readonly RELATIVE: "relative";
|
|
14
|
+
readonly INTERVAL: "interval";
|
|
15
|
+
};
|
|
16
|
+
export type EditorLineNumbers = typeof EditorLineNumbers[keyof typeof EditorLineNumbers];
|
|
17
|
+
export declare const EditorWordWrap: {
|
|
18
|
+
readonly OFF: "off";
|
|
19
|
+
readonly ON: "on";
|
|
20
|
+
readonly WORD_WRAP_COLUMN: "wordWrapColumn";
|
|
21
|
+
readonly BOUNDED: "bounded";
|
|
22
|
+
};
|
|
23
|
+
export type EditorWordWrap = typeof EditorWordWrap[keyof typeof EditorWordWrap];
|
|
24
|
+
export declare const EditorCursorStyle: {
|
|
25
|
+
readonly LINE: "line";
|
|
26
|
+
readonly BLOCK: "block";
|
|
27
|
+
readonly UNDERLINE: "underline";
|
|
28
|
+
readonly LINE_THIN: "line-thin";
|
|
29
|
+
readonly BLOCK_OUTLINE: "block-outline";
|
|
30
|
+
readonly UNDERLINE_THIN: "underline-thin";
|
|
31
|
+
};
|
|
32
|
+
export type EditorCursorStyle = typeof EditorCursorStyle[keyof typeof EditorCursorStyle];
|
|
33
|
+
export declare const EditorCursorBlinking: {
|
|
34
|
+
readonly BLINK: "blink";
|
|
35
|
+
readonly SMOOTH: "smooth";
|
|
36
|
+
readonly PHASE: "phase";
|
|
37
|
+
readonly EXPAND: "expand";
|
|
38
|
+
readonly SOLID: "solid";
|
|
39
|
+
};
|
|
40
|
+
export type EditorCursorBlinking = typeof EditorCursorBlinking[keyof typeof EditorCursorBlinking];
|
|
41
|
+
export declare const EditorRenderWhitespace: {
|
|
42
|
+
readonly NONE: "none";
|
|
43
|
+
readonly BOUNDARY: "boundary";
|
|
44
|
+
readonly SELECTION: "selection";
|
|
45
|
+
readonly TRAILING: "trailing";
|
|
46
|
+
readonly ALL: "all";
|
|
47
|
+
};
|
|
48
|
+
export type EditorRenderWhitespace = typeof EditorRenderWhitespace[keyof typeof EditorRenderWhitespace];
|
|
49
|
+
export declare const EditorFoldingControls: {
|
|
50
|
+
readonly ALWAYS: "always";
|
|
51
|
+
readonly NEVER: "never";
|
|
52
|
+
readonly MOUSEOVER: "mouseover";
|
|
53
|
+
};
|
|
54
|
+
export type EditorFoldingControls = typeof EditorFoldingControls[keyof typeof EditorFoldingControls];
|
|
55
|
+
export declare const EditorMatchBrackets: {
|
|
56
|
+
readonly NEVER: "never";
|
|
57
|
+
readonly NEAR: "near";
|
|
58
|
+
readonly ALWAYS: "always";
|
|
59
|
+
};
|
|
60
|
+
export type EditorMatchBrackets = typeof EditorMatchBrackets[keyof typeof EditorMatchBrackets];
|
|
61
|
+
export declare const EditorAutoIndent: {
|
|
62
|
+
readonly NONE: "none";
|
|
63
|
+
readonly KEEP: "keep";
|
|
64
|
+
readonly BRACKETS: "brackets";
|
|
65
|
+
readonly ADVANCED: "advanced";
|
|
66
|
+
readonly FULL: "full";
|
|
67
|
+
};
|
|
68
|
+
export type EditorAutoIndent = typeof EditorAutoIndent[keyof typeof EditorAutoIndent];
|
|
69
|
+
export declare const EditorAcceptSuggestion: {
|
|
70
|
+
readonly ON: "on";
|
|
71
|
+
readonly OFF: "off";
|
|
72
|
+
readonly SMART: "smart";
|
|
73
|
+
};
|
|
74
|
+
export type EditorAcceptSuggestion = typeof EditorAcceptSuggestion[keyof typeof EditorAcceptSuggestion];
|
|
75
|
+
/**
|
|
76
|
+
* Consumer-facing Monaco editor options. Use the DUI enum constants for
|
|
77
|
+
* value-based fields (e.g. EditorCursorStyle.BLOCK, EditorLineNumbers.RELATIVE).
|
|
78
|
+
* Ignored entirely while running in fallback mode (see EditorView.fallback.tsx).
|
|
79
|
+
*
|
|
80
|
+
* DUI always retains control of: contextmenu, automaticLayout, glyphMargin,
|
|
81
|
+
* fixedOverflowWidgets (structural internals — not overridable).
|
|
82
|
+
*/
|
|
83
|
+
export interface EditorOptions {
|
|
84
|
+
lineNumbers?: EditorLineNumbers;
|
|
85
|
+
/** Width reserved for line-number decorations, in px. Set 0 to remove the gutter entirely. */
|
|
86
|
+
lineDecorationsWidth?: number;
|
|
87
|
+
/** Minimum character width reserved for line numbers. */
|
|
88
|
+
lineNumbersMinChars?: number;
|
|
89
|
+
lineHeight?: number;
|
|
90
|
+
letterSpacing?: number;
|
|
91
|
+
rulers?: number[];
|
|
92
|
+
renderWhitespace?: EditorRenderWhitespace;
|
|
93
|
+
/**
|
|
94
|
+
* Current-line highlight style. Defaults to 'line' when glyphMargin is
|
|
95
|
+
* active (debugSupported with a breakpoint handler) and 'none' otherwise —
|
|
96
|
+
* pass explicitly to override either way.
|
|
97
|
+
*/
|
|
98
|
+
renderLineHighlight?: 'none' | 'gutter' | 'line' | 'all';
|
|
99
|
+
/** Override the monospace font stack (defaults to Menlo/Monaco/Courier New). */
|
|
100
|
+
fontFamily?: string;
|
|
101
|
+
minimap?: boolean;
|
|
102
|
+
scrollBeyondLastLine?: boolean;
|
|
103
|
+
smoothScrolling?: boolean;
|
|
104
|
+
mouseWheelZoom?: boolean;
|
|
105
|
+
/** Scrollbar visibility + thickness. Defaults to 6px, always visible. */
|
|
106
|
+
scrollbar?: {
|
|
107
|
+
vertical?: 'auto' | 'visible' | 'hidden';
|
|
108
|
+
horizontal?: 'auto' | 'visible' | 'hidden';
|
|
109
|
+
verticalScrollbarSize?: number;
|
|
110
|
+
horizontalScrollbarSize?: number;
|
|
111
|
+
};
|
|
112
|
+
cursorStyle?: EditorCursorStyle;
|
|
113
|
+
cursorBlinking?: EditorCursorBlinking;
|
|
114
|
+
tabSize?: number;
|
|
115
|
+
wordWrap?: EditorWordWrap;
|
|
116
|
+
formatOnPaste?: boolean;
|
|
117
|
+
formatOnType?: boolean;
|
|
118
|
+
autoIndent?: EditorAutoIndent;
|
|
119
|
+
folding?: boolean;
|
|
120
|
+
showFoldingControls?: EditorFoldingControls;
|
|
121
|
+
matchBrackets?: EditorMatchBrackets;
|
|
122
|
+
bracketPairColorization?: boolean;
|
|
123
|
+
quickSuggestions?: boolean;
|
|
124
|
+
suggestOnTriggerCharacters?: boolean;
|
|
125
|
+
acceptSuggestionOnEnter?: EditorAcceptSuggestion;
|
|
126
|
+
parameterHints?: boolean;
|
|
127
|
+
hover?: boolean;
|
|
128
|
+
codeLens?: boolean;
|
|
129
|
+
inlayHints?: boolean;
|
|
130
|
+
/** Which suggestion-list sections to show. Merged over DUI's defaults (all true). */
|
|
131
|
+
suggest?: {
|
|
132
|
+
showKeywords?: boolean;
|
|
133
|
+
showSnippets?: boolean;
|
|
134
|
+
showValues?: boolean;
|
|
135
|
+
showProperties?: boolean;
|
|
136
|
+
showIcons?: boolean;
|
|
137
|
+
};
|
|
138
|
+
colorDecorators?: boolean;
|
|
139
|
+
linkedEditing?: boolean;
|
|
140
|
+
copyWithSyntaxHighlighting?: boolean;
|
|
141
|
+
padding?: {
|
|
142
|
+
top?: number;
|
|
143
|
+
bottom?: number;
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
export type EditorLanguage = 'javascript' | 'typescript' | 'json' | 'xml' | 'html' | 'css' | 'graphql' | 'python' | 'yaml' | 'sql' | 'plaintext' | 'markdown' | 'java';
|
|
147
|
+
export interface EditorViewProps {
|
|
148
|
+
value: string;
|
|
149
|
+
onChange?: (value: string) => void;
|
|
150
|
+
language?: EditorLanguage;
|
|
151
|
+
height?: string | number;
|
|
152
|
+
minHeight?: number;
|
|
153
|
+
readOnly?: boolean;
|
|
154
|
+
/** Placeholder shown when value is empty */
|
|
155
|
+
placeholder?: string;
|
|
156
|
+
wordWrap?: boolean;
|
|
157
|
+
/**
|
|
158
|
+
* DUI size token — sets editor font size via EDITOR_FONT_SIZE scale (md=12, lg=13, xl=14…).
|
|
159
|
+
* Ignored when `fontSize` is provided explicitly.
|
|
160
|
+
*/
|
|
161
|
+
size?: DuiSize;
|
|
162
|
+
/** Explicit font size in px — takes precedence over `size`. Defaults to 12 (md). */
|
|
163
|
+
fontSize?: number;
|
|
164
|
+
className?: string;
|
|
165
|
+
/** Adds a rounded border matching CodeEditor appearance */
|
|
166
|
+
bordered?: boolean;
|
|
167
|
+
/**
|
|
168
|
+
* Opt-in to full debug feature set: breakpoint gutter, variable hover,
|
|
169
|
+
* navigate-to-line from RunAndDebugPanel, dk/console completions.
|
|
170
|
+
* When false (default) none of these hooks or store subscriptions are active.
|
|
171
|
+
* No effect in fallback mode — breakpoints are a Monaco glyph-margin concept.
|
|
172
|
+
*/
|
|
173
|
+
debugSupported?: boolean;
|
|
174
|
+
breakpoints?: number[];
|
|
175
|
+
disabledBreakpoints?: number[];
|
|
176
|
+
conditionalBreakpointLines?: number[];
|
|
177
|
+
/** Currently paused line — shows yellow highlight */
|
|
178
|
+
pausedLine?: number | null;
|
|
179
|
+
onToggleBreakpoint?: (line: number) => void;
|
|
180
|
+
onGlyphContextMenu?: (line: number, pos: {
|
|
181
|
+
x: number;
|
|
182
|
+
y: number;
|
|
183
|
+
}) => void;
|
|
184
|
+
/** Receives editor + monaco instances after mount (e.g. for AI autocomplete). Not called in fallback mode. */
|
|
185
|
+
onEditorMount?: (editor: any, monaco: any) => void;
|
|
186
|
+
/**
|
|
187
|
+
* Accent color for the Monaco scrollbar thumb. Accepts any CSS color value
|
|
188
|
+
* including CSS variables (e.g. `var(--color-protocol-soap)`). When omitted
|
|
189
|
+
* the global `--color-accent` is used automatically via CSS fallback.
|
|
190
|
+
*/
|
|
191
|
+
accentColor?: string;
|
|
192
|
+
/**
|
|
193
|
+
* 'native' — use Monaco's built-in context menu (default).
|
|
194
|
+
* 'dui' — suppress Monaco's menu and show DUI ContextMenuView instead.
|
|
195
|
+
* Requires contextMenuItems to be provided.
|
|
196
|
+
*/
|
|
197
|
+
contextMenuMode?: EditorContextMenuMode;
|
|
198
|
+
/**
|
|
199
|
+
* Items for the DUI ContextMenuView. Only used when contextMenuMode='dui'.
|
|
200
|
+
* Supports icons, colors, danger styling, separators, and infinite submenus.
|
|
201
|
+
*/
|
|
202
|
+
contextMenuItems?: ContextMenuItem[];
|
|
203
|
+
/**
|
|
204
|
+
* Fine-grained Monaco editor options. Consumer values are merged over DUI
|
|
205
|
+
* defaults. Use the exported enum constants for value fields:
|
|
206
|
+
* cursorStyle={EditorCursorStyle.BLOCK}
|
|
207
|
+
* lineNumbers={EditorLineNumbers.RELATIVE}
|
|
208
|
+
* DUI always retains: contextmenu, automaticLayout, glyphMargin, fixedOverflowWidgets.
|
|
209
|
+
*/
|
|
210
|
+
editorOptions?: EditorOptions;
|
|
211
|
+
}
|
|
212
|
+
export type { ContextMenuItem as EditorContextMenuItem } from '../modal/ContextMenuView';
|
|
213
|
+
/**
|
|
214
|
+
* DUI's code editor. Renders the real Monaco-backed editor once the consumer
|
|
215
|
+
* has installed '@monaco-editor/react' + 'monaco-editor' and imported
|
|
216
|
+
* '@salilvnair/dui/monaco-setup' once at app bootstrap (self-hosted — no CDN;
|
|
217
|
+
* that subpath registers the Monaco implementation into monaco-runtime.ts).
|
|
218
|
+
* Until then, renders a lightweight plain-text fallback so '@salilvnair/dui'
|
|
219
|
+
* never requires Monaco as a hard dependency — this file has no reference to
|
|
220
|
+
* '@monaco-editor/react' or 'monaco-editor' anywhere in its module graph.
|
|
221
|
+
*/
|
|
222
|
+
export declare function EditorView(props: EditorViewProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { EditorViewProps } from './EditorView';
|
|
2
|
+
/**
|
|
3
|
+
* Plain-textarea stand-in for EditorView, used whenever Monaco isn't
|
|
4
|
+
* available (not installed, or '@salilvnair/dui/monaco-setup' was never
|
|
5
|
+
* imported). Deliberately minimal — no IntelliSense, no breakpoints, no
|
|
6
|
+
* folding, no format-on-save. Those are Monaco-specific concepts; anything
|
|
7
|
+
* that needs them should treat the fallback as a degraded, read/write-only
|
|
8
|
+
* text box rather than try to emulate Monaco's feature set.
|
|
9
|
+
*/
|
|
10
|
+
export declare function EditorViewFallback({ value, onChange, language, height, minHeight, readOnly, placeholder, wordWrap, size, fontSize, className, bordered, accentColor, }: EditorViewProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ContextMenuItem } from '../modal/ContextMenuView';
|
|
2
|
+
/**
|
|
3
|
+
* Shared render shell for both the Monaco-backed and fallback editor
|
|
4
|
+
* implementations — pure DUI chrome, no editor-engine dependency either way.
|
|
5
|
+
*/
|
|
6
|
+
export declare function EditorShell({ bordered, containerHeight, children, contextMenuMode, contextMenuItems, accentColor, }: {
|
|
7
|
+
bordered: boolean;
|
|
8
|
+
containerHeight: string;
|
|
9
|
+
children: React.ReactNode;
|
|
10
|
+
contextMenuMode?: 'native' | 'dui' | 'none';
|
|
11
|
+
contextMenuItems?: ContextMenuItem[];
|
|
12
|
+
accentColor?: string;
|
|
13
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export interface FormDataRow {
|
|
2
|
+
id: string;
|
|
3
|
+
key: string;
|
|
4
|
+
value: string;
|
|
5
|
+
type: 'text' | 'file';
|
|
6
|
+
enabled: boolean;
|
|
7
|
+
fileNames?: string[];
|
|
8
|
+
fileData?: string[];
|
|
9
|
+
fileMimeTypes?: string[];
|
|
10
|
+
}
|
|
11
|
+
export interface FormDataTableViewProps {
|
|
12
|
+
rows: FormDataRow[];
|
|
13
|
+
onChange: (rows: FormDataRow[]) => void;
|
|
14
|
+
/** Called when a file row's picker resolves. Pass undefined to handle file reads externally. */
|
|
15
|
+
onFileSelect?: (rowId: string, files: File[]) => void;
|
|
16
|
+
accentColor?: string;
|
|
17
|
+
label?: string;
|
|
18
|
+
hideToolbar?: boolean;
|
|
19
|
+
className?: string;
|
|
20
|
+
style?: React.CSSProperties;
|
|
21
|
+
}
|
|
22
|
+
export declare function FormDataTableView({ rows, onChange, onFileSelect, accentColor, label, hideToolbar, className, style, }: FormDataTableViewProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export interface HiddenKeyValueItemViewProps {
|
|
2
|
+
keyValue: string;
|
|
3
|
+
value: string;
|
|
4
|
+
/** Small colored pill badge on the key — e.g. "auth", "cookie" */
|
|
5
|
+
badge?: string;
|
|
6
|
+
badgeColor?: string;
|
|
7
|
+
/** Override the left lock icon */
|
|
8
|
+
icon?: React.ReactNode;
|
|
9
|
+
/** Mask the value with dots; shows eye toggle to reveal */
|
|
10
|
+
masked?: boolean;
|
|
11
|
+
onDelete?: () => void;
|
|
12
|
+
deleteTitle?: string;
|
|
13
|
+
/** Show description column placeholder (for grid alignment with KeyValueItemView) */
|
|
14
|
+
showDescription?: boolean;
|
|
15
|
+
className?: string;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Read-only hidden/system-managed key-value row.
|
|
19
|
+
* Ditto the lock-icon + dashed-border pattern from ComputedHeaderList —
|
|
20
|
+
* "Hidden" is Postman's terminology; Daakia's visual style is kept.
|
|
21
|
+
*/
|
|
22
|
+
export declare function HiddenKeyValueItemView({ keyValue, value, badge, badgeColor, icon, masked, onDelete, deleteTitle, showDescription, className, }: HiddenKeyValueItemViewProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { DuiSize } from '../../core/DuiTypes';
|
|
2
|
+
export interface MockServerSuggestion {
|
|
3
|
+
url: string;
|
|
4
|
+
name: string;
|
|
5
|
+
}
|
|
6
|
+
export interface HighlightedInputViewProps {
|
|
7
|
+
value: string;
|
|
8
|
+
onChange: (value: string) => void;
|
|
9
|
+
onKeyDown?: (e: React.KeyboardEvent) => void;
|
|
10
|
+
onBlur?: () => void;
|
|
11
|
+
placeholder?: string;
|
|
12
|
+
suggestions?: string[];
|
|
13
|
+
/** Running mock server URLs — shown at the top with a server icon */
|
|
14
|
+
mockServers?: MockServerSuggestion[];
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
accentColor?: string;
|
|
17
|
+
/** Falls back to DuiProvider size when omitted. */
|
|
18
|
+
size?: DuiSize;
|
|
19
|
+
/** Raw height override in px — prefer `size` for token-aligned sizing. */
|
|
20
|
+
height?: number;
|
|
21
|
+
/** Border radius of the input in px (default 0 — matches URL bar; set 6 for standalone rounded usage) */
|
|
22
|
+
borderRadius?: number;
|
|
23
|
+
style?: React.CSSProperties;
|
|
24
|
+
className?: string;
|
|
25
|
+
}
|
|
26
|
+
export declare function HighlightedInputView({ value, onChange, onKeyDown, onBlur, placeholder, suggestions, mockServers, disabled, accentColor, size, height, borderRadius, style, className, }: HighlightedInputViewProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { DuiSize } from '../../core/DuiTypes';
|
|
2
|
+
export interface KeyValueTableRowViewProps {
|
|
3
|
+
rowKey: string;
|
|
4
|
+
value: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
/** Enabled state. Pass undefined to hide the toggle (use with readOnly for pinned rows). */
|
|
7
|
+
enabled?: boolean;
|
|
8
|
+
/** Read-only pinned mode: lock icon, dashed border, no editing */
|
|
9
|
+
readOnly?: boolean;
|
|
10
|
+
/** Explicitly mask the value with an eye toggle */
|
|
11
|
+
masked?: boolean;
|
|
12
|
+
/** Auto-mask when rowKey matches SENSITIVE_HEADERS */
|
|
13
|
+
maskSensitive?: boolean;
|
|
14
|
+
/** Show trash icon on hover */
|
|
15
|
+
deletable?: boolean;
|
|
16
|
+
showDescription?: boolean;
|
|
17
|
+
placeholder?: {
|
|
18
|
+
key?: string;
|
|
19
|
+
value?: string;
|
|
20
|
+
};
|
|
21
|
+
/** HTTP header key/value autocomplete — editable mode only */
|
|
22
|
+
autocompleteKeys?: boolean;
|
|
23
|
+
size?: DuiSize;
|
|
24
|
+
accentColor?: string;
|
|
25
|
+
onKeyChange?: (val: string) => void;
|
|
26
|
+
onValueChange?: (val: string) => void;
|
|
27
|
+
onDescriptionChange?: (val: string) => void;
|
|
28
|
+
onEnabledChange?: (enabled: boolean) => void;
|
|
29
|
+
onRemove?: () => void;
|
|
30
|
+
}
|
|
31
|
+
export declare function KeyValueTableRowView({ rowKey, value, description, enabled, readOnly, masked, maskSensitive, deletable, showDescription, placeholder, autocompleteKeys, size, onKeyChange, onValueChange, onDescriptionChange, onEnabledChange, onRemove, }: KeyValueTableRowViewProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { DuiSize } from '../../core/DuiTypes';
|
|
2
|
+
export interface KeyValueTableRow {
|
|
3
|
+
id: string;
|
|
4
|
+
key: string;
|
|
5
|
+
value: string;
|
|
6
|
+
description?: string;
|
|
7
|
+
enabled: boolean;
|
|
8
|
+
type?: 'text' | 'file';
|
|
9
|
+
files?: string[];
|
|
10
|
+
filePaths?: string[];
|
|
11
|
+
fileData?: string[];
|
|
12
|
+
fileMimeTypes?: string[];
|
|
13
|
+
fileExists?: boolean[];
|
|
14
|
+
}
|
|
15
|
+
/** A computed/auto-generated row shown above editable rows — read-only, lock icon on left */
|
|
16
|
+
export interface PinnedKeyValueRow {
|
|
17
|
+
id: string;
|
|
18
|
+
key: string;
|
|
19
|
+
value: string;
|
|
20
|
+
description?: string;
|
|
21
|
+
/** If true, a trash icon appears on hover and the row can be removed via onPinnedRemove */
|
|
22
|
+
deletable?: boolean;
|
|
23
|
+
/** If true (or auto-detected via SENSITIVE_HEADERS), value is masked with eye-toggle */
|
|
24
|
+
masked?: boolean;
|
|
25
|
+
}
|
|
26
|
+
export interface KeyValueTableViewProps {
|
|
27
|
+
rows: KeyValueTableRow[];
|
|
28
|
+
onChange: (rows: KeyValueTableRow[]) => void;
|
|
29
|
+
showDescription?: boolean;
|
|
30
|
+
placeholder?: {
|
|
31
|
+
key?: string;
|
|
32
|
+
value?: string;
|
|
33
|
+
};
|
|
34
|
+
className?: string;
|
|
35
|
+
/** Show HTTP header key autocomplete + value suggestions */
|
|
36
|
+
autocompleteKeys?: boolean;
|
|
37
|
+
/** Mask values for known sensitive keys (Authorization, token, etc.) */
|
|
38
|
+
maskSensitive?: boolean;
|
|
39
|
+
/** Hide the toolbar row entirely */
|
|
40
|
+
hideToolbar?: boolean;
|
|
41
|
+
/** Left-side label text */
|
|
42
|
+
label?: string;
|
|
43
|
+
/** Accent color for InsertRowDivider and toolbar highlights */
|
|
44
|
+
accentColor?: string;
|
|
45
|
+
/** Extra nodes rendered in toolbar right side (before trash icon) */
|
|
46
|
+
toolbarExtra?: React.ReactNode;
|
|
47
|
+
/** DUI size token — controls input height and font size. Falls back to DuiProvider or 'md'. */
|
|
48
|
+
size?: DuiSize;
|
|
49
|
+
/** Wrap in a rounded border panel */
|
|
50
|
+
bordered?: boolean;
|
|
51
|
+
/**
|
|
52
|
+
* Computed/auto-generated rows — shown as the first N rows with lock icon + dotted border.
|
|
53
|
+
* Hidden by default; revealed via the eye icon next to the label.
|
|
54
|
+
*/
|
|
55
|
+
pinnedTopRows?: PinnedKeyValueRow[];
|
|
56
|
+
/** Called when a deletable pinned row is removed */
|
|
57
|
+
onPinnedRemove?: (id: string) => void;
|
|
58
|
+
}
|
|
59
|
+
export declare function KeyValueTableView({ rows, onChange, showDescription, placeholder, className, autocompleteKeys, maskSensitive, hideToolbar, label, accentColor, toolbarExtra, size, bordered, pinnedTopRows, onPinnedRemove, }: KeyValueTableViewProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { DuiSize } from '../../core/DuiTypes';
|
|
2
|
+
/** @deprecated Use `DuiSize` ('sm' | 'md' | 'lg' | 'xl') directly. */
|
|
3
|
+
export type MergedInputSize = DuiSize;
|
|
4
|
+
export interface MergedSelectOption {
|
|
5
|
+
value: string;
|
|
6
|
+
label: string;
|
|
7
|
+
color?: string;
|
|
8
|
+
}
|
|
9
|
+
export type MergedInputSegment = {
|
|
10
|
+
type: 'select';
|
|
11
|
+
value: string;
|
|
12
|
+
options: MergedSelectOption[];
|
|
13
|
+
onChange: (value: string) => void;
|
|
14
|
+
width?: number;
|
|
15
|
+
} | {
|
|
16
|
+
type: 'text';
|
|
17
|
+
value: string;
|
|
18
|
+
onChange: (value: string) => void;
|
|
19
|
+
placeholder?: string;
|
|
20
|
+
flex?: number;
|
|
21
|
+
} | {
|
|
22
|
+
type: 'button';
|
|
23
|
+
label: string;
|
|
24
|
+
onClick: () => void;
|
|
25
|
+
icon?: React.ReactNode;
|
|
26
|
+
accentColor?: string;
|
|
27
|
+
} | {
|
|
28
|
+
type: 'divider';
|
|
29
|
+
} | {
|
|
30
|
+
type: 'custom';
|
|
31
|
+
content: React.ReactNode;
|
|
32
|
+
width?: number;
|
|
33
|
+
};
|
|
34
|
+
export interface MergedInputViewProps {
|
|
35
|
+
segments: MergedInputSegment[];
|
|
36
|
+
/** Falls back to DuiProvider size when omitted. */
|
|
37
|
+
size?: DuiSize;
|
|
38
|
+
accentColor?: string;
|
|
39
|
+
disabled?: boolean;
|
|
40
|
+
className?: string;
|
|
41
|
+
}
|
|
42
|
+
export declare function MergeDivider(): import("react").JSX.Element;
|
|
43
|
+
export declare function MergedInputView({ segments, size, accentColor, disabled, className, }: MergedInputViewProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { TextareaHTMLAttributes } from 'react';
|
|
2
|
+
import { DuiSize, DuiRadius, DuiWidth } from '../../core/DuiTypes';
|
|
3
|
+
export interface MultilineInputViewProps extends TextareaHTMLAttributes<HTMLTextAreaElement> {
|
|
4
|
+
size?: 'default' | DuiSize;
|
|
5
|
+
rounded?: boolean;
|
|
6
|
+
accentColor?: string;
|
|
7
|
+
error?: boolean;
|
|
8
|
+
/** Number of visible rows (default: 4) */
|
|
9
|
+
rows?: number;
|
|
10
|
+
/** Allow manual resize: 'none' | 'vertical' | 'both' (default: 'none') */
|
|
11
|
+
resize?: 'none' | 'vertical' | 'both';
|
|
12
|
+
width?: DuiWidth;
|
|
13
|
+
borderRadius?: DuiRadius | number;
|
|
14
|
+
}
|
|
15
|
+
export declare const MultilineInputView: import('react').ForwardRefExoticComponent<MultilineInputViewProps & import('react').RefAttributes<HTMLTextAreaElement>>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ReactNode, InputHTMLAttributes, CSSProperties } from 'react';
|
|
2
|
+
import { DuiSize } from '../../core/DuiTypes';
|
|
3
|
+
export interface SearchInputViewProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'onChange' | 'prefix' | 'size'> {
|
|
4
|
+
value: string;
|
|
5
|
+
onChange: (value: string) => void;
|
|
6
|
+
/** Node shown left inside the bar (e.g. SearchIcon) */
|
|
7
|
+
prefix?: ReactNode;
|
|
8
|
+
/** Node shown right inside the bar (e.g. clear button) */
|
|
9
|
+
suffix?: ReactNode;
|
|
10
|
+
/** Falls back to DuiProvider size when omitted. */
|
|
11
|
+
size?: DuiSize;
|
|
12
|
+
/** Raw height override in px — prefer `size` for token-aligned sizing. */
|
|
13
|
+
height?: number;
|
|
14
|
+
style?: CSSProperties;
|
|
15
|
+
className?: string;
|
|
16
|
+
}
|
|
17
|
+
export declare function SearchInputView({ value, onChange, prefix, suffix, placeholder, size, height, style, className, ...rest }: SearchInputViewProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { DuiSize } from '../../core/DuiTypes';
|
|
3
|
+
export interface SegmentedControlOption {
|
|
4
|
+
value: string;
|
|
5
|
+
label: string;
|
|
6
|
+
icon?: ReactNode;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export interface SegmentedControlViewProps {
|
|
10
|
+
options: SegmentedControlOption[];
|
|
11
|
+
value: string;
|
|
12
|
+
onChange: (value: string) => void;
|
|
13
|
+
size?: DuiSize;
|
|
14
|
+
/** Accent color for the active segment indicator and text */
|
|
15
|
+
accentColor?: string;
|
|
16
|
+
/** Stretch to fill container width */
|
|
17
|
+
fullWidth?: boolean;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Segmented control with a sliding animated indicator.
|
|
21
|
+
* Active segment text color shifts to accentColor; inactive stays text-secondary.
|
|
22
|
+
*/
|
|
23
|
+
export declare function SegmentedControlView({ options, value, onChange, size, accentColor, fullWidth, }: SegmentedControlViewProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { DuiSize, DuiRadius } from '../../core/DuiTypes';
|
|
2
|
+
export interface SelectOption {
|
|
3
|
+
value: string;
|
|
4
|
+
label: string;
|
|
5
|
+
icon?: React.ReactNode;
|
|
6
|
+
color?: string;
|
|
7
|
+
isHeader?: boolean;
|
|
8
|
+
/** Colored pill chip rendered before the label — { label: 'TS', color: 'var(--color-primary)' } */
|
|
9
|
+
badge?: {
|
|
10
|
+
label: string;
|
|
11
|
+
color: string;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
/** Backward-compatible size alias — accepts all DuiSize values plus legacy "default" (maps to "md"). */
|
|
15
|
+
export type SelectInputSize = DuiSize | 'default';
|
|
16
|
+
export interface SelectInputViewProps {
|
|
17
|
+
options: SelectOption[];
|
|
18
|
+
value: string;
|
|
19
|
+
onChange: (value: string) => void;
|
|
20
|
+
size?: SelectInputSize;
|
|
21
|
+
/** true = size-derived radius (default), false = 0px */
|
|
22
|
+
rounded?: boolean;
|
|
23
|
+
placeholder?: string;
|
|
24
|
+
accentColor?: string;
|
|
25
|
+
disabled?: boolean;
|
|
26
|
+
className?: string;
|
|
27
|
+
style?: React.CSSProperties;
|
|
28
|
+
width?: string | number;
|
|
29
|
+
borderRadius?: DuiRadius | number;
|
|
30
|
+
}
|
|
31
|
+
export declare function SelectInputView({ options, value, onChange, size, rounded, placeholder, accentColor, disabled, className, style, width, borderRadius, }: SelectInputViewProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { DuiSize, DuiRadius, DuiWidth, DuiFontStyle } from '../../core/DuiTypes';
|
|
2
|
+
export interface SelectTextOption {
|
|
3
|
+
value: string;
|
|
4
|
+
label: string;
|
|
5
|
+
/** Accent color for this option — e.g. HTTP methods */
|
|
6
|
+
color?: string;
|
|
7
|
+
}
|
|
8
|
+
/** Running mock server entry — shown at top of suggestions with server icon */
|
|
9
|
+
export interface MockServerSuggestion {
|
|
10
|
+
url: string;
|
|
11
|
+
name: string;
|
|
12
|
+
}
|
|
13
|
+
export interface SelectTextInputViewProps {
|
|
14
|
+
selectValue: string;
|
|
15
|
+
selectOptions: SelectTextOption[];
|
|
16
|
+
onSelectChange: (value: string) => void;
|
|
17
|
+
inputValue: string;
|
|
18
|
+
onInputChange: (value: string) => void;
|
|
19
|
+
placeholder?: string;
|
|
20
|
+
/** Falls back to DuiProvider size when omitted. */
|
|
21
|
+
size?: DuiSize;
|
|
22
|
+
disabled?: boolean;
|
|
23
|
+
/** Accent border color on focus */
|
|
24
|
+
accentColor?: string;
|
|
25
|
+
/** Override the select section width in px */
|
|
26
|
+
selectWidth?: number;
|
|
27
|
+
/** URL / text autocomplete suggestions */
|
|
28
|
+
suggestions?: string[];
|
|
29
|
+
/** Running mock server URLs — shown at the top with a server icon */
|
|
30
|
+
mockServers?: MockServerSuggestion[];
|
|
31
|
+
/** Called when user picks a mock server entry (in addition to onInputChange) */
|
|
32
|
+
onMockServerSelect?: (url: string) => void;
|
|
33
|
+
onKeyDown?: (e: React.KeyboardEvent<HTMLInputElement>) => void;
|
|
34
|
+
/** Minimum width (px) for the suggestions dropdown — useful when the input is narrow */
|
|
35
|
+
suggestionMinWidth?: number;
|
|
36
|
+
/** z-index for the suggestions dropdown portal (default: 9998) */
|
|
37
|
+
suggestionZIndex?: number;
|
|
38
|
+
width?: DuiWidth;
|
|
39
|
+
borderRadius?: DuiRadius | number;
|
|
40
|
+
color?: string;
|
|
41
|
+
fontStyle?: DuiFontStyle;
|
|
42
|
+
className?: string;
|
|
43
|
+
}
|
|
44
|
+
export declare function SelectTextInputView({ selectValue, selectOptions, onSelectChange, inputValue, onInputChange, placeholder, size, disabled, accentColor, selectWidth, suggestions, mockServers, onMockServerSelect, onKeyDown, suggestionMinWidth, suggestionZIndex, width, borderRadius, color, fontStyle, className, }: SelectTextInputViewProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { DuiSize } from '../../core/DuiTypes';
|
|
2
|
+
export interface SliderViewProps {
|
|
3
|
+
value: number;
|
|
4
|
+
onChange: (value: number) => void;
|
|
5
|
+
min?: number;
|
|
6
|
+
max?: number;
|
|
7
|
+
step?: number;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
size?: DuiSize;
|
|
10
|
+
accentColor?: string;
|
|
11
|
+
showValue?: boolean;
|
|
12
|
+
width?: number | string;
|
|
13
|
+
className?: string;
|
|
14
|
+
}
|
|
15
|
+
export declare function SliderView({ value, onChange, min, max, step, disabled, accentColor, showValue, width, className, }: SliderViewProps): import("react").JSX.Element;
|