@hanzo/app 0.2.35 → 0.2.37

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/dist/Chrome.d.ts CHANGED
@@ -14,7 +14,7 @@
14
14
  * hanzo.ai's /join does. Log out is the account menu's own (lib/signout). The
15
15
  * session is IAM's: the host mounts `IamProvider`.
16
16
  */
17
- import type { ReactNode } from 'react';
17
+ import { type ReactNode } from 'react';
18
18
  export declare function Chrome({ back }: {
19
19
  back?: ReactNode;
20
20
  }): import("react").JSX.Element;
package/dist/Chrome.js CHANGED
@@ -1,5 +1,22 @@
1
1
  'use client';
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ /**
4
+ * The bar over a focused page: the organization chooser, the way in, the way to
5
+ * pay, a beta application. One bar for all of them, so none draws its own.
6
+ *
7
+ * The brand at the start (`HanzoWordmark`: `brand()` in words, as the site's own bar sets it), going to this
8
+ * host's root; then the host's `back`, where the page has a step to go back to.
9
+ * At the end, once someone is signed in, who it is: the face, the name and the
10
+ * address, with Use another account and Log out. Signed out, nothing but the
11
+ * brand. Under gui's `md` the account folds into its face, a menu of the address
12
+ * and the same two ways out.
13
+ *
14
+ * Use another account writes this page down first (destination.ts
15
+ * `rememberDestination`), so the sign-in that follows comes back to it, as
16
+ * hanzo.ai's /join does. Log out is the account menu's own (lib/signout). The
17
+ * session is IAM's: the host mounts `IamProvider`.
18
+ */
19
+ import { useEffect, useState } from 'react';
3
20
  import { useI18n } from '@hanzo/i18n/react';
4
21
  import { useIam } from '@hanzo/iam/react';
5
22
  import { Text, View, XStack, YStack } from '@hanzo/gui';
@@ -12,6 +29,22 @@ import { brand, site } from './where.js';
12
29
  import { dragWindow, toggleWindowMaximize, WindowControls } from './WindowControls.js';
13
30
  /** The bar's height under the notch: hanzo.ai's masthead's. */
14
31
  const HEIGHT = 60;
32
+ /** The bar's ground once the page has moved under it: the page's own, frosted. At rest it has none. */
33
+ const GLASS = '$background/72';
34
+ const BLUR = 'blur(20px) saturate(1.8)';
35
+ /** How far the page moves before the bar takes a ground: a flick is not a scroll. */
36
+ const MOVED = 8;
37
+ /** Whether the page has scrolled past `MOVED`. */
38
+ function useMoved() {
39
+ const [moved, setMoved] = useState(false);
40
+ useEffect(() => {
41
+ const read = () => setMoved((window.scrollY || document.documentElement.scrollTop || 0) > MOVED);
42
+ read();
43
+ window.addEventListener('scroll', read, { passive: true });
44
+ return () => window.removeEventListener('scroll', read);
45
+ }, []);
46
+ return moved;
47
+ }
15
48
  /** The notch's inset. gui carries a CSS function to the page unchanged; its types only name custom properties. */
16
49
  const NOTCH = 'env(safe-area-inset-top)';
