@assassin1717/aifelib 1.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/README.md +739 -0
- package/dist/index.cjs +1534 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +342 -0
- package/dist/index.d.ts +342 -0
- package/dist/index.js +1458 -0
- package/dist/index.js.map +1 -0
- package/package.json +95 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,342 @@
|
|
|
1
|
+
import { ClassValue } from 'clsx';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
|
+
|
|
5
|
+
declare function cn(...inputs: ClassValue[]): string;
|
|
6
|
+
|
|
7
|
+
type ButtonVariant = "primary" | "secondary" | "ghost" | "destructive" | "outline";
|
|
8
|
+
type ButtonSize = "sm" | "md" | "lg";
|
|
9
|
+
interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
10
|
+
variant?: ButtonVariant;
|
|
11
|
+
size?: ButtonSize;
|
|
12
|
+
loading?: boolean;
|
|
13
|
+
fullWidth?: boolean;
|
|
14
|
+
}
|
|
15
|
+
declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
16
|
+
|
|
17
|
+
interface InputProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
18
|
+
error?: boolean;
|
|
19
|
+
startIcon?: React.ReactNode;
|
|
20
|
+
endIcon?: React.ReactNode;
|
|
21
|
+
}
|
|
22
|
+
declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<HTMLInputElement>>;
|
|
23
|
+
|
|
24
|
+
interface TextareaProps extends React.TextareaHTMLAttributes<HTMLTextAreaElement> {
|
|
25
|
+
error?: boolean;
|
|
26
|
+
}
|
|
27
|
+
declare const Textarea: React.ForwardRefExoticComponent<TextareaProps & React.RefAttributes<HTMLTextAreaElement>>;
|
|
28
|
+
|
|
29
|
+
interface SelectOption {
|
|
30
|
+
value: string;
|
|
31
|
+
label: string;
|
|
32
|
+
disabled?: boolean;
|
|
33
|
+
}
|
|
34
|
+
interface SelectProps extends React.SelectHTMLAttributes<HTMLSelectElement> {
|
|
35
|
+
options: SelectOption[];
|
|
36
|
+
placeholder?: string;
|
|
37
|
+
error?: boolean;
|
|
38
|
+
}
|
|
39
|
+
declare const Select: React.ForwardRefExoticComponent<SelectProps & React.RefAttributes<HTMLSelectElement>>;
|
|
40
|
+
|
|
41
|
+
interface CheckboxProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "type"> {
|
|
42
|
+
label?: string;
|
|
43
|
+
error?: boolean;
|
|
44
|
+
}
|
|
45
|
+
declare const Checkbox: React.ForwardRefExoticComponent<CheckboxProps & React.RefAttributes<HTMLInputElement>>;
|
|
46
|
+
|
|
47
|
+
interface LabelProps extends React.LabelHTMLAttributes<HTMLLabelElement> {
|
|
48
|
+
required?: boolean;
|
|
49
|
+
}
|
|
50
|
+
declare const Label: React.ForwardRefExoticComponent<LabelProps & React.RefAttributes<HTMLLabelElement>>;
|
|
51
|
+
|
|
52
|
+
interface FormFieldProps {
|
|
53
|
+
label?: string;
|
|
54
|
+
htmlFor?: string;
|
|
55
|
+
required?: boolean;
|
|
56
|
+
hint?: string;
|
|
57
|
+
error?: string;
|
|
58
|
+
className?: string;
|
|
59
|
+
children: React.ReactNode;
|
|
60
|
+
}
|
|
61
|
+
declare function FormField({ label, htmlFor, required, hint, error, className, children, }: FormFieldProps): react_jsx_runtime.JSX.Element;
|
|
62
|
+
|
|
63
|
+
type SpinnerSize = "sm" | "md" | "lg";
|
|
64
|
+
interface SpinnerProps {
|
|
65
|
+
size?: SpinnerSize;
|
|
66
|
+
label?: string;
|
|
67
|
+
className?: string;
|
|
68
|
+
}
|
|
69
|
+
declare function Spinner({ size, label, className }: SpinnerProps): react_jsx_runtime.JSX.Element;
|
|
70
|
+
|
|
71
|
+
type BadgeVariant = "default" | "success" | "warning" | "destructive" | "info" | "outline";
|
|
72
|
+
interface BadgeProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
73
|
+
variant?: BadgeVariant;
|
|
74
|
+
}
|
|
75
|
+
declare function Badge({ variant, className, children, ...props }: BadgeProps): react_jsx_runtime.JSX.Element;
|
|
76
|
+
|
|
77
|
+
type AlertVariant = "info" | "success" | "warning" | "destructive";
|
|
78
|
+
interface AlertProps {
|
|
79
|
+
variant?: AlertVariant;
|
|
80
|
+
title?: string;
|
|
81
|
+
children?: React.ReactNode;
|
|
82
|
+
className?: string;
|
|
83
|
+
onDismiss?: () => void;
|
|
84
|
+
}
|
|
85
|
+
declare function Alert({ variant, title, children, className, onDismiss }: AlertProps): react_jsx_runtime.JSX.Element;
|
|
86
|
+
|
|
87
|
+
interface CardProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
88
|
+
padding?: "none" | "sm" | "md" | "lg";
|
|
89
|
+
}
|
|
90
|
+
declare function Card({ className, padding, children, ...props }: CardProps): react_jsx_runtime.JSX.Element;
|
|
91
|
+
declare function CardHeader({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
|
|
92
|
+
declare function CardTitle({ className, ...props }: React.HTMLAttributes<HTMLHeadingElement>): react_jsx_runtime.JSX.Element;
|
|
93
|
+
declare function CardDescription({ className, ...props }: React.HTMLAttributes<HTMLParagraphElement>): react_jsx_runtime.JSX.Element;
|
|
94
|
+
declare function CardContent({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
|
|
95
|
+
declare function CardFooter({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
|
|
96
|
+
|
|
97
|
+
type ModalSize = "sm" | "md" | "lg" | "xl" | "full";
|
|
98
|
+
interface ModalProps {
|
|
99
|
+
open: boolean;
|
|
100
|
+
onClose: () => void;
|
|
101
|
+
title?: string;
|
|
102
|
+
description?: string;
|
|
103
|
+
size?: ModalSize;
|
|
104
|
+
className?: string;
|
|
105
|
+
children: React.ReactNode;
|
|
106
|
+
/** Footer slot — place action Buttons here, they stay inside the Modal */
|
|
107
|
+
footer?: React.ReactNode;
|
|
108
|
+
}
|
|
109
|
+
declare function Modal({ open, onClose, title, description, size, className, children, footer, }: ModalProps): React.ReactPortal | null;
|
|
110
|
+
|
|
111
|
+
interface ConfirmDialogProps {
|
|
112
|
+
open: boolean;
|
|
113
|
+
onClose: () => void;
|
|
114
|
+
onConfirm: () => void;
|
|
115
|
+
title: string;
|
|
116
|
+
description?: string;
|
|
117
|
+
confirmLabel?: string;
|
|
118
|
+
cancelLabel?: string;
|
|
119
|
+
/** Use "destructive" for delete/danger actions */
|
|
120
|
+
variant?: "primary" | "destructive";
|
|
121
|
+
loading?: boolean;
|
|
122
|
+
}
|
|
123
|
+
declare function ConfirmDialog({ open, onClose, onConfirm, title, description, confirmLabel, cancelLabel, variant, loading, }: ConfirmDialogProps): react_jsx_runtime.JSX.Element;
|
|
124
|
+
|
|
125
|
+
type ToastType = "success" | "error" | "warning" | "info";
|
|
126
|
+
interface Toast {
|
|
127
|
+
id: string;
|
|
128
|
+
type: ToastType;
|
|
129
|
+
title: string;
|
|
130
|
+
description?: string;
|
|
131
|
+
duration?: number;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
interface ToastContextValue {
|
|
135
|
+
addToast: (opts: {
|
|
136
|
+
type: ToastType;
|
|
137
|
+
title: string;
|
|
138
|
+
description?: string;
|
|
139
|
+
duration?: number;
|
|
140
|
+
}) => void;
|
|
141
|
+
removeToast: (id: string) => void;
|
|
142
|
+
}
|
|
143
|
+
declare function ToastProvider({ children }: {
|
|
144
|
+
children: React.ReactNode;
|
|
145
|
+
}): react_jsx_runtime.JSX.Element;
|
|
146
|
+
|
|
147
|
+
declare function useToast(): ToastContextValue;
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* Wrapper.
|
|
151
|
+
* - Mobile: each TableRow renders as a card (block layout), no horizontal scroll needed.
|
|
152
|
+
* - sm+: classic table with overflow-x-auto.
|
|
153
|
+
*/
|
|
154
|
+
declare function Table({ className, children, ...props }: React.HTMLAttributes<HTMLTableElement>): react_jsx_runtime.JSX.Element;
|
|
155
|
+
/** Hidden on mobile — column labels come from TableCell's `label` prop instead */
|
|
156
|
+
declare function TableHeader({ className, ...props }: React.HTMLAttributes<HTMLTableSectionElement>): react_jsx_runtime.JSX.Element;
|
|
157
|
+
declare function TableBody({ className, ...props }: React.HTMLAttributes<HTMLTableSectionElement>): react_jsx_runtime.JSX.Element;
|
|
158
|
+
declare function TableRow({ className, ...props }: React.HTMLAttributes<HTMLTableRowElement>): react_jsx_runtime.JSX.Element;
|
|
159
|
+
interface TableHeadProps extends React.ThHTMLAttributes<HTMLTableCellElement> {
|
|
160
|
+
align?: "left" | "center" | "right";
|
|
161
|
+
}
|
|
162
|
+
declare function TableHead({ className, align, ...props }: TableHeadProps): react_jsx_runtime.JSX.Element;
|
|
163
|
+
interface TableCellProps extends React.TdHTMLAttributes<HTMLTableCellElement> {
|
|
164
|
+
align?: "left" | "center" | "right";
|
|
165
|
+
/**
|
|
166
|
+
* Column label shown on mobile (before the value).
|
|
167
|
+
* Should match the corresponding TableHead content.
|
|
168
|
+
* Example: <TableCell label="Status">Active</TableCell>
|
|
169
|
+
*/
|
|
170
|
+
label?: string;
|
|
171
|
+
}
|
|
172
|
+
declare function TableCell({ className, align, label, children, ...props }: TableCellProps): react_jsx_runtime.JSX.Element;
|
|
173
|
+
|
|
174
|
+
interface TableToolbarProps {
|
|
175
|
+
/** Left side — search input or filters. Stay inside TableToolbar. */
|
|
176
|
+
filters?: React.ReactNode;
|
|
177
|
+
/** Right side — action buttons. Stay inside TableToolbar. */
|
|
178
|
+
actions?: React.ReactNode;
|
|
179
|
+
className?: string;
|
|
180
|
+
}
|
|
181
|
+
declare function TableToolbar({ filters, actions, className }: TableToolbarProps): react_jsx_runtime.JSX.Element;
|
|
182
|
+
|
|
183
|
+
interface TableEmptyStateProps {
|
|
184
|
+
colSpan: number;
|
|
185
|
+
title?: string;
|
|
186
|
+
description?: string;
|
|
187
|
+
/** Action button — stays inside the table, never leaks out */
|
|
188
|
+
action?: React.ReactNode;
|
|
189
|
+
icon?: React.ReactNode;
|
|
190
|
+
className?: string;
|
|
191
|
+
}
|
|
192
|
+
declare function TableEmptyState({ colSpan, title, description, action, icon, className, }: TableEmptyStateProps): react_jsx_runtime.JSX.Element;
|
|
193
|
+
|
|
194
|
+
interface PageHeaderProps {
|
|
195
|
+
title: string;
|
|
196
|
+
description?: string;
|
|
197
|
+
/** Breadcrumb or back link slot */
|
|
198
|
+
prefix?: React.ReactNode;
|
|
199
|
+
/** Action buttons — defined by caller but rendered inside PageHeader, never escape */
|
|
200
|
+
actions?: React.ReactNode;
|
|
201
|
+
className?: string;
|
|
202
|
+
}
|
|
203
|
+
declare function PageHeader({ title, description, prefix, actions, className }: PageHeaderProps): react_jsx_runtime.JSX.Element;
|
|
204
|
+
|
|
205
|
+
interface EmptyStateProps {
|
|
206
|
+
icon?: React.ReactNode;
|
|
207
|
+
title: string;
|
|
208
|
+
description?: string;
|
|
209
|
+
/** Primary action button — stays inside EmptyState */
|
|
210
|
+
action?: React.ReactNode;
|
|
211
|
+
/** Secondary action button */
|
|
212
|
+
secondaryAction?: React.ReactNode;
|
|
213
|
+
className?: string;
|
|
214
|
+
}
|
|
215
|
+
declare function EmptyState({ icon, title, description, action, secondaryAction, className, }: EmptyStateProps): react_jsx_runtime.JSX.Element;
|
|
216
|
+
|
|
217
|
+
interface SidebarNavItem {
|
|
218
|
+
label: string;
|
|
219
|
+
href?: string;
|
|
220
|
+
icon?: React.ReactNode;
|
|
221
|
+
active?: boolean;
|
|
222
|
+
disabled?: boolean;
|
|
223
|
+
onClick?: () => void;
|
|
224
|
+
/** Badge count or label shown on the right */
|
|
225
|
+
badge?: string | number;
|
|
226
|
+
}
|
|
227
|
+
interface SidebarNavGroup {
|
|
228
|
+
title?: string;
|
|
229
|
+
items: SidebarNavItem[];
|
|
230
|
+
}
|
|
231
|
+
interface SidebarProps {
|
|
232
|
+
/** Logo or brand slot */
|
|
233
|
+
logo?: React.ReactNode;
|
|
234
|
+
/** Navigation groups */
|
|
235
|
+
groups: SidebarNavGroup[];
|
|
236
|
+
/** Bottom slot — user avatar, settings, logout */
|
|
237
|
+
footer?: React.ReactNode;
|
|
238
|
+
className?: string;
|
|
239
|
+
}
|
|
240
|
+
declare function Sidebar({ logo, groups, footer, className }: SidebarProps): react_jsx_runtime.JSX.Element;
|
|
241
|
+
|
|
242
|
+
interface TopbarProps {
|
|
243
|
+
/** Called when the hamburger is pressed — open the Drawer/Sidebar */
|
|
244
|
+
onMenuOpen?: () => void;
|
|
245
|
+
/** Center slot — page title or breadcrumb */
|
|
246
|
+
title?: React.ReactNode;
|
|
247
|
+
/** Right slot — user avatar, notifications, etc. Stays inside Topbar. */
|
|
248
|
+
actions?: React.ReactNode;
|
|
249
|
+
/** Hide the hamburger button (e.g. when sidebar is always visible) */
|
|
250
|
+
hideMenuButton?: boolean;
|
|
251
|
+
className?: string;
|
|
252
|
+
}
|
|
253
|
+
declare function Topbar({ onMenuOpen, title, actions, hideMenuButton, className, }: TopbarProps): react_jsx_runtime.JSX.Element;
|
|
254
|
+
|
|
255
|
+
interface AppShellProps {
|
|
256
|
+
/** Props forwarded to the Sidebar */
|
|
257
|
+
sidebar: SidebarProps;
|
|
258
|
+
/** Props forwarded to the Topbar (onMenuOpen is wired automatically) */
|
|
259
|
+
topbar?: Omit<TopbarProps, "onMenuOpen" | "hideMenuButton">;
|
|
260
|
+
/** Page content */
|
|
261
|
+
children: React.ReactNode;
|
|
262
|
+
className?: string;
|
|
263
|
+
}
|
|
264
|
+
declare function AppShell({ sidebar, topbar, children, className }: AppShellProps): react_jsx_runtime.JSX.Element;
|
|
265
|
+
|
|
266
|
+
interface Tab {
|
|
267
|
+
value: string;
|
|
268
|
+
label: string;
|
|
269
|
+
disabled?: boolean;
|
|
270
|
+
}
|
|
271
|
+
interface TabsProps {
|
|
272
|
+
tabs: Tab[];
|
|
273
|
+
value: string;
|
|
274
|
+
onChange: (value: string) => void;
|
|
275
|
+
/** Content panels — use TabPanel to associate with a tab value */
|
|
276
|
+
children?: React.ReactNode;
|
|
277
|
+
className?: string;
|
|
278
|
+
}
|
|
279
|
+
declare function Tabs({ tabs, value, onChange, children, className }: TabsProps): react_jsx_runtime.JSX.Element;
|
|
280
|
+
interface TabPanelProps {
|
|
281
|
+
value: string;
|
|
282
|
+
activeValue: string;
|
|
283
|
+
children: React.ReactNode;
|
|
284
|
+
className?: string;
|
|
285
|
+
}
|
|
286
|
+
declare function TabPanel({ value, activeValue, children, className }: TabPanelProps): react_jsx_runtime.JSX.Element;
|
|
287
|
+
|
|
288
|
+
interface DropdownMenuItem {
|
|
289
|
+
label: string;
|
|
290
|
+
onClick?: () => void;
|
|
291
|
+
icon?: React.ReactNode;
|
|
292
|
+
disabled?: boolean;
|
|
293
|
+
destructive?: boolean;
|
|
294
|
+
/** Renders a visual divider above this item */
|
|
295
|
+
divider?: boolean;
|
|
296
|
+
}
|
|
297
|
+
type DropdownAlign = "left" | "right";
|
|
298
|
+
interface DropdownMenuProps {
|
|
299
|
+
/** The trigger element — button or icon button. Stays inside DropdownMenu. */
|
|
300
|
+
trigger: React.ReactNode;
|
|
301
|
+
items: DropdownMenuItem[];
|
|
302
|
+
align?: DropdownAlign;
|
|
303
|
+
className?: string;
|
|
304
|
+
}
|
|
305
|
+
declare function DropdownMenu({ trigger, items, align, className }: DropdownMenuProps): react_jsx_runtime.JSX.Element;
|
|
306
|
+
|
|
307
|
+
interface PaginationProps {
|
|
308
|
+
page: number;
|
|
309
|
+
totalPages: number;
|
|
310
|
+
onChange: (page: number) => void;
|
|
311
|
+
/** Max page buttons to show (default 5) */
|
|
312
|
+
siblingCount?: number;
|
|
313
|
+
className?: string;
|
|
314
|
+
}
|
|
315
|
+
declare function Pagination({ page, totalPages, onChange, siblingCount, className, }: PaginationProps): react_jsx_runtime.JSX.Element | null;
|
|
316
|
+
|
|
317
|
+
type DrawerSide = "right" | "left";
|
|
318
|
+
interface DrawerProps {
|
|
319
|
+
open: boolean;
|
|
320
|
+
onClose: () => void;
|
|
321
|
+
title?: string;
|
|
322
|
+
description?: string;
|
|
323
|
+
side?: DrawerSide;
|
|
324
|
+
/** Width on sm+ (default: "sm:w-96") */
|
|
325
|
+
widthClass?: string;
|
|
326
|
+
className?: string;
|
|
327
|
+
children: React.ReactNode;
|
|
328
|
+
/** Footer slot — action buttons stay inside the Drawer */
|
|
329
|
+
footer?: React.ReactNode;
|
|
330
|
+
}
|
|
331
|
+
declare function Drawer({ open, onClose, title, description, side, widthClass, className, children, footer, }: DrawerProps): React.ReactPortal | null;
|
|
332
|
+
|
|
333
|
+
type TooltipSide = "top" | "bottom" | "left" | "right";
|
|
334
|
+
interface TooltipProps {
|
|
335
|
+
content: string;
|
|
336
|
+
side?: TooltipSide;
|
|
337
|
+
children: React.ReactElement;
|
|
338
|
+
className?: string;
|
|
339
|
+
}
|
|
340
|
+
declare function Tooltip({ content, side, children, className }: TooltipProps): react_jsx_runtime.JSX.Element;
|
|
341
|
+
|
|
342
|
+
export { Alert, type AlertProps, type AlertVariant, AppShell, type AppShellProps, Badge, type BadgeProps, type BadgeVariant, Button, type ButtonProps, type ButtonSize, type ButtonVariant, Card, CardContent, CardDescription, CardFooter, CardHeader, type CardProps, CardTitle, Checkbox, type CheckboxProps, ConfirmDialog, type ConfirmDialogProps, Drawer, type DrawerProps, type DrawerSide, type DropdownAlign, DropdownMenu, type DropdownMenuItem, type DropdownMenuProps, EmptyState, type EmptyStateProps, FormField, type FormFieldProps, Input, type InputProps, Label, type LabelProps, Modal, type ModalProps, type ModalSize, PageHeader, type PageHeaderProps, Pagination, type PaginationProps, Select, type SelectOption, type SelectProps, Sidebar, type SidebarNavGroup, type SidebarNavItem, type SidebarProps, Spinner, type SpinnerProps, type SpinnerSize, type Tab, TabPanel, type TabPanelProps, Table, TableBody, TableCell, type TableCellProps, TableEmptyState, type TableEmptyStateProps, TableHead, type TableHeadProps, TableHeader, TableRow, TableToolbar, type TableToolbarProps, Tabs, type TabsProps, Textarea, type TextareaProps, type Toast, ToastProvider, type ToastType, Tooltip, type TooltipProps, type TooltipSide, Topbar, type TopbarProps, cn, useToast };
|