@domicile-desktop/manganese-page-requests 1.2.0 → 1.3.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/package.json CHANGED
@@ -1,43 +1,47 @@
1
1
  {
2
2
  "dependencies": {
3
3
  "@cprussin/option-result": "^2.0.1",
4
- "@domicile-desktop/component-library": "2.1.0",
5
- "@domicile-desktop/sdk": "2.2.0",
6
- "@domicile-desktop/system-apps": "1.2.0",
7
- "@pandacss/dev": "^1.12.1",
4
+ "@domicile-desktop/component-library": "2.2.0",
5
+ "@domicile-desktop/sdk": "3.0.0",
6
+ "@domicile-desktop/system-apps": "1.3.0",
7
+ "@pandacss/dev": "^1.12.2",
8
8
  "@phosphor-icons/react": "^2.1.10",
9
- "react": "^19.2.8",
10
- "zod": "^4.5.4"
9
+ "react": "^19.3.1",
10
+ "zod": "^4.6.7"
11
11
  },
12
12
  "description": "Manganese's prompts for a web page's permission, device and dialog requests.",
13
13
  "devDependencies": {
14
14
  "@cprussin/tsconfig": "^5.0.0",
15
15
  "@domicile-desktop/test-support": "0.0.2",
16
- "@pandacss/preset-panda": "^1.12.1",
16
+ "@pandacss/preset-panda": "^1.12.2",
17
17
  "@testing-library/react": "^16.3.3",
18
- "@testing-library/user-event": "^14.6.7",
19
- "@types/bun": "^1.4.2",
20
- "@types/react": "^19.2.18",
21
- "@types/react-dom": "^19.2.7",
22
- "postcss": "^8.5.28",
18
+ "@testing-library/user-event": "^14.6.10",
19
+ "@types/bun": "^1.4.4",
20
+ "@types/react": "^19.3.0",
21
+ "@types/react-dom": "^19.3.0",
22
+ "postcss": "^8.5.32",
23
23
  "typescript": "^7.0.2"
24
24
  },
25
25
  "engines": {
26
26
  "bun": ">=1.4.2"
27
27
  },
28
28
  "exports": {
29
+ "./AppMessageBox": "./src/AppMessageBox.tsx",
29
30
  "./DeviceAsk": "./src/DeviceAsk.tsx",
30
31
  "./ExternalAppAsk": "./src/ExternalAppAsk.tsx",
32
+ "./IdentityAsk": "./src/IdentityAsk.tsx",
31
33
  "./PageDialog": "./src/PageDialog.tsx",
32
34
  "./PermissionAsk": "./src/PermissionAsk.tsx",
33
35
  "./PickerAsk": "./src/PickerAsk.tsx",
34
36
  "./PromptAsk": "./src/PromptAsk.tsx",
35
37
  "./permission-names": "./src/permission-names.tsx",
36
38
  "./SignInAsk": "./src/SignInAsk.tsx",
39
+ "./shell-links": "./src/shell-links.ts",
37
40
  "./site-permissions": "./src/site-permissions.ts",
38
41
  "./useDeviceRequest": "./src/useDeviceRequest.ts",
39
42
  "./useDialogRequest": "./src/useDialogRequest.ts",
40
43
  "./useExternalAppRequest": "./src/useExternalAppRequest.ts",
44
+ "./useIdentityRequest": "./src/useIdentityRequest.ts",
41
45
  "./useLinkOpener": "./src/useLinkOpener.ts",
42
46
  "./usePermissionRequest": "./src/usePermissionRequest.ts",
43
47
  "./usePickerRequest": "./src/usePickerRequest.ts",
@@ -67,5 +71,5 @@
67
71
  "test:unit": "bun test"
68
72
  },
69
73
  "type": "module",
70
- "version": "1.2.0"
74
+ "version": "1.3.0"
71
75
  }
@@ -0,0 +1,72 @@
1
+ import { Button } from "@domicile-desktop/component-library/Button";
2
+ import { Switch } from "@domicile-desktop/component-library/Switch";
3
+ import type { MessageBox } from "@domicile-desktop/sdk/message-box";
4
+ import type { RefCallback } from "react";
5
+ import { useState } from "react";
6
+
7
+ import { PageModal } from "./PageModal";
8
+
9
+ type Props = {
10
+ box: MessageBox;
11
+ /** The user pressed button `button`, leaving the checkbox `checked`. */
12
+ onAnswer: (button: number, checked: boolean) => void;
13
+ /** Gets the element to focus: the default button, or else Cancel. */
14
+ ref?: RefCallback<HTMLElement> | undefined;
15
+ };
16
+
17
+ /**
18
+ * An Electron app's message box (`dialog.showMessageBox`), over the window
19
+ * that asked, as a page's `confirm()` is.
20
+ *
21
+ * The app's buttons, in the app's order, with its default one in the accent
22
+ * color. A `PageModal`: Enter presses the default button, if the app named
23
+ * one, and Escape presses its cancel button. The app's checkbox, such as
24
+ * "Don't ask again", is a switch, as other asks' are. Takes no focus itself:
25
+ * the caller focuses `ref`'s element as its own focus rules allow. Key it by
26
+ * the box, so each starts with the app's checkbox.
27
+ */
28
+ export const AppMessageBox = ({ box, onAnswer, ref }: Props) => {
29
+ const [checked, setChecked] = useState(box.checkboxChecked);
30
+ const focused = box.defaultButton ?? box.cancelButton;
31
+ return (
32
+ <PageModal
33
+ footer={box.buttons.map((label, button) => (
34
+ <Button
35
+ // The app's buttons have no ids but their places, which a box never
36
+ // changes.
37
+ key={button}
38
+ onClick={
39
+ button === box.defaultButton
40
+ ? undefined
41
+ : () => {
42
+ onAnswer(button, checked);
43
+ }
44
+ }
45
+ ref={button === focused ? ref : undefined}
46
+ type={button === box.defaultButton ? "submit" : "button"}
47
+ variant={button === box.defaultButton ? "accent" : "outline"}
48
+ >
49
+ {label}
50
+ </Button>
51
+ ))}
52
+ message={box.detail === "" ? undefined : box.detail}
53
+ onDismiss={() => {
54
+ onAnswer(box.cancelButton, checked);
55
+ }}
56
+ onSubmit={() => {
57
+ if (box.defaultButton !== undefined) {
58
+ onAnswer(box.defaultButton, checked);
59
+ }
60
+ }}
61
+ title={box.message}
62
+ >
63
+ {box.checkbox !== undefined && (
64
+ <Switch
65
+ checked={checked}
66
+ label={box.checkbox}
67
+ onCheckedChange={setChecked}
68
+ />
69
+ )}
70
+ </PageModal>
71
+ );
72
+ };
package/src/DeviceAsk.tsx CHANGED
@@ -1,4 +1,7 @@
1
1
  import { Button } from "@domicile-desktop/component-library/Button";
2
+ import { EmptyState } from "@domicile-desktop/component-library/EmptyState";
3
+ import { Loading } from "@domicile-desktop/component-library/Loading";
4
+ import { DevicesIcon } from "@phosphor-icons/react/dist/ssr/Devices";
2
5
  import { useId, useState } from "react";
