@reifydb/ui 0.4.7
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/index.cjs +684 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +270 -0
- package/dist/index.d.ts +270 -0
- package/dist/index.mjs +608 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +85 -0
- package/src/fonts/ibm-plex-mono/ibm-plex-mono-bold.woff2 +0 -0
- package/src/fonts/ibm-plex-mono/ibm-plex-mono-medium.woff2 +0 -0
- package/src/fonts/ibm-plex-mono/ibm-plex-mono-regular.woff2 +0 -0
- package/src/fonts/ibm-plex-mono/ibm-plex-mono-semi-bold.woff2 +0 -0
- package/src/fonts/inter/inter-bold.woff2 +0 -0
- package/src/fonts/inter/inter-medium.woff2 +0 -0
- package/src/fonts/inter/inter-regular.woff2 +0 -0
- package/src/fonts/inter/inter-semi-bold.woff2 +0 -0
- package/src/styles/base.css +180 -0
- package/src/styles/fonts.css +68 -0
- package/src/styles/index.css +7 -0
- package/src/styles/theme.css +73 -0
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,608 @@
|
|
|
1
|
+
// src/components/badge/badge.tsx
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
var variantStyles = {
|
|
4
|
+
active: "font-bold text-primary",
|
|
5
|
+
inactive: "text-text-secondary",
|
|
6
|
+
"coming-soon": "text-text-secondary",
|
|
7
|
+
default: "text-text-primary",
|
|
8
|
+
signal: "font-bold text-primary",
|
|
9
|
+
success: "text-[11px] font-medium rounded-full border px-2.5 py-0.5 bg-status-success/15 text-status-success border-status-success/30",
|
|
10
|
+
danger: "text-[11px] font-medium rounded-full border px-2.5 py-0.5 bg-status-error/15 text-status-error border-status-error/30",
|
|
11
|
+
warning: "text-[11px] font-medium rounded-full border px-2.5 py-0.5 bg-status-warning/15 text-status-warning border-status-warning/30",
|
|
12
|
+
error: "text-[11px] font-medium rounded-full border px-2.5 py-0.5 bg-status-error/15 text-status-error border-status-error/30",
|
|
13
|
+
outline: "text-text-muted"
|
|
14
|
+
};
|
|
15
|
+
function Badge({ variant = "default", children, className = "", onClick }) {
|
|
16
|
+
return /* @__PURE__ */ jsx(
|
|
17
|
+
"span",
|
|
18
|
+
{
|
|
19
|
+
className: `inline-flex items-center ${variantStyles[variant]} ${className}`,
|
|
20
|
+
onClick,
|
|
21
|
+
children
|
|
22
|
+
}
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// src/components/button/button.tsx
|
|
27
|
+
import { forwardRef } from "react";
|
|
28
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
29
|
+
var variantStyles2 = {
|
|
30
|
+
primary: "bg-primary text-[var(--accent-text,#1a1a1a)] font-semibold border-primary hover:brightness-110 hover:shadow-[0_0_16px_rgba(255,255,255,0.1)]",
|
|
31
|
+
secondary: "bg-transparent text-text-secondary border-border-default font-medium hover:border-primary hover:text-primary",
|
|
32
|
+
ghost: "text-text-secondary border-transparent hover:bg-white/[0.04] hover:text-text-primary",
|
|
33
|
+
danger: "bg-status-error/10 text-status-error border-status-error/30 hover:bg-status-error/20",
|
|
34
|
+
destructive: "bg-status-error text-white font-semibold border-status-error hover:bg-status-error/90",
|
|
35
|
+
link: "text-primary border-transparent underline-offset-4 hover:underline"
|
|
36
|
+
};
|
|
37
|
+
var sizeStyles = {
|
|
38
|
+
sm: "h-8 px-3 text-xs gap-1.5",
|
|
39
|
+
md: "h-9 px-4 text-sm gap-2",
|
|
40
|
+
lg: "h-11 px-6 text-sm gap-2",
|
|
41
|
+
icon: "h-9 w-9 p-0"
|
|
42
|
+
};
|
|
43
|
+
var Button = forwardRef(
|
|
44
|
+
({ variant = "primary", size = "md", className = "", children, disabled, ...props }, ref) => {
|
|
45
|
+
return /* @__PURE__ */ jsx2(
|
|
46
|
+
"button",
|
|
47
|
+
{
|
|
48
|
+
ref,
|
|
49
|
+
className: `inline-flex items-center justify-center font-medium transition-all duration-200
|
|
50
|
+
rounded-lg border
|
|
51
|
+
focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary
|
|
52
|
+
disabled:pointer-events-none disabled:opacity-50
|
|
53
|
+
${variantStyles2[variant]} ${sizeStyles[size]} ${className}`,
|
|
54
|
+
disabled,
|
|
55
|
+
...props,
|
|
56
|
+
children
|
|
57
|
+
}
|
|
58
|
+
);
|
|
59
|
+
}
|
|
60
|
+
);
|
|
61
|
+
Button.displayName = "Button";
|
|
62
|
+
|
|
63
|
+
// src/components/card/card.tsx
|
|
64
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
65
|
+
function Card({ children, className = "" }) {
|
|
66
|
+
return /* @__PURE__ */ jsx3("div", { className: `glass-card p-6 ${className}`, children });
|
|
67
|
+
}
|
|
68
|
+
function CardHeader({ children, className = "" }) {
|
|
69
|
+
return /* @__PURE__ */ jsx3("div", { className: `mb-4 ${className}`, children });
|
|
70
|
+
}
|
|
71
|
+
function CardTitle({ children, className = "" }) {
|
|
72
|
+
return /* @__PURE__ */ jsx3("h3", { className: `text-sm font-medium text-text-primary ${className}`, children });
|
|
73
|
+
}
|
|
74
|
+
function CardDescription({ children, className = "" }) {
|
|
75
|
+
return /* @__PURE__ */ jsx3("p", { className: `mt-1 text-xs text-text-muted ${className}`, children });
|
|
76
|
+
}
|
|
77
|
+
function CardContent({ children, className = "" }) {
|
|
78
|
+
return /* @__PURE__ */ jsx3("div", { className, children });
|
|
79
|
+
}
|
|
80
|
+
function CardFooter({ children, className = "" }) {
|
|
81
|
+
return /* @__PURE__ */ jsx3("div", { className: `pt-4 mt-4 border-t border-white/[0.06] ${className}`, children });
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
// src/components/chip/chip.tsx
|
|
85
|
+
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
86
|
+
function Chip({ active, onClick, children, className = "" }) {
|
|
87
|
+
return /* @__PURE__ */ jsx4(
|
|
88
|
+
"button",
|
|
89
|
+
{
|
|
90
|
+
onClick,
|
|
91
|
+
className: `text-xs font-medium px-3 py-1 rounded-lg border cursor-pointer whitespace-nowrap transition-all ${active ? "text-primary border-primary/30 bg-primary/10" : "text-text-secondary bg-white/[0.04] border-white/[0.08] hover:text-text-primary hover:border-white/[0.12]"} ${className}`,
|
|
92
|
+
children
|
|
93
|
+
}
|
|
94
|
+
);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
// src/components/chip-group/chip-group.tsx
|
|
98
|
+
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
99
|
+
function ChipGroup(props) {
|
|
100
|
+
const { options, className = "" } = props;
|
|
101
|
+
return /* @__PURE__ */ jsx5("div", { className: `flex items-center gap-2 ${className}`, children: options.map((option) => {
|
|
102
|
+
const isActive = props.multiple ? props.value.includes(option.value) : props.value === option.value;
|
|
103
|
+
const handleClick = () => {
|
|
104
|
+
if (props.multiple) {
|
|
105
|
+
const next = props.value.includes(option.value) ? props.value.filter((v) => v !== option.value) : [...props.value, option.value];
|
|
106
|
+
props.onChange(next);
|
|
107
|
+
} else {
|
|
108
|
+
props.onChange(option.value);
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
return /* @__PURE__ */ jsx5(Chip, { active: isActive, onClick: handleClick, children: option.label }, option.value);
|
|
112
|
+
}) });
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
// src/components/code-block/code-block.tsx
|
|
116
|
+
import { useMemo } from "react";
|
|
117
|
+
import Prism from "prismjs";
|
|
118
|
+
import "prismjs/components/prism-json";
|
|
119
|
+
import "prismjs/components/prism-bash";
|
|
120
|
+
import "prismjs/components/prism-python";
|
|
121
|
+
import "prismjs/components/prism-javascript";
|
|
122
|
+
import "prismjs/components/prism-typescript";
|
|
123
|
+
import "prismjs/components/prism-rust";
|
|
124
|
+
|
|
125
|
+
// src/components/copy-button/copy-button.tsx
|
|
126
|
+
import { useState, useCallback } from "react";
|
|
127
|
+
import { Fragment, jsx as jsx6, jsxs } from "react/jsx-runtime";
|
|
128
|
+
function CopyButton({ text, className = "", label, onCopy }) {
|
|
129
|
+
const [copied, setCopied] = useState(false);
|
|
130
|
+
const handleCopy = useCallback(async () => {
|
|
131
|
+
await navigator.clipboard.writeText(text);
|
|
132
|
+
setCopied(true);
|
|
133
|
+
setTimeout(() => setCopied(false), 2e3);
|
|
134
|
+
onCopy?.();
|
|
135
|
+
}, [text, onCopy]);
|
|
136
|
+
return /* @__PURE__ */ jsx6(
|
|
137
|
+
"button",
|
|
138
|
+
{
|
|
139
|
+
onClick: handleCopy,
|
|
140
|
+
className: `inline-flex items-center gap-1.5 px-2 py-1 text-xs text-text-muted
|
|
141
|
+
rounded-sm border border-white/[0.08] transition-colors duration-75 hover:bg-white/[0.06] hover:text-text-primary ${className}`,
|
|
142
|
+
children: copied ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
143
|
+
/* @__PURE__ */ jsx6("svg", { width: "14", height: "14", viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ jsx6("path", { d: "M3 8.5l3 3 7-7", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) }),
|
|
144
|
+
label ? "Copied!" : null
|
|
145
|
+
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
146
|
+
/* @__PURE__ */ jsxs("svg", { width: "14", height: "14", viewBox: "0 0 16 16", fill: "none", children: [
|
|
147
|
+
/* @__PURE__ */ jsx6("rect", { x: "5", y: "5", width: "8", height: "8", rx: "1.5", stroke: "currentColor", strokeWidth: "1.5" }),
|
|
148
|
+
/* @__PURE__ */ jsx6("path", { d: "M3 11V3.5A.5.5 0 013.5 3H11", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" })
|
|
149
|
+
] }),
|
|
150
|
+
label ?? null
|
|
151
|
+
] })
|
|
152
|
+
}
|
|
153
|
+
);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
// src/components/code-block/code-block.tsx
|
|
157
|
+
import { jsx as jsx7, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
158
|
+
function CodeBlock({ code, language = "bash", showCopy = true, className = "" }) {
|
|
159
|
+
const highlightedHtml = useMemo(() => {
|
|
160
|
+
if (code.length >= 5e4 || !Prism.languages[language]) return null;
|
|
161
|
+
return Prism.highlight(code, Prism.languages[language], language);
|
|
162
|
+
}, [code, language]);
|
|
163
|
+
return /* @__PURE__ */ jsxs2("div", { className: `group relative bg-code-bg ${className}`, children: [
|
|
164
|
+
showCopy && /* @__PURE__ */ jsx7("div", { className: "absolute right-2 top-2 opacity-0 transition-opacity group-hover:opacity-100", children: /* @__PURE__ */ jsx7(CopyButton, { text: code }) }),
|
|
165
|
+
/* @__PURE__ */ jsx7("pre", { className: `language-${language} !bg-code-bg !m-0`, children: highlightedHtml != null ? /* @__PURE__ */ jsx7("code", { className: `language-${language}`, dangerouslySetInnerHTML: { __html: highlightedHtml } }) : /* @__PURE__ */ jsx7("code", { className: `language-${language}`, children: code }) })
|
|
166
|
+
] });
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
// src/components/dialog/dialog.tsx
|
|
170
|
+
import { useEffect, forwardRef as forwardRef2 } from "react";
|
|
171
|
+
import { jsx as jsx8, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
172
|
+
function Dialog({ open, onOpenChange, children }) {
|
|
173
|
+
useEffect(() => {
|
|
174
|
+
if (open) {
|
|
175
|
+
document.body.style.overflow = "hidden";
|
|
176
|
+
} else {
|
|
177
|
+
document.body.style.overflow = "unset";
|
|
178
|
+
}
|
|
179
|
+
return () => {
|
|
180
|
+
document.body.style.overflow = "unset";
|
|
181
|
+
};
|
|
182
|
+
}, [open]);
|
|
183
|
+
useEffect(() => {
|
|
184
|
+
const handleEscape = (e) => {
|
|
185
|
+
if (e.key === "Escape") onOpenChange(false);
|
|
186
|
+
};
|
|
187
|
+
if (open) {
|
|
188
|
+
document.addEventListener("keydown", handleEscape);
|
|
189
|
+
}
|
|
190
|
+
return () => {
|
|
191
|
+
document.removeEventListener("keydown", handleEscape);
|
|
192
|
+
};
|
|
193
|
+
}, [open, onOpenChange]);
|
|
194
|
+
if (!open) return null;
|
|
195
|
+
return /* @__PURE__ */ jsxs3("div", { className: "fixed inset-0 z-50 flex items-center justify-center", children: [
|
|
196
|
+
/* @__PURE__ */ jsx8("div", { className: "fixed inset-0 bg-black/60", onClick: () => onOpenChange(false) }),
|
|
197
|
+
/* @__PURE__ */ jsx8("div", { className: "relative z-50", children })
|
|
198
|
+
] });
|
|
199
|
+
}
|
|
200
|
+
var DialogContent = forwardRef2(
|
|
201
|
+
({ className = "", children }, ref) => /* @__PURE__ */ jsx8(
|
|
202
|
+
"div",
|
|
203
|
+
{
|
|
204
|
+
ref,
|
|
205
|
+
className: `relative w-full max-w-lg mx-4 bg-white/[0.04] backdrop-blur-2xl border border-white/[0.10] rounded-[var(--radius-lg)] shadow-xl ${className}`,
|
|
206
|
+
onClick: (e) => e.stopPropagation(),
|
|
207
|
+
children
|
|
208
|
+
}
|
|
209
|
+
)
|
|
210
|
+
);
|
|
211
|
+
DialogContent.displayName = "DialogContent";
|
|
212
|
+
function DialogHeader({ children, className = "" }) {
|
|
213
|
+
return /* @__PURE__ */ jsx8("div", { className: `flex flex-col gap-1.5 p-6 border-b border-white/[0.06] ${className}`, children });
|
|
214
|
+
}
|
|
215
|
+
var DialogTitle = forwardRef2(
|
|
216
|
+
({ children, className = "" }, ref) => /* @__PURE__ */ jsx8("h2", { ref, className: `text-base font-semibold text-text-primary ${className}`, children })
|
|
217
|
+
);
|
|
218
|
+
DialogTitle.displayName = "DialogTitle";
|
|
219
|
+
var DialogDescription = forwardRef2(
|
|
220
|
+
({ children, className = "" }, ref) => /* @__PURE__ */ jsx8("p", { ref, className: `text-sm text-text-muted ${className}`, children })
|
|
221
|
+
);
|
|
222
|
+
DialogDescription.displayName = "DialogDescription";
|
|
223
|
+
var DialogClose = forwardRef2(
|
|
224
|
+
({ className = "", ...props }, ref) => /* @__PURE__ */ jsx8(
|
|
225
|
+
"button",
|
|
226
|
+
{
|
|
227
|
+
ref,
|
|
228
|
+
className: `absolute right-4 top-4 h-6 w-6 flex items-center justify-center text-text-muted hover:text-text-primary transition-colors ${className}`,
|
|
229
|
+
"aria-label": "Close",
|
|
230
|
+
...props,
|
|
231
|
+
children: /* @__PURE__ */ jsx8("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ jsx8("path", { d: "M4 4l8 8M12 4l-8 8", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" }) })
|
|
232
|
+
}
|
|
233
|
+
)
|
|
234
|
+
);
|
|
235
|
+
DialogClose.displayName = "DialogClose";
|
|
236
|
+
function DialogFooter({ children, className = "" }) {
|
|
237
|
+
return /* @__PURE__ */ jsx8("div", { className: `flex justify-end gap-3 p-6 border-t border-white/[0.06] ${className}`, children });
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
// src/components/empty-state/empty-state.tsx
|
|
241
|
+
import { jsx as jsx9, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
242
|
+
function EmptyState({ icon, title, description, action }) {
|
|
243
|
+
return /* @__PURE__ */ jsxs4("div", { className: "flex flex-col items-center justify-center py-12 text-center", children: [
|
|
244
|
+
icon && /* @__PURE__ */ jsx9("div", { className: "mb-4 text-text-muted", children: icon }),
|
|
245
|
+
/* @__PURE__ */ jsx9("h3", { className: "text-sm font-medium text-text-primary", children: title }),
|
|
246
|
+
description && /* @__PURE__ */ jsx9("p", { className: "mt-1 text-sm text-text-muted", children: description }),
|
|
247
|
+
action && /* @__PURE__ */ jsx9("div", { className: "mt-4", children: action })
|
|
248
|
+
] });
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
// src/components/input/input.tsx
|
|
252
|
+
import { forwardRef as forwardRef3 } from "react";
|
|
253
|
+
import { jsx as jsx10, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
254
|
+
var Input = forwardRef3(
|
|
255
|
+
({ label, error, className = "", id, ...props }, ref) => {
|
|
256
|
+
const inputId = id || label?.toLowerCase().replace(/\s+/g, "-");
|
|
257
|
+
return /* @__PURE__ */ jsxs5("div", { className: "flex flex-col gap-1.5", children: [
|
|
258
|
+
label && /* @__PURE__ */ jsx10("label", { htmlFor: inputId, className: "text-sm font-medium text-text-secondary", children: label }),
|
|
259
|
+
/* @__PURE__ */ jsx10(
|
|
260
|
+
"input",
|
|
261
|
+
{
|
|
262
|
+
ref,
|
|
263
|
+
id: inputId,
|
|
264
|
+
className: `h-9 rounded-lg border border-white/[0.08] bg-white/[0.04] px-3 text-sm text-text-primary
|
|
265
|
+
placeholder:text-text-muted
|
|
266
|
+
focus:border-primary focus:outline-none focus:ring-2 focus:ring-primary
|
|
267
|
+
disabled:cursor-not-allowed disabled:opacity-50
|
|
268
|
+
${error ? "border-status-error" : ""} ${className}`,
|
|
269
|
+
...props
|
|
270
|
+
}
|
|
271
|
+
),
|
|
272
|
+
error && /* @__PURE__ */ jsx10("p", { className: "text-xs text-status-error", children: error })
|
|
273
|
+
] });
|
|
274
|
+
}
|
|
275
|
+
);
|
|
276
|
+
Input.displayName = "Input";
|
|
277
|
+
|
|
278
|
+
// src/components/kbd/kbd.tsx
|
|
279
|
+
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
280
|
+
function Kbd({ children, className = "" }) {
|
|
281
|
+
return /* @__PURE__ */ jsx11(
|
|
282
|
+
"kbd",
|
|
283
|
+
{
|
|
284
|
+
className: `inline-flex h-5 min-w-5 items-center justify-center rounded border border-white/[0.08]
|
|
285
|
+
bg-white/[0.06] px-1.5 font-mono text-[10px] font-medium text-text-muted ${className}`,
|
|
286
|
+
children
|
|
287
|
+
}
|
|
288
|
+
);
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
// src/components/loading/loading.tsx
|
|
292
|
+
import { jsx as jsx12, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
293
|
+
function Loading({ text = "Loading", className = "" }) {
|
|
294
|
+
return /* @__PURE__ */ jsxs6("div", { className: `flex items-center gap-1 text-text-muted text-sm font-mono ${className}`, children: [
|
|
295
|
+
/* @__PURE__ */ jsx12("span", { children: text }),
|
|
296
|
+
/* @__PURE__ */ jsxs6("span", { className: "flex gap-0.5", children: [
|
|
297
|
+
/* @__PURE__ */ jsx12("span", { className: "animate-pulse", style: { animationDelay: "0ms" }, children: "." }),
|
|
298
|
+
/* @__PURE__ */ jsx12("span", { className: "animate-pulse", style: { animationDelay: "200ms" }, children: "." }),
|
|
299
|
+
/* @__PURE__ */ jsx12("span", { className: "animate-pulse", style: { animationDelay: "400ms" }, children: "." })
|
|
300
|
+
] })
|
|
301
|
+
] });
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
// src/components/modal/modal.tsx
|
|
305
|
+
import { useEffect as useEffect2, useCallback as useCallback2 } from "react";
|
|
306
|
+
import { jsx as jsx13, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
307
|
+
function Modal({ open, onClose, title, children, className = "" }) {
|
|
308
|
+
const handleKeyDown = useCallback2(
|
|
309
|
+
(e) => {
|
|
310
|
+
if (e.key === "Escape") onClose();
|
|
311
|
+
},
|
|
312
|
+
[onClose]
|
|
313
|
+
);
|
|
314
|
+
useEffect2(() => {
|
|
315
|
+
if (open) {
|
|
316
|
+
document.addEventListener("keydown", handleKeyDown);
|
|
317
|
+
document.body.style.overflow = "hidden";
|
|
318
|
+
}
|
|
319
|
+
return () => {
|
|
320
|
+
document.removeEventListener("keydown", handleKeyDown);
|
|
321
|
+
document.body.style.overflow = "";
|
|
322
|
+
};
|
|
323
|
+
}, [open, handleKeyDown]);
|
|
324
|
+
if (!open) return null;
|
|
325
|
+
return /* @__PURE__ */ jsxs7("div", { className: "fixed inset-0 z-50 flex items-center justify-center", children: [
|
|
326
|
+
/* @__PURE__ */ jsx13("div", { className: "absolute inset-0 bg-black/60", onClick: onClose }),
|
|
327
|
+
/* @__PURE__ */ jsxs7(
|
|
328
|
+
"div",
|
|
329
|
+
{
|
|
330
|
+
className: `relative w-full max-w-md rounded-[var(--radius-lg)] border border-white/[0.10] bg-white/[0.04] backdrop-blur-2xl p-6 shadow-xl ${className}`,
|
|
331
|
+
children: [
|
|
332
|
+
/* @__PURE__ */ jsxs7("div", { className: "mb-4 flex items-center justify-between", children: [
|
|
333
|
+
/* @__PURE__ */ jsx13("h2", { className: "text-base font-semibold text-text-primary", children: title }),
|
|
334
|
+
/* @__PURE__ */ jsx13(
|
|
335
|
+
"button",
|
|
336
|
+
{
|
|
337
|
+
onClick: onClose,
|
|
338
|
+
className: "p-1 text-text-muted transition-colors rounded-sm hover:bg-white/[0.06]",
|
|
339
|
+
"aria-label": "Close",
|
|
340
|
+
children: /* @__PURE__ */ jsx13("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ jsx13("path", { d: "M4 4l8 8M12 4l-8 8", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" }) })
|
|
341
|
+
}
|
|
342
|
+
)
|
|
343
|
+
] }),
|
|
344
|
+
children
|
|
345
|
+
]
|
|
346
|
+
}
|
|
347
|
+
)
|
|
348
|
+
] });
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
// src/components/nav-tabs/nav-tabs.tsx
|
|
352
|
+
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
353
|
+
var variantStyles3 = {
|
|
354
|
+
underline: {
|
|
355
|
+
container: "flex border-b border-white/[0.06] bg-white/[0.04]",
|
|
356
|
+
item: "px-5 py-2.5 font-mono text-xs uppercase tracking-wider transition-colors border-b-2",
|
|
357
|
+
active: "border-primary font-bold text-text-primary",
|
|
358
|
+
inactive: "border-transparent text-text-muted hover:text-text-primary"
|
|
359
|
+
},
|
|
360
|
+
pill: {
|
|
361
|
+
container: "flex items-center gap-1",
|
|
362
|
+
item: "px-3 py-2 text-sm font-medium transition-colors rounded-lg",
|
|
363
|
+
active: "bg-white/[0.06] text-text-primary",
|
|
364
|
+
inactive: "text-text-muted hover:bg-white/[0.04] hover:text-text-primary"
|
|
365
|
+
}
|
|
366
|
+
};
|
|
367
|
+
function NavTabs({ items, variant = "underline", className = "", renderLink }) {
|
|
368
|
+
const styles = variantStyles3[variant];
|
|
369
|
+
return /* @__PURE__ */ jsx14("nav", { className: `${styles.container} ${className}`, children: items.map((item) => {
|
|
370
|
+
const itemClassName = `${styles.item} ${item.isActive ? styles.active : styles.inactive}`;
|
|
371
|
+
if (renderLink) {
|
|
372
|
+
return /* @__PURE__ */ jsx14("span", { children: renderLink({ href: item.href, className: itemClassName, children: item.label }) }, item.href);
|
|
373
|
+
}
|
|
374
|
+
return /* @__PURE__ */ jsx14("a", { href: item.href, className: itemClassName, children: item.label }, item.href);
|
|
375
|
+
}) });
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
// src/components/section-header/section-header.tsx
|
|
379
|
+
import { jsx as jsx15, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
380
|
+
function SectionHeader({ title, badge, className = "" }) {
|
|
381
|
+
return /* @__PURE__ */ jsxs8("div", { className: `flex items-center justify-between bg-white/[0.06] px-3 py-2.5 rounded-t-xl ${className}`, children: [
|
|
382
|
+
/* @__PURE__ */ jsx15("span", { className: "text-xs font-semibold text-text-secondary", children: title }),
|
|
383
|
+
badge
|
|
384
|
+
] });
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
// src/components/select/select.tsx
|
|
388
|
+
import { forwardRef as forwardRef4 } from "react";
|
|
389
|
+
import { jsx as jsx16, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
390
|
+
var Select = forwardRef4(
|
|
391
|
+
({ label, options, className = "", id, ...props }, ref) => {
|
|
392
|
+
const selectId = id || label?.toLowerCase().replace(/\s+/g, "-");
|
|
393
|
+
return /* @__PURE__ */ jsxs9("div", { className: "flex flex-col gap-1.5", children: [
|
|
394
|
+
label && /* @__PURE__ */ jsx16("label", { htmlFor: selectId, className: "text-sm font-medium text-text-secondary", children: label }),
|
|
395
|
+
/* @__PURE__ */ jsx16(
|
|
396
|
+
"select",
|
|
397
|
+
{
|
|
398
|
+
ref,
|
|
399
|
+
id: selectId,
|
|
400
|
+
className: `h-9 rounded-lg border border-white/[0.08] bg-white/[0.04] px-3 text-sm text-text-primary
|
|
401
|
+
focus:border-primary focus:outline-none focus:ring-2 focus:ring-primary
|
|
402
|
+
disabled:cursor-not-allowed disabled:opacity-50
|
|
403
|
+
${className}`,
|
|
404
|
+
...props,
|
|
405
|
+
children: options.map((opt) => /* @__PURE__ */ jsx16("option", { value: opt.value, children: opt.label }, opt.value))
|
|
406
|
+
}
|
|
407
|
+
)
|
|
408
|
+
] });
|
|
409
|
+
}
|
|
410
|
+
);
|
|
411
|
+
Select.displayName = "Select";
|
|
412
|
+
|
|
413
|
+
// src/components/separator/separator.tsx
|
|
414
|
+
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
415
|
+
function Separator({ className = "" }) {
|
|
416
|
+
return /* @__PURE__ */ jsx17("div", { className: `mx-1 h-5 w-px shrink-0 bg-white/[0.12] ${className}` });
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
// src/components/skeleton/skeleton.tsx
|
|
420
|
+
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
421
|
+
function Skeleton({ className = "" }) {
|
|
422
|
+
return /* @__PURE__ */ jsx18(
|
|
423
|
+
"div",
|
|
424
|
+
{
|
|
425
|
+
className: `rounded-lg bg-white/[0.06] animate-pulse ${className}`
|
|
426
|
+
}
|
|
427
|
+
);
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
// src/components/sparkline/sparkline.tsx
|
|
431
|
+
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
432
|
+
function Sparkline({ trend, className = "" }) {
|
|
433
|
+
const max = Math.max(...trend);
|
|
434
|
+
return /* @__PURE__ */ jsx19("div", { className: `flex items-end gap-px h-4 ${className}`, children: trend.map((v, i) => {
|
|
435
|
+
const h = Math.max(2, Math.round(v / max * 14));
|
|
436
|
+
const col = v >= 10 ? "bg-status-error" : v >= 7 ? "bg-status-warning" : "bg-text-muted";
|
|
437
|
+
return /* @__PURE__ */ jsx19("div", { className: `w-[3px] rounded-full ${col}`, style: { height: `${h}px` } }, i);
|
|
438
|
+
}) });
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
// src/components/spinner/spinner.tsx
|
|
442
|
+
import { jsx as jsx20, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
443
|
+
var sizeMap = { sm: "h-4 w-4", md: "h-5 w-5", lg: "h-6 w-6" };
|
|
444
|
+
function Spinner({ size = "md", className = "" }) {
|
|
445
|
+
return /* @__PURE__ */ jsxs10(
|
|
446
|
+
"svg",
|
|
447
|
+
{
|
|
448
|
+
className: `animate-spin text-text-muted ${sizeMap[size]} ${className}`,
|
|
449
|
+
viewBox: "0 0 24 24",
|
|
450
|
+
fill: "none",
|
|
451
|
+
role: "status",
|
|
452
|
+
"aria-label": "Loading",
|
|
453
|
+
children: [
|
|
454
|
+
/* @__PURE__ */ jsx20("circle", { cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "2.5", opacity: "0.2" }),
|
|
455
|
+
/* @__PURE__ */ jsx20(
|
|
456
|
+
"path",
|
|
457
|
+
{
|
|
458
|
+
d: "M12 2a10 10 0 019.95 9",
|
|
459
|
+
stroke: "currentColor",
|
|
460
|
+
strokeWidth: "2.5",
|
|
461
|
+
strokeLinecap: "round"
|
|
462
|
+
}
|
|
463
|
+
)
|
|
464
|
+
]
|
|
465
|
+
}
|
|
466
|
+
);
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
// src/components/status-bar/status-bar.tsx
|
|
470
|
+
import { jsx as jsx21, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
471
|
+
var dotColors = {
|
|
472
|
+
success: "bg-status-success",
|
|
473
|
+
warning: "bg-status-warning",
|
|
474
|
+
danger: "bg-status-error",
|
|
475
|
+
idle: "bg-text-muted"
|
|
476
|
+
};
|
|
477
|
+
function StatusBar({ items, trailing, className = "" }) {
|
|
478
|
+
return /* @__PURE__ */ jsxs11("div", { className: `flex h-7 shrink-0 items-center gap-4 border-t border-white/[0.06] bg-white/[0.04] px-4 ${className}`, children: [
|
|
479
|
+
items.map((item, i) => /* @__PURE__ */ jsxs11("div", { className: "flex items-center gap-1.5 text-xs text-text-muted", children: [
|
|
480
|
+
item.dot && /* @__PURE__ */ jsx21("span", { className: `inline-block h-1.5 w-1.5 rounded-full ${dotColors[item.dot]}` }),
|
|
481
|
+
item.label
|
|
482
|
+
] }, i)),
|
|
483
|
+
trailing && /* @__PURE__ */ jsx21("div", { className: "ml-auto text-xs text-text-muted", children: trailing })
|
|
484
|
+
] });
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
// src/components/table/table.tsx
|
|
488
|
+
import { jsx as jsx22 } from "react/jsx-runtime";
|
|
489
|
+
function Table({ children, className = "" }) {
|
|
490
|
+
return /* @__PURE__ */ jsx22("div", { className: "w-full overflow-x-auto rounded-xl", children: /* @__PURE__ */ jsx22("table", { className: `w-full text-sm ${className}`, children }) });
|
|
491
|
+
}
|
|
492
|
+
function TableHead({ children }) {
|
|
493
|
+
return /* @__PURE__ */ jsx22("thead", { className: "border-b border-white/[0.06]", children: /* @__PURE__ */ jsx22("tr", { children }) });
|
|
494
|
+
}
|
|
495
|
+
function TableHeader({ children, className = "", onClick }) {
|
|
496
|
+
return /* @__PURE__ */ jsx22(
|
|
497
|
+
"th",
|
|
498
|
+
{
|
|
499
|
+
className: `px-4 py-3 text-left text-xs font-medium text-text-muted ${onClick ? "cursor-pointer select-none hover:text-text-primary" : ""} ${className}`,
|
|
500
|
+
onClick,
|
|
501
|
+
children
|
|
502
|
+
}
|
|
503
|
+
);
|
|
504
|
+
}
|
|
505
|
+
function TableBody({ children }) {
|
|
506
|
+
return /* @__PURE__ */ jsx22("tbody", { className: "divide-y divide-white/[0.06]", children });
|
|
507
|
+
}
|
|
508
|
+
function TableRow({ children, className = "", onClick }) {
|
|
509
|
+
return /* @__PURE__ */ jsx22("tr", { className: `hover:bg-white/[0.04] transition-colors ${onClick ? "cursor-pointer" : ""} ${className}`, onClick, children });
|
|
510
|
+
}
|
|
511
|
+
function TableCell({ children, className = "" }) {
|
|
512
|
+
return /* @__PURE__ */ jsx22("td", { className: `px-4 py-3.5 text-text-secondary ${className}`, children });
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
// src/components/tabs/tabs.tsx
|
|
516
|
+
import { jsx as jsx23 } from "react/jsx-runtime";
|
|
517
|
+
function Tabs({ tabs, value, onChange, className = "" }) {
|
|
518
|
+
return /* @__PURE__ */ jsx23("div", { className: `flex gap-1 rounded-[var(--radius-lg)] border border-white/[0.08] bg-white/[0.04] p-1 ${className}`, children: tabs.map((tab) => /* @__PURE__ */ jsx23(
|
|
519
|
+
"button",
|
|
520
|
+
{
|
|
521
|
+
onClick: () => onChange(tab.value),
|
|
522
|
+
className: `px-3 py-1.5 text-sm font-medium transition-all rounded-md
|
|
523
|
+
${value === tab.value ? "bg-white/[0.08] text-text-primary" : "text-text-muted hover:bg-white/[0.04] hover:text-text-primary"}`,
|
|
524
|
+
children: tab.label
|
|
525
|
+
},
|
|
526
|
+
tab.value
|
|
527
|
+
)) });
|
|
528
|
+
}
|
|
529
|
+
|
|
530
|
+
// src/components/toggle/toggle.tsx
|
|
531
|
+
import { jsx as jsx24, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
532
|
+
function Toggle({ options, value, onChange, className = "" }) {
|
|
533
|
+
const [left, right] = options;
|
|
534
|
+
return /* @__PURE__ */ jsxs12("div", { className: `inline-flex items-center gap-2 text-sm ${className}`, children: [
|
|
535
|
+
/* @__PURE__ */ jsx24(
|
|
536
|
+
"span",
|
|
537
|
+
{
|
|
538
|
+
className: `cursor-pointer transition-colors ${value === left ? "text-text-primary" : "text-text-muted"}`,
|
|
539
|
+
onClick: () => onChange(left),
|
|
540
|
+
children: left
|
|
541
|
+
}
|
|
542
|
+
),
|
|
543
|
+
/* @__PURE__ */ jsx24(
|
|
544
|
+
"button",
|
|
545
|
+
{
|
|
546
|
+
onClick: () => onChange(value === left ? right : left),
|
|
547
|
+
className: `relative w-10 h-5 rounded-none transition-colors border-2 border-white/[0.08] ${value === right ? "bg-primary" : "bg-white/[0.04]"}`,
|
|
548
|
+
children: /* @__PURE__ */ jsx24(
|
|
549
|
+
"span",
|
|
550
|
+
{
|
|
551
|
+
className: `absolute top-0.5 w-4 h-4 rounded-none transition-transform bg-text-primary ${value === right ? "translate-x-5" : "translate-x-0.5"}`
|
|
552
|
+
}
|
|
553
|
+
)
|
|
554
|
+
}
|
|
555
|
+
),
|
|
556
|
+
/* @__PURE__ */ jsx24(
|
|
557
|
+
"span",
|
|
558
|
+
{
|
|
559
|
+
className: `cursor-pointer transition-colors ${value === right ? "text-text-primary" : "text-text-muted"}`,
|
|
560
|
+
onClick: () => onChange(right),
|
|
561
|
+
children: right
|
|
562
|
+
}
|
|
563
|
+
)
|
|
564
|
+
] });
|
|
565
|
+
}
|
|
566
|
+
export {
|
|
567
|
+
Badge,
|
|
568
|
+
Button,
|
|
569
|
+
Card,
|
|
570
|
+
CardContent,
|
|
571
|
+
CardDescription,
|
|
572
|
+
CardFooter,
|
|
573
|
+
CardHeader,
|
|
574
|
+
CardTitle,
|
|
575
|
+
Chip,
|
|
576
|
+
ChipGroup,
|
|
577
|
+
CodeBlock,
|
|
578
|
+
CopyButton,
|
|
579
|
+
Dialog,
|
|
580
|
+
DialogClose,
|
|
581
|
+
DialogContent,
|
|
582
|
+
DialogDescription,
|
|
583
|
+
DialogFooter,
|
|
584
|
+
DialogHeader,
|
|
585
|
+
DialogTitle,
|
|
586
|
+
EmptyState,
|
|
587
|
+
Input,
|
|
588
|
+
Kbd,
|
|
589
|
+
Loading,
|
|
590
|
+
Modal,
|
|
591
|
+
NavTabs,
|
|
592
|
+
SectionHeader,
|
|
593
|
+
Select,
|
|
594
|
+
Separator,
|
|
595
|
+
Skeleton,
|
|
596
|
+
Sparkline,
|
|
597
|
+
Spinner,
|
|
598
|
+
StatusBar,
|
|
599
|
+
Table,
|
|
600
|
+
TableBody,
|
|
601
|
+
TableCell,
|
|
602
|
+
TableHead,
|
|
603
|
+
TableHeader,
|
|
604
|
+
TableRow,
|
|
605
|
+
Tabs,
|
|
606
|
+
Toggle
|
|
607
|
+
};
|
|
608
|
+
//# sourceMappingURL=index.mjs.map
|