@gridui/task 1.0.10 → 1.1.0

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/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @gridui/task
2
2
 
3
- Dashboard family. Public API: `ApprovalPanel`, `ApprovalPanelProps`, `TaskStep`, `TaskTimeline`, `TaskTimelineProps`.
3
+ Dashboard family. Public API: `ApprovalPanel`, `ApprovalPanelProps`, `TaskStep`, `TaskTimeline`, `TaskTimelineProps`, `ToolCall`, `ToolCallProps`, `ToolCallStatus`, `ToolCallSummary`, `ToolCallSummaryProps`, `ToolCallDetails`, `ToolCallDetailsProps`.
4
4
 
5
5
  Import components from `@gridui/task` and load `@gridui/task/styles.css` after Theme.
6
6
  Load styles for any composed dependency used by this family. Applications own routes, labels, state persistence, and branding.
@@ -15,4 +15,60 @@ with Disclosure; Task owns decision state, callbacks, and dense spacing.
15
15
  TaskTimeline rows share the palette’s structural border color in every state.
16
16
  Failed steps emphasize their status label with the danger foreground color.
17
17
 
18
+ ## Tool calls
19
+
20
+ Use `ToolCall` for one invocation and `TaskTimeline` for a sequence of tasks.
21
+ Supply a localized `title` and `statusLabel`, plus a `status`: `pending`,
22
+ `input-streaming`, `waiting`, `running`, `completed`, `failed`, or `cancelled`.
23
+ The execution states use the same names as TaskTimeline; `input-streaming`
24
+ distinguishes arguments that have not finished arriving. Optional `description`
25
+ and preformatted `durationLabel` appear in the summary.
26
+
27
+ ```tsx
28
+ import { ToolCall, ToolCallSummary, ToolCallDetails } from "@gridui/task";
29
+ import { Grid, GridItem } from "@gridui/grid";
30
+
31
+ <ToolCall title="Search documents" status="running" statusLabel="Searching">
32
+ <Grid columns={1} frame="all">
33
+ <GridItem padding={16}><ToolCallSummary /></GridItem>
34
+ <GridItem asChild padding={16}>
35
+ <ToolCallDetails>{output}</ToolCallDetails>
36
+ </GridItem>
37
+ </Grid>
38
+ </ToolCall>
39
+ ```
40
+
41
+ Load Theme, Grid, then Task styles for this composition. ToolCall itself does not
42
+ render Button or Disclosure; import their styles when rendering those components.
43
+
44
+ Include one summary and one details part per root. Details start closed; use
45
+ `defaultOpen` for an initial preference or `open`/`onOpenChange` for controlled
46
+ state. A controlled host may reject a change request. A host collapse returns
47
+ focus to the summary only when focus was inside the details. Collapsed details
48
+ stay mounted and leave the accessibility tree and layout. Invocation status
49
+ changes never reset expansion or content. Use a new React key for a new call.
50
+
51
+ ToolCall parts have no outer inset, background, or structural border. Grid owns
52
+ those regions, including empty space: use `GridItem asChild` around details,
53
+ not a permanently visible GridItem around a hidden panel. Use nested Grids for
54
+ input/output seams. A permanently expanded inspector uses `open` and
55
+ `ToolCallSummary collapsible={false}`. For output-first presentation, keep output
56
+ in a sibling GridItem and put only the arguments in ToolCallDetails.
57
+
58
+ `ToolCallSummary actions` accepts caller-owned controls outside the toggle.
59
+ Applications own availability, stop/retry callbacks, focus after removing actions,
60
+ and execution. Only `statusLabel` is announced through a polite status region;
61
+ keep token counts and elapsed time out of that label. Details are busy during
62
+ `input-streaming` and `running`; waiting for approval is not active execution.
63
+
64
+ Inputs and outputs are React content, not protocol objects. Render incomplete
65
+ arguments as escaped text; only render structured arguments when the application
66
+ has parsed a complete value. Markdown, logs, tables, and result controls can all
67
+ be children. Failure and cancellation retain whatever content the caller supplies;
68
+ the component does not cache removed snapshots, parse JSON, fetch, or run tools.
69
+
70
+ Keep ApprovalPanel outside collapsible details in its own Grid region. Its public
71
+ `style` prop can remove its standalone padding, border, and background when Grid
72
+ owns the frame. Approval and execution remain separate states.
73
+
18
74
  [Component reference](docs/reference/README.md) contains focused API pages for each public component.
package/dist/index.d.ts CHANGED
@@ -9,3 +9,10 @@ export { ApprovalPanel } from "./approval-panel/approval-panel";
9
9
  export type { TaskStep } from "./task-timeline/task-timeline";
10
10
  export type { TaskTimelineProps } from "./task-timeline/task-timeline";
11
11
  export { TaskTimeline } from "./task-timeline/task-timeline";
12
+ export type { ToolCallStatus } from "./shared/tool-call-context";
13
+ export type { ToolCallProps } from "./tool-call/tool-call";
14
+ export { ToolCall } from "./tool-call/tool-call";
15
+ export type { ToolCallSummaryProps } from "./tool-call-summary/tool-call-summary";
16
+ export { ToolCallSummary } from "./tool-call-summary/tool-call-summary";
17
+ export type { ToolCallDetailsProps } from "./tool-call-details/tool-call-details";
18
+ export { ToolCallDetails } from "./tool-call-details/tool-call-details";
package/dist/index.js CHANGED
@@ -146,6 +146,13 @@ import { cva as cva3 } from "class-variance-authority";
146
146
  var taskListStyles = cva3("gridui-u-task--m-0 gridui-u-task--list-decimal gridui-u-task--ps-gridui-32");
147
147
  var taskItemStyles = cva3("gridui-u-task--min-w-0 gridui-u-task--border-b gridui-u-task--border-border gridui-u-task--py-gridui-16 gridui-u-task--pe-gridui-16 gridui-u-task--wrap-anywhere");
148
148
  var taskDetailsStyles = cva3("gridui-u-task--my-gridui-8");
149
+ var taskStatusStyles = cva3(taskMetaStyles(), {
150
+ variants: {
151
+ failed: {
152
+ true: "gridui-u-task--text-status-danger-text"
153
+ }
154
+ }
155
+ });
149
156
 
150
157
  // src/task-timeline/task-timeline.tsx
151
158
  import { Button as Button2 } from "@gridui/button";
@@ -177,7 +184,7 @@ var TaskTimeline = (props) => {
177
184
  /* @__PURE__ */ jsx2(
178
185
  "span",
179
186
  {
180
- className: cn2(taskMetaStyles(), step.status === "failed" && "gridui-u-task--text-danger-foreground"),
187
+ className: cn2(taskStatusStyles({ failed: step.status === "failed" })),
181
188
  children: step.statusLabel
182
189
  }
183
190
  )
@@ -225,8 +232,125 @@ var TaskTimeline = (props) => {
225
232
  }
226
233
  );
227
234
  };
