@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.
Files changed (107) hide show
  1. package/README.md +95 -0
  2. package/dist/Alert.d.ts +27 -0
  3. package/dist/Alert.js +56 -0
  4. package/dist/Avatar.d.ts +20 -0
  5. package/dist/Avatar.js +40 -0
  6. package/dist/Badge.d.ts +56 -0
  7. package/dist/Badge.js +74 -0
  8. package/dist/Button.d.ts +53 -0
  9. package/dist/Button.js +66 -0
  10. package/dist/Card.d.ts +18 -0
  11. package/dist/Card.js +98 -0
  12. package/dist/CodeBlock.d.ts +45 -0
  13. package/dist/CodeBlock.js +306 -0
  14. package/dist/Collapse.d.ts +58 -0
  15. package/dist/Collapse.js +89 -0
  16. package/dist/Combobox.d.ts +44 -0
  17. package/dist/Combobox.js +409 -0
  18. package/dist/DarkMode.d.ts +59 -0
  19. package/dist/DarkMode.js +56 -0
  20. package/dist/DatePicker.d.ts +48 -0
  21. package/dist/DatePicker.js +2954 -0
  22. package/dist/Dialog.d.ts +119 -0
  23. package/dist/Dialog.js +337 -0
  24. package/dist/Drawer.d.ts +28 -0
  25. package/dist/Drawer.js +1126 -0
  26. package/dist/Dropdown.d.ts +23 -0
  27. package/dist/Dropdown.js +247 -0
  28. package/dist/EasyForm.d.ts +138 -0
  29. package/dist/EasyForm.js +286 -0
  30. package/dist/HoverCard.d.ts +10 -0
  31. package/dist/HoverCard.js +195 -0
  32. package/dist/Input.d.ts +230 -0
  33. package/dist/Input.js +2216 -0
  34. package/dist/LogViewer.d.ts +57 -0
  35. package/dist/LogViewer.js +120 -0
  36. package/dist/Menubar.d.ts +32 -0
  37. package/dist/Menubar.js +398 -0
  38. package/dist/Navbar.d.ts +20 -0
  39. package/dist/Navbar.js +31 -0
  40. package/dist/Pagination.d.ts +78 -0
  41. package/dist/Pagination.js +106 -0
  42. package/dist/Popover.d.ts +11 -0
  43. package/dist/Popover.js +28 -0
  44. package/dist/ProgressBar.d.ts +35 -0
  45. package/dist/ProgressBar.js +210 -0
  46. package/dist/Resizable.d.ts +23 -0
  47. package/dist/Resizable.js +1532 -0
  48. package/dist/Separator.d.ts +4 -0
  49. package/dist/Separator.js +46 -0
  50. package/dist/Sheet.d.ts +29 -0
  51. package/dist/Sheet.js +104 -0
  52. package/dist/Sidebar.d.ts +117 -0
  53. package/dist/Sidebar.js +237 -0
  54. package/dist/Skeleton.d.ts +57 -0
  55. package/dist/Skeleton.js +47 -0
  56. package/dist/Table.d.ts +71 -0
  57. package/dist/Table.js +94 -0
  58. package/dist/Tabs.d.ts +76 -0
  59. package/dist/Tabs.js +202 -0
  60. package/dist/Toast.d.ts +54 -0
  61. package/dist/Toast.js +827 -0
  62. package/dist/Tooltip.d.ts +29 -0
  63. package/dist/Tooltip.js +352 -0
  64. package/dist/Typography.d.ts +101 -0
  65. package/dist/Typography.js +123 -0
  66. package/dist/Widget.d.ts +133 -0
  67. package/dist/Widget.js +207 -0
  68. package/dist/_shared/Combination-D_l4PLF_.js +676 -0
  69. package/dist/_shared/index-B03TCNO5.js +142 -0
  70. package/dist/_shared/index-B1f-hyuh.js +31 -0
  71. package/dist/_shared/index-BC7vfx-u.js +13 -0
  72. package/dist/_shared/index-BrLJJgkl.js +67 -0
  73. package/dist/_shared/index-C0gNQvxa.js +269 -0
  74. package/dist/_shared/index-C3aZemLI.js +268 -0
  75. package/dist/_shared/index-CXeb1OMI.js +198 -0
  76. package/dist/_shared/index-CukUn3R0.js +626 -0
  77. package/dist/_shared/index-DLcqcWxM.js +29 -0
  78. package/dist/_shared/index-DlSuDb9N.js +283 -0
  79. package/dist/_shared/index-V-Ajw7Ac.js +79 -0
  80. package/dist/_shared/index-uPOYJZpG.js +34 -0
  81. package/dist/_shared/index-uu9PT5Nu.js +1588 -0
  82. package/dist/_shared/utils-eGXXUFl7.js +2935 -0
  83. package/dist/backgrounds/Aurora.d.ts +7 -0
  84. package/dist/backgrounds/Aurora.js +126 -0
  85. package/dist/backgrounds/Iridescence.d.ts +7 -0
  86. package/dist/backgrounds/Iridescence.js +77 -0
  87. package/dist/backgrounds/Lightning.d.ts +8 -0
  88. package/dist/backgrounds/Lightning.js +75 -0
  89. package/dist/backgrounds/LiquidChrome.d.ts +9 -0
  90. package/dist/backgrounds/LiquidChrome.js +89 -0
  91. package/dist/backgrounds/Particles.d.ts +15 -0
  92. package/dist/backgrounds/Particles.js +137 -0
  93. package/dist/backgrounds/PixelSnow.d.ts +9 -0
  94. package/dist/backgrounds/PixelSnow.js +52 -0
  95. package/dist/backgrounds/Silk.d.ts +8 -0
  96. package/dist/backgrounds/Silk.js +92 -0
  97. package/dist/backgrounds/Squares.d.ts +9 -0
  98. package/dist/backgrounds/Squares.js +75 -0
  99. package/dist/backgrounds/Threads.d.ts +7 -0
  100. package/dist/backgrounds/Threads.js +110 -0
  101. package/dist/backgrounds/Waves.d.ts +14 -0
  102. package/dist/backgrounds/Waves.js +139 -0
  103. package/dist/fonts/inter-latin-wght-normal.woff2 +0 -0
  104. package/dist/index.css +1 -0
  105. package/dist/index.d.ts +2 -0
  106. package/dist/index.js +4 -0
  107. package/package.json +318 -0
