open-mcp-app-ui 0.0.2 → 0.0.3
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/index.d.ts +501 -19
- package/dist/index.js +1717 -153
- package/dist/index.js.map +1 -1
- package/dist/styles/fallbacks.css +2 -2
- package/dist/styles.css +2 -0
- package/package.json +11 -4
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import * as react from 'react';
|
|
3
|
-
import { HTMLAttributes, ReactNode, ButtonHTMLAttributes, InputHTMLAttributes, TextareaHTMLAttributes
|
|
3
|
+
import { HTMLAttributes, ReactNode, ButtonHTMLAttributes, InputHTMLAttributes, TextareaHTMLAttributes } from 'react';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Shared types for open-mcp-app-ui.
|
|
@@ -140,6 +140,12 @@ interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
|
140
140
|
size?: Size;
|
|
141
141
|
/** Show a loading spinner and disable interaction. */
|
|
142
142
|
loading?: boolean;
|
|
143
|
+
/**
|
|
144
|
+
* Custom spinner element shown when `loading` is true.
|
|
145
|
+
* Receives a ReactNode so callers can pass any SVG or component.
|
|
146
|
+
* Falls back to a built-in circle spinner when omitted.
|
|
147
|
+
*/
|
|
148
|
+
loadingIcon?: ReactNode;
|
|
143
149
|
/** Button content. */
|
|
144
150
|
children: ReactNode;
|
|
145
151
|
}
|
|
@@ -204,45 +210,72 @@ interface SelectOption {
|
|
|
204
210
|
label?: string;
|
|
205
211
|
/** Whether this option is disabled. */
|
|
206
212
|
disabled?: boolean;
|
|
213
|
+
/** Secondary description text below the label. */
|
|
214
|
+
description?: string;
|
|
215
|
+
}
|
|
216
|
+
interface SelectOptionGroup {
|
|
217
|
+
/** Group label shown as the optgroup heading. */
|
|
218
|
+
label: string;
|
|
219
|
+
/** Options within this group. */
|
|
220
|
+
options: SelectOption[];
|
|
207
221
|
}
|
|
208
|
-
|
|
222
|
+
/** Options can be flat or grouped. */
|
|
223
|
+
type SelectOptions = SelectOption[] | SelectOptionGroup[];
|
|
224
|
+
interface SelectProps {
|
|
209
225
|
/** Label displayed above the select. */
|
|
210
226
|
label?: string;
|
|
211
|
-
/** Options to display. */
|
|
212
|
-
options:
|
|
213
|
-
/**
|
|
227
|
+
/** Options to display. Supports flat arrays or grouped arrays. */
|
|
228
|
+
options: SelectOptions;
|
|
229
|
+
/** Controlled value. */
|
|
230
|
+
value?: string;
|
|
231
|
+
/** Called when the selection changes. */
|
|
232
|
+
onChange?: (value: string) => void;
|
|
233
|
+
/** Placeholder text when no value is selected. */
|
|
214
234
|
placeholder?: string;
|
|
215
|
-
/** Error message
|
|
235
|
+
/** Error message — shows error styling. */
|
|
216
236
|
error?: string;
|
|
217
237
|
/** Helper text displayed below the select. */
|
|
218
238
|
helperText?: string;
|
|
219
239
|
/** Select size. */
|
|
220
240
|
size?: Size;
|
|
241
|
+
/** Expand to full width. */
|
|
242
|
+
block?: boolean;
|
|
243
|
+
/** Disables the select. */
|
|
244
|
+
disabled?: boolean;
|
|
245
|
+
/** ID for the trigger element. */
|
|
246
|
+
id?: string;
|
|
247
|
+
/** Additional CSS class. */
|
|
248
|
+
className?: string;
|
|
221
249
|
}
|
|
222
250
|
/**
|
|
223
|
-
*
|
|
251
|
+
* Custom dropdown select with keyboard navigation and check marks.
|
|
224
252
|
*
|
|
225
253
|
* @example
|
|
226
254
|
* ```tsx
|
|
227
255
|
* <Select
|
|
228
256
|
* label="Status"
|
|
229
|
-
* placeholder="Choose
|
|
257
|
+
* placeholder="Choose..."
|
|
258
|
+
* value={status}
|
|
259
|
+
* onChange={setStatus}
|
|
230
260
|
* options={[
|
|
231
261
|
* { value: "active", label: "Active" },
|
|
232
262
|
* { value: "archived", label: "Archived" },
|
|
233
263
|
* ]}
|
|
234
|
-
* onChange={(e) => setStatus(e.target.value)}
|
|
235
264
|
* />
|
|
236
265
|
* ```
|
|
237
266
|
*/
|
|
238
|
-
declare const Select: react.ForwardRefExoticComponent<SelectProps & react.RefAttributes<
|
|
267
|
+
declare const Select: react.ForwardRefExoticComponent<SelectProps & react.RefAttributes<HTMLButtonElement>>;
|
|
239
268
|
|
|
240
269
|
interface CheckboxProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "type" | "size"> {
|
|
241
270
|
/** Label displayed next to the checkbox. */
|
|
242
271
|
label?: string;
|
|
243
272
|
}
|
|
244
273
|
/**
|
|
245
|
-
* Accessible checkbox with optional label.
|
|
274
|
+
* Accessible checkbox with animated checkmark and optional label.
|
|
275
|
+
*
|
|
276
|
+
* Supports both controlled (`checked` + `onChange`) and uncontrolled
|
|
277
|
+
* (`defaultChecked`) usage. The visual state tracks the native input
|
|
278
|
+
* so animations stay in sync.
|
|
246
279
|
*
|
|
247
280
|
* @example
|
|
248
281
|
* ```tsx
|
|
@@ -271,13 +304,307 @@ interface SwitchProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "onC
|
|
|
271
304
|
*/
|
|
272
305
|
declare const Switch: react.ForwardRefExoticComponent<SwitchProps & react.RefAttributes<HTMLButtonElement>>;
|
|
273
306
|
|
|
307
|
+
interface RadioGroupProps {
|
|
308
|
+
/** Controlled selected value. */
|
|
309
|
+
value: string;
|
|
310
|
+
/** Called when the selection changes. */
|
|
311
|
+
onChange: (value: string) => void;
|
|
312
|
+
/** Accessible label for the group. */
|
|
313
|
+
"aria-label": string;
|
|
314
|
+
/** Layout direction of radio items. */
|
|
315
|
+
direction?: "row" | "col";
|
|
316
|
+
/** Disables the entire group. */
|
|
317
|
+
disabled?: boolean;
|
|
318
|
+
/** Additional CSS class. */
|
|
319
|
+
className?: string;
|
|
320
|
+
children: ReactNode;
|
|
321
|
+
}
|
|
322
|
+
/**
|
|
323
|
+
* Radio option group with animated selection indicator.
|
|
324
|
+
*
|
|
325
|
+
* @example
|
|
326
|
+
* ```tsx
|
|
327
|
+
* <RadioGroup value={size} onChange={setSize} aria-label="Size">
|
|
328
|
+
* <RadioGroup.Item value="sm">Small</RadioGroup.Item>
|
|
329
|
+
* <RadioGroup.Item value="md">Medium</RadioGroup.Item>
|
|
330
|
+
* <RadioGroup.Item value="lg">Large</RadioGroup.Item>
|
|
331
|
+
* </RadioGroup>
|
|
332
|
+
* ```
|
|
333
|
+
*/
|
|
334
|
+
declare const RadioGroup: react.ForwardRefExoticComponent<RadioGroupProps & react.RefAttributes<HTMLDivElement>> & {
|
|
335
|
+
Item: typeof RadioGroupItem;
|
|
336
|
+
};
|
|
337
|
+
interface RadioGroupItemProps {
|
|
338
|
+
/** Option value. */
|
|
339
|
+
value: string;
|
|
340
|
+
/** Disables this individual item. */
|
|
341
|
+
disabled?: boolean;
|
|
342
|
+
/** Additional CSS class. */
|
|
343
|
+
className?: string;
|
|
344
|
+
children: ReactNode;
|
|
345
|
+
}
|
|
346
|
+
/**
|
|
347
|
+
* A single radio option within a RadioGroup.
|
|
348
|
+
* Uses a hidden native radio input for accessibility.
|
|
349
|
+
*/
|
|
350
|
+
declare function RadioGroupItem({ value, disabled: itemDisabled, className, children, }: RadioGroupItemProps): react_jsx_runtime.JSX.Element;
|
|
351
|
+
|
|
352
|
+
interface SliderProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "type" | "size"> {
|
|
353
|
+
/** Label displayed above the slider. */
|
|
354
|
+
label?: string;
|
|
355
|
+
/** Current value (controlled). */
|
|
356
|
+
value?: number;
|
|
357
|
+
/** Minimum value. */
|
|
358
|
+
min?: number;
|
|
359
|
+
/** Maximum value. */
|
|
360
|
+
max?: number;
|
|
361
|
+
/** Step increment. */
|
|
362
|
+
step?: number;
|
|
363
|
+
/** Show the current value next to the slider. */
|
|
364
|
+
showValue?: boolean;
|
|
365
|
+
/** Format function for the displayed value. */
|
|
366
|
+
formatValue?: (value: number) => string;
|
|
367
|
+
/** Helper text below the slider. */
|
|
368
|
+
helperText?: string;
|
|
369
|
+
/** Additional CSS class. */
|
|
370
|
+
className?: string;
|
|
371
|
+
}
|
|
372
|
+
/**
|
|
373
|
+
* Range slider with optional label and value display.
|
|
374
|
+
*
|
|
375
|
+
* @example
|
|
376
|
+
* ```tsx
|
|
377
|
+
* <Slider label="Volume" value={vol} min={0} max={100} onChange={e => setVol(+e.target.value)} />
|
|
378
|
+
* <Slider label="Opacity" value={0.5} min={0} max={1} step={0.1} showValue />
|
|
379
|
+
* ```
|
|
380
|
+
*/
|
|
381
|
+
declare const Slider: react.ForwardRefExoticComponent<SliderProps & react.RefAttributes<HTMLInputElement>>;
|
|
382
|
+
|
|
383
|
+
/**
|
|
384
|
+
* TagInput — Multi-tag input with keyboard navigation and validation.
|
|
385
|
+
*
|
|
386
|
+
* Allows users to enter multiple values as "tags" via typing and pressing
|
|
387
|
+
* Enter (or a custom delimiter). Tags can be removed by clicking their
|
|
388
|
+
* close button or by pressing Backspace. Supports duplicate detection with
|
|
389
|
+
* a shake animation, custom validation, and max tag limits.
|
|
390
|
+
*/
|
|
391
|
+
interface Tag {
|
|
392
|
+
/** Tag display value. */
|
|
393
|
+
value: string;
|
|
394
|
+
/** Whether this tag passed validation. */
|
|
395
|
+
valid: boolean;
|
|
396
|
+
}
|
|
397
|
+
interface TagInputProps {
|
|
398
|
+
/** Label displayed above the input. */
|
|
399
|
+
label?: string;
|
|
400
|
+
/** Controlled tag list. */
|
|
401
|
+
value?: Tag[];
|
|
402
|
+
/** Default tags for uncontrolled mode. */
|
|
403
|
+
defaultValue?: Tag[];
|
|
404
|
+
/** Called when tags change. */
|
|
405
|
+
onChange?: (tags: Tag[]) => void;
|
|
406
|
+
/** Validation function — return false to mark a tag as invalid. */
|
|
407
|
+
validator?: (value: string) => boolean;
|
|
408
|
+
/** Characters that trigger tag creation (besides Enter). */
|
|
409
|
+
delimiters?: string[];
|
|
410
|
+
/** Maximum number of tags allowed. */
|
|
411
|
+
maxTags?: number;
|
|
412
|
+
/** Placeholder text when no tags are present. */
|
|
413
|
+
placeholder?: string;
|
|
414
|
+
/** Disables the input. */
|
|
415
|
+
disabled?: boolean;
|
|
416
|
+
/** Error message shown below the input. */
|
|
417
|
+
error?: string;
|
|
418
|
+
/** Helper text shown below the input. */
|
|
419
|
+
helperText?: string;
|
|
420
|
+
/** Size variant. */
|
|
421
|
+
size?: "sm" | "md" | "lg";
|
|
422
|
+
/** ID for the input element. */
|
|
423
|
+
id?: string;
|
|
424
|
+
/** Additional CSS class. */
|
|
425
|
+
className?: string;
|
|
426
|
+
}
|
|
427
|
+
/**
|
|
428
|
+
* Multi-tag input with validation and keyboard navigation.
|
|
429
|
+
*
|
|
430
|
+
* @example
|
|
431
|
+
* ```tsx
|
|
432
|
+
* <TagInput
|
|
433
|
+
* label="Tags"
|
|
434
|
+
* value={tags}
|
|
435
|
+
* onChange={setTags}
|
|
436
|
+
* placeholder="Add a tag..."
|
|
437
|
+
* maxTags={5}
|
|
438
|
+
* />
|
|
439
|
+
* ```
|
|
440
|
+
*/
|
|
441
|
+
declare const TagInput: react.ForwardRefExoticComponent<TagInputProps & react.RefAttributes<HTMLInputElement>>;
|
|
442
|
+
|
|
443
|
+
/**
|
|
444
|
+
* DatePicker — Custom calendar dropdown for date selection.
|
|
445
|
+
*
|
|
446
|
+
* Replaces native <input type="date"> with a fully styled calendar
|
|
447
|
+
* popup that respects the MCP Apps spec CSS variables. The calendar
|
|
448
|
+
* opens below the trigger input and supports month/year navigation,
|
|
449
|
+
* min/max constraints, and keyboard interaction.
|
|
450
|
+
*/
|
|
451
|
+
interface DatePickerProps {
|
|
452
|
+
/** Label displayed above the input. */
|
|
453
|
+
label?: string;
|
|
454
|
+
/** Current date value (YYYY-MM-DD string). */
|
|
455
|
+
value?: string;
|
|
456
|
+
/** Called when the user selects a date. Receives YYYY-MM-DD string. */
|
|
457
|
+
onChange?: (value: string) => void;
|
|
458
|
+
/** Minimum selectable date (YYYY-MM-DD). */
|
|
459
|
+
min?: string;
|
|
460
|
+
/** Maximum selectable date (YYYY-MM-DD). */
|
|
461
|
+
max?: string;
|
|
462
|
+
/** Placeholder text shown when no date is selected. */
|
|
463
|
+
placeholder?: string;
|
|
464
|
+
/** Helper text below the input. */
|
|
465
|
+
helperText?: string;
|
|
466
|
+
/** Error message — replaces helperText and shows error styling. */
|
|
467
|
+
error?: string;
|
|
468
|
+
/** Disables the picker. */
|
|
469
|
+
disabled?: boolean;
|
|
470
|
+
/** Additional CSS class for the outer container. */
|
|
471
|
+
className?: string;
|
|
472
|
+
/** Input id for label association. */
|
|
473
|
+
id?: string;
|
|
474
|
+
}
|
|
475
|
+
/**
|
|
476
|
+
* Custom date picker with a calendar dropdown.
|
|
477
|
+
*
|
|
478
|
+
* @example
|
|
479
|
+
* ```tsx
|
|
480
|
+
* <DatePicker label="Start date" value={date} onChange={setDate} />
|
|
481
|
+
* <DatePicker label="Birthday" min="1900-01-01" max="2010-12-31" />
|
|
482
|
+
* ```
|
|
483
|
+
*/
|
|
484
|
+
declare const DatePicker: react.ForwardRefExoticComponent<DatePickerProps & react.RefAttributes<HTMLDivElement>>;
|
|
485
|
+
|
|
486
|
+
/**
|
|
487
|
+
* DateRangePicker — Dual custom calendar dropdowns for selecting a date range.
|
|
488
|
+
*
|
|
489
|
+
* Renders two DatePicker triggers (start / end) with coordinated min/max
|
|
490
|
+
* constraints so the end date can never precede the start date.
|
|
491
|
+
* Uses the same custom calendar dropdown as DatePicker for consistent styling.
|
|
492
|
+
*/
|
|
493
|
+
interface DateRangePickerProps {
|
|
494
|
+
/** Label displayed above the picker pair. */
|
|
495
|
+
label?: string;
|
|
496
|
+
/** Start date value (YYYY-MM-DD string). */
|
|
497
|
+
startDate?: string;
|
|
498
|
+
/** End date value (YYYY-MM-DD string). */
|
|
499
|
+
endDate?: string;
|
|
500
|
+
/** Called when either date changes. */
|
|
501
|
+
onChange: (range: {
|
|
502
|
+
startDate: string;
|
|
503
|
+
endDate: string;
|
|
504
|
+
}) => void;
|
|
505
|
+
/** Minimum selectable date for the start input. */
|
|
506
|
+
min?: string;
|
|
507
|
+
/** Maximum selectable date for the end input. */
|
|
508
|
+
max?: string;
|
|
509
|
+
/** Labels for the individual inputs. */
|
|
510
|
+
startLabel?: string;
|
|
511
|
+
endLabel?: string;
|
|
512
|
+
/** Placeholder text for inputs. */
|
|
513
|
+
startPlaceholder?: string;
|
|
514
|
+
endPlaceholder?: string;
|
|
515
|
+
/** Helper text below the picker. */
|
|
516
|
+
helperText?: string;
|
|
517
|
+
/** Error message — replaces helperText and shows error styling. */
|
|
518
|
+
error?: string;
|
|
519
|
+
/** Disables both inputs. */
|
|
520
|
+
disabled?: boolean;
|
|
521
|
+
/** Additional CSS class. */
|
|
522
|
+
className?: string;
|
|
523
|
+
}
|
|
524
|
+
/**
|
|
525
|
+
* Date range picker using two coordinated DatePicker calendars.
|
|
526
|
+
*
|
|
527
|
+
* @example
|
|
528
|
+
* ```tsx
|
|
529
|
+
* <DateRangePicker
|
|
530
|
+
* label="Trip dates"
|
|
531
|
+
* startDate={range.startDate}
|
|
532
|
+
* endDate={range.endDate}
|
|
533
|
+
* onChange={setRange}
|
|
534
|
+
* />
|
|
535
|
+
* ```
|
|
536
|
+
*/
|
|
537
|
+
declare const DateRangePicker: react.ForwardRefExoticComponent<DateRangePickerProps & react.RefAttributes<HTMLDivElement>>;
|
|
538
|
+
|
|
539
|
+
interface ToggleGroupProps {
|
|
540
|
+
/** Currently selected value. */
|
|
541
|
+
value: string;
|
|
542
|
+
/** Called when a new option is selected. */
|
|
543
|
+
onChange: (value: string) => void;
|
|
544
|
+
/** Accessible label for the group. */
|
|
545
|
+
"aria-label": string;
|
|
546
|
+
/** Size variant. */
|
|
547
|
+
size?: "sm" | "md" | "lg";
|
|
548
|
+
/** Disable the entire group. */
|
|
549
|
+
disabled?: boolean;
|
|
550
|
+
/** Expand to full width with equal-width options. */
|
|
551
|
+
block?: boolean;
|
|
552
|
+
/** Fully rounded pill shape. */
|
|
553
|
+
pill?: boolean;
|
|
554
|
+
/** Additional CSS class. */
|
|
555
|
+
className?: string;
|
|
556
|
+
children: ReactNode;
|
|
557
|
+
}
|
|
558
|
+
/**
|
|
559
|
+
* Segmented toggle group with animated sliding indicator.
|
|
560
|
+
*
|
|
561
|
+
* @example
|
|
562
|
+
* ```tsx
|
|
563
|
+
* <ToggleGroup value={view} onChange={setView} aria-label="View mode">
|
|
564
|
+
* <ToggleGroup.Option value="grid">Grid</ToggleGroup.Option>
|
|
565
|
+
* <ToggleGroup.Option value="list">List</ToggleGroup.Option>
|
|
566
|
+
* </ToggleGroup>
|
|
567
|
+
* ```
|
|
568
|
+
*/
|
|
569
|
+
declare const ToggleGroup: react.ForwardRefExoticComponent<ToggleGroupProps & react.RefAttributes<HTMLDivElement>> & {
|
|
570
|
+
Option: typeof ToggleGroupOption;
|
|
571
|
+
};
|
|
572
|
+
interface ToggleGroupOptionProps {
|
|
573
|
+
/** Option value. */
|
|
574
|
+
value: string;
|
|
575
|
+
/** Disable this individual option. */
|
|
576
|
+
disabled?: boolean;
|
|
577
|
+
children: ReactNode;
|
|
578
|
+
}
|
|
579
|
+
/**
|
|
580
|
+
* A single option inside a ToggleGroup. This component exists purely
|
|
581
|
+
* for API ergonomics — the actual rendering is handled by the parent
|
|
582
|
+
* ToggleGroup which reads the Option's props.
|
|
583
|
+
*
|
|
584
|
+
* @example
|
|
585
|
+
* ```tsx
|
|
586
|
+
* <ToggleGroup.Option value="grid">Grid</ToggleGroup.Option>
|
|
587
|
+
* ```
|
|
588
|
+
*/
|
|
589
|
+
declare function ToggleGroupOption(_props: ToggleGroupOptionProps): React.ReactElement | null;
|
|
590
|
+
|
|
591
|
+
/** Visual style of the alert. */
|
|
592
|
+
type AlertVariant = "outline" | "soft" | "solid";
|
|
274
593
|
interface AlertProps extends HTMLAttributes<HTMLDivElement> {
|
|
275
|
-
/** Semantic color
|
|
276
|
-
|
|
594
|
+
/** Semantic color. */
|
|
595
|
+
color?: SemanticVariant;
|
|
596
|
+
/** Visual variant style. */
|
|
597
|
+
variant?: AlertVariant;
|
|
277
598
|
/** Bold title displayed above the body text. */
|
|
278
599
|
title?: string;
|
|
279
|
-
/** Alert body content. */
|
|
600
|
+
/** Alert body content / description. */
|
|
280
601
|
children: ReactNode;
|
|
602
|
+
/** Actions rendered on the right (or below on small widths). */
|
|
603
|
+
actions?: ReactNode;
|
|
604
|
+
/** Force actions placement — by default it auto-detects. */
|
|
605
|
+
actionsPlacement?: "end" | "bottom";
|
|
606
|
+
/** Custom indicator/icon element. Set to false to hide. */
|
|
607
|
+
indicator?: ReactNode | false;
|
|
281
608
|
/** Show a dismiss button. */
|
|
282
609
|
dismissible?: boolean;
|
|
283
610
|
/** Called when the dismiss button is clicked. */
|
|
@@ -288,12 +615,15 @@ interface AlertProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
288
615
|
*
|
|
289
616
|
* @example
|
|
290
617
|
* ```tsx
|
|
291
|
-
* <Alert
|
|
292
|
-
* <Alert
|
|
293
|
-
* <Alert
|
|
618
|
+
* <Alert color="success" title="Saved">Your changes have been saved.</Alert>
|
|
619
|
+
* <Alert color="danger" variant="solid" dismissible>Something went wrong.</Alert>
|
|
620
|
+
* <Alert color="info" variant="soft">Tip: You can drag items to reorder.</Alert>
|
|
621
|
+
* <Alert color="warning" variant="outline" actions={<Button size="sm">Retry</Button>}>
|
|
622
|
+
* Connection lost.
|
|
623
|
+
* </Alert>
|
|
294
624
|
* ```
|
|
295
625
|
*/
|
|
296
|
-
declare const Alert: ({ variant, title, children, dismissible, onDismiss, className, ...rest }: AlertProps) => react_jsx_runtime.JSX.Element | null;
|
|
626
|
+
declare const Alert: ({ color, variant, title, children, actions, actionsPlacement, indicator, dismissible, onDismiss, className, ...rest }: AlertProps) => react_jsx_runtime.JSX.Element | null;
|
|
297
627
|
|
|
298
628
|
interface BadgeProps extends HTMLAttributes<HTMLSpanElement> {
|
|
299
629
|
/** Semantic color variant. */
|
|
@@ -313,6 +643,125 @@ interface BadgeProps extends HTMLAttributes<HTMLSpanElement> {
|
|
|
313
643
|
*/
|
|
314
644
|
declare const Badge: ({ variant, children, className, ...rest }: BadgeProps) => react_jsx_runtime.JSX.Element;
|
|
315
645
|
|
|
646
|
+
interface MenuProps {
|
|
647
|
+
children: ReactNode;
|
|
648
|
+
/** Additional CSS class for the container. */
|
|
649
|
+
className?: string;
|
|
650
|
+
}
|
|
651
|
+
/**
|
|
652
|
+
* Dropdown menu container. Compose with Menu.Trigger, Menu.Content,
|
|
653
|
+
* Menu.Item, and Menu.Separator.
|
|
654
|
+
*
|
|
655
|
+
* @example
|
|
656
|
+
* ```tsx
|
|
657
|
+
* <Menu>
|
|
658
|
+
* <Menu.Trigger><Button>Open</Button></Menu.Trigger>
|
|
659
|
+
* <Menu.Content>
|
|
660
|
+
* <Menu.Item onSelect={() => console.log("Edit")}>Edit</Menu.Item>
|
|
661
|
+
* <Menu.Separator />
|
|
662
|
+
* <Menu.Item onSelect={() => console.log("Delete")} danger>Delete</Menu.Item>
|
|
663
|
+
* </Menu.Content>
|
|
664
|
+
* </Menu>
|
|
665
|
+
* ```
|
|
666
|
+
*/
|
|
667
|
+
declare const Menu: (({ children, className }: MenuProps) => react_jsx_runtime.JSX.Element) & {
|
|
668
|
+
Trigger: typeof MenuTrigger;
|
|
669
|
+
Content: typeof MenuContent;
|
|
670
|
+
Item: typeof MenuItem;
|
|
671
|
+
Separator: typeof MenuSeparator;
|
|
672
|
+
CheckboxItem: typeof MenuCheckboxItem;
|
|
673
|
+
Label: typeof MenuLabel;
|
|
674
|
+
};
|
|
675
|
+
interface MenuTriggerProps {
|
|
676
|
+
children: ReactNode;
|
|
677
|
+
/** @internal — injected by Menu. */
|
|
678
|
+
_toggle?: () => void;
|
|
679
|
+
}
|
|
680
|
+
/**
|
|
681
|
+
* Wraps the trigger element that opens the menu on click.
|
|
682
|
+
*/
|
|
683
|
+
declare function MenuTrigger({ children, _toggle }: MenuTriggerProps): react_jsx_runtime.JSX.Element;
|
|
684
|
+
interface MenuContentProps {
|
|
685
|
+
children: ReactNode;
|
|
686
|
+
/** Preferred alignment relative to the trigger. */
|
|
687
|
+
align?: "start" | "center" | "end";
|
|
688
|
+
/** Width of the menu. */
|
|
689
|
+
width?: number | string;
|
|
690
|
+
/** Minimum width. */
|
|
691
|
+
minWidth?: number | string;
|
|
692
|
+
/** Additional CSS class. */
|
|
693
|
+
className?: string;
|
|
694
|
+
}
|
|
695
|
+
/**
|
|
696
|
+
* The dropdown content panel. Only rendered when the menu is open.
|
|
697
|
+
* Uses a smooth scale+fade entry animation and an elevated surface style.
|
|
698
|
+
*/
|
|
699
|
+
declare function MenuContent({ children, align, width, minWidth, className, }: MenuContentProps): react_jsx_runtime.JSX.Element | null;
|
|
700
|
+
interface MenuItemProps {
|
|
701
|
+
children: ReactNode;
|
|
702
|
+
/** Called when the item is selected. */
|
|
703
|
+
onSelect?: () => void;
|
|
704
|
+
/** Disables the item. */
|
|
705
|
+
disabled?: boolean;
|
|
706
|
+
/** Danger styling (red text). */
|
|
707
|
+
danger?: boolean;
|
|
708
|
+
/** Additional CSS class. */
|
|
709
|
+
className?: string;
|
|
710
|
+
}
|
|
711
|
+
/**
|
|
712
|
+
* A single actionable menu item with hover highlight.
|
|
713
|
+
*/
|
|
714
|
+
declare function MenuItem({ children, onSelect, disabled, danger, className, }: MenuItemProps): react_jsx_runtime.JSX.Element;
|
|
715
|
+
interface MenuCheckboxItemProps {
|
|
716
|
+
children: ReactNode;
|
|
717
|
+
/** Whether the item is checked. */
|
|
718
|
+
checked?: boolean;
|
|
719
|
+
/** Called when the checked state changes. */
|
|
720
|
+
onCheckedChange?: (checked: boolean) => void;
|
|
721
|
+
/** Disables the item. */
|
|
722
|
+
disabled?: boolean;
|
|
723
|
+
/** Additional CSS class. */
|
|
724
|
+
className?: string;
|
|
725
|
+
}
|
|
726
|
+
/**
|
|
727
|
+
* A checkbox-style menu item that toggles a boolean state.
|
|
728
|
+
*/
|
|
729
|
+
declare function MenuCheckboxItem({ children, checked, onCheckedChange, disabled, className, }: MenuCheckboxItemProps): react_jsx_runtime.JSX.Element;
|
|
730
|
+
/**
|
|
731
|
+
* Horizontal line between menu item groups.
|
|
732
|
+
*/
|
|
733
|
+
declare function MenuSeparator(): react_jsx_runtime.JSX.Element;
|
|
734
|
+
interface MenuLabelProps {
|
|
735
|
+
children: ReactNode;
|
|
736
|
+
className?: string;
|
|
737
|
+
}
|
|
738
|
+
/**
|
|
739
|
+
* Non-interactive label/heading within a menu section.
|
|
740
|
+
*/
|
|
741
|
+
declare function MenuLabel({ children, className }: MenuLabelProps): react_jsx_runtime.JSX.Element;
|
|
742
|
+
|
|
743
|
+
interface TabsProps extends Omit<HTMLAttributes<HTMLDivElement>, "onChange"> {
|
|
744
|
+
/** Currently active tab value. */
|
|
745
|
+
value: string;
|
|
746
|
+
/** Called when a tab is clicked. */
|
|
747
|
+
onChange: (value: string) => void;
|
|
748
|
+
/** Tab items (should be Tabs.Tab elements). */
|
|
749
|
+
children: ReactNode;
|
|
750
|
+
}
|
|
751
|
+
interface TabProps {
|
|
752
|
+
/** Unique value identifying this tab. Matched against Tabs.value. */
|
|
753
|
+
value: string;
|
|
754
|
+
/** Tab label. */
|
|
755
|
+
children: ReactNode;
|
|
756
|
+
/** Disables the tab. */
|
|
757
|
+
disabled?: boolean;
|
|
758
|
+
/** Additional CSS class. */
|
|
759
|
+
className?: string;
|
|
760
|
+
}
|
|
761
|
+
declare const Tabs: react.ForwardRefExoticComponent<TabsProps & react.RefAttributes<HTMLDivElement>> & {
|
|
762
|
+
Tab: ({ value, children, disabled, className }: TabProps) => react_jsx_runtime.JSX.Element;
|
|
763
|
+
};
|
|
764
|
+
|
|
316
765
|
interface CardProps extends HTMLAttributes<HTMLDivElement> {
|
|
317
766
|
/** Visual style. "default" has border+shadow, "ghost" is borderless. */
|
|
318
767
|
variant?: "default" | "ghost";
|
|
@@ -692,4 +1141,37 @@ interface DividerProps extends HTMLAttributes<HTMLHRElement> {
|
|
|
692
1141
|
*/
|
|
693
1142
|
declare const Divider: ({ spacing, className, ...rest }: DividerProps) => react_jsx_runtime.JSX.Element;
|
|
694
1143
|
|
|
695
|
-
|
|
1144
|
+
/**
|
|
1145
|
+
* CodeBlock — Syntax-highlighted code display with copy button.
|
|
1146
|
+
*
|
|
1147
|
+
* Uses react-syntax-highlighter (PrismLight) for real syntax coloring.
|
|
1148
|
+
* Token colors are mapped to MCP Apps spec CSS variables so they adapt
|
|
1149
|
+
* to whichever host platform the app runs on.
|
|
1150
|
+
*
|
|
1151
|
+
* Languages are registered on demand — only the ones imported here are
|
|
1152
|
+
* available. The set matches the most common languages for MCP Apps.
|
|
1153
|
+
*/
|
|
1154
|
+
interface CodeBlockProps {
|
|
1155
|
+
/** Code content to display. */
|
|
1156
|
+
children: string;
|
|
1157
|
+
/** Language for syntax highlighting (e.g. "tsx", "python", "bash"). */
|
|
1158
|
+
language?: string;
|
|
1159
|
+
/** Show a copy button. */
|
|
1160
|
+
copyable?: boolean;
|
|
1161
|
+
/** Show line numbers. */
|
|
1162
|
+
showLineNumbers?: boolean;
|
|
1163
|
+
/** Additional CSS class for the outer container. */
|
|
1164
|
+
className?: string;
|
|
1165
|
+
}
|
|
1166
|
+
/**
|
|
1167
|
+
* Syntax-highlighted code block with copy functionality.
|
|
1168
|
+
*
|
|
1169
|
+
* @example
|
|
1170
|
+
* ```tsx
|
|
1171
|
+
* <CodeBlock language="bash">{`npm install open-mcp-app-ui`}</CodeBlock>
|
|
1172
|
+
* <CodeBlock language="tsx" showLineNumbers>{someCode}</CodeBlock>
|
|
1173
|
+
* ```
|
|
1174
|
+
*/
|
|
1175
|
+
declare const CodeBlock: ({ children, language, copyable, showLineNumbers, className, }: CodeBlockProps) => react_jsx_runtime.JSX.Element;
|
|
1176
|
+
|
|
1177
|
+
export { Alert, type AlertProps, type AlertVariant, AppLayout, type AppLayoutProps, Badge, type BadgeProps, Button, type ButtonProps, Card, type CardProps, Checkbox, type CheckboxProps, CodeBlock, type CodeBlockProps, DatePicker, type DatePickerProps, DateRangePicker, type DateRangePickerProps, type DisplayMode, Divider, type DividerProps, Heading, type HeadingProps, type HeadingSize, Input, type InputProps, Menu, type MenuCheckboxItemProps, type MenuContentProps, type MenuItemProps, type MenuLabelProps, type MenuProps, RadioGroup, type RadioGroupItemProps, type RadioGroupProps, Select, type SelectOption, type SelectOptionGroup, type SelectOptions, type SelectProps, type SemanticVariant, Show, type ShowProps, type Size, Slider, type SliderProps, Switch, type SwitchProps, type TabProps, Tabs, type TabsProps, type Tag, TagInput, type TagInputProps, Text, type TextProps, Textarea, type TextareaProps, ToggleGroup, type ToggleGroupOptionProps, type ToggleGroupProps, type UseDisplayModeReturn, useDisplayMode };
|