235
+
236
+ // src/shared/tool-call-context.ts
237
+ import { createContext, useContext } from "react";
238
+ var toolCallContext = createContext(null);
239
+ var useToolCall = () => {
240
+ const context = useContext(toolCallContext);
241
+ if (!context) {
242
+ throw new Error("ToolCall parts require a ToolCall.");
243
+ }
244
+ return context;
245
+ };
246
+
247
+ // src/tool-call/tool-call.tsx
248
+ import { cn as cn3 } from "@gridui/style-utils";
249
+ import { useId as useId2, useLayoutEffect as useLayoutEffect2, useState } from "react";
250
+ import { jsx as jsx3 } from "react/jsx-runtime";
251
+ var ToolCall = (props) => {
252
+ const {
253
+ title,
254
+ status,
255
+ statusLabel,
256
+ description,
257
+ durationLabel,
258
+ open: controlledOpen,
259
+ defaultOpen = false,
260
+ onOpenChange,
261
+ children,
262
+ className,
263
+ ...restProps
264
+ } = props;
265
+ const id = useId2();
266
+ const summaryId = `${id}-summary`;
267
+ const detailsId = `${id}-details`;
268
+ const [uncontrolledOpen, setUncontrolledOpen] = useState(defaultOpen);
269
+ const open = controlledOpen ?? uncontrolledOpen;
270
+ const setOpen = (nextOpen) => {
271
+ if (controlledOpen === void 0) {
272
+ setUncontrolledOpen(nextOpen);
273
+ }
274
+ onOpenChange?.(nextOpen);
275
+ };
276
+ useLayoutEffect2(() => {
277
+ if (!open && document.getElementById(detailsId)?.contains(document.activeElement)) {
278
+ document.getElementById(summaryId)?.focus();
279
+ }
280
+ }, [open, detailsId, summaryId]);
281
+ return /* @__PURE__ */ jsx3(toolCallContext.Provider, { value: {
282
+ title,
283
+ status,
284
+ statusLabel,
285
+ description,
286
+ durationLabel,
287
+ open,
288
+ setOpen,
289
+ summaryId,
290
+ detailsId
291
+ }, children: /* @__PURE__ */ jsx3("div", { ...restProps, "data-state": status, className: cn3("gridui-u-task--min-w-0 gridui-u-task--type-body gridui-u-task--wrap-anywhere", className), children }) });
292
+ };
293
+
294
+ // src/tool-call-summary/tool-call-summary.tsx
295
+ import { cn as cn4 } from "@gridui/style-utils";
296
+ import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
297
+ var ToolCallSummary = (props) => {
298
+ const { collapsible = true, actions, className, ...restProps } = props;
299
+ const call = useToolCall();
300
+ return /* @__PURE__ */ jsxs3("div", { ...restProps, className: cn4("gridui-u-task--flex gridui-u-task--min-w-0 gridui-u-task--flex-col gridui-u-task--gap-gridui-8", className), children: [
301
+ /* @__PURE__ */ jsxs3("div", { className: taskHeadingStyles(), children: [
302
+ collapsible ? /* @__PURE__ */ jsxs3(
303
+ "button",
304
+ {
305
+ type: "button",
306
+ id: call.summaryId,
307
+ className: cn4("gridui-tool-call-trigger gridui-u-task--flex gridui-u-task--min-h-11 gridui-u-task--min-w-0 gridui-u-task--items-center gridui-u-task--gap-gridui-8 gridui-u-task--border-0 gridui-u-task--bg-transparent gridui-u-task--p-0 gridui-u-task--text-start gridui-u-task--text-foreground gridui-u-task--wrap-anywhere gridui-u-task--cursor-pointer"),
308
+ "aria-expanded": call.open,
309
+ "aria-controls": call.detailsId,
310
+ onClick: () => {
311
+ call.setOpen(!call.open);
312
+ },
313
+ children: [
314
+ /* @__PURE__ */ jsx4("span", { className: cn4("gridui-tool-call-chevron"), "aria-hidden": "true" }),
315
+ /* @__PURE__ */ jsx4("strong", { className: cn4("gridui-u-task--font-medium"), children: call.title })
316
+ ]
317
+ }
318
+ ) : /* @__PURE__ */ jsx4("strong", { id: call.summaryId, className: cn4("gridui-u-task--font-medium"), children: call.title }),
319
+ /* @__PURE__ */ jsx4("span", { role: "status", className: cn4(taskMetaStyles(), call.status === "failed" && "gridui-u-task--text-status-danger-text"), children: call.statusLabel })
320
+ ] }),
321
+ (call.description !== void 0 || call.durationLabel !== void 0 || actions !== void 0) && /* @__PURE__ */ jsxs3("div", { className: taskHeadingStyles(), children: [
322
+ /* @__PURE__ */ jsxs3("div", { className: cn4("gridui-u-task--flex gridui-u-task--min-w-0 gridui-u-task--flex-wrap gridui-u-task--items-baseline gridui-u-task--gap-gridui-8"), children: [
323
+ call.description,
324
+ call.durationLabel !== void 0 && /* @__PURE__ */ jsx4("span", { className: taskMetaStyles(), children: call.durationLabel })
325
+ ] }),
326
+ actions
327
+ ] })
328
+ ] });
329
+ };
330
+
331
+ // src/tool-call-details/tool-call-details.tsx
332
+ import { cn as cn5 } from "@gridui/style-utils";
333
+ import { jsx as jsx5 } from "react/jsx-runtime";
334
+ var ToolCallDetails = (props) => {
335
+ const { className, ...restProps } = props;
336
+ const call = useToolCall();
337
+ return /* @__PURE__ */ jsx5(
338
+ "div",
339
+ {
340
+ ...restProps,
341
+ id: call.detailsId,
342
+ hidden: !call.open,
343
+ "aria-labelledby": call.summaryId,
344
+ "aria-busy": call.status === "input-streaming" || call.status === "running" || void 0,
345
+ className: cn5("gridui-tool-call-details gridui-u-task--min-w-0", className)
346
+ }
347
+ );
348
+ };
228
349
  export {
229
350
  ApprovalPanel,
230
- TaskTimeline
351
+ TaskTimeline,
352
+ ToolCall,
353
+ ToolCallDetails,
354
+ ToolCallSummary
231
355
  };
