@tangle-network/ui 11.10.0 → 11.11.1

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 (132) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/README.md +4 -1
  3. package/dist/active-sessions-store-Gt1R0rFG.js +262 -0
  4. package/dist/{active-sessions-store-CeOmXgv5.d.ts → active-sessions-store-nl70ZnMC.d.ts} +40 -41
  5. package/dist/artifact-pane-BL_DFWNl.d.ts +32 -0
  6. package/dist/artifact-pane-DMXT9a8U.js +70 -0
  7. package/dist/auth-DOETfnd9.js +154 -0
  8. package/dist/auth.d.ts +2 -74
  9. package/dist/auth.js +2 -16
  10. package/dist/branding-26d5ARIr.d.ts +14 -0
  11. package/dist/button-C87nEe2R.js +78 -0
  12. package/dist/button-yoIv77e2.d.ts +16 -0
  13. package/dist/chat-D4jAfEmj.js +667 -0
  14. package/dist/chat.d.ts +2 -201
  15. package/dist/chat.js +2 -31
  16. package/dist/code-block-B36KVUSN.js +165 -0
  17. package/dist/code-block-B9miUPht.d.ts +23 -0
  18. package/dist/diff-preview-BcK3nRXb.js +533 -0
  19. package/dist/document-editor-pane-BcoABlhn.d.ts +131 -0
  20. package/dist/document-editor-pane-BxlPjaTP.js +1287 -0
  21. package/dist/dropdown-menu-BpcLa5vF.js +101 -0
  22. package/dist/editor.d.ts +76 -78
  23. package/dist/editor.js +2 -34
  24. package/dist/file-format-BgXbr-Ib.js +160 -0
  25. package/dist/files-Bug33qCl.js +743 -0
  26. package/dist/files.d.ts +2 -243
  27. package/dist/files.js +3 -41
  28. package/dist/focus-BcE_SHqz.js +57 -0
  29. package/dist/format-DfcLWqMa.js +54 -0
  30. package/dist/hooks.d.ts +30 -37
  31. package/dist/hooks.js +111 -46
  32. package/dist/index-2UntyjBb.d.ts +52 -0
  33. package/dist/index-BgUHilZm.d.ts +108 -0
  34. package/dist/index-COgqsFAQ.d.ts +42 -0
  35. package/dist/index-CPDET_s1.d.ts +549 -0
  36. package/dist/index-CUhfHT_V.d.ts +204 -0
  37. package/dist/index-Cg6gYAqh.d.ts +73 -0
  38. package/dist/index-Cq-EJzqW.d.ts +16 -0
  39. package/dist/index-DhYmSaLF.d.ts +245 -0
  40. package/dist/index-DjKxO357.d.ts +128 -0
  41. package/dist/index.d.ts +26 -43
  42. package/dist/index.js +35 -472
  43. package/dist/markdown-BGqicV82.js +45 -0
  44. package/dist/markdown.d.ts +3 -18
  45. package/dist/markdown.js +3 -15
  46. package/dist/message-vhUI0c5G.d.ts +16 -0
  47. package/dist/nav.d.ts +6 -8
  48. package/dist/nav.js +29 -11
  49. package/dist/openui-artifact-renderer-D3E5bIAI.d.ts +114 -0
  50. package/dist/openui-artifact-renderer-DrU1AdVk.js +266 -0
  51. package/dist/openui.d.ts +2 -115
  52. package/dist/openui.js +2 -13
  53. package/dist/parts-5mhy9yJ3.d.ts +37 -0
  54. package/dist/primitives-Cb8GGVKr.js +1239 -0
  55. package/dist/primitives.d.ts +5 -525
  56. package/dist/primitives.js +9 -212
  57. package/dist/redaction-CGGB2ENG.js +74 -0
  58. package/dist/redaction.d.ts +2 -42
  59. package/dist/redaction.js +2 -7
  60. package/dist/run-OyWmIDqu.d.ts +41 -0
  61. package/dist/run-ZsIKPA6J.js +17 -0
  62. package/dist/run-group-BACLbCFl.js +410 -0
  63. package/dist/run.d.ts +3 -126
  64. package/dist/run.js +5 -40
  65. package/dist/sdk-hooks.d.ts +2 -285
  66. package/dist/sdk-hooks.js +3 -36
  67. package/dist/stores.d.ts +13 -14
  68. package/dist/stores.js +34 -76
  69. package/dist/table-Bss73DhB.js +146 -0
  70. package/dist/tabs-BVHR6NkO.js +40 -0
  71. package/dist/text-shimmer-BUUo6I-g.js +64 -0
  72. package/dist/tool-call-feed-BeB1_4pX.d.ts +47 -0
  73. package/dist/tool-call-feed-Djt2q11V.js +109 -0
  74. package/dist/tool-call-step-DNebqhmX.js +434 -0
  75. package/dist/tool-display-BAuAVa43.js +158 -0
  76. package/dist/{tool-display-z4JcDmMQ.d.ts → tool-display-DgmL5rIU.d.ts} +16 -16
  77. package/dist/tool-previews.d.ts +2 -48
  78. package/dist/tool-previews.js +2 -23
  79. package/dist/types.d.ts +6 -19
  80. package/dist/types.js +0 -1
  81. package/dist/use-auto-scroll-C5Pjeqon.js +153 -0
  82. package/dist/use-sse-stream-BVgO1QBN.js +884 -0
  83. package/dist/use-sse-stream-Dm6R5YWz.d.ts +282 -0
  84. package/dist/utils-Bl_CZ0Qp.js +37 -0
  85. package/dist/{chunk-RQHJBTEU.js → utils-C_uf36nf.js} +4 -6
  86. package/dist/utils.d.ts +2 -104
  87. package/dist/utils.js +6 -44
  88. package/package.json +39 -41
  89. package/src/lib/focus.ts +2 -1
  90. package/dist/artifact-pane-DpuWcAiF.d.ts +0 -33
  91. package/dist/button-CMQuQEW_.d.ts +0 -17
  92. package/dist/chunk-34A66VBG.js +0 -214
  93. package/dist/chunk-3OI2QKFD.js +0 -0
  94. package/dist/chunk-3XXBZL53.js +0 -174
  95. package/dist/chunk-42PAH5D2.js +0 -112
  96. package/dist/chunk-4CLN43XT.js +0 -45
  97. package/dist/chunk-55WHV7SS.js +0 -1604
  98. package/dist/chunk-565EATZZ.js +0 -156
  99. package/dist/chunk-5Z5ZYMOJ.js +0 -0
  100. package/dist/chunk-6BGQA4BQ.js +0 -0
  101. package/dist/chunk-BEBXZPHW.js +0 -299
  102. package/dist/chunk-C5WF4WMV.js +0 -734
  103. package/dist/chunk-HFL6R6IF.js +0 -37
  104. package/dist/chunk-HGML45QH.js +0 -104
  105. package/dist/chunk-HMAPIH7L.js +0 -595
  106. package/dist/chunk-K5XFRUS4.js +0 -1401
  107. package/dist/chunk-KFQGHD73.js +0 -198
  108. package/dist/chunk-L57WRIND.js +0 -59
  109. package/dist/chunk-LTEKI7YJ.js +0 -59
  110. package/dist/chunk-M3QZK62R.js +0 -233
  111. package/dist/chunk-ND3ZFXQK.js +0 -179
  112. package/dist/chunk-OEX7NZE3.js +0 -321
  113. package/dist/chunk-OL5GYLHV.js +0 -60
  114. package/dist/chunk-QGFYBNSO.js +0 -133
  115. package/dist/chunk-R7B3UWPF.js +0 -550
  116. package/dist/chunk-R7SUY4E3.js +0 -65
  117. package/dist/chunk-REJESC5U.js +0 -117
  118. package/dist/chunk-RQGKSCEZ.js +0 -0
  119. package/dist/chunk-SNLR2AEA.js +0 -40
  120. package/dist/chunk-WKWBTL2V.js +0 -15
  121. package/dist/chunk-X7CU776B.js +0 -1048
  122. package/dist/chunk-XU3HB5QL.js +0 -127
  123. package/dist/chunk-YTO5V6QS.js +0 -19
  124. package/dist/chunk-YU4E5J2N.js +0 -437
  125. package/dist/chunk-YZ6AK25N.js +0 -886
  126. package/dist/code-block-0kSpWMnf.d.ts +0 -25
  127. package/dist/document-editor-pane-IAEQn_Dl.d.ts +0 -128
  128. package/dist/document-editor-pane-QHDOBA43.js +0 -13
  129. package/dist/message-BHWbxBtT.d.ts +0 -15
  130. package/dist/parts-dj7AcUg0.d.ts +0 -36
  131. package/dist/run-PfLmDAox.d.ts +0 -41
  132. package/dist/tool-call-feed-D9iofJgW.d.ts +0 -46
