@twentyfirstmedia/elements 0.4.0 → 0.6.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/dist/custom-elements.json +1383 -72
- package/dist/elements.d.ts +258 -19
- package/dist/elements.global.js +23 -23
- package/dist/elements.js +23 -23
- package/dist/vscode.html-custom-data.json +398 -19
- package/package.json +2 -2
package/dist/elements.d.ts
CHANGED
|
@@ -295,9 +295,21 @@ export interface SearchFieldProps extends BaseProps {
|
|
|
295
295
|
placeholder?: string;
|
|
296
296
|
/** Accessible name (default: the placeholder, or "Search"). */
|
|
297
297
|
label?: string;
|
|
298
|
+
/** The key hint, e.g. "⌘K" (hidden on touch screens). */
|
|
298
299
|
shortcut?: string;
|
|
300
|
+
/** ⌘/Ctrl + the hint's last key (K for "⌘K") focuses the field, except while typing elsewhere. */
|
|
301
|
+
bindShortcut?: boolean;
|
|
299
302
|
value?: string;
|
|
303
|
+
defaultValue?: string;
|
|
300
304
|
onChange?: (e: ChangeEvent<HTMLInputElement>) => void;
|
|
305
|
+
onKeyDown?: (e: KeyboardEvent<HTMLInputElement>) => void;
|
|
306
|
+
onFocus?: (e: FocusEvent<HTMLInputElement>) => void;
|
|
307
|
+
onBlur?: (e: FocusEvent<HTMLInputElement>) => void;
|
|
308
|
+
id?: string;
|
|
309
|
+
name?: string;
|
|
310
|
+
autoFocus?: boolean;
|
|
311
|
+
/** For a search with suggestions (combobox): role, aria-controls, aria-activedescendant … */
|
|
312
|
+
inputProps?: InputHTMLAttributes<HTMLInputElement>;
|
|
301
313
|
}
|
|
302
314
|
export interface CheckboxProps extends BaseProps {
|
|
303
315
|
name?: string;
|
|
@@ -372,7 +384,10 @@ export interface PanelProps extends BaseProps {
|
|
|
372
384
|
surface?: Surface;
|
|
373
385
|
}
|
|
374
386
|
export interface PageHeaderProps extends BaseProps {
|
|
375
|
-
|
|
387
|
+
/** A breadcrumb above the title (see `Breadcrumb`): labels, or items with `href`/`onClick`. */
|
|
388
|
+
crumbs?: (string | Crumb)[];
|
|
389
|
+
/** The element crumb links render as, e.g. Next.js `Link`. */
|
|
390
|
+
crumbLinkAs?: ElementType;
|
|
376
391
|
title: string;
|
|
377
392
|
subtitle?: string;
|
|
378
393
|
actions?: ReactNode[];
|
|
@@ -383,7 +398,8 @@ export interface NavItem {
|
|
|
383
398
|
count?: number;
|
|
384
399
|
}
|
|
385
400
|
export interface TopBarProps extends BaseProps {
|
|
386
|
-
|
|
401
|
+
/** The product name, or a node (a logo mark with the name). */
|
|
402
|
+
brand?: ReactNode;
|
|
387
403
|
tag?: string;
|
|
388
404
|
items: NavItem[];
|
|
389
405
|
active?: string;
|
|
@@ -403,6 +419,14 @@ export interface RailItem {
|
|
|
403
419
|
export interface SideRailProps extends BaseProps {
|
|
404
420
|
top?: RailItem[];
|
|
405
421
|
bottom?: RailItem[];
|
|
422
|
+
/** Names next to the icons (controlled); every button has a tooltip while collapsed. */
|
|
423
|
+
expanded?: boolean;
|
|
424
|
+
defaultExpanded?: boolean;
|
|
425
|
+
onExpandedChange?: (expanded: boolean) => void;
|
|
426
|
+
/** A button at the foot that expands and collapses the rail. */
|
|
427
|
+
toggle?: boolean;
|
|
428
|
+
/** Accessible name of the rail (default "Tools"). */
|
|
429
|
+
label?: string;
|
|
406
430
|
}
|
|
407
431
|
export interface FloatingLayoutProps extends BaseProps {
|
|
408
432
|
/** What the UI floats over, filling the layout: a map, a 3D canvas, a video, a photo. */
|
|
@@ -415,7 +439,23 @@ export interface FloatingLayoutProps extends BaseProps {
|
|
|
415
439
|
end?: ReactNode;
|
|
416
440
|
/** Bar along the bottom edge (dock, playback, a summary). */
|
|
417
441
|
bottom?: ReactNode;
|
|
418
|
-
/**
|
|
442
|
+
/** Controls of the background (zoom, compass, locate) in the free corner above the bottom bar. */
|
|
443
|
+
controls?: ReactNode;
|
|
444
|
+
/** Source notes of the background (map attribution), under `controls`, clear of every slot. */
|
|
445
|
+
attribution?: ReactNode;
|
|
446
|
+
/** Width of the start column (default 320px) and of the end column (default 340px). */
|
|
447
|
+
startWidth?: number | string;
|
|
448
|
+
endWidth?: number | string;
|
|
449
|
+
/**
|
|
450
|
+
* Below 720px of width the end slot becomes a bottom sheet over the background, with a handle
|
|
451
|
+
* that expands and collapses it (default true). `false` stacks it with the others.
|
|
452
|
+
*/
|
|
453
|
+
endSheet?: boolean;
|
|
454
|
+
/**
|
|
455
|
+
* Height of the layout (default 640). Below 720px of width the slots stack: top, start, end,
|
|
456
|
+
* bottom. The layout sets `--floating-safe-top/-start/-end/-bottom` (px) to the space its
|
|
457
|
+
* slots take, so map libraries can keep their own controls clear of them.
|
|
458
|
+
*/
|
|
419
459
|
height?: number | string;
|
|
420
460
|
/** Glass for every surface in the slots (default) or solid surfaces. */
|
|
421
461
|
surface?: Surface;
|
|
@@ -462,6 +502,11 @@ export interface TableProps extends BaseProps {
|
|
|
462
502
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- rows are app data
|
|
463
503
|
rows: Record<string, any>[];
|
|
464
504
|
animate?: boolean;
|
|
505
|
+
/**
|
|
506
|
+
* Cards instead of columns when the table's box is narrow (up to 600px): every row stacks its
|
|
507
|
+
* cells, each with its column label. Without it narrow tables scroll sideways.
|
|
508
|
+
*/
|
|
509
|
+
stack?: boolean;
|
|
465
510
|
}
|
|
466
511
|
export interface ProgressProps extends BaseProps {
|
|
467
512
|
value: number;
|
|
@@ -482,8 +527,21 @@ export interface EmptyStateProps extends BaseProps {
|
|
|
482
527
|
tint?: Tint;
|
|
483
528
|
action?: ReactNode;
|
|
484
529
|
}
|
|
530
|
+
/** A breadcrumb: a plain label, or one with an address or a handler. */
|
|
531
|
+
export interface Crumb {
|
|
532
|
+
label: string;
|
|
533
|
+
href?: string;
|
|
534
|
+
onClick?: () => void;
|
|
535
|
+
}
|
|
485
536
|
export interface BreadcrumbProps extends BaseProps {
|
|
486
|
-
|
|
537
|
+
/** The trail; the last one is the current page. Items with `href` are links, with `onClick` buttons. */
|
|
538
|
+
items: (string | Crumb)[];
|
|
539
|
+
/** The element links render as (default `a`), e.g. Next.js `Link`. */
|
|
540
|
+
linkAs?: ElementType;
|
|
541
|
+
/** Makes every crumb but the last a button; receives its index. */
|
|
542
|
+
onNavigate?: (index: number) => void;
|
|
543
|
+
/** Accessible name of the navigation (default "Breadcrumb"). */
|
|
544
|
+
label?: string;
|
|
487
545
|
}
|
|
488
546
|
export interface PaginationProps extends BaseProps {
|
|
489
547
|
/** Number of pages. */
|
|
@@ -497,10 +555,17 @@ export interface PaginationProps extends BaseProps {
|
|
|
497
555
|
defaultPage?: number;
|
|
498
556
|
/** A page was picked (previous, next or a number); receives the new 1-based page. */
|
|
499
557
|
onChange?: (page: number) => void;
|
|
558
|
+
/** Link mode for server-rendered lists: the address of a page; pages become links. */
|
|
559
|
+
href?: (page: number) => string;
|
|
560
|
+
/** The element links render as (default `a`), e.g. Next.js `Link`. */
|
|
561
|
+
linkAs?: ElementType;
|
|
562
|
+
/** Accessible name of the navigation (default "Pagination"), e.g. "Search results pages". */
|
|
563
|
+
label?: string;
|
|
500
564
|
}
|
|
501
565
|
export interface AppShellProps extends BaseProps {
|
|
502
566
|
active?: string;
|
|
503
|
-
|
|
567
|
+
/** The product name, or a node (a logo mark with the name; collapsed sidebars show it whole). */
|
|
568
|
+
brand?: ReactNode;
|
|
504
569
|
tag?: string;
|
|
505
570
|
nav?: NavItem[];
|
|
506
571
|
user?: { name: string; email?: string };
|
|
@@ -513,6 +578,19 @@ export interface AppShellProps extends BaseProps {
|
|
|
513
578
|
dockItems?: DockProps["items"];
|
|
514
579
|
railTop?: RailItem[];
|
|
515
580
|
railBottom?: RailItem[];
|
|
581
|
+
/**
|
|
582
|
+
* `top` (default): navigation in the top bar, tools in the side rail. `sidebar`: a labelled
|
|
583
|
+
* sidebar on the frame, with groups, nesting and a drawer on phones.
|
|
584
|
+
*/
|
|
585
|
+
navigation?: "top" | "sidebar";
|
|
586
|
+
/** With `navigation="sidebar"`: groups instead of the flat `nav` list. */
|
|
587
|
+
sidebarGroups?: SidebarGroup[];
|
|
588
|
+
/** With `navigation="sidebar"`: more sidebar props (collapsed, storageKey, shortcut, linkAs …). */
|
|
589
|
+
sidebar?: Partial<Omit<SidebarProps, "variant" | "groups">>;
|
|
590
|
+
/** With `navigation="sidebar"`: the workspace switcher at the top instead of the brand. */
|
|
591
|
+
workspaces?: WorkspaceSwitcherProps;
|
|
592
|
+
/** The account menu's entries (with `navigation="sidebar"` at the foot of the sidebar). */
|
|
593
|
+
userMenu?: (MenuItem | "-")[];
|
|
516
594
|
children?: ReactNode;
|
|
517
595
|
}
|
|
518
596
|
export interface StaggerProps extends BaseProps {
|
|
@@ -530,6 +608,8 @@ export interface CountUpProps extends BaseProps {
|
|
|
530
608
|
duration?: number;
|
|
531
609
|
delay?: number;
|
|
532
610
|
className?: string;
|
|
611
|
+
/** `false`: show the value without counting (it is always the value on the server). */
|
|
612
|
+
animate?: boolean;
|
|
533
613
|
}
|
|
534
614
|
export interface ListRowProps extends BaseProps {
|
|
535
615
|
avatar?: string;
|
|
@@ -543,6 +623,18 @@ export interface ListRowProps extends BaseProps {
|
|
|
543
623
|
unread?: boolean;
|
|
544
624
|
active?: boolean;
|
|
545
625
|
onClick?: () => void;
|
|
626
|
+
/** Makes the row a link (with `linkAs` for a router's link). */
|
|
627
|
+
href?: string;
|
|
628
|
+
linkAs?: ElementType;
|
|
629
|
+
/**
|
|
630
|
+
* Buttons of the row's own (rename, remove …), outside the clickable area so nothing interactive
|
|
631
|
+
* is nested. Without `onClick` and `href` the row is not interactive at all.
|
|
632
|
+
*/
|
|
633
|
+
actions?: ReactNode;
|
|
634
|
+
/** Lines the title may take before it ends in an ellipsis (default: it wraps freely). */
|
|
635
|
+
titleLines?: number;
|
|
636
|
+
/** Lines the subtitle may take (default 1); badges and facts wrap within them. */
|
|
637
|
+
subtitleLines?: number;
|
|
546
638
|
}
|
|
547
639
|
export interface TimelineProps extends BaseProps {
|
|
548
640
|
items: {
|
|
@@ -831,6 +923,14 @@ export interface TextFieldProps extends Omit<FormFieldProps, "children"> {
|
|
|
831
923
|
inputMode?: "none" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | "search";
|
|
832
924
|
onChange?: (e: ChangeEvent<HTMLInputElement>) => void;
|
|
833
925
|
onBlur?: (e: ChangeEvent<HTMLInputElement>) => void;
|
|
926
|
+
onKeyDown?: (e: KeyboardEvent<HTMLInputElement>) => void;
|
|
927
|
+
/**
|
|
928
|
+
* An interactive control at the end of the field (an `IconButton`: clear, copy, locate …). Unlike
|
|
929
|
+
* `suffix` it can be clicked, and it stays when the field shows an error or success mark.
|
|
930
|
+
*/
|
|
931
|
+
action?: ReactNode;
|
|
932
|
+
/** For `type="password"`: a button that shows and hides the password (default true). */
|
|
933
|
+
reveal?: boolean;
|
|
834
934
|
}
|
|
835
935
|
export interface RadioGroupProps extends BaseProps {
|
|
836
936
|
label?: string;
|
|
@@ -924,10 +1024,18 @@ export interface SliderProps extends BaseProps {
|
|
|
924
1024
|
marks?: boolean;
|
|
925
1025
|
hint?: string;
|
|
926
1026
|
}
|
|
1027
|
+
export interface OtpInputHandle {
|
|
1028
|
+
/** Empties every cell and focuses the first. */
|
|
1029
|
+
reset: () => void;
|
|
1030
|
+
}
|
|
927
1031
|
export interface OtpInputProps extends BaseProps {
|
|
928
1032
|
length?: number;
|
|
929
1033
|
onComplete?: (code: string) => void;
|
|
930
1034
|
error?: boolean;
|
|
1035
|
+
/** Empties the cells when `error` turns on, ready for the next try (default true). */
|
|
1036
|
+
clearOnError?: boolean;
|
|
1037
|
+
/** `ref.current.reset()` empties the cells on demand. */
|
|
1038
|
+
ref?: Ref<OtpInputHandle>;
|
|
931
1039
|
label?: string;
|
|
932
1040
|
}
|
|
933
1041
|
export interface UploadFile {
|
|
@@ -947,9 +1055,10 @@ export interface FileDropProps extends BaseProps {
|
|
|
947
1055
|
/**
|
|
948
1056
|
* The person picked or dropped files: the real `File` objects, after `accept` and `multiple`.
|
|
949
1057
|
* Upload them yourself. To show progress, control `files` and set each `progress`; an
|
|
950
|
-
* uncontrolled list shows them with their size only.
|
|
1058
|
+
* uncontrolled list shows them with their size only. Return `false` to list none of them, or
|
|
1059
|
+
* the files to list (for example after checking their size).
|
|
951
1060
|
*/
|
|
952
|
-
onFiles?: (files: File[]) => void;
|
|
1061
|
+
onFiles?: (files: File[]) => void | boolean | File[];
|
|
953
1062
|
/** Dropped files that do not match `accept` (show an inline Alert). */
|
|
954
1063
|
onReject?: (files: File[]) => void;
|
|
955
1064
|
/** A listed file was removed or its upload cancelled. */
|
|
@@ -964,6 +1073,10 @@ export interface FileDropProps extends BaseProps {
|
|
|
964
1073
|
/** Accepted types, as for `<input type="file">` ("image/*,.pdf"); also checked on drop. */
|
|
965
1074
|
accept?: string;
|
|
966
1075
|
multiple?: boolean;
|
|
1076
|
+
/** No picking or dropping; the list stays visible. */
|
|
1077
|
+
disabled?: boolean;
|
|
1078
|
+
/** Takes part in a surrounding form under this name: the listed files are submitted with it. */
|
|
1079
|
+
name?: string;
|
|
967
1080
|
}
|
|
968
1081
|
export interface TooltipProps extends BaseProps {
|
|
969
1082
|
label: ReactNode;
|
|
@@ -1120,6 +1233,8 @@ export interface LegendProps extends BaseProps {
|
|
|
1120
1233
|
/* ── Kit 3: AI chat & agents ── */
|
|
1121
1234
|
export interface Source {
|
|
1122
1235
|
title: string;
|
|
1236
|
+
/** More about the source in a tooltip: dataset, publisher, date ("Stand") … */
|
|
1237
|
+
detail?: ReactNode;
|
|
1123
1238
|
icon?: IconName;
|
|
1124
1239
|
url?: string;
|
|
1125
1240
|
onClick?: () => void;
|
|
@@ -1333,6 +1448,11 @@ export interface CheckoutStepsProps extends BaseProps {
|
|
|
1333
1448
|
steps?: string[];
|
|
1334
1449
|
current?: number;
|
|
1335
1450
|
onPick?: (i: number) => void;
|
|
1451
|
+
/**
|
|
1452
|
+
* Numbers only, with the label of the current step (screen readers still hear every label).
|
|
1453
|
+
* Narrow containers (up to 560px) get this on their own.
|
|
1454
|
+
*/
|
|
1455
|
+
compact?: boolean;
|
|
1336
1456
|
}
|
|
1337
1457
|
export interface OrderTimelineProps extends BaseProps {
|
|
1338
1458
|
status: "Placed" | "Paid" | "Packed" | "Shipped" | "Delivered" | "Refunded" | "Cancelled";
|
|
@@ -1341,7 +1461,15 @@ export interface OrderTimelineProps extends BaseProps {
|
|
|
1341
1461
|
export interface PlanCardProps extends BaseProps {
|
|
1342
1462
|
name: string;
|
|
1343
1463
|
text?: string;
|
|
1344
|
-
|
|
1464
|
+
/**
|
|
1465
|
+
* A number is formatted as money (0 = "Free", null = "Let's talk"); any other node is shown as
|
|
1466
|
+
* it is, e.g. a placeholder ("—") or a price the app formatted itself.
|
|
1467
|
+
*/
|
|
1468
|
+
price: number | null | ReactNode;
|
|
1469
|
+
/** Before the price, e.g. "from". */
|
|
1470
|
+
pricePrefix?: ReactNode;
|
|
1471
|
+
/** Under the price: net or gross, billed yearly, VAT note … */
|
|
1472
|
+
priceNote?: ReactNode;
|
|
1345
1473
|
was?: number;
|
|
1346
1474
|
per?: string;
|
|
1347
1475
|
features?: string[];
|
|
@@ -1352,6 +1480,9 @@ export interface PlanCardProps extends BaseProps {
|
|
|
1352
1480
|
/** Disable the button, e.g. while a checkout starts or when the plan cannot be picked. */
|
|
1353
1481
|
disabled?: boolean;
|
|
1354
1482
|
onPick?: () => void;
|
|
1483
|
+
/** The action as a link (checkout or sign-up page), with `linkAs` for a router's link. */
|
|
1484
|
+
href?: string;
|
|
1485
|
+
linkAs?: ElementType;
|
|
1355
1486
|
}
|
|
1356
1487
|
|
|
1357
1488
|
/* ── Kit 3: system screens ── */
|
|
@@ -2043,6 +2174,8 @@ export interface TilePickerProps extends BaseProps {
|
|
|
2043
2174
|
multiple?: boolean;
|
|
2044
2175
|
min?: number;
|
|
2045
2176
|
label?: string;
|
|
2177
|
+
/** `list`: one compact row per option (small picture or icon beside the label), e.g. on phones. */
|
|
2178
|
+
layout?: "grid" | "list";
|
|
2046
2179
|
}
|
|
2047
2180
|
export interface ColorFieldProps extends BaseProps {
|
|
2048
2181
|
label?: ReactNode;
|
|
@@ -2292,6 +2425,8 @@ export interface WorkspaceSwitcherProps extends BaseProps {
|
|
|
2292
2425
|
footer?: ReactNode;
|
|
2293
2426
|
variant?: "frame";
|
|
2294
2427
|
width?: number;
|
|
2428
|
+
/** Only the workspace's mark, its name as the accessible name (a collapsed sidebar). */
|
|
2429
|
+
compact?: boolean;
|
|
2295
2430
|
}
|
|
2296
2431
|
export interface ExportDialogProps extends BaseProps {
|
|
2297
2432
|
open?: boolean;
|
|
@@ -2316,6 +2451,12 @@ export interface ExportDialogProps extends BaseProps {
|
|
|
2316
2451
|
}
|
|
2317
2452
|
export interface TwoFactorSetupProps extends BaseProps {
|
|
2318
2453
|
qr?: ReactNode;
|
|
2454
|
+
/** The otpauth:// link: the kit draws its QR code (instead of `qr`). */
|
|
2455
|
+
qrValue?: string;
|
|
2456
|
+
/** A "Trust this device" checkbox under the code field; a string replaces its label. */
|
|
2457
|
+
trustDevice?: boolean | string;
|
|
2458
|
+
/** The trust checkbox changed. */
|
|
2459
|
+
onTrustChange?: (trusted: boolean) => void;
|
|
2319
2460
|
secret: string;
|
|
2320
2461
|
onVerify?: (code: string) => boolean | Promise<boolean>;
|
|
2321
2462
|
codes?: string[];
|
|
@@ -2372,7 +2513,13 @@ export interface GalleryProps extends BaseProps {
|
|
|
2372
2513
|
loading?: "lazy" | "eager";
|
|
2373
2514
|
/** `referrerPolicy` of every image, e.g. `"no-referrer"` for photos from other hosts. */
|
|
2374
2515
|
referrerPolicy?: ImageReferrerPolicy;
|
|
2516
|
+
/** First image when uncontrolled. */
|
|
2375
2517
|
start?: number;
|
|
2518
|
+
/** The shown image (controlled, 0-based), with `onIndexChange`. */
|
|
2519
|
+
index?: number;
|
|
2520
|
+
onIndexChange?: (index: number) => void;
|
|
2521
|
+
/** Accessible name of the gallery (default "Images"), e.g. the listing's title. */
|
|
2522
|
+
label?: string;
|
|
2376
2523
|
ratio?: string;
|
|
2377
2524
|
thumbs?: boolean;
|
|
2378
2525
|
fullscreen?: boolean;
|
|
@@ -2514,13 +2661,21 @@ export interface CookieConsentProps extends BaseProps {
|
|
|
2514
2661
|
categories?: {
|
|
2515
2662
|
id: string;
|
|
2516
2663
|
label: string;
|
|
2517
|
-
|
|
2664
|
+
/** What the category covers; may hold a link to the details. */
|
|
2665
|
+
text?: ReactNode;
|
|
2518
2666
|
required?: boolean;
|
|
2519
2667
|
default?: boolean;
|
|
2520
2668
|
}[];
|
|
2521
2669
|
onSave?: (choices: Record<string, boolean>) => void;
|
|
2522
2670
|
open?: boolean;
|
|
2523
2671
|
inline?: boolean;
|
|
2672
|
+
/**
|
|
2673
|
+
* "Only necessary" and "Accept all" with the same weight (both secondary buttons), as German
|
|
2674
|
+
* data protection authorities expect on the first layer.
|
|
2675
|
+
*/
|
|
2676
|
+
equalChoice?: boolean;
|
|
2677
|
+
/** Id of the banner (its text is referenced by `aria-describedby`). */
|
|
2678
|
+
id?: string;
|
|
2524
2679
|
}
|
|
2525
2680
|
export interface AnnouncementBarProps extends BaseProps {
|
|
2526
2681
|
children: ReactNode;
|
|
@@ -2590,6 +2745,8 @@ export interface ToggleGroupProps extends BaseProps {
|
|
|
2590
2745
|
/** Accessible name of the group. */
|
|
2591
2746
|
label: string;
|
|
2592
2747
|
size?: "sm" | "md";
|
|
2748
|
+
/** Fills the width and shares it evenly; labels end in an ellipsis when space runs short. */
|
|
2749
|
+
block?: boolean;
|
|
2593
2750
|
}
|
|
2594
2751
|
export interface ButtonGroupProps extends BaseProps {
|
|
2595
2752
|
/** Accessible name of the group. */
|
|
@@ -2673,6 +2830,8 @@ export interface SelectMenuProps extends FieldProps, BaseProps {
|
|
|
2673
2830
|
onChange?: (value: string) => void;
|
|
2674
2831
|
placeholder?: string;
|
|
2675
2832
|
disabled?: boolean;
|
|
2833
|
+
/** `sm`: a compact trigger, e.g. a sort menu next to a heading. */
|
|
2834
|
+
size?: "sm" | "md";
|
|
2676
2835
|
}
|
|
2677
2836
|
|
|
2678
2837
|
/* ── Navigation ── */
|
|
@@ -2709,31 +2868,91 @@ export interface NavigationMenuProps extends BaseProps {
|
|
|
2709
2868
|
export interface SidebarItem {
|
|
2710
2869
|
id?: string;
|
|
2711
2870
|
label: string;
|
|
2712
|
-
|
|
2871
|
+
/** Required for pages; options in a filter group usually go without. */
|
|
2872
|
+
icon?: IconName;
|
|
2713
2873
|
count?: number;
|
|
2714
|
-
/**
|
|
2874
|
+
/** A small marker instead of a number: `"dot"` for new activity, or a short word such as "New". */
|
|
2875
|
+
badge?: string;
|
|
2876
|
+
/** Renders the item as a link to this address (with `linkAs` for a router's link, e.g. Next.js `Link`). */
|
|
2877
|
+
href?: string;
|
|
2878
|
+
/** Opens `href` in a new tab and says so. */
|
|
2879
|
+
external?: boolean;
|
|
2880
|
+
disabled?: boolean;
|
|
2881
|
+
/** A menu behind a "…" button on the item (rename, share, remove …). */
|
|
2882
|
+
actions?: (MenuItem | "-")[];
|
|
2883
|
+
/** One level of nested pages, shown when the item is open (as a flyout when the sidebar is collapsed). */
|
|
2715
2884
|
items?: Omit<SidebarItem, "items">[];
|
|
2885
|
+
/**
|
|
2886
|
+
* Makes the item a filter option: a checkbox (or a radio in a group with `select: "single"`)
|
|
2887
|
+
* with its label and `count`, instead of a page.
|
|
2888
|
+
*/
|
|
2889
|
+
checked?: boolean;
|
|
2890
|
+
onCheckedChange?: (checked: boolean) => void;
|
|
2716
2891
|
}
|
|
2717
2892
|
export interface SidebarGroup {
|
|
2893
|
+
id?: string;
|
|
2718
2894
|
label?: string;
|
|
2719
|
-
items
|
|
2895
|
+
items?: SidebarItem[];
|
|
2896
|
+
/** Any content instead of (or after) the items: a `RangeSlider`, `DateRangePicker`, chips … */
|
|
2897
|
+
content?: ReactNode;
|
|
2898
|
+
/** For filter options (items with `checked`): `single` makes them radios (one choice per group). */
|
|
2899
|
+
select?: "multiple" | "single";
|
|
2900
|
+
/** The label folds the group open and shut. */
|
|
2901
|
+
collapsible?: boolean;
|
|
2902
|
+
/** For a collapsible group: starts open (default true). */
|
|
2903
|
+
defaultOpen?: boolean;
|
|
2904
|
+
/** A small button next to the label, e.g. "+" to add a project. */
|
|
2905
|
+
action?: { label: string; icon?: IconName; onClick?: () => void };
|
|
2720
2906
|
}
|
|
2721
2907
|
export interface SidebarProps extends BaseProps {
|
|
2722
2908
|
groups: SidebarGroup[];
|
|
2723
2909
|
/** Id (or label) of the current page. */
|
|
2724
2910
|
current?: string;
|
|
2725
2911
|
onPick?: (id: string) => void;
|
|
2912
|
+
/**
|
|
2913
|
+
* `floating` (default): a card with rounded corners and a shadow. `attached`: full height, flush
|
|
2914
|
+
* with the edge of the screen, divided by a line. `shell`: on the dark frame of `AppShell`.
|
|
2915
|
+
*/
|
|
2916
|
+
variant?: "floating" | "attached" | "shell";
|
|
2726
2917
|
/** Icons only. */
|
|
2727
2918
|
collapsed?: boolean;
|
|
2728
2919
|
defaultCollapsed?: boolean;
|
|
2729
2920
|
onCollapsedChange?: (collapsed: boolean) => void;
|
|
2730
|
-
/**
|
|
2731
|
-
|
|
2732
|
-
/**
|
|
2733
|
-
|
|
2734
|
-
/**
|
|
2921
|
+
/** Remember the collapsed state in the browser under this key. */
|
|
2922
|
+
storageKey?: string;
|
|
2923
|
+
/** ⌘B (Ctrl+B) collapses and expands the sidebar, except while typing in a field. */
|
|
2924
|
+
shortcut?: boolean;
|
|
2925
|
+
/** The element items with an `href` render as (default `a`), e.g. Next.js `Link`. */
|
|
2926
|
+
linkAs?: ElementType;
|
|
2927
|
+
/** On phones (up to 760px wide): whether the drawer is open (controlled). */
|
|
2928
|
+
mobileOpen?: boolean;
|
|
2929
|
+
onMobileOpenChange?: (open: boolean) => void;
|
|
2930
|
+
/** Top of the sidebar (brand, `WorkspaceSwitcher`); a function gets the collapsed state. */
|
|
2931
|
+
header?: ReactNode | ((state: { collapsed: boolean }) => ReactNode);
|
|
2932
|
+
/** Bottom of the sidebar (`UserMenu`, settings); a function gets the collapsed state. */
|
|
2933
|
+
footer?: ReactNode | ((state: { collapsed: boolean }) => ReactNode);
|
|
2934
|
+
/**
|
|
2935
|
+
* `nav` (default) for app navigation. `aside` for filters, settings or other tools beside the
|
|
2936
|
+
* content: a complementary region instead of a navigation landmark.
|
|
2937
|
+
*/
|
|
2938
|
+
as?: "nav" | "aside";
|
|
2939
|
+
/** Offers the collapse button and the icons-only mode (default true; filters usually set false). */
|
|
2940
|
+
collapsible?: boolean;
|
|
2941
|
+
/** Accessible name of the navigation (or the aside). */
|
|
2735
2942
|
label?: string;
|
|
2736
2943
|
}
|
|
2944
|
+
export interface UserMenuProps extends BaseProps {
|
|
2945
|
+
name: string;
|
|
2946
|
+
email?: string;
|
|
2947
|
+
/** Picture URL; initials otherwise. */
|
|
2948
|
+
avatar?: string;
|
|
2949
|
+
/** The menu: profile, settings, sign out … */
|
|
2950
|
+
items?: (MenuItem | "-")[];
|
|
2951
|
+
/** Only the avatar (a collapsed sidebar). */
|
|
2952
|
+
compact?: boolean;
|
|
2953
|
+
/** Where the menu opens (default `top`, for the foot of a sidebar). */
|
|
2954
|
+
side?: "top" | "bottom";
|
|
2955
|
+
}
|
|
2737
2956
|
|
|
2738
2957
|
/* ── ResizablePanels ── */
|
|
2739
2958
|
export interface ResizablePanelsProps extends BaseProps {
|
|
@@ -2749,6 +2968,20 @@ export interface ResizablePanelsProps extends BaseProps {
|
|
|
2749
2968
|
labels?: string[];
|
|
2750
2969
|
}
|
|
2751
2970
|
|
|
2971
|
+
/* ── QrCode ── */
|
|
2972
|
+
export interface QrCodeProps extends BaseProps {
|
|
2973
|
+
/** The text to encode: an otpauth:// link, a URL … */
|
|
2974
|
+
value: string;
|
|
2975
|
+
/** Error correction: L, M (default), Q or H. */
|
|
2976
|
+
level?: "L" | "M" | "Q" | "H";
|
|
2977
|
+
/** Width and height (default: the width of its container). */
|
|
2978
|
+
size?: number | string;
|
|
2979
|
+
/** Light modules around the code (default 4, the standard quiet zone). */
|
|
2980
|
+
quiet?: number;
|
|
2981
|
+
/** Accessible name (default "QR code"). */
|
|
2982
|
+
label?: string;
|
|
2983
|
+
}
|
|
2984
|
+
|
|
2752
2985
|
export interface IconProps {
|
|
2753
2986
|
name: IconName;
|
|
2754
2987
|
/** Pixel size (default 16; 14 in chips and badges, 20 in navigation). */
|
|
@@ -2810,6 +3043,8 @@ export type TfExportDialogElement = TfElement<ExportDialogProps>;
|
|
|
2810
3043
|
export type TfTwoFactorSetupElement = TfElement<TwoFactorSetupProps>;
|
|
2811
3044
|
/** `<tf-color-field>`: The ColorField component as a custom element. */
|
|
2812
3045
|
export type TfColorFieldElement = TfElement<ColorFieldProps>;
|
|
3046
|
+
/** `<tf-qr-code>`: A QR code drawn as SVG and encoded on the device, so the text (a sign-in secret, an invite link) never goes to a service. */
|
|
3047
|
+
export type TfQrCodeElement = TfElement<QrCodeProps>;
|
|
2813
3048
|
/** `<tf-agent-card>`: One agent at a glance (AgentCard) and everything about it beside a chat (AgentDetails). */
|
|
2814
3049
|
export type TfAgentCardElement = TfElement<AgentCardProps>;
|
|
2815
3050
|
/** `<tf-agent-details>`: The AgentDetails component as a custom element. */
|
|
@@ -2897,7 +3132,7 @@ export type TfRichTextElement = TfElement<RichTextProps>;
|
|
|
2897
3132
|
/** `<tf-code-block>`: The CodeBlock component as a custom element. */
|
|
2898
3133
|
export type TfCodeBlockElement = TfElement<CodeBlockProps>;
|
|
2899
3134
|
/** `<tf-typing-dots>`: The TypingDots component as a custom element. */
|
|
2900
|
-
export type TfTypingDotsElement = TfElement<{
|
|
3135
|
+
export type TfTypingDotsElement = TfElement<{}>;
|
|
2901
3136
|
/** `<tf-agent-mark>`: The AgentMark component as a custom element. */
|
|
2902
3137
|
export type TfAgentMarkElement = TfElement<AgentMarkProps>;
|
|
2903
3138
|
/** `<tf-chat-message>`: One turn in a conversation with an agent: user bubble on the right, agent reply as rich text on the left. */
|
|
@@ -3086,8 +3321,10 @@ export type TfPaginationElement = TfElement<PaginationProps>;
|
|
|
3086
3321
|
export type TfMenubarElement = TfElement<MenubarProps>;
|
|
3087
3322
|
/** `<tf-navigation-menu>`: Site navigation for marketing pages: plain links and items that open a panel of links with icons and descriptions, optionally with a highlighted card. */
|
|
3088
3323
|
export type TfNavigationMenuElement = TfElement<NavigationMenuProps>;
|
|
3089
|
-
/** `<tf-sidebar>`: App navigation down the side: groups with headings, counts, one level of nested pages and a collapsed mode with icons only. */
|
|
3324
|
+
/** `<tf-sidebar>`: App navigation down the side: groups with headings, counts and badges, one level of nested pages, links, item menus and a collapsed mode with icons only. */
|
|
3090
3325
|
export type TfSidebarElement = TfElement<SidebarProps>;
|
|
3326
|
+
/** `<tf-user-menu>`: The signed-in account at the foot of a sidebar: avatar, name and email, opening a menu with profile, settings and sign-out. */
|
|
3327
|
+
export type TfUserMenuElement = TfElement<UserMenuProps>;
|
|
3091
3328
|
/** `<tf-connection-card>`: Connected services and the live connection: ConnectionCard and ConnectionBanner. */
|
|
3092
3329
|
export type TfConnectionCardElement = TfElement<ConnectionCardProps>;
|
|
3093
3330
|
/** `<tf-connection-banner>`: The ConnectionBanner component as a custom element. */
|
|
@@ -3221,6 +3458,7 @@ declare global {
|
|
|
3221
3458
|
"tf-export-dialog": TfExportDialogElement;
|
|
3222
3459
|
"tf-two-factor-setup": TfTwoFactorSetupElement;
|
|
3223
3460
|
"tf-color-field": TfColorFieldElement;
|
|
3461
|
+
"tf-qr-code": TfQrCodeElement;
|
|
3224
3462
|
"tf-agent-card": TfAgentCardElement;
|
|
3225
3463
|
"tf-agent-details": TfAgentDetailsElement;
|
|
3226
3464
|
"tf-chat-list": TfChatListElement;
|
|
@@ -3360,6 +3598,7 @@ declare global {
|
|
|
3360
3598
|
"tf-menubar": TfMenubarElement;
|
|
3361
3599
|
"tf-navigation-menu": TfNavigationMenuElement;
|
|
3362
3600
|
"tf-sidebar": TfSidebarElement;
|
|
3601
|
+
"tf-user-menu": TfUserMenuElement;
|
|
3363
3602
|
"tf-connection-card": TfConnectionCardElement;
|
|
3364
3603
|
"tf-connection-banner": TfConnectionBannerElement;
|
|
3365
3604
|
"tf-server-card": TfServerCardElement;
|