@passui/tanstack 0.3.1 → 0.4.1

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 fixed h-svh w-full min-w-full", "selection:bg-accent/20 overflow-x-hidden", "typeset wrap-anywhere duration-200", "flex flex-col", className),
19
+ className: cn("bg-background w-full min-w-full", "selection:bg-accent/20", "typeset wrap-anywhere duration-200", "flex flex-col", documentScroll ? "h-auto min-h-dvh overflow-x-clip" : "fixed h-svh overflow-x-hidden", className),
19
20
  ...props,
20
- children: [/* @__PURE__ */ jsx("main", {
21
- className: cn("flex min-h-svh flex-1 flex-col overflow-auto", "no-scrollbar"),
22
- children
23
- }), after]
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 };
@@ -1,2 +1,3 @@
1
1
  import { ComposeViewport } from "./document/compose-viewport.js";
2
- export { ComposeViewport };
2
+ import { themeColorMeta, viewportMeta } from "./document/meta.js";
3
+ export { ComposeViewport, themeColorMeta, viewportMeta };
package/dist/document.js CHANGED
@@ -1 +1,3 @@
1
- export { ComposeViewport } from "./document/compose-viewport.js";
1
+ import { ComposeViewport } from "./document/compose-viewport.js";
2
+ import { themeColorMeta, viewportMeta } from "./document/meta.js";
3
+ export { ComposeViewport, themeColorMeta, viewportMeta };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@passui/tanstack",
3
- "version": "0.3.1",
3
+ "version": "0.4.1",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "repository": {
@@ -56,12 +56,12 @@
56
56
  "@tanstack/react-router-devtools": "^1.167.2",
57
57
  "@tanstack/react-table": "^9.2.4",
58
58
  "motion": "14.12.0",
59
- "@passui/react": "^0.3.0",
59
+ "@passui/react": "^0.3.8",
60
60
  "react": "^19.3.0",
61
61
  "react-dom": "^19.3.0",
62
62
  "@tanstack/react-query": "^5.104.0",
63
63
  "tsdown": "0.23.7",
64
- "@passui/icons": "^0.1.1"
64
+ "@passui/icons": "^0.1.2"
65
65
  },
66
66
  "exports": {
67
67
  "./auth-shell": "./dist/auth-shell.js",