@jgb-solutions/kit 0.6.0 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +38 -0
- package/README.md +73 -7
- package/dist/account/AccountPage.d.ts +130 -0
- package/dist/account/SignIn.d.ts +54 -0
- package/dist/account/index.d.ts +12 -0
- package/dist/account/native/index.d.ts +173 -0
- package/dist/account/native.d.ts +2 -0
- package/dist/account/native.js +1012 -0
- package/dist/account/result.d.ts +13 -0
- package/dist/account/styles.css +557 -0
- package/dist/account/text.d.ts +108 -0
- package/dist/account/theme.d.ts +47 -0
- package/dist/account/ui.d.ts +73 -0
- package/dist/account.d.ts +2 -0
- package/dist/account.js +1396 -0
- package/dist/auth/browser.d.ts +4 -1
- package/dist/auth/bun.d.ts +3 -2
- package/dist/auth/bun.js +4 -2
- package/dist/auth/expo.d.ts +39 -4
- package/dist/auth/expo.js +24 -3
- package/dist/auth/orpc.d.ts +6 -0
- package/dist/auth/orpc.js +11 -3
- package/dist/auth/server.d.ts +43 -7
- package/dist/auth/server.js +178 -16
- package/dist/auth/versions.d.ts +17 -0
- package/dist/auth/versions.js +19 -0
- package/dist/auth.d.ts +111 -3
- package/dist/auth.js +110 -4
- package/dist/i18n.js +2 -2
- package/package.json +32 -5
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/** What every account action answers: kit/auth/server's AuthResult has this shape. */
|
|
2
|
+
export type AccountResult = {
|
|
3
|
+
ok: true;
|
|
4
|
+
} | {
|
|
5
|
+
ok: false;
|
|
6
|
+
code: string;
|
|
7
|
+
retryAfter?: number | undefined;
|
|
8
|
+
};
|
|
9
|
+
/** Runs an action, turning a throw into `{ ok: false, code: 'fallback' }`: a screen never shows a raw error. */
|
|
10
|
+
export declare function attempt<T extends AccountResult>(action: () => Promise<T>): Promise<T | {
|
|
11
|
+
ok: false;
|
|
12
|
+
code: string;
|
|
13
|
+
}>;
|
|
@@ -0,0 +1,557 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* kit/account: design tokens. One layout for every app's sign-in, sign-up and account pages (the
|
|
3
|
+
* owner's rule, 2026-12-04); each app changes only these tokens (colours, fonts,
|
|
4
|
+
* radius), through <AccountRoot theme={…}> or its own CSS on .jac-root.
|
|
5
|
+
*
|
|
6
|
+
* Everything lives under .jac-root, so the account pages never restyle the rest of the app.
|
|
7
|
+
* Light by default; dark with data-theme="dark", or with the system's dark mode while the scheme is
|
|
8
|
+
* "system" (no data-theme).
|
|
9
|
+
*/
|
|
10
|
+
.jac-root {
|
|
11
|
+
--jac-brand: #2f54c8;
|
|
12
|
+
--jac-brand-ink: #ffffff;
|
|
13
|
+
/* Brand-coloured text (links, a field's error) on the page and on cards. */
|
|
14
|
+
--jac-brand-text: #2a4bb3;
|
|
15
|
+
--jac-page: #f4f4f6;
|
|
16
|
+
--jac-surface: #ffffff;
|
|
17
|
+
--jac-raised: #ececf0;
|
|
18
|
+
--jac-line: #dcdce3;
|
|
19
|
+
--jac-field-line: #a9a9b4;
|
|
20
|
+
--jac-ink: #17171c;
|
|
21
|
+
--jac-muted: #5b5b66;
|
|
22
|
+
--jac-good: #146c43;
|
|
23
|
+
--jac-warn: #845400;
|
|
24
|
+
--jac-bad: #b42318;
|
|
25
|
+
--jac-info: #1d5c9e;
|
|
26
|
+
--jac-bad-fill: #b42318;
|
|
27
|
+
--jac-bad-ink: #ffffff;
|
|
28
|
+
--jac-focus: var(--jac-brand);
|
|
29
|
+
|
|
30
|
+
--jac-radius-card: 16px;
|
|
31
|
+
--jac-radius-control: 12px;
|
|
32
|
+
--jac-radius-button: 12px;
|
|
33
|
+
|
|
34
|
+
--jac-font-display: ui-sans-serif, system-ui, sans-serif;
|
|
35
|
+
--jac-font-body: ui-sans-serif, system-ui, sans-serif;
|
|
36
|
+
|
|
37
|
+
color-scheme: light;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.jac-root[data-theme='dark'] {
|
|
41
|
+
--jac-brand-text: color-mix(in oklab, var(--jac-brand) 45%, white);
|
|
42
|
+
--jac-page: #0b0b0e;
|
|
43
|
+
--jac-surface: #15151a;
|
|
44
|
+
--jac-raised: #212127;
|
|
45
|
+
--jac-line: #2d2d34;
|
|
46
|
+
--jac-field-line: #55555e;
|
|
47
|
+
--jac-ink: #eeeef1;
|
|
48
|
+
--jac-muted: #aaaab2;
|
|
49
|
+
--jac-good: #4cc38a;
|
|
50
|
+
--jac-warn: #f0b429;
|
|
51
|
+
--jac-bad: #ff7a6b;
|
|
52
|
+
--jac-info: #7cc4fa;
|
|
53
|
+
--jac-bad-fill: #d42320;
|
|
54
|
+
--jac-bad-ink: #ffffff;
|
|
55
|
+
--jac-focus: color-mix(in oklab, var(--jac-brand) 55%, white);
|
|
56
|
+
color-scheme: dark;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
@media (prefers-color-scheme: dark) {
|
|
60
|
+
.jac-root:not([data-theme]) {
|
|
61
|
+
--jac-brand-text: color-mix(in oklab, var(--jac-brand) 45%, white);
|
|
62
|
+
--jac-page: #0b0b0e;
|
|
63
|
+
--jac-surface: #15151a;
|
|
64
|
+
--jac-raised: #212127;
|
|
65
|
+
--jac-line: #2d2d34;
|
|
66
|
+
--jac-field-line: #55555e;
|
|
67
|
+
--jac-ink: #eeeef1;
|
|
68
|
+
--jac-muted: #aaaab2;
|
|
69
|
+
--jac-good: #4cc38a;
|
|
70
|
+
--jac-warn: #f0b429;
|
|
71
|
+
--jac-bad: #ff7a6b;
|
|
72
|
+
--jac-info: #7cc4fa;
|
|
73
|
+
--jac-bad-fill: #d42320;
|
|
74
|
+
--jac-bad-ink: #ffffff;
|
|
75
|
+
--jac-focus: color-mix(in oklab, var(--jac-brand) 55%, white);
|
|
76
|
+
color-scheme: dark;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/* kit/account: the pieces (card, field, messages, buttons), on the tokens. */
|
|
81
|
+
.jac-root {
|
|
82
|
+
font-family: var(--jac-font-body);
|
|
83
|
+
color: var(--jac-ink);
|
|
84
|
+
line-height: 1.5;
|
|
85
|
+
-webkit-text-size-adjust: 100%;
|
|
86
|
+
}
|
|
87
|
+
.jac-root[data-fill] {
|
|
88
|
+
background: var(--jac-page);
|
|
89
|
+
min-height: 100%;
|
|
90
|
+
}
|
|
91
|
+
.jac-root *,
|
|
92
|
+
.jac-root *::before,
|
|
93
|
+
.jac-root *::after {
|
|
94
|
+
box-sizing: border-box;
|
|
95
|
+
}
|
|
96
|
+
.jac-root :where(h1, h2, p, ul) {
|
|
97
|
+
margin: 0;
|
|
98
|
+
padding: 0;
|
|
99
|
+
}
|
|
100
|
+
.jac-root :where(button, input) {
|
|
101
|
+
font: inherit;
|
|
102
|
+
color: inherit;
|
|
103
|
+
}
|
|
104
|
+
.jac-root :where(a, button, input):focus-visible {
|
|
105
|
+
outline: 2px solid var(--jac-focus);
|
|
106
|
+
outline-offset: 2px;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/* The sign-in frame: one centred card, the app's header and footer around it. */
|
|
110
|
+
.jac-auth {
|
|
111
|
+
width: 100%;
|
|
112
|
+
max-width: 28rem;
|
|
113
|
+
margin-inline: auto;
|
|
114
|
+
padding-block: 1rem;
|
|
115
|
+
}
|
|
116
|
+
.jac-card {
|
|
117
|
+
border: 1px solid var(--jac-line);
|
|
118
|
+
border-radius: var(--jac-radius-card);
|
|
119
|
+
background: var(--jac-surface);
|
|
120
|
+
padding: 1.5rem;
|
|
121
|
+
}
|
|
122
|
+
.jac-title {
|
|
123
|
+
font-family: var(--jac-font-display);
|
|
124
|
+
font-size: 1.5rem;
|
|
125
|
+
line-height: 1.2;
|
|
126
|
+
font-weight: 900;
|
|
127
|
+
}
|
|
128
|
+
.jac-intro {
|
|
129
|
+
margin-top: 0.5rem;
|
|
130
|
+
font-size: 0.875rem;
|
|
131
|
+
color: var(--jac-muted);
|
|
132
|
+
}
|
|
133
|
+
.jac-card-body {
|
|
134
|
+
margin-top: 1.5rem;
|
|
135
|
+
}
|
|
136
|
+
.jac-footer {
|
|
137
|
+
margin-top: 1.5rem;
|
|
138
|
+
text-align: center;
|
|
139
|
+
font-size: 0.875rem;
|
|
140
|
+
color: var(--jac-muted);
|
|
141
|
+
}
|
|
142
|
+
.jac-note {
|
|
143
|
+
margin-top: 1rem;
|
|
144
|
+
text-align: center;
|
|
145
|
+
font-size: 0.75rem;
|
|
146
|
+
color: var(--jac-muted);
|
|
147
|
+
}
|
|
148
|
+
.jac-link {
|
|
149
|
+
font-weight: 600;
|
|
150
|
+
color: var(--jac-ink);
|
|
151
|
+
text-decoration: underline;
|
|
152
|
+
text-underline-offset: 4px;
|
|
153
|
+
border-radius: 4px;
|
|
154
|
+
}
|
|
155
|
+
.jac-notice .jac-link {
|
|
156
|
+
display: inline-block;
|
|
157
|
+
margin-top: 0.25rem;
|
|
158
|
+
}
|
|
159
|
+
@media (min-width: 640px) {
|
|
160
|
+
.jac-auth {
|
|
161
|
+
padding-block: 2rem;
|
|
162
|
+
}
|
|
163
|
+
.jac-card {
|
|
164
|
+
padding: 2rem;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
/* A labelled field: its error (announced) and hint under it. */
|
|
169
|
+
.jac-field {
|
|
170
|
+
margin-bottom: 1rem;
|
|
171
|
+
}
|
|
172
|
+
.jac-label {
|
|
173
|
+
display: block;
|
|
174
|
+
margin-bottom: 0.375rem;
|
|
175
|
+
font-size: 0.875rem;
|
|
176
|
+
font-weight: 600;
|
|
177
|
+
}
|
|
178
|
+
.jac-input {
|
|
179
|
+
display: block;
|
|
180
|
+
width: 100%;
|
|
181
|
+
min-height: 2.75rem;
|
|
182
|
+
border: 1px solid var(--jac-field-line);
|
|
183
|
+
border-radius: var(--jac-radius-control);
|
|
184
|
+
background: var(--jac-surface);
|
|
185
|
+
padding: 0.625rem 0.875rem;
|
|
186
|
+
font-size: 1rem;
|
|
187
|
+
}
|
|
188
|
+
.jac-input[aria-invalid='true'] {
|
|
189
|
+
border-color: var(--jac-bad);
|
|
190
|
+
}
|
|
191
|
+
.jac-field-error {
|
|
192
|
+
margin-top: 0.375rem;
|
|
193
|
+
font-size: 0.875rem;
|
|
194
|
+
font-weight: 600;
|
|
195
|
+
color: var(--jac-bad);
|
|
196
|
+
}
|
|
197
|
+
.jac-hint {
|
|
198
|
+
margin-top: 0.25rem;
|
|
199
|
+
font-size: 0.75rem;
|
|
200
|
+
color: var(--jac-muted);
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
/* Messages: an error (alert), a success or a warning (status). */
|
|
204
|
+
.jac-message {
|
|
205
|
+
margin-bottom: 1rem;
|
|
206
|
+
border: 1px solid;
|
|
207
|
+
border-radius: var(--jac-radius-control);
|
|
208
|
+
padding: 0.5rem 0.75rem;
|
|
209
|
+
font-size: 0.875rem;
|
|
210
|
+
}
|
|
211
|
+
.jac-message[data-kind='error'] {
|
|
212
|
+
border-color: color-mix(in oklab, var(--jac-bad) 50%, transparent);
|
|
213
|
+
background: color-mix(in oklab, var(--jac-bad) 10%, var(--jac-surface));
|
|
214
|
+
}
|
|
215
|
+
.jac-message[data-kind='success'] {
|
|
216
|
+
border-color: color-mix(in oklab, var(--jac-good) 50%, transparent);
|
|
217
|
+
background: color-mix(in oklab, var(--jac-good) 10%, var(--jac-surface));
|
|
218
|
+
}
|
|
219
|
+
.jac-message[data-kind='warning'] {
|
|
220
|
+
border-color: color-mix(in oklab, var(--jac-warn) 50%, transparent);
|
|
221
|
+
background: color-mix(in oklab, var(--jac-warn) 10%, var(--jac-surface));
|
|
222
|
+
}
|
|
223
|
+
/* Why the visitor is here: calm, not an error. */
|
|
224
|
+
.jac-notice {
|
|
225
|
+
display: flex;
|
|
226
|
+
align-items: flex-start;
|
|
227
|
+
gap: 0.625rem;
|
|
228
|
+
margin-bottom: 1.25rem;
|
|
229
|
+
border: 1px solid color-mix(in oklab, var(--jac-info) 40%, transparent);
|
|
230
|
+
border-radius: var(--jac-radius-control);
|
|
231
|
+
background: color-mix(in oklab, var(--jac-info) 10%, var(--jac-surface));
|
|
232
|
+
padding: 0.625rem 0.75rem;
|
|
233
|
+
font-size: 0.875rem;
|
|
234
|
+
}
|
|
235
|
+
.jac-notice > svg {
|
|
236
|
+
flex-shrink: 0;
|
|
237
|
+
width: 1rem;
|
|
238
|
+
height: 1rem;
|
|
239
|
+
margin-top: 0.125rem;
|
|
240
|
+
color: var(--jac-info);
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
/* Buttons: primary (the brand), quiet, danger. */
|
|
244
|
+
.jac-button {
|
|
245
|
+
display: inline-flex;
|
|
246
|
+
align-items: center;
|
|
247
|
+
justify-content: center;
|
|
248
|
+
gap: 0.5rem;
|
|
249
|
+
min-height: 2.75rem;
|
|
250
|
+
border: 1px solid transparent;
|
|
251
|
+
border-radius: var(--jac-radius-button);
|
|
252
|
+
background: var(--jac-brand);
|
|
253
|
+
color: var(--jac-brand-ink);
|
|
254
|
+
padding: 0.625rem 1.25rem;
|
|
255
|
+
font-weight: 600;
|
|
256
|
+
line-height: 1.25;
|
|
257
|
+
cursor: pointer;
|
|
258
|
+
transition:
|
|
259
|
+
filter 150ms,
|
|
260
|
+
background-color 150ms;
|
|
261
|
+
}
|
|
262
|
+
.jac-button:hover:not(:disabled) {
|
|
263
|
+
filter: brightness(1.08);
|
|
264
|
+
}
|
|
265
|
+
.jac-button[data-variant='quiet'] {
|
|
266
|
+
border-color: var(--jac-line);
|
|
267
|
+
background: var(--jac-surface);
|
|
268
|
+
color: var(--jac-ink);
|
|
269
|
+
padding-inline: 1rem;
|
|
270
|
+
font-weight: 500;
|
|
271
|
+
}
|
|
272
|
+
.jac-button[data-variant='quiet']:hover:not(:disabled) {
|
|
273
|
+
filter: none;
|
|
274
|
+
background: var(--jac-raised);
|
|
275
|
+
}
|
|
276
|
+
.jac-button[data-variant='danger'] {
|
|
277
|
+
background: var(--jac-bad-fill);
|
|
278
|
+
color: var(--jac-bad-ink);
|
|
279
|
+
}
|
|
280
|
+
.jac-button[data-block] {
|
|
281
|
+
width: 100%;
|
|
282
|
+
}
|
|
283
|
+
.jac-button:disabled {
|
|
284
|
+
opacity: 0.6;
|
|
285
|
+
cursor: default;
|
|
286
|
+
}
|
|
287
|
+
.jac-button > svg {
|
|
288
|
+
width: 1rem;
|
|
289
|
+
height: 1rem;
|
|
290
|
+
flex-shrink: 0;
|
|
291
|
+
}
|
|
292
|
+
/* Google's button: its own colours, whatever the app's theme (Google's sign-in branding). */
|
|
293
|
+
.jac-google {
|
|
294
|
+
display: flex;
|
|
295
|
+
align-items: center;
|
|
296
|
+
justify-content: center;
|
|
297
|
+
gap: 0.75rem;
|
|
298
|
+
width: 100%;
|
|
299
|
+
min-height: 2.75rem;
|
|
300
|
+
border: 1px solid #dadce0;
|
|
301
|
+
border-radius: 999px;
|
|
302
|
+
background: #ffffff;
|
|
303
|
+
color: #1f1f1f;
|
|
304
|
+
padding-inline: 1rem;
|
|
305
|
+
font-size: 0.875rem;
|
|
306
|
+
font-weight: 600;
|
|
307
|
+
cursor: pointer;
|
|
308
|
+
transition: background-color 150ms;
|
|
309
|
+
}
|
|
310
|
+
.jac-google:hover:not(:disabled) {
|
|
311
|
+
background: #f8f9fa;
|
|
312
|
+
}
|
|
313
|
+
.jac-google:disabled {
|
|
314
|
+
opacity: 0.6;
|
|
315
|
+
cursor: default;
|
|
316
|
+
}
|
|
317
|
+
.jac-google > svg {
|
|
318
|
+
width: 18px;
|
|
319
|
+
height: 18px;
|
|
320
|
+
}
|
|
321
|
+
.jac-stack-sm > * + * {
|
|
322
|
+
margin-top: 0.75rem;
|
|
323
|
+
}
|
|
324
|
+
.jac-or {
|
|
325
|
+
display: flex;
|
|
326
|
+
align-items: center;
|
|
327
|
+
gap: 0.75rem;
|
|
328
|
+
margin-block: 1.25rem;
|
|
329
|
+
font-size: 0.75rem;
|
|
330
|
+
text-transform: uppercase;
|
|
331
|
+
letter-spacing: 0.1em;
|
|
332
|
+
color: var(--jac-muted);
|
|
333
|
+
}
|
|
334
|
+
.jac-or::before,
|
|
335
|
+
.jac-or::after {
|
|
336
|
+
content: '';
|
|
337
|
+
flex: 1;
|
|
338
|
+
height: 1px;
|
|
339
|
+
background: var(--jac-line);
|
|
340
|
+
}
|
|
341
|
+
.jac-icon-button {
|
|
342
|
+
display: inline-flex;
|
|
343
|
+
align-items: center;
|
|
344
|
+
justify-content: center;
|
|
345
|
+
width: 2.25rem;
|
|
346
|
+
height: 2.25rem;
|
|
347
|
+
flex-shrink: 0;
|
|
348
|
+
border: 0;
|
|
349
|
+
border-radius: 999px;
|
|
350
|
+
background: transparent;
|
|
351
|
+
color: var(--jac-muted);
|
|
352
|
+
cursor: pointer;
|
|
353
|
+
}
|
|
354
|
+
.jac-icon-button:hover:not(:disabled) {
|
|
355
|
+
background: var(--jac-raised);
|
|
356
|
+
color: var(--jac-ink);
|
|
357
|
+
}
|
|
358
|
+
.jac-icon-button > svg {
|
|
359
|
+
width: 1rem;
|
|
360
|
+
height: 1rem;
|
|
361
|
+
}
|
|
362
|
+
.jac-avatar {
|
|
363
|
+
display: inline-flex;
|
|
364
|
+
align-items: center;
|
|
365
|
+
justify-content: center;
|
|
366
|
+
flex-shrink: 0;
|
|
367
|
+
overflow: hidden;
|
|
368
|
+
border-radius: 999px;
|
|
369
|
+
background: var(--jac-raised);
|
|
370
|
+
color: var(--jac-ink);
|
|
371
|
+
font-weight: 700;
|
|
372
|
+
}
|
|
373
|
+
.jac-avatar > img {
|
|
374
|
+
width: 100%;
|
|
375
|
+
height: 100%;
|
|
376
|
+
object-fit: cover;
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
@media (prefers-reduced-motion: reduce) {
|
|
380
|
+
.jac-button,
|
|
381
|
+
.jac-google {
|
|
382
|
+
transition: none;
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
/* kit/account: the account page: a column of cards, in a fixed order. */
|
|
387
|
+
.jac-page {
|
|
388
|
+
width: 100%;
|
|
389
|
+
max-width: 42rem;
|
|
390
|
+
margin-inline: auto;
|
|
391
|
+
display: flex;
|
|
392
|
+
flex-direction: column;
|
|
393
|
+
gap: 1.5rem;
|
|
394
|
+
}
|
|
395
|
+
.jac-page-head {
|
|
396
|
+
display: flex;
|
|
397
|
+
flex-wrap: wrap;
|
|
398
|
+
align-items: flex-end;
|
|
399
|
+
justify-content: space-between;
|
|
400
|
+
gap: 0.75rem;
|
|
401
|
+
}
|
|
402
|
+
.jac-page-title {
|
|
403
|
+
font-family: var(--jac-font-display);
|
|
404
|
+
font-size: 1.875rem;
|
|
405
|
+
line-height: 1.2;
|
|
406
|
+
font-weight: 900;
|
|
407
|
+
}
|
|
408
|
+
.jac-section {
|
|
409
|
+
border: 1px solid var(--jac-line);
|
|
410
|
+
border-radius: var(--jac-radius-card);
|
|
411
|
+
background: var(--jac-surface);
|
|
412
|
+
padding: 1.25rem;
|
|
413
|
+
}
|
|
414
|
+
.jac-section[data-tone='danger'] {
|
|
415
|
+
border-color: color-mix(in oklab, var(--jac-bad) 45%, transparent);
|
|
416
|
+
}
|
|
417
|
+
.jac-h2 {
|
|
418
|
+
margin-bottom: 1rem;
|
|
419
|
+
font-family: var(--jac-font-display);
|
|
420
|
+
font-size: 1.125rem;
|
|
421
|
+
line-height: 1.3;
|
|
422
|
+
font-weight: 700;
|
|
423
|
+
}
|
|
424
|
+
.jac-text {
|
|
425
|
+
margin-bottom: 1rem;
|
|
426
|
+
font-size: 0.875rem;
|
|
427
|
+
color: var(--jac-muted);
|
|
428
|
+
}
|
|
429
|
+
.jac-text:last-child {
|
|
430
|
+
margin-bottom: 0;
|
|
431
|
+
}
|
|
432
|
+
@media (min-width: 640px) {
|
|
433
|
+
.jac-section {
|
|
434
|
+
padding: 1.5rem;
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
/* Profile: the person, then label | value | Change rows. */
|
|
439
|
+
.jac-person {
|
|
440
|
+
display: flex;
|
|
441
|
+
align-items: center;
|
|
442
|
+
gap: 0.75rem;
|
|
443
|
+
margin-bottom: 1rem;
|
|
444
|
+
}
|
|
445
|
+
.jac-person-name {
|
|
446
|
+
min-width: 0;
|
|
447
|
+
overflow: hidden;
|
|
448
|
+
text-overflow: ellipsis;
|
|
449
|
+
white-space: nowrap;
|
|
450
|
+
font-size: 1.125rem;
|
|
451
|
+
font-weight: 700;
|
|
452
|
+
}
|
|
453
|
+
.jac-rows {
|
|
454
|
+
border-block: 1px solid var(--jac-line);
|
|
455
|
+
font-size: 0.875rem;
|
|
456
|
+
}
|
|
457
|
+
.jac-rows > * + * {
|
|
458
|
+
border-top: 1px solid var(--jac-line);
|
|
459
|
+
}
|
|
460
|
+
.jac-row {
|
|
461
|
+
padding-block: 0.75rem;
|
|
462
|
+
}
|
|
463
|
+
.jac-row-line {
|
|
464
|
+
display: flex;
|
|
465
|
+
align-items: center;
|
|
466
|
+
gap: 1rem;
|
|
467
|
+
min-height: 2.25rem;
|
|
468
|
+
}
|
|
469
|
+
.jac-row-label {
|
|
470
|
+
width: 6rem;
|
|
471
|
+
flex-shrink: 0;
|
|
472
|
+
color: var(--jac-muted);
|
|
473
|
+
}
|
|
474
|
+
.jac-row-value {
|
|
475
|
+
min-width: 0;
|
|
476
|
+
flex: 1;
|
|
477
|
+
overflow-wrap: anywhere;
|
|
478
|
+
}
|
|
479
|
+
.jac-row-value[data-strong] {
|
|
480
|
+
font-weight: 600;
|
|
481
|
+
}
|
|
482
|
+
.jac-row-edit {
|
|
483
|
+
min-height: 2.25rem;
|
|
484
|
+
flex-shrink: 0;
|
|
485
|
+
border: 0;
|
|
486
|
+
border-radius: 999px;
|
|
487
|
+
background: transparent;
|
|
488
|
+
padding-inline: 0.75rem;
|
|
489
|
+
font-size: 0.875rem;
|
|
490
|
+
font-weight: 600;
|
|
491
|
+
text-decoration: underline;
|
|
492
|
+
text-underline-offset: 4px;
|
|
493
|
+
cursor: pointer;
|
|
494
|
+
}
|
|
495
|
+
.jac-row-edit:hover {
|
|
496
|
+
background: var(--jac-raised);
|
|
497
|
+
}
|
|
498
|
+
.jac-row-note {
|
|
499
|
+
margin-top: 0.25rem;
|
|
500
|
+
padding-left: 7rem;
|
|
501
|
+
font-size: 0.75rem;
|
|
502
|
+
color: var(--jac-muted);
|
|
503
|
+
}
|
|
504
|
+
.jac-row .jac-message {
|
|
505
|
+
margin-bottom: 0.5rem;
|
|
506
|
+
}
|
|
507
|
+
.jac-actions {
|
|
508
|
+
display: flex;
|
|
509
|
+
flex-wrap: wrap;
|
|
510
|
+
gap: 0.5rem;
|
|
511
|
+
}
|
|
512
|
+
.jac-admin-link {
|
|
513
|
+
display: inline-block;
|
|
514
|
+
margin-top: 1rem;
|
|
515
|
+
font-size: 0.875rem;
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
/* Passkeys: one line each, with a remove button. */
|
|
519
|
+
.jac-list {
|
|
520
|
+
margin-bottom: 1rem;
|
|
521
|
+
list-style: none;
|
|
522
|
+
border: 1px solid var(--jac-line);
|
|
523
|
+
border-radius: var(--jac-radius-control);
|
|
524
|
+
}
|
|
525
|
+
.jac-list > li {
|
|
526
|
+
display: flex;
|
|
527
|
+
align-items: center;
|
|
528
|
+
gap: 0.75rem;
|
|
529
|
+
padding: 0.75rem 1rem;
|
|
530
|
+
}
|
|
531
|
+
.jac-list > li + li {
|
|
532
|
+
border-top: 1px solid var(--jac-line);
|
|
533
|
+
}
|
|
534
|
+
.jac-list > li > svg {
|
|
535
|
+
width: 1rem;
|
|
536
|
+
height: 1rem;
|
|
537
|
+
flex-shrink: 0;
|
|
538
|
+
color: var(--jac-muted);
|
|
539
|
+
}
|
|
540
|
+
.jac-list-main {
|
|
541
|
+
min-width: 0;
|
|
542
|
+
flex: 1;
|
|
543
|
+
}
|
|
544
|
+
.jac-list-name {
|
|
545
|
+
overflow: hidden;
|
|
546
|
+
text-overflow: ellipsis;
|
|
547
|
+
white-space: nowrap;
|
|
548
|
+
font-size: 0.875rem;
|
|
549
|
+
font-weight: 600;
|
|
550
|
+
}
|
|
551
|
+
.jac-list-meta {
|
|
552
|
+
font-size: 0.75rem;
|
|
553
|
+
color: var(--jac-muted);
|
|
554
|
+
}
|
|
555
|
+
.jac-narrow {
|
|
556
|
+
max-width: 20rem;
|
|
557
|
+
}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Every word the account screens show, in one typed object. The kit ships English (`accountTextEn`);
|
|
3
|
+
* an app passes its own translation, or English with a few lines changed:
|
|
4
|
+
*
|
|
5
|
+
* const text = { ...accountTextEn, signUp: { ...accountTextEn.signUp, intro: 'Free, and optional.' } }
|
|
6
|
+
*
|
|
7
|
+
* Words that hold a number or a name are functions, so every language can place them where it needs.
|
|
8
|
+
*/
|
|
9
|
+
export type AccountText = {
|
|
10
|
+
signIn: {
|
|
11
|
+
title: string;
|
|
12
|
+
submit: string;
|
|
13
|
+
passkey: string;
|
|
14
|
+
google: string;
|
|
15
|
+
or: string;
|
|
16
|
+
noAccount: string;
|
|
17
|
+
createOne: string;
|
|
18
|
+
/** In the reason notice, above the form: most visitors sent here are new. */
|
|
19
|
+
newHere: string;
|
|
20
|
+
/** No emails are sent, so there is no reset link: a passkey is the way back in. */
|
|
21
|
+
forgot: string;
|
|
22
|
+
};
|
|
23
|
+
signUp: {
|
|
24
|
+
title: string;
|
|
25
|
+
intro: string;
|
|
26
|
+
submit: string;
|
|
27
|
+
haveAccount: string;
|
|
28
|
+
signIn: string;
|
|
29
|
+
recovery: string;
|
|
30
|
+
};
|
|
31
|
+
signedIn: {
|
|
32
|
+
title: string;
|
|
33
|
+
body: string;
|
|
34
|
+
};
|
|
35
|
+
fields: {
|
|
36
|
+
login: string;
|
|
37
|
+
username: string;
|
|
38
|
+
usernameHint: (min: number, max: number) => string;
|
|
39
|
+
email: string;
|
|
40
|
+
emailHint: string;
|
|
41
|
+
password: string;
|
|
42
|
+
currentPassword: string;
|
|
43
|
+
newPassword: string;
|
|
44
|
+
passwordHint: (min: number) => string;
|
|
45
|
+
};
|
|
46
|
+
page: {
|
|
47
|
+
title: string;
|
|
48
|
+
signOut: string;
|
|
49
|
+
welcome: string;
|
|
50
|
+
profile: string;
|
|
51
|
+
displayName: string;
|
|
52
|
+
displayNameHint: string;
|
|
53
|
+
username: string;
|
|
54
|
+
usernameRule: (days: number) => string;
|
|
55
|
+
email: string;
|
|
56
|
+
noEmail: string;
|
|
57
|
+
edit: string;
|
|
58
|
+
editName: string;
|
|
59
|
+
editUsername: string;
|
|
60
|
+
save: string;
|
|
61
|
+
cancel: string;
|
|
62
|
+
nameSaved: string;
|
|
63
|
+
usernameSaved: (username: string) => string;
|
|
64
|
+
usernameNextChange: (date: string) => string;
|
|
65
|
+
usernameWait: (date: string) => string;
|
|
66
|
+
admin: string;
|
|
67
|
+
passkeys: string;
|
|
68
|
+
passkeysIntro: string;
|
|
69
|
+
passkeysIntroGoogle: string;
|
|
70
|
+
noPasskey: string;
|
|
71
|
+
noPasskeyGoogle: string;
|
|
72
|
+
addPasskey: string;
|
|
73
|
+
passkeyAdded: string;
|
|
74
|
+
passkeyName: (number: number) => string;
|
|
75
|
+
removePasskey: (name: string) => string;
|
|
76
|
+
added: (date: string) => string;
|
|
77
|
+
google: string;
|
|
78
|
+
googleConnected: string;
|
|
79
|
+
googleIntro: string;
|
|
80
|
+
connectGoogle: string;
|
|
81
|
+
googleJustConnected: string;
|
|
82
|
+
password: string;
|
|
83
|
+
passwordSubmit: string;
|
|
84
|
+
passwordDone: string;
|
|
85
|
+
setPassword: string;
|
|
86
|
+
setPasswordIntro: string;
|
|
87
|
+
setPasswordDone: string;
|
|
88
|
+
danger: string;
|
|
89
|
+
dangerIntro: string;
|
|
90
|
+
dangerConfirm: string;
|
|
91
|
+
dangerSubmit: string;
|
|
92
|
+
/** An account without a password: a fresh Google sign-in proves it's them (kit/auth/server's REAUTH_REQUIRED). */
|
|
93
|
+
dangerReauth: (minutes: number) => string;
|
|
94
|
+
reauthGoogle: string;
|
|
95
|
+
/** Signed in again moments ago: one more press deletes. */
|
|
96
|
+
dangerReady: (minutes: number) => string;
|
|
97
|
+
dangerAreYouSure: string;
|
|
98
|
+
};
|
|
99
|
+
/** Words for the error codes the actions answer (`{ ok: false, code }`); `fallback` for any other. */
|
|
100
|
+
errors: Readonly<Record<string, string>> & {
|
|
101
|
+
fallback: string;
|
|
102
|
+
};
|
|
103
|
+
/** A date from the server (ISO), as the page shows it ("Dec 5, 2026"). */
|
|
104
|
+
date: (iso: string) => string;
|
|
105
|
+
};
|
|
106
|
+
export declare const accountTextEn: AccountText;
|
|
107
|
+
/** The words for an action's error code: the app's own, or `fallback` for a code it doesn't word. */
|
|
108
|
+
export declare function errorText(text: AccountText, code: string | undefined): string;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { CSSProperties, ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* What an app may change: colours, fonts and radius. The layout, order and wording rules are the
|
|
4
|
+
* kit's, the same in every app. Any colour CSS reads works; give hex colours where the kit should
|
|
5
|
+
* pick a readable text colour for you (`brandInk`).
|
|
6
|
+
*/
|
|
7
|
+
export type AccountTheme = {
|
|
8
|
+
brand?: string;
|
|
9
|
+
/** Text on the brand colour: white or the ink, whichever reads better, when not given. */
|
|
10
|
+
brandInk?: string;
|
|
11
|
+
/** Brand-coloured text on cards (links, focus). */
|
|
12
|
+
brandText?: string;
|
|
13
|
+
page?: string;
|
|
14
|
+
surface?: string;
|
|
15
|
+
raised?: string;
|
|
16
|
+
line?: string;
|
|
17
|
+
fieldLine?: string;
|
|
18
|
+
ink?: string;
|
|
19
|
+
muted?: string;
|
|
20
|
+
good?: string;
|
|
21
|
+
warn?: string;
|
|
22
|
+
bad?: string;
|
|
23
|
+
info?: string;
|
|
24
|
+
badFill?: string;
|
|
25
|
+
badInk?: string;
|
|
26
|
+
focus?: string;
|
|
27
|
+
radiusCard?: string;
|
|
28
|
+
radiusControl?: string;
|
|
29
|
+
/** '12px' (rounded) or '999px' (pills). */
|
|
30
|
+
radiusButton?: string;
|
|
31
|
+
fontDisplay?: string;
|
|
32
|
+
fontBody?: string;
|
|
33
|
+
};
|
|
34
|
+
/** The theme as CSS variables, for an element's `style` (AccountRoot does this). */
|
|
35
|
+
export declare function accountTheme(theme?: AccountTheme): CSSProperties;
|
|
36
|
+
export type AccountScheme = 'light' | 'dark' | 'system';
|
|
37
|
+
export type AccountRootProps = {
|
|
38
|
+
theme?: AccountTheme;
|
|
39
|
+
/** 'system' (the default) follows the device; an app with one look (say, dark only) fixes it. */
|
|
40
|
+
scheme?: AccountScheme;
|
|
41
|
+
/** Paint the page colour behind the content (a page of its own; leave off inside the app's layout). */
|
|
42
|
+
fill?: boolean;
|
|
43
|
+
className?: string;
|
|
44
|
+
children: ReactNode;
|
|
45
|
+
};
|
|
46
|
+
/** The account screens' root: their tokens and scoped styles apply inside it only. */
|
|
47
|
+
export declare function AccountRoot({ theme, scheme, fill, className, children }: AccountRootProps): import("react").JSX.Element;
|