@twentyfirstmedia/elements 0.1.0 → 0.2.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 +477 -4
- package/dist/elements.d.ts +71 -1
- package/dist/elements.global.js +24 -24
- package/dist/elements.js +24 -24
- package/dist/vscode.html-custom-data.json +125 -2
- package/package.json +2 -2
package/dist/elements.d.ts
CHANGED
|
@@ -135,6 +135,19 @@ export interface UIProviderProps {
|
|
|
135
135
|
* per mode. For a fixed theme, CSS is simpler (see `themeCss`); this is for runtime brands.
|
|
136
136
|
*/
|
|
137
137
|
tokens?: ThemeValues | ThemeInput;
|
|
138
|
+
/**
|
|
139
|
+
* `"glass"` turns every top-level surface (Panel, Card, Dock, map legend and controls) and every
|
|
140
|
+
* floating layer (menus, popovers, dialogs, drawers) inside into translucent glass, for UI that
|
|
141
|
+
* floats over a map, a 3D scene, video or photos (sets `data-surface`). Single surfaces take
|
|
142
|
+
* `surface="glass"` themselves; `surface="solid"` on one opts it out.
|
|
143
|
+
*/
|
|
144
|
+
surface?: Surface;
|
|
145
|
+
/**
|
|
146
|
+
* Motion level for everything inside (sets `data-motion`): `"standard"` (default), `"expressive"`
|
|
147
|
+
* for orchestrated page entrances, or `"off"`, e.g. for a setting in your app. The reader's
|
|
148
|
+
* reduced-motion setting always turns motion off.
|
|
149
|
+
*/
|
|
150
|
+
motion?: Motion;
|
|
138
151
|
className?: string;
|
|
139
152
|
style?: CSSProperties;
|
|
140
153
|
children?: ReactNode;
|
|
@@ -292,6 +305,8 @@ export interface CardProps extends BaseProps {
|
|
|
292
305
|
onClick?: () => void;
|
|
293
306
|
children?: ReactNode;
|
|
294
307
|
eyebrow?: ReactNode;
|
|
308
|
+
/** `"glass"`: translucent glass over what is behind (maps, 3D, video, photos); `"solid"` opts out inside a glass `UIProvider`. */
|
|
309
|
+
surface?: Surface;
|
|
295
310
|
}
|
|
296
311
|
export interface EventCardProps extends BaseProps {
|
|
297
312
|
kind?: "meeting" | "deadline" | "review" | "launch" | "incident";
|
|
@@ -309,6 +324,8 @@ export interface PanelProps extends BaseProps {
|
|
|
309
324
|
subtitle?: string;
|
|
310
325
|
action?: ReactNode;
|
|
311
326
|
children?: ReactNode;
|
|
327
|
+
/** `"glass"`: translucent glass over what is behind (maps, 3D, video, photos); `"solid"` opts out inside a glass `UIProvider`. */
|
|
328
|
+
surface?: Surface;
|
|
312
329
|
}
|
|
313
330
|
export interface PageHeaderProps extends BaseProps {
|
|
314
331
|
crumbs?: string[];
|
|
@@ -343,6 +360,39 @@ export interface SideRailProps extends BaseProps {
|
|
|
343
360
|
top?: RailItem[];
|
|
344
361
|
bottom?: RailItem[];
|
|
345
362
|
}
|
|
363
|
+
export interface FloatingLayoutProps extends BaseProps {
|
|
364
|
+
/** What the UI floats over, filling the layout: a map, a 3D canvas, a video, a photo. */
|
|
365
|
+
background?: ReactNode;
|
|
366
|
+
/** Bar along the top edge (search, filters, title). */
|
|
367
|
+
top?: ReactNode;
|
|
368
|
+
/** Column on the start side (layers, lists, settings). */
|
|
369
|
+
start?: ReactNode;
|
|
370
|
+
/** Column on the end side (details of the selected thing). */
|
|
371
|
+
end?: ReactNode;
|
|
372
|
+
/** Bar along the bottom edge (dock, playback, a summary). */
|
|
373
|
+
bottom?: ReactNode;
|
|
374
|
+
/** Height of the layout (default 640). Below 720px of width the slots stack: top, start, end, bottom. */
|
|
375
|
+
height?: number | string;
|
|
376
|
+
/** Glass for every surface in the slots (default) or solid surfaces. */
|
|
377
|
+
surface?: Surface;
|
|
378
|
+
/** Accessible name of the region. */
|
|
379
|
+
label?: string;
|
|
380
|
+
children?: ReactNode;
|
|
381
|
+
}
|
|
382
|
+
export interface AmbientProps extends BaseProps {
|
|
383
|
+
/** Colours of the soft fields (any CSS colour); default the kit's `--ambient-1…4`. */
|
|
384
|
+
colors?: string[];
|
|
385
|
+
/** A photo (or, with `video`, a video) instead of the fields, under a scrim that keeps it calm. */
|
|
386
|
+
src?: string;
|
|
387
|
+
/** Treat `src` as a video (muted, looping, still with motion off). */
|
|
388
|
+
video?: boolean;
|
|
389
|
+
/** Let the fields drift slowly (default true). Still with motion off; paused off screen. */
|
|
390
|
+
animate?: boolean;
|
|
391
|
+
/** Cover the window behind the page instead of the nearest container. */
|
|
392
|
+
fixed?: boolean;
|
|
393
|
+
/** Your own layer (a canvas, WebGL, a map) instead of fields or media. */
|
|
394
|
+
children?: ReactNode;
|
|
395
|
+
}
|
|
346
396
|
export interface DockItem {
|
|
347
397
|
label: string;
|
|
348
398
|
icon: IconName;
|
|
@@ -352,6 +402,8 @@ export interface DockItem {
|
|
|
352
402
|
export interface DockProps extends BaseProps {
|
|
353
403
|
items: DockItem[];
|
|
354
404
|
label?: string;
|
|
405
|
+
/** `"glass"`: translucent glass over what is behind (maps, 3D, video, photos); `"solid"` opts out inside a glass `UIProvider`. */
|
|
406
|
+
surface?: Surface;
|
|
355
407
|
}
|
|
356
408
|
export interface TableColumn {
|
|
357
409
|
key: string;
|
|
@@ -414,7 +466,10 @@ export interface StaggerProps extends BaseProps {
|
|
|
414
466
|
as?: string;
|
|
415
467
|
className?: string;
|
|
416
468
|
style?: CSSProperties;
|
|
469
|
+
/** Extra delay before the first child, in ms. */
|
|
417
470
|
delay?: number;
|
|
471
|
+
/** Below the fold, wait until the group scrolls into view (default true). */
|
|
472
|
+
reveal?: boolean;
|
|
418
473
|
children?: ReactNode;
|
|
419
474
|
}
|
|
420
475
|
export interface CountUpProps extends BaseProps {
|
|
@@ -536,6 +591,8 @@ export interface ModalProps extends BaseProps {
|
|
|
536
591
|
onClose?: () => void;
|
|
537
592
|
style?: CSSProperties;
|
|
538
593
|
children?: ReactNode;
|
|
594
|
+
/** Optional: with `open` the component stays mounted while it animates out; without it, render it only while open. */
|
|
595
|
+
open?: boolean;
|
|
539
596
|
}
|
|
540
597
|
/** Mounts a demo page with a "Replay motion" button that re-runs every entrance. */
|
|
541
598
|
export interface SubNavItem {
|
|
@@ -560,6 +617,8 @@ export interface DrawerProps extends BaseProps, DrawerSide {
|
|
|
560
617
|
width?: number | string;
|
|
561
618
|
inline?: boolean;
|
|
562
619
|
children?: ReactNode;
|
|
620
|
+
/** Optional: with `open` the component stays mounted while it animates out; without it, render it only while open. */
|
|
621
|
+
open?: boolean;
|
|
563
622
|
}
|
|
564
623
|
export interface PaletteItem {
|
|
565
624
|
id?: string | number;
|
|
@@ -582,6 +641,8 @@ export interface CommandPaletteProps extends BaseProps {
|
|
|
582
641
|
empty?: ReactNode;
|
|
583
642
|
/** Called with the query as the user types, for searching on a server. */
|
|
584
643
|
onQueryChange?: (query: string) => void;
|
|
644
|
+
/** Optional: with `open` the component stays mounted while it animates out; without it, render it only while open. */
|
|
645
|
+
open?: boolean;
|
|
585
646
|
}
|
|
586
647
|
export interface DrawerSide {
|
|
587
648
|
/** Edge the sheet slides in from (default right). */
|
|
@@ -1919,8 +1980,11 @@ export interface MapViewProps extends BaseProps {
|
|
|
1919
1980
|
renderPopup?: (p: MapPoint) => ReactNode;
|
|
1920
1981
|
legend?: ReactNode;
|
|
1921
1982
|
controls?: ReactNode;
|
|
1922
|
-
|
|
1983
|
+
/** Height in px (default 320) or any CSS length, e.g. "100%" to fill a FloatingLayout. */
|
|
1984
|
+
height?: number | string;
|
|
1923
1985
|
label?: string;
|
|
1986
|
+
/** `"glass"`: the legend, controls and popup float as glass over the map (for a live map in `background`). */
|
|
1987
|
+
surface?: Surface;
|
|
1924
1988
|
className?: string;
|
|
1925
1989
|
}
|
|
1926
1990
|
|
|
@@ -2968,6 +3032,10 @@ export type TfTopBarElement = TfElement<TopBarProps>;
|
|
|
2968
3032
|
export type TfSideRailElement = TfElement<SideRailProps>;
|
|
2969
3033
|
/** `<tf-dock>`: The Dock component as a custom element. */
|
|
2970
3034
|
export type TfDockElement = TfElement<DockProps>;
|
|
3035
|
+
/** `<tf-floating-layout>`: UI floating over a full-bleed background: a map, a 3D scene, a video or a photo. */
|
|
3036
|
+
export type TfFloatingLayoutElement = TfElement<FloatingLayoutProps>;
|
|
3037
|
+
/** `<tf-ambient>`: A calm, living background for glass UI: soft colour fields from the kit (pastels in Halo, a faint aurora in Pro) that drift slowly, a photo or video under a scrim, or your own layer. */
|
|
3038
|
+
export type TfAmbientElement = TfElement<AmbientProps>;
|
|
2971
3039
|
/** `<tf-app-shell>`: The AppShell component as a custom element. */
|
|
2972
3040
|
export type TfAppShellElement = TfElement<AppShellProps>;
|
|
2973
3041
|
/** `<tf-chat-launcher>`: Site-wide chrome for customer-facing apps: ChatLauncher (floating assistant with page context), CookieConsent and AnnouncementBar. */
|
|
@@ -3203,6 +3271,8 @@ declare global {
|
|
|
3203
3271
|
"tf-top-bar": TfTopBarElement;
|
|
3204
3272
|
"tf-side-rail": TfSideRailElement;
|
|
3205
3273
|
"tf-dock": TfDockElement;
|
|
3274
|
+
"tf-floating-layout": TfFloatingLayoutElement;
|
|
3275
|
+
"tf-ambient": TfAmbientElement;
|
|
3206
3276
|
"tf-app-shell": TfAppShellElement;
|
|
3207
3277
|
"tf-chat-launcher": TfChatLauncherElement;
|
|
3208
3278
|
"tf-cookie-consent": TfCookieConsentElement;
|