@coffre/ui 0.2.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/audit-sentence-BhHmvQX_.js +660 -0
- package/dist/chunks/audit-sentence-BhHmvQX_.js.map +1 -0
- package/dist/chunks/delete-place-CRX7ntE8.js +206 -0
- package/dist/chunks/delete-place-CRX7ntE8.js.map +1 -0
- package/dist/chunks/{directory-CSjWWUQ1.js → directory-zr3ek7Mc.js} +175 -60
- package/dist/chunks/directory-zr3ek7Mc.js.map +1 -0
- package/dist/chunks/folders-DoBmCwOi.js +207 -0
- package/dist/chunks/folders-DoBmCwOi.js.map +1 -0
- package/dist/chunks/grants-Cw1FyGID.js +669 -0
- package/dist/chunks/grants-Cw1FyGID.js.map +1 -0
- package/dist/chunks/offboarding-CE6d7um1.js +305 -0
- package/dist/chunks/offboarding-CE6d7um1.js.map +1 -0
- package/dist/chunks/one-time-DXEl9hbg.js +35 -0
- package/dist/chunks/one-time-DXEl9hbg.js.map +1 -0
- package/dist/chunks/page-DvsgZ2Hd.js +391 -0
- package/dist/chunks/page-DvsgZ2Hd.js.map +1 -0
- package/dist/chunks/principal-BIN-xwZw.js +42 -0
- package/dist/chunks/principal-BIN-xwZw.js.map +1 -0
- package/dist/chunks/{principal-page-D_91OA0l.js → principal-page-DhjO76GH.js} +245 -251
- package/dist/chunks/principal-page-DhjO76GH.js.map +1 -0
- package/dist/chunks/project-page-SRCtRe2g.js +17 -0
- package/dist/chunks/project-page-SRCtRe2g.js.map +1 -0
- package/dist/chunks/{queries-CQ81o4so.js → queries-DVR_i3rA.js} +132 -30
- package/dist/chunks/queries-DVR_i3rA.js.map +1 -0
- package/dist/chunks/references-B6pLT1uQ.js +343 -0
- package/dist/chunks/references-B6pLT1uQ.js.map +1 -0
- package/dist/chunks/{row-state-0PsrEzOL.js → row-state-DOPUsjQK.js} +3 -3
- package/dist/chunks/{row-state-0PsrEzOL.js.map → row-state-DOPUsjQK.js.map} +1 -1
- package/dist/chunks/signin-errors--ykMFuqN.js +57 -0
- package/dist/chunks/signin-errors--ykMFuqN.js.map +1 -0
- package/dist/chunks/tabs-BmwKfUeK.js +22 -0
- package/dist/chunks/tabs-BmwKfUeK.js.map +1 -0
- package/dist/chunks/{theme-B2vQolVR.js → theme-DJuz-xLM.js} +3 -3
- package/dist/chunks/{theme-B2vQolVR.js.map → theme-DJuz-xLM.js.map} +1 -1
- package/dist/chunks/{ui-DixXLQvQ.js → ui-DJje3gST.js} +6 -3
- package/dist/chunks/ui-DJje3gST.js.map +1 -0
- package/dist/chunks/{use-change-c6CeLRin.js → use-change-DUiGO19U.js} +52 -21
- package/dist/chunks/use-change-DUiGO19U.js.map +1 -0
- package/dist/chunks/{use-shell-jxd7Tzd-.js → use-shell-rNKfGjdj.js} +3 -3
- package/dist/chunks/{use-shell-jxd7Tzd-.js.map → use-shell-rNKfGjdj.js.map} +1 -1
- package/dist/chunks/validation-D312_NLf.js +87 -0
- package/dist/chunks/validation-D312_NLf.js.map +1 -0
- package/dist/index.d.ts +361 -27
- package/dist/index.js +188 -98
- package/dist/index.js.map +1 -1
- package/dist/pages/account.d.ts +2 -2
- package/dist/pages/account.js +297 -135
- package/dist/pages/account.js.map +1 -1
- package/dist/pages/approval.d.ts +9 -0
- package/dist/pages/approval.js +207 -0
- package/dist/pages/approval.js.map +1 -0
- package/dist/pages/audit.js +17 -542
- package/dist/pages/audit.js.map +1 -1
- package/dist/pages/device-login.js +2 -3
- package/dist/pages/device-login.js.map +1 -1
- package/dist/pages/environment.js +647 -257
- package/dist/pages/environment.js.map +1 -1
- package/dist/pages/login.js +18 -7
- package/dist/pages/login.js.map +1 -1
- package/dist/pages/oauth-authorize.d.ts +10 -0
- package/dist/pages/oauth-authorize.js +249 -0
- package/dist/pages/oauth-authorize.js.map +1 -0
- package/dist/pages/project-access.d.ts +6 -0
- package/dist/pages/project-access.js +370 -0
- package/dist/pages/project-access.js.map +1 -0
- package/dist/pages/project-environments.d.ts +4 -0
- package/dist/pages/project-environments.js +593 -0
- package/dist/pages/project-environments.js.map +1 -0
- package/dist/pages/project-settings.d.ts +4 -0
- package/dist/pages/project-settings.js +242 -0
- package/dist/pages/project-settings.js.map +1 -0
- package/dist/pages/project.d.ts +10 -2
- package/dist/pages/project.js +57 -934
- package/dist/pages/project.js.map +1 -1
- package/dist/pages/projects.js +53 -21
- package/dist/pages/projects.js.map +1 -1
- package/dist/pages/service-account.d.ts +10 -0
- package/dist/pages/{token.js → service-account.js} +115 -56
- package/dist/pages/service-account.js.map +1 -0
- package/dist/pages/service-accounts.d.ts +3 -0
- package/dist/pages/service-accounts.js +38 -0
- package/dist/pages/service-accounts.js.map +1 -0
- package/dist/pages/settings.d.ts +1 -0
- package/dist/pages/settings.js +104 -42
- package/dist/pages/settings.js.map +1 -1
- package/dist/pages/unregistered.js +2 -3
- package/dist/pages/unregistered.js.map +1 -1
- package/dist/pages/user.d.ts +6 -1
- package/dist/pages/user.js +18 -6
- package/dist/pages/user.js.map +1 -1
- package/dist/pages/users.js +6 -10
- package/dist/pages/users.js.map +1 -1
- package/package.json +3 -3
- package/src/components/actions-log.tsx +117 -0
- package/src/components/audit-sentence.tsx +55 -0
- package/src/components/command-palette.tsx +4 -4
- package/src/components/delete-place.tsx +180 -0
- package/src/components/directory.tsx +259 -110
- package/src/components/every-project.tsx +287 -0
- package/src/components/expiry-field.tsx +42 -0
- package/src/components/folders.tsx +219 -0
- package/src/components/grants.tsx +11 -4
- package/src/components/icons.tsx +2 -0
- package/src/components/missing.tsx +110 -0
- package/src/components/offboarding.tsx +61 -33
- package/src/components/page.tsx +4 -1
- package/src/components/principal-page.tsx +136 -106
- package/src/components/principal-picker.tsx +5 -5
- package/src/components/principal.tsx +4 -4
- package/src/components/references.tsx +323 -0
- package/src/components/service-tokens.tsx +115 -95
- package/src/components/shell.tsx +11 -32
- package/src/components/tabs.tsx +18 -0
- package/src/components/trusted-workloads.tsx +97 -79
- package/src/components/ui.tsx +8 -1
- package/src/index.ts +13 -2
- package/src/layout.tsx +2 -2
- package/src/lib/access-plan.ts +2 -2
- package/src/lib/audit-sentences.ts +161 -77
- package/src/lib/changes.ts +56 -5
- package/src/lib/coffre.ts +3 -2
- package/src/lib/one-time.ts +32 -0
- package/src/lib/project-access.ts +11 -23
- package/src/lib/project-page.ts +14 -0
- package/src/lib/queries.ts +126 -32
- package/src/lib/search.ts +25 -0
- package/src/lib/signin-errors.ts +45 -1
- package/src/lib/validation.ts +14 -0
- package/src/options.ts +187 -35
- package/src/pages/account.tsx +274 -129
- package/src/pages/approval.tsx +197 -0
- package/src/pages/audit.tsx +9 -61
- package/src/pages/environment.tsx +585 -286
- package/src/pages/login.tsx +8 -2
- package/src/pages/oauth-authorize.tsx +233 -0
- package/src/pages/project-access.tsx +219 -0
- package/src/pages/project-environments.tsx +582 -0
- package/src/pages/project-settings.tsx +259 -0
- package/src/pages/project.tsx +52 -879
- package/src/pages/projects.tsx +55 -18
- package/src/pages/service-account.tsx +50 -0
- package/src/pages/{tokens.tsx → service-accounts.tsx} +9 -6
- package/src/pages/settings.tsx +62 -8
- package/src/pages/user.tsx +16 -4
- package/src/pages/users.tsx +2 -2
- package/src/parity.ts +160 -0
- package/src/register.ts +58 -9
- package/src/router.tsx +4 -0
- package/src/shared/models.ts +6 -2
- package/src/styles/globals.css +536 -31
- package/dist/chunks/directory-CSjWWUQ1.js.map +0 -1
- package/dist/chunks/grants-saMQagmG.js +0 -160
- package/dist/chunks/grants-saMQagmG.js.map +0 -1
- package/dist/chunks/icons-D-PfAfnH.js +0 -203
- package/dist/chunks/icons-D-PfAfnH.js.map +0 -1
- package/dist/chunks/offboarding-C6l30DZR.js +0 -263
- package/dist/chunks/offboarding-C6l30DZR.js.map +0 -1
- package/dist/chunks/page-C5HcNqf2.js +0 -190
- package/dist/chunks/page-C5HcNqf2.js.map +0 -1
- package/dist/chunks/principal-page-D_91OA0l.js.map +0 -1
- package/dist/chunks/queries-CQ81o4so.js.map +0 -1
- package/dist/chunks/signin-errors-BEFlVDbQ.js +0 -30
- package/dist/chunks/signin-errors-BEFlVDbQ.js.map +0 -1
- package/dist/chunks/ui-DixXLQvQ.js.map +0 -1
- package/dist/chunks/use-action-CWsg_YWU.js +0 -49
- package/dist/chunks/use-action-CWsg_YWU.js.map +0 -1
- package/dist/chunks/use-change-c6CeLRin.js.map +0 -1
- package/dist/chunks/validation-BQtqPe2V.js +0 -29
- package/dist/chunks/validation-BQtqPe2V.js.map +0 -1
- package/dist/pages/token.d.ts +0 -3
- package/dist/pages/token.js.map +0 -1
- package/dist/pages/tokens.d.ts +0 -3
- package/dist/pages/tokens.js +0 -39
- package/dist/pages/tokens.js.map +0 -1
- package/dist/project-BqIy8gYR.d.ts +0 -5
- package/src/lib/instance.ts +0 -13
- package/src/pages/token.tsx +0 -34
|
@@ -0,0 +1,391 @@
|
|
|
1
|
+
import { useRouter } from "@tanstack/react-router";
|
|
2
|
+
import { Activity, Archive, ArrowRight, Ban, Check, ChevronRight, ChevronsUpDown, CircleAlert, CircleCheck, Clock, Copy, Ellipsis, Eye, EyeOff, Folder, Hash, History, Info, KeyRound, Layers, Link as Link$1, LoaderCircle, Lock, LogOut, Menu, Monitor, Moon, PanelLeft, Pencil, Plus, RotateCcw, ScrollText, Search, Settings, ShieldCheck, Sun, Terminal, Trash2, TriangleAlert, Upload, User, UserRoundCog, Users, X } from "lucide-react";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
import { CoffreError } from "@coffre/client";
|
|
5
|
+
//#region src/components/mark.ts
|
|
6
|
+
/**
|
|
7
|
+
* coffre's mark: a keyhole cut from a disc, which leaves a lowercase c, its
|
|
8
|
+
* slot tilted up 14°. Drawn on a 32-unit grid, where 2 units are a pixel at
|
|
9
|
+
* 16px.
|
|
10
|
+
*
|
|
11
|
+
* Everything that draws it reads this file: `Mark` in the app, the favicon,
|
|
12
|
+
* and `scripts/icons.ts`, which renders the PNGs and the README's mark from
|
|
13
|
+
* it. The colours stand in until the brand has its own: change them here,
|
|
14
|
+
* then run `pnpm --filter @coffre/ui icons`.
|
|
15
|
+
*/
|
|
16
|
+
/** 64px and up. */
|
|
17
|
+
var MARK_PATH = "M24.17 12.23A9 9 0 1 0 24.93 14.91L18.39 16.27A3.6 3.6 0 1 1 17.84 14.07Z";
|
|
18
|
+
/** 48px and below: a larger disc, the hole on the pixel grid, a thicker slot, so both stay open at 16px. */
|
|
19
|
+
var MARK_PATH_SMALL = "M25.77 10.94A11 11 0 1 0 26.95 14.9L17.92 16.81A4 4 0 1 1 17.08 13.45Z";
|
|
20
|
+
function markPath(size) {
|
|
21
|
+
return size <= 48 ? MARK_PATH_SMALL : MARK_PATH;
|
|
22
|
+
}
|
|
23
|
+
//#endregion
|
|
24
|
+
//#region src/components/icons.tsx
|
|
25
|
+
/**
|
|
26
|
+
* The mark, bare, in the text's colour, so it follows the theme. The tiled
|
|
27
|
+
* favicon and app icons are drawn from the same paths, in `./mark`.
|
|
28
|
+
*/
|
|
29
|
+
function Mark({ size = 16, className, style, label }) {
|
|
30
|
+
return /* @__PURE__ */ jsx("svg", {
|
|
31
|
+
width: size,
|
|
32
|
+
height: size,
|
|
33
|
+
viewBox: "0 0 32 32",
|
|
34
|
+
className,
|
|
35
|
+
style,
|
|
36
|
+
"aria-hidden": label === void 0,
|
|
37
|
+
"aria-label": label,
|
|
38
|
+
role: label === void 0 ? void 0 : "img",
|
|
39
|
+
children: /* @__PURE__ */ jsx("path", {
|
|
40
|
+
d: markPath(size),
|
|
41
|
+
fill: "currentColor"
|
|
42
|
+
})
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Lucide draws on a 24-unit grid with a 2-unit stroke. At the 14-16px these
|
|
47
|
+
* are shown, 1.75 sits closer to Inter's weight beside them.
|
|
48
|
+
*/
|
|
49
|
+
var STROKE = 1.75;
|
|
50
|
+
function lucide(Glyph) {
|
|
51
|
+
return function Icon({ size = 16, className, style, label }) {
|
|
52
|
+
return /* @__PURE__ */ jsx(Glyph, {
|
|
53
|
+
size,
|
|
54
|
+
strokeWidth: STROKE,
|
|
55
|
+
className,
|
|
56
|
+
style,
|
|
57
|
+
...label === void 0 ? {} : {
|
|
58
|
+
"aria-label": label,
|
|
59
|
+
role: "img"
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
var Folder$1 = lucide(Folder);
|
|
65
|
+
var Layers$1 = lucide(Layers);
|
|
66
|
+
var Users$1 = lucide(Users);
|
|
67
|
+
var User$1 = lucide(User);
|
|
68
|
+
/** Your own settings, so they never share the instance's gear. */
|
|
69
|
+
var UserCog = lucide(UserRoundCog);
|
|
70
|
+
var Key = lucide(KeyRound);
|
|
71
|
+
var Ledger = lucide(ScrollText);
|
|
72
|
+
var Settings$1 = lucide(Settings);
|
|
73
|
+
var Eye$1 = lucide(Eye);
|
|
74
|
+
var EyeOff$1 = lucide(EyeOff);
|
|
75
|
+
var Copy$1 = lucide(Copy);
|
|
76
|
+
var Pencil$1 = lucide(Pencil);
|
|
77
|
+
var Archive$1 = lucide(Archive);
|
|
78
|
+
var Trash = lucide(Trash2);
|
|
79
|
+
var History$1 = lucide(History);
|
|
80
|
+
var RotateBack = lucide(RotateCcw);
|
|
81
|
+
var Upload$1 = lucide(Upload);
|
|
82
|
+
var Lock$1 = lucide(Lock);
|
|
83
|
+
var Terminal$1 = lucide(Terminal);
|
|
84
|
+
var Hash$1 = lucide(Hash);
|
|
85
|
+
var Clock$1 = lucide(Clock);
|
|
86
|
+
var Check$1 = lucide(Check);
|
|
87
|
+
var CheckCircle = lucide(CircleCheck);
|
|
88
|
+
var SlashCircle = lucide(Ban);
|
|
89
|
+
var ShieldCheck$1 = lucide(ShieldCheck);
|
|
90
|
+
var AlertTriangle = lucide(TriangleAlert);
|
|
91
|
+
var AlertCircle = lucide(CircleAlert);
|
|
92
|
+
var Info$1 = lucide(Info);
|
|
93
|
+
var Activity$1 = lucide(Activity);
|
|
94
|
+
var Loader = lucide(LoaderCircle);
|
|
95
|
+
var X$1 = lucide(X);
|
|
96
|
+
var Plus$1 = lucide(Plus);
|
|
97
|
+
var Search$1 = lucide(Search);
|
|
98
|
+
var Menu$1 = lucide(Menu);
|
|
99
|
+
var PanelLeft$1 = lucide(PanelLeft);
|
|
100
|
+
var MoreHorizontal = lucide(Ellipsis);
|
|
101
|
+
var ChevronRight$1 = lucide(ChevronRight);
|
|
102
|
+
var ChevronsUpDown$1 = lucide(ChevronsUpDown);
|
|
103
|
+
var ArrowRight$1 = lucide(ArrowRight);
|
|
104
|
+
var Link$2 = lucide(Link$1);
|
|
105
|
+
var SignOut = lucide(LogOut);
|
|
106
|
+
var Sun$1 = lucide(Sun);
|
|
107
|
+
var Moon$1 = lucide(Moon);
|
|
108
|
+
var Monitor$1 = lucide(Monitor);
|
|
109
|
+
/**
|
|
110
|
+
* GitHub's mark, drawn as GitHub publishes it: a filled shape on its own
|
|
111
|
+
* 16-unit grid, since a brand is not ours to redraw in the stroke style.
|
|
112
|
+
*/
|
|
113
|
+
function GitHub({ size = 16, className, style }) {
|
|
114
|
+
return /* @__PURE__ */ jsx("svg", {
|
|
115
|
+
width: size,
|
|
116
|
+
height: size,
|
|
117
|
+
viewBox: "0 0 16 16",
|
|
118
|
+
fill: "currentColor",
|
|
119
|
+
className,
|
|
120
|
+
style,
|
|
121
|
+
"aria-hidden": true,
|
|
122
|
+
children: /* @__PURE__ */ jsx("path", { d: "M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.01 8.01 0 0 0 16 8c0-4.42-3.58-8-8-8Z" })
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
/** Google's "G", in its four colours, as Google's sign-in guidelines require. */
|
|
126
|
+
function Google({ size = 16, className, style }) {
|
|
127
|
+
return /* @__PURE__ */ jsxs("svg", {
|
|
128
|
+
width: size,
|
|
129
|
+
height: size,
|
|
130
|
+
viewBox: "0 0 48 48",
|
|
131
|
+
className,
|
|
132
|
+
style,
|
|
133
|
+
"aria-hidden": true,
|
|
134
|
+
children: [
|
|
135
|
+
/* @__PURE__ */ jsx("path", {
|
|
136
|
+
fill: "#EA4335",
|
|
137
|
+
d: "M24 9.5c3.54 0 6.71 1.22 9.21 3.6l6.85-6.85C35.9 2.38 30.47 0 24 0 14.62 0 6.51 5.38 2.56 13.22l7.98 6.19C12.43 13.72 17.74 9.5 24 9.5z"
|
|
138
|
+
}),
|
|
139
|
+
/* @__PURE__ */ jsx("path", {
|
|
140
|
+
fill: "#4285F4",
|
|
141
|
+
d: "M46.98 24.55c0-1.57-.15-3.09-.38-4.55H24v9.02h12.94c-.58 2.96-2.26 5.48-4.78 7.18l7.73 6c4.51-4.18 7.09-10.36 7.09-17.65z"
|
|
142
|
+
}),
|
|
143
|
+
/* @__PURE__ */ jsx("path", {
|
|
144
|
+
fill: "#FBBC05",
|
|
145
|
+
d: "M10.53 28.59c-.48-1.45-.76-2.99-.76-4.59s.27-3.14.76-4.59l-7.98-6.19C.92 16.46 0 20.12 0 24c0 3.88.92 7.54 2.56 10.78l7.97-6.19z"
|
|
146
|
+
}),
|
|
147
|
+
/* @__PURE__ */ jsx("path", {
|
|
148
|
+
fill: "#34A853",
|
|
149
|
+
d: "M24 48c6.48 0 11.93-2.13 15.89-5.81l-7.73-6c-2.15 1.45-4.92 2.3-8.16 2.3-6.26 0-11.57-4.22-13.47-9.91l-7.98 6.19C6.51 42.62 14.62 48 24 48z"
|
|
150
|
+
})
|
|
151
|
+
]
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
/** Microsoft's four squares. */
|
|
155
|
+
function Microsoft({ size = 16, className, style }) {
|
|
156
|
+
return /* @__PURE__ */ jsxs("svg", {
|
|
157
|
+
width: size,
|
|
158
|
+
height: size,
|
|
159
|
+
viewBox: "0 0 21 21",
|
|
160
|
+
className,
|
|
161
|
+
style,
|
|
162
|
+
"aria-hidden": true,
|
|
163
|
+
children: [
|
|
164
|
+
/* @__PURE__ */ jsx("rect", {
|
|
165
|
+
x: "0",
|
|
166
|
+
y: "0",
|
|
167
|
+
width: "10",
|
|
168
|
+
height: "10",
|
|
169
|
+
fill: "#F25022"
|
|
170
|
+
}),
|
|
171
|
+
/* @__PURE__ */ jsx("rect", {
|
|
172
|
+
x: "11",
|
|
173
|
+
y: "0",
|
|
174
|
+
width: "10",
|
|
175
|
+
height: "10",
|
|
176
|
+
fill: "#7FBA00"
|
|
177
|
+
}),
|
|
178
|
+
/* @__PURE__ */ jsx("rect", {
|
|
179
|
+
x: "0",
|
|
180
|
+
y: "11",
|
|
181
|
+
width: "10",
|
|
182
|
+
height: "10",
|
|
183
|
+
fill: "#00A4EF"
|
|
184
|
+
}),
|
|
185
|
+
/* @__PURE__ */ jsx("rect", {
|
|
186
|
+
x: "11",
|
|
187
|
+
y: "11",
|
|
188
|
+
width: "10",
|
|
189
|
+
height: "10",
|
|
190
|
+
fill: "#FFB900"
|
|
191
|
+
})
|
|
192
|
+
]
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
/** The mark on a provider's button; any other OpenID Connect issuer gets a key. */
|
|
196
|
+
function ProviderMark({ brand, size = 16 }) {
|
|
197
|
+
switch (brand) {
|
|
198
|
+
case "github": return /* @__PURE__ */ jsx(GitHub, { size });
|
|
199
|
+
case "google": return /* @__PURE__ */ jsx(Google, { size });
|
|
200
|
+
case "microsoft": return /* @__PURE__ */ jsx(Microsoft, { size });
|
|
201
|
+
default: return /* @__PURE__ */ jsx(Key, { size });
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
//#endregion
|
|
205
|
+
//#region src/components/tile.tsx
|
|
206
|
+
var HUES = [
|
|
207
|
+
"blue",
|
|
208
|
+
"green",
|
|
209
|
+
"amber",
|
|
210
|
+
"violet"
|
|
211
|
+
];
|
|
212
|
+
/** The same name always lands on the same tint, on every screen (FNV-1a). */
|
|
213
|
+
function tileHue(name) {
|
|
214
|
+
let hash = 2166136261;
|
|
215
|
+
for (const char of name) hash = Math.imul(hash ^ char.charCodeAt(0), 16777619) >>> 0;
|
|
216
|
+
return HUES[hash % HUES.length];
|
|
217
|
+
}
|
|
218
|
+
/**
|
|
219
|
+
* A letter on a tint, standing in for a project wherever its name appears.
|
|
220
|
+
*
|
|
221
|
+
* It is a recognition aid, not information: the name is always beside it, so
|
|
222
|
+
* the tile is hidden from assistive technology.
|
|
223
|
+
*/
|
|
224
|
+
function Tile({ name, size = "sm" }) {
|
|
225
|
+
return /* @__PURE__ */ jsx("span", {
|
|
226
|
+
className: `tile tile-${tileHue(name)}${size === "lg" ? " tile-lg" : ""}`,
|
|
227
|
+
"aria-hidden": true,
|
|
228
|
+
children: name.slice(0, 1)
|
|
229
|
+
});
|
|
230
|
+
}
|
|
231
|
+
//#endregion
|
|
232
|
+
//#region src/lib/coffre.ts
|
|
233
|
+
/**
|
|
234
|
+
* The API as whoever is looking at the page, with their permissions: what
|
|
235
|
+
* coffre's pages call, and a deployment's own may too. In the browser this
|
|
236
|
+
* is plain `fetch` to `/api`, carrying the session cookie; on the server,
|
|
237
|
+
* the API in process. Components call it from event handlers; loaders read
|
|
238
|
+
* the same client as `context.coffre`.
|
|
239
|
+
*/
|
|
240
|
+
function useCoffre() {
|
|
241
|
+
return useRouter().options.context.coffre;
|
|
242
|
+
}
|
|
243
|
+
/** A refusal the page words itself, shown as it is. */
|
|
244
|
+
var Refusal = class extends Error {};
|
|
245
|
+
/** The HTTP status of an API error; undefined when the request never got an answer. */
|
|
246
|
+
function statusOf(error) {
|
|
247
|
+
return error instanceof CoffreError ? error.status : void 0;
|
|
248
|
+
}
|
|
249
|
+
/** What to tell the person when a call fails. */
|
|
250
|
+
function failureMessage(error) {
|
|
251
|
+
if (error instanceof Refusal) return error.message;
|
|
252
|
+
if (!(error instanceof CoffreError)) return "The request could not be sent. Nothing was changed.";
|
|
253
|
+
if (error.status === 401) return "Your session has ended. Sign in again, then retry.";
|
|
254
|
+
if (error.code === "cross_origin") return "coffre refused a change that did not come from this page. Reload, then retry.";
|
|
255
|
+
if (error.status === 403) return "You hold no grant that covers this. Someone with grant.manage on the project can add one.";
|
|
256
|
+
if (error.status === 404) return "Not found. It may have been renamed or archived.";
|
|
257
|
+
if (error.status === 400 || error.status === 409) return error.message;
|
|
258
|
+
return "coffre is unavailable. Nothing was read or written.";
|
|
259
|
+
}
|
|
260
|
+
function uiFailure(error) {
|
|
261
|
+
return {
|
|
262
|
+
ok: false,
|
|
263
|
+
error: failureMessage(error),
|
|
264
|
+
signedOut: statusOf(error) === 401
|
|
265
|
+
};
|
|
266
|
+
}
|
|
267
|
+
/** A loader's answer: what it read, or what to say instead. */
|
|
268
|
+
async function uiResult(operation) {
|
|
269
|
+
try {
|
|
270
|
+
return {
|
|
271
|
+
ok: true,
|
|
272
|
+
...await operation()
|
|
273
|
+
};
|
|
274
|
+
} catch (error) {
|
|
275
|
+
return uiFailure(error);
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
/** How the API names a member: `user:ada@acme.example`, `token:ci-deploy` (which people read as `service:ci-deploy`). */
|
|
279
|
+
function memberRef(principalType, principalId) {
|
|
280
|
+
return `${principalType === "user" ? "user" : "token"}:${principalId}`;
|
|
281
|
+
}
|
|
282
|
+
//#endregion
|
|
283
|
+
//#region src/components/page.tsx
|
|
284
|
+
/**
|
|
285
|
+
* The head of every page: an optional project tile, the title with a muted
|
|
286
|
+
* aside, one line of description or facts, and the page's own actions.
|
|
287
|
+
*
|
|
288
|
+
* Where you are is already in the top bar's path, so the head does not repeat
|
|
289
|
+
* it; it says what this page is.
|
|
290
|
+
*/
|
|
291
|
+
function PageHeader({ tile, lead, title, aside, description, meta, actions }) {
|
|
292
|
+
return /* @__PURE__ */ jsxs("header", {
|
|
293
|
+
className: "page-head",
|
|
294
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
295
|
+
className: "page-head-text",
|
|
296
|
+
children: [
|
|
297
|
+
tile !== void 0 && /* @__PURE__ */ jsx(Tile, {
|
|
298
|
+
name: tile,
|
|
299
|
+
size: "lg"
|
|
300
|
+
}),
|
|
301
|
+
lead,
|
|
302
|
+
/* @__PURE__ */ jsxs("div", {
|
|
303
|
+
style: { minWidth: 0 },
|
|
304
|
+
children: [
|
|
305
|
+
/* @__PURE__ */ jsxs("h1", {
|
|
306
|
+
className: "page-title",
|
|
307
|
+
children: [/* @__PURE__ */ jsx("span", { children: title }), aside !== void 0 && aside !== null && /* @__PURE__ */ jsx("span", {
|
|
308
|
+
className: "page-title-aside",
|
|
309
|
+
children: aside
|
|
310
|
+
})]
|
|
311
|
+
}),
|
|
312
|
+
description !== void 0 && /* @__PURE__ */ jsx("p", {
|
|
313
|
+
className: "page-desc",
|
|
314
|
+
children: description
|
|
315
|
+
}),
|
|
316
|
+
meta !== void 0 && /* @__PURE__ */ jsx("div", {
|
|
317
|
+
className: "page-meta",
|
|
318
|
+
children: meta
|
|
319
|
+
})
|
|
320
|
+
]
|
|
321
|
+
})
|
|
322
|
+
]
|
|
323
|
+
}), actions !== void 0 && actions !== false && /* @__PURE__ */ jsx("div", {
|
|
324
|
+
className: "page-actions",
|
|
325
|
+
children: actions
|
|
326
|
+
})]
|
|
327
|
+
});
|
|
328
|
+
}
|
|
329
|
+
/** A bordered panel with a titled head; tables inside it run edge to edge. */
|
|
330
|
+
function Card({ title, description, actions, children, labelledBy, tone, wide = false }) {
|
|
331
|
+
return /* @__PURE__ */ jsxs("section", {
|
|
332
|
+
className: `card${tone === "danger" ? " card-danger" : ""}${wide ? " card-wide" : ""}`,
|
|
333
|
+
"aria-labelledby": labelledBy,
|
|
334
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
335
|
+
className: "card-head",
|
|
336
|
+
children: [/* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("h2", {
|
|
337
|
+
className: "card-title",
|
|
338
|
+
id: labelledBy,
|
|
339
|
+
children: title
|
|
340
|
+
}), description !== void 0 && /* @__PURE__ */ jsx("p", {
|
|
341
|
+
className: "card-desc",
|
|
342
|
+
children: description
|
|
343
|
+
})] }), actions]
|
|
344
|
+
}), children]
|
|
345
|
+
});
|
|
346
|
+
}
|
|
347
|
+
/** One labelled fact in a card's `dl.facts`. */
|
|
348
|
+
function Fact({ label, children }) {
|
|
349
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
350
|
+
className: "fact",
|
|
351
|
+
children: [/* @__PURE__ */ jsx("dt", { children: label }), /* @__PURE__ */ jsx("dd", { children })]
|
|
352
|
+
});
|
|
353
|
+
}
|
|
354
|
+
/**
|
|
355
|
+
* A page that cannot be shown: no access, no such thing, or no session.
|
|
356
|
+
*
|
|
357
|
+
* It says which page, why in a sentence, and offers the one useful way out.
|
|
358
|
+
*/
|
|
359
|
+
function ClosedDoor({ icon, label, title, children, actions }) {
|
|
360
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
361
|
+
className: "closed",
|
|
362
|
+
role: "status",
|
|
363
|
+
children: [
|
|
364
|
+
icon !== void 0 && /* @__PURE__ */ jsx("div", {
|
|
365
|
+
className: "closed-icon",
|
|
366
|
+
"aria-hidden": true,
|
|
367
|
+
children: icon
|
|
368
|
+
}),
|
|
369
|
+
label !== void 0 && /* @__PURE__ */ jsx("p", {
|
|
370
|
+
className: "closed-label",
|
|
371
|
+
children: label
|
|
372
|
+
}),
|
|
373
|
+
/* @__PURE__ */ jsx("h1", {
|
|
374
|
+
className: "closed-title",
|
|
375
|
+
children: title
|
|
376
|
+
}),
|
|
377
|
+
/* @__PURE__ */ jsx("div", {
|
|
378
|
+
className: "closed-body",
|
|
379
|
+
children
|
|
380
|
+
}),
|
|
381
|
+
actions !== void 0 && /* @__PURE__ */ jsx("div", {
|
|
382
|
+
className: "closed-actions",
|
|
383
|
+
children: actions
|
|
384
|
+
})
|
|
385
|
+
]
|
|
386
|
+
});
|
|
387
|
+
}
|
|
388
|
+
//#endregion
|
|
389
|
+
export { Trash as $, Key as A, MoreHorizontal as B, Eye$1 as C, Hash$1 as D, GitHub as E, Lock$1 as F, RotateBack as G, Pencil$1 as H, Mark as I, ShieldCheck$1 as J, Search$1 as K, Menu$1 as L, Ledger as M, Link$2 as N, History$1 as O, Loader as P, Terminal$1 as Q, Monitor$1 as R, Copy$1 as S, Folder$1 as T, Plus$1 as U, PanelLeft$1 as V, ProviderMark as W, SlashCircle as X, SignOut as Y, Sun$1 as Z, Check$1 as _, Refusal as a, ChevronsUpDown$1 as b, statusOf as c, Tile as d, Upload$1 as et, Activity$1 as f, ArrowRight$1 as g, Archive$1 as h, PageHeader as i, X$1 as it, Layers$1 as j, Info$1 as k, uiResult as l, AlertTriangle as m, ClosedDoor as n, UserCog as nt, failureMessage as o, AlertCircle as p, Settings$1 as q, Fact as r, Users$1 as rt, memberRef as s, Card as t, User$1 as tt, useCoffre as u, CheckCircle as v, EyeOff$1 as w, Clock$1 as x, ChevronRight$1 as y, Moon$1 as z };
|
|
390
|
+
|
|
391
|
+
//# sourceMappingURL=page-DvsgZ2Hd.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"page-DvsgZ2Hd.js","names":[],"sources":["../../src/components/mark.ts","../../src/components/icons.tsx","../../src/components/tile.tsx","../../src/lib/coffre.ts","../../src/components/page.tsx"],"sourcesContent":["/**\n * coffre's mark: a keyhole cut from a disc, which leaves a lowercase c, its\n * slot tilted up 14°. Drawn on a 32-unit grid, where 2 units are a pixel at\n * 16px.\n *\n * Everything that draws it reads this file: `Mark` in the app, the favicon,\n * and `scripts/icons.ts`, which renders the PNGs and the README's mark from\n * it. The colours stand in until the brand has its own: change them here,\n * then run `pnpm --filter @coffre/ui icons`.\n */\n\n/** 64px and up. */\nexport const MARK_PATH = 'M24.17 12.23A9 9 0 1 0 24.93 14.91L18.39 16.27A3.6 3.6 0 1 1 17.84 14.07Z';\n\n/** 48px and below: a larger disc, the hole on the pixel grid, a thicker slot, so both stay open at 16px. */\nexport const MARK_PATH_SMALL = 'M25.77 10.94A11 11 0 1 0 26.95 14.9L17.92 16.81A4 4 0 1 1 17.08 13.45Z';\n\n/** The tile behind the mark wherever it stands alone: the favicon, app icons, the README. */\nexport const TILE = '#000';\n\n/** The mark on its tile. */\nexport const INK = '#fff';\n\n/** The tile's corner radius, on the 32-unit grid. */\nexport const TILE_RADIUS = 7;\n\nexport function markPath(size: number): string {\n return size <= 48 ? MARK_PATH_SMALL : MARK_PATH;\n}\n\n/**\n * The mark on its tile, as an SVG document, drawn for `size` pixels.\n * `square` leaves the corners for the platform to round (iOS, GitHub);\n * `adaptive` swaps the colours in a dark browser, for the favicon.\n */\nexport function markSvg(size: number, { square = false, adaptive = false } = {}): string {\n const dark = adaptive ? `<style>@media (prefers-color-scheme:dark){rect{fill:${INK}}path{fill:${TILE}}}</style>` : '';\n const radius = square ? '' : ` rx=\"${TILE_RADIUS}\"`;\n return (\n `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 32 32\">${dark}` +\n `<rect width=\"32\" height=\"32\"${radius} fill=\"${TILE}\"/>` +\n `<path d=\"${markPath(size)}\" fill=\"${INK}\"/></svg>`\n );\n}\n","import type { LucideIcon } from 'lucide-react';\nimport {\n Activity as ActivityGlyph,\n ArrowRight as ArrowRightGlyph,\n Archive as ArchiveGlyph,\n Ban,\n Check as CheckGlyph,\n ChevronDown as ChevronDownGlyph,\n ChevronRight as ChevronRightGlyph,\n ChevronsUpDown as ChevronsUpDownGlyph,\n CircleAlert,\n CircleCheck,\n Clock as ClockGlyph,\n Copy as CopyGlyph,\n Ellipsis,\n Eye as EyeGlyph,\n EyeOff as EyeOffGlyph,\n Folder as FolderGlyph,\n Hash as HashGlyph,\n History as HistoryGlyph,\n Inbox as InboxGlyph,\n Info as InfoGlyph,\n KeyRound,\n Layers as LayersGlyph,\n Link as LinkGlyph,\n LoaderCircle,\n Lock as LockGlyph,\n LogOut,\n Menu as MenuGlyph,\n Monitor as MonitorGlyph,\n Moon as MoonGlyph,\n PanelLeft as PanelLeftGlyph,\n Pause as PauseGlyph,\n Pencil as PencilGlyph,\n Play as PlayGlyph,\n Plus as PlusGlyph,\n RotateCcw,\n ScrollText,\n Search as SearchGlyph,\n Settings as SettingsGlyph,\n ShieldCheck as ShieldCheckGlyph,\n Sun as SunGlyph,\n Terminal as TerminalGlyph,\n Trash2,\n TriangleAlert,\n Upload as UploadGlyph,\n User as UserGlyph,\n UserRoundCog,\n Users as UsersGlyph,\n X as XGlyph,\n} from 'lucide-react';\nimport { markPath } from './mark';\n\n/**\n * One icon vocabulary for the whole app: Lucide, at one stroke weight.\n *\n * Mixing icon families is the fastest way to make a product UI feel assembled\n * rather than designed, so every glyph comes through here and call sites never\n * import Lucide themselves: changing one is a line in this file. The\n * exceptions are marks that are not ours to redraw: coffre's mark and the\n * sign-in providers' logos.\n */\n\ntype IconProps = {\n size?: number;\n className?: string;\n style?: React.CSSProperties;\n /** Icons are decorative by default; pass a label when one carries meaning. */\n label?: string;\n};\n\nfunction Svg({\n size = 16,\n className,\n style,\n label,\n children,\n}: IconProps & { children: React.ReactNode }) {\n return (\n <svg\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth={1.6}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className={className}\n style={style}\n aria-hidden={label === undefined}\n aria-label={label}\n role={label === undefined ? undefined : 'img'}\n >\n {children}\n </svg>\n );\n}\n\n/**\n * The mark, bare, in the text's colour, so it follows the theme. The tiled\n * favicon and app icons are drawn from the same paths, in `./mark`.\n */\nexport function Mark({ size = 16, className, style, label }: IconProps) {\n return (\n <svg\n width={size}\n height={size}\n viewBox=\"0 0 32 32\"\n className={className}\n style={style}\n aria-hidden={label === undefined}\n aria-label={label}\n role={label === undefined ? undefined : 'img'}\n >\n <path d={markPath(size)} fill=\"currentColor\" />\n </svg>\n );\n}\n\n/**\n * Lucide draws on a 24-unit grid with a 2-unit stroke. At the 14-16px these\n * are shown, 1.75 sits closer to Inter's weight beside them.\n */\nconst STROKE = 1.75;\n\nfunction lucide(Glyph: LucideIcon) {\n // Lucide hides a glyph from assistive technology unless it is labelled.\n return function Icon({ size = 16, className, style, label }: IconProps) {\n return (\n <Glyph\n size={size}\n strokeWidth={STROKE}\n className={className}\n style={style}\n {...(label === undefined ? {} : { 'aria-label': label, role: 'img' })}\n />\n );\n };\n}\n\n// Places\nexport const Folder = lucide(FolderGlyph);\nexport const Layers = lucide(LayersGlyph);\nexport const Users = lucide(UsersGlyph);\nexport const User = lucide(UserGlyph);\n/** Your own settings, so they never share the instance's gear. */\nexport const UserCog = lucide(UserRoundCog);\nexport const Key = lucide(KeyRound);\nexport const Ledger = lucide(ScrollText);\nexport const Settings = lucide(SettingsGlyph);\n\n// Secrets\nexport const Eye = lucide(EyeGlyph);\nexport const EyeOff = lucide(EyeOffGlyph);\nexport const Copy = lucide(CopyGlyph);\nexport const Pencil = lucide(PencilGlyph);\nexport const Archive = lucide(ArchiveGlyph);\nexport const Trash = lucide(Trash2);\nexport const History = lucide(HistoryGlyph);\nexport const RotateBack = lucide(RotateCcw);\nexport const Upload = lucide(UploadGlyph);\nexport const Pause = lucide(PauseGlyph);\nexport const Play = lucide(PlayGlyph);\nexport const Lock = lucide(LockGlyph);\nexport const Terminal = lucide(TerminalGlyph);\nexport const Hash = lucide(HashGlyph);\nexport const Clock = lucide(ClockGlyph);\n\n// Outcomes\nexport const Check = lucide(CheckGlyph);\nexport const CheckCircle = lucide(CircleCheck);\nexport const SlashCircle = lucide(Ban);\nexport const ShieldCheck = lucide(ShieldCheckGlyph);\nexport const AlertTriangle = lucide(TriangleAlert);\nexport const AlertCircle = lucide(CircleAlert);\nexport const Info = lucide(InfoGlyph);\nexport const Activity = lucide(ActivityGlyph);\nexport const Inbox = lucide(InboxGlyph);\nexport const Loader = lucide(LoaderCircle);\n\n// Controls\nexport const X = lucide(XGlyph);\nexport const Plus = lucide(PlusGlyph);\nexport const Search = lucide(SearchGlyph);\nexport const Menu = lucide(MenuGlyph);\nexport const PanelLeft = lucide(PanelLeftGlyph);\nexport const MoreHorizontal = lucide(Ellipsis);\nexport const ChevronRight = lucide(ChevronRightGlyph);\nexport const ChevronDown = lucide(ChevronDownGlyph);\nexport const ChevronsUpDown = lucide(ChevronsUpDownGlyph);\nexport const ArrowRight = lucide(ArrowRightGlyph);\nexport const Link = lucide(LinkGlyph);\nexport const SignOut = lucide(LogOut);\n\n// Theme\nexport const Sun = lucide(SunGlyph);\nexport const Moon = lucide(MoonGlyph);\nexport const Monitor = lucide(MonitorGlyph);\n\n/**\n * GitHub's mark, drawn as GitHub publishes it: a filled shape on its own\n * 16-unit grid, since a brand is not ours to redraw in the stroke style.\n */\nexport function GitHub({ size = 16, className, style }: IconProps) {\n return (\n <svg\n width={size}\n height={size}\n viewBox=\"0 0 16 16\"\n fill=\"currentColor\"\n className={className}\n style={style}\n aria-hidden\n >\n <path d=\"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.01 8.01 0 0 0 16 8c0-4.42-3.58-8-8-8Z\" />\n </svg>\n );\n}\n\n/** Google's \"G\", in its four colours, as Google's sign-in guidelines require. */\nexport function Google({ size = 16, className, style }: IconProps) {\n return (\n <svg width={size} height={size} viewBox=\"0 0 48 48\" className={className} style={style} aria-hidden>\n <path fill=\"#EA4335\" d=\"M24 9.5c3.54 0 6.71 1.22 9.21 3.6l6.85-6.85C35.9 2.38 30.47 0 24 0 14.62 0 6.51 5.38 2.56 13.22l7.98 6.19C12.43 13.72 17.74 9.5 24 9.5z\" />\n <path fill=\"#4285F4\" d=\"M46.98 24.55c0-1.57-.15-3.09-.38-4.55H24v9.02h12.94c-.58 2.96-2.26 5.48-4.78 7.18l7.73 6c4.51-4.18 7.09-10.36 7.09-17.65z\" />\n <path fill=\"#FBBC05\" d=\"M10.53 28.59c-.48-1.45-.76-2.99-.76-4.59s.27-3.14.76-4.59l-7.98-6.19C.92 16.46 0 20.12 0 24c0 3.88.92 7.54 2.56 10.78l7.97-6.19z\" />\n <path fill=\"#34A853\" d=\"M24 48c6.48 0 11.93-2.13 15.89-5.81l-7.73-6c-2.15 1.45-4.92 2.3-8.16 2.3-6.26 0-11.57-4.22-13.47-9.91l-7.98 6.19C6.51 42.62 14.62 48 24 48z\" />\n </svg>\n );\n}\n\n/** Microsoft's four squares. */\nexport function Microsoft({ size = 16, className, style }: IconProps) {\n return (\n <svg width={size} height={size} viewBox=\"0 0 21 21\" className={className} style={style} aria-hidden>\n <rect x=\"0\" y=\"0\" width=\"10\" height=\"10\" fill=\"#F25022\" />\n <rect x=\"11\" y=\"0\" width=\"10\" height=\"10\" fill=\"#7FBA00\" />\n <rect x=\"0\" y=\"11\" width=\"10\" height=\"10\" fill=\"#00A4EF\" />\n <rect x=\"11\" y=\"11\" width=\"10\" height=\"10\" fill=\"#FFB900\" />\n </svg>\n );\n}\n\n/** The mark on a provider's button; any other OpenID Connect issuer gets a key. */\nexport function ProviderMark({ brand, size = 16 }: { brand: string; size?: number }) {\n switch (brand) {\n case 'github':\n return <GitHub size={size} />;\n case 'google':\n return <Google size={size} />;\n case 'microsoft':\n return <Microsoft size={size} />;\n default:\n return <Key size={size} />;\n }\n}\n","const HUES = ['blue', 'green', 'amber', 'violet'] as const;\n\n/** The same name always lands on the same tint, on every screen (FNV-1a). */\nexport function tileHue(name: string): (typeof HUES)[number] {\n let hash = 0x811c9dc5;\n for (const char of name) hash = Math.imul(hash ^ char.charCodeAt(0), 0x01000193) >>> 0;\n return HUES[hash % HUES.length];\n}\n\n/**\n * A letter on a tint, standing in for a project wherever its name appears.\n *\n * It is a recognition aid, not information: the name is always beside it, so\n * the tile is hidden from assistive technology.\n */\nexport function Tile({ name, size = 'sm' }: { name: string; size?: 'sm' | 'lg' }) {\n return (\n <span className={`tile tile-${tileHue(name)}${size === 'lg' ? ' tile-lg' : ''}`} aria-hidden>\n {name.slice(0, 1)}\n </span>\n );\n}\n","import { CoffreError, type CoffreClient } from '@coffre/client';\nimport { useRouter } from '@tanstack/react-router';\n\nimport type { CoffreContext } from '../options';\n\n/**\n * The API as whoever is looking at the page, with their permissions: what\n * coffre's pages call, and a deployment's own may too. In the browser this\n * is plain `fetch` to `/api`, carrying the session cookie; on the server,\n * the API in process. Components call it from event handlers; loaders read\n * the same client as `context.coffre`.\n */\nexport function useCoffre(): CoffreClient {\n return (useRouter().options.context as CoffreContext).coffre;\n}\n\n/** A refusal the page words itself, shown as it is. */\nexport class Refusal extends Error {}\n\n/** A call that failed: what to say, and whether signing in again would help, which it does only for an ended session. */\ntype Failure = { ok: false; error: string; signedOut: boolean };\n\n/** The HTTP status of an API error; undefined when the request never got an answer. */\nexport function statusOf(error: unknown): number | undefined {\n return error instanceof CoffreError ? error.status : undefined;\n}\n\n/** What to tell the person when a call fails. */\nexport function failureMessage(error: unknown): string {\n if (error instanceof Refusal) return error.message;\n if (!(error instanceof CoffreError)) return 'The request could not be sent. Nothing was changed.';\n if (error.status === 401) return 'Your session has ended. Sign in again, then retry.';\n if (error.code === 'cross_origin') return 'coffre refused a change that did not come from this page. Reload, then retry.';\n if (error.status === 403) {\n return 'You hold no grant that covers this. Someone with grant.manage on the project can add one.';\n }\n if (error.status === 404) return 'Not found. It may have been renamed or archived.';\n // A 400 or 409 carries a sentence written for the person, such as which\n // field of a request is wrong, which names a service account as people\n // do, service:<name>. Anything unexpected stays generic.\n if (error.status === 400 || error.status === 409) return error.message;\n return 'coffre is unavailable. Nothing was read or written.';\n}\n\nexport function uiFailure(error: unknown): Failure {\n return { ok: false, error: failureMessage(error), signedOut: statusOf(error) === 401 };\n}\n\n/** A loader's answer: what it read, or what to say instead. */\nexport async function uiResult<T extends object>(\n operation: () => Promise<T>,\n): Promise<({ ok: true } & T) | Failure> {\n try {\n return { ok: true, ...(await operation()) };\n } catch (error) {\n return uiFailure(error);\n }\n}\n\n/** How the API names a member: `user:ada@acme.example`, `token:ci-deploy` (which people read as `service:ci-deploy`). */\nexport function memberRef(principalType: 'user' | 'service', principalId: string): string {\n return `${principalType === 'user' ? 'user' : 'token'}:${principalId}`;\n}\n","import type { ReactNode } from 'react';\nimport { Tile } from './tile';\n\n/**\n * The head of every page: an optional project tile, the title with a muted\n * aside, one line of description or facts, and the page's own actions.\n *\n * Where you are is already in the top bar's path, so the head does not repeat\n * it; it says what this page is.\n */\nexport function PageHeader({\n tile,\n lead,\n title,\n aside,\n description,\n meta,\n actions,\n}: {\n tile?: string;\n /** Stands where the tile would, for pages that are not about a project. */\n lead?: ReactNode;\n title: ReactNode;\n aside?: ReactNode;\n description?: ReactNode;\n meta?: ReactNode;\n actions?: ReactNode;\n}) {\n return (\n <header className=\"page-head\">\n <div className=\"page-head-text\">\n {tile !== undefined && <Tile name={tile} size=\"lg\" />}\n {lead}\n <div style={{ minWidth: 0 }}>\n <h1 className=\"page-title\">\n <span>{title}</span>\n {aside !== undefined && aside !== null && (\n <span className=\"page-title-aside\">{aside}</span>\n )}\n </h1>\n {description !== undefined && <p className=\"page-desc\">{description}</p>}\n {meta !== undefined && <div className=\"page-meta\">{meta}</div>}\n </div>\n </div>\n {actions !== undefined && actions !== false && (\n <div className=\"page-actions\">{actions}</div>\n )}\n </header>\n );\n}\n\n/** A bordered panel with a titled head; tables inside it run edge to edge. */\nexport function Card({\n title,\n description,\n actions,\n children,\n labelledBy,\n tone,\n wide = false,\n}: {\n title: ReactNode;\n description?: ReactNode;\n actions?: ReactNode;\n children: ReactNode;\n labelledBy: string;\n tone?: 'danger';\n /** Takes the content column whole, for a table of many or long columns. */\n wide?: boolean;\n}) {\n return (\n <section\n className={`card${tone === 'danger' ? ' card-danger' : ''}${wide ? ' card-wide' : ''}`}\n aria-labelledby={labelledBy}\n >\n <div className=\"card-head\">\n <div>\n <h2 className=\"card-title\" id={labelledBy}>\n {title}\n </h2>\n {description !== undefined && <p className=\"card-desc\">{description}</p>}\n </div>\n {actions}\n </div>\n {children}\n </section>\n );\n}\n\n/** One labelled fact in a card's `dl.facts`. */\nexport function Fact({ label, children }: { label: string; children: ReactNode }) {\n return (\n <div className=\"fact\">\n <dt>{label}</dt>\n <dd>{children}</dd>\n </div>\n );\n}\n\n/**\n * A page that cannot be shown: no access, no such thing, or no session.\n *\n * It says which page, why in a sentence, and offers the one useful way out.\n */\nexport function ClosedDoor({\n icon,\n label,\n title,\n children,\n actions,\n}: {\n icon?: ReactNode;\n label?: ReactNode;\n title: ReactNode;\n children: ReactNode;\n actions?: ReactNode;\n}) {\n return (\n <div className=\"closed\" role=\"status\">\n {icon !== undefined && (\n <div className=\"closed-icon\" aria-hidden>\n {icon}\n </div>\n )}\n {label !== undefined && <p className=\"closed-label\">{label}</p>}\n <h1 className=\"closed-title\">{title}</h1>\n <div className=\"closed-body\">{children}</div>\n {actions !== undefined && <div className=\"closed-actions\">{actions}</div>}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAYA,IAAa,YAAY;;AAGzB,IAAa,kBAAkB;AAW/B,SAAgB,SAAS,MAAsB;CAC7C,OAAO,QAAQ,KAAK,kBAAkB;AACxC;;;;;;;AC2EA,SAAgB,KAAK,EAAE,OAAO,IAAI,WAAW,OAAO,SAAoB;CACtE,OACE,oBAAC,OAAD;EACE,OAAO;EACP,QAAQ;EACR,SAAQ;EACG;EACJ;EACP,eAAa,UAAU,KAAA;EACvB,cAAY;EACZ,MAAM,UAAU,KAAA,IAAY,KAAA,IAAY;YAExC,oBAAC,QAAD;GAAM,GAAG,SAAS,IAAI;GAAG,MAAK;EAAgB,CAAA;CAC3C,CAAA;AAET;;;;;AAMA,IAAM,SAAS;AAEf,SAAS,OAAO,OAAmB;CAEjC,OAAO,SAAS,KAAK,EAAE,OAAO,IAAI,WAAW,OAAO,SAAoB;EACtE,OACE,oBAAC,OAAD;GACQ;GACN,aAAa;GACF;GACJ;GACP,GAAK,UAAU,KAAA,IAAY,CAAC,IAAI;IAAE,cAAc;IAAO,MAAM;GAAM;EACpE,CAAA;CAEL;AACF;AAGA,IAAa,WAAS,OAAO,MAAW;AACxC,IAAa,WAAS,OAAO,MAAW;AACxC,IAAa,UAAQ,OAAO,KAAU;AACtC,IAAa,SAAO,OAAO,IAAS;;AAEpC,IAAa,UAAU,OAAO,YAAY;AAC1C,IAAa,MAAM,OAAO,QAAQ;AAClC,IAAa,SAAS,OAAO,UAAU;AACvC,IAAa,aAAW,OAAO,QAAa;AAG5C,IAAa,QAAM,OAAO,GAAQ;AAClC,IAAa,WAAS,OAAO,MAAW;AACxC,IAAa,SAAO,OAAO,IAAS;AACpC,IAAa,WAAS,OAAO,MAAW;AACxC,IAAa,YAAU,OAAO,OAAY;AAC1C,IAAa,QAAQ,OAAO,MAAM;AAClC,IAAa,YAAU,OAAO,OAAY;AAC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,SAAgB,WAAW,EACzB,MACA,OACA,OACA,UACA,WAOC;CACD,OACE,qBAAC,OAAD;EAAK,WAAU;EAAS,MAAK;YAA7B;GACG,SAAS,KAAA,KACR,oBAAC,OAAD;IAAK,WAAU;IAAc,eAAA;cAC1B;GACE,CAAA;GAEN,UAAU,KAAA,KAAa,oBAAC,KAAD;IAAG,WAAU;cAAgB;GAAS,CAAA;GAC9D,oBAAC,MAAD;IAAI,WAAU;cAAgB;GAAU,CAAA;GACxC,oBAAC,OAAD;IAAK,WAAU;IAAe;GAAc,CAAA;GAC3C,YAAY,KAAA,KAAa,oBAAC,OAAD;IAAK,WAAU;cAAkB;GAAa,CAAA;EACrE;;AAET"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { t as useMounted } from "./mounted-jJmqqV_n.js";
|
|
2
|
+
import { A as Key } from "./page-DvsgZ2Hd.js";
|
|
3
|
+
import { Link } from "@tanstack/react-router";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
//#region src/components/principal.tsx
|
|
6
|
+
/** A person's initial, or a key for a machine. */
|
|
7
|
+
function PrincipalAvatar({ type, id, size = "sm" }) {
|
|
8
|
+
return /* @__PURE__ */ jsx("span", {
|
|
9
|
+
className: `avatar${type === "service" ? " avatar-token" : ""}${size === "lg" ? " avatar-lg" : ""}`,
|
|
10
|
+
"aria-hidden": true,
|
|
11
|
+
children: type === "service" ? /* @__PURE__ */ jsx(Key, { size: size === "lg" ? 18 : 13 }) : id.slice(0, 1)
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* A user or token, linking to its own page, if the deployment kept it.
|
|
16
|
+
* `stretch` makes the link cover the whole table row it sits in.
|
|
17
|
+
*/
|
|
18
|
+
function PrincipalLink({ type, id, stretch = false }) {
|
|
19
|
+
const className = `cell-link${stretch ? " stretch" : ""}`;
|
|
20
|
+
const mounted = useMounted();
|
|
21
|
+
return /* @__PURE__ */ jsxs("span", {
|
|
22
|
+
className: "cell-principal",
|
|
23
|
+
children: [/* @__PURE__ */ jsx(PrincipalAvatar, {
|
|
24
|
+
type,
|
|
25
|
+
id
|
|
26
|
+
}), !mounted(type === "user" ? "/users/$user" : "/service-accounts/$account") ? /* @__PURE__ */ jsx("span", { children: type === "user" ? id : `service:${id}` }) : type === "user" ? /* @__PURE__ */ jsx(Link, {
|
|
27
|
+
className,
|
|
28
|
+
to: "/users/$user",
|
|
29
|
+
params: { user: id },
|
|
30
|
+
children: id
|
|
31
|
+
}) : /* @__PURE__ */ jsxs(Link, {
|
|
32
|
+
className,
|
|
33
|
+
to: "/service-accounts/$account",
|
|
34
|
+
params: { account: id },
|
|
35
|
+
children: ["service:", id]
|
|
36
|
+
})]
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
//#endregion
|
|
40
|
+
export { PrincipalLink as n, PrincipalAvatar as t };
|
|
41
|
+
|
|
42
|
+
//# sourceMappingURL=principal-BIN-xwZw.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"principal-BIN-xwZw.js","names":[],"sources":["../../src/components/principal.tsx"],"sourcesContent":["import { Link } from '@tanstack/react-router';\nimport { useMounted } from '../lib/mounted';\nimport type { DirectoryPrincipal } from '../shared/models';\nimport { Key } from './icons';\n\ntype PrincipalType = DirectoryPrincipal['principalType'];\n\n/** A person's initial, or a key for a machine. */\nexport function PrincipalAvatar({\n type,\n id,\n size = 'sm',\n}: {\n type: PrincipalType;\n id: string;\n size?: 'sm' | 'lg';\n}) {\n const className = `avatar${type === 'service' ? ' avatar-token' : ''}${size === 'lg' ? ' avatar-lg' : ''}`;\n return (\n <span className={className} aria-hidden>\n {type === 'service' ? <Key size={size === 'lg' ? 18 : 13} /> : id.slice(0, 1)}\n </span>\n );\n}\n\n/**\n * A user or token, linking to its own page, if the deployment kept it.\n * `stretch` makes the link cover the whole table row it sits in.\n */\nexport function PrincipalLink({\n type,\n id,\n stretch = false,\n}: {\n type: PrincipalType;\n id: string;\n stretch?: boolean;\n}) {\n const className = `cell-link${stretch ? ' stretch' : ''}`;\n const mounted = useMounted();\n return (\n <span className=\"cell-principal\">\n <PrincipalAvatar type={type} id={id} />\n {!mounted(type === 'user' ? '/users/$user' : '/service-accounts/$account') ? (\n <span>{type === 'user' ? id : `service:${id}`}</span>\n ) : type === 'user' ? (\n <Link className={className} to=\"/users/$user\" params={{ user: id }}>\n {id}\n </Link>\n ) : (\n <Link className={className} to=\"/service-accounts/$account\" params={{ account: id }}>\n service:{id}\n </Link>\n )}\n </span>\n );\n}\n"],"mappings":";;;;;;AAQA,SAAgB,gBAAgB,EAC9B,MACA,IACA,OAAO,QAKN;CAED,OACE,oBAAC,QAAD;EAAiB,WAAA,SAFQ,SAAS,YAAY,kBAAkB,KAAK,SAAS,OAAO,eAAe;EAExE,eAAA;YACzB,SAAS,YAAY,oBAAC,KAAD,EAAK,MAAM,SAAS,OAAO,KAAK,GAAK,CAAA,IAAI,GAAG,MAAM,GAAG,CAAC;CACxE,CAAA;AAEV;;;;;AAMA,SAAgB,cAAc,EAC5B,MACA,IACA,UAAU,SAKT;CACD,MAAM,YAAY,YAAY,UAAU,aAAa;CACrD,MAAM,UAAU,WAAW;CAC3B,OACE,qBAAC,QAAD;EAAM,WAAU;YAAhB,CACE,oBAAC,iBAAD;GAAuB;GAAU;EAAK,CAAA,GACrC,CAAC,QAAQ,SAAS,SAAS,iBAAiB,4BAA4B,IACvE,oBAAC,QAAD,EAAA,UAAO,SAAS,SAAS,KAAK,WAAW,KAAW,CAAA,IAClD,SAAS,SACX,oBAAC,MAAD;GAAiB;GAAW,IAAG;GAAe,QAAQ,EAAE,MAAM,GAAG;aAC9D;EACG,CAAA,IAEN,qBAAC,MAAD;GAAiB;GAAW,IAAG;GAA6B,QAAQ,EAAE,SAAS,GAAG;aAAlF,CAAqF,YAC1E,EACL;IAEJ;;AAEV"}
|