orbital-ds 0.40.0 → 0.41.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.
Files changed (64) hide show
  1. package/AGENTS.md +1 -1
  2. package/components.manifest.json +221 -1
  3. package/dist/hooks/use-ds-messages.d.ts +82 -0
  4. package/dist/lib/a2ui-catalog.d.ts +42 -0
  5. package/dist/lib/a2ui-catalog.js +558 -0
  6. package/dist/lib/a2ui.d.ts +289 -0
  7. package/dist/lib/a2ui.js +215 -0
  8. package/dist/lib/ai-events.d.ts +15 -0
  9. package/dist/lib/ai-events.js +202 -0
  10. package/dist/lib/auth-flow.d.ts +3 -1
  11. package/dist/lib/auth-flow.js +24 -3
  12. package/dist/lib/i18n.d.ts +82 -0
  13. package/dist/lib/i18n.js +246 -0
  14. package/dist/styles.css +23 -1
  15. package/dist/ui/a2ui-renderer.d.ts +33 -0
  16. package/dist/ui/a2ui-renderer.js +793 -0
  17. package/dist/ui/agent-events.d.ts +32 -0
  18. package/dist/ui/agent-events.js +108 -0
  19. package/dist/ui/alert.d.ts +1 -1
  20. package/dist/ui/attachment.d.ts +2 -2
  21. package/dist/ui/auth-form.d.ts +3 -1
  22. package/dist/ui/auth-form.js +34 -6
  23. package/dist/ui/badge.d.ts +1 -1
  24. package/dist/ui/banner.d.ts +1 -1
  25. package/dist/ui/bubble.d.ts +1 -1
  26. package/dist/ui/button-group.d.ts +1 -1
  27. package/dist/ui/button.d.ts +2 -2
  28. package/dist/ui/chain-of-thought.d.ts +19 -0
  29. package/dist/ui/chain-of-thought.js +90 -0
  30. package/dist/ui/chat-composer.d.ts +39 -0
  31. package/dist/ui/chat-composer.js +192 -0
  32. package/dist/ui/conversation-list.d.ts +24 -0
  33. package/dist/ui/conversation-list.js +141 -0
  34. package/dist/ui/empty.d.ts +1 -1
  35. package/dist/ui/field.d.ts +1 -1
  36. package/dist/ui/generated-image.d.ts +14 -0
  37. package/dist/ui/generated-image.js +65 -0
  38. package/dist/ui/generated-table.d.ts +11 -0
  39. package/dist/ui/generated-table.js +59 -0
  40. package/dist/ui/icon-tile.d.ts +2 -2
  41. package/dist/ui/item.d.ts +2 -2
  42. package/dist/ui/markdown.d.ts +14 -0
  43. package/dist/ui/markdown.js +123 -0
  44. package/dist/ui/marker.d.ts +1 -1
  45. package/dist/ui/message-actions.d.ts +12 -0
  46. package/dist/ui/message-actions.js +79 -0
  47. package/dist/ui/panel.d.ts +1 -1
  48. package/dist/ui/reasoning.d.ts +10 -0
  49. package/dist/ui/reasoning.js +62 -0
  50. package/dist/ui/sidebar.d.ts +1 -1
  51. package/dist/ui/sparkline.d.ts +1 -1
  52. package/dist/ui/stat.d.ts +1 -1
  53. package/dist/ui/status-badge.d.ts +3 -3
  54. package/dist/ui/suggestions.d.ts +8 -0
  55. package/dist/ui/suggestions.js +39 -0
  56. package/dist/ui/tabs.d.ts +1 -1
  57. package/dist/ui/toggle.d.ts +1 -1
  58. package/dist/ui/tool-call.d.ts +15 -0
  59. package/dist/ui/tool-call.js +74 -0
  60. package/dist/ui/workflow-run.d.ts +23 -0
  61. package/dist/ui/workflow-run.js +185 -0
  62. package/docs/designer/criterio.md +87 -87
  63. package/docs/designer/patrones.md +3 -1
  64. package/package.json +238 -228
