@tensile-tools/auth-client 0.0.0-stage → 0.4.1

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.
Files changed (44) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +62 -2
  3. package/dist/client.d.ts +569 -0
  4. package/dist/client.js +637 -0
  5. package/dist/devtools.d.ts +12 -0
  6. package/dist/devtools.js +44 -0
  7. package/dist/elements/account.d.ts +63 -0
  8. package/dist/elements/account.js +331 -0
  9. package/dist/elements/approvals.d.ts +61 -0
  10. package/dist/elements/approvals.js +252 -0
  11. package/dist/elements/auth.d.ts +48 -0
  12. package/dist/elements/auth.js +238 -0
  13. package/dist/elements/base.d.ts +176 -0
  14. package/dist/elements/base.js +540 -0
  15. package/dist/elements/config.d.ts +70 -0
  16. package/dist/elements/config.js +119 -0
  17. package/dist/elements/format.d.ts +32 -0
  18. package/dist/elements/format.js +67 -0
  19. package/dist/elements/index.d.ts +21 -0
  20. package/dist/elements/index.js +31 -0
  21. package/dist/elements/qr.d.ts +9 -0
  22. package/dist/elements/qr.js +302 -0
  23. package/dist/elements/returnto.d.ts +20 -0
  24. package/dist/elements/returnto.js +76 -0
  25. package/dist/elements/setup.d.ts +70 -0
  26. package/dist/elements/setup.js +316 -0
  27. package/dist/elements/styles.d.ts +3 -0
  28. package/dist/elements/styles.js +194 -0
  29. package/dist/elements/text.d.ts +21 -0
  30. package/dist/elements/text.js +302 -0
  31. package/dist/fonts/OFL-geist-mono.txt +93 -0
  32. package/dist/fonts/OFL-geist.txt +93 -0
  33. package/dist/fonts/OFL-inter.txt +93 -0
  34. package/dist/fonts/README.md +18 -0
  35. package/dist/fonts/geist-mono.woff2 +0 -0
  36. package/dist/fonts/geist.woff2 +0 -0
  37. package/dist/fonts/inter.woff2 +0 -0
  38. package/dist/index.d.ts +4 -0
  39. package/dist/index.js +5 -0
  40. package/dist/problem.d.ts +54 -0
  41. package/dist/problem.js +40 -0
  42. package/dist/webauthn.d.ts +46 -0
  43. package/dist/webauthn.js +102 -0
  44. package/package.json +51 -4
