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