@twentyfirstmedia/elements 0.7.0 → 0.8.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/ICONS-LICENSE +250 -0
- package/dist/custom-elements.json +1966 -0
- package/dist/elements.d.ts +319 -0
- package/dist/elements.global.js +23 -23
- package/dist/elements.js +23 -23
- package/dist/vscode.html-custom-data.json +640 -0
- package/package.json +4 -3
package/dist/elements.d.ts
CHANGED
|
@@ -3138,6 +3138,10 @@ export interface ConsentScope {
|
|
|
3138
3138
|
granted: boolean;
|
|
3139
3139
|
/** Needed for the connection to work at all: shown, not switchable. */
|
|
3140
3140
|
required?: boolean;
|
|
3141
|
+
/** What the permission allows: reading, acting (sending, booking, switching) or moving money. */
|
|
3142
|
+
level?: "read" | "act" | "money";
|
|
3143
|
+
/** The assistant asks you before it uses this permission. */
|
|
3144
|
+
asksFirst?: boolean;
|
|
3141
3145
|
}
|
|
3142
3146
|
export interface ConsentConnector {
|
|
3143
3147
|
id: string;
|
|
@@ -3304,6 +3308,282 @@ export interface DocumentListProps extends BaseProps {
|
|
|
3304
3308
|
label?: string;
|
|
3305
3309
|
}
|
|
3306
3310
|
|
|
3311
|
+
/* ── Connectors: services an assistant reads from and acts in ── */
|
|
3312
|
+
/** The state of a connected service. */
|
|
3313
|
+
export type ServiceState = "connected" | "syncing" | "error" | "paused" | "off";
|
|
3314
|
+
export interface ServiceMarkProps extends BaseProps {
|
|
3315
|
+
/** The service's name: the accessible name, and the monogram when there is no icon or logo. */
|
|
3316
|
+
name: string;
|
|
3317
|
+
/** A brand logo (`brandGmail` …) or a line icon. */
|
|
3318
|
+
icon?: IconName;
|
|
3319
|
+
/** Your own logo (an `<img>` or `<svg>`) instead of the icon. */
|
|
3320
|
+
logo?: ReactNode;
|
|
3321
|
+
/** Letters for the monogram (default: the initials of `name`). */
|
|
3322
|
+
monogram?: string;
|
|
3323
|
+
/** 24, 36 (default) or 48 px. */
|
|
3324
|
+
size?: "sm" | "md" | "lg";
|
|
3325
|
+
tint?: Tint | "plain";
|
|
3326
|
+
/** A dot in the corner with the state in words for screen readers. */
|
|
3327
|
+
status?: ServiceState;
|
|
3328
|
+
/** Hidden from screen readers when the name is written next to it. */
|
|
3329
|
+
decorative?: boolean;
|
|
3330
|
+
}
|
|
3331
|
+
export interface Connector {
|
|
3332
|
+
id: string;
|
|
3333
|
+
name: string;
|
|
3334
|
+
icon?: IconName;
|
|
3335
|
+
logo?: ReactNode;
|
|
3336
|
+
/** Letters shown when there is neither icon nor logo (default: the initials of `name`). */
|
|
3337
|
+
monogram?: string;
|
|
3338
|
+
tint?: Tint | "plain";
|
|
3339
|
+
/** The group it is listed under ("Health & fitness", "Money" …). */
|
|
3340
|
+
category: string;
|
|
3341
|
+
description?: ReactNode;
|
|
3342
|
+
/** `available` (default), `connected`, `error` (needs a reconnect) or `soon`. */
|
|
3343
|
+
state?: "available" | "connected" | "error" | "soon";
|
|
3344
|
+
/** A hint under the description: "Needs the iPhone app", "Import an export file". */
|
|
3345
|
+
note?: ReactNode;
|
|
3346
|
+
/** The connected account ("mara@gmail.com"). */
|
|
3347
|
+
account?: string;
|
|
3348
|
+
}
|
|
3349
|
+
export interface ConnectorGalleryProps extends BaseProps {
|
|
3350
|
+
connectors: Connector[];
|
|
3351
|
+
/** Order of the groups; categories not listed follow in the order they appear. */
|
|
3352
|
+
categories?: string[];
|
|
3353
|
+
onConnect?: (id: string) => void;
|
|
3354
|
+
/** Opens a connected (or failing) connector. */
|
|
3355
|
+
onOpen?: (id: string) => void;
|
|
3356
|
+
/** A search field and category chips above the grid (default true). */
|
|
3357
|
+
filters?: boolean;
|
|
3358
|
+
/** Accessible name (default "Connectors"). */
|
|
3359
|
+
label?: string;
|
|
3360
|
+
}
|
|
3361
|
+
export interface SyncStatusProps extends BaseProps {
|
|
3362
|
+
state: "synced" | "syncing" | "error" | "paused" | "never";
|
|
3363
|
+
/** The last successful sync. */
|
|
3364
|
+
last?: Date | string | number;
|
|
3365
|
+
/** The next planned sync. */
|
|
3366
|
+
next?: Date | string | number;
|
|
3367
|
+
/** "Now" for the relative times; pass it so server and client render the same. */
|
|
3368
|
+
now?: Date | string | number;
|
|
3369
|
+
/** What the last sync brought: `{ label: "emails", value: 1204 }`. */
|
|
3370
|
+
counts?: { label: string; value: number }[];
|
|
3371
|
+
/** Why the sync failed. */
|
|
3372
|
+
error?: ReactNode;
|
|
3373
|
+
onSync?: () => void;
|
|
3374
|
+
/** One line: state and time only. */
|
|
3375
|
+
compact?: boolean;
|
|
3376
|
+
}
|
|
3377
|
+
export interface AgentAction {
|
|
3378
|
+
id: string;
|
|
3379
|
+
/** The service the action used. */
|
|
3380
|
+
service?: { name: string; icon?: IconName; logo?: ReactNode };
|
|
3381
|
+
/** Which agent did it ("Assistant", "Money agent"). */
|
|
3382
|
+
agent?: string;
|
|
3383
|
+
/** What happened, in a sentence: "Moved the dentist to Friday, 10:00". */
|
|
3384
|
+
text: ReactNode;
|
|
3385
|
+
at: Date | string | number;
|
|
3386
|
+
/** `read` (looked something up), `act` (changed something) or `money`. */
|
|
3387
|
+
kind?: "read" | "act" | "money";
|
|
3388
|
+
/** `done` (default), `waiting` for your approval, `declined`, `undone` or `failed`. */
|
|
3389
|
+
state?: "done" | "waiting" | "declined" | "undone" | "failed";
|
|
3390
|
+
detail?: ReactNode;
|
|
3391
|
+
}
|
|
3392
|
+
export interface AgentActivityProps extends BaseProps {
|
|
3393
|
+
items: AgentAction[];
|
|
3394
|
+
/** "Now" for the day headings; pass it so server and client render the same. */
|
|
3395
|
+
now?: Date | string | number;
|
|
3396
|
+
/** Offers "Undo" on finished actions that changed something. */
|
|
3397
|
+
onUndo?: (id: string) => void;
|
|
3398
|
+
/** Opens an action that waits for your approval. */
|
|
3399
|
+
onReview?: (id: string) => void;
|
|
3400
|
+
/** Accessible name (default "Agent activity"). */
|
|
3401
|
+
label?: string;
|
|
3402
|
+
}
|
|
3403
|
+
export interface ConnectionItem {
|
|
3404
|
+
id: string;
|
|
3405
|
+
name: string;
|
|
3406
|
+
icon?: IconName;
|
|
3407
|
+
logo?: ReactNode;
|
|
3408
|
+
monogram?: string;
|
|
3409
|
+
tint?: Tint | "plain";
|
|
3410
|
+
/** The connected account ("mara@gmail.com", "Giro ••• 4410"). */
|
|
3411
|
+
account?: ReactNode;
|
|
3412
|
+
state: ServiceState;
|
|
3413
|
+
/** How fresh the data is, shown as a compact `SyncStatus`. */
|
|
3414
|
+
sync?: { state: SyncStatusProps["state"]; last?: Date | string | number };
|
|
3415
|
+
}
|
|
3416
|
+
export interface ConnectionListProps extends BaseProps {
|
|
3417
|
+
items: ConnectionItem[];
|
|
3418
|
+
/** "Now" for the relative times; pass it so server and client render the same. */
|
|
3419
|
+
now?: Date | string | number;
|
|
3420
|
+
onManage?: (id: string) => void;
|
|
3421
|
+
/** Shown instead of "Manage" on connections in the `error` state. */
|
|
3422
|
+
onReconnect?: (id: string) => void;
|
|
3423
|
+
/** Accessible name (default "Connections"). */
|
|
3424
|
+
label?: string;
|
|
3425
|
+
}
|
|
3426
|
+
|
|
3427
|
+
/* ── Connected data: home, car, media, workouts, calls, bookings, golf, investments ── */
|
|
3428
|
+
/** The service a value comes from, shown as a small mark. */
|
|
3429
|
+
export interface ServiceRef {
|
|
3430
|
+
name: string;
|
|
3431
|
+
icon?: IconName;
|
|
3432
|
+
logo?: ReactNode;
|
|
3433
|
+
}
|
|
3434
|
+
export interface DeviceTileProps extends BaseProps {
|
|
3435
|
+
name: string;
|
|
3436
|
+
room?: string;
|
|
3437
|
+
icon?: IconName;
|
|
3438
|
+
/** The kind sets the default icon and which controls appear. */
|
|
3439
|
+
kind?: "switch" | "light" | "thermostat" | "vacuum" | "purifier" | "camera" | "lock" | "sensor";
|
|
3440
|
+
/** On or off; with `onToggle` a switch. */
|
|
3441
|
+
on?: boolean;
|
|
3442
|
+
onToggle?: (on: boolean) => void;
|
|
3443
|
+
/** The main reading: "21.5 °C", "Cleaning", "AQI 12". */
|
|
3444
|
+
value?: ReactNode;
|
|
3445
|
+
/** A line under the value: "Heating to 22 °C", "Kitchen · 18 m² left". */
|
|
3446
|
+
status?: ReactNode;
|
|
3447
|
+
/** Thermostat target in °C; with `onTarget` a − / + stepper (steps of `step`, default 0.5). */
|
|
3448
|
+
target?: number;
|
|
3449
|
+
onTarget?: (value: number) => void;
|
|
3450
|
+
step?: number;
|
|
3451
|
+
/** Battery in percent (vacuums, sensors, locks). */
|
|
3452
|
+
battery?: number;
|
|
3453
|
+
/** Quick actions: "Start", "Dock", "Boost". */
|
|
3454
|
+
actions?: { label: string; icon?: IconName; onClick?: () => void }[];
|
|
3455
|
+
/** The device does not answer. */
|
|
3456
|
+
offline?: boolean;
|
|
3457
|
+
service?: ServiceRef;
|
|
3458
|
+
}
|
|
3459
|
+
export interface VehicleCardProps extends BaseProps {
|
|
3460
|
+
name: string;
|
|
3461
|
+
model?: string;
|
|
3462
|
+
/** Battery (or tank) in percent. */
|
|
3463
|
+
battery: number;
|
|
3464
|
+
/** Range in km. */
|
|
3465
|
+
range?: number;
|
|
3466
|
+
/** The charge limit in percent, marked on the bar. */
|
|
3467
|
+
limit?: number;
|
|
3468
|
+
charging?: "charging" | "complete" | "plugged" | "unplugged";
|
|
3469
|
+
/** Charging power in kW while charging. */
|
|
3470
|
+
power?: number;
|
|
3471
|
+
/** When charging reaches the limit. */
|
|
3472
|
+
until?: Date | string | number;
|
|
3473
|
+
locked?: boolean;
|
|
3474
|
+
/** Inside temperature in °C. */
|
|
3475
|
+
inside?: number;
|
|
3476
|
+
climateOn?: boolean;
|
|
3477
|
+
location?: ReactNode;
|
|
3478
|
+
onLock?: (locked: boolean) => void;
|
|
3479
|
+
onClimate?: (on: boolean) => void;
|
|
3480
|
+
service?: ServiceRef;
|
|
3481
|
+
}
|
|
3482
|
+
export interface NowPlayingProps extends BaseProps {
|
|
3483
|
+
title: string;
|
|
3484
|
+
artist?: string;
|
|
3485
|
+
album?: string;
|
|
3486
|
+
/** Cover art: an `<img>`. */
|
|
3487
|
+
art?: ReactNode;
|
|
3488
|
+
/** Position and length in seconds. */
|
|
3489
|
+
position?: number;
|
|
3490
|
+
duration?: number;
|
|
3491
|
+
playing?: boolean;
|
|
3492
|
+
/** Where it plays: "Living room speaker". */
|
|
3493
|
+
device?: string;
|
|
3494
|
+
onPlayPause?: () => void;
|
|
3495
|
+
onNext?: () => void;
|
|
3496
|
+
onPrevious?: () => void;
|
|
3497
|
+
service?: ServiceRef;
|
|
3498
|
+
}
|
|
3499
|
+
export interface WorkoutCardProps extends BaseProps {
|
|
3500
|
+
/** "Run", "Ride", "Strength", "Golf" … */
|
|
3501
|
+
type: string;
|
|
3502
|
+
icon?: IconName;
|
|
3503
|
+
date: Date | string | number;
|
|
3504
|
+
/** Minutes. */
|
|
3505
|
+
duration: number;
|
|
3506
|
+
/** Kilometres. */
|
|
3507
|
+
distance?: number;
|
|
3508
|
+
calories?: number;
|
|
3509
|
+
/** Average heart rate in bpm. */
|
|
3510
|
+
heartRate?: number;
|
|
3511
|
+
/** Minutes in heart-rate zones 1–5. */
|
|
3512
|
+
zones?: number[];
|
|
3513
|
+
service?: ServiceRef;
|
|
3514
|
+
}
|
|
3515
|
+
export interface CallItem {
|
|
3516
|
+
id: string;
|
|
3517
|
+
name: string;
|
|
3518
|
+
number?: string;
|
|
3519
|
+
direction: "incoming" | "outgoing" | "missed";
|
|
3520
|
+
at: Date | string | number;
|
|
3521
|
+
/** Seconds. */
|
|
3522
|
+
duration?: number;
|
|
3523
|
+
/** What the call was about (an assistant's summary). */
|
|
3524
|
+
summary?: ReactNode;
|
|
3525
|
+
}
|
|
3526
|
+
export interface CallLogProps extends BaseProps {
|
|
3527
|
+
calls: CallItem[];
|
|
3528
|
+
/** "Now" for the day headings. */
|
|
3529
|
+
now?: Date | string | number;
|
|
3530
|
+
onCall?: (id: string) => void;
|
|
3531
|
+
onOpen?: (id: string) => void;
|
|
3532
|
+
/** Accessible name (default "Calls"). */
|
|
3533
|
+
label?: string;
|
|
3534
|
+
}
|
|
3535
|
+
export interface ReservationCardProps extends BaseProps {
|
|
3536
|
+
kind: "stay" | "flight" | "train" | "ride" | "order" | "event";
|
|
3537
|
+
title: string;
|
|
3538
|
+
/** "Hotel Atlantic · 2 nights", "LH 2024 · Seat 14A". */
|
|
3539
|
+
subtitle?: ReactNode;
|
|
3540
|
+
start: Date | string | number;
|
|
3541
|
+
end?: Date | string | number;
|
|
3542
|
+
/** Where: an address, airport codes, a restaurant. */
|
|
3543
|
+
place?: ReactNode;
|
|
3544
|
+
/** Booking or order number. */
|
|
3545
|
+
code?: string;
|
|
3546
|
+
status?: "confirmed" | "pending" | "cancelled" | "delayed" | "onTheWay" | "delivered";
|
|
3547
|
+
/** Extra words for the status: "+25 min", "Arrives 19:40". */
|
|
3548
|
+
statusText?: string;
|
|
3549
|
+
service?: ServiceRef;
|
|
3550
|
+
actions?: ReactNode;
|
|
3551
|
+
}
|
|
3552
|
+
export interface GolfHole {
|
|
3553
|
+
par: number;
|
|
3554
|
+
strokes?: number;
|
|
3555
|
+
putts?: number;
|
|
3556
|
+
}
|
|
3557
|
+
export interface ScorecardProps extends BaseProps {
|
|
3558
|
+
course: string;
|
|
3559
|
+
date?: Date | string | number;
|
|
3560
|
+
/** 9 or 18 holes. */
|
|
3561
|
+
holes: GolfHole[];
|
|
3562
|
+
/** Tee and course rating: "Yellow · CR 71.2 / SR 128". */
|
|
3563
|
+
tee?: string;
|
|
3564
|
+
service?: ServiceRef;
|
|
3565
|
+
}
|
|
3566
|
+
export interface Holding {
|
|
3567
|
+
id: string;
|
|
3568
|
+
name: string;
|
|
3569
|
+
/** Ticker or ISIN. */
|
|
3570
|
+
symbol?: string;
|
|
3571
|
+
value: number;
|
|
3572
|
+
/** Change in percent over `period`. */
|
|
3573
|
+
change?: number;
|
|
3574
|
+
/** Share of the portfolio in percent. */
|
|
3575
|
+
weight?: number;
|
|
3576
|
+
}
|
|
3577
|
+
export interface HoldingsListProps extends BaseProps {
|
|
3578
|
+
holdings: Holding[];
|
|
3579
|
+
currency?: string;
|
|
3580
|
+
/** The period of `change` ("today", "1 year"). */
|
|
3581
|
+
period?: string;
|
|
3582
|
+
onSelect?: (id: string) => void;
|
|
3583
|
+
/** Accessible name (default "Holdings"). */
|
|
3584
|
+
label?: string;
|
|
3585
|
+
}
|
|
3586
|
+
|
|
3307
3587
|
export interface IconProps {
|
|
3308
3588
|
name: IconName;
|
|
3309
3589
|
/** Pixel size (default 16; 14 in chips and badges, 20 in navigation). */
|
|
@@ -3403,6 +3683,32 @@ export type TfCoverageMatrixElement = TfElement<CoverageMatrixProps>;
|
|
|
3403
3683
|
export type TfClaimTimelineElement = TfElement<ClaimTimelineProps>;
|
|
3404
3684
|
/** `<tf-document-list>`: Important papers (IDs, contracts, policies, certificates) with category, holder and expiry: "Expired", "Expires in 19 days" or "Valid until May 2031". */
|
|
3405
3685
|
export type TfDocumentListElement = TfElement<DocumentListProps>;
|
|
3686
|
+
/** `<tf-service-mark>`: A connected service's mark: its brand logo from the icon library (brandGmail, brandTesla …), your own logo, or a monogram for a service without a logo ("KS" for a local nursery). */
|
|
3687
|
+
export type TfServiceMarkElement = TfElement<ServiceMarkProps>;
|
|
3688
|
+
/** `<tf-connector-gallery>`: Every service an assistant can connect to, grouped by category, with a search field and category chips. */
|
|
3689
|
+
export type TfConnectorGalleryElement = TfElement<ConnectorGalleryProps>;
|
|
3690
|
+
/** `<tf-connection-list>`: The services you are connected to: mark with state dot, the connected account, how fresh the data is (a compact SyncStatus) and Manage, or Reconnect for a connection that needs attention. */
|
|
3691
|
+
export type TfConnectionListElement = TfElement<ConnectionListProps>;
|
|
3692
|
+
/** `<tf-sync-status>`: When a connected service last synced, in words ("Synced 6 minutes ago"), when it syncs next, what the last sync brought ("1,204 emails") and why a sync failed, with "Sync now". */
|
|
3693
|
+
export type TfSyncStatusElement = TfElement<SyncStatusProps>;
|
|
3694
|
+
/** `<tf-agent-activity>`: What agents did with your connected services, newest first and grouped by day: each action with its service, agent and time, whether it read something, changed something or touched money, and its state (waiting for you, declined, undone, fa */
|
|
3695
|
+
export type TfAgentActivityElement = TfElement<AgentActivityProps>;
|
|
3696
|
+
/** `<tf-device-tile>`: A smart-home device (from Google Home, Apple Home, SmartThings, tado°, Dyson, eufy, Dreame …): its reading, its state and the controls its kind needs. */
|
|
3697
|
+
export type TfDeviceTileElement = TfElement<DeviceTileProps>;
|
|
3698
|
+
/** `<tf-vehicle-card>`: An electric car: charge in percent with the limit marked on the bar, range, charging state with power and when it is done, lock and climate as buttons, the inside temperature and where it is. */
|
|
3699
|
+
export type TfVehicleCardElement = TfElement<VehicleCardProps>;
|
|
3700
|
+
/** `<tf-now-playing>`: What is playing (Spotify, a speaker, a podcast app): cover, title and artist, the device, progress with times and previous / play-pause / next. */
|
|
3701
|
+
export type TfNowPlayingElement = TfElement<NowPlayingProps>;
|
|
3702
|
+
/** `<tf-workout-card>`: One workout from Apple Fitness, Strava, Garmin or a golf app: type, time, duration, distance, calories, average heart rate and minutes in each heart-rate zone as a bar with a legend in words. */
|
|
3703
|
+
export type TfWorkoutCardElement = TfElement<WorkoutCardProps>;
|
|
3704
|
+
/** `<tf-call-log>`: Your calls grouped by day: incoming, outgoing and missed with time and length, and what the call was about when an assistant summarised it. */
|
|
3705
|
+
export type TfCallLogElement = TfElement<CallLogProps>;
|
|
3706
|
+
/** `<tf-reservation-card>`: A booking or order: a stay, flight, train, ride, delivery or ticket with its dates, place, booking number and status (confirmed, pending, delayed, on the way, delivered, cancelled) plus a note like "+25 min". */
|
|
3707
|
+
export type TfReservationCardElement = TfElement<ReservationCardProps>;
|
|
3708
|
+
/** `<tf-scorecard>`: A round of golf: par and strokes for each hole in the usual marks (circle for a birdie, double circle for an eagle, square for a bogey, double square for worse), putts, Out, In and the total against par. */
|
|
3709
|
+
export type TfScorecardElement = TfElement<ScorecardProps>;
|
|
3710
|
+
/** `<tf-holdings-list>`: Positions in a portfolio: name and ISIN or ticker, value, change over a period (arrow, sign and colour) and the share of the portfolio as a bar. */
|
|
3711
|
+
export type TfHoldingsListElement = TfElement<HoldingsListProps>;
|
|
3406
3712
|
/** `<tf-agent-card>`: One agent at a glance (AgentCard) and everything about it beside a chat (AgentDetails). */
|
|
3407
3713
|
export type TfAgentCardElement = TfElement<AgentCardProps>;
|
|
3408
3714
|
/** `<tf-agent-details>`: The AgentDetails component as a custom element. */
|
|
@@ -3835,6 +4141,19 @@ declare global {
|
|
|
3835
4141
|
"tf-coverage-matrix": TfCoverageMatrixElement;
|
|
3836
4142
|
"tf-claim-timeline": TfClaimTimelineElement;
|
|
3837
4143
|
"tf-document-list": TfDocumentListElement;
|
|
4144
|
+
"tf-service-mark": TfServiceMarkElement;
|
|
4145
|
+
"tf-connector-gallery": TfConnectorGalleryElement;
|
|
4146
|
+
"tf-connection-list": TfConnectionListElement;
|
|
4147
|
+
"tf-sync-status": TfSyncStatusElement;
|
|
4148
|
+
"tf-agent-activity": TfAgentActivityElement;
|
|
4149
|
+
"tf-device-tile": TfDeviceTileElement;
|
|
4150
|
+
"tf-vehicle-card": TfVehicleCardElement;
|
|
4151
|
+
"tf-now-playing": TfNowPlayingElement;
|
|
4152
|
+
"tf-workout-card": TfWorkoutCardElement;
|
|
4153
|
+
"tf-call-log": TfCallLogElement;
|
|
4154
|
+
"tf-reservation-card": TfReservationCardElement;
|
|
4155
|
+
"tf-scorecard": TfScorecardElement;
|
|
4156
|
+
"tf-holdings-list": TfHoldingsListElement;
|
|
3838
4157
|
"tf-agent-card": TfAgentCardElement;
|
|
3839
4158
|
"tf-agent-details": TfAgentDetailsElement;
|
|
3840
4159
|
"tf-chat-list": TfChatListElement;
|