@molecule/app-auth-shell-svelte 0.0.0-stage → 0.0.1-stage

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.
Files changed (60) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +439 -2
  3. package/dist/AuthFormStateProvider.svelte +22 -0
  4. package/dist/AuthFormStateProvider.svelte.d.ts +5 -0
  5. package/dist/AuthFormStateProvider.svelte.d.ts.map +1 -0
  6. package/dist/AuthShell.svelte +56 -0
  7. package/dist/AuthShell.svelte.d.ts +5 -0
  8. package/dist/AuthShell.svelte.d.ts.map +1 -0
  9. package/dist/AuthShellBackLink.svelte +28 -0
  10. package/dist/AuthShellBackLink.svelte.d.ts +5 -0
  11. package/dist/AuthShellBackLink.svelte.d.ts.map +1 -0
  12. package/dist/AuthShellCard.svelte +38 -0
  13. package/dist/AuthShellCard.svelte.d.ts +5 -0
  14. package/dist/AuthShellCard.svelte.d.ts.map +1 -0
  15. package/dist/AuthShellCardColumn.svelte +26 -0
  16. package/dist/AuthShellCardColumn.svelte.d.ts +5 -0
  17. package/dist/AuthShellCardColumn.svelte.d.ts.map +1 -0
  18. package/dist/AuthShellContainer.svelte +31 -0
  19. package/dist/AuthShellContainer.svelte.d.ts +5 -0
  20. package/dist/AuthShellContainer.svelte.d.ts.map +1 -0
  21. package/dist/AuthShellDecoration.svelte +16 -0
  22. package/dist/AuthShellDecoration.svelte.d.ts +8 -0
  23. package/dist/AuthShellDecoration.svelte.d.ts.map +1 -0
  24. package/dist/AuthShellFooter.svelte +18 -0
  25. package/dist/AuthShellFooter.svelte.d.ts +8 -0
  26. package/dist/AuthShellFooter.svelte.d.ts.map +1 -0
  27. package/dist/AuthShellHeading.svelte +38 -0
  28. package/dist/AuthShellHeading.svelte.d.ts +5 -0
  29. package/dist/AuthShellHeading.svelte.d.ts.map +1 -0
  30. package/dist/AuthShellPanel.svelte +18 -0
  31. package/dist/AuthShellPanel.svelte.d.ts +5 -0
  32. package/dist/AuthShellPanel.svelte.d.ts.map +1 -0
  33. package/dist/AuthShellSplit.svelte +18 -0
  34. package/dist/AuthShellSplit.svelte.d.ts +5 -0
  35. package/dist/AuthShellSplit.svelte.d.ts.map +1 -0
  36. package/dist/AuthShellSplitRow.svelte +18 -0
  37. package/dist/AuthShellSplitRow.svelte.d.ts +5 -0
  38. package/dist/AuthShellSplitRow.svelte.d.ts.map +1 -0
  39. package/dist/components.d.ts +19 -0
  40. package/dist/components.d.ts.map +1 -0
  41. package/dist/components.js +18 -0
  42. package/dist/context.d.ts +20 -0
  43. package/dist/context.d.ts.map +1 -0
  44. package/dist/context.js +26 -0
  45. package/dist/index.d.ts +62 -0
  46. package/dist/index.d.ts.map +1 -0
  47. package/dist/index.js +61 -0
  48. package/dist/keys.d.ts +9 -0
  49. package/dist/keys.d.ts.map +1 -0
  50. package/dist/keys.js +8 -0
  51. package/dist/styles.d.ts +20 -0
  52. package/dist/styles.d.ts.map +1 -0
  53. package/dist/styles.js +67 -0
  54. package/dist/types.d.ts +163 -0
  55. package/dist/types.d.ts.map +1 -0
  56. package/dist/types.js +8 -0
  57. package/dist/useAuthFormState.d.ts +27 -0
  58. package/dist/useAuthFormState.d.ts.map +1 -0
  59. package/dist/useAuthFormState.js +122 -0
  60. package/package.json +77 -4
