meowtail 0.2.0-alpha.0 → 0.2.0-alpha.2
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/AGENT-COMPONENTS.md +65 -65
- package/ASSISTANT.md +35 -35
- package/JSON.md +11 -11
- package/README.md +413 -385
- package/THIRD_PARTY_NOTICES.md +8 -0
- package/dist/src/chat/assistant-composer.js +58 -98
- package/dist/src/chat/assistant-content.d.ts +1 -3
- package/dist/src/chat/assistant-content.js +36 -44
- package/dist/src/chat/assistant-markdown.js +4 -8
- package/dist/src/chat/assistant-question.js +13 -14
- package/dist/src/chat/assistant.js +27 -26
- package/dist/src/chat/attachments.d.ts +3 -2
- package/dist/src/chat/attachments.js +43 -34
- package/dist/src/chat/composer-panel.d.ts +16 -0
- package/dist/src/chat/composer-panel.js +11 -0
- package/dist/src/chat/composer.d.ts +7 -3
- package/dist/src/chat/composer.js +71 -22
- package/dist/src/chat/conversation.js +2 -2
- package/dist/src/chat/index.d.ts +1 -0
- package/dist/src/chat/index.js +1 -0
- package/dist/src/chat/message-list.js +1 -1
- package/dist/src/chat/message.js +3 -3
- package/dist/src/chat/question.js +1 -1
- package/dist/src/chat/sources.js +1 -1
- package/dist/src/chat/task.js +9 -15
- package/dist/src/chat/tool-call.js +7 -14
- package/dist/src/components/accordion.d.ts +24 -0
- package/dist/src/components/accordion.js +50 -0
- package/dist/src/components/action-rail.d.ts +19 -0
- package/dist/src/components/action-rail.js +13 -0
- package/dist/src/components/add-button.js +1 -1
- package/dist/src/components/alert.d.ts +2 -0
- package/dist/src/components/alert.js +2 -1
- package/dist/src/components/app-bar.d.ts +17 -0
- package/dist/src/components/app-bar.js +10 -0
- package/dist/src/components/avatar.d.ts +22 -0
- package/dist/src/components/avatar.js +44 -0
- package/dist/src/components/breadcrumb.js +1 -1
- package/dist/src/components/checkbox.d.ts +6 -2
- package/dist/src/components/checkbox.js +36 -8
- package/dist/src/components/choice-group.d.ts +1 -0
- package/dist/src/components/choice-group.js +12 -17
- package/dist/src/components/choice-select.d.ts +3 -1
- package/dist/src/components/choice-select.js +56 -54
- package/dist/src/components/code-block.d.ts +3 -3
- package/dist/src/components/code-block.js +31 -27
- package/dist/src/components/context-menu.d.ts +16 -0
- package/dist/src/components/context-menu.js +49 -0
- package/dist/src/components/credential-source.js +12 -12
- package/dist/src/components/diff-block.js +1 -1
- package/dist/src/components/disclosure.d.ts +2 -2
- package/dist/src/components/disclosure.js +1 -1
- package/dist/src/components/hover-card.js +2 -2
- package/dist/src/components/image-lightbox.js +3 -3
- package/dist/src/components/image-preview.js +1 -1
- package/dist/src/components/index.d.ts +12 -0
- package/dist/src/components/index.js +12 -0
- package/dist/src/components/json-block.js +2 -2
- package/dist/src/components/json-tree.js +3 -3
- package/dist/src/components/link.d.ts +13 -0
- package/dist/src/components/link.js +9 -0
- package/dist/src/components/list-group.d.ts +1 -1
- package/dist/src/components/menu-button.d.ts +13 -0
- package/dist/src/components/menu-button.js +10 -0
- package/dist/src/components/menu.d.ts +4 -0
- package/dist/src/components/menu.js +3 -3
- package/dist/src/components/meta-row.d.ts +34 -0
- package/dist/src/components/meta-row.js +61 -0
- package/dist/src/components/nav-item.js +2 -5
- package/dist/src/components/number-input.d.ts +29 -0
- package/dist/src/components/number-input.js +137 -0
- package/dist/src/components/output-block.js +8 -15
- package/dist/src/components/page-frame.d.ts +6 -2
- package/dist/src/components/page-frame.js +2 -2
- package/dist/src/components/path-picker.js +9 -14
- package/dist/src/components/pill.js +2 -5
- package/dist/src/components/popover.js +4 -4
- package/dist/src/components/process-group.d.ts +2 -2
- package/dist/src/components/progress.d.ts +15 -0
- package/dist/src/components/progress.js +12 -0
- package/dist/src/components/rail-item.d.ts +2 -2
- package/dist/src/components/rail-section.d.ts +1 -1
- package/dist/src/components/read-block.js +2 -2
- package/dist/src/components/resource-card.d.ts +1 -1
- package/dist/src/components/resource-link.d.ts +1 -1
- package/dist/src/components/risk-confirmation.js +2 -5
- package/dist/src/components/search-block.js +2 -3
- package/dist/src/components/segmented-control.js +3 -3
- package/dist/src/components/skeleton-boundary.js +4 -7
- package/dist/src/components/slider.d.ts +22 -0
- package/dist/src/components/slider.js +49 -0
- package/dist/src/components/table.d.ts +41 -0
- package/dist/src/components/table.js +146 -0
- package/dist/src/components/tabs.d.ts +1 -1
- package/dist/src/components/tabs.js +11 -20
- package/dist/src/components/terminal-block.js +6 -6
- package/dist/src/components/text-shimmer.js +2 -5
- package/dist/src/components/web-block.js +3 -3
- package/dist/src/components/work-card.d.ts +2 -2
- package/dist/src/components/work-card.js +1 -1
- package/dist/src/icons/README.md +13 -2
- package/dist/src/icons/icon-frame.d.ts +11 -0
- package/dist/src/icons/icon-frame.js +4 -0
- package/dist/src/icons/icon-source.d.ts +17 -0
- package/dist/src/icons/icon-source.js +6 -0
- package/dist/src/icons/icon.d.ts +44 -37
- package/dist/src/icons/icon.js +55 -128
- package/dist/src/icons/index.d.ts +1 -0
- package/dist/src/icons/index.js +1 -0
- package/dist/src/icons/lucide.d.ts +1 -0
- package/dist/src/icons/lucide.js +4 -0
- package/dist/src/registry/index.d.ts +99 -5
- package/dist/src/registry/index.js +28 -3
- package/dist/src/shared/execution-state.js +7 -7
- package/dist/src/theme/chat/composer-panel.styles.d.ts +1 -0
- package/dist/src/theme/chat/composer-panel.styles.js +47 -0
- package/dist/src/theme/chat/composer.styles.js +69 -60
- package/dist/src/theme/chat/task.styles.js +5 -6
- package/dist/src/theme/components/accordion.styles.d.ts +1 -0
- package/dist/src/theme/components/accordion.styles.js +63 -0
- package/dist/src/theme/components/action-rail.styles.d.ts +1 -0
- package/dist/src/theme/components/action-rail.styles.js +47 -0
- package/dist/src/theme/components/alert.styles.js +42 -1
- package/dist/src/theme/components/app-bar.styles.d.ts +1 -0
- package/dist/src/theme/components/app-bar.styles.js +48 -0
- package/dist/src/theme/components/avatar.styles.d.ts +1 -0
- package/dist/src/theme/components/avatar.styles.js +52 -0
- package/dist/src/theme/components/button.styles.js +9 -0
- package/dist/src/theme/components/card.styles.js +2 -0
- package/dist/src/theme/components/code-block.styles.js +7 -0
- package/dist/src/theme/components/context-menu.styles.d.ts +1 -0
- package/dist/src/theme/components/context-menu.styles.js +14 -0
- package/dist/src/theme/components/dialog.styles.js +7 -0
- package/dist/src/theme/components/link.styles.d.ts +1 -0
- package/dist/src/theme/components/link.styles.js +33 -0
- package/dist/src/theme/components/list-group.styles.js +1 -0
- package/dist/src/theme/components/menu.styles.js +9 -3
- package/dist/src/theme/components/meta-row.styles.d.ts +1 -0
- package/dist/src/theme/components/meta-row.styles.js +66 -0
- package/dist/src/theme/components/number-input.styles.d.ts +1 -0
- package/dist/src/theme/components/number-input.styles.js +106 -0
- package/dist/src/theme/components/output-block.styles.js +9 -0
- package/dist/src/theme/components/page-frame.styles.js +7 -1
- package/dist/src/theme/components/page-header.styles.js +7 -0
- package/dist/src/theme/components/progress.styles.d.ts +1 -0
- package/dist/src/theme/components/progress.styles.js +71 -0
- package/dist/src/theme/components/resource-card.styles.js +7 -0
- package/dist/src/theme/components/slider.styles.d.ts +1 -0
- package/dist/src/theme/components/slider.styles.js +129 -0
- package/dist/src/theme/components/table.styles.d.ts +1 -0
- package/dist/src/theme/components/table.styles.js +156 -0
- package/dist/src/theme/components/tag.styles.js +3 -3
- package/dist/src/theme/components/toggle.styles.js +10 -0
- package/dist/src/theme/components/toolbar.styles.js +7 -0
- package/dist/src/theme/index.d.ts +15 -15
- package/dist/src/theme/index.js +24 -0
- package/dist/src/theme/palette.d.ts +1 -1
- package/dist/src/theme/palette.js +1 -1
- package/dist/src/theme/shared/code-highlight.tokens.d.ts +6 -6
- package/dist/src/theme/shared/code-highlight.tokens.js +6 -6
- package/dist/src/theme/tokens.d.ts +7 -7
- package/dist/src/theme/tokens.js +14 -8
- package/package.json +9 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent, h, keyed, unwrap } from "meowjsx";
|
|
1
|
+
import { defineComponent, derived, h, keyed, unwrap } from "meowjsx";
|
|
2
2
|
import { PageFrame } from "../components/page-frame.js";
|
|
3
3
|
import { Button } from "../components/button.js";
|
|
4
4
|
import { WorkCard } from "../components/work-card.js";
|
|
@@ -7,7 +7,7 @@ import { Dialog } from "../components/dialog.js";
|
|
|
7
7
|
import { ChatHeader } from "./header.js";
|
|
8
8
|
import { ChatMessageList } from "./message-list.js";
|
|
9
9
|
import { AssistantComposer } from "./assistant-composer.js";
|
|
10
|
-
import { AssistantMessageView, AssistantSteps
|
|
10
|
+
import { AssistantMessageView, AssistantSteps } from "./assistant-content.js";
|
|
11
11
|
import { AssistantQuestionView } from "./assistant-question.js";
|
|
12
12
|
import { AssistantMarkdown } from "./assistant-markdown.js";
|
|
13
13
|
import { assistantScroll } from "./assistant-scroll.js";
|
|
@@ -32,18 +32,18 @@ export const assistantViewContract = {
|
|
|
32
32
|
"status",
|
|
33
33
|
],
|
|
34
34
|
};
|
|
35
|
-
const AssistantWorkRow = defineComponent({ name: "assistant-work-row", parts: ["root"] }, ({ value, onOpen, actionLabel }
|
|
35
|
+
const AssistantWorkRow = defineComponent({ name: "assistant-work-row", parts: ["root"] }, ({ value, onOpen, actionLabel }) => h(WorkCard, {
|
|
36
36
|
action: actionLabel,
|
|
37
|
-
title:
|
|
38
|
-
state:
|
|
39
|
-
status:
|
|
40
|
-
detail:
|
|
37
|
+
title: derived(() => value.value.title),
|
|
38
|
+
state: derived(() => value.value.tone ?? "unknown"),
|
|
39
|
+
status: derived(() => value.value.statusText),
|
|
40
|
+
detail: derived(() => [value.value.executionText, value.value.replyText].filter(Boolean).join(" · ")),
|
|
41
41
|
onClick: (event) => onOpen(value.value.id, event.currentTarget),
|
|
42
42
|
}));
|
|
43
43
|
const AssistantWorkDetail = defineComponent({ name: "assistant-work-detail", parts: ["root", "feedback", "facts"] }, ({ value, options }, context) => {
|
|
44
44
|
const assistantCopy = { ...defaultAssistantCopy, ...options.labels };
|
|
45
|
-
const hidden =
|
|
46
|
-
const feedback =
|
|
45
|
+
const hidden = derived(() => value.value?.readState === "unavailable");
|
|
46
|
+
const feedback = derived(() => {
|
|
47
47
|
const work = value.value;
|
|
48
48
|
return (work?.feedback ||
|
|
49
49
|
(work?.readState === "unavailable"
|
|
@@ -55,16 +55,17 @@ const AssistantWorkDetail = defineComponent({ name: "assistant-work-detail", par
|
|
|
55
55
|
: ""));
|
|
56
56
|
});
|
|
57
57
|
const detail = h(AssistantMarkdown, {
|
|
58
|
-
text:
|
|
58
|
+
text: derived(() => value.value?.readState === "unavailable"
|
|
59
59
|
? ""
|
|
60
60
|
: (value.value?.detail ?? value.value?.summary ?? "")),
|
|
61
61
|
});
|
|
62
|
+
// The host detail slot may return a node. The default markdown view stays mounted otherwise.
|
|
62
63
|
const custom = options.renderWorkDetail
|
|
63
|
-
?
|
|
64
|
+
? derived(() => value.value && value.value.readState !== "unavailable"
|
|
64
65
|
? (options.renderWorkDetail(value.value) ?? detail)
|
|
65
66
|
: null)
|
|
66
67
|
: detail;
|
|
67
|
-
return context.part("root", "section", null, context.part("feedback", "p", { role: "status", hidden:
|
|
68
|
+
return context.part("root", "section", null, context.part("feedback", "p", { role: "status", hidden: derived(() => !feedback.value) }, feedback), context.part("facts", "div", { hidden }, h("h3", null, derived(() => value.value?.title ?? "")), h("p", null, h(StatusDot, { state: derived(() => value.value?.tone ?? "unknown") }), " ", derived(() => value.value?.statusText ?? "")), h("p", null, derived(() => value.value?.executionText ?? "")), h("p", null, derived(() => value.value?.replyText ?? "")), custom, h(AssistantSteps, { steps: derived(() => value.value?.steps ?? []) })), options.onRefreshWork
|
|
68
69
|
? h(Button, {
|
|
69
70
|
variant: "outline",
|
|
70
71
|
size: "small",
|
|
@@ -79,16 +80,16 @@ const AssistantWorkDetail = defineComponent({ name: "assistant-work-detail", par
|
|
|
79
80
|
/** A complete default Assistant surface. Data, permissions, network and business lifetime stay with the host. */
|
|
80
81
|
export const AssistantView = defineComponent(assistantViewContract, (options, context) => {
|
|
81
82
|
const assistantCopy = { ...defaultAssistantCopy, ...options.labels };
|
|
82
|
-
const messages =
|
|
83
|
-
const work =
|
|
84
|
-
const questions =
|
|
85
|
-
const activity =
|
|
83
|
+
const messages = derived(() => unwrap(options.messages));
|
|
84
|
+
const work = derived(() => unwrap(options.work ?? []));
|
|
85
|
+
const questions = derived(() => unwrap(options.questions ?? []));
|
|
86
|
+
const activity = derived(() => unwrap(options.activity));
|
|
86
87
|
const panelOpen = context.signal(false);
|
|
87
88
|
const selected = context.signal("");
|
|
88
|
-
const selectedWork =
|
|
89
|
+
const selectedWork = derived(() => work.value.find((item) => item.id === selected.value));
|
|
89
90
|
const latestHidden = context.signal(true);
|
|
90
|
-
const bodyHidden =
|
|
91
|
-
const detailHidden =
|
|
91
|
+
const bodyHidden = derived(() => !!selected.value);
|
|
92
|
+
const detailHidden = derived(() => !selected.value);
|
|
92
93
|
let content;
|
|
93
94
|
let scroll;
|
|
94
95
|
let dialog;
|
|
@@ -189,19 +190,19 @@ export const AssistantView = defineComponent(assistantViewContract, (options, co
|
|
|
189
190
|
})
|
|
190
191
|
: null, context.part("feedback", "p", {
|
|
191
192
|
role: "status",
|
|
192
|
-
hidden:
|
|
193
|
-
},
|
|
193
|
+
hidden: derived(() => unwrap(options.readState ?? "ready") === "ready"),
|
|
194
|
+
}, derived(() => unwrap(options.readFeedback ?? "") ||
|
|
194
195
|
(unwrap(options.readState ?? "ready") === "loading"
|
|
195
196
|
? assistantCopy.loading
|
|
196
197
|
: assistantCopy.readError))), context.part("empty", "div", {
|
|
197
|
-
hidden:
|
|
198
|
+
hidden: derived(() => messages.value.length > 0 || unwrap(options.readState ?? "ready") !== "ready"),
|
|
198
199
|
}, h("h2", null, assistantCopy.empty), h("p", null, assistantCopy.emptyDescription)), h(ChatMessageList, { ariaLabel: assistantCopy.messages, children: transcript }))), context.part("latest", "div", { hidden: latestHidden }, h(Button, {
|
|
199
200
|
variant: "outline",
|
|
200
201
|
size: "small",
|
|
201
202
|
onClick: () => scroll?.latest(),
|
|
202
203
|
children: assistantCopy.latest,
|
|
203
204
|
})));
|
|
204
|
-
const activityList = context.part("activityBody", "div", { hidden: bodyHidden }, context.part("section", "section", null, h("h3", null, assistantCopy.current), context.part("status", "p", null, h(StatusDot, { state:
|
|
205
|
+
const activityList = context.part("activityBody", "div", { hidden: bodyHidden }, context.part("section", "section", null, h("h3", null, assistantCopy.current), context.part("status", "p", null, h(StatusDot, { state: derived(() => activity.value?.tone ?? "idle") }), derived(() => activity.value?.statusText ?? assistantCopy.noActivity)), h("strong", null, derived(() => activity.value?.title ?? "")), h("p", null, derived(() => activity.value?.description ?? "")), h(AssistantSteps, { steps: derived(() => activity.value?.steps ?? []) })), context.part("section", "section", null, h("h3", null, assistantCopy.background), h("p", { hidden: derived(() => work.value.length > 0) }, assistantCopy.noWork), keyed(work, (item) => item.id, (value) => h(AssistantWorkRow, {
|
|
205
206
|
value,
|
|
206
207
|
actionLabel: assistantCopy.details,
|
|
207
208
|
onOpen: (id, button) => {
|
|
@@ -212,7 +213,7 @@ export const AssistantView = defineComponent(assistantViewContract, (options, co
|
|
|
212
213
|
dialog?.querySelector("[data-assistant-back]")?.focus();
|
|
213
214
|
});
|
|
214
215
|
},
|
|
215
|
-
}))), context.part("section", "section", { hidden:
|
|
216
|
+
}))), context.part("section", "section", { hidden: derived(() => questions.value.length === 0) }, h("h3", null, assistantCopy.questions), keyed(questions, (question) => question.id, (value) => h(AssistantQuestionView, {
|
|
216
217
|
value,
|
|
217
218
|
labels: options.labels,
|
|
218
219
|
onAnswer: options.onAnswer,
|
|
@@ -260,7 +261,7 @@ export const AssistantView = defineComponent(assistantViewContract, (options, co
|
|
|
260
261
|
style: options.style,
|
|
261
262
|
"aria-label": options["aria-label"],
|
|
262
263
|
className: options.className,
|
|
263
|
-
"data-activity-open":
|
|
264
|
+
"data-activity-open": derived(() => String(panelOpen.value)),
|
|
264
265
|
ref: (element) => {
|
|
265
266
|
root = element;
|
|
266
267
|
const observer = new ResizeObserver(syncDialog);
|
|
@@ -280,7 +281,7 @@ export const AssistantView = defineComponent(assistantViewContract, (options, co
|
|
|
280
281
|
h(Button, {
|
|
281
282
|
variant: "quiet",
|
|
282
283
|
size: "small",
|
|
283
|
-
"aria-expanded":
|
|
284
|
+
"aria-expanded": derived(() => String(panelOpen.value)),
|
|
284
285
|
ref: (element) => {
|
|
285
286
|
activityTrigger = element;
|
|
286
287
|
},
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type Props } from "meowjsx";
|
|
1
|
+
import { type MaybeSignal, type Props } from "meowjsx";
|
|
2
2
|
export declare const chatAttachmentsContract: {
|
|
3
3
|
readonly name: "chat-attachments";
|
|
4
4
|
readonly parts: readonly ["root", "image", "preview", "file", "icon", "details", "name", "size", "entry", "previewButton", "remove"];
|
|
@@ -16,7 +16,8 @@ export interface ChatAttachmentItem {
|
|
|
16
16
|
onRemove?: () => void;
|
|
17
17
|
}
|
|
18
18
|
export interface ChatAttachmentsProps extends Props {
|
|
19
|
-
|
|
19
|
+
/** Plain arrays are fixed for the mount. A signal updates rows in place. */
|
|
20
|
+
items: MaybeSignal<readonly ChatAttachmentItem[]>;
|
|
20
21
|
label?: string;
|
|
21
22
|
className?: string;
|
|
22
23
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent, h } from "meowjsx";
|
|
1
|
+
import { defineComponent, derived, h, keyed, } from "meowjsx";
|
|
2
2
|
import { Icon } from "../icons/icon.js";
|
|
3
3
|
import { FileTypeIcon, fileExtension } from "../icons/file-type-icon.js";
|
|
4
4
|
import { ImagePreview } from "../components/image-preview.js";
|
|
@@ -18,53 +18,62 @@ export const chatAttachmentsContract = {
|
|
|
18
18
|
"remove",
|
|
19
19
|
],
|
|
20
20
|
};
|
|
21
|
-
export const ChatAttachments = defineComponent(chatAttachmentsContract, ({ items, label = "
|
|
21
|
+
export const ChatAttachments = defineComponent(chatAttachmentsContract, ({ items, label = "Message attachments", className, ...props }, context) => context.part("root", "div", {
|
|
22
22
|
...props,
|
|
23
23
|
className,
|
|
24
24
|
role: "group",
|
|
25
25
|
"aria-label": label,
|
|
26
|
-
}, items
|
|
27
|
-
|
|
26
|
+
}, keyed(items, (item) => [
|
|
27
|
+
item.id,
|
|
28
|
+
item.mediaType.startsWith("image/") ? "image" : "file",
|
|
29
|
+
item.onRemove ? "remove" : "keep",
|
|
30
|
+
item.onPreview ? "preview" : "plain",
|
|
31
|
+
].join(":"), (item) => {
|
|
32
|
+
const current = item.value;
|
|
33
|
+
const remove = current.onRemove
|
|
28
34
|
? context.part("remove", "button", {
|
|
29
35
|
type: "button",
|
|
30
|
-
onClick: item.onRemove,
|
|
31
|
-
"aria-label":
|
|
36
|
+
onClick: () => item.value.onRemove?.(),
|
|
37
|
+
"aria-label": derived(() => `Remove ${item.value.name}`),
|
|
32
38
|
}, h(Icon, { name: "x" }))
|
|
33
39
|
: null;
|
|
34
|
-
|
|
35
|
-
|
|
40
|
+
const size = derived(() => {
|
|
41
|
+
const bytes = item.value.sizeBytes;
|
|
42
|
+
if (bytes === undefined || !Number.isFinite(bytes) || bytes < 0)
|
|
43
|
+
return null;
|
|
44
|
+
return context.part("size", "small", null, [fileExtension(item.value.name).toUpperCase().slice(0, 8), formatBytes(bytes)]
|
|
45
|
+
.filter(Boolean)
|
|
46
|
+
.join(" "));
|
|
47
|
+
});
|
|
48
|
+
return current.mediaType.startsWith("image/")
|
|
49
|
+
? context.part("entry", "div", { "data-kind": "image" }, context.part("image", current.onPreview ? "button" : "a", current.onPreview
|
|
36
50
|
? {
|
|
37
51
|
type: "button",
|
|
38
|
-
onClick: item.onPreview,
|
|
39
|
-
"aria-label":
|
|
52
|
+
onClick: () => item.value.onPreview?.(),
|
|
53
|
+
"aria-label": derived(() => `Preview ${item.value.name}`),
|
|
40
54
|
}
|
|
41
55
|
: {
|
|
42
|
-
href: item.url,
|
|
56
|
+
href: derived(() => item.value.url),
|
|
43
57
|
target: "_blank",
|
|
44
58
|
rel: "noreferrer",
|
|
45
|
-
"aria-label":
|
|
46
|
-
}, context.part("preview", "span", null, h(ImagePreview, { src:
|
|
47
|
-
: context.part("entry", "div", {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
}, context.part("icon", "span", { "aria-hidden": "true" }, h(FileTypeIcon, { path:
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
]
|
|
64
|
-
.filter(Boolean)
|
|
65
|
-
.join(" "))
|
|
66
|
-
: null)), item.onPreview
|
|
67
|
-
? context.part("previewButton", "button", { type: "button", onClick: item.onPreview, "aria-label": `预览 ${item.name}` }, "预览")
|
|
59
|
+
"aria-label": derived(() => `Open image ${item.value.name}`),
|
|
60
|
+
}, context.part("preview", "span", null, h(ImagePreview, { src: current.url, alt: current.name }))), remove)
|
|
61
|
+
: context.part("entry", "div", { "data-kind": "file" }, context.part("file", "a", {
|
|
62
|
+
href: derived(() => item.value.url),
|
|
63
|
+
download: derived(() => item.value.name),
|
|
64
|
+
onClick: (event) => {
|
|
65
|
+
const download = item.value.onDownload;
|
|
66
|
+
if (!download)
|
|
67
|
+
return;
|
|
68
|
+
event.preventDefault();
|
|
69
|
+
download();
|
|
70
|
+
},
|
|
71
|
+
}, context.part("icon", "span", { "aria-hidden": "true" }, h(FileTypeIcon, { path: current.name })), context.part("details", "span", null, context.part("name", "strong", null, derived(() => item.value.name)), size)), current.onPreview
|
|
72
|
+
? context.part("previewButton", "button", {
|
|
73
|
+
type: "button",
|
|
74
|
+
onClick: () => item.value.onPreview?.(),
|
|
75
|
+
"aria-label": derived(() => `Preview ${item.value.name}`),
|
|
76
|
+
}, "Preview")
|
|
68
77
|
: null, remove);
|
|
69
78
|
})));
|
|
70
79
|
function formatBytes(value) {
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type Child } from "meowjsx";
|
|
2
|
+
import { type ChatComposerProps } from "./composer.js";
|
|
3
|
+
export declare const composerPanelContract: {
|
|
4
|
+
readonly name: "composer-panel";
|
|
5
|
+
readonly parts: readonly ["root", "surface", "meta"];
|
|
6
|
+
};
|
|
7
|
+
export interface ComposerPanelProps extends Omit<ChatComposerProps, "surface" | "className"> {
|
|
8
|
+
/** Page-level facts below the writing surface, usually a MetaRow. */
|
|
9
|
+
meta?: Child;
|
|
10
|
+
className?: string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* A ChatComposer and optional page-level meta row. The composer keeps its single
|
|
14
|
+
* writing surface and external hint; this panel owns the surrounding composition.
|
|
15
|
+
*/
|
|
16
|
+
export declare const ComposerPanel: import("meowjsx").Component<ComposerPanelProps, "composer-panel", "meta" | "root" | "surface">;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { defineComponent, h } from "meowjsx";
|
|
2
|
+
import { ChatComposer } from "./composer.js";
|
|
3
|
+
export const composerPanelContract = {
|
|
4
|
+
name: "composer-panel",
|
|
5
|
+
parts: ["root", "surface", "meta"],
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* A ChatComposer and optional page-level meta row. The composer keeps its single
|
|
9
|
+
* writing surface and external hint; this panel owns the surrounding composition.
|
|
10
|
+
*/
|
|
11
|
+
export const ComposerPanel = defineComponent(composerPanelContract, ({ meta, className, ...props }, context) => context.part("root", "div", { className, "data-pattern": "composer-panel" }, context.part("surface", "div", null, h(ChatComposer, props)), meta !== undefined && meta !== null ? context.part("meta", "div", null, meta) : null));
|
|
@@ -2,12 +2,14 @@ import { type ThemedProps } from "meowcss/meowjsx";
|
|
|
2
2
|
import { type Child, type MaybeSignal, type Props } from "meowjsx";
|
|
3
3
|
export declare const chatComposerOptions: import("meowcss").Options<{
|
|
4
4
|
readonly layout: readonly ["stacked", "inline", "hero"];
|
|
5
|
+
readonly surface: readonly ["default", "none"];
|
|
5
6
|
}>;
|
|
6
7
|
export declare const chatComposerContract: {
|
|
7
8
|
readonly name: "chat-composer";
|
|
8
|
-
readonly parts: readonly ["root", "attachments", "field", "input", "hint", "actions", "trailing", "submit"];
|
|
9
|
+
readonly parts: readonly ["root", "surface", "attachments", "field", "input", "hint", "actions", "trailing", "submit"];
|
|
9
10
|
readonly styleProps: import("meowcss/meowjsx").StylePropsBinding<import("meowcss").Options<{
|
|
10
11
|
readonly layout: readonly ["stacked", "inline", "hero"];
|
|
12
|
+
readonly surface: readonly ["default", "none"];
|
|
11
13
|
}>>;
|
|
12
14
|
};
|
|
13
15
|
export type ChatComposerSubmit = (event: SubmitEvent) => void;
|
|
@@ -21,16 +23,18 @@ export interface ChatComposerProps extends Props, ThemedProps<typeof chatCompose
|
|
|
21
23
|
attachments?: Child;
|
|
22
24
|
/** Model/provider selection beside the send action; options and state belong to the host. */
|
|
23
25
|
trailing?: Child;
|
|
26
|
+
/** Supporting instructions below the writing surface, associated through hintId. */
|
|
24
27
|
hint?: Child;
|
|
25
28
|
hintId?: string;
|
|
26
29
|
submitLabel?: string;
|
|
27
30
|
/** Visible action content; the accessible name always comes from submitLabel. */
|
|
28
31
|
submitContent?: Child;
|
|
29
|
-
disabled?: boolean
|
|
32
|
+
disabled?: MaybeSignal<boolean>;
|
|
33
|
+
readOnly?: MaybeSignal<boolean>;
|
|
30
34
|
/** Prevent another submission while keeping the draft editable. */
|
|
31
35
|
submitDisabled?: MaybeSignal<boolean>;
|
|
32
36
|
onSubmit?: ChatComposerSubmit;
|
|
33
37
|
onInput?: ChatComposerInput;
|
|
34
38
|
className?: string;
|
|
35
39
|
}
|
|
36
|
-
export declare const ChatComposer: import("meowjsx").Component<ChatComposerProps, "chat-composer", "actions" | "attachments" | "field" | "hint" | "input" | "root" | "submit" | "trailing">;
|
|
40
|
+
export declare const ChatComposer: import("meowjsx").Component<ChatComposerProps, "chat-composer", "actions" | "attachments" | "field" | "hint" | "input" | "root" | "submit" | "surface" | "trailing">;
|
|
@@ -1,31 +1,80 @@
|
|
|
1
1
|
import { defineOptions } from "meowcss";
|
|
2
2
|
import { defineStyleProps } from "meowcss/meowjsx";
|
|
3
|
-
import { defineComponent, h } from "meowjsx";
|
|
3
|
+
import { defineComponent, derived, h, unwrap, } from "meowjsx";
|
|
4
4
|
import { Icon } from "../icons/icon.js";
|
|
5
5
|
export const chatComposerOptions = defineOptions("chat-composer", {
|
|
6
6
|
layout: ["stacked", "inline", "hero"],
|
|
7
|
+
surface: ["default", "none"],
|
|
7
8
|
});
|
|
8
9
|
export const chatComposerContract = {
|
|
9
10
|
name: "chat-composer",
|
|
10
|
-
parts: [
|
|
11
|
-
|
|
11
|
+
parts: [
|
|
12
|
+
"root",
|
|
13
|
+
"surface",
|
|
14
|
+
"attachments",
|
|
15
|
+
"field",
|
|
16
|
+
"input",
|
|
17
|
+
"hint",
|
|
18
|
+
"actions",
|
|
19
|
+
"trailing",
|
|
20
|
+
"submit",
|
|
21
|
+
],
|
|
22
|
+
styleProps: defineStyleProps(chatComposerOptions, {
|
|
23
|
+
defaults: { layout: "stacked", surface: "default" },
|
|
24
|
+
}),
|
|
12
25
|
};
|
|
13
|
-
export const ChatComposer = defineComponent(chatComposerContract, ({ value = "", placeholder = "
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
"
|
|
31
|
-
|
|
26
|
+
export const ChatComposer = defineComponent(chatComposerContract, ({ value = "", placeholder = "Write a message…", inputLabel = "Message", attachments, trailing, hint, hintId, submitLabel = "Send", submitContent, disabled = false, readOnly = false, submitDisabled = false, onSubmit, onInput, children, className, ...props }, context) => {
|
|
27
|
+
const submitBlocked = disabled === true
|
|
28
|
+
? true
|
|
29
|
+
: typeof disabled === "boolean"
|
|
30
|
+
? submitDisabled
|
|
31
|
+
: derived(() => Boolean(unwrap(disabled)) || Boolean(unwrap(submitDisabled)));
|
|
32
|
+
let field;
|
|
33
|
+
const resize = () => {
|
|
34
|
+
if (!field?.isConnected)
|
|
35
|
+
return;
|
|
36
|
+
field.style.height = "auto";
|
|
37
|
+
field.style.height = `${field.scrollHeight}px`;
|
|
38
|
+
};
|
|
39
|
+
return context.part("root", "form", {
|
|
40
|
+
...props,
|
|
41
|
+
className,
|
|
42
|
+
onSubmit,
|
|
43
|
+
}, context.part("surface", "div", null, attachments ? context.part("attachments", "div", null, attachments) : null, context.part("field", "div", null, context.part("input", "textarea", {
|
|
44
|
+
"data-chat-input": true,
|
|
45
|
+
name: "message",
|
|
46
|
+
rows: 1,
|
|
47
|
+
value,
|
|
48
|
+
placeholder,
|
|
49
|
+
"aria-label": inputLabel,
|
|
50
|
+
"aria-describedby": hint && hintId ? hintId : undefined,
|
|
51
|
+
disabled,
|
|
52
|
+
readOnly,
|
|
53
|
+
onInput,
|
|
54
|
+
ref: (textarea) => {
|
|
55
|
+
field = textarea;
|
|
56
|
+
const stop = context.effect(() => {
|
|
57
|
+
unwrap(value);
|
|
58
|
+
resize();
|
|
59
|
+
});
|
|
60
|
+
const onResizeInput = () => resize();
|
|
61
|
+
textarea.addEventListener("input", onResizeInput);
|
|
62
|
+
const observer = typeof ResizeObserver === "function" ? new ResizeObserver(resize) : undefined;
|
|
63
|
+
observer?.observe(textarea);
|
|
64
|
+
queueMicrotask(() => {
|
|
65
|
+
if (textarea.isConnected)
|
|
66
|
+
resize();
|
|
67
|
+
});
|
|
68
|
+
return () => {
|
|
69
|
+
stop();
|
|
70
|
+
textarea.removeEventListener("input", onResizeInput);
|
|
71
|
+
observer?.disconnect();
|
|
72
|
+
field = undefined;
|
|
73
|
+
};
|
|
74
|
+
},
|
|
75
|
+
})), context.part("actions", "div", null, children, trailing ? context.part("trailing", "div", null, trailing) : null, context.part("submit", "button", {
|
|
76
|
+
type: "submit",
|
|
77
|
+
disabled: submitBlocked,
|
|
78
|
+
"aria-label": submitLabel,
|
|
79
|
+
}, submitContent ?? h(Icon, { name: "arrow-up" })))), hint ? context.part("hint", "span", hintId ? { id: hintId } : null, hint) : null);
|
|
80
|
+
});
|
|
@@ -8,11 +8,11 @@ export const chatConversationContract = {
|
|
|
8
8
|
* Place it beside the host viewport in a height-constrained column; the host
|
|
9
9
|
* owns visibility, returning to the end and restoring viewport focus.
|
|
10
10
|
*/
|
|
11
|
-
export const ChatConversationLatest = defineComponent(chatConversationContract, ({ children, ...props }, context) => context.part("latest", "button", { type: "button", ...props }, children ?? "
|
|
11
|
+
export const ChatConversationLatest = defineComponent(chatConversationContract, ({ children, ...props }, context) => context.part("latest", "button", { type: "button", ...props }, children ?? "Back to latest message"));
|
|
12
12
|
/** Optional scroll owner for append-only transcripts. Give the root a constrained height.
|
|
13
13
|
* Do not combine with an application-owned scroll controller. Children can use ChatMessageList.
|
|
14
14
|
*/
|
|
15
|
-
export const ChatConversation = defineComponent(chatConversationContract, ({ children, ariaLabel = "
|
|
15
|
+
export const ChatConversation = defineComponent(chatConversationContract, ({ children, ariaLabel = "Conversation reading area", latestLabel = "Back to latest message", className, ...props }, context) => {
|
|
16
16
|
const hidden = context.signal(true);
|
|
17
17
|
let jump;
|
|
18
18
|
const mount = (root) => {
|
package/dist/src/chat/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { ChatAttachments, type ChatAttachmentItem, type ChatAttachmentsProps, chatAttachmentsContract, } from "./attachments.js";
|
|
2
2
|
export { ChatComposer, type ChatComposerProps, type ChatComposerInput, type ChatComposerSubmit, chatComposerContract, chatComposerOptions, } from "./composer.js";
|
|
3
|
+
export { ComposerPanel, type ComposerPanelProps, composerPanelContract } from "./composer-panel.js";
|
|
3
4
|
export { ChatFrame, type ChatFrameProps, chatFrameContract } from "./frame.js";
|
|
4
5
|
export { AssistantView, assistantViewContract, assistantCopy, type AssistantViewProps, type AssistantDraft, type AssistantAttachment, type AssistantMessage, type AssistantMessagePart, type AssistantToolPart, type AssistantTaskPart, type AssistantProcessStep, type AssistantActivity, type AssistantWork, type AssistantQuestion, type AssistantChoice, type AssistantLabels, } from "./assistant.js";
|
|
5
6
|
export { ChatHeader, type ChatHeaderProps, chatHeaderContract } from "./header.js";
|
package/dist/src/chat/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { ChatAttachments, chatAttachmentsContract, } from "./attachments.js";
|
|
2
2
|
export { ChatComposer, chatComposerContract, chatComposerOptions, } from "./composer.js";
|
|
3
|
+
export { ComposerPanel, composerPanelContract } from "./composer-panel.js";
|
|
3
4
|
export { ChatFrame, chatFrameContract } from "./frame.js";
|
|
4
5
|
export { AssistantView, assistantViewContract, assistantCopy, } from "./assistant.js";
|
|
5
6
|
export { ChatHeader, chatHeaderContract } from "./header.js";
|
|
@@ -3,7 +3,7 @@ export const chatMessageListContract = {
|
|
|
3
3
|
name: "chat-message-list",
|
|
4
4
|
parts: ["root", "content", "item", "date"],
|
|
5
5
|
};
|
|
6
|
-
export const ChatMessageList = defineComponent(chatMessageListContract, ({ children, className, ariaLabel = "
|
|
6
|
+
export const ChatMessageList = defineComponent(chatMessageListContract, ({ children, className, ariaLabel = "Message log", ...props }, context) => context.part("root", "div", {
|
|
7
7
|
...props,
|
|
8
8
|
className,
|
|
9
9
|
role: "log",
|
package/dist/src/chat/message.js
CHANGED
|
@@ -29,8 +29,8 @@ export const ChatMessage = defineComponent(chatMessageContract, ({ children, rol
|
|
|
29
29
|
? context.part("header", "div", null, header)
|
|
30
30
|
: context.part("meta", "div", null, context.part("author", "strong", null, author), timestamp ? context.part("time", "time", { datetime: dateTime }, timestamp) : null, status !== "complete"
|
|
31
31
|
? context.part("status", "span", null, status === "streaming"
|
|
32
|
-
? "
|
|
32
|
+
? "Generating"
|
|
33
33
|
: status === "pending"
|
|
34
|
-
? "
|
|
35
|
-
: "
|
|
34
|
+
? "Waiting"
|
|
35
|
+
: "Incomplete")
|
|
36
36
|
: null), context.part("content", "div", null, surface === "none" ? children : h(ChatBubble, null, children)), footer !== undefined ? context.part("footer", "div", null, footer) : null, actions ? context.part("actions", "div", null, actions) : null)))));
|
|
@@ -4,4 +4,4 @@ export const chatQuestionContract = {
|
|
|
4
4
|
parts: ["root", "eyebrow", "title", "description", "content", "feedback", "actions"],
|
|
5
5
|
};
|
|
6
6
|
/** Presentation only: submission, cancellation and question lifetime belong to the host. */
|
|
7
|
-
export const ChatQuestion = defineComponent(chatQuestionContract, ({ label = "
|
|
7
|
+
export const ChatQuestion = defineComponent(chatQuestionContract, ({ label = "Needs your answer", question, questionId, description, feedback, actions, children, ...props }, context) => context.part("root", "section", { ...props, "aria-labelledby": questionId ?? props["aria-labelledby"] }, context.part("eyebrow", "div", null, label), question ? context.part("title", "p", { id: questionId }, question) : null, description ? context.part("description", "p", null, description) : null, context.part("content", "div", null, children), feedback ? context.part("feedback", "div", { role: "status" }, feedback) : null, actions ? context.part("actions", "div", null, actions) : null));
|
package/dist/src/chat/sources.js
CHANGED
|
@@ -4,7 +4,7 @@ export const chatSourcesContract = {
|
|
|
4
4
|
name: "chat-sources",
|
|
5
5
|
parts: ["root", "summary", "icon", "list", "item", "link", "description"],
|
|
6
6
|
};
|
|
7
|
-
export const ChatSources = defineComponent(chatSourcesContract, ({ items, label = "
|
|
7
|
+
export const ChatSources = defineComponent(chatSourcesContract, ({ items, label = "Sources", ...props }, context) => {
|
|
8
8
|
const links = items.filter(({ url }) => {
|
|
9
9
|
try {
|
|
10
10
|
return ["http:", "https:"].includes(new URL(url).protocol);
|
package/dist/src/chat/task.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { defineComponent, h, unwrap, } from "meowjsx";
|
|
1
|
+
import { defineComponent, derived, h, unwrap, } from "meowjsx";
|
|
2
|
+
import { Progress } from "../components/progress.js";
|
|
2
3
|
import { StatusDot } from "../components/status-dot.js";
|
|
3
4
|
import { executionStateLabel, executionStateTone, } from "../shared/execution-state.js";
|
|
4
5
|
export const chatTaskContract = {
|
|
@@ -31,23 +32,16 @@ function checkedProgress(value) {
|
|
|
31
32
|
}
|
|
32
33
|
/** A task record, not an executable task or a whole-card control. */
|
|
33
34
|
export const ChatTask = defineComponent(chatTaskContract, ({ title, state = "unknown", statusLabel, description, executionText, replyText, progress, footer, children, className, ...props }, context) => {
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
context.effect(() => {
|
|
37
|
-
result.value = read();
|
|
38
|
-
});
|
|
39
|
-
return result;
|
|
40
|
-
};
|
|
41
|
-
const currentProgress = derive(() => checkedProgress(unwrap(progress)));
|
|
42
|
-
const text = (part, value) => context.part(part, "p", { hidden: derive(() => !unwrap(value)) }, derive(() => unwrap(value) ?? ""));
|
|
35
|
+
const currentProgress = derived(() => checkedProgress(unwrap(progress)));
|
|
36
|
+
const text = (part, value) => context.part(part, "p", { hidden: derived(() => !unwrap(value)) }, derived(() => unwrap(value) ?? ""));
|
|
43
37
|
return context.part("root", "section", {
|
|
44
38
|
...props,
|
|
45
39
|
className,
|
|
46
40
|
"aria-label": props["aria-label"] ?? title,
|
|
47
41
|
"data-execution-state": state,
|
|
48
|
-
}, context.part("header", "div", null, context.part("title", "strong", null, title), context.part("status", "span", null, h(StatusDot, { state:
|
|
49
|
-
value:
|
|
50
|
-
max:
|
|
51
|
-
|
|
52
|
-
})), context.part("body", "div", null, children), context.part("footer", "div", null, footer));
|
|
42
|
+
}, context.part("header", "div", null, context.part("title", "strong", null, title), context.part("status", "span", null, h(StatusDot, { state: derived(() => executionStateTone(unwrap(state))) }), derived(() => unwrap(statusLabel) ?? executionStateLabel(unwrap(state))))), text("description", description), text("execution", executionText), text("reply", replyText), context.part("progress", "div", { hidden: derived(() => currentProgress.value === undefined) }, context.part("progressLabel", "span", null, derived(() => currentProgress.value?.label ?? "")), context.part("progressBar", "div", null, h(Progress, {
|
|
43
|
+
value: derived(() => currentProgress.value?.value ?? 0),
|
|
44
|
+
max: derived(() => currentProgress.value?.max ?? 1),
|
|
45
|
+
label: derived(() => currentProgress.value?.label ?? ""),
|
|
46
|
+
}))), context.part("body", "div", null, children), context.part("footer", "div", null, footer));
|
|
53
47
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent, h, unwrap, } from "meowjsx";
|
|
1
|
+
import { defineComponent, derived, h, unwrap, } from "meowjsx";
|
|
2
2
|
import { Icon } from "../icons/icon.js";
|
|
3
3
|
import { Button } from "../components/button.js";
|
|
4
4
|
import { OutputBlock } from "../components/output-block.js";
|
|
@@ -22,20 +22,13 @@ export const chatToolCallContract = {
|
|
|
22
22
|
],
|
|
23
23
|
};
|
|
24
24
|
export const ChatToolCall = defineComponent(chatToolCallContract, ({ children, label, summary, state = "complete", statusLabel, detail, icon, input, output, outputSummary, maxLines, collapsible = false, onActivate, onRetry, onCancel, canRetry = true, canCancel = true, retryDisabled = false, cancelDisabled = false, labels, className, ...props }, context) => {
|
|
25
|
-
const derived = (read) => {
|
|
26
|
-
const value = context.signal(read());
|
|
27
|
-
context.effect(() => {
|
|
28
|
-
value.value = read();
|
|
29
|
-
});
|
|
30
|
-
return value;
|
|
31
|
-
};
|
|
32
25
|
const copy = {
|
|
33
|
-
input: "
|
|
34
|
-
output: "
|
|
35
|
-
emptyInput: "
|
|
36
|
-
emptyOutput: "
|
|
37
|
-
retry: "
|
|
38
|
-
cancel: "
|
|
26
|
+
input: "Input",
|
|
27
|
+
output: "Output",
|
|
28
|
+
emptyInput: "No input content",
|
|
29
|
+
emptyOutput: "Empty output",
|
|
30
|
+
retry: "Retry",
|
|
31
|
+
cancel: "Cancel",
|
|
39
32
|
...labels,
|
|
40
33
|
};
|
|
41
34
|
const status = derived(() => unwrap(statusLabel) ?? executionStateLabel(unwrap(state)));
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type Child, type MaybeSignal, type Props } from "meowjsx";
|
|
2
|
+
export declare const accordionContract: {
|
|
3
|
+
readonly name: "accordion";
|
|
4
|
+
readonly parts: readonly ["root", "item"];
|
|
5
|
+
};
|
|
6
|
+
export interface AccordionItem {
|
|
7
|
+
id: string;
|
|
8
|
+
summary: Child;
|
|
9
|
+
content: Child;
|
|
10
|
+
}
|
|
11
|
+
export type AccordionType = "single" | "multiple";
|
|
12
|
+
export type AccordionValue = string | readonly string[];
|
|
13
|
+
export interface AccordionProps extends Props {
|
|
14
|
+
items: readonly AccordionItem[];
|
|
15
|
+
/** `single` keeps one section open; `multiple` lets several stay open. */
|
|
16
|
+
type?: AccordionType;
|
|
17
|
+
value?: MaybeSignal<AccordionValue>;
|
|
18
|
+
defaultValue?: AccordionValue;
|
|
19
|
+
onValueChange?: (value: AccordionValue) => void;
|
|
20
|
+
label?: string;
|
|
21
|
+
className?: string;
|
|
22
|
+
}
|
|
23
|
+
/** Grouped disclosures. Items are fixed for the mount. Expansion is handed to the caller when `value` is set. */
|
|
24
|
+
export declare const Accordion: import("meowjsx").Component<AccordionProps, "accordion", "item" | "root">;
|