@passui/tanstack 0.2.2 → 0.2.3
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.
|
@@ -1,26 +1,13 @@
|
|
|
1
1
|
import { createComponent, getNextElement, getNextMarker, insert, template } from "solid-js/web";
|
|
2
|
-
import {
|
|
3
|
-
import { Outlet, useLocation } from "@tanstack/solid-router";
|
|
2
|
+
import { Outlet } from "@tanstack/solid-router";
|
|
4
3
|
//#region src/solid/auth-shell/auth-shell.tsx
|
|
5
4
|
/** @jsxImportSource solid-js */
|
|
6
|
-
var _tmpl$ = /*#__PURE__*/ template(`<section class="relative isolate flex min-h-dvh flex-col items-center justify-center px-4 py-12"><div class="flex w-full max-w-[26rem] flex-col items-start gap-6"
|
|
7
|
-
var _tmpl$2 = /*#__PURE__*/ template(`<div class="w-full motion-safe:animate-in motion-safe:fade-in-0 motion-safe:slide-in-from-right-4 motion-safe:duration-500">`);
|
|
5
|
+
var _tmpl$ = /*#__PURE__*/ template(`<section class="relative isolate flex min-h-dvh flex-col items-center justify-center px-4 py-12"><div class="flex w-full max-w-[26rem] flex-col items-start gap-6"><!$><!/><div class=w-full>`);
|
|
8
6
|
function AuthShell(props) {
|
|
9
|
-
const location = useLocation();
|
|
10
7
|
return (() => {
|
|
11
|
-
var _el$ = getNextElement(_tmpl$), _el$2 = _el$.firstChild, _el$
|
|
12
|
-
insert(_el$2, () => props.brand, _el$
|
|
13
|
-
insert(_el$
|
|
14
|
-
get when() {
|
|
15
|
-
return location().pathname;
|
|
16
|
-
},
|
|
17
|
-
keyed: true,
|
|
18
|
-
children: (_pathname) => (() => {
|
|
19
|
-
var _el$7 = getNextElement(_tmpl$2);
|
|
20
|
-
insert(_el$7, createComponent(Outlet, {}));
|
|
21
|
-
return _el$7;
|
|
22
|
-
})()
|
|
23
|
-
}), _el$6, _co$2);
|
|
8
|
+
var _el$ = getNextElement(_tmpl$), _el$2 = _el$.firstChild, _el$4 = _el$2.firstChild, [_el$5, _co$] = getNextMarker(_el$4.nextSibling), _el$3 = _el$5.nextSibling;
|
|
9
|
+
insert(_el$2, () => props.brand, _el$5, _co$);
|
|
10
|
+
insert(_el$3, createComponent(Outlet, {}));
|
|
24
11
|
return _el$;
|
|
25
12
|
})();
|
|
26
13
|
}
|
|
@@ -1,28 +1,15 @@
|
|
|
1
1
|
import { createComponent, escape, ssr, ssrHydrationKey } from "solid-js/web";
|
|
2
|
-
import {
|
|
3
|
-
import { Outlet, useLocation } from "@tanstack/solid-router";
|
|
2
|
+
import { Outlet } from "@tanstack/solid-router";
|
|
4
3
|
//#region src/solid/auth-shell/auth-shell.tsx
|
|
5
4
|
/** @jsxImportSource solid-js */
|
|
6
5
|
var _tmpl$ = [
|
|
7
6
|
"<section",
|
|
8
7
|
" class=\"relative isolate flex min-h-dvh flex-col items-center justify-center px-4 py-12\"><div class=\"flex w-full max-w-[26rem] flex-col items-start gap-6\"><!--$-->",
|
|
9
|
-
"
|
|
10
|
-
"
|
|
11
|
-
];
|
|
12
|
-
var _tmpl$2 = [
|
|
13
|
-
"<div",
|
|
14
|
-
" class=\"w-full motion-safe:animate-in motion-safe:fade-in-0 motion-safe:slide-in-from-right-4 motion-safe:duration-500\">",
|
|
15
|
-
"</div>"
|
|
8
|
+
"<!--/--><div class=\"w-full\">",
|
|
9
|
+
"</div></div></section>"
|
|
16
10
|
];
|
|
17
11
|
function AuthShell(props) {
|
|
18
|
-
|
|
19
|
-
return ssr(_tmpl$, ssrHydrationKey(), escape(props.brand), escape(createComponent(Show, {
|
|
20
|
-
get when() {
|
|
21
|
-
return location().pathname;
|
|
22
|
-
},
|
|
23
|
-
keyed: true,
|
|
24
|
-
children: (_pathname) => ssr(_tmpl$2, ssrHydrationKey(), escape(createComponent(Outlet, {})))
|
|
25
|
-
})));
|
|
12
|
+
return ssr(_tmpl$, ssrHydrationKey(), escape(props.brand), escape(createComponent(Outlet, {})));
|
|
26
13
|
}
|
|
27
14
|
//#endregion
|
|
28
15
|
export { AuthShell };
|
package/package.json
CHANGED
|
@@ -1,23 +1,13 @@
|
|
|
1
|
-
import { Outlet
|
|
1
|
+
import { Outlet } from "@tanstack/react-router"
|
|
2
2
|
import type { ReactNode } from "react"
|
|
3
3
|
|
|
4
|
-
/**
|
|
5
|
-
* The frame for every page reached before or outside an app (sign in, create
|
|
6
|
-
* account, recovery, consent): no card, a soft light behind the page, the
|
|
7
|
-
* brand on top, content sliding in as you move through the flow. CSS
|
|
8
|
-
* animations only, so the page is never hidden waiting on JavaScript.
|
|
9
|
-
*/
|
|
4
|
+
/** Auth routes share a stable frame; pages own their transitions. */
|
|
10
5
|
export function AuthShell({ brand }: { brand: ReactNode }) {
|
|
11
|
-
const { pathname } = useLocation()
|
|
12
|
-
|
|
13
6
|
return (
|
|
14
7
|
<section className="relative isolate flex min-h-dvh flex-col items-center justify-center px-4 py-12">
|
|
15
8
|
<div className="flex w-full max-w-[26rem] flex-col items-start gap-6">
|
|
16
9
|
{brand}
|
|
17
|
-
<div
|
|
18
|
-
key={pathname}
|
|
19
|
-
className="w-full motion-safe:animate-in motion-safe:fade-in-0 motion-safe:slide-in-from-right-4 motion-safe:duration-500 motion-safe:ease-out"
|
|
20
|
-
>
|
|
10
|
+
<div className="w-full">
|
|
21
11
|
<Outlet />
|
|
22
12
|
</div>
|
|
23
13
|
</div>
|
|
@@ -1,19 +1,15 @@
|
|
|
1
1
|
/** @jsxImportSource solid-js */
|
|
2
|
-
import { Outlet
|
|
3
|
-
import {
|
|
2
|
+
import { Outlet } from "@tanstack/solid-router"
|
|
3
|
+
import type { JSX } from "solid-js"
|
|
4
|
+
|
|
4
5
|
export function AuthShell(props: { brand: JSX.Element }) {
|
|
5
|
-
const location = useLocation()
|
|
6
6
|
return (
|
|
7
7
|
<section class="relative isolate flex min-h-dvh flex-col items-center justify-center px-4 py-12">
|
|
8
8
|
<div class="flex w-full max-w-[26rem] flex-col items-start gap-6">
|
|
9
9
|
{props.brand}
|
|
10
|
-
<
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
<Outlet />
|
|
14
|
-
</div>
|
|
15
|
-
)}
|
|
16
|
-
</Show>
|
|
10
|
+
<div class="w-full">
|
|
11
|
+
<Outlet />
|
|
12
|
+
</div>
|
|
17
13
|
</div>
|
|
18
14
|
</section>
|
|
19
15
|
)
|