@gridui/task 1.0.11 → 1.2.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,18 +1,84 @@
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
- Load styles for any composed dependency used by this family. Applications own routes, labels, state persistence, and branding.
6
+ Applications own routes, labels, state persistence, and branding.
7
7
 
8
8
  See [component ownership](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/docs/component-ownership.md) and [release history](https://github.com/sudo-ui/GridUI-React-Monorepo/tree/main/packages-dashboard/task/.changeset/history).
9
9
 
10
10
  TaskTimeline detail rows and settled ApprovalPanel records compose the public
11
- Disclosure. Load `@gridui/disclosure/styles.css` before Task styles. Native
11
+ Disclosure. Disclosure styles are included in Task styles. Native
12
12
  summary focus, keyboard interaction, and retained server-rendered context stay
13
13
  with Disclosure; Task owns decision state, callbacks, and dense spacing.
14
14
 
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
+ ## Styles
19
+
20
+ Load Theme once. Use `@gridui/task/styled` for automatic component CSS in
21
+ CSS-aware bundlers, or keep the CSS-free root import and load `@gridui/task/styles.css`.
22
+ Both entries expose the same root API. The standalone stylesheet includes component
23
+ dependency styles; Theme/reset remain separate. See the
24
+ [integration guide](https://github.com/sudo-ui/GridUI-React-Monorepo/blob/main/docs/usage/integration.md)
25
+ for static HTML loading, SSR limits, and avoiding duplicate CSS.
26
+
27
+
28
+ ## Tool calls
29
+
30
+ Use `ToolCall` for one invocation and `TaskTimeline` for a sequence of tasks.
31
+ Supply a localized `title` and `statusLabel`, plus a `status`: `pending`,
32
+ `input-streaming`, `waiting`, `running`, `completed`, `failed`, or `cancelled`.
33
+ The execution states use the same names as TaskTimeline; `input-streaming`
34
+ distinguishes arguments that have not finished arriving. Optional `description`
35
+ and preformatted `durationLabel` appear in the summary.
36
+
37
+ ```tsx
38
+ import { ToolCall, ToolCallSummary, ToolCallDetails } from "@gridui/task";
39
+ import { Grid, GridItem } from "@gridui/grid";
40
+
41
+ <ToolCall title="Search documents" status="running" statusLabel="Searching">
42
+ <Grid columns={1} frame="all">
43
+ <GridItem padding={16}><ToolCallSummary /></GridItem>
44
+ <GridItem asChild padding={16}>
45
+ <ToolCallDetails>{output}</ToolCallDetails>
46
+ </GridItem>
47
+ </Grid>
48
+ </ToolCall>
49
+ ```
50
+
51
+ Load Theme, Grid, then Task styles for this composition. ToolCall itself does not
52
+ render Button or Disclosure; import their styles when rendering those components.
53
+
54
+ Include one summary and one details part per root. Details start closed; use
55
+ `defaultOpen` for an initial preference or `open`/`onOpenChange` for controlled
56
+ state. A controlled host may reject a change request. A host collapse returns
57
+ focus to the summary only when focus was inside the details. Collapsed details
58
+ stay mounted and leave the accessibility tree and layout. Invocation status
59
+ changes never reset expansion or content. Use a new React key for a new call.
60
+
61
+ ToolCall parts have no outer inset, background, or structural border. Grid owns
62
+ those regions, including empty space: use `GridItem asChild` around details,
63
+ not a permanently visible GridItem around a hidden panel. Use nested Grids for
64
+ input/output seams. A permanently expanded inspector uses `open` and
65
+ `ToolCallSummary collapsible={false}`. For output-first presentation, keep output
66
+ in a sibling GridItem and put only the arguments in ToolCallDetails.
67
+
68
+ `ToolCallSummary actions` accepts caller-owned controls outside the toggle.
69
+ Applications own availability, stop/retry callbacks, focus after removing actions,
70
+ and execution. Only `statusLabel` is announced through a polite status region;
71
+ keep token counts and elapsed time out of that label. Details are busy during
72
+ `input-streaming` and `running`; waiting for approval is not active execution.
73
+
74
+ Inputs and outputs are React content, not protocol objects. Render incomplete
75
+ arguments as escaped text; only render structured arguments when the application
76
+ has parsed a complete value. Markdown, logs, tables, and result controls can all
77
+ be children. Failure and cancellation retain whatever content the caller supplies;
78
+ the component does not cache removed snapshots, parse JSON, fetch, or run tools.
79
+
80
+ Keep ApprovalPanel outside collapsible details in its own Grid region. Its public
81
+ `style` prop can remove its standalone padding, border, and background when Grid
82
+ owns the frame. Approval and execution remain separate states.
83
+
18
84
  [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
@@ -149,7 +149,7 @@ var taskDetailsStyles = cva3("gridui-u-task--my-gridui-8");
149
149
  var taskStatusStyles = cva3(taskMetaStyles(), {
150
150
  variants: {
151
151
  failed: {
152
- true: "gridui-u-task--text-danger-foreground"
152
+ true: "gridui-u-task--text-status-danger-text"
153
153
  }
154
154
  }
155
155
  });
@@ -232,8 +232,125 @@ var TaskTimeline = (props) => {
232
232
  }
233
233
  );
234
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
+ };
235
349
  export {
236
350
  ApprovalPanel,
237
- TaskTimeline
351
+ TaskTimeline,
352
+ ToolCall,
353
+ ToolCallDetails,
354
+ ToolCallSummary
238
355
  };
239
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 { 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-danger-foreground\",\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"],
5
- "mappings": ";AAOA,SAAS,WAAW;AAEb,IAAM,oBAAoB,IAAI,2LAA2L;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BC,IAAG,oDAAoD;AAAA,kBAExE,eAAK;AAAA;AAAA,cACV;AAAA,cACC,KAAK,UAAW,gBAAAC;AAAA,gBAACH;AAAA,gBAAA;AAAA,kBACd,SAAQ;AAAA,kBACR,UAAU,YAAY,KAAK,OAAO,YAAY,KAAK,WAAW;AAAA,kBAC9D,SAAS,KAAK,OAAO;AAAA,kBAEpB,eAAK,OAAO;AAAA;AAAA,cACjB;AAAA;AAAA;AAAA,UA3CK,KAAK;AAAA,QA4Cd;AAAA,MACJ,CAAC;AAAA;AAAA,EACL;AACJ;",
6
- "names": ["cva", "cva", "Button", "Disclosure", "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", "/**\n * @author WMXPY\n * @package Task\n * @namespace Shared\n * @description Tool Call Context\n */\n\nimport { 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", "/**\n * @author WMXPY\n * @package Task\n * @namespace ToolCall\n * @description Tool Call\n */\n\nimport { 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", "/**\n * @author WMXPY\n * @package Task\n * @namespace ToolCallSummary\n * @description Tool Call Summary\n */\n\nimport { 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", "/**\n * @author WMXPY\n * @package Task\n * @namespace ToolCallDetails\n * @description Tool Call Details\n */\n\nimport { 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;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QACL,KAAK,kBAAkB,UAAc,gBAAAC,KAAC,UAAK,WAAW,eAAe,GAAI,eAAK,eAAc;AAAA,SACjG;AAAA,MACC;AAAA,OACL;AAAA,KAER;AACJ;;;ACzCA,SAAS,MAAAE,WAAU;AAQP,gBAAAC,YAAA;AAHL,IAAM,kBAA4C,CAAC,UAAgC;AACtF,QAAM,EAAE,WAAW,GAAG,UAAU,IAAI;AACpC,QAAM,OAAO,YAAY;AACzB,SAAQ,gBAAAA;AAAA,IAAC;AAAA;AAAA,MACJ,GAAG;AAAA,MACJ,IAAI,KAAK;AAAA,MACT,QAAQ,CAAC,KAAK;AAAA,MACd,mBAAiB,KAAK;AAAA,MACtB,aAAW,KAAK,WAAW,qBAAqB,KAAK,WAAW,aAAa;AAAA,MAC7E,WAAWD,IAAG,mDAAmD,SAAS;AAAA;AAAA,EAC9E;AACJ;",
6
+ "names": ["cva", "cva", "Button", "Disclosure", "cn", "jsx", "jsxs", "cn", "useId", "useLayoutEffect", "jsx", "cn", "jsx", "jsxs", "cn", "jsx"]
7
7
  }
@@ -0,0 +1,21 @@
1
+ /**
2
+ * @author WMXPY
3
+ * @package Task
4
+ * @namespace Shared
5
+ * @description Tool Call Context
6
+ */
7
+ import { type ReactNode } from "react";
8
+ export type ToolCallStatus = "pending" | "input-streaming" | "waiting" | "running" | "completed" | "failed" | "cancelled";
9
+ export type ToolCallContext = {
10
+ readonly title: string;
11
+ readonly status: ToolCallStatus;
12
+ readonly statusLabel: string;
13
+ readonly description: ReactNode;
14
+ readonly durationLabel: string | undefined;
15
+ readonly open: boolean;
16
+ readonly setOpen: (open: boolean) => void;
17
+ readonly summaryId: string;
18
+ readonly detailsId: string;
19
+ };
20
+ export declare const toolCallContext: import("react").Context<ToolCallContext | null>;
21
+ export declare const useToolCall: () => ToolCallContext;
package/dist/styled.js ADDED
@@ -0,0 +1,4 @@
1
+ import "@gridui/button/styled";
2
+ import "@gridui/disclosure/styled";
3
+ import "./styles.local.css";
4
+ export * from "./index.js";