@hanzo/ui 8.27.19 → 8.27.22

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 (113) hide show
  1. package/dist/backends/gui/item.cjs +2 -3
  2. package/dist/backends/gui/item.d.ts.map +1 -1
  3. package/dist/backends/gui/item.js +1 -2
  4. package/dist/backends/gui/item.js.map +1 -1
  5. package/dist/backends/gui/press.cjs +29 -0
  6. package/dist/backends/gui/press.d.ts +28 -0
  7. package/dist/backends/gui/press.d.ts.map +1 -0
  8. package/dist/backends/gui/press.js +26 -0
  9. package/dist/backends/gui/press.js.map +1 -0
  10. package/dist/backends/gui/toggle-group.cjs +2 -3
  11. package/dist/backends/gui/toggle-group.d.ts.map +1 -1
  12. package/dist/backends/gui/toggle-group.js +1 -2
  13. package/dist/backends/gui/toggle-group.js.map +1 -1
  14. package/dist/backends/gui/toggle.cjs +3 -4
  15. package/dist/backends/gui/toggle.d.ts.map +1 -1
  16. package/dist/backends/gui/toggle.js +1 -2
  17. package/dist/backends/gui/toggle.js.map +1 -1
  18. package/dist/catalog/Shelf.cjs +76 -0
  19. package/dist/catalog/Shelf.d.ts +55 -0
  20. package/dist/catalog/Shelf.d.ts.map +1 -0
  21. package/dist/catalog/Shelf.js +74 -0
  22. package/dist/catalog/Shelf.js.map +1 -0
  23. package/dist/catalog/Tile.cjs +72 -0
  24. package/dist/catalog/Tile.d.ts +56 -0
  25. package/dist/catalog/Tile.d.ts.map +1 -0
  26. package/dist/catalog/Tile.js +67 -0
  27. package/dist/catalog/Tile.js.map +1 -0
  28. package/dist/catalog/index.cjs +23 -0
  29. package/dist/catalog/index.d.ts +16 -0
  30. package/dist/catalog/index.d.ts.map +1 -0
  31. package/dist/catalog/index.js +16 -0
  32. package/dist/catalog/index.js.map +1 -0
  33. package/dist/chat/Home.cjs +30 -0
  34. package/dist/chat/Home.d.ts +35 -0
  35. package/dist/chat/Home.d.ts.map +1 -0
  36. package/dist/chat/Home.js +28 -0
  37. package/dist/chat/Home.js.map +1 -0
  38. package/dist/chat/SessionRail.cjs +165 -37
  39. package/dist/chat/SessionRail.d.ts +92 -14
  40. package/dist/chat/SessionRail.d.ts.map +1 -1
  41. package/dist/chat/SessionRail.js +165 -39
  42. package/dist/chat/SessionRail.js.map +1 -1
  43. package/dist/chat/index.cjs +6 -1
  44. package/dist/chat/index.d.ts +2 -1
  45. package/dist/chat/index.d.ts.map +1 -1
  46. package/dist/chat/index.js +2 -1
  47. package/dist/chat/index.js.map +1 -1
  48. package/dist/gallery.cjs +78 -2
  49. package/dist/gallery.d.ts +13 -0
  50. package/dist/gallery.d.ts.map +1 -1
  51. package/dist/gallery.html +47 -3
  52. package/dist/gallery.js +78 -3
  53. package/dist/gallery.js.map +1 -1
  54. package/dist/models/ModelSelector.cjs +19 -4
  55. package/dist/models/ModelSelector.d.ts +10 -1
  56. package/dist/models/ModelSelector.d.ts.map +1 -1
  57. package/dist/models/ModelSelector.js +20 -5
  58. package/dist/models/ModelSelector.js.map +1 -1
  59. package/dist/models/catalog.cjs +19 -0
  60. package/dist/models/catalog.d.ts +13 -0
  61. package/dist/models/catalog.d.ts.map +1 -1
  62. package/dist/models/catalog.js +18 -0
  63. package/dist/models/catalog.js.map +1 -1
  64. package/dist/models/index.cjs +2 -1
  65. package/dist/models/index.d.ts +1 -1
  66. package/dist/models/index.d.ts.map +1 -1
  67. package/dist/models/index.js +1 -1
  68. package/dist/models/index.js.map +1 -1
  69. package/dist/product/ChipSelect.cjs +2 -3
  70. package/dist/product/ChipSelect.d.ts.map +1 -1
  71. package/dist/product/ChipSelect.js +1 -2
  72. package/dist/product/ChipSelect.js.map +1 -1
  73. package/dist/product/MenuRow.cjs +2 -1
  74. package/dist/product/MenuRow.d.ts +11 -7
  75. package/dist/product/MenuRow.d.ts.map +1 -1
  76. package/dist/product/MenuRow.js +3 -2
  77. package/dist/product/MenuRow.js.map +1 -1
  78. package/dist/product/OrgSwitcher.cjs +16 -5
  79. package/dist/product/OrgSwitcher.d.ts.map +1 -1
  80. package/dist/product/OrgSwitcher.js +16 -5
  81. package/dist/product/OrgSwitcher.js.map +1 -1
  82. package/dist/product/UserMenu.cjs +19 -27
  83. package/dist/product/UserMenu.d.ts +2 -21
  84. package/dist/product/UserMenu.d.ts.map +1 -1
  85. package/dist/product/UserMenu.js +23 -31
  86. package/dist/product/UserMenu.js.map +1 -1
  87. package/dist/product/account.cjs +37 -0
  88. package/dist/product/account.d.ts +55 -0
  89. package/dist/product/account.d.ts.map +1 -0
  90. package/dist/product/account.js +35 -0
  91. package/dist/product/account.js.map +1 -0
  92. package/dist/product/menu/roving.cjs +4 -1
  93. package/dist/product/menu/roving.d.ts +8 -3
  94. package/dist/product/menu/roving.d.ts.map +1 -1
  95. package/dist/product/menu/roving.js +4 -1
  96. package/dist/product/menu/roving.js.map +1 -1
  97. package/dist/settings/Section.cjs +71 -0
  98. package/dist/settings/Section.d.ts +78 -0
  99. package/dist/settings/Section.d.ts.map +1 -0
  100. package/dist/settings/Section.js +62 -0
  101. package/dist/settings/Section.js.map +1 -0
  102. package/dist/settings/Settings.cjs +54 -0
  103. package/dist/settings/Settings.d.ts +50 -0
  104. package/dist/settings/Settings.d.ts.map +1 -0
  105. package/dist/settings/Settings.js +52 -0
  106. package/dist/settings/Settings.js.map +1 -0
  107. package/dist/settings/index.cjs +26 -0
  108. package/dist/settings/index.d.ts +15 -0
  109. package/dist/settings/index.d.ts.map +1 -0
  110. package/dist/settings/index.js +15 -0
  111. package/dist/settings/index.js.map +1 -0
  112. package/dist/styles.css +44 -0
  113. package/package.json +19 -1
@@ -18,28 +18,9 @@
18
18
  * identity rather than a caption over a control.
19
19
  */
