@hanzo/ui 8.0.54 → 8.0.56

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 (66) hide show
  1. package/README.md +5 -1
  2. package/dist/chat/Code.cjs +2 -36
  3. package/dist/chat/Code.d.ts +0 -13
  4. package/dist/chat/Code.d.ts.map +1 -1
  5. package/dist/chat/Code.js +2 -35
  6. package/dist/chat/Code.js.map +1 -1
  7. package/dist/chat/index.cjs +7 -2
  8. package/dist/chat/index.d.ts +7 -1
  9. package/dist/chat/index.d.ts.map +1 -1
  10. package/dist/chat/index.js +7 -1
  11. package/dist/chat/index.js.map +1 -1
  12. package/dist/gui-config.cjs +37 -12
  13. package/dist/gui-config.d.ts +1 -582
  14. package/dist/gui-config.d.ts.map +1 -1
  15. package/dist/gui-config.js +37 -12
  16. package/dist/gui-config.js.map +1 -1
  17. package/dist/product/AppHeader.cjs +8 -6
  18. package/dist/product/AppHeader.d.ts.map +1 -1
  19. package/dist/product/AppHeader.js +11 -9
  20. package/dist/product/AppHeader.js.map +1 -1
  21. package/dist/product/CopyButton.cjs +54 -0
  22. package/dist/product/CopyButton.d.ts +12 -0
  23. package/dist/product/CopyButton.d.ts.map +1 -0
  24. package/dist/product/CopyButton.js +52 -0
  25. package/dist/product/CopyButton.js.map +1 -0
  26. package/dist/product/Field.cjs +2 -1
  27. package/dist/product/Field.d.ts.map +1 -1
  28. package/dist/product/Field.js +2 -1
  29. package/dist/product/Field.js.map +1 -1
  30. package/dist/product/Fieldset.cjs +13 -0
  31. package/dist/product/Fieldset.d.ts +35 -0
  32. package/dist/product/Fieldset.d.ts.map +1 -0
  33. package/dist/product/Fieldset.js +11 -0
  34. package/dist/product/Fieldset.js.map +1 -0
  35. package/dist/product/OrgMark.cjs +39 -3
  36. package/dist/product/OrgMark.d.ts +9 -0
  37. package/dist/product/OrgMark.d.ts.map +1 -1
  38. package/dist/product/OrgMark.js +38 -3
  39. package/dist/product/OrgMark.js.map +1 -1
  40. package/dist/product/OrgSwitcher.cjs +3 -3
  41. package/dist/product/OrgSwitcher.d.ts +29 -1
  42. package/dist/product/OrgSwitcher.d.ts.map +1 -1
  43. package/dist/product/OrgSwitcher.js +3 -3
  44. package/dist/product/OrgSwitcher.js.map +1 -1
  45. package/dist/product/Pagination.cjs +72 -0
  46. package/dist/product/Pagination.d.ts +21 -0
  47. package/dist/product/Pagination.d.ts.map +1 -0
  48. package/dist/product/Pagination.js +68 -0
  49. package/dist/product/Pagination.js.map +1 -0
  50. package/dist/product/SecretInput.cjs +59 -0
  51. package/dist/product/SecretInput.d.ts +24 -0
  52. package/dist/product/SecretInput.d.ts.map +1 -0
  53. package/dist/product/SecretInput.js +55 -0
  54. package/dist/product/SecretInput.js.map +1 -0
  55. package/dist/product/UserMenu.cjs +63 -0
  56. package/dist/product/UserMenu.d.ts +56 -0
  57. package/dist/product/UserMenu.d.ts.map +1 -0
  58. package/dist/product/UserMenu.js +60 -0
  59. package/dist/product/UserMenu.js.map +1 -0
  60. package/dist/product/index.cjs +21 -2
  61. package/dist/product/index.d.ts +5 -0
  62. package/dist/product/index.d.ts.map +1 -1
  63. package/dist/product/index.js +21 -2
  64. package/dist/product/index.js.map +1 -1
  65. package/dist/styles.css +247 -247
  66. package/package.json +1 -1