@@ -0,0 +1,70 @@
1
+ import { type Html, TensileElement } from './base.ts';
2
+ import type { Options } from './config.ts';
3
+ /** Shared steps for showing, saving, and checking recovery codes. */
4
+ declare abstract class CodesElement extends TensileElement {
5
+ protected followsSession: boolean;
6
+ protected codes: string[] | undefined;
7
+ protected confirming: boolean;
8
+ protected copied: boolean;
9
+ protected forget(): void;
10
+ /** The codes step: make, show, copy, download, and type one back. */
11
+ protected codesBlock(): Html;
12
+ /** Runs the codes actions; it returns true when it handled name. */
13
+ protected codesAct(name: string, from: HTMLElement): Promise<boolean>;
14
+ private focusCodes;
15
+ }
16
+ /**
17
+ * `<tensile-two-step>`: the person's authenticator app. It reads the
18
+ * app's status first. When the app is on, it says so and offers Replace
19
+ * and Remove; when too many wrong codes locked it, it offers to set it up
20
+ * again. Otherwise it sets the app up in three steps: save recovery
21
+ * codes, scan the QR code, and enter a code. With `recoveryCodes` off, or
22
+ * when it replaces an app, setup has two steps.
23
+ *
24
+ * Removing the app, and setting it up, need a sign-in from the last 10
25
+ * minutes: the client confirms it's you with a passkey first when the
26
+ * server asks.
27
+ *
28
+ * Events: `codes-saved`, `two-step-on`, `two-step-off`, `problem`.
29
+ */
30
+ export declare class TwoStep extends CodesElement {
31
+ private uri;
32
+ /** The app's status, or undefined until it loads. */
33
+ private status;
34
+ /** True while setup replaces an app that was on or locked, so the codes step is skipped. */
35
+ private again;
36
+ protected on(o: Options): boolean;
37
+ private steps;
38
+ protected body(o: Options): Html;
39
+ /** The app is on: when it was set up, and Replace and Remove. */
40
+ private onBody;
41
+ /** Too many wrong codes locked the app: set it up again, or remove it. */
42
+ private lockedBody;
43
+ /** Asks before Remove or Replace, which turn the current app off. */
44
+ private confirmBody;
45
+ private stepBody;
46
+ protected forget(): void;
47
+ /** The state the status calls for: on, locked, or the first setup step. */
48
+ private stateFor;
49
+ /**
50
+ * Reads the app's status, then shows it. Setup with recovery codes off
51
+ * starts at the scan step, without moving focus.
52
+ */
53
+ protected load(): Promise<void>;
54
+ private toScan;
55
+ /** Removes the app. It returns false when the server refused, after showing why. */
56
+ private removeApp;
57
+ protected act(name: string, from: HTMLElement): Promise<void>;
58
+ }
59
+ /**
60
+ * `<tensile-recovery-codes>`: makes a new set of recovery codes, shows
61
+ * them with Copy and Download, and asks for one back.
62
+ *
63
+ * Events: `codes-saved`, `problem`.
64
+ */
65
+ export declare class RecoveryCodes extends CodesElement {
66
+ protected on(o: Options): boolean;
67
+ protected body(o: Options): Html;
68
+ protected act(name: string, from: HTMLElement): Promise<void>;
69
+ }
70
+ export {};
@@ -0,0 +1,316 @@
1
+ // The setup elements: an authenticator app with recovery codes, and
2
+ // recovery codes alone.
3
+ import { html, TensileElement } from "./base.js";
4
+ import { encodeQR, qrPath } from "./qr.js";
5
+ /** Shared steps for showing, saving, and checking recovery codes. */
6
+ class CodesElement extends TensileElement {
7
+ // The codes and the authenticator key are secrets: when the session
8
+ // ends, they go with it.
9
+ followsSession = true;
10
+ codes;
11
+ confirming = false;
12
+ copied = false;
13
+ forget() {
14
+ this.codes = undefined;
15
+ this.confirming = false;
16
+ this.copied = false;
17
+ }
18
+ /** The codes step: make, show, copy, download, and type one back. */
19
+ codesBlock() {
20
+ if (!this.codes) {
21
+ return html `<p class="cap">${this.t('codes.cap')}</p>${this.err()}
22
+ <button class="btn fill" type="button" part="button button-primary" data-do="make" data-key="make">${this.t('codes.make')}</button>`;
23
+ }
24
+ const shown = html `<pre class="codes" part="codes" tabindex="0" aria-label="${this.t('codes.title')}">${this.codes.join('\n')}</pre>
25
+ <div class="two"><button class="btn plain sm" type="button" part="button" data-do="copy" data-key="copy">${this.t(this.copied ? 'copied' : 'copy')}</button>
26
+ <button class="btn plain sm" type="button" part="button" data-do="download" data-key="download">${this.t('download')}</button></div>`;
27
+ if (!this.confirming) {
28
+ return html `<p class="cap">${this.t('codes.cap')}</p>${shown}${this.err()}
29
+ <button class="btn fill" type="button" part="button button-primary" data-do="saved" data-key="saved">${this.t('codes.saved')}</button>`;
30
+ }
31
+ return html `<form class="stack" data-do="confirm-codes" novalidate>
32
+ ${this.field('typed', this.t('codes.confirmLabel'), html `class="code" autocomplete="off" autocapitalize="characters" spellcheck="false" required data-autofocus`, { invalid: true })}
33
+ ${this.err()}<button class="btn fill" part="button button-primary">${this.t('codes.confirm')}</button></form>`;
34
+ }
35
+ /** Runs the codes actions; it returns true when it handled name. */
36
+ async codesAct(name, from) {
37
+ switch (name) {
38
+ case 'make': {
39
+ const r = await this.client.generateRecoveryCodes();
40
+ if (r.outcome !== 'ok') {
41
+ this.failWith(r);
42
+ return true;
43
+ }
44
+ this.codes = r.data.codes;
45
+ this.focusCodes();
46
+ return true;
47
+ }
48
+ case 'copy':
49
+ try {
50
+ await navigator.clipboard.writeText((this.codes ?? []).join('\n'));
51
+ this.copied = true;
52
+ this.update();
53
+ this.announce(this.t('copied'));
54
+ }
55
+ catch {
56
+ this.fail(this.t('copyFailed'));
57
+ }
58
+ return true;
59
+ case 'download': {
60
+ const a = document.createElement('a');
61
+ a.href = URL.createObjectURL(new Blob([(this.codes ?? []).join('\n') + '\n'], { type: 'text/plain' }));
62
+ a.download = this.t('codes.file').toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/^-|-$/g, '') + '.txt';
63
+ a.click();
64
+ setTimeout(() => URL.revokeObjectURL(a.href), 1000);
65
+ void from;
66
+ return true;
67
+ }
68
+ case 'saved':
69
+ this.confirming = true;
70
+ this.go(this.state);
71
+ return true;
72
+ }
73
+ return false;
74
+ }
75
+ focusCodes() {
76
+ this.go(this.state);
77
+ this.root.querySelector('.codes')?.focus();
78
+ }
79
+ }
80
+ /**
81
+ * `<tensile-two-step>`: the person's authenticator app. It reads the
82
+ * app's status first. When the app is on, it says so and offers Replace
83
+ * and Remove; when too many wrong codes locked it, it offers to set it up
84
+ * again. Otherwise it sets the app up in three steps: save recovery
85
+ * codes, scan the QR code, and enter a code. With `recoveryCodes` off, or
86
+ * when it replaces an app, setup has two steps.
87
+ *
88
+ * Removing the app, and setting it up, need a sign-in from the last 10
89
+ * minutes: the client confirms it's you with a passkey first when the
90
+ * server asks.
91
+ *
92
+ * Events: `codes-saved`, `two-step-on`, `two-step-off`, `problem`.
93
+ */
94
+ export class TwoStep extends CodesElement {
95
+ uri;
96
+ /** The app's status, or undefined until it loads. */
97
+ status;
98
+ /** True while setup replaces an app that was on or locked, so the codes step is skipped. */
99
+ again = false;
100
+ on(o) {
101
+ return o.twoStep;
102
+ }
103
+ steps(o) {
104
+ return o.recoveryCodes && !this.again ? ['codes', 'scan', 'enter'] : ['scan', 'enter'];
105
+ }
106
+ body(o) {
107
+ if (!this.status)
108
+ return this.loadingBody(o, this.t('twoStep.title'));
109
+ switch (this.state) {
110
+ case 'on': return this.onBody(o);
111
+ case 'locked': return this.lockedBody(o);
112
+ case 'remove': return this.confirmBody(o, 'remove', 'remove-confirm', this.t('twoStep.removeConfirm'));
113
+ case 'replace': return this.confirmBody(o, 'replace', 'replace-confirm', this.t('continue'));
114
+ case 'removed': return html `${this.heading(o, this.r('twoStep.removeHeadline'), this.t('twoStep.removeTitle'))}${this.done(this.t('twoStep.removedChip'), '', this.t('twoStep.removed'), { label: this.t('twoStep.setUp'), action: 'setup' })}`;
115
+ }
116
+ const steps = this.steps(o);
117
+ const current = this.state === 'start' ? steps[0] : this.state;
118
+ const head = this.heading(o, this.r('twoStep.headline', { steps: this.t(steps.length === 3 ? 'twoStep.three' : 'twoStep.two') }), this.t('twoStep.title'));
119
+ if (current === 'done')
120
+ return html `${head}${this.done(this.t('twoStep.doneChip'), 'green', this.t('twoStep.done'))}`;
121
+ const titles = { codes: this.t('twoStep.codes'), scan: this.t('twoStep.scan'), enter: this.t('twoStep.enter') };
122
+ const at = steps.indexOf(current);
123
+ const items = steps.map((s, i) => html `<li class="step${s === current ? ' on' : ''}" part="step"${s === current ? html ` aria-current="step"` : ''}>
124
+ <h3 class="st"><span class="n" aria-hidden="true">${i + 1}</span><b>${titles[s]}</b>${i < at ? html `<span class="chip green">${this.t('twoStep.stepDone')}</span>` : ''}</h3>
125
+ ${s === current ? html `<div class="sb">${this.stepBody(s)}</div>` : ''}</li>`);
126
+ return html `${head}<ol class="steps">${items}</ol>`;
127
+ }
128
+ /** The app is on: when it was set up, and Replace and Remove. */
129
+ onBody(o) {
130
+ const since = this.status?.since ? this.t('twoStep.since', { date: new Date(this.status.since).toLocaleDateString(undefined, { day: 'numeric', month: 'short', year: 'numeric' }) }) : '';
131
+ return html `${this.heading(o, this.r('twoStep.onHeadline'), this.t('twoStep.onTitle'))}<div class="body">
132
+ <p class="as" part="row"><span class="nm"><b>${this.t('twoStep.app')}</b>${since ? html `<small>${since}</small>` : ''}</span><span class="chip green" part="chip">${this.t('twoStep.onChip')}</span></p>
133
+ <p class="fine">${this.t('twoStep.onLead')}</p>${this.err()}
134
+ <div class="two"><button class="btn plain sm" type="button" part="button" data-do="replace" data-key="replace">${this.t('twoStep.replace')}</button>
135
+ <button class="btn plain sm" type="button" part="button" data-do="remove" data-key="remove">${this.t('twoStep.remove')}</button></div></div>`;
136
+ }
137
+ /** Too many wrong codes locked the app: set it up again, or remove it. */
138
+ lockedBody(o) {
139
+ return html `${this.heading(o, this.r('twoStep.lockedHeadline'), this.t('twoStep.lockedTitle'))}<div class="body">
140
+ <p class="as" part="row"><span class="nm"><b>${this.t('twoStep.app')}</b></span><span class="chip orange" part="chip">${this.t('twoStep.lockedChip')}</span></p>
141
+ <p class="fine">${this.t('twoStep.lockedLead')}</p>${this.err()}
142
+ <div class="acts"><button class="btn fill" type="button" part="button button-primary" data-do="set-up-again" data-key="set-up-again" data-autofocus>${this.t('twoStep.setUpAgain')}</button>
143
+ <button class="lnk" type="button" part="link" data-do="remove" data-key="remove">${this.t('twoStep.remove')}</button></div></div>`;
144
+ }
145
+ /** Asks before Remove or Replace, which turn the current app off. */
146
+ confirmBody(o, what, action, label) {
147
+ return html `${this.heading(o, this.r(`twoStep.${what}Headline`), this.t(`twoStep.${what}Title`))}<div class="body">
148
+ <p class="fine">${this.t(`twoStep.${what}Lead`)}</p>${this.err()}
149
+ <div class="acts"><button class="btn fill" type="button" part="button button-primary" data-do="${action}" data-key="${action}" data-autofocus>${label}</button>
150
+ <button class="lnk" type="button" part="link" data-do="cancel" data-key="cancel">${this.t('cancel')}</button></div></div>`;
151
+ }
152
+ stepBody(s) {
153
+ if (s === 'codes')
154
+ return this.codesBlock();
155
+ if (s === 'scan') {
156
+ if (!this.uri)
157
+ return html `<p class="cap">${this.t('loading')}</p>${this.err()}`;
158
+ const secret = new URL(this.uri).searchParams.get('secret') ?? '';
159
+ let qr = '';
160
+ try {
161
+ const q = encodeQR(this.uri);
162
+ qr = html `<div class="qr"><svg viewBox="0 0 ${q.size + 8} ${q.size + 8}" role="img" aria-label="${this.t('twoStep.qr')}" shape-rendering="crispEdges"><path d="${qrPath(q)}" fill="#171717"/></svg></div>`;
163
+ }
164
+ catch {
165
+ qr = '';
166
+ }
167
+ return html `${qr}<p class="cap">${this.t('twoStep.key')} <code class="key">${secret.match(/.{1,4}/g)?.join(' ') ?? secret}</code></p>
168
+ <a class="lnk" part="link" href="${this.uri}">${this.t('twoStep.open')}</a>${this.err()}
169
+ <button class="btn fill" type="button" part="button button-primary" data-do="scanned" data-key="scanned">${this.t('continue')}</button>`;
170
+ }
171
+ return html `<form class="stack" data-do="turn-on" novalidate>
172
+ ${this.field('code', this.t('code.label'), html `class="code" inputmode="numeric" autocomplete="one-time-code" maxlength="6" placeholder="${this.t('code.placeholder')}" required data-autofocus`, { invalid: true })}
173
+ ${this.err()}<button class="btn fill" part="button button-primary">${this.t('twoStep.turnOn')}</button></form>`;
174
+ }
175
+ forget() {
176
+ super.forget();
177
+ this.uri = undefined;
178
+ this.status = undefined;
179
+ this.again = false;
180
+ }
181
+ /** The state the status calls for: on, locked, or the first setup step. */
182
+ stateFor(s) {
183
+ if (s.locked)
184
+ return 'locked';
185
+ return s.confirmed ? 'on' : 'start';
186
+ }
187
+ /**
188
+ * Reads the app's status, then shows it. Setup with recovery codes off
189
+ * starts at the scan step, without moving focus.
190
+ */
191
+ async load() {
192
+ const g = this.generation;
193
+ const r = await this.client.totpStatus();
194
+ if (this.stale(g))
195
+ return;
196
+ if (r.outcome !== 'ok')
197
+ return this.failWith(r);
198
+ this.status = r.data;
199
+ this.error = '';
200
+ if (this.state === 'start' || this.state === 'on' || this.state === 'locked')
201
+ this.state = this.stateFor(r.data);
202
+ this.update();
203
+ if (this.state === 'start' && !this.options.recoveryCodes)
204
+ await this.toScan(false);
205
+ }
206
+ async toScan(focus = true) {
207
+ if (focus)
208
+ this.go('scan');
209
+ else {
210
+ this.state = 'scan';
211
+ this.update();
212
+ }
213
+ const g = this.generation;
214
+ const r = await this.client.enrollTOTP();
215
+ if (this.stale(g))
216
+ return;
217
+ if (r.outcome !== 'ok')
218
+ return this.failWith(r);
219
+ this.uri = r.data.uri;
220
+ this.update();
221
+ }
222
+ /** Removes the app. It returns false when the server refused, after showing why. */
223
+ async removeApp() {
224
+ const g = this.generation;
225
+ const r = await this.client.removeTOTP();
226
+ if (this.stale(g))
227
+ return false;
228
+ if (r.outcome !== 'ok') {
229
+ this.failWith(r);
230
+ return false;
231
+ }
232
+ this.status = r.data;
233
+ this.emit('two-step-off');
234
+ return true;
235
+ }
236
+ async act(name, from) {
237
+ if (await this.codesAct(name, from))
238
+ return;
239
+ switch (name) {
240
+ case 'replace':
241
+ case 'remove':
242
+ return this.go(name);
243
+ case 'cancel':
244
+ return this.go(this.status ? this.stateFor(this.status) : 'start');
245
+ case 'remove-confirm':
246
+ if (await this.removeApp())
247
+ this.go('removed');
248
+ return;
249
+ case 'replace-confirm':
250
+ if (!(await this.removeApp()))
251
+ return;
252
+ this.again = true;
253
+ return this.toScan();
254
+ case 'set-up-again':
255
+ // Enrolling again replaces a locked app.
256
+ this.again = true;
257
+ return this.toScan();
258
+ case 'setup':
259
+ this.again = false;
260
+ this.uri = undefined;
261
+ this.go('start');
262
+ if (!this.options.recoveryCodes)
263
+ await this.toScan();
264
+ return;
265
+ case 'confirm-codes': {
266
+ const r = await this.client.confirmRecoveryCodes((this.values.typed ?? '').trim());
267
+ if (r.outcome !== 'ok')
268
+ return this.failWith(r);
269
+ this.emit('codes-saved');
270
+ return this.toScan();
271
+ }
272
+ case 'scanned':
273
+ return this.go('enter');
274
+ case 'turn-on': {
275
+ const code = (this.values.code ?? '').replace(/\s/g, '');
276
+ if (!/^\d{6}$/.test(code))
277
+ return this.fail(this.t('code.bad'));
278
+ const r = await this.client.confirmTOTP(code);
279
+ if (r.outcome !== 'ok')
280
+ return this.failWith(r);
281
+ this.status = { enrolled: true, confirmed: true, locked: false, since: new Date().toISOString() };
282
+ this.again = false;
283
+ this.emit('two-step-on', r.data);
284
+ this.go('done');
285
+ }
286
+ }
287
+ }
288
+ }
289
+ /**
290
+ * `<tensile-recovery-codes>`: makes a new set of recovery codes, shows
291
+ * them with Copy and Download, and asks for one back.
292
+ *
293
+ * Events: `codes-saved`, `problem`.
294
+ */
295
+ export class RecoveryCodes extends CodesElement {
296
+ on(o) {
297
+ return o.recoveryCodes;
298
+ }
299
+ body(o) {
300
+ const head = this.heading(o, this.r('codes.headline'), this.t('codes.title'));
301
+ if (this.state === 'done')
302
+ return html `${head}${this.done(this.t('codes.doneChip'), 'green', this.t('codes.done'))}`;
303
+ return html `${head}<div class="body">${this.codesBlock()}</div>`;
304
+ }
305
+ async act(name, from) {
306
+ if (await this.codesAct(name, from))
307
+ return;
308
+ if (name === 'confirm-codes') {
309
+ const r = await this.client.confirmRecoveryCodes((this.values.typed ?? '').trim());
310
+ if (r.outcome !== 'ok')
311
+ return this.failWith(r);
312
+ this.emit('codes-saved');
313
+ this.go('done');
314
+ }
315
+ }
316
+ }
@@ -0,0 +1,3 @@
1
+ export declare const css = "\n:host {\n --_ink: #171717; --_soft: #4d4d4d; --_mute: #6b6b6b; --_quiet: #767676; --_join: #8f8f8f;\n --_line: #ebebeb; --_line-2: #dedede; --_paper: #fff; --_well: #fafafa;\n --_green: #0a6b34; --_green-t: #e3f5ea; --_orange: #a83a04; --_orange-t: #fdebe1; --_violet: #5b34d6; --_violet-t: #efeafd;\n --_chip: #f0f0f0; --_ul: #b5b5b5; color-scheme: light;\n --ink: var(--tensile-ink, var(--_ink)); --soft: var(--tensile-soft, var(--_soft));\n --mute: var(--tensile-mute, var(--_mute)); --quiet: var(--tensile-quiet, var(--_quiet));\n --line: var(--tensile-line, var(--_line)); --line-2: var(--tensile-line-strong, var(--_line-2));\n --paper: var(--tensile-paper, var(--_paper)); --well: var(--tensile-well, var(--_well));\n --green: var(--tensile-good, var(--_green)); --green-t: var(--tensile-good-tint, var(--_green-t));\n --orange: var(--tensile-warn, var(--_orange)); --orange-t: var(--tensile-warn-tint, var(--_orange-t));\n --violet: var(--tensile-agent, var(--_violet)); --violet-t: var(--tensile-agent-tint, var(--_violet-t)); --chip: var(--_chip); --ul: var(--_ul);\n --accent: var(--tensile-accent, var(--_accent, var(--ink)));\n --on-accent: var(--tensile-on-accent, var(--_on-accent, var(--paper)));\n --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px;\n --ctl: 48px; --say: 34px; --amt: 96px;\n --r-btn: var(--tensile-radius-button, 100px); --r-field: 12px; --r-frame: var(--tensile-radius-frame, 28px); --r-sm: 8px;\n --display: var(--tensile-font-display, \"TensileGeist\", \"Geist\", \"TensileInter\", system-ui, sans-serif);\n --text: var(--tensile-font-text, \"TensileInter\", \"Inter\", system-ui, sans-serif);\n --mono: var(--tensile-font-mono, \"TensileGeistMono\", \"Geist Mono\", ui-monospace, monospace);\n --track: -0.05em; --track-amt: -0.06em; --w-key: 640; --w-join: 520;\n display: block; container-type: inline-size; color: var(--ink);\n font: 400 14px/20px var(--text); -webkit-font-smoothing: antialiased;\n}\n:host([hidden]), :host([data-off]) { display: none; }\n:host([data-theme=\"dark\"]) {\n --_ink: #f2f2f2; --_soft: #b8b8b8; --_mute: #9a9a9a; --_quiet: #8c8c8c; --_join: #7d7d7d;\n --_line: #262626; --_line-2: #333; --_paper: #0d0d0e; --_well: #161617;\n --_green: #4cd685; --_green-t: #10291a; --_orange: #ff8a4c; --_orange-t: #2e1608; --_violet: #a98bff; --_violet-t: #1f1833;\n --_chip: #232323; --_ul: #5a5a5a; color-scheme: dark;}\n@media (prefers-color-scheme: dark) { :host([data-theme=\"auto\"]) {\n --_ink: #f2f2f2; --_soft: #b8b8b8; --_mute: #9a9a9a; --_quiet: #8c8c8c; --_join: #7d7d7d;\n --_line: #262626; --_line-2: #333; --_paper: #0d0d0e; --_well: #161617;\n --_green: #4cd685; --_green-t: #10291a; --_orange: #ff8a4c; --_orange-t: #2e1608; --_violet: #a98bff; --_violet-t: #1f1833;\n --_chip: #232323; --_ul: #5a5a5a; color-scheme: dark;} }\n:host([data-density=\"compact\"]) { --s2: 6px; --s3: 8px; --s4: 12px; --s5: 16px; --s6: 24px; --ctl: 40px; --say: 28px; --amt: 76px; }\n:host([data-radius=\"sharp\"]) { --r-btn: var(--tensile-radius-button, 2px); --r-field: 2px; --r-frame: var(--tensile-radius-frame, 4px); --r-sm: 2px; }\n:host([data-radius=\"soft\"]) { --r-btn: var(--tensile-radius-button, 10px); --r-field: 8px; --r-frame: var(--tensile-radius-frame, 18px); --r-sm: 6px; }\n:host([data-font=\"tight\"]) { --display: var(--tensile-font-display, \"Inter Tight\", \"TensileInter\", system-ui, sans-serif); --track: -0.045em; --w-key: 620; --w-join: 560; }\n:host([data-font=\"serif\"]) { --display: var(--tensile-font-display, \"Newsreader\", \"Iowan Old Style\", Georgia, serif); --track: -0.025em; --track-amt: -0.035em; --w-key: 560; --w-join: 420; --say: 38px; }\n:host([data-font=\"serif\"][data-density=\"compact\"]) { --say: 31px; }\n:host([data-font=\"system\"]) { --display: var(--tensile-font-display, system-ui, -apple-system, \"Segoe UI\", sans-serif); --text: var(--tensile-font-text, system-ui, -apple-system, \"Segoe UI\", sans-serif); --mono: var(--tensile-font-mono, ui-monospace, monospace); --track: -0.03em; --track-amt: -0.04em; }\n\n* { box-sizing: border-box; }\n[hidden] { display: none !important; }\n:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }\n.num { font-variant-numeric: tabular-nums lining-nums; }\n.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }\n\n.scr { width: 100%; max-width: 390px; margin: 0 auto; background: var(--paper); border: 1px solid var(--line-2); border-radius: var(--r-frame); padding: var(--s5); display: flex; flex-direction: column; overflow-wrap: anywhere; }\n.app { display: flex; align-items: center; gap: var(--s2); font: 600 15px/20px var(--display); letter-spacing: -0.02em; min-height: 24px; color: var(--ink); }\n.lm { width: 24px; height: 24px; border-radius: var(--r-sm); background: var(--accent); color: var(--on-accent); display: grid; place-items: center; font: 700 13px/1 var(--display); flex: none; }\n.li { height: 24px; max-width: 96px; object-fit: contain; display: block; }\n\n.say { font: var(--w-key) var(--say)/1.06 var(--display); letter-spacing: var(--track); margin: var(--s5) 0; text-wrap: balance; color: var(--ink); }\n.say:focus { outline: none; }\n.say .j { font-weight: var(--w-join); color: var(--tensile-join, var(--_join)); }\n:host([data-font=\"serif\"]) .say .j { font-style: italic; }\n.say .ok { color: var(--green); }\n.say .warn { color: var(--orange); }\n.say .l { display: block; }\n.agent { color: var(--violet); }\n.amt { display: block; font-size: var(--amt); line-height: 0.84; letter-spacing: var(--track-amt); white-space: nowrap; overflow: hidden; margin: 0.16em 0 0.1em -0.04em; padding-bottom: 0.04em; font-variant-numeric: tabular-nums lining-nums; }\n.amt .cur { font-size: 0.5em; vertical-align: 0.74em; margin-right: 0.04em; letter-spacing: 0; font-weight: var(--w-join); color: var(--tensile-join, var(--_join)); }\n\n.ttl { margin: var(--s5) 0 var(--s4); }\n.ttl h2 { font: 600 22px/28px var(--display); letter-spacing: -0.025em; margin: 0; text-wrap: balance; color: var(--ink); }\n.ttl h2:focus { outline: none; }\n.ttl .lead { color: var(--soft); margin: var(--s1) 0 0; font-size: 15px; line-height: 22px; text-wrap: pretty; }\n\n.body, .stack { display: flex; flex-direction: column; gap: var(--s3); }\n.acts { display: flex; flex-direction: column; gap: var(--s2); margin-top: var(--s1); }\n.btn { appearance: none; display: inline-flex; align-items: center; justify-content: center; gap: var(--s2); width: 100%; min-height: var(--ctl); padding: 0 var(--s5); border-radius: var(--r-btn); border: 1px solid var(--line-2); background: var(--paper); color: var(--ink); font: 500 15px/1.2 var(--text); cursor: pointer; transition: transform 120ms ease; text-align: center; }\n.btn:active { transform: scale(0.98); }\n.btn.fill { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }\n.btn.sm { min-height: 40px; font-size: 14px; }\n.btn[aria-disabled=\"true\"], .btn:disabled { background: var(--well); color: var(--soft); border-color: var(--line-2); cursor: default; }\n.lnk { appearance: none; background: none; border: 0; padding: 0 var(--s2); min-height: 40px; align-self: center; font: 500 14px/20px var(--text); color: var(--ink); text-decoration: underline; text-decoration-color: var(--ul); text-underline-offset: 3px; cursor: pointer; }\n.lnk.in { min-height: 24px; padding: 0; font-size: 13px; }\n.f label { display: block; font: 500 13px/18px var(--text); color: var(--mute); }\n.f .hint { font-size: 13px; line-height: 18px; color: var(--mute); margin: var(--s1) 0 0; }\n.fi { position: relative; }\ninput { width: 100%; height: var(--ctl); border: 0; border-bottom: 1.5px solid var(--ink); border-radius: 0; padding: 0; font: 400 16px/1 var(--text); color: var(--ink); background: transparent; }\ninput::placeholder { color: var(--quiet); opacity: 1; }\ninput:focus-visible { outline: 0; border-bottom-width: 2.5px; border-color: var(--accent); }\ninput[aria-invalid=\"true\"] { border-color: var(--orange); }\ninput.code { font-family: var(--mono); font-size: 17px; letter-spacing: 0.24em; }\ninput.code::placeholder { letter-spacing: 0; font-family: var(--text); font-size: 16px; }\n.afk { position: absolute; right: 0; top: 50%; transform: translateY(-50%); color: var(--mute); display: grid; }\n.afk svg { width: 18px; height: 18px; }\n.fi:has(.afk) input { padding-right: 28px; }\n.or { display: flex; align-items: center; gap: var(--s3); margin: var(--s3) 0 var(--s1); color: var(--mute); font-size: 13px; line-height: 1; }\n.or::before, .or::after { content: \"\"; flex: 1; border-top: 1px solid var(--line); }\n.as { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); margin: 0; font-weight: 500; min-width: 0; }\n.as .lnk { padding: 0; min-height: 32px; font-size: 13px; flex: none; }\n.nm { display: flex; flex-direction: column; min-width: 0; flex: 1; }\n.nm b { font-weight: 500; }\n.nm small { font-size: 12.5px; line-height: 18px; color: var(--mute); }\n.chip { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: min(var(--r-btn), 100px); font: 500 12px/1 var(--text); background: var(--chip); color: var(--soft); white-space: nowrap; flex: none; }\n.chip.green { background: var(--green-t); color: var(--green); }\n.chip.orange { background: var(--orange-t); color: var(--orange); }\n.cap { font-size: 13px; line-height: 18px; color: var(--mute); margin: 0; text-wrap: pretty; }\n.fine { color: var(--soft); font-size: 15px; line-height: 22px; margin: 0; text-wrap: pretty; }\n.done { display: flex; flex-direction: column; gap: var(--s3); align-items: flex-start; }\n.done p { margin: 0; font: var(--w-key) 26px/30px var(--display); letter-spacing: -0.03em; text-wrap: balance; color: var(--ink); }\n.done .lnk { align-self: flex-start; padding: 0; }\n.subject { display: flex; gap: var(--s3); align-items: center; }\n.since { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: var(--s2); color: var(--soft); text-wrap: pretty; }\n.since li { position: relative; padding-left: 18px; }\n.since li::before { content: \"\"; position: absolute; left: 0; top: 9px; width: 8px; height: 2px; border-radius: 1px; background: var(--orange); }\n.since.ok li::before { background: var(--green); }\n.err { margin: 0; font-size: 13px; line-height: 18px; color: var(--orange); }\n.note { margin: 0; font-size: 13px; line-height: 18px; color: var(--soft); }\n.gl { width: 22px; height: 22px; flex: none; display: inline-block; }\n.gl.agent { color: var(--violet); }\n\n/* sessions */\n.tree, .tree ul, .log, .inbox { list-style: none; margin: 0; padding: 0; }\n.node.dev { border-top: 1px solid var(--line); padding: var(--s1) 0; }\n.row { display: flex; align-items: center; gap: 10px; min-height: 44px; min-width: 0; }\n.dev > .row .nm b { font: 600 17px/22px var(--display); letter-spacing: -0.02em; }\n.node.ag > .row .nm b { color: var(--violet); font-size: 15px; }\n.node.ag { position: relative; padding-left: 22px; }\n.node.ag::before { content: \"\"; position: absolute; left: 10px; top: 0; width: 8px; height: 22px; border-left: 1.5px solid var(--ink); border-bottom: 1.5px solid var(--ink); border-bottom-left-radius: 6px; }\n.rv { appearance: none; border: 0; background: none; padding: 0 2px; min-height: 40px; min-width: 44px; font: 500 13px/1 var(--text); color: var(--ink); text-decoration: underline; text-decoration-color: var(--ul); text-underline-offset: 3px; cursor: pointer; flex: none; }\n.rv[aria-disabled=\"true\"] { color: var(--orange); text-decoration: none; cursor: default; }\n.revoked > .row .nm b { text-decoration: line-through; }\n.acct .acts { margin-top: var(--s4); }\n\n/* approvals inbox */\n.req { border-top: 1px solid var(--line); padding: var(--s3) 0; display: flex; flex-direction: column; gap: var(--s2); }\n.req .what { margin: 0; font-size: 15px; line-height: 22px; }\n.req .what b { color: var(--violet); font-weight: 600; }\n.two { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2); }\n\n/* activity */\n.vrow { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0 var(--s2); margin: calc(var(--s3) * -1) 0 var(--s2); color: var(--mute); font-size: 13px; }\n.vrow .lnk { padding: 0; font-size: 13px; min-height: 32px; flex: none; }\n.vrow > .lnk:only-child { margin-left: auto; }\n.ev { display: grid; grid-template-columns: 24px minmax(0, 1fr); column-gap: 10px; align-items: start; padding: 9px 0; border-top: 1px solid var(--line); }\n.ev .who { grid-row: 1 / 3; padding-top: 1px; display: flex; }\n.ev .who .gl { width: 24px; height: 24px; }\n.ev .what { margin: 0; font-size: 14.5px; line-height: 20px; text-wrap: pretty; }\n.ev .what b { font-weight: 600; }\n.ev .what b.agent { color: var(--violet); }\n.ev time { color: var(--mute); font-size: 12.5px; line-height: 18px; }\n.seal { display: none; }\n\n/* setup */\n.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }\n.step { border-top: 1px solid var(--line); padding: var(--s3) 0; }\n.step:first-child { border-top-color: var(--ink); }\n.step:last-child { padding-bottom: 0; }\n.st { display: flex; align-items: center; gap: 10px; min-height: 26px; margin: 0; font: inherit; }\n.st b { font-weight: 500; flex: 1; }\n.n { width: 24px; height: 24px; border-radius: var(--r-sm); border: 1px solid var(--line-2); font: 600 12px/1 var(--text); display: grid; place-items: center; flex: none; }\n.step.on .n { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }\n.sb { display: flex; flex-direction: column; gap: var(--s3); padding-top: var(--s3); }\n.codes { font: 400 12px/20px var(--mono); margin: 0; padding: 10px 12px; background: var(--well); border: 1px solid var(--line); border-radius: min(var(--r-field), 10px); overflow-x: auto; color: var(--ink); }\n.qr { align-self: center; width: 164px; padding: 6px; border-radius: 12px; background: #fff; border: 1px solid var(--line); }\n.qr svg { display: block; width: 100%; }\n.key { font: 500 13px/20px var(--mono); color: var(--ink); overflow-wrap: anywhere; }\n\n/* wide: a page section instead of a card */\n@container (min-width: 720px) {\n .wide .scr { max-width: none; border: 0; border-radius: 0; padding: var(--s6) 0; background: transparent; }\n .wide .app { display: none; }\n .wide .say, .wide .ttl { text-align: center; margin: 0 auto var(--s6); max-width: 720px; }\n .wide .say { font-size: calc(var(--say) * 1.5); }\n .wide .vrow { justify-content: center; gap: 16px; margin: calc(var(--s5) * -1) 0 var(--s6); }\n .wide .vrow > .lnk:only-child { margin-left: 0; }\n .wide .acts { align-items: center; margin-top: var(--s6); }\n .wide .acts .btn { width: auto; min-height: 40px; font-size: 14px; }\n .wide .tree { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s5) 32px; align-items: start; max-width: 964px; margin: 0 auto; }\n .wide .tree > .node { flex: 0 1 300px; min-width: 0; border-top: 1.5px solid var(--ink); padding-top: var(--s2); }\n .wide .log, .wide .inbox { max-width: 960px; margin: 0 auto; width: 100%; }\n .wide .ev { grid-template-columns: 24px minmax(0, 1fr) 150px 72px; align-items: center; column-gap: 20px; }\n .wide .ev .who { grid-row: auto; }\n .wide .seal { display: block; font: 400 12px/18px var(--mono); color: var(--mute); text-align: right; }\n .wide .req { flex-direction: row; align-items: center; justify-content: space-between; }\n .wide .req .two { flex: none; width: 260px; }\n}\n@media (prefers-reduced-motion: reduce) {\n *, *::before, *::after { transition: none !important; animation: none !important; }\n}\n";
2
+ /** The @font-face rules for the bundled fonts, relative to `base`. */
3
+ export declare function fontFaces(base: string): string;
@@ -0,0 +1,194 @@
1
+ // The elements' styles: direction C, "Sentence". Each element adopts them
2
+ // as a constructed style sheet, which a Content-Security-Policy without
3
+ // 'unsafe-inline' still allows. Every colour, radius, and font reads a
4
+ // --tensile-* custom property first, so an app themes the elements from
5
+ // its own CSS; ::part() reaches the rest.
6
+ const dark = `
7
+ --_ink: #f2f2f2; --_soft: #b8b8b8; --_mute: #9a9a9a; --_quiet: #8c8c8c; --_join: #7d7d7d;
8
+ --_line: #262626; --_line-2: #333; --_paper: #0d0d0e; --_well: #161617;
9
+ --_green: #4cd685; --_green-t: #10291a; --_orange: #ff8a4c; --_orange-t: #2e1608; --_violet: #a98bff; --_violet-t: #1f1833;
10
+ --_chip: #232323; --_ul: #5a5a5a; color-scheme: dark;`;
11
+ export const css = `
12
+ :host {
13
+ --_ink: #171717; --_soft: #4d4d4d; --_mute: #6b6b6b; --_quiet: #767676; --_join: #8f8f8f;
14
+ --_line: #ebebeb; --_line-2: #dedede; --_paper: #fff; --_well: #fafafa;
15
+ --_green: #0a6b34; --_green-t: #e3f5ea; --_orange: #a83a04; --_orange-t: #fdebe1; --_violet: #5b34d6; --_violet-t: #efeafd;
16
+ --_chip: #f0f0f0; --_ul: #b5b5b5; color-scheme: light;
17
+ --ink: var(--tensile-ink, var(--_ink)); --soft: var(--tensile-soft, var(--_soft));
18
+ --mute: var(--tensile-mute, var(--_mute)); --quiet: var(--tensile-quiet, var(--_quiet));
19
+ --line: var(--tensile-line, var(--_line)); --line-2: var(--tensile-line-strong, var(--_line-2));
20
+ --paper: var(--tensile-paper, var(--_paper)); --well: var(--tensile-well, var(--_well));
21
+ --green: var(--tensile-good, var(--_green)); --green-t: var(--tensile-good-tint, var(--_green-t));
22
+ --orange: var(--tensile-warn, var(--_orange)); --orange-t: var(--tensile-warn-tint, var(--_orange-t));
23
+ --violet: var(--tensile-agent, var(--_violet)); --violet-t: var(--tensile-agent-tint, var(--_violet-t)); --chip: var(--_chip); --ul: var(--_ul);
24
+ --accent: var(--tensile-accent, var(--_accent, var(--ink)));
25
+ --on-accent: var(--tensile-on-accent, var(--_on-accent, var(--paper)));
26
+ --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px;
27
+ --ctl: 48px; --say: 34px; --amt: 96px;
28
+ --r-btn: var(--tensile-radius-button, 100px); --r-field: 12px; --r-frame: var(--tensile-radius-frame, 28px); --r-sm: 8px;
29
+ --display: var(--tensile-font-display, "TensileGeist", "Geist", "TensileInter", system-ui, sans-serif);
30
+ --text: var(--tensile-font-text, "TensileInter", "Inter", system-ui, sans-serif);
31
+ --mono: var(--tensile-font-mono, "TensileGeistMono", "Geist Mono", ui-monospace, monospace);
32
+ --track: -0.05em; --track-amt: -0.06em; --w-key: 640; --w-join: 520;
33
+ display: block; container-type: inline-size; color: var(--ink);
34
+ font: 400 14px/20px var(--text); -webkit-font-smoothing: antialiased;
35
+ }
36
+ :host([hidden]), :host([data-off]) { display: none; }
37
+ :host([data-theme="dark"]) {${dark}}
38
+ @media (prefers-color-scheme: dark) { :host([data-theme="auto"]) {${dark}} }
39
+ :host([data-density="compact"]) { --s2: 6px; --s3: 8px; --s4: 12px; --s5: 16px; --s6: 24px; --ctl: 40px; --say: 28px; --amt: 76px; }
40
+ :host([data-radius="sharp"]) { --r-btn: var(--tensile-radius-button, 2px); --r-field: 2px; --r-frame: var(--tensile-radius-frame, 4px); --r-sm: 2px; }
41
+ :host([data-radius="soft"]) { --r-btn: var(--tensile-radius-button, 10px); --r-field: 8px; --r-frame: var(--tensile-radius-frame, 18px); --r-sm: 6px; }
42
+ :host([data-font="tight"]) { --display: var(--tensile-font-display, "Inter Tight", "TensileInter", system-ui, sans-serif); --track: -0.045em; --w-key: 620; --w-join: 560; }
43
+ :host([data-font="serif"]) { --display: var(--tensile-font-display, "Newsreader", "Iowan Old Style", Georgia, serif); --track: -0.025em; --track-amt: -0.035em; --w-key: 560; --w-join: 420; --say: 38px; }
44
+ :host([data-font="serif"][data-density="compact"]) { --say: 31px; }
45
+ :host([data-font="system"]) { --display: var(--tensile-font-display, system-ui, -apple-system, "Segoe UI", sans-serif); --text: var(--tensile-font-text, system-ui, -apple-system, "Segoe UI", sans-serif); --mono: var(--tensile-font-mono, ui-monospace, monospace); --track: -0.03em; --track-amt: -0.04em; }
46
+
47
+ * { box-sizing: border-box; }
48
+ [hidden] { display: none !important; }
49
+ :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
50
+ .num { font-variant-numeric: tabular-nums lining-nums; }
51
+ .vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
52
+
53
+ .scr { width: 100%; max-width: 390px; margin: 0 auto; background: var(--paper); border: 1px solid var(--line-2); border-radius: var(--r-frame); padding: var(--s5); display: flex; flex-direction: column; overflow-wrap: anywhere; }
54
+ .app { display: flex; align-items: center; gap: var(--s2); font: 600 15px/20px var(--display); letter-spacing: -0.02em; min-height: 24px; color: var(--ink); }
55
+ .lm { width: 24px; height: 24px; border-radius: var(--r-sm); background: var(--accent); color: var(--on-accent); display: grid; place-items: center; font: 700 13px/1 var(--display); flex: none; }
56
+ .li { height: 24px; max-width: 96px; object-fit: contain; display: block; }
57
+
58
+ .say { font: var(--w-key) var(--say)/1.06 var(--display); letter-spacing: var(--track); margin: var(--s5) 0; text-wrap: balance; color: var(--ink); }
59
+ .say:focus { outline: none; }
60
+ .say .j { font-weight: var(--w-join); color: var(--tensile-join, var(--_join)); }
61
+ :host([data-font="serif"]) .say .j { font-style: italic; }
62
+ .say .ok { color: var(--green); }
63
+ .say .warn { color: var(--orange); }
64
+ .say .l { display: block; }
65
+ .agent { color: var(--violet); }
66
+ .amt { display: block; font-size: var(--amt); line-height: 0.84; letter-spacing: var(--track-amt); white-space: nowrap; overflow: hidden; margin: 0.16em 0 0.1em -0.04em; padding-bottom: 0.04em; font-variant-numeric: tabular-nums lining-nums; }
67
+ .amt .cur { font-size: 0.5em; vertical-align: 0.74em; margin-right: 0.04em; letter-spacing: 0; font-weight: var(--w-join); color: var(--tensile-join, var(--_join)); }
68
+
69
+ .ttl { margin: var(--s5) 0 var(--s4); }
70
+ .ttl h2 { font: 600 22px/28px var(--display); letter-spacing: -0.025em; margin: 0; text-wrap: balance; color: var(--ink); }
71
+ .ttl h2:focus { outline: none; }
72
+ .ttl .lead { color: var(--soft); margin: var(--s1) 0 0; font-size: 15px; line-height: 22px; text-wrap: pretty; }
73
+
74
+ .body, .stack { display: flex; flex-direction: column; gap: var(--s3); }
75
+ .acts { display: flex; flex-direction: column; gap: var(--s2); margin-top: var(--s1); }
76
+ .btn { appearance: none; display: inline-flex; align-items: center; justify-content: center; gap: var(--s2); width: 100%; min-height: var(--ctl); padding: 0 var(--s5); border-radius: var(--r-btn); border: 1px solid var(--line-2); background: var(--paper); color: var(--ink); font: 500 15px/1.2 var(--text); cursor: pointer; transition: transform 120ms ease; text-align: center; }
77
+ .btn:active { transform: scale(0.98); }
78
+ .btn.fill { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
79
+ .btn.sm { min-height: 40px; font-size: 14px; }
80
+ .btn[aria-disabled="true"], .btn:disabled { background: var(--well); color: var(--soft); border-color: var(--line-2); cursor: default; }
81
+ .lnk { appearance: none; background: none; border: 0; padding: 0 var(--s2); min-height: 40px; align-self: center; font: 500 14px/20px var(--text); color: var(--ink); text-decoration: underline; text-decoration-color: var(--ul); text-underline-offset: 3px; cursor: pointer; }
82
+ .lnk.in { min-height: 24px; padding: 0; font-size: 13px; }
83
+ .f label { display: block; font: 500 13px/18px var(--text); color: var(--mute); }
84
+ .f .hint { font-size: 13px; line-height: 18px; color: var(--mute); margin: var(--s1) 0 0; }
85
+ .fi { position: relative; }
86
+ input { width: 100%; height: var(--ctl); border: 0; border-bottom: 1.5px solid var(--ink); border-radius: 0; padding: 0; font: 400 16px/1 var(--text); color: var(--ink); background: transparent; }
87
+ input::placeholder { color: var(--quiet); opacity: 1; }
88
+ input:focus-visible { outline: 0; border-bottom-width: 2.5px; border-color: var(--accent); }
89
+ input[aria-invalid="true"] { border-color: var(--orange); }
90
+ input.code { font-family: var(--mono); font-size: 17px; letter-spacing: 0.24em; }
91
+ input.code::placeholder { letter-spacing: 0; font-family: var(--text); font-size: 16px; }
92
+ .afk { position: absolute; right: 0; top: 50%; transform: translateY(-50%); color: var(--mute); display: grid; }
93
+ .afk svg { width: 18px; height: 18px; }
94
+ .fi:has(.afk) input { padding-right: 28px; }
95
+ .or { display: flex; align-items: center; gap: var(--s3); margin: var(--s3) 0 var(--s1); color: var(--mute); font-size: 13px; line-height: 1; }
96
+ .or::before, .or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
97
+ .as { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); margin: 0; font-weight: 500; min-width: 0; }
98
+ .as .lnk { padding: 0; min-height: 32px; font-size: 13px; flex: none; }
99
+ .nm { display: flex; flex-direction: column; min-width: 0; flex: 1; }
100
+ .nm b { font-weight: 500; }
101
+ .nm small { font-size: 12.5px; line-height: 18px; color: var(--mute); }
102
+ .chip { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: min(var(--r-btn), 100px); font: 500 12px/1 var(--text); background: var(--chip); color: var(--soft); white-space: nowrap; flex: none; }
103
+ .chip.green { background: var(--green-t); color: var(--green); }
104
+ .chip.orange { background: var(--orange-t); color: var(--orange); }
105
+ .cap { font-size: 13px; line-height: 18px; color: var(--mute); margin: 0; text-wrap: pretty; }
106
+ .fine { color: var(--soft); font-size: 15px; line-height: 22px; margin: 0; text-wrap: pretty; }
107
+ .done { display: flex; flex-direction: column; gap: var(--s3); align-items: flex-start; }
108
+ .done p { margin: 0; font: var(--w-key) 26px/30px var(--display); letter-spacing: -0.03em; text-wrap: balance; color: var(--ink); }
109
+ .done .lnk { align-self: flex-start; padding: 0; }
110
+ .subject { display: flex; gap: var(--s3); align-items: center; }
111
+ .since { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: var(--s2); color: var(--soft); text-wrap: pretty; }
112
+ .since li { position: relative; padding-left: 18px; }
113
+ .since li::before { content: ""; position: absolute; left: 0; top: 9px; width: 8px; height: 2px; border-radius: 1px; background: var(--orange); }
114
+ .since.ok li::before { background: var(--green); }
115
+ .err { margin: 0; font-size: 13px; line-height: 18px; color: var(--orange); }
116
+ .note { margin: 0; font-size: 13px; line-height: 18px; color: var(--soft); }
117
+ .gl { width: 22px; height: 22px; flex: none; display: inline-block; }
118
+ .gl.agent { color: var(--violet); }
119
+
120
+ /* sessions */
121
+ .tree, .tree ul, .log, .inbox { list-style: none; margin: 0; padding: 0; }
122
+ .node.dev { border-top: 1px solid var(--line); padding: var(--s1) 0; }
123
+ .row { display: flex; align-items: center; gap: 10px; min-height: 44px; min-width: 0; }
124
+ .dev > .row .nm b { font: 600 17px/22px var(--display); letter-spacing: -0.02em; }
125
+ .node.ag > .row .nm b { color: var(--violet); font-size: 15px; }
126
+ .node.ag { position: relative; padding-left: 22px; }
127
+ .node.ag::before { content: ""; position: absolute; left: 10px; top: 0; width: 8px; height: 22px; border-left: 1.5px solid var(--ink); border-bottom: 1.5px solid var(--ink); border-bottom-left-radius: 6px; }
128
+ .rv { appearance: none; border: 0; background: none; padding: 0 2px; min-height: 40px; min-width: 44px; font: 500 13px/1 var(--text); color: var(--ink); text-decoration: underline; text-decoration-color: var(--ul); text-underline-offset: 3px; cursor: pointer; flex: none; }
129
+ .rv[aria-disabled="true"] { color: var(--orange); text-decoration: none; cursor: default; }
130
+ .revoked > .row .nm b { text-decoration: line-through; }
131
+ .acct .acts { margin-top: var(--s4); }
132
+
133
+ /* approvals inbox */
134
+ .req { border-top: 1px solid var(--line); padding: var(--s3) 0; display: flex; flex-direction: column; gap: var(--s2); }
135
+ .req .what { margin: 0; font-size: 15px; line-height: 22px; }
136
+ .req .what b { color: var(--violet); font-weight: 600; }
137
+ .two { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2); }
138
+
139
+ /* activity */
140
+ .vrow { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0 var(--s2); margin: calc(var(--s3) * -1) 0 var(--s2); color: var(--mute); font-size: 13px; }
141
+ .vrow .lnk { padding: 0; font-size: 13px; min-height: 32px; flex: none; }
142
+ .vrow > .lnk:only-child { margin-left: auto; }
143
+ .ev { display: grid; grid-template-columns: 24px minmax(0, 1fr); column-gap: 10px; align-items: start; padding: 9px 0; border-top: 1px solid var(--line); }
144
+ .ev .who { grid-row: 1 / 3; padding-top: 1px; display: flex; }
145
+ .ev .who .gl { width: 24px; height: 24px; }
146
+ .ev .what { margin: 0; font-size: 14.5px; line-height: 20px; text-wrap: pretty; }
147
+ .ev .what b { font-weight: 600; }
148
+ .ev .what b.agent { color: var(--violet); }
149
+ .ev time { color: var(--mute); font-size: 12.5px; line-height: 18px; }
150
+ .seal { display: none; }
151
+
152
+ /* setup */
153
+ .steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
154
+ .step { border-top: 1px solid var(--line); padding: var(--s3) 0; }
155
+ .step:first-child { border-top-color: var(--ink); }
156
+ .step:last-child { padding-bottom: 0; }
157
+ .st { display: flex; align-items: center; gap: 10px; min-height: 26px; margin: 0; font: inherit; }
158
+ .st b { font-weight: 500; flex: 1; }
159
+ .n { width: 24px; height: 24px; border-radius: var(--r-sm); border: 1px solid var(--line-2); font: 600 12px/1 var(--text); display: grid; place-items: center; flex: none; }
160
+ .step.on .n { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
161
+ .sb { display: flex; flex-direction: column; gap: var(--s3); padding-top: var(--s3); }
162
+ .codes { font: 400 12px/20px var(--mono); margin: 0; padding: 10px 12px; background: var(--well); border: 1px solid var(--line); border-radius: min(var(--r-field), 10px); overflow-x: auto; color: var(--ink); }
163
+ .qr { align-self: center; width: 164px; padding: 6px; border-radius: 12px; background: #fff; border: 1px solid var(--line); }
164
+ .qr svg { display: block; width: 100%; }
165
+ .key { font: 500 13px/20px var(--mono); color: var(--ink); overflow-wrap: anywhere; }
166
+
167
+ /* wide: a page section instead of a card */
168
+ @container (min-width: 720px) {
169
+ .wide .scr { max-width: none; border: 0; border-radius: 0; padding: var(--s6) 0; background: transparent; }
170
+ .wide .app { display: none; }
171
+ .wide .say, .wide .ttl { text-align: center; margin: 0 auto var(--s6); max-width: 720px; }
172
+ .wide .say { font-size: calc(var(--say) * 1.5); }
173
+ .wide .vrow { justify-content: center; gap: 16px; margin: calc(var(--s5) * -1) 0 var(--s6); }
174
+ .wide .vrow > .lnk:only-child { margin-left: 0; }
175
+ .wide .acts { align-items: center; margin-top: var(--s6); }
176
+ .wide .acts .btn { width: auto; min-height: 40px; font-size: 14px; }
177
+ .wide .tree { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s5) 32px; align-items: start; max-width: 964px; margin: 0 auto; }
178
+ .wide .tree > .node { flex: 0 1 300px; min-width: 0; border-top: 1.5px solid var(--ink); padding-top: var(--s2); }
179
+ .wide .log, .wide .inbox { max-width: 960px; margin: 0 auto; width: 100%; }
180
+ .wide .ev { grid-template-columns: 24px minmax(0, 1fr) 150px 72px; align-items: center; column-gap: 20px; }
181
+ .wide .ev .who { grid-row: auto; }
182
+ .wide .seal { display: block; font: 400 12px/18px var(--mono); color: var(--mute); text-align: right; }
183
+ .wide .req { flex-direction: row; align-items: center; justify-content: space-between; }
184
+ .wide .req .two { flex: none; width: 260px; }
185
+ }
186
+ @media (prefers-reduced-motion: reduce) {
187
+ *, *::before, *::after { transition: none !important; animation: none !important; }
188
+ }
189
+ `;
190
+ /** The @font-face rules for the bundled fonts, relative to `base`. */
191
+ export function fontFaces(base) {
192
+ const face = (family, file) => `@font-face{font-family:"${family}";font-weight:100 900;font-style:normal;font-display:swap;src:url("${base}${file}") format("woff2")}`;
193
+ return face('TensileGeist', 'geist.woff2') + face('TensileInter', 'inter.woff2') + face('TensileGeistMono', 'geist-mono.woff2');
194
+ }
@@ -0,0 +1,21 @@
1
+ export declare const english: Readonly<Record<string, string>>;
2
+ /** Fills {name} values in a template. A missing value becomes empty. */
3
+ export declare function fill(template: string, vars?: Record<string, string | number>): string;
4
+ /** One run of a sentence: its text and how it is shown. */
5
+ export interface Run {
6
+ /** The run's template, which may hold {name} values. */
7
+ text: string;
8
+ kind: 'key' | 'join' | 'ok' | 'warn' | 'value';
9
+ /** The name of the value, for a `value` run. */
10
+ name?: string;
11
+ }
12
+ /**
13
+ * Splits a template into runs: [words] are `join`, *words* are `ok`,
14
+ * !words! are `warn`, and the rest is `key`. A {name} outside markup is a
15
+ * `value` run of its own, so the caller can render it, for example in
16
+ * bold; inside markup it stays in its run's text. The caller fills values
17
+ * after splitting, so a value never adds markup.
18
+ */
19
+ export declare function runs(template: string): Run[];
20
+ /** The plain text of a template: its markup removed and its values filled. */
21
+ export declare function plain(template: string, vars?: Record<string, string | number>): string;