@la-batcave/ui 3.5.0 → 4.0.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/Alert.d.ts CHANGED
@@ -7,21 +7,31 @@ export interface AlertProps extends Omit<React.HTMLAttributes<HTMLDivElement>, '
7
7
  size?: number;
8
8
  className?: string;
9
9
  }>;
10
- /** Accent color variant controlling the left border and icon color. */
10
+ /** Accent color variant controlling the icon and optional background tint. */
11
11
  variant?: AlertVariant;
12
12
  /** Title displayed prominently above the description. */
13
13
  title?: React.ReactNode;
14
+ /**
15
+ * When true, the entire card background is tinted with the variant color.
16
+ * When false, the card stays neutral and only the icon gets a colored badge.
17
+ * @default true
18
+ */
19
+ filled?: boolean;
14
20
  }
15
21
  /**
16
22
  * Alert banner for displaying contextual messages with icon, variant, title, and description.
17
23
  *
18
24
  * @example
19
- * import { Alert } from '@la-batcave/ui/Alert';
20
- * import { AlertTriangle } from 'lucide-react';
25
+ * // Filled (default) tinted background
26
+ * <Alert icon={Info} variant="info" title="Information">Message</Alert>
21
27
  *
22
- * <Alert icon={AlertTriangle} variant="warning" title="Attention">
23
- * Votre certificat SSL expire dans 43 jours.
24
- * </Alert>
28
+ * @example
29
+ * // Not filled neutral card, icon badge
30
+ * <Alert icon={Info} variant="info" title="Information" filled={false}>Message</Alert>
31
+ *
32
+ * @example
33
+ * // No variant — fully neutral
34
+ * <Alert icon={Shield} title="Note">Message</Alert>
25
35
  */
26
- declare function Alert({ icon: Icon, variant, title, children, className, ...props }: AlertProps): import("react/jsx-runtime").JSX.Element;
36
+ declare function Alert({ icon: Icon, variant, title, children, className, filled, ...props }: AlertProps): import("react/jsx-runtime").JSX.Element;
27
37
  export { Alert };