17
50
  export function Chrome({ back }) {
@@ -30,7 +63,8 @@ export function Chrome({ back }) {
30
63
  };
31
64
  const out = () => void signOut();
32
65
  const signed = isAuthenticated && Boolean(who);
33
- return (_jsxs(XStack, { render: "header", "data-slot": "masthead", "data-tauri-drag-region": "deep", onMouseDown: dragWindow, onDoubleClick: toggleWindowMaximize, position: "sticky", t: 0, z: "var(--z-header)", shrink: 0, boxSizing: "content-box", height: HEIGHT, pt: NOTCH, px: 20, gap: 12, items: "center", bg: "var(--background)", borderBottomWidth: 1, borderColor: "var(--border)", children: [_jsx(Text, { render: _jsx("a", { href: "/", "aria-label": t('{brand} home', { brand: brand() }), "data-tauri-drag-region": "deep", onClick: (e) => {
66
+ const moved = useMoved();
67
+ return (_jsxs(XStack, { render: "header", "data-slot": "masthead", "data-scrolled": moved ? 'true' : 'false', "data-tauri-drag-region": "deep", onMouseDown: dragWindow, onDoubleClick: toggleWindowMaximize, position: "sticky", t: 0, z: "var(--z-header)", shrink: 0, boxSizing: "content-box", height: HEIGHT, pt: NOTCH, px: 20, gap: 12, items: "center", bg: moved ? GLASS : 'transparent', backdropFilter: moved ? BLUR : 'none', transition: "quickest", borderBottomWidth: 0, children: [_jsx(Text, { render: _jsx("a", { href: "/", "aria-label": t('{brand} home', { brand: brand() }), "data-tauri-drag-region": "deep", onClick: (e) => {
34
68
  if (typeof document !== 'undefined' && document.documentElement.getAttribute('data-desktop') === 'true') {
35
69
  e.preventDefault();
36
70
  }
@@ -99,6 +99,11 @@ const MARKS = {
99
99
  // Zoo Labs, who make the Zen models. Their venn of three rings, cut to a disc.
100
100
  // Not in the fork — Zoo's own mark, mapped into the 24-unit space.
101
101
  //
102
+ // THE DISC FILLS THE BOX, and its lines are as heavy as the Hanzo mark's mass:
103
+ // the frame's outer edge is the box's edge (r 10.8 + half a 2.4 stroke = 12),
104
+ // so at a list's 16-20px it stands as large as the mark beside it instead of
105
+ // as a hairline ring inside a margin.
106
+ //
102
107
  // The cut MUST be an SVG `<clipPath>`, in USER units. A CSS
103
108
  // `clip-path: circle(11.5px …)` resolves against the RENDERED box instead, so
104
109
  // at an 18px icon it cuts nothing and the venn squares off into a scribble.
@@ -109,7 +114,7 @@ const MARKS = {
109
114
  // ring stays `currentColor` — it is the frame, not one of the three, and a
110
115
  // fourth hue there would read as a fourth petal. Under `ink` the petals'
111
116
  // strokes come off (`INKED`) and they take the group's `currentColor`.
112
- '<defs><clipPath id="zoo-cut"><circle cx="12" cy="12" r="11.5"></circle></clipPath></defs><g clip-path="url(#zoo-cut)" fill="none" stroke="currentColor"><circle cx="12.203" cy="6.27" r="9.509" stroke-width="1.341" stroke="#00A652"></circle><circle cx="6.189" cy="15.454" r="9.509" stroke-width="1.341" stroke="#ED1C24"></circle><circle cx="17.486" cy="15.454" r="9.509" stroke-width="1.341" stroke="#2E3192"></circle><circle cx="12" cy="12" r="10.769" stroke-width="1.463"></circle></g>',
117
+ '<defs><clipPath id="zoo-cut"><circle cx="12" cy="12" r="12"></circle></clipPath></defs><g clip-path="url(#zoo-cut)" fill="none" stroke="currentColor"><circle cx="12.203" cy="6.27" r="9.509" stroke-width="2.4" stroke="#00A652"></circle><circle cx="6.189" cy="15.454" r="9.509" stroke-width="2.4" stroke="#ED1C24"></circle><circle cx="17.486" cy="15.454" r="9.509" stroke-width="2.4" stroke="#2E3192"></circle><circle cx="12" cy="12" r="10.8" stroke-width="2.4"></circle></g>',
113
118
  // THE CHANNELS, keyed by the registry's provider id. These are the brands'
114
119
  // own published marks, from simple-icons, so a connect tile is drawn the way
115
120
  // the provider draws itself. Brands it does not carry keep the initial.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hanzo/app",
3
- "version": "0.2.35",
3
+ "version": "0.2.37",
4
4
  "description": "Hanzo's app: the shell and its apps (Home, Chat, Inbox, Contacts, Meet, Calendar, Drive, Board, Work, Bots), once, for every Hanzo surface.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",