@hanzo/ui 8.27.19 → 8.27.20

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 (98) 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 +72 -1
  49. package/dist/gallery.d.ts +13 -0
  50. package/dist/gallery.d.ts.map +1 -1
  51. package/dist/gallery.html +45 -3
  52. package/dist/gallery.js +72 -2
  53. package/dist/gallery.js.map +1 -1
  54. package/dist/product/ChipSelect.cjs +2 -3
  55. package/dist/product/ChipSelect.d.ts.map +1 -1
  56. package/dist/product/ChipSelect.js +1 -2
  57. package/dist/product/ChipSelect.js.map +1 -1
  58. package/dist/product/MenuRow.cjs +2 -1
  59. package/dist/product/MenuRow.d.ts +11 -7
  60. package/dist/product/MenuRow.d.ts.map +1 -1
  61. package/dist/product/MenuRow.js +3 -2
  62. package/dist/product/MenuRow.js.map +1 -1
  63. package/dist/product/OrgSwitcher.cjs +16 -5
  64. package/dist/product/OrgSwitcher.d.ts.map +1 -1
  65. package/dist/product/OrgSwitcher.js +16 -5
  66. package/dist/product/OrgSwitcher.js.map +1 -1
  67. package/dist/product/UserMenu.cjs +19 -27
  68. package/dist/product/UserMenu.d.ts +2 -21
  69. package/dist/product/UserMenu.d.ts.map +1 -1
  70. package/dist/product/UserMenu.js +23 -31
  71. package/dist/product/UserMenu.js.map +1 -1
  72. package/dist/product/account.cjs +37 -0
  73. package/dist/product/account.d.ts +55 -0
  74. package/dist/product/account.d.ts.map +1 -0
  75. package/dist/product/account.js +35 -0
  76. package/dist/product/account.js.map +1 -0
  77. package/dist/product/menu/roving.cjs +4 -1
  78. package/dist/product/menu/roving.d.ts +8 -3
  79. package/dist/product/menu/roving.d.ts.map +1 -1
  80. package/dist/product/menu/roving.js +4 -1
  81. package/dist/product/menu/roving.js.map +1 -1
  82. package/dist/settings/Section.cjs +71 -0
  83. package/dist/settings/Section.d.ts +78 -0
  84. package/dist/settings/Section.d.ts.map +1 -0
  85. package/dist/settings/Section.js +62 -0
  86. package/dist/settings/Section.js.map +1 -0
  87. package/dist/settings/Settings.cjs +54 -0
  88. package/dist/settings/Settings.d.ts +50 -0
  89. package/dist/settings/Settings.d.ts.map +1 -0
  90. package/dist/settings/Settings.js +52 -0
  91. package/dist/settings/Settings.js.map +1 -0
  92. package/dist/settings/index.cjs +26 -0
  93. package/dist/settings/index.d.ts +15 -0
  94. package/dist/settings/index.d.ts.map +1 -0
  95. package/dist/settings/index.js +15 -0
  96. package/dist/settings/index.js.map +1 -0
  97. package/dist/styles.css +42 -0
  98. package/package.json +13 -1
