@eifi1/ui-kit 0.28.1 → 0.30.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/README.md +44 -4
- package/dist/account/account-parts.d.ts +21 -0
- package/dist/account/account-parts.js +40 -0
- package/dist/account/account-parts.js.map +1 -0
- package/dist/account/data-export-setting.d.ts +73 -0
- package/dist/account/data-export-setting.js +113 -0
- package/dist/account/data-export-setting.js.map +1 -0
- package/dist/account/delete-account-setting.d.ts +91 -0
- package/dist/account/delete-account-setting.js +199 -0
- package/dist/account/delete-account-setting.js.map +1 -0
- package/dist/account/email-change-setting.d.ts +136 -0
- package/dist/account/email-change-setting.js +277 -0
- package/dist/account/email-change-setting.js.map +1 -0
- package/dist/account/sessions-setting.d.ts +110 -0
- package/dist/account/sessions-setting.js +146 -0
- package/dist/account/sessions-setting.js.map +1 -0
- package/dist/admin/admin-action-confirm.d.ts +91 -0
- package/dist/admin/admin-action-confirm.js +276 -0
- package/dist/admin/admin-action-confirm.js.map +1 -0
- package/dist/admin/admin-action-log.d.ts +105 -0
- package/dist/admin/admin-action-log.js +153 -0
- package/dist/admin/admin-action-log.js.map +1 -0
- package/dist/admin/admin-parts.d.ts +40 -0
- package/dist/admin/admin-parts.js +45 -0
- package/dist/admin/admin-parts.js.map +1 -0
- package/dist/admin/invitations-panel.d.ts +91 -0
- package/dist/admin/invitations-panel.js +289 -0
- package/dist/admin/invitations-panel.js.map +1 -0
- package/dist/admin/reviewer-scope-editor.d.ts +91 -0
- package/dist/admin/reviewer-scope-editor.js +134 -0
- package/dist/admin/reviewer-scope-editor.js.map +1 -0
- package/dist/admin/role-select.d.ts +91 -0
- package/dist/admin/role-select.js +128 -0
- package/dist/admin/role-select.js.map +1 -0
- package/dist/admin/transfer-ownership-dialog.d.ts +91 -0
- package/dist/admin/transfer-ownership-dialog.js +83 -0
- package/dist/admin/transfer-ownership-dialog.js.map +1 -0
- package/dist/admin/user-roster.d.ts +91 -0
- package/dist/admin/user-roster.js +285 -0
- package/dist/admin/user-roster.js.map +1 -0
- package/dist/auth/accept-invitation.d.ts +90 -0
- package/dist/auth/accept-invitation.js +117 -0
- package/dist/auth/accept-invitation.js.map +1 -0
- package/dist/auth/auth-errors.d.ts +139 -0
- package/dist/auth/auth-errors.js +92 -0
- package/dist/auth/auth-errors.js.map +1 -0
- package/dist/auth/complete-name-dialog.d.ts +71 -0
- package/dist/auth/complete-name-dialog.js +168 -0
- package/dist/auth/complete-name-dialog.js.map +1 -0
- package/dist/auth/email-tag.d.ts +60 -0
- package/dist/auth/email-tag.js +23 -0
- package/dist/auth/email-tag.js.map +1 -0
- package/dist/auth/forgot-password-form.d.ts +86 -0
- package/dist/auth/forgot-password-form.js +123 -0
- package/dist/auth/forgot-password-form.js.map +1 -0
- package/dist/auth/form-rules.d.ts +27 -0
- package/dist/auth/form-rules.js +23 -0
- package/dist/auth/form-rules.js.map +1 -0
- package/dist/auth/new-password-fields.d.ts +38 -0
- package/dist/auth/new-password-fields.js +54 -0
- package/dist/auth/new-password-fields.js.map +1 -0
- package/dist/auth/not-found-page.d.ts +57 -0
- package/dist/auth/not-found-page.js +40 -0
- package/dist/auth/not-found-page.js.map +1 -0
- package/dist/auth/register-form.d.ts +91 -0
- package/dist/auth/register-form.js +270 -0
- package/dist/auth/register-form.js.map +1 -0
- package/dist/auth/reset-password-form.d.ts +131 -0
- package/dist/auth/reset-password-form.js +167 -0
- package/dist/auth/reset-password-form.js.map +1 -0
- package/dist/auth/sign-in-form.d.ts +295 -0
- package/dist/auth/sign-in-form.js +426 -0
- package/dist/auth/sign-in-form.js.map +1 -0
- package/dist/auth/status-parts.d.ts +78 -0
- package/dist/auth/status-parts.js +83 -0
- package/dist/auth/status-parts.js.map +1 -0
- package/dist/auth/verify-email.d.ts +126 -0
- package/dist/auth/verify-email.js +243 -0
- package/dist/auth/verify-email.js.map +1 -0
- package/dist/chart.d.ts +25 -5
- package/dist/components/account-chips.d.ts +47 -7
- package/dist/components/account-chips.js +19 -3
- package/dist/components/account-chips.js.map +1 -1
- package/dist/components/account-settings-labels.d.ts +12 -1
- package/dist/components/account-settings-labels.js +4 -1
- package/dist/components/account-settings-labels.js.map +1 -1
- package/dist/components/account-settings.d.ts +61 -6
- package/dist/components/account-settings.js +115 -15
- package/dist/components/account-settings.js.map +1 -1
- package/dist/components/amount-input.d.ts +26 -5
- package/dist/components/button-group.d.ts +26 -5
- package/dist/components/calculator.d.ts +26 -5
- package/dist/components/confirm-dialog.d.ts +26 -5
- package/dist/components/copy-button.d.ts +23 -2
- package/dist/components/danger-confirm.d.ts +26 -5
- package/dist/components/facing-pair.d.ts +26 -5
- package/dist/components/file-button.d.ts +26 -5
- package/dist/components/file-dropzone.d.ts +26 -5
- package/dist/components/form-actions.d.ts +26 -5
- package/dist/components/iban-input.d.ts +26 -5
- package/dist/components/language-select.d.ts +26 -12
- package/dist/components/legal-page.d.ts +26 -5
- package/dist/components/legal.d.ts +26 -5
- package/dist/components/money-field.d.ts +26 -5
- package/dist/components/number-field.d.ts +26 -5
- package/dist/components/number-input.d.ts +26 -5
- package/dist/components/numpad-sheet.d.ts +26 -5
- package/dist/components/phone-input.d.ts +26 -5
- package/dist/components/series-chart.d.ts +26 -5
- package/dist/components/settings-fields.d.ts +25 -7
- package/dist/components/share-card.d.ts +25 -4
- package/dist/components/text-link.d.ts +26 -5
- package/dist/components/time-input.d.ts +26 -5
- package/dist/components/ui.d.ts +23 -2
- package/dist/components/user-avatar.d.ts +16 -2
- package/dist/components/user-avatar.js +7 -3
- package/dist/components/user-avatar.js.map +1 -1
- package/dist/{kit-labels-Du0uHBq4.d.ts → delete-account-setting-CGVMckMw.d.ts} +6654 -5302
- package/dist/feedback/feedback-attachment.d.ts +26 -5
- package/dist/feedback/feedback-context.d.ts +26 -5
- package/dist/feedback/feedback-crash.d.ts +26 -5
- package/dist/feedback/feedback-dialog.d.ts +26 -5
- package/dist/feedback/feedback-inbox.d.ts +26 -5
- package/dist/feedback/feedback-labels.d.ts +26 -5
- package/dist/feedback/feedback-menu.d.ts +26 -5
- package/dist/feedback/feedback-record.d.ts +26 -5
- package/dist/feedback/feedback-row-detail.d.ts +26 -5
- package/dist/feedback/feedback-status-undo.d.ts +26 -5
- package/dist/feedback/feedback-submit.d.ts +26 -5
- package/dist/feedback/feedback-swipe.d.ts +26 -5
- package/dist/feedback/feedback-table.d.ts +23 -2
- package/dist/feedback/feedback-thread.d.ts +26 -5
- package/dist/feedback.d.ts +26 -5
- package/dist/hooks/use-anchored-panel.d.ts +6 -2
- package/dist/hooks/use-anchored-panel.js +2 -1
- package/dist/hooks/use-anchored-panel.js.map +1 -1
- package/dist/hooks/use-file-drop.d.ts +26 -5
- package/dist/i18n/defaults.d.ts +26 -5
- package/dist/i18n/defaults.js +40 -0
- package/dist/i18n/defaults.js.map +1 -1
- package/dist/i18n/german.d.ts +26 -5
- package/dist/i18n/german.js +343 -2
- package/dist/i18n/german.js.map +1 -1
- package/dist/i18n/kit-labels.d.ts +23 -2
- package/dist/i18n/kit-labels.js.map +1 -1
- package/dist/i18n/languages.d.ts +21 -204
- package/dist/i18n/locales/de-CH.d.ts +26 -5
- package/dist/i18n/locales/en.d.ts +26 -5
- package/dist/i18n/locales/es.d.ts +26 -5
- package/dist/i18n/locales/es.js +337 -3
- package/dist/i18n/locales/es.js.map +1 -1
- package/dist/i18n/locales/fr.d.ts +26 -5
- package/dist/i18n/locales/fr.js +344 -2
- package/dist/i18n/locales/fr.js.map +1 -1
- package/dist/i18n/locales/hu.d.ts +26 -5
- package/dist/i18n/locales/hu.js +337 -3
- package/dist/i18n/locales/hu.js.map +1 -1
- package/dist/i18n/locales/it.d.ts +26 -5
- package/dist/i18n/locales/it.js +342 -2
- package/dist/i18n/locales/it.js.map +1 -1
- package/dist/i18n/locales/zh.d.ts +26 -5
- package/dist/i18n/locales/zh.js +333 -2
- package/dist/i18n/locales/zh.js.map +1 -1
- package/dist/i18n/review.d.ts +26 -5
- package/dist/i18n/review.js +45 -1
- package/dist/i18n/review.js.map +1 -1
- package/dist/index.d.ts +19 -3
- package/dist/index.js +89 -0
- package/dist/index.js.map +1 -1
- package/dist/lib/person-name.d.ts +69 -0
- package/dist/lib/person-name.js +65 -0
- package/dist/lib/person-name.js.map +1 -0
- package/dist/rhf/fields.d.ts +26 -5
- package/dist/rhf/form.d.ts +26 -5
- package/dist/rhf.d.ts +26 -5
- package/dist/shell/app-shell.d.ts +26 -5
- package/dist/shell/company-switcher.d.ts +59 -0
- package/dist/shell/company-switcher.js +85 -0
- package/dist/shell/company-switcher.js.map +1 -0
- package/dist/shell/top-bar-brand.d.ts +26 -5
- package/dist/shell/topbar-action-menu.d.ts +1 -0
- package/dist/shell.d.ts +20 -5
- package/dist/wizard/stepper-nav.d.ts +26 -5
- package/dist/wizard.d.ts +26 -5
- package/package.json +1 -1
- package/src/account/account-parts.ts +67 -0
- package/src/account/data-export-setting.tsx +218 -0
- package/src/account/delete-account-setting.tsx +362 -0
- package/src/account/email-change-setting.tsx +457 -0
- package/src/account/sessions-setting.tsx +283 -0
- package/src/admin/admin-action-confirm.tsx +495 -0
- package/src/admin/admin-action-log.tsx +297 -0
- package/src/admin/admin-parts.ts +82 -0
- package/src/admin/invitations-panel.tsx +516 -0
- package/src/admin/reviewer-scope-editor.tsx +234 -0
- package/src/admin/role-select.tsx +286 -0
- package/src/admin/transfer-ownership-dialog.tsx +172 -0
- package/src/admin/user-roster.tsx +573 -0
- package/src/auth/accept-invitation.tsx +227 -0
- package/src/auth/auth-errors.ts +262 -0
- package/src/auth/complete-name-dialog.tsx +253 -0
- package/src/auth/email-tag.ts +75 -0
- package/src/auth/forgot-password-form.tsx +229 -0
- package/src/auth/form-rules.ts +40 -0
- package/src/auth/new-password-fields.tsx +85 -0
- package/src/auth/not-found-page.tsx +98 -0
- package/src/auth/register-form.tsx +477 -0
- package/src/auth/reset-password-form.tsx +351 -0
- package/src/auth/sign-in-form.tsx +859 -0
- package/src/auth/status-parts.tsx +138 -0
- package/src/auth/verify-email.tsx +409 -0
- package/src/components/account-chips.tsx +64 -7
- package/src/components/account-settings-labels.ts +15 -1
- package/src/components/account-settings.tsx +199 -23
- package/src/components/user-avatar.tsx +22 -4
- package/src/hooks/use-anchored-panel.ts +14 -3
- package/src/i18n/defaults.ts +40 -0
- package/src/i18n/german.ts +379 -0
- package/src/i18n/kit-labels.tsx +60 -0
- package/src/i18n/locales/es.ts +371 -1
- package/src/i18n/locales/fr.ts +379 -0
- package/src/i18n/locales/hu.ts +366 -1
- package/src/i18n/locales/it.ts +373 -0
- package/src/i18n/locales/zh.ts +343 -0
- package/src/i18n/review.ts +44 -0
- package/src/index.ts +146 -0
- package/src/lib/person-name.ts +157 -0
- package/src/shell/company-switcher.tsx +140 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/auth/email-tag.ts"],"sourcesContent":["/**\n * The address tag: `you@example.com` → `you+kastlan@example.com`, the app's own name as\n * a sub-address of the address a person types for themselves (docs/auth-harmonization.md\n * §4.5, Marcel 2026-10-05). Lifted from keksdose (`features/auth/email-tag.ts`, feedback\n * dev#481), where the tag was the constant `keksdose`; here it is the app's.\n *\n * **Structurally valid is not the same as deliverable.** `+` is an ordinary character in\n * the local part under RFC 5322, and sub-addressing — `user+tag@host` delivered to\n * `user@host` — is specified (RFC 5233). But it is specified as a convention the\n * RECEIVING server may implement: Gmail, Outlook, iCloud, Fastmail and Proton do; many\n * Exchange installs, small hosters and corporate filters do not, and some web forms\n * refuse the character outright.\n *\n * Which is why every caller OFFERS the result and never applies it. Silently registering\n * somebody as `you+kastlan@example.com` would send the verification mail — the one\n * message the account depends on — down a delivery path nobody checked, and make the\n * address they sign in with one they never typed. The tag is a convenience for the\n * person who wants it: one click, with the exact resulting address on the button\n * (`RegisterForm` does this with its `emailTag`).\n *\n * The tagged address is then the identity. The server trims and lower-cases an address\n * at every entry and never strips a tag, so `you@…` and `you+kastlan@…` are two\n * different accounts; sign-in stays exact (§4.5), which is why `SignInForm`'s hint after\n * a failed sign-in names the tagged address rather than trying it.\n *\n * Offer it only where a person types an address FOR THEMSELVES — sign-up, a later email\n * change in the profile — never in a field for someone else's (an invite dialog, a\n * share), where the tag would be a guess about another person's mail server.\n */\n\n/** What a tag may be: the app's name, lower case — letters, digits, `.`, `_`, `-`. A\n * space, `@` or `+` would make the result something other than a sub-address. */\nconst TAG_SHAPE = /^[a-z0-9][a-z0-9._-]*$/;\n\n/**\n * `taggedEmail(\"you@example.com\", \"kastlan\")` → `\"you+kastlan@example.com\"`, or `null`\n * when there is nothing to offer:\n *\n * - the address is not complete enough to split — no local part, no domain, or a\n * domain without an inner dot (the shape the field's own `type=\"email\"` accepts), so\n * the offer cannot appear before the address is plausible or linger once it stops\n * being one;\n * - the address already carries a `+` — the person's own scheme wins, and stacking a\n * second tag on it would be wrong;\n * - the tag is empty or not a plain name (see `TAG_SHAPE`).\n *\n * The tag is the app's name in lower case (`keksdose`, `kastlan`, `kurvenschmiede`); it\n * is trimmed and lower-cased here, so `\"Kastlan\"` gives the same answer. The address is\n * trimmed and otherwise kept as typed — normalising it is the server's job (server-kit's\n * `normalise_email`).\n */\nexport function taggedEmail(email: string, tag: string): string | null {\n const name = tag.trim().toLowerCase();\n if (!TAG_SHAPE.test(name)) return null;\n const parts = emailParts(email);\n if (!parts || parts.local.includes(\"+\")) return null;\n return `${parts.local}+${name}@${parts.domain}`;\n}\n\n/**\n * The trimmed address split at its last `@`, or `null` while it is not complete enough\n * to split: no local part, no domain, or a domain without an inner dot — the shape the\n * field's own `type=\"email\"` accepts.\n *\n * @internal `RegisterForm` gates its submit on it; not part of the barrel.\n */\nexport function emailParts(email: string): { local: string; domain: string } | null {\n const trimmed = email.trim();\n const at = trimmed.lastIndexOf(\"@\");\n if (at <= 0 || at === trimmed.length - 1) return null;\n const local = trimmed.slice(0, at);\n const domain = trimmed.slice(at + 1);\n if (!domain.includes(\".\") || domain.startsWith(\".\") || domain.endsWith(\".\")) return null;\n return { local, domain };\n}\n"],"mappings":";AAgCA,MAAM,YAAY;AAmBX,SAAS,YAAY,OAAe,KAA4B;AACrE,QAAM,OAAO,IAAI,KAAK,EAAE,YAAY;AACpC,MAAI,CAAC,UAAU,KAAK,IAAI,EAAG,QAAO;AAClC,QAAM,QAAQ,WAAW,KAAK;AAC9B,MAAI,CAAC,SAAS,MAAM,MAAM,SAAS,GAAG,EAAG,QAAO;AAChD,SAAO,GAAG,MAAM,KAAK,IAAI,IAAI,IAAI,MAAM,MAAM;AAC/C;AASO,SAAS,WAAW,OAAyD;AAClF,QAAM,UAAU,MAAM,KAAK;AAC3B,QAAM,KAAK,QAAQ,YAAY,GAAG;AAClC,MAAI,MAAM,KAAK,OAAO,QAAQ,SAAS,EAAG,QAAO;AACjD,QAAM,QAAQ,QAAQ,MAAM,GAAG,EAAE;AACjC,QAAM,SAAS,QAAQ,MAAM,KAAK,CAAC;AACnC,MAAI,CAAC,OAAO,SAAS,GAAG,KAAK,OAAO,WAAW,GAAG,KAAK,OAAO,SAAS,GAAG,EAAG,QAAO;AACpF,SAAO,EAAE,OAAO,OAAO;AACzB;","names":[]}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { ComponentPropsWithoutRef, ReactNode } from 'react';
|
|
3
|
+
import { AuthHeadingLevel } from './status-parts.js';
|
|
4
|
+
|
|
5
|
+
/** Every string the form renders — the `forgotPassword` namespace. keksdose's words
|
|
6
|
+
* (`auth.forgot.*`), which kastlan took over unchanged. */
|
|
7
|
+
interface ForgotPasswordLabels {
|
|
8
|
+
/** The heading. */
|
|
9
|
+
title: string;
|
|
10
|
+
/** Under the heading, before the field. */
|
|
11
|
+
intro: string;
|
|
12
|
+
/** The email field's label. */
|
|
13
|
+
email: string;
|
|
14
|
+
submit: string;
|
|
15
|
+
/** The one answer, whatever the server knows — given the address as typed. */
|
|
16
|
+
sent: (email: string) => string;
|
|
17
|
+
/** Under it: how long the link lives, and where else to look. */
|
|
18
|
+
sentHint: string;
|
|
19
|
+
/** The link back to the sign-in page, on both states. */
|
|
20
|
+
backToSignIn: string;
|
|
21
|
+
/** A request that did not go through: a throttle, an outage. Never "unknown
|
|
22
|
+
* address" — the endpoint does not say. */
|
|
23
|
+
error: string;
|
|
24
|
+
/** 0.30.0: the request was throttled — HTTP 429 ({@link isRateLimited}) — given the
|
|
25
|
+
* `Retry-After` wait in seconds, or `undefined` without one. OPTIONAL, like every key
|
|
26
|
+
* added to a shipped interface; the provider's `forgotPassword`, then English, fill
|
|
27
|
+
* it. */
|
|
28
|
+
rateLimited?: (seconds?: number) => string;
|
|
29
|
+
}
|
|
30
|
+
/** `Required`: every key, the 0.30 one included, has its English here. */
|
|
31
|
+
declare const DEFAULT_FORGOT_PASSWORD_LABELS: Required<ForgotPasswordLabels>;
|
|
32
|
+
interface ForgotPasswordFormProps extends Omit<ComponentPropsWithoutRef<"div">, "onSubmit" | "children" | "title"> {
|
|
33
|
+
/**
|
|
34
|
+
* The address was submitted, trimmed: send `POST /auth/password-reset/request`.
|
|
35
|
+
* Resolve when the server answered — whatever it answered: it is `204` whether or not
|
|
36
|
+
* an account exists. Reject only when the request did not go through (a throttle, an
|
|
37
|
+
* outage); the form then stays, with the address, and says so. The form never sends a
|
|
38
|
+
* request itself (§8).
|
|
39
|
+
*/
|
|
40
|
+
onSubmit: (email: string) => Promise<unknown> | void;
|
|
41
|
+
/** "Back to sign in" — the app's `/login`. Default `/login`. */
|
|
42
|
+
signInHref?: string;
|
|
43
|
+
/** The field's start value — the address the sign-in form already had, so someone
|
|
44
|
+
* whose password just failed need not type it twice. */
|
|
45
|
+
defaultEmail?: string;
|
|
46
|
+
/**
|
|
47
|
+
* The app's words for a failed request ("Too many requests — try again in an hour"),
|
|
48
|
+
* or `undefined` for the kit's: `rateLimited` for a bare `429` (0.30.0), else `error`.
|
|
49
|
+
* The same hook as `SignInForm`'s.
|
|
50
|
+
*/
|
|
51
|
+
describeError?: (error: unknown) => ReactNode | undefined;
|
|
52
|
+
/** App content under the intro — a notice, a support address. */
|
|
53
|
+
formContent?: ReactNode;
|
|
54
|
+
/** The heading. Default `labels.title`; `null` draws none, for a page that puts it
|
|
55
|
+
* in `AuthLayout`'s `title` instead. */
|
|
56
|
+
title?: ReactNode;
|
|
57
|
+
/** The heading's level. Default `h2`, under the page's `h1`. */
|
|
58
|
+
headingAs?: AuthHeadingLevel;
|
|
59
|
+
labels?: Partial<ForgotPasswordLabels>;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* "I forgot my password" for every app (docs/auth-harmonization.md §7): one field, then
|
|
63
|
+
* the same sentence whatever the answer — keksdose's `ForgotPasswordPage`
|
|
64
|
+
* (features/auth/forgot-password-page.tsx), kastlan's copy of it, as one component.
|
|
65
|
+
*
|
|
66
|
+
* **It always ends on the same message**: "If an account exists for …, the link is on
|
|
67
|
+
* its way." The server answers `204` whether or not the address has an account — so the
|
|
68
|
+
* page cannot be used to find out who has one — and the page must not undo that by
|
|
69
|
+
* saying more than the server knows. Worded as a promise ("we sent you a link"), a typo
|
|
70
|
+
* would look like a mail-delivery problem and send the person waiting instead of trying
|
|
71
|
+
* their other address (keksdose #198). The address shown is the one they typed, so a
|
|
72
|
+
* typo is visible.
|
|
73
|
+
*
|
|
74
|
+
* The only failure it can show is a request that did not go through (throttled, the
|
|
75
|
+
* server down), never "unknown address". §4.5's fallback to a tagged address
|
|
76
|
+
* (`you+kastlan@…` when `you@…` has no account) is the server's and changes nothing here.
|
|
77
|
+
*
|
|
78
|
+
* The submit is not disabled while the field is empty — a browser that autofills
|
|
79
|
+
* withholds the value until the first interaction, and a disabled button would swallow
|
|
80
|
+
* that first click; the field's own `required` answers an empty submit instead. After a
|
|
81
|
+
* submit the confirmation takes focus, because the button that had it is gone with the
|
|
82
|
+
* form.
|
|
83
|
+
*/
|
|
84
|
+
declare function ForgotPasswordForm({ onSubmit, signInHref, defaultEmail, describeError, formContent, title, headingAs: Heading, labels: labelsProp, className, ...rest }: ForgotPasswordFormProps): react.JSX.Element;
|
|
85
|
+
|
|
86
|
+
export { DEFAULT_FORGOT_PASSWORD_LABELS, ForgotPasswordForm, type ForgotPasswordFormProps, type ForgotPasswordLabels };
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useId, useRef, useState } from "react";
|
|
4
|
+
import { MailCheck } from "lucide-react";
|
|
5
|
+
import { cn } from "../lib/cn.js";
|
|
6
|
+
import { useKitLabels } from "../i18n/kit-labels.js";
|
|
7
|
+
import { AlertBanner } from "../components/alert-banner.js";
|
|
8
|
+
import { TextLink } from "../components/text-link.js";
|
|
9
|
+
import { Button, Input } from "../components/ui.js";
|
|
10
|
+
import { englishRateLimited, isRateLimited, retryAfterSeconds } from "./auth-errors.js";
|
|
11
|
+
import { FORM_HEADING_CLASS, INTRO_CLASS, OutcomeMessage, isThenable, useFocusWhen } from "./status-parts.js";
|
|
12
|
+
const DEFAULT_FORGOT_PASSWORD_LABELS = {
|
|
13
|
+
title: "Forgot password",
|
|
14
|
+
intro: "Enter your account\u2019s email address. We\u2019ll send you a link to choose a new password.",
|
|
15
|
+
email: "Email",
|
|
16
|
+
submit: "Send the link",
|
|
17
|
+
sent: (email) => `If an account exists for ${email}, the link is on its way.`,
|
|
18
|
+
sentHint: "The link is valid for one hour and works exactly once. Check your spam folder too.",
|
|
19
|
+
backToSignIn: "Back to sign in",
|
|
20
|
+
error: "The request failed. Please try again later.",
|
|
21
|
+
rateLimited: englishRateLimited
|
|
22
|
+
};
|
|
23
|
+
function ForgotPasswordForm({
|
|
24
|
+
onSubmit,
|
|
25
|
+
signInHref = "/login",
|
|
26
|
+
defaultEmail = "",
|
|
27
|
+
describeError,
|
|
28
|
+
formContent,
|
|
29
|
+
title,
|
|
30
|
+
headingAs: Heading = "h2",
|
|
31
|
+
labels: labelsProp,
|
|
32
|
+
className,
|
|
33
|
+
...rest
|
|
34
|
+
}) {
|
|
35
|
+
const labels = useKitLabels("forgotPassword", DEFAULT_FORGOT_PASSWORD_LABELS, labelsProp);
|
|
36
|
+
const [email, setEmail] = useState(defaultEmail);
|
|
37
|
+
const [pending, setPending] = useState(false);
|
|
38
|
+
const [failure, setFailure] = useState(null);
|
|
39
|
+
const [sentTo, setSentTo] = useState(null);
|
|
40
|
+
const headingId = useId();
|
|
41
|
+
const sentRef = useRef(null);
|
|
42
|
+
useFocusWhen(sentTo !== null, sentRef);
|
|
43
|
+
const heading = title === null ? null : /* @__PURE__ */ jsx(Heading, { id: headingId, className: FORM_HEADING_CLASS, children: title ?? labels.title });
|
|
44
|
+
const back = /* @__PURE__ */ jsx("p", { className: "text-center text-sm", children: /* @__PURE__ */ jsx(TextLink, { href: signInHref, tone: "primary", children: labels.backToSignIn }) });
|
|
45
|
+
if (sentTo !== null) {
|
|
46
|
+
return /* @__PURE__ */ jsxs("div", { ...rest, "data-state": "sent", className: cn("space-y-3", className), children: [
|
|
47
|
+
heading,
|
|
48
|
+
/* @__PURE__ */ jsxs(OutcomeMessage, { icon: /* @__PURE__ */ jsx(MailCheck, { className: "text-[var(--success)]" }), focusRef: sentRef, children: [
|
|
49
|
+
/* @__PURE__ */ jsx("p", { className: INTRO_CLASS, children: labels.sent(sentTo) }),
|
|
50
|
+
/* @__PURE__ */ jsx("p", { className: "text-xs text-[var(--text-muted)]", children: labels.sentHint })
|
|
51
|
+
] }),
|
|
52
|
+
back
|
|
53
|
+
] });
|
|
54
|
+
}
|
|
55
|
+
const failureFor = (error) => describeError?.(error) ?? (isRateLimited(error) ? (labels.rateLimited ?? DEFAULT_FORGOT_PASSWORD_LABELS.rateLimited)(retryAfterSeconds(error)) : labels.error);
|
|
56
|
+
const submit = (e) => {
|
|
57
|
+
e.preventDefault();
|
|
58
|
+
const address = email.trim();
|
|
59
|
+
if (pending || address === "") return;
|
|
60
|
+
setFailure(null);
|
|
61
|
+
let result;
|
|
62
|
+
try {
|
|
63
|
+
result = onSubmit(address);
|
|
64
|
+
} catch (error) {
|
|
65
|
+
setFailure(failureFor(error));
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
if (!isThenable(result)) {
|
|
69
|
+
setSentTo(address);
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
setPending(true);
|
|
73
|
+
result.then(
|
|
74
|
+
() => {
|
|
75
|
+
setPending(false);
|
|
76
|
+
setSentTo(address);
|
|
77
|
+
},
|
|
78
|
+
(error) => {
|
|
79
|
+
setPending(false);
|
|
80
|
+
setFailure(failureFor(error));
|
|
81
|
+
}
|
|
82
|
+
);
|
|
83
|
+
};
|
|
84
|
+
return /* @__PURE__ */ jsxs("div", { ...rest, "data-state": "form", className: cn("space-y-3", className), children: [
|
|
85
|
+
/* @__PURE__ */ jsxs(
|
|
86
|
+
"form",
|
|
87
|
+
{
|
|
88
|
+
className: "space-y-3",
|
|
89
|
+
"aria-labelledby": title === null ? void 0 : headingId,
|
|
90
|
+
onSubmit: submit,
|
|
91
|
+
children: [
|
|
92
|
+
heading,
|
|
93
|
+
/* @__PURE__ */ jsx("p", { className: INTRO_CLASS, children: labels.intro }),
|
|
94
|
+
formContent,
|
|
95
|
+
/* @__PURE__ */ jsx(
|
|
96
|
+
Input,
|
|
97
|
+
{
|
|
98
|
+
type: "email",
|
|
99
|
+
name: "email",
|
|
100
|
+
autoComplete: "email",
|
|
101
|
+
label: labels.email,
|
|
102
|
+
value: email,
|
|
103
|
+
onChange: (e) => {
|
|
104
|
+
setEmail(e.target.value);
|
|
105
|
+
if (failure) setFailure(null);
|
|
106
|
+
},
|
|
107
|
+
readOnly: pending,
|
|
108
|
+
required: true
|
|
109
|
+
}
|
|
110
|
+
),
|
|
111
|
+
failure != null && /* @__PURE__ */ jsx(AlertBanner, { tone: "danger", size: "sm", role: "alert", children: failure }),
|
|
112
|
+
/* @__PURE__ */ jsx(Button, { type: "submit", className: "w-full", pending, children: labels.submit })
|
|
113
|
+
]
|
|
114
|
+
}
|
|
115
|
+
),
|
|
116
|
+
back
|
|
117
|
+
] });
|
|
118
|
+
}
|
|
119
|
+
export {
|
|
120
|
+
DEFAULT_FORGOT_PASSWORD_LABELS,
|
|
121
|
+
ForgotPasswordForm
|
|
122
|
+
};
|
|
123
|
+
//# sourceMappingURL=forgot-password-form.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/auth/forgot-password-form.tsx"],"sourcesContent":["import { useId, useRef, useState } from \"react\";\nimport type { ComponentPropsWithoutRef, FormEvent, ReactNode } from \"react\";\nimport { MailCheck } from \"lucide-react\";\nimport { cn } from \"../lib/cn\";\nimport { useKitLabels } from \"../i18n/kit-labels\";\nimport { AlertBanner } from \"../components/alert-banner\";\nimport { TextLink } from \"../components/text-link\";\nimport { Button, Input } from \"../components/ui\";\nimport { englishRateLimited, isRateLimited, retryAfterSeconds } from \"./auth-errors\";\nimport { FORM_HEADING_CLASS, INTRO_CLASS, OutcomeMessage, isThenable, useFocusWhen } from \"./status-parts\";\nimport type { AuthHeadingLevel } from \"./status-parts\";\n\n/* ── Labels ──────────────────────────────────────────────────────────────── */\n\n/** Every string the form renders — the `forgotPassword` namespace. keksdose's words\n * (`auth.forgot.*`), which kastlan took over unchanged. */\nexport interface ForgotPasswordLabels {\n /** The heading. */\n title: string;\n /** Under the heading, before the field. */\n intro: string;\n /** The email field's label. */\n email: string;\n submit: string;\n /** The one answer, whatever the server knows — given the address as typed. */\n sent: (email: string) => string;\n /** Under it: how long the link lives, and where else to look. */\n sentHint: string;\n /** The link back to the sign-in page, on both states. */\n backToSignIn: string;\n /** A request that did not go through: a throttle, an outage. Never \"unknown\n * address\" — the endpoint does not say. */\n error: string;\n /** 0.30.0: the request was throttled — HTTP 429 ({@link isRateLimited}) — given the\n * `Retry-After` wait in seconds, or `undefined` without one. OPTIONAL, like every key\n * added to a shipped interface; the provider's `forgotPassword`, then English, fill\n * it. */\n rateLimited?: (seconds?: number) => string;\n}\n\n/** `Required`: every key, the 0.30 one included, has its English here. */\nexport const DEFAULT_FORGOT_PASSWORD_LABELS: Required<ForgotPasswordLabels> = {\n title: \"Forgot password\",\n intro: \"Enter your account’s email address. We’ll send you a link to choose a new password.\",\n email: \"Email\",\n submit: \"Send the link\",\n sent: (email) => `If an account exists for ${email}, the link is on its way.`,\n sentHint: \"The link is valid for one hour and works exactly once. Check your spam folder too.\",\n backToSignIn: \"Back to sign in\",\n error: \"The request failed. Please try again later.\",\n rateLimited: englishRateLimited,\n};\n\n/* ── The form ────────────────────────────────────────────────────────────── */\n\nexport interface ForgotPasswordFormProps\n extends Omit<ComponentPropsWithoutRef<\"div\">, \"onSubmit\" | \"children\" | \"title\"> {\n /**\n * The address was submitted, trimmed: send `POST /auth/password-reset/request`.\n * Resolve when the server answered — whatever it answered: it is `204` whether or not\n * an account exists. Reject only when the request did not go through (a throttle, an\n * outage); the form then stays, with the address, and says so. The form never sends a\n * request itself (§8).\n */\n onSubmit: (email: string) => Promise<unknown> | void;\n /** \"Back to sign in\" — the app's `/login`. Default `/login`. */\n signInHref?: string;\n /** The field's start value — the address the sign-in form already had, so someone\n * whose password just failed need not type it twice. */\n defaultEmail?: string;\n /**\n * The app's words for a failed request (\"Too many requests — try again in an hour\"),\n * or `undefined` for the kit's: `rateLimited` for a bare `429` (0.30.0), else `error`.\n * The same hook as `SignInForm`'s.\n */\n describeError?: (error: unknown) => ReactNode | undefined;\n /** App content under the intro — a notice, a support address. */\n formContent?: ReactNode;\n /** The heading. Default `labels.title`; `null` draws none, for a page that puts it\n * in `AuthLayout`'s `title` instead. */\n title?: ReactNode;\n /** The heading's level. Default `h2`, under the page's `h1`. */\n headingAs?: AuthHeadingLevel;\n labels?: Partial<ForgotPasswordLabels>;\n}\n\n/**\n * \"I forgot my password\" for every app (docs/auth-harmonization.md §7): one field, then\n * the same sentence whatever the answer — keksdose's `ForgotPasswordPage`\n * (features/auth/forgot-password-page.tsx), kastlan's copy of it, as one component.\n *\n * **It always ends on the same message**: \"If an account exists for …, the link is on\n * its way.\" The server answers `204` whether or not the address has an account — so the\n * page cannot be used to find out who has one — and the page must not undo that by\n * saying more than the server knows. Worded as a promise (\"we sent you a link\"), a typo\n * would look like a mail-delivery problem and send the person waiting instead of trying\n * their other address (keksdose #198). The address shown is the one they typed, so a\n * typo is visible.\n *\n * The only failure it can show is a request that did not go through (throttled, the\n * server down), never \"unknown address\". §4.5's fallback to a tagged address\n * (`you+kastlan@…` when `you@…` has no account) is the server's and changes nothing here.\n *\n * The submit is not disabled while the field is empty — a browser that autofills\n * withholds the value until the first interaction, and a disabled button would swallow\n * that first click; the field's own `required` answers an empty submit instead. After a\n * submit the confirmation takes focus, because the button that had it is gone with the\n * form.\n */\nexport function ForgotPasswordForm({\n onSubmit,\n signInHref = \"/login\",\n defaultEmail = \"\",\n describeError,\n formContent,\n title,\n headingAs: Heading = \"h2\",\n labels: labelsProp,\n className,\n ...rest\n}: ForgotPasswordFormProps) {\n const labels = useKitLabels(\"forgotPassword\", DEFAULT_FORGOT_PASSWORD_LABELS, labelsProp);\n const [email, setEmail] = useState(defaultEmail);\n const [pending, setPending] = useState(false);\n const [failure, setFailure] = useState<ReactNode>(null);\n const [sentTo, setSentTo] = useState<string | null>(null);\n const headingId = useId();\n const sentRef = useRef<HTMLDivElement>(null);\n useFocusWhen(sentTo !== null, sentRef);\n\n const heading =\n title === null ? null : (\n <Heading id={headingId} className={FORM_HEADING_CLASS}>\n {title ?? labels.title}\n </Heading>\n );\n const back = (\n <p className=\"text-center text-sm\">\n <TextLink href={signInHref} tone=\"primary\">\n {labels.backToSignIn}\n </TextLink>\n </p>\n );\n\n if (sentTo !== null) {\n return (\n <div {...rest} data-state=\"sent\" className={cn(\"space-y-3\", className)}>\n {heading}\n <OutcomeMessage icon={<MailCheck className=\"text-[var(--success)]\" />} focusRef={sentRef}>\n <p className={INTRO_CLASS}>{labels.sent(sentTo)}</p>\n <p className=\"text-xs text-[var(--text-muted)]\">{labels.sentHint}</p>\n </OutcomeMessage>\n {back}\n </div>\n );\n }\n\n // The app's words first, then the throttle's, then the kit's catch-all.\n const failureFor = (error: unknown): ReactNode =>\n describeError?.(error) ??\n (isRateLimited(error)\n ? (labels.rateLimited ?? DEFAULT_FORGOT_PASSWORD_LABELS.rateLimited)(retryAfterSeconds(error))\n : labels.error);\n\n const submit = (e: FormEvent) => {\n e.preventDefault();\n const address = email.trim();\n if (pending || address === \"\") return;\n setFailure(null);\n let result: unknown;\n try {\n result = onSubmit(address);\n } catch (error) {\n setFailure(failureFor(error));\n return;\n }\n if (!isThenable(result)) {\n setSentTo(address);\n return;\n }\n setPending(true);\n result.then(\n () => {\n setPending(false);\n setSentTo(address);\n },\n (error: unknown) => {\n setPending(false);\n setFailure(failureFor(error));\n },\n );\n };\n\n return (\n <div {...rest} data-state=\"form\" className={cn(\"space-y-3\", className)}>\n <form\n className=\"space-y-3\"\n aria-labelledby={title === null ? undefined : headingId}\n onSubmit={submit}\n >\n {heading}\n <p className={INTRO_CLASS}>{labels.intro}</p>\n {formContent}\n <Input\n type=\"email\"\n name=\"email\"\n autoComplete=\"email\"\n label={labels.email}\n value={email}\n onChange={(e) => {\n setEmail(e.target.value);\n if (failure) setFailure(null);\n }}\n readOnly={pending}\n required\n />\n {failure != null && (\n <AlertBanner tone=\"danger\" size=\"sm\" role=\"alert\">\n {failure}\n </AlertBanner>\n )}\n <Button type=\"submit\" className=\"w-full\" pending={pending}>\n {labels.submit}\n </Button>\n </form>\n {back}\n </div>\n );\n}\n"],"mappings":";AAoIM,cAgBE,YAhBF;AApIN,SAAS,OAAO,QAAQ,gBAAgB;AAExC,SAAS,iBAAiB;AAC1B,SAAS,UAAU;AACnB,SAAS,oBAAoB;AAC7B,SAAS,mBAAmB;AAC5B,SAAS,gBAAgB;AACzB,SAAS,QAAQ,aAAa;AAC9B,SAAS,oBAAoB,eAAe,yBAAyB;AACrE,SAAS,oBAAoB,aAAa,gBAAgB,YAAY,oBAAoB;AAgCnF,MAAM,iCAAiE;AAAA,EAC5E,OAAO;AAAA,EACP,OAAO;AAAA,EACP,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,MAAM,CAAC,UAAU,4BAA4B,KAAK;AAAA,EAClD,UAAU;AAAA,EACV,cAAc;AAAA,EACd,OAAO;AAAA,EACP,aAAa;AACf;AA0DO,SAAS,mBAAmB;AAAA,EACjC;AAAA,EACA,aAAa;AAAA,EACb,eAAe;AAAA,EACf;AAAA,EACA;AAAA,EACA;AAAA,EACA,WAAW,UAAU;AAAA,EACrB,QAAQ;AAAA,EACR;AAAA,EACA,GAAG;AACL,GAA4B;AAC1B,QAAM,SAAS,aAAa,kBAAkB,gCAAgC,UAAU;AACxF,QAAM,CAAC,OAAO,QAAQ,IAAI,SAAS,YAAY;AAC/C,QAAM,CAAC,SAAS,UAAU,IAAI,SAAS,KAAK;AAC5C,QAAM,CAAC,SAAS,UAAU,IAAI,SAAoB,IAAI;AACtD,QAAM,CAAC,QAAQ,SAAS,IAAI,SAAwB,IAAI;AACxD,QAAM,YAAY,MAAM;AACxB,QAAM,UAAU,OAAuB,IAAI;AAC3C,eAAa,WAAW,MAAM,OAAO;AAErC,QAAM,UACJ,UAAU,OAAO,OACf,oBAAC,WAAQ,IAAI,WAAW,WAAW,oBAChC,mBAAS,OAAO,OACnB;AAEJ,QAAM,OACJ,oBAAC,OAAE,WAAU,uBACX,8BAAC,YAAS,MAAM,YAAY,MAAK,WAC9B,iBAAO,cACV,GACF;AAGF,MAAI,WAAW,MAAM;AACnB,WACE,qBAAC,SAAK,GAAG,MAAM,cAAW,QAAO,WAAW,GAAG,aAAa,SAAS,GAClE;AAAA;AAAA,MACD,qBAAC,kBAAe,MAAM,oBAAC,aAAU,WAAU,yBAAwB,GAAI,UAAU,SAC/E;AAAA,4BAAC,OAAE,WAAW,aAAc,iBAAO,KAAK,MAAM,GAAE;AAAA,QAChD,oBAAC,OAAE,WAAU,oCAAoC,iBAAO,UAAS;AAAA,SACnE;AAAA,MACC;AAAA,OACH;AAAA,EAEJ;AAGA,QAAM,aAAa,CAAC,UAClB,gBAAgB,KAAK,MACpB,cAAc,KAAK,KACf,OAAO,eAAe,+BAA+B,aAAa,kBAAkB,KAAK,CAAC,IAC3F,OAAO;AAEb,QAAM,SAAS,CAAC,MAAiB;AAC/B,MAAE,eAAe;AACjB,UAAM,UAAU,MAAM,KAAK;AAC3B,QAAI,WAAW,YAAY,GAAI;AAC/B,eAAW,IAAI;AACf,QAAI;AACJ,QAAI;AACF,eAAS,SAAS,OAAO;AAAA,IAC3B,SAAS,OAAO;AACd,iBAAW,WAAW,KAAK,CAAC;AAC5B;AAAA,IACF;AACA,QAAI,CAAC,WAAW,MAAM,GAAG;AACvB,gBAAU,OAAO;AACjB;AAAA,IACF;AACA,eAAW,IAAI;AACf,WAAO;AAAA,MACL,MAAM;AACJ,mBAAW,KAAK;AAChB,kBAAU,OAAO;AAAA,MACnB;AAAA,MACA,CAAC,UAAmB;AAClB,mBAAW,KAAK;AAChB,mBAAW,WAAW,KAAK,CAAC;AAAA,MAC9B;AAAA,IACF;AAAA,EACF;AAEA,SACE,qBAAC,SAAK,GAAG,MAAM,cAAW,QAAO,WAAW,GAAG,aAAa,SAAS,GACnE;AAAA;AAAA,MAAC;AAAA;AAAA,QACC,WAAU;AAAA,QACV,mBAAiB,UAAU,OAAO,SAAY;AAAA,QAC9C,UAAU;AAAA,QAET;AAAA;AAAA,UACD,oBAAC,OAAE,WAAW,aAAc,iBAAO,OAAM;AAAA,UACxC;AAAA,UACD;AAAA,YAAC;AAAA;AAAA,cACC,MAAK;AAAA,cACL,MAAK;AAAA,cACL,cAAa;AAAA,cACb,OAAO,OAAO;AAAA,cACd,OAAO;AAAA,cACP,UAAU,CAAC,MAAM;AACf,yBAAS,EAAE,OAAO,KAAK;AACvB,oBAAI,QAAS,YAAW,IAAI;AAAA,cAC9B;AAAA,cACA,UAAU;AAAA,cACV,UAAQ;AAAA;AAAA,UACV;AAAA,UACC,WAAW,QACV,oBAAC,eAAY,MAAK,UAAS,MAAK,MAAK,MAAK,SACvC,mBACH;AAAA,UAEF,oBAAC,UAAO,MAAK,UAAS,WAAU,UAAS,SACtC,iBAAO,QACV;AAAA;AAAA;AAAA,IACF;AAAA,IACC;AAAA,KACH;AAEJ;","names":[]}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The few hard rules of the sign-up and sign-in forms, in one place — and the only ones
|
|
3
|
+
* (docs/auth-harmonization.md §3.1, §8). The servers check the same; the kit adds no
|
|
4
|
+
* rule of its own, and everything the strength meter shows beyond these is advice.
|
|
5
|
+
*
|
|
6
|
+
* @internal Shared by RegisterForm, SignInForm and CompleteNameDialog; the coordinator
|
|
7
|
+
* decides whether the constants join the barrel.
|
|
8
|
+
*/
|
|
9
|
+
/** At least 8 characters. */
|
|
10
|
+
declare const PASSWORD_MIN_LENGTH = 8;
|
|
11
|
+
/** At most 72 BYTES — bcrypt reads no further, so a longer password would be silently
|
|
12
|
+
* cut. "ü" is two bytes, an emoji four. */
|
|
13
|
+
declare const PASSWORD_MAX_BYTES = 72;
|
|
14
|
+
/** A first or last name: 1–120 characters after trimming — the old `display_name`
|
|
15
|
+
* limit, so a migrated name fits (§3.1). */
|
|
16
|
+
declare const PERSON_NAME_MAX_LENGTH = 120;
|
|
17
|
+
/** 1–120 characters after trimming. */
|
|
18
|
+
declare function personNameOk(value: string): boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Why a new password and its confirmation may not be submitted yet, or `null` when they
|
|
21
|
+
* may — keksdose's `passwordPairError` (features/auth/password-fields.tsx). Characters
|
|
22
|
+
* are counted as code points, as the strength meter counts them: an emoji is one
|
|
23
|
+
* character to the person typing it.
|
|
24
|
+
*/
|
|
25
|
+
declare function newPasswordProblem(password: string, confirm: string): "length" | "bytes" | "mismatch" | null;
|
|
26
|
+
|
|
27
|
+
export { PASSWORD_MAX_BYTES, PASSWORD_MIN_LENGTH, PERSON_NAME_MAX_LENGTH, newPasswordProblem, personNameOk };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { passwordByteLength } from "../components/password-strength.js";
|
|
3
|
+
const PASSWORD_MIN_LENGTH = 8;
|
|
4
|
+
const PASSWORD_MAX_BYTES = 72;
|
|
5
|
+
const PERSON_NAME_MAX_LENGTH = 120;
|
|
6
|
+
function personNameOk(value) {
|
|
7
|
+
const length = value.trim().length;
|
|
8
|
+
return length >= 1 && length <= PERSON_NAME_MAX_LENGTH;
|
|
9
|
+
}
|
|
10
|
+
function newPasswordProblem(password, confirm) {
|
|
11
|
+
if ([...password].length < PASSWORD_MIN_LENGTH) return "length";
|
|
12
|
+
if (passwordByteLength(password) > PASSWORD_MAX_BYTES) return "bytes";
|
|
13
|
+
if (password !== confirm) return "mismatch";
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
16
|
+
export {
|
|
17
|
+
PASSWORD_MAX_BYTES,
|
|
18
|
+
PASSWORD_MIN_LENGTH,
|
|
19
|
+
PERSON_NAME_MAX_LENGTH,
|
|
20
|
+
newPasswordProblem,
|
|
21
|
+
personNameOk
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=form-rules.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/auth/form-rules.ts"],"sourcesContent":["import { passwordByteLength } from \"../components/password-strength\";\n\n/**\n * The few hard rules of the sign-up and sign-in forms, in one place — and the only ones\n * (docs/auth-harmonization.md §3.1, §8). The servers check the same; the kit adds no\n * rule of its own, and everything the strength meter shows beyond these is advice.\n *\n * @internal Shared by RegisterForm, SignInForm and CompleteNameDialog; the coordinator\n * decides whether the constants join the barrel.\n */\n\n/** At least 8 characters. */\nexport const PASSWORD_MIN_LENGTH = 8;\n\n/** At most 72 BYTES — bcrypt reads no further, so a longer password would be silently\n * cut. \"ü\" is two bytes, an emoji four. */\nexport const PASSWORD_MAX_BYTES = 72;\n\n/** A first or last name: 1–120 characters after trimming — the old `display_name`\n * limit, so a migrated name fits (§3.1). */\nexport const PERSON_NAME_MAX_LENGTH = 120;\n\n/** 1–120 characters after trimming. */\nexport function personNameOk(value: string): boolean {\n const length = value.trim().length;\n return length >= 1 && length <= PERSON_NAME_MAX_LENGTH;\n}\n\n/**\n * Why a new password and its confirmation may not be submitted yet, or `null` when they\n * may — keksdose's `passwordPairError` (features/auth/password-fields.tsx). Characters\n * are counted as code points, as the strength meter counts them: an emoji is one\n * character to the person typing it.\n */\nexport function newPasswordProblem(password: string, confirm: string): \"length\" | \"bytes\" | \"mismatch\" | null {\n if ([...password].length < PASSWORD_MIN_LENGTH) return \"length\";\n if (passwordByteLength(password) > PASSWORD_MAX_BYTES) return \"bytes\";\n if (password !== confirm) return \"mismatch\";\n return null;\n}\n"],"mappings":";AAAA,SAAS,0BAA0B;AAY5B,MAAM,sBAAsB;AAI5B,MAAM,qBAAqB;AAI3B,MAAM,yBAAyB;AAG/B,SAAS,aAAa,OAAwB;AACnD,QAAM,SAAS,MAAM,KAAK,EAAE;AAC5B,SAAO,UAAU,KAAK,UAAU;AAClC;AAQO,SAAS,mBAAmB,UAAkB,SAAyD;AAC5G,MAAI,CAAC,GAAG,QAAQ,EAAE,SAAS,oBAAqB,QAAO;AACvD,MAAI,mBAAmB,QAAQ,IAAI,mBAAoB,QAAO;AAC9D,MAAI,aAAa,QAAS,QAAO;AACjC,SAAO;AACT;","names":[]}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { ReactNode, Ref } from 'react';
|
|
3
|
+
|
|
4
|
+
/** @internal The words the fields show — the host form's own labels. */
|
|
5
|
+
interface NewPasswordFieldsText {
|
|
6
|
+
password: ReactNode;
|
|
7
|
+
confirm: ReactNode;
|
|
8
|
+
mismatch: ReactNode;
|
|
9
|
+
}
|
|
10
|
+
/** @internal */
|
|
11
|
+
interface NewPasswordFieldsProps {
|
|
12
|
+
password: string;
|
|
13
|
+
confirm: string;
|
|
14
|
+
onPasswordChange: (value: string) => void;
|
|
15
|
+
onConfirmChange: (value: string) => void;
|
|
16
|
+
text: NewPasswordFieldsText;
|
|
17
|
+
/** A request is running: both fields `readOnly` (not `disabled`, which would drop
|
|
18
|
+
* the focus of the one being typed in). */
|
|
19
|
+
busy?: boolean;
|
|
20
|
+
passwordRef?: Ref<HTMLInputElement>;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* "Choose a password": the field, the strength meter with its advisory checklist, and
|
|
24
|
+
* the confirmation — keksdose's `PasswordFields`, which its register form, its reset
|
|
25
|
+
* page and its forced-change step share so that every screen choosing a password does
|
|
26
|
+
* it under the same rules and the same feedback. Here `RegisterForm` and
|
|
27
|
+
* `SignInForm`'s set-a-new-password step share it.
|
|
28
|
+
*
|
|
29
|
+
* Both fields are `new-password`: a password manager offers to generate one and never
|
|
30
|
+
* fills in the current one. The confirmation carries the mismatch as its own `error`,
|
|
31
|
+
* attached with `aria-describedby`; the key is always passed, so the message coming and
|
|
32
|
+
* going never remounts the field under the typist.
|
|
33
|
+
*
|
|
34
|
+
* @internal Not part of the barrel; the forms are.
|
|
35
|
+
*/
|
|
36
|
+
declare function NewPasswordFields({ password, confirm, onPasswordChange, onConfirmChange, text, busy, passwordRef, }: NewPasswordFieldsProps): react.JSX.Element;
|
|
37
|
+
|
|
38
|
+
export { NewPasswordFields, type NewPasswordFieldsProps, type NewPasswordFieldsText };
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { PasswordStrengthMeter } from "../components/password-strength.js";
|
|
4
|
+
import { Input } from "../components/ui.js";
|
|
5
|
+
import { PASSWORD_MAX_BYTES, PASSWORD_MIN_LENGTH } from "./form-rules.js";
|
|
6
|
+
function NewPasswordFields({
|
|
7
|
+
password,
|
|
8
|
+
confirm,
|
|
9
|
+
onPasswordChange,
|
|
10
|
+
onConfirmChange,
|
|
11
|
+
text,
|
|
12
|
+
busy = false,
|
|
13
|
+
passwordRef
|
|
14
|
+
}) {
|
|
15
|
+
const mismatch = confirm !== "" && confirm !== password;
|
|
16
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
17
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
18
|
+
/* @__PURE__ */ jsx(
|
|
19
|
+
Input,
|
|
20
|
+
{
|
|
21
|
+
ref: passwordRef,
|
|
22
|
+
type: "password",
|
|
23
|
+
name: "new-password",
|
|
24
|
+
autoComplete: "new-password",
|
|
25
|
+
label: text.password,
|
|
26
|
+
value: password,
|
|
27
|
+
onChange: (e) => onPasswordChange(e.target.value),
|
|
28
|
+
minLength: PASSWORD_MIN_LENGTH,
|
|
29
|
+
readOnly: busy,
|
|
30
|
+
required: true
|
|
31
|
+
}
|
|
32
|
+
),
|
|
33
|
+
/* @__PURE__ */ jsx(PasswordStrengthMeter, { value: password, minLength: PASSWORD_MIN_LENGTH, maxBytes: PASSWORD_MAX_BYTES })
|
|
34
|
+
] }),
|
|
35
|
+
/* @__PURE__ */ jsx(
|
|
36
|
+
Input,
|
|
37
|
+
{
|
|
38
|
+
type: "password",
|
|
39
|
+
name: "confirm-password",
|
|
40
|
+
autoComplete: "new-password",
|
|
41
|
+
label: text.confirm,
|
|
42
|
+
value: confirm,
|
|
43
|
+
onChange: (e) => onConfirmChange(e.target.value),
|
|
44
|
+
readOnly: busy,
|
|
45
|
+
error: mismatch ? text.mismatch : void 0,
|
|
46
|
+
required: true
|
|
47
|
+
}
|
|
48
|
+
)
|
|
49
|
+
] });
|
|
50
|
+
}
|
|
51
|
+
export {
|
|
52
|
+
NewPasswordFields
|
|
53
|
+
};
|
|
54
|
+
//# sourceMappingURL=new-password-fields.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/auth/new-password-fields.tsx"],"sourcesContent":["import type { ReactNode, Ref } from \"react\";\nimport { PasswordStrengthMeter } from \"../components/password-strength\";\nimport { Input } from \"../components/ui\";\nimport { PASSWORD_MAX_BYTES, PASSWORD_MIN_LENGTH } from \"./form-rules\";\n\n/** @internal The words the fields show — the host form's own labels. */\nexport interface NewPasswordFieldsText {\n password: ReactNode;\n confirm: ReactNode;\n mismatch: ReactNode;\n}\n\n/** @internal */\nexport interface NewPasswordFieldsProps {\n password: string;\n confirm: string;\n onPasswordChange: (value: string) => void;\n onConfirmChange: (value: string) => void;\n text: NewPasswordFieldsText;\n /** A request is running: both fields `readOnly` (not `disabled`, which would drop\n * the focus of the one being typed in). */\n busy?: boolean;\n passwordRef?: Ref<HTMLInputElement>;\n}\n\n/**\n * \"Choose a password\": the field, the strength meter with its advisory checklist, and\n * the confirmation — keksdose's `PasswordFields`, which its register form, its reset\n * page and its forced-change step share so that every screen choosing a password does\n * it under the same rules and the same feedback. Here `RegisterForm` and\n * `SignInForm`'s set-a-new-password step share it.\n *\n * Both fields are `new-password`: a password manager offers to generate one and never\n * fills in the current one. The confirmation carries the mismatch as its own `error`,\n * attached with `aria-describedby`; the key is always passed, so the message coming and\n * going never remounts the field under the typist.\n *\n * @internal Not part of the barrel; the forms are.\n */\nexport function NewPasswordFields({\n password,\n confirm,\n onPasswordChange,\n onConfirmChange,\n text,\n busy = false,\n passwordRef,\n}: NewPasswordFieldsProps) {\n const mismatch = confirm !== \"\" && confirm !== password;\n return (\n <>\n <div>\n <Input\n ref={passwordRef}\n type=\"password\"\n name=\"new-password\"\n autoComplete=\"new-password\"\n label={text.password}\n value={password}\n onChange={(e) => onPasswordChange(e.target.value)}\n minLength={PASSWORD_MIN_LENGTH}\n readOnly={busy}\n required\n />\n {/* The 72-byte cap is passed because a SIGN-IN password has one (bcrypt); the\n minimum is passed rather than left to the meter's own default 8, so the two\n cannot drift apart. */}\n <PasswordStrengthMeter value={password} minLength={PASSWORD_MIN_LENGTH} maxBytes={PASSWORD_MAX_BYTES} />\n </div>\n {/* A typo'd password costs a reset mail — and under keksdose's end-to-end\n encryption, data (feedback #124) — so it is typed twice. */}\n <Input\n type=\"password\"\n name=\"confirm-password\"\n autoComplete=\"new-password\"\n label={text.confirm}\n value={confirm}\n onChange={(e) => onConfirmChange(e.target.value)}\n readOnly={busy}\n error={mismatch ? text.mismatch : undefined}\n required\n />\n </>\n );\n}\n"],"mappings":";AAkDI,mBAEI,KADF,YADF;AAjDJ,SAAS,6BAA6B;AACtC,SAAS,aAAa;AACtB,SAAS,oBAAoB,2BAA2B;AAoCjD,SAAS,kBAAkB;AAAA,EAChC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,OAAO;AAAA,EACP;AACF,GAA2B;AACzB,QAAM,WAAW,YAAY,MAAM,YAAY;AAC/C,SACE,iCACE;AAAA,yBAAC,SACC;AAAA;AAAA,QAAC;AAAA;AAAA,UACC,KAAK;AAAA,UACL,MAAK;AAAA,UACL,MAAK;AAAA,UACL,cAAa;AAAA,UACb,OAAO,KAAK;AAAA,UACZ,OAAO;AAAA,UACP,UAAU,CAAC,MAAM,iBAAiB,EAAE,OAAO,KAAK;AAAA,UAChD,WAAW;AAAA,UACX,UAAU;AAAA,UACV,UAAQ;AAAA;AAAA,MACV;AAAA,MAIA,oBAAC,yBAAsB,OAAO,UAAU,WAAW,qBAAqB,UAAU,oBAAoB;AAAA,OACxG;AAAA,IAGA;AAAA,MAAC;AAAA;AAAA,QACC,MAAK;AAAA,QACL,MAAK;AAAA,QACL,cAAa;AAAA,QACb,OAAO,KAAK;AAAA,QACZ,OAAO;AAAA,QACP,UAAU,CAAC,MAAM,gBAAgB,EAAE,OAAO,KAAK;AAAA,QAC/C,UAAU;AAAA,QACV,OAAO,WAAW,KAAK,WAAW;AAAA,QAClC,UAAQ;AAAA;AAAA,IACV;AAAA,KACF;AAEJ;","names":[]}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { ComponentPropsWithoutRef, ReactNode } from 'react';
|
|
3
|
+
import { AuthHeadingLevel } from './status-parts.js';
|
|
4
|
+
|
|
5
|
+
/** Every string the page renders — the `notFound` namespace. keksdose's words
|
|
6
|
+
* (`error.not_found_*`), which kastlan took over. */
|
|
7
|
+
interface NotFoundLabels {
|
|
8
|
+
/** The heading. */
|
|
9
|
+
title: string;
|
|
10
|
+
/** Under it. */
|
|
11
|
+
body: string;
|
|
12
|
+
/** The way out for everyone — to `homeHref`. */
|
|
13
|
+
home: string;
|
|
14
|
+
/** The second way out for someone signed in — to `appHref`. */
|
|
15
|
+
app: string;
|
|
16
|
+
}
|
|
17
|
+
declare const DEFAULT_NOT_FOUND_LABELS: NotFoundLabels;
|
|
18
|
+
interface NotFoundPageProps extends Omit<ComponentPropsWithoutRef<"div">, "children" | "title"> {
|
|
19
|
+
/** "Go to the start page". Default `/`, which takes a signed-in user into the app and
|
|
20
|
+
* anyone else to sign-in in all three apps. */
|
|
21
|
+
homeHref?: string;
|
|
22
|
+
/**
|
|
23
|
+
* "Back to the app", beside it — pass it while someone is signed in. A LITERAL page
|
|
24
|
+
* (keksdose's `/budget`), never the "last visited page" an app restores on start: a
|
|
25
|
+
* stale one of those pointing at a route that is gone is the likeliest way a
|
|
26
|
+
* signed-in user lands here (keksdose's not-found-page.tsx).
|
|
27
|
+
*/
|
|
28
|
+
appHref?: string;
|
|
29
|
+
/** App content under the text — a search field, a support address. */
|
|
30
|
+
children?: ReactNode;
|
|
31
|
+
/** `false` adds no `noindex` — for a preview inside another page. Default `true`. */
|
|
32
|
+
noIndex?: boolean;
|
|
33
|
+
/** The heading's level. Default `h2`, under `AuthLayout`'s `h1`; `h1` where the page
|
|
34
|
+
* stands alone (inside the app shell). */
|
|
35
|
+
headingAs?: AuthHeadingLevel;
|
|
36
|
+
labels?: Partial<NotFoundLabels>;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* What an unknown address renders (the router's catch-all), signed out and signed in —
|
|
40
|
+
* keksdose's `NotFoundPage` (app/not-found-page.tsx, feedback #129), which kastlan took
|
|
41
|
+
* over on `AuthLayout` (docs/auth-harmonization.md §7).
|
|
42
|
+
*
|
|
43
|
+
* In place of the silent `<Navigate to="/">` keksdose had: bouncing every typo, dead link
|
|
44
|
+
* and fabricated URL to the start page is what Search Console reports as a soft 404, and
|
|
45
|
+
* it hid broken links. An SPA cannot send a real 404 status — the web server answers
|
|
46
|
+
* every path with index.html — so the page says it in words and calls
|
|
47
|
+
* {@link useNoIndex}, which makes a crawler drop it (the server's `X-Robots-Tag` is the
|
|
48
|
+
* authoritative half).
|
|
49
|
+
*
|
|
50
|
+
* It is the page's CONTENT, not a frame, so it sits in either: as `AuthLayout`'s child
|
|
51
|
+
* for a visitor (`headingAs` default `h2`, under the layout's title), or bare inside the
|
|
52
|
+
* app shell for someone signed in (`headingAs="h1"`, and `appHref`). The large "404" is
|
|
53
|
+
* decoration — the heading says it in words — and hidden from a screen reader.
|
|
54
|
+
*/
|
|
55
|
+
declare function NotFoundPage({ homeHref, appHref, children, noIndex, headingAs: Heading, labels: labelsProp, className, ...rest }: NotFoundPageProps): react.JSX.Element;
|
|
56
|
+
|
|
57
|
+
export { DEFAULT_NOT_FOUND_LABELS, type NotFoundLabels, NotFoundPage, type NotFoundPageProps };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { cn } from "../lib/cn.js";
|
|
4
|
+
import { useKitLabels } from "../i18n/kit-labels.js";
|
|
5
|
+
import { useNoIndex } from "../hooks/use-noindex.js";
|
|
6
|
+
import { Button } from "../components/ui.js";
|
|
7
|
+
const DEFAULT_NOT_FOUND_LABELS = {
|
|
8
|
+
title: "Page not found",
|
|
9
|
+
body: "This address doesn\u2019t exist (any more). It may be a typo, or the page has moved.",
|
|
10
|
+
home: "Go to the start page",
|
|
11
|
+
app: "Back to the app"
|
|
12
|
+
};
|
|
13
|
+
function NotFoundPage({
|
|
14
|
+
homeHref = "/",
|
|
15
|
+
appHref,
|
|
16
|
+
children,
|
|
17
|
+
noIndex = true,
|
|
18
|
+
headingAs: Heading = "h2",
|
|
19
|
+
labels: labelsProp,
|
|
20
|
+
className,
|
|
21
|
+
...rest
|
|
22
|
+
}) {
|
|
23
|
+
const labels = useKitLabels("notFound", DEFAULT_NOT_FOUND_LABELS, labelsProp);
|
|
24
|
+
useNoIndex(noIndex);
|
|
25
|
+
return /* @__PURE__ */ jsxs("div", { ...rest, className: cn("flex flex-col items-center gap-2 py-4 text-center", className), children: [
|
|
26
|
+
/* @__PURE__ */ jsx("p", { "aria-hidden": true, className: "text-6xl font-bold leading-none tracking-tight text-[var(--text-placeholder)]", children: "404" }),
|
|
27
|
+
/* @__PURE__ */ jsx(Heading, { className: "mt-2 text-xl font-semibold text-[var(--text-primary)]", children: labels.title }),
|
|
28
|
+
/* @__PURE__ */ jsx("p", { className: "max-w-prose text-sm text-[var(--text-secondary)]", children: labels.body }),
|
|
29
|
+
children,
|
|
30
|
+
/* @__PURE__ */ jsxs("div", { className: "mt-4 flex flex-wrap justify-center gap-3", children: [
|
|
31
|
+
/* @__PURE__ */ jsx(Button, { href: homeHref, variant: "brand", children: labels.home }),
|
|
32
|
+
appHref !== void 0 && /* @__PURE__ */ jsx(Button, { href: appHref, variant: "secondary", children: labels.app })
|
|
33
|
+
] })
|
|
34
|
+
] });
|
|
35
|
+
}
|
|
36
|
+
export {
|
|
37
|
+
DEFAULT_NOT_FOUND_LABELS,
|
|
38
|
+
NotFoundPage
|
|
39
|
+
};
|
|
40
|
+
//# sourceMappingURL=not-found-page.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/auth/not-found-page.tsx"],"sourcesContent":["import type { ComponentPropsWithoutRef, ReactNode } from \"react\";\nimport { cn } from \"../lib/cn\";\nimport { useKitLabels } from \"../i18n/kit-labels\";\nimport { useNoIndex } from \"../hooks/use-noindex\";\nimport { Button } from \"../components/ui\";\nimport type { AuthHeadingLevel } from \"./status-parts\";\n\n/** Every string the page renders — the `notFound` namespace. keksdose's words\n * (`error.not_found_*`), which kastlan took over. */\nexport interface NotFoundLabels {\n /** The heading. */\n title: string;\n /** Under it. */\n body: string;\n /** The way out for everyone — to `homeHref`. */\n home: string;\n /** The second way out for someone signed in — to `appHref`. */\n app: string;\n}\n\nexport const DEFAULT_NOT_FOUND_LABELS: NotFoundLabels = {\n title: \"Page not found\",\n body: \"This address doesn’t exist (any more). It may be a typo, or the page has moved.\",\n home: \"Go to the start page\",\n app: \"Back to the app\",\n};\n\nexport interface NotFoundPageProps extends Omit<ComponentPropsWithoutRef<\"div\">, \"children\" | \"title\"> {\n /** \"Go to the start page\". Default `/`, which takes a signed-in user into the app and\n * anyone else to sign-in in all three apps. */\n homeHref?: string;\n /**\n * \"Back to the app\", beside it — pass it while someone is signed in. A LITERAL page\n * (keksdose's `/budget`), never the \"last visited page\" an app restores on start: a\n * stale one of those pointing at a route that is gone is the likeliest way a\n * signed-in user lands here (keksdose's not-found-page.tsx).\n */\n appHref?: string;\n /** App content under the text — a search field, a support address. */\n children?: ReactNode;\n /** `false` adds no `noindex` — for a preview inside another page. Default `true`. */\n noIndex?: boolean;\n /** The heading's level. Default `h2`, under `AuthLayout`'s `h1`; `h1` where the page\n * stands alone (inside the app shell). */\n headingAs?: AuthHeadingLevel;\n labels?: Partial<NotFoundLabels>;\n}\n\n/**\n * What an unknown address renders (the router's catch-all), signed out and signed in —\n * keksdose's `NotFoundPage` (app/not-found-page.tsx, feedback #129), which kastlan took\n * over on `AuthLayout` (docs/auth-harmonization.md §7).\n *\n * In place of the silent `<Navigate to=\"/\">` keksdose had: bouncing every typo, dead link\n * and fabricated URL to the start page is what Search Console reports as a soft 404, and\n * it hid broken links. An SPA cannot send a real 404 status — the web server answers\n * every path with index.html — so the page says it in words and calls\n * {@link useNoIndex}, which makes a crawler drop it (the server's `X-Robots-Tag` is the\n * authoritative half).\n *\n * It is the page's CONTENT, not a frame, so it sits in either: as `AuthLayout`'s child\n * for a visitor (`headingAs` default `h2`, under the layout's title), or bare inside the\n * app shell for someone signed in (`headingAs=\"h1\"`, and `appHref`). The large \"404\" is\n * decoration — the heading says it in words — and hidden from a screen reader.\n */\nexport function NotFoundPage({\n homeHref = \"/\",\n appHref,\n children,\n noIndex = true,\n headingAs: Heading = \"h2\",\n labels: labelsProp,\n className,\n ...rest\n}: NotFoundPageProps) {\n const labels = useKitLabels(\"notFound\", DEFAULT_NOT_FOUND_LABELS, labelsProp);\n useNoIndex(noIndex);\n return (\n <div {...rest} className={cn(\"flex flex-col items-center gap-2 py-4 text-center\", className)}>\n <p aria-hidden className=\"text-6xl font-bold leading-none tracking-tight text-[var(--text-placeholder)]\">\n 404\n </p>\n <Heading className=\"mt-2 text-xl font-semibold text-[var(--text-primary)]\">{labels.title}</Heading>\n <p className=\"max-w-prose text-sm text-[var(--text-secondary)]\">{labels.body}</p>\n {children}\n <div className=\"mt-4 flex flex-wrap justify-center gap-3\">\n <Button href={homeHref} variant=\"brand\">\n {labels.home}\n </Button>\n {appHref !== undefined && (\n <Button href={appHref} variant=\"secondary\">\n {labels.app}\n </Button>\n )}\n </div>\n </div>\n );\n}\n"],"mappings":";AA+EM,cAMA,YANA;AA9EN,SAAS,UAAU;AACnB,SAAS,oBAAoB;AAC7B,SAAS,kBAAkB;AAC3B,SAAS,cAAc;AAgBhB,MAAM,2BAA2C;AAAA,EACtD,OAAO;AAAA,EACP,MAAM;AAAA,EACN,MAAM;AAAA,EACN,KAAK;AACP;AAwCO,SAAS,aAAa;AAAA,EAC3B,WAAW;AAAA,EACX;AAAA,EACA;AAAA,EACA,UAAU;AAAA,EACV,WAAW,UAAU;AAAA,EACrB,QAAQ;AAAA,EACR;AAAA,EACA,GAAG;AACL,GAAsB;AACpB,QAAM,SAAS,aAAa,YAAY,0BAA0B,UAAU;AAC5E,aAAW,OAAO;AAClB,SACE,qBAAC,SAAK,GAAG,MAAM,WAAW,GAAG,qDAAqD,SAAS,GACzF;AAAA,wBAAC,OAAE,eAAW,MAAC,WAAU,iFAAgF,iBAEzG;AAAA,IACA,oBAAC,WAAQ,WAAU,yDAAyD,iBAAO,OAAM;AAAA,IACzF,oBAAC,OAAE,WAAU,oDAAoD,iBAAO,MAAK;AAAA,IAC5E;AAAA,IACD,qBAAC,SAAI,WAAU,4CACb;AAAA,0BAAC,UAAO,MAAM,UAAU,SAAQ,SAC7B,iBAAO,MACV;AAAA,MACC,YAAY,UACX,oBAAC,UAAO,MAAM,SAAS,SAAQ,aAC5B,iBAAO,KACV;AAAA,OAEJ;AAAA,KACF;AAEJ;","names":[]}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import 'react';
|
|
2
|
+
export { cB as DEFAULT_REGISTER_LABELS, ei as RegisterForm, ej as RegisterFormProps, ek as RegisterLabels, el as RegisterValues } from '../delete-account-setting-CGVMckMw.js';
|
|
3
|
+
import '../components/tooltip.js';
|
|
4
|
+
import '../hooks/use-anchored-rect.js';
|
|
5
|
+
import '../lib/clipping.js';
|
|
6
|
+
import '../data-table-labels-DUELeXpa.js';
|
|
7
|
+
import '../components/data-table-sort.js';
|
|
8
|
+
import '../components/swipeable-row.js';
|
|
9
|
+
import '../components/mini-calendar.js';
|
|
10
|
+
import '../components/calendar-heatmap.js';
|
|
11
|
+
import '../components/popover.js';
|
|
12
|
+
import '../components/chip.js';
|
|
13
|
+
import 'lucide-react';
|
|
14
|
+
import '../components/field-sync.js';
|
|
15
|
+
import '../wizard/types.js';
|
|
16
|
+
import '../tour/tour.js';
|
|
17
|
+
import '../search/command-palette.js';
|
|
18
|
+
import '../search/global-search.js';
|
|
19
|
+
import '../search/search-index.js';
|
|
20
|
+
import '../components/month-picker.js';
|
|
21
|
+
import '../components/page-contents.js';
|
|
22
|
+
import '../components/series-chart-labels.js';
|
|
23
|
+
import '../components/pie-chart-labels.js';
|
|
24
|
+
import '../components/sparkline.js';
|
|
25
|
+
import '../components/stat-tile.js';
|
|
26
|
+
import '../components/signature-pad.js';
|
|
27
|
+
import '../components/password-strength.js';
|
|
28
|
+
import '../components/swatch-picker.js';
|
|
29
|
+
import '../components/tile-radio.js';
|
|
30
|
+
import '../components/icon-picker.js';
|
|
31
|
+
import '../components/dialog-frame.js';
|
|
32
|
+
import '../components/modal.js';
|
|
33
|
+
import '../hooks/use-search-param-state.js';
|
|
34
|
+
import '../components/measured-grid.js';
|
|
35
|
+
import '../components/user-avatar.js';
|
|
36
|
+
import '../lib/person-name.js';
|
|
37
|
+
import '../components/status-dot.js';
|
|
38
|
+
import '../components/progress-bar.js';
|
|
39
|
+
import '../components/signed-amount.js';
|
|
40
|
+
import '../shell/topbar-action-menu.js';
|
|
41
|
+
import '../components/menu-item.js';
|
|
42
|
+
import '../components/floating-panel.js';
|
|
43
|
+
import '../hooks/use-authed-src.js';
|
|
44
|
+
import '../components/account-settings-labels.js';
|
|
45
|
+
import '../components/bulk-action-bar.js';
|
|
46
|
+
import '../components/list.js';
|
|
47
|
+
import '../components/breadcrumbs.js';
|
|
48
|
+
import '../components/toast.js';
|
|
49
|
+
import '../components/description-list.js';
|
|
50
|
+
import '../components/line-items.js';
|
|
51
|
+
import '../components/error-boundary.js';
|
|
52
|
+
import '../components/authed-image.js';
|
|
53
|
+
import '../components/image-grid.js';
|
|
54
|
+
import '../components/lightbox.js';
|
|
55
|
+
import '../components/write-lock.js';
|
|
56
|
+
import './sign-in-form.js';
|
|
57
|
+
import '../shell/topbar-controls.js';
|
|
58
|
+
import '../theme/palette-presets.js';
|
|
59
|
+
import '../theme/chart-palette.js';
|
|
60
|
+
import '../theme/theme-store.js';
|
|
61
|
+
import 'zustand/middleware';
|
|
62
|
+
import 'zustand';
|
|
63
|
+
import './complete-name-dialog.js';
|
|
64
|
+
import './forgot-password-form.js';
|
|
65
|
+
import './status-parts.js';
|
|
66
|
+
import './reset-password-form.js';
|
|
67
|
+
import './verify-email.js';
|
|
68
|
+
import './not-found-page.js';
|
|
69
|
+
import './accept-invitation.js';
|
|
70
|
+
import '../shell/company-switcher.js';
|
|
71
|
+
import '../account/email-change-setting.js';
|
|
72
|
+
import '../account/sessions-setting.js';
|
|
73
|
+
import '../lib/format.js';
|
|
74
|
+
import '../account/data-export-setting.js';
|
|
75
|
+
import '../components/account-chips.js';
|
|
76
|
+
import '../admin/admin-parts.js';
|
|
77
|
+
import '../admin/admin-action-log.js';
|
|
78
|
+
import '../components/reauth-dialog.js';
|
|
79
|
+
import '../components/server-wake.js';
|
|
80
|
+
import '../lib/server-wake.js';
|
|
81
|
+
import '../components/translation-review-labels.js';
|
|
82
|
+
import '../lib/translation-review.js';
|
|
83
|
+
import '../components/country-select.js';
|
|
84
|
+
import '../components/inline-edit-field.js';
|
|
85
|
+
import '../lib/iban.js';
|
|
86
|
+
import '../lib/phone.js';
|
|
87
|
+
import '../components/sign-chip.js';
|
|
88
|
+
import '../components/column-mapper.js';
|
|
89
|
+
import '../lib/column-mapping.js';
|
|
90
|
+
import '../lib/table-text.js';
|
|
91
|
+
import '../components/field-parts.js';
|