232
356
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../src/shared/style.ts", "../src/approval-panel/style.ts", "../src/approval-panel/approval-panel.tsx", "../src/task-timeline/style.ts", "../src/task-timeline/task-timeline.tsx"],
4
- "sourcesContent": ["/**\n * @author WMXPY\n * @package Task\n * @namespace Shared\n * @description Style\n */\n\nimport { cva } from \"class-variance-authority\";\n\nexport const taskHeadingStyles = cva(\"gridui-u-task--flex gridui-u-task--min-w-0 gridui-u-task--flex-wrap gridui-u-task--items-baseline gridui-u-task--justify-between gridui-u-task--gap-gridui-8 gridui-u-task--wrap-anywhere\");\n\nexport const taskMetaStyles = cva(\"gridui-u-task--text-muted gridui-u-task--type-caption\");\n", "/**\n * @author WMXPY\n * @package Task\n * @namespace ApprovalPanel\n * @description Style\n */\n\nimport { cva } from \"class-variance-authority\";\n\nexport const taskActionsStyles = cva(\"gridui-u-task--mt-gridui-16 gridui-u-task--flex gridui-u-task--flex-wrap gridui-u-task--justify-end gridui-u-task--gap-gridui-8\");\n\nexport const approvalStyles = cva(\"gridui-u-task--min-w-0 gridui-u-task--border gridui-u-task--border-border gridui-u-task--bg-background gridui-u-task--p-gridui-16 gridui-u-task--text-foreground gridui-u-task--wrap-anywhere\");\n", "/**\n * @author WMXPY\n * @package Task\n * @namespace ApprovalPanel\n * @description Approval Panel\n */\n\nimport { taskHeadingStyles, taskMetaStyles } from \"../shared/style\";\nimport { approvalStyles, taskActionsStyles } from \"./style\";\nimport { Button } from \"@gridui/button\";\nimport { Disclosure } from \"@gridui/disclosure\";\nimport { cn } from \"@gridui/style-utils\";\nimport { type ComponentPropsWithRef, type FC, type ReactNode, useId, useLayoutEffect, useRef } from \"react\";\n\nexport type ApprovalPanelProps = Omit<ComponentPropsWithRef<\"section\">, \"title\"> & {\n readonly title: string;\n readonly description?: ReactNode;\n readonly status: \"pending\" | \"submitting\" | \"approved\" | \"denied\" | \"failed\" | \"blocked\";\n readonly statusLabel: string;\n readonly approveLabel: string;\n readonly denyLabel: string;\n readonly recordLabel: string;\n readonly onDecision: (decision: \"approve\" | \"deny\") => void;\n readonly disabled?: boolean;\n readonly error?: ReactNode;\n};\n\nexport const ApprovalPanel: FC<ApprovalPanelProps> = (props: ApprovalPanelProps) => {\n const {\n title,\n description,\n status,\n statusLabel,\n approveLabel,\n denyLabel,\n recordLabel,\n onDecision,\n disabled = false,\n error,\n children,\n className,\n ...restProps\n } = props;\n const id = useId();\n const record = useRef<HTMLElement>(null);\n const requested = useRef(false);\n const settled = status === \"approved\" || status === \"denied\" || status === \"blocked\";\n useLayoutEffect(() => {\n if (settled && requested.current) {\n record.current?.focus();\n requested.current = false;\n }\n }, [settled]);\n const decide = (decision: \"approve\" | \"deny\") => {\n if (!disabled && (status === \"pending\" || status === \"failed\")) {\n requested.current = true;\n onDecision(decision);\n }\n };\n return (<section\n {...restProps}\n aria-labelledby={id}\n className={cn(approvalStyles(), className)}\n data-state={status}\n >\n <div\n className={taskHeadingStyles()}\n >\n <strong\n id={id}\n >\n {title}\n </strong>\n <span\n role=\"status\"\n className={taskMetaStyles()}\n >\n {statusLabel}\n </span>\n </div>\n {settled ? (<Disclosure\n label={recordLabel}\n style={{\n font: \"inherit\",\n letterSpacing: \"inherit\",\n }}\n summaryPaddingBlock={8}\n summaryPaddingInline={0}\n contentPadding={0}\n summaryClassName={cn(\"gridui-u-task--text-inherit\")}\n summaryProps={{ ref: record }}\n >\n {description}\n {children}\n </Disclosure>) : (<div>\n {description}\n {children}\n {error && (<div\n role=\"alert\"\n >\n {error}\n </div>)}\n <div\n className={taskActionsStyles()}\n >\n <Button\n variant=\"secondary\"\n disabled={disabled || status === \"submitting\"}\n onClick={() => {\n decide(\"deny\");\n }}\n >\n {denyLabel}\n </Button>\n <Button\n disabled={disabled || status === \"submitting\"}\n loading={status === \"submitting\"}\n onClick={() => {\n decide(\"approve\");\n }}\n >\n {approveLabel}\n </Button>\n </div>\n </div>)}\n </section>);\n};\n", "/**\n * @author WMXPY\n * @package Task\n * @namespace TaskTimeline\n * @description Style\n */\n\nimport { cva } from \"class-variance-authority\";\n\nexport const taskListStyles = cva(\"gridui-u-task--m-0 gridui-u-task--list-decimal gridui-u-task--ps-gridui-32\");\n\nexport const taskItemStyles = cva(\"gridui-u-task--min-w-0 gridui-u-task--border-b gridui-u-task--border-border gridui-u-task--py-gridui-16 gridui-u-task--pe-gridui-16 gridui-u-task--wrap-anywhere\");\n\nexport const taskDetailsStyles = cva(\"gridui-u-task--my-gridui-8\");\n", "/**\n * @author WMXPY\n * @package Task\n * @namespace TaskTimeline\n * @description Task Timeline\n */\n\nimport { taskHeadingStyles, taskMetaStyles } from \"../shared/style\";\nimport { taskDetailsStyles, taskItemStyles, taskListStyles } from \"./style\";\nimport { Button } from \"@gridui/button\";\nimport { Disclosure } from \"@gridui/disclosure\";\nimport { cn } from \"@gridui/style-utils\";\nimport type { ComponentPropsWithRef, FC, ReactNode } from \"react\";\n\nexport type TaskStep = {\n readonly id: string;\n readonly title: string;\n readonly status: \"pending\" | \"running\" | \"completed\" | \"failed\" | \"cancelled\" | \"waiting\";\n readonly statusLabel: string;\n readonly description?: ReactNode;\n readonly durationLabel?: string;\n readonly details?: ReactNode;\n readonly detailsLabel?: string;\n readonly action?: {\n readonly label: string;\n readonly onAction: () => void;\n readonly disabled?: boolean;\n };\n};\n\nexport type TaskTimelineProps = Omit<ComponentPropsWithRef<\"ol\">, \"children\"> & {\n readonly steps: readonly TaskStep[];\n readonly label: string;\n readonly disabled?: boolean;\n};\n\nexport const TaskTimeline: FC<TaskTimelineProps> = (props: TaskTimelineProps) => {\n const { steps, label, disabled = false, className, ...restProps } = props;\n return (<ol\n {...restProps}\n aria-label={label}\n className={cn(taskListStyles(), className)}\n >\n {steps.map(step => {\n return (<li\n key={step.id}\n className={taskItemStyles()}\n data-state={step.status}\n aria-current={step.status === \"running\" || step.status === \"waiting\" ? \"step\" : undefined}\n >\n <div\n className={taskHeadingStyles()}\n >\n <strong>\n {step.title}\n </strong>\n <span\n className={cn(taskMetaStyles(), step.status === \"failed\" && \"gridui-u-task--text-danger-foreground\")}\n >\n {step.statusLabel}\n </span>\n </div>\n {step.description}\n {step.durationLabel && (<span\n className={taskMetaStyles()}\n >\n {step.durationLabel}\n </span>)}\n {step.details !== undefined && (<Disclosure\n className={taskDetailsStyles()}\n label={step.detailsLabel ?? step.title}\n style={{\n font: \"inherit\",\n letterSpacing: \"inherit\",\n }}\n summaryPaddingBlock={8}\n summaryPaddingInline={0}\n contentPadding={0}\n summaryClassName={cn(\"gridui-u-task--min-h-0 gridui-u-task--text-inherit\")}\n >\n {step.details}\n </Disclosure>)}\n {step.action && (<Button\n variant=\"secondary\"\n disabled={disabled || step.action.disabled || step.status === \"running\"}\n onClick={step.action.onAction}\n >\n {step.action.label}\n </Button>)}\n </li>);\n })}\n </ol>);\n};\n"],
5
- "mappings": ";AAOA,SAAS,WAAW;AAEb,IAAM,oBAAoB,IAAI,2LAA2L;AAEzN,IAAM,iBAAiB,IAAI,uDAAuD;;;ACJzF,SAAS,OAAAA,YAAW;AAEb,IAAM,oBAAoBA,KAAI,iIAAiI;AAE/J,IAAM,iBAAiBA,KAAI,+LAA+L;;;ACFjO,SAAS,cAAc;AACvB,SAAS,kBAAkB;AAC3B,SAAS,UAAU;AACnB,SAA8D,OAAO,iBAAiB,cAAc;AA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osure", "cn", "jsx", "jsxs"]
3
+ "sources": ["../src/shared/style.ts", "../src/approval-panel/style.ts", "../src/approval-panel/approval-panel.tsx", "../src/task-timeline/style.ts", "../src/task-timeline/task-timeline.tsx", "../src/shared/tool-call-context.ts", "../src/tool-call/tool-call.tsx", "../src/tool-call-summary/tool-call-summary.tsx", "../src/tool-call-details/tool-call-details.tsx"],
4
+ "sourcesContent": ["/**\n * @author WMXPY\n * @package Task\n * @namespace Shared\n * @description Style\n */\n\nimport { cva } from \"class-variance-authority\";\n\nexport const taskHeadingStyles = cva(\"gridui-u-task--flex gridui-u-task--min-w-0 gridui-u-task--flex-wrap gridui-u-task--items-baseline gridui-u-task--justify-between gridui-u-task--gap-gridui-8 gridui-u-task--wrap-anywhere\");\n\nexport const taskMetaStyles = cva(\"gridui-u-task--text-muted gridui-u-task--type-caption\");\n", "/**\n * @author WMXPY\n * @package Task\n * @namespace ApprovalPanel\n * @description Style\n */\n\nimport { cva } from \"class-variance-authority\";\n\nexport const taskActionsStyles = cva(\"gridui-u-task--mt-gridui-16 gridui-u-task--flex gridui-u-task--flex-wrap gridui-u-task--justify-end gridui-u-task--gap-gridui-8\");\n\nexport const approvalStyles = cva(\"gridui-u-task--min-w-0 gridui-u-task--border gridui-u-task--border-border gridui-u-task--bg-background gridui-u-task--p-gridui-16 gridui-u-task--text-foreground gridui-u-task--wrap-anywhere\");\n", "/**\n * @author WMXPY\n * @package Task\n * @namespace ApprovalPanel\n * @description Approval Panel\n */\n\nimport { taskHeadingStyles, taskMetaStyles } from \"../shared/style\";\nimport { approvalStyles, taskActionsStyles } from \"./style\";\nimport { Button } from \"@gridui/button\";\nimport { Disclosure } from \"@gridui/disclosure\";\nimport { cn } from \"@gridui/style-utils\";\nimport { type ComponentPropsWithRef, type FC, type ReactNode, useId, useLayoutEffect, useRef } from \"react\";\n\nexport type ApprovalPanelProps = Omit<ComponentPropsWithRef<\"section\">, \"title\"> & {\n readonly title: string;\n readonly description?: ReactNode;\n readonly status: \"pending\" | \"submitting\" | \"approved\" | \"denied\" | \"failed\" | \"blocked\";\n readonly statusLabel: string;\n readonly approveLabel: string;\n readonly denyLabel: string;\n readonly recordLabel: string;\n readonly onDecision: (decision: \"approve\" | \"deny\") => void;\n readonly disabled?: boolean;\n readonly error?: ReactNode;\n};\n\nexport const ApprovalPanel: FC<ApprovalPanelProps> = (props: ApprovalPanelProps) => {\n const {\n title,\n description,\n status,\n statusLabel,\n approveLabel,\n denyLabel,\n recordLabel,\n onDecision,\n disabled = false,\n error,\n children,\n className,\n ...restProps\n } = props;\n const id = useId();\n const record = useRef<HTMLElement>(null);\n const requested = useRef(false);\n const settled = status === \"approved\" || status === \"denied\" || status === \"blocked\";\n useLayoutEffect(() => {\n if (settled && requested.current) {\n record.current?.focus();\n requested.current = false;\n }\n }, [settled]);\n const decide = (decision: \"approve\" | \"deny\") => {\n if (!disabled && (status === \"pending\" || status === \"failed\")) {\n requested.current = true;\n onDecision(decision);\n }\n };\n return (<section\n {...restProps}\n aria-labelledby={id}\n className={cn(approvalStyles(), className)}\n data-state={status}\n >\n <div\n className={taskHeadingStyles()}\n >\n <strong\n id={id}\n >\n {title}\n </strong>\n <span\n role=\"status\"\n className={taskMetaStyles()}\n >\n {statusLabel}\n </span>\n </div>\n {settled ? (<Disclosure\n label={recordLabel}\n style={{\n font: \"inherit\",\n letterSpacing: \"inherit\",\n }}\n summaryPaddingBlock={8}\n summaryPaddingInline={0}\n contentPadding={0}\n summaryClassName={cn(\"gridui-u-task--text-inherit\")}\n summaryProps={{ ref: record }}\n >\n {description}\n {children}\n </Disclosure>) : (<div>\n {description}\n {children}\n {error && (<div\n role=\"alert\"\n >\n {error}\n </div>)}\n <div\n className={taskActionsStyles()}\n >\n <Button\n variant=\"secondary\"\n disabled={disabled || status === \"submitting\"}\n onClick={() => {\n decide(\"deny\");\n }}\n >\n {denyLabel}\n </Button>\n <Button\n disabled={disabled || status === \"submitting\"}\n loading={status === \"submitting\"}\n onClick={() => {\n decide(\"approve\");\n }}\n >\n {approveLabel}\n </Button>\n </div>\n </div>)}\n </section>);\n};\n", "/**\n * @author WMXPY\n * @package Task\n * @namespace TaskTimeline\n * @description Style\n */\n\nimport { taskMetaStyles } from \"../shared/style\";\nimport { cva } from \"class-variance-authority\";\n\nexport const taskListStyles = cva(\"gridui-u-task--m-0 gridui-u-task--list-decimal gridui-u-task--ps-gridui-32\");\n\nexport const taskItemStyles = cva(\"gridui-u-task--min-w-0 gridui-u-task--border-b gridui-u-task--border-border gridui-u-task--py-gridui-16 gridui-u-task--pe-gridui-16 gridui-u-task--wrap-anywhere\");\n\nexport const taskDetailsStyles = cva(\"gridui-u-task--my-gridui-8\");\n\nexport const taskStatusStyles = cva(taskMetaStyles(), {\n variants: {\n failed: {\n true: \"gridui-u-task--text-status-danger-text\",\n },\n },\n});\n", "/**\n * @author WMXPY\n * @package Task\n * @namespace TaskTimeline\n * @description Task Timeline\n */\n\nimport { taskHeadingStyles, taskMetaStyles } from \"../shared/style\";\nimport { taskDetailsStyles, taskItemStyles, taskListStyles, taskStatusStyles } from \"./style\";\nimport { Button } from \"@gridui/button\";\nimport { Disclosure } from \"@gridui/disclosure\";\nimport { cn } from \"@gridui/style-utils\";\nimport type { ComponentPropsWithRef, FC, ReactNode } from \"react\";\n\nexport type TaskStep = {\n readonly id: string;\n readonly title: string;\n readonly status: \"pending\" | \"running\" | \"completed\" | \"failed\" | \"cancelled\" | \"waiting\";\n readonly statusLabel: string;\n readonly description?: ReactNode;\n readonly durationLabel?: string;\n readonly details?: ReactNode;\n readonly detailsLabel?: string;\n readonly action?: {\n readonly label: string;\n readonly onAction: () => void;\n readonly disabled?: boolean;\n };\n};\n\nexport type TaskTimelineProps = Omit<ComponentPropsWithRef<\"ol\">, \"children\"> & {\n readonly steps: readonly TaskStep[];\n readonly label: string;\n readonly disabled?: boolean;\n};\n\nexport const TaskTimeline: FC<TaskTimelineProps> = (props: TaskTimelineProps) => {\n const { steps, label, disabled = false, className, ...restProps } = props;\n return (<ol\n {...restProps}\n aria-label={label}\n className={cn(taskListStyles(), className)}\n >\n {steps.map(step => {\n return (<li\n key={step.id}\n className={taskItemStyles()}\n data-state={step.status}\n aria-current={step.status === \"running\" || step.status === \"waiting\" ? \"step\" : undefined}\n >\n <div\n className={taskHeadingStyles()}\n >\n <strong>\n {step.title}\n </strong>\n <span\n className={cn(taskStatusStyles({ failed: step.status === \"failed\" }))}\n >\n {step.statusLabel}\n </span>\n </div>\n {step.description}\n {step.durationLabel && (<span\n className={taskMetaStyles()}\n >\n {step.durationLabel}\n </span>)}\n {step.details !== undefined && (<Disclosure\n className={taskDetailsStyles()}\n label={step.detailsLabel ?? step.title}\n style={{\n font: \"inherit\",\n letterSpacing: \"inherit\",\n }}\n summaryPaddingBlock={8}\n summaryPaddingInline={0}\n contentPadding={0}\n summaryClassName={cn(\"gridui-u-task--min-h-0 gridui-u-task--text-inherit\")}\n >\n {step.details}\n </Disclosure>)}\n {step.action && (<Button\n variant=\"secondary\"\n disabled={disabled || step.action.disabled || step.status === \"running\"}\n onClick={step.action.onAction}\n >\n {step.action.label}\n </Button>)}\n </li>);\n })}\n </ol>);\n};\n", "import { createContext, type ReactNode, useContext } from \"react\";\n\nexport type ToolCallStatus = \"pending\" | \"input-streaming\" | \"waiting\" | \"running\" | \"completed\" | \"failed\" | \"cancelled\";\n\nexport type ToolCallContext = {\n readonly title: string;\n readonly status: ToolCallStatus;\n readonly statusLabel: string;\n readonly description: ReactNode;\n readonly durationLabel: string | undefined;\n readonly open: boolean;\n readonly setOpen: (open: boolean) => void;\n readonly summaryId: string;\n readonly detailsId: string;\n};\n\nexport const toolCallContext = createContext<ToolCallContext | null>(null);\n\nexport const useToolCall = (): ToolCallContext => {\n const context = useContext(toolCallContext);\n if (!context) {\n throw new Error(\"ToolCall parts require a ToolCall.\");\n }\n return context;\n};\n", "import { toolCallContext, type ToolCallStatus } from \"../shared/tool-call-context\";\nimport { cn } from \"@gridui/style-utils\";\nimport { type ComponentPropsWithRef, type FC, type ReactNode, useId, useLayoutEffect, useState } from \"react\";\n\nexport type ToolCallProps = Omit<ComponentPropsWithRef<\"div\">, \"title\" | \"children\"> & {\n readonly title: string;\n readonly status: ToolCallStatus;\n readonly statusLabel: string;\n readonly description?: ReactNode;\n readonly durationLabel?: string;\n readonly open?: boolean;\n readonly defaultOpen?: boolean;\n readonly onOpenChange?: (open: boolean) => void;\n readonly children: ReactNode;\n};\n\nexport const ToolCall: FC<ToolCallProps> = (props: ToolCallProps) => {\n const { title, status, statusLabel, description, durationLabel, open: controlledOpen,\n defaultOpen = false, onOpenChange, children, className, ...restProps } = props;\n const id = useId();\n const summaryId = `${id}-summary`;\n const detailsId = `${id}-details`;\n const [uncontrolledOpen, setUncontrolledOpen] = useState(defaultOpen);\n const open = controlledOpen ?? uncontrolledOpen;\n const setOpen = (nextOpen: boolean) => {\n if (controlledOpen === undefined) {\n setUncontrolledOpen(nextOpen);\n }\n onOpenChange?.(nextOpen);\n };\n\n useLayoutEffect(() => {\n // A host can collapse the panel while focus is still in retained content.\n if (!open && document.getElementById(detailsId)?.contains(document.activeElement)) {\n document.getElementById(summaryId)?.focus();\n }\n }, [open, detailsId, summaryId]);\n\n return (<toolCallContext.Provider value={{ title, status, statusLabel, description,\n durationLabel, open, setOpen, summaryId, detailsId }}>\n <div {...restProps} data-state={status} className={cn(\"gridui-u-task--min-w-0 gridui-u-task--type-body gridui-u-task--wrap-anywhere\", className)}>\n {children}\n </div>\n </toolCallContext.Provider>);\n};\n", "import { taskHeadingStyles, taskMetaStyles } from \"../shared/style\";\nimport { useToolCall } from \"../shared/tool-call-context\";\nimport { cn } from \"@gridui/style-utils\";\nimport type { ComponentPropsWithRef, FC, ReactNode } from \"react\";\n\nexport type ToolCallSummaryProps = Omit<ComponentPropsWithRef<\"div\">, \"children\"> & {\n /** Use a static title when details are always visible. */\n readonly collapsible?: boolean;\n /** Actions stay outside the disclosure button. The host owns their availability. */\n readonly actions?: ReactNode;\n};\n\nexport const ToolCallSummary: FC<ToolCallSummaryProps> = (props: ToolCallSummaryProps) => {\n const { collapsible = true, actions, className, ...restProps } = props;\n const call = useToolCall();\n return (<div {...restProps} className={cn(\"gridui-u-task--flex gridui-u-task--min-w-0 gridui-u-task--flex-col gridui-u-task--gap-gridui-8\", className)}>\n <div className={taskHeadingStyles()}>\n {collapsible ? (<button\n type=\"button\"\n id={call.summaryId}\n className={cn(\"gridui-tool-call-trigger gridui-u-task--flex gridui-u-task--min-h-11 gridui-u-task--min-w-0 gridui-u-task--items-center gridui-u-task--gap-gridui-8 gridui-u-task--border-0 gridui-u-task--bg-transparent gridui-u-task--p-0 gridui-u-task--text-start gridui-u-task--text-foreground gridui-u-task--wrap-anywhere gridui-u-task--cursor-pointer\")}\n aria-expanded={call.open}\n aria-controls={call.detailsId}\n onClick={() => { call.setOpen(!call.open); }}\n >\n <span className={cn(\"gridui-tool-call-chevron\")} aria-hidden=\"true\" />\n <strong className={cn(\"gridui-u-task--font-medium\")}>{call.title}</strong>\n </button>) : (<strong id={call.summaryId} className={cn(\"gridui-u-task--font-medium\")}>{call.title}</strong>)}\n <span role=\"status\" className={cn(taskMetaStyles(), call.status === \"failed\" && \"gridui-u-task--text-status-danger-text\")}>\n {call.statusLabel}\n </span>\n </div>\n {(call.description !== undefined || call.durationLabel !== undefined || actions !== undefined) && (\n <div className={taskHeadingStyles()}>\n <div className={cn(\"gridui-u-task--flex gridui-u-task--min-w-0 gridui-u-task--flex-wrap gridui-u-task--items-baseline gridui-u-task--gap-gridui-8\")}>\n {call.description}\n {call.durationLabel !== undefined && (<span className={taskMetaStyles()}>{call.durationLabel}</span>)}\n </div>\n {actions}\n </div>\n )}\n </div>);\n};\n", "import { useToolCall } from \"../shared/tool-call-context\";\nimport { cn } from \"@gridui/style-utils\";\nimport type { ComponentPropsWithRef, FC } from \"react\";\n\nexport type ToolCallDetailsProps = Omit<ComponentPropsWithRef<\"div\">, \"id\" | \"hidden\" | \"aria-labelledby\" | \"aria-busy\">;\n\nexport const ToolCallDetails: FC<ToolCallDetailsProps> = (props: ToolCallDetailsProps) => {\n const { className, ...restProps } = props;\n const call = useToolCall();\n return (<div\n {...restProps}\n id={call.detailsId}\n hidden={!call.open}\n aria-labelledby={call.summaryId}\n aria-busy={call.status === \"input-streaming\" || call.status === \"running\" || undefined}\n className={cn(\"gridui-tool-call-details gridui-u-task--min-w-0\", className)}\n />);\n};\n"],
5
+ "mappings": ";AAOA,SAAS,WAAW;AAEb,IAAM,oBAAoB,IAAI,2LAA2L;AAEzN,IAAM,iBAAiB,IAAI,uDAAuD;;;ACJzF,SAAS,OAAAA,YAAW;AAEb,IAAM,oBAAoBA,KAAI,iIAAiI;AAE/J,IAAM,iBAAiBA,KAAI,+LAA+L;;;ACFjO,SAAS,cAAc;AACvB,SAAS,kBAAkB;AAC3B,SAAS,UAAU;AACnB,SAA8D,OAAO,iBAAiB,cAAc;AAqD5F,SAGI,KAHJ;AAtCD,IAAM,gBAAwC,CAAC,UAA8B;AAChF,QAAM;AAAA,IACF;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,WAAW;AAAA,IACX;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EACP,IAAI;AACJ,QAAM,KAAK,MAAM;AACjB,QAAM,SAAS,OAAoB,IAAI;AACvC,QAAM,YAAY,OAAO,KAAK;AAC9B,QAAM,UAAU,WAAW,cAAc,WAAW,YAAY,WAAW;AAC3E,kBAAgB,MAAM;AAClB,QAAI,WAAW,UAAU,SAAS;AAC9B,aAAO,SAAS,MAAM;AACtB,gBAAU,UAAU;AAAA,IACxB;AAAA,EACJ,GAAG,CAAC,OAAO,CAAC;AACZ,QAAM,SAAS,CAAC,aAAiC;AAC7C,QAAI,CAAC,aAAa,WAAW,aAAa,WAAW,WAAW;AAC5D,gBAAU,UAAU;AACpB,iBAAW,QAAQ;AAAA,IACvB;AAAA,EACJ;AACA,SAAQ;AAAA,IAAC;AAAA;AAA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jsxs", "cn", "jsx"]
7
7
  }
