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