@hex-core/components 1.4.0 → 1.5.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/dist/_tsup-dts-rollup.d.ts +3105 -0
- package/dist/accordion.d.ts +4 -13
- package/dist/alert-dialog.d.ts +11 -34
- package/dist/alert.d.ts +4 -17
- package/dist/aspect-ratio.d.ts +1 -7
- package/dist/avatar.d.ts +3 -11
- package/dist/badge.d.ts +3 -22
- package/dist/breadcrumb.d.ts +7 -27
- package/dist/button.d.ts +3 -13
- package/dist/calendar.d.ts +1 -17
- package/dist/card.d.ts +6 -16
- package/dist/checkbox.d.ts +2 -11
- package/dist/citation.d.ts +2 -0
- package/dist/citation.js +70 -0
- package/dist/citation.js.map +1 -0
- package/dist/cluster.d.ts +3 -34
- package/dist/code-block-copy.d.ts +2 -0
- package/dist/code-block-copy.js +108 -0
- package/dist/code-block-copy.js.map +1 -0
- package/dist/code-block.d.ts +3 -0
- package/dist/code-block.js +90 -0
- package/dist/code-block.js.map +1 -0
- package/dist/collapsible.d.ts +3 -11
- package/dist/color-picker.d.ts +2 -44
- package/dist/combobox.d.ts +3 -45
- package/dist/command.d.ts +9 -111
- package/dist/composer.d.ts +2 -0
- package/dist/composer.js +75 -0
- package/dist/composer.js.map +1 -0
- package/dist/container.d.ts +3 -41
- package/dist/context-menu.d.ts +12 -37
- package/dist/data-table.d.ts +2 -33
- package/dist/date-picker.d.ts +2 -43
- package/dist/dialog.d.ts +11 -46
- package/dist/drawer.d.ts +10 -41
- package/dist/dropdown-menu.d.ts +13 -39
- package/dist/dropzone.d.ts +3 -54
- package/dist/file-tree.d.ts +3 -53
- package/dist/form.d.ts +8 -45
- package/dist/grid.d.ts +3 -50
- package/dist/hover-card.d.ts +3 -11
- package/dist/index.d.ts +298 -179
- package/dist/index.js +674 -1
- package/dist/index.js.map +1 -1
- package/dist/input-otp.d.ts +5 -19
- package/dist/input.d.ts +2 -6
- package/dist/label.d.ts +2 -11
- package/dist/loading-indicator.d.ts +3 -0
- package/dist/loading-indicator.js +64 -0
- package/dist/loading-indicator.js.map +1 -0
- package/dist/markdown.d.ts +2 -0
- package/dist/markdown.js +28 -0
- package/dist/markdown.js.map +1 -0
- package/dist/menubar.d.ts +11 -35
- package/dist/message-actions.d.ts +2 -0
- package/dist/message-actions.js +28 -0
- package/dist/message-actions.js.map +1 -0
- package/dist/message-list.d.ts +2 -0
- package/dist/message-list.js +49 -0
- package/dist/message-list.js.map +1 -0
- package/dist/message.d.ts +3 -0
- package/dist/message.js +35 -0
- package/dist/message.js.map +1 -0
- package/dist/multi-combobox.d.ts +3 -51
- package/dist/navigation-menu.d.ts +9 -23
- package/dist/pagination.d.ts +7 -40
- package/dist/popover.d.ts +4 -13
- package/dist/progress.d.ts +1 -10
- package/dist/radio-group.d.ts +2 -9
- package/dist/reasoning.d.ts +2 -0
- package/dist/reasoning.js +90 -0
- package/dist/reasoning.js.map +1 -0
- package/dist/resizable.d.ts +3 -28
- package/dist/schemas.d.ts +72 -121
- package/dist/schemas.js +849 -1
- package/dist/schemas.js.map +1 -1
- package/dist/scroll-area.d.ts +3 -18
- package/dist/select.d.ts +8 -21
- package/dist/separator.d.ts +2 -11
- package/dist/sheet.d.ts +10 -39
- package/dist/sidebar.d.ts +8 -75
- package/dist/skeleton.d.ts +1 -11
- package/dist/slider.d.ts +2 -20
- package/dist/sonner.d.ts +2 -14
- package/dist/spacer.d.ts +3 -38
- package/dist/stack.d.ts +3 -34
- package/dist/stepper.d.ts +4 -48
- package/dist/suggestion.d.ts +2 -0
- package/dist/suggestion.js +55 -0
- package/dist/suggestion.js.map +1 -0
- package/dist/switch.d.ts +2 -11
- package/dist/table.d.ts +8 -24
- package/dist/tabs.d.ts +4 -13
- package/dist/textarea.d.ts +2 -10
- package/dist/time-picker.d.ts +2 -34
- package/dist/timeline.d.ts +4 -42
- package/dist/toggle-group.d.ts +2 -17
- package/dist/toggle.d.ts +2 -19
- package/dist/tool-call.d.ts +2 -0
- package/dist/tool-call.js +133 -0
- package/dist/tool-call.js.map +1 -0
- package/dist/tooltip.d.ts +4 -13
- package/package.json +4 -1
- package/dist/button-variants-Bx6gCUFp.d.ts +0 -19
package/dist/timeline.d.ts
CHANGED
|
@@ -1,42 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
interface TimelineEvent {
|
|
6
|
-
/** Stable unique id used as the React key. */
|
|
7
|
-
id: string;
|
|
8
|
-
/** Headline for the event. */
|
|
9
|
-
title: string;
|
|
10
|
-
/** Optional timestamp/metadata (e.g. "2 hours ago", "2026-04-27 14:30"). */
|
|
11
|
-
timestamp?: React.ReactNode;
|
|
12
|
-
/** Optional secondary text/body. */
|
|
13
|
-
description?: React.ReactNode;
|
|
14
|
-
/** Optional icon override for the indicator. Replaces the default dot. */
|
|
15
|
-
icon?: React.ReactNode;
|
|
16
|
-
/** Color variant for the indicator. */
|
|
17
|
-
status?: TimelineStatus;
|
|
18
|
-
}
|
|
19
|
-
interface TimelineProps extends Omit<React.HTMLAttributes<HTMLOListElement>, "aria-label"> {
|
|
20
|
-
/** Ordered list of chronological events. */
|
|
21
|
-
events: TimelineEvent[];
|
|
22
|
-
/** Indicator size — `"md"` by default. */
|
|
23
|
-
size?: "sm" | "md";
|
|
24
|
-
/** Required accessible name for the ordered list. */
|
|
25
|
-
"aria-label": string;
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Vertical chronological event feed (activity log, audit trail, release notes).
|
|
29
|
-
* Pure semantic HTML — `<ol>` of `<li>`. Events expose an optional icon, a
|
|
30
|
-
* status color, a timestamp, and a description; status is purely visual, no
|
|
31
|
-
* aria-current is set since events are historical, not navigational.
|
|
32
|
-
*
|
|
33
|
-
* For Gantt-style project timelines, build a custom layout — Timeline is for
|
|
34
|
-
* event feeds, not scheduling.
|
|
35
|
-
* @returns An accessible vertical event list.
|
|
36
|
-
*/
|
|
37
|
-
declare function Timeline({ events, size, "aria-label": ariaLabel, className, ...rest }: TimelineProps): react_jsx_runtime.JSX.Element;
|
|
38
|
-
declare namespace Timeline {
|
|
39
|
-
var displayName: string;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
export { Timeline, type TimelineEvent, type TimelineProps, type TimelineStatus };
|
|
1
|
+
export { Timeline_alias_1 as Timeline } from './_tsup-dts-rollup.js';
|
|
2
|
+
export { TimelineEvent_alias_1 as TimelineEvent } from './_tsup-dts-rollup.js';
|
|
3
|
+
export { TimelineProps_alias_1 as TimelineProps } from './_tsup-dts-rollup.js';
|
|
4
|
+
export { TimelineStatus_alias_1 as TimelineStatus } from './_tsup-dts-rollup.js';
|
package/dist/toggle-group.d.ts
CHANGED
|
@@ -1,17 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import { VariantProps } from 'class-variance-authority';
|
|
4
|
-
import * as React from 'react';
|
|
5
|
-
|
|
6
|
-
/** Root container for a set of toggles (single-select or multi-select). */
|
|
7
|
-
declare const ToggleGroup: React.ForwardRefExoticComponent<((Omit<ToggleGroupPrimitive.ToggleGroupSingleProps & React.RefAttributes<HTMLDivElement>, "ref"> | Omit<ToggleGroupPrimitive.ToggleGroupMultipleProps & React.RefAttributes<HTMLDivElement>, "ref">) & VariantProps<(props?: ({
|
|
8
|
-
variant?: "default" | "outline" | null | undefined;
|
|
9
|
-
size?: "default" | "sm" | "lg" | null | undefined;
|
|
10
|
-
} & class_variance_authority_types.ClassProp) | undefined) => string>) & React.RefAttributes<HTMLDivElement>>;
|
|
11
|
-
/** A single toggle option within a ToggleGroup. Inherits variant/size from context. */
|
|
12
|
-
declare const ToggleGroupItem: React.ForwardRefExoticComponent<Omit<ToggleGroupPrimitive.ToggleGroupItemProps & React.RefAttributes<HTMLButtonElement>, "ref"> & VariantProps<(props?: ({
|
|
13
|
-
variant?: "default" | "outline" | null | undefined;
|
|
14
|
-
size?: "default" | "sm" | "lg" | null | undefined;
|
|
15
|
-
} & class_variance_authority_types.ClassProp) | undefined) => string> & React.RefAttributes<HTMLButtonElement>>;
|
|
16
|
-
|
|
17
|
-
export { ToggleGroup, ToggleGroupItem };
|
|
1
|
+
export { ToggleGroup_alias_1 as ToggleGroup } from './_tsup-dts-rollup.js';
|
|
2
|
+
export { ToggleGroupItem_alias_1 as ToggleGroupItem } from './_tsup-dts-rollup.js';
|
package/dist/toggle.d.ts
CHANGED
|
@@ -1,19 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import { VariantProps } from 'class-variance-authority';
|
|
4
|
-
import * as React from 'react';
|
|
5
|
-
|
|
6
|
-
declare const toggleVariants: (props?: ({
|
|
7
|
-
variant?: "default" | "outline" | null | undefined;
|
|
8
|
-
size?: "default" | "sm" | "lg" | null | undefined;
|
|
9
|
-
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
10
|
-
/**
|
|
11
|
-
* A two-state button. Stays pressed when toggled on.
|
|
12
|
-
* @returns A styled Radix Toggle root
|
|
13
|
-
*/
|
|
14
|
-
declare const Toggle: React.ForwardRefExoticComponent<Omit<TogglePrimitive.ToggleProps & React.RefAttributes<HTMLButtonElement>, "ref"> & VariantProps<(props?: ({
|
|
15
|
-
variant?: "default" | "outline" | null | undefined;
|
|
16
|
-
size?: "default" | "sm" | "lg" | null | undefined;
|
|
17
|
-
} & class_variance_authority_types.ClassProp) | undefined) => string> & React.RefAttributes<HTMLButtonElement>>;
|
|
18
|
-
|
|
19
|
-
export { Toggle, toggleVariants };
|
|
1
|
+
export { Toggle_alias_1 as Toggle } from './_tsup-dts-rollup.js';
|
|
2
|
+
export { toggleVariants_alias_1 as toggleVariants } from './_tsup-dts-rollup.js';
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import * as CollapsiblePrimitive from '@radix-ui/react-collapsible';
|
|
3
|
+
import { clsx } from 'clsx';
|
|
4
|
+
import { twMerge } from 'tailwind-merge';
|
|
5
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
6
|
+
|
|
7
|
+
function cn(...inputs) {
|
|
8
|
+
return twMerge(clsx(inputs));
|
|
9
|
+
}
|
|
10
|
+
var STATE_LABEL = {
|
|
11
|
+
pending: "Pending",
|
|
12
|
+
running: "Running",
|
|
13
|
+
result: "Done",
|
|
14
|
+
error: "Error"
|
|
15
|
+
};
|
|
16
|
+
var STATE_CLASSES = {
|
|
17
|
+
pending: "bg-muted text-muted-foreground",
|
|
18
|
+
running: "bg-primary/15 text-primary animate-pulse",
|
|
19
|
+
result: "bg-accent/30 text-accent-foreground",
|
|
20
|
+
error: "bg-destructive/15 text-destructive"
|
|
21
|
+
};
|
|
22
|
+
function ToolCall({
|
|
23
|
+
name,
|
|
24
|
+
state,
|
|
25
|
+
args,
|
|
26
|
+
result,
|
|
27
|
+
defaultOpen = false,
|
|
28
|
+
className
|
|
29
|
+
}) {
|
|
30
|
+
return /* @__PURE__ */ jsxs(
|
|
31
|
+
CollapsiblePrimitive.Root,
|
|
32
|
+
{
|
|
33
|
+
defaultOpen,
|
|
34
|
+
className: cn(
|
|
35
|
+
"overflow-hidden rounded-md border bg-card text-card-foreground",
|
|
36
|
+
"transition-all duration-[var(--duration-normal,200ms)] ease-out",
|
|
37
|
+
"data-[state=open]:shadow-sm",
|
|
38
|
+
className
|
|
39
|
+
),
|
|
40
|
+
children: [
|
|
41
|
+
/* @__PURE__ */ jsxs(
|
|
42
|
+
CollapsiblePrimitive.Trigger,
|
|
43
|
+
{
|
|
44
|
+
className: cn(
|
|
45
|
+
"group flex w-full items-center justify-between gap-3 px-3 py-2 text-left text-sm",
|
|
46
|
+
"hover:bg-muted/40",
|
|
47
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2"
|
|
48
|
+
),
|
|
49
|
+
children: [
|
|
50
|
+
/* @__PURE__ */ jsxs("span", { className: "flex min-w-0 items-center gap-2", children: [
|
|
51
|
+
/* @__PURE__ */ jsx(ToolGlyph, {}),
|
|
52
|
+
/* @__PURE__ */ jsx("span", { className: "truncate font-mono text-xs text-foreground", children: name }),
|
|
53
|
+
/* @__PURE__ */ jsx(
|
|
54
|
+
"span",
|
|
55
|
+
{
|
|
56
|
+
className: cn(
|
|
57
|
+
"inline-flex items-center rounded-full px-2 py-0.5 text-[10px] font-medium",
|
|
58
|
+
STATE_CLASSES[state]
|
|
59
|
+
),
|
|
60
|
+
children: STATE_LABEL[state]
|
|
61
|
+
}
|
|
62
|
+
)
|
|
63
|
+
] }),
|
|
64
|
+
/* @__PURE__ */ jsx(Chevron, {})
|
|
65
|
+
]
|
|
66
|
+
}
|
|
67
|
+
),
|
|
68
|
+
/* @__PURE__ */ jsxs(CollapsiblePrimitive.Content, { className: "overflow-hidden border-t bg-muted/20 px-3 py-2 text-xs", children: [
|
|
69
|
+
args !== void 0 ? /* @__PURE__ */ jsx(CodeSection, { label: "Arguments", value: args }) : null,
|
|
70
|
+
result !== void 0 ? /* @__PURE__ */ jsx(CodeSection, { label: "Result", value: result }) : null,
|
|
71
|
+
args === void 0 && result === void 0 ? /* @__PURE__ */ jsx("p", { className: "text-muted-foreground", children: "No arguments or result yet." }) : null
|
|
72
|
+
] })
|
|
73
|
+
]
|
|
74
|
+
}
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
function CodeSection({ label, value }) {
|
|
78
|
+
const text = typeof value === "string" ? value : safeStringify(value);
|
|
79
|
+
return /* @__PURE__ */ jsxs("div", { className: "space-y-1 py-1", children: [
|
|
80
|
+
/* @__PURE__ */ jsx("div", { className: "text-[10px] uppercase tracking-wide text-muted-foreground", children: label }),
|
|
81
|
+
/* @__PURE__ */ jsx("pre", { className: "overflow-x-auto rounded bg-background/60 p-2 font-mono text-[11px] leading-snug", children: text })
|
|
82
|
+
] });
|
|
83
|
+
}
|
|
84
|
+
function safeStringify(value) {
|
|
85
|
+
try {
|
|
86
|
+
return JSON.stringify(value, null, 2);
|
|
87
|
+
} catch {
|
|
88
|
+
return String(value);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
function ToolGlyph() {
|
|
92
|
+
return /* @__PURE__ */ jsxs(
|
|
93
|
+
"svg",
|
|
94
|
+
{
|
|
95
|
+
"aria-hidden": true,
|
|
96
|
+
viewBox: "0 0 16 16",
|
|
97
|
+
width: "14",
|
|
98
|
+
height: "14",
|
|
99
|
+
fill: "none",
|
|
100
|
+
stroke: "currentColor",
|
|
101
|
+
strokeWidth: "1.5",
|
|
102
|
+
strokeLinecap: "round",
|
|
103
|
+
strokeLinejoin: "round",
|
|
104
|
+
className: "shrink-0 text-muted-foreground",
|
|
105
|
+
children: [
|
|
106
|
+
/* @__PURE__ */ jsx("path", { d: "M11.5 1.5l3 3-2.5 2.5-3-3 2.5-2.5z" }),
|
|
107
|
+
/* @__PURE__ */ jsx("path", { d: "M9 4l-7 7v3h3l7-7" })
|
|
108
|
+
]
|
|
109
|
+
}
|
|
110
|
+
);
|
|
111
|
+
}
|
|
112
|
+
function Chevron() {
|
|
113
|
+
return /* @__PURE__ */ jsx(
|
|
114
|
+
"svg",
|
|
115
|
+
{
|
|
116
|
+
"aria-hidden": true,
|
|
117
|
+
viewBox: "0 0 16 16",
|
|
118
|
+
width: "14",
|
|
119
|
+
height: "14",
|
|
120
|
+
fill: "none",
|
|
121
|
+
stroke: "currentColor",
|
|
122
|
+
strokeWidth: "1.5",
|
|
123
|
+
strokeLinecap: "round",
|
|
124
|
+
strokeLinejoin: "round",
|
|
125
|
+
className: "shrink-0 text-muted-foreground transition-transform duration-200 group-data-[state=open]:rotate-180",
|
|
126
|
+
children: /* @__PURE__ */ jsx("path", { d: "M4 6l4 4 4-4" })
|
|
127
|
+
}
|
|
128
|
+
);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export { ToolCall };
|
|
132
|
+
//# sourceMappingURL=tool-call.js.map
|
|
133
|
+
//# sourceMappingURL=tool-call.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/lib/utils.ts","../src/ai/tool-call/tool-call.t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x\";\nimport { twMerge } from \"tailwind-merge\";\n\n/**\n * Merge class names with Tailwind CSS conflict resolution.\n * @param inputs - Class values (strings, arrays, objects) to merge\n * @returns A single merged class string with Tailwind conflicts resolved\n */\nexport function cn(...inputs: ClassValue[]) {\n\treturn twMerge(clsx(inputs));\n}\n","\"use client\";\n\nimport * as CollapsiblePrimitive from \"@radix-ui/react-collapsible\";\nimport * as React from \"react\";\nimport { cn } from \"../../lib/utils.js\";\nimport type { ToolCallState } from \"../types.js\";\n\nconst STATE_LABEL: Record<ToolCallState, string> = {\n\tpending: \"Pending\",\n\trunning: \"Running\",\n\tresult: \"Done\",\n\terror: \"Error\",\n};\n\nconst STATE_CLASSES: Record<ToolCallState, string> = {\n\tpending: \"bg-muted text-muted-foreground\",\n\trunning: \"bg-primary/15 text-primary animate-pulse\",\n\tresult: \"bg-accent/30 text-accent-foreground\",\n\terror: \"bg-destructive/15 text-destructive\",\n};\n\n/**\n * Collapsible card displaying a tool / function invocation. Header shows the\n * tool name and lifecycle state badge; body reveals the JSON-stringified\n * arguments and result on expand.\n *\n * Display-only — the component does not run the tool. Wire it up in the\n * consumer (AI SDK `tool-*` parts → ToolCall props, LangChain\n * `AIMessage.tool_calls` → ToolCall props).\n *\n * @example\n * <ToolCall\n * name=\"searchDocs\"\n * state=\"result\"\n * args={{ query: \"auth\" }}\n * result={{ hits: 12 }}\n * />\n */\nexport interface ToolCallProps {\n\tname: string;\n\tstate: ToolCallState;\n\targs?: unknown;\n\tresult?: unknown;\n\tdefaultOpen?: boolean;\n\tclassName?: string;\n}\n\n/**\n * Renders a tool-invocation card with collapsible details.\n * @param props - tool name, state, optional args/result\n * @returns A Collapsible wrapping a header + JSON body\n */\nfunction ToolCall({\n\tname,\n\tstate,\n\targs,\n\tresult,\n\tdefaultOpen = false,\n\tclassName,\n}: ToolCallProps) {\n\treturn (\n\t\t<CollapsiblePrimitive.Root\n\t\t\tdefaultOpen={defaultOpen}\n\t\t\tclassName={cn(\n\t\t\t\t\"overflow-hidden rounded-md border bg-card text-card-foreground\",\n\t\t\t\t\"transition-all duration-[var(--duration-normal,200ms)] ease-out\",\n\t\t\t\t\"data-[state=open]:shadow-sm\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t>\n\t\t\t<CollapsiblePrimitive.Trigger\n\t\t\t\tclassName={cn(\n\t\t\t\t\t\"group flex w-full items-center justify-between gap-3 px-3 py-2 text-left text-sm\",\n\t\t\t\t\t\"hover:bg-muted/40\",\n\t\t\t\t\t\"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2\",\n\t\t\t\t)}\n\t\t\t>\n\t\t\t\t<span className=\"flex min-w-0 items-center gap-2\">\n\t\t\t\t\t<ToolGlyph />\n\t\t\t\t\t<span className=\"truncate font-mono text-xs text-foreground\">{name}</span>\n\t\t\t\t\t<span\n\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t\"inline-flex items-center rounded-full px-2 py-0.5 text-[10px] font-medium\",\n\t\t\t\t\t\t\tSTATE_CLASSES[state],\n\t\t\t\t\t\t)}\n\t\t\t\t\t>\n\t\t\t\t\t\t{STATE_LABEL[state]}\n\t\t\t\t\t</span>\n\t\t\t\t</span>\n\t\t\t\t<Chevron />\n\t\t\t</CollapsiblePrimitive.Trigger>\n\t\t\t<CollapsiblePrimitive.Content className=\"overflow-hidden border-t bg-muted/20 px-3 py-2 text-xs\">\n\t\t\t\t{args !== undefined ? <CodeSection label=\"Arguments\" value={args} /> : null}\n\t\t\t\t{result !== undefined ? <CodeSection label=\"Result\" value={result} /> : null}\n\t\t\t\t{args === undefined && result === undefined ? (\n\t\t\t\t\t<p className=\"text-muted-foreground\">No arguments or result yet.</p>\n\t\t\t\t) : null}\n\t\t\t</CollapsiblePrimitive.Content>\n\t\t</CollapsiblePrimitive.Root>\n\t);\n}\n\nfunction CodeSection({ label, value }: { label: string; value: unknown }) {\n\tconst text = typeof value === \"string\" ? value : safeStringify(value);\n\treturn (\n\t\t<div className=\"space-y-1 py-1\">\n\t\t\t<div className=\"text-[10px] uppercase tracking-wide text-muted-foreground\">{label}</div>\n\t\t\t<pre className=\"overflow-x-auto rounded bg-background/60 p-2 font-mono text-[11px] leading-snug\">\n\t\t\t\t{text}\n\t\t\t</pre>\n\t\t</div>\n\t);\n}\n\nfunction safeStringify(value: unknown): string {\n\ttry {\n\t\treturn JSON.stringify(value, null, 2);\n\t} catch {\n\t\treturn String(value);\n\t}\n}\n\nfunction ToolGlyph() {\n\treturn (\n\t\t<svg\n\t\t\taria-hidden\n\t\t\tviewBox=\"0 0 16 16\"\n\t\t\twidth=\"14\"\n\t\t\theight=\"14\"\n\t\t\tfill=\"none\"\n\t\t\tstroke=\"currentColor\"\n\t\t\tstrokeWidth=\"1.5\"\n\t\t\tstrokeLinecap=\"round\"\n\t\t\tstrokeLinejoin=\"round\"\n\t\t\tclassName=\"shrink-0 text-muted-foreground\"\n\t\t>\n\t\t\t<path d=\"M11.5 1.5l3 3-2.5 2.5-3-3 2.5-2.5z\" />\n\t\t\t<path d=\"M9 4l-7 7v3h3l7-7\" />\n\t\t</svg>\n\t);\n}\n\nfunction Chevron() {\n\treturn (\n\t\t<svg\n\t\t\taria-hidden\n\t\t\tviewBox=\"0 0 16 16\"\n\t\t\twidth=\"14\"\n\t\t\theight=\"14\"\n\t\t\tfill=\"none\"\n\t\t\tstroke=\"currentColor\"\n\t\t\tstrokeWidth=\"1.5\"\n\t\t\tstrokeLinecap=\"round\"\n\t\t\tstrokeLinejoin=\"round\"\n\t\t\tclassName=\"shrink-0 text-muted-foreground transition-transform duration-200 group-data-[state=open]:rotate-180\"\n\t\t>\n\t\t\t<path d=\"M4 6l4 4 4-4\" />\n\t\t</svg>\n\t);\n}\n\nexport { ToolCall };\n"]}
|
package/dist/tooltip.d.ts
CHANGED
|
@@ -1,13 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
declare const TooltipProvider: React.FC<TooltipPrimitive.TooltipProviderProps>;
|
|
6
|
-
/** Root container for a single tooltip. */
|
|
7
|
-
declare const Tooltip: React.FC<TooltipPrimitive.TooltipProps>;
|
|
8
|
-
/** The element that shows the tooltip on hover/focus. */
|
|
9
|
-
declare const TooltipTrigger: React.ForwardRefExoticComponent<TooltipPrimitive.TooltipTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
10
|
-
/** The floating tooltip content (small, hover-reveal info). */
|
|
11
|
-
declare const TooltipContent: React.ForwardRefExoticComponent<Omit<TooltipPrimitive.TooltipContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
12
|
-
|
|
13
|
-
export { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger };
|
|
1
|
+
export { Tooltip_alias_1 as Tooltip } from './_tsup-dts-rollup.js';
|
|
2
|
+
export { TooltipTrigger_alias_1 as TooltipTrigger } from './_tsup-dts-rollup.js';
|
|
3
|
+
export { TooltipContent_alias_1 as TooltipContent } from './_tsup-dts-rollup.js';
|
|
4
|
+
export { TooltipProvider_alias_1 as TooltipProvider } from './_tsup-dts-rollup.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hex-core/components",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.0",
|
|
4
4
|
"description": "AI-native React components for Hex UI — Radix UI + Tailwind CSS with machine-readable schemas. RSC-aware per-component bundles + tree-shakable.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -80,9 +80,12 @@
|
|
|
80
80
|
"@radix-ui/react-tooltip": "^1.2.8",
|
|
81
81
|
"class-variance-authority": "^0.7.0",
|
|
82
82
|
"clsx": "^2.1.0",
|
|
83
|
+
"shiki": "^4.0.2",
|
|
84
|
+
"streamdown": "^2.5.0",
|
|
83
85
|
"tailwind-merge": "^3.5.0"
|
|
84
86
|
},
|
|
85
87
|
"devDependencies": {
|
|
88
|
+
"@microsoft/api-extractor": "^7.58.7",
|
|
86
89
|
"@tanstack/react-table": "^8.21.3",
|
|
87
90
|
"@types/react": "^19.0.0",
|
|
88
91
|
"@types/react-dom": "^19.0.0",
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
2
|
-
import { VariantProps } from 'class-variance-authority';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* CVA variants for the Button component.
|
|
6
|
-
*
|
|
7
|
-
* Lives in its own module so RSC-safe consumers (`Pagination`, future
|
|
8
|
-
* link-styled buttons in static layouts) can import variants without
|
|
9
|
-
* pulling in the full `Button` runtime — `Button` itself is client-only
|
|
10
|
-
* because of `Slot` + `forwardRef` + the loading spinner. Splitting the
|
|
11
|
-
* variants out keeps `dist/pagination.js` free of `@radix-ui/react-slot`.
|
|
12
|
-
*/
|
|
13
|
-
declare const buttonVariants: (props?: ({
|
|
14
|
-
variant?: "default" | "secondary" | "destructive" | "outline" | "link" | "ghost" | null | undefined;
|
|
15
|
-
size?: "default" | "sm" | "lg" | "icon" | null | undefined;
|
|
16
|
-
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
17
|
-
type ButtonVariantsProps = VariantProps<typeof buttonVariants>;
|
|
18
|
-
|
|
19
|
-
export { type ButtonVariantsProps as B, buttonVariants as b };
|