20
20
  import { type CSSProperties, type ReactNode } from 'react';
21
+ import { type UserMenuGroup } from './account.js';
21
22
  import { displayName } from './name.js';
22
- /** One row. `id` names it in analytics; the label is what the person reads. */
23
- export type UserMenuItem = {
24
- id: string;
25
- label: string;
26
- icon?: ReactNode;
27
- onPress: () => void;
28
- /** Draws the row in the destructive tone (sign out, delete account). */
29
- danger?: boolean;
30
- /**
31
- * Whether this row is the chosen one — for a group that is a CHOICE rather
32
- * than a list of actions (which theme, which language). Its presence makes the
33
- * group a `radiogroup` and the row a `radio`, so assistive tech is told that
34
- * exactly one of them holds, and the chosen row carries a check.
35
- */
36
- active?: boolean;
37
- };
38
- /** A group of rows, optionally named. A bare array is the unnamed form. */
39
- export type UserMenuGroup = UserMenuItem[] | {
40
- label?: string;
41
- items: UserMenuItem[];
42
- };
23
+ export type { UserMenuGroup, UserMenuItem } from './account.js';
43
24
  export type UserMenuProps = {
44
25
  /** The signed-in person's display name. Falls back to the email's local part. */
45
26
  name?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"UserMenu.d.ts","sourceRoot":"","sources":["../../src/product/UserMenu.tsx"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,EAAY,KAAK,aAAa,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAOpE,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAA;AAIpC,+EAA+E;AAC/E,MAAM,MAAM,YAAY,GAAG;IACzB,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,SAAS,CAAA;IAChB,OAAO,EAAE,MAAM,IAAI,CAAA;IACnB,wEAAwE;IACxE,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB;;;;;OAKG;IACH,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB,CAAA;AAED,2EAA2E;AAC3E,MAAM,MAAM,aAAa,GAAG,YAAY,EAAE,GAAG;IAAE,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,YAAY,EAAE,CAAA;CAAE,CAAA;AAKtF,MAAM,MAAM,aAAa,GAAG;IAC1B,iFAAiF;IACjF,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,yEAAyE;I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I,EACJ,MAAM,EACN,SAAS,EACT,KAAK,GACN,EAAE,aAAa,+BAoHf"}
@@ -1,5 +1,5 @@
1
1
  'use client';
2
- import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  /**
4
4
  * UserMenu — the account control: who I am, and the things I do to my account.
5
5
  *
@@ -19,34 +19,26 @@ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-run
19
19
  * same type — so "which workspace" and "who I am" read as two halves of one
20
20
  * identity rather than a caption over a control.
21
21
  */
22
- import { useState } from 'react';
22
+ import { useRef, useState } from 'react';
23
23
  import { sx } from '../sx.js';
24
- import { Popover, Separator, Text, XStack, YStack } from '@hanzo/gui';
25
- import { ChevronsUpDown, LogOut, UserRound } from '@hanzogui/lucide-icons-2';
24
+ import { Popover, Text, XStack } from '@hanzo/gui';
25
+ import { ChevronsUpDown, UserRound } from '@hanzogui/lucide-icons-2';
26
+ import { Account } from './account.js';
26
27
  import { useEmit } from './instrument.js';
27
- import { MenuLabel, MenuRow } from './MenuRow.js';
28
28
  import { displayName } from './name.js';
29
29
  import { OrgMark } from './OrgMark.js';
30
30
  import { ThemeToggle } from './ThemeToggle.js';
31
- const itemsOf = (g) => (Array.isArray(g) ? g : g.items);
32
- const nameOf = (g) => (Array.isArray(g) ? undefined : g.label);
33
- function Row({ item, onDone }) {
34
- const track = useEmit();
35
- return (_jsx(MenuRow, { label: item.label, icon: item.icon, active: item.active, danger: item.danger, onPress: () => {
36
- track({ component: 'UserMenu', action: 'select', id: item.id });
37
- onDone();
38
- item.onPress();
39
- } }));
40
- }
41
31
  // The name to show is a rule over two strings, so it lives in `./name` and is
42
32
  // reachable without a gui runtime via `@hanzo/ui/product/pure`. Re-exported
43
33
  // here because it was published from this module.
44
34
  export { displayName };
45
35
  export function UserMenu({ name, email, avatar, groups = [], theme, onSignOut, signOutLabel = 'Sign out', children, label = true, height = 44, direction = 'down', align = 'end', aria, testId, className, style, }) {
46
36
  const [open, setOpen] = useState(false);
37
+ // Closing hands focus back to the trigger. The popover's own return goes
38
+ // through a trigger ref that an `asChild` stack never fills, so it is ours.
39
+ const trigger = useRef(null);
47
40
  const track = useEmit();
48
41
  const shown = displayName(name, email);
49
- const filled = groups.filter((g) => itemsOf(g).length > 0);
50
42
  const close = () => setOpen(false);
51
43
  return (_jsxs(Popover, { open: open, onOpenChange: (next) => {
52
44
  track({ component: 'UserMenu', action: next ? 'open' : 'close' });
@@ -56,7 +48,15 @@ export function UserMenu({ name, email, avatar, groups = [], theme, onSignOut, s
56
48
  // `OrgSwitcher`. This is the control it bites: at the foot of a desktop
57
49
  // rail it opens upward, and the SAME mount near the top of a phone's
58
50
  // account sheet has nowhere to go upward at all.
59
- allowFlip: true, stayInFrame: true, children: [_jsx(Popover.Trigger, { asChild: true, children: _jsxs(XStack, { cursor: "pointer", items: "center", gap: "$2.5", height: height, px: "$2", rounded: "$3", minW: 0, hoverStyle: { bg: '$edge' }, role: "button", tabIndex: 0, "data-testid": testId, "aria-label": aria ?? (shown ? `${shown} · account` : 'Account'), children: [avatar || shown ? (_jsx(OrgMark, { org: { name: shown || 'Account', logo: avatar }, size: 30 })) : (_jsx(UserRound, { size: 18 })), label && shown ? (_jsx(Text, { fontSize: "$3", fontWeight: "600", color: "$ink", numberOfLines: 1, maxW: 160, children: shown })) : null, label && shown ? _jsx(ChevronsUpDown, { size: 16, color: "$faint" }) : null] }) }), _jsx(Popover.Content, { role: "menu",
51
+ allowFlip: true, stayInFrame: true, children: [_jsx(Popover.Trigger, { asChild: true, children: _jsxs(XStack, { ref: trigger, cursor: "pointer", items: "center", gap: "$2.5", height: height, px: "$2", rounded: "$3", minW: 0, hoverStyle: { bg: '$edge' }, role: "button", tabIndex: 0, "data-testid": testId, "aria-label": aria ?? (shown ? `${shown} · account` : 'Account'), "aria-haspopup": "menu", "aria-expanded": open,
52
+ // gui opens a stack-drawn trigger on a press only; Enter and Space are
53
+ // the trigger's own (see backends/gui/press.ts).
54
+ onKeyDown: (e) => {
55
+ if (e?.key !== 'Enter' && e?.key !== ' ')
56
+ return;
57
+ e.preventDefault?.();
58
+ setOpen(!open);
59
+ }, children: [avatar || shown ? (_jsx(OrgMark, { org: { name: shown || 'Account', logo: avatar }, size: 30 })) : (_jsx(UserRound, { size: 18 })), label && shown ? (_jsx(Text, { fontSize: "$3", fontWeight: "600", color: "$ink", numberOfLines: 1, maxW: 160, children: shown })) : null, label && shown ? _jsx(ChevronsUpDown, { size: 16, color: "$faint" }) : null] }) }), _jsx(Popover.Content, { role: "menu",
60
60
  /* A menu sheet's rows run its full width. gui's PopperContent centres
61
61
  its children, so each row is only as wide as its own text until the
62
62
  class that stretches it lands a frame later: the sheet flashes a
@@ -71,19 +71,11 @@ export function UserMenu({ name, email, avatar, groups = [], theme, onSignOut, s
71
71
  applied normally, and React logged "Received true for a non-boolean
72
72
  attribute bordered". The siblings in this package have always used
73
73
  borderWidth={1}. */
74
- borderWidth: 1, elevation: "$2", px: "$1", py: "$1", width: 240, bg: "$panel", borderColor: "$borderColor", ...sx(className), style: style, children: children ?? (_jsxs(YStack, { gap: "$1", children: [shown || email ? (_jsxs(YStack, { gap: "$0.5", px: "$2", py: "$1.5", children: [shown ? (_jsx(Text, { fontSize: "$2", fontWeight: "700", color: "$ink", numberOfLines: 1, children: shown })) : null, email && email !== shown ? (_jsx(Text, { fontSize: "$1", color: "$soft", numberOfLines: 1, children: email })) : null] })) : null, filled.map((group, i) => {
75
- const items = itemsOf(group);
76
- const groupName = nameOf(group);
77
- // A group whose every row carries a chosen-one is a CHOICE, so it
78
- // is a radiogroup — a heading alone would leave the rows unrelated.
79
- const choice = items.every((it) => it.active !== undefined);
80
- const rows = items.map((item) => _jsx(Row, { item: item, onDone: close }, item.id));
81
- return (_jsxs(YStack, { gap: "$1", children: [i > 0 || shown || email ? _jsx(Separator, { borderColor: "$borderColor", my: "$1" }) : null, groupName ? _jsx(MenuLabel, { children: groupName }) : null, choice ? (_jsx(YStack, { role: "radiogroup", "aria-label": groupName, gap: "$1", children: rows })) : (rows)] }, i));
82
- }), theme !== null ? (_jsxs(_Fragment, { children: [_jsx(Separator, { borderColor: "$borderColor", my: "$1" }), _jsxs(XStack, { items: "center", gap: "$2.5", px: "$2", py: "$1", rounded: "$3", children: [_jsx(Text, { flex: 1, fontSize: "$2", color: "$ink", children: "Theme" }), theme ?? _jsx(ThemeToggle, {})] })] })) : null, onSignOut ? (_jsxs(_Fragment, { children: [_jsx(Separator, { borderColor: "$borderColor", my: "$1" }), _jsx(Row, { item: {
83
- id: 'sign-out',
84
- label: signOutLabel,
85
- icon: _jsx(LogOut, { size: 16 }),
86
- onPress: onSignOut,
87
- }, onDone: close })] })) : null] })) })] }));
74
+ borderWidth: 1, elevation: "$2", px: "$1", py: "$1", width: 240, bg: "$panel", borderColor: "$borderColor", onCloseAutoFocus: (e) => {
75
+ e.preventDefault();
76
+ trigger.current?.focus();
77
+ }, ...sx(className), style: style, children: children ?? (_jsx(Account, { name: name, email: email, groups: groups,
78
+ // The default toggle is this menu's, not the shared body's (see account.tsx).
79
+ theme: theme === undefined ? _jsx(ThemeToggle, {}) : theme, onSignOut: onSignOut, signOutLabel: signOutLabel, onDone: close, component: "UserMenu" })) })] }));
88
80
  }
89
81
  //# sourceMappingURL=UserMenu.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"UserMenu.js","sourceRoot":"","sources":["../../src/product/UserMenu.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,EAAE,QAAQ,EAAsC,MAAM,OAAO,CAAA;AACpE,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;AAC1B,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACrE,OAAO,EAAE,cAAc,EAAE,MAAM,EAAE,SAAS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AAC,SAAS,CAAC,EACjB,KAAK,EAAE,KAAK,YAEX,QAAQ,IAAI,CACX,KAAC,OAAO,IACN,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,MAAM;oBACd,8EAA8E;oBAC9E,KAAK,EAAE,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,KAAC,WAAW,KAAG,CAAC,CAAC,CAAC,KAAK,EACpD,SAAS,EAAE,SAAS,EACpB,YAAY,EAAE,YAAY,EAC1B,MAAM,EAAE,KAAK,EACb,SAAS,EAAC,UAAU,GACpB,CACH,GACe,IACV,CACX,CAAA;AACH,CAAC"}
@@ -0,0 +1,37 @@
1
+ 'use client';"use strict";
2
+ 'use client';
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.Account = Account;
5
+ const jsx_runtime_1 = require("react/jsx-runtime");
6
+ const gui_1 = require("@hanzo/gui");
7
+ const lucide_icons_2_1 = require("@hanzogui/lucide-icons-2");
8
+ const instrument_1 = require("./instrument.cjs");
9
+ const roving_1 = require("./menu/roving.cjs");
10
+ const MenuRow_1 = require("./MenuRow.cjs");
11
+ const name_1 = require("./name.cjs");
12
+ const itemsOf = (g) => (Array.isArray(g) ? g : g.items);
13
+ const nameOf = (g) => (Array.isArray(g) ? undefined : g.label);
14
+ function Row({ item, onDone, component }) {
15
+ const track = (0, instrument_1.useEmit)();
16
+ return ((0, jsx_runtime_1.jsx)(MenuRow_1.MenuRow, { label: item.label, icon: item.icon, active: item.active, danger: item.danger, onPress: () => {
17
+ track({ component, action: 'select', id: item.id });
18
+ onDone();
19
+ item.onPress();
20
+ } }));
21
+ }
22
+ /** A rule between groups — never above the first thing in the menu. */
23
+ const Rule = () => (0, jsx_runtime_1.jsx)(gui_1.Separator, { borderColor: "$borderColor", my: "$1" });
24
+ function Account({ name, email, groups = [], theme, onSignOut, signOutLabel = 'Sign out', onDone, component }) {
25
+ const shown = (0, name_1.displayName)(name, email);
26
+ const filled = groups.filter((g) => itemsOf(g).length > 0);
27
+ return ((0, jsx_runtime_1.jsxs)(gui_1.YStack, { gap: "$1", onKeyDown: (e) => (0, roving_1.menuKeyDown)(e), children: [shown || email ? ((0, jsx_runtime_1.jsxs)(gui_1.YStack, { gap: "$0.5", px: "$2", py: "$1.5", children: [shown ? ((0, jsx_runtime_1.jsx)(gui_1.Text, { fontSize: "$2", fontWeight: "700", color: "$ink", numberOfLines: 1, children: shown })) : null, email && email !== shown ? ((0, jsx_runtime_1.jsx)(gui_1.Text, { fontSize: "$1", color: "$soft", numberOfLines: 1, children: email })) : null] })) : null, filled.map((group, i) => {
28
+ const items = itemsOf(group);
29
+ const label = nameOf(group);
30
+ // A group whose every row carries a chosen-one is a CHOICE, so it is a
31
+ // named `group` of `menuitemradio` rows (see MenuRow) — a heading alone
32
+ // would leave the rows unrelated.
33
+ const choice = items.every((it) => it.active !== undefined);
34
+ const rows = items.map((item) => (0, jsx_runtime_1.jsx)(Row, { item: item, onDone: onDone, component: component }, item.id));
35
+ return ((0, jsx_runtime_1.jsxs)(gui_1.YStack, { gap: "$1", children: [i > 0 || shown || email ? (0, jsx_runtime_1.jsx)(Rule, {}) : null, label ? (0, jsx_runtime_1.jsx)(MenuRow_1.MenuLabel, { children: label }) : null, choice ? ((0, jsx_runtime_1.jsx)(gui_1.YStack, { role: "group", "aria-label": label, gap: "$1", children: rows })) : (rows)] }, i));
36
+ }), theme != null ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Rule, {}), (0, jsx_runtime_1.jsxs)(gui_1.XStack, { items: "center", gap: "$2.5", px: "$2", py: "$1", rounded: "$3", children: [(0, jsx_runtime_1.jsx)(gui_1.Text, { flex: 1, fontSize: "$2", color: "$ink", children: "Theme" }), theme] })] })) : null, onSignOut ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Rule, {}), (0, jsx_runtime_1.jsx)(Row, { item: { id: 'sign-out', label: signOutLabel, icon: (0, jsx_runtime_1.jsx)(lucide_icons_2_1.LogOut, { size: 16 }), onPress: onSignOut }, onDone: onDone, component: component })] })) : null] }));
37
+ }
@@ -0,0 +1,55 @@
1
+ /**
2
+ * The account menu's body — who is signed in, the host's groups of rows, the
3
+ * theme, and signing out.
4
+ *
5
+ * `UserMenu` draws it under its avatar trigger; `SessionRail` draws it over its
6
+ * account row. It is one body in one file so the two menus cannot drift apart —
7
+ * the same header, the same rules between groups, the same named group for a
8
+ * choice, the same sign-out at the foot.
9
+ *
10
+ * Off the product barrel on purpose: a host wants a whole menu, and gets one
11
+ * from either of those two. This is the part they share.
12
+ */
13
+ import type { ReactNode } from 'react';
14
+ /** One row. `id` names it in analytics; the label is what the person reads. */
15
+ export type UserMenuItem = {
16
+ id: string;
17
+ label: string;
18
+ icon?: ReactNode;
19
+ onPress: () => void;
20
+ /** Draws the row in the destructive tone (sign out, delete account). */
21
+ danger?: boolean;
22
+ /**
23
+ * Whether this row is the chosen one — for a group that is a CHOICE rather
24
+ * than a list of actions (which theme, which language). Its presence makes the
25
+ * group a named `group` and the row a `menuitemradio`, so assistive tech is
26
+ * told that exactly one of them holds, and the chosen row carries a check.
27
+ */
28
+ active?: boolean;
29
+ };
30
+ /** A group of rows, optionally named. A bare array is the unnamed form. */
31
+ export type UserMenuGroup = UserMenuItem[] | {
32
+ label?: string;
33
+ items: UserMenuItem[];
34
+ };
35
+ export type AccountProps = {
36
+ name?: string;
37
+ email?: string;
38
+ groups?: UserMenuGroup[];
39
+ /**
40
+ * The theme row's control. Absent, there is no theme row. `UserMenu` passes
41
+ * its default `<ThemeToggle/>`; this body does not import it, because that
42
+ * toggle reaches the optional `@hanzogui/next-theme` peer, and a rail that
43
+ * only wanted an account menu must not put that peer in its host's bundle —
44
+ * Vite 8 fails the build on the missing peer's export.
45
+ */
46
+ theme?: ReactNode;
47
+ onSignOut?: () => void;
48
+ signOutLabel?: string;
49
+ /** Called after any row runs — the host closes its popover. */
50
+ onDone: () => void;
51
+ /** The menu that drew this body, as analytics names it — `UserMenu`, `SessionRail`. */
52
+ component: string;
53
+ };
54
+ export declare function Account({ name, email, groups, theme, onSignOut, signOutLabel, onDone, component }: AccountProps): import("react").JSX.Element;
55
+ //# sourceMappingURL=account.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"account.d.ts","sourceRoot":"","sources":["../../src/product/account.tsx"],"names":[],"mappings":"AAEA;;;;;;;;;;;GAWG;AACH,OAAO,KAAK,EAAiB,SAAS,EAAE,MAAM,OAAO,CAAA;AASrD,+EAA+E;AAC/E,MAAM,MAAM,YAAY,GAAG;IACzB,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,SAAS,CAAA;IAChB,OAAO,EAAE,MAAM,IAAI,CAAA;IACnB,wEAAwE;IACxE,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB;;;;;OAKG;IACH,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB,CAAA;AAED,2EAA2E;AAC3E,MAAM,MAAM,aAAa,GAAG,YAAY,EAAE,GAAG;IAAE,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,YAAY,EAAE,CAAA;CAAE,CAAA;AAKtF,MAAM,MAAM,YAAY,GAAG;IACzB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,aAAa,EAAE,CAAA;IACxB;;;;;;OAMG;IACH,KAAK,CAAC,EAAE,SAAS,CAAA;IACjB,SAAS,CAAC,EAAE,MAAM,IAAI,CAAA;IACtB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,+DAA+D;IAC/D,MAAM,EAAE,MAAM,IAAI,CAAA;IAClB,uFAAuF;IACvF,SAAS,EAAE,MAAM,CAAA;CAClB,CAAA;AAsBD,wBAAgB,OAAO,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,MAAW,EAAE,KAAK,EAAE,SAAS,EAAE,YAAyB,EAAE,MAAM,EAAE,SAAS,EAAE,EAAE,YAAY,+BAuEjI"}
@@ -0,0 +1,35 @@
1
+ 'use client';
2
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { Separator, Text, XStack, YStack } from '@hanzo/gui';
4
+ import { LogOut } from '@hanzogui/lucide-icons-2';
5
+ import { useEmit } from './instrument.js';
6
+ import { menuKeyDown } from './menu/roving.js';
7
+ import { MenuLabel, MenuRow } from './MenuRow.js';
8
+ import { displayName } from './name.js';
9
+ const itemsOf = (g) => (Array.isArray(g) ? g : g.items);
10
+ const nameOf = (g) => (Array.isArray(g) ? undefined : g.label);
11
+ function Row({ item, onDone, component }) {
12
+ const track = useEmit();
13
+ return (_jsx(MenuRow, { label: item.label, icon: item.icon, active: item.active, danger: item.danger, onPress: () => {
14
+ track({ component, action: 'select', id: item.id });
15
+ onDone();
16
+ item.onPress();
17
+ } }));
18
+ }
19
+ /** A rule between groups — never above the first thing in the menu. */
20
+ const Rule = () => _jsx(Separator, { borderColor: "$borderColor", my: "$1" });
21
+ export function Account({ name, email, groups = [], theme, onSignOut, signOutLabel = 'Sign out', onDone, component }) {
22
+ const shown = displayName(name, email);
23
+ const filled = groups.filter((g) => itemsOf(g).length > 0);
24
+ return (_jsxs(YStack, { gap: "$1", onKeyDown: (e) => menuKeyDown(e), children: [shown || email ? (_jsxs(YStack, { gap: "$0.5", px: "$2", py: "$1.5", children: [shown ? (_jsx(Text, { fontSize: "$2", fontWeight: "700", color: "$ink", numberOfLines: 1, children: shown })) : null, email && email !== shown ? (_jsx(Text, { fontSize: "$1", color: "$soft", numberOfLines: 1, children: email })) : null] })) : null, filled.map((group, i) => {
25
+ const items = itemsOf(group);
26
+ const label = nameOf(group);
27
+ // A group whose every row carries a chosen-one is a CHOICE, so it is a
28
+ // named `group` of `menuitemradio` rows (see MenuRow) — a heading alone
29
+ // would leave the rows unrelated.
30
+ const choice = items.every((it) => it.active !== undefined);
31
+ const rows = items.map((item) => _jsx(Row, { item: item, onDone: onDone, component: component }, item.id));
32
+ return (_jsxs(YStack, { gap: "$1", children: [i > 0 || shown || email ? _jsx(Rule, {}) : null, label ? _jsx(MenuLabel, { children: label }) : null, choice ? (_jsx(YStack, { role: "group", "aria-label": label, gap: "$1", children: rows })) : (rows)] }, i));
33
+ }), theme != null ? (_jsxs(_Fragment, { children: [_jsx(Rule, {}), _jsxs(XStack, { items: "center", gap: "$2.5", px: "$2", py: "$1", rounded: "$3", children: [_jsx(Text, { flex: 1, fontSize: "$2", color: "$ink", children: "Theme" }), theme] })] })) : null, onSignOut ? (_jsxs(_Fragment, { children: [_jsx(Rule, {}), _jsx(Row, { item: { id: 'sign-out', label: signOutLabel, icon: _jsx(LogOut, { size: 16 }), onPress: onSignOut }, onDone: onDone, component: component })] })) : null] }));
34
+ }
35
+ //# sourceMappingURL=account.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"account.js","sourceRoot":"","sources":["../../src/product/account.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAeZ,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAA;AAEjD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AACtC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAA;AAsBpC,MAAM,OAAO,GAAG,CAAC,CAAgB,EAAkB,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAA;AACtF,MAAM,MAAM,GAAG,CAAC,CAAgB,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I,KAAK,IAAI,KAAK,CAAC,CAAC,CAAC,KAAC,IAAI,KAAG,CAAC,CAAC,CAAC,IAAI,EACzC,KAAK,CAAC,CAAC,CAAC,KAAC,SAAS,cAAE,KAAK,GAAa,CAAC,CAAC,CAAC,IAAI,EAC7C,MAAM,CAAC,CAAC,CAAC,CACR,KAAC,MAAM,IAAC,IAAI,EAAC,OAAO,gBAAa,KAAK,EAAE,GAAG,EAAC,IAAI,YAC7C,IAAI,GACE,CACV,CAAC,CAAC,CAAC,CACF,IAAI,CACL,KATU,CAAC,CAUL,CACV,CAAA;YACH,CAAC,CAAC,EAED,KAAK,IAAI,IAAI,CAAC,CAAC,CAAC,CACf,8BACE,KAAC,IAAI,KAAG,EACR,MAAC,MAAM,IAAC,KAAK,EAAC,QAAQ,EAAC,GAAG,EAAC,MAAM,EAAC,EAAE,EAAC,IAAI,EAAC,EAAE,EAAC,IAAI,EAAC,OAAO,EAAC,IAAI,aAC5D,KAAC,IAAI,IAAC,IAAI,EAAE,CAAC,EAAE,QAAQ,EAAC,IAAI,EAAC,KAAK,EAAC,MAAM,sBAElC,EACN,KAAK,IACC,IACR,CACJ,CAAC,CAAC,CAAC,IAAI,EAEP,SAAS,CAAC,CAAC,CAAC,CACX,8BACE,KAAC,IAAI,KAAG,EACR,KAAC,GAAG,IACF,IAAI,EAAE,EAAE,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,KAAC,MAAM,IAAC,IAAI,EAAE,EAAE,GAAI,EAAE,OAAO,EAAE,SAAS,EAAE,EAC7F,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,SAAS,GACpB,IACD,CACJ,CAAC,CAAC,CAAC,IAAI,IACD,CACV,CAAA;AACH,CAAC"}
@@ -11,8 +11,11 @@ function menuKeyDown(e, onClose) {
11
11
  return;
12
12
  if (typeof document === 'undefined')
13
13
  return;
14
+ const target = e.target;
15
+ if (target && /^(INPUT|TEXTAREA)$/.test(target.tagName))
16
+ return;
14
17
  const panel = e.currentTarget;
15
- const items = Array.from(panel.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"])'));
18
+ const items = Array.from(panel.querySelectorAll(['menuitem', 'menuitemradio', 'menuitemcheckbox'].map((r) => `[role="${r}"]:not([aria-disabled="true"])`).join(', ')));
16
19
  if (items.length === 0)
17
20
  return;
18
21
  e.preventDefault();
@@ -1,8 +1,13 @@
1
1
  /**
2
2
  * Roving keyboard focus for a menu panel — ArrowUp/Down move focus between enabled
3
- * `[role="menuitem"]` children, Home/End jump to ends, Escape closes. Web/desktop
4
- * only (guards on `document`); native menus have no pointer-keyboard nav. Shared by
5
- * DropdownMenu and ContextMenu so navigation is identical.
3
+ * menu items (`menuitem`, `menuitemradio`, `menuitemcheckbox`), wrapping at the
4
+ * ends; Home/End jump to them; Escape closes. Web/desktop only (guards on
5
+ * `document`); native menus have no pointer-keyboard nav. Shared by DropdownMenu,
6
+ * ContextMenu and the account sheets (`UserMenu`, `OrgSwitcher`, `SessionRail`'s
7
+ * menu) so navigation is identical.
8
+ *
9
+ * A key typed into a field inside the panel — a sheet's search box — is the
10
+ * field's: Home and End move its caret, not the menu.
6
11
  */
7
12
  import type { KeyboardEvent } from 'react';
8
13
  export declare function menuKeyDown(e: KeyboardEvent, onClose?: () => void): void;
@@ -1 +1 @@
1
- {"version":3,"file":"roving.d.ts","sourceRoot":"","sources":["../../../src/product/menu/roving.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;AAE1C,wBAAgB,WAAW,CAAC,CAAC,EAAE,aAAa,EAAE,OAAO,CAAC,EAAE,MAAM,IAAI,GAAG,IAAI,CAuBxE"}
1
+ {"version":3,"file":"roving.d.ts","sourceRoot":"","sources":["../../../src/product/menu/roving.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;GAUG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;AAE1C,wBAAgB,WAAW,CAAC,CAAC,EAAE,aAAa,EAAE,OAAO,CAAC,EAAE,MAAM,IAAI,GAAG,IAAI,CA2BxE"}
@@ -8,8 +8,11 @@ export function menuKeyDown(e, onClose) {
8
8
  return;
9
9
  if (typeof document === 'undefined')
10
10
  return;
11
+ const target = e.target;
12
+ if (target && /^(INPUT|TEXTAREA)$/.test(target.tagName))
13
+ return;
11
14
  const panel = e.currentTarget;
12
- const items = Array.from(panel.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"])'));
15
+ const items = Array.from(panel.querySelectorAll(['menuitem', 'menuitemradio', 'menuitemcheckbox'].map((r) => `[role="${r}"]:not([aria-disabled="true"])`).join(', ')));
13
16
  if (items.length === 0)
14
17
  return;
15
18
  e.preventDefault();
@@ -1 +1 @@
1
- {"version":3,"file":"roving.js","sourceRoot":"","sources":["../../../src/product/menu/roving.ts"],"names":[],"mappings":"AAAA,YAAY,CAAA;AAUZ,MAAM,UAAU,WAAW,CAAC,CAAgB,EAAE,OAAoB;IAChE,IAAI,CAAC,CAAC,GAAG,KAAK,QAAQ,EAAE,CAAC;QACvB,OAAO,EAAE,EAAE,CAAA;QACX,OAAM;IACR,CAAC;IACD,IAAI,CAAC,CAAC,GAAG,KAAK,WAAW,IAAI,CAAC,CAAC,GAAG,KAAK,SAAS,IAAI,CAAC,CAAC,GAAG,KAAK,MAAM,IAAI,CAAC,CAAC,GAAG,KAAK,KAAK;QAAE,OAAM;IAC/F,IAAI,OAAO,QAAQ,KAAK,WAAW;QAAE,OAAM;IAE3C,MAAM,KAAK,GAAG,CAAC,CAAC,aAA4B,CAAA;IAC5C,MAAM,KAAK,GAAG,KAAK,CAAC,IAAI,CACtB,KAAK,CAAC,gBAAgB,CAAc,+CAA+C,CAAC,CACrF,CAAA;IACD,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;QAAE,OAAM;IAC9B,CAAC,CAAC,cAAc,EAAE,CAAA;IAElB,MAAM,MAAM,GAAG,QAAQ,CAAC,aAAmC,CAAA;IAC3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 Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.Heading = Heading;
5
+ exports.Group = Group;
6
+ exports.Card = Card;
7
+ exports.Row = Row;
8
+ exports.Field = Field;
9
+ exports.Soft = Soft;
10
+ exports.Note = Note;
11
+ exports.Once = Once;
12
+ const jsx_runtime_1 = require("react/jsx-runtime");
13
+ /**
14
+ * What a settings section is drawn from, so every section reads as one page:
15
+ *
16
+ * Heading the section's title, what it is for, and its one action
17
+ * Group a small title over a run of rows or fields
18
+ * Card a bordered list; its `Row`s draw the rules between them
19
+ * Row one thing in a Card: what it is, a line about it, what can be done
20
+ * Field a labelled control, with a line under it when there is more to say
21
+ * Soft the quiet line for empty, loading, signed-out and refused
22
+ * Note what the last action did, said once, where it was done
23
+ * Once a credential the platform shows once: the value, and a copy
24
+ *
25
+ * Presentational. Every string is the host's; nothing here fetches or decides.
26
+ */
27
+ const gui_1 = require("@hanzo/gui");
28
+ const slot_1 = require("../backends/gui/slot.cjs");
29
+ const CopyButton_1 = require("../product/CopyButton.cjs");
30
+ /** A section's title, what it is for, and its one action. */
31
+ function Heading({ title, detail, action, level = 2 }) {
32
+ return ((0, jsx_runtime_1.jsxs)(gui_1.XStack, { ...(0, slot_1.slot)('settings-heading'), items: "flex-start", gap: "$3", children: [(0, jsx_runtime_1.jsxs)(gui_1.YStack, { flex: 1, minW: 0, gap: "$1", children: [(0, jsx_runtime_1.jsx)(gui_1.SizableText, { role: "heading", "aria-level": level, size: "$6", color: "$ink", children: title }), detail ? ((0, jsx_runtime_1.jsx)(gui_1.SizableText, { size: "$2", color: "$soft", children: detail })) : null] }), action] }));
33
+ }
34
+ /** A group inside a section: a small title over what it holds. */
35
+ function Group({ title, detail, action, level = 3, children }) {
36
+ return ((0, jsx_runtime_1.jsxs)(gui_1.YStack, { ...(0, slot_1.slot)('settings-group'), gap: "$2", children: [(0, jsx_runtime_1.jsxs)(gui_1.XStack, { items: "center", gap: "$2", children: [(0, jsx_runtime_1.jsxs)(gui_1.YStack, { flex: 1, minW: 0, gap: "$0.5", children: [(0, jsx_runtime_1.jsx)(gui_1.SizableText, { role: "heading", "aria-level": level, size: "$3", color: "$ink", children: title }), detail ? ((0, jsx_runtime_1.jsx)(gui_1.SizableText, { size: "$1", color: "$soft", children: detail })) : null] }), action] }), children] }));
37
+ }
38
+ /**
39
+ * A bordered box of rows. Its rows draw the rules between them; the first says
40
+ * `first`. It holds what a section needs in one frame — `Row`s, a form line, a
41
+ * `Soft` — so it claims no list role its children would have to live up to.
42
+ */
43
+ function Card({ children }) {
44
+ return ((0, jsx_runtime_1.jsx)(gui_1.YStack, { ...(0, slot_1.slot)('settings-card'), borderWidth: 1, borderColor: "$borderColor", rounded: "$3", overflow: "hidden", children: children }));
45
+ }
46
+ /** One row of a Card: what it is, a line about it, and what can be done to it. */
47
+ function Row({ title, detail, leading, trailing, first, mono }) {
48
+ return ((0, jsx_runtime_1.jsxs)(gui_1.XStack, { ...(0, slot_1.slot)('settings-row'), items: "center", gap: "$3", px: "$3", py: "$2.5", borderTopWidth: first ? 0 : 1, borderColor: "$borderColor", children: [leading, (0, jsx_runtime_1.jsxs)(gui_1.YStack, { flex: 1, minW: 0, gap: "$0.5", children: [(0, jsx_runtime_1.jsx)(gui_1.SizableText, { size: "$2", color: "$ink", numberOfLines: 1, fontFamily: mono ? '$mono' : undefined, children: title }), detail ? ((0, jsx_runtime_1.jsx)(gui_1.SizableText, { size: "$1", color: "$soft", numberOfLines: 2, children: detail })) : null] }), trailing] }));
49
+ }
50
+ /** A labelled control, with a line under it when there is more to say. */
51
+ function Field({ label, hint, children }) {
52
+ return ((0, jsx_runtime_1.jsxs)(gui_1.YStack, { ...(0, slot_1.slot)('settings-field'), gap: "$1.5", children: [(0, jsx_runtime_1.jsx)(gui_1.SizableText, { size: "$2", color: "$ink", children: label }), children, hint ? ((0, jsx_runtime_1.jsx)(gui_1.SizableText, { size: "$1", color: "$soft", children: hint })) : null] }));
53
+ }
54
+ /** The quiet line for empty, loading, signed-out and refused — and the one thing to do about it. */
55
+ function Soft({ children, action }) {
56
+ return ((0, jsx_runtime_1.jsxs)(gui_1.YStack, { ...(0, slot_1.slot)('settings-soft'), py: "$5", items: "center", gap: "$3", children: [(0, jsx_runtime_1.jsx)(gui_1.SizableText, { size: "$2", color: "$soft", text: "center", children: children }), action] }));
57
+ }
58
+ /**
59
+ * What the last action did, said once, where it was done.
60
+ *
61
+ * The live region is ALWAYS there, empty when there is nothing to say: a
62
+ * `role=status` that mounts together with its text is often not announced,
63
+ * because a reader watches regions it already knows about for changes.
64
+ */
65
+ function Note({ children }) {
66
+ return ((0, jsx_runtime_1.jsx)(gui_1.SizableText, { ...(0, slot_1.slot)('settings-note'), size: "$1", color: "$soft", role: "status", children: children }));
67
+ }
68
+ /** A credential the platform answers once: the value to copy, and what it is for. */
69
+ function Once({ value, label, says = 'Copy it now. It is not shown again.', children }) {
70
+ return ((0, jsx_runtime_1.jsxs)(gui_1.YStack, { ...(0, slot_1.slot)('settings-once'), gap: "$2", px: "$3", py: "$3", rounded: "$3", borderWidth: 1, borderColor: "$borderColor", bg: "$raised", children: [(0, jsx_runtime_1.jsxs)(gui_1.XStack, { items: "center", gap: "$2", children: [(0, jsx_runtime_1.jsx)(gui_1.SizableText, { flex: 1, minW: 0, size: "$2", color: "$ink", fontFamily: "$mono", "aria-label": label, style: { wordBreak: 'break-all' }, children: value }), (0, jsx_runtime_1.jsx)(CopyButton_1.CopyButton, { value: value, label: `Copy ${label.toLowerCase()}` })] }), (0, jsx_runtime_1.jsx)(gui_1.SizableText, { size: "$1", color: "$soft", children: says }), children] }));
71
+ }
@@ -0,0 +1,78 @@
1
+ import type { ReactNode } from 'react';
2
+ export interface HeadingProps {
3
+ title: string;
4
+ /** One or two lines on what the section is for. */
5
+ detail?: string;
6
+ /** The section's one action — an Add, a Save. */
7
+ action?: ReactNode;
8
+ /** The heading's outline level. The page's own title is the nav's, so 2. */
9
+ level?: 1 | 2 | 3;
10
+ }
11
+ /** A section's title, what it is for, and its one action. */
12
+ export declare function Heading({ title, detail, action, level }: HeadingProps): import("react").JSX.Element;
13
+ export interface GroupProps {
14
+ title: string;
15
+ detail?: string;
16
+ action?: ReactNode;
17
+ /** One level under the section's `Heading`. */
18
+ level?: 2 | 3 | 4;
19
+ children: ReactNode;
20
+ }
21
+ /** A group inside a section: a small title over what it holds. */
22
+ export declare function Group({ title, detail, action, level, children }: GroupProps): import("react").JSX.Element;
23
+ /**
24
+ * A bordered box of rows. Its rows draw the rules between them; the first says
25
+ * `first`. It holds what a section needs in one frame — `Row`s, a form line, a
26
+ * `Soft` — so it claims no list role its children would have to live up to.
27
+ */
28
+ export declare function Card({ children }: {
29
+ children: ReactNode;
30
+ }): import("react").JSX.Element;
31
+ export interface RowProps {
32
+ title: string;
33
+ detail?: string;
34
+ /** Before the words — a mark, an icon, a status. */
35
+ leading?: ReactNode;
36
+ /** After them — what can be done to this row. */
37
+ trailing?: ReactNode;
38
+ /** The Card's first row draws no rule above itself. */
39
+ first?: boolean;
40
+ /** The title is an identifier — a key name, a path — and is set in `$mono`. */
41
+ mono?: boolean;
42
+ }
43
+ /** One row of a Card: what it is, a line about it, and what can be done to it. */
44
+ export declare function Row({ title, detail, leading, trailing, first, mono }: RowProps): import("react").JSX.Element;
45
+ /** A labelled control, with a line under it when there is more to say. */
46
+ export declare function Field({ label, hint, children }: {
47
+ label: string;
48
+ hint?: string;
49
+ children: ReactNode;
50
+ }): import("react").JSX.Element;
51
+ /** The quiet line for empty, loading, signed-out and refused — and the one thing to do about it. */
52
+ export declare function Soft({ children, action }: {
53
+ children: string;
54
+ action?: ReactNode;
55
+ }): import("react").JSX.Element;
56
+ /**
57
+ * What the last action did, said once, where it was done.
58
+ *
59
+ * The live region is ALWAYS there, empty when there is nothing to say: a
60
+ * `role=status` that mounts together with its text is often not announced,
61
+ * because a reader watches regions it already knows about for changes.
62
+ */
63
+ export declare function Note({ children }: {
64
+ children: string;
65
+ }): import("react").JSX.Element;
66
+ export interface OnceProps {
67
+ /** The credential. */
68
+ value: string;
69
+ /** What it is — "API key". Names the value and its copy control. */
70
+ label: string;
71
+ /** The line under it. */
72
+ says?: string;
73
+ /** What follows — a Done. */
74
+ children?: ReactNode;
75
+ }
76
+ /** A credential the platform answers once: the value to copy, and what it is for. */
77
+ export declare function Once({ value, label, says, children }: OnceProps): import("react").JSX.Element;
78
+ //# sourceMappingURL=Section.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Section.d.ts","sourceRoot":"","sources":["../../src/settings/Section.tsx"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAKtC,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAA;IACb,mDAAmD;IACnD,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,iDAAiD;IACjD,MAAM,CAAC,EAAE,SAAS,CAAA;IAClB,4EAA4E;IAC5E,KAAK,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;CAClB;AAED,6DAA6D;AAC7D,wBAAgB,OAAO,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,KAAS,EAAE,EAAE,YAAY,+BAgBzE;AAED,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,MAAM,CAAC,EAAE,SAAS,CAAA;IAClB,+CAA+C;IAC/C,KAAK,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;IACjB,QAAQ,EAAE,SAAS,CAAA;CACpB;AAED,kEAAkE;AAClE,wBAAgB,KAAK,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,KAAS,EAAE,QAAQ,EAAE,EAAE,UAAU,+BAmB/E;AAED;;;;GAIG;AACH,wBAAgB,IAAI,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,+BAYzD;AAED,MAAM,WAAW,QAA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-0,0 +1,62 @@
1
+ 'use client';
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ /**
4
+ * What a settings section is drawn from, so every section reads as one page:
5
+ *
6
+ * Heading the section's title, what it is for, and its one action
7
+ * Group a small title over a run of rows or fields
8
+ * Card a bordered list; its `Row`s draw the rules between them
9
+ * Row one thing in a Card: what it is, a line about it, what can be done
10
+ * Field a labelled control, with a line under it when there is more to say
11
+ * Soft the quiet line for empty, loading, signed-out and refused
12
+ * Note what the last action did, said once, where it was done
13
+ * Once a credential the platform shows once: the value, and a copy
14
+ *
15
+ * Presentational. Every string is the host's; nothing here fetches or decides.
16
+ */
17
+ import { SizableText, XStack, YStack } from '@hanzo/gui';
18
+ import { slot } from '../backends/gui/slot.js';
19
+ import { CopyButton } from '../product/CopyButton.js';
20
+ /** A section's title, what it is for, and its one action. */
21
+ export function Heading({ title, detail, action, level = 2 }) {
22
+ return (_jsxs(XStack, { ...slot('settings-heading'), items: "flex-start", gap: "$3", children: [_jsxs(YStack, { flex: 1, minW: 0, gap: "$1", children: [_jsx(SizableText, { role: "heading", "aria-level": level, size: "$6", color: "$ink", children: title }), detail ? (_jsx(SizableText, { size: "$2", color: "$soft", children: detail })) : null] }), action] }));
23
+ }
24
+ /** A group inside a section: a small title over what it holds. */
25
+ export function Group({ title, detail, action, level = 3, children }) {
26
+ return (_jsxs(YStack, { ...slot('settings-group'), gap: "$2", children: [_jsxs(XStack, { items: "center", gap: "$2", children: [_jsxs(YStack, { flex: 1, minW: 0, gap: "$0.5", children: [_jsx(SizableText, { role: "heading", "aria-level": level, size: "$3", color: "$ink", children: title }), detail ? (_jsx(SizableText, { size: "$1", color: "$soft", children: detail })) : null] }), action] }), children] }));
27
+ }
28
+ /**
29
+ * A bordered box of rows. Its rows draw the rules between them; the first says
30
+ * `first`. It holds what a section needs in one frame — `Row`s, a form line, a
31
+ * `Soft` — so it claims no list role its children would have to live up to.
32
+ */
33
+ export function Card({ children }) {
34
+ return (_jsx(YStack, { ...slot('settings-card'), borderWidth: 1, borderColor: "$borderColor", rounded: "$3", overflow: "hidden", children: children }));
35
+ }
36
+ /** One row of a Card: what it is, a line about it, and what can be done to it. */
37
+ export function Row({ title, detail, leading, trailing, first, mono }) {
38
+ return (_jsxs(XStack, { ...slot('settings-row'), items: "center", gap: "$3", px: "$3", py: "$2.5", borderTopWidth: first ? 0 : 1, borderColor: "$borderColor", children: [leading, _jsxs(YStack, { flex: 1, minW: 0, gap: "$0.5", children: [_jsx(SizableText, { size: "$2", color: "$ink", numberOfLines: 1, fontFamily: mono ? '$mono' : undefined, children: title }), detail ? (_jsx(SizableText, { size: "$1", color: "$soft", numberOfLines: 2, children: detail })) : null] }), trailing] }));
39
+ }
40
+ /** A labelled control, with a line under it when there is more to say. */
41
+ export function Field({ label, hint, children }) {
42
+ return (_jsxs(YStack, { ...slot('settings-field'), gap: "$1.5", children: [_jsx(SizableText, { size: "$2", color: "$ink", children: label }), children, hint ? (_jsx(SizableText, { size: "$1", color: "$soft", children: hint })) : null] }));
43
+ }
44
+ /** The quiet line for empty, loading, signed-out and refused — and the one thing to do about it. */
45
+ export function Soft({ children, action }) {
46
+ return (_jsxs(YStack, { ...slot('settings-soft'), py: "$5", items: "center", gap: "$3", children: [_jsx(SizableText, { size: "$2", color: "$soft", text: "center", children: children }), action] }));
47
+ }
48
+ /**
49
+ * What the last action did, said once, where it was done.
50
+ *
51
+ * The live region is ALWAYS there, empty when there is nothing to say: a
52
+ * `role=status` that mounts together with its text is often not announced,
53
+ * because a reader watches regions it already knows about for changes.
54
+ */
55
+ export function Note({ children }) {
56
+ return (_jsx(SizableText, { ...slot('settings-note'), size: "$1", color: "$soft", role: "status", children: children }));
57
+ }
58
+ /** A credential the platform answers once: the value to copy, and what it is for. */
59
+ export function Once({ value, label, says = 'Copy it now. It is not shown again.', children }) {
60
+ return (_jsxs(YStack, { ...slot('settings-once'), gap: "$2", px: "$3", py: "$3", rounded: "$3", borderWidth: 1, borderColor: "$borderColor", bg: "$raised", children: [_jsxs(XStack, { items: "center", gap: "$2", children: [_jsx(SizableText, { flex: 1, minW: 0, size: "$2", color: "$ink", fontFamily: "$mono", "aria-label": label, style: { wordBreak: 'break-all' }, children: value }), _jsx(CopyButton, { value: value, label: `Copy ${label.toLowerCase()}` })] }), _jsx(SizableText, { size: "$1", color: "$soft", children: says }), children] }));
61
+ }
62
+ //# sourceMappingURL=Section.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Section.js","sourceRoot":"","sources":["../../src/settings/Section.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ;;;;;;;;;;;;;GAaG;AACH,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AAGxD,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AAYlD,6DAA6D;AAC7D,MAAM,UAAU,OAAO,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,GAAG,CAAC,EAAgB;IACxE,OAAO,CACL,MAAC,MAAM,OAAK,IAAI,CAAC,kBAAkB,CAAC,EAAE,KAAK,EAAC,YAAY,EAAC,GAAG,EAAC,IAAI,aAC/D,MAAC,MAAM,IAAC,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,GAAG,EAAC,IAAI,aAChC,KAAC,WAAW,IAAC,IAAI,EAAC,SAAS,gBAAa,KAAK,EAAE,IAAI,EAAC,IAAI,EAAC,KAAK,EAAC,MAAM,YAClE,KAAK,GACM,EACb,MAAM,CAAC,CAAC,CAAC,CACR,KAAC,WAAW,IAAC,IAAI,EAAC,IAAI,EAAC,KAAK,EAAC,OAAO,YACjC,MAAM,GACK,CACf,CAAC,CAAC,CAAC,IAAI,IACD,EACR,MAAM,IACA,CACV,CAAA;AACH,CAAC;AAWD,kEAAkE;AAClE,MAAM,UAAU,KAAK,CAAC,EAA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