@hanzo/ui 8.27.15 → 8.27.16
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/NOTICE +19 -0
- package/dist/agents/Attachments.cjs +29 -0
- package/dist/agents/Attachments.d.ts +31 -0
- package/dist/agents/Attachments.d.ts.map +1 -0
- package/dist/agents/Attachments.js +27 -0
- package/dist/agents/Attachments.js.map +1 -0
- package/dist/agents/Choice.cjs +47 -0
- package/dist/agents/Choice.d.ts +34 -0
- package/dist/agents/Choice.d.ts.map +1 -0
- package/dist/agents/Choice.js +44 -0
- package/dist/agents/Choice.js.map +1 -0
- package/dist/agents/Console.cjs +106 -0
- package/dist/agents/Console.d.ts +54 -0
- package/dist/agents/Console.d.ts.map +1 -0
- package/dist/agents/Console.js +104 -0
- package/dist/agents/Console.js.map +1 -0
- package/dist/agents/Feedback.cjs +50 -0
- package/dist/agents/Feedback.d.ts +25 -0
- package/dist/agents/Feedback.d.ts.map +1 -0
- package/dist/agents/Feedback.js +48 -0
- package/dist/agents/Feedback.js.map +1 -0
- package/dist/agents/FileTabs.cjs +63 -0
- package/dist/agents/FileTabs.d.ts +45 -0
- package/dist/agents/FileTabs.d.ts.map +1 -0
- package/dist/agents/FileTabs.js +61 -0
- package/dist/agents/FileTabs.js.map +1 -0
- package/dist/agents/FileTree.cjs +160 -0
- package/dist/agents/FileTree.d.ts +41 -0
- package/dist/agents/FileTree.d.ts.map +1 -0
- package/dist/agents/FileTree.js +157 -0
- package/dist/agents/FileTree.js.map +1 -0
- package/dist/agents/PreviewFrame.cjs +108 -0
- package/dist/agents/PreviewFrame.d.ts +78 -0
- package/dist/agents/PreviewFrame.d.ts.map +1 -0
- package/dist/agents/PreviewFrame.js +105 -0
- package/dist/agents/PreviewFrame.js.map +1 -0
- package/dist/agents/Suggestions.cjs +29 -0
- package/dist/agents/Suggestions.d.ts +28 -0
- package/dist/agents/Suggestions.d.ts.map +1 -0
- package/dist/agents/Suggestions.js +26 -0
- package/dist/agents/Suggestions.js.map +1 -0
- package/dist/agents/Workspace.cjs +103 -0
- package/dist/agents/Workspace.d.ts +104 -0
- package/dist/agents/Workspace.d.ts.map +1 -0
- package/dist/agents/Workspace.js +98 -0
- package/dist/agents/Workspace.js.map +1 -0
- package/dist/agents/bridge.cjs +201 -0
- package/dist/agents/bridge.d.ts +102 -0
- package/dist/agents/bridge.d.ts.map +1 -0
- package/dist/agents/bridge.js +197 -0
- package/dist/agents/bridge.js.map +1 -0
- package/dist/agents/index.cjs +64 -1
- package/dist/agents/index.d.ts +23 -0
- package/dist/agents/index.d.ts.map +1 -1
- package/dist/agents/index.js +23 -0
- package/dist/agents/index.js.map +1 -1
- package/dist/agents/log.cjs +75 -0
- package/dist/agents/log.d.ts +58 -0
- package/dist/agents/log.d.ts.map +1 -0
- package/dist/agents/log.js +65 -0
- package/dist/agents/log.js.map +1 -0
- package/dist/agents/tree.cjs +238 -0
- package/dist/agents/tree.d.ts +99 -0
- package/dist/agents/tree.d.ts.map +1 -0
- package/dist/agents/tree.js +226 -0
- package/dist/agents/tree.js.map +1 -0
- package/dist/backends/gui/3d-card.d.ts +6 -6
- package/dist/backends/gui/3d-marquee.d.ts +7 -8
- package/dist/backends/gui/3d-marquee.d.ts.map +1 -1
- package/dist/backends/gui/3d-pin.d.ts +1 -1
- package/dist/backends/gui/alert.d.ts +3 -3
- package/dist/backends/gui/android.d.ts +1 -1
- package/dist/backends/gui/animated-testimonials.d.ts +1 -1
- package/dist/backends/gui/animated-tooltip.d.ts +1 -1
- package/dist/backends/gui/announcement.d.ts +1 -1
- package/dist/backends/gui/banner.d.ts +1 -1
- package/dist/backends/gui/button.d.ts +1 -1
- package/dist/backends/gui/card.d.ts +7 -7
- package/dist/backends/gui/code-editor.cjs +2 -2
- package/dist/backends/gui/code-editor.d.ts +7 -1
- package/dist/backends/gui/code-editor.d.ts.map +1 -1
- package/dist/backends/gui/code-editor.js +2 -2
- package/dist/backends/gui/code-editor.js.map +1 -1
- package/dist/backends/gui/command.d.ts +5 -5
- package/dist/backends/gui/command.d.ts.map +1 -1
- package/dist/backends/gui/context-menu.d.ts +14 -14
- package/dist/backends/gui/context-menu.d.ts.map +1 -1
- package/dist/backends/gui/credit-card.d.ts +1 -1
- package/dist/backends/gui/desktop.d.ts +1 -1
- package/dist/backends/gui/dock.d.ts +3 -3
- package/dist/backends/gui/dropdown-menu.d.ts +16 -16
- package/dist/backends/gui/dropdown-menu.d.ts.map +1 -1
- package/dist/backends/gui/empty.d.ts +6 -6
- package/dist/backends/gui/field.d.ts +3 -3
- package/dist/backends/gui/gantt.d.ts +1 -1
- package/dist/backends/gui/grid-pattern.d.ts +1 -2
- package/dist/backends/gui/grid-pattern.d.ts.map +1 -1
- package/dist/backends/gui/image-zoom.d.ts +1 -1
- package/dist/backends/gui/iphone-15-pro.d.ts +1 -1
- package/dist/backends/gui/item.d.ts +9 -9
- package/dist/backends/gui/list.d.ts +2 -2
- package/dist/backends/gui/macos-dock.d.ts +2 -2
- package/dist/backends/gui/magnetic.d.ts +1 -1
- package/dist/backends/gui/marquee.d.ts +1 -15
- package/dist/backends/gui/marquee.d.ts.map +1 -1
- package/dist/backends/gui/menu-dock.d.ts +1 -1
- package/dist/backends/gui/menubar.d.ts +15 -15
- package/dist/backends/gui/menubar.d.ts.map +1 -1
- package/dist/backends/gui/message-dock.d.ts +1 -1
- package/dist/backends/gui/motion-highlight.d.ts +1 -12
- package/dist/backends/gui/motion-highlight.d.ts.map +1 -1
- package/dist/backends/gui/pagination.d.ts +4 -4
- package/dist/backends/gui/qr-code.d.ts +1 -2
- package/dist/backends/gui/qr-code.d.ts.map +1 -1
- package/dist/backends/gui/scroll-area.d.ts +3 -14
- package/dist/backends/gui/scroll-area.d.ts.map +1 -1
- package/dist/backends/gui/sheet.d.ts +3 -3
- package/dist/backends/gui/sheet.d.ts.map +1 -1
- package/dist/backends/gui/status.d.ts +1 -1
- package/dist/backends/gui/table.d.ts +8 -8
- package/dist/backends/gui/toaster.d.ts +1 -15
- package/dist/backends/gui/toaster.d.ts.map +1 -1
- package/dist/backends/gui/toggle.d.ts +1 -1
- package/dist/backends/gui/video-player.d.ts +1 -1
- package/dist/chat/Composer.cjs +60 -9
- package/dist/chat/Composer.d.ts +42 -2
- package/dist/chat/Composer.d.ts.map +1 -1
- package/dist/chat/Composer.js +61 -11
- package/dist/chat/Composer.js.map +1 -1
- package/dist/chat/EmptyPrompt.cjs +27 -0
- package/dist/chat/EmptyPrompt.d.ts +30 -0
- package/dist/chat/EmptyPrompt.d.ts.map +1 -0
- package/dist/chat/EmptyPrompt.js +24 -0
- package/dist/chat/EmptyPrompt.js.map +1 -0
- package/dist/chat/SessionRail.cjs +97 -0
- package/dist/chat/SessionRail.d.ts +97 -0
- package/dist/chat/SessionRail.d.ts.map +1 -0
- package/dist/chat/SessionRail.js +94 -0
- package/dist/chat/SessionRail.js.map +1 -0
- package/dist/chat/Thread.d.ts +2 -8
- package/dist/chat/Thread.d.ts.map +1 -1
- package/dist/chat/index.cjs +8 -1
- package/dist/chat/index.d.ts +3 -1
- package/dist/chat/index.d.ts.map +1 -1
- package/dist/chat/index.js +3 -1
- package/dist/chat/index.js.map +1 -1
- package/dist/gallery.cjs +28 -1
- package/dist/gallery.d.ts.map +1 -1
- package/dist/gallery.html +71 -3
- package/dist/gallery.js +30 -3
- package/dist/gallery.js.map +1 -1
- package/dist/product/BranchSelect.cjs +27 -0
- package/dist/product/BranchSelect.d.ts +27 -0
- package/dist/product/BranchSelect.d.ts.map +1 -0
- package/dist/product/BranchSelect.js +23 -0
- package/dist/product/BranchSelect.js.map +1 -0
- package/dist/product/ChipSelect.cjs +267 -0
- package/dist/product/ChipSelect.d.ts +71 -0
- package/dist/product/ChipSelect.d.ts.map +1 -0
- package/dist/product/ChipSelect.js +265 -0
- package/dist/product/ChipSelect.js.map +1 -0
- package/dist/product/RepoSelect.cjs +75 -0
- package/dist/product/RepoSelect.d.ts +63 -0
- package/dist/product/RepoSelect.d.ts.map +1 -0
- package/dist/product/RepoSelect.js +69 -0
- package/dist/product/RepoSelect.js.map +1 -0
- package/dist/product/chipSelect.logic.cjs +147 -0
- package/dist/product/chipSelect.logic.d.ts +92 -0
- package/dist/product/chipSelect.logic.d.ts.map +1 -0
- package/dist/product/chipSelect.logic.js +138 -0
- package/dist/product/chipSelect.logic.js.map +1 -0
- package/dist/product/index.cjs +23 -1
- package/dist/product/index.d.ts +4 -0
- package/dist/product/index.d.ts.map +1 -1
- package/dist/product/index.js +7 -0
- package/dist/product/index.js.map +1 -1
- package/dist/styles.css +68 -0
- package/package.json +2 -1
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SessionRail — the left rail of a sessions surface: start one, go somewhere,
|
|
3
|
+
* reopen a recent one, and who you are.
|
|
4
|
+
*
|
|
5
|
+
* + New the primary row; the current view on a fresh pane
|
|
6
|
+
* Artifacts · Customize … the surface's own places, as `links`
|
|
7
|
+
* More ⌄ a disclosure over `more`, when there are more
|
|
8
|
+
* Recents ⇅ the sessions, newest first, each with a status dot
|
|
9
|
+
* (z) z@hanzo.ai ⌄ ⚙ ⌕ the account, then settings and search
|
|
10
|
+
*
|
|
11
|
+
* Presentational: no routing, no fetching. `active` comes in, `onOpen` goes out.
|
|
12
|
+
*
|
|
13
|
+
* THE SIDEBAR CANON (console, hanzo.app, hanzo.chat, the extension):
|
|
14
|
+
* - Collapse is an EXPLICIT toggle and the host persists it. `collapsed` in,
|
|
15
|
+
* `onCollapse` out. There is no hover-to-expand and no pin.
|
|
16
|
+
* - Collapsed is a narrow RAIL that stays on screen — icons only, labels as
|
|
17
|
+
* tooltips — and its top row is the expand control.
|
|
18
|
+
* - Below `md` there is no rail at all. The column hides, and the same
|
|
19
|
+
* contents open as a drawer from the left when the host says so (`open`,
|
|
20
|
+
* `onOpenChange`) — typically from a menu button only a phone shows.
|
|
21
|
+
*
|
|
22
|
+
* Built from the chat `Sidebar` column and its icon button, so the rail is the
|
|
23
|
+
* same material as every other chat surface's.
|
|
24
|
+
*/
|
|
25
|
+
import { YStack } from '@hanzo/gui';
|
|
26
|
+
import { type ComponentProps, type ReactNode } from 'react';
|
|
27
|
+
type Col = Omit<ComponentProps<typeof YStack>, 'children'>;
|
|
28
|
+
/** Where a session is. `running` pulses; finished and idle are an open ring. */
|
|
29
|
+
export type SessionStatus = 'running' | 'paused' | 'done' | 'stopped' | 'error' | 'idle';
|
|
30
|
+
export interface RailSession {
|
|
31
|
+
id: string;
|
|
32
|
+
title: string;
|
|
33
|
+
status?: SessionStatus;
|
|
34
|
+
}
|
|
35
|
+
export interface RailLink {
|
|
36
|
+
id: string;
|
|
37
|
+
label: string;
|
|
38
|
+
icon: ReactNode;
|
|
39
|
+
onPress?: () => void;
|
|
40
|
+
/** This place is the current view. */
|
|
41
|
+
active?: boolean;
|
|
42
|
+
}
|
|
43
|
+
export interface RailAccount {
|
|
44
|
+
/** The line shown — an email or a name. */
|
|
45
|
+
name: string;
|
|
46
|
+
/** Avatar slot. Falls back to the first letter of `name`. */
|
|
47
|
+
avatar?: ReactNode;
|
|
48
|
+
/** The caret beside the name: the account menu. */
|
|
49
|
+
onPress?: () => void;
|
|
50
|
+
}
|
|
51
|
+
export interface SessionRailProps extends Col {
|
|
52
|
+
/** Starts a new session. */
|
|
53
|
+
onNew?: () => void;
|
|
54
|
+
newLabel?: string;
|
|
55
|
+
/** The fresh pane IS the current view, so New draws as the active row. */
|
|
56
|
+
fresh?: boolean;
|
|
57
|
+
/** The surface's own places, under New. */
|
|
58
|
+
links?: RailLink[];
|
|
59
|
+
/** Behind the "More" disclosure. None, and there is no More row. */
|
|
60
|
+
more?: RailLink[];
|
|
61
|
+
moreLabel?: string;
|
|
62
|
+
/** The sessions, newest first. */
|
|
63
|
+
recents: RailSession[];
|
|
64
|
+
recentsLabel?: string;
|
|
65
|
+
/** The open session's id. */
|
|
66
|
+
active?: string | null;
|
|
67
|
+
onOpen: (id: string) => void;
|
|
68
|
+
/** The sort/filter control beside the Recents label. None, no control. */
|
|
69
|
+
onSort?: () => void;
|
|
70
|
+
sortLabel?: string;
|
|
71
|
+
/** Shown in place of the list when there are no recents. */
|
|
72
|
+
empty?: ReactNode;
|
|
73
|
+
/** Drawn above the account row — a notice, a setup card. */
|
|
74
|
+
notice?: ReactNode;
|
|
75
|
+
account?: RailAccount;
|
|
76
|
+
onSettings?: () => void;
|
|
77
|
+
onSearch?: () => void;
|
|
78
|
+
/** Collapsed to the icon rail. The host owns and persists it. */
|
|
79
|
+
collapsed?: boolean;
|
|
80
|
+
onCollapse?: (collapsed: boolean) => void;
|
|
81
|
+
/** The rail's top row when collapsed — a surface's mark. It is the expand control. */
|
|
82
|
+
mark?: ReactNode;
|
|
83
|
+
/** Below `md`: the drawer is open. */
|
|
84
|
+
open?: boolean;
|
|
85
|
+
onOpenChange?: (open: boolean) => void;
|
|
86
|
+
/** The landmark's name. */
|
|
87
|
+
label?: string;
|
|
88
|
+
/** Expanded width, px. */
|
|
89
|
+
width?: number;
|
|
90
|
+
}
|
|
91
|
+
/** The status mark: a 6px dot, filled while something is happening. */
|
|
92
|
+
export declare function StatusDot({ status }: {
|
|
93
|
+
status?: SessionStatus;
|
|
94
|
+
}): import("react").JSX.Element;
|
|
95
|
+
export declare function SessionRail(props: SessionRailProps): import("react").JSX.Element;
|
|
96
|
+
export {};
|
|
97
|
+
//# sourceMappingURL=SessionRail.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SessionRail.d.ts","sourceRoot":"","sources":["../../src/chat/SessionRail.tsx"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,OAAO,EAAmC,MAAM,EAAE,MAAM,YAAY,CAAA;AAUpE,OAAO,EAAmB,KAAK,cAAc,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAM5E,KAAK,GAAG,GAAG,IAAI,CAAC,cAAc,CAAC,OAAO,MAAM,CAAC,EAAE,UAAU,CAAC,CAAA;AAc1D,gFAAg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IACnB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,4DAA4D;IAC5D,KAAK,CAAC,EAAE,SAAS,CAAA;IACjB,4DAA4D;IAC5D,MAAM,CAAC,EAAE,SAAS,CAAA;IAClB,OAAO,CAAC,EAAE,WAAW,CAAA;IACrB,UAAU,CAAC,EAAE,MAAM,IAAI,CAAA;IACvB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAA;IACrB,iEAAiE;IACjE,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,UAAU,CAAC,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI,CAAA;IACzC,sFAAsF;IACtF,IAAI,CAAC,EAAE,SAAS,CAAA;IAChB,sCAAsC;IACtC,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAA;IACtC,2BAA2B;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,0BAA0B;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED,uEAAuE;AACvE,wBAAgB,SAAS,CAAC,EAAE,MAAe,EAAE,EAAE;IAAE,MAAM,CAAC,EAAE,aAAa,CAAA;CAAE,+BAmBxE;AA0SD,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,+BAqDlD"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
/**
|
|
4
|
+
* SessionRail — the left rail of a sessions surface: start one, go somewhere,
|
|
5
|
+
* reopen a recent one, and who you are.
|
|
6
|
+
*
|
|
7
|
+
* + New the primary row; the current view on a fresh pane
|
|
8
|
+
* Artifacts · Customize … the surface's own places, as `links`
|
|
9
|
+
* More ⌄ a disclosure over `more`, when there are more
|
|
10
|
+
* Recents ⇅ the sessions, newest first, each with a status dot
|
|
11
|
+
* (z) z@hanzo.ai ⌄ ⚙ ⌕ the account, then settings and search
|
|
12
|
+
*
|
|
13
|
+
* Presentational: no routing, no fetching. `active` comes in, `onOpen` goes out.
|
|
14
|
+
*
|
|
15
|
+
* THE SIDEBAR CANON (console, hanzo.app, hanzo.chat, the extension):
|
|
16
|
+
* - Collapse is an EXPLICIT toggle and the host persists it. `collapsed` in,
|
|
17
|
+
* `onCollapse` out. There is no hover-to-expand and no pin.
|
|
18
|
+
* - Collapsed is a narrow RAIL that stays on screen — icons only, labels as
|
|
19
|
+
* tooltips — and its top row is the expand control.
|
|
20
|
+
* - Below `md` there is no rail at all. The column hides, and the same
|
|
21
|
+
* contents open as a drawer from the left when the host says so (`open`,
|
|
22
|
+
* `onOpenChange`) — typically from a menu button only a phone shows.
|
|
23
|
+
*
|
|
24
|
+
* Built from the chat `Sidebar` column and its icon button, so the rail is the
|
|
25
|
+
* same material as every other chat surface's.
|
|
26
|
+
*/
|
|
27
|
+
import { ScrollView, SizableText, XStack, YStack } from '@hanzo/gui';
|
|
28
|
+
import { ArrowDownUp, ChevronDown, ChevronUp, PanelLeft, Plus, Search, Settings, } from '@hanzogui/lucide-icons-2';
|
|
29
|
+
import { useId, useState } from 'react';
|
|
30
|
+
import { Sheet, SheetContent, SheetTitle } from '../backends/gui/sheet.js';
|
|
31
|
+
import { slot, tip } from '../backends/gui/slot.js';
|
|
32
|
+
import { Sidebar, SidebarIconButton } from './Sidebar.js';
|
|
33
|
+
/** Expanded width, px — the column's own width, its hairline outside it. */
|
|
34
|
+
const WIDTH = 272;
|
|
35
|
+
/** Collapsed width, px. The same rail width every chat surface collapses to. */
|
|
36
|
+
const RAIL = 56;
|
|
37
|
+
/** The keyboard focus ring every control in the package draws. */
|
|
38
|
+
const RING = { outlineColor: '$outlineColor', outlineWidth: 2, outlineStyle: 'solid' };
|
|
39
|
+
/** One row: 32px, the 8px radius, icon then label. */
|
|
40
|
+
const ROW = { minH: 32, px: '$2', rounded: '$3', gap: '$2.5' };
|
|
41
|
+
/** The status mark: a 6px dot, filled while something is happening. */
|
|
42
|
+
export function StatusDot({ status = 'idle' }) {
|
|
43
|
+
const filled = status === 'running' || status === 'paused' || status === 'error';
|
|
44
|
+
return (_jsx(XStack, { ...slot('status-dot'), "data-status": status,
|
|
45
|
+
// The pulse is a class the package's own sheet owns (styles/motion.css),
|
|
46
|
+
// opacity only — nothing reflows for a dot nobody is reading.
|
|
47
|
+
className: status === 'running' ? 'hz-pulse' : undefined, width: 6, height: 6, rounded: 9999, shrink: 0, bg: filled ? (status === 'error' ? '$bad' : status === 'paused' ? '$faint' : '$quiet') : 'transparent', borderWidth: filled ? 0 : 1, borderColor: "$faint", "aria-hidden": true }));
|
|
48
|
+
}
|
|
49
|
+
/** Where a row starts: the 16px column every icon and dot sits centred in. */
|
|
50
|
+
const Lead = ({ children }) => (_jsx(XStack, { width: 16, height: 16, shrink: 0, items: "center", justify: "center", children: children }));
|
|
51
|
+
/** One nav row. On the rail it is the icon alone, the label its tooltip and name. */
|
|
52
|
+
function Row({ label, icon, onPress, active, rail, quiet, expanded, controls, data = 'rail-row' }) {
|
|
53
|
+
return (_jsxs(XStack, { ...slot(data), ...(rail ? tip(label) : null), ...ROW, items: "center", justify: rail ? 'center' : 'flex-start', cursor: "pointer", role: "button", tabIndex: 0, "aria-label": rail ? label : undefined, "aria-current": active ? 'page' : undefined, "aria-expanded": expanded, "aria-controls": controls, bg: active ? '$raised' : undefined, hoverStyle: { bg: active ? '$raised' : '$hover' }, pressStyle: { bg: '$raised' }, focusVisibleStyle: RING, onPress: onPress, onKeyDown: (e) => {
|
|
54
|
+
if (e?.key !== 'Enter' && e?.key !== ' ')
|
|
55
|
+
return;
|
|
56
|
+
e.preventDefault?.();
|
|
57
|
+
onPress?.();
|
|
58
|
+
}, children: [_jsx(Lead, { children: icon }), rail ? null : (_jsx(SizableText, { size: "$3", numberOfLines: 1, flex: 1, color: quiet ? '$soft' : '$ink', children: label }))] }));
|
|
59
|
+
}
|
|
60
|
+
/** The account line: avatar, the name clamped, the caret. */
|
|
61
|
+
function Account({ account, rail }) {
|
|
62
|
+
const face = (_jsx(XStack, { width: 24, height: 24, rounded: 9999, items: "center", justify: "center", bg: "$raised", overflow: "hidden", shrink: 0, children: account.avatar ?? (_jsx(SizableText, { size: "$1", fontWeight: "600", color: "$ink", children: account.name.charAt(0).toUpperCase() })) }));
|
|
63
|
+
return (_jsxs(XStack, { ...slot('rail-account'), ...(rail ? tip(account.name) : null), ...ROW, gap: "$2", px: "$1", flex: rail ? undefined : 1, minW: 0, items: "center", justify: rail ? 'center' : 'flex-start', cursor: account.onPress ? 'pointer' : undefined, role: account.onPress ? 'button' : undefined, tabIndex: account.onPress ? 0 : undefined, "aria-label": account.onPress ? `Account: ${account.name}` : undefined, "aria-haspopup": account.onPress ? 'menu' : undefined, hoverStyle: account.onPress ? { bg: '$hover' } : undefined, onPress: account.onPress, onKeyDown: (e) => {
|
|
64
|
+
if (!account.onPress || (e?.key !== 'Enter' && e?.key !== ' '))
|
|
65
|
+
return;
|
|
66
|
+
e.preventDefault?.();
|
|
67
|
+
account.onPress();
|
|
68
|
+
}, children: [face, rail ? null : (_jsxs(_Fragment, { children: [_jsx(SizableText, { size: "$3", numberOfLines: 1, flex: 1, minW: 0, color: "$ink", children: account.name }), account.onPress ? _jsx(ChevronDown, { size: 14, color: "$soft" }) : null] }))] }));
|
|
69
|
+
}
|
|
70
|
+
/** The rail's contents — the same tree in the column and in the drawer. */
|
|
71
|
+
function Contents({ onNew, newLabel = 'New', fresh = false, links = [], more = [], moreLabel = 'More', recents, recentsLabel = 'Recents', active = null, onOpen, onSort, sortLabel = 'Sort and filter', empty, notice, account, onSettings, onSearch, collapsed = false, onCollapse, mark, rail, }) {
|
|
72
|
+
const [unfolded, setUnfolded] = useState(false);
|
|
73
|
+
const id = useId();
|
|
74
|
+
const moreId = `${id}-more`;
|
|
75
|
+
const headId = `${id}-recents`;
|
|
76
|
+
return (_jsxs(_Fragment, { children: [rail ? (_jsx(XStack, { justify: "center", pb: "$1", children: _jsx(SidebarIconButton, { label: "Expand sidebar", width: 36, height: 36, onPress: () => onCollapse?.(false), children: mark ?? _jsx(PanelLeft, { size: 16 }) }) })) : null, _jsxs(YStack, { ...slot('rail-nav'), gap: "$0", role: "list", children: [onNew ? (_jsx(YStack, { role: "listitem", children: _jsx(Row, { label: newLabel, icon: _jsx(Plus, { size: 16 }), onPress: onNew, active: fresh, rail: rail, data: "rail-new" }) })) : null, links.map((link) => (_jsx(YStack, { role: "listitem", children: _jsx(Row, { label: link.label, icon: link.icon, onPress: link.onPress, active: link.active, rail: rail }) }, link.id))), more.length ? (_jsxs(YStack, { role: "listitem", children: [_jsx(Row, { label: moreLabel, icon: unfolded ? _jsx(ChevronUp, { size: 16 }) : _jsx(ChevronDown, { size: 16 }), onPress: () => setUnfolded((v) => !v), rail: rail, quiet: true, expanded: unfolded, controls: moreId, data: "rail-more" }), unfolded ? (_jsx(YStack, { id: moreId, role: "list", gap: "$0", children: more.map((link) => (_jsx(YStack, { role: "listitem", children: _jsx(Row, { label: link.label, icon: link.icon, onPress: link.onPress, active: link.active, rail: rail }) }, link.id))) })) : null] })) : null] }), rail ? (_jsx(YStack, { flex: 1 })) : (_jsxs(YStack, { ...slot('rail-recents'), flex: 1, minH: 0, mt: "$5", children: [_jsxs(XStack, { items: "center", justify: "space-between", height: 28, pl: "$2", pr: "$1", shrink: 0, children: [_jsx(SizableText, { id: headId, size: "$2", color: "$soft", children: recentsLabel }), onSort ? (_jsx(SidebarIconButton, { label: sortLabel, onPress: onSort, width: 24, height: 24, children: _jsx(ArrowDownUp, { size: 14 }) })) : null] }), _jsx(ScrollView, { flex: 1, showsVerticalScrollIndicator: false, children: recents.length === 0 ? (empty ? (_jsx(YStack, { px: "$2", py: "$2", children: typeof empty === 'string' ? (_jsx(SizableText, { size: "$2", color: "$soft", children: empty })) : (empty) })) : null) : (_jsx(YStack, { role: "list", "aria-labelledby": headId, gap: 1, children: recents.map((s) => {
|
|
77
|
+
const on = s.id === active;
|
|
78
|
+
return (_jsx(YStack, { role: "listitem", children: _jsxs(XStack, { ...slot('rail-session'), ...ROW, items: "center", cursor: "pointer", role: "button", tabIndex: 0, "aria-current": on ? 'page' : undefined, bg: on ? '$raised' : undefined, hoverStyle: { bg: on ? '$raised' : '$hover' }, pressStyle: { bg: '$raised' }, focusVisibleStyle: RING, onPress: () => onOpen(s.id), onKeyDown: (e) => {
|
|
79
|
+
if (e?.key !== 'Enter' && e?.key !== ' ')
|
|
80
|
+
return;
|
|
81
|
+
e.preventDefault?.();
|
|
82
|
+
onOpen(s.id);
|
|
83
|
+
}, children: [_jsx(Lead, { children: _jsx(StatusDot, { status: s.status }) }), _jsx(SizableText, { size: "$3", numberOfLines: 1, flex: 1, minW: 0, color: on ? '$ink' : '$quiet', children: s.title })] }) }, s.id));
|
|
84
|
+
}) })) })] })), notice && !rail ? _jsx(YStack, { pt: "$2", children: notice }) : null, _jsxs(XStack, { ...slot('rail-foot'), items: "center", gap: "$1", pt: "$2", mt: "$1", borderTopWidth: 1, borderColor: "$borderColor", flexDirection: rail ? 'column' : 'row', children: [account ? _jsx(Account, { account: account, rail: rail }) : _jsx(XStack, { flex: 1 }), onSettings ? (_jsx(SidebarIconButton, { label: "Settings", onPress: onSettings, children: _jsx(Settings, { size: 16 }) })) : null, onSearch ? (_jsx(SidebarIconButton, { label: "Search", onPress: onSearch, children: _jsx(Search, { size: 16 }) })) : null, onCollapse && !rail ? (_jsx(SidebarIconButton, { label: "Collapse sidebar", onPress: () => onCollapse(!collapsed), children: _jsx(PanelLeft, { size: 16 }) })) : null] })] }));
|
|
85
|
+
}
|
|
86
|
+
export function SessionRail(props) {
|
|
87
|
+
const {
|
|
88
|
+
// Everything the contents read is named here, so none of it reaches the
|
|
89
|
+
// column as a stray DOM attribute through `rest`.
|
|
90
|
+
onNew, newLabel, fresh, links, more, moreLabel, recents, recentsLabel, active, onOpen, onSort, sortLabel, empty, notice, account, onSettings, onSearch, collapsed = false, onCollapse, mark, open = false, onOpenChange, label = 'Sessions', width = WIDTH, ...rest } = props;
|
|
91
|
+
const rail = collapsed;
|
|
92
|
+
return (_jsxs(_Fragment, { children: [_jsx(Sidebar, { ...slot('session-rail'), role: "navigation", "aria-label": label, "data-collapsed": rail ? 'true' : 'false', width: rail ? RAIL : width, gap: "$0", px: rail ? '$1.5' : '$2', py: "$2", "$max-md": { display: 'none' }, ...rest, children: _jsx(Contents, { ...props, rail: rail }) }), open ? (_jsx(Sheet, { open: open, onOpenChange: onOpenChange, children: _jsxs(SheetContent, { side: "left", width: width, maxW: "86%", p: "$2", gap: "$0", bg: "$panel", children: [_jsx(SheetTitle, { ...slot('session-rail-title'), position: "absolute", opacity: 0, pointerEvents: "none", children: label }), _jsx(YStack, { ...slot('session-rail-drawer'), role: "navigation", "aria-label": label, flex: 1, minH: 0, children: _jsx(Contents, { ...props, rail: false, collapsed: false, onCollapse: undefined, onNew: onNew ? () => (onOpenChange?.(false), onNew()) : undefined, onOpen: (sid) => (onOpenChange?.(false), onOpen(sid)) }) })] }) })) : null] }));
|
|
93
|
+
}
|
|
94
|
+
//# sourceMappingURL=SessionRail.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SessionRail.js","sourceRoot":"","sources":["../../src/chat/SessionRail.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACpE,OAAO,EACL,WAAW,EACX,WAAW,EACX,SAAS,EACT,SAAS,EACT,IAAI,EACJ,MAAM,EACN,QAAQ,GACT,MAAM,0BAA0B,CAAA;AACjC,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAuC,MAAM,OAAO,CAAA;AAE5E,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AACvE,OAAO,EAAE,IAAI,EAAE,GAAG,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ACJ,CAAA;AACH,CAAC"}
|
package/dist/chat/Thread.d.ts
CHANGED
|
@@ -5,14 +5,9 @@
|
|
|
5
5
|
* scrolls up. The decision is `pinned()`; this only wires it to the platform's
|
|
6
6
|
* scroll view, so momentum and keyboard stay the host's.
|
|
7
7
|
*/
|
|
8
|
-
import { ScrollView, YStack
|
|
8
|
+
import { ScrollView, YStack } from '@hanzo/gui';
|
|
9
9
|
import { type ComponentProps, type ReactNode } from 'react';
|
|
10
10
|
import { type Track } from './stick.js';
|
|
11
|
-
type Scroller = GetRef<typeof ScrollView> & {
|
|
12
|
-
scrollToEnd(o: {
|
|
13
|
-
animated: boolean;
|
|
14
|
-
}): void;
|
|
15
|
-
};
|
|
16
11
|
export interface ThreadProps extends Omit<ComponentProps<typeof ScrollView>, 'children' | 'onScroll'> {
|
|
17
12
|
children?: ReactNode;
|
|
18
13
|
/** Reading-measure cap. Pass `0` to fill the container. */
|
|
@@ -28,6 +23,5 @@ export interface ThreadProps extends Omit<ComponentProps<typeof ScrollView>, 'ch
|
|
|
28
23
|
/** The column that holds the turns, for a surface that needs to reach it. */
|
|
29
24
|
column?: Omit<ComponentProps<typeof YStack>, 'children'>;
|
|
30
25
|
}
|
|
31
|
-
export declare const Thread: import("react").ForwardRefExoticComponent<Omit<ThreadProps, "ref"> & import("react").RefAttributes<
|
|
32
|
-
export {};
|
|
26
|
+
export declare const Thread: import("react").ForwardRefExoticComponent<Omit<ThreadProps, "ref"> & import("react").RefAttributes<any>>;
|
|
33
27
|
//# sourceMappingURL=Thread.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Thread.d.ts","sourceRoot":"","sources":["../../src/chat/Thread.tsx"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"Thread.d.ts","sourceRoot":"","sources":["../../src/chat/Thread.tsx"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,EAAe,MAAM,YAAY,CAAA;AAC5D,OAAO,EAAmC,KAAK,cAAc,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAG5F,OAAO,EAAiB,KAAK,KAAK,EAAE,MAAM,SAAS,CAAA;AAOnD,MAAM,WAAW,WACf,SAAQ,IAAI,CAAC,cAAc,CAAC,OAAO,UAAU,CAAC,EAAE,UAAU,GAAG,UAAU,CAAC;IACxE,QAAQ,CAAC,EAAE,SAAS,CAAA;IACpB,2DAA2D;IAC3D,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,+DAA+D;IAC/D,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,6EAA6E;IAC7E,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE,EAAE;QAAE,MAAM,EAAE,OAAO,CAAC;QAAC,KAAK,EAAE,KAAK,CAAA;KAAE,KAAK,IAAI,CAAA;IAC1E,6EAA6E;IAC7E,MAAM,CAAC,EAAE,IAAI,CAAC,cAAc,CAAC,OAAO,MAAM,CAAC,EAAE,UAAU,CAAC,CAAA;CACzD;AAED,eAAO,MAAM,MAAM,0GA6DjB,CAAA"}
|
package/dist/chat/index.cjs
CHANGED
|
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.clip = exports.Persona = exports.SourceCard = exports.Sources = exports.Inspector = exports.Preview = exports.made = exports.answer = exports.read = exports.stage = exports.EMPTY = exports.TOOLS = exports.Failure = exports.Step = 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 = exports.join = exports.Piece = exports.Parts = exports.words = exports.Chat = void 0;
|
|
17
|
+
exports.clip = exports.Persona = exports.SourceCard = exports.Sources = exports.Inspector = exports.Preview = exports.made = exports.answer = exports.read = exports.stage = exports.EMPTY = exports.TOOLS = exports.Failure = exports.Step = exports.Code = exports.Aside = exports.AsideToggle = exports.ShareButton = exports.HeaderButton = exports.Header = exports.StatusDot = exports.SessionRail = 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.NEXT = exports.EmptyPrompt = exports.ASK = exports.ComposerTool = exports.Composer = exports.join = exports.Piece = exports.Parts = exports.words = exports.Chat = void 0;
|
|
18
18
|
/**
|
|
19
19
|
* @hanzo/ui/chat — the one chat shell, on @hanzo/gui primitives.
|
|
20
20
|
*
|
|
@@ -60,7 +60,11 @@ Object.defineProperty(exports, "Piece", { enumerable: true, get: function () { r
|
|
|
60
60
|
Object.defineProperty(exports, "join", { enumerable: true, get: function () { return Parts_1.join; } });
|
|
61
61
|
var Composer_1 = require("./Composer.cjs");
|
|
62
62
|
Object.defineProperty(exports, "Composer", { enumerable: true, get: function () { return Composer_1.Composer; } });
|
|
63
|
+
Object.defineProperty(exports, "ComposerTool", { enumerable: true, get: function () { return Composer_1.ComposerTool; } });
|
|
63
64
|
Object.defineProperty(exports, "ASK", { enumerable: true, get: function () { return Composer_1.ASK; } });
|
|
65
|
+
var EmptyPrompt_1 = require("./EmptyPrompt.cjs");
|
|
66
|
+
Object.defineProperty(exports, "EmptyPrompt", { enumerable: true, get: function () { return EmptyPrompt_1.EmptyPrompt; } });
|
|
67
|
+
Object.defineProperty(exports, "NEXT", { enumerable: true, get: function () { return EmptyPrompt_1.NEXT; } });
|
|
64
68
|
var Message_1 = require("./Message.cjs");
|
|
65
69
|
Object.defineProperty(exports, "Caret", { enumerable: true, get: function () { return Message_1.Caret; } });
|
|
66
70
|
Object.defineProperty(exports, "Message", { enumerable: true, get: function () { return Message_1.Message; } });
|
|
@@ -82,6 +86,9 @@ Object.defineProperty(exports, "SidebarSection", { enumerable: true, get: functi
|
|
|
82
86
|
Object.defineProperty(exports, "SidebarItem", { enumerable: true, get: function () { return Sidebar_1.SidebarItem; } });
|
|
83
87
|
Object.defineProperty(exports, "SidebarFolder", { enumerable: true, get: function () { return Sidebar_1.SidebarFolder; } });
|
|
84
88
|
Object.defineProperty(exports, "SidebarUser", { enumerable: true, get: function () { return Sidebar_1.SidebarUser; } });
|
|
89
|
+
var SessionRail_1 = require("./SessionRail.cjs");
|
|
90
|
+
Object.defineProperty(exports, "SessionRail", { enumerable: true, get: function () { return SessionRail_1.SessionRail; } });
|
|
91
|
+
Object.defineProperty(exports, "StatusDot", { enumerable: true, get: function () { return SessionRail_1.StatusDot; } });
|
|
85
92
|
var Header_1 = require("./Header.cjs");
|
|
86
93
|
Object.defineProperty(exports, "Header", { enumerable: true, get: function () { return Header_1.Header; } });
|
|
87
94
|
Object.defineProperty(exports, "HeaderButton", { enumerable: true, get: function () { return Header_1.HeaderButton; } });
|
package/dist/chat/index.d.ts
CHANGED
|
@@ -36,12 +36,14 @@
|
|
|
36
36
|
export { Chat, type ChatProps, type Turn } from './Chat.js';
|
|
37
37
|
export { words, type Part, type Said } from './words.js';
|
|
38
38
|
export { Parts, Piece, join, type MessagePart, type PartActions, type PartsProps, type PieceProps, } from './Parts.js';
|
|
39
|
-
export { Composer, ASK, type ComposerProps } from './Composer.js';
|
|
39
|
+
export { Composer, ComposerTool, ASK, type ComposerProps, type ComposerToolProps, } from './Composer.js';
|
|
40
|
+
export { EmptyPrompt, NEXT, type EmptyPromptProps } from './EmptyPrompt.js';
|
|
40
41
|
export { Caret, Message, type MessageProps, type Role } from './Message.js';
|
|
41
42
|
export { Thread, type ThreadProps } from './Thread.js';
|
|
42
43
|
export { ready, sends, type Mods } from './send.js';
|
|
43
44
|
export { pinned, SLACK, type Track } from './stick.js';
|
|
44
45
|
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';
|
|
46
|
+
export { SessionRail, StatusDot, type RailAccount, type RailLink, type RailSession, type SessionRailProps, type SessionStatus, } from './SessionRail.js';
|
|
45
47
|
export { Header, HeaderButton, ShareButton, AsideToggle, Aside, type HeaderProps, type HeaderButtonProps, type ShareButtonProps, type AsideToggleProps, type AsideProps, } from './Header.js';
|
|
46
48
|
export { Code, type CodeProps } from './Code.js';
|
|
47
49
|
export { Step, type StepProps, type Ran } from './Step.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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,OAAO,EAAE,IAAI,EAAE,KAAK,SAAS,EAAE,KAAK,IAAI,EAAE,MAAM,QAAQ,CAAA;AACxD,OAAO,EAAE,KAAK,EAAE,KAAK,IAAI,EAAE,KAAK,IAAI,EAAE,MAAM,SAAS,CAAA;AACrD,OAAO,EACL,KAAK,EACL,KAAK,EACL,IAAI,EACJ,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,KAAK,UAAU,GAChB,MAAM,SAAS,CAAA;AAChB,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ch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from './Chat.js';
|
|
37
37
|
export { words } from './words.js';
|
|
38
38
|
export { Parts, Piece, join, } from './Parts.js';
|
|
39
|
-
export { Composer, ASK } from './Composer.js';
|
|
39
|
+
export { Composer, ComposerTool, ASK, } from './Composer.js';
|
|
40
|
+
export { EmptyPrompt, NEXT } from './EmptyPrompt.js';
|
|
40
41
|
export { Caret, Message } from './Message.js';
|
|
41
42
|
export { Thread } from './Thread.js';
|
|
42
43
|
export { ready, sends } from './send.js';
|
|
43
44
|
export { pinned, SLACK } from './stick.js';
|
|
44
45
|
export { Sidebar, SidebarHeader, SidebarIconButton, SidebarNewChat, SidebarScroll, SidebarSection, SidebarItem, SidebarFolder, SidebarUser, } from './Sidebar.js';
|
|
46
|
+
export { SessionRail, StatusDot, } from './SessionRail.js';
|
|
45
47
|
export { Header, HeaderButton, ShareButton, AsideToggle, Aside, } from './Header.js';
|
|
46
48
|
export { Code } from './Code.js';
|
|
47
49
|
export { Step } from './Step.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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,OAAO,EAAE,IAAI,EAA6B,MAAM,QAAQ,CAAA;AACxD,OAAO,EAAE,KAAK,EAAwB,MAAM,SAAS,CAAA;AACrD,OAAO,EACL,KAAK,EACL,KAAK,EACL,IAAI,GAKL,MAAM,SAAS,CAAA;AAChB,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/chat/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,OAAO,EAAE,IAAI,EAA6B,MAAM,QAAQ,CAAA;AACxD,OAAO,EAAE,KAAK,EAAwB,MAAM,SAAS,CAAA;AACrD,OAAO,EACL,KAAK,EACL,KAAK,EACL,IAAI,GAKL,MAAM,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|
@@ -12,10 +12,14 @@ const ProjectThumb_1 = require("./product/ProjectThumb.cjs");
|
|
|
12
12
|
const Split_1 = require("./product/Split.cjs");
|
|
13
13
|
const TooltipAnchor_1 = require("./product/TooltipAnchor.cjs");
|
|
14
14
|
const DialogTemplate_1 = require("./product/DialogTemplate.cjs");
|
|
15
|
+
const ChipSelect_1 = require("./product/ChipSelect.cjs");
|
|
16
|
+
const RepoSelect_1 = require("./product/RepoSelect.cjs");
|
|
17
|
+
const BranchSelect_1 = require("./product/BranchSelect.cjs");
|
|
15
18
|
const chat_1 = require("./chat/index.cjs");
|
|
16
19
|
const gui_2 = require("./backends/gui/index.cjs");
|
|
17
20
|
// Off the barrel — web-only, so it is imported the way a consumer imports it.
|
|
18
21
|
const grid_1 = require("./grid.cjs");
|
|
22
|
+
const agents_1 = require("./agents/index.cjs");
|
|
19
23
|
/** A real <img> with real intrinsic pixels, inline so nothing hits the network.
|
|
20
24
|
* 120x40 on purpose: the wrong ratio for every box it goes in, so a frame that
|
|
21
25
|
* fails to cover-fit its child is visible rather than merely untested. */
|
|
@@ -37,6 +41,16 @@ const TURNS = [
|
|
|
37
41
|
];
|
|
38
42
|
/** The chat shell is callbacks-out, and this list only needs them to exist. */
|
|
39
43
|
const NOOP = () => { };
|
|
44
|
+
/** The sessions a rail lists: every status, because each draws its own dot. */
|
|
45
|
+
const SESSIONS = [
|
|
46
|
+
{ id: 's1', title: 'Rolling update and bootstrap CD', status: 'running' },
|
|
47
|
+
{ id: 's2', title: 'Reset to 2025 version', status: 'done' },
|
|
48
|
+
{ id: 's3', title: 'Paused audit', status: 'paused' },
|
|
49
|
+
{ id: 's4', title: 'Enterprise/OSS feature audit', status: 'error' },
|
|
50
|
+
{ id: 's5', title: 'Idle one', status: 'idle' },
|
|
51
|
+
];
|
|
52
|
+
/** A loader that never needs to answer — the chips render closed. */
|
|
53
|
+
const NONE = async () => ({ repos: [], branches: [], items: [] });
|
|
40
54
|
/** Two: one with a host and one without, so the card's second line and its
|
|
41
55
|
* letter fallback are both rendered rules. */
|
|
42
56
|
const SOURCES = [
|
|
@@ -88,6 +102,19 @@ const Gallery = () => ((0, jsx_runtime_1.jsxs)("div", { style: { display: 'flex'
|
|
|
88
102
|
tabs: [
|
|
89
103
|
{ id: 'console', title: 'Console', closable: false, content: (0, jsx_runtime_1.jsx)(gui_2.CardTitle, { children: "console" }) },
|
|
90
104
|
],
|
|
91
|
-
}, children: (0, jsx_runtime_1.jsx)(gui_2.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: '100%', maxWidth: 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_2.Button, { children: "hinted" }) }), (0, jsx_runtime_1.jsx)(gui_2.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_2.CardTitle, { children: "body" }) }) })] }), (0, jsx_runtime_1.jsxs)(Section, { name: "chat", children: [(0, jsx_runtime_1.jsxs)(gui_2.Screen, { height: "min(72vh, 620px)", minH: 420, maxW: 720, gap: "$3", children: [(0, jsx_runtime_1.jsxs)(chat_1.Header, { title: "A conversation with a long enough name to clamp", leading: (0, jsx_runtime_1.jsx)(chat_1.AsideToggle, {}), onOpenMenu: NOOP, children: [(0, jsx_runtime_1.jsx)(chat_1.ShareButton, {}), (0, jsx_runtime_1.jsx)(chat_1.AsideToggle, {})] }), (0, jsx_runtime_1.jsx)(gui_2.Fill, { children: (0, jsx_runtime_1.jsx)(chat_1.Message, { role: "user", children: "plain Fill \u2014 the middle, without a Thread" }) }), (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_2.Spinner, {}), actions: (0, jsx_runtime_1.jsx)(gui_2.Badge, { children: "copy" }), children: [(0, jsx_runtime_1.jsx)(chat_1.Step, { name: "shell", status: "running", detail: "git status --porcelain" }), (0, jsx_runtime_1.jsx)(chat_1.Step, { name: "write", status: "done", detail: "src/index.ts", defaultOpen: true, children: (0, jsx_runtime_1.jsx)(chat_1.Code, { language: "json", value: "{}", children: '{}' }) }), (0, jsx_runtime_1.jsx)(chat_1.Step, { name: "fetch", status: "error", detail: "timed out", children: "plain body" }), (0, jsx_runtime_1.jsx)(chat_1.Step, { name: "plan", status: "cancelled" }), (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: "assistant", children: (0, jsx_runtime_1.jsx)(chat_1.Failure, { onRetry: NOOP, children: "The model stopped before finishing." }) }), (0, jsx_runtime_1.jsx)(chat_1.Message, { role: "assistant", children: (0, jsx_runtime_1.jsx)(chat_1.Failure, { children: "Rate limited." }) }), (0, jsx_runtime_1.jsx)(chat_1.Message, { role: "user", body: { bg: '$color5', rounded: '$3' }, children: "restyled bubble" }), (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_2.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)(gui_2.Screen, { height: "min(72vh, 620px)", minH: 420, maxW: 720, gap: "$3", children: (0, jsx_runtime_1.jsx)(chat_1.Chat, { messages: TURNS, streaming: true, send: NOOP, stop: NOOP, composer: { placeholder: 'Ask anything' } }) }), (0, jsx_runtime_1.jsx)(gui_2.Screen, { height: "min(72vh, 620px)", minH: 420, maxW: 720, gap: "$3", children: (0, jsx_runtime_1.jsx)(chat_1.Chat, { messages: [], send: NOOP, empty: (0, jsx_runtime_1.jsx)(chat_1.Message, { role: "system", children: "nothing yet" }) }) }), (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: '100%', maxWidth: 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: "
|
|
105
|
+
}, children: (0, jsx_runtime_1.jsx)(gui_2.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: '100%', maxWidth: 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_2.Button, { children: "hinted" }) }), (0, jsx_runtime_1.jsx)(gui_2.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_2.CardTitle, { children: "body" }) }) })] }), (0, jsx_runtime_1.jsxs)(Section, { name: "chat", children: [(0, jsx_runtime_1.jsxs)(gui_2.Screen, { height: "min(72vh, 620px)", minH: 420, maxW: 720, gap: "$3", children: [(0, jsx_runtime_1.jsxs)(chat_1.Header, { title: "A conversation with a long enough name to clamp", leading: (0, jsx_runtime_1.jsx)(chat_1.AsideToggle, {}), onOpenMenu: NOOP, children: [(0, jsx_runtime_1.jsx)(chat_1.ShareButton, {}), (0, jsx_runtime_1.jsx)(chat_1.AsideToggle, {})] }), (0, jsx_runtime_1.jsx)(gui_2.Fill, { children: (0, jsx_runtime_1.jsx)(chat_1.Message, { role: "user", children: "plain Fill \u2014 the middle, without a Thread" }) }), (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_2.Spinner, {}), actions: (0, jsx_runtime_1.jsx)(gui_2.Badge, { children: "copy" }), children: [(0, jsx_runtime_1.jsx)(chat_1.Step, { name: "shell", status: "running", detail: "git status --porcelain" }), (0, jsx_runtime_1.jsx)(chat_1.Step, { name: "write", status: "done", detail: "src/index.ts", defaultOpen: true, children: (0, jsx_runtime_1.jsx)(chat_1.Code, { language: "json", value: "{}", children: '{}' }) }), (0, jsx_runtime_1.jsx)(chat_1.Step, { name: "fetch", status: "error", detail: "timed out", children: "plain body" }), (0, jsx_runtime_1.jsx)(chat_1.Step, { name: "plan", status: "cancelled" }), (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: "assistant", children: (0, jsx_runtime_1.jsx)(chat_1.Failure, { onRetry: NOOP, children: "The model stopped before finishing." }) }), (0, jsx_runtime_1.jsx)(chat_1.Message, { role: "assistant", children: (0, jsx_runtime_1.jsx)(chat_1.Failure, { children: "Rate limited." }) }), (0, jsx_runtime_1.jsx)(chat_1.Message, { role: "user", body: { bg: '$color5', rounded: '$3' }, children: "restyled bubble" }), (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_2.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)(gui_2.Screen, { height: "min(72vh, 620px)", minH: 420, maxW: 720, gap: "$3", children: (0, jsx_runtime_1.jsx)(chat_1.Chat, { messages: TURNS, streaming: true, send: NOOP, stop: NOOP, composer: { placeholder: 'Ask anything' } }) }), (0, jsx_runtime_1.jsx)(gui_2.Screen, { height: "min(72vh, 620px)", minH: 420, maxW: 720, gap: "$3", children: (0, jsx_runtime_1.jsx)(chat_1.Chat, { messages: [], send: NOOP, empty: (0, jsx_runtime_1.jsx)(chat_1.Message, { role: "system", children: "nothing yet" }) }) }), (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: '100%', maxWidth: 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: "workspace", children: [(0, jsx_runtime_1.jsx)("div", { style: { display: 'flex', width: '100%', height: 420 }, children: (0, jsx_runtime_1.jsx)(agents_1.Workspace, { start: (0, jsx_runtime_1.jsx)(agents_1.ProjectChip, { name: "MEGA Shop", onPress: NOOP }), middle: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(agents_1.Views, { views: [...agents_1.VIEWS, agents_1.CHAT], value: "preview", onChange: NOOP, label: "Editor view" }), (0, jsx_runtime_1.jsx)(agents_1.Views, { views: agents_1.DEVICES, value: "desktop", onChange: NOOP, label: "Device", labels: "none" }), (0, jsx_runtime_1.jsx)(agents_1.PageSelect, { pages: [{ id: '/', label: 'Homepage' }], value: "/", onChange: NOOP })] }), end: (0, jsx_runtime_1.jsx)(gui_2.Button, { size: "sm", children: "Publish" }), chat: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(agents_1.Suggestions, { items: agents_1.SUGGESTIONS, onPick: NOOP, onDismiss: NOOP }), (0, jsx_runtime_1.jsx)(agents_1.Attachments, { items: [
|
|
106
|
+
{ id: 'a', kind: 'file', label: 'src/app.tsx' },
|
|
107
|
+
{ id: 'b', kind: 'element', label: '<button> .cta' },
|
|
108
|
+
{ id: 'c', kind: 'upload', label: 'shot.png' },
|
|
109
|
+
], onRemove: NOOP }), (0, jsx_runtime_1.jsx)(agents_1.Feedback, { text: "reply", verdict: "up", onVerdict: NOOP }), (0, jsx_runtime_1.jsx)(agents_1.ModeSelect, { modes: [{ id: 'build', label: 'Build' }, { id: 'plan', label: 'Plan' }], value: "build", onChange: NOOP })] }), dock: (0, jsx_runtime_1.jsx)(agents_1.Console, { lines: [
|
|
110
|
+
{ id: 1, level: 'log', text: 'log', source: 'run' },
|
|
111
|
+
{ id: 2, level: 'info', text: 'info' },
|
|
112
|
+
{ id: 3, level: 'warn', text: 'warn' },
|
|
113
|
+
{ id: 4, level: 'error', text: 'error' },
|
|
114
|
+
{ id: 5, level: 'debug', text: 'debug' },
|
|
115
|
+
], height: 200, onHeight: NOOP, onClear: NOOP, onRun: NOOP }), children: (0, jsx_runtime_1.jsx)(agents_1.PreviewFrame, { src: "https://hanzo.ai/", toolbar: (0, jsx_runtime_1.jsx)(gui_2.Button, { size: "icon-sm", variant: "ghost", children: "+" }) }) }) }), (0, jsx_runtime_1.jsx)("div", { style: { display: 'flex', width: 280, height: 240 }, children: (0, jsx_runtime_1.jsx)(agents_1.FileTree, { files: ['src/app.tsx', 'src/lib/a.ts', 'README.md'], value: "src/lib/a.ts", onSelect: NOOP }) }), (0, jsx_runtime_1.jsx)("div", { style: { display: 'flex', width: 360, height: 240 }, children: (0, jsx_runtime_1.jsx)(agents_1.FileTabs, { files: [
|
|
116
|
+
{ path: 'src/app.tsx', content: 'export {}', dirty: true },
|
|
117
|
+
{ path: 'big.bin', error: 'Too large to show here.' },
|
|
118
|
+
], value: "src/app.tsx", onSelect: NOOP, onClose: NOOP, onChange: NOOP }) }), (0, jsx_runtime_1.jsx)("div", { style: { display: 'flex', width: 280, height: 160 }, children: (0, jsx_runtime_1.jsx)(agents_1.PreviewFrame, { src: null }) }), (0, jsx_runtime_1.jsx)("div", { style: { display: 'flex', width: 360 }, children: (0, jsx_runtime_1.jsx)(agents_1.Console, { lines: [], height: 36, onHeight: NOOP }) })] }), (0, jsx_runtime_1.jsxs)(Section, { name: "sessions", children: [(0, jsx_runtime_1.jsxs)("div", { style: { display: 'flex', width: '100%', maxWidth: 560, height: 420, gap: 12 }, children: [(0, jsx_runtime_1.jsx)(chat_1.SessionRail, { onNew: NOOP, fresh: true, links: [{ id: 'a', label: 'Artifacts', icon: (0, jsx_runtime_1.jsx)(gui_2.Badge, { children: "a" }) }], more: [{ id: 'p', label: 'Projects', icon: (0, jsx_runtime_1.jsx)(gui_2.Badge, { children: "p" }) }], recents: SESSIONS, active: "s2", onOpen: NOOP, onSort: NOOP, account: { name: 'z@hanzo.ai', onPress: NOOP }, onSettings: NOOP, onSearch: NOOP, onCollapse: NOOP }), (0, jsx_runtime_1.jsx)(chat_1.SessionRail, { onNew: NOOP, recents: SESSIONS, onOpen: NOOP, collapsed: true, onCollapse: NOOP, account: { name: 'z' } })] }), (0, jsx_runtime_1.jsx)(chat_1.EmptyPrompt, { mark: (0, jsx_runtime_1.jsx)(gui_2.Badge, { children: "h" }) }), (0, jsx_runtime_1.jsx)("div", { style: { width: '100%', maxWidth: 768 }, children: (0, jsx_runtime_1.jsx)(chat_1.Composer, { inline: true, value: "", onChange: NOOP, onSend: NOOP, placeholder: "Describe a task or ask a question", head: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(ChipSelect_1.ChipSelect, { name: "Environment", label: "Default", onChange: NOOP, items: [] }), (0, jsx_runtime_1.jsx)(RepoSelect_1.RepoSelect, { value: { owner: 'hanzo-inc', name: 'cloud' }, onChange: NOOP, load: NONE }), (0, jsx_runtime_1.jsx)(BranchSelect_1.BranchSelect, { value: "main", onChange: NOOP, load: NONE }), (0, jsx_runtime_1.jsx)(ChipSelect_1.ChipSelect, { name: "Disabled", label: "off", onChange: NOOP, items: [], disabled: true })] }), foot: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(chat_1.ComposerTool, { label: "Attach", icon: (0, jsx_runtime_1.jsx)(gui_2.Badge, { children: "+" }), onPress: NOOP }), (0, jsx_runtime_1.jsx)(chat_1.ComposerTool, { label: "Mode", text: "Auto", caret: true, onPress: NOOP }), (0, jsx_runtime_1.jsx)(chat_1.ComposerTool, { label: "Disabled", text: "off", disabled: true }), (0, jsx_runtime_1.jsx)(gui_1.XStack, { flex: 1 }), (0, jsx_runtime_1.jsx)(ChipSelect_1.ChipSelect, { name: "Model", label: "Zen 5", onChange: NOOP, items: [], quiet: true })] }) }) }), (0, jsx_runtime_1.jsx)("div", { style: { width: '100%', maxWidth: 768 }, children: (0, jsx_runtime_1.jsx)(chat_1.Composer, { inline: true, value: "a draft", onChange: NOOP, onSend: NOOP, onStop: NOOP, busy: true }) })] }), (0, jsx_runtime_1.jsxs)(Section, { name: "box", children: [(0, jsx_runtime_1.jsx)(gui_1.XStack, { items: "center", gap: 16, px: 24, py: 12, rounded: "var(--radius-lg, 0.75rem)", borderWidth: 1, children: (0, jsx_runtime_1.jsx)(gui_2.CardTitle, { children: "utility classes" }) }), (0, jsx_runtime_1.jsx)(gui_1.YStack, { gap: 8, maxW: 768, ml: "auto", mr: "auto", overflow: "hidden", children: (0, jsx_runtime_1.jsx)(gui_2.CardTitle, { children: "column" }) })] })] }));
|
|
92
119
|
exports.Gallery = Gallery;
|
|
93
120
|
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":"AA0LA;;;GAGG;AACH,eAAO,MAAM,OAAO,mCA+tBnB,CAAA;eAEc,OAAO"}
|