@@ -0,0 +1,15 @@
1
+ import { type ReactNode } from "react";
2
+ export type ToolCallStatus = "pending" | "input-streaming" | "waiting" | "running" | "completed" | "failed" | "cancelled";
3
+ export type ToolCallContext = {
4
+ readonly title: string;
5
+ readonly status: ToolCallStatus;
6
+ readonly statusLabel: string;
7
+ readonly description: ReactNode;
8
+ readonly durationLabel: string | undefined;
9
+ readonly open: boolean;
10
+ readonly setOpen: (open: boolean) => void;
11
+ readonly summaryId: string;
12
+ readonly detailsId: string;
13
+ };
14
+ export declare const toolCallContext: import("react").Context<ToolCallContext | null>;
15
+ export declare const useToolCall: () => ToolCallContext;
package/dist/styles.css CHANGED
@@ -1,6 +1,12 @@
1
1
  /*! tailwindcss v4.3.5 | MIT License | https://tailwindcss.com */
2
2
  @layer properties;
3
3
  @layer theme, base, components, utilities;
4
+ @layer theme {
5
+ :root, :host {
6
+ --spacing: 0.25rem;
7
+ --font-weight-medium: 500;
8
+ }
9
+ }
4
10
  @layer utilities {
5
11
  .gridui-u-task--m-0 {
6
12
  margin: 0px;
@@ -17,18 +23,30 @@
17
23
  .gridui-u-task--min-h-0 {
18
24
  min-height: 0px;
19
25
  }
26
+ .gridui-u-task--min-h-11 {
27
+ min-height: calc(var(--spacing) * 11);
28
+ }
20
29
  .gridui-u-task--min-w-0 {
21
30
  min-width: 0px;
22
31
  }
32
+ .gridui-u-task--cursor-pointer {
33
+ cursor: pointer;
34
+ }
23
35
  .gridui-u-task--list-decimal {
24
36
  list-style-type: decimal;
25
37
  }
38
+ .gridui-u-task--flex-col {
39
+ flex-direction: column;
40
+ }
26
41
  .gridui-u-task--flex-wrap {
27
42
  flex-wrap: wrap;
28
43
  }
29
44
  .gridui-u-task--items-baseline {
30
45
  align-items: baseline;
31
46
  }
47
+ .gridui-u-task--items-center {
48
+ align-items: center;
49
+ }
32
50
  .gridui-u-task--justify-between {
33
51
  justify-content: space-between;
34
52
  }
@@ -42,6 +60,10 @@
42
60
  border-style: var(--tw-border-style);
43
61
  border-width: 1px;
44
62
  }
63
+ .gridui-u-task--border-0 {
64
+ border-style: var(--tw-border-style);
65
+ border-width: 0px;
66
+ }
45
67
  .gridui-u-task--border-b {
46
68
  border-bottom-style: var(--tw-border-style);
47
69
  border-bottom-width: 1px;
@@ -52,6 +74,12 @@
52
74
  .gridui-u-task--bg-background {
53
75
  background-color: var(--gridui-background);
54
76
  }
77
+ .gridui-u-task--bg-transparent {
78
+ background-color: transparent;
79
+ }
80
+ .gridui-u-task--p-0 {
81
+ padding: 0px;
82
+ }
55
83
  .gridui-u-task--p-gridui-16 {
56
84
  padding: var(--gridui-space-16);
57
85
  }
@@ -64,16 +92,26 @@
64
92
  .gridui-u-task--pe-gridui-16 {
65
93
  padding-inline-end: var(--gridui-space-16);
66
94
  }
95
+ .gridui-u-task--text-start {
96
+ text-align: start;
97
+ }
98
+ .gridui-u-task--type-body {
99
+ font: var(--gridui-type-body);
100
+ font-family: var(--gridui-font-body);
101
+ letter-spacing: normal;
102
+ }
67
103
  .gridui-u-task--type-caption {
68
104
  font: var(--gridui-type-caption);
105
+ font-family: var(--gridui-font-body);
69
106
  letter-spacing: normal;
70
107
  }
108
+ .gridui-u-task--font-medium {
109
+ --tw-font-weight: var(--font-weight-medium);
110
+ font-weight: var(--font-weight-medium);
111
+ }
71
112
  .gridui-u-task--wrap-anywhere {
72
113
  overflow-wrap: anywhere;
73
114
  }
74
- .gridui-u-task--text-danger-foreground {
75
- color: var(--gridui-danger-foreground);
76
- }
77
115
  .gridui-u-task--text-foreground {
78
116
  color: var(--gridui-foreground);
79
117
  }
@@ -83,16 +121,46 @@
83
121
  .gridui-u-task--text-muted {
84
122
  color: var(--gridui-muted);
85
123
  }
124
+ .gridui-u-task--text-status-danger-text {
125
+ color: var(--gridui-status-danger-text);
126
+ }
127
+ }
128
+ @layer components {
129
+ .gridui-tool-call-trigger {
130
+ font: inherit;
131
+ }
132
+ .gridui-tool-call-chevron {
133
+ inline-size: 0.375rem;
134
+ block-size: 0.375rem;
135
+ flex: none;
136
+ border-block-start: 1px solid currentColor;
137
+ border-inline-end: 1px solid currentColor;
138
+ rotate: 45deg;
139
+ }
140
+ .gridui-tool-call-trigger:dir(rtl) .gridui-tool-call-chevron {
141
+ rotate: -135deg;
142
+ }
143
+ .gridui-tool-call-trigger[aria-expanded="true"] .gridui-tool-call-chevron {
144
+ rotate: 135deg;
145
+ }
146
+ .gridui-tool-call-details[hidden] {
147
+ display: none !important;
148
+ }
86
149
  }
87
150
  @property --tw-border-style {
88
151
  syntax: "*";
89
152
  inherits: false;
90
153
  initial-value: solid;
91
154
  }
155
+ @property --tw-font-weight {
156
+ syntax: "*";
157
+ inherits: false;
158
+ }
92
159
  @layer properties {
93
160
  @supports ((-webkit-hyphens: none) and (not (margin-trim: block))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))) {
94
161
  *, ::before, ::after, ::backdrop {
95
162
  --tw-border-style: solid;
163
+ --tw-font-weight: initial;
96
164
  }
97
165
  }