@@ -1,198 +0,0 @@
1
- import {
2
- Avatar,
3
- AvatarFallback,
4
- AvatarImage,
5
- DropdownMenu,
6
- DropdownMenuContent,
7
- DropdownMenuItem,
8
- DropdownMenuLabel,
9
- DropdownMenuSeparator,
10
- DropdownMenuTrigger
11
- } from "./chunk-34A66VBG.js";
12
- import {
13
- Button
14
- } from "./chunk-42PAH5D2.js";
15
- import {
16
- focusRing
17
- } from "./chunk-WKWBTL2V.js";
18
- import {
19
- cn
20
- } from "./chunk-RQHJBTEU.js";
21
-
22
- // src/auth/auth.tsx
23
- import { jsx, jsxs } from "react/jsx-runtime";
24
- function GitHubIcon({ className }) {
25
- return /* @__PURE__ */ jsx(
26
- "svg",
27
- {
28
- className,
29
- viewBox: "0 0 24 24",
30
- fill: "currentColor",
31
- "aria-hidden": "true",
32
- children: /* @__PURE__ */ jsx(
33
- "path",
34
- {
35
- fillRule: "evenodd",
36
- clipRule: "evenodd",
37
- d: "M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z"
38
- }
39
- )
40
- }
41
- );
42
- }
43
- function GitHubLoginButton({
44
- authUrl = "/auth/github",
45
- variant = "default",
46
- className,
47
- children,
48
- ...props
49
- }) {
50
- return /* @__PURE__ */ jsxs(
51
- Button,
52
- {
53
- variant,
54
- className: cn("gap-2", className),
55
- onClick: () => {
56
- window.location.href = authUrl;
57
- },
58
- ...props,
59
- children: [
60
- /* @__PURE__ */ jsx(GitHubIcon, { className: "h-5 w-5" }),
61
- children ?? "Sign in with GitHub"
62
- ]
63
- }
64
- );
65
- }
66
- function UserMenu({
67
- user,
68
- logoutUrl = "/auth/logout",
69
- links = [],
70
- variant = "sandbox",
71
- onLogout
72
- }) {
73
- const initials = user.name ? user.name.split(" ").map((n) => n[0]).join("").toUpperCase().slice(0, 2) : user.email.slice(0, 2).toUpperCase();
74
- const avatarGradient = {
75
- sandbox: "bg-[image:var(--accent-gradient-strong)]"
76
- }[variant];
77
- const handleLogout = () => {
78
- if (onLogout) {
79
- onLogout();
80
- }
81
- window.location.href = logoutUrl;
82
- };
83
- return /* @__PURE__ */ jsxs(DropdownMenu, { children: [
84
- /* @__PURE__ */ jsx(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(
85
- "button",
86
- {
87
- type: "button",
88
- className: cn(
89
- "flex items-center gap-2 rounded-lg p-1.5 transition-colors hover:bg-accent",
90
- focusRing
91
- ),
92
- children: [
93
- /* @__PURE__ */ jsxs(Avatar, { className: "h-8 w-8", children: [
94
- /* @__PURE__ */ jsx(AvatarImage, { src: void 0, alt: user.name ?? user.email }),
95
- /* @__PURE__ */ jsx(
96
- AvatarFallback,
97
- {
98
- className: cn(
99
- "text-white text-xs",
100
- avatarGradient
101
- ),
102
- children: initials
103
- }
104
- )
105
- ] }),
106
- /* @__PURE__ */ jsxs("div", { className: "hidden text-left md:block", children: [
107
- /* @__PURE__ */ jsx("p", { className: "font-medium text-sm", children: user.name ?? user.email }),
108
- user.tier && /* @__PURE__ */ jsxs("p", { className: "text-muted-foreground text-xs capitalize", children: [
109
- user.tier,
110
- " Plan"
111
- ] })
112
- ] })
113
- ]
114
- }
115
- ) }),
116
- /* @__PURE__ */ jsxs(DropdownMenuContent, { align: "end", className: "w-56", children: [
117
- /* @__PURE__ */ jsx(DropdownMenuLabel, { className: "font-normal", children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col space-y-1", children: [
118
- /* @__PURE__ */ jsx("p", { className: "font-medium text-sm", children: user.name ?? "Account" }),
119
- /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-xs", children: user.email })
120
- ] }) }),
121
- /* @__PURE__ */ jsx(DropdownMenuSeparator, {}),
122
- links.map((link) => /* @__PURE__ */ jsx(DropdownMenuItem, { asChild: true, children: /* @__PURE__ */ jsxs("a", { href: link.href, className: "flex items-center gap-2", children: [
123
- link.icon,
124
- link.label
125
- ] }) }, link.href)),
126
- links.length > 0 && /* @__PURE__ */ jsx(DropdownMenuSeparator, {}),
127
- /* @__PURE__ */ jsx(
128
- DropdownMenuItem,
129
- {
130
- onClick: handleLogout,
131
- className: "text-[var(--surface-danger-text)] focus:text-[var(--surface-danger-text)]",
132
- children: "Sign out"
133
- }
134
- )
135
- ] })
136
- ] });
137
- }
138
- function AuthHeader({
139
- user,
140
- loading = false,
141
- variant = "sandbox",
142
- apiBaseUrl = "",
143
- menuLinks,
144
- className
145
- }) {
146
- if (loading) {
147
- return /* @__PURE__ */ jsxs("div", { className: cn("flex items-center gap-2", className), children: [
148
- /* @__PURE__ */ jsx("div", { className: "h-8 w-8 animate-pulse rounded-full bg-muted" }),
149
- /* @__PURE__ */ jsx("div", { className: "hidden md:block", children: /* @__PURE__ */ jsx("div", { className: "h-4 w-20 animate-pulse rounded bg-muted" }) })
150
- ] });
151
- }
152
- if (!user) {
153
- return /* @__PURE__ */ jsx("div", { className: cn("flex items-center gap-2", className), children: /* @__PURE__ */ jsx(
154
- GitHubLoginButton,
155
- {
156
- authUrl: `${apiBaseUrl}/auth/github`,
157
- variant,
158
- size: "sm"
159
- }
160
- ) });
161
- }
162
- return /* @__PURE__ */ jsx(
163
- UserMenu,
164
- {
165
- user,
166
- variant,
167
- logoutUrl: `${apiBaseUrl}/auth/logout`,
168
- links: menuLinks
169
- }
170
- );
171
- }
172
-
173
- // src/auth/login-layout.tsx
174
- import { Terminal } from "lucide-react";
175
- import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
176
- function LoginLayout({
177
- title = "Welcome Back",
178
- subtitle = "Sign in to your workspace.",
179
- brandIcon,
180
- children,
181
- className
182
- }) {
183
- return /* @__PURE__ */ jsx2("div", { className: cn("relative flex min-h-screen items-center justify-center bg-background overflow-hidden antialiased font-sans flex-col", className), children: /* @__PURE__ */ jsxs2("div", { className: "z-10 w-full max-w-md px-6 animate-in flex flex-col items-center", children: [
184
- /* @__PURE__ */ jsxs2("div", { className: "mb-10 text-center flex flex-col items-center", children: [
185
- /* @__PURE__ */ jsx2("div", { className: "inline-flex h-14 w-14 mb-4 items-center justify-center rounded-lg bg-muted border border-border", children: brandIcon || /* @__PURE__ */ jsx2(Terminal, { className: "h-7 w-7 text-foreground" }) }),
186
- /* @__PURE__ */ jsx2("h1", { className: "text-2xl font-bold tracking-tight text-foreground font-display", children: title }),
187
- /* @__PURE__ */ jsx2("p", { className: "mt-2 text-sm text-muted-foreground", children: subtitle })
188
- ] }),
189
- /* @__PURE__ */ jsx2("div", { className: "w-full bg-card p-8 border border-border rounded-lg", children })
190
- ] }) });
191
- }
192
-
193
- export {
194
- GitHubLoginButton,
195
- UserMenu,
196
- AuthHeader,
197
- LoginLayout
198
- };
@@ -1,59 +0,0 @@
1
- import {
2
- cn
3
- } from "./chunk-RQHJBTEU.js";
4
-
5
- // src/primitives/text-shimmer.tsx
6
- import { useEffect, useLayoutEffect } from "react";
7
- import { jsx } from "react/jsx-runtime";
8
- var CLASS_NAME = "tangle-text-shimmer";
9
- var STYLE_ID = "tangle-text-shimmer-styles";
10
- var SHIMMER_CSS = `
11
- @keyframes ${CLASS_NAME} {
12
- from { -webkit-mask-position: 150% center; mask-position: 150% center; }
13
- to { -webkit-mask-position: -50% center; mask-position: -50% center; }
14
- }
15
- .${CLASS_NAME} {
16
- -webkit-mask-image: linear-gradient(90deg, rgba(0,0,0,0.72) 0%, #000 45%, rgba(0,0,0,0.72) 60%);
17
- mask-image: linear-gradient(90deg, rgba(0,0,0,0.72) 0%, #000 45%, rgba(0,0,0,0.72) 60%);
18
- -webkit-mask-size: 250% 100%;
19
- mask-size: 250% 100%;
20
- animation: ${CLASS_NAME} 1.4s linear infinite;
21
- }
22
- @media (prefers-reduced-motion: reduce) {
23
- .${CLASS_NAME} {
24
- animation: none;
25
- -webkit-mask-image: none;
26
- mask-image: none;
27
- text-decoration: underline dotted currentColor;
28
- text-underline-offset: 3px;
29
- }
30
- }
31
- `;
32
- function ensureShimmerStyles() {
33
- if (typeof document === "undefined") return;
34
- if (document.getElementById(STYLE_ID)) return;
35
- const style = document.createElement("style");
36
- style.id = STYLE_ID;
37
- style.textContent = SHIMMER_CSS;
38
- document.head.appendChild(style);
39
- }
40
- var useIsomorphicLayoutEffect = typeof window === "undefined" ? useEffect : useLayoutEffect;
41
- function TextShimmer({
42
- children,
43
- className,
44
- durationMs = 1400
45
- }) {
46
- useIsomorphicLayoutEffect(ensureShimmerStyles, []);
47
- return /* @__PURE__ */ jsx(
48
- "span",
49
- {
50
- className: cn(CLASS_NAME, "text-foreground", className),
51
- style: { animationDuration: `${durationMs}ms` },
52
- children
53
- }
54
- );
55
- }
56
-
57
- export {
58
- TextShimmer
59
- };
@@ -1,59 +0,0 @@
1
- import {
2
- cn
3
- } from "./chunk-RQHJBTEU.js";
4
-
5
- // src/primitives/artifact-pane.tsx
6
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
7
- function ArtifactPane({
8
- eyebrow,
9
- title,
10
- subtitle,
11
- meta,
12
- headerActions,
13
- tabs,
14
- toolbar,
15
- footer,
16
- emptyState,
17
- children,
18
- className,
19
- contentClassName,
20
- headerClassName,
21
- hideTitleBlock = false
22
- }) {
23
- const hasContent = children !== void 0 && children !== null;
24
- const showTitleRow = !hideTitleBlock || Boolean(headerActions);
25
- const hasHeader = showTitleRow || Boolean(tabs) || Boolean(toolbar);
26
- const toolbarNeedsDivider = showTitleRow || Boolean(tabs);
27
- return /* @__PURE__ */ jsxs(
28
- "section",
29
- {
30
- className: cn(
31
- "flex h-full min-h-0 flex-col overflow-hidden bg-background text-foreground",
32
- className
33
- ),
34
- children: [
35
- hasHeader && /* @__PURE__ */ jsxs("header", { className: cn("border-b border-border bg-muted/10", headerClassName), children: [
36
- showTitleRow && /* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between gap-3 px-3 py-2", children: [
37
- /* @__PURE__ */ jsx("div", { className: "min-w-0 flex-1", children: !hideTitleBlock && /* @__PURE__ */ jsxs(Fragment, { children: [
38
- eyebrow && /* @__PURE__ */ jsx("div", { className: "mb-1 inline-flex max-w-full items-center px-1 py-0.5 text-[10px] font-bold uppercase tracking-wider text-muted-foreground", children: eyebrow }),
39
- /* @__PURE__ */ jsx("div", { className: "min-w-0 text-[13px] font-medium text-foreground", children: title }),
40
- (subtitle || meta) && /* @__PURE__ */ jsxs("div", { className: "mt-1 flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1 text-xs leading-relaxed text-muted-foreground", children: [
41
- subtitle && /* @__PURE__ */ jsx("span", { className: "truncate", children: subtitle }),
42
- meta && /* @__PURE__ */ jsx("span", { className: "flex items-center gap-2", children: meta })
43
- ] })
44
- ] }) }),
45
- headerActions && /* @__PURE__ */ jsx("div", { className: "flex shrink-0 items-center gap-1.5", children: headerActions })
46
- ] }),
47
- tabs,
48
- toolbar && /* @__PURE__ */ jsx("div", { className: cn("px-3 py-2", toolbarNeedsDivider && "border-t border-border"), children: toolbar })
49
- ] }),
50
- /* @__PURE__ */ jsx("div", { className: cn("min-h-0 flex-1 overflow-auto", contentClassName), children: hasContent ? children : emptyState ? /* @__PURE__ */ jsx("div", { className: "flex h-full items-center justify-center p-6", children: emptyState }) : null }),
51
- footer && /* @__PURE__ */ jsx("footer", { className: "shrink-0 border-t border-border bg-card px-3 py-2", children: footer })
52
- ]
53
- }
54
- );
55
- }
56
-
57
- export {
58
- ArtifactPane
59
- };
@@ -1,233 +0,0 @@
1
- import {
2
- focusRing
3
- } from "./chunk-WKWBTL2V.js";
4
- import {
5
- cn
6
- } from "./chunk-RQHJBTEU.js";
7
-
8
- // src/primitives/card.tsx
9
- import * as React from "react";
10
- import { jsx } from "react/jsx-runtime";
11
- var Card = React.forwardRef(({ className, variant = "default", hover = false, ...props }, ref) => {
12
- const variants = {
13
- default: "bg-card border-border",
14
- elevated: "bg-muted/50 border-border shadow-[var(--shadow-card)]",
15
- glass: "bg-card/80 backdrop-blur-xl border-border shadow-[var(--shadow-card)]",
16
- sandbox: "bg-muted/50 border-primary/20 shadow-[var(--shadow-accent)]"
17
- };
18
- return /* @__PURE__ */ jsx(
19
- "div",
20
- {
21
- ref,
22
- className: cn(
23
- "rounded-[var(--radius-lg)] border text-card-foreground transition-[border-color,box-shadow]",
24
- "duration-[var(--transition-default)]",
25
- variants[variant],
26
- hover && "cursor-pointer hover:border-[var(--border-strong)]",
27
- className
28
- ),
29
- ...props
30
- }
31
- );
32
- });
33
- Card.displayName = "Card";
34
- var CardHeader = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
35
- "div",
36
- {
37
- ref,
38
- className: cn("flex flex-col space-y-1 p-4", className),
39
- ...props
40
- }
41
- ));
42
- CardHeader.displayName = "CardHeader";
43
- var CardTitle = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
44
- "h3",
45
- {
46
- ref,
47
- className: cn("font-semibold leading-none tracking-tight", className),
48
- ...props
49
- }
50
- ));
51
- CardTitle.displayName = "CardTitle";
52
- var CardDescription = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
53
- "p",
54
- {
55
- ref,
56
- className: cn("text-muted-foreground text-sm", className),
57
- ...props
58
- }
59
- ));
60
- CardDescription.displayName = "CardDescription";
61
- var CardContent = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("p-4 pt-0", className), ...props }));
62
- CardContent.displayName = "CardContent";
63
- var CardFooter = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
64
- "div",
65
- {
66
- ref,
67
- className: cn("flex items-center p-6 pt-0", className),
68
- ...props
69
- }
70
- ));
71
- CardFooter.displayName = "CardFooter";
72
-
73
- // src/primitives/badge.tsx
74
- import { cva } from "class-variance-authority";
75
- import { jsx as jsx2, jsxs } from "react/jsx-runtime";
76
- var badgeVariants = cva(
77
- `inline-flex items-center gap-1.5 rounded-full border px-2.5 py-0.5 font-medium text-xs transition-colors ${focusRing}`,
78
- {
79
- variants: {
80
- variant: {
81
- default: "border-transparent bg-primary text-primary-foreground",
82
- secondary: "border-transparent bg-secondary text-secondary-foreground",
83
- destructive: "border-transparent bg-destructive/15 border-destructive/25 text-destructive",
84
- outline: "text-foreground border-border",
85
- success: "border-[var(--surface-success-border)] bg-[var(--surface-success-bg)] text-[var(--surface-success-text)]",
86
- warning: "border-[var(--surface-warning-border)] bg-[var(--surface-warning-bg)] text-[var(--surface-warning-text)]",
87
- error: "border-[var(--surface-danger-border)] bg-[var(--surface-danger-bg)] text-[var(--surface-danger-text)]",
88
- info: "border-[var(--surface-info-border)] bg-[var(--surface-info-bg)] text-[var(--surface-info-text)]",
89
- sandbox: "border-border bg-[var(--accent-surface-soft)] text-[var(--accent-text)]",
90
- /* Operational status variants */
91
- running: "border-[var(--surface-teal-border)] bg-[var(--surface-teal-bg)] text-[var(--surface-teal-text)]",
92
- creating: "border-[var(--surface-violet-border)] bg-[var(--surface-violet-bg)] text-[var(--surface-violet-text)]",
93
- stopped: "border-[var(--surface-warning-border)] bg-[var(--surface-warning-bg)] text-[var(--surface-warning-text)]",
94
- warm: "border-[var(--surface-orange-border)] bg-[var(--surface-orange-bg)] text-[var(--surface-orange-text)]",
95
- cold: "border-[var(--surface-info-border)] bg-[var(--surface-info-bg)] text-[var(--surface-info-text)]",
96
- deleted: "border-[var(--surface-neutral-border)] bg-[var(--surface-neutral-bg)] text-[var(--surface-neutral-text)]"
97
- }
98
- },
99
- defaultVariants: {
100
- variant: "default"
101
- }
102
- }
103
- );
104
- var statusDotClass = {
105
- running: "status-dot status-dot-running",
106
- creating: "status-dot status-dot-creating",
107
- stopped: "status-dot status-dot-stopped",
108
- warm: "status-dot status-dot-warm",
109
- cold: "status-dot status-dot-cold",
110
- error: "status-dot status-dot-error",
111
- deleted: "status-dot status-dot-deleted"
112
- };
113
- function Badge({ className, variant, dot, children, ...props }) {
114
- const dotClass = dot && variant ? statusDotClass[variant] : null;
115
- return /* @__PURE__ */ jsxs("div", { className: cn(badgeVariants({ variant }), className), ...props, children: [
116
- dotClass && /* @__PURE__ */ jsx2("span", { className: dotClass, "aria-hidden": true }),
117
- children
118
- ] });
119
- }
120
-
121
- // src/primitives/table.tsx
122
- import * as React2 from "react";
123
- import { jsx as jsx3 } from "react/jsx-runtime";
124
- var Table = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx3("div", { className: "relative w-full overflow-auto", children: /* @__PURE__ */ jsx3(
125
- "table",
126
- {
127
- ref,
128
- className: cn("w-full caption-bottom text-sm", className),
129
- ...props
130
- }
131
- ) }));
132
- Table.displayName = "Table";
133
- var TableHeader = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx3("thead", { ref, className: cn("[&_tr]:border-b", className), ...props }));
134
- TableHeader.displayName = "TableHeader";
135
- var TableBody = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx3(
136
- "tbody",
137
- {
138
- ref,
139
- className: cn("[&_tr:last-child]:border-0", className),
140
- ...props
141
- }
142
- ));
143
- TableBody.displayName = "TableBody";
144
- var TableFooter = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx3(
145
- "tfoot",
146
- {
147
- ref,
148
- className: cn(
149
- "border-t bg-card font-medium [&>tr]:last:border-b-0",
150
- className
151
- ),
152
- ...props
153
- }
154
- ));
155
- TableFooter.displayName = "TableFooter";
156
- var TableRow = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx3(
157
- "tr",
158
- {
159
- ref,
160
- className: cn(
161
- "border-border border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted/50",
162
- className
163
- ),
164
- ...props
165
- }
166
- ));
167
- TableRow.displayName = "TableRow";
168
- var TableHead = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx3(
169
- "th",
170
- {
171
- ref,
172
- className: cn(
173
- "h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",
174
- className
175
- ),
176
- ...props
177
- }
178
- ));
179
- TableHead.displayName = "TableHead";
180
- var TableCell = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx3(
181
- "td",
182
- {
183
- ref,
184
- className: cn("p-4 align-middle [&:has([role=checkbox])]:pr-0", className),
185
- ...props
186
- }
187
- ));
188
- TableCell.displayName = "TableCell";
189
- var TableCaption = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx3(
190
- "caption",
191
- {
192
- ref,
193
- className: cn("mt-4 text-muted-foreground text-sm", className),
194
- ...props
195
- }
196
- ));
197
- TableCaption.displayName = "TableCaption";
198
-
199
- // src/primitives/code-block.tsx
200
- import { jsx as jsx4 } from "react/jsx-runtime";
201
- function InlineCode({ className, children, ...props }) {
202
- return /* @__PURE__ */ jsx4(
203
- "code",
204
- {
205
- className: cn(
206
- "rounded border border-border bg-card px-1.5 py-0.5 font-mono text-[0.85em] text-[var(--code-keyword)]",
207
- className
208
- ),
209
- ...props,
210
- children
211
- }
212
- );
213
- }
214
-
215
- export {
216
- Card,
217
- CardHeader,
218
- CardTitle,
219
- CardDescription,
220
- CardContent,
221
- CardFooter,
222
- badgeVariants,
223
- Badge,
224
- Table,
225
- TableHeader,
226
- TableBody,
227
- TableFooter,
228
- TableRow,
229
- TableHead,
230
- TableCell,
231
- TableCaption,
232
- InlineCode
233
- };