@domicile-desktop/component-library 0.0.0-alpha-258d9aabe264 → 0.0.0-alpha-a2ee8eaa5f91

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
@@ -2,8 +2,8 @@
2
2
  "dependencies": {
3
3
  "@base-ui/react": "^1.8.0",
4
4
  "@cprussin/option-result": "^2.0.1",
5
- "@domicile-desktop/sdk": "0.0.0-alpha-258d9aabe264",
6
- "@domicile-desktop/system-apps": "0.0.0-alpha-258d9aabe264",
5
+ "@domicile-desktop/sdk": "0.0.0-alpha-a2ee8eaa5f91",
6
+ "@domicile-desktop/system-apps": "0.0.0-alpha-a2ee8eaa5f91",
7
7
  "@pandacss/dev": "^1.12.1",
8
8
  "@phosphor-icons/react": "^2.1.10"
9
9
  },
@@ -159,5 +159,5 @@
159
159
  "test:unit": "bun test"
160
160
  },
161
161
  "type": "module",
162
- "version": "0.0.0-alpha-258d9aabe264"
162
+ "version": "0.0.0-alpha-a2ee8eaa5f91"
163
163
  }
@@ -269,7 +269,7 @@ const popupStyles = flex({
269
269
  },
270
270
  backgroundColor: "card",
271
271
  border: "1px solid {colors.border}",
272
- borderRadius: "lg",
272
+ borderRadius: "0.875rem",
273
273
  boxShadow: "modal",
274
274
  direction: "column",
275
275
  inlineSize: "min({spacing.120}, 92cqw)",
@@ -13,44 +13,56 @@ type Props = {
13
13
  };
14
14
 
15
15
  /** A yes/no question from an application. Dismissing it denies. */
16
- export const AccessDialog = ({ answer, asker, body, screen }: Props) => (
17
- <ModalDialog
18
- closeButton={false}
19
- footer={
20
- <>
21
- <Button
22
- onClick={() => {
23
- answer(Answer.Canceled());
24
- }}
25
- variant="outline"
26
- >
27
- {body.denyLabel ?? "Deny"}
28
- </Button>
29
- <Button
30
- onClick={() => {
31
- answer(Answer.Access());
32
- }}
33
- variant={body.destructive ? "danger" : "primary"}
34
- >
35
- {body.grantLabel ?? "Allow"}
36
- </Button>
37
- </>
38
- }
39
- onOpenChange={(open) => {
40
- if (!open) {
41
- answer(Answer.Canceled());
16
+ export const AccessDialog = ({ answer, asker, body, screen }: Props) => {
17
+ // One line under the title. The subtitle mostly restates the title, so the
18
+ // body wins when there is one.
19
+ const detail = [body.body, body.subtitle].find((text) => text !== "");
20
+ return (
21
+ <ModalDialog
22
+ closeButton={false}
23
+ footer={
24
+ <>
25
+ {asker !== undefined && (
26
+ <p className={askerStyles}>{`${asker} asks`}</p>
27
+ )}
28
+ <Button
29
+ onClick={() => {
30
+ answer(Answer.Canceled());
31
+ }}
32
+ variant="outline"
33
+ >
34
+ {body.denyLabel ?? "Deny"}
35
+ </Button>
36
+ <Button
37
+ onClick={() => {
38
+ answer(Answer.Access());
39
+ }}
40
+ variant={body.destructive ? "danger" : "accent"}
41
+ >
42
+ {body.grantLabel ?? "Allow"}
43
+ </Button>
44
+ </>
42
45
  }
43
- }}
44
- open
45
- screen={screen}
46
- title={body.title}
47
- >
48
- {asker !== undefined && <p className={askerStyles}>{`${asker} asks`}</p>}
49
- {body.subtitle !== "" && <p className={textStyles}>{body.subtitle}</p>}
50
- {body.body !== "" && <p className={textStyles}>{body.body}</p>}
51
- </ModalDialog>
52
- );
46
+ onOpenChange={(open) => {
47
+ if (!open) {
48
+ answer(Answer.Canceled());
49
+ }
50
+ }}
51
+ open
52
+ screen={screen}
53
+ title={body.title}
54
+ >
55
+ {detail !== undefined && <p className={detailStyles}>{detail}</p>}
56
+ </ModalDialog>
57
+ );
58
+ };
53
59
 
54
- const askerStyles = css({ color: "muted", fontSize: "sm", margin: 0 });
60
+ // Who asks sits opposite the buttons, leaving the body one line.
61
+ const askerStyles = css({
62
+ color: "muted",
63
+ fontSize: "0.8125rem",
64
+ margin: 0,
65
+ marginInlineEnd: "auto",
66
+ });
55
67
 
56
- const textStyles = css({ color: "foreground", margin: 0 });
68
+ const detailStyles = css({ color: "muted", margin: 0 });