rei-kit 0.14.0 → 0.15.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 +8 -1
- package/dist/GoogleButton-BQSsm0hp.js +507 -0
- package/dist/GoogleButton-BQSsm0hp.js.map +1 -0
- package/dist/app/AuthForm.vue.d.ts +78 -0
- package/dist/app/auth-form.d.ts +36 -0
- package/dist/app/field-errors.d.ts +39 -0
- package/dist/app/index.d.ts +4 -0
- package/dist/app.js +185 -4
- package/dist/app.js.map +1 -1
- package/dist/components/GoogleButton.vue.d.ts +8 -0
- package/dist/index.js +3 -247
- package/dist/index.js.map +1 -1
- package/dist/shell/mobile.css +49 -0
- package/dist/styles.css +8 -40
- package/dist/supabase/auth-errors.d.ts +40 -0
- package/dist/supabase/index.d.ts +2 -0
- package/dist/supabase.js +46 -2
- package/dist/supabase.js.map +1 -1
- package/package.json +1 -1
- package/dist/BaseSheet-CLIhXDwe.js +0 -253
- package/dist/BaseSheet-CLIhXDwe.js.map +0 -1
package/dist/shell/mobile.css
CHANGED
|
@@ -91,3 +91,52 @@
|
|
|
91
91
|
filter: none;
|
|
92
92
|
}
|
|
93
93
|
}
|
|
94
|
+
|
|
95
|
+
/* ── Between a guide's slides ───────────────────────────────────────────────
|
|
96
|
+
Used by `TourShell`, and unscoped on purpose: the slides are the app's, so a
|
|
97
|
+
scoped rule inside the component could never reach them.
|
|
98
|
+
|
|
99
|
+
Leaving takes half the time of arriving, the same reasoning as the page
|
|
100
|
+
fade — the slide being left is not worth watching. */
|
|
101
|
+
.tour-forward-enter-active,
|
|
102
|
+
.tour-backward-enter-active {
|
|
103
|
+
transition:
|
|
104
|
+
opacity 260ms ease-out,
|
|
105
|
+
transform 260ms cubic-bezier(0.22, 1, 0.36, 1);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.tour-forward-leave-active,
|
|
109
|
+
.tour-backward-leave-active {
|
|
110
|
+
transition:
|
|
111
|
+
opacity 130ms ease-in,
|
|
112
|
+
transform 130ms ease-in;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.tour-forward-enter-from {
|
|
116
|
+
opacity: 0;
|
|
117
|
+
transform: translateX(1.25rem);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.tour-forward-leave-to {
|
|
121
|
+
opacity: 0;
|
|
122
|
+
transform: translateX(-0.75rem);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.tour-backward-enter-from {
|
|
126
|
+
opacity: 0;
|
|
127
|
+
transform: translateX(-1.25rem);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.tour-backward-leave-to {
|
|
131
|
+
opacity: 0;
|
|
132
|
+
transform: translateX(0.75rem);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
@media (prefers-reduced-motion: reduce) {
|
|
136
|
+
.tour-forward-enter-from,
|
|
137
|
+
.tour-forward-leave-to,
|
|
138
|
+
.tour-backward-enter-from,
|
|
139
|
+
.tour-backward-leave-to {
|
|
140
|
+
transform: none;
|
|
141
|
+
}
|
|
142
|
+
}
|
package/dist/styles.css
CHANGED
|
@@ -25,50 +25,18 @@
|
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
.
|
|
29
|
-
|
|
28
|
+
/* The dialog's own fade. The *slide* transition is not here: a scoped rule
|
|
29
|
+
cannot reach slot content, which belongs to the caller's scope, so
|
|
30
|
+
`.tour-forward-*` and `.tour-backward-*` ship unscoped in
|
|
31
|
+
`rei-kit/shell/mobile.css` where the caller's slide can actually see them. */
|
|
32
|
+
.tour-enter-active[data-v-1b9e7f4d],
|
|
33
|
+
.tour-leave-active[data-v-1b9e7f4d] {
|
|
30
34
|
transition: opacity 220ms ease;
|
|
31
35
|
}
|
|
32
|
-
.tour-enter-from[data-v-
|
|
33
|
-
.tour-leave-to[data-v-
|
|
36
|
+
.tour-enter-from[data-v-1b9e7f4d],
|
|
37
|
+
.tour-leave-to[data-v-1b9e7f4d] {
|
|
34
38
|
opacity: 0;
|
|
35
39
|
}
|
|
36
|
-
.tour-forward-enter-active[data-v-75292716],
|
|
37
|
-
.tour-backward-enter-active[data-v-75292716] {
|
|
38
|
-
transition:
|
|
39
|
-
opacity 260ms ease-out,
|
|
40
|
-
transform 260ms cubic-bezier(0.22, 1, 0.36, 1);
|
|
41
|
-
}
|
|
42
|
-
.tour-forward-leave-active[data-v-75292716],
|
|
43
|
-
.tour-backward-leave-active[data-v-75292716] {
|
|
44
|
-
transition:
|
|
45
|
-
opacity 130ms ease-in,
|
|
46
|
-
transform 130ms ease-in;
|
|
47
|
-
}
|
|
48
|
-
.tour-forward-enter-from[data-v-75292716] {
|
|
49
|
-
opacity: 0;
|
|
50
|
-
transform: translateX(1.25rem);
|
|
51
|
-
}
|
|
52
|
-
.tour-forward-leave-to[data-v-75292716] {
|
|
53
|
-
opacity: 0;
|
|
54
|
-
transform: translateX(-0.75rem);
|
|
55
|
-
}
|
|
56
|
-
.tour-backward-enter-from[data-v-75292716] {
|
|
57
|
-
opacity: 0;
|
|
58
|
-
transform: translateX(-1.25rem);
|
|
59
|
-
}
|
|
60
|
-
.tour-backward-leave-to[data-v-75292716] {
|
|
61
|
-
opacity: 0;
|
|
62
|
-
transform: translateX(0.75rem);
|
|
63
|
-
}
|
|
64
|
-
@media (prefers-reduced-motion: reduce) {
|
|
65
|
-
.tour-forward-enter-from[data-v-75292716],
|
|
66
|
-
.tour-forward-leave-to[data-v-75292716],
|
|
67
|
-
.tour-backward-enter-from[data-v-75292716],
|
|
68
|
-
.tour-backward-leave-to[data-v-75292716] {
|
|
69
|
-
transform: none;
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
40
|
|
|
73
41
|
/* Movement is small and downward from the top, upward from the bottom — the
|
|
74
42
|
direction it came from either way. */
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Supabase auth codes a sign-in screen has to have wording for.
|
|
3
|
+
*
|
|
4
|
+
* Exported so an app can assert its locale files cover them. The list is not
|
|
5
|
+
* every code Supabase can send — it is the ones that are the user's to act on,
|
|
6
|
+
* which is the only kind worth a sentence of its own. Everything else is a
|
|
7
|
+
* fault, and a fault reads the same whatever caused it.
|
|
8
|
+
*/
|
|
9
|
+
export declare const AUTH_ERROR_CODES: readonly ["invalid_credentials", "email_not_confirmed", "user_already_exists", "email_exists", "weak_password", "over_request_rate_limit", "over_email_send_rate_limit", "signup_disabled", "user_banned"];
|
|
10
|
+
export type AuthErrorCode = (typeof AUTH_ERROR_CODES)[number];
|
|
11
|
+
export type AuthMessageKeyOptions = {
|
|
12
|
+
/**
|
|
13
|
+
* Codes this app has wording for beyond the shared list.
|
|
14
|
+
*
|
|
15
|
+
* A key is only an improvement on the generic message if something
|
|
16
|
+
* translates it, so widening the list is the app's decision and not the
|
|
17
|
+
* kit's: an app that has not written `authError.validation_failed` is better
|
|
18
|
+
* served by the sentence it has than by a key rendered raw on screen.
|
|
19
|
+
*/
|
|
20
|
+
extraCodes?: readonly string[] | undefined;
|
|
21
|
+
/** The key returned when nothing matches. */
|
|
22
|
+
fallback?: string | undefined;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Maps an auth failure to a message key.
|
|
26
|
+
*
|
|
27
|
+
* Returns a key rather than a sentence so the caller translates it at render
|
|
28
|
+
* time — an error stored before a language switch still reads correctly after,
|
|
29
|
+
* which is the whole reason this returns a string that looks unfinished.
|
|
30
|
+
*
|
|
31
|
+
* Recognising a Supabase error is Supabase's business, so the type guard stays
|
|
32
|
+
* on this side of the boundary and the caller only ever sees a key.
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```ts
|
|
36
|
+
* serverError.value = toAuthMessageKey(error) // 'authError.invalid_credentials'
|
|
37
|
+
* // <p>{{ $t(serverError) }}</p>
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
export declare function toAuthMessageKey(error: unknown, options?: AuthMessageKeyOptions): string;
|
package/dist/supabase/index.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { SupabaseClient } from '@supabase/supabase-js';
|
|
2
|
+
export { AUTH_ERROR_CODES, toAuthMessageKey } from './auth-errors';
|
|
3
|
+
export type { AuthErrorCode, AuthMessageKeyOptions } from './auth-errors';
|
|
2
4
|
/**
|
|
3
5
|
* Records whether the next session should outlive the tab.
|
|
4
6
|
*
|
package/dist/supabase.js
CHANGED
|
@@ -1,5 +1,49 @@
|
|
|
1
1
|
import { n as registerErrorMapper, t as AppError } from "./app-error-DF9cijE0.js";
|
|
2
|
-
import { PostgrestError, createClient } from "@supabase/supabase-js";
|
|
2
|
+
import { PostgrestError, createClient, isAuthError } from "@supabase/supabase-js";
|
|
3
|
+
//#region src/supabase/auth-errors.ts
|
|
4
|
+
/**
|
|
5
|
+
* The Supabase auth codes a sign-in screen has to have wording for.
|
|
6
|
+
*
|
|
7
|
+
* Exported so an app can assert its locale files cover them. The list is not
|
|
8
|
+
* every code Supabase can send — it is the ones that are the user's to act on,
|
|
9
|
+
* which is the only kind worth a sentence of its own. Everything else is a
|
|
10
|
+
* fault, and a fault reads the same whatever caused it.
|
|
11
|
+
*/
|
|
12
|
+
var AUTH_ERROR_CODES = [
|
|
13
|
+
"invalid_credentials",
|
|
14
|
+
"email_not_confirmed",
|
|
15
|
+
"user_already_exists",
|
|
16
|
+
"email_exists",
|
|
17
|
+
"weak_password",
|
|
18
|
+
"over_request_rate_limit",
|
|
19
|
+
"over_email_send_rate_limit",
|
|
20
|
+
"signup_disabled",
|
|
21
|
+
"user_banned"
|
|
22
|
+
];
|
|
23
|
+
/**
|
|
24
|
+
* Maps an auth failure to a message key.
|
|
25
|
+
*
|
|
26
|
+
* Returns a key rather than a sentence so the caller translates it at render
|
|
27
|
+
* time — an error stored before a language switch still reads correctly after,
|
|
28
|
+
* which is the whole reason this returns a string that looks unfinished.
|
|
29
|
+
*
|
|
30
|
+
* Recognising a Supabase error is Supabase's business, so the type guard stays
|
|
31
|
+
* on this side of the boundary and the caller only ever sees a key.
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```ts
|
|
35
|
+
* serverError.value = toAuthMessageKey(error) // 'authError.invalid_credentials'
|
|
36
|
+
* // <p>{{ $t(serverError) }}</p>
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
39
|
+
function toAuthMessageKey(error, options = {}) {
|
|
40
|
+
const { extraCodes = [], fallback = "authError.generic" } = options;
|
|
41
|
+
if (!isAuthError(error)) return fallback;
|
|
42
|
+
const code = error.code;
|
|
43
|
+
if (!code) return fallback;
|
|
44
|
+
return AUTH_ERROR_CODES.includes(code) || extraCodes.includes(code) ? `authError.${code}` : fallback;
|
|
45
|
+
}
|
|
46
|
+
//#endregion
|
|
3
47
|
//#region src/supabase/index.ts
|
|
4
48
|
/**
|
|
5
49
|
* The optional Supabase entry.
|
|
@@ -121,6 +165,6 @@ registerErrorMapper((error) => {
|
|
|
121
165
|
return new AppError("unknown", error.message, { cause: error });
|
|
122
166
|
});
|
|
123
167
|
//#endregion
|
|
124
|
-
export { createSupabaseClient, setRememberMe };
|
|
168
|
+
export { AUTH_ERROR_CODES, createSupabaseClient, setRememberMe, toAuthMessageKey };
|
|
125
169
|
|
|
126
170
|
//# sourceMappingURL=supabase.js.map
|
package/dist/supabase.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"supabase.js","names":[],"sources":["../src/supabase/index.ts"],"sourcesContent":["import { createClient } from '@supabase/supabase-js'\nimport { PostgrestError } from '@supabase/supabase-js'\nimport type { SupabaseClient, SupportedStorage } from '@supabase/supabase-js'\n\nimport { AppError, registerErrorMapper } from '../utils/app-error'\n\n/**\n * The optional Supabase entry.\n *\n * Behind its own export so an app that never touches Supabase downloads none of\n * it — importing this module is what opts in, including to the error mapping\n * registered at the bottom.\n */\n\nconst REMEMBER_KEY = 'rei-remember'\n\n/**\n * Records whether the next session should outlive the tab.\n *\n * Call before signing in: the SDK writes the session as soon as the request\n * succeeds, and this decides where it lands.\n */\nexport function setRememberMe(remember: boolean): void {\n try {\n localStorage.setItem(REMEMBER_KEY, String(remember))\n } catch {\n // Storage blocked; the session will simply not persist.\n }\n}\n\nfunction activeStore(): Storage {\n try {\n return localStorage.getItem(REMEMBER_KEY) === 'false' ? sessionStorage : localStorage\n } catch {\n return sessionStorage\n }\n}\n\n/**\n * Session storage that follows the \"remember me\" choice.\n *\n * Supabase issues a short-lived access token plus a long-lived refresh token.\n * Where the refresh token is kept decides how long a login survives:\n * `localStorage` outlives the browser, `sessionStorage` dies with the tab. On a\n * shared machine that difference is the whole point, so the choice switches the\n * store rather than the token lifetime.\n *\n * Removal clears both, so signing out cannot leave a copy behind.\n */\nconst rememberAwareStorage: SupportedStorage = {\n getItem: (key) => {\n try {\n return activeStore().getItem(key)\n } catch {\n return null\n }\n },\n setItem: (key, value) => {\n try {\n activeStore().setItem(key, value)\n } catch {\n // Storage blocked.\n }\n },\n removeItem: (key) => {\n try {\n localStorage.removeItem(key)\n sessionStorage.removeItem(key)\n } catch {\n // Storage blocked.\n }\n },\n}\n\n/**\n * Builds a typed Supabase client with the remember-me storage wired in.\n *\n * A factory, not a module singleton reading `import.meta.env`: a package cannot\n * know what an app calls its environment variables, and a second app would have\n * different ones.\n *\n * @param url - Project URL. Public; it is the API endpoint.\n * @param anonKey - Anon key. Also public — row-level security is the boundary,\n * not the key.\n *\n * @example\n * ```ts\n * export const supabase = createSupabaseClient<Database>(\n * import.meta.env.VITE_SUPABASE_URL,\n * import.meta.env.VITE_SUPABASE_ANON_KEY,\n * )\n * ```\n */\nexport function createSupabaseClient<Database>(\n url: string,\n anonKey: string,\n): SupabaseClient<Database> {\n if (!url) throw new Error('createSupabaseClient: the project URL is missing.')\n if (!anonKey) throw new Error('createSupabaseClient: the anon key is missing.')\n\n return createClient<Database>(url, anonKey, { auth: { storage: rememberAwareStorage } })\n}\n\n/**\n * Teaches `toAppError` to read Postgres.\n *\n * Registered on import rather than exported as a step to remember: importing\n * this module is already the decision to use Supabase.\n */\n/**\n * A PostgREST failure, however it reached us.\n *\n * `instanceof PostgrestError` is the obvious test and it is not enough. The\n * error returned in `{ data, error }` is a plain object — supabase-js builds\n * the class only on the paths that throw — and even where it does construct\n * one, a project holding two copies of `@supabase/postgrest-js` gets two\n * different classes and an `instanceof` that is false against a genuine error.\n *\n * The consequence was silent and total: every database failure fell past this\n * mapper into the generic branch, so `permission denied for table enrollments`\n * — a message naming the table and the missing grant — reached the screen as\n * \"Something went wrong.\" The information was there the whole time.\n *\n * So: the class where it holds, and the shape where it does not. `code` and\n * `message` are what PostgREST always sends; `details` and `hint` are always\n * present as keys, null when empty, which is what separates this from any\n * other object carrying a `code`.\n */\nfunction isPostgrestError(error: unknown): error is PostgrestError {\n if (error instanceof PostgrestError) return true\n if (typeof error !== 'object' || error === null) return false\n\n const candidate = error as Record<string, unknown>\n\n return (\n typeof candidate['message'] === 'string' &&\n typeof candidate['code'] === 'string' &&\n 'details' in candidate &&\n 'hint' in candidate\n )\n}\n\nregisterErrorMapper((error) => {\n if (!isPostgrestError(error)) return null\n\n // 23505 is unique_violation — a second row where the schema allows one. It is\n // a normal outcome of a double tap, not a failure worth an error screen.\n if (error.code === '23505') {\n return new AppError('conflict', 'That already exists.', { cause: error })\n }\n\n if (error.code === 'PGRST116') {\n return new AppError('not-found', 'That could not be found.', { cause: error })\n }\n\n // 42501 is insufficient_privilege and PGRST301/302 are an absent or expired\n // token. All three mean the same thing to a reader — you are not allowed to\n // do this — and none of them mean the app is broken, which is what a generic\n // failure message implies and what sends somebody to the error log.\n if (error.code === '42501' || error.code === 'PGRST301' || error.code === 'PGRST302') {\n return new AppError('denied', 'You are not allowed to do that.', { cause: error })\n }\n\n return new AppError('unknown', error.message, { cause: error })\n})\n"],"mappings":";;;;;;;;;;AAcA,IAAM,eAAe;;;;;;;AAQrB,SAAgB,cAAc,UAAyB;CACrD,IAAI;EACF,aAAa,QAAQ,cAAc,OAAO,QAAQ,CAAC;CACrD,QAAQ,CAER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MAAM,SAAS,cAAc,MAAM,SAAS,YACxE,OAAO,IAAI,SAAS,UAAU,mCAAmC,EAAE,OAAO,MAAM,CAAC;CAGnF,OAAO,IAAI,SAAS,WAAW,MAAM,SAAS,EAAE,OAAO,MAAM,CAAC;AAChE,CAAC"}
|
|
1
|
+
{"version":3,"file":"supabase.js","names":[],"sources":["../src/supabase/auth-errors.ts","../src/supabase/index.ts"],"sourcesContent":["import { isAuthError } from '@supabase/supabase-js'\n\n/**\n * The Supabase auth codes a sign-in screen has to have wording for.\n *\n * Exported so an app can assert its locale files cover them. The list is not\n * every code Supabase can send — it is the ones that are the user's to act on,\n * which is the only kind worth a sentence of its own. Everything else is a\n * fault, and a fault reads the same whatever caused it.\n */\nexport const AUTH_ERROR_CODES = [\n 'invalid_credentials',\n 'email_not_confirmed',\n 'user_already_exists',\n 'email_exists',\n 'weak_password',\n 'over_request_rate_limit',\n 'over_email_send_rate_limit',\n 'signup_disabled',\n 'user_banned',\n] as const\n\nexport type AuthErrorCode = (typeof AUTH_ERROR_CODES)[number]\n\nexport type AuthMessageKeyOptions = {\n /**\n * Codes this app has wording for beyond the shared list.\n *\n * A key is only an improvement on the generic message if something\n * translates it, so widening the list is the app's decision and not the\n * kit's: an app that has not written `authError.validation_failed` is better\n * served by the sentence it has than by a key rendered raw on screen.\n */\n extraCodes?: readonly string[] | undefined\n /** The key returned when nothing matches. */\n fallback?: string | undefined\n}\n\n/**\n * Maps an auth failure to a message key.\n *\n * Returns a key rather than a sentence so the caller translates it at render\n * time — an error stored before a language switch still reads correctly after,\n * which is the whole reason this returns a string that looks unfinished.\n *\n * Recognising a Supabase error is Supabase's business, so the type guard stays\n * on this side of the boundary and the caller only ever sees a key.\n *\n * @example\n * ```ts\n * serverError.value = toAuthMessageKey(error) // 'authError.invalid_credentials'\n * // <p>{{ $t(serverError) }}</p>\n * ```\n */\nexport function toAuthMessageKey(error: unknown, options: AuthMessageKeyOptions = {}): string {\n const { extraCodes = [], fallback = 'authError.generic' } = options\n\n if (!isAuthError(error)) return fallback\n\n const code = error.code\n if (!code) return fallback\n\n const known = (AUTH_ERROR_CODES as readonly string[]).includes(code) || extraCodes.includes(code)\n\n return known ? `authError.${code}` : fallback\n}\n","import { createClient } from '@supabase/supabase-js'\nimport { PostgrestError } from '@supabase/supabase-js'\nimport type { SupabaseClient, SupportedStorage } from '@supabase/supabase-js'\n\nimport { AppError, registerErrorMapper } from '../utils/app-error'\n\nexport { AUTH_ERROR_CODES, toAuthMessageKey } from './auth-errors'\nexport type { AuthErrorCode, AuthMessageKeyOptions } from './auth-errors'\n\n/**\n * The optional Supabase entry.\n *\n * Behind its own export so an app that never touches Supabase downloads none of\n * it — importing this module is what opts in, including to the error mapping\n * registered at the bottom.\n */\n\nconst REMEMBER_KEY = 'rei-remember'\n\n/**\n * Records whether the next session should outlive the tab.\n *\n * Call before signing in: the SDK writes the session as soon as the request\n * succeeds, and this decides where it lands.\n */\nexport function setRememberMe(remember: boolean): void {\n try {\n localStorage.setItem(REMEMBER_KEY, String(remember))\n } catch {\n // Storage blocked; the session will simply not persist.\n }\n}\n\nfunction activeStore(): Storage {\n try {\n return localStorage.getItem(REMEMBER_KEY) === 'false' ? sessionStorage : localStorage\n } catch {\n return sessionStorage\n }\n}\n\n/**\n * Session storage that follows the \"remember me\" choice.\n *\n * Supabase issues a short-lived access token plus a long-lived refresh token.\n * Where the refresh token is kept decides how long a login survives:\n * `localStorage` outlives the browser, `sessionStorage` dies with the tab. On a\n * shared machine that difference is the whole point, so the choice switches the\n * store rather than the token lifetime.\n *\n * Removal clears both, so signing out cannot leave a copy behind.\n */\nconst rememberAwareStorage: SupportedStorage = {\n getItem: (key) => {\n try {\n return activeStore().getItem(key)\n } catch {\n return null\n }\n },\n setItem: (key, value) => {\n try {\n activeStore().setItem(key, value)\n } catch {\n // Storage blocked.\n }\n },\n removeItem: (key) => {\n try {\n localStorage.removeItem(key)\n sessionStorage.removeItem(key)\n } catch {\n // Storage blocked.\n }\n },\n}\n\n/**\n * Builds a typed Supabase client with the remember-me storage wired in.\n *\n * A factory, not a module singleton reading `import.meta.env`: a package cannot\n * know what an app calls its environment variables, and a second app would have\n * different ones.\n *\n * @param url - Project URL. Public; it is the API endpoint.\n * @param anonKey - Anon key. Also public — row-level security is the boundary,\n * not the key.\n *\n * @example\n * ```ts\n * export const supabase = createSupabaseClient<Database>(\n * import.meta.env.VITE_SUPABASE_URL,\n * import.meta.env.VITE_SUPABASE_ANON_KEY,\n * )\n * ```\n */\nexport function createSupabaseClient<Database>(\n url: string,\n anonKey: string,\n): SupabaseClient<Database> {\n if (!url) throw new Error('createSupabaseClient: the project URL is missing.')\n if (!anonKey) throw new Error('createSupabaseClient: the anon key is missing.')\n\n return createClient<Database>(url, anonKey, { auth: { storage: rememberAwareStorage } })\n}\n\n/**\n * Teaches `toAppError` to read Postgres.\n *\n * Registered on import rather than exported as a step to remember: importing\n * this module is already the decision to use Supabase.\n */\n/**\n * A PostgREST failure, however it reached us.\n *\n * `instanceof PostgrestError` is the obvious test and it is not enough. The\n * error returned in `{ data, error }` is a plain object — supabase-js builds\n * the class only on the paths that throw — and even where it does construct\n * one, a project holding two copies of `@supabase/postgrest-js` gets two\n * different classes and an `instanceof` that is false against a genuine error.\n *\n * The consequence was silent and total: every database failure fell past this\n * mapper into the generic branch, so `permission denied for table enrollments`\n * — a message naming the table and the missing grant — reached the screen as\n * \"Something went wrong.\" The information was there the whole time.\n *\n * So: the class where it holds, and the shape where it does not. `code` and\n * `message` are what PostgREST always sends; `details` and `hint` are always\n * present as keys, null when empty, which is what separates this from any\n * other object carrying a `code`.\n */\nfunction isPostgrestError(error: unknown): error is PostgrestError {\n if (error instanceof PostgrestError) return true\n if (typeof error !== 'object' || error === null) return false\n\n const candidate = error as Record<string, unknown>\n\n return (\n typeof candidate['message'] === 'string' &&\n typeof candidate['code'] === 'string' &&\n 'details' in candidate &&\n 'hint' in candidate\n )\n}\n\nregisterErrorMapper((error) => {\n if (!isPostgrestError(error)) return null\n\n // 23505 is unique_violation — a second row where the schema allows one. It is\n // a normal outcome of a double tap, not a failure worth an error screen.\n if (error.code === '23505') {\n return new AppError('conflict', 'That already exists.', { cause: error })\n }\n\n if (error.code === 'PGRST116') {\n return new AppError('not-found', 'That could not be found.', { cause: error })\n }\n\n // 42501 is insufficient_privilege and PGRST301/302 are an absent or expired\n // token. All three mean the same thing to a reader — you are not allowed to\n // do this — and none of them mean the app is broken, which is what a generic\n // failure message implies and what sends somebody to the error log.\n if (error.code === '42501' || error.code === 'PGRST301' || error.code === 'PGRST302') {\n return new AppError('denied', 'You are not allowed to do that.', { cause: error })\n }\n\n return new AppError('unknown', error.message, { cause: error })\n})\n"],"mappings":";;;;;;;;;;;AAUA,IAAa,mBAAmB;CAC9B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;;;;;;;;;;;;;;;;;AAkCA,SAAgB,iBAAiB,OAAgB,UAAiC,CAAC,GAAW;CAC5F,MAAM,EAAE,aAAa,CAAC,GAAG,WAAW,wBAAwB;CAE5D,IAAI,CAAC,YAAY,KAAK,GAAG,OAAO;CAEhC,MAAM,OAAO,MAAM;CACnB,IAAI,CAAC,MAAM,OAAO;CAIlB,OAFe,iBAAuC,SAAS,IAAI,KAAK,WAAW,SAAS,IAAI,IAEjF,aAAa,SAAS;AACvC;;;;;;;;;;AChDA,IAAM,eAAe;;;;;;;AAQrB,SAAgB,cAAc,UAAyB;CACrD,IAAI;EACF,aAAa,QAAQ,cAAc,OAAO,QAAQ,CAAC;CACrD,QAAQ,CAER;AACF;AAEA,SAAS,cAAuB;CAC9B,IAAI;EACF,OAAO,aAAa,QAAQ,YAAY,MAAM,UAAU,iBAAiB;CAC3E,QAAQ;EACN,OAAO;CACT;AACF;;;;;;;;;;;;AAaA,IAAM,uBAAyC;CAC7C,UAAU,QAAQ;EAChB,IAAI;GACF,OAAO,YAAY,CAAC,CAAC,QAAQ,GAAG;EAClC,QAAQ;GACN,OAAO;EACT;CACF;CACA,UAAU,KAAK,UAAU;EAC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
2
|
-
import { Teleport, Transition, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createVNode, defineComponent, mergeModels, nextTick, normalizeStyle, onScopeDispose, onUnmounted, openBlock, readonly, ref, renderSlot, toDisplayString, unref, useModel, watch, withCtx } from "vue";
|
|
3
|
-
import { X } from "lucide-vue-next";
|
|
4
|
-
//#region src/composables/use-theme.ts
|
|
5
|
-
/**
|
|
6
|
-
* Namespaced by the app, not by this package.
|
|
7
|
-
*
|
|
8
|
-
* Two rei-kit apps served from the same origin would otherwise share one theme
|
|
9
|
-
* setting — and during development on localhost, they will be.
|
|
10
|
-
*/
|
|
11
|
-
var storageKey = "rei-theme";
|
|
12
|
-
function isThemePreference(value) {
|
|
13
|
-
return value === "system" || value === "light" || value === "dark";
|
|
14
|
-
}
|
|
15
|
-
/** Reads the stored preference, falling back to `system`. */
|
|
16
|
-
function readStoredTheme() {
|
|
17
|
-
try {
|
|
18
|
-
const stored = localStorage.getItem(storageKey);
|
|
19
|
-
return isThemePreference(stored) ? stored : "system";
|
|
20
|
-
} catch {
|
|
21
|
-
return "system";
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
function storeTheme(preference) {
|
|
25
|
-
try {
|
|
26
|
-
localStorage.setItem(storageKey, preference);
|
|
27
|
-
} catch {}
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Does the environment prefer a dark scheme?
|
|
31
|
-
*
|
|
32
|
-
* `matchMedia` is checked for on its own rather than inferred from `document`.
|
|
33
|
-
* Having one does not imply having the other: jsdom supplies a document and no
|
|
34
|
-
* `matchMedia`, so a consumer's component test that so much as mounts something
|
|
35
|
-
* calling `useTheme` threw — and some embedded webviews are the same. Where
|
|
36
|
-
* there is nothing to ask, the answer is no rather than an exception.
|
|
37
|
-
*/
|
|
38
|
-
function prefersDarkScheme() {
|
|
39
|
-
return typeof window !== "undefined" && typeof window.matchMedia === "function" ? window.matchMedia("(prefers-color-scheme: dark)").matches : false;
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* Adds or removes `.dark` on `<html>`, resolving `system` against the OS.
|
|
43
|
-
*
|
|
44
|
-
* A no-op without a document. There is no OS preference to read on a server and
|
|
45
|
-
* no `<html>` to write to, so a prerender leaves the class off and the app
|
|
46
|
-
* decides the theme before hydration — see the note in the README.
|
|
47
|
-
*/
|
|
48
|
-
function applyTheme(preference) {
|
|
49
|
-
if (typeof document === "undefined") return;
|
|
50
|
-
const isDark = preference === "dark" || preference === "system" && prefersDarkScheme();
|
|
51
|
-
document.documentElement.classList.toggle("dark", isDark);
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
54
|
-
* The shared preference, created on first use rather than at import.
|
|
55
|
-
*
|
|
56
|
-
* Lazy on purpose: reading storage at import time would lock in the default key
|
|
57
|
-
* before an app had a chance to set its own, leaving the controller reading one
|
|
58
|
-
* key and writing another.
|
|
59
|
-
*/
|
|
60
|
-
var preference = null;
|
|
61
|
-
function controller() {
|
|
62
|
-
if (preference) return preference;
|
|
63
|
-
preference = ref(readStoredTheme());
|
|
64
|
-
watch(preference, (next) => {
|
|
65
|
-
storeTheme(next);
|
|
66
|
-
applyTheme(next);
|
|
67
|
-
}, { immediate: true });
|
|
68
|
-
if (typeof window !== "undefined" && typeof window.matchMedia === "function") window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change", () => {
|
|
69
|
-
if (preference?.value === "system") applyTheme("system");
|
|
70
|
-
});
|
|
71
|
-
return preference;
|
|
72
|
-
}
|
|
73
|
-
/**
|
|
74
|
-
* Sets where the preference is stored.
|
|
75
|
-
*
|
|
76
|
-
* Safe in either order: called before the first `useTheme()` it simply changes
|
|
77
|
-
* the key, and called after it re-reads under the new one, so the controller
|
|
78
|
-
* never reads from one key while writing to another.
|
|
79
|
-
*
|
|
80
|
-
* @example
|
|
81
|
-
* ```ts
|
|
82
|
-
* setThemeStorageKey('hibi-theme') // once, at startup
|
|
83
|
-
* ```
|
|
84
|
-
*/
|
|
85
|
-
function setThemeStorageKey(key) {
|
|
86
|
-
storageKey = key;
|
|
87
|
-
if (preference) preference.value = readStoredTheme();
|
|
88
|
-
}
|
|
89
|
-
/** @returns The shared preference ref; assigning to it stores and applies it. */
|
|
90
|
-
function useTheme() {
|
|
91
|
-
return controller();
|
|
92
|
-
}
|
|
93
|
-
//#endregion
|
|
94
|
-
//#region src/composables/use-visual-viewport.ts
|
|
95
|
-
/**
|
|
96
|
-
* Tracks the visual viewport.
|
|
97
|
-
*
|
|
98
|
-
* Chrome and Android browsers honour `interactive-widget=resizes-content`, so
|
|
99
|
-
* the layout viewport already shrinks for the keyboard there. Safari on iOS
|
|
100
|
-
* does not implement it: it shrinks only the *visual* viewport, leaving a sheet
|
|
101
|
-
* sized in `dvh` sitting partly underneath the keyboard.
|
|
102
|
-
*
|
|
103
|
-
* `null` means the API is unavailable, which callers should read as "trust the
|
|
104
|
-
* layout viewport" rather than as zero. A server has no viewport at all, so it
|
|
105
|
-
* gets that same `null` — this runs during `setup`, and a component using it
|
|
106
|
-
* has to survive being rendered there.
|
|
107
|
-
*
|
|
108
|
-
* @example
|
|
109
|
-
* ```ts
|
|
110
|
-
* const viewport = useVisualViewport()
|
|
111
|
-
* // :style="viewport ? { height: `${viewport.height}px` } : undefined"
|
|
112
|
-
* ```
|
|
113
|
-
*/
|
|
114
|
-
function useVisualViewport() {
|
|
115
|
-
const rect = ref(null);
|
|
116
|
-
const viewport = typeof window === "undefined" ? void 0 : window.visualViewport;
|
|
117
|
-
if (!viewport) return readonly(rect);
|
|
118
|
-
function read() {
|
|
119
|
-
if (!viewport) return;
|
|
120
|
-
rect.value = {
|
|
121
|
-
height: viewport.height,
|
|
122
|
-
offsetTop: viewport.offsetTop
|
|
123
|
-
};
|
|
124
|
-
}
|
|
125
|
-
read();
|
|
126
|
-
viewport.addEventListener("resize", read);
|
|
127
|
-
viewport.addEventListener("scroll", read);
|
|
128
|
-
onScopeDispose(() => {
|
|
129
|
-
viewport.removeEventListener("resize", read);
|
|
130
|
-
viewport.removeEventListener("scroll", read);
|
|
131
|
-
});
|
|
132
|
-
return readonly(rect);
|
|
133
|
-
}
|
|
134
|
-
//#endregion
|
|
135
|
-
//#region src/components/BaseSheet.vue?vue&type=script&setup=true&lang.ts
|
|
136
|
-
var _hoisted_1 = { class: "shell-frame md:rounded-shell relative flex max-h-full flex-col justify-end overflow-hidden" };
|
|
137
|
-
var _hoisted_2 = ["aria-label"];
|
|
138
|
-
var _hoisted_3 = { class: "flex shrink-0 items-start gap-3 px-6 pt-4 pb-5" };
|
|
139
|
-
var _hoisted_4 = { class: "min-w-0 flex-1" };
|
|
140
|
-
var _hoisted_5 = { class: "text-ink text-xl leading-tight font-semibold" };
|
|
141
|
-
var _hoisted_6 = {
|
|
142
|
-
key: 0,
|
|
143
|
-
class: "text-ink-soft mt-1 text-sm leading-snug"
|
|
144
|
-
};
|
|
145
|
-
var _hoisted_7 = { class: "min-h-0 flex-1 overflow-y-auto px-6 pb-[calc(2rem+env(safe-area-inset-bottom,0px))]" };
|
|
146
|
-
//#endregion
|
|
147
|
-
//#region src/components/BaseSheet.vue
|
|
148
|
-
var BaseSheet_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
|
|
149
|
-
__name: "BaseSheet",
|
|
150
|
-
props: /*@__PURE__*/ mergeModels({
|
|
151
|
-
title: {},
|
|
152
|
-
subtitle: { default: "" },
|
|
153
|
-
closeLabel: { default: "Close" }
|
|
154
|
-
}, {
|
|
155
|
-
"modelValue": {
|
|
156
|
-
type: Boolean,
|
|
157
|
-
required: true
|
|
158
|
-
},
|
|
159
|
-
"modelModifiers": {}
|
|
160
|
-
}),
|
|
161
|
-
emits: ["update:modelValue"],
|
|
162
|
-
setup(__props) {
|
|
163
|
-
const open = useModel(__props, "modelValue");
|
|
164
|
-
const viewport = useVisualViewport();
|
|
165
|
-
/**
|
|
166
|
-
* Pins the sheet to the area the keyboard has left visible.
|
|
167
|
-
*
|
|
168
|
-
* Only needed where the layout viewport does not shrink on its own — iOS. On
|
|
169
|
-
* Android the numbers already agree, so this is a no-op there rather than a
|
|
170
|
-
* second, competing adjustment.
|
|
171
|
-
*/
|
|
172
|
-
const viewportStyle = computed(() => viewport.value ? {
|
|
173
|
-
height: `${viewport.value.height}px`,
|
|
174
|
-
top: `${viewport.value.offsetTop}px`
|
|
175
|
-
} : void 0);
|
|
176
|
-
const panel = ref(null);
|
|
177
|
-
let lastFocused = null;
|
|
178
|
-
function close() {
|
|
179
|
-
open.value = false;
|
|
180
|
-
}
|
|
181
|
-
function onKeydown(event) {
|
|
182
|
-
if (event.key === "Escape") close();
|
|
183
|
-
}
|
|
184
|
-
watch(open, async (isOpen) => {
|
|
185
|
-
if (isOpen) {
|
|
186
|
-
setBackgroundInert(true);
|
|
187
|
-
lastFocused = document.activeElement instanceof HTMLElement ? document.activeElement : null;
|
|
188
|
-
window.addEventListener("keydown", onKeydown);
|
|
189
|
-
await nextTick();
|
|
190
|
-
panel.value?.focus();
|
|
191
|
-
} else {
|
|
192
|
-
window.removeEventListener("keydown", onKeydown);
|
|
193
|
-
lastFocused?.focus();
|
|
194
|
-
lastFocused = null;
|
|
195
|
-
setBackgroundInert(false);
|
|
196
|
-
}
|
|
197
|
-
});
|
|
198
|
-
/**
|
|
199
|
-
* `inert` takes the whole app out of tab order and pointer events while the
|
|
200
|
-
* sheet is open — a real focus trap without keydown bookkeeping.
|
|
201
|
-
*
|
|
202
|
-
* The sheet itself is teleported to `#sheet-root`, a sibling of `#app`, so it
|
|
203
|
-
* stays interactive.
|
|
204
|
-
*/
|
|
205
|
-
function setBackgroundInert(isInert) {
|
|
206
|
-
document.getElementById("app")?.toggleAttribute("inert", isInert);
|
|
207
|
-
}
|
|
208
|
-
onUnmounted(() => {
|
|
209
|
-
window.removeEventListener("keydown", onKeydown);
|
|
210
|
-
setBackgroundInert(false);
|
|
211
|
-
});
|
|
212
|
-
return (_ctx, _cache) => {
|
|
213
|
-
return openBlock(), createBlock(Teleport, { to: "#sheet-root" }, [createVNode(Transition, { name: "sheet" }, {
|
|
214
|
-
default: withCtx(() => [open.value ? (openBlock(), createElementBlock("div", {
|
|
215
|
-
key: 0,
|
|
216
|
-
class: "fixed inset-x-0 top-0 bottom-0 z-50 flex items-center justify-center",
|
|
217
|
-
style: normalizeStyle(viewportStyle.value)
|
|
218
|
-
}, [createElementVNode("div", _hoisted_1, [createElementVNode("div", {
|
|
219
|
-
class: "bg-ink/45 absolute inset-0 backdrop-blur-[2px]",
|
|
220
|
-
onClick: close
|
|
221
|
-
}), createElementVNode("section", {
|
|
222
|
-
ref_key: "panel",
|
|
223
|
-
ref: panel,
|
|
224
|
-
role: "dialog",
|
|
225
|
-
"aria-modal": "true",
|
|
226
|
-
"aria-label": __props.title,
|
|
227
|
-
tabindex: "-1",
|
|
228
|
-
class: "sheet-panel bg-surface relative flex max-h-[94%] min-h-[56dvh] flex-col rounded-t-[28px] shadow-2xl outline-none"
|
|
229
|
-
}, [
|
|
230
|
-
_cache[0] || (_cache[0] = createElementVNode("div", {
|
|
231
|
-
class: "flex shrink-0 justify-center pt-3",
|
|
232
|
-
"aria-hidden": "true"
|
|
233
|
-
}, [createElementVNode("span", { class: "bg-hair h-1.5 w-10 rounded-full" })], -1)),
|
|
234
|
-
createElementVNode("header", _hoisted_3, [createElementVNode("div", _hoisted_4, [createElementVNode("h2", _hoisted_5, toDisplayString(__props.title), 1), __props.subtitle ? (openBlock(), createElementBlock("p", _hoisted_6, toDisplayString(__props.subtitle), 1)) : createCommentVNode("", true)]), createVNode(BaseButton_default, {
|
|
235
|
-
variant: "unstyled",
|
|
236
|
-
class: "text-ink-soft hover:bg-muted hover:text-ink -mt-1 flex size-10 shrink-0 items-center justify-center rounded-full transition-colors active:scale-90",
|
|
237
|
-
"aria-label": __props.closeLabel,
|
|
238
|
-
onClick: close
|
|
239
|
-
}, {
|
|
240
|
-
default: withCtx(() => [createVNode(unref(X), { class: "size-5" })]),
|
|
241
|
-
_: 1
|
|
242
|
-
}, 8, ["aria-label"])]),
|
|
243
|
-
createElementVNode("div", _hoisted_7, [renderSlot(_ctx.$slots, "default", {}, void 0, true)])
|
|
244
|
-
], 8, _hoisted_2)])], 4)) : createCommentVNode("", true)]),
|
|
245
|
-
_: 3
|
|
246
|
-
})]);
|
|
247
|
-
};
|
|
248
|
-
}
|
|
249
|
-
}), [["__scopeId", "data-v-51709579"]]);
|
|
250
|
-
//#endregion
|
|
251
|
-
export { readStoredTheme as a, isThemePreference as i, useVisualViewport as n, setThemeStorageKey as o, applyTheme as r, useTheme as s, BaseSheet_default as t };
|
|
252
|
-
|
|
253
|
-
//# sourceMappingURL=BaseSheet-CLIhXDwe.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"BaseSheet-CLIhXDwe.js","names":[],"sources":["../src/composables/use-theme.ts","../src/composables/use-visual-viewport.ts","../src/components/BaseSheet.vue","../src/components/BaseSheet.vue"],"sourcesContent":["import { ref, watch } from 'vue'\nimport type { Ref } from 'vue'\n\n/** What the user asked for; `system` follows the OS. */\nexport type ThemePreference = 'system' | 'light' | 'dark'\n\n/**\n * Namespaced by the app, not by this package.\n *\n * Two rei-kit apps served from the same origin would otherwise share one theme\n * setting — and during development on localhost, they will be.\n */\nlet storageKey = 'rei-theme'\n\nexport function isThemePreference(value: unknown): value is ThemePreference {\n return value === 'system' || value === 'light' || value === 'dark'\n}\n\n/** Reads the stored preference, falling back to `system`. */\nexport function readStoredTheme(): ThemePreference {\n try {\n const stored = localStorage.getItem(storageKey)\n\n return isThemePreference(stored) ? stored : 'system'\n } catch {\n return 'system'\n }\n}\n\nfunction storeTheme(preference: ThemePreference): void {\n try {\n localStorage.setItem(storageKey, preference)\n } catch {\n // Private mode or blocked storage: the choice just will not persist.\n }\n}\n\n/**\n * Does the environment prefer a dark scheme?\n *\n * `matchMedia` is checked for on its own rather than inferred from `document`.\n * Having one does not imply having the other: jsdom supplies a document and no\n * `matchMedia`, so a consumer's component test that so much as mounts something\n * calling `useTheme` threw — and some embedded webviews are the same. Where\n * there is nothing to ask, the answer is no rather than an exception.\n */\nfunction prefersDarkScheme(): boolean {\n return typeof window !== 'undefined' && typeof window.matchMedia === 'function'\n ? window.matchMedia('(prefers-color-scheme: dark)').matches\n : false\n}\n\n/**\n * Adds or removes `.dark` on `<html>`, resolving `system` against the OS.\n *\n * A no-op without a document. There is no OS preference to read on a server and\n * no `<html>` to write to, so a prerender leaves the class off and the app\n * decides the theme before hydration — see the note in the README.\n */\nexport function applyTheme(preference: ThemePreference): void {\n if (typeof document === 'undefined') return\n\n const isDark = preference === 'dark' || (preference === 'system' && prefersDarkScheme())\n\n document.documentElement.classList.toggle('dark', isDark)\n}\n\n/**\n * The shared preference, created on first use rather than at import.\n *\n * Lazy on purpose: reading storage at import time would lock in the default key\n * before an app had a chance to set its own, leaving the controller reading one\n * key and writing another.\n */\nlet preference: Ref<ThemePreference> | null = null\n\nfunction controller(): Ref<ThemePreference> {\n if (preference) return preference\n\n preference = ref<ThemePreference>(readStoredTheme())\n\n watch(\n preference,\n (next) => {\n storeTheme(next)\n applyTheme(next)\n },\n { immediate: true },\n )\n\n // While on `system`, follow the OS if the user flips it at night. Only where\n // there is something to listen to; see `prefersDarkScheme`.\n if (typeof window !== 'undefined' && typeof window.matchMedia === 'function') {\n window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', () => {\n if (preference?.value === 'system') applyTheme('system')\n })\n }\n\n return preference\n}\n\n/**\n * Sets where the preference is stored.\n *\n * Safe in either order: called before the first `useTheme()` it simply changes\n * the key, and called after it re-reads under the new one, so the controller\n * never reads from one key while writing to another.\n *\n * @example\n * ```ts\n * setThemeStorageKey('hibi-theme') // once, at startup\n * ```\n */\nexport function setThemeStorageKey(key: string): void {\n storageKey = key\n if (preference) preference.value = readStoredTheme()\n}\n\n/** @returns The shared preference ref; assigning to it stores and applies it. */\nexport function useTheme(): Ref<ThemePreference> {\n return controller()\n}\n","import { onScopeDispose, readonly, ref } from 'vue'\n\n/** The visible area, once the on-screen keyboard has taken its share. */\nexport interface VisualViewportRect {\n height: number\n offsetTop: number\n}\n\n/**\n * Tracks the visual viewport.\n *\n * Chrome and Android browsers honour `interactive-widget=resizes-content`, so\n * the layout viewport already shrinks for the keyboard there. Safari on iOS\n * does not implement it: it shrinks only the *visual* viewport, leaving a sheet\n * sized in `dvh` sitting partly underneath the keyboard.\n *\n * `null` means the API is unavailable, which callers should read as \"trust the\n * layout viewport\" rather than as zero. A server has no viewport at all, so it\n * gets that same `null` — this runs during `setup`, and a component using it\n * has to survive being rendered there.\n *\n * @example\n * ```ts\n * const viewport = useVisualViewport()\n * // :style=\"viewport ? { height: `${viewport.height}px` } : undefined\"\n * ```\n */\nexport function useVisualViewport() {\n const rect = ref<VisualViewportRect | null>(null)\n\n const viewport = typeof window === 'undefined' ? undefined : window.visualViewport\n if (!viewport) return readonly(rect)\n\n function read() {\n if (!viewport) return\n\n rect.value = { height: viewport.height, offsetTop: viewport.offsetTop }\n }\n\n read()\n\n // `scroll` matters as much as `resize`: iOS shifts the visual viewport up to\n // keep the focused field visible, without changing its height.\n viewport.addEventListener('resize', read)\n viewport.addEventListener('scroll', read)\n\n onScopeDispose(() => {\n viewport.removeEventListener('resize', read)\n viewport.removeEventListener('scroll', read)\n })\n\n return readonly(rect)\n}\n","<script setup lang=\"ts\">\nimport BaseButton from './BaseButton.vue'\nimport { computed, nextTick, onUnmounted, ref, watch } from 'vue'\nimport { X } from 'lucide-vue-next'\n\nimport { useVisualViewport } from '../composables/use-visual-viewport'\n\nconst open = defineModel<boolean>({ required: true })\nconst {\n title,\n subtitle = '',\n closeLabel = 'Close',\n} = defineProps<{\n title: string\n subtitle?: string | undefined\n /**\n * Accessible name for the close button.\n *\n * A prop rather than a translation: a component that calls t() forces every\n * consumer onto one i18n setup, and this is the package's only visible string.\n */\n closeLabel?: string | undefined\n}>()\n\nconst viewport = useVisualViewport()\n\n/**\n * Pins the sheet to the area the keyboard has left visible.\n *\n * Only needed where the layout viewport does not shrink on its own — iOS. On\n * Android the numbers already agree, so this is a no-op there rather than a\n * second, competing adjustment.\n */\nconst viewportStyle = computed(() =>\n viewport.value\n ? { height: `${viewport.value.height}px`, top: `${viewport.value.offsetTop}px` }\n : undefined,\n)\n\nconst panel = ref<HTMLElement | null>(null)\nlet lastFocused: HTMLElement | null = null\n\nfunction close() {\n open.value = false\n}\n\nfunction onKeydown(event: KeyboardEvent) {\n if (event.key === 'Escape') close()\n}\n\nwatch(open, async (isOpen) => {\n if (isOpen) {\n setBackgroundInert(true)\n lastFocused = document.activeElement instanceof HTMLElement ? document.activeElement : null\n window.addEventListener('keydown', onKeydown)\n await nextTick()\n panel.value?.focus()\n } else {\n window.removeEventListener('keydown', onKeydown)\n lastFocused?.focus()\n lastFocused = null\n setBackgroundInert(false)\n }\n})\n\n/**\n * `inert` takes the whole app out of tab order and pointer events while the\n * sheet is open — a real focus trap without keydown bookkeeping.\n *\n * The sheet itself is teleported to `#sheet-root`, a sibling of `#app`, so it\n * stays interactive.\n */\nfunction setBackgroundInert(isInert: boolean) {\n document.getElementById('app')?.toggleAttribute('inert', isInert)\n}\n\nonUnmounted(() => {\n window.removeEventListener('keydown', onKeydown)\n // Unmounting while open would otherwise leave the whole app inert forever.\n setBackgroundInert(false)\n})\n</script>\n\n<template>\n <Teleport to=\"#sheet-root\">\n <Transition name=\"sheet\">\n <div\n v-if=\"open\"\n class=\"fixed inset-x-0 top-0 bottom-0 z-50 flex items-center justify-center\"\n :style=\"viewportStyle\"\n >\n <div\n class=\"shell-frame md:rounded-shell relative flex max-h-full flex-col justify-end overflow-hidden\"\n >\n <div class=\"bg-ink/45 absolute inset-0 backdrop-blur-[2px]\" @click=\"close\" />\n\n <!-- Header and footer stay put; only the slot scrolls. Sized in dvh so\n the on-screen keyboard shrinks the sheet instead of pushing its\n content out of reach. -->\n <section\n ref=\"panel\"\n role=\"dialog\"\n aria-modal=\"true\"\n :aria-label=\"title\"\n tabindex=\"-1\"\n class=\"sheet-panel bg-surface relative flex max-h-[94%] min-h-[56dvh] flex-col rounded-t-[28px] shadow-2xl outline-none\"\n >\n <div class=\"flex shrink-0 justify-center pt-3\" aria-hidden=\"true\">\n <span class=\"bg-hair h-1.5 w-10 rounded-full\" />\n </div>\n\n <header class=\"flex shrink-0 items-start gap-3 px-6 pt-4 pb-5\">\n <div class=\"min-w-0 flex-1\">\n <h2 class=\"text-ink text-xl leading-tight font-semibold\">{{ title }}</h2>\n <p v-if=\"subtitle\" class=\"text-ink-soft mt-1 text-sm leading-snug\">\n {{ subtitle }}\n </p>\n </div>\n\n <!-- `unstyled`, so the sheet keeps the exact button it had. What it\n gains is the focus ring it never had: this was a raw\n `<button>` with no `focus-visible` rule, so closing a sheet\n from the keyboard was invisible. -->\n <BaseButton\n variant=\"unstyled\"\n class=\"text-ink-soft hover:bg-muted hover:text-ink -mt-1 flex size-10 shrink-0 items-center justify-center rounded-full transition-colors active:scale-90\"\n :aria-label=\"closeLabel\"\n @click=\"close\"\n >\n <X class=\"size-5\" />\n </BaseButton>\n </header>\n\n <div\n class=\"min-h-0 flex-1 overflow-y-auto px-6 pb-[calc(2rem+env(safe-area-inset-bottom,0px))]\"\n >\n <slot />\n </div>\n </section>\n </div>\n </div>\n </Transition>\n </Teleport>\n</template>\n\n<style scoped>\n.sheet-enter-active,\n.sheet-leave-active {\n transition: opacity 200ms ease;\n}\n.sheet-enter-from,\n.sheet-leave-to {\n opacity: 0;\n}\n\n/* The panel travels further than the scrim fades, which is what makes the\n sheet read as rising rather than appearing. */\n.sheet-enter-active .sheet-panel,\n.sheet-leave-active .sheet-panel {\n transition: transform 280ms cubic-bezier(0.32, 0.72, 0, 1);\n}\n.sheet-enter-from .sheet-panel,\n.sheet-leave-to .sheet-panel {\n transform: translateY(6%);\n}\n\n@media (prefers-reduced-motion: reduce) {\n .sheet-enter-from .sheet-panel,\n .sheet-leave-to .sheet-panel {\n transform: none;\n }\n}\n</style>\n","<script setup lang=\"ts\">\nimport BaseButton from './BaseButton.vue'\nimport { computed, nextTick, onUnmounted, ref, watch } from 'vue'\nimport { X } from 'lucide-vue-next'\n\nimport { useVisualViewport } from '../composables/use-visual-viewport'\n\nconst open = defineModel<boolean>({ required: true })\nconst {\n title,\n subtitle = '',\n closeLabel = 'Close',\n} = defineProps<{\n title: string\n subtitle?: string | undefined\n /**\n * Accessible name for the close button.\n *\n * A prop rather than a translation: a component that calls t() forces every\n * consumer onto one i18n setup, and this is the package's only visible string.\n */\n closeLabel?: string | undefined\n}>()\n\nconst viewport = useVisualViewport()\n\n/**\n * Pins the sheet to the area the keyboard has left visible.\n *\n * Only needed where the layout viewport does not shrink on its own — iOS. On\n * Android the numbers already agree, so this is a no-op there rather than a\n * second, competing adjustment.\n */\nconst viewportStyle = computed(() =>\n viewport.value\n ? { height: `${viewport.value.height}px`, top: `${viewport.value.offsetTop}px` }\n : undefined,\n)\n\nconst panel = ref<HTMLElement | null>(null)\nlet lastFocused: HTMLElement | null = null\n\nfunction close() {\n open.value = false\n}\n\nfunction onKeydown(event: KeyboardEvent) {\n if (event.key === 'Escape') close()\n}\n\nwatch(open, async (isOpen) => {\n if (isOpen) {\n setBackgroundInert(true)\n lastFocused = document.activeElement instanceof HTMLElement ? document.activeElement : null\n window.addEventListener('keydown', onKeydown)\n await nextTick()\n panel.value?.focus()\n } else {\n window.removeEventListener('keydown', onKeydown)\n lastFocused?.focus()\n lastFocused = null\n setBackgroundInert(false)\n }\n})\n\n/**\n * `inert` takes the whole app out of tab order and pointer events while the\n * sheet is open — a real focus trap without keydown bookkeeping.\n *\n * The sheet itself is teleported to `#sheet-root`, a sibling of `#app`, so it\n * stays interactive.\n */\nfunction setBackgroundInert(isInert: boolean) {\n document.getElementById('app')?.toggleAttribute('inert', isInert)\n}\n\nonUnmounted(() => {\n window.removeEventListener('keydown', onKeydown)\n // Unmounting while open would otherwise leave the whole app inert forever.\n setBackgroundInert(false)\n})\n</script>\n\n<template>\n <Teleport to=\"#sheet-root\">\n <Transition name=\"sheet\">\n <div\n v-if=\"open\"\n class=\"fixed inset-x-0 top-0 bottom-0 z-50 flex items-center justify-center\"\n :style=\"viewportStyle\"\n >\n <div\n class=\"shell-frame md:rounded-shell relative flex max-h-full flex-col justify-end overflow-hidden\"\n >\n <div class=\"bg-ink/45 absolute inset-0 backdrop-blur-[2px]\" @click=\"close\" />\n\n <!-- Header and footer stay put; only the slot scrolls. Sized in dvh so\n the on-screen keyboard shrinks the sheet instead of pushing its\n content out of reach. -->\n <section\n ref=\"panel\"\n role=\"dialog\"\n aria-modal=\"true\"\n :aria-label=\"title\"\n tabindex=\"-1\"\n class=\"sheet-panel bg-surface relative flex max-h-[94%] min-h-[56dvh] flex-col rounded-t-[28px] shadow-2xl outline-none\"\n >\n <div class=\"flex shrink-0 justify-center pt-3\" aria-hidden=\"true\">\n <span class=\"bg-hair h-1.5 w-10 rounded-full\" />\n </div>\n\n <header class=\"flex shrink-0 items-start gap-3 px-6 pt-4 pb-5\">\n <div class=\"min-w-0 flex-1\">\n <h2 class=\"text-ink text-xl leading-tight font-semibold\">{{ title }}</h2>\n <p v-if=\"subtitle\" class=\"text-ink-soft mt-1 text-sm leading-snug\">\n {{ subtitle }}\n </p>\n </div>\n\n <!-- `unstyled`, so the sheet keeps the exact button it had. What it\n gains is the focus ring it never had: this was a raw\n `<button>` with no `focus-visible` rule, so closing a sheet\n from the keyboard was invisible. -->\n <BaseButton\n variant=\"unstyled\"\n class=\"text-ink-soft hover:bg-muted hover:text-ink -mt-1 flex size-10 shrink-0 items-center justify-center rounded-full transition-colors active:scale-90\"\n :aria-label=\"closeLabel\"\n @click=\"close\"\n >\n <X class=\"size-5\" />\n </BaseButton>\n </header>\n\n <div\n class=\"min-h-0 flex-1 overflow-y-auto px-6 pb-[calc(2rem+env(safe-area-inset-bottom,0px))]\"\n >\n <slot />\n </div>\n </section>\n </div>\n </div>\n </Transition>\n </Teleport>\n</template>\n\n<style scoped>\n.sheet-enter-active,\n.sheet-leave-active {\n transition: opacity 200ms ease;\n}\n.sheet-enter-from,\n.sheet-leave-to {\n opacity: 0;\n}\n\n/* The panel travels further than the scrim fades, which is what makes the\n sheet read as rising rather than appearing. */\n.sheet-enter-active .sheet-panel,\n.sheet-leave-active .sheet-panel {\n transition: transform 280ms cubic-bezier(0.32, 0.72, 0, 1);\n}\n.sheet-enter-from .sheet-panel,\n.sheet-leave-to .sheet-panel {\n transform: translateY(6%);\n}\n\n@media (prefers-reduced-motion: reduce) {\n .sheet-enter-from .sheet-panel,\n .sheet-leave-to .sheet-panel {\n transform: none;\n }\n}\n</style>\n"],"mappings":";;;;;;;;;;AAYA,IAAI,aAAa;AAEjB,SAAgB,kBAAkB,OAA0C;CAC1E,OAAO,UAAU,YAAY,UAAU,WAAW,UAAU;AAC9D;;AAGA,SAAgB,kBAAmC;CACjD,IAAI;EACF,MAAM,SAAS,aAAa,QAAQ,UAAU;EAE9C,OAAO,kBAAkB,MAAM,IAAI,SAAS;CAC9C,QAAQ;EACN,OAAO;CACT;AACF;AAEA,SAAS,WAAW,YAAmC;CACrD,IAAI;EACF,aAAa,QAAQ,YAAY,UAAU;CAC7C,QAAQ,CAER;AACF;;;;;;;;;;AAWA,SAAS,oBAA6B;CACpC,OAAO,OAAO,WAAW,eAAe,OAAO,OAAO,eAAe,aACjE,OAAO,WAAW,8BAA8B,CAAC,CAAC,UAClD;AACN;;;;;;;;AASA,SAAgB,WAAW,YAAmC;CAC5D,IAAI,OAAO,aAAa,aAAa;CAErC,MAAM,SAAS,eAAe,UAAW,eAAe,YAAY,kBAAkB;CAEtF,SAAS,gBAAgB,UAAU,OAAO,QAAQ,MAAM;AAC1D;;;;;;;;AASA,IAAI,aAA0C;AAE9C,SAAS,aAAmC;CAC1C,IAAI,YAAY,OAAO;CAEvB,aAAa,IAAqB,gBAAgB,CAAC;CAEnD,MACE,aACC,SAAS;EACR,WAAW,IAAI;EACf,WAAW,IAAI;CACjB,GACA,EAAE,WAAW,KAAK,CACpB;CAIA,IAAI,OAAO,WAAW,eAAe,OAAO,OAAO,eAAe,YAChE,OAAO,WAAW,8BAA8B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