@@ -0,0 +1,71 @@
1
+ 'use client';"use strict";
2
+ 'use client';
3
+ 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,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oGAAoG;AACpG,wBAAgB,IAAI,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,SAAS,CAAA;CAAE,+BASlF;AAED;;;;;;GAMG;AACH,wBAAgB,IAAI,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,MAAM,CAAA;CAAE,+BAMtD;AAED,MAAM,WAAW,SAAS;IACxB,sBAAsB;IACtB,KAAK,EAAE,MAAM,CAAA;IACb,oEAAoE;IACpE,KAAK,EAAE,MAAM,CAAA;IACb,yBAAyB;IACzB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,6BAA6B;IAC7B,QAAQ,CAAC,EAAE,SAAS,CAAA;CACrB;AAED,qFAAqF;AACrF,wBAAgB,IAAI,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,IAA4C,EAAE,QAAQ,EAAE,EAAE,SAAS,+BAgCvG"}
@@ -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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,WAAW,EAAC,cAAc,EAC1B,EAAE,EAAC,SAAS,aAEZ,MAAC,MAAM,IAAC,KAAK,EAAC,QAAQ,EAAC,GAAG,EAAC,IAAI,aAC7B,KAAC,WAAW,IACV,IAAI,EAAE,CAAC,EACP,IAAI,EAAE,CAAC,EACP,IAAI,EAAC,IAAI,EACT,KAAK,EAAC,MAAM,EACZ,UAAU,EAAC,OAAO,gBACN,KAAK,EACjB,KAAK,EAAE,EAAE,SAAS,EAAE,WAAW,EAAE,YAEhC,KAAK,GACM,EACd,KAAC,UAAU,IAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,KAAK,CAAC,WAAW,EAAE,EAAE,GAAI,IAC3D,EACT,KAAC,WAAW,IAAC,IAAI,EAAC,IAAI,EAAC,KAAK,EAAC,OAAO,YACjC,IAAI,GACO,EACb,QAAQ,IACF,CACV,CAAA;AACH,CAAC"}
@@ -0,0 +1,54 @@
1
+ 'use client';"use strict";
2
+ 'use client';
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.Settings = Settings;
5
+ const jsx_runtime_1 = require("react/jsx-runtime");
6
+ /**
7
+ * Settings — a settings page: every section listed by group, and the chosen one
8
+ * in a readable column.
9
+ *
10
+ * Settings │ General
11
+ * Settings │ ─────────────────────────
12
+ * General ◀ │ (the section, as `children`, 760px at most)
13
+ * Account │
14
+ * Code │
15
+ * Environments │
16
+ *
17
+ * From `md` up the sections are a 220px column on the left, grouped under quiet
18
+ * labels, the current one marked `aria-current="page"`. Below `md` that column
19
+ * is gone and the same sections are a row of chips over the content — every
20
+ * section one press away on a phone, with no drawer to open first.
21
+ *
22
+ * Presentational: which section is open comes in as `active`, a choice goes out
23
+ * through `onPick`, and the section itself is the host's `children` — the page
24
+ * never learns what a section holds. A section is its own address in the host,
25
+ * so it can be linked to and survives a reload.
26
+ *
27
+ * The section's own parts — heading, groups, bordered lists, fields, the quiet
28
+ * lines — are in `./Section`, so every section reads as one page.
29
+ */
30
+ const gui_1 = require("@hanzo/gui");
31
+ const react_1 = require("react");
32
+ const press_1 = require("../backends/gui/press.cjs");
33
+ const slot_1 = require("../backends/gui/slot.cjs");
34
+ /** The nav column's width, px. */
35
+ const NAV = 220;
36
+ /** The content column's measure, px — a form reads badly any wider. */
37
+ const MEASURE = 760;
38
+ function Settings({ entries, groups, active, onPick, title = 'Settings', children, ...rest }) {
39
+ const id = (0, react_1.useId)();
40
+ const order = groups ?? [...new Set(entries.map((e) => e.group))];
41
+ return ((0, jsx_runtime_1.jsxs)(gui_1.XStack, { ...(0, slot_1.slot)('settings'), flex: 1, minH: 0, minW: 0, ...rest, children: [(0, jsx_runtime_1.jsx)(gui_1.YStack, { ...(0, slot_1.slot)('settings-nav'), role: "navigation", "aria-label": title, width: NAV, shrink: 0, minH: 0, borderRightWidth: 1, borderColor: "$borderColor", "$max-md": { display: 'none' }, children: (0, jsx_runtime_1.jsx)(gui_1.ScrollView, { flex: 1, minH: 0, overflowY: "auto", showsVerticalScrollIndicator: false, children: (0, jsx_runtime_1.jsxs)(gui_1.YStack, { px: "$2", py: "$4", gap: "$4", children: [(0, jsx_runtime_1.jsx)(gui_1.SizableText, { size: "$4", color: "$ink", px: "$2", children: title }), order.map((g, i) => {
42
+ const list = entries.filter((e) => e.group === g);
43
+ if (!list.length)
44
+ return null;
45
+ const head = `${id}-group-${i}`;
46
+ return ((0, jsx_runtime_1.jsxs)(gui_1.YStack, { gap: "$0.5", children: [(0, jsx_runtime_1.jsx)(gui_1.SizableText, { id: head, size: "$1", color: "$soft", px: "$2", pb: "$1", children: g }), (0, jsx_runtime_1.jsx)(gui_1.YStack, { role: "list", "aria-labelledby": head, gap: "$0.5", children: list.map((e) => {
47
+ const on = e.id === active;
48
+ return ((0, jsx_runtime_1.jsx)(gui_1.YStack, { role: "listitem", children: (0, jsx_runtime_1.jsx)(gui_1.XStack, { ...(0, slot_1.slot)('settings-entry'), ...(0, press_1.press)(() => onPick(e.id)), "aria-current": on ? 'page' : undefined, px: "$2", py: "$1.5", rounded: "$2", cursor: "pointer", bg: on ? '$hover' : 'transparent', hoverStyle: { bg: '$hover' }, focusVisibleStyle: press_1.RING, children: (0, jsx_runtime_1.jsx)(gui_1.SizableText, { size: "$2", color: on ? '$ink' : '$soft', numberOfLines: 1, children: e.label }) }) }, e.id));
49
+ }) })] }, g));
50
+ })] }) }) }), (0, jsx_runtime_1.jsxs)(gui_1.ScrollView, { flex: 1, minW: 0, minH: 0, overflowY: "auto", children: [(0, jsx_runtime_1.jsx)(gui_1.XStack, { ...(0, slot_1.slot)('settings-chips'), role: "navigation", "aria-label": title, flexWrap: "wrap", gap: "$1.5", px: "$4", pt: "$3", $md: { display: 'none' }, children: entries.map((e) => {
51
+ const on = e.id === active;
52
+ return ((0, jsx_runtime_1.jsx)(gui_1.XStack, { ...(0, slot_1.slot)('settings-chip'), ...(0, press_1.press)(() => onPick(e.id)), "aria-current": on ? 'page' : undefined, px: "$2.5", py: "$1", rounded: "$10", cursor: "pointer", borderWidth: 1, borderColor: on ? '$ink' : '$borderColor', hoverStyle: { bg: '$hover' }, focusVisibleStyle: press_1.RING, children: (0, jsx_runtime_1.jsx)(gui_1.SizableText, { size: "$1", color: on ? '$ink' : '$soft', children: e.label }) }, e.id));
53
+ }) }), (0, jsx_runtime_1.jsx)(gui_1.YStack, { ...(0, slot_1.slot)('settings-body'), width: "100%", maxW: MEASURE, self: "center", px: "$5", py: "$6", children: children })] })] }));
54
+ }
@@ -0,0 +1,50 @@
1
+ /**
2
+ * Settings — a settings page: every section listed by group, and the chosen one
3
+ * in a readable column.
4
+ *
5
+ * Settings │ General
6
+ * Settings │ ─────────────────────────
7
+ * General ◀ │ (the section, as `children`, 760px at most)
8
+ * Account │
9
+ * Code │
10
+ * Environments │
11
+ *
12
+ * From `md` up the sections are a 220px column on the left, grouped under quiet
13
+ * labels, the current one marked `aria-current="page"`. Below `md` that column
14
+ * is gone and the same sections are a row of chips over the content — every
15
+ * section one press away on a phone, with no drawer to open first.
16
+ *
17
+ * Presentational: which section is open comes in as `active`, a choice goes out
18
+ * through `onPick`, and the section itself is the host's `children` — the page
19
+ * never learns what a section holds. A section is its own address in the host,
20
+ * so it can be linked to and survives a reload.
21
+ *
22
+ * The section's own parts — heading, groups, bordered lists, fields, the quiet
23
+ * lines — are in `./Section`, so every section reads as one page.
24
+ */
25
+ import { XStack } from '@hanzo/gui';
26
+ import { type ComponentProps, type ReactNode } from 'react';
27
+ type Row = Omit<ComponentProps<typeof XStack>, 'children'>;
28
+ /** One section of the page, as the nav lists it. */
29
+ export interface Entry {
30
+ id: string;
31
+ label: string;
32
+ /** The group it is listed under. */
33
+ group: string;
34
+ }
35
+ export interface SettingsProps<E extends Entry = Entry> extends Row {
36
+ /** Every section, in the order the page lists them. */
37
+ entries: readonly E[];
38
+ /** The groups, in order. Omitted, they are the entries' own, in first-seen order. */
39
+ groups?: readonly string[];
40
+ /** The open section's id. */
41
+ active: E['id'];
42
+ onPick: (id: E['id']) => void;
43
+ /** The page's name — the nav's heading and its landmark name. */
44
+ title?: string;
45
+ /** The open section. */
46
+ children?: ReactNode;
47
+ }
48
+ export declare function Settings<E extends Entry>({ entries, groups, active, onPick, title, children, ...rest }: SettingsProps<E>): import("react").JSX.Element;
49
+ export {};
50
+ //# sourceMappingURL=Settings.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Settings.d.ts","sourceRoot":"","sources":["../../src/settings/Settings.tsx"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,OAAO,EAA2B,MAAM,EAAU,MAAM,YAAY,CAAA;AACpE,OAAO,EAAS,KAAK,cAAc,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAKlE,KAAK,GAAG,GAAG,IAAI,CAAC,cAAc,CAAC,OAAO,MAAM,CAAC,EAAE,UAAU,CAAC,CAAA;AAQ1D,oDAAoD;AACpD,MAAM,WAAW,KAAK;IACpB,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,oCAAoC;IACpC,KAAK,EAAE,MAAM,CAAA;CACd;AAED,MAAM,WAAW,aAAa,CAAC,CAAC,SAAS,KAAK,GAAG,KAAK,CAAE,SAAQ,GAAG;IACjE,uDAAuD;IACvD,OAAO,EAAE,SAAS,CAAC,EAAE,CAAA;IACrB,qFAAqF;IACrF,MAAM,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;IAC1B,6BAA6B;IAC7B,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,CAAA;IACf,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,KAAK,IAAI,CAAA;IAC7B,iEAAiE;IACjE,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,wBAAwB;IACxB,QAAQ,CAAC,EAAE,SAAS,CAAA;CACrB;AAED,wBAAgB,QAAQ,CAAC,CAAC,SAAS,KAAK,EAAE,EACxC,OAAO,EACP,MAAM,EACN,MAAM,EACN,MAAM,EACN,KAAkB,EAClB,QAAQ,EACR,GAAG,IAAI,EACR,EAAE,aAAa,CAAC,CAAC,CAAC,+BA2GlB"}
@@ -0,0 +1,52 @@
1
+ 'use client';
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ /**
4
+ * Settings — a settings page: every section listed by group, and the chosen one
5
+ * in a readable column.
6
+ *
7
+ * Settings │ General
8
+ * Settings │ ─────────────────────────
9
+ * General ◀ │ (the section, as `children`, 760px at most)
10
+ * Account │
11
+ * Code │
12
+ * Environments │
13
+ *
14
+ * From `md` up the sections are a 220px column on the left, grouped under quiet
15
+ * labels, the current one marked `aria-current="page"`. Below `md` that column
16
+ * is gone and the same sections are a row of chips over the content — every
17
+ * section one press away on a phone, with no drawer to open first.
18
+ *
19
+ * Presentational: which section is open comes in as `active`, a choice goes out
20
+ * through `onPick`, and the section itself is the host's `children` — the page
21
+ * never learns what a section holds. A section is its own address in the host,
22
+ * so it can be linked to and survives a reload.
23
+ *
24
+ * The section's own parts — heading, groups, bordered lists, fields, the quiet
25
+ * lines — are in `./Section`, so every section reads as one page.
26
+ */
27
+ import { ScrollView, SizableText, XStack, YStack } from '@hanzo/gui';
28
+ import { useId } from 'react';
29
+ import { press, RING } from '../backends/gui/press.js';
30
+ import { slot } from '../backends/gui/slot.js';
31
+ /** The nav column's width, px. */
32
+ const NAV = 220;
33
+ /** The content column's measure, px — a form reads badly any wider. */
34
+ const MEASURE = 760;
35
+ export function Settings({ entries, groups, active, onPick, title = 'Settings', children, ...rest }) {
36
+ const id = useId();
37
+ const order = groups ?? [...new Set(entries.map((e) => e.group))];
38
+ return (_jsxs(XStack, { ...slot('settings'), flex: 1, minH: 0, minW: 0, ...rest, children: [_jsx(YStack, { ...slot('settings-nav'), role: "navigation", "aria-label": title, width: NAV, shrink: 0, minH: 0, borderRightWidth: 1, borderColor: "$borderColor", "$max-md": { display: 'none' }, children: _jsx(ScrollView, { flex: 1, minH: 0, overflowY: "auto", showsVerticalScrollIndicator: false, children: _jsxs(YStack, { px: "$2", py: "$4", gap: "$4", children: [_jsx(SizableText, { size: "$4", color: "$ink", px: "$2", children: title }), order.map((g, i) => {
39
+ const list = entries.filter((e) => e.group === g);
40
+ if (!list.length)
41
+ return null;
42
+ const head = `${id}-group-${i}`;
43
+ return (_jsxs(YStack, { gap: "$0.5", children: [_jsx(SizableText, { id: head, size: "$1", color: "$soft", px: "$2", pb: "$1", children: g }), _jsx(YStack, { role: "list", "aria-labelledby": head, gap: "$0.5", children: list.map((e) => {
44
+ const on = e.id === active;
45
+ return (_jsx(YStack, { role: "listitem", children: _jsx(XStack, { ...slot('settings-entry'), ...press(() => onPick(e.id)), "aria-current": on ? 'page' : undefined, px: "$2", py: "$1.5", rounded: "$2", cursor: "pointer", bg: on ? '$hover' : 'transparent', hoverStyle: { bg: '$hover' }, focusVisibleStyle: RING, children: _jsx(SizableText, { size: "$2", color: on ? '$ink' : '$soft', numberOfLines: 1, children: e.label }) }) }, e.id));
46
+ }) })] }, g));
47
+ })] }) }) }), _jsxs(ScrollView, { flex: 1, minW: 0, minH: 0, overflowY: "auto", children: [_jsx(XStack, { ...slot('settings-chips'), role: "navigation", "aria-label": title, flexWrap: "wrap", gap: "$1.5", px: "$4", pt: "$3", $md: { display: 'none' }, children: entries.map((e) => {
48
+ const on = e.id === active;
49
+ return (_jsx(XStack, { ...slot('settings-chip'), ...press(() => onPick(e.id)), "aria-current": on ? 'page' : undefined, px: "$2.5", py: "$1", rounded: "$10", cursor: "pointer", borderWidth: 1, borderColor: on ? '$ink' : '$borderColor', hoverStyle: { bg: '$hover' }, focusVisibleStyle: RING, children: _jsx(SizableText, { size: "$1", color: on ? '$ink' : '$soft', children: e.label }) }, e.id));
50
+ }) }), _jsx(YStack, { ...slot('settings-body'), width: "100%", maxW: MEASURE, self: "center", px: "$5", py: "$6", children: children })] })] }));
51
+ }
52
+ //# sourceMappingURL=Settings.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Settings.js","sourceRoot":"","sources":["../../src/settings/Settings.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACpE,OAAO,EAAE,KAAK,EAAuC,MAAM,OAAO,CAAA;AAElE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAA;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;AAI3C,kCAAkC;AAClC,MAAM,GAAG,GAAG,GAAG,CAAA;AAEf,uEAAuE;AACvE,MAAM,OAAO,GAAG,GAAG,CAAA;AAwBnB,MAAM,UAAU,QAAQ,CAAkB,EACxC,OAAO,EACP,MAAM,EACN,MAAM,EACN,MAAM,EACN,KAAK,GAAG,UAAU,EAClB,QAAQ,EACR,GAAG,IAAI,EACU;IACjB,MAAM,EAAE,GAAG,KAAK,EAAE,CAAA;IAClB,M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A;AACH,CAAC"}
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Soft = exports.Row = exports.Once = exports.Note = exports.Heading = exports.Group = exports.Field = exports.Card = exports.Settings = void 0;
4
+ /**
5
+ * @hanzo/ui/settings — a settings page, and what its sections are drawn from.
6
+ *
7
+ * `Settings` is the page: the sections grouped in a column from `md` up, a row
8
+ * of chips below it, and the open section in a 760px column. The section is the
9
+ * host's `children`, drawn from `Heading`, `Group`, `Card` + `Row`, `Field`,
10
+ * `Soft`, `Note` and `Once`, so every section of every surface reads as one
11
+ * page.
12
+ *
13
+ * Props in, callbacks out: which section is open is the host's (its address),
14
+ * and nothing here fetches.
15
+ */
16
+ var Settings_1 = require("./Settings.cjs");
17
+ Object.defineProperty(exports, "Settings", { enumerable: true, get: function () { return Settings_1.Settings; } });
18
+ var Section_1 = require("./Section.cjs");
19
+ Object.defineProperty(exports, "Card", { enumerable: true, get: function () { return Section_1.Card; } });
20
+ Object.defineProperty(exports, "Field", { enumerable: true, get: function () { return Section_1.Field; } });
21
+ Object.defineProperty(exports, "Group", { enumerable: true, get: function () { return Section_1.Group; } });
22
+ Object.defineProperty(exports, "Heading", { enumerable: true, get: function () { return Section_1.Heading; } });
23
+ Object.defineProperty(exports, "Note", { enumerable: true, get: function () { return Section_1.Note; } });
24
+ Object.defineProperty(exports, "Once", { enumerable: true, get: function () { return Section_1.Once; } });
25
+ Object.defineProperty(exports, "Row", { enumerable: true, get: function () { return Section_1.Row; } });
26
+ Object.defineProperty(exports, "Soft", { enumerable: true, get: function () { return Section_1.Soft; } });
@@ -0,0 +1,15 @@
1
+ /**
2
+ * @hanzo/ui/settings — a settings page, and what its sections are drawn from.
3
+ *
4
+ * `Settings` is the page: the sections grouped in a column from `md` up, a row
5
+ * of chips below it, and the open section in a 760px column. The section is the
6
+ * host's `children`, drawn from `Heading`, `Group`, `Card` + `Row`, `Field`,
7
+ * `Soft`, `Note` and `Once`, so every section of every surface reads as one
8
+ * page.
9
+ *
10
+ * Props in, callbacks out: which section is open is the host's (its address),
11
+ * and nothing here fetches.
12
+ */
13
+ export { Settings, type Entry, type SettingsProps } from './Settings.js';
14
+ export { Card, Field, Group, Heading, Note, Once, Row, Soft, type GroupProps, type HeadingProps, type OnceProps, type RowProps, } from './Section.js';
15
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/settings/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EAAE,QAAQ,EAAE,KAAK,KAAK,EAAE,KAAK,aAAa,EAAE,MAAM,YAAY,CAAA;AACrE,OAAO,EACL,IAAI,EACJ,KAAK,EACL,KAAK,EACL,OAAO,EACP,IAAI,EACJ,IAAI,EACJ,GAAG,EACH,IAAI,EACJ,KAAK,UAAU,EACf,KAAK,YAAY,EACjB,KAAK,SAAS,EACd,KAAK,QAAQ,GACd,MAAM,WAAW,CAAA"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * @hanzo/ui/settings — a settings page, and what its sections are drawn from.
3
+ *
4
+ * `Settings` is the page: the sections grouped in a column from `md` up, a row
5
+ * of chips below it, and the open section in a 760px column. The section is the
6
+ * host's `children`, drawn from `Heading`, `Group`, `Card` + `Row`, `Field`,
7
+ * `Soft`, `Note` and `Once`, so every section of every surface reads as one
8
+ * page.
9
+ *
10
+ * Props in, callbacks out: which section is open is the host's (its address),
11
+ * and nothing here fetches.
12
+ */
13
+ export { Settings } from './Settings.js';
14
+ export { Card, Field, Group, Heading, Note, Once, Row, Soft, } from './Section.js';
15
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/settings/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EAAE,QAAQ,EAAkC,MAAM,YAAY,CAAA;AACrE,OAAO,EACL,IAAI,EACJ,KAAK,EACL,KAAK,EACL,OAAO,EACP,IAAI,EACJ,IAAI,EACJ,GAAG,EACH,IAAI,GAKL,MAAM,WAAW,CAAA"}