@molecule/app-auth-shell-vue 0.0.0-stage → 1.1.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/LICENSE +202 -0
- package/README.md +887 -2
- package/dist/AuthFormStateProvider.d.ts +42 -0
- package/dist/AuthFormStateProvider.d.ts.map +1 -0
- package/dist/AuthFormStateProvider.js +56 -0
- package/dist/AuthFormStateProvider.js.map +1 -0
- package/dist/AuthShell.d.ts +236 -0
- package/dist/AuthShell.d.ts.map +1 -0
- package/dist/AuthShell.js +303 -0
- package/dist/AuthShell.js.map +1 -0
- package/dist/index.d.ts +85 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +85 -0
- package/dist/index.js.map +1 -0
- package/dist/types.d.ts +153 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +9 -0
- package/dist/types.js.map +1 -0
- package/dist/useAuthFormState.d.ts +29 -0
- package/dist/useAuthFormState.d.ts.map +1 -0
- package/dist/useAuthFormState.js +124 -0
- package/dist/useAuthFormState.js.map +1 -0
- package/package.json +69 -4
package/README.md
CHANGED
|
@@ -1,3 +1,888 @@
|
|
|
1
|
-
|
|
1
|
+
<!--
|
|
2
|
+
AUTO-GENERATED — DO NOT EDIT THIS FILE.
|
|
3
|
+
Generated by `mlcl sync-docs` from the package's src/index.ts JSDoc + mlcl/registry.json.
|
|
4
|
+
Edits here are overwritten on the next commit (molecule's pre-commit hook regenerates).
|
|
5
|
+
To change this document, edit the module-level JSDoc in src/index.ts.
|
|
6
|
+
Generated: 2026-11-18T23:41:36.029Z
|
|
7
|
+
-->
|
|
2
8
|
|
|
3
|
-
|
|
9
|
+
# @molecule/app-auth-shell-vue
|
|
10
|
+
|
|
11
|
+
`@molecule/app-auth-shell-vue` — centered glassmorphic shell for auth pages
|
|
12
|
+
(Login, Signup, ForgotPassword, ResetPassword), the Vue counterpart of
|
|
13
|
+
`@molecule/app-auth-shell-react`: the same exports, the same props (React
|
|
14
|
+
names), and the same DOM for the same input.
|
|
15
|
+
|
|
16
|
+
Apps pass per-app `decoration` (orbs, gradient backdrop) and `brand` (logo +
|
|
17
|
+
tagline) as node slots or props. The shell handles layout, the glass card,
|
|
18
|
+
heading/subheading, body slot, footer, and the "Back to home" link.
|
|
19
|
+
|
|
20
|
+
The shell also provides its content through `<AuthFormStateProvider>`, so any
|
|
21
|
+
form rendered inside inherits cross-view email persistence — the email typed
|
|
22
|
+
on one auth view (Login/Signup/Forgot/Reset) is carried to the next and
|
|
23
|
+
cleared on successful auth. Forms read it via `useAuthFormStateContext()`;
|
|
24
|
+
the underlying `useAuthFormState` composable is also exported for standalone
|
|
25
|
+
use. Persistence flows through the `@molecule/app-storage` `StorageProvider`
|
|
26
|
+
abstraction (never raw `sessionStorage`), defaulting to a process-shared
|
|
27
|
+
in-memory store.
|
|
28
|
+
|
|
29
|
+
Besides the `AuthShell` preset, the package exports the composable primitives
|
|
30
|
+
it is built from — `AuthShellContainer`, `AuthShellDecoration`,
|
|
31
|
+
`AuthShellCard`, `AuthShellHeading`, `AuthShellFooter`, `AuthShellBackLink` —
|
|
32
|
+
plus a two-column family for the "brand panel + form card" split layout:
|
|
33
|
+
`AuthShellSplit` > `AuthShellSplitRow` > (`AuthShellPanel` +
|
|
34
|
+
`AuthShellCardColumn`).
|
|
35
|
+
|
|
36
|
+
> **Auto-generated, AI-first package reference** for the [molecule.dev](https://molecule.dev) ecosystem.
|
|
37
|
+
> It is written to be read by coding agents as much as by people, and is generated from this
|
|
38
|
+
> package's source — edit `src/index.ts` JSDoc, not this file.
|
|
39
|
+
|
|
40
|
+
## Quick Start
|
|
41
|
+
|
|
42
|
+
```ts
|
|
43
|
+
import { defineComponent, h } from 'vue'
|
|
44
|
+
import { AuthShell, useAuthFormStateContext } from '@molecule/app-auth-shell-vue'
|
|
45
|
+
import { createSessionStorageProvider } from '@molecule/app-storage-localstorage'
|
|
46
|
+
|
|
47
|
+
const sessionStore = createSessionStorageProvider({ prefix: 'auth_' })
|
|
48
|
+
|
|
49
|
+
const LoginForm = defineComponent({
|
|
50
|
+
setup() {
|
|
51
|
+
const { fields, setField, clear } = useAuthFormStateContext()
|
|
52
|
+
return () =>
|
|
53
|
+
h('form', [
|
|
54
|
+
h('input', {
|
|
55
|
+
value: fields.value.email ?? '',
|
|
56
|
+
onInput: (e: Event) => setField('email', (e.target as HTMLInputElement).value),
|
|
57
|
+
}),
|
|
58
|
+
])
|
|
59
|
+
},
|
|
60
|
+
})
|
|
61
|
+
|
|
62
|
+
const Login = defineComponent({
|
|
63
|
+
setup() {
|
|
64
|
+
return () =>
|
|
65
|
+
h(
|
|
66
|
+
AuthShell,
|
|
67
|
+
{
|
|
68
|
+
heading: 'Sign in',
|
|
69
|
+
subheading: 'Welcome back.',
|
|
70
|
+
brand: h('h2', 'Acme'),
|
|
71
|
+
formStateStorage: sessionStore,
|
|
72
|
+
footer: h('p', 'No account? Sign up'),
|
|
73
|
+
},
|
|
74
|
+
{ default: () => [h(LoginForm)] },
|
|
75
|
+
)
|
|
76
|
+
},
|
|
77
|
+
})
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## Type
|
|
81
|
+
|
|
82
|
+
`feature`
|
|
83
|
+
|
|
84
|
+
## Installation
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
npm install @molecule/app-auth-shell-vue @molecule/app-logger @molecule/app-storage @molecule/app-ui @molecule/app-ui-vue @molecule/app-vue vue
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
## API
|
|
91
|
+
|
|
92
|
+
### Interfaces
|
|
93
|
+
|
|
94
|
+
#### `AuthFormFields`
|
|
95
|
+
|
|
96
|
+
Shared auth form field values. `email` is the canonical cross-view field;
|
|
97
|
+
additional string fields (e.g. a name carried from Signup) may be stored
|
|
98
|
+
alongside it.
|
|
99
|
+
|
|
100
|
+
```typescript
|
|
101
|
+
interface AuthFormFields {
|
|
102
|
+
/** Email address, shared across all auth views. */
|
|
103
|
+
email?: string
|
|
104
|
+
/** Any other shared string field (e.g. `name`). */
|
|
105
|
+
[field: string]: string | undefined
|
|
106
|
+
}
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
#### `UseAuthFormStateOptions`
|
|
110
|
+
|
|
111
|
+
Options for {@link useAuthFormState}.
|
|
112
|
+
|
|
113
|
+
```typescript
|
|
114
|
+
interface UseAuthFormStateOptions {
|
|
115
|
+
/** Storage provider backing persistence (defaults to a process-shared in-memory provider). */
|
|
116
|
+
storage?: StorageProvider
|
|
117
|
+
/** Storage key for the persisted fields. Defaults to `molecule.auth.form-state`. */
|
|
118
|
+
storageKey?: string
|
|
119
|
+
/** Seed values used before hydration completes / when storage is empty. */
|
|
120
|
+
initialFields?: AuthFormFields
|
|
121
|
+
}
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
#### `AuthFormState`
|
|
125
|
+
|
|
126
|
+
The value {@link useAuthFormState} returns.
|
|
127
|
+
|
|
128
|
+
```typescript
|
|
129
|
+
interface AuthFormState {
|
|
130
|
+
/** Current field values (email + any shared fields), as a read-only ref. */
|
|
131
|
+
fields: Ref<AuthFormFields>
|
|
132
|
+
/** `true` once the initial read from storage has completed, as a read-only ref. */
|
|
133
|
+
hydrated: Ref<boolean>
|
|
134
|
+
/** Sets a single field and persists the new state. */
|
|
135
|
+
setField: (name: string, value: string) => void
|
|
136
|
+
/** Merges a patch of fields and persists the new state. */
|
|
137
|
+
setFields: (patch: AuthFormFields) => void
|
|
138
|
+
/** Clears all persisted auth form state and removes the storage key. */
|
|
139
|
+
clear: () => void
|
|
140
|
+
}
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
#### `AuthFormStateProviderProps`
|
|
144
|
+
|
|
145
|
+
Props for {@link AuthFormStateProvider}.
|
|
146
|
+
|
|
147
|
+
```typescript
|
|
148
|
+
interface AuthFormStateProviderProps {
|
|
149
|
+
/** Children rendered inside the provider. */
|
|
150
|
+
children?: VNodeChild
|
|
151
|
+
/** Storage provider backing persistence (defaults to a shared in-memory provider). */
|
|
152
|
+
storage?: StorageProvider
|
|
153
|
+
/** Storage key for the persisted fields. */
|
|
154
|
+
storageKey?: string
|
|
155
|
+
/** Seed values used before hydration / when storage is empty. */
|
|
156
|
+
initialFields?: AuthFormFields
|
|
157
|
+
}
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
#### `AuthShellContainerProps`
|
|
161
|
+
|
|
162
|
+
Props accepted by {@link AuthShellContainer}.
|
|
163
|
+
|
|
164
|
+
```typescript
|
|
165
|
+
interface AuthShellContainerProps {
|
|
166
|
+
/** Content rendered inside the container. */
|
|
167
|
+
children?: VNodeChild
|
|
168
|
+
/** Optional CSS background applied to the container. */
|
|
169
|
+
style?: CSSProperties
|
|
170
|
+
/** Extra classes appended after the defaults. */
|
|
171
|
+
className?: string
|
|
172
|
+
/** Layout direction. Defaults to `'centered'`; pass `'column'` for a vertical stack. */
|
|
173
|
+
layout?: 'centered' | 'column'
|
|
174
|
+
}
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
#### `AuthShellCardProps`
|
|
178
|
+
|
|
179
|
+
Props accepted by {@link AuthShellCard}.
|
|
180
|
+
|
|
181
|
+
```typescript
|
|
182
|
+
interface AuthShellCardProps {
|
|
183
|
+
/** Content rendered inside the card. */
|
|
184
|
+
children?: VNodeChild
|
|
185
|
+
/** Override the default glass surface. */
|
|
186
|
+
surfaceClassName?: string
|
|
187
|
+
/** Extra layout classes appended after the flex/padding defaults. */
|
|
188
|
+
className?: string
|
|
189
|
+
/** Override the outer `<main>` wrapper classes. */
|
|
190
|
+
outerClassName?: string
|
|
191
|
+
/** `data-mol-id` pass-through for E2E selectors. */
|
|
192
|
+
dataMolId?: string
|
|
193
|
+
/** Optional CSS style applied to the card's inner surface. */
|
|
194
|
+
style?: CSSProperties
|
|
195
|
+
}
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
#### `AuthShellHeadingProps`
|
|
199
|
+
|
|
200
|
+
Props accepted by {@link AuthShellHeading}.
|
|
201
|
+
|
|
202
|
+
```typescript
|
|
203
|
+
interface AuthShellHeadingProps {
|
|
204
|
+
/** The heading text. */
|
|
205
|
+
heading: string
|
|
206
|
+
/** Optional subheading paragraph. */
|
|
207
|
+
subheading?: string
|
|
208
|
+
/** Optional small uppercase tag rendered above the heading. */
|
|
209
|
+
eyebrow?: string
|
|
210
|
+
/** Optional override for the h1 className. */
|
|
211
|
+
headingClassName?: string
|
|
212
|
+
/** Optional override for the h1 style. */
|
|
213
|
+
headingStyle?: CSSProperties
|
|
214
|
+
}
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
#### `AuthShellBackLinkProps`
|
|
218
|
+
|
|
219
|
+
Props accepted by {@link AuthShellBackLink}.
|
|
220
|
+
|
|
221
|
+
```typescript
|
|
222
|
+
interface AuthShellBackLinkProps {
|
|
223
|
+
/** Destination. Defaults to `/`. */
|
|
224
|
+
to?: string
|
|
225
|
+
/** Translated label override; falls back to `auth.backHome` → "Back to home" when absent, empty or blank. */
|
|
226
|
+
label?: string
|
|
227
|
+
}
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
#### `AuthShellSplitProps`
|
|
231
|
+
|
|
232
|
+
Props accepted by {@link AuthShellSplit}.
|
|
233
|
+
|
|
234
|
+
```typescript
|
|
235
|
+
interface AuthShellSplitProps {
|
|
236
|
+
/** The split row (and optionally a site footer sibling). */
|
|
237
|
+
children?: VNodeChild
|
|
238
|
+
/** Cosmetic classes (background, text color, font) for the outer container. */
|
|
239
|
+
className?: string
|
|
240
|
+
}
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
#### `AuthShellSplitRowProps`
|
|
244
|
+
|
|
245
|
+
Props accepted by {@link AuthShellSplitRow}.
|
|
246
|
+
|
|
247
|
+
```typescript
|
|
248
|
+
interface AuthShellSplitRowProps {
|
|
249
|
+
/** The brand panel and the card column. */
|
|
250
|
+
children?: VNodeChild
|
|
251
|
+
/** Layout classes for the row (typically `cm.flex({})` or `cm.grid({ cols: 2 })`). */
|
|
252
|
+
className?: string
|
|
253
|
+
}
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
#### `AuthShellPanelProps`
|
|
257
|
+
|
|
258
|
+
Props accepted by {@link AuthShellPanel}.
|
|
259
|
+
|
|
260
|
+
```typescript
|
|
261
|
+
interface AuthShellPanelProps {
|
|
262
|
+
/** The app's bespoke decoration, wordmark or social proof. */
|
|
263
|
+
children?: VNodeChild
|
|
264
|
+
/** Cosmetic classes — width ratio, padding, gradient, positioning. */
|
|
265
|
+
className?: string
|
|
266
|
+
}
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
#### `AuthShellCardColumnProps`
|
|
270
|
+
|
|
271
|
+
Props accepted by {@link AuthShellCardColumn}.
|
|
272
|
+
|
|
273
|
+
```typescript
|
|
274
|
+
interface AuthShellCardColumnProps {
|
|
275
|
+
/** The form card content. */
|
|
276
|
+
children?: VNodeChild
|
|
277
|
+
/** Cosmetic classes — width ratio, padding. */
|
|
278
|
+
className?: string
|
|
279
|
+
/** Element to render. Defaults to `'section'`. */
|
|
280
|
+
as?: 'section' | 'main'
|
|
281
|
+
}
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
#### `AuthShellProps`
|
|
285
|
+
|
|
286
|
+
Props accepted by {@link AuthShell}.
|
|
287
|
+
|
|
288
|
+
```typescript
|
|
289
|
+
interface AuthShellProps {
|
|
290
|
+
/** The heading text. */
|
|
291
|
+
heading: string
|
|
292
|
+
/** The subheading text. */
|
|
293
|
+
subheading: string
|
|
294
|
+
/** The form body. */
|
|
295
|
+
children?: VNodeChild
|
|
296
|
+
/** Optional footer node. */
|
|
297
|
+
footer?: VNodeChild
|
|
298
|
+
/** Optional brand node rendered above the heading. */
|
|
299
|
+
brand?: VNodeChild
|
|
300
|
+
/** Optional background decoration node. */
|
|
301
|
+
decoration?: VNodeChild
|
|
302
|
+
/** Destination of the back link. Defaults to `/`. */
|
|
303
|
+
backTo?: string
|
|
304
|
+
/** Whether to render the back link. Defaults to `true`. */
|
|
305
|
+
showBackLink?: boolean
|
|
306
|
+
/** Storage provider backing cross-view auth form persistence. */
|
|
307
|
+
formStateStorage?: StorageProvider
|
|
308
|
+
/** Storage key for the persisted auth form state. */
|
|
309
|
+
formStateKey?: string
|
|
310
|
+
}
|
|
311
|
+
```
|
|
312
|
+
|
|
313
|
+
### Functions
|
|
314
|
+
|
|
315
|
+
#### `useAuthFormStateContext()`
|
|
316
|
+
|
|
317
|
+
Reads the shared auth form state from the nearest
|
|
318
|
+
{@link AuthFormStateProvider} (which `<AuthShell>` renders by default).
|
|
319
|
+
|
|
320
|
+
```typescript
|
|
321
|
+
function useAuthFormStateContext(): AuthFormState
|
|
322
|
+
```
|
|
323
|
+
|
|
324
|
+
**Returns:** The shared {@link AuthFormState}.
|
|
325
|
+
|
|
326
|
+
#### `useAuthFormState(options)`
|
|
327
|
+
|
|
328
|
+
Vue composable holding email + shared auth fields, persisted across auth
|
|
329
|
+
views via an injectable `StorageProvider` and cleared on successful auth.
|
|
330
|
+
|
|
331
|
+
```typescript
|
|
332
|
+
function useAuthFormState(
|
|
333
|
+
options?: UseAuthFormStateOptions | MaybeRefOrGetter<UseAuthFormStateOptions | undefined>,
|
|
334
|
+
): AuthFormState
|
|
335
|
+
```
|
|
336
|
+
|
|
337
|
+
- `options` — Optional storage provider, storage key, and seed fields (a plain object or a getter/ref of them).
|
|
338
|
+
|
|
339
|
+
**Returns:** The current fields plus `setField`/`setFields`/`clear` and a `hydrated` flag.
|
|
340
|
+
|
|
341
|
+
### Constants
|
|
342
|
+
|
|
343
|
+
#### `AuthFormStateProvider`
|
|
344
|
+
|
|
345
|
+
Provides a single {@link useAuthFormState} instance to all descendants via
|
|
346
|
+
provide/inject, so sibling/child auth forms share the same email.
|
|
347
|
+
|
|
348
|
+
```typescript
|
|
349
|
+
const AuthFormStateProvider: DefineComponent<
|
|
350
|
+
ExtractPropTypes<{
|
|
351
|
+
children: null
|
|
352
|
+
storage: null
|
|
353
|
+
storageKey: StringConstructor
|
|
354
|
+
initialFields: null
|
|
355
|
+
}>,
|
|
356
|
+
() => VNode<RendererNode, RendererElement, { [key: string]: any }>[],
|
|
357
|
+
{},
|
|
358
|
+
{},
|
|
359
|
+
{},
|
|
360
|
+
ComponentOptionsMixin,
|
|
361
|
+
ComponentOptionsMixin,
|
|
362
|
+
{},
|
|
363
|
+
string,
|
|
364
|
+
PublicProps,
|
|
365
|
+
Readonly<
|
|
366
|
+
ExtractPropTypes<{
|
|
367
|
+
children: null
|
|
368
|
+
storage: null
|
|
369
|
+
storageKey: StringConstructor
|
|
370
|
+
initialFields: null
|
|
371
|
+
}>
|
|
372
|
+
> &
|
|
373
|
+
Readonly<{}>,
|
|
374
|
+
{},
|
|
375
|
+
{},
|
|
376
|
+
{},
|
|
377
|
+
{},
|
|
378
|
+
string,
|
|
379
|
+
ComponentProvideOptions,
|
|
380
|
+
true,
|
|
381
|
+
{},
|
|
382
|
+
any
|
|
383
|
+
>
|
|
384
|
+
```
|
|
385
|
+
|
|
386
|
+
- `props` — Children plus optional storage provider, key, and seed fields.
|
|
387
|
+
|
|
388
|
+
**Returns:** The provider component.
|
|
389
|
+
|
|
390
|
+
#### `AuthShellContainer`
|
|
391
|
+
|
|
392
|
+
Outer full-screen container — centered flex, padded, with optional
|
|
393
|
+
absolute-positioned background decoration child.
|
|
394
|
+
|
|
395
|
+
```typescript
|
|
396
|
+
const AuthShellContainer: DefineComponent<
|
|
397
|
+
ExtractPropTypes<{
|
|
398
|
+
className: StringConstructor
|
|
399
|
+
layout: { type: StringConstructor; default: string }
|
|
400
|
+
}>,
|
|
401
|
+
() => VNode,
|
|
402
|
+
{},
|
|
403
|
+
{},
|
|
404
|
+
{},
|
|
405
|
+
ComponentOptionsMixin,
|
|
406
|
+
ComponentOptionsMixin,
|
|
407
|
+
{},
|
|
408
|
+
string,
|
|
409
|
+
PublicProps,
|
|
410
|
+
Readonly<
|
|
411
|
+
ExtractPropTypes<{
|
|
412
|
+
className: StringConstructor
|
|
413
|
+
layout: { type: StringConstructor; default: string }
|
|
414
|
+
}>
|
|
415
|
+
> &
|
|
416
|
+
Readonly<{}>,
|
|
417
|
+
{ layout: string },
|
|
418
|
+
{},
|
|
419
|
+
{},
|
|
420
|
+
{},
|
|
421
|
+
string,
|
|
422
|
+
ComponentProvideOptions,
|
|
423
|
+
true,
|
|
424
|
+
{},
|
|
425
|
+
any
|
|
426
|
+
>
|
|
427
|
+
```
|
|
428
|
+
|
|
429
|
+
- `props` — Component props (see the exported `AuthShellContainerProps`).
|
|
430
|
+
- `context` — The setup context (default slot = children).
|
|
431
|
+
|
|
432
|
+
**Returns:** The container component.
|
|
433
|
+
|
|
434
|
+
#### `AuthShellDecoration`
|
|
435
|
+
|
|
436
|
+
Absolute-positioned background decoration layer — orbs, mesh gradients,
|
|
437
|
+
radial glows.
|
|
438
|
+
|
|
439
|
+
```typescript
|
|
440
|
+
const AuthShellDecoration: DefineComponent<
|
|
441
|
+
{},
|
|
442
|
+
() => VNode,
|
|
443
|
+
{},
|
|
444
|
+
{},
|
|
445
|
+
{},
|
|
446
|
+
ComponentOptionsMixin,
|
|
447
|
+
ComponentOptionsMixin,
|
|
448
|
+
{},
|
|
449
|
+
string,
|
|
450
|
+
PublicProps,
|
|
451
|
+
Readonly<{}> & Readonly<{}>,
|
|
452
|
+
{},
|
|
453
|
+
{},
|
|
454
|
+
{},
|
|
455
|
+
{},
|
|
456
|
+
string,
|
|
457
|
+
ComponentProvideOptions,
|
|
458
|
+
true,
|
|
459
|
+
{},
|
|
460
|
+
any
|
|
461
|
+
>
|
|
462
|
+
```
|
|
463
|
+
|
|
464
|
+
- `props` — Component props (no data props; the default slot is the content).
|
|
465
|
+
- `context` — The setup context (default slot = children).
|
|
466
|
+
|
|
467
|
+
**Returns:** The decoration component.
|
|
468
|
+
|
|
469
|
+
#### `AuthShellCard`
|
|
470
|
+
|
|
471
|
+
The centered glassmorphic card surface.
|
|
472
|
+
|
|
473
|
+
```typescript
|
|
474
|
+
const AuthShellCard: DefineComponent<
|
|
475
|
+
ExtractPropTypes<{
|
|
476
|
+
surfaceClassName: StringConstructor
|
|
477
|
+
className: StringConstructor
|
|
478
|
+
outerClassName: StringConstructor
|
|
479
|
+
dataMolId: StringConstructor
|
|
480
|
+
}>,
|
|
481
|
+
() => VNode,
|
|
482
|
+
{},
|
|
483
|
+
{},
|
|
484
|
+
{},
|
|
485
|
+
ComponentOptionsMixin,
|
|
486
|
+
ComponentOptionsMixin,
|
|
487
|
+
{},
|
|
488
|
+
string,
|
|
489
|
+
PublicProps,
|
|
490
|
+
Readonly<
|
|
491
|
+
ExtractPropTypes<{
|
|
492
|
+
surfaceClassName: StringConstructor
|
|
493
|
+
className: StringConstructor
|
|
494
|
+
outerClassName: StringConstructor
|
|
495
|
+
dataMolId: StringConstructor
|
|
496
|
+
}>
|
|
497
|
+
> &
|
|
498
|
+
Readonly<{}>,
|
|
499
|
+
{},
|
|
500
|
+
{},
|
|
501
|
+
{},
|
|
502
|
+
{},
|
|
503
|
+
string,
|
|
504
|
+
ComponentProvideOptions,
|
|
505
|
+
true,
|
|
506
|
+
{},
|
|
507
|
+
any
|
|
508
|
+
>
|
|
509
|
+
```
|
|
510
|
+
|
|
511
|
+
- `props` — Component props (see the exported `AuthShellCardProps`).
|
|
512
|
+
- `context` — The setup context (default slot = children; `style` is an attr).
|
|
513
|
+
|
|
514
|
+
**Returns:** The card component.
|
|
515
|
+
|
|
516
|
+
#### `AuthShellHeading`
|
|
517
|
+
|
|
518
|
+
Centered heading block: optional eyebrow + h1 + optional subheading.
|
|
519
|
+
|
|
520
|
+
```typescript
|
|
521
|
+
const AuthShellHeading: DefineComponent<
|
|
522
|
+
ExtractPropTypes<{
|
|
523
|
+
heading: { type: StringConstructor; required: true }
|
|
524
|
+
subheading: StringConstructor
|
|
525
|
+
eyebrow: StringConstructor
|
|
526
|
+
headingClassName: StringConstructor
|
|
527
|
+
headingStyle: null
|
|
528
|
+
}>,
|
|
529
|
+
() => VNode,
|
|
530
|
+
{},
|
|
531
|
+
{},
|
|
532
|
+
{},
|
|
533
|
+
ComponentOptionsMixin,
|
|
534
|
+
ComponentOptionsMixin,
|
|
535
|
+
{},
|
|
536
|
+
string,
|
|
537
|
+
PublicProps,
|
|
538
|
+
Readonly<
|
|
539
|
+
ExtractPropTypes<{
|
|
540
|
+
heading: { type: StringConstructor; required: true }
|
|
541
|
+
subheading: StringConstructor
|
|
542
|
+
eyebrow: StringConstructor
|
|
543
|
+
headingClassName: StringConstructor
|
|
544
|
+
headingStyle: null
|
|
545
|
+
}>
|
|
546
|
+
> &
|
|
547
|
+
Readonly<{}>,
|
|
548
|
+
{},
|
|
549
|
+
{},
|
|
550
|
+
{},
|
|
551
|
+
{},
|
|
552
|
+
string,
|
|
553
|
+
ComponentProvideOptions,
|
|
554
|
+
true,
|
|
555
|
+
{},
|
|
556
|
+
any
|
|
557
|
+
>
|
|
558
|
+
```
|
|
559
|
+
|
|
560
|
+
- `props` — Component props (see the exported `AuthShellHeadingProps`).
|
|
561
|
+
- `context` — The setup context (no slots).
|
|
562
|
+
|
|
563
|
+
**Returns:** The heading component.
|
|
564
|
+
|
|
565
|
+
#### `AuthShellFooter`
|
|
566
|
+
|
|
567
|
+
Footer inside the card — small text with a top border.
|
|
568
|
+
|
|
569
|
+
```typescript
|
|
570
|
+
const AuthShellFooter: DefineComponent<
|
|
571
|
+
{},
|
|
572
|
+
() => VNode,
|
|
573
|
+
{},
|
|
574
|
+
{},
|
|
575
|
+
{},
|
|
576
|
+
ComponentOptionsMixin,
|
|
577
|
+
ComponentOptionsMixin,
|
|
578
|
+
{},
|
|
579
|
+
string,
|
|
580
|
+
PublicProps,
|
|
581
|
+
Readonly<{}> & Readonly<{}>,
|
|
582
|
+
{},
|
|
583
|
+
{},
|
|
584
|
+
{},
|
|
585
|
+
{},
|
|
586
|
+
string,
|
|
587
|
+
ComponentProvideOptions,
|
|
588
|
+
true,
|
|
589
|
+
{},
|
|
590
|
+
any
|
|
591
|
+
>
|
|
592
|
+
```
|
|
593
|
+
|
|
594
|
+
- `props` — Component props (no data props; the default slot is the content).
|
|
595
|
+
- `context` — The setup context (default slot = children).
|
|
596
|
+
|
|
597
|
+
**Returns:** The footer component.
|
|
598
|
+
|
|
599
|
+
#### `AuthShellBackLink`
|
|
600
|
+
|
|
601
|
+
"Back to home" link (or custom destination) rendered below the card.
|
|
602
|
+
|
|
603
|
+
The arrow's Material Symbols glyph span is `aria-hidden="true"`, so the
|
|
604
|
+
link's accessible name is its `t()` label alone.
|
|
605
|
+
|
|
606
|
+
```typescript
|
|
607
|
+
const AuthShellBackLink: DefineComponent<
|
|
608
|
+
ExtractPropTypes<{ to: { type: StringConstructor; default: string }; label: StringConstructor }>,
|
|
609
|
+
() => VNode,
|
|
610
|
+
{},
|
|
611
|
+
{},
|
|
612
|
+
{},
|
|
613
|
+
ComponentOptionsMixin,
|
|
614
|
+
ComponentOptionsMixin,
|
|
615
|
+
{},
|
|
616
|
+
string,
|
|
617
|
+
PublicProps,
|
|
618
|
+
Readonly<
|
|
619
|
+
ExtractPropTypes<{ to: { type: StringConstructor; default: string }; label: StringConstructor }>
|
|
620
|
+
> &
|
|
621
|
+
Readonly<{}>,
|
|
622
|
+
{ to: string },
|
|
623
|
+
{},
|
|
624
|
+
{},
|
|
625
|
+
{},
|
|
626
|
+
string,
|
|
627
|
+
ComponentProvideOptions,
|
|
628
|
+
true,
|
|
629
|
+
{},
|
|
630
|
+
any
|
|
631
|
+
>
|
|
632
|
+
```
|
|
633
|
+
|
|
634
|
+
- `props` — Component props (see the exported `AuthShellBackLinkProps`).
|
|
635
|
+
|
|
636
|
+
**Returns:** The back-link component.
|
|
637
|
+
|
|
638
|
+
#### `AuthShellSplit`
|
|
639
|
+
|
|
640
|
+
Outer frame for the two-column "decorated brand panel + card" auth layout.
|
|
641
|
+
|
|
642
|
+
```typescript
|
|
643
|
+
const AuthShellSplit: DefineComponent<
|
|
644
|
+
ExtractPropTypes<{ className: StringConstructor }>,
|
|
645
|
+
() => VNode,
|
|
646
|
+
{},
|
|
647
|
+
{},
|
|
648
|
+
{},
|
|
649
|
+
ComponentOptionsMixin,
|
|
650
|
+
ComponentOptionsMixin,
|
|
651
|
+
{},
|
|
652
|
+
string,
|
|
653
|
+
PublicProps,
|
|
654
|
+
Readonly<ExtractPropTypes<{ className: StringConstructor }>> & Readonly<{}>,
|
|
655
|
+
{},
|
|
656
|
+
{},
|
|
657
|
+
{},
|
|
658
|
+
{},
|
|
659
|
+
string,
|
|
660
|
+
ComponentProvideOptions,
|
|
661
|
+
true,
|
|
662
|
+
{},
|
|
663
|
+
any
|
|
664
|
+
>
|
|
665
|
+
```
|
|
666
|
+
|
|
667
|
+
- `props` — Component props (see the exported `AuthShellSplitProps`).
|
|
668
|
+
- `context` — The setup context (default slot = children; extra attrs fall through).
|
|
669
|
+
|
|
670
|
+
**Returns:** The split component.
|
|
671
|
+
|
|
672
|
+
#### `AuthShellSplitRow`
|
|
673
|
+
|
|
674
|
+
The vertically-flexed two-column row inside `<AuthShellSplit>`.
|
|
675
|
+
|
|
676
|
+
```typescript
|
|
677
|
+
const AuthShellSplitRow: DefineComponent<
|
|
678
|
+
ExtractPropTypes<{ className: StringConstructor }>,
|
|
679
|
+
() => VNode,
|
|
680
|
+
{},
|
|
681
|
+
{},
|
|
682
|
+
{},
|
|
683
|
+
ComponentOptionsMixin,
|
|
684
|
+
ComponentOptionsMixin,
|
|
685
|
+
{},
|
|
686
|
+
string,
|
|
687
|
+
PublicProps,
|
|
688
|
+
Readonly<ExtractPropTypes<{ className: StringConstructor }>> & Readonly<{}>,
|
|
689
|
+
{},
|
|
690
|
+
{},
|
|
691
|
+
{},
|
|
692
|
+
{},
|
|
693
|
+
string,
|
|
694
|
+
ComponentProvideOptions,
|
|
695
|
+
true,
|
|
696
|
+
{},
|
|
697
|
+
any
|
|
698
|
+
>
|
|
699
|
+
```
|
|
700
|
+
|
|
701
|
+
- `props` — Component props (see the exported `AuthShellSplitRowProps`).
|
|
702
|
+
- `context` — The setup context (default slot = children; extra attrs fall through).
|
|
703
|
+
|
|
704
|
+
**Returns:** The split-row component.
|
|
705
|
+
|
|
706
|
+
#### `AuthShellPanel`
|
|
707
|
+
|
|
708
|
+
A decorative `<aside>` that collapses on mobile (the brand-panel half).
|
|
709
|
+
|
|
710
|
+
```typescript
|
|
711
|
+
const AuthShellPanel: DefineComponent<
|
|
712
|
+
ExtractPropTypes<{ className: StringConstructor }>,
|
|
713
|
+
() => VNode,
|
|
714
|
+
{},
|
|
715
|
+
{},
|
|
716
|
+
{},
|
|
717
|
+
ComponentOptionsMixin,
|
|
718
|
+
ComponentOptionsMixin,
|
|
719
|
+
{},
|
|
720
|
+
string,
|
|
721
|
+
PublicProps,
|
|
722
|
+
Readonly<ExtractPropTypes<{ className: StringConstructor }>> & Readonly<{}>,
|
|
723
|
+
{},
|
|
724
|
+
{},
|
|
725
|
+
{},
|
|
726
|
+
{},
|
|
727
|
+
string,
|
|
728
|
+
ComponentProvideOptions,
|
|
729
|
+
true,
|
|
730
|
+
{},
|
|
731
|
+
any
|
|
732
|
+
>
|
|
733
|
+
```
|
|
734
|
+
|
|
735
|
+
- `props` — Component props (see the exported `AuthShellPanelProps`).
|
|
736
|
+
- `context` — The setup context (default slot = children; extra attrs fall through).
|
|
737
|
+
|
|
738
|
+
**Returns:** The panel component.
|
|
739
|
+
|
|
740
|
+
#### `AuthShellCardColumn`
|
|
741
|
+
|
|
742
|
+
A `<section>` (or `<main>`, via `as`) that centers its children on both axes.
|
|
743
|
+
|
|
744
|
+
```typescript
|
|
745
|
+
const AuthShellCardColumn: DefineComponent<
|
|
746
|
+
ExtractPropTypes<{
|
|
747
|
+
className: StringConstructor
|
|
748
|
+
as: { type: StringConstructor; default: string }
|
|
749
|
+
}>,
|
|
750
|
+
() => VNode,
|
|
751
|
+
{},
|
|
752
|
+
{},
|
|
753
|
+
{},
|
|
754
|
+
ComponentOptionsMixin,
|
|
755
|
+
ComponentOptionsMixin,
|
|
756
|
+
{},
|
|
757
|
+
string,
|
|
758
|
+
PublicProps,
|
|
759
|
+
Readonly<
|
|
760
|
+
ExtractPropTypes<{
|
|
761
|
+
className: StringConstructor
|
|
762
|
+
as: { type: StringConstructor; default: string }
|
|
763
|
+
}>
|
|
764
|
+
> &
|
|
765
|
+
Readonly<{}>,
|
|
766
|
+
{ as: string },
|
|
767
|
+
{},
|
|
768
|
+
{},
|
|
769
|
+
{},
|
|
770
|
+
string,
|
|
771
|
+
ComponentProvideOptions,
|
|
772
|
+
true,
|
|
773
|
+
{},
|
|
774
|
+
any
|
|
775
|
+
>
|
|
776
|
+
```
|
|
777
|
+
|
|
778
|
+
- `props` — Component props (see the exported `AuthShellCardColumnProps`).
|
|
779
|
+
- `context` — The setup context (default slot = children; extra attrs fall through).
|
|
780
|
+
|
|
781
|
+
**Returns:** The card-column component.
|
|
782
|
+
|
|
783
|
+
#### `AuthShell`
|
|
784
|
+
|
|
785
|
+
Convenience preset for the most common layout: centered glass card with
|
|
786
|
+
optional decoration, brand, heading, body, footer, and a "Back to home" link.
|
|
787
|
+
|
|
788
|
+
Wraps its content in an `<AuthFormStateProvider>` so every form rendered
|
|
789
|
+
inside inherits cross-view email persistence via
|
|
790
|
+
`useAuthFormStateContext()`.
|
|
791
|
+
|
|
792
|
+
```typescript
|
|
793
|
+
const AuthShell: DefineComponent<
|
|
794
|
+
ExtractPropTypes<{
|
|
795
|
+
heading: { type: StringConstructor; required: true }
|
|
796
|
+
subheading: { type: StringConstructor; required: true }
|
|
797
|
+
footer: null
|
|
798
|
+
brand: null
|
|
799
|
+
decoration: null
|
|
800
|
+
backTo: { type: StringConstructor; default: string }
|
|
801
|
+
showBackLink: { type: BooleanConstructor; default: boolean }
|
|
802
|
+
formStateStorage: null
|
|
803
|
+
formStateKey: StringConstructor
|
|
804
|
+
}>,
|
|
805
|
+
() => VNode,
|
|
806
|
+
{},
|
|
807
|
+
{},
|
|
808
|
+
{},
|
|
809
|
+
ComponentOptionsMixin,
|
|
810
|
+
ComponentOptionsMixin,
|
|
811
|
+
{},
|
|
812
|
+
string,
|
|
813
|
+
PublicProps,
|
|
814
|
+
Readonly<
|
|
815
|
+
ExtractPropTypes<{
|
|
816
|
+
heading: { type: StringConstructor; required: true }
|
|
817
|
+
subheading: { type: StringConstructor; required: true }
|
|
818
|
+
footer: null
|
|
819
|
+
brand: null
|
|
820
|
+
decoration: null
|
|
821
|
+
backTo: { type: StringConstructor; default: string }
|
|
822
|
+
showBackLink: { type: BooleanConstructor; default: boolean }
|
|
823
|
+
formStateStorage: null
|
|
824
|
+
formStateKey: StringConstructor
|
|
825
|
+
}>
|
|
826
|
+
> &
|
|
827
|
+
Readonly<{}>,
|
|
828
|
+
{ backTo: string; showBackLink: boolean },
|
|
829
|
+
{},
|
|
830
|
+
{},
|
|
831
|
+
{},
|
|
832
|
+
string,
|
|
833
|
+
ComponentProvideOptions,
|
|
834
|
+
true,
|
|
835
|
+
{},
|
|
836
|
+
any
|
|
837
|
+
>
|
|
838
|
+
```
|
|
839
|
+
|
|
840
|
+
- `props` — Component props (see the exported `AuthShellProps`).
|
|
841
|
+
- `context` — The setup context (default/brand/decoration/footer slots).
|
|
842
|
+
|
|
843
|
+
**Returns:** The preset shell component.
|
|
844
|
+
|
|
845
|
+
#### `DEFAULT_AUTH_FORM_STATE_KEY`
|
|
846
|
+
|
|
847
|
+
Default storage key for persisted auth form fields.
|
|
848
|
+
|
|
849
|
+
```typescript
|
|
850
|
+
const DEFAULT_AUTH_FORM_STATE_KEY: 'molecule.auth.form-state'
|
|
851
|
+
```
|
|
852
|
+
|
|
853
|
+
## Injection Notes
|
|
854
|
+
|
|
855
|
+
### Requirements
|
|
856
|
+
|
|
857
|
+
Peer dependencies:
|
|
858
|
+
|
|
859
|
+
- `@molecule/app-logger` ^1.0.1
|
|
860
|
+
- `@molecule/app-storage` ^1.0.1
|
|
861
|
+
- `@molecule/app-ui` ^1.3.11
|
|
862
|
+
- `@molecule/app-ui-vue` ^1.1.0
|
|
863
|
+
- `@molecule/app-vue` ^3.6.0
|
|
864
|
+
- `vue` ^3.4.0
|
|
865
|
+
|
|
866
|
+
### Runtime Dependencies
|
|
867
|
+
|
|
868
|
+
- `@molecule/app-logger`
|
|
869
|
+
- `@molecule/app-storage`
|
|
870
|
+
- `@molecule/app-ui`
|
|
871
|
+
- `@molecule/app-ui-vue`
|
|
872
|
+
- `@molecule/app-vue`
|
|
873
|
+
- `vue`
|
|
874
|
+
|
|
875
|
+
`AuthShell` renders the binding's router `<Link>` ("Back to home") by
|
|
876
|
+
default, so it MUST be rendered inside a `moleculePlugin` router; pass
|
|
877
|
+
`showBackLink={false}` in router-less setups. The back link's arrow uses the
|
|
878
|
+
Material Symbols icon font — load it, or the glyph renders as text; the glyph
|
|
879
|
+
span is `aria-hidden="true"`, so the link's accessible name is its `t()` label
|
|
880
|
+
alone. Form-state persistence defaults to a process-shared in-memory store
|
|
881
|
+
(survives route
|
|
882
|
+
swaps, not reloads) — inject `createSessionStorageProvider()` for reload-safe,
|
|
883
|
+
tab-scoped persistence. Translations come from the companion
|
|
884
|
+
`@molecule/app-locales-auth-shell` locale bond.
|
|
885
|
+
|
|
886
|
+
## Translations
|
|
887
|
+
|
|
888
|
+
Translation strings are provided by `@molecule/app-locales-auth-shell`.
|