@mcp-elements/react 0.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/LICENSE +21 -0
- package/dist/index.d.ts +592 -0
- package/dist/index.js +1793 -0
- package/dist/index.js.map +1 -0
- package/package.json +38 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Mayur Rawte
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,592 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import react__default from 'react';
|
|
3
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
|
+
import * as _mcp_elements_core from '@mcp-elements/core';
|
|
5
|
+
import { DialogConfig, TabItem, TabsConfig, AccordionItemConfig, AccordionConfig, SelectOption, SelectConfig, TooltipConfig, PopoverConfig, Toast, DrawerConfig, DropdownMenuItem, DropdownMenuConfig, ToolStateApi, JsonSchema, ScopeDescriptor, AppMessageEnvelope, ToolStateSnapshot, OAuthFlowSnapshot, OAuthFlowApi, FieldDescriptor } from '@mcp-elements/core';
|
|
6
|
+
|
|
7
|
+
interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
8
|
+
variant?: 'primary' | 'secondary' | 'outline' | 'ghost' | 'destructive' | 'link';
|
|
9
|
+
size?: 'sm' | 'md' | 'lg' | 'icon';
|
|
10
|
+
}
|
|
11
|
+
declare const Button: react.ForwardRefExoticComponent<ButtonProps & react.RefAttributes<HTMLButtonElement>>;
|
|
12
|
+
|
|
13
|
+
interface BadgeProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
14
|
+
variant?: 'default' | 'secondary' | 'outline' | 'destructive';
|
|
15
|
+
}
|
|
16
|
+
declare function Badge({ variant, className, ...props }: BadgeProps): react_jsx_runtime.JSX.Element;
|
|
17
|
+
|
|
18
|
+
declare const Card: react.ForwardRefExoticComponent<react.HTMLAttributes<HTMLDivElement> & react.RefAttributes<HTMLDivElement>>;
|
|
19
|
+
declare const CardHeader: react.ForwardRefExoticComponent<react.HTMLAttributes<HTMLDivElement> & react.RefAttributes<HTMLDivElement>>;
|
|
20
|
+
declare const CardTitle: react.ForwardRefExoticComponent<react.HTMLAttributes<HTMLHeadingElement> & react.RefAttributes<HTMLHeadingElement>>;
|
|
21
|
+
declare const CardDescription: react.ForwardRefExoticComponent<react.HTMLAttributes<HTMLParagraphElement> & react.RefAttributes<HTMLParagraphElement>>;
|
|
22
|
+
declare const CardContent: react.ForwardRefExoticComponent<react.HTMLAttributes<HTMLDivElement> & react.RefAttributes<HTMLDivElement>>;
|
|
23
|
+
declare const CardFooter: react.ForwardRefExoticComponent<react.HTMLAttributes<HTMLDivElement> & react.RefAttributes<HTMLDivElement>>;
|
|
24
|
+
|
|
25
|
+
interface InputProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
26
|
+
}
|
|
27
|
+
declare const Input: react.ForwardRefExoticComponent<InputProps & react.RefAttributes<HTMLInputElement>>;
|
|
28
|
+
|
|
29
|
+
interface TextareaProps extends React.TextareaHTMLAttributes<HTMLTextAreaElement> {
|
|
30
|
+
}
|
|
31
|
+
declare const Textarea: react.ForwardRefExoticComponent<TextareaProps & react.RefAttributes<HTMLTextAreaElement>>;
|
|
32
|
+
|
|
33
|
+
interface AvatarProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
34
|
+
src?: string;
|
|
35
|
+
alt?: string;
|
|
36
|
+
fallback?: string;
|
|
37
|
+
}
|
|
38
|
+
declare const Avatar: react.ForwardRefExoticComponent<AvatarProps & react.RefAttributes<HTMLDivElement>>;
|
|
39
|
+
|
|
40
|
+
interface SeparatorProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
41
|
+
orientation?: 'horizontal' | 'vertical';
|
|
42
|
+
}
|
|
43
|
+
declare const Separator: react.ForwardRefExoticComponent<SeparatorProps & react.RefAttributes<HTMLDivElement>>;
|
|
44
|
+
|
|
45
|
+
interface SkeletonProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
46
|
+
}
|
|
47
|
+
declare function Skeleton({ className, ...props }: SkeletonProps): react_jsx_runtime.JSX.Element;
|
|
48
|
+
|
|
49
|
+
declare function useDialog(config?: Omit<DialogConfig, 'onOpenChange'>): {
|
|
50
|
+
id: string;
|
|
51
|
+
getTriggerProps: (isOpen: boolean) => {
|
|
52
|
+
"aria-haspopup": "dialog";
|
|
53
|
+
"aria-expanded": boolean;
|
|
54
|
+
onClick: () => void | undefined;
|
|
55
|
+
};
|
|
56
|
+
getContentProps: (isOpen: boolean) => {
|
|
57
|
+
role: "dialog";
|
|
58
|
+
"aria-modal": boolean;
|
|
59
|
+
"aria-labelledby": string;
|
|
60
|
+
"aria-describedby": string;
|
|
61
|
+
hidden: boolean | undefined;
|
|
62
|
+
onKeyDown: (e: KeyboardEvent) => void;
|
|
63
|
+
};
|
|
64
|
+
getOverlayProps: () => {
|
|
65
|
+
"aria-hidden": true;
|
|
66
|
+
onClick: () => void | undefined;
|
|
67
|
+
};
|
|
68
|
+
getCloseProps: () => {
|
|
69
|
+
"aria-label": string;
|
|
70
|
+
onClick: () => void | undefined;
|
|
71
|
+
};
|
|
72
|
+
open: boolean;
|
|
73
|
+
setOpen: react.Dispatch<react.SetStateAction<boolean>>;
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
interface DialogProps {
|
|
77
|
+
open?: boolean;
|
|
78
|
+
onOpenChange?: (open: boolean) => void;
|
|
79
|
+
modal?: boolean;
|
|
80
|
+
children: React.ReactNode;
|
|
81
|
+
}
|
|
82
|
+
declare function Dialog({ open: controlledOpen, onOpenChange, modal, children }: DialogProps): react_jsx_runtime.JSX.Element | null;
|
|
83
|
+
declare function DialogHeader({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
|
|
84
|
+
declare function DialogFooter({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
|
|
85
|
+
declare function DialogTitle({ className, ...props }: React.HTMLAttributes<HTMLHeadingElement>): react_jsx_runtime.JSX.Element;
|
|
86
|
+
declare function DialogDescription({ className, ...props }: React.HTMLAttributes<HTMLParagraphElement>): react_jsx_runtime.JSX.Element;
|
|
87
|
+
|
|
88
|
+
declare function useTabs(items: TabItem[], config?: Omit<TabsConfig, 'onValueChange'>): {
|
|
89
|
+
getListProps: () => {
|
|
90
|
+
role: "tablist";
|
|
91
|
+
};
|
|
92
|
+
getTriggerProps: (value: string, activeValue: string) => {
|
|
93
|
+
role: "tab";
|
|
94
|
+
"aria-selected": boolean;
|
|
95
|
+
"aria-controls": string;
|
|
96
|
+
id: string;
|
|
97
|
+
tabIndex: number;
|
|
98
|
+
disabled: boolean;
|
|
99
|
+
onClick: () => void;
|
|
100
|
+
onKeyDown: (e: KeyboardEvent) => void;
|
|
101
|
+
};
|
|
102
|
+
getPanelProps: (value: string, activeValue: string) => {
|
|
103
|
+
role: "tabpanel";
|
|
104
|
+
id: string;
|
|
105
|
+
"aria-labelledby": string;
|
|
106
|
+
hidden: true | undefined;
|
|
107
|
+
tabIndex: number;
|
|
108
|
+
};
|
|
109
|
+
value: string;
|
|
110
|
+
setValue: react.Dispatch<react.SetStateAction<string>>;
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
interface TabsProps {
|
|
114
|
+
items: TabItem[];
|
|
115
|
+
defaultValue?: string;
|
|
116
|
+
children: (api: ReturnType<typeof useTabs>) => React.ReactNode;
|
|
117
|
+
className?: string;
|
|
118
|
+
}
|
|
119
|
+
declare function Tabs({ items, defaultValue, children, className }: TabsProps): react_jsx_runtime.JSX.Element;
|
|
120
|
+
declare function TabsList({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
|
|
121
|
+
interface TabsTriggerProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
122
|
+
isActive?: boolean;
|
|
123
|
+
}
|
|
124
|
+
declare function TabsTrigger({ isActive, className, ...props }: TabsTriggerProps): react_jsx_runtime.JSX.Element;
|
|
125
|
+
declare function TabsContent({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
|
|
126
|
+
|
|
127
|
+
declare function useAccordion(items: AccordionItemConfig[], config?: Omit<AccordionConfig, 'onValueChange'>): {
|
|
128
|
+
getItemProps: (value: string) => {
|
|
129
|
+
"data-value": string;
|
|
130
|
+
};
|
|
131
|
+
getTriggerProps: (value: string, expandedValues: string[]) => {
|
|
132
|
+
"aria-expanded": boolean;
|
|
133
|
+
"aria-controls": string;
|
|
134
|
+
id: string;
|
|
135
|
+
disabled: boolean;
|
|
136
|
+
onClick: () => void;
|
|
137
|
+
onKeyDown: (e: KeyboardEvent) => void;
|
|
138
|
+
};
|
|
139
|
+
getContentProps: (value: string, expandedValues: string[]) => {
|
|
140
|
+
role: "region";
|
|
141
|
+
id: string;
|
|
142
|
+
"aria-labelledby": string;
|
|
143
|
+
hidden: boolean | undefined;
|
|
144
|
+
};
|
|
145
|
+
expandedValues: string[];
|
|
146
|
+
setExpandedValues: react.Dispatch<react.SetStateAction<string[]>>;
|
|
147
|
+
};
|
|
148
|
+
|
|
149
|
+
interface AccordionProps {
|
|
150
|
+
items: AccordionItemConfig[];
|
|
151
|
+
type?: AccordionConfig['type'];
|
|
152
|
+
collapsible?: boolean;
|
|
153
|
+
children: (api: ReturnType<typeof useAccordion>) => React.ReactNode;
|
|
154
|
+
className?: string;
|
|
155
|
+
}
|
|
156
|
+
declare function Accordion({ items, type, collapsible, children, className }: AccordionProps): react_jsx_runtime.JSX.Element;
|
|
157
|
+
declare function AccordionItem({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
|
|
158
|
+
interface AccordionTriggerProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
159
|
+
isExpanded?: boolean;
|
|
160
|
+
}
|
|
161
|
+
declare function AccordionTrigger({ isExpanded, className, children, ...props }: AccordionTriggerProps): react_jsx_runtime.JSX.Element;
|
|
162
|
+
declare function AccordionContent({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
|
|
163
|
+
|
|
164
|
+
declare function useSelect(options: SelectOption[], config?: Omit<SelectConfig, 'onValueChange' | 'onOpenChange'>): {
|
|
165
|
+
getTriggerProps: (isOpen: boolean, selectedValue: string | null, highlightedIndex?: number) => {
|
|
166
|
+
role: "combobox";
|
|
167
|
+
"aria-expanded": boolean;
|
|
168
|
+
"aria-haspopup": "listbox";
|
|
169
|
+
"aria-label": string;
|
|
170
|
+
"aria-activedescendant": string | undefined;
|
|
171
|
+
onClick: () => void | undefined;
|
|
172
|
+
onKeyDown: (e: KeyboardEvent) => void;
|
|
173
|
+
};
|
|
174
|
+
getListProps: () => {
|
|
175
|
+
role: "listbox";
|
|
176
|
+
};
|
|
177
|
+
getOptionProps: (option: SelectOption, isHighlighted: boolean, selectedValue: string | null, _highlightedIndex: number) => {
|
|
178
|
+
role: "option";
|
|
179
|
+
"aria-selected": boolean;
|
|
180
|
+
"aria-disabled": true | undefined;
|
|
181
|
+
"data-highlighted": true | undefined;
|
|
182
|
+
id: string;
|
|
183
|
+
onClick: () => void;
|
|
184
|
+
};
|
|
185
|
+
getContentProps: (isOpen: boolean) => {
|
|
186
|
+
hidden: boolean | undefined;
|
|
187
|
+
};
|
|
188
|
+
isOpen: boolean;
|
|
189
|
+
setIsOpen: react.Dispatch<react.SetStateAction<boolean>>;
|
|
190
|
+
selectedValue: string | null;
|
|
191
|
+
setSelectedValue: react.Dispatch<react.SetStateAction<string | null>>;
|
|
192
|
+
highlightedIndex: number;
|
|
193
|
+
setHighlightedIndex: react.Dispatch<react.SetStateAction<number>>;
|
|
194
|
+
handleKeyDown: (e: React.KeyboardEvent) => void;
|
|
195
|
+
};
|
|
196
|
+
|
|
197
|
+
interface SelectProps {
|
|
198
|
+
options: SelectOption[];
|
|
199
|
+
placeholder?: string;
|
|
200
|
+
className?: string;
|
|
201
|
+
onChange?: (value: string) => void;
|
|
202
|
+
}
|
|
203
|
+
declare function Select({ options, placeholder, className, onChange }: SelectProps): react_jsx_runtime.JSX.Element;
|
|
204
|
+
|
|
205
|
+
declare function useTooltip(config?: Omit<TooltipConfig, 'onOpenChange'>): {
|
|
206
|
+
getTriggerProps: () => {
|
|
207
|
+
"aria-describedby": string;
|
|
208
|
+
onMouseEnter: () => void;
|
|
209
|
+
onMouseLeave: () => void;
|
|
210
|
+
onFocus: () => void;
|
|
211
|
+
onBlur: () => void;
|
|
212
|
+
};
|
|
213
|
+
getContentProps: (isOpen: boolean) => {
|
|
214
|
+
id: string;
|
|
215
|
+
role: "tooltip";
|
|
216
|
+
hidden: boolean | undefined;
|
|
217
|
+
};
|
|
218
|
+
destroy: () => void;
|
|
219
|
+
open: boolean;
|
|
220
|
+
setOpen: react.Dispatch<react.SetStateAction<boolean>>;
|
|
221
|
+
};
|
|
222
|
+
|
|
223
|
+
interface TooltipProps {
|
|
224
|
+
content: React.ReactNode;
|
|
225
|
+
delay?: number;
|
|
226
|
+
children: React.ReactElement;
|
|
227
|
+
className?: string;
|
|
228
|
+
side?: 'top' | 'bottom';
|
|
229
|
+
}
|
|
230
|
+
declare function Tooltip({ content, delay, children, className, side }: TooltipProps): react_jsx_runtime.JSX.Element;
|
|
231
|
+
|
|
232
|
+
declare function usePopover(config?: Omit<PopoverConfig, 'onOpenChange'>): {
|
|
233
|
+
getTriggerProps: (isOpen: boolean) => {
|
|
234
|
+
"aria-haspopup": true;
|
|
235
|
+
"aria-expanded": boolean;
|
|
236
|
+
onClick: () => void | undefined;
|
|
237
|
+
};
|
|
238
|
+
getContentProps: (isOpen: boolean) => {
|
|
239
|
+
role: "dialog";
|
|
240
|
+
hidden: true | undefined;
|
|
241
|
+
onKeyDown: (e: KeyboardEvent) => void;
|
|
242
|
+
};
|
|
243
|
+
open: boolean;
|
|
244
|
+
setOpen: react.Dispatch<react.SetStateAction<boolean>>;
|
|
245
|
+
};
|
|
246
|
+
|
|
247
|
+
interface PopoverProps {
|
|
248
|
+
trigger: React.ReactNode;
|
|
249
|
+
children: React.ReactNode;
|
|
250
|
+
className?: string;
|
|
251
|
+
}
|
|
252
|
+
declare function Popover({ trigger, children, className }: PopoverProps): react_jsx_runtime.JSX.Element;
|
|
253
|
+
|
|
254
|
+
declare function useToast(): {
|
|
255
|
+
toasts: Toast[];
|
|
256
|
+
dismiss: (id: string) => void;
|
|
257
|
+
toast: {
|
|
258
|
+
default: (title: string, description?: string) => string;
|
|
259
|
+
success: (title: string, description?: string) => string;
|
|
260
|
+
destructive: (title: string, description?: string) => string;
|
|
261
|
+
custom: (t: Omit<Toast, "id">) => string;
|
|
262
|
+
dismiss: (id: string) => void;
|
|
263
|
+
subscribe: (listener: (state: _mcp_elements_core.ToastState) => void) => () => void;
|
|
264
|
+
getState: () => _mcp_elements_core.ToastState;
|
|
265
|
+
};
|
|
266
|
+
};
|
|
267
|
+
|
|
268
|
+
interface ToasterProps {
|
|
269
|
+
position?: 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left';
|
|
270
|
+
className?: string;
|
|
271
|
+
}
|
|
272
|
+
declare function Toaster({ position, className }: ToasterProps): react_jsx_runtime.JSX.Element;
|
|
273
|
+
|
|
274
|
+
declare function useDrawer(config?: Omit<DrawerConfig, 'onOpenChange'>): {
|
|
275
|
+
getOverlayProps: () => {
|
|
276
|
+
"aria-hidden": true;
|
|
277
|
+
onClick: () => void | undefined;
|
|
278
|
+
};
|
|
279
|
+
getContentProps: (isOpen: boolean) => {
|
|
280
|
+
role: "dialog";
|
|
281
|
+
"aria-modal": boolean;
|
|
282
|
+
hidden: boolean | undefined;
|
|
283
|
+
onKeyDown: (e: KeyboardEvent) => void;
|
|
284
|
+
};
|
|
285
|
+
getCloseProps: () => {
|
|
286
|
+
"aria-label": string;
|
|
287
|
+
onClick: () => void | undefined;
|
|
288
|
+
};
|
|
289
|
+
side: "left" | "right" | "top" | "bottom";
|
|
290
|
+
open: boolean;
|
|
291
|
+
setOpen: react.Dispatch<react.SetStateAction<boolean>>;
|
|
292
|
+
};
|
|
293
|
+
|
|
294
|
+
interface DrawerProps {
|
|
295
|
+
open?: boolean;
|
|
296
|
+
onOpenChange?: (open: boolean) => void;
|
|
297
|
+
side?: 'left' | 'right' | 'top' | 'bottom';
|
|
298
|
+
children: React.ReactNode;
|
|
299
|
+
}
|
|
300
|
+
declare function Drawer({ open: controlledOpen, onOpenChange, side, children }: DrawerProps): react_jsx_runtime.JSX.Element | null;
|
|
301
|
+
declare function DrawerHeader({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
|
|
302
|
+
declare function DrawerFooter({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
|
|
303
|
+
declare function DrawerTitle({ className, ...props }: React.HTMLAttributes<HTMLHeadingElement>): react_jsx_runtime.JSX.Element;
|
|
304
|
+
declare function DrawerDescription({ className, ...props }: React.HTMLAttributes<HTMLParagraphElement>): react_jsx_runtime.JSX.Element;
|
|
305
|
+
declare function DrawerBody({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
|
|
306
|
+
|
|
307
|
+
declare function useDropdownMenu(items: DropdownMenuItem[], config?: Omit<DropdownMenuConfig, 'onOpenChange'>): {
|
|
308
|
+
getTriggerProps: (isOpen: boolean) => {
|
|
309
|
+
"aria-haspopup": "menu";
|
|
310
|
+
"aria-expanded": boolean;
|
|
311
|
+
onClick: () => void | undefined;
|
|
312
|
+
};
|
|
313
|
+
getContentProps: (isOpen: boolean) => {
|
|
314
|
+
role: "menu";
|
|
315
|
+
hidden: true | undefined;
|
|
316
|
+
};
|
|
317
|
+
getItemProps: (item: DropdownMenuItem, isHighlighted: boolean) => {
|
|
318
|
+
role: "menuitem";
|
|
319
|
+
"aria-disabled": true | undefined;
|
|
320
|
+
"data-highlighted": true | undefined;
|
|
321
|
+
tabIndex: number;
|
|
322
|
+
onClick: () => void;
|
|
323
|
+
};
|
|
324
|
+
isOpen: boolean;
|
|
325
|
+
setIsOpen: react.Dispatch<react.SetStateAction<boolean>>;
|
|
326
|
+
highlightedIndex: number;
|
|
327
|
+
setHighlightedIndex: react.Dispatch<react.SetStateAction<number>>;
|
|
328
|
+
handleKeyDown: (e: React.KeyboardEvent) => void;
|
|
329
|
+
};
|
|
330
|
+
|
|
331
|
+
interface DropdownMenuProps {
|
|
332
|
+
trigger: React.ReactNode;
|
|
333
|
+
items: DropdownMenuItem[];
|
|
334
|
+
className?: string;
|
|
335
|
+
align?: 'start' | 'end';
|
|
336
|
+
}
|
|
337
|
+
declare function DropdownMenu({ trigger, items, className, align }: DropdownMenuProps): react_jsx_runtime.JSX.Element;
|
|
338
|
+
|
|
339
|
+
interface SwitchProps {
|
|
340
|
+
checked?: boolean;
|
|
341
|
+
onCheckedChange?: (checked: boolean) => void;
|
|
342
|
+
disabled?: boolean;
|
|
343
|
+
className?: string;
|
|
344
|
+
id?: string;
|
|
345
|
+
name?: string;
|
|
346
|
+
}
|
|
347
|
+
declare const Switch: react.ForwardRefExoticComponent<SwitchProps & react.RefAttributes<HTMLButtonElement>>;
|
|
348
|
+
|
|
349
|
+
interface ProgressProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
350
|
+
value?: number;
|
|
351
|
+
max?: number;
|
|
352
|
+
}
|
|
353
|
+
declare const Progress: react.ForwardRefExoticComponent<ProgressProps & react.RefAttributes<HTMLDivElement>>;
|
|
354
|
+
|
|
355
|
+
interface LoaderProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
356
|
+
size?: 'sm' | 'md' | 'lg' | 'xl';
|
|
357
|
+
variant?: 'primary' | 'muted';
|
|
358
|
+
}
|
|
359
|
+
declare function Loader({ size, variant, className, ...props }: LoaderProps): react_jsx_runtime.JSX.Element;
|
|
360
|
+
|
|
361
|
+
interface ChipProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
362
|
+
variant?: 'default' | 'primary' | 'outline' | 'destructive';
|
|
363
|
+
onRemove?: () => void;
|
|
364
|
+
}
|
|
365
|
+
declare function Chip({ variant, onRemove, className, children, ...props }: ChipProps): react_jsx_runtime.JSX.Element;
|
|
366
|
+
interface ChipsProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
367
|
+
}
|
|
368
|
+
declare function Chips({ className, ...props }: ChipsProps): react_jsx_runtime.JSX.Element;
|
|
369
|
+
|
|
370
|
+
interface PasswordInputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'type'> {
|
|
371
|
+
}
|
|
372
|
+
declare const PasswordInput: react.ForwardRefExoticComponent<PasswordInputProps & react.RefAttributes<HTMLInputElement>>;
|
|
373
|
+
|
|
374
|
+
interface CounterProps {
|
|
375
|
+
value: number;
|
|
376
|
+
onChange: (value: number) => void;
|
|
377
|
+
min?: number;
|
|
378
|
+
max?: number;
|
|
379
|
+
step?: number;
|
|
380
|
+
disabled?: boolean;
|
|
381
|
+
className?: string;
|
|
382
|
+
}
|
|
383
|
+
declare function Counter({ value, onChange, min, max, step, disabled, className }: CounterProps): react_jsx_runtime.JSX.Element;
|
|
384
|
+
|
|
385
|
+
interface AlertProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
386
|
+
variant?: 'default' | 'destructive' | 'success' | 'warning';
|
|
387
|
+
}
|
|
388
|
+
declare const Alert: react.ForwardRefExoticComponent<AlertProps & react.RefAttributes<HTMLDivElement>>;
|
|
389
|
+
declare function AlertTitle({ className, ...props }: React.HTMLAttributes<HTMLHeadingElement>): react_jsx_runtime.JSX.Element;
|
|
390
|
+
declare function AlertDescription({ className, ...props }: React.HTMLAttributes<HTMLParagraphElement>): react_jsx_runtime.JSX.Element;
|
|
391
|
+
|
|
392
|
+
declare const PromptInput: react.ForwardRefExoticComponent<react.HTMLAttributes<HTMLDivElement> & react.RefAttributes<HTMLDivElement>>;
|
|
393
|
+
interface PromptInputTextareaProps extends React.TextareaHTMLAttributes<HTMLTextAreaElement> {
|
|
394
|
+
}
|
|
395
|
+
declare const PromptInputTextarea: react.ForwardRefExoticComponent<PromptInputTextareaProps & react.RefAttributes<HTMLTextAreaElement>>;
|
|
396
|
+
declare const PromptInputFooter: react.ForwardRefExoticComponent<react.HTMLAttributes<HTMLDivElement> & react.RefAttributes<HTMLDivElement>>;
|
|
397
|
+
declare const PromptInputActions: react.ForwardRefExoticComponent<react.HTMLAttributes<HTMLDivElement> & react.RefAttributes<HTMLDivElement>>;
|
|
398
|
+
interface PromptInputCharCountProps {
|
|
399
|
+
count: number;
|
|
400
|
+
max?: number;
|
|
401
|
+
className?: string;
|
|
402
|
+
}
|
|
403
|
+
declare function PromptInputCharCount({ count, max, className }: PromptInputCharCountProps): react_jsx_runtime.JSX.Element;
|
|
404
|
+
declare const PromptInputAttachments: react.ForwardRefExoticComponent<react.HTMLAttributes<HTMLDivElement> & react.RefAttributes<HTMLDivElement>>;
|
|
405
|
+
interface PromptInputAttachmentProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
406
|
+
onRemove?: () => void;
|
|
407
|
+
}
|
|
408
|
+
declare function PromptInputAttachment({ onRemove, className, children, ...props }: PromptInputAttachmentProps): react_jsx_runtime.JSX.Element;
|
|
409
|
+
|
|
410
|
+
interface ChatBubbleProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
411
|
+
variant?: 'user' | 'ai';
|
|
412
|
+
}
|
|
413
|
+
declare const ChatBubble: react.ForwardRefExoticComponent<ChatBubbleProps & react.RefAttributes<HTMLDivElement>>;
|
|
414
|
+
interface ChatBubbleAvatarProps {
|
|
415
|
+
src: string;
|
|
416
|
+
alt: string;
|
|
417
|
+
className?: string;
|
|
418
|
+
}
|
|
419
|
+
declare function ChatBubbleAvatar({ src, alt, className }: ChatBubbleAvatarProps): react_jsx_runtime.JSX.Element;
|
|
420
|
+
declare const ChatBubbleContent: react.ForwardRefExoticComponent<react.HTMLAttributes<HTMLDivElement> & react.RefAttributes<HTMLDivElement>>;
|
|
421
|
+
declare const ChatBubbleTimestamp: react.ForwardRefExoticComponent<react.HTMLAttributes<HTMLSpanElement> & react.RefAttributes<HTMLSpanElement>>;
|
|
422
|
+
declare function ChatBubbleTyping({ className }: {
|
|
423
|
+
className?: string;
|
|
424
|
+
}): react_jsx_runtime.JSX.Element;
|
|
425
|
+
|
|
426
|
+
interface AiBadgeProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
427
|
+
variant?: 'default' | 'prominent' | 'subtle';
|
|
428
|
+
showIcon?: boolean;
|
|
429
|
+
}
|
|
430
|
+
declare function AiBadge({ variant, showIcon, className, children, ...props }: AiBadgeProps): react_jsx_runtime.JSX.Element;
|
|
431
|
+
|
|
432
|
+
interface SuggestionChipsProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
433
|
+
}
|
|
434
|
+
declare const SuggestionChips: react.ForwardRefExoticComponent<SuggestionChipsProps & react.RefAttributes<HTMLDivElement>>;
|
|
435
|
+
interface SuggestionChipProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
436
|
+
variant?: 'default' | 'primary' | 'outline';
|
|
437
|
+
}
|
|
438
|
+
declare const SuggestionChip: react.ForwardRefExoticComponent<SuggestionChipProps & react.RefAttributes<HTMLButtonElement>>;
|
|
439
|
+
|
|
440
|
+
interface SourceCardsProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
441
|
+
}
|
|
442
|
+
declare const SourceCards: react.ForwardRefExoticComponent<SourceCardsProps & react.RefAttributes<HTMLDivElement>>;
|
|
443
|
+
interface SourceCardProps extends React.AnchorHTMLAttributes<HTMLAnchorElement> {
|
|
444
|
+
favicon?: string;
|
|
445
|
+
title: string;
|
|
446
|
+
domain: string;
|
|
447
|
+
index?: number;
|
|
448
|
+
}
|
|
449
|
+
declare const SourceCard: react.ForwardRefExoticComponent<SourceCardProps & react.RefAttributes<HTMLAnchorElement>>;
|
|
450
|
+
|
|
451
|
+
interface StreamingTextProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
452
|
+
}
|
|
453
|
+
declare const StreamingText: react.ForwardRefExoticComponent<StreamingTextProps & react.RefAttributes<HTMLDivElement>>;
|
|
454
|
+
declare const StreamingTextFadeIn: react.ForwardRefExoticComponent<react.HTMLAttributes<HTMLSpanElement> & react.RefAttributes<HTMLSpanElement>>;
|
|
455
|
+
declare const StreamingTextWord: react.ForwardRefExoticComponent<react.HTMLAttributes<HTMLSpanElement> & react.RefAttributes<HTMLSpanElement>>;
|
|
456
|
+
declare const StreamingTextLine: react.ForwardRefExoticComponent<react.HTMLAttributes<HTMLDivElement> & react.RefAttributes<HTMLDivElement>>;
|
|
457
|
+
declare const StreamingTextSkeleton: react.ForwardRefExoticComponent<react.HTMLAttributes<HTMLDivElement> & react.RefAttributes<HTMLDivElement>>;
|
|
458
|
+
declare const StreamingTextSkeletonLine: react.ForwardRefExoticComponent<react.HTMLAttributes<HTMLDivElement> & react.RefAttributes<HTMLDivElement>>;
|
|
459
|
+
|
|
460
|
+
declare const Feedback: react.ForwardRefExoticComponent<react.HTMLAttributes<HTMLDivElement> & react.RefAttributes<HTMLDivElement>>;
|
|
461
|
+
interface FeedbackButtonProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'type'> {
|
|
462
|
+
type: 'up' | 'down';
|
|
463
|
+
selected?: boolean;
|
|
464
|
+
}
|
|
465
|
+
declare function FeedbackButton({ type, selected, className, ...props }: FeedbackButtonProps): react_jsx_runtime.JSX.Element;
|
|
466
|
+
declare function FeedbackSeparator({ className }: {
|
|
467
|
+
className?: string;
|
|
468
|
+
}): react_jsx_runtime.JSX.Element;
|
|
469
|
+
declare const FeedbackForm: react.ForwardRefExoticComponent<react.HTMLAttributes<HTMLDivElement> & react.RefAttributes<HTMLDivElement>>;
|
|
470
|
+
declare const FeedbackInput: react.ForwardRefExoticComponent<react.InputHTMLAttributes<HTMLInputElement> & react.RefAttributes<HTMLInputElement>>;
|
|
471
|
+
declare const FeedbackSubmit: react.ForwardRefExoticComponent<react.ButtonHTMLAttributes<HTMLButtonElement> & react.RefAttributes<HTMLButtonElement>>;
|
|
472
|
+
|
|
473
|
+
type McpConnectionStatus = 'connected' | 'connecting' | 'disconnected' | 'error';
|
|
474
|
+
interface McpServerStatusProps extends react__default.HTMLAttributes<HTMLSpanElement> {
|
|
475
|
+
status: McpConnectionStatus;
|
|
476
|
+
serverName?: string;
|
|
477
|
+
}
|
|
478
|
+
declare function McpServerStatus({ status, serverName, className, ...props }: McpServerStatusProps): react_jsx_runtime.JSX.Element;
|
|
479
|
+
|
|
480
|
+
interface McpToolCallProps {
|
|
481
|
+
state: ToolStateApi;
|
|
482
|
+
toolName?: string;
|
|
483
|
+
args?: Record<string, unknown>;
|
|
484
|
+
onRetry?: () => void;
|
|
485
|
+
className?: string;
|
|
486
|
+
}
|
|
487
|
+
declare function McpToolCall({ state, toolName, args, onRetry, className }: McpToolCallProps): react_jsx_runtime.JSX.Element;
|
|
488
|
+
|
|
489
|
+
interface McpToolFormProps {
|
|
490
|
+
schema: JsonSchema;
|
|
491
|
+
onSubmit: (args: Record<string, unknown>) => void;
|
|
492
|
+
loading?: boolean;
|
|
493
|
+
submitLabel?: string;
|
|
494
|
+
className?: string;
|
|
495
|
+
}
|
|
496
|
+
declare function McpToolForm({ schema, onSubmit, loading, submitLabel, className, }: McpToolFormProps): react_jsx_runtime.JSX.Element;
|
|
497
|
+
|
|
498
|
+
interface McpConsentDialogProps {
|
|
499
|
+
open: boolean;
|
|
500
|
+
serverName: string;
|
|
501
|
+
serverIcon?: string;
|
|
502
|
+
scopes: string[];
|
|
503
|
+
onApprove: () => void;
|
|
504
|
+
onDeny: () => void;
|
|
505
|
+
className?: string;
|
|
506
|
+
}
|
|
507
|
+
declare function McpConsentDialog({ open, serverName, serverIcon, scopes, onApprove, onDeny, className, }: McpConsentDialogProps): react_jsx_runtime.JSX.Element;
|
|
508
|
+
|
|
509
|
+
interface McpScopeInspectorProps {
|
|
510
|
+
/** Space-separated scope string OR pre-parsed array */
|
|
511
|
+
scopes: string | ScopeDescriptor[];
|
|
512
|
+
/** Human-readable descriptions keyed by scope raw string or resource */
|
|
513
|
+
descriptions?: Record<string, string>;
|
|
514
|
+
className?: string;
|
|
515
|
+
}
|
|
516
|
+
declare function McpScopeInspector({ scopes, descriptions, className }: McpScopeInspectorProps): react_jsx_runtime.JSX.Element;
|
|
517
|
+
|
|
518
|
+
interface McpResource {
|
|
519
|
+
uri: string;
|
|
520
|
+
name: string;
|
|
521
|
+
mimeType?: string;
|
|
522
|
+
description?: string;
|
|
523
|
+
}
|
|
524
|
+
interface McpResourceBrowserProps {
|
|
525
|
+
resources: McpResource[];
|
|
526
|
+
selectedUri?: string;
|
|
527
|
+
onSelect?: (resource: McpResource) => void;
|
|
528
|
+
loading?: boolean;
|
|
529
|
+
className?: string;
|
|
530
|
+
}
|
|
531
|
+
declare function McpResourceBrowser({ resources, selectedUri, onSelect, loading, className, }: McpResourceBrowserProps): react_jsx_runtime.JSX.Element;
|
|
532
|
+
|
|
533
|
+
interface McpAppFrameProps {
|
|
534
|
+
/** URL of the MCP App to load */
|
|
535
|
+
src: string;
|
|
536
|
+
/** Called when the app sends a message via postMessage */
|
|
537
|
+
onMessage?: (envelope: AppMessageEnvelope) => void;
|
|
538
|
+
/** Height of the iframe in pixels */
|
|
539
|
+
height?: number;
|
|
540
|
+
/** Additional iframe sandbox flags */
|
|
541
|
+
sandbox?: string;
|
|
542
|
+
className?: string;
|
|
543
|
+
}
|
|
544
|
+
declare function McpAppFrame({ src, onMessage, height, sandbox, className, }: McpAppFrameProps): react_jsx_runtime.JSX.Element;
|
|
545
|
+
|
|
546
|
+
/**
|
|
547
|
+
* React hook that wraps a ToolStateApi instance.
|
|
548
|
+
* Provides reactive access to tool call state.
|
|
549
|
+
*/
|
|
550
|
+
declare function useMcpToolState(): ToolStateSnapshot & ToolStateApi;
|
|
551
|
+
|
|
552
|
+
/**
|
|
553
|
+
* React hook that wraps an OAuthFlowApi instance.
|
|
554
|
+
* Manages PKCE OAuth 2.1 flow state.
|
|
555
|
+
*/
|
|
556
|
+
declare function useMcpOAuth(): OAuthFlowSnapshot & OAuthFlowApi;
|
|
557
|
+
|
|
558
|
+
interface UseMcpAppBridgeOptions {
|
|
559
|
+
/** Called when a message arrives from the iframe */
|
|
560
|
+
onMessage?: (envelope: AppMessageEnvelope) => void;
|
|
561
|
+
}
|
|
562
|
+
interface UseMcpAppBridgeReturn {
|
|
563
|
+
/** Send a message to the iframe */
|
|
564
|
+
send: (envelope: AppMessageEnvelope) => void;
|
|
565
|
+
/** Assign to <iframe ref={...}> */
|
|
566
|
+
frameRef: React.RefObject<HTMLIFrameElement | null>;
|
|
567
|
+
}
|
|
568
|
+
/**
|
|
569
|
+
* React hook that sets up a postMessage bridge with an MCP App iframe.
|
|
570
|
+
* Wire it up: <iframe ref={frameRef} src={...} />
|
|
571
|
+
*
|
|
572
|
+
* onMessage is stored in a ref so inline callbacks don't recreate the bridge.
|
|
573
|
+
*/
|
|
574
|
+
declare function useMcpAppBridge(options?: UseMcpAppBridgeOptions): UseMcpAppBridgeReturn;
|
|
575
|
+
|
|
576
|
+
interface UseMcpSchemaFormReturn {
|
|
577
|
+
/** Derived field descriptors from the JSON Schema */
|
|
578
|
+
fields: FieldDescriptor[];
|
|
579
|
+
/** Current form values */
|
|
580
|
+
values: Record<string, unknown>;
|
|
581
|
+
/** Update a single field value (stable reference) */
|
|
582
|
+
setValue: (key: string, value: unknown) => void;
|
|
583
|
+
/** Reset values to defaults (stable when fields are unchanged) */
|
|
584
|
+
reset: () => void;
|
|
585
|
+
}
|
|
586
|
+
/**
|
|
587
|
+
* React hook that converts a JSON Schema into form field descriptors
|
|
588
|
+
* and manages form state.
|
|
589
|
+
*/
|
|
590
|
+
declare function useMcpSchemaForm(schema: JsonSchema): UseMcpSchemaFormReturn;
|
|
591
|
+
|
|
592
|
+
export { Accordion, AccordionContent, AccordionItem, type AccordionProps, AccordionTrigger, type AccordionTriggerProps, AiBadge, type AiBadgeProps, Alert, AlertDescription, type AlertProps, AlertTitle, Avatar, type AvatarProps, Badge, type BadgeProps, Button, type ButtonProps, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, ChatBubble, ChatBubbleAvatar, type ChatBubbleAvatarProps, ChatBubbleContent, type ChatBubbleProps, ChatBubbleTimestamp, ChatBubbleTyping, Chip, type ChipProps, Chips, type ChipsProps, Counter, type CounterProps, Dialog, DialogDescription, DialogFooter, DialogHeader, type DialogProps, DialogTitle, Drawer, DrawerBody, DrawerDescription, DrawerFooter, DrawerHeader, type DrawerProps, DrawerTitle, DropdownMenu, type DropdownMenuProps, Feedback, FeedbackButton, type FeedbackButtonProps, FeedbackForm, FeedbackInput, FeedbackSeparator, FeedbackSubmit, Input, type InputProps, Loader, type LoaderProps, McpAppFrame, type McpAppFrameProps, type McpConnectionStatus, McpConsentDialog, type McpConsentDialogProps, type McpResource, McpResourceBrowser, type McpResourceBrowserProps, McpScopeInspector, type McpScopeInspectorProps, McpServerStatus, type McpServerStatusProps, McpToolCall, type McpToolCallProps, McpToolForm, type McpToolFormProps, PasswordInput, type PasswordInputProps, Popover, type PopoverProps, Progress, type ProgressProps, PromptInput, PromptInputActions, PromptInputAttachment, type PromptInputAttachmentProps, PromptInputAttachments, PromptInputCharCount, type PromptInputCharCountProps, PromptInputFooter, PromptInputTextarea, type PromptInputTextareaProps, Select, type SelectProps, Separator, type SeparatorProps, Skeleton, type SkeletonProps, SourceCard, type SourceCardProps, SourceCards, type SourceCardsProps, StreamingText, StreamingTextFadeIn, StreamingTextLine, type StreamingTextProps, StreamingTextSkeleton, StreamingTextSkeletonLine, StreamingTextWord, SuggestionChip, type SuggestionChipProps, SuggestionChips, type SuggestionChipsProps, Switch, type SwitchProps, Tabs, TabsContent, TabsList, type TabsProps, TabsTrigger, type TabsTriggerProps, Textarea, type TextareaProps, Toaster, type ToasterProps, Tooltip, type TooltipProps, type UseMcpAppBridgeOptions, type UseMcpAppBridgeReturn, type UseMcpSchemaFormReturn, useAccordion, useDialog, useDrawer, useDropdownMenu, useMcpAppBridge, useMcpOAuth, useMcpSchemaForm, useMcpToolState, usePopover, useSelect, useTabs, useToast, useTooltip };
|