98
166
  }
@@ -7,3 +7,6 @@
7
7
  export declare const taskListStyles: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
8
8
  export declare const taskItemStyles: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
9
9
  export declare const taskDetailsStyles: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
10
+ export declare const taskStatusStyles: (props?: ({
11
+ failed?: boolean | null | undefined;
12
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
@@ -0,0 +1,14 @@
1
+ import { type ToolCallStatus } from "../shared/tool-call-context";
2
+ import { type ComponentPropsWithRef, type FC, type ReactNode } from "react";
3
+ export type ToolCallProps = Omit<ComponentPropsWithRef<"div">, "title" | "children"> & {
4
+ readonly title: string;
5
+ readonly status: ToolCallStatus;
6
+ readonly statusLabel: string;
7
+ readonly description?: ReactNode;
8
+ readonly durationLabel?: string;
9
+ readonly open?: boolean;
10
+ readonly defaultOpen?: boolean;
11
+ readonly onOpenChange?: (open: boolean) => void;
12
+ readonly children: ReactNode;
13
+ };
14
+ export declare const ToolCall: FC<ToolCallProps>;
@@ -0,0 +1,3 @@
1
+ import type { ComponentPropsWithRef, FC } from "react";
2
+ export type ToolCallDetailsProps = Omit<ComponentPropsWithRef<"div">, "id" | "hidden" | "aria-labelledby" | "aria-busy">;
3
+ export declare const ToolCallDetails: FC<ToolCallDetailsProps>;
@@ -0,0 +1,8 @@
1
+ import type { ComponentPropsWithRef, FC, ReactNode } from "react";
2
+ export type ToolCallSummaryProps = Omit<ComponentPropsWithRef<"div">, "children"> & {
3
+ /** Use a static title when details are always visible. */
4
+ readonly collapsible?: boolean;
5
+ /** Actions stay outside the disclosure button. The host owns their availability. */
6
+ readonly actions?: ReactNode;
7
+ };
8
+ export declare const ToolCallSummary: FC<ToolCallSummaryProps>;
package/docs/catalog.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
3
  "name": "@gridui/task",
4
- "version": "1.0.10",
4
+ "version": "1.1.0",
5
5
  "category": "dashboard",
6
6
  "description": "GridUI React task",
7
7
  "usage": "TaskTimeline detail rows and settled ApprovalPanel records compose the public Disclosure. Load `@gridui/disclosure/styles.css` before Task styles. Native summary focus, keyboard interaction, and retained server-rendered context stay with Disclosure; Task owns decision state, callbacks, and dense spacing.",
@@ -9,7 +9,10 @@
9
9
  "README.md",
10
10
  "docs/reference/README.md",
11
11
  "docs/reference/approval-panel.md",
12
- "docs/reference/task-timeline.md"
12
+ "docs/reference/task-timeline.md",
13
+ "docs/reference/tool-call-details.md",
14
+ "docs/reference/tool-call-summary.md",
15
+ "docs/reference/tool-call.md"
13
16
  ],
14
17
  "exports": [
15
18
  {
@@ -36,6 +39,41 @@
36
39
  "name": "TaskTimelineProps",
37
40
  "kind": "type",
38
41
  "importPath": "@gridui/task"
42
+ },
43
+ {
44
+ "name": "ToolCall",
45
+ "kind": "component",
46
+ "importPath": "@gridui/task"
47
+ },
48
+ {
49
+ "name": "ToolCallDetails",
50
+ "kind": "component",
51
+ "importPath": "@gridui/task"
52
+ },
53
+ {
54
+ "name": "ToolCallDetailsProps",
55
+ "kind": "type",
56
+ "importPath": "@gridui/task"
57
+ },
58
+ {
59
+ "name": "ToolCallProps",
60
+ "kind": "type",
61
+ "importPath": "@gridui/task"
62
+ },
63
+ {
64
+ "name": "ToolCallStatus",
65
+ "kind": "type",
66
+ "importPath": "@gridui/task"
67
+ },
68
+ {
69
+ "name": "ToolCallSummary",
70
+ "kind": "component",
71
+ "importPath": "@gridui/task"
72
+ },
73
+ {
74
+ "name": "ToolCallSummaryProps",
75
+ "kind": "type",
76
+ "importPath": "@gridui/task"
39
77
  }
40
78
  ],
41
79
  "styles": [
@@ -48,7 +86,9 @@
48
86
  "https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-dashboard/task/stories/approvals.mdx",
49
87
  "https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-dashboard/task/stories/getting-started.mdx",
50
88
  "https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-dashboard/task/stories/timeline.mdx",
89
+ "https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-dashboard/task/stories/tool-calls.mdx",
51
90
  "https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-dashboard/task/stories/approval-panel.stories.tsx",
52
- "https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-dashboard/task/stories/task-timeline.stories.tsx"
91
+ "https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-dashboard/task/stories/task-timeline.stories.tsx",
92
+ "https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-dashboard/task/stories/tool-call.stories.tsx"
53
93
  ]
54
94
  }
@@ -3,3 +3,6 @@
3
3
 
4
4
  - [ApprovalPanel](approval-panel.md)
5
5
  - [TaskTimeline](task-timeline.md)
6
+ - [ToolCall](tool-call.md)
7
+ - [ToolCallDetails](tool-call-details.md)
8
+ - [ToolCallSummary](tool-call-summary.md)
@@ -0,0 +1,57 @@
1
+ <!-- Generated from public Props and owned stories. Run pnpm docs:storybook. -->
2
+ # ToolCallDetails
3
+
4
+ Compose ToolCallDetails with ToolCall inside the same @gridui/task component family.
5
+
6
+ Import from ``@gridui/task`` and load Theme before this family's stylesheet.
7
+
8
+ ```tsx
9
+ import { ToolCallDetails } from "@gridui/task";
10
+ import "@gridui/theme/styles.css";
11
+ import "@gridui/task/styles.css";
12
+ ```
13
+
14
+ Read the [package contract](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-dashboard/task/README.md) for shared behavior and stylesheet dependencies.
15
+
16
+ The [working composition](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-dashboard/task/stories/tool-call.stories.tsx) demonstrates required context, state, and related components. Use View code in Storybook to inspect the actual implementation.
17
+
18
+ ## API
19
+
20
+ The public Props type is the source of these signatures. Defaults below are explicit implementation defaults; story presets are separate. Native attributes remain available through the exported Props type.
21
+
22
+ ### children
23
+
24
+ ``ReactNode`` · Optional
25
+
26
+ Content rendered inside the component.
27
+
28
+ ### onFocus
29
+
30
+ ``(event: FocusEvent<HTMLDivElement, Element>): void`` · Optional
31
+
32
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
33
+
34
+ ### onBlur
35
+
36
+ ``(event: FocusEvent<HTMLDivElement, Element>): void`` · Optional
37
+
38
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
39
+
40
+ ### onChange
41
+
42
+ ``(event: ChangeEvent<HTMLDivElement, Element>): void`` · Optional
43
+
44
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
45
+
46
+ ### onSubmit
47
+
48
+ ``(event: SubmitEvent<HTMLDivElement>): void`` · Optional
49
+
50
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
51
+
52
+ ### onClick
53
+
54
+ ``(event: MouseEvent<HTMLDivElement, MouseEvent>): void`` · Optional
55
+
56
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
57
+
@@ -0,0 +1,65 @@
1
+ <!-- Generated from public Props and owned stories. Run pnpm docs:storybook. -->
2
+ # ToolCallSummary
3
+
4
+ Compose ToolCallSummary with ToolCall inside the same @gridui/task component family.
5
+
6
+ Import from ``@gridui/task`` and load Theme before this family's stylesheet.
7
+
8
+ ```tsx
9
+ import { ToolCallSummary } from "@gridui/task";
10
+ import "@gridui/theme/styles.css";
11
+ import "@gridui/task/styles.css";
12
+ ```
13
+
14
+ Read the [package contract](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-dashboard/task/README.md) for shared behavior and stylesheet dependencies.
15
+
16
+ The [working composition](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-dashboard/task/stories/tool-call.stories.tsx) demonstrates required context, state, and related components. Use View code in Storybook to inspect the actual implementation.
17
+
18
+ ## API
19
+
20
+ The public Props type is the source of these signatures. Defaults below are explicit implementation defaults; story presets are separate. Native attributes remain available through the exported Props type.
21
+
22
+ ### onFocus
23
+
24
+ ``(event: FocusEvent<HTMLDivElement, Element>): void`` · Optional
25
+
26
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
27
+
28
+ ### onBlur
29
+
30
+ ``(event: FocusEvent<HTMLDivElement, Element>): void`` · Optional
31
+
32
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
33
+
34
+ ### onChange
35
+
36
+ ``(event: ChangeEvent<HTMLDivElement, Element>): void`` · Optional
37
+
38
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
39
+
40
+ ### onSubmit
41
+
42
+ ``(event: SubmitEvent<HTMLDivElement>): void`` · Optional
43
+
44
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
45
+
46
+ ### onClick
47
+
48
+ ``(event: MouseEvent<HTMLDivElement, MouseEvent>): void`` · Optional
49
+
50
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
51
+
52
+ ### collapsible
53
+
54
+ ``boolean | undefined`` · Optional
55
+
56
+ Default: ``true``
57
+
58
+ Use a static title when details are always visible.
59
+
60
+ ### actions
61
+
62
+ ``ReactNode`` · Optional
63
+
64
+ Actions stay outside the disclosure button. The host owns their availability.
65
+
@@ -0,0 +1,97 @@
1
+ <!-- Generated from public Props and owned stories. Run pnpm docs:storybook. -->
2
+ # ToolCall
3
+
4
+ Presents one tool invocation with a localized status and retained details. Grid owns padding, seams, and placement; the application owns execution and recovery.
5
+
6
+ Import from ``@gridui/task`` and load Theme before this family's stylesheet.
7
+
8
+ ```tsx
9
+ import { ToolCall } from "@gridui/task";
10
+ import "@gridui/theme/styles.css";
11
+ import "@gridui/task/styles.css";
12
+ ```
13
+
14
+ Read the [package contract](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-dashboard/task/README.md) for shared behavior and stylesheet dependencies.
15
+
16
+ The [working composition](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/packages-dashboard/task/stories/tool-call.stories.tsx) demonstrates required context, state, and related components. Use View code in Storybook to inspect the actual implementation.
17
+
18
+ ## API
19
+
20
+ The public Props type is the source of these signatures. Defaults below are explicit implementation defaults; story presets are separate. Native attributes remain available through the exported Props type.
21
+
22
+ ### onFocus
23
+
24
+ ``(event: FocusEvent<HTMLDivElement, Element>): void`` · Optional
25
+
26
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
27
+
28
+ ### onBlur
29
+
30
+ ``(event: FocusEvent<HTMLDivElement, Element>): void`` · Optional
31
+
32
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
33
+
34
+ ### onChange
35
+
36
+ ``(event: ChangeEvent<HTMLDivElement, Element>): void`` · Optional
37
+
38
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
39
+
40
+ ### onSubmit
41
+
42
+ ``(event: SubmitEvent<HTMLDivElement>): void`` · Optional
43
+
44
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
45
+
46
+ ### onClick
47
+
48
+ ``(event: MouseEvent<HTMLDivElement, MouseEvent>): void`` · Optional
49
+
50
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
51
+
52
+ ### title
53
+
54
+ ``string`` · Required
55
+
56
+ ### status
57
+
58
+ ``ToolCallStatus`` · Required
59
+
60
+ ### statusLabel
61
+
62
+ ``string`` · Required
63
+
64
+ ### description
65
+
66
+ ``ReactNode`` · Optional
67
+
68
+ ### durationLabel
69
+
70
+ ``string | undefined`` · Optional
71
+
72
+ ### open
73
+
74
+ ``boolean | undefined`` · Optional
75
+
76
+ Controlled visibility. Pair with onOpenChange.
77
+
78
+ ### defaultOpen
79
+
80
+ ``boolean | undefined`` · Optional
81
+
82
+ Default: ``false``
83
+
84
+ Initial uncontrolled visibility. Reset the story after changing it.
85
+
86
+ ### onOpenChange
87
+
88
+ ``(open: boolean): void`` · Optional
89
+
90
+ Called when the corresponding interaction occurs; inspect the arguments in Actions.
91
+
92
+ ### children
93
+
94
+ ``ReactNode`` · Required
95
+
96
+ Content rendered inside the component.
97
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gridui/task",
3
- "version": "1.0.10",
3
+ "version": "1.1.0",
4
4
  "description": "GridUI React task",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",
@@ -27,17 +27,18 @@
27
27
  "react-dom": "^19.2.0"
28
28
  },
