@passui/tanstack 0.3.1 → 0.4.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.
|
@@ -9,12 +9,24 @@ type WindowProps = ComponentPropsWithoutRef<"body"> & {
|
|
|
9
9
|
* body", not nested inside the app's content wrapper.
|
|
10
10
|
*/
|
|
11
11
|
after?: ReactNode;
|
|
12
|
+
/**
|
|
13
|
+
* `"container"` (default) fixes `<body>` and scrolls inside `<main>`.
|
|
14
|
+
* `"document"` lets the page itself scroll, which is what lets iOS Safari
|
|
15
|
+
* collapse its toolbar and tint the overscroll area.
|
|
16
|
+
*/
|
|
17
|
+
scroll?: "container" | "document";
|
|
18
|
+
/**
|
|
19
|
+
* iOS only: a 6px transparent strip fixed to the bottom edge, so Safari
|
|
20
|
+
* treats the area under the toolbar as page chrome. Off unless a real
|
|
21
|
+
* device shows the gap it closes.
|
|
22
|
+
*/
|
|
23
|
+
edgeShim?: boolean;
|
|
12
24
|
};
|
|
13
25
|
export declare function ComposeViewport({ children, lang, className, ...props }: ComposeViewportProps): import("react").JSX.Element;
|
|
14
26
|
export declare namespace ComposeViewport {
|
|
15
27
|
export { Window };
|
|
16
28
|
export { Devtools };
|
|
17
29
|
}
|
|
18
|
-
declare function Window({ className, children, after, ...props }: WindowProps): import("react").JSX.Element;
|
|
30
|
+
declare function Window({ className, children, after, scroll, edgeShim, ...props }: WindowProps): import("react").JSX.Element;
|
|
19
31
|
declare function Devtools(): import("react").JSX.Element;
|
|
20
32
|
export {};
|
|
@@ -13,14 +13,23 @@ function ComposeViewport({ children, lang = "en", className, ...props }) {
|
|
|
13
13
|
children
|
|
14
14
|
});
|
|
15
15
|
}
|
|
16
|
-
function Window({ className, children, after, ...props }) {
|
|
16
|
+
function Window({ className, children, after, scroll = "container", edgeShim = false, ...props }) {
|
|
17
|
+
const documentScroll = scroll === "document";
|
|
17
18
|
return /* @__PURE__ */ jsxs("body", {
|
|
18
|
-
className: cn("bg-background
|
|
19
|
+
className: cn("bg-background w-full min-w-full", "selection:bg-accent/20", "typeset wrap-anywhere duration-200", "flex flex-col", documentScroll ? "min-h-dvh overflow-x-clip" : "fixed h-svh overflow-x-hidden", className),
|
|
19
20
|
...props,
|
|
20
|
-
children: [
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
children: [
|
|
22
|
+
/* @__PURE__ */ jsx("main", {
|
|
23
|
+
className: cn("no-scrollbar flex flex-1 flex-col", documentScroll ? "min-h-0 overflow-visible" : "min-h-svh overflow-auto"),
|
|
24
|
+
children
|
|
25
|
+
}),
|
|
26
|
+
edgeShim && /* @__PURE__ */ jsx("div", {
|
|
27
|
+
"aria-hidden": "true",
|
|
28
|
+
"data-slot": "edge-shim",
|
|
29
|
+
className: "ios:block pointer-events-none fixed inset-x-0 -bottom-px z-9999 hidden h-1.5 w-full"
|
|
30
|
+
}),
|
|
31
|
+
after
|
|
32
|
+
]
|
|
24
33
|
});
|
|
25
34
|
}
|
|
26
35
|
function Devtools() {
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Head tags every Passui document needs. Spread them into the root route's
|
|
3
|
+
* `head().meta`:
|
|
4
|
+
*
|
|
5
|
+
* meta: [{ charSet: "utf-8" }, viewportMeta, ...themeColorMeta({ light, dark })]
|
|
6
|
+
*/
|
|
7
|
+
/** `viewport-fit=cover` lets `env(safe-area-inset-*)` report the notch and home bar. */
|
|
8
|
+
export declare const viewportMeta: {
|
|
9
|
+
readonly name: "viewport";
|
|
10
|
+
readonly content: "width=device-width, initial-scale=1, viewport-fit=cover";
|
|
11
|
+
};
|
|
12
|
+
/** Tints the browser chrome on Android. iOS Safari reads the page background instead. */
|
|
13
|
+
export declare function themeColorMeta(colors: {
|
|
14
|
+
light: string;
|
|
15
|
+
dark: string;
|
|
16
|
+
}): readonly [{
|
|
17
|
+
readonly name: "theme-color";
|
|
18
|
+
readonly content: string;
|
|
19
|
+
readonly media: "(prefers-color-scheme: light)";
|
|
20
|
+
}, {
|
|
21
|
+
readonly name: "theme-color";
|
|
22
|
+
readonly content: string;
|
|
23
|
+
readonly media: "(prefers-color-scheme: dark)";
|
|
24
|
+
}];
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// src/document/meta.ts
|
|
2
|
+
/**
|
|
3
|
+
* Head tags every Passui document needs. Spread them into the root route's
|
|
4
|
+
* `head().meta`:
|
|
5
|
+
*
|
|
6
|
+
* meta: [{ charSet: "utf-8" }, viewportMeta, ...themeColorMeta({ light, dark })]
|
|
7
|
+
*/
|
|
8
|
+
/** `viewport-fit=cover` lets `env(safe-area-inset-*)` report the notch and home bar. */
|
|
9
|
+
const viewportMeta = {
|
|
10
|
+
name: "viewport",
|
|
11
|
+
content: "width=device-width, initial-scale=1, viewport-fit=cover"
|
|
12
|
+
};
|
|
13
|
+
/** Tints the browser chrome on Android. iOS Safari reads the page background instead. */
|
|
14
|
+
function themeColorMeta(colors) {
|
|
15
|
+
return [{
|
|
16
|
+
name: "theme-color",
|
|
17
|
+
content: colors.light,
|
|
18
|
+
media: "(prefers-color-scheme: light)"
|
|
19
|
+
}, {
|
|
20
|
+
name: "theme-color",
|
|
21
|
+
content: colors.dark,
|
|
22
|
+
media: "(prefers-color-scheme: dark)"
|
|
23
|
+
}];
|
|
24
|
+
}
|
|
25
|
+
export { themeColorMeta, viewportMeta };
|
package/dist/document.d.ts
CHANGED
package/dist/document.js
CHANGED