@@ -0,0 +1,123 @@
1
+ "use client";
2
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
3
+ import * as React from "react";
4
+ import ReactMarkdown from "react-markdown";
5
+ import remarkGfm from "remark-gfm";
6
+ import { AlertTriangleIcon, ExternalLinkIcon, InfoIcon, LightbulbIcon, OctagonAlertIcon, SparklesIcon } from "lucide-react";
7
+ import { useDsMessages } from "../hooks/use-ds-messages.js";
8
+ import { cn } from "../lib/utils.js";
9
+ import { Alert, AlertDescription, AlertTitle } from "./alert.js";
10
+ import { CodeBlock } from "./code-block.js";
11
+ function closeOpenMarkdown(text) {
12
+ let out = text;
13
+ if ((out.match(/^\s*```/gm)?.length ?? 0) % 2 === 1) return `${out}
14
+ \`\`\``;
15
+ if ((out.match(/\*\*/g)?.length ?? 0) % 2 === 1) out += "**";
16
+ if ((out.match(/(?<![*\\])\*(?!\*)/g)?.length ?? 0) % 2 === 1) out += "*";
17
+ if ((out.match(/~~/g)?.length ?? 0) % 2 === 1) out += "~~";
18
+ return out;
19
+ }
20
+ const CALLOUT = {
21
+ NOTE: { variant: "info", icon: /* @__PURE__ */ jsx(InfoIcon, {}) },
22
+ TIP: { variant: "success", icon: /* @__PURE__ */ jsx(LightbulbIcon, {}) },
23
+ IMPORTANT: { variant: "default", icon: /* @__PURE__ */ jsx(SparklesIcon, {}) },
24
+ WARNING: { variant: "warning", icon: /* @__PURE__ */ jsx(AlertTriangleIcon, {}) },
25
+ CAUTION: { variant: "danger", icon: /* @__PURE__ */ jsx(OctagonAlertIcon, {}) }
26
+ };
27
+ function readCallout(children) {
28
+ const nodes = React.Children.toArray(children);
29
+ const first = nodes.find((n) => React.isValidElement(n));
30
+ if (!first) return null;
31
+ const inner = React.Children.toArray(first.props.children);
32
+ const head = typeof inner[0] === "string" ? inner[0] : "";
33
+ const m = /^\s*\[!(NOTE|TIP|IMPORTANT|WARNING|CAUTION)\]\s*/.exec(head);
34
+ if (!m) return null;
35
+ const rest = [head.slice(m[0].length), ...inner.slice(1)].filter((x) => x !== "");
36
+ const body = nodes.map((n) => n === first ? rest.length ? /* @__PURE__ */ jsx("p", { children: rest }, "first") : null : n);
37
+ return { type: m[1], body };
38
+ }
39
+ function useComponents() {
40
+ const t = useDsMessages();
41
+ const label = {
42
+ NOTE: t.calloutNote,
43
+ TIP: t.calloutTip,
44
+ IMPORTANT: t.calloutImportant,
45
+ WARNING: t.calloutWarning,
46
+ CAUTION: t.calloutCaution
47
+ };
48
+ return React.useMemo(
49
+ () => ({
50
+ h1: ({ node: _n, className, ...p }) => /* @__PURE__ */ jsx("h1", { className: cn("mt-6 mb-3 text-xl font-(--ds-strong-weight) first:mt-0", className), ...p }),
51
+ h2: ({ node: _n, className, ...p }) => /* @__PURE__ */ jsx("h2", { className: cn("mt-5 mb-2 text-lg font-(--ds-strong-weight) first:mt-0", className), ...p }),
52
+ h3: ({ node: _n, className, ...p }) => /* @__PURE__ */ jsx("h3", { className: cn("mt-4 mb-2 text-base font-(--ds-medium-weight) first:mt-0", className), ...p }),
53
+ p: ({ node: _n, className, ...p }) => /* @__PURE__ */ jsx("p", { className: cn("mb-3 leading-relaxed last:mb-0", className), ...p }),
54
+ ul: ({ node: _n, className, ...p }) => /* @__PURE__ */ jsx("ul", { className: cn("mb-3 list-disc space-y-1 ps-5", className), ...p }),
55
+ ol: ({ node: _n, className, ...p }) => /* @__PURE__ */ jsx("ol", { className: cn("mb-3 list-decimal space-y-1 ps-5", className), ...p }),
56
+ hr: () => /* @__PURE__ */ jsx("hr", { className: "my-5 border-border" }),
57
+ a: ({ node: _n, href, children, className, ...p }) => {
58
+ const external = Boolean(href && /^https?:/i.test(href));
59
+ return /* @__PURE__ */ jsxs(
60
+ "a",
61
+ {
62
+ href,
63
+ className: cn("text-(--link) underline-offset-2 hover:underline", className),
64
+ ...external ? { target: "_blank", rel: "noopener noreferrer" } : null,
65
+ ...p,
66
+ children: [
67
+ children,
68
+ external ? /* @__PURE__ */ jsxs(Fragment, { children: [
69
+ /* @__PURE__ */ jsx(ExternalLinkIcon, { "aria-hidden": true, className: "ms-0.5 inline size-3 align-baseline opacity-70" }),
70
+ /* @__PURE__ */ jsxs("span", { className: "sr-only", children: [
71
+ " ",
72
+ t.markdownLinkExternal
73
+ ] })
74
+ ] }) : null
75
+ ]
76
+ }
77
+ );
78
+ },
79
+ blockquote: ({ node: _n, children, className, ...p }) => {
80
+ const c = readCallout(children);
81
+ if (c) {
82
+ const { variant, icon } = CALLOUT[c.type];
83
+ return /* @__PURE__ */ jsxs(Alert, { variant, className: "mb-3", children: [
84
+ icon,
85
+ /* @__PURE__ */ jsx(AlertTitle, { children: label[c.type] }),
86
+ /* @__PURE__ */ jsx(AlertDescription, { children: c.body })
87
+ ] });
88
+ }
89
+ return /* @__PURE__ */ jsx("blockquote", { className: cn("mb-3 border-s-2 border-border ps-4 text-muted-foreground", className), ...p, children });
90
+ },
91
+ pre: ({ children }) => /* @__PURE__ */ jsx(Fragment, { children }),
92
+ code: ({ node: _n, className, children, ...p }) => {
93
+ const lang = /language-([\w-]+)/.exec(className ?? "")?.[1];
94
+ const text = String(children ?? "");
95
+ if (lang || text.includes("\n")) {
96
+ return /* @__PURE__ */ jsx(CodeBlock, { code: text.replace(/\n$/, ""), language: lang, className: "mb-3" });
97
+ }
98
+ return /* @__PURE__ */ jsx("code", { className: cn("rounded-control bg-muted px-1 py-0.5 font-mono text-[0.9em]", className), ...p, children });
99
+ },
100
+ table: ({ node: _n, className, ...p }) => /* @__PURE__ */ jsx("div", { className: "mb-3 overflow-x-auto rounded-lg border border-border", children: /* @__PURE__ */ jsx("table", { className: cn("w-full border-collapse text-sm", className), ...p }) }),
101
+ thead: ({ node: _n, className, ...p }) => /* @__PURE__ */ jsx("thead", { className: cn("bg-muted/50", className), ...p }),
102
+ tr: ({ node: _n, className, ...p }) => /* @__PURE__ */ jsx("tr", { className: cn("border-b border-border last:border-0", className), ...p }),
103
+ th: ({ node: _n, className, ...p }) => /* @__PURE__ */ jsx("th", { scope: "col", className: cn("px-3 py-2 text-start text-xs font-(--ds-medium-weight) text-muted-foreground", className), ...p }),
104
+ td: ({ node: _n, className, ...p }) => /* @__PURE__ */ jsx("td", { className: cn("px-3 py-2 align-top", className), ...p })
105
+ }),
106
+ // eslint-disable-next-line react-hooks/exhaustive-deps
107
+ [t]
108
+ );
109
+ }
110
+ function Markdown({
111
+ children,
112
+ streaming = false,
113
+ className,
114
+ ...props
115
+ }) {
116
+ const components = useComponents();
117
+ const source = streaming ? closeOpenMarkdown(children) : children;
118
+ return /* @__PURE__ */ jsx("div", { "data-slot": "markdown", className: cn("min-w-0 text-sm", className), ...props, children: /* @__PURE__ */ jsx(ReactMarkdown, { remarkPlugins: [remarkGfm], components, children: source }) });
119
+ }
120
+ export {
121
+ Markdown,
122
+ closeOpenMarkdown
123
+ };
@@ -4,7 +4,7 @@ import { useRender } from '@base-ui/react/use-render';
4
4
  import { VariantProps } from 'class-variance-authority';
5
5
 
6
6
  declare const markerVariants: (props?: ({
7
- variant?: "separator" | "default" | "border" | null | undefined;
7
+ variant?: "default" | "separator" | "border" | null | undefined;
8
8
  } & class_variance_authority_types.ClassProp) | undefined) => string;
9
9
  declare function Marker({ className, variant, render, ...props }: useRender.ComponentProps<"div"> & VariantProps<typeof markerVariants>): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
10
10
  declare function MarkerIcon({ className, ...props }: React.ComponentProps<"span">): React.JSX.Element;
@@ -0,0 +1,12 @@
1
+ import * as React from 'react';
2
+
3
+ type MessageFeedback = "good" | "bad" | null;
4
+ declare function MessageActions({ text, onCopy, onRetry, feedback, onFeedback, className, ...props }: Omit<React.ComponentProps<"div">, "children"> & {
5
+ text?: string;
6
+ onCopy?: (text: string) => void;
7
+ onRetry?: () => void;
8
+ feedback?: MessageFeedback;
9
+ onFeedback?: (value: MessageFeedback) => void;
10
+ }): React.JSX.Element;
11
+
12
+ export { MessageActions, type MessageFeedback };
@@ -0,0 +1,79 @@
1
+ "use client";
2
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
3
+ import * as React from "react";
4
+ import { CheckIcon, CopyIcon, RefreshCwIcon, ThumbsDownIcon, ThumbsUpIcon } from "lucide-react";
5
+ import { useDsMessages } from "../hooks/use-ds-messages.js";
6
+ import { cn } from "../lib/utils.js";
7
+ import { Button } from "./button.js";
8
+ function MessageActions({
9
+ text,
10
+ onCopy,
11
+ onRetry,
12
+ feedback = null,
13
+ onFeedback,
14
+ className,
15
+ ...props
16
+ }) {
17
+ const t = useDsMessages();
18
+ const [copied, setCopied] = React.useState(false);
19
+ React.useEffect(() => {
20
+ if (!copied) return;
21
+ const id = window.setTimeout(() => setCopied(false), 2e3);
22
+ return () => window.clearTimeout(id);
23
+ }, [copied]);
24
+ const copy = async () => {
25
+ if (text === void 0) return;
26
+ try {
27
+ await navigator.clipboard.writeText(text);
28
+ setCopied(true);
29
+ onCopy?.(text);
30
+ } catch {
31
+ }
32
+ };
33
+ return /* @__PURE__ */ jsxs(
34
+ "div",
35
+ {
36
+ "data-slot": "message-actions",
37
+ role: "group",
38
+ "aria-label": t.messageActionsLabel,
39
+ className: cn("flex items-center gap-0.5 text-muted-foreground", className),
40
+ ...props,
41
+ children: [
42
+ text !== void 0 ? /* @__PURE__ */ jsx(Button, { variant: "ghost", size: "icon-sm", "data-action": "copy", "aria-label": t.messageCopy, onClick: copy, children: copied ? /* @__PURE__ */ jsx(CheckIcon, {}) : /* @__PURE__ */ jsx(CopyIcon, {}) }) : null,
43
+ onRetry ? /* @__PURE__ */ jsx(Button, { variant: "ghost", size: "icon-sm", "data-action": "retry", "aria-label": t.messageRetry, onClick: onRetry, children: /* @__PURE__ */ jsx(RefreshCwIcon, {}) }) : null,
44
+ onFeedback ? /* @__PURE__ */ jsxs(Fragment, { children: [
45
+ /* @__PURE__ */ jsx(
46
+ Button,
47
+ {
48
+ variant: "ghost",
49
+ size: "icon-sm",
50
+ "data-action": "good",
51
+ "aria-label": t.messageGood,
52
+ "aria-pressed": feedback === "good",
53
+ className: cn(feedback === "good" && "text-foreground"),
54
+ onClick: () => onFeedback(feedback === "good" ? null : "good"),
55
+ children: /* @__PURE__ */ jsx(ThumbsUpIcon, {})
56
+ }
57
+ ),
58
+ /* @__PURE__ */ jsx(
59
+ Button,
60
+ {
61
+ variant: "ghost",
62
+ size: "icon-sm",
63
+ "data-action": "bad",
64
+ "aria-label": t.messageBad,
65
+ "aria-pressed": feedback === "bad",
66
+ className: cn(feedback === "bad" && "text-foreground"),
67
+ onClick: () => onFeedback(feedback === "bad" ? null : "bad"),
68
+ children: /* @__PURE__ */ jsx(ThumbsDownIcon, {})
69
+ }
70
+ )
71
+ ] }) : null,
72
+ /* @__PURE__ */ jsx("span", { role: "status", "aria-live": "polite", className: "sr-only", children: copied ? t.copied : "" })
73
+ ]
74
+ }
75
+ );
76
+ }
77
+ export {
78
+ MessageActions
79
+ };
@@ -4,7 +4,7 @@ import { useRender } from '@base-ui/react/use-render';
4
4
  import { VariantProps } from 'class-variance-authority';
5
5
 
6
6
  declare const panelVariants: (props?: ({
7
- variant?: "default" | "outline" | "ghost" | "glass" | "muted" | null | undefined;
7
+ variant?: "outline" | "default" | "ghost" | "muted" | "glass" | null | undefined;
8
8
  size?: "sm" | "lg" | "md" | null | undefined;
9
9
  } & class_variance_authority_types.ClassProp) | undefined) => string;
10
10
  declare function Panel({ className, variant, size, render, ...props }: useRender.ComponentProps<"div"> & VariantProps<typeof panelVariants>): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
@@ -0,0 +1,10 @@
1
+ import * as React from 'react';
2
+
3
+ declare function Reasoning({ streaming, title, defaultOpen, onOpenChange, className, children, ...props }: Omit<React.ComponentProps<"div">, "title"> & {
4
+ streaming?: boolean;
5
+ title?: React.ReactNode;
6
+ defaultOpen?: boolean;
7
+ onOpenChange?: (open: boolean) => void;
8
+ }): React.JSX.Element;
9
+
10
+ export { Reasoning };
@@ -0,0 +1,62 @@
1
+ "use client";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import * as React from "react";
4
+ import { ChevronDownIcon } from "lucide-react";
5
+ import { useDsMessages } from "../hooks/use-ds-messages.js";
6
+ import { cn } from "../lib/utils.js";
7
+ import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "./collapsible.js";
8
+ import { Spinner } from "./spinner.js";
9
+ function Reasoning({
10
+ streaming = false,
11
+ title,
12
+ defaultOpen,
13
+ onOpenChange,
14
+ className,
15
+ children,
16
+ ...props
17
+ }) {
18
+ const t = useDsMessages();
19
+ const [open, setOpen] = React.useState(defaultOpen ?? streaming);
20
+ const touched = React.useRef(false);
21
+ React.useEffect(() => {
22
+ if (!touched.current) setOpen(streaming);
23
+ }, [streaming]);
24
+ return /* @__PURE__ */ jsx(
25
+ "div",
26
+ {
27
+ "data-slot": "reasoning",
28
+ "data-streaming": streaming || void 0,
29
+ className: cn("rounded-lg border border-border bg-muted/40 text-sm", className),
30
+ ...props,
31
+ children: /* @__PURE__ */ jsxs(
32
+ Collapsible,
33
+ {
34
+ open,
35
+ onOpenChange: (v) => {
36
+ touched.current = true;
37
+ setOpen(v);
38
+ onOpenChange?.(v);
39
+ },
40
+ children: [
41
+ /* @__PURE__ */ jsxs(
42
+ CollapsibleTrigger,
43
+ {
44
+ "data-slot": "reasoning-trigger",
45
+ className: "group flex w-full items-center gap-2 rounded-lg px-3 py-2 text-start text-muted-foreground outline-none hover:text-foreground focus-visible:ring-(length:--ds-ring-width) focus-visible:ring-(--ds-ring-color)",
46
+ children: [
47
+ streaming ? /* @__PURE__ */ jsx(Spinner, { "aria-hidden": true, role: "presentation", className: "size-3.5" }) : null,
48
+ /* @__PURE__ */ jsx("span", { className: cn("flex-1 font-(--ds-medium-weight)", streaming && "text-shimmer"), children: title ?? (streaming ? t.reasoningThinking : t.reasoningDone) }),
49
+ /* @__PURE__ */ jsx(ChevronDownIcon, { "aria-hidden": true, className: "size-4 transition-transform group-data-[panel-open]:rotate-180" })
50
+ ]
51
+ }
52
+ ),
53
+ /* @__PURE__ */ jsx(CollapsibleContent, { "data-slot": "reasoning-content", className: "whitespace-pre-wrap px-3 pb-3 text-muted-foreground", children })
54
+ ]
55
+ }
56
+ )
57
+ }
58
+ );
59
+ }
60
+ export {
61
+ Reasoning
62
+ };
@@ -66,7 +66,7 @@ declare function SidebarGroupContent({ className, ...props }: React.ComponentPro
66
66
  declare function SidebarMenu({ className, ...props }: React.ComponentProps<"ul">): React.JSX.Element;
67
67
  declare function SidebarMenuItem({ className, ...props }: React.ComponentProps<"li">): React.JSX.Element;
68
68
  declare const sidebarMenuButtonVariants: (props?: ({
69
- variant?: "default" | "outline" | null | undefined;
69
+ variant?: "outline" | "default" | null | undefined;
70
70
  size?: "default" | "sm" | "lg" | null | undefined;
71
71
  } & class_variance_authority_types.ClassProp) | undefined) => string;
72
72
  declare function SidebarMenuButton({ isActive, variant, size, tooltip, className, render, ...props }: useRender.ComponentProps<"button"> & {
@@ -4,7 +4,7 @@ import * as React from 'react';
4
4
  type SparklineSeries = 1 | 2 | 3 | 4 | 5;
5
5
  type SparklineTone = "info" | "success" | "warning" | "danger" | "neutral";
6
6
  declare const sparklineVariants: (props?: ({
7
- color?: "current" | "info" | "success" | "warning" | "danger" | "neutral" | "series-1" | "series-2" | "series-3" | "series-4" | "series-5" | null | undefined;
7
+ color?: "info" | "warning" | "success" | "danger" | "neutral" | "current" | "series-1" | "series-2" | "series-3" | "series-4" | "series-5" | null | undefined;
8
8
  } & class_variance_authority_types.ClassProp) | undefined) => string;
9
9
  type SparklineProps = Omit<React.ComponentProps<"svg">, "children" | "color"> & {
10
10
  /** Serie de valores; `null` = sin dato (hueco), nunca cero. */
package/dist/ui/stat.d.ts CHANGED
@@ -9,7 +9,7 @@ type StatVariant = "card" | "plain" | "inline";
9
9
  type StatSize = "sm" | "md" | "lg";
10
10
  type StatTone = "neutral" | "good" | "warn" | "bad";
11
11
  declare const statVariants: (props?: ({
12
- variant?: "inline" | "plain" | "card" | null | undefined;
12
+ variant?: "inline" | "card" | "plain" | null | undefined;
13
13
  tone?: "neutral" | "good" | "warn" | "bad" | null | undefined;
14
14
  } & class_variance_authority_types.ClassProp) | undefined) => string;
15
15
  type StatProps = Omit<React.ComponentProps<"div">, "ref"> & {
@@ -4,7 +4,7 @@ import * as React from 'react';
4
4
  type StatusLevel = "critical" | "warning" | "ok" | "info" | "neutral" | "none";
5
5
  type StatusBadgeVariant = "soft" | "dot" | "outline";
6
6
  declare const statusDotVariants: (props?: ({
7
- level?: "none" | "info" | "warning" | "neutral" | "critical" | "ok" | null | undefined;
7
+ level?: "info" | "warning" | "none" | "neutral" | "critical" | "ok" | null | undefined;
8
8
  } & class_variance_authority_types.ClassProp) | undefined) => string;
9
9
  type StatusDotProps = Omit<React.ComponentProps<"span">, "children"> & {
10
10
  level?: StatusLevel;
@@ -16,8 +16,8 @@ type StatusDotProps = Omit<React.ComponentProps<"span">, "children"> & {
16
16
  };
17
17
  declare function StatusDot({ level, pulse, size, label, className, ...props }: StatusDotProps): React.JSX.Element;
18
18
  declare const statusBadgeVariants: (props?: ({
19
- variant?: "outline" | "soft" | "dot" | null | undefined;
20
- level?: "none" | "info" | "warning" | "neutral" | "critical" | "ok" | null | undefined;
19
+ variant?: "outline" | "dot" | "soft" | null | undefined;
20
+ level?: "info" | "warning" | "none" | "neutral" | "critical" | "ok" | null | undefined;
21
21
  } & class_variance_authority_types.ClassProp) | undefined) => string;
22
22
  type StatusBadgeProps = Omit<React.ComponentProps<"span">, "children"> & {
23
23
  level?: StatusLevel;
@@ -0,0 +1,8 @@
1
+ import * as React from 'react';
2
+
3
+ declare function Suggestions({ items, onSelect, className, ...props }: Omit<React.ComponentProps<"div">, "children" | "onSelect"> & {
4
+ items: string[];
5
+ onSelect?: (item: string) => void;
6
+ }): React.JSX.Element;
7
+
8
+ export { Suggestions };
@@ -0,0 +1,39 @@
1
+ "use client";
2
+ import { jsx } from "react/jsx-runtime";
3
+ import { useDsMessages } from "../hooks/use-ds-messages.js";
4
+ import { cn } from "../lib/utils.js";
5
+ import { Button } from "./button.js";
6
+ function Suggestions({
7
+ items,
8
+ onSelect,
9
+ className,
10
+ ...props
11
+ }) {
12
+ const t = useDsMessages();
13
+ return /* @__PURE__ */ jsx(
14
+ "div",
15
+ {
16
+ "data-slot": "suggestions",
17
+ role: "group",
18
+ "aria-label": t.suggestionsLabel,
19
+ className: cn("flex flex-wrap gap-2", className),
20
+ ...props,
21
+ children: items.map((item) => /* @__PURE__ */ jsx(
22
+ Button,
23
+ {
24
+ type: "button",
25
+ variant: "outline",
26
+ size: "sm",
27
+ "data-slot": "suggestions-item",
28
+ className: "h-auto max-w-full whitespace-normal rounded-full py-1.5 text-start",
29
+ onClick: () => onSelect?.(item),
30
+ children: item
31
+ },
32
+ item
33
+ ))
34
+ }
35
+ );
36
+ }
37
+ export {
38
+ Suggestions
39
+ };
package/dist/ui/tabs.d.ts CHANGED
@@ -5,7 +5,7 @@ import { VariantProps } from 'class-variance-authority';
5
5
 
6
6
  declare function Tabs({ className, orientation, ...props }: Tabs$1.Root.Props): React.JSX.Element;
7
7
  declare const tabsListVariants: (props?: ({
8
- variant?: "line" | "default" | null | undefined;
8
+ variant?: "default" | "line" | null | undefined;
9
9
  } & class_variance_authority_types.ClassProp) | undefined) => string;
10
10
  declare function TabsList({ className, variant, ...props }: Tabs$1.List.Props & VariantProps<typeof tabsListVariants>): React.JSX.Element;
11
11
  declare function TabsTrigger({ className, ...props }: Tabs$1.Tab.Props): React.JSX.Element;
@@ -4,7 +4,7 @@ import { Toggle as Toggle$1 } from '@base-ui/react/toggle';
4
4
  import { VariantProps } from 'class-variance-authority';
5
5
 
6
6
  declare const toggleVariants: (props?: ({
7
- variant?: "default" | "outline" | null | undefined;
7
+ variant?: "outline" | "default" | null | undefined;
8
8
  size?: "default" | "sm" | "lg" | null | undefined;
9
9
  } & class_variance_authority_types.ClassProp) | undefined) => string;
10
10
  declare function Toggle({ className, variant, size, ...props }: Toggle$1.Props & VariantProps<typeof toggleVariants>): React.JSX.Element;
@@ -0,0 +1,15 @@
1
+ import * as React from 'react';
2
+
3
+ type ToolCallStatus = "running" | "done" | "error" | "approval";
4
+ declare function ToolCall({ name, status, input, output, defaultOpen, onApprove, onDeny, className, ...props }: Omit<React.ComponentProps<"div">, "children"> & {
5
+ name: string;
6
+ status?: ToolCallStatus;
7
+ input?: unknown;
8
+ output?: unknown;
9
+ defaultOpen?: boolean;
10
+ /** Con `status="approval"`: la persona autoriza o rechaza la ejecución (human-in-the-loop). */
11
+ onApprove?: () => void;
12
+ onDeny?: () => void;
13
+ }): React.JSX.Element;
14
+
15
+ export { ToolCall, type ToolCallStatus };
@@ -0,0 +1,74 @@
1
+ "use client";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import * as React from "react";
4
+ import { ChevronDownIcon, WrenchIcon } from "lucide-react";
5
+ import { useDsMessages } from "../hooks/use-ds-messages.js";
6
+ import { cn } from "../lib/utils.js";
7
+ import { Button } from "./button.js";
8
+ import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "./collapsible.js";
9
+ import { Spinner } from "./spinner.js";
10
+ const DOT = {
11
+ approval: "bg-warning",
12
+ running: "bg-info",
13
+ done: "bg-success",
14
+ error: "bg-danger"
15
+ };
16
+ function ToolCall({
17
+ name,
18
+ status = "running",
19
+ input,
20
+ output,
21
+ defaultOpen = false,
22
+ onApprove,
23
+ onDeny,
24
+ className,
25
+ ...props
26
+ }) {
27
+ const t = useDsMessages();
28
+ const label = status === "running" ? t.toolRunning : status === "approval" ? t.toolAwaiting : status === "error" ? t.toolError : t.toolDone;
29
+ const show = (v) => React.isValidElement(v) || typeof v === "string" ? v : /* @__PURE__ */ jsx("code", { children: JSON.stringify(v, null, 2) });
30
+ return /* @__PURE__ */ jsx(
31
+ "div",
32
+ {
33
+ "data-slot": "tool-call",
34
+ "data-status": status,
35
+ className: cn("rounded-lg border border-border bg-card text-sm", className),
36
+ ...props,
37
+ children: /* @__PURE__ */ jsxs(Collapsible, { defaultOpen: defaultOpen || status === "approval", children: [
38
+ /* @__PURE__ */ jsxs(
39
+ CollapsibleTrigger,
40
+ {
41
+ "data-slot": "tool-call-trigger",
42
+ className: "group flex w-full items-center gap-2 rounded-lg px-3 py-2 text-start outline-none focus-visible:ring-(length:--ds-ring-width) focus-visible:ring-(--ds-ring-color)",
43
+ children: [
44
+ /* @__PURE__ */ jsx(WrenchIcon, { "aria-hidden": true, className: "size-4 text-muted-foreground" }),
45
+ /* @__PURE__ */ jsx("span", { className: cn("flex-1 truncate font-mono", status === "running" && "text-shimmer"), children: name }),
46
+ /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-1.5 text-muted-foreground", children: [
47
+ status === "running" ? /* @__PURE__ */ jsx(Spinner, { "aria-hidden": true, role: "presentation", className: "size-3.5" }) : /* @__PURE__ */ jsx("span", { "aria-hidden": true, className: cn("block size-(--ds-status-dot) rounded-full", DOT[status]) }),
48
+ label
49
+ ] }),
50
+ /* @__PURE__ */ jsx(ChevronDownIcon, { "aria-hidden": true, className: "size-4 text-muted-foreground transition-transform group-data-[panel-open]:rotate-180" })
51
+ ]
52
+ }
53
+ ),
54
+ /* @__PURE__ */ jsxs(CollapsibleContent, { "data-slot": "tool-call-content", className: "flex flex-col gap-2 border-t border-border px-3 py-2", children: [
55
+ input !== void 0 ? /* @__PURE__ */ jsxs("div", { children: [
56
+ /* @__PURE__ */ jsx("div", { className: "text-xs font-(--ds-medium-weight) text-muted-foreground", children: t.toolInput }),
57
+ /* @__PURE__ */ jsx("pre", { className: "overflow-x-auto whitespace-pre-wrap text-xs", children: show(input) })
58
+ ] }) : null,
59
+ output !== void 0 ? /* @__PURE__ */ jsxs("div", { children: [
60
+ /* @__PURE__ */ jsx("div", { className: "text-xs font-(--ds-medium-weight) text-muted-foreground", children: t.toolOutput }),
61
+ /* @__PURE__ */ jsx("pre", { className: "overflow-x-auto whitespace-pre-wrap text-xs", children: show(output) })
62
+ ] }) : null,
63
+ status === "approval" ? /* @__PURE__ */ jsxs("div", { className: "flex gap-2", children: [
64
+ /* @__PURE__ */ jsx(Button, { size: "sm", onClick: onApprove, children: t.toolApprove }),
65
+ /* @__PURE__ */ jsx(Button, { size: "sm", variant: "outline", onClick: onDeny, children: t.toolDeny })
66
+ ] }) : null
67
+ ] })
68
+ ] })
69
+ }
70
+ );
71
+ }
72
+ export {
73
+ ToolCall
74
+ };
@@ -0,0 +1,23 @@
1
+ import * as React from 'react';
2
+
3
+ type WorkflowNodeStatus = "pending" | "running" | "done" | "error" | "skipped";
4
+ type WorkflowRunStatus = "running" | "succeeded" | "failed" | "cancelled";
5
+ interface WorkflowNode {
6
+ id: string;
7
+ title: React.ReactNode;
8
+ description?: React.ReactNode;
9
+ status?: WorkflowNodeStatus;
10
+ /** Duración ya formateada («1,2 s»); la pone la app. */
11
+ duration?: string;
12
+ /** Ramas que corren a la vez bajo este nodo. */
13
+ branches?: WorkflowNode[];
14
+ }
15
+ declare function WorkflowRun({ name, status, nodes, onCancel, onRetry, className, ...props }: Omit<React.ComponentProps<"section">, "children"> & {
16
+ name: React.ReactNode;
17
+ status?: WorkflowRunStatus;
18
+ nodes: WorkflowNode[];
19
+ onCancel?: () => void;
20
+ onRetry?: () => void;
21
+ }): React.JSX.Element;
22
+
23
+ export { type WorkflowNode, type WorkflowNodeStatus, WorkflowRun, type WorkflowRunStatus };