@la-batcave/ui 3.1.2
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/README.md +95 -0
- package/dist/Alert.d.ts +27 -0
- package/dist/Alert.js +56 -0
- package/dist/Avatar.d.ts +20 -0
- package/dist/Avatar.js +40 -0
- package/dist/Badge.d.ts +56 -0
- package/dist/Badge.js +74 -0
- package/dist/Button.d.ts +53 -0
- package/dist/Button.js +66 -0
- package/dist/Card.d.ts +18 -0
- package/dist/Card.js +98 -0
- package/dist/CodeBlock.d.ts +45 -0
- package/dist/CodeBlock.js +306 -0
- package/dist/Collapse.d.ts +58 -0
- package/dist/Collapse.js +89 -0
- package/dist/Combobox.d.ts +44 -0
- package/dist/Combobox.js +409 -0
- package/dist/DarkMode.d.ts +59 -0
- package/dist/DarkMode.js +56 -0
- package/dist/DatePicker.d.ts +48 -0
- package/dist/DatePicker.js +2954 -0
- package/dist/Dialog.d.ts +119 -0
- package/dist/Dialog.js +337 -0
- package/dist/Drawer.d.ts +28 -0
- package/dist/Drawer.js +1126 -0
- package/dist/Dropdown.d.ts +23 -0
- package/dist/Dropdown.js +247 -0
- package/dist/EasyForm.d.ts +138 -0
- package/dist/EasyForm.js +286 -0
- package/dist/HoverCard.d.ts +10 -0
- package/dist/HoverCard.js +195 -0
- package/dist/Input.d.ts +230 -0
- package/dist/Input.js +2216 -0
- package/dist/LogViewer.d.ts +57 -0
- package/dist/LogViewer.js +120 -0
- package/dist/Menubar.d.ts +32 -0
- package/dist/Menubar.js +398 -0
- package/dist/Navbar.d.ts +20 -0
- package/dist/Navbar.js +31 -0
- package/dist/Pagination.d.ts +78 -0
- package/dist/Pagination.js +106 -0
- package/dist/Popover.d.ts +11 -0
- package/dist/Popover.js +28 -0
- package/dist/ProgressBar.d.ts +35 -0
- package/dist/ProgressBar.js +210 -0
- package/dist/Resizable.d.ts +23 -0
- package/dist/Resizable.js +1532 -0
- package/dist/Separator.d.ts +4 -0
- package/dist/Separator.js +46 -0
- package/dist/Sheet.d.ts +29 -0
- package/dist/Sheet.js +104 -0
- package/dist/Sidebar.d.ts +117 -0
- package/dist/Sidebar.js +237 -0
- package/dist/Skeleton.d.ts +57 -0
- package/dist/Skeleton.js +47 -0
- package/dist/Table.d.ts +71 -0
- package/dist/Table.js +94 -0
- package/dist/Tabs.d.ts +76 -0
- package/dist/Tabs.js +202 -0
- package/dist/Toast.d.ts +54 -0
- package/dist/Toast.js +827 -0
- package/dist/Tooltip.d.ts +29 -0
- package/dist/Tooltip.js +352 -0
- package/dist/Typography.d.ts +101 -0
- package/dist/Typography.js +123 -0
- package/dist/Widget.d.ts +133 -0
- package/dist/Widget.js +207 -0
- package/dist/_shared/Combination-D_l4PLF_.js +676 -0
- package/dist/_shared/index-B03TCNO5.js +142 -0
- package/dist/_shared/index-B1f-hyuh.js +31 -0
- package/dist/_shared/index-BC7vfx-u.js +13 -0
- package/dist/_shared/index-BrLJJgkl.js +67 -0
- package/dist/_shared/index-C0gNQvxa.js +269 -0
- package/dist/_shared/index-C3aZemLI.js +268 -0
- package/dist/_shared/index-CXeb1OMI.js +198 -0
- package/dist/_shared/index-CukUn3R0.js +626 -0
- package/dist/_shared/index-DLcqcWxM.js +29 -0
- package/dist/_shared/index-DlSuDb9N.js +283 -0
- package/dist/_shared/index-V-Ajw7Ac.js +79 -0
- package/dist/_shared/index-uPOYJZpG.js +34 -0
- package/dist/_shared/index-uu9PT5Nu.js +1588 -0
- package/dist/_shared/utils-eGXXUFl7.js +2935 -0
- package/dist/backgrounds/Aurora.d.ts +7 -0
- package/dist/backgrounds/Aurora.js +126 -0
- package/dist/backgrounds/Iridescence.d.ts +7 -0
- package/dist/backgrounds/Iridescence.js +77 -0
- package/dist/backgrounds/Lightning.d.ts +8 -0
- package/dist/backgrounds/Lightning.js +75 -0
- package/dist/backgrounds/LiquidChrome.d.ts +9 -0
- package/dist/backgrounds/LiquidChrome.js +89 -0
- package/dist/backgrounds/Particles.d.ts +15 -0
- package/dist/backgrounds/Particles.js +137 -0
- package/dist/backgrounds/PixelSnow.d.ts +9 -0
- package/dist/backgrounds/PixelSnow.js +52 -0
- package/dist/backgrounds/Silk.d.ts +8 -0
- package/dist/backgrounds/Silk.js +92 -0
- package/dist/backgrounds/Squares.d.ts +9 -0
- package/dist/backgrounds/Squares.js +75 -0
- package/dist/backgrounds/Threads.d.ts +7 -0
- package/dist/backgrounds/Threads.js +110 -0
- package/dist/backgrounds/Waves.d.ts +14 -0
- package/dist/backgrounds/Waves.js +139 -0
- package/dist/fonts/inter-latin-wght-normal.woff2 +0 -0
- package/dist/index.css +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +4 -0
- package/package.json +318 -0
package/README.md
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
# @la-batcave/ui
|
|
2
|
+
|
|
3
|
+
Design system React pour les projets **La Batcave**.
|
|
4
|
+
|
|
5
|
+
30+ composants shadcn-style + 10 backgrounds animes + tokens CSS + theme dark/light.
|
|
6
|
+
|
|
7
|
+
**Showcase** : [ui.btcv.fr](https://ui.btcv.fr)
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## Installation
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npm install @la-batcave/ui lucide-react
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
| Package | Role | Requis ? |
|
|
18
|
+
|---|---|---|
|
|
19
|
+
| `@la-batcave/ui` | Composants + styles | Oui |
|
|
20
|
+
| `lucide-react` | Icones (peer dep) | Oui |
|
|
21
|
+
|
|
22
|
+
### Installer Tailwind CSS v4
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
npm install -D tailwindcss @tailwindcss/vite
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Plugin Vite (`vite.config.js`) :
|
|
29
|
+
|
|
30
|
+
```js
|
|
31
|
+
import tailwindcss from '@tailwindcss/vite';
|
|
32
|
+
|
|
33
|
+
export default defineConfig({
|
|
34
|
+
plugins: [react(), tailwindcss()],
|
|
35
|
+
});
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### Configurer le CSS
|
|
39
|
+
|
|
40
|
+
Creer un fichier `globals.css` :
|
|
41
|
+
|
|
42
|
+
```css
|
|
43
|
+
@layer base;
|
|
44
|
+
|
|
45
|
+
@import "tailwindcss/theme" layer(theme);
|
|
46
|
+
@import "tailwindcss/utilities" layer(utilities);
|
|
47
|
+
|
|
48
|
+
@import "@la-batcave/ui/styles.css";
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
> **Attention** : Le `@layer base;` AVANT les imports est obligatoire. Sans ca, le reset CSS ecrase toutes les utilities Tailwind.
|
|
52
|
+
|
|
53
|
+
### Importer et utiliser
|
|
54
|
+
|
|
55
|
+
```jsx
|
|
56
|
+
import './globals.css';
|
|
57
|
+
import { Button } from '@la-batcave/ui/Button';
|
|
58
|
+
import { Card, CardHeader, CardBody } from '@la-batcave/ui/Card';
|
|
59
|
+
import { cn } from '@la-batcave/ui';
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Chaque composant est un entry point separe. Le seul export du barrel (`@la-batcave/ui`) est `cn()`.
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
## Theme
|
|
67
|
+
|
|
68
|
+
Dark-first. Le theme sombre est actif par defaut.
|
|
69
|
+
|
|
70
|
+
| Token | Dark | Light |
|
|
71
|
+
|---|---|---|
|
|
72
|
+
| `--primary` | `#E7BB1D` (gold) | `#E7BB1D` |
|
|
73
|
+
| `--background` | `#1D1917` | `#FAFAF8` |
|
|
74
|
+
| `--foreground` | `#F5F0E8` | `#1A1714` |
|
|
75
|
+
| `--card` | `#252220` | `#FFFFFF` |
|
|
76
|
+
|
|
77
|
+
Tous les tokens sont utilisables en Tailwind : `bg-primary`, `text-foreground`, `border-border`, etc.
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
## Developpement
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
npm run build # vite build && tsc && move-types
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
## Publication
|
|
88
|
+
|
|
89
|
+
Automatique via GitHub Actions a chaque push sur `main` → publie sur npm.
|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
|
|
93
|
+
## Licence
|
|
94
|
+
|
|
95
|
+
MIT
|
package/dist/Alert.d.ts
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
/** Variant controlling the accent color of the alert. */
|
|
3
|
+
export type AlertVariant = 'primary' | 'info' | 'success' | 'destructive' | 'warning';
|
|
4
|
+
export interface AlertProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'title'> {
|
|
5
|
+
/** Icon displayed at the start of the alert. */
|
|
6
|
+
icon?: React.ComponentType<{
|
|
7
|
+
size?: number;
|
|
8
|
+
className?: string;
|
|
9
|
+
}>;
|
|
10
|
+
/** Accent color variant controlling the left border and icon color. */
|
|
11
|
+
variant?: AlertVariant;
|
|
12
|
+
/** Title displayed prominently above the description. */
|
|
13
|
+
title?: React.ReactNode;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Alert banner for displaying contextual messages with icon, variant, title, and description.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* import { Alert } from '@la-batcave/ui/Alert';
|
|
20
|
+
* import { AlertTriangle } from 'lucide-react';
|
|
21
|
+
*
|
|
22
|
+
* <Alert icon={AlertTriangle} variant="warning" title="Attention">
|
|
23
|
+
* Votre certificat SSL expire dans 43 jours.
|
|
24
|
+
* </Alert>
|
|
25
|
+
*/
|
|
26
|
+
declare function Alert({ icon: Icon, variant, title, children, className, ...props }: AlertProps): import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
export { Alert };
|
package/dist/Alert.js
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { jsx as e, jsxs as o } from "react/jsx-runtime";
|
|
2
|
+
import { c as l } from "./_shared/utils-eGXXUFl7.js";
|
|
3
|
+
import { Card as c } from "./Card.js";
|
|
4
|
+
const a = {
|
|
5
|
+
primary: "border-l-3 border-l-primary",
|
|
6
|
+
info: "border-l-3 border-l-info",
|
|
7
|
+
success: "border-l-3 border-l-success",
|
|
8
|
+
destructive: "border-l-3 border-l-destructive",
|
|
9
|
+
warning: "border-l-3 border-l-warning"
|
|
10
|
+
}, m = {
|
|
11
|
+
primary: "text-primary",
|
|
12
|
+
info: "text-info",
|
|
13
|
+
success: "text-success",
|
|
14
|
+
destructive: "text-destructive",
|
|
15
|
+
warning: "text-warning"
|
|
16
|
+
};
|
|
17
|
+
function b({
|
|
18
|
+
icon: t,
|
|
19
|
+
variant: r,
|
|
20
|
+
title: s,
|
|
21
|
+
children: i,
|
|
22
|
+
className: d,
|
|
23
|
+
...n
|
|
24
|
+
}) {
|
|
25
|
+
return /* @__PURE__ */ e(
|
|
26
|
+
c,
|
|
27
|
+
{
|
|
28
|
+
className: l(
|
|
29
|
+
"!p-4 transition-all",
|
|
30
|
+
r && a[r],
|
|
31
|
+
d
|
|
32
|
+
),
|
|
33
|
+
role: "alert",
|
|
34
|
+
...n,
|
|
35
|
+
children: /* @__PURE__ */ o("div", { className: "flex items-start gap-3", children: [
|
|
36
|
+
t && /* @__PURE__ */ e(
|
|
37
|
+
"div",
|
|
38
|
+
{
|
|
39
|
+
className: l(
|
|
40
|
+
"shrink-0 h-5 flex items-center",
|
|
41
|
+
r ? m[r] : "text-muted-foreground"
|
|
42
|
+
),
|
|
43
|
+
children: /* @__PURE__ */ e(t, { size: 16 })
|
|
44
|
+
}
|
|
45
|
+
),
|
|
46
|
+
/* @__PURE__ */ o("div", { className: "flex-1 min-w-0 flex flex-col gap-1", children: [
|
|
47
|
+
s && /* @__PURE__ */ e("div", { className: "text-sm font-semibold text-foreground", children: s }),
|
|
48
|
+
i && /* @__PURE__ */ e("div", { className: "text-sm text-muted-foreground", children: i })
|
|
49
|
+
] })
|
|
50
|
+
] })
|
|
51
|
+
}
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
export {
|
|
55
|
+
b as Alert
|
|
56
|
+
};
|
package/dist/Avatar.d.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export interface AvatarProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
/** Image URL. Falls back to initials if not provided or on error. */
|
|
4
|
+
src?: string;
|
|
5
|
+
/** Alt text for the image. */
|
|
6
|
+
alt?: string;
|
|
7
|
+
/** Fallback text (e.g. initials) shown when no image. @default "?" */
|
|
8
|
+
fallback?: string;
|
|
9
|
+
/** Size of the avatar. @default "md" */
|
|
10
|
+
size?: "sm" | "md" | "lg" | "xl";
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Avatar with image and fallback initials.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* <Avatar src="/photo.jpg" alt="Tomarok" fallback="TM" />
|
|
17
|
+
* <Avatar fallback="AB" size="lg" />
|
|
18
|
+
*/
|
|
19
|
+
declare const Avatar: React.ForwardRefExoticComponent<AvatarProps & React.RefAttributes<HTMLDivElement>>;
|
|
20
|
+
export { Avatar };
|
package/dist/Avatar.js
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
3
|
+
import * as r from "react";
|
|
4
|
+
import { c as f } from "./_shared/utils-eGXXUFl7.js";
|
|
5
|
+
const u = {
|
|
6
|
+
sm: "size-7 text-xs",
|
|
7
|
+
md: "size-9 text-sm",
|
|
8
|
+
lg: "size-11 text-base",
|
|
9
|
+
xl: "size-14 text-lg"
|
|
10
|
+
}, x = r.forwardRef(
|
|
11
|
+
({ src: t, alt: o, fallback: s = "?", size: i = "md", className: m, ...n }, a) => {
|
|
12
|
+
const [l, c] = r.useState(!1), d = t && !l;
|
|
13
|
+
return /* @__PURE__ */ e(
|
|
14
|
+
"div",
|
|
15
|
+
{
|
|
16
|
+
ref: a,
|
|
17
|
+
className: f(
|
|
18
|
+
"relative inline-flex items-center justify-center shrink-0 rounded-full overflow-hidden",
|
|
19
|
+
"bg-muted text-muted-foreground font-medium select-none",
|
|
20
|
+
u[i],
|
|
21
|
+
m
|
|
22
|
+
),
|
|
23
|
+
...n,
|
|
24
|
+
children: d ? /* @__PURE__ */ e(
|
|
25
|
+
"img",
|
|
26
|
+
{
|
|
27
|
+
src: t,
|
|
28
|
+
alt: o || s,
|
|
29
|
+
onError: () => c(!0),
|
|
30
|
+
className: "size-full object-cover"
|
|
31
|
+
}
|
|
32
|
+
) : /* @__PURE__ */ e("span", { children: s })
|
|
33
|
+
}
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
);
|
|
37
|
+
x.displayName = "Avatar";
|
|
38
|
+
export {
|
|
39
|
+
x as Avatar
|
|
40
|
+
};
|
package/dist/Badge.d.ts
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
/** Available color variants for Badge. */
|
|
3
|
+
export type BadgeVariant = 'default' | 'success' | 'destructive' | 'warning' | 'info' | 'secondary' | 'outline';
|
|
4
|
+
/** Available size options for Badge. */
|
|
5
|
+
export type BadgeSize = 'sm' | 'md' | 'lg';
|
|
6
|
+
export interface BadgeProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
7
|
+
/** Color variant controlling background, text, and border. @default "default" */
|
|
8
|
+
variant?: BadgeVariant;
|
|
9
|
+
/** Badge size controlling font size and padding. @default "md" */
|
|
10
|
+
size?: BadgeSize;
|
|
11
|
+
/**
|
|
12
|
+
* Custom color override (CSS color string). When provided, ignores `variant`
|
|
13
|
+
* and renders with this color for text/border and a semi-transparent background.
|
|
14
|
+
* Useful for dynamic colors stored in DB.
|
|
15
|
+
* @example <Badge color="#8B5CF6">Custom</Badge>
|
|
16
|
+
*/
|
|
17
|
+
color?: string;
|
|
18
|
+
}
|
|
19
|
+
/** Available status values for StatusDot. */
|
|
20
|
+
export type StatusDotStatus = 'online' | 'offline' | 'loading' | 'idle';
|
|
21
|
+
export interface StatusDotProps {
|
|
22
|
+
/** Current status controlling the dot color. @default "offline" */
|
|
23
|
+
status?: StatusDotStatus;
|
|
24
|
+
/** Optional text label displayed next to the dot. */
|
|
25
|
+
label?: React.ReactNode;
|
|
26
|
+
/** Whether the dot should pulse (animate). @default false */
|
|
27
|
+
pulse?: boolean;
|
|
28
|
+
/** Additional CSS classes. */
|
|
29
|
+
className?: string;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* CVA variant generator for Badge styles. Returns a Tailwind class string
|
|
33
|
+
* for the given variant/size combination.
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* const cls = badgeVariants({ variant: "success", size: "sm" });
|
|
37
|
+
*/
|
|
38
|
+
declare const badgeVariants: (props?: ({
|
|
39
|
+
variant?: "success" | "info" | "warning" | "destructive" | "default" | "secondary" | "outline" | null | undefined;
|
|
40
|
+
size?: "sm" | "md" | "lg" | null | undefined;
|
|
41
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
42
|
+
/**
|
|
43
|
+
* Inline label badge with semantic color variants and multiple sizes.
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* <Badge variant="success" size="sm">Active</Badge>
|
|
47
|
+
*/
|
|
48
|
+
declare function Badge({ children, variant, size, color, className, style, ...props }: BadgeProps): import("react/jsx-runtime").JSX.Element;
|
|
49
|
+
/**
|
|
50
|
+
* Small colored dot indicator for connection or activity status, with an optional label.
|
|
51
|
+
*
|
|
52
|
+
* @example
|
|
53
|
+
* <StatusDot status="online" label="Connected" pulse />
|
|
54
|
+
*/
|
|
55
|
+
declare function StatusDot({ status, label, pulse, className }: StatusDotProps): import("react/jsx-runtime").JSX.Element;
|
|
56
|
+
export { Badge, badgeVariants, StatusDot };
|
package/dist/Badge.js
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { jsx as s, jsxs as u } from "react/jsx-runtime";
|
|
2
|
+
import { c as g } from "./_shared/index-uPOYJZpG.js";
|
|
3
|
+
import { c as o } from "./_shared/utils-eGXXUFl7.js";
|
|
4
|
+
const p = g(
|
|
5
|
+
"inline-flex items-center font-semibold rounded-full transition-colors",
|
|
6
|
+
{
|
|
7
|
+
variants: {
|
|
8
|
+
variant: {
|
|
9
|
+
default: "bg-primary/15 text-primary border border-primary/20",
|
|
10
|
+
success: "bg-success/15 text-success border border-success/20",
|
|
11
|
+
destructive: "bg-destructive/15 text-destructive border border-destructive/20",
|
|
12
|
+
warning: "bg-warning/15 text-warning border border-warning/20",
|
|
13
|
+
info: "bg-info/15 text-info border border-info/20",
|
|
14
|
+
secondary: "bg-muted text-muted-foreground border border-border",
|
|
15
|
+
outline: "bg-transparent text-foreground border border-border"
|
|
16
|
+
},
|
|
17
|
+
size: {
|
|
18
|
+
sm: "text-[10px] px-1.5 py-0.5 gap-1",
|
|
19
|
+
md: "text-xs px-2.5 py-0.5 gap-1.5",
|
|
20
|
+
lg: "text-sm px-3 py-1 gap-2"
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
defaultVariants: {
|
|
24
|
+
variant: "default",
|
|
25
|
+
size: "md"
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
);
|
|
29
|
+
function c({ children: t, variant: n = "default", size: r = "md", color: e, className: a, style: d, ...i }) {
|
|
30
|
+
return e ? /* @__PURE__ */ s(
|
|
31
|
+
"span",
|
|
32
|
+
{
|
|
33
|
+
className: o(
|
|
34
|
+
"inline-flex items-center font-semibold rounded-full border",
|
|
35
|
+
r === "sm" ? "text-[10px] px-1.5 py-0.5 gap-1" : r === "lg" ? "text-sm px-3 py-1 gap-2" : "text-xs px-2.5 py-0.5 gap-1.5",
|
|
36
|
+
a
|
|
37
|
+
),
|
|
38
|
+
style: {
|
|
39
|
+
color: e,
|
|
40
|
+
borderColor: `${e}33`,
|
|
41
|
+
backgroundColor: `${e}1A`,
|
|
42
|
+
...d
|
|
43
|
+
},
|
|
44
|
+
...i,
|
|
45
|
+
children: t
|
|
46
|
+
}
|
|
47
|
+
) : /* @__PURE__ */ s("span", { className: o(p({ variant: n, size: r }), a), style: d, ...i, children: t });
|
|
48
|
+
}
|
|
49
|
+
const b = {
|
|
50
|
+
online: "bg-success",
|
|
51
|
+
offline: "bg-destructive",
|
|
52
|
+
loading: "bg-warning",
|
|
53
|
+
idle: "bg-muted-foreground"
|
|
54
|
+
};
|
|
55
|
+
function m({ status: t = "offline", label: n, pulse: r = !1, className: e }) {
|
|
56
|
+
return /* @__PURE__ */ u("span", { className: o("inline-flex items-center gap-2 text-sm text-muted-foreground", e), children: [
|
|
57
|
+
/* @__PURE__ */ s(
|
|
58
|
+
"span",
|
|
59
|
+
{
|
|
60
|
+
className: o(
|
|
61
|
+
"w-2 h-2 rounded-full shrink-0",
|
|
62
|
+
b[t],
|
|
63
|
+
r && "animate-pulse"
|
|
64
|
+
)
|
|
65
|
+
}
|
|
66
|
+
),
|
|
67
|
+
n && /* @__PURE__ */ s("span", { children: n })
|
|
68
|
+
] });
|
|
69
|
+
}
|
|
70
|
+
export {
|
|
71
|
+
c as Badge,
|
|
72
|
+
m as StatusDot,
|
|
73
|
+
p as badgeVariants
|
|
74
|
+
};
|
package/dist/Button.d.ts
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
/** Available visual style variants for Button. */
|
|
3
|
+
export type ButtonVariant = 'primary' | 'secondary' | 'outline' | 'destructive' | 'success' | 'warning' | 'info' | 'ghost' | 'ghost-primary' | 'ghost-destructive' | 'ghost-success' | 'ghost-warning' | 'ghost-info' | 'link';
|
|
4
|
+
/** Available size options for Button. */
|
|
5
|
+
export type ButtonSize = 'sm' | 'md' | 'lg' | 'icon';
|
|
6
|
+
export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
7
|
+
/** Visual style variant. @default "primary" */
|
|
8
|
+
variant?: ButtonVariant;
|
|
9
|
+
/**
|
|
10
|
+
* Button size controlling height, padding, and font size.
|
|
11
|
+
* Use `"icon"` for square icon-only buttons (36x36).
|
|
12
|
+
* @default "md"
|
|
13
|
+
*/
|
|
14
|
+
size?: ButtonSize;
|
|
15
|
+
/**
|
|
16
|
+
* Shows a spinning loader and disables the button.
|
|
17
|
+
* Children are hidden while loading.
|
|
18
|
+
* @default false
|
|
19
|
+
*/
|
|
20
|
+
loading?: boolean;
|
|
21
|
+
/** Render as a child Slot element instead of a native button. @default false */
|
|
22
|
+
asChild?: boolean;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* CVA variant generator for Button styles. Returns a Tailwind class string
|
|
26
|
+
* for the given variant/size combination.
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* const cls = buttonVariants({ variant: "outline", size: "lg" });
|
|
30
|
+
*/
|
|
31
|
+
declare const buttonVariants: (props?: ({
|
|
32
|
+
variant?: "primary" | "success" | "info" | "warning" | "destructive" | "link" | "secondary" | "outline" | "ghost" | "ghost-primary" | "ghost-destructive" | "ghost-success" | "ghost-warning" | "ghost-info" | null | undefined;
|
|
33
|
+
size?: "icon" | "sm" | "md" | "lg" | null | undefined;
|
|
34
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
35
|
+
/**
|
|
36
|
+
* Primary action button with multiple visual variants and sizes.
|
|
37
|
+
* Uses children composition for icons -- place SVG icons directly as children.
|
|
38
|
+
* Can render as a Radix Slot via `asChild`.
|
|
39
|
+
*
|
|
40
|
+
* @description SVG children are automatically sized to 16px via `[&_svg]:size-4`.
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* <Button variant="primary" size="md">Save changes</Button>
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* import { Plus } from 'lucide-react';
|
|
47
|
+
* <Button variant="primary"><Plus /> Add Game</Button>
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* <Button variant="ghost" size="icon"><Settings /></Button>
|
|
51
|
+
*/
|
|
52
|
+
declare function Button({ className, variant, size, loading, asChild, children, ...props }: ButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
53
|
+
export { Button, buttonVariants };
|
package/dist/Button.js
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { S as g } from "./_shared/index-BrLJJgkl.js";
|
|
3
|
+
import { c as l } from "./_shared/index-uPOYJZpG.js";
|
|
4
|
+
import { Loader2 as u } from "lucide-react";
|
|
5
|
+
import { c as i } from "./_shared/utils-eGXXUFl7.js";
|
|
6
|
+
const d = l(
|
|
7
|
+
"relative inline-flex items-center justify-center gap-2 whitespace-nowrap font-medium border border-transparent cursor-pointer transition-all select-none outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background active:not-disabled:scale-[0.97] disabled:opacity-40 disabled:cursor-not-allowed disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0",
|
|
8
|
+
{
|
|
9
|
+
variants: {
|
|
10
|
+
variant: {
|
|
11
|
+
primary: "bg-primary text-primary-foreground border-primary hover:not-disabled:bg-primary-light hover:not-disabled:border-primary-light hover:not-disabled:shadow-[0_0_20px_rgba(231,187,29,0.15)]",
|
|
12
|
+
secondary: "bg-secondary text-foreground border-secondary hover:not-disabled:bg-muted hover:not-disabled:border-secondary",
|
|
13
|
+
outline: "bg-input/30 border-border hover:not-disabled:bg-input/50",
|
|
14
|
+
destructive: "bg-destructive text-destructive-foreground border-transparent hover:not-disabled:bg-destructive-light",
|
|
15
|
+
success: "bg-success text-success-foreground border-transparent hover:not-disabled:bg-success-light",
|
|
16
|
+
warning: "bg-warning text-warning-foreground border-transparent hover:not-disabled:bg-warning-light",
|
|
17
|
+
info: "bg-info text-info-foreground border-transparent hover:not-disabled:bg-info-light",
|
|
18
|
+
ghost: "bg-transparent text-muted-foreground border-transparent hover:not-disabled:bg-secondary/50 hover:not-disabled:text-foreground",
|
|
19
|
+
"ghost-primary": "bg-primary/15 text-primary border-transparent hover:not-disabled:bg-primary/25",
|
|
20
|
+
"ghost-destructive": "bg-destructive/15 text-destructive border-transparent hover:not-disabled:bg-destructive/25",
|
|
21
|
+
"ghost-success": "bg-success/15 text-success border-transparent hover:not-disabled:bg-success/25",
|
|
22
|
+
"ghost-warning": "bg-warning/15 text-warning border-transparent hover:not-disabled:bg-warning/25",
|
|
23
|
+
"ghost-info": "bg-info/15 text-info border-transparent hover:not-disabled:bg-info/25",
|
|
24
|
+
link: "bg-transparent text-primary border-transparent underline-offset-4 hover:not-disabled:underline"
|
|
25
|
+
},
|
|
26
|
+
size: {
|
|
27
|
+
sm: "text-xs px-3 py-1 rounded-md h-7",
|
|
28
|
+
md: "text-sm px-4 py-2 rounded-md h-9",
|
|
29
|
+
lg: "text-base px-6 py-3 rounded-md h-11",
|
|
30
|
+
icon: "size-9 rounded-md"
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
defaultVariants: {
|
|
34
|
+
variant: "primary",
|
|
35
|
+
size: "md"
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
);
|
|
39
|
+
function h({ className: o, variant: e, size: r, loading: s = !1, asChild: b = !1, children: a, ...t }) {
|
|
40
|
+
return b ? /* @__PURE__ */ n(
|
|
41
|
+
g,
|
|
42
|
+
{
|
|
43
|
+
"data-slot": "button",
|
|
44
|
+
"data-variant": e,
|
|
45
|
+
"data-size": r,
|
|
46
|
+
className: i(d({ variant: e, size: r, className: o })),
|
|
47
|
+
...t,
|
|
48
|
+
children: a
|
|
49
|
+
}
|
|
50
|
+
) : /* @__PURE__ */ n(
|
|
51
|
+
"button",
|
|
52
|
+
{
|
|
53
|
+
"data-slot": "button",
|
|
54
|
+
"data-variant": e,
|
|
55
|
+
"data-size": r,
|
|
56
|
+
disabled: s || t.disabled,
|
|
57
|
+
className: i(d({ variant: e, size: r, className: o })),
|
|
58
|
+
...t,
|
|
59
|
+
children: s ? /* @__PURE__ */ n(u, { className: "animate-spin" }) : a
|
|
60
|
+
}
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
export {
|
|
64
|
+
h as Button,
|
|
65
|
+
d as buttonVariants
|
|
66
|
+
};
|
package/dist/Card.d.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
/** Accent color options for Card. */
|
|
3
|
+
export type AccentColor = 'primary' | 'success' | 'info' | 'warning' | 'destructive';
|
|
4
|
+
/** Accent side options for Card. */
|
|
5
|
+
export type AccentSide = 'top' | 'bottom' | 'left' | 'right';
|
|
6
|
+
export interface CardProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
7
|
+
/** Side of the card to display the accent border. */
|
|
8
|
+
accentSide?: AccentSide;
|
|
9
|
+
/** Color of the accent border. */
|
|
10
|
+
accentColor?: AccentColor;
|
|
11
|
+
}
|
|
12
|
+
declare const Card: React.ForwardRefExoticComponent<CardProps & React.RefAttributes<HTMLDivElement>>;
|
|
13
|
+
declare const CardHeader: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
14
|
+
declare const CardTitle: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
15
|
+
declare const CardDescription: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
16
|
+
declare const CardContent: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
17
|
+
declare const CardFooter: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
18
|
+
export { Card, CardHeader, CardTitle, CardDescription, CardContent, CardFooter };
|
package/dist/Card.js
ADDED
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as s } from "react";
|
|
3
|
+
import { c as t } from "./_shared/utils-eGXXUFl7.js";
|
|
4
|
+
const i = {
|
|
5
|
+
top: {
|
|
6
|
+
primary: "border-t-2 !border-t-primary",
|
|
7
|
+
success: "border-t-2 !border-t-success",
|
|
8
|
+
info: "border-t-2 !border-t-info",
|
|
9
|
+
warning: "border-t-2 !border-t-warning",
|
|
10
|
+
destructive: "border-t-2 !border-t-destructive"
|
|
11
|
+
},
|
|
12
|
+
bottom: {
|
|
13
|
+
primary: "border-b-2 !border-b-primary",
|
|
14
|
+
success: "border-b-2 !border-b-success",
|
|
15
|
+
info: "border-b-2 !border-b-info",
|
|
16
|
+
warning: "border-b-2 !border-b-warning",
|
|
17
|
+
destructive: "border-b-2 !border-b-destructive"
|
|
18
|
+
},
|
|
19
|
+
left: {
|
|
20
|
+
primary: "border-l-2 !border-l-primary",
|
|
21
|
+
success: "border-l-2 !border-l-success",
|
|
22
|
+
info: "border-l-2 !border-l-info",
|
|
23
|
+
warning: "border-l-2 !border-l-warning",
|
|
24
|
+
destructive: "border-l-2 !border-l-destructive"
|
|
25
|
+
},
|
|
26
|
+
right: {
|
|
27
|
+
primary: "border-r-2 !border-r-primary",
|
|
28
|
+
success: "border-r-2 !border-r-success",
|
|
29
|
+
info: "border-r-2 !border-r-info",
|
|
30
|
+
warning: "border-r-2 !border-r-warning",
|
|
31
|
+
destructive: "border-r-2 !border-r-destructive"
|
|
32
|
+
}
|
|
33
|
+
}, n = s(({ className: d, accentSide: r, accentColor: e, ...a }, b) => /* @__PURE__ */ o(
|
|
34
|
+
"div",
|
|
35
|
+
{
|
|
36
|
+
ref: b,
|
|
37
|
+
className: t(
|
|
38
|
+
"rounded-lg border border-border blurred-bg shadow-sm flex flex-col gap-5 p-5",
|
|
39
|
+
r && e && i[r]?.[e],
|
|
40
|
+
d
|
|
41
|
+
),
|
|
42
|
+
...a
|
|
43
|
+
}
|
|
44
|
+
));
|
|
45
|
+
n.displayName = "Card";
|
|
46
|
+
const c = s(({ className: d, ...r }, e) => /* @__PURE__ */ o(
|
|
47
|
+
"div",
|
|
48
|
+
{
|
|
49
|
+
ref: e,
|
|
50
|
+
className: t("flex flex-col space-y-1.5", d),
|
|
51
|
+
...r
|
|
52
|
+
}
|
|
53
|
+
));
|
|
54
|
+
c.displayName = "CardHeader";
|
|
55
|
+
const l = s(({ className: d, ...r }, e) => /* @__PURE__ */ o(
|
|
56
|
+
"div",
|
|
57
|
+
{
|
|
58
|
+
ref: e,
|
|
59
|
+
className: t("text-base font-semibold leading-none tracking-tight", d),
|
|
60
|
+
...r
|
|
61
|
+
}
|
|
62
|
+
));
|
|
63
|
+
l.displayName = "CardTitle";
|
|
64
|
+
const m = s(({ className: d, ...r }, e) => /* @__PURE__ */ o(
|
|
65
|
+
"div",
|
|
66
|
+
{
|
|
67
|
+
ref: e,
|
|
68
|
+
className: t("text-sm text-muted-foreground", d),
|
|
69
|
+
...r
|
|
70
|
+
}
|
|
71
|
+
));
|
|
72
|
+
m.displayName = "CardDescription";
|
|
73
|
+
const p = s(({ className: d, ...r }, e) => /* @__PURE__ */ o(
|
|
74
|
+
"div",
|
|
75
|
+
{
|
|
76
|
+
ref: e,
|
|
77
|
+
className: t(d),
|
|
78
|
+
...r
|
|
79
|
+
}
|
|
80
|
+
));
|
|
81
|
+
p.displayName = "CardContent";
|
|
82
|
+
const f = s(({ className: d, ...r }, e) => /* @__PURE__ */ o(
|
|
83
|
+
"div",
|
|
84
|
+
{
|
|
85
|
+
ref: e,
|
|
86
|
+
className: t("flex items-center gap-2", d),
|
|
87
|
+
...r
|
|
88
|
+
}
|
|
89
|
+
));
|
|
90
|
+
f.displayName = "CardFooter";
|
|
91
|
+
export {
|
|
92
|
+
n as Card,
|
|
93
|
+
p as CardContent,
|
|
94
|
+
m as CardDescription,
|
|
95
|
+
f as CardFooter,
|
|
96
|
+
c as CardHeader,
|
|
97
|
+
l as CardTitle
|
|
98
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
export interface CodeBlockProps {
|
|
2
|
+
/** Source code string to display. Trailing newline is stripped automatically. */
|
|
3
|
+
children: string;
|
|
4
|
+
/** Filename shown in the header bar. Takes precedence over language label. */
|
|
5
|
+
filename?: string;
|
|
6
|
+
/** Language identifier for syntax highlighting (e.g. "js", "python", "css", "bash", "json"). */
|
|
7
|
+
language?: string;
|
|
8
|
+
/** Whether to display line numbers. @default true */
|
|
9
|
+
lineNumbers?: boolean;
|
|
10
|
+
/** Array of 1-based line numbers to visually highlight. @default [] */
|
|
11
|
+
highlightLines?: number[];
|
|
12
|
+
/** Whether to show the copy-to-clipboard button in the header. @default true */
|
|
13
|
+
showCopyButton?: boolean;
|
|
14
|
+
/** Additional CSS classes for the outer container. */
|
|
15
|
+
className?: string;
|
|
16
|
+
/** Accessible label for the code region. Defaults to filename or "Code block". */
|
|
17
|
+
'aria-label'?: string;
|
|
18
|
+
}
|
|
19
|
+
export interface CopyButtonProps {
|
|
20
|
+
/** Text content to copy to the clipboard. */
|
|
21
|
+
text: string;
|
|
22
|
+
/** Additional CSS classes. */
|
|
23
|
+
className?: string;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Small icon button that copies text to the clipboard and shows a check icon on success.
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* <CopyButton text="npm install @la-batcave/ui" />
|
|
30
|
+
*/
|
|
31
|
+
declare function CopyButton({ text, className }: CopyButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
32
|
+
/**
|
|
33
|
+
* Syntax-highlighted code block with line numbers, copy button, diff markers,
|
|
34
|
+
* and line highlighting. Supports JS/TS, CSS, HTML, JSON, Bash, and Python.
|
|
35
|
+
* Automatically detects diff mode when lines start with `+` or `-`.
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* <CodeBlock language="js" filename="index.js" highlightLines={[3]}>
|
|
39
|
+
* {`const x = 1;
|
|
40
|
+
* const y = 2;
|
|
41
|
+
* const sum = x + y;`}
|
|
42
|
+
* </CodeBlock>
|
|
43
|
+
*/
|
|
44
|
+
declare function CodeBlock({ children, filename, language, lineNumbers, highlightLines, showCopyButton, className, "aria-label": ariaLabel, }: CodeBlockProps): import("react/jsx-runtime").JSX.Element;
|
|
45
|
+
export { CodeBlock, CopyButton };
|