@@ -0,0 +1,56 @@
1
+ <!--
2
+ AuthShell: the Svelte counterpart of `@molecule/app-auth-shell-react`'s
3
+ `AuthShell` — the centered glass card preset (container, decoration, card,
4
+ heading, body, footer, back link), publishing the shared auth-form state to
5
+ descendants through Svelte context.
6
+ -->
7
+ <script lang="ts">
8
+ import { setContext } from 'svelte'
9
+
10
+ import AuthShellBackLink from './AuthShellBackLink.svelte'
11
+ import AuthShellCard from './AuthShellCard.svelte'
12
+ import AuthShellContainer from './AuthShellContainer.svelte'
13
+ import AuthShellDecoration from './AuthShellDecoration.svelte'
14
+ import AuthShellFooter from './AuthShellFooter.svelte'
15
+ import AuthShellHeading from './AuthShellHeading.svelte'
16
+ import { AUTH_FORM_STATE_KEY } from './keys.js'
17
+ import type { AuthShellProps } from './types.js'
18
+ import { useAuthFormState } from './useAuthFormState.js'
19
+
20
+ let {
21
+ heading,
22
+ subheading,
23
+ children,
24
+ footer,
25
+ brand,
26
+ decoration,
27
+ backTo = '/',
28
+ showBackLink = true,
29
+ formStateStorage,
30
+ formStateKey,
31
+ }: AuthShellProps = $props()
32
+
33
+ setContext(
34
+ AUTH_FORM_STATE_KEY,
35
+ useAuthFormState(() => ({ storage: formStateStorage, storageKey: formStateKey })),
36
+ )
37
+ </script>
38
+
39
+ <AuthShellContainer>
40
+ {#if decoration}
41
+ <AuthShellDecoration>{@render decoration()}</AuthShellDecoration>
42
+ {/if}
43
+ <div>
44
+ <AuthShellCard>
45
+ {#if brand}{@render brand()}{/if}
46
+ <AuthShellHeading {heading} {subheading} />
47
+ {@render children()}
48
+ {#if footer}
49
+ <AuthShellFooter>{@render footer()}</AuthShellFooter>
50
+ {/if}
51
+ </AuthShellCard>
52
+ {#if showBackLink}
53
+ <AuthShellBackLink to={backTo} />
54
+ {/if}
55
+ </div>
56
+ </AuthShellContainer>
@@ -0,0 +1,5 @@
1
+ import type { AuthShellProps } from './types.js';
2
+ declare const AuthShell: import("svelte").Component<AuthShellProps, {}, "">;
3
+ type AuthShell = ReturnType<typeof AuthShell>;
4
+ export default AuthShell;
5
+ //# sourceMappingURL=AuthShell.svelte.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AuthShell.svelte.d.ts","sourceRoot":"","sources":["../src/AuthShell.svelte"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAyDhD,QAAA,MAAM,SAAS,oDAAwC,CAAC;AACxD,KAAK,SAAS,GAAG,UAAU,CAAC,OAAO,SAAS,CAAC,CAAC;AAC9C,eAAe,SAAS,CAAC"}
@@ -0,0 +1,28 @@
1
+ <!--
2
+ AuthShellBackLink: the Svelte counterpart of
3
+ `@molecule/app-auth-shell-react`'s `AuthShellBackLink` — the "Back to home"
4
+ router link (or a custom destination/label) rendered below the card. The
5
+ arrow's Material Symbols glyph span is `aria-hidden="true"`, so the link's
6
+ accessible name is its `t()` label alone.
7
+ -->
8
+ <script lang="ts">
9
+ import { Link, useTranslation } from '@molecule/app-svelte'
10
+ import { getClassMap } from '@molecule/app-ui'
11
+
12
+ import type { AuthShellBackLinkProps } from './types.js'
13
+
14
+ let { to = '/', label }: AuthShellBackLinkProps = $props()
15
+
16
+ const cm = $derived(getClassMap())
17
+ const { t } = useTranslation()
18
+ </script>
19
+
20
+ <p class={cm.cn(cm.textCenter, cm.textSize('xs'), cm.sp('mt', 6), cm.authShellBackLink)}>
21
+ <Link {to} class={cm.cn(cm.flex({ align: 'center', gap: 'xs' }), cm.authShellBackLinkAnchor)}>
22
+ <!-- The Material Symbols ligature name paints a glyph, not text — hidden
23
+ from the accessibility tree so the link's accessible name is its t() label
24
+ alone. Svelte strips this comment from the rendered DOM. -->
25
+ <span class={cm.iconGlyphFont} style="font-size: 14px" aria-hidden="true">arrow_back</span>
26
+ {label?.trim() ? label : t('auth.backHome', undefined, { defaultValue: 'Back to home' })}
27
+ </Link>
28
+ </p>
@@ -0,0 +1,5 @@
1
+ import type { AuthShellBackLinkProps } from './types.js';
2
+ declare const AuthShellBackLink: import("svelte").Component<AuthShellBackLinkProps, {}, "">;
3
+ type AuthShellBackLink = ReturnType<typeof AuthShellBackLink>;
4
+ export default AuthShellBackLink;
5
+ //# sourceMappingURL=AuthShellBackLink.svelte.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AuthShellBackLink.svelte.d.ts","sourceRoot":"","sources":["../src/AuthShellBackLink.svelte"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AAyBzD,QAAA,MAAM,iBAAiB,4DAAwC,CAAC;AAChE,KAAK,iBAAiB,GAAG,UAAU,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAC9D,eAAe,iBAAiB,CAAC"}
@@ -0,0 +1,38 @@
1
+ <!--
2
+ AuthShellCard: the Svelte counterpart of
3
+ `@molecule/app-auth-shell-react`'s `AuthShellCard` — the centered
4
+ glassmorphic card surface with an overridable outer and inner treatment.
5
+ -->
6
+ <script lang="ts">
7
+ import { getClassMap } from '@molecule/app-ui'
8
+
9
+ import { toStyleText } from './styles.js'
10
+ import type { AuthShellCardProps } from './types.js'
11
+
12
+ let {
13
+ children,
14
+ surfaceClassName,
15
+ className,
16
+ outerClassName,
17
+ dataMolId,
18
+ style,
19
+ }: AuthShellCardProps = $props()
20
+
21
+ const cm = $derived(getClassMap())
22
+ const outer = $derived(outerClassName ?? cm.cn(cm.w('full'), cm.authShellCardOuter))
23
+ </script>
24
+
25
+ <main class={outer}>
26
+ <div
27
+ class={cm.cn(
28
+ cm.flex({ direction: 'col', gap: 'lg' }),
29
+ cm.sp('p', 8),
30
+ surfaceClassName ?? cm.authShellCardSurface,
31
+ className,
32
+ )}
33
+ style={toStyleText(style)}
34
+ data-mol-id={dataMolId}
35
+ >
36
+ {@render children?.()}
37
+ </div>
38
+ </main>
@@ -0,0 +1,5 @@
1
+ import type { AuthShellCardProps } from './types.js';
2
+ declare const AuthShellCard: import("svelte").Component<AuthShellCardProps, {}, "">;
3
+ type AuthShellCard = ReturnType<typeof AuthShellCard>;
4
+ export default AuthShellCard;
5
+ //# sourceMappingURL=AuthShellCard.svelte.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AuthShellCard.svelte.d.ts","sourceRoot":"","sources":["../src/AuthShellCard.svelte"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAmCrD,QAAA,MAAM,aAAa,wDAAwC,CAAC;AAC5D,KAAK,aAAa,GAAG,UAAU,CAAC,OAAO,aAAa,CAAC,CAAC;AACtD,eAAe,aAAa,CAAC"}
@@ -0,0 +1,26 @@
1
+ <!--
2
+ AuthShellCardColumn: the Svelte counterpart of
3
+ `@molecule/app-auth-shell-react`'s `AuthShellCardColumn` — a centered
4
+ `<section>` (or `<main>`, via `as`) that holds the form card.
5
+ -->
6
+ <script lang="ts">
7
+ import { getClassMap } from '@molecule/app-ui'
8
+
9
+ import type { AuthShellCardColumnProps } from './types.js'
10
+
11
+ let { children, className, as = 'section', ...rest }: AuthShellCardColumnProps = $props()
12
+
13
+ const cm = $derived(getClassMap())
14
+ </script>
15
+
16
+ <svelte:element
17
+ this={as}
18
+ class={cm.cn(
19
+ cm.flex({ direction: 'col', align: 'center', justify: 'center' }),
20
+ cm.minW(0),
21
+ className,
22
+ )}
23
+ {...rest}
24
+ >
25
+ {@render children?.()}
26
+ </svelte:element>
@@ -0,0 +1,5 @@
1
+ import type { AuthShellCardColumnProps } from './types.js';
2
+ declare const AuthShellCardColumn: import("svelte").Component<AuthShellCardColumnProps, {}, "">;
3
+ type AuthShellCardColumn = ReturnType<typeof AuthShellCardColumn>;
4
+ export default AuthShellCardColumn;
5
+ //# sourceMappingURL=AuthShellCardColumn.svelte.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AuthShellCardColumn.svelte.d.ts","sourceRoot":"","sources":["../src/AuthShellCardColumn.svelte"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAC;AAuB3D,QAAA,MAAM,mBAAmB,8DAAwC,CAAC;AAClE,KAAK,mBAAmB,GAAG,UAAU,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAClE,eAAe,mBAAmB,CAAC"}
@@ -0,0 +1,31 @@
1
+ <!--
2
+ AuthShellContainer: the Svelte counterpart of
3
+ `@molecule/app-auth-shell-react`'s `AuthShellContainer` — outer full-screen
4
+ container, centered flex (default) or a vertical column, with optional
5
+ background decoration.
6
+ -->
7
+ <script lang="ts">
8
+ import { getClassMap } from '@molecule/app-ui'
9
+
10
+ import { toStyleText } from './styles.js'
11
+ import type { AuthShellContainerProps } from './types.js'
12
+
13
+ let { children, style, className, layout = 'centered' }: AuthShellContainerProps = $props()
14
+
15
+ const cm = $derived(getClassMap())
16
+
17
+ const base = $derived(
18
+ layout === 'column'
19
+ ? cm.cn(cm.flex({ direction: 'col' }), cm.minH('screen'), cm.authShellContainer)
20
+ : cm.cn(
21
+ cm.flex({ align: 'center', justify: 'center' }),
22
+ cm.minH('screen'),
23
+ cm.sp('p', 6),
24
+ cm.authShellContainer,
25
+ ),
26
+ )
27
+ </script>
28
+
29
+ <div class={cm.cn(base, className)} style={toStyleText(style)}>
30
+ {@render children?.()}
31
+ </div>
@@ -0,0 +1,5 @@
1
+ import type { AuthShellContainerProps } from './types.js';
2
+ declare const AuthShellContainer: import("svelte").Component<AuthShellContainerProps, {}, "">;
3
+ type AuthShellContainer = ReturnType<typeof AuthShellContainer>;
4
+ export default AuthShellContainer;
5
+ //# sourceMappingURL=AuthShellContainer.svelte.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AuthShellContainer.svelte.d.ts","sourceRoot":"","sources":["../src/AuthShellContainer.svelte"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AA+B1D,QAAA,MAAM,kBAAkB,6DAAwC,CAAC;AACjE,KAAK,kBAAkB,GAAG,UAAU,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAChE,eAAe,kBAAkB,CAAC"}
@@ -0,0 +1,16 @@
1
+ <!--
2
+ AuthShellDecoration: the Svelte counterpart of
3
+ `@molecule/app-auth-shell-react`'s `AuthShellDecoration` — absolute-positioned
4
+ background decoration (orbs, mesh gradients, radial glows).
5
+ -->
6
+ <script lang="ts">
7
+ import type { Snippet } from 'svelte'
8
+
9
+ import { getClassMap } from '@molecule/app-ui'
10
+
11
+ let { children }: { children?: Snippet } = $props()
12
+
13
+ const cm = $derived(getClassMap())
14
+ </script>
15
+
16
+ <div class={cm.cn(cm.authShellDecoration)}>{@render children?.()}</div>
@@ -0,0 +1,8 @@
1
+ import type { Snippet } from 'svelte';
2
+ type $$ComponentProps = {
3
+ children?: Snippet;
4
+ };
5
+ declare const AuthShellDecoration: import("svelte").Component<$$ComponentProps, {}, "">;
6
+ type AuthShellDecoration = ReturnType<typeof AuthShellDecoration>;
7
+ export default AuthShellDecoration;
8
+ //# sourceMappingURL=AuthShellDecoration.svelte.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AuthShellDecoration.svelte.d.ts","sourceRoot":"","sources":["../src/AuthShellDecoration.svelte"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAA;AAIpC,KAAK,gBAAgB,GAAI;IAAE,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;AAgBjD,QAAA,MAAM,mBAAmB,sDAAwC,CAAC;AAClE,KAAK,mBAAmB,GAAG,UAAU,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAClE,eAAe,mBAAmB,CAAC"}
@@ -0,0 +1,18 @@
1
+ <!--
2
+ AuthShellFooter: the Svelte counterpart of
3
+ `@molecule/app-auth-shell-react`'s `AuthShellFooter` — small footer text with
4
+ a top border inside the card.
5
+ -->
6
+ <script lang="ts">
7
+ import type { Snippet } from 'svelte'
8
+
9
+ import { getClassMap } from '@molecule/app-ui'
10
+
11
+ let { children }: { children?: Snippet } = $props()
12
+
13
+ const cm = $derived(getClassMap())
14
+ </script>
15
+
16
+ <footer class={cm.cn(cm.textCenter, cm.textSize('sm'), cm.authShellFooter)}>
17
+ {@render children?.()}
18
+ </footer>
@@ -0,0 +1,8 @@
1
+ import type { Snippet } from 'svelte';
2
+ type $$ComponentProps = {
3
+ children?: Snippet;
4
+ };
5
+ declare const AuthShellFooter: import("svelte").Component<$$ComponentProps, {}, "">;
6
+ type AuthShellFooter = ReturnType<typeof AuthShellFooter>;
7
+ export default AuthShellFooter;
8
+ //# sourceMappingURL=AuthShellFooter.svelte.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AuthShellFooter.svelte.d.ts","sourceRoot":"","sources":["../src/AuthShellFooter.svelte"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAA;AAIpC,KAAK,gBAAgB,GAAI;IAAE,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;AAkBjD,QAAA,MAAM,eAAe,sDAAwC,CAAC;AAC9D,KAAK,eAAe,GAAG,UAAU,CAAC,OAAO,eAAe,CAAC,CAAC;AAC1D,eAAe,eAAe,CAAC"}
@@ -0,0 +1,38 @@
1
+ <!--
2
+ AuthShellHeading: the Svelte counterpart of
3
+ `@molecule/app-auth-shell-react`'s `AuthShellHeading` — centered heading block
4
+ with optional eyebrow, h1 and subheading.
5
+ -->
6
+ <script lang="ts">
7
+ import { getClassMap } from '@molecule/app-ui'
8
+
9
+ import { toStyleText } from './styles.js'
10
+ import type { AuthShellHeadingProps } from './types.js'
11
+
12
+ let { heading, subheading, eyebrow, headingClassName, headingStyle }: AuthShellHeadingProps =
13
+ $props()
14
+
15
+ const cm = $derived(getClassMap())
16
+ </script>
17
+
18
+ <header class={cm.flex({ direction: 'col', align: 'center', gap: 'xs' })}>
19
+ {#if eyebrow}
20
+ <span class={cm.cn(cm.textSize('xs'), cm.fontWeight('bold'), cm.authShellHeadingEyebrow)}>
21
+ {eyebrow}
22
+ </span>
23
+ {/if}
24
+ <h1
25
+ class={cm.cn(
26
+ cm.textSize('2xl'),
27
+ cm.fontWeight('bold'),
28
+ cm.authShellHeadingTitle,
29
+ headingClassName,
30
+ )}
31
+ style={toStyleText(headingStyle)}
32
+ >
33
+ {heading}
34
+ </h1>
35
+ {#if subheading}
36
+ <p class={cm.cn(cm.textSize('sm'), cm.authShellHeadingSub)}>{subheading}</p>
37
+ {/if}
38
+ </header>
@@ -0,0 +1,5 @@
1
+ import type { AuthShellHeadingProps } from './types.js';
2
+ declare const AuthShellHeading: import("svelte").Component<AuthShellHeadingProps, {}, "">;
3
+ type AuthShellHeading = ReturnType<typeof AuthShellHeading>;
4
+ export default AuthShellHeading;
5
+ //# sourceMappingURL=AuthShellHeading.svelte.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AuthShellHeading.svelte.d.ts","sourceRoot":"","sources":["../src/AuthShellHeading.svelte"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAoCxD,QAAA,MAAM,gBAAgB,2DAAwC,CAAC;AAC/D,KAAK,gBAAgB,GAAG,UAAU,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAC5D,eAAe,gBAAgB,CAAC"}
@@ -0,0 +1,18 @@
1
+ <!--
2
+ AuthShellPanel: the Svelte counterpart of
3
+ `@molecule/app-auth-shell-react`'s `AuthShellPanel` — the decorative
4
+ brand-panel `<aside>` that collapses on mobile.
5
+ -->
6
+ <script lang="ts">
7
+ import { getClassMap } from '@molecule/app-ui'
8
+
9
+ import type { AuthShellPanelProps } from './types.js'
10
+
11
+ let { children, className, ...rest }: AuthShellPanelProps = $props()
12
+
13
+ const cm = $derived(getClassMap())
14
+ </script>
15
+
16
+ <aside class={cm.cn(cm.authShellPanel, className)} {...rest}>
17
+ {@render children?.()}
18
+ </aside>
@@ -0,0 +1,5 @@
1
+ import type { AuthShellPanelProps } from './types.js';
2
+ declare const AuthShellPanel: import("svelte").Component<AuthShellPanelProps, {}, "">;
3
+ type AuthShellPanel = ReturnType<typeof AuthShellPanel>;
4
+ export default AuthShellPanel;
5
+ //# sourceMappingURL=AuthShellPanel.svelte.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AuthShellPanel.svelte.d.ts","sourceRoot":"","sources":["../src/AuthShellPanel.svelte"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAmBtD,QAAA,MAAM,cAAc,yDAAwC,CAAC;AAC7D,KAAK,cAAc,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AACxD,eAAe,cAAc,CAAC"}
@@ -0,0 +1,18 @@
1
+ <!--
2
+ AuthShellSplit: the Svelte counterpart of
3
+ `@molecule/app-auth-shell-react`'s `AuthShellSplit` — the outer min-h-screen
4
+ flex-column frame for a two-column brand-panel + card auth layout.
5
+ -->
6
+ <script lang="ts">
7
+ import { getClassMap } from '@molecule/app-ui'
8
+
9
+ import type { AuthShellSplitProps } from './types.js'
10
+
11
+ let { children, className, ...rest }: AuthShellSplitProps = $props()
12
+
13
+ const cm = $derived(getClassMap())
14
+ </script>
15
+
16
+ <div class={cm.cn(cm.flex({ direction: 'col' }), cm.minH('screen'), className)} {...rest}>
17
+ {@render children?.()}
18
+ </div>
@@ -0,0 +1,5 @@
1
+ import type { AuthShellSplitProps } from './types.js';
2
+ declare const AuthShellSplit: import("svelte").Component<AuthShellSplitProps, {}, "">;
3
+ type AuthShellSplit = ReturnType<typeof AuthShellSplit>;
4
+ export default AuthShellSplit;
5
+ //# sourceMappingURL=AuthShellSplit.svelte.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AuthShellSplit.svelte.d.ts","sourceRoot":"","sources":["../src/AuthShellSplit.svelte"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAmBtD,QAAA,MAAM,cAAc,yDAAwC,CAAC;AAC7D,KAAK,cAAc,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AACxD,eAAe,cAAc,CAAC"}
@@ -0,0 +1,18 @@
1
+ <!--
2
+ AuthShellSplitRow: the Svelte counterpart of
3
+ `@molecule/app-auth-shell-react`'s `AuthShellSplitRow` — the vertically
4
+ flex-1 `<main>` row holding the brand panel and the card column.
5
+ -->
6
+ <script lang="ts">
7
+ import { getClassMap } from '@molecule/app-ui'
8
+
9
+ import type { AuthShellSplitRowProps } from './types.js'
10
+
11
+ let { children, className, ...rest }: AuthShellSplitRowProps = $props()
12
+
13
+ const cm = $derived(getClassMap())
14
+ </script>
15
+
16
+ <main class={cm.cn(cm.flex1, className)} {...rest}>
17
+ {@render children?.()}
18
+ </main>
@@ -0,0 +1,5 @@
1
+ import type { AuthShellSplitRowProps } from './types.js';
2
+ declare const AuthShellSplitRow: import("svelte").Component<AuthShellSplitRowProps, {}, "">;
3
+ type AuthShellSplitRow = ReturnType<typeof AuthShellSplitRow>;
4
+ export default AuthShellSplitRow;
5
+ //# sourceMappingURL=AuthShellSplitRow.svelte.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AuthShellSplitRow.svelte.d.ts","sourceRoot":"","sources":["../src/AuthShellSplitRow.svelte"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AAmBzD,QAAA,MAAM,iBAAiB,4DAAwC,CAAC;AAChE,KAAK,iBAAiB,GAAG,UAAU,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAC9D,eAAe,iBAAiB,CAAC"}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * The package's components: one Svelte 5 component per React component in
3
+ * `@molecule/app-auth-shell-react`, under the same React name.
4
+ *
5
+ * @module
6
+ */
7
+ export { default as AuthFormStateProvider } from './AuthFormStateProvider.svelte';
8
+ export { default as AuthShell } from './AuthShell.svelte';
9
+ export { default as AuthShellBackLink } from './AuthShellBackLink.svelte';
10
+ export { default as AuthShellCard } from './AuthShellCard.svelte';
11
+ export { default as AuthShellCardColumn } from './AuthShellCardColumn.svelte';
12
+ export { default as AuthShellContainer } from './AuthShellContainer.svelte';
13
+ export { default as AuthShellDecoration } from './AuthShellDecoration.svelte';
14
+ export { default as AuthShellFooter } from './AuthShellFooter.svelte';
15
+ export { default as AuthShellHeading } from './AuthShellHeading.svelte';
16
+ export { default as AuthShellPanel } from './AuthShellPanel.svelte';
17
+ export { default as AuthShellSplit } from './AuthShellSplit.svelte';
18
+ export { default as AuthShellSplitRow } from './AuthShellSplitRow.svelte';
19
+ //# sourceMappingURL=components.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"components.d.ts","sourceRoot":"","sources":["../src/components.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,OAAO,IAAI,qBAAqB,EAAE,MAAM,gCAAgC,CAAA;AACjF,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,oBAAoB,CAAA;AACzD,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AACzE,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,wBAAwB,CAAA;AACjE,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,8BAA8B,CAAA;AAC7E,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,6BAA6B,CAAA;AAC3E,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,8BAA8B,CAAA;AAC7E,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,0BAA0B,CAAA;AACrE,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,2BAA2B,CAAA;AACvE,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,yBAAyB,CAAA;AACnE,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,yBAAyB,CAAA;AACnE,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,4BAA4B,CAAA"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * The package's components: one Svelte 5 component per React component in
3
+ * `@molecule/app-auth-shell-react`, under the same React name.
4
+ *
5
+ * @module
6
+ */
7
+ export { default as AuthFormStateProvider } from './AuthFormStateProvider.svelte';
8
+ export { default as AuthShell } from './AuthShell.svelte';
9
+ export { default as AuthShellBackLink } from './AuthShellBackLink.svelte';
10
+ export { default as AuthShellCard } from './AuthShellCard.svelte';
11
+ export { default as AuthShellCardColumn } from './AuthShellCardColumn.svelte';
12
+ export { default as AuthShellContainer } from './AuthShellContainer.svelte';
13
+ export { default as AuthShellDecoration } from './AuthShellDecoration.svelte';
14
+ export { default as AuthShellFooter } from './AuthShellFooter.svelte';
15
+ export { default as AuthShellHeading } from './AuthShellHeading.svelte';
16
+ export { default as AuthShellPanel } from './AuthShellPanel.svelte';
17
+ export { default as AuthShellSplit } from './AuthShellSplit.svelte';
18
+ export { default as AuthShellSplitRow } from './AuthShellSplitRow.svelte';
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Svelte context wiring for {@link useAuthFormState}.
3
+ *
4
+ * `<AuthShell>` publishes the shared state through `setContext` so any auth
5
+ * form rendered inside inherits cross-view email persistence — call
6
+ * `useAuthFormStateContext()` from the form to bind the shared `email` (and
7
+ * other shared fields) and to `clear()` on successful auth.
8
+ *
9
+ * @module
10
+ */
11
+ import type { AuthFormState } from './types.js';
12
+ /**
13
+ * Reads the shared auth form state from the nearest
14
+ * {@link AuthFormStateProvider} (which `<AuthShell>` renders by default).
15
+ *
16
+ * @returns The shared {@link AuthFormState}.
17
+ * @throws {Error} If called outside an `<AuthFormStateProvider>`/`<AuthShell>`.
18
+ */
19
+ export declare function useAuthFormStateContext(): AuthFormState;
20
+ //# sourceMappingURL=context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAKH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAE/C;;;;;;GAMG;AACH,wBAAgB,uBAAuB,IAAI,aAAa,CAQvD"}
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Svelte context wiring for {@link useAuthFormState}.
3
+ *
4
+ * `<AuthShell>` publishes the shared state through `setContext` so any auth
5
+ * form rendered inside inherits cross-view email persistence — call
6
+ * `useAuthFormStateContext()` from the form to bind the shared `email` (and
7
+ * other shared fields) and to `clear()` on successful auth.
8
+ *
9
+ * @module
10
+ */
11
+ import { getContext } from 'svelte';
12
+ import { AUTH_FORM_STATE_KEY } from './keys.js';
13
+ /**
14
+ * Reads the shared auth form state from the nearest
15
+ * {@link AuthFormStateProvider} (which `<AuthShell>` renders by default).
16
+ *
17
+ * @returns The shared {@link AuthFormState}.
18
+ * @throws {Error} If called outside an `<AuthFormStateProvider>`/`<AuthShell>`.
19
+ */
20
+ export function useAuthFormStateContext() {
21
+ const state = getContext(AUTH_FORM_STATE_KEY);
22
+ if (!state) {
23
+ throw new Error('useAuthFormStateContext must be used within an <AuthFormStateProvider> (or <AuthShell>, which renders one).');
24
+ }
25
+ return state;
26
+ }
@@ -0,0 +1,62 @@
1
+ /**
2
+ * `@molecule/app-auth-shell-svelte` — centered glassmorphic shell for auth
3
+ * pages (Login, Signup, ForgotPassword, ResetPassword), the Svelte counterpart
4
+ * of `@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 snippets. The shell handles layout, the glass card,
9
+ * heading/subheading, body, footer, and the "Back to home" link.
10
+ *
11
+ * The shell also publishes its content through `AuthFormStateProvider` (via
12
+ * Svelte context), so any form rendered inside inherits cross-view email
13
+ * persistence. Forms read it via `useAuthFormStateContext()`, or use the
14
+ * standalone `useAuthFormState` hook. Persistence flows through the
15
+ * `@molecule/app-storage` `StorageProvider` abstraction (never raw
16
+ * `sessionStorage`), defaulting to a 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
+ * ```svelte
26
+ * <script lang="ts">
27
+ * import { AuthShell, useAuthFormStateContext } from '@molecule/app-auth-shell-svelte'
28
+ * import { createSessionStorageProvider } from '@molecule/app-storage-localstorage'
29
+ *
30
+ * const sessionStore = createSessionStorageProvider({ prefix: 'auth_' })
31
+ * </script>
32
+ *
33
+ * <AuthShell
34
+ * heading="Sign in"
35
+ * subheading="Welcome back."
36
+ * formStateStorage={sessionStore}
37
+ * >
38
+ * {#snippet brand()}<h2>Acme</h2>{/snippet}
39
+ * {#snippet footer()}<p>No account? Sign up</p>{/snippet}
40
+ * <LoginForm />
41
+ * </AuthShell>
42
+ * ```
43
+ *
44
+ * @remarks
45
+ * `AuthShell` renders the binding's router `<Link>` ("Back to home") by
46
+ * default, so it MUST be rendered under `setMoleculeContext` with a router;
47
+ * pass `showBackLink={false}` in router-less setups. The back link's arrow
48
+ * uses the Material Symbols icon font; the glyph span is `aria-hidden="true"`,
49
+ * so the link's accessible name is its `t()` label alone. Form-state
50
+ * persistence defaults to a
51
+ * process-shared in-memory store (survives route swaps, not reloads) — inject
52
+ * `createSessionStorageProvider()` for reload-safe, tab-scoped persistence.
53
+ * Translations come from the companion `@molecule/app-locales-auth-shell`
54
+ * locale bond.
55
+ *
56
+ * @module
57
+ */
58
+ export * from './components.js';
59
+ export * from './context.js';
60
+ export * from './types.js';
61
+ export * from './useAuthFormState.js';
62
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwDG;AAEH,cAAc,iBAAiB,CAAA;AAC/B,cAAc,cAAc,CAAA;AAC5B,cAAc,YAAY,CAAA;AAC1B,cAAc,uBAAuB,CAAA"}