@hanzo/ui 8.0.118 → 8.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chat/Code.cjs +1 -1
- package/dist/chat/Code.d.ts.map +1 -1
- package/dist/chat/Code.js +2 -2
- package/dist/chat/Code.js.map +1 -1
- package/dist/chat/Message.cjs +38 -2
- package/dist/chat/Message.d.ts +17 -1
- package/dist/chat/Message.d.ts.map +1 -1
- package/dist/chat/Message.js +38 -3
- package/dist/chat/Message.js.map +1 -1
- package/dist/chat/index.cjs +2 -1
- package/dist/chat/index.d.ts +1 -1
- package/dist/chat/index.d.ts.map +1 -1
- package/dist/chat/index.js +1 -1
- package/dist/chat/index.js.map +1 -1
- package/dist/gallery.cjs +12 -1
- package/dist/gallery.d.ts.map +1 -1
- package/dist/gallery.js +12 -1
- package/dist/gallery.js.map +1 -1
- package/dist/product/DialogTemplate.cjs +23 -0
- package/dist/product/DialogTemplate.d.ts +55 -0
- package/dist/product/DialogTemplate.d.ts.map +1 -0
- package/dist/product/DialogTemplate.js +21 -0
- package/dist/product/DialogTemplate.js.map +1 -0
- package/dist/product/Skeleton.cjs +33 -0
- package/dist/product/Skeleton.d.ts +34 -0
- package/dist/product/Skeleton.d.ts.map +1 -0
- package/dist/product/Skeleton.js +31 -0
- package/dist/product/Skeleton.js.map +1 -0
- package/dist/product/Toast.cjs +23 -5
- package/dist/product/Toast.d.ts +23 -3
- package/dist/product/Toast.d.ts.map +1 -1
- package/dist/product/Toast.js +25 -7
- package/dist/product/Toast.js.map +1 -1
- package/dist/product/TooltipAnchor.cjs +37 -0
- package/dist/product/TooltipAnchor.d.ts +42 -0
- package/dist/product/TooltipAnchor.d.ts.map +1 -0
- package/dist/product/TooltipAnchor.js +35 -0
- package/dist/product/TooltipAnchor.js.map +1 -0
- package/dist/product/index.cjs +8 -0
- package/dist/product/index.d.ts +3 -0
- package/dist/product/index.d.ts.map +1 -1
- package/dist/product/index.js +8 -0
- package/dist/product/index.js.map +1 -1
- package/dist/styles/motion.css +7 -4
- package/dist/styles.css +53 -4
- package/package.json +1 -1
package/dist/chat/Code.cjs
CHANGED
|
@@ -32,5 +32,5 @@ const MONO = {
|
|
|
32
32
|
};
|
|
33
33
|
function Code({ children, language = 'text', value, actions }) {
|
|
34
34
|
const text = value ?? (typeof children === 'string' ? children : '');
|
|
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: "$color11", 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 }) })] }));
|
|
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: "$color11", 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.ScrollView, { horizontal: true, showsHorizontalScrollIndicator: false, children: (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 }) }) })] }));
|
|
36
36
|
}
|
package/dist/chat/Code.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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,
|
|
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,2CAyD9E"}
|
package/dist/chat/Code.js
CHANGED
|
@@ -12,7 +12,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
12
12
|
* dependency or be bypassed. `children` is rendered as-is, so a surface can pass
|
|
13
13
|
* plain text or its own highlighted nodes.
|
|
14
14
|
*/
|
|
15
|
-
import { SizableText, XStack, YStack } from '@hanzo/gui';
|
|
15
|
+
import { ScrollView, SizableText, XStack, YStack } from '@hanzo/gui';
|
|
16
16
|
import { slot } from '../backends/gui/slot.js';
|
|
17
17
|
import { CopyButton } from '../product/CopyButton.js';
|
|
18
18
|
/**
|
|
@@ -29,6 +29,6 @@ const MONO = {
|
|
|
29
29
|
};
|
|
30
30
|
export function Code({ children, language = 'text', value, actions }) {
|
|
31
31
|
const text = value ?? (typeof children === 'string' ? children : '');
|
|
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: "$color11", 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 }) })] }));
|
|
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: "$color11", children: language }), _jsx(XStack, { flex: 1 }), actions, text ? _jsx(CopyButton, { value: text }) : null] }), _jsx(ScrollView, { horizontal: true, showsHorizontalScrollIndicator: false, children: _jsx(YStack, { px: "$3", py: "$2.5", children: _jsx(SizableText, { size: "$1", style: MONO, lineHeight: 20, children: children }) }) })] }));
|
|
33
33
|
}
|
|
34
34
|
//# sourceMappingURL=Code.js.map
|
package/dist/chat/Code.js.map
CHANGED
|
@@ -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;
|
|
1
|
+
{"version":3,"file":"Code.js","sourceRoot":"","sources":["../../src/chat/Code.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ;;;;;;;;;;;GAWG;AACH,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AAGpE,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AAElD;;;;;;;;GAQG;AACH,MAAM,IAAI,GAAG;IACX,UAAU,EAAE,wEAAwE;CAC5E,CAAA;AAYV,MAAM,UAAU,IAAI,CAAC,EAAE,QAAQ,EAAE,QAAQ,GAAG,MAAM,EAAE,KAAK,EAAE,OAAO,EAAa;IAC7E,MAAM,IAAI,GAAG,KAAK,IAAI,CAAC,OAAO,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAA;IAEpE,OAAO,CACL,MAAC,MAAM,OACD,IAAI,CAAC,MAAM,CAAC,EAChB,KAAK,EAAC,MAAM,EACZ,OAAO,EAAC,IAAI,EACZ,WAAW,EAAE,CAAC,EACd,WAAW,EAAC,cAAc,EAC1B,EAAE,EAAC,SAAS,EACZ,QAAQ,EAAC,QAAQ,aAEjB,MAAC,MAAM,IACL,KAAK,EAAC,QAAQ,EACd,GAAG,EAAC,IAAI,EACR,EAAE,EAAC,IAAI,EACP,EAAE,EAAC,MAAM,EACT,iBAAiB,EAAE,CAAC,EACpB,WAAW,EAAC,cAAc,aAQ1B,KAAC,WAAW,IAAC,IAAI,EAAC,IAAI,EAAC,KAAK,EAAE,IAAI,EAAE,KAAK,EAAC,UAAU,YACjD,QAAQ,GACG,EACd,KAAC,MAAM,IAAC,IAAI,EAAE,CAAC,GAAI,EAClB,OAAO,EACP,IAAI,CAAC,CAAC,CAAC,KAAC,UAAU,IAAC,KAAK,EAAE,IAAI,GAAI,CAAC,CAAC,CAAC,IAAI,IACnC,EAeT,KAAC,UAAU,IAAC,UAAU,QAAC,8BAA8B,EAAE,KAAK,YAC1D,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,GACE,IACN,CACV,CAAA;AACH,CAAC"}
|
package/dist/chat/Message.cjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use client';"use strict";
|
|
2
2
|
'use client';
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.Caret = Caret;
|
|
4
5
|
exports.Message = Message;
|
|
5
6
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
7
|
/**
|
|
@@ -11,17 +12,52 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
11
12
|
* turn is a muted aside. Content is `children`, so the surface keeps its own
|
|
12
13
|
* markdown pipeline — the surfaces disagree on remark plugins and none of that
|
|
13
14
|
* belongs in a presentational package.
|
|
15
|
+
*
|
|
16
|
+
* That arrangement is not this package's taste; it is what all six turn
|
|
17
|
+
* renderers across the estate independently arrived at. hanzo/chat states it
|
|
18
|
+
* outright in `client/src/components/Chat/Messages/ui/MessageRender.tsx:131`:
|
|
19
|
+
* "the user's turn is a glass bubble on the right, the reply plain and full
|
|
20
|
+
* width — the contrast is what says who is speaking." No avatar, no sender
|
|
21
|
+
* name, no timestamp — which is why `icon` is opt-in and there is no `name`
|
|
22
|
+
* prop. Only the read-only share view renders a name, and only one surface
|
|
23
|
+
* renders a timestamp.
|
|
14
24
|
*/
|
|
15
25
|
const gui_1 = require("@hanzo/gui");
|
|
26
|
+
const ink_1 = require("../backends/gui/ink.cjs");
|
|
16
27
|
const slot_1 = require("../backends/gui/slot.cjs");
|
|
28
|
+
/**
|
|
29
|
+
* The mark that says a turn is still arriving.
|
|
30
|
+
*
|
|
31
|
+
* Placed by whoever knows where the prose ends. A surface rendering markdown
|
|
32
|
+
* owns that node and can append this inside it; `Message busy` puts it at the
|
|
33
|
+
* end of the turn instead, which is all this package can know.
|
|
34
|
+
*
|
|
35
|
+
* It does not blink. Every surface that ships one draws it static — an 8x16
|
|
36
|
+
* block on hanzo.app `/chat`, a 2px caret in the builder, a 12px `⬤` from
|
|
37
|
+
* hanzo/chat's `.result-streaming::after`. A caret is the narrowest of the
|
|
38
|
+
* three and the one that reads as "the sentence continues" rather than as a
|
|
39
|
+
* bullet. Decorative, so it is hidden from assistive tech: the turn's text is
|
|
40
|
+
* already live-announced by the surface, and a cursor announced as content is
|
|
41
|
+
* noise on every token.
|
|
42
|
+
*/
|
|
43
|
+
function Caret() {
|
|
44
|
+
return (0, jsx_runtime_1.jsx)(gui_1.YStack, { ...(0, slot_1.slot)('caret'), width: 2, height: 15, rounded: 1, bg: "$color12", "aria-hidden": true });
|
|
45
|
+
}
|
|
17
46
|
function Message({ role, children, actions, busy = false, icon }) {
|
|
18
47
|
if (role === 'system')
|
|
19
48
|
return ((0, jsx_runtime_1.jsx)(gui_1.XStack, { ...(0, slot_1.slot)('message'), "data-role": "system", width: "100%", justify: "center", py: "$2", children: (0, jsx_runtime_1.jsx)(gui_1.Text, { fontSize: "$1", color: "$color10", text: "center", children: children }) }));
|
|
20
49
|
const mine = role === 'user';
|
|
21
|
-
return ((0, jsx_runtime_1.jsxs)(gui_1.XStack, { ...(0, slot_1.slot)('message'), "data-role": role, width: "100%", justify: mine ? 'flex-end' : 'flex-start', gap: "$2", children: [icon && !mine ? (0, jsx_runtime_1.jsx)(gui_1.YStack, { pt: "$1", children: icon }) : null, (0, jsx_runtime_1.jsxs)(gui_1.YStack, { ...(0, slot_1.slot)('message-body'), "data-bubble": mine ? 'true' : undefined, gap: "$2",
|
|
50
|
+
return ((0, jsx_runtime_1.jsxs)(gui_1.XStack, { ...(0, slot_1.slot)('message'), "data-role": role, width: "100%", justify: mine ? 'flex-end' : 'flex-start', gap: "$2", children: [icon && !mine ? (0, jsx_runtime_1.jsx)(gui_1.YStack, { pt: "$1", children: icon }) : null, (0, jsx_runtime_1.jsxs)(gui_1.YStack, { ...(0, slot_1.slot)('message-body'), "data-bubble": mine ? 'true' : undefined, gap: "$2",
|
|
51
|
+
// 85%, because that is the number three independent implementations
|
|
52
|
+
// reached: hanzo/chat's `USER_TURN` (`common/turn.ts:17`,
|
|
53
|
+
// `max-w-[85%]`), hanzo.app `/chat` (`app/chat/page.tsx:521`,
|
|
54
|
+
// `maxWidth="85%"`) and the app builder's `UserBubble`
|
|
55
|
+
// (`ask-ai/chat-thread.tsx:141`). This package said 80% and no one
|
|
56
|
+
// said 80%.
|
|
57
|
+
maxW: mine ? '85%' : '100%', flex: mine ? undefined : 1, ...(mine && {
|
|
22
58
|
bg: '$color3',
|
|
23
59
|
rounded: '$5',
|
|
24
60
|
px: '$3',
|
|
25
61
|
py: '$2',
|
|
26
|
-
}), children: [children, busy ? (0, jsx_runtime_1.jsx)(
|
|
62
|
+
}), children: [(0, ink_1.ink)(children), busy ? (0, jsx_runtime_1.jsx)(Caret, {}) : null, actions ? (0, jsx_runtime_1.jsx)(gui_1.XStack, { gap: "$1", items: "center", children: actions }) : null] })] }));
|
|
27
63
|
}
|
package/dist/chat/Message.d.ts
CHANGED
|
@@ -1,11 +1,27 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
2
|
export type Role = 'user' | 'assistant' | 'system';
|
|
3
|
+
/**
|
|
4
|
+
* The mark that says a turn is still arriving.
|
|
5
|
+
*
|
|
6
|
+
* Placed by whoever knows where the prose ends. A surface rendering markdown
|
|
7
|
+
* owns that node and can append this inside it; `Message busy` puts it at the
|
|
8
|
+
* end of the turn instead, which is all this package can know.
|
|
9
|
+
*
|
|
10
|
+
* It does not blink. Every surface that ships one draws it static — an 8x16
|
|
11
|
+
* block on hanzo.app `/chat`, a 2px caret in the builder, a 12px `⬤` from
|
|
12
|
+
* hanzo/chat's `.result-streaming::after`. A caret is the narrowest of the
|
|
13
|
+
* three and the one that reads as "the sentence continues" rather than as a
|
|
14
|
+
* bullet. Decorative, so it is hidden from assistive tech: the turn's text is
|
|
15
|
+
* already live-announced by the surface, and a cursor announced as content is
|
|
16
|
+
* noise on every token.
|
|
17
|
+
*/
|
|
18
|
+
export declare function Caret(): import("react/jsx-runtime").JSX.Element;
|
|
3
19
|
export interface MessageProps {
|
|
4
20
|
role: Role;
|
|
5
21
|
children?: ReactNode;
|
|
6
22
|
/** Row rendered under the turn — copy, retry, feedback. */
|
|
7
23
|
actions?: ReactNode;
|
|
8
|
-
/** The turn is still streaming. */
|
|
24
|
+
/** The turn is still streaming: a `Caret` closes the body. */
|
|
9
25
|
busy?: boolean;
|
|
10
26
|
/** Leading affordance for an assistant turn: avatar or model mark. */
|
|
11
27
|
icon?: ReactNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Message.d.ts","sourceRoot":"","sources":["../../src/chat/Message.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Message.d.ts","sourceRoot":"","sources":["../../src/chat/Message.tsx"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAKtC,MAAM,MAAM,IAAI,GAAG,MAAM,GAAG,WAAW,GAAG,QAAQ,CAAA;AAElD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,KAAK,4CAEpB;AAED,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,IAAI,CAAA;IACV,QAAQ,CAAC,EAAE,SAAS,CAAA;IACpB,2DAA2D;IAC3D,OAAO,CAAC,EAAE,SAAS,CAAA;IACnB,8DAA8D;IAC9D,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,sEAAsE;IACtE,IAAI,CAAC,EAAE,SAAS,CAAA;CACjB;AAED,wBAAgB,OAAO,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAY,EAAE,IAAI,EAAE,EAAE,YAAY,2CA6CpF"}
|
package/dist/chat/Message.js
CHANGED
|
@@ -8,18 +8,53 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
8
8
|
* turn is a muted aside. Content is `children`, so the surface keeps its own
|
|
9
9
|
* markdown pipeline — the surfaces disagree on remark plugins and none of that
|
|
10
10
|
* belongs in a presentational package.
|
|
11
|
+
*
|
|
12
|
+
* That arrangement is not this package's taste; it is what all six turn
|
|
13
|
+
* renderers across the estate independently arrived at. hanzo/chat states it
|
|
14
|
+
* outright in `client/src/components/Chat/Messages/ui/MessageRender.tsx:131`:
|
|
15
|
+
* "the user's turn is a glass bubble on the right, the reply plain and full
|
|
16
|
+
* width — the contrast is what says who is speaking." No avatar, no sender
|
|
17
|
+
* name, no timestamp — which is why `icon` is opt-in and there is no `name`
|
|
18
|
+
* prop. Only the read-only share view renders a name, and only one surface
|
|
19
|
+
* renders a timestamp.
|
|
11
20
|
*/
|
|
12
|
-
import {
|
|
21
|
+
import { Text, XStack, YStack } from '@hanzo/gui';
|
|
22
|
+
import { ink } from '../backends/gui/ink.js';
|
|
13
23
|
import { slot } from '../backends/gui/slot.js';
|
|
24
|
+
/**
|
|
25
|
+
* The mark that says a turn is still arriving.
|
|
26
|
+
*
|
|
27
|
+
* Placed by whoever knows where the prose ends. A surface rendering markdown
|
|
28
|
+
* owns that node and can append this inside it; `Message busy` puts it at the
|
|
29
|
+
* end of the turn instead, which is all this package can know.
|
|
30
|
+
*
|
|
31
|
+
* It does not blink. Every surface that ships one draws it static — an 8x16
|
|
32
|
+
* block on hanzo.app `/chat`, a 2px caret in the builder, a 12px `⬤` from
|
|
33
|
+
* hanzo/chat's `.result-streaming::after`. A caret is the narrowest of the
|
|
34
|
+
* three and the one that reads as "the sentence continues" rather than as a
|
|
35
|
+
* bullet. Decorative, so it is hidden from assistive tech: the turn's text is
|
|
36
|
+
* already live-announced by the surface, and a cursor announced as content is
|
|
37
|
+
* noise on every token.
|
|
38
|
+
*/
|
|
39
|
+
export function Caret() {
|
|
40
|
+
return _jsx(YStack, { ...slot('caret'), width: 2, height: 15, rounded: 1, bg: "$color12", "aria-hidden": true });
|
|
41
|
+
}
|
|
14
42
|
export function Message({ role, children, actions, busy = false, icon }) {
|
|
15
43
|
if (role === 'system')
|
|
16
44
|
return (_jsx(XStack, { ...slot('message'), "data-role": "system", width: "100%", justify: "center", py: "$2", children: _jsx(Text, { fontSize: "$1", color: "$color10", text: "center", children: children }) }));
|
|
17
45
|
const mine = role === 'user';
|
|
18
|
-
return (_jsxs(XStack, { ...slot('message'), "data-role": role, width: "100%", justify: mine ? 'flex-end' : 'flex-start', gap: "$2", children: [icon && !mine ? _jsx(YStack, { pt: "$1", children: icon }) : null, _jsxs(YStack, { ...slot('message-body'), "data-bubble": mine ? 'true' : undefined, gap: "$2",
|
|
46
|
+
return (_jsxs(XStack, { ...slot('message'), "data-role": role, width: "100%", justify: mine ? 'flex-end' : 'flex-start', gap: "$2", children: [icon && !mine ? _jsx(YStack, { pt: "$1", children: icon }) : null, _jsxs(YStack, { ...slot('message-body'), "data-bubble": mine ? 'true' : undefined, gap: "$2",
|
|
47
|
+
// 85%, because that is the number three independent implementations
|
|
48
|
+
// reached: hanzo/chat's `USER_TURN` (`common/turn.ts:17`,
|
|
49
|
+
// `max-w-[85%]`), hanzo.app `/chat` (`app/chat/page.tsx:521`,
|
|
50
|
+
// `maxWidth="85%"`) and the app builder's `UserBubble`
|
|
51
|
+
// (`ask-ai/chat-thread.tsx:141`). This package said 80% and no one
|
|
52
|
+
// said 80%.
|
|
53
|
+
maxW: mine ? '85%' : '100%', flex: mine ? undefined : 1, ...(mine && {
|
|
19
54
|
bg: '$color3',
|
|
20
55
|
rounded: '$5',
|
|
21
56
|
px: '$3',
|
|
22
57
|
py: '$2',
|
|
23
|
-
}), children: [children, busy ? _jsx(
|
|
58
|
+
}), children: [ink(children), busy ? _jsx(Caret, {}) : null, actions ? _jsx(XStack, { gap: "$1", items: "center", children: actions }) : null] })] }));
|
|
24
59
|
}
|
|
25
60
|
//# sourceMappingURL=Message.js.map
|
package/dist/chat/Message.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Message.js","sourceRoot":"","sources":["../../src/chat/Message.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ
|
|
1
|
+
{"version":3,"file":"Message.js","sourceRoot":"","sources":["../../src/chat/Message.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AAGjD,OAAO,EAAE,GAAG,EAAE,MAAM,qBAAqB,CAAA;AACzC,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;AAI3C;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,KAAK;IACnB,OAAO,KAAC,MAAM,OAAK,IAAI,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,EAAE,EAAC,UAAU,wBAAe,CAAA;AAClG,CAAC;AAaD,MAAM,UAAU,OAAO,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,GAAG,KAAK,EAAE,IAAI,EAAgB;IACnF,IAAI,IAAI,KAAK,QAAQ;QACnB,OAAO,CACL,KAAC,MAAM,OAAK,IAAI,CAAC,SAAS,CAAC,eAAY,QAAQ,EAAC,KAAK,EAAC,MAAM,EAAC,OAAO,EAAC,QAAQ,EAAC,EAAE,EA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,IAAI,IAC7D,IACF,CACV,CAAA;AACH,CAAC"}
|
package/dist/chat/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
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;
|
|
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.Caret = exports.ASK = exports.Composer = void 0;
|
|
4
4
|
/**
|
|
5
5
|
* @hanzo/ui/chat — the one chat shell, on @hanzo/gui primitives.
|
|
6
6
|
*
|
|
@@ -31,6 +31,7 @@ var Composer_1 = require("./Composer.cjs");
|
|
|
31
31
|
Object.defineProperty(exports, "Composer", { enumerable: true, get: function () { return Composer_1.Composer; } });
|
|
32
32
|
Object.defineProperty(exports, "ASK", { enumerable: true, get: function () { return Composer_1.ASK; } });
|
|
33
33
|
var Message_1 = require("./Message.cjs");
|
|
34
|
+
Object.defineProperty(exports, "Caret", { enumerable: true, get: function () { return Message_1.Caret; } });
|
|
34
35
|
Object.defineProperty(exports, "Message", { enumerable: true, get: function () { return Message_1.Message; } });
|
|
35
36
|
var Thread_1 = require("./Thread.cjs");
|
|
36
37
|
Object.defineProperty(exports, "Thread", { enumerable: true, get: function () { return Thread_1.Thread; } });
|
package/dist/chat/index.d.ts
CHANGED
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
* `Code` imports it from there.
|
|
26
26
|
*/
|
|
27
27
|
export { Composer, ASK, type ComposerProps } from './Composer.js';
|
|
28
|
-
export { Message, type MessageProps, type Role } from './Message.js';
|
|
28
|
+
export { Caret, Message, type MessageProps, type Role } from './Message.js';
|
|
29
29
|
export { Thread, type ThreadProps } from './Thread.js';
|
|
30
30
|
export { ready, sends, type Mods } from './send.js';
|
|
31
31
|
export { pinned, SLACK, type Track } from './stick.js';
|
package/dist/chat/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/chat/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;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;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/chat/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,OAAO,EAAE,QAAQ,EAAE,GAAG,EAAE,KAAK,aAAa,EAAE,MAAM,YAAY,CAAA;AAC9D,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,IAAI,EAAE,MAAM,WAAW,CAAA;AACxE,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,CAAA;AAEjB,OAAO,EAAE,IAAI,EAAE,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"}
|
package/dist/chat/index.js
CHANGED
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
* `Code` imports it from there.
|
|
26
26
|
*/
|
|
27
27
|
export { Composer, ASK } from './Composer.js';
|
|
28
|
-
export { Message } from './Message.js';
|
|
28
|
+
export { Caret, Message } from './Message.js';
|
|
29
29
|
export { Thread } from './Thread.js';
|
|
30
30
|
export { ready, sends } from './send.js';
|
|
31
31
|
export { pinned, SLACK } from './stick.js';
|
package/dist/chat/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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;
|
|
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,KAAK,EAAE,OAAO,EAAgC,MAAM,WAAW,CAAA;AACxE,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"}
|
package/dist/gallery.cjs
CHANGED
|
@@ -5,6 +5,10 @@ exports.Gallery = void 0;
|
|
|
5
5
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
6
|
const box_1 = require("./box.cjs");
|
|
7
7
|
const Workbench_1 = require("./product/Workbench.cjs");
|
|
8
|
+
const Skeleton_1 = require("./product/Skeleton.cjs");
|
|
9
|
+
const TooltipAnchor_1 = require("./product/TooltipAnchor.cjs");
|
|
10
|
+
const DialogTemplate_1 = require("./product/DialogTemplate.cjs");
|
|
11
|
+
const chat_1 = require("./chat/index.cjs");
|
|
8
12
|
const gui_1 = require("./backends/gui/index.cjs");
|
|
9
13
|
/** A real <img> with real intrinsic pixels, inline so nothing hits the network.
|
|
10
14
|
* 120x40 on purpose: the wrong ratio for every box it goes in, so a frame that
|
|
@@ -20,6 +24,13 @@ const BUTTON_VARIANTS = [
|
|
|
20
24
|
];
|
|
21
25
|
const BUTTON_SIZES = ['default', 'sm', 'lg', 'icon', 'icon-sm', 'icon-lg'];
|
|
22
26
|
const BADGE_VARIANTS = ['default', 'secondary', 'destructive', 'outline'];
|
|
27
|
+
/** The chat shell is callbacks-out, and this list only needs them to exist. */
|
|
28
|
+
const NOOP = () => { };
|
|
29
|
+
/** Two, so the grid's wrap rule and the letter fallback both render. */
|
|
30
|
+
const SOURCES = [
|
|
31
|
+
{ id: 'a', title: 'hanzo.ai', href: 'https://hanzo.ai' },
|
|
32
|
+
{ id: 'b', title: 'Reference' },
|
|
33
|
+
];
|
|
23
34
|
/** One section. Plain CSS on a plain div — the gallery is a harness, and laying
|
|
24
35
|
* it out with the components under test would make a layout bug read as a
|
|
25
36
|
* styling bug. Rows wrap so the same tree is legible at 390px and at 1280px,
|
|
@@ -42,6 +53,6 @@ const Gallery = () => ((0, jsx_runtime_1.jsxs)("div", { style: { display: 'flex'
|
|
|
42
53
|
tabs: [
|
|
43
54
|
{ id: 'console', title: 'Console', closable: false, content: (0, jsx_runtime_1.jsx)(gui_1.CardTitle, { children: "console" }) },
|
|
44
55
|
],
|
|
45
|
-
}, children: (0, jsx_runtime_1.jsx)(gui_1.CardTitle, { children: "center" }) }) }) }), (0, jsx_runtime_1.jsxs)(Section, { name: "box", children: [(0, jsx_runtime_1.jsx)(box_1.Box, { className: "flex items-center gap-4 px-6 py-3 rounded-lg border", children: (0, jsx_runtime_1.jsx)(gui_1.CardTitle, { children: "utility classes" }) }), (0, jsx_runtime_1.jsx)(box_1.Box, { className: "flex-col gap-2 max-w-3xl mx-auto overflow-hidden", children: (0, jsx_runtime_1.jsx)(gui_1.CardTitle, { children: "column" }) })] })] }));
|
|
56
|
+
}, children: (0, jsx_runtime_1.jsx)(gui_1.CardTitle, { children: "center" }) }) }) }), (0, jsx_runtime_1.jsxs)(Section, { name: "product-arrangements", children: [(0, jsx_runtime_1.jsxs)("div", { style: { display: 'flex', flexDirection: 'column', gap: 12, width: 320 }, children: [(0, jsx_runtime_1.jsx)(Skeleton_1.Skeleton, { width: 120 }), (0, jsx_runtime_1.jsx)(Skeleton_1.Skeleton, { width: "100%", height: 72, rounded: "$4" }), (0, jsx_runtime_1.jsx)(Skeleton_1.Skeleton.Text, { lines: 3 })] }), (0, jsx_runtime_1.jsx)(TooltipAnchor_1.TooltipAnchor, { description: "Delete this agent", children: (0, jsx_runtime_1.jsx)(gui_1.Button, { children: "hinted" }) }), (0, jsx_runtime_1.jsx)(gui_1.Dialog, { open: true, children: (0, jsx_runtime_1.jsx)(DialogTemplate_1.DialogTemplate, { title: "Delete agent", description: "This removes every run recorded against it.", confirm: { label: 'Delete', tone: 'danger' }, children: (0, jsx_runtime_1.jsx)(gui_1.CardTitle, { children: "body" }) }) })] }), (0, jsx_runtime_1.jsxs)(Section, { name: "chat", children: [(0, jsx_runtime_1.jsxs)("div", { style: { display: 'flex', flexDirection: 'column', gap: 12, width: 520, height: 320 }, children: [(0, jsx_runtime_1.jsxs)(chat_1.Header, { title: "A conversation with a long enough name to clamp", children: [(0, jsx_runtime_1.jsx)(chat_1.ShareButton, {}), (0, jsx_runtime_1.jsx)(chat_1.AsideToggle, {})] }), (0, jsx_runtime_1.jsxs)(chat_1.Thread, { children: [(0, jsx_runtime_1.jsx)(chat_1.Message, { role: "user", children: "ask" }), (0, jsx_runtime_1.jsxs)(chat_1.Message, { role: "assistant", icon: (0, jsx_runtime_1.jsx)(gui_1.Spinner, {}), actions: (0, jsx_runtime_1.jsx)(gui_1.Badge, { children: "copy" }), children: [(0, jsx_runtime_1.jsx)(chat_1.Code, { language: "typescript", value: "const x = 1", children: "const x = 1" }), (0, jsx_runtime_1.jsx)(chat_1.Sources, { sources: SOURCES })] }), (0, jsx_runtime_1.jsx)(chat_1.Message, { role: "assistant", busy: true, children: "answering" }), (0, jsx_runtime_1.jsx)(chat_1.Message, { role: "system", children: "note" })] }), (0, jsx_runtime_1.jsx)(chat_1.Composer, { value: "a draft", onChange: NOOP, onSend: NOOP, hint: "Enter to send", children: (0, jsx_runtime_1.jsx)(gui_1.Badge, { children: "tool" }) }), (0, jsx_runtime_1.jsx)(chat_1.Composer, { value: "", onChange: NOOP, onSend: NOOP, onStop: NOOP, busy: true })] }), (0, jsx_runtime_1.jsx)(chat_1.Aside, { children: (0, jsx_runtime_1.jsx)(chat_1.Sources, { sources: SOURCES }) }), (0, jsx_runtime_1.jsx)("div", { style: { display: 'flex', width: 260, height: 320 }, children: (0, jsx_runtime_1.jsxs)(chat_1.Sidebar, { children: [(0, jsx_runtime_1.jsx)(chat_1.SidebarHeader, { title: "Hanzo", onOpenSwitcher: NOOP, onSearch: NOOP, onCollapse: NOOP }), (0, jsx_runtime_1.jsx)(chat_1.SidebarNewChat, { onPress: NOOP }), (0, jsx_runtime_1.jsxs)(chat_1.SidebarScroll, { children: [(0, jsx_runtime_1.jsxs)(chat_1.SidebarSection, { label: "Today", children: [(0, jsx_runtime_1.jsx)(chat_1.SidebarItem, { active: true, onPress: NOOP, children: "Selected thread" }), (0, jsx_runtime_1.jsx)(chat_1.SidebarItem, { onPress: NOOP, children: "Another thread" })] }), (0, jsx_runtime_1.jsx)(chat_1.SidebarFolder, { name: "Archive", defaultOpen: true, children: (0, jsx_runtime_1.jsx)(chat_1.SidebarItem, { onPress: NOOP, children: "Nested thread" }) })] }), (0, jsx_runtime_1.jsx)(chat_1.SidebarUser, { name: "z", secondary: "z@hanzo.ai", onPress: NOOP, onHelp: NOOP })] }) })] }), (0, jsx_runtime_1.jsxs)(Section, { name: "box", children: [(0, jsx_runtime_1.jsx)(box_1.Box, { className: "flex items-center gap-4 px-6 py-3 rounded-lg border", children: (0, jsx_runtime_1.jsx)(gui_1.CardTitle, { children: "utility classes" }) }), (0, jsx_runtime_1.jsx)(box_1.Box, { className: "flex-col gap-2 max-w-3xl mx-auto overflow-hidden", children: (0, jsx_runtime_1.jsx)(gui_1.CardTitle, { children: "column" }) })] })] }));
|
|
46
57
|
exports.Gallery = Gallery;
|
|
47
58
|
exports.default = exports.Gallery;
|
package/dist/gallery.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gallery.d.ts","sourceRoot":"","sources":["../src/gallery.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"gallery.d.ts","sourceRoot":"","sources":["../src/gallery.tsx"],"names":[],"mappings":"AA8GA;;;GAGG;AACH,eAAO,MAAM,OAAO,+CA+enB,CAAA;AAED,eAAe,OAAO,CAAA"}
|
package/dist/gallery.js
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { Box } from './box.js';
|
|
4
4
|
import { Workbench } from './product/Workbench.js';
|
|
5
|
+
import { Skeleton } from './product/Skeleton.js';
|
|
6
|
+
import { TooltipAnchor } from './product/TooltipAnchor.js';
|
|
7
|
+
import { DialogTemplate } from './product/DialogTemplate.js';
|
|
8
|
+
import { Aside, AsideToggle, Code, Composer, Header as ChatHeader, Message, ShareButton, Sidebar, SidebarFolder, SidebarHeader, SidebarItem, SidebarNewChat, SidebarScroll, SidebarSection, SidebarUser, Sources, Thread, } from './chat/index.js';
|
|
5
9
|
import { Accordion, AccordionContent, AccordionItem, AccordionTrigger, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, ContextMenu, ContextMenuContent, ContextMenuItem, ContextMenuLabel, ContextMenuSeparator, ContextMenuTrigger, HoverCard, HoverCardContent, HoverCardTrigger, RadioGroup, RadioGroupItem, ToggleGroup, ToggleGroupItem, AspectRatio, Avatar, AvatarFallback, Badge, Button, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, Collapsible, CollapsibleContent, CollapsibleTrigger, Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger, Input, Label, Popover, PopoverContent, PopoverTrigger, Progress, ResizableHandle, ResizablePanel, ResizablePanelGroup, ScrollArea, Select, SelectContent, SelectItem, SelectTrigger, SelectValue, Separator, Slider, Switch, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, Toaster, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, Grid, Section as PageSection, CardMedia, CommandDialog, Spinner, } from './backends/gui/index.js';
|
|
6
10
|
/** A real <img> with real intrinsic pixels, inline so nothing hits the network.
|
|
7
11
|
* 120x40 on purpose: the wrong ratio for every box it goes in, so a frame that
|
|
@@ -17,6 +21,13 @@ const BUTTON_VARIANTS = [
|
|
|
17
21
|
];
|
|
18
22
|
const BUTTON_SIZES = ['default', 'sm', 'lg', 'icon', 'icon-sm', 'icon-lg'];
|
|
19
23
|
const BADGE_VARIANTS = ['default', 'secondary', 'destructive', 'outline'];
|
|
24
|
+
/** The chat shell is callbacks-out, and this list only needs them to exist. */
|
|
25
|
+
const NOOP = () => { };
|
|
26
|
+
/** Two, so the grid's wrap rule and the letter fallback both render. */
|
|
27
|
+
const SOURCES = [
|
|
28
|
+
{ id: 'a', title: 'hanzo.ai', href: 'https://hanzo.ai' },
|
|
29
|
+
{ id: 'b', title: 'Reference' },
|
|
30
|
+
];
|
|
20
31
|
/** One section. Plain CSS on a plain div — the gallery is a harness, and laying
|
|
21
32
|
* it out with the components under test would make a layout bug read as a
|
|
22
33
|
* styling bug. Rows wrap so the same tree is legible at 390px and at 1280px,
|
|
@@ -39,6 +50,6 @@ export const Gallery = () => (_jsxs("div", { style: { display: 'flex', flexDirec
|
|
|
39
50
|
tabs: [
|
|
40
51
|
{ id: 'console', title: 'Console', closable: false, content: _jsx(CardTitle, { children: "console" }) },
|
|
41
52
|
],
|
|
42
|
-
}, children: _jsx(CardTitle, { children: "center" }) }) }) }), _jsxs(Section, { name: "box", children: [_jsx(Box, { className: "flex items-center gap-4 px-6 py-3 rounded-lg border", children: _jsx(CardTitle, { children: "utility classes" }) }), _jsx(Box, { className: "flex-col gap-2 max-w-3xl mx-auto overflow-hidden", children: _jsx(CardTitle, { children: "column" }) })] })] }));
|
|
53
|
+
}, children: _jsx(CardTitle, { children: "center" }) }) }) }), _jsxs(Section, { name: "product-arrangements", children: [_jsxs("div", { style: { display: 'flex', flexDirection: 'column', gap: 12, width: 320 }, children: [_jsx(Skeleton, { width: 120 }), _jsx(Skeleton, { width: "100%", height: 72, rounded: "$4" }), _jsx(Skeleton.Text, { lines: 3 })] }), _jsx(TooltipAnchor, { description: "Delete this agent", children: _jsx(Button, { children: "hinted" }) }), _jsx(Dialog, { open: true, children: _jsx(DialogTemplate, { title: "Delete agent", description: "This removes every run recorded against it.", confirm: { label: 'Delete', tone: 'danger' }, children: _jsx(CardTitle, { children: "body" }) }) })] }), _jsxs(Section, { name: "chat", children: [_jsxs("div", { style: { display: 'flex', flexDirection: 'column', gap: 12, width: 520, height: 320 }, children: [_jsxs(ChatHeader, { title: "A conversation with a long enough name to clamp", children: [_jsx(ShareButton, {}), _jsx(AsideToggle, {})] }), _jsxs(Thread, { children: [_jsx(Message, { role: "user", children: "ask" }), _jsxs(Message, { role: "assistant", icon: _jsx(Spinner, {}), actions: _jsx(Badge, { children: "copy" }), children: [_jsx(Code, { language: "typescript", value: "const x = 1", children: "const x = 1" }), _jsx(Sources, { sources: SOURCES })] }), _jsx(Message, { role: "assistant", busy: true, children: "answering" }), _jsx(Message, { role: "system", children: "note" })] }), _jsx(Composer, { value: "a draft", onChange: NOOP, onSend: NOOP, hint: "Enter to send", children: _jsx(Badge, { children: "tool" }) }), _jsx(Composer, { value: "", onChange: NOOP, onSend: NOOP, onStop: NOOP, busy: true })] }), _jsx(Aside, { children: _jsx(Sources, { sources: SOURCES }) }), _jsx("div", { style: { display: 'flex', width: 260, height: 320 }, children: _jsxs(Sidebar, { children: [_jsx(SidebarHeader, { title: "Hanzo", onOpenSwitcher: NOOP, onSearch: NOOP, onCollapse: NOOP }), _jsx(SidebarNewChat, { onPress: NOOP }), _jsxs(SidebarScroll, { children: [_jsxs(SidebarSection, { label: "Today", children: [_jsx(SidebarItem, { active: true, onPress: NOOP, children: "Selected thread" }), _jsx(SidebarItem, { onPress: NOOP, children: "Another thread" })] }), _jsx(SidebarFolder, { name: "Archive", defaultOpen: true, children: _jsx(SidebarItem, { onPress: NOOP, children: "Nested thread" }) })] }), _jsx(SidebarUser, { name: "z", secondary: "z@hanzo.ai", onPress: NOOP, onHelp: NOOP })] }) })] }), _jsxs(Section, { name: "box", children: [_jsx(Box, { className: "flex items-center gap-4 px-6 py-3 rounded-lg border", children: _jsx(CardTitle, { children: "utility classes" }) }), _jsx(Box, { className: "flex-col gap-2 max-w-3xl mx-auto overflow-hidden", children: _jsx(CardTitle, { children: "column" }) })] })] }));
|
|
43
54
|
export default Gallery;
|
|
44
55
|
//# sourceMappingURL=gallery.js.map
|
package/dist/gallery.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gallery.js","sourceRoot":"","sources":["../src/gallery.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAwBZ,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAA;AAC3B,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAE/C,OAAO,EACL,SAAS,EAAE,gBAAgB,EAAE,aAAa,EAAE,gBAAgB,EAAE,WAAW,EAAE,iBAAiB,EAC5F,iBAAiB,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,iBAAiB,EAChF,iBAAiB,EAAE,gBAAgB,EAAE,WAAW,EAAE,kBAAkB,EAAE,eAAe,EACrF,gBAAgB,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,SAAS,EAAE,gBAAgB,EACvF,gBAAgB,EAAE,UAAU,EAAE,cAAc,EAAE,WAAW,EAAE,eAAe,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,MAAM,EAAE,IAAI,EAAE,IAAI,SAAG,IAClE,EAEN,KAAC,KAAK,cACJ,KAAC,OAAO,IAAC,OAAO,EAAE,OAAO,GAAI,GACvB,EACR,cAAK,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,YACtD,MAAC,OAAO,eACN,KAAC,aAAa,IAAC,KAAK,EAAC,OAAO,EAAC,cAAc,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,GAAI,EACvF,KAAC,cAAc,IAAC,OAAO,EAAE,IAAI,GAAI,EACjC,MAAC,aAAa,eACZ,MAAC,cAAc,IAAC,KAAK,EAAC,OAAO,aAE3B,KAAC,WAAW,IAAC,MAAM,QAAC,OAAO,EAAE,IAAI,gCAEnB,EACd,KAAC,WAAW,IAAC,OAAO,EAAE,IAAI,+BAA8B,IACzC,EACjB,KAAC,aAAa,IAAC,IAAI,EAAC,SAAS,EAAC,WAAW,kBACvC,KAAC,WAAW,IAAC,OAAO,EAAE,IAAI,8BAA6B,GACzC,IACF,EAChB,KAAC,WAAW,IAAC,IAAI,EAAC,GAAG,EAAC,SAAS,EAAC,YAAY,EAAC,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,GAAI,IACpE,GACN,IACE,EAIV,MAAC,OAAO,IAAC,IAAI,EAAC,KAAK,aACjB,KAAC,GAAG,IAAC,SAAS,EAAC,qDAAqD,YAClE,KAAC,SAAS,kCAA4B,GAClC,EACN,KAAC,GAAG,IAAC,SAAS,EAAC,kDAAkD,YAC/D,KAAC,SAAS,yBAAmB,GACzB,IACE,IAEN,CACP,CAAA;AAED,eAAe,OAAO,CAAA"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
'use client';"use strict";
|
|
2
|
+
'use client';
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.DialogTemplate = DialogTemplate;
|
|
5
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
+
const gui_1 = require("@hanzo/gui");
|
|
7
|
+
const dialog_1 = require("../backends/gui/dialog.cjs");
|
|
8
|
+
const PrimaryButton_1 = require("./PrimaryButton.cjs");
|
|
9
|
+
/**
|
|
10
|
+
* The affirmative action. `PrimaryButton` is the console's one high-emphasis
|
|
11
|
+
* button, so it draws the ordinary confirm; a destructive one takes the neutral
|
|
12
|
+
* Button in the red theme instead, per that component's own rule that
|
|
13
|
+
* destructive actions do not wear the primary fill. A delete should not be the
|
|
14
|
+
* brightest thing on screen.
|
|
15
|
+
*/
|
|
16
|
+
function Confirm({ label, onPress, tone, disabled, busy }) {
|
|
17
|
+
const off = busy || disabled;
|
|
18
|
+
return tone === 'danger' ? ((0, jsx_runtime_1.jsx)(gui_1.Button, { theme: "red", disabled: off, onPress: onPress, children: label })) : ((0, jsx_runtime_1.jsx)(PrimaryButton_1.PrimaryButton, { disabled: off, onPress: onPress, children: label }));
|
|
19
|
+
}
|
|
20
|
+
function DialogTemplate({ title, description, children, confirm, cancelLabel = 'Cancel', showCancel = true, leftActions, busy = false, ...content }) {
|
|
21
|
+
const footer = showCancel || confirm || leftActions;
|
|
22
|
+
return ((0, jsx_runtime_1.jsxs)(dialog_1.DialogContent, { ...content, children: [(0, jsx_runtime_1.jsxs)(dialog_1.DialogHeader, { children: [(0, jsx_runtime_1.jsx)(dialog_1.DialogTitle, { children: title }), description ? (0, jsx_runtime_1.jsx)(dialog_1.DialogDescription, { children: description }) : null] }), children ? (0, jsx_runtime_1.jsx)(gui_1.YStack, { gap: "$3", children: children }) : null, footer ? ((0, jsx_runtime_1.jsxs)(dialog_1.DialogFooter, { justify: leftActions ? 'space-between' : 'flex-end', children: [leftActions ? ((0, jsx_runtime_1.jsx)(gui_1.XStack, { gap: "$2", items: "center", children: leftActions })) : null, (0, jsx_runtime_1.jsxs)(gui_1.XStack, { gap: "$2", items: "center", children: [showCancel ? ((0, jsx_runtime_1.jsx)(dialog_1.DialogClose, { asChild: true, children: (0, jsx_runtime_1.jsx)(gui_1.Button, { disabled: busy, children: cancelLabel }) })) : null, confirm ? (0, jsx_runtime_1.jsx)(Confirm, { ...confirm, busy: busy }) : null] })] })) : null] }));
|
|
23
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DialogTemplate — the shape almost every dialog already is.
|
|
3
|
+
*
|
|
4
|
+
* The Dialog primitive gives you a box and the parts to fill it. Nearly every
|
|
5
|
+
* dialog then fills them the same way: a title, an optional line of
|
|
6
|
+
* explanation, a body, and a right-aligned row of buttons with cancel on the
|
|
7
|
+
* left of confirm. Measured on a real surface, 31 call sites had written that
|
|
8
|
+
* arrangement out by hand, which is 31 chances to order the buttons differently.
|
|
9
|
+
*
|
|
10
|
+
* So the arrangement is the component and the content is the props. The parts
|
|
11
|
+
* stay exported for a dialog that genuinely is not this shape — a full-bleed
|
|
12
|
+
* preview, a wizard — and reaching for them is the honest signal that you have
|
|
13
|
+
* left the common case.
|
|
14
|
+
*
|
|
15
|
+
* <Dialog open={open} onOpenChange={setOpen}>
|
|
16
|
+
* <DialogTemplate
|
|
17
|
+
* title="Delete agent"
|
|
18
|
+
* description="This removes every run recorded against it."
|
|
19
|
+
* confirm={{ label: 'Delete', tone: 'danger', onPress: remove }}
|
|
20
|
+
* />
|
|
21
|
+
* </Dialog>
|
|
22
|
+
*
|
|
23
|
+
* Cancel is rendered unless you turn it off, because a dialog you cannot back
|
|
24
|
+
* out of is a trap; it closes the dialog on its own through `DialogClose`, so
|
|
25
|
+
* the caller does not wire dismissal. `busy` disables both buttons rather than
|
|
26
|
+
* only the confirm, so a slow request cannot be cancelled halfway into itself.
|
|
27
|
+
*/
|
|
28
|
+
import type { ComponentProps, ReactNode } from 'react';
|
|
29
|
+
import { DialogContent } from '../backends/gui/dialog.js';
|
|
30
|
+
/** A dialog's action. `tone: 'danger'` is for the one that destroys something. */
|
|
31
|
+
export type DialogAction = {
|
|
32
|
+
label: string;
|
|
33
|
+
onPress?: () => void;
|
|
34
|
+
tone?: 'default' | 'danger';
|
|
35
|
+
disabled?: boolean;
|
|
36
|
+
};
|
|
37
|
+
export type DialogTemplateProps = Omit<ComponentProps<typeof DialogContent>, 'title'> & {
|
|
38
|
+
title: ReactNode;
|
|
39
|
+
/** One line under the title. A paragraph belongs in `children`. */
|
|
40
|
+
description?: ReactNode;
|
|
41
|
+
/** The body. Omit it for a plain confirm. */
|
|
42
|
+
children?: ReactNode;
|
|
43
|
+
/** The affirmative action. Omit it for a dialog that only informs. */
|
|
44
|
+
confirm?: DialogAction;
|
|
45
|
+
/** Overrides the cancel label. */
|
|
46
|
+
cancelLabel?: string;
|
|
47
|
+
/** Drops cancel — only for a dialog with no way to get it wrong. */
|
|
48
|
+
showCancel?: boolean;
|
|
49
|
+
/** Extra controls, left-aligned opposite the confirm pair. */
|
|
50
|
+
leftActions?: ReactNode;
|
|
51
|
+
/** A request is in flight: both actions are disabled. */
|
|
52
|
+
busy?: boolean;
|
|
53
|
+
};
|
|
54
|
+
export declare function DialogTemplate({ title, description, children, confirm, cancelLabel, showCancel, leftActions, busy, ...content }: DialogTemplateProps): import("react/jsx-runtime").JSX.Element;
|
|
55
|
+
//# sourceMappingURL=DialogTemplate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DialogTemplate.d.ts","sourceRoot":"","sources":["../../src/product/DialogTemplate.tsx"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAGtD,OAAO,EAEL,aAAa,EAKd,MAAM,wBAAwB,CAAA;AAG/B,kFAAkF;AAClF,MAAM,MAAM,YAAY,GAAG;IACzB,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;IACpB,IAAI,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAA;IAC3B,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,CAAA;AAED,MAAM,MAAM,mBAAmB,GAAG,IAAI,CAAC,cAAc,CAAC,OAAO,aAAa,CAAC,EAAE,OAAO,CAAC,GAAG;IACtF,KAAK,EAAE,SAAS,CAAA;IAChB,mEAAmE;IACnE,WAAW,CAAC,EAAE,SAAS,CAAA;IACvB,6CAA6C;IAC7C,QAAQ,CAAC,EAAE,SAAS,CAAA;IACpB,sEAAsE;IACtE,OAAO,CAAC,EAAE,YAAY,CAAA;IACtB,kCAAkC;IAClC,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,oEAAoE;IACpE,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,8DAA8D;IAC9D,WAAW,CAAC,EAAE,SAAS,CAAA;IACvB,yDAAyD;IACzD,IAAI,CAAC,EAAE,OAAO,CAAA;CACf,CAAA;AAsBD,wBAAgB,cAAc,CAAC,EAC7B,KAAK,EACL,WAAW,EACX,QAAQ,EACR,OAAO,EACP,WAAsB,EACtB,UAAiB,EACjB,WAAW,EACX,IAAY,EACZ,GAAG,OAAO,EACX,EAAE,mBAAmB,2CA8BrB"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Button, XStack, YStack } from '@hanzo/gui';
|
|
4
|
+
import { DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, } from '../backends/gui/dialog.js';
|
|
5
|
+
import { PrimaryButton } from './PrimaryButton.js';
|
|
6
|
+
/**
|
|
7
|
+
* The affirmative action. `PrimaryButton` is the console's one high-emphasis
|
|
8
|
+
* button, so it draws the ordinary confirm; a destructive one takes the neutral
|
|
9
|
+
* Button in the red theme instead, per that component's own rule that
|
|
10
|
+
* destructive actions do not wear the primary fill. A delete should not be the
|
|
11
|
+
* brightest thing on screen.
|
|
12
|
+
*/
|
|
13
|
+
function Confirm({ label, onPress, tone, disabled, busy }) {
|
|
14
|
+
const off = busy || disabled;
|
|
15
|
+
return tone === 'danger' ? (_jsx(Button, { theme: "red", disabled: off, onPress: onPress, children: label })) : (_jsx(PrimaryButton, { disabled: off, onPress: onPress, children: label }));
|
|
16
|
+
}
|
|
17
|
+
export function DialogTemplate({ title, description, children, confirm, cancelLabel = 'Cancel', showCancel = true, leftActions, busy = false, ...content }) {
|
|
18
|
+
const footer = showCancel || confirm || leftActions;
|
|
19
|
+
return (_jsxs(DialogContent, { ...content, children: [_jsxs(DialogHeader, { children: [_jsx(DialogTitle, { children: title }), description ? _jsx(DialogDescription, { children: description }) : null] }), children ? _jsx(YStack, { gap: "$3", children: children }) : null, footer ? (_jsxs(DialogFooter, { justify: leftActions ? 'space-between' : 'flex-end', children: [leftActions ? (_jsx(XStack, { gap: "$2", items: "center", children: leftActions })) : null, _jsxs(XStack, { gap: "$2", items: "center", children: [showCancel ? (_jsx(DialogClose, { asChild: true, children: _jsx(Button, { disabled: busy, children: cancelLabel }) })) : null, confirm ? _jsx(Confirm, { ...confirm, busy: busy }) : null] })] })) : null] }));
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=DialogTemplate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DialogTemplate.js","sourceRoot":"","sources":["../../src/product/DialogTemplate.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AA8BZ,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AAEnD,OAAO,EACL,WAAW,EACX,aAAa,EACb,iBAAiB,EACjB,YAAY,EACZ,YAAY,EACZ,WAAW,GACZ,MAAM,wBAAwB,CAAA;AAC/B,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AA4B/C;;;;;;GAMG;AACH,SAAS,OAAO,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAoC;IACzF,MA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C,CACZ,KAAC,WAAW,IAAC,OAAO,kBAClB,KAAC,MAAM,IAAC,QAAQ,EAAE,IAAI,YAAG,WAAW,GAAU,GAClC,CACf,CAAC,CAAC,CAAC,IAAI,EACP,OAAO,CAAC,CAAC,CAAC,KAAC,OAAO,OAAK,OAAO,EAAE,IAAI,EAAE,IAAI,GAAI,CAAC,CAAC,CAAC,IAAI,IAC/C,IACI,CAChB,CAAC,CAAC,CAAC,IAAI,IACM,CACjB,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
'use client';"use strict";
|
|
2
|
+
'use client';
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.Skeleton = void 0;
|
|
5
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
+
/**
|
|
7
|
+
* Skeleton — the honest "loading", never fabricated content.
|
|
8
|
+
*
|
|
9
|
+
* The shimmer itself has shipped in `styles/motion.css` as `.hz-skeleton` since
|
|
10
|
+
* the living-overview work; what was missing was a component to reach it, so
|
|
11
|
+
* every surface hand-rolled a grey `<div>` and picked its own radius. This is
|
|
12
|
+
* that div, once, sized in the same `$` space as the rest of the package.
|
|
13
|
+
*
|
|
14
|
+
* It renders a BLOCK, not a spinner: a placeholder the size and shape of the
|
|
15
|
+
* thing that is coming keeps the layout from jumping when the data lands. Give
|
|
16
|
+
* it the dimensions of the real content — that is the whole discipline.
|
|
17
|
+
*
|
|
18
|
+
* <Skeleton height="$2" width={180} /> // a line of text
|
|
19
|
+
* <Skeleton height={120} rounded="$4" /> // a card
|
|
20
|
+
* <Skeleton.Text lines={3} /> // a paragraph
|
|
21
|
+
*/
|
|
22
|
+
const gui_1 = require("@hanzo/gui");
|
|
23
|
+
function Block({ height = '$1', rounded = '$2', ...props }) {
|
|
24
|
+
return ((0, jsx_runtime_1.jsx)(gui_1.View, { className: "hz-skeleton", height: height, rounded: rounded, "aria-hidden": true, ...props }));
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* A paragraph's worth of lines. The last one is short, because a real paragraph
|
|
28
|
+
* ends mid-line and a stack of equal bars reads as a table.
|
|
29
|
+
*/
|
|
30
|
+
function SkeletonText({ lines = 3, gap = '$2', ...props }) {
|
|
31
|
+
return ((0, jsx_runtime_1.jsx)(gui_1.YStack, { gap: gap, width: "100%", children: Array.from({ length: Math.max(1, lines) }, (_, i) => ((0, jsx_runtime_1.jsx)(Block, { width: i === lines - 1 ? '60%' : '100%', ...props }, i))) }));
|
|
32
|
+
}
|
|
33
|
+
exports.Skeleton = Object.assign(Block, { Text: SkeletonText });
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Skeleton — the honest "loading", never fabricated content.
|
|
3
|
+
*
|
|
4
|
+
* The shimmer itself has shipped in `styles/motion.css` as `.hz-skeleton` since
|
|
5
|
+
* the living-overview work; what was missing was a component to reach it, so
|
|
6
|
+
* every surface hand-rolled a grey `<div>` and picked its own radius. This is
|
|
7
|
+
* that div, once, sized in the same `$` space as the rest of the package.
|
|
8
|
+
*
|
|
9
|
+
* It renders a BLOCK, not a spinner: a placeholder the size and shape of the
|
|
10
|
+
* thing that is coming keeps the layout from jumping when the data lands. Give
|
|
11
|
+
* it the dimensions of the real content — that is the whole discipline.
|
|
12
|
+
*
|
|
13
|
+
* <Skeleton height="$2" width={180} /> // a line of text
|
|
14
|
+
* <Skeleton height={120} rounded="$4" /> // a card
|
|
15
|
+
* <Skeleton.Text lines={3} /> // a paragraph
|
|
16
|
+
*/
|
|
17
|
+
import { View } from '@hanzo/gui';
|
|
18
|
+
import type { ComponentProps } from 'react';
|
|
19
|
+
export type SkeletonProps = ComponentProps<typeof View>;
|
|
20
|
+
declare function Block({ height, rounded, ...props }: SkeletonProps): import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
export type SkeletonTextProps = SkeletonProps & {
|
|
22
|
+
/** How many lines to stand in for. */
|
|
23
|
+
lines?: number;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* A paragraph's worth of lines. The last one is short, because a real paragraph
|
|
27
|
+
* ends mid-line and a stack of equal bars reads as a table.
|
|
28
|
+
*/
|
|
29
|
+
declare function SkeletonText({ lines, gap, ...props }: SkeletonTextProps): import("react/jsx-runtime").JSX.Element;
|
|
30
|
+
export declare const Skeleton: typeof Block & {
|
|
31
|
+
Text: typeof SkeletonText;
|
|
32
|
+
};
|
|
33
|
+
export {};
|
|
34
|
+
//# sourceMappingURL=Skeleton.d.ts.map
|