29
29
  "dependencies": {
30
- "@gridui/button": "^5.0.0",
31
- "@gridui/disclosure": "^2.0.0",
30
+ "@gridui/button": "^5.1.0",
31
+ "@gridui/disclosure": "^2.0.1",
32
32
  "@gridui/style-utils": "^4.0.0",
33
- "@gridui/theme": "^2.5.4",
33
+ "@gridui/theme": "^3.0.0",
34
34
  "class-variance-authority": "0.7.1"
35
35
  },
36
36
  "devDependencies": {
37
37
  "@gridui-internal/configuration": "0.0.0-internal",
38
- "@gridui/code-view": "1.0.7",
38
+ "@gridui/code-view": "1.0.8",
39
+ "@gridui/grid": "3.1.0",
39
40
  "@jest/globals": "30.5.2",
40
- "@storybook/react-vite": "10.6.6",
41
+ "@storybook/react-vite": "10.6.7",
41
42
  "@types/jest": "30.0.0",
42
43
  "@types/node": "26.6.6",
43
44
  "@types/react": "19.3.0",
@@ -50,7 +51,6 @@
50
51
  "scripts": {
51
52
  "build": "node ../../scripts/compilation/package.ts",
52
53
  "compile": "tsc --project tsconfig.json",
53
- "test": "jest",
54
- "coverage": "jest --coverage"
54
+ "test": "jest"
55
55
  }
56
56
  }