package/dist/Alert.js CHANGED
@@ -1,50 +1,53 @@
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 = {
1
+ import { jsx as e, jsxs as m } from "react/jsx-runtime";
2
+ import { c as r } from "./_shared/utils-eGXXUFl7.js";
3
+ import { Card as f } from "./Card.js";
4
+ const d = {
11
5
  primary: "text-primary",
12
6
  info: "text-info",
13
7
  success: "text-success",
14
8
  destructive: "text-destructive",
15
9
  warning: "text-warning"
10
+ }, x = {
11
+ primary: "bg-primary/15",
12
+ info: "bg-info/15",
13
+ success: "bg-success/15",
14
+ destructive: "bg-destructive/15",
15
+ warning: "bg-warning/15"
16
16
  };
17
- function b({
17
+ function N({
18
18
  icon: t,
19
- variant: r,
20
- title: s,
19
+ variant: s,
20
+ title: c,
21
21
  children: i,
22
- className: d,
23
- ...n
22
+ className: a,
23
+ filled: n = !0,
24
+ ...l
24
25
  }) {
26
+ const o = s && !n, u = c && !i;
25
27
  return /* @__PURE__ */ e(
26
- c,
28
+ f,
27
29
  {
28
- className: l(
29
- "!p-4 transition-all",
30
- r && a[r],
31
- d
30
+ accent: n ? s : void 0,
31
+ className: r(
32
+ "!p-4 !shadow-none",
33
+ a
32
34
  ),
33
35
  role: "alert",
34
- ...n,
35
- children: /* @__PURE__ */ o("div", { className: "flex items-start gap-3", children: [
36
- t && /* @__PURE__ */ e(
36
+ ...l,
37
+ children: /* @__PURE__ */ m("div", { className: r("flex gap-3", u ? "items-center" : "items-start"), children: [
38
+ t && o && /* @__PURE__ */ e("div", { className: r("shrink-0 w-8 h-8 rounded-full flex items-center justify-center", x[s]), children: /* @__PURE__ */ e(t, { size: 16, className: d[s] }) }),
39
+ t && !o && /* @__PURE__ */ e(
37
40
  "div",
38
41
  {
39
- className: l(
42
+ className: r(
40
43
  "shrink-0 h-5 flex items-center",
41
- r ? m[r] : "text-muted-foreground"
44
+ s ? d[s] : "text-muted-foreground"
42
45
  ),
43
46
  children: /* @__PURE__ */ e(t, { size: 16 })
44
47
  }
45
48
  ),
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 }),
49
+ /* @__PURE__ */ m("div", { className: "flex-1 min-w-0 flex flex-col gap-1", children: [
50
+ c && /* @__PURE__ */ e("div", { className: "text-sm font-semibold text-foreground", children: c }),
48
51
  i && /* @__PURE__ */ e("div", { className: "text-sm text-muted-foreground", children: i })
49
52
  ] })
50
53
  ] })
@@ -52,5 +55,5 @@ function b({
52
55
  );
53
56
  }
54
57
  export {
55
- b as Alert
58
+ N as Alert
56
59
  };
package/dist/Button.js CHANGED
@@ -1,10 +1,10 @@
1
- import { jsx as n } from "react/jsx-runtime";
2
- import { S as g } from "./_shared/index-BrLJJgkl.js";
1
+ import { jsx as t, jsxs as g } from "react/jsx-runtime";
2
+ import { S as l } from "./_shared/index-BrLJJgkl.js";
3
3
  import { c } from "./_shared/index-uPOYJZpG.js";
4
- import { Loader2 as l } from "lucide-react";
5
- import { c as d } from "./_shared/utils-eGXXUFl7.js";
6
- const i = c(
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",
4
+ import { Loader2 as u } from "lucide-react";
5
+ import { c as o } from "./_shared/utils-eGXXUFl7.js";
6
+ const d = c(
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:border-ring focus-visible:ring-3 focus-visible:ring-ring/30 disabled:opacity-40 disabled:cursor-not-allowed disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0",
8
8
  {
9
9
  variants: {
10
10
  variant: {
@@ -21,7 +21,7 @@ const i = c(
21
21
  "ghost-success": "bg-transparent text-success border-transparent hover:not-disabled:bg-success/15",
22
22
  "ghost-warning": "bg-transparent text-warning border-transparent hover:not-disabled:bg-warning/15",
23
23
  "ghost-info": "bg-transparent text-info border-transparent hover:not-disabled:bg-info/15",
24
- semi: "bg-secondary text-muted-foreground border-transparent hover:not-disabled:bg-secondary/80 hover:not-disabled:text-foreground",
24
+ semi: "bg-foreground/15 text-foreground border-transparent hover:not-disabled:bg-foreground/25",
25
25
  "semi-primary": "bg-primary/15 text-primary border-transparent hover:not-disabled:bg-primary/25",
26
26
  "semi-destructive": "bg-destructive/15 text-destructive border-transparent hover:not-disabled:bg-destructive/25",
27
27
  "semi-success": "bg-success/15 text-success border-transparent hover:not-disabled:bg-success/25",
@@ -30,10 +30,10 @@ const i = c(
30
30
  link: "bg-transparent text-primary border-transparent underline-offset-4 hover:not-disabled:underline"
31
31
  },
32
32
  size: {
33
- sm: "text-xs px-3 py-1 rounded-md h-7",
34
- md: "text-sm px-4 py-2 rounded-md h-9",
35
- lg: "text-base px-6 py-3 rounded-md h-11",
36
- icon: "size-9 rounded-md"
33
+ sm: "text-xs px-3 py-1 rounded-4xl h-7",
34
+ md: "text-sm px-4 py-2 rounded-4xl h-9",
35
+ lg: "text-base px-6 py-3 rounded-4xl h-11",
36
+ icon: "size-9 rounded-4xl"
37
37
  }
38
38
  },
39
39
  defaultVariants: {
@@ -42,31 +42,34 @@ const i = c(
42
42
  }
43
43
  }
44
44
  );
45
- function h({ className: o, variant: e, size: r, loading: s = !1, asChild: b = !1, children: a, ...t }) {
46
- return b ? /* @__PURE__ */ n(
47
- g,
45
+ function x({ className: a, variant: e, size: r, loading: n = !1, asChild: b = !1, children: i, ...s }) {
46
+ return b ? /* @__PURE__ */ t(
47
+ l,
48
48
  {
49
49
  "data-slot": "button",
50
50
  "data-variant": e,
51
51
  "data-size": r,
52
- className: d(i({ variant: e, size: r, className: o })),
53
- ...t,
54
- children: a
52
+ className: o(d({ variant: e, size: r, className: a })),
53
+ ...s,
54
+ children: i
55
55
  }
56
- ) : /* @__PURE__ */ n(
56
+ ) : /* @__PURE__ */ g(
57
57
  "button",
58
58
  {
59
59
  "data-slot": "button",
60
60
  "data-variant": e,
61
61
  "data-size": r,
62
- disabled: s || t.disabled,
63
- className: d(i({ variant: e, size: r, className: o })),
64
- ...t,
65
- children: s ? /* @__PURE__ */ n(l, { className: "animate-spin" }) : a
62
+ disabled: n || s.disabled,
63
+ className: o(d({ variant: e, size: r, className: a })),
64
+ ...s,
65
+ children: [
66
+ n && /* @__PURE__ */ t("span", { className: "absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ t(u, { className: "animate-spin" }) }),
67
+ /* @__PURE__ */ t("span", { className: o("inline-flex items-center justify-center gap-2", n && "invisible"), children: i })
68
+ ]
66
69
  }
67
70
  );
68
71
  }
69
72
  export {
70
- h as Button,
71
- i as buttonVariants
73
+ x as Button,
74
+ d as buttonVariants
72
75
  };
package/dist/Card.d.ts CHANGED
@@ -1,13 +1,9 @@
1
1
  import * as React from "react";
2
2
  /** Accent color options for Card. */
3
3
  export type AccentColor = 'primary' | 'success' | 'info' | 'warning' | 'destructive';
4
- /** Accent side options for Card. */
5
- export type AccentSide = 'top' | 'bottom' | 'left' | 'right';
6
4
  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;
5
+ /** Tints the card background with a subtle color. */
6
+ accent?: AccentColor;
11
7
  }
12
8
  declare const Card: React.ForwardRefExoticComponent<CardProps & React.RefAttributes<HTMLDivElement>>;
13
9
  declare const CardHeader: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
package/dist/Card.js CHANGED
@@ -1,98 +1,75 @@
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(
1
+ import { jsx as a } from "react/jsx-runtime";
2
+ import { forwardRef as o } from "react";
3
+ import { c as s } from "./_shared/utils-eGXXUFl7.js";
4
+ const t = {
5
+ primary: "bg-primary/20 border-primary/30 dark:bg-primary/10 dark:border-primary/20 backdrop-blur-md",
6
+ success: "bg-success/20 border-success/30 dark:bg-success/10 dark:border-success/20 backdrop-blur-md",
7
+ info: "bg-info/20 border-info/30 dark:bg-info/10 dark:border-info/20 backdrop-blur-md",
8
+ warning: "bg-warning/20 border-warning/30 dark:bg-warning/10 dark:border-warning/20 backdrop-blur-md",
9
+ destructive: "bg-destructive/20 border-destructive/30 dark:bg-destructive/10 dark:border-destructive/20 backdrop-blur-md"
10
+ }, c = o(({ className: d, accent: r, ...e }, i) => /* @__PURE__ */ a(
34
11
  "div",
35
12
  {
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],
13
+ ref: i,
14
+ className: s(
15
+ "rounded-4xl border ring-1 ring-foreground/5 dark:ring-foreground/10 shadow-md flex flex-col gap-6 p-5",
16
+ r ? t[r] : "border-border blurred-bg",
40
17
  d
41
18
  ),
42
- ...a
19
+ ...e
43
20
  }
44
21
  ));
45
- n.displayName = "Card";
46
- const c = s(({ className: d, ...r }, e) => /* @__PURE__ */ o(
22
+ c.displayName = "Card";
23
+ const n = o(({ className: d, ...r }, e) => /* @__PURE__ */ a(
47
24
  "div",
48
25
  {
49
26
  ref: e,
50
- className: t("flex flex-col space-y-1.5", d),
27
+ className: s("flex flex-col space-y-1.5", d),
51
28
  ...r
52
29
  }
53
30
  ));
54
- c.displayName = "CardHeader";
55
- const l = s(({ className: d, ...r }, e) => /* @__PURE__ */ o(
31
+ n.displayName = "CardHeader";
32
+ const b = o(({ className: d, ...r }, e) => /* @__PURE__ */ a(
56
33
  "div",
57
34
  {
58
35
  ref: e,
59
- className: t("text-base font-semibold leading-none tracking-tight", d),
36
+ className: s("text-base font-semibold leading-none tracking-tight", d),
60
37
  ...r
61
38
  }
62
39
  ));
63
- l.displayName = "CardTitle";
64
- const m = s(({ className: d, ...r }, e) => /* @__PURE__ */ o(
40
+ b.displayName = "CardTitle";
41
+ const m = o(({ className: d, ...r }, e) => /* @__PURE__ */ a(
65
42
  "div",
66
43
  {
67
44
  ref: e,
68
- className: t("text-sm text-muted-foreground", d),
45
+ className: s("text-sm text-muted-foreground", d),
69
46
  ...r
70
47
  }
71
48
  ));
72
49
  m.displayName = "CardDescription";
73
- const p = s(({ className: d, ...r }, e) => /* @__PURE__ */ o(
50
+ const l = o(({ className: d, ...r }, e) => /* @__PURE__ */ a(
74
51
  "div",
75
52
  {
76
53
  ref: e,
77
- className: t(d),
54
+ className: s(d),
78
55
  ...r
79
56
  }
80
57
  ));
81
- p.displayName = "CardContent";
82
- const f = s(({ className: d, ...r }, e) => /* @__PURE__ */ o(
58
+ l.displayName = "CardContent";
59
+ const g = o(({ className: d, ...r }, e) => /* @__PURE__ */ a(
83
60
  "div",
84
61
  {
85
62
  ref: e,
86
- className: t("flex items-center gap-2", d),
63
+ className: s("flex items-center gap-2", d),
87
64
  ...r
88
65
  }
89
66
  ));
90
- f.displayName = "CardFooter";
67
+ g.displayName = "CardFooter";
91
68
  export {
92
- n as Card,
93
- p as CardContent,
69
+ c as Card,
70
+ l as CardContent,
94
71
  m as CardDescription,
95
- f as CardFooter,
96
- c as CardHeader,
97
- l as CardTitle
72
+ g as CardFooter,
73
+ n as CardHeader,
74
+ b as CardTitle
98
75
  };
package/dist/CodeBlock.js CHANGED
@@ -139,11 +139,11 @@ function O({ text: a, className: n }) {
139
139
  {
140
140
  onClick: p,
141
141
  className: y(
142
- "inline-flex items-center justify-center rounded-md p-1.5",
142
+ "inline-flex items-center justify-center rounded-xl p-1.5",
143
143
  "text-muted-foreground hover:text-foreground",
144
144
  "bg-transparent hover:bg-secondary",
145
145
  "transition-all duration-150",
146
- "focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",
146
+ "focus-visible:outline-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/30",
147
147
  n
148
148
  ),
149
149
  "aria-label": r ? "Copied" : "Copy code",
package/dist/Collapse.js CHANGED
@@ -5,8 +5,8 @@ import { ChevronDown as F } from "lucide-react";
5
5
  import { c as b } from "./_shared/utils-eGXXUFl7.js";
6
6
  const y = H(null);
7
7
  function G({
8
- title: p,
9
- children: x,
8
+ title: x,
9
+ children: p,
10
10
  icon: s,
11
11
  defaultOpen: r = !1,
12
12
  open: n,
@@ -36,7 +36,7 @@ function G({
36
36
  "div",
37
37
  {
38
38
  className: b(
39
- "bg-card/85 backdrop-blur-xl border border-border rounded-lg overflow-hidden transition-colors hover:border-secondary",
39
+ "bg-card/85 backdrop-blur-xl border border-border rounded-2xl overflow-hidden transition-colors hover:border-secondary ring-1 ring-foreground/5 dark:ring-foreground/10",
40
40
  g
41
41
  ),
42
42
  ...l,
@@ -50,7 +50,7 @@ function G({
50
50
  className: "flex items-center gap-3 w-full px-4 py-3 text-left text-sm font-medium text-foreground cursor-pointer",
51
51
  children: [
52
52
  s && /* @__PURE__ */ e("span", { className: "text-muted-foreground shrink-0 inline-flex items-center", children: /* @__PURE__ */ e(s, { size: 16 }) }),
53
- /* @__PURE__ */ e("span", { className: "flex-1 min-w-0", children: p }),
53
+ /* @__PURE__ */ e("span", { className: "flex-1 min-w-0", children: x }),
54
54
  /* @__PURE__ */ e(
55
55
  F,
56
56
  {
@@ -70,18 +70,18 @@ function G({
70
70
  ref: C,
71
71
  style: { height: A },
72
72
  className: "overflow-hidden transition-[height] duration-200 ease-in-out",
73
- children: /* @__PURE__ */ e("div", { className: "px-4 pb-4 text-sm text-muted-foreground", children: x })
73
+ children: /* @__PURE__ */ e("div", { className: "px-4 pb-4 text-sm text-muted-foreground", children: p })
74
74
  }
75
75
  )
76
76
  ]
77
77
  }
78
78
  );
79
79
  }
80
- function P({ children: p, accordion: x = !1, className: s, ...r }) {
80
+ function P({ children: x, accordion: p = !1, className: s, ...r }) {
81
81
  const [n, i] = v(null), g = I((c) => {
82
82
  i((h) => h === c ? null : c);
83
- }, []), l = /* @__PURE__ */ e("div", { className: b("flex flex-col gap-2", s), ...r, children: p });
84
- return x ? /* @__PURE__ */ e(y.Provider, { value: { openId: n, toggle: g }, children: l }) : l;
83
+ }, []), l = /* @__PURE__ */ e("div", { className: b("flex flex-col gap-2", s), ...r, children: x });
84
+ return p ? /* @__PURE__ */ e(y.Provider, { value: { openId: n, toggle: g }, children: l }) : l;
85
85
  }
86
86
  export {
87
87
  G as Collapse,