Skip to content

Commit beecb6c

Browse files
authored
Introduce ct-tools-chip (#1833)
* Introduce `ct-tools-chip` * Format pass
1 parent 3597c27 commit beecb6c

File tree

5 files changed

+672
-0
lines changed

5 files changed

+672
-0
lines changed

packages/patterns/chatbot.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ export default recipe<ChatInput, ChatOutput>(
132132
<ct-screen>
133133
<ct-hstack justify="between" slot="header">
134134
<ct-heading level={4}>{title}</ct-heading>
135+
<ct-tools-chip tools={tools} />
135136
</ct-hstack>
136137

137138
<ct-vscroll flex showScrollbar fadeEdges snapToBottom>

packages/static/assets/types/jsx.d.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,21 @@ declare global {
156156
"multiple"?: boolean,
157157
"onct-change"?: OpaqueRef<HandlerEvent<{ items: { label: string, value: any }[], value: any | any[] }>>,
158158
} & Children & HTMLElementProps;
159+
"ct-tools-chip": {
160+
"label"?: string,
161+
"show-count"?: boolean,
162+
"open-on-hover"?: boolean,
163+
"toggle-on-click"?: boolean,
164+
"close-delay"?: number,
165+
/**
166+
* Accepts either:
167+
* - Array: { name, description?, schema? }[]
168+
* - Native map: { [toolName]: { handler?: any, pattern?: any } | any }
169+
*/
170+
"tools"?:
171+
| { name: string, description?: string, schema?: unknown }[]
172+
| Record<string, { handler?: unknown; pattern?: unknown } | any>,
173+
} & Children & HTMLElementProps;
159174
"ct-heading": {
160175
"level"?: number,
161176
"no-margin"?: boolean,

0 commit comments

Comments
 (0)