@molecule/app-auth-shell-solid 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 +521 -2
- package/dist/AuthFormStateProvider.d.ts +29 -0
- package/dist/AuthFormStateProvider.d.ts.map +1 -0
- package/dist/AuthFormStateProvider.jsx +44 -0
- package/dist/AuthFormStateProvider.jsx.map +1 -0
- package/dist/AuthShell.d.ts +99 -0
- package/dist/AuthShell.d.ts.map +1 -0
- package/dist/AuthShell.jsx +187 -0
- package/dist/AuthShell.jsx.map +1 -0
- package/dist/index.d.ts +67 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +67 -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 +25 -0
- package/dist/useAuthFormState.d.ts.map +1 -0
- package/dist/useAuthFormState.js +121 -0
- package/dist/useAuthFormState.js.map +1 -0
- package/package.json +68 -4
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AuthShell.d.ts","sourceRoot":"","sources":["../src/AuthShell.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,GAAG,EAAc,MAAM,UAAU,CAAA;AAO/D,OAAO,KAAK,EACV,sBAAsB,EACtB,wBAAwB,EACxB,kBAAkB,EAClB,uBAAuB,EACvB,qBAAqB,EACrB,mBAAmB,EACnB,cAAc,EACd,mBAAmB,EACnB,sBAAsB,EACvB,MAAM,YAAY,CAAA;AAEnB;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,EAAE,SAAS,CAAC,uBAAuB,CAgBjE,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,EAAE,SAAS,CAAC;IAAE,QAAQ,CAAC,EAAE,GAAG,CAAC,OAAO,CAAA;CAAE,CAGrE,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,aAAa,EAAE,SAAS,CAAC,kBAAkB,CAkBvD,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,EAAE,SAAS,CAAC,qBAAqB,CAyB7D,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,eAAe,EAAE,SAAS,CAAC;IAAE,QAAQ,CAAC,EAAE,GAAG,CAAC,OAAO,CAAA;CAAE,CAOjE,CAAA;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,iBAAiB,EAAE,SAAS,CAAC,sBAAsB,CAqB/D,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,cAAc,EAAE,SAAS,CAAC,mBAAmB,CAQzD,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,EAAE,SAAS,CAAC,sBAAsB,CAQ/D,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,cAAc,EAAE,SAAS,CAAC,mBAAmB,CAQzD,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,EAAE,SAAS,CAAC,wBAAwB,CAgBnE,CAAA;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,SAAS,EAAE,SAAS,CAAC,cAAc,CAmB/C,CAAA;AAED,eAAe,SAAS,CAAA"}
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Solid auth-page layout shell — the Solid counterpart of
|
|
3
|
+
* `@molecule/app-auth-shell-react`. Same exports, same props (React names),
|
|
4
|
+
* same DOM for the same input.
|
|
5
|
+
*
|
|
6
|
+
* @module
|
|
7
|
+
*/
|
|
8
|
+
import { splitProps } from 'solid-js';
|
|
9
|
+
import { Dynamic } from 'solid-js/web';
|
|
10
|
+
import { Link, useTranslation } from '@molecule/app-solid';
|
|
11
|
+
import { getClassMap } from '@molecule/app-ui';
|
|
12
|
+
import { AuthFormStateProvider } from './AuthFormStateProvider.jsx';
|
|
13
|
+
/**
|
|
14
|
+
* Outer full-screen container — centered flex, padded, with optional
|
|
15
|
+
* absolute-positioned background decoration child.
|
|
16
|
+
*
|
|
17
|
+
* @param props - Component props (see {@link AuthShellContainerProps}).
|
|
18
|
+
* @returns The container element.
|
|
19
|
+
*/
|
|
20
|
+
export const AuthShellContainer = (props) => {
|
|
21
|
+
const cm = getClassMap();
|
|
22
|
+
const base = () => props.layout === 'column'
|
|
23
|
+
? cm.cn(cm.flex({ direction: 'col' }), cm.minH('screen'), cm.authShellContainer)
|
|
24
|
+
: cm.cn(cm.flex({ align: 'center', justify: 'center' }), cm.minH('screen'), cm.sp('p', 6), cm.authShellContainer);
|
|
25
|
+
return (<div class={cm.cn(base(), props.className)} style={props.style}>
|
|
26
|
+
{props.children}
|
|
27
|
+
</div>);
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Absolute-positioned background decoration layer — orbs, mesh gradients,
|
|
31
|
+
* radial glows.
|
|
32
|
+
*
|
|
33
|
+
* @param props - Component props (the children are the decoration).
|
|
34
|
+
* @returns The decoration element.
|
|
35
|
+
*/
|
|
36
|
+
export const AuthShellDecoration = (props) => {
|
|
37
|
+
const cm = getClassMap();
|
|
38
|
+
return <div class={cm.cn(cm.authShellDecoration)}>{props.children}</div>;
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* The centered glassmorphic card surface.
|
|
42
|
+
*
|
|
43
|
+
* @param props - Component props (see {@link AuthShellCardProps}).
|
|
44
|
+
* @returns The card element.
|
|
45
|
+
*/
|
|
46
|
+
export const AuthShellCard = (props) => {
|
|
47
|
+
const cm = getClassMap();
|
|
48
|
+
return (<main class={props.outerClassName ?? cm.cn(cm.w('full'), cm.authShellCardOuter)}>
|
|
49
|
+
<div class={cm.cn(cm.flex({ direction: 'col', gap: 'lg' }), cm.sp('p', 8), props.surfaceClassName ?? cm.authShellCardSurface, props.className)} style={props.style} data-mol-id={props.dataMolId}>
|
|
50
|
+
{props.children}
|
|
51
|
+
</div>
|
|
52
|
+
</main>);
|
|
53
|
+
};
|
|
54
|
+
/**
|
|
55
|
+
* Centered heading block: optional eyebrow + h1 + optional subheading.
|
|
56
|
+
*
|
|
57
|
+
* @param props - Component props (see {@link AuthShellHeadingProps}).
|
|
58
|
+
* @returns The heading element.
|
|
59
|
+
*/
|
|
60
|
+
export const AuthShellHeading = (props) => {
|
|
61
|
+
const cm = getClassMap();
|
|
62
|
+
return (<header class={cm.flex({ direction: 'col', align: 'center', gap: 'xs' })}>
|
|
63
|
+
{props.eyebrow ? (<span class={cm.cn(cm.textSize('xs'), cm.fontWeight('bold'), cm.authShellHeadingEyebrow)}>
|
|
64
|
+
{props.eyebrow}
|
|
65
|
+
</span>) : null}
|
|
66
|
+
<h1 class={cm.cn(cm.textSize('2xl'), cm.fontWeight('bold'), cm.authShellHeadingTitle, props.headingClassName)} style={props.headingStyle}>
|
|
67
|
+
{props.heading}
|
|
68
|
+
</h1>
|
|
69
|
+
{props.subheading ? (<p class={cm.cn(cm.textSize('sm'), cm.authShellHeadingSub)}>{props.subheading}</p>) : null}
|
|
70
|
+
</header>);
|
|
71
|
+
};
|
|
72
|
+
/**
|
|
73
|
+
* Footer inside the card — small text with a top border.
|
|
74
|
+
*
|
|
75
|
+
* @param props - Component props (the children are the footer content).
|
|
76
|
+
* @returns The footer element.
|
|
77
|
+
*/
|
|
78
|
+
export const AuthShellFooter = (props) => {
|
|
79
|
+
const cm = getClassMap();
|
|
80
|
+
return (<footer class={cm.cn(cm.textCenter, cm.textSize('sm'), cm.authShellFooter)}>
|
|
81
|
+
{props.children}
|
|
82
|
+
</footer>);
|
|
83
|
+
};
|
|
84
|
+
/**
|
|
85
|
+
* "Back to home" link (or custom destination) rendered below the card.
|
|
86
|
+
*
|
|
87
|
+
* The arrow's Material Symbols glyph span is `aria-hidden="true"`, so the
|
|
88
|
+
* link's accessible name is its `t()` label alone.
|
|
89
|
+
*
|
|
90
|
+
* @param props - Component props (see {@link AuthShellBackLinkProps}).
|
|
91
|
+
* @returns The back-link element.
|
|
92
|
+
*/
|
|
93
|
+
export const AuthShellBackLink = (props) => {
|
|
94
|
+
const cm = getClassMap();
|
|
95
|
+
const { t } = useTranslation();
|
|
96
|
+
return (<p class={cm.cn(cm.textCenter, cm.textSize('xs'), cm.sp('mt', 6), cm.authShellBackLink)}>
|
|
97
|
+
<Link to={props.to ?? '/'} class={cm.cn(cm.flex({ align: 'center', gap: 'xs' }), cm.authShellBackLinkAnchor)}>
|
|
98
|
+
{/* The Material Symbols ligature name paints a glyph, not text — hidden
|
|
99
|
+
from the accessibility tree so the link's accessible name is its
|
|
100
|
+
t() label alone. */}
|
|
101
|
+
<span class={cm.iconGlyphFont} style={{ 'font-size': '14px' }} aria-hidden="true">
|
|
102
|
+
arrow_back
|
|
103
|
+
</span>
|
|
104
|
+
{props.label?.trim()
|
|
105
|
+
? props.label
|
|
106
|
+
: t('auth.backHome', undefined, { defaultValue: 'Back to home' })}
|
|
107
|
+
</Link>
|
|
108
|
+
</p>);
|
|
109
|
+
};
|
|
110
|
+
/**
|
|
111
|
+
* Outer frame for the two-column "decorated brand panel + card" auth layout.
|
|
112
|
+
*
|
|
113
|
+
* @param props - Component props (see {@link AuthShellSplitProps}).
|
|
114
|
+
* @returns The split element.
|
|
115
|
+
*/
|
|
116
|
+
export const AuthShellSplit = (props) => {
|
|
117
|
+
const cm = getClassMap();
|
|
118
|
+
const [local, rest] = splitProps(props, ['children', 'className']);
|
|
119
|
+
return (<div class={cm.cn(cm.flex({ direction: 'col' }), cm.minH('screen'), local.className)} {...rest}>
|
|
120
|
+
{local.children}
|
|
121
|
+
</div>);
|
|
122
|
+
};
|
|
123
|
+
/**
|
|
124
|
+
* The vertically-flexed two-column row inside `<AuthShellSplit>`.
|
|
125
|
+
*
|
|
126
|
+
* @param props - Component props (see {@link AuthShellSplitRowProps}).
|
|
127
|
+
* @returns The split-row element.
|
|
128
|
+
*/
|
|
129
|
+
export const AuthShellSplitRow = (props) => {
|
|
130
|
+
const cm = getClassMap();
|
|
131
|
+
const [local, rest] = splitProps(props, ['children', 'className']);
|
|
132
|
+
return (<main class={cm.cn(cm.flex1, local.className)} {...rest}>
|
|
133
|
+
{local.children}
|
|
134
|
+
</main>);
|
|
135
|
+
};
|
|
136
|
+
/**
|
|
137
|
+
* A decorative `<aside>` that collapses on mobile (the brand-panel half).
|
|
138
|
+
*
|
|
139
|
+
* @param props - Component props (see {@link AuthShellPanelProps}).
|
|
140
|
+
* @returns The panel element.
|
|
141
|
+
*/
|
|
142
|
+
export const AuthShellPanel = (props) => {
|
|
143
|
+
const cm = getClassMap();
|
|
144
|
+
const [local, rest] = splitProps(props, ['children', 'className']);
|
|
145
|
+
return (<aside class={cm.cn(cm.authShellPanel, local.className)} {...rest}>
|
|
146
|
+
{local.children}
|
|
147
|
+
</aside>);
|
|
148
|
+
};
|
|
149
|
+
/**
|
|
150
|
+
* A `<section>` (or `<main>`, via `as`) that centers its children on both axes.
|
|
151
|
+
*
|
|
152
|
+
* @param props - Component props (see {@link AuthShellCardColumnProps}).
|
|
153
|
+
* @returns The card-column element.
|
|
154
|
+
*/
|
|
155
|
+
export const AuthShellCardColumn = (props) => {
|
|
156
|
+
const cm = getClassMap();
|
|
157
|
+
const [local, rest] = splitProps(props, ['children', 'className', 'as']);
|
|
158
|
+
return (<Dynamic component={local.as ?? 'section'} class={cm.cn(cm.flex({ direction: 'col', align: 'center', justify: 'center' }), cm.minW(0), local.className)} {...rest}>
|
|
159
|
+
{local.children}
|
|
160
|
+
</Dynamic>);
|
|
161
|
+
};
|
|
162
|
+
/**
|
|
163
|
+
* Convenience preset composing container, decoration, card, heading, footer,
|
|
164
|
+
* and back-link into a single component. Wraps its content in an
|
|
165
|
+
* `<AuthFormStateProvider>`.
|
|
166
|
+
*
|
|
167
|
+
* @param props - Component props (see {@link AuthShellProps}).
|
|
168
|
+
* @returns The preset shell element.
|
|
169
|
+
*/
|
|
170
|
+
export const AuthShell = (props) => {
|
|
171
|
+
return (<AuthFormStateProvider storage={props.formStateStorage} storageKey={props.formStateKey}>
|
|
172
|
+
<AuthShellContainer>
|
|
173
|
+
{props.decoration != null ? (<AuthShellDecoration>{props.decoration}</AuthShellDecoration>) : null}
|
|
174
|
+
<div>
|
|
175
|
+
<AuthShellCard>
|
|
176
|
+
{props.brand}
|
|
177
|
+
<AuthShellHeading heading={props.heading} subheading={props.subheading}/>
|
|
178
|
+
{props.children}
|
|
179
|
+
{props.footer != null ? <AuthShellFooter>{props.footer}</AuthShellFooter> : null}
|
|
180
|
+
</AuthShellCard>
|
|
181
|
+
{(props.showBackLink ?? true) ? <AuthShellBackLink to={props.backTo ?? '/'}/> : null}
|
|
182
|
+
</div>
|
|
183
|
+
</AuthShellContainer>
|
|
184
|
+
</AuthFormStateProvider>);
|
|
185
|
+
};
|
|
186
|
+
export default AuthShell;
|
|
187
|
+
//# sourceMappingURL=AuthShell.jsx.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AuthShell.jsx","sourceRoot":"","sources":["../src/AuthShell.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAA4B,UAAU,EAAE,MAAM,UAAU,CAAA;AAC/D,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAEtC,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAE9C,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAA;AAanE;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAuC,CAAC,KAAK,EAAE,EAAE;IAC9E,MAAM,EAAE,GAAG,WAAW,EAAE,CAAA;IACxB,MAAM,IAAI,GAAG,GAAW,EAAE,CACxB,KAAK,CAAC,MAAM,KAAK,QAAQ;QACvB,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,SAAS,EAAE,KAAK,E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AAK,CAAC,QAAQ,CACf;YAAA,CAAC,KAAK,CAAC,MAAM,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,eAAe,CAAC,CAAC,CAAC,CAAC,IAAI,CAClF;UAAA,EAAE,aAAa,CACf;UAAA,CAAC,CAAC,KAAK,CAAC,YAAY,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,iBAAiB,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,MAAM,IAAI,GAAG,CAAC,EAAG,CAAC,CAAC,CAAC,IAAI,CACvF;QAAA,EAAE,GAAG,CACP;MAAA,EAAE,kBAAkB,CACtB;IAAA,EAAE,qBAAqB,CAAC,CACzB,CAAA;AACH,CAAC,CAAA;AAED,eAAe,SAAS,CAAA"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@molecule/app-auth-shell-solid` — centered glassmorphic shell for auth pages
|
|
3
|
+
* (Login, Signup, ForgotPassword, ResetPassword), the Solid counterpart of
|
|
4
|
+
* `@molecule/app-auth-shell-react`: the same exports, the same props (React
|
|
5
|
+
* names), and the same DOM for the same input.
|
|
6
|
+
*
|
|
7
|
+
* Apps pass per-app `decoration` (orbs, gradient backdrop) and `brand` (logo +
|
|
8
|
+
* tagline) as JSX props. The shell handles layout, the glass card,
|
|
9
|
+
* heading/subheading, body, footer, and the "Back to home" link.
|
|
10
|
+
*
|
|
11
|
+
* The shell also provides its content through `<AuthFormStateProvider>`, so any
|
|
12
|
+
* form rendered inside inherits cross-view email persistence. Forms read it via
|
|
13
|
+
* `useAuthFormStateContext()`, or use the standalone `useAuthFormState`
|
|
14
|
+
* primitive. Persistence flows through the `@molecule/app-storage`
|
|
15
|
+
* `StorageProvider` abstraction (never raw `sessionStorage`), defaulting to a
|
|
16
|
+
* process-shared in-memory store.
|
|
17
|
+
*
|
|
18
|
+
* Besides the `AuthShell` preset, the package exports the composable
|
|
19
|
+
* primitives — `AuthShellContainer`, `AuthShellDecoration`, `AuthShellCard`,
|
|
20
|
+
* `AuthShellHeading`, `AuthShellFooter`, `AuthShellBackLink` — plus a
|
|
21
|
+
* two-column family for the split layout: `AuthShellSplit` >
|
|
22
|
+
* `AuthShellSplitRow` > (`AuthShellPanel` + `AuthShellCardColumn`).
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```tsx
|
|
26
|
+
* import { AuthShell, useAuthFormStateContext } from '@molecule/app-auth-shell-solid'
|
|
27
|
+
* import { createSessionStorageProvider } from '@molecule/app-storage-localstorage'
|
|
28
|
+
*
|
|
29
|
+
* const sessionStore = createSessionStorageProvider({ prefix: 'auth_' })
|
|
30
|
+
*
|
|
31
|
+
* export function Login() {
|
|
32
|
+
* const { fields, setField } = useAuthFormStateContext()
|
|
33
|
+
* return (
|
|
34
|
+
* <AuthShell
|
|
35
|
+
* heading="Sign in"
|
|
36
|
+
* subheading="Welcome back."
|
|
37
|
+
* brand={<h2>Acme</h2>}
|
|
38
|
+
* formStateStorage={sessionStore}
|
|
39
|
+
* footer={<p>No account? Sign up</p>}
|
|
40
|
+
* >
|
|
41
|
+
* <form>
|
|
42
|
+
* <input value={fields().email ?? ''} onInput={(e) => setField('email', e.currentTarget.value)} />
|
|
43
|
+
* </form>
|
|
44
|
+
* </AuthShell>
|
|
45
|
+
* )
|
|
46
|
+
* }
|
|
47
|
+
* ```
|
|
48
|
+
*
|
|
49
|
+
* @remarks
|
|
50
|
+
* `AuthShell` renders the binding's router `<Link>` ("Back to home") by
|
|
51
|
+
* default, so it MUST be rendered under a `MoleculeProvider` whose config has a
|
|
52
|
+
* router; pass `showBackLink={false}` in router-less setups. The back link's
|
|
53
|
+
* arrow uses the Material Symbols icon font; the glyph span is
|
|
54
|
+
* `aria-hidden="true"`, so the link's accessible name is its `t()` label alone.
|
|
55
|
+
* Form-state persistence defaults to a process-shared in-memory store (survives
|
|
56
|
+
* route swaps, not reloads) — inject
|
|
57
|
+
* `createSessionStorageProvider()` for reload-safe, tab-scoped persistence.
|
|
58
|
+
* Translations come from the companion `@molecule/app-locales-auth-shell`
|
|
59
|
+
* locale bond.
|
|
60
|
+
*
|
|
61
|
+
* @module
|
|
62
|
+
*/
|
|
63
|
+
export * from './AuthFormStateProvider.jsx';
|
|
64
|
+
export * from './AuthShell.jsx';
|
|
65
|
+
export * from './types.js';
|
|
66
|
+
export * from './useAuthFormState.js';
|
|
67
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6DG;AAEH,cAAc,6BAA6B,CAAA;AAC3C,cAAc,iBAAiB,CAAA;AAC/B,cAAc,YAAY,CAAA;AAC1B,cAAc,uBAAuB,CAAA"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@molecule/app-auth-shell-solid` — centered glassmorphic shell for auth pages
|
|
3
|
+
* (Login, Signup, ForgotPassword, ResetPassword), the Solid counterpart of
|
|
4
|
+
* `@molecule/app-auth-shell-react`: the same exports, the same props (React
|
|
5
|
+
* names), and the same DOM for the same input.
|
|
6
|
+
*
|
|
7
|
+
* Apps pass per-app `decoration` (orbs, gradient backdrop) and `brand` (logo +
|
|
8
|
+
* tagline) as JSX props. The shell handles layout, the glass card,
|
|
9
|
+
* heading/subheading, body, footer, and the "Back to home" link.
|
|
10
|
+
*
|
|
11
|
+
* The shell also provides its content through `<AuthFormStateProvider>`, so any
|
|
12
|
+
* form rendered inside inherits cross-view email persistence. Forms read it via
|
|
13
|
+
* `useAuthFormStateContext()`, or use the standalone `useAuthFormState`
|
|
14
|
+
* primitive. Persistence flows through the `@molecule/app-storage`
|
|
15
|
+
* `StorageProvider` abstraction (never raw `sessionStorage`), defaulting to a
|
|
16
|
+
* process-shared in-memory store.
|
|
17
|
+
*
|
|
18
|
+
* Besides the `AuthShell` preset, the package exports the composable
|
|
19
|
+
* primitives — `AuthShellContainer`, `AuthShellDecoration`, `AuthShellCard`,
|
|
20
|
+
* `AuthShellHeading`, `AuthShellFooter`, `AuthShellBackLink` — plus a
|
|
21
|
+
* two-column family for the split layout: `AuthShellSplit` >
|
|
22
|
+
* `AuthShellSplitRow` > (`AuthShellPanel` + `AuthShellCardColumn`).
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```tsx
|
|
26
|
+
* import { AuthShell, useAuthFormStateContext } from '@molecule/app-auth-shell-solid'
|
|
27
|
+
* import { createSessionStorageProvider } from '@molecule/app-storage-localstorage'
|
|
28
|
+
*
|
|
29
|
+
* const sessionStore = createSessionStorageProvider({ prefix: 'auth_' })
|
|
30
|
+
*
|
|
31
|
+
* export function Login() {
|
|
32
|
+
* const { fields, setField } = useAuthFormStateContext()
|
|
33
|
+
* return (
|
|
34
|
+
* <AuthShell
|
|
35
|
+
* heading="Sign in"
|
|
36
|
+
* subheading="Welcome back."
|
|
37
|
+
* brand={<h2>Acme</h2>}
|
|
38
|
+
* formStateStorage={sessionStore}
|
|
39
|
+
* footer={<p>No account? Sign up</p>}
|
|
40
|
+
* >
|
|
41
|
+
* <form>
|
|
42
|
+
* <input value={fields().email ?? ''} onInput={(e) => setField('email', e.currentTarget.value)} />
|
|
43
|
+
* </form>
|
|
44
|
+
* </AuthShell>
|
|
45
|
+
* )
|
|
46
|
+
* }
|
|
47
|
+
* ```
|
|
48
|
+
*
|
|
49
|
+
* @remarks
|
|
50
|
+
* `AuthShell` renders the binding's router `<Link>` ("Back to home") by
|
|
51
|
+
* default, so it MUST be rendered under a `MoleculeProvider` whose config has a
|
|
52
|
+
* router; pass `showBackLink={false}` in router-less setups. The back link's
|
|
53
|
+
* arrow uses the Material Symbols icon font; the glyph span is
|
|
54
|
+
* `aria-hidden="true"`, so the link's accessible name is its `t()` label alone.
|
|
55
|
+
* Form-state persistence defaults to a process-shared in-memory store (survives
|
|
56
|
+
* route swaps, not reloads) — inject
|
|
57
|
+
* `createSessionStorageProvider()` for reload-safe, tab-scoped persistence.
|
|
58
|
+
* Translations come from the companion `@molecule/app-locales-auth-shell`
|
|
59
|
+
* locale bond.
|
|
60
|
+
*
|
|
61
|
+
* @module
|
|
62
|
+
*/
|
|
63
|
+
export * from './AuthFormStateProvider.jsx';
|
|
64
|
+
export * from './AuthShell.jsx';
|
|
65
|
+
export * from './types.js';
|
|
66
|
+
export * from './useAuthFormState.js';
|
|
67
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6DG;AAEH,cAAc,6BAA6B,CAAA;AAC3C,cAAc,iBAAiB,CAAA;AAC/B,cAAc,YAAY,CAAA;AAC1B,cAAc,uBAAuB,CAAA"}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Types for the Solid auth-page layout shell — the Solid counterpart of
|
|
3
|
+
* `@molecule/app-auth-shell-react`: the same props (React names) and the same
|
|
4
|
+
* DOM for the same input.
|
|
5
|
+
*
|
|
6
|
+
* @module
|
|
7
|
+
*/
|
|
8
|
+
import type { Accessor, JSX } from 'solid-js';
|
|
9
|
+
import type { StorageProvider } from '@molecule/app-storage';
|
|
10
|
+
/**
|
|
11
|
+
* Shared auth form field values. `email` is the canonical cross-view field;
|
|
12
|
+
* additional string fields (e.g. a name carried from Signup) may be stored
|
|
13
|
+
* alongside it.
|
|
14
|
+
*/
|
|
15
|
+
export interface AuthFormFields {
|
|
16
|
+
/** Email address, shared across all auth views. */
|
|
17
|
+
email?: string;
|
|
18
|
+
/** Any other shared string field (e.g. `name`). */
|
|
19
|
+
[field: string]: string | undefined;
|
|
20
|
+
}
|
|
21
|
+
/** Options for {@link useAuthFormState}. */
|
|
22
|
+
export interface UseAuthFormStateOptions {
|
|
23
|
+
/** Storage provider backing persistence (defaults to a process-shared in-memory provider). */
|
|
24
|
+
storage?: StorageProvider;
|
|
25
|
+
/** Storage key for the persisted fields. Defaults to `molecule.auth.form-state`. */
|
|
26
|
+
storageKey?: string;
|
|
27
|
+
/** Seed values used before hydration completes / when storage is empty. */
|
|
28
|
+
initialFields?: AuthFormFields;
|
|
29
|
+
}
|
|
30
|
+
/** The value {@link useAuthFormState} returns. */
|
|
31
|
+
export interface AuthFormState {
|
|
32
|
+
/** Current field values (email + any shared fields), as an accessor. */
|
|
33
|
+
fields: Accessor<AuthFormFields>;
|
|
34
|
+
/** `true` once the initial read from storage has completed, as an accessor. */
|
|
35
|
+
hydrated: Accessor<boolean>;
|
|
36
|
+
/** Sets a single field and persists the new state. */
|
|
37
|
+
setField: (name: string, value: string) => void;
|
|
38
|
+
/** Merges a patch of fields and persists the new state. */
|
|
39
|
+
setFields: (patch: AuthFormFields) => void;
|
|
40
|
+
/** Clears all persisted auth form state and removes the storage key. */
|
|
41
|
+
clear: () => void;
|
|
42
|
+
}
|
|
43
|
+
/** Props for {@link AuthFormStateProvider}. */
|
|
44
|
+
export interface AuthFormStateProviderProps {
|
|
45
|
+
/** Children rendered inside the provider. */
|
|
46
|
+
children?: JSX.Element;
|
|
47
|
+
/** Storage provider backing persistence (defaults to a shared in-memory provider). */
|
|
48
|
+
storage?: StorageProvider;
|
|
49
|
+
/** Storage key for the persisted fields. */
|
|
50
|
+
storageKey?: string;
|
|
51
|
+
/** Seed values used before hydration / when storage is empty. */
|
|
52
|
+
initialFields?: AuthFormFields;
|
|
53
|
+
}
|
|
54
|
+
/** Props accepted by {@link AuthShellContainer}. */
|
|
55
|
+
export interface AuthShellContainerProps {
|
|
56
|
+
/** Content rendered inside the container. */
|
|
57
|
+
children?: JSX.Element;
|
|
58
|
+
/** Optional CSS background applied to the container. */
|
|
59
|
+
style?: JSX.CSSProperties;
|
|
60
|
+
/** Extra classes appended after the defaults. */
|
|
61
|
+
className?: string;
|
|
62
|
+
/** Layout direction. Defaults to `'centered'`; pass `'column'` for a vertical stack. */
|
|
63
|
+
layout?: 'centered' | 'column';
|
|
64
|
+
}
|
|
65
|
+
/** Props accepted by {@link AuthShellCard}. */
|
|
66
|
+
export interface AuthShellCardProps {
|
|
67
|
+
/** Content rendered inside the card. */
|
|
68
|
+
children?: JSX.Element;
|
|
69
|
+
/** Override the default glass surface. */
|
|
70
|
+
surfaceClassName?: string;
|
|
71
|
+
/** Extra layout classes appended after the flex/padding defaults. */
|
|
72
|
+
className?: string;
|
|
73
|
+
/** Override the outer `<main>` wrapper classes. */
|
|
74
|
+
outerClassName?: string;
|
|
75
|
+
/** `data-mol-id` pass-through for E2E selectors. */
|
|
76
|
+
dataMolId?: string;
|
|
77
|
+
/** Optional CSS style applied to the card's inner surface. */
|
|
78
|
+
style?: JSX.CSSProperties;
|
|
79
|
+
}
|
|
80
|
+
/** Props accepted by {@link AuthShellHeading}. */
|
|
81
|
+
export interface AuthShellHeadingProps {
|
|
82
|
+
/** The heading text. */
|
|
83
|
+
heading: string;
|
|
84
|
+
/** Optional subheading paragraph. */
|
|
85
|
+
subheading?: string;
|
|
86
|
+
/** Optional small uppercase tag rendered above the heading. */
|
|
87
|
+
eyebrow?: string;
|
|
88
|
+
/** Optional override for the h1 className. */
|
|
89
|
+
headingClassName?: string;
|
|
90
|
+
/** Optional override for the h1 style. */
|
|
91
|
+
headingStyle?: JSX.CSSProperties;
|
|
92
|
+
}
|
|
93
|
+
/** Props accepted by {@link AuthShellBackLink}. */
|
|
94
|
+
export interface AuthShellBackLinkProps {
|
|
95
|
+
/** Destination. Defaults to `/`. */
|
|
96
|
+
to?: string;
|
|
97
|
+
/** Translated label override; falls back to `auth.backHome` → "Back to home" when absent, empty or blank. */
|
|
98
|
+
label?: string;
|
|
99
|
+
}
|
|
100
|
+
/** Props accepted by {@link AuthShellSplit}. */
|
|
101
|
+
export interface AuthShellSplitProps extends JSX.HTMLAttributes<HTMLDivElement> {
|
|
102
|
+
/** The split row (and optionally a site footer sibling). */
|
|
103
|
+
children?: JSX.Element;
|
|
104
|
+
/** Cosmetic classes (background, text color, font) for the outer container. */
|
|
105
|
+
className?: string;
|
|
106
|
+
}
|
|
107
|
+
/** Props accepted by {@link AuthShellSplitRow}. */
|
|
108
|
+
export interface AuthShellSplitRowProps extends JSX.HTMLAttributes<HTMLElement> {
|
|
109
|
+
/** The brand panel and the card column. */
|
|
110
|
+
children?: JSX.Element;
|
|
111
|
+
/** Layout classes for the row (typically `cm.flex({})` or `cm.grid({ cols: 2 })`). */
|
|
112
|
+
className?: string;
|
|
113
|
+
}
|
|
114
|
+
/** Props accepted by {@link AuthShellPanel}. */
|
|
115
|
+
export interface AuthShellPanelProps extends JSX.HTMLAttributes<HTMLElement> {
|
|
116
|
+
/** The app's bespoke decoration, wordmark or social proof. */
|
|
117
|
+
children?: JSX.Element;
|
|
118
|
+
/** Cosmetic classes — width ratio, padding, gradient, positioning. */
|
|
119
|
+
className?: string;
|
|
120
|
+
}
|
|
121
|
+
/** Props accepted by {@link AuthShellCardColumn}. */
|
|
122
|
+
export interface AuthShellCardColumnProps extends JSX.HTMLAttributes<HTMLElement> {
|
|
123
|
+
/** The form card content. */
|
|
124
|
+
children?: JSX.Element;
|
|
125
|
+
/** Cosmetic classes — width ratio, padding. */
|
|
126
|
+
className?: string;
|
|
127
|
+
/** Element to render. Defaults to `'section'`. */
|
|
128
|
+
as?: 'section' | 'main';
|
|
129
|
+
}
|
|
130
|
+
/** Props accepted by {@link AuthShell}. */
|
|
131
|
+
export interface AuthShellProps {
|
|
132
|
+
/** The heading text. */
|
|
133
|
+
heading: string;
|
|
134
|
+
/** The subheading text. */
|
|
135
|
+
subheading: string;
|
|
136
|
+
/** The form body. */
|
|
137
|
+
children?: JSX.Element;
|
|
138
|
+
/** Optional footer node. */
|
|
139
|
+
footer?: JSX.Element;
|
|
140
|
+
/** Optional brand node rendered above the heading. */
|
|
141
|
+
brand?: JSX.Element;
|
|
142
|
+
/** Optional background decoration node. */
|
|
143
|
+
decoration?: JSX.Element;
|
|
144
|
+
/** Destination of the back link. Defaults to `/`. */
|
|
145
|
+
backTo?: string;
|
|
146
|
+
/** Whether to render the back link. Defaults to `true`. */
|
|
147
|
+
showBackLink?: boolean;
|
|
148
|
+
/** Storage provider backing cross-view auth form persistence. */
|
|
149
|
+
formStateStorage?: StorageProvider;
|
|
150
|
+
/** Storage key for the persisted auth form state. */
|
|
151
|
+
formStateKey?: string;
|
|
152
|
+
}
|
|
153
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAE7C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAE5D;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC7B,mDAAmD;IACnD,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,mDAAmD;IACnD,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAA;CACpC;AAED,4CAA4C;AAC5C,MAAM,WAAW,uBAAuB;IACtC,8FAA8F;IAC9F,OAAO,CAAC,EAAE,eAAe,CAAA;IACzB,oFAAoF;IACpF,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,2EAA2E;IAC3E,aAAa,CAAC,EAAE,cAAc,CAAA;CAC/B;AAED,kDAAkD;AAClD,MAAM,WAAW,aAAa;IAC5B,wEAAwE;IACxE,MAAM,EAAE,QAAQ,CAAC,cAAc,CAAC,CAAA;IAChC,+EAA+E;IAC/E,QAAQ,EAAE,QAAQ,C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AAA;IAClB,kDAAkD;IAClD,EAAE,CAAC,EAAE,SAAS,GAAG,MAAM,CAAA;CACxB;AAED,2CAA2C;AAC3C,MAAM,WAAW,cAAc;IAC7B,wBAAwB;IACxB,OAAO,EAAE,MAAM,CAAA;IACf,2BAA2B;IAC3B,UAAU,EAAE,MAAM,CAAA;IAClB,qBAAqB;IACrB,QAAQ,CAAC,EAAE,GAAG,CAAC,OAAO,CAAA;IACtB,4BAA4B;IAC5B,MAAM,CAAC,EAAE,GAAG,CAAC,OAAO,CAAA;IACpB,sDAAsD;IACtD,KAAK,CAAC,EAAE,GAAG,CAAC,OAAO,CAAA;IACnB,2CAA2C;IAC3C,UAAU,CAAC,EAAE,GAAG,CAAC,OAAO,CAAA;IACxB,qDAAqD;IACrD,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,2DAA2D;IAC3D,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,iEAAiE;IACjE,gBAAgB,CAAC,EAAE,eAAe,CAAA;IAClC,qDAAqD;IACrD,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB"}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `useAuthFormState` (Solid primitive) — cross-view auth form persistence.
|
|
3
|
+
*
|
|
4
|
+
* Holds the email (and any other shared auth fields) so a value typed on one
|
|
5
|
+
* auth view (Login / Signup / ForgotPassword / ResetPassword) is carried over
|
|
6
|
+
* when the user navigates to another. Backed by the `@molecule/app-storage`
|
|
7
|
+
* `StorageProvider` abstraction (never raw `sessionStorage`/`localStorage`).
|
|
8
|
+
*
|
|
9
|
+
* The state is CLEARED on successful auth (call `clear()` from the success
|
|
10
|
+
* handler) so credentials do not linger.
|
|
11
|
+
*
|
|
12
|
+
* @module
|
|
13
|
+
*/
|
|
14
|
+
import type { AuthFormState, UseAuthFormStateOptions } from './types.js';
|
|
15
|
+
/** Default storage key for persisted auth form fields. */
|
|
16
|
+
export declare const DEFAULT_AUTH_FORM_STATE_KEY = "molecule.auth.form-state";
|
|
17
|
+
/**
|
|
18
|
+
* Solid primitive holding email + shared auth fields, persisted across auth
|
|
19
|
+
* views via an injectable `StorageProvider` and cleared on successful auth.
|
|
20
|
+
*
|
|
21
|
+
* @param options - Optional storage provider, storage key, and seed fields.
|
|
22
|
+
* @returns The current fields plus `setField`/`setFields`/`clear` and a `hydrated` flag.
|
|
23
|
+
*/
|
|
24
|
+
export declare function useAuthFormState(options?: UseAuthFormStateOptions): AuthFormState;
|
|
25
|
+
//# sourceMappingURL=useAuthFormState.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useAuthFormState.d.ts","sourceRoot":"","sources":["../src/useAuthFormState.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAOH,OAAO,KAAK,EAAkB,aAAa,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAA;AAExF,0DAA0D;AAC1D,eAAO,MAAM,2BAA2B,6BAA6B,CAAA;AAoBrE;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,CAAC,EAAE,uBAAuB,GAAG,aAAa,CAkFjF"}
|