package/README.md CHANGED
@@ -26,7 +26,11 @@ import { RecordsView, DataTable, BoardView, RecordDetail, registerField } from '
26
26
  - **Charts** (dependency-free inline SVG): `Sparkline`, `LineChart`, `BarChart`, `Donut`, `BarRows` — hover tooltips, axis ticks, honest `null` under two real points.
27
27
  - **Metric** tiles/panels: `MetricCard`, `MiniBars`, `UtilBar`, `LegendDot`, `Panel`, `HintButton` (+ `MetricSparkline`).
28
28
  - **Chrome**: `PageHeader`, `StatusTag`, `EmptyState` (DO/Vercel-class first-run), `PrimaryButton`, `HanzoMark`, `ProductIcon`, `ProviderLogo`.
29
- - **Interaction**: `ComboBox` (typeable, ReDoS-safe filter), `SelectMenu`, `SlideOver` (a11y drawer), `Toast` (`useToast`), `Reorder` (pointer DnD), `Field*` rows, `FadeIn`, `ThemeToggle`, generic `DataTable<T>`.
29
+ - **The identity trio** one row of chrome, three switchers: `OrgSwitcher` (which workspace, `direction` up or down, `footer` for a surface's own rows), the app switcher inside `AppHeader`, and `UserMenu` (who I am). `AppHeader` composes all three; each is importable alone, so a surface that wants an account menu without the whole header does not write a sixth one.
30
+ - **Settings**: `Fieldset` — the titled, optionally destructive group the `Field*` rows sit in. Not `Panel`: that is a dashboard metric tile.
31
+ - **Interaction**: `ComboBox` (typeable, ReDoS-safe filter), `SelectMenu`, `SlideOver` (a11y drawer), `Toast` (`useToast`), `Reorder` (pointer DnD), `Field*` rows, `CopyButton`, `SecretInput` (mask · reveal · copy), `Pagination` (+ the pure `pages` rule), `FadeIn`, `ThemeToggle`, generic `DataTable<T>`.
32
+
33
+ > **Masking needs both spellings.** `secureTextEntry` is React Native's and gui **drops it on web**, so an input carrying only that prop renders the secret in plain text; `type="password"` is the web one and native ignores it. `masked(on)` sets both and is what `SecretInput` and `<FieldText secure>` use. Never pass `secureTextEntry` alone.
30
34
  - **Tokens**: `tokens`, `TAG_TONES`, `tagTone` — the calm, dark-first, zinc-on-black identity.
31
35
  - **`@hanzo/ui/data`** — the metadata-driven record layer (source of truth: `@hanzo/data`): `RecordsView` (table ⇆ board, filter/sort/search/group, inline edit, saved views), the record-grid `DataTable`, `BoardView`, `RecordDetail`/`RecordForm`, every typed field editor, the field registry, and the pure view/sort/filter logic.
32
36
 
@@ -2,7 +2,6 @@
2
2
  'use client';
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.Code = Code;
5
- exports.CopyButton = CopyButton;
6
5
  const jsx_runtime_1 = require("react/jsx-runtime");
7
6
  /**
8
7
  * Code — a labelled, copyable code region.
@@ -17,11 +16,8 @@ const jsx_runtime_1 = require("react/jsx-runtime");
17
16
  * plain text or its own highlighted nodes.
18
17
  */
19
18
  const gui_1 = require("@hanzo/gui");
20
- const lucide_icons_2_1 = require("@hanzogui/lucide-icons-2");
21
- const react_1 = require("react");
22
19
  const slot_1 = require("../backends/gui/slot.cjs");
23
- /** How long the copy control shows its confirmation, in ms. */
24
- const CONFIRM = 2000;
20
+ const CopyButton_1 = require("../product/CopyButton.cjs");
25
21
  /**
26
22
  * Monospace stack, applied through `style` rather than a `$mono` token.
27
23
  *
@@ -36,35 +32,5 @@ const MONO = {
36
32
  };
37
33
  function Code({ children, language = 'text', value, actions }) {
38
34
  const text = value ?? (typeof children === 'string' ? children : '');
39
- return ((0, jsx_runtime_1.jsxs)(gui_1.YStack, { ...(0, slot_1.slot)('code'), width: "100%", rounded: "$4", borderWidth: 1, borderColor: "$borderColor", bg: "$color2", overflow: "hidden", children: [(0, jsx_runtime_1.jsxs)(gui_1.XStack, { items: "center", gap: "$1", px: "$3", py: "$1.5", borderBottomWidth: 1, borderColor: "$borderColor", children: [(0, jsx_runtime_1.jsx)(gui_1.SizableText, { size: "$1", style: MONO, color: "$color10", children: language }), (0, jsx_runtime_1.jsx)(gui_1.XStack, { flex: 1 }), actions, text ? (0, jsx_runtime_1.jsx)(CopyButton, { value: text }) : null] }), (0, jsx_runtime_1.jsx)(gui_1.YStack, { px: "$3", py: "$2.5", children: (0, jsx_runtime_1.jsx)(gui_1.SizableText, { size: "$1", style: MONO, lineHeight: 20, children: children }) })] }));
40
- }
41
- /**
42
- * CopyButton — copy with a confirmation tick.
43
- *
44
- * The tick is the point. A control that looks identical before and after leaves
45
- * the reader unsure whether it fired, and the usual response is to press it
46
- * again. Reverts after `CONFIRM`, and clears its timer on unmount so it cannot
47
- * set state on a component that is gone.
48
- */
49
- function CopyButton({ value, label = 'Copy' }) {
50
- const [copied, setCopied] = (0, react_1.useState)(false);
51
- const timer = (0, react_1.useRef)(undefined);
52
- (0, react_1.useEffect)(() => () => clearTimeout(timer.current), []);
53
- const copy = () => {
54
- // Optional-chained rather than assumed: `navigator.clipboard` is undefined
55
- // in insecure contexts and absent entirely on native, and these components
56
- // are meant to run on both.
57
- navigator?.clipboard
58
- ?.writeText(value)
59
- .then(() => {
60
- setCopied(true);
61
- clearTimeout(timer.current);
62
- timer.current = setTimeout(() => setCopied(false), CONFIRM);
63
- })
64
- .catch(() => {
65
- // A refused clipboard needs no toast — the missing tick already says it,
66
- // and an error dialog for a failed copy is louder than the failure.
67
- });
68
- };
69
- return ((0, jsx_runtime_1.jsx)(gui_1.XStack, { width: 24, height: 24, items: "center", justify: "center", rounded: "$2", cursor: "pointer", opacity: 0.7, onPress: copy, role: "button", tabIndex: 0, "aria-label": copied ? 'Copied' : label, ...(0, slot_1.tip)(copied ? 'Copied' : label), hoverStyle: { bg: '$color4', opacity: 1 }, pressStyle: { bg: '$color5' }, children: copied ? (0, jsx_runtime_1.jsx)(lucide_icons_2_1.Check, { size: 14 }) : (0, jsx_runtime_1.jsx)(lucide_icons_2_1.Copy, { size: 14 }) }));
35
+ return ((0, jsx_runtime_1.jsxs)(gui_1.YStack, { ...(0, slot_1.slot)('code'), width: "100%", rounded: "$4", borderWidth: 1, borderColor: "$borderColor", bg: "$color2", overflow: "hidden", children: [(0, jsx_runtime_1.jsxs)(gui_1.XStack, { items: "center", gap: "$1", px: "$3", py: "$1.5", borderBottomWidth: 1, borderColor: "$borderColor", children: [(0, jsx_runtime_1.jsx)(gui_1.SizableText, { size: "$1", style: MONO, color: "$color10", children: language }), (0, jsx_runtime_1.jsx)(gui_1.XStack, { flex: 1 }), actions, text ? (0, jsx_runtime_1.jsx)(CopyButton_1.CopyButton, { value: text }) : null] }), (0, jsx_runtime_1.jsx)(gui_1.YStack, { px: "$3", py: "$2.5", children: (0, jsx_runtime_1.jsx)(gui_1.SizableText, { size: "$1", style: MONO, lineHeight: 20, children: children }) })] }));
70
36
  }
@@ -9,17 +9,4 @@ export interface CodeProps {
9
9
  actions?: ReactNode;
10
10
  }
11
11
  export declare function Code({ children, language, value, actions }: CodeProps): import("react/jsx-runtime").JSX.Element;
12
- export interface CopyButtonProps {
13
- value: string;
14
- label?: string;
15
- }
16
- /**
17
- * CopyButton — copy with a confirmation tick.
18
- *
19
- * The tick is the point. A control that looks identical before and after leaves
20
- * the reader unsure whether it fired, and the usual response is to press it
21
- * again. Reverts after `CONFIRM`, and clears its timer on unmount so it cannot
22
- * set state on a component that is gone.
23
- */
24
- export declare function CopyButton({ value, label }: CopyButtonProps): import("react/jsx-runtime").JSX.Element;
25
12
  //# sourceMappingURL=Code.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Code.d.ts","sourceRoot":"","sources":["../../src/chat/Code.tsx"],"names":[],"mappings":"AAgBA,OAAO,EAA+B,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAoBnE,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,EAAE,SAAS,CAAA;IACpB,8BAA8B;IAC9B,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,mFAAmF;IACnF,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,oDAAoD;IACpD,OAAO,CAAC,EAAE,SAAS,CAAA;CACpB;AAED,wBAAgB,IAAI,CAAC,EAAE,QAAQ,EAAE,QAAiB,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,SAAS,2CAoC9E;AAED,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED;;;;;;;GAOG;AACH,wBAAgB,UAAU,CAAC,EAAE,KAAK,EAAE,KAAc,EAAE,EAAE,eAAe,2CA2CpE"}
1
+ {"version":3,"file":"Code.d.ts","sourceRoot":"","sources":["../../src/chat/Code.tsx"],"names":[],"mappings":"AAeA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAkBtC,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,EAAE,SAAS,CAAA;IACpB,8BAA8B;IAC9B,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,mFAAmF;IACnF,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,oDAAoD;IACpD,OAAO,CAAC,EAAE,SAAS,CAAA;CACpB;AAED,wBAAgB,IAAI,CAAC,EAAE,QAAQ,EAAE,QAAiB,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,SAAS,2CAoC9E"}
package/dist/chat/Code.js CHANGED
@@ -13,11 +13,8 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
13
  * plain text or its own highlighted nodes.
14
14
  */
15
15
  import { SizableText, XStack, YStack } from '@hanzo/gui';
16
- import { Check, Copy } from '@hanzogui/lucide-icons-2';
17
- import { useEffect, useRef, useState } from 'react';
18
- import { slot, tip } from '../backends/gui/slot.js';
19
- /** How long the copy control shows its confirmation, in ms. */
20
- const CONFIRM = 2000;
16
+ import { slot } from '../backends/gui/slot.js';
17
+ import { CopyButton } from '../product/CopyButton.js';
21
18
  /**
22
19
  * Monospace stack, applied through `style` rather than a `$mono` token.
23
20
  *
@@ -34,34 +31,4 @@ export function Code({ children, language = 'text', value, actions }) {
34
31
  const text = value ?? (typeof children === 'string' ? children : '');
35
32
  return (_jsxs(YStack, { ...slot('code'), width: "100%", rounded: "$4", borderWidth: 1, borderColor: "$borderColor", bg: "$color2", overflow: "hidden", children: [_jsxs(XStack, { items: "center", gap: "$1", px: "$3", py: "$1.5", borderBottomWidth: 1, borderColor: "$borderColor", children: [_jsx(SizableText, { size: "$1", style: MONO, color: "$color10", children: language }), _jsx(XStack, { flex: 1 }), actions, text ? _jsx(CopyButton, { value: text }) : null] }), _jsx(YStack, { px: "$3", py: "$2.5", children: _jsx(SizableText, { size: "$1", style: MONO, lineHeight: 20, children: children }) })] }));
36
33
  }
37
- /**
38
- * CopyButton — copy with a confirmation tick.
39
- *
40
- * The tick is the point. A control that looks identical before and after leaves
41
- * the reader unsure whether it fired, and the usual response is to press it
42
- * again. Reverts after `CONFIRM`, and clears its timer on unmount so it cannot
43
- * set state on a component that is gone.
44
- */
45
- export function CopyButton({ value, label = 'Copy' }) {
46
- const [copied, setCopied] = useState(false);
47
- const timer = useRef(undefined);
48
- useEffect(() => () => clearTimeout(timer.current), []);
49
- const copy = () => {
50
- // Optional-chained rather than assumed: `navigator.clipboard` is undefined
51
- // in insecure contexts and absent entirely on native, and these components
52
- // are meant to run on both.
53
- navigator?.clipboard
54
- ?.writeText(value)
55
- .then(() => {
56
- setCopied(true);
57
- clearTimeout(timer.current);
58
- timer.current = setTimeout(() => setCopied(false), CONFIRM);
59
- })
60
- .catch(() => {
61
- // A refused clipboard needs no toast — the missing tick already says it,
62
- // and an error dialog for a failed copy is louder than the failure.
63
- });
64
- };
65
- return (_jsx(XStack, { width: 24, height: 24, items: "center", justify: "center", rounded: "$2", cursor: "pointer", opacity: 0.7, onPress: copy, role: "button", tabIndex: 0, "aria-label": copied ? 'Copied' : label, ...tip(copied ? 'Copied' : label), hoverStyle: { bg: '$color4', opacity: 1 }, pressStyle: { bg: '$color5' }, children: copied ? _jsx(Check, { size: 14 }) : _jsx(Copy, { size: 14 }) }));
66
- }
67
34
  //# sourceMappingURL=Code.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Code.js","sourceRoot":"","sources":["../../src/chat/Code.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ;;;;;;;;;;;GAWG;AACH,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACxD,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAA;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAkB,MAAM,OAAO,CAAA;AAEnE,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,sBAAsB,CAAA;AAEhD,+DAA+D;AAC/D,MAAM,OAAO,GAAG,IAAI,CAAA;AAEpB;;;;;;;;GAQG;AACH,MAAM,IAAI,GAAG;IACX,UAAU,EAAE,wEAAwE;CAC5E,CAAA;AAYV,MAAM,UAAU,IAAI,CAAC,EAAE,QAAQ,EAAE,QAAQ,GAA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AC,UAAU,IAAC,KAAK,EAAE,IAAI,GAAI,CAAC,CAAC,CAAC,IAAI,IACnC,EAET,KAAC,MAAM,IAAC,EAAE,EAAC,IAAI,EAAC,EAAE,EAAC,MAAM,YACvB,KAAC,WAAW,IAAC,IAAI,EAAC,IAAI,EAAC,KAAK,EAAE,IAAI,EAAE,UAAU,EAAE,EAAE,YAC/C,QAAQ,GACG,GACP,IACF,CACV,CAAA;AACH,CAAC"}
@@ -1,6 +1,6 @@
1
1
  'use client';"use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SourceChip = exports.Sources = exports.CopyButton = exports.Code = exports.Aside = exports.AsideToggle = exports.ShareButton = exports.HeaderButton = exports.Header = exports.SidebarUser = exports.SidebarFolder = exports.SidebarItem = exports.SidebarSection = exports.SidebarScroll = exports.SidebarNewChat = exports.SidebarIconButton = exports.SidebarHeader = exports.Sidebar = exports.SLACK = exports.pinned = exports.sends = exports.ready = exports.Thread = exports.Message = exports.ASK = exports.Composer = void 0;
3
+ exports.SourceChip = exports.Sources = exports.Code = exports.Aside = exports.AsideToggle = exports.ShareButton = exports.HeaderButton = exports.Header = exports.SidebarUser = exports.SidebarFolder = exports.SidebarItem = exports.SidebarSection = exports.SidebarScroll = exports.SidebarNewChat = exports.SidebarIconButton = exports.SidebarHeader = exports.Sidebar = exports.SLACK = exports.pinned = exports.sends = exports.ready = exports.Thread = exports.Message = exports.ASK = exports.Composer = void 0;
4
4
  /**
5
5
  * @hanzo/ui/chat — the one chat shell, on @hanzo/gui primitives.
6
6
  *
@@ -20,6 +20,12 @@ exports.SourceChip = exports.Sources = exports.CopyButton = exports.Code = expor
20
20
  *
21
21
  * The model picker is not here: it already ships at `@hanzo/ui/models`, and it
22
22
  * is not chat-specific.
23
+ *
24
+ * `CopyButton` is not here either, for the same reason and after the same
25
+ * mistake: it lived in `Code.tsx`, so the only way to reach it was
26
+ * `@hanzo/ui/chat`, and no one hunting for a copy button looks in a chat module.
27
+ * Six surfaces wrote their own instead. It now ships at `@hanzo/ui/product`;
28
+ * `Code` imports it from there.
23
29
  */
24
30
  var Composer_1 = require("./Composer.cjs");
25
31
  Object.defineProperty(exports, "Composer", { enumerable: true, get: function () { return Composer_1.Composer; } });
@@ -52,7 +58,6 @@ Object.defineProperty(exports, "AsideToggle", { enumerable: true, get: function
52
58
  Object.defineProperty(exports, "Aside", { enumerable: true, get: function () { return Header_1.Aside; } });
53
59
  var Code_1 = require("./Code.cjs");
54
60
  Object.defineProperty(exports, "Code", { enumerable: true, get: function () { return Code_1.Code; } });
55
- Object.defineProperty(exports, "CopyButton", { enumerable: true, get: function () { return Code_1.CopyButton; } });
56
61
  var Sources_1 = require("./Sources.cjs");
57
62
  Object.defineProperty(exports, "Sources", { enumerable: true, get: function () { return Sources_1.Sources; } });
58
63
  Object.defineProperty(exports, "SourceChip", { enumerable: true, get: function () { return Sources_1.SourceChip; } });
@@ -17,6 +17,12 @@
17
17
  *
18
18
  * The model picker is not here: it already ships at `@hanzo/ui/models`, and it
19
19
  * is not chat-specific.
20
+ *
21
+ * `CopyButton` is not here either, for the same reason and after the same
22
+ * mistake: it lived in `Code.tsx`, so the only way to reach it was
23
+ * `@hanzo/ui/chat`, and no one hunting for a copy button looks in a chat module.
24
+ * Six surfaces wrote their own instead. It now ships at `@hanzo/ui/product`;
25
+ * `Code` imports it from there.
20
26
  */
21
27
  export { Composer, ASK, type ComposerProps } from './Composer.js';
22
28
  export { Message, type MessageProps, type Role } from './Message.js';
@@ -25,6 +31,6 @@ export { ready, sends, type Mods } from './send.js';
25
31
  export { pinned, SLACK, type Track } from './stick.js';
26
32
  export { Sidebar, SidebarHeader, SidebarIconButton, SidebarNewChat, SidebarScroll, SidebarSection, SidebarItem, SidebarFolder, SidebarUser, type SidebarProps, type SidebarHeaderProps, type SidebarIconButtonProps, type SidebarNewChatProps, type SidebarSectionProps, type SidebarItemProps, type SidebarFolderProps, type SidebarUserProps, } from './Sidebar.js';
27
33
  export { Header, HeaderButton, ShareButton, AsideToggle, Aside, type HeaderProps, type HeaderButtonProps, type ShareButtonProps, type AsideToggleProps, type AsideProps, } from './Header.js';
28
- export { Code, CopyButton, type CodeProps, type CopyButtonProps } from './Code.js';
34
+ export { Code, type CodeProps } from './Code.js';
29
35
  export { Sources, SourceChip, type Source, type SourcesProps, type SourceChipProps, } from './Sources.js';
30
36
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/chat/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EAAE,QAAQ,EAAE,GAAG,EAAE,KAAK,aAAa,EAAE,MAAM,YAAY,CAAA;AAC9D,OAAO,EAAE,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,IAAI,EAAE,MAAM,WAAW,CAAA;AACjE,OAAO,EAAE,MAAM,EAAE,KAAK,WAAW,EAAE,MAAM,UAAU,CAAA;AACnD,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,IAAI,EAAE,MAAM,QAAQ,CAAA;AAChD,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,KAAK,EAAE,MAAM,SAAS,CAAA;AAEnD,OAAO,EACL,OAAO,EACP,aAAa,EACb,iBAAiB,EACjB,cAAc,EACd,aAAa,EACb,cAAc,EACd,WAAW,EACX,aAAa,EACb,WAAW,EACX,KAAK,YAAY,EACjB,KAAK,kBAAkB,EACvB,KAAK,sBAAsB,EAC3B,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,GACtB,MAAM,WAAW,CAAA;AAElB,OAAO,EACL,MAAM,EACN,YAAY,EACZ,WAAW,EACX,WAAW,EACX,KAAK,EACL,KAAK,WAAW,EAChB,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,KAAK,UAAU,GAChB,MAAM,UAAU,CA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,KAAK,SAAS,EAAE,MAAM,QAAQ,CAAA;AAE7C,OAAO,EACL,OAAO,EACP,UAAU,EACV,KAAK,MAAM,EACX,KAAK,YAAY,EACjB,KAAK,eAAe,GACrB,MAAM,WAAW,CAAA"}
@@ -17,6 +17,12 @@
17
17
  *
18
18
  * The model picker is not here: it already ships at `@hanzo/ui/models`, and it
19
19
  * is not chat-specific.
20
+ *
21
+ * `CopyButton` is not here either, for the same reason and after the same
22
+ * mistake: it lived in `Code.tsx`, so the only way to reach it was
23
+ * `@hanzo/ui/chat`, and no one hunting for a copy button looks in a chat module.
24
+ * Six surfaces wrote their own instead. It now ships at `@hanzo/ui/product`;
25
+ * `Code` imports it from there.
20
26
  */
21
27
  export { Composer, ASK } from './Composer.js';
22
28
  export { Message } from './Message.js';
@@ -25,6 +31,6 @@ export { ready, sends } from './send.js';
25
31
  export { pinned, SLACK } from './stick.js';
26
32
  export { Sidebar, SidebarHeader, SidebarIconButton, SidebarNewChat, SidebarScroll, SidebarSection, SidebarItem, SidebarFolder, SidebarUser, } from './Sidebar.js';
27
33
  export { Header, HeaderButton, ShareButton, AsideToggle, Aside, } from './Header.js';
28
- export { Code, CopyButton } from './Code.js';
34
+ export { Code } from './Code.js';
29
35
  export { Sources, SourceChip, } from './Sources.js';
30
36
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/chat/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EAAE,QAAQ,EAAE,GAAG,EAAsB,MAAM,YAAY,CAAA;AAC9D,OAAO,EAAE,OAAO,EAAgC,MAAM,WAAW,CAAA;AACjE,OAAO,EAAE,MAAM,EAAoB,MAAM,UAAU,CAAA;AACnD,OAAO,EAAE,KAAK,EAAE,KAAK,EAAa,MAAM,QAAQ,CAAA;AAChD,OAAO,EAAE,MAAM,EAAE,KAAK,EAAc,MAAM,SAAS,CAAA;AAEnD,OAAO,EACL,OAAO,EACP,aAAa,EACb,iBAAiB,EACjB,cAAc,EACd,aAAa,EACb,cAAc,EACd,WAAW,EACX,aAAa,EACb,WAAW,GASZ,MAAM,WAAW,CAAA;AAElB,OAAO,EACL,MAAM,EACN,YAAY,EACZ,WAAW,EACX,WAAW,EACX,KAAK,GAMN,MAAM,UAAU,CAAA;AAEjB,OAAO,EAAE,IAAI,EAAE,UAAU,EAAwC,MAAM,QAAQ,CAAA;AAE/E,OAAO,EACL,OAAO,EACP,UAAU,GAIX,MAAM,WAAW,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/chat/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,OAAO,EAAE,QAAQ,EAAE,GAAG,EAAsB,MAAM,YAAY,CAAA;AAC9D,OAAO,EAAE,OAAO,EAAgC,MAAM,WAAW,CAAA;AACjE,OAAO,EAAE,MAAM,EAAoB,MAAM,UAAU,CAAA;AACnD,OAAO,EAAE,KAAK,EAAE,KAAK,EAAa,MAAM,QAAQ,CAAA;AAChD,OAAO,EAAE,MAAM,EAAE,KAAK,EAAc,MAAM,SAAS,CAAA;AAEnD,OAAO,EACL,OAAO,EACP,aAAa,EACb,iBAAiB,EACjB,cAAc,EACd,aAAa,EACb,cAAc,EACd,WAAW,EACX,aAAa,EACb,WAAW,GASZ,MAAM,WAAW,CAAA;AAElB,OAAO,EACL,MAAM,EACN,YAAY,EACZ,WAAW,EACX,WAAW,EACX,KAAK,GAMN,MAAM,UAAU,CAAA;AAEjB,OAAO,EAAE,IAAI,EAAkB,MAAM,QAAQ,CAAA;AAE7C,OAAO,EACL,OAAO,EACP,UAAU,GAIX,MAAM,WAAW,CAAA"}
@@ -188,20 +188,45 @@ space['-true'] = -STEP['4'];
188
188
  const EDGE = { dark: 'rgb(255 255 255 / .10)', light: 'rgb(0 0 0 / .10)' };
189
189
  const LABEL = { dark: '#fafafa', light: '#0a0a0a' };
190
190
  const RING = { dark: 'rgb(255 255 255 / .40)', light: 'rgb(0 0 0 / .5)' };
191
- const rebased = (theme) => ({
192
- ...v5_1.defaultConfig.themes[theme],
193
- color4: `var(--border, ${EDGE[theme]})`,
194
- borderColor: `var(--border, ${EDGE[theme]})`,
195
- color12: `var(--foreground, ${LABEL[theme]})`,
196
- outlineColor: `var(--ring, ${RING[theme]})`,
197
- });
191
+ /**
192
+ * The edge and the label are re-based on the two ROOT themes; the ring is
193
+ * re-based on ALL of them, and the asymmetry is the point.
194
+ *
195
+ * A sub-theme exists to hold different colours — `dark_accent`'s label really
196
+ * should be the accent's label, `dark_red`'s edge really should be red — so
197
+ * re-basing those two rungs everywhere would flatten 388 themes into one and
198
+ * stop being a re-base. A focus ring is the opposite kind of thing: there is
199
+ * exactly ONE of it in this system, it is `--ring`, and it is a contrast
200
+ * requirement rather than a colour choice. The ramp ships 21 distinct rings
201
+ * across 390 themes, twenty of them hues — a pale blue on `dark_blue_Button`,
202
+ * a pale pink on `dark_pink` — and every one of them fails 3:1 on a near-black
203
+ * canvas the same way the grey did.
204
+ *
205
+ * Measured, and this is why the two root themes are not enough: gui activates a
206
+ * `Button` sub-theme for every Button it renders, so hanzo.app's Sign In, Get
207
+ * started and Search kept `dark_Button`'s ring at 1.4:1 while the page's own
208
+ * `--outlineColor` already read design's. The three CTAs the audit named were
209
+ * exactly the three a root-only fix misses.
210
+ */
211
+ const scheme = (name) => (name.startsWith('light') ? 'light' : 'dark');
212
+ const themes = Object.fromEntries(Object.entries(v5_1.defaultConfig.themes).map(([name, theme]) => {
213
+ const s = scheme(name);
214
+ const ringed = { ...theme, outlineColor: `var(--ring, ${RING[s]})` };
215
+ return [
216
+ name,
217
+ name === s
218
+ ? {
219
+ ...ringed,
220
+ color4: `var(--border, ${EDGE[s]})`,
221
+ borderColor: `var(--border, ${EDGE[s]})`,
222
+ color12: `var(--foreground, ${LABEL[s]})`,
223
+ }
224
+ : ringed,
225
+ ];
226
+ }));
198
227
  exports.config = (0, gui_1.createGui)({
199
228
  ...v5_1.defaultConfig,
200
- themes: {
201
- ...v5_1.defaultConfig.themes,
202
- dark: rebased('dark'),
203
- light: rebased('light'),
204
- },
229
+ themes,
205
230
  tokens: {
206
231
  ...v5_1.defaultConfig.tokens,
207
232
  radius: RADIUS,