3
6
 
4
7
  import { css } from "../styled-system/css";
@@ -25,10 +28,14 @@ export const DeviceAsk = ({ request }: Props) => {
25
28
  {request.title}
26
29
  </span>
27
30
  {request.devices === undefined && (
28
- <span className={noteStyles}>Looking for devices…</span>
31
+ <Loading icon={DevicesIcon}>Looking for devices…</Loading>
29
32
  )}
30
33
  {request.devices?.length === 0 && (
31
- <span className={noteStyles}>No compatible devices found</span>
34
+ <EmptyState
35
+ hint="Plug in or turn on the device, and it shows up here."
36
+ icon={DevicesIcon}
37
+ title="No devices found"
38
+ />
32
39
  )}
33
40
  {request.devices !== undefined && request.devices.length > 0 && (
34
41
  <ul aria-label="Devices" className={devicesStyles}>
@@ -87,8 +94,6 @@ const askingTextStyles = css({
87
94
  overflowWrap: "anywhere",
88
95
  });
89
96
 
90
- const noteStyles = css({ color: "muted", fontSize: "sm" });
91
-
92
97
  const devicesStyles = vstack({
93
98
  alignItems: "stretch",
94
99
  gap: 1,
@@ -0,0 +1,635 @@
1
+ import { Avatar } from "@domicile-desktop/component-library/Avatar";
2
+ import { Button } from "@domicile-desktop/component-library/Button";
3
+ import { IconButton } from "@domicile-desktop/component-library/IconButton";
4
+ import { Loading } from "@domicile-desktop/component-library/Loading";
5
+ import type {
6
+ WebViewIdentityAccount,
7
+ WebViewIdentityField,
8
+ WebViewIdentityProvider,
9
+ WebViewIdentityPurpose,
10
+ } from "@domicile-desktop/sdk/webview-element";
11
+ import { XIcon } from "@phosphor-icons/react/dist/ssr/X";
12
+ import type { ReactNode, RefCallback } from "react";
13
+ import { useId } from "react";
14
+
15
+ import { css } from "../styled-system/css";
16
+ import { flex, hstack, vstack } from "../styled-system/patterns";
17
+ import { PageModal } from "./PageModal";
18
+ import type { IdentityRequest } from "./useIdentityRequest";
19
+
20
+ type Props = {
21
+ /** Opens a link the step shows, such as the site's privacy policy. */
22
+ onOpenLink: (url: string) => void;
23
+ /**
24
+ * Gets the element to focus: the step's first answer. Only after the
25
+ * page's own button: a step the site offers unasked takes no focus.
26
+ */
27
+ ref?: RefCallback<HTMLElement> | undefined;
28
+ request: IdentityRequest;
29
+ };
30
+
31
+ /**
32
+ * A site's "Sign in with" step: the accounts to sign in with, signed out of
33
+ * the provider, signing in, or the provider's refusal.
34
+ *
35
+ * After the page's own sign-in button it asks over the page, as a
36
+ * `PageModal`: Escape cancels. Offered unasked, as a site does on load, it
37
+ * sits in the page's top corner without dimming it, and ✕ closes it.
38
+ */
39
+ export const IdentityAsk = ({ onOpenLink, ref, request }: Props) => {
40
+ const step = stepFor(request, onOpenLink, request.button ? ref : undefined);
41
+ return request.button ? (
42
+ <PageModal
43
+ footer={
44
+ <>
45
+ {step.extra}
46
+ {step.dismiss !== undefined && (
47
+ <Button
48
+ onClick={request.dismiss}
49
+ ref={step.dismiss.focused ? ref : undefined}
50
+ variant={step.dismiss.primary ? "accent" : "outline"}
51
+ >
52
+ {step.dismiss.label}
53
+ </Button>
54
+ )}
55
+ {step.primary}
56
+ </>
57
+ }
58
+ message={step.message}
59
+ note={step.note}
60
+ onDismiss={step.dismiss === undefined ? () => undefined : request.dismiss}
61
+ onSubmit={step.submit}
62
+ title={<StepTitle icon={step.icon} title={step.title} />}
63
+ >
64
+ {step.body}
65
+ </PageModal>
66
+ ) : (
67
+ <CornerCard
68
+ footer={
69
+ <>
70
+ {step.extra}
71
+ {step.dismiss?.primary === true && (
72
+ <Button onClick={request.dismiss} size="sm" variant="accent">
73
+ {step.dismiss.label}
74
+ </Button>
75
+ )}
76
+ {step.primary}
77
+ </>
78
+ }
79
+ hasFooter={
80
+ step.extra !== undefined ||
81
+ step.primary !== undefined ||
82
+ step.dismiss?.primary === true
83
+ }
84
+ message={step.message}
85
+ note={step.note}
86
+ onClose={
87
+ step.dismiss === undefined || step.dismiss.primary
88
+ ? undefined
89
+ : request.dismiss
90
+ }
91
+ title={<StepTitle icon={step.icon} title={step.title} />}
92
+ >
93
+ {step.body}
94
+ </CornerCard>
95
+ );
96
+ };
97
+
98
+ /** What a step shows, laid out over the page or in its corner. */
99
+ type Step = {
100
+ /** The provider's icon, drawn before the title. */
101
+ icon: WebViewIdentityProvider | undefined;
102
+ title: string;
103
+ message?: string | undefined;
104
+ body?: ReactNode;
105
+ note?: ReactNode;
106
+ /** The answer Enter gives, as its button. */
107
+ primary?: ReactNode;
108
+ submit: () => void;
109
+ /** Answers beside it, such as "Use another account". */
110
+ extra?: ReactNode;
111
+ /**
112
+ * The button that dismisses: Cancel, or OK where dismissing is the answer.
113
+ * `focused` where it is the step's first answer, so it takes the keyboard.
114
+ * None where the step takes no answer.
115
+ */
116
+ dismiss: { label: string; primary: boolean; focused: boolean } | undefined;
117
+ };
118
+
119
+ /** The step's words and answers. */
120
+ const stepFor = (
121
+ request: IdentityRequest,
122
+ onOpenLink: (url: string) => void,
123
+ ref: RefCallback<HTMLElement> | undefined,
124
+ ): Step => {
125
+ const provider = providerAt(request, 0);
126
+ const providerName = provider.name;
127
+ switch (request.step) {
128
+ case "loading":
129
+ return {
130
+ body: (
131
+ <span className={waitingStyles}>
132
+ <Loading layout="glyph">Finding your accounts…</Loading>
133
+ <span aria-hidden>Finding your accounts…</span>
134
+ </span>
135
+ ),
136
+ dismiss: { focused: true, label: "Cancel", primary: false },
137
+ icon: provider,
138
+ submit: () => undefined,
139
+ title: titleFor(request),
140
+ };
141
+ case "accounts":
142
+ return accountsStep(request, onOpenLink, ref);
143
+ case "signed-out":
144
+ return {
145
+ dismiss: { focused: false, label: "Cancel", primary: false },
146
+ icon: provider,
147
+ message: `You're not signed in to ${providerName}. Sign in there, then come back to pick your account.`,
148
+ primary: (
149
+ <AnswerButton
150
+ answer={() => {
151
+ request.signInToProvider(0);
152
+ }}
153
+ modal={request.button}
154
+ ref={ref}
155
+ >
156
+ {`Sign in to ${providerName}`}
157
+ </AnswerButton>
158
+ ),
159
+ submit: () => {
160
+ request.signInToProvider(0);
161
+ },
162
+ title: titleFor(request),
163
+ };
164
+ case "verifying":
165
+ return {
166
+ body: request.accounts.map((account) => (
167
+ <span className={verifyingStyles} key={account.identifier}>
168
+ <AccountLabel account={account} />
169
+ <Loading layout="glyph">Signing in</Loading>
170
+ </span>
171
+ )),
172
+ dismiss: undefined,
173
+ icon: provider,
174
+ submit: () => undefined,
175
+ title: `Signing you in to ${request.site}`,
176
+ };
177
+ case "error":
178
+ return {
179
+ dismiss: { focused: true, label: "OK", primary: true },
180
+ extra:
181
+ request.errorUrl === "" ? undefined : (
182
+ <Button
183
+ onClick={request.moreDetails}
184
+ size={request.button ? "md" : "sm"}
185
+ variant="outline"
186
+ >
187
+ More details
188
+ </Button>
189
+ ),
190
+ icon: provider,
191
+ message: `${providerName} didn't let ${request.site} sign you in. Try again later, or use the site's own sign-in.`,
192
+ submit: request.dismiss,
193
+ title: `Can't sign in with ${providerName}`,
194
+ };
195
+ }
196
+ };
197
+
198
+ /**
199
+ * The accounts: one to continue as, or several to pick from, with what
200
+ * signing in shares the first time.
201
+ */
202
+ const accountsStep = (
203
+ request: IdentityRequest,
204
+ onOpenLink: (url: string) => void,
205
+ ref: RefCallback<HTMLElement> | undefined,
206
+ ): Step => {
207
+ const size = request.button ? "md" : "sm";
208
+ const only = request.accounts.length === 1 ? request.accounts[0] : undefined;
209
+ const sharing = request.accounts.find(({ shared }) => shared.length > 0);
210
+ const adders = request.providers.flatMap((provider, index) =>
211
+ provider.addAccount ? [{ index, provider }] : [],
212
+ );
213
+ return {
214
+ body:
215
+ only === undefined ? (
216
+ <ul aria-label="Accounts" className={accountsStyles}>
217
+ {request.accounts.map((account, index) => (
218
+ <li key={`${account.provider}\n${account.identifier}`}>
219
+ <button
220
+ className={accountButtonStyles}
221
+ onClick={() => {
222
+ request.choose(index);
223
+ }}
224
+ ref={index === 0 ? ref : undefined}
225
+ type="button"
226
+ >
227
+ <AccountLabel account={account} />
228
+ </button>
229
+ </li>
230
+ ))}
231
+ </ul>
232
+ ) : (
233
+ <span className={onlyAccountStyles}>
234
+ <AccountLabel account={only} />
235
+ </span>
236
+ ),
237
+ dismiss: { focused: false, label: "Cancel", primary: false },
238
+ extra:
239
+ adders.length === 0
240
+ ? undefined
241
+ : adders.map(({ index, provider }) => (
242
+ <Button
243
+ key={provider.name}
244
+ onClick={() => {
245
+ request.signInToProvider(index);
246
+ }}
247
+ size={size}
248
+ variant="outline"
249
+ >
250
+ {adders.length === 1 && request.providers.length === 1
251
+ ? "Use another account"
252
+ : `Use another ${provider.name} account`}
253
+ </Button>
254
+ )),
255
+ icon: request.providers.length === 1 ? request.providers[0] : undefined,
256
+ note:
257
+ sharing === undefined ? undefined : (
258
+ <Disclosure
259
+ account={sharing}
260
+ onOpenLink={onOpenLink}
261
+ provider={providerAt(request, sharing.provider)}
262
+ site={request.site}
263
+ />
264
+ ),
265
+ primary:
266
+ only === undefined ? undefined : (
267
+ <AnswerButton
268
+ answer={() => {
269
+ request.choose(0);
270
+ }}
271
+ modal={request.button}
272
+ ref={ref}
273
+ >
274
+ {`Continue as ${firstNameOf(only.name)}`}
275
+ </AnswerButton>
276
+ ),
277
+ submit:
278
+ only === undefined
279
+ ? () => undefined
280
+ : () => {
281
+ request.choose(0);
282
+ },
283
+ title: titleFor(request),
284
+ };
285
+ };
286
+
287
+ /**
288
+ * The step's answer. Over the page it submits the `PageModal`, whose submit
289
+ * answers, so Enter does too; in the corner it answers on its own.
290
+ */
291
+ const AnswerButton = ({
292
+ answer,
293
+ children,
294
+ modal,
295
+ ref,
296
+ }: {
297
+ answer: () => void;
298
+ children: string;
299
+ modal: boolean;
300
+ ref: RefCallback<HTMLElement> | undefined;
301
+ }) =>
302
+ modal ? (
303
+ <Button ref={ref} type="submit" variant="accent">
304
+ {children}
305
+ </Button>
306
+ ) : (
307
+ <Button onClick={answer} size="sm" variant="accent">
308
+ {children}
309
+ </Button>
310
+ );
311
+
312
+ /**
313
+ * The provider at `index`. The engine sends every step its provider and every
314
+ * account its provider's index, so a missing one is the engine's bug.
315
+ */
316
+ const providerAt = (
317
+ request: IdentityRequest,
318
+ index: number,
319
+ ): WebViewIdentityProvider => {
320
+ const provider = request.providers[index];
321
+ if (provider === undefined) {
322
+ throw new Error(
323
+ `"Sign in with" ${request.step} step has no provider ${index}`,
324
+ );
325
+ } else {
326
+ return provider;
327
+ }
328
+ };
329
+
330
+ /** "Sign in to medium.com with google.com", by what the site signs in for. */
331
+ const titleFor = (request: IdentityRequest): string => {
332
+ const verb = PURPOSE_VERBS[request.purpose];
333
+ const provider = request.providers[0];
334
+ return request.providers.length === 1 && provider !== undefined
335
+ ? `${verb} ${request.site} with ${provider.name}`
336
+ : `${verb} ${request.site}`;
337
+ };
338
+
339
+ const PURPOSE_VERBS: Record<WebViewIdentityPurpose, string> = {
340
+ continue: "Continue to",
341
+ "sign-in": "Sign in to",
342
+ "sign-up": "Sign up to",
343
+ use: "Use",
344
+ };
345
+
346
+ /** The name to greet an account by: its first word. */
347
+ const firstNameOf = (name: string): string => name.split(/\s+/u)[0] ?? name;
348
+
349
+ /** The title, after the provider's icon. */
350
+ const StepTitle = ({
351
+ icon,
352
+ title,
353
+ }: {
354
+ icon: WebViewIdentityProvider | undefined;
355
+ title: string;
356
+ }) => (
357
+ <>
358
+ {icon !== undefined && (
359
+ // The title names the provider; its icon only shows it.
360
+ <span aria-hidden className={iconStyles}>
361
+ <Avatar
362
+ name={icon.name}
363
+ size="xs"
364
+ src={icon.icon === "" ? undefined : icon.icon}
365
+ />
366
+ </span>
367
+ )}
368
+ {title}
369
+ </>
370
+ );
371
+
372
+ /** An account's picture, name and email. */
373
+ const AccountLabel = ({ account }: { account: WebViewIdentityAccount }) => (
374
+ <span className={accountStyles}>
375
+ <span aria-hidden className={iconStyles}>
376
+ <Avatar
377
+ name={account.name}
378
+ size="sm"
379
+ src={account.picture === "" ? undefined : account.picture}
380
+ />
381
+ </span>
382
+ <span className={whoStyles}>
383
+ <span className={nameStyles}>{account.name}</span>{" "}
384
+ <span className={identifierStyles}>{account.identifier}</span>
385
+ </span>
386
+ </span>
387
+ );
388
+
389
+ /**
390
+ * What signing in with `account` shares with the site, and the site's
391
+ * privacy policy and terms of service as its provider lists them.
392
+ */
393
+ const Disclosure = ({
394
+ account,
395
+ onOpenLink,
396
+ provider,
397
+ site,
398
+ }: {
399
+ account: WebViewIdentityAccount;
400
+ onOpenLink: (url: string) => void;
401
+ provider: WebViewIdentityProvider;
402
+ site: string;
403
+ }) => {
404
+ const links = [
405
+ { label: "privacy policy", url: provider.privacyPolicy },
406
+ { label: "terms of service", url: provider.termsOfService },
407
+ ].filter(({ url }) => url !== "");
408
+ return (
409
+ <>
410
+ {`To continue, ${provider.name} will share your ${listOf(account.shared.map((field) => FIELD_NAMES[field]))} with this site.`}
411
+ {links.length > 0 && ` See ${site}'s `}
412
+ {links.map(({ label, url }, index) => (
413
+ <span key={label}>
414
+ {index > 0 && " and "}
415
+ <a
416
+ className={linkStyles}
417
+ href={url}
418
+ onClick={(event) => {
419
+ event.preventDefault();
420
+ onOpenLink(url);
421
+ }}
422
+ >
423
+ {label}
424
+ </a>
425
+ </span>
426
+ ))}
427
+ {links.length > 0 && "."}
428
+ </>
429
+ );
430
+ };
431
+
432
+ const FIELD_NAMES: Record<WebViewIdentityField, string> = {
433
+ email: "email address",
434
+ name: "name",
435
+ "phone-number": "phone number",
436
+ picture: "profile picture",
437
+ username: "username",
438
+ };
439
+
440
+ /** "a", "a and b", "a, b and c". */
441
+ const listOf = (items: readonly string[]): string =>
442
+ items.length <= 1
443
+ ? (items[0] ?? "")
444
+ : `${items.slice(0, -1).join(", ")} and ${items.at(-1) ?? ""}`;
445
+
446
+ /**
447
+ * A step the site offered unasked, in the page's top corner: the page stays
448
+ * usable and keeps the keyboard.
449
+ */
450
+ const CornerCard = ({
451
+ children,
452
+ footer,
453
+ hasFooter,
454
+ message,
455
+ note,
456
+ onClose,
457
+ title,
458
+ }: {
459
+ children?: ReactNode;
460
+ footer: ReactNode;
461
+ hasFooter: boolean;
462
+ message?: string | undefined;
463
+ note?: ReactNode;
464
+ /** ✕, as Cancel. None where the step has no Cancel. */
465
+ onClose: (() => void) | undefined;
466
+ title: ReactNode;
467
+ }) => {
468
+ const titleId = useId();
469
+ const messageId = useId();
470
+ return (
471
+ <section
472
+ aria-describedby={message === undefined ? undefined : messageId}
473
+ aria-labelledby={titleId}
474
+ className={cornerStyles}
475
+ role="dialog"
476
+ >
477
+ <div className={cornerCardStyles}>
478
+ <header className={cornerHeadStyles}>
479
+ <h2 className={cornerTitleStyles} id={titleId}>
480
+ {title}
481
+ </h2>
482
+ {onClose !== undefined && (
483
+ <IconButton label="Close" onClick={onClose} size="sm">
484
+ <XIcon />
485
+ </IconButton>
486
+ )}
487
+ </header>
488
+ {message !== undefined && (
489
+ <p className={cornerMessageStyles} id={messageId}>
490
+ {message}
491
+ </p>
492
+ )}
493
+ {children}
494
+ {note !== undefined && <p className={cornerNoteStyles}>{note}</p>}
495
+ {hasFooter && <footer className={cornerFooterStyles}>{footer}</footer>}
496
+ </div>
497
+ </section>
498
+ );
499
+ };
500
+
501
+ const iconStyles = flex({ flexShrink: 0 });
502
+
503
+ const waitingStyles = hstack({
504
+ color: "muted",
505
+ fontSize: "sm",
506
+ gap: 2,
507
+ });
508
+
509
+ const verifyingStyles = hstack({
510
+ gap: 3,
511
+ justifyContent: "space-between",
512
+ });
513
+
514
+ const accountsStyles = vstack({
515
+ alignItems: "stretch",
516
+ gap: 0.5,
517
+ listStyle: "none",
518
+ margin: 0,
519
+ maxBlockSize: 60,
520
+ overflowY: "auto",
521
+ padding: 0,
522
+ });
523
+
524
+ const accountButtonStyles = css({
525
+ _focusVisible: {
526
+ outline: "2px solid {colors.accent}",
527
+ outlineOffset: "-2px",
528
+ },
529
+ _hover: {
530
+ backgroundColor: "color-mix(in oklab, {colors.accent} 12%, {colors.card})",
531
+ },
532
+ backgroundColor: "transparent",
533
+ border: "none",
534
+ borderRadius: "md",
535
+ color: "foreground",
536
+ cursor: "pointer",
537
+ display: "flex",
538
+ inlineSize: "100%",
539
+ padding: 2,
540
+ textAlign: "start",
541
+ });
542
+
543
+ const onlyAccountStyles = flex({ paddingInline: 2 });
544
+
545
+ const accountStyles = hstack({ gap: 2.5, minInlineSize: 0 });
546
+
547
+ const whoStyles = vstack({
548
+ alignItems: "flex-start",
549
+ gap: 0,
550
+ minInlineSize: 0,
551
+ });
552
+
553
+ const nameStyles = css({
554
+ color: "foreground",
555
+ fontSize: "sm",
556
+ fontWeight: "medium",
557
+ });
558
+
559
+ const identifierStyles = css({
560
+ color: "muted",
561
+ fontSize: "xs",
562
+ maxInlineSize: "100%",
563
+ overflow: "hidden",
564
+ textOverflow: "ellipsis",
565
+ whiteSpace: "nowrap",
566
+ });
567
+
568
+ const linkStyles = css({
569
+ _hover: { textDecoration: "underline" },
570
+ color: "accent",
571
+ textDecoration: "none",
572
+ });
573
+
574
+ // The top corner, clear of the page's own header, as Chrome places it.
575
+ const cornerStyles = flex({
576
+ insetBlockStart: 2,
577
+ insetInline: 2,
578
+ justifyContent: "flex-end",
579
+ pointerEvents: "none",
580
+ position: "absolute",
581
+ });
582
+
583
+ // `PageModal`'s popup, smaller.
584
+ const cornerCardStyles = vstack({
585
+ _starting: {
586
+ opacity: 0,
587
+ transform: "translateY({spacing.3}) scale(0.96)",
588
+ },
589
+ alignItems: "stretch",
590
+ backgroundColor: "card",
591
+ border: "1px solid {colors.border}",
592
+ borderRadius: "lg",
593
+ boxShadow: "modal",
594
+ gap: 3,
595
+ inlineSize: "min({spacing.84}, 100%)",
596
+ opacity: 1,
597
+ padding: 3.5,
598
+ pointerEvents: "auto",
599
+ transform: "translateY(0) scale(1)",
600
+ transition:
601
+ "opacity {durations.normal} {easings.out}, transform {durations.normal} {easings.out}",
602
+ });
603
+
604
+ const cornerHeadStyles = flex({ alignItems: "flex-start", gap: 2 });
605
+
606
+ const cornerTitleStyles = css({
607
+ alignItems: "center",
608
+ color: "foreground",
609
+ display: "flex",
610
+ flex: 1,
611
+ fontSize: "sm",
612
+ fontWeight: "semibold",
613
+ gap: 2.5,
614
+ lineHeight: "snug",
615
+ margin: 0,
616
+ overflowWrap: "anywhere",
617
+ });
618
+
619
+ const cornerMessageStyles = css({
620
+ color: "foreground",
621
+ fontSize: "sm",
622
+ margin: 0,
623
+ });
624
+
625
+ const cornerNoteStyles = css({
626
+ color: "muted",
627
+ fontSize: "xs",
628
+ margin: 0,
629
+ });
630
+
631
+ const cornerFooterStyles = flex({
632
+ gap: 2,
633
+ justifyContent: "flex-end",
634
+ wrap: "wrap",
635
+ });
package/src/PageModal.tsx CHANGED
@@ -8,9 +8,11 @@ type Props = {
8
8
  /** The question, which names the dialog. */
9
9
  title: ReactNode;
10
10
  /** The text under it, which describes the dialog. */
11
- message: ReactNode;
11
+ message?: ReactNode;
12
12
  /** Anything between the text and the buttons. */
13
13
  children?: ReactNode;
14
+ /** Small print over the buttons. */
15
+ note?: ReactNode;
14
16
  /** The buttons; a `submit` one answers yes. */
15
17
  footer: ReactNode;
16
18
  /** Escape, as Cancel. */
@@ -31,6 +33,7 @@ export const PageModal = ({
31
33
  children,
32
34
  footer,
33
35
  message,
36
+ note,
34
37
  onDismiss,
35
38
  onSubmit,
36
39
  title,
@@ -41,7 +44,7 @@ export const PageModal = ({
41
44
  <div className={scrimStyles}>
42
45
  {/* biome-ignore lint/a11y/noNoninteractiveElementInteractions: Escape cancels the dialog wherever focus is in it, as base-ui's dialogs do */}
43
46
  <form
44
- aria-describedby={messageId}
47
+ aria-describedby={message === undefined ? undefined : messageId}
45
48
  aria-labelledby={titleId}
46
49
  aria-modal="true"
47
50
  className={popupStyles}
@@ -60,10 +63,13 @@ export const PageModal = ({
60
63
  <h2 className={titleStyles} id={titleId}>
61
64
  {title}
62
65
  </h2>
63
- <p className={messageStyles} id={messageId}>
64
- {message}
65
- </p>
66
+ {message !== undefined && (
67
+ <p className={messageStyles} id={messageId}>
68
+ {message}
69
+ </p>
70
+ )}
66
71
  {children}
72
+ {note !== undefined && <p className={noteStyles}>{note}</p>}
67
73
  <footer className={footerStyles}>{footer}</footer>
68
74
  </form>
69
75
  </div>
@@ -127,6 +133,12 @@ const messageStyles = css({
127
133
  whiteSpace: "pre-wrap",
128
134
  });
129
135
 
136
+ const noteStyles = css({
137
+ color: "muted",
138
+ fontSize: "xs",
139
+ margin: 0,
140
+ });
141
+
130
142
  const footerStyles = flex({
131
143
  gap: 2,
132
144
  justifyContent: "flex-end",
@@ -0,0 +1,17 @@
1
+ import { createContext } from "react";
2
+
3
+ /**
4
+ * The links the shell opens itself, such as manganese's `mailto:` links,
5
+ * which open in an inbox. A page's link for an application that the shell
6
+ * opens goes to `open` rather than asking which application.
7
+ */
8
+ export type ShellLinks = {
9
+ /** Whether the shell opens `url` itself. */
10
+ opens: (url: string) => boolean;
11
+ open: (url: string) => void;
12
+ };
13
+
14
+ /** The shell's {@link ShellLinks}; none when it opens no links itself. */
15
+ export const ShellLinksContext = createContext<ShellLinks | undefined>(
16
+ undefined,
17
+ );
@@ -2,7 +2,9 @@ import {
2
2
  WEBVIEW_EXTERNAL_APP_EVENT,
3
3
  WEBVIEW_EXTERNAL_APP_WITHDRAWN_EVENT,
4
4
  } from "@domicile-desktop/sdk/webview-element";
5
- import { useEffect, useState } from "react";
5
+ import { useContext, useEffect, useState } from "react";
6
+
7
+ import { ShellLinksContext } from "./shell-links";
6
8
 
7
9
  /** A link for an application the page opened, waiting on the user. */
8
10
  export type ExternalAppRequest = {
@@ -26,6 +28,9 @@ export type ExternalAppRequest = {
26
28
  * as does the engine withdrawing it for a newer one. Unmounting answers
27
29
  * nothing: the engine opens nothing for a request whose element is gone.
28
30
  *
31
+ * A link the shell opens itself (see `ShellLinksContext`) goes to the shell,
32
+ * and the engine opens nothing.
33
+ *
29
34
  * `view` is `null` when missing, as React's callback refs provide.
30
35
  */
31
36
  export const useExternalAppRequest = (
@@ -34,6 +39,7 @@ export const useExternalAppRequest = (
34
39
  const [request, setRequest] = useState<ExternalAppRequest | undefined>(
35
40
  undefined,
36
41
  );
42
+ const shellLinks = useContext(ShellLinksContext);
37
43
 
38
44
  useEffect(() => {
39
45
  if (view === null) {
@@ -44,19 +50,24 @@ export const useExternalAppRequest = (
44
50
  };
45
51
  const asked = (event: DomicileExternalAppEvent) => {
46
52
  event.preventDefault();
47
- setRequest({
48
- dismiss: () => {
49
- cleared();
50
- event.dismiss();
51
- },
52
- mayRemember: event.mayRemember,
53
- open: (remember) => {
54
- cleared();
55
- event.open(remember);
56
- },
57
- origin: event.origin,
58
- url: event.url,
59
- });
53
+ if (shellLinks?.opens(event.url) === true) {
54
+ event.dismiss();
55
+ shellLinks.open(event.url);
56
+ } else {
57
+ setRequest({
58
+ dismiss: () => {
59
+ cleared();
60
+ event.dismiss();
61
+ },
62
+ mayRemember: event.mayRemember,
63
+ open: (remember) => {
64
+ cleared();
65
+ event.open(remember);
66
+ },
67
+ origin: event.origin,
68
+ url: event.url,
69
+ });
70
+ }
60
71
  };
61
72
  view.addEventListener(WEBVIEW_EXTERNAL_APP_EVENT, asked);
62
73
  view.addEventListener(WEBVIEW_EXTERNAL_APP_WITHDRAWN_EVENT, cleared);
@@ -65,7 +76,7 @@ export const useExternalAppRequest = (
65
76
  view.removeEventListener(WEBVIEW_EXTERNAL_APP_WITHDRAWN_EVENT, cleared);
66
77
  };
67
78
  }
68
- }, [view]);
79
+ }, [shellLinks, view]);
69
80
 
70
81
  return request;
71
82
  };
@@ -0,0 +1,96 @@
1
+ import type {
2
+ WebViewIdentityAccount,
3
+ WebViewIdentityProvider,
4
+ WebViewIdentityPurpose,
5
+ WebViewIdentityStep,
6
+ } from "@domicile-desktop/sdk/webview-element";
7
+ import {
8
+ WEBVIEW_IDENTITY_EVENT,
9
+ WEBVIEW_IDENTITY_WITHDRAWN_EVENT,
10
+ } from "@domicile-desktop/sdk/webview-element";
11
+ import { useEffect, useState } from "react";
12
+
13
+ /**
14
+ * A step of a site's "Sign in with" request, waiting on the user: see
15
+ * `WEBVIEW_IDENTITY_STEPS` for what each shows and takes.
16
+ */
17
+ export type IdentityRequest = {
18
+ step: WebViewIdentityStep;
19
+ /** Asked from the page's own button: show it over the page. */
20
+ button: boolean;
21
+ /** The site signing in, such as `medium.com`. */
22
+ site: string;
23
+ purpose: WebViewIdentityPurpose;
24
+ providers: readonly WebViewIdentityProvider[];
25
+ accounts: readonly WebViewIdentityAccount[];
26
+ /** The provider's page about an error, or `""`. */
27
+ errorUrl: string;
28
+ /** Sign in with `accounts[account]`. */
29
+ choose: (account: number) => void;
30
+ /** Open `providers[provider]`'s sign-in page in a browser window. */
31
+ signInToProvider: (provider: number) => void;
32
+ /** Open `errorUrl` in a browser window. */
33
+ moreDetails: () => void;
34
+ /** Close the step, as the user's close. */
35
+ dismiss: () => void;
36
+ };
37
+
38
+ /**
39
+ * The "Sign in with" step the page in `view` is waiting on, if any.
40
+ *
41
+ * Claimed and cleared as `usePromptRequest`'s prompts are: answering or the
42
+ * engine withdrawing it clears it, and the next step replaces it.
43
+ */
44
+ export const useIdentityRequest = (
45
+ view: HTMLElement | null,
46
+ ): IdentityRequest | undefined => {
47
+ const [request, setRequest] = useState<IdentityRequest | undefined>(
48
+ undefined,
49
+ );
50
+
51
+ useEffect(() => {
52
+ if (view === null) {
53
+ return undefined;
54
+ } else {
55
+ const cleared = () => {
56
+ setRequest(undefined);
57
+ };
58
+ const asked = (event: DomicileIdentityEvent) => {
59
+ event.preventDefault();
60
+ setRequest({
61
+ accounts: event.accounts(),
62
+ button: event.button,
63
+ choose: (account) => {
64
+ cleared();
65
+ event.choose(account);
66
+ },
67
+ dismiss: () => {
68
+ cleared();
69
+ event.dismiss();
70
+ },
71
+ errorUrl: event.errorUrl,
72
+ moreDetails: () => {
73
+ cleared();
74
+ event.moreDetails();
75
+ },
76
+ providers: event.providers(),
77
+ purpose: event.purpose,
78
+ signInToProvider: (provider) => {
79
+ cleared();
80
+ event.signInToProvider(provider);
81
+ },
82
+ site: event.site,
83
+ step: event.step,
84
+ });
85
+ };
86
+ view.addEventListener(WEBVIEW_IDENTITY_EVENT, asked);
87
+ view.addEventListener(WEBVIEW_IDENTITY_WITHDRAWN_EVENT, cleared);
88
+ return () => {
89
+ view.removeEventListener(WEBVIEW_IDENTITY_EVENT, asked);
90
+ view.removeEventListener(WEBVIEW_IDENTITY_WITHDRAWN_EVENT, cleared);
91
+ };
92
+ }
93
+ }, [view]);
94
+
95
+ return request;
96
+ };
@@ -33504,15 +33504,15 @@ const tokens = {
33504
33504
  "variable": "var(--jRjWKm)"
33505
33505
  },
33506
33506
  "zIndex.lock": {
33507
- "value": "202",
33507
+ "value": "2147483647",
33508
33508
  "variable": "var(--fkMZTt)"
33509
33509
  },
33510
33510
  "zIndex.modal": {
33511
- "value": "201",
33511
+ "value": "2147483646",
33512
33512
  "variable": "var(--dIktSh)"
33513
33513
  },
33514
33514
  "zIndex.modalBackdrop": {
33515
- "value": "200",
33515
+ "value": "2147483645",
33516
33516
  "variable": "var(--jXaBXH)"
33517
33517
  },
33518
33518
  "zIndex.toast": {
@@ -33595,6 +33595,10 @@ const tokens = {
33595
33595
  "value": "var(--dIlxIZ)",
33596
33596
  "variable": "var(--dIlxIZ)"
33597
33597
  },
33598
+ "colors.onDanger": {
33599
+ "value": "white",
33600
+ "variable": "var(--hgeHO)"
33601
+ },
33598
33602
  "colors.onPhoto": {
33599
33603
  "value": "white",
33600
33604
  "variable": "var(--cFzlNp)"
@@ -1,7 +1,7 @@
1
1
  /* eslint-disable */
2
2
  export type Token = `aspectRatios.${AspectRatioToken}` | `borders.${BorderToken}` | `radii.${RadiusToken}` | `fontWeights.${FontWeightToken}` | `lineHeights.${LineHeightToken}` | `letterSpacings.${LetterSpacingToken}` | `shadows.${ShadowToken}` | `colors.${ColorToken}` | `blurs.${BlurToken}` | `animations.${AnimationToken}` | `borderWidths.${BorderWidthToken}` | `durations.${DurationToken}` | `easings.${EasingToken}` | `fontSizes.${FontSizeToken}` | `fonts.${FontToken}` | `gradients.${GradientToken}` | `opacity.${OpacityToken}` | `sizes.${SizeToken}` | `spacing.${SpacingToken}` | `zIndex.${ZIndexToken}` | `breakpoints.${BreakpointToken}`
3
3
 
4
- export type ColorPalette = "current" | "black" | "white" | "transparent" | "rose" | "pink" | "fuchsia" | "purple" | "violet" | "indigo" | "blue" | "sky" | "cyan" | "teal" | "emerald" | "green" | "lime" | "yellow" | "amber" | "orange" | "red" | "neutral" | "stone" | "zinc" | "gray" | "slate" | "accent" | "backdrop" | "background" | "border" | "borderStrong" | "card" | "danger" | "dangerSoft" | "divider" | "fill" | "fillHover" | "fillOverPhoto" | "foreground" | "muted" | "onPhoto" | "panelOverPhoto" | "private" | "skeleton" | "success" | "textFaint" | "textSoft" | "warning"
4
+ export type ColorPalette = "current" | "black" | "white" | "transparent" | "rose" | "pink" | "fuchsia" | "purple" | "violet" | "indigo" | "blue" | "sky" | "cyan" | "teal" | "emerald" | "green" | "lime" | "yellow" | "amber" | "orange" | "red" | "neutral" | "stone" | "zinc" | "gray" | "slate" | "accent" | "backdrop" | "background" | "border" | "borderStrong" | "card" | "danger" | "dangerSoft" | "divider" | "fill" | "fillHover" | "fillOverPhoto" | "foreground" | "muted" | "onDanger" | "onPhoto" | "panelOverPhoto" | "private" | "skeleton" | "success" | "textFaint" | "textSoft" | "warning"
5
5
 
6
6
  export type AspectRatioToken = "square" | "landscape" | "portrait" | "wide" | "ultrawide" | "golden"
7
7
 
@@ -17,7 +17,7 @@ export type LetterSpacingToken = "tighter" | "tight" | "normal" | "wide" | "wide
17
17
 
18
18
  export type ShadowToken = "2xs" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "inset-2xs" | "inset-xs" | "inset-sm" | "lifted" | "modal" | "textOverPhoto"
19
19
 
20
- export type ColorToken = "current" | "black" | "white" | "transparent" | "rose.50" | "rose.100" | "rose.200" | "rose.300" | "rose.400" | "rose.500" | "rose.600" | "rose.700" | "rose.800" | "rose.900" | "rose.950" | "pink.50" | "pink.100" | "pink.200" | "pink.300" | "pink.400" | "pink.500" | "pink.600" | "pink.700" | "pink.800" | "pink.900" | "pink.950" | "fuchsia.50" | "fuchsia.100" | "fuchsia.200" | "fuchsia.300" | "fuchsia.400" | "fuchsia.500" | "fuchsia.600" | "fuchsia.700" | "fuchsia.800" | "fuchsia.900" | "fuchsia.950" | "purple.50" | "purple.100" | "purple.200" | "purple.300" | "purple.400" | "purple.500" | "purple.600" | "purple.700" | "purple.800" | "purple.900" | "purple.950" | "violet.50" | "violet.100" | "violet.200" | "violet.300" | "violet.400" | "violet.500" | "violet.600" | "violet.700" | "violet.800" | "violet.900" | "violet.950" | "indigo.50" | "indigo.100" | "indigo.200" | "indigo.300" | "indigo.400" | "indigo.500" | "indigo.600" | "indigo.700" | "indigo.800" | "indigo.900" | "indigo.950" | "blue.50" | "blue.100" | "blue.200" | "blue.300" | "blue.400" | "blue.500" | "blue.600" | "blue.700" | "blue.800" | "blue.900" | "blue.950" | "sky.50" | "sky.100" | "sky.200" | "sky.300" | "sky.400" | "sky.500" | "sky.600" | "sky.700" | "sky.800" | "sky.900" | "sky.950" | "cyan.50" | "cyan.100" | "cyan.200" | "cyan.300" | "cyan.400" | "cyan.500" | "cyan.600" | "cyan.700" | "cyan.800" | "cyan.900" | "cyan.950" | "teal.50" | "teal.100" | "teal.200" | "teal.300" | "teal.400" | "teal.500" | "teal.600" | "teal.700" | "teal.800" | "teal.900" | "teal.950" | "emerald.50" | "emerald.100" | "emerald.200" | "emerald.300" | "emerald.400" | "emerald.500" | "emerald.600" | "emerald.700" | "emerald.800" | "emerald.900" | "emerald.950" | "green.50" | "green.100" | "green.200" | "green.300" | "green.400" | "green.500" | "green.600" | "green.700" | "green.800" | "green.900" | "green.950" | "lime.50" | "lime.100" | "lime.200" | "lime.300" | "lime.400" | "lime.500" | "lime.600" | "lime.700" | "lime.800" | "lime.900" | "lime.950" | "yellow.50" | "yellow.100" | "yellow.200" | "yellow.300" | "yellow.400" | "yellow.500" | "yellow.600" | "yellow.700" | "yellow.800" | "yellow.900" | "yellow.950" | "amber.50" | "amber.100" | "amber.200" | "amber.300" | "amber.400" | "amber.500" | "amber.600" | "amber.700" | "amber.800" | "amber.900" | "amber.950" | "orange.50" | "orange.100" | "orange.200" | "orange.300" | "orange.400" | "orange.500" | "orange.600" | "orange.700" | "orange.800" | "orange.900" | "orange.950" | "red.50" | "red.100" | "red.200" | "red.300" | "red.400" | "red.500" | "red.600" | "red.700" | "red.800" | "red.900" | "red.950" | "neutral.50" | "neutral.100" | "neutral.200" | "neutral.300" | "neutral.400" | "neutral.500" | "neutral.600" | "neutral.700" | "neutral.800" | "neutral.900" | "neutral.950" | "stone.50" | "stone.100" | "stone.200" | "stone.300" | "stone.400" | "stone.500" | "stone.600" | "stone.700" | "stone.800" | "stone.900" | "stone.950" | "zinc.50" | "zinc.100" | "zinc.200" | "zinc.300" | "zinc.400" | "zinc.500" | "zinc.600" | "zinc.700" | "zinc.800" | "zinc.900" | "zinc.950" | "gray.50" | "gray.100" | "gray.200" | "gray.300" | "gray.400" | "gray.500" | "gray.600" | "gray.700" | "gray.800" | "gray.900" | "gray.950" | "slate.50" | "slate.100" | "slate.200" | "slate.300" | "slate.400" | "slate.500" | "slate.600" | "slate.700" | "slate.800" | "slate.900" | "slate.950" | "accent" | "backdrop" | "background" | "border" | "borderStrong" | "card" | "danger" | "dangerSoft" | "divider" | "fill" | "fillHover" | "fillOverPhoto" | "foreground" | "muted" | "onPhoto" | "panelOverPhoto" | "private" | "skeleton" | "success" | "textFaint" | "textSoft" | "warning" | "colorPalette" | "colorPalette.50" | "colorPalette.100" | "colorPalette.200" | "colorPalette.300" | "colorPalette.400" | "colorPalette.500" | "colorPalette.600" | "colorPalette.700" | "colorPalette.800" | "colorPalette.900" | "colorPalette.950"
20
+ export type ColorToken = "current" | "black" | "white" | "transparent" | "rose.50" | "rose.100" | "rose.200" | "rose.300" | "rose.400" | "rose.500" | "rose.600" | "rose.700" | "rose.800" | "rose.900" | "rose.950" | "pink.50" | "pink.100" | "pink.200" | "pink.300" | "pink.400" | "pink.500" | "pink.600" | "pink.700" | "pink.800" | "pink.900" | "pink.950" | "fuchsia.50" | "fuchsia.100" | "fuchsia.200" | "fuchsia.300" | "fuchsia.400" | "fuchsia.500" | "fuchsia.600" | "fuchsia.700" | "fuchsia.800" | "fuchsia.900" | "fuchsia.950" | "purple.50" | "purple.100" | "purple.200" | "purple.300" | "purple.400" | "purple.500" | "purple.600" | "purple.700" | "purple.800" | "purple.900" | "purple.950" | "violet.50" | "violet.100" | "violet.200" | "violet.300" | "violet.400" | "violet.500" | "violet.600" | "violet.700" | "violet.800" | "violet.900" | "violet.950" | "indigo.50" | "indigo.100" | "indigo.200" | "indigo.300" | "indigo.400" | "indigo.500" | "indigo.600" | "indigo.700" | "indigo.800" | "indigo.900" | "indigo.950" | "blue.50" | "blue.100" | "blue.200" | "blue.300" | "blue.400" | "blue.500" | "blue.600" | "blue.700" | "blue.800" | "blue.900" | "blue.950" | "sky.50" | "sky.100" | "sky.200" | "sky.300" | "sky.400" | "sky.500" | "sky.600" | "sky.700" | "sky.800" | "sky.900" | "sky.950" | "cyan.50" | "cyan.100" | "cyan.200" | "cyan.300" | "cyan.400" | "cyan.500" | "cyan.600" | "cyan.700" | "cyan.800" | "cyan.900" | "cyan.950" | "teal.50" | "teal.100" | "teal.200" | "teal.300" | "teal.400" | "teal.500" | "teal.600" | "teal.700" | "teal.800" | "teal.900" | "teal.950" | "emerald.50" | "emerald.100" | "emerald.200" | "emerald.300" | "emerald.400" | "emerald.500" | "emerald.600" | "emerald.700" | "emerald.800" | "emerald.900" | "emerald.950" | "green.50" | "green.100" | "green.200" | "green.300" | "green.400" | "green.500" | "green.600" | "green.700" | "green.800" | "green.900" | "green.950" | "lime.50" | "lime.100" | "lime.200" | "lime.300" | "lime.400" | "lime.500" | "lime.600" | "lime.700" | "lime.800" | "lime.900" | "lime.950" | "yellow.50" | "yellow.100" | "yellow.200" | "yellow.300" | "yellow.400" | "yellow.500" | "yellow.600" | "yellow.700" | "yellow.800" | "yellow.900" | "yellow.950" | "amber.50" | "amber.100" | "amber.200" | "amber.300" | "amber.400" | "amber.500" | "amber.600" | "amber.700" | "amber.800" | "amber.900" | "amber.950" | "orange.50" | "orange.100" | "orange.200" | "orange.300" | "orange.400" | "orange.500" | "orange.600" | "orange.700" | "orange.800" | "orange.900" | "orange.950" | "red.50" | "red.100" | "red.200" | "red.300" | "red.400" | "red.500" | "red.600" | "red.700" | "red.800" | "red.900" | "red.950" | "neutral.50" | "neutral.100" | "neutral.200" | "neutral.300" | "neutral.400" | "neutral.500" | "neutral.600" | "neutral.700" | "neutral.800" | "neutral.900" | "neutral.950" | "stone.50" | "stone.100" | "stone.200" | "stone.300" | "stone.400" | "stone.500" | "stone.600" | "stone.700" | "stone.800" | "stone.900" | "stone.950" | "zinc.50" | "zinc.100" | "zinc.200" | "zinc.300" | "zinc.400" | "zinc.500" | "zinc.600" | "zinc.700" | "zinc.800" | "zinc.900" | "zinc.950" | "gray.50" | "gray.100" | "gray.200" | "gray.300" | "gray.400" | "gray.500" | "gray.600" | "gray.700" | "gray.800" | "gray.900" | "gray.950" | "slate.50" | "slate.100" | "slate.200" | "slate.300" | "slate.400" | "slate.500" | "slate.600" | "slate.700" | "slate.800" | "slate.900" | "slate.950" | "accent" | "backdrop" | "background" | "border" | "borderStrong" | "card" | "danger" | "dangerSoft" | "divider" | "fill" | "fillHover" | "fillOverPhoto" | "foreground" | "muted" | "onDanger" | "onPhoto" | "panelOverPhoto" | "private" | "skeleton" | "success" | "textFaint" | "textSoft" | "warning" | "colorPalette" | "colorPalette.50" | "colorPalette.100" | "colorPalette.200" | "colorPalette.300" | "colorPalette.400" | "colorPalette.500" | "colorPalette.600" | "colorPalette.700" | "colorPalette.800" | "colorPalette.900" | "colorPalette.950"
21
21
 
22
22
  export type BlurToken = "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl"
23
23
 
@@ -222,7 +222,7 @@ export interface UtilityValues {
222
222
  srOnly: boolean;
223
223
  debug: boolean;
224
224
  containerName: CssProperties["containerName"];
225
- colorPalette: "current" | "black" | "white" | "transparent" | "rose" | "pink" | "fuchsia" | "purple" | "violet" | "indigo" | "blue" | "sky" | "cyan" | "teal" | "emerald" | "green" | "lime" | "yellow" | "amber" | "orange" | "red" | "neutral" | "stone" | "zinc" | "gray" | "slate" | "accent" | "backdrop" | "background" | "border" | "borderStrong" | "card" | "danger" | "dangerSoft" | "divider" | "fill" | "fillHover" | "fillOverPhoto" | "foreground" | "muted" | "onPhoto" | "panelOverPhoto" | "private" | "skeleton" | "success" | "textFaint" | "textSoft" | "warning";
225
+ colorPalette: "current" | "black" | "white" | "transparent" | "rose" | "pink" | "fuchsia" | "purple" | "violet" | "indigo" | "blue" | "sky" | "cyan" | "teal" | "emerald" | "green" | "lime" | "yellow" | "amber" | "orange" | "red" | "neutral" | "stone" | "zinc" | "gray" | "slate" | "accent" | "backdrop" | "background" | "border" | "borderStrong" | "card" | "danger" | "dangerSoft" | "divider" | "fill" | "fillHover" | "fillOverPhoto" | "foreground" | "muted" | "onDanger" | "onPhoto" | "panelOverPhoto" | "private" | "skeleton" | "success" | "textFaint" | "textSoft" | "warning";
226
226
  textStyle: "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | "panelDetail" | "panelLabel" | "panelOverline" | "panelTitle";
227
227
  }
228
228