@@ -0,0 +1,133 @@
1
+ import * as React from 'react';
2
+ /** Variant controlling the accent color of the widget. */
3
+ export type WidgetVariant = 'primary' | 'info' | 'success' | 'destructive' | 'warning';
4
+ export interface StatWidgetProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'title'> {
5
+ /** Icon displayed in a colored box beside the stat. */
6
+ icon?: React.ComponentType<{
7
+ size?: number;
8
+ className?: string;
9
+ }>;
10
+ /** Descriptive label displayed above the value. */
11
+ title: React.ReactNode;
12
+ /** Primary metric value displayed prominently. */
13
+ value: React.ReactNode;
14
+ /** Accent color variant. When omitted, icon is white with no colored border. */
15
+ variant?: WidgetVariant;
16
+ /** Show colored top border. Defaults to true when variant is set. @default !!variant */
17
+ accent?: boolean;
18
+ }
19
+ export interface ListWidgetProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'title'> {
20
+ /** Title displayed in the widget header. */
21
+ title?: React.ReactNode;
22
+ /** Icon displayed beside the title. */
23
+ icon?: React.ComponentType<{
24
+ size?: number;
25
+ className?: string;
26
+ }>;
27
+ /** Accent color variant. */
28
+ variant?: WidgetVariant;
29
+ /** Show colored top border. Defaults to true when variant is set. @default !!variant */
30
+ accent?: boolean;
31
+ }
32
+ export interface ListWidgetLineProps extends React.HTMLAttributes<HTMLDivElement> {
33
+ /** Icon displayed in a box at the start of the line. */
34
+ icon?: React.ComponentType<{
35
+ size?: number;
36
+ className?: string;
37
+ }>;
38
+ /** Additional class names applied to the icon container. */
39
+ iconClassName?: string;
40
+ /** Image URL that replaces the icon when provided. */
41
+ imageUrl?: string;
42
+ /** Variant controlling the icon color. When omitted, icon is muted. */
43
+ variant?: WidgetVariant;
44
+ /** Secondary text displayed below the main content. */
45
+ subtitle?: React.ReactNode;
46
+ /** Content displayed on the right side of the line (badge, status, value, etc.). */
47
+ suffix?: React.ReactNode;
48
+ }
49
+ export interface CustomWidgetProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'title'> {
50
+ /** Title displayed in the widget header. */
51
+ title?: React.ReactNode;
52
+ /** Icon displayed beside the title. */
53
+ icon?: React.ComponentType<{
54
+ size?: number;
55
+ className?: string;
56
+ }>;
57
+ /** Accent color variant. */
58
+ variant?: WidgetVariant;
59
+ /** Show colored top border. Defaults to true when variant is set. @default !!variant */
60
+ accent?: boolean;
61
+ }
62
+ export interface TextWidgetProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'title'> {
63
+ /** Title displayed in the widget header. */
64
+ title?: React.ReactNode;
65
+ /** Icon displayed beside the title. */
66
+ icon?: React.ComponentType<{
67
+ size?: number;
68
+ className?: string;
69
+ }>;
70
+ /** Accent color variant. */
71
+ variant?: WidgetVariant;
72
+ /** Show colored top border. Defaults to true when variant is set. @default !!variant */
73
+ accent?: boolean;
74
+ }
75
+ /**
76
+ * Compact widget for displaying a single key metric with icon, title, and value.
77
+ *
78
+ * @example
79
+ * import { StatWidget } from '@la-batcave/ui/Widget';
80
+ * import { Users } from 'lucide-react';
81
+ *
82
+ * <StatWidget icon={Users} title="Total Users" value="1,234" variant="success" />
83
+ */
84
+ declare function StatWidget({ icon: Icon, title, value, variant, accent, className, ...props }: StatWidgetProps): import("react/jsx-runtime").JSX.Element;
85
+ /**
86
+ * Widget displaying a list of items with an optional header (title + icon).
87
+ * Use ListWidgetLine as children.
88
+ *
89
+ * @example
90
+ * import { ListWidget, ListWidgetLine } from '@la-batcave/ui/Widget';
91
+ * import { BarChart3, Download, Cpu } from 'lucide-react';
92
+ *
93
+ * <ListWidget title="Activite recente" icon={BarChart3} variant="primary">
94
+ * <ListWidgetLine icon={Download} subtitle="il y a 5 min">Fichier telecharge</ListWidgetLine>
95
+ * <ListWidgetLine icon={Cpu} subtitle="il y a 12 min">Build termine</ListWidgetLine>
96
+ * </ListWidget>
97
+ */
98
+ declare function ListWidget({ title, icon: Icon, variant, accent, children, className, ...props }: ListWidgetProps): import("react/jsx-runtime").JSX.Element;
99
+ /**
100
+ * A single line inside a ListWidget.
101
+ *
102
+ * @example
103
+ * <ListWidgetLine icon={Download} iconColor="var(--success)" subtitle="il y a 5 min">
104
+ * Escape Simulator 2 telecharge
105
+ * </ListWidgetLine>
106
+ */
107
+ declare function ListWidgetLine({ icon: Icon, iconClassName, imageUrl, variant, children, subtitle, suffix, className, ...props }: ListWidgetLineProps): import("react/jsx-runtime").JSX.Element;
108
+ /**
109
+ * Widget with an optional header (title + icon) and free-form children content.
110
+ * Like ListWidget but without the list structure -- use for custom layouts.
111
+ *
112
+ * @example
113
+ * import { CustomWidget } from '@la-batcave/ui/Widget';
114
+ * import { Download } from 'lucide-react';
115
+ *
116
+ * <CustomWidget title="Telechargement" icon={Download} variant="primary">
117
+ * <ProgressBar value={67} />
118
+ * </CustomWidget>
119
+ */
120
+ declare function CustomWidget({ title, icon: Icon, variant, accent, children, className, ...props }: CustomWidgetProps): import("react/jsx-runtime").JSX.Element;
121
+ /**
122
+ * Widget with header (title + icon) and text content auto-styled as muted description.
123
+ *
124
+ * @example
125
+ * import { TextWidget } from '@la-batcave/ui/Widget';
126
+ * import { Shield } from 'lucide-react';
127
+ *
128
+ * <TextWidget title="Info systeme" icon={Shield} variant="info">
129
+ * Maintenance prevue demain a 3h.
130
+ * </TextWidget>
131
+ */
132
+ declare function TextWidget({ title, icon: Icon, variant, accent, children, className, ...props }: TextWidgetProps): import("react/jsx-runtime").JSX.Element;
133
+ export { StatWidget, ListWidget, ListWidgetLine, CustomWidget, TextWidget };
package/dist/Widget.js ADDED
@@ -0,0 +1,207 @@
1
+ import { jsxs as o, jsx as t } from "react/jsx-runtime";
2
+ import { Card as m } from "./Card.js";
3
+ import { c as l } from "./_shared/utils-eGXXUFl7.js";
4
+ const a = "p-5 transition-all hover:border-secondary hover:shadow-[0_2px_12px_rgba(0,0,0,0.2)]", x = {
5
+ primary: "bg-primary/15 text-primary",
6
+ info: "bg-info/15 text-info",
7
+ success: "bg-success/15 text-success",
8
+ destructive: "bg-destructive/15 text-destructive",
9
+ warning: "bg-warning/15 text-warning"
10
+ }, h = {
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: s,
19
+ title: r,
20
+ value: e,
21
+ variant: c,
22
+ accent: n = !!c,
23
+ className: d,
24
+ ...i
25
+ }) {
26
+ return /* @__PURE__ */ t(
27
+ m,
28
+ {
29
+ accentSide: n ? "top" : void 0,
30
+ accentColor: c,
31
+ className: l(a, d),
32
+ ...i,
33
+ children: /* @__PURE__ */ o("div", { className: "flex items-center gap-3", children: [
34
+ s && /* @__PURE__ */ t(
35
+ "div",
36
+ {
37
+ className: l(
38
+ "w-9 h-9 rounded-md flex items-center justify-center shrink-0",
39
+ c ? x[c] : "text-foreground"
40
+ ),
41
+ children: /* @__PURE__ */ t(s, { size: c ? 18 : 22 })
42
+ }
43
+ ),
44
+ /* @__PURE__ */ o("div", { className: "flex flex-col gap-0.5 min-w-0", children: [
45
+ /* @__PURE__ */ t("span", { className: "text-sm text-muted-foreground truncate", children: r }),
46
+ /* @__PURE__ */ t("span", { className: "text-xl font-bold text-foreground", children: e })
47
+ ] })
48
+ ] })
49
+ }
50
+ );
51
+ }
52
+ function w({
53
+ title: s,
54
+ icon: r,
55
+ variant: e,
56
+ accent: c = !!e,
57
+ children: n,
58
+ className: d,
59
+ ...i
60
+ }) {
61
+ return /* @__PURE__ */ o(
62
+ m,
63
+ {
64
+ accentSide: c ? "top" : void 0,
65
+ accentColor: e,
66
+ className: l(a, "flex flex-col", d),
67
+ ...i,
68
+ children: [
69
+ (s || r) && /* @__PURE__ */ o("div", { className: "flex items-center gap-2", children: [
70
+ r && /* @__PURE__ */ t(
71
+ "div",
72
+ {
73
+ className: l(
74
+ "w-7 h-7 rounded-md flex items-center justify-center shrink-0",
75
+ e ? x[e] : "text-foreground"
76
+ ),
77
+ children: /* @__PURE__ */ t(r, { size: e ? 14 : 18 })
78
+ }
79
+ ),
80
+ s && /* @__PURE__ */ t("span", { className: "text-sm font-semibold text-foreground", children: s })
81
+ ] }),
82
+ /* @__PURE__ */ t("div", { className: "flex flex-col -my-2.5", children: n })
83
+ ]
84
+ }
85
+ );
86
+ }
87
+ function y({
88
+ icon: s,
89
+ iconClassName: r,
90
+ imageUrl: e,
91
+ variant: c,
92
+ children: n,
93
+ subtitle: d,
94
+ suffix: i,
95
+ className: f,
96
+ ...u
97
+ }) {
98
+ return /* @__PURE__ */ o(
99
+ "div",
100
+ {
101
+ className: l("flex items-center gap-3 py-2.5 border-b border-border last:border-b-0", f),
102
+ ...u,
103
+ children: [
104
+ (s || e) && /* @__PURE__ */ t(
105
+ "div",
106
+ {
107
+ className: l(
108
+ "w-8 h-8 rounded-md bg-secondary flex items-center justify-center shrink-0 overflow-hidden",
109
+ c ? h[c] : "text-muted-foreground",
110
+ r
111
+ ),
112
+ children: e ? /* @__PURE__ */ t(
113
+ "img",
114
+ {
115
+ src: e,
116
+ alt: "",
117
+ className: "w-full h-full object-cover"
118
+ }
119
+ ) : s ? /* @__PURE__ */ t(s, { size: 14 }) : null
120
+ }
121
+ ),
122
+ /* @__PURE__ */ o("div", { className: "flex-1 min-w-0", children: [
123
+ /* @__PURE__ */ t("div", { className: "text-[0.8125rem] font-medium text-foreground", children: n }),
124
+ d && /* @__PURE__ */ t("div", { className: "text-xs text-muted-foreground", children: d })
125
+ ] }),
126
+ i && /* @__PURE__ */ t("div", { className: "shrink-0 flex items-center", children: i })
127
+ ]
128
+ }
129
+ );
130
+ }
131
+ function v({
132
+ title: s,
133
+ icon: r,
134
+ variant: e,
135
+ accent: c = !!e,
136
+ children: n,
137
+ className: d,
138
+ ...i
139
+ }) {
140
+ return /* @__PURE__ */ o(
141
+ m,
142
+ {
143
+ accentSide: c ? "top" : void 0,
144
+ accentColor: e,
145
+ className: l(a, "flex flex-col", d),
146
+ ...i,
147
+ children: [
148
+ (s || r) && /* @__PURE__ */ o("div", { className: "flex items-center gap-2", children: [
149
+ r && /* @__PURE__ */ t(
150
+ "div",
151
+ {
152
+ className: l(
153
+ "w-7 h-7 rounded-md flex items-center justify-center shrink-0",
154
+ e ? x[e] : "text-foreground"
155
+ ),
156
+ children: /* @__PURE__ */ t(r, { size: e ? 14 : 18 })
157
+ }
158
+ ),
159
+ s && /* @__PURE__ */ t("span", { className: "text-sm font-semibold text-foreground", children: s })
160
+ ] }),
161
+ n
162
+ ]
163
+ }
164
+ );
165
+ }
166
+ function j({
167
+ title: s,
168
+ icon: r,
169
+ variant: e,
170
+ accent: c = !!e,
171
+ children: n,
172
+ className: d,
173
+ ...i
174
+ }) {
175
+ return /* @__PURE__ */ o(
176
+ m,
177
+ {
178
+ accentSide: c ? "top" : void 0,
179
+ accentColor: e,
180
+ className: l(a, "flex flex-col gap-3", d),
181
+ ...i,
182
+ children: [
183
+ (s || r) && /* @__PURE__ */ o("div", { className: "flex items-center gap-2", children: [
184
+ r && /* @__PURE__ */ t(
185
+ "div",
186
+ {
187
+ className: l(
188
+ "w-7 h-7 rounded-md flex items-center justify-center shrink-0",
189
+ e ? x[e] : "text-foreground"
190
+ ),
191
+ children: /* @__PURE__ */ t(r, { size: e ? 14 : 18 })
192
+ }
193
+ ),
194
+ s && /* @__PURE__ */ t("span", { className: "text-sm font-semibold text-foreground", children: s })
195
+ ] }),
196
+ n && /* @__PURE__ */ t("div", { className: "text-sm text-muted-foreground", children: n })
197
+ ]
198
+ }
199
+ );
200
+ }
201
+ export {
202
+ v as CustomWidget,
203
+ w as ListWidget,
204
+ y as ListWidgetLine,
205
+ b as StatWidget,
206
+ j as TextWidget
207
+ };