avt-rct-lib 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 +82 -0
- package/dist/index.cjs +1341 -0
- package/dist/index.d.cts +298 -0
- package/dist/index.d.ts +298 -0
- package/dist/index.js +1266 -0
- package/package.json +54 -0
- package/src/styles/base.css +57 -0
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,298 @@
|
|
|
1
|
+
import React, { RefObject } from 'react';
|
|
2
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
|
+
|
|
4
|
+
type ButtonVariant = 'primary' | 'secondary' | 'ghost' | 'outline' | 'destructive' | 'link';
|
|
5
|
+
type ButtonSize = 'xs' | 'sm' | 'md' | 'lg' | 'icon';
|
|
6
|
+
interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
7
|
+
variant?: ButtonVariant;
|
|
8
|
+
size?: ButtonSize;
|
|
9
|
+
loading?: boolean;
|
|
10
|
+
leftIcon?: React.ReactNode;
|
|
11
|
+
rightIcon?: React.ReactNode;
|
|
12
|
+
fullWidth?: boolean;
|
|
13
|
+
asChild?: boolean;
|
|
14
|
+
}
|
|
15
|
+
declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
16
|
+
|
|
17
|
+
type BadgeVariant = 'default' | 'secondary' | 'success' | 'warning' | 'destructive' | 'purple' | 'outline';
|
|
18
|
+
interface BadgeProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
19
|
+
variant?: BadgeVariant;
|
|
20
|
+
dot?: boolean;
|
|
21
|
+
}
|
|
22
|
+
declare function Badge({ variant, dot, className, children, ...props }: BadgeProps): react_jsx_runtime.JSX.Element;
|
|
23
|
+
|
|
24
|
+
interface InputProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
25
|
+
label?: string;
|
|
26
|
+
hint?: string;
|
|
27
|
+
error?: string;
|
|
28
|
+
leftAddon?: React.ReactNode;
|
|
29
|
+
rightAddon?: React.ReactNode;
|
|
30
|
+
containerClassName?: string;
|
|
31
|
+
}
|
|
32
|
+
declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<HTMLInputElement>>;
|
|
33
|
+
interface TextareaProps extends React.TextareaHTMLAttributes<HTMLTextAreaElement> {
|
|
34
|
+
label?: string;
|
|
35
|
+
hint?: string;
|
|
36
|
+
error?: string;
|
|
37
|
+
containerClassName?: string;
|
|
38
|
+
}
|
|
39
|
+
declare const Textarea: React.ForwardRefExoticComponent<TextareaProps & React.RefAttributes<HTMLTextAreaElement>>;
|
|
40
|
+
|
|
41
|
+
interface CardProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
42
|
+
hover?: boolean;
|
|
43
|
+
glass?: boolean;
|
|
44
|
+
padding?: 'none' | 'sm' | 'md' | 'lg';
|
|
45
|
+
}
|
|
46
|
+
declare function Card({ hover, glass, padding, className, ...props }: CardProps): react_jsx_runtime.JSX.Element;
|
|
47
|
+
declare function CardHeader({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
|
|
48
|
+
declare function CardTitle({ className, ...props }: React.HTMLAttributes<HTMLHeadingElement>): react_jsx_runtime.JSX.Element;
|
|
49
|
+
declare function CardDescription({ className, ...props }: React.HTMLAttributes<HTMLParagraphElement>): react_jsx_runtime.JSX.Element;
|
|
50
|
+
declare function CardContent({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
|
|
51
|
+
declare function CardFooter({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
|
|
52
|
+
declare function CardDivider({ className, ...props }: React.HTMLAttributes<HTMLHRElement>): react_jsx_runtime.JSX.Element;
|
|
53
|
+
|
|
54
|
+
interface TableProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
55
|
+
/** Wraps the table in a rounded card container */
|
|
56
|
+
card?: boolean;
|
|
57
|
+
}
|
|
58
|
+
declare function Table({ card, className, children, ...props }: TableProps): react_jsx_runtime.JSX.Element;
|
|
59
|
+
declare function TableHeader({ className, ...props }: React.HTMLAttributes<HTMLTableSectionElement>): react_jsx_runtime.JSX.Element;
|
|
60
|
+
declare function TableBody({ className, ...props }: React.HTMLAttributes<HTMLTableSectionElement>): react_jsx_runtime.JSX.Element;
|
|
61
|
+
declare function TableFooter({ className, ...props }: React.HTMLAttributes<HTMLTableSectionElement>): react_jsx_runtime.JSX.Element;
|
|
62
|
+
declare function TableRow({ className, ...props }: React.HTMLAttributes<HTMLTableRowElement>): react_jsx_runtime.JSX.Element;
|
|
63
|
+
declare function TableHead({ className, ...props }: React.ThHTMLAttributes<HTMLTableCellElement>): react_jsx_runtime.JSX.Element;
|
|
64
|
+
declare function TableCell({ className, ...props }: React.TdHTMLAttributes<HTMLTableCellElement>): react_jsx_runtime.JSX.Element;
|
|
65
|
+
declare function TableCaption({ className, ...props }: React.HTMLAttributes<HTMLTableCaptionElement>): react_jsx_runtime.JSX.Element;
|
|
66
|
+
declare function TableToolbar({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
|
|
67
|
+
declare function TablePagination({ page, pageCount, canPrev, canNext, onPrev, onNext, className, }: {
|
|
68
|
+
page: number;
|
|
69
|
+
pageCount: number;
|
|
70
|
+
canPrev: boolean;
|
|
71
|
+
canNext: boolean;
|
|
72
|
+
onPrev: () => void;
|
|
73
|
+
onNext: () => void;
|
|
74
|
+
className?: string;
|
|
75
|
+
}): react_jsx_runtime.JSX.Element;
|
|
76
|
+
|
|
77
|
+
interface TabsProps {
|
|
78
|
+
defaultValue?: string;
|
|
79
|
+
value?: string;
|
|
80
|
+
onValueChange?: (value: string) => void;
|
|
81
|
+
variant?: 'pills' | 'underline' | 'segment';
|
|
82
|
+
children: React.ReactNode;
|
|
83
|
+
className?: string;
|
|
84
|
+
}
|
|
85
|
+
declare function Tabs({ defaultValue, value, onValueChange, variant, children, className, }: TabsProps): react_jsx_runtime.JSX.Element;
|
|
86
|
+
declare function TabsList({ className, children, ...props }: React.HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
|
|
87
|
+
interface TabsTriggerProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
88
|
+
value: string;
|
|
89
|
+
icon?: React.ReactNode;
|
|
90
|
+
}
|
|
91
|
+
declare function TabsTrigger({ value, icon, className, children, ...props }: TabsTriggerProps): react_jsx_runtime.JSX.Element;
|
|
92
|
+
interface TabsContentProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
93
|
+
value: string;
|
|
94
|
+
keepMounted?: boolean;
|
|
95
|
+
}
|
|
96
|
+
declare function TabsContent({ value, keepMounted, className, children, ...props }: TabsContentProps): react_jsx_runtime.JSX.Element | null;
|
|
97
|
+
|
|
98
|
+
interface ScrollbarProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
99
|
+
/** Max height of the scroll container */
|
|
100
|
+
maxHeight?: string | number;
|
|
101
|
+
/** Max width of the scroll container */
|
|
102
|
+
maxWidth?: string | number;
|
|
103
|
+
/** Direction of scrolling */
|
|
104
|
+
direction?: 'vertical' | 'horizontal' | 'both';
|
|
105
|
+
/** Show scrollbar always (default: on hover) */
|
|
106
|
+
always?: boolean;
|
|
107
|
+
}
|
|
108
|
+
declare function Scrollbar({ maxHeight, maxWidth, direction, always, className, style, ...props }: ScrollbarProps): react_jsx_runtime.JSX.Element;
|
|
109
|
+
declare function withScrollbar<T extends object>(Component: React.ComponentType<T>, scrollbarProps?: Omit<ScrollbarProps, 'children'>): (props: T & {
|
|
110
|
+
children?: React.ReactNode;
|
|
111
|
+
}) => react_jsx_runtime.JSX.Element;
|
|
112
|
+
|
|
113
|
+
type ToastVariant = 'default' | 'success' | 'destructive' | 'warning';
|
|
114
|
+
type ToastPosition = 'top-right' | 'top-left' | 'top-center' | 'bottom-right' | 'bottom-left' | 'bottom-center';
|
|
115
|
+
interface ToastItem {
|
|
116
|
+
id: string;
|
|
117
|
+
title?: string;
|
|
118
|
+
description?: string;
|
|
119
|
+
variant?: ToastVariant;
|
|
120
|
+
duration?: number;
|
|
121
|
+
icon?: React.ReactNode;
|
|
122
|
+
}
|
|
123
|
+
type ToastOptions = Omit<ToastItem, 'id'>;
|
|
124
|
+
/** Call anywhere — inside or outside React — to show a toast. */
|
|
125
|
+
declare function toast(options: ToastOptions): string;
|
|
126
|
+
/** Dismiss a specific toast by ID. */
|
|
127
|
+
declare function dismissToast(id: string): void;
|
|
128
|
+
declare function useToast(): {
|
|
129
|
+
toasts: ToastItem[];
|
|
130
|
+
toast: typeof toast;
|
|
131
|
+
dismiss: typeof dismissToast;
|
|
132
|
+
};
|
|
133
|
+
interface ToasterProps {
|
|
134
|
+
position?: ToastPosition;
|
|
135
|
+
}
|
|
136
|
+
declare function Toaster({ position }: ToasterProps): React.ReactPortal | null;
|
|
137
|
+
|
|
138
|
+
type MenuAlign = 'start' | 'center' | 'end';
|
|
139
|
+
interface MenuProps {
|
|
140
|
+
children: React.ReactNode;
|
|
141
|
+
open?: boolean;
|
|
142
|
+
onOpenChange?: (open: boolean) => void;
|
|
143
|
+
}
|
|
144
|
+
declare function MenuRoot({ children, open: controlledOpen, onOpenChange }: MenuProps): react_jsx_runtime.JSX.Element;
|
|
145
|
+
|
|
146
|
+
declare function MenuButton({ className, children, ...props }: React.ButtonHTMLAttributes<HTMLButtonElement>): react_jsx_runtime.JSX.Element;
|
|
147
|
+
interface MenuContentProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
148
|
+
align?: MenuAlign;
|
|
149
|
+
sideOffset?: number;
|
|
150
|
+
minWidth?: number;
|
|
151
|
+
}
|
|
152
|
+
declare function MenuContent({ align, sideOffset, minWidth, className, children, style, ...props }: MenuContentProps): React.ReactPortal | null;
|
|
153
|
+
interface MenuItemProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
154
|
+
icon?: React.ReactNode;
|
|
155
|
+
rightSlot?: React.ReactNode;
|
|
156
|
+
variant?: 'default' | 'destructive';
|
|
157
|
+
disabled?: boolean;
|
|
158
|
+
}
|
|
159
|
+
declare function MenuItem({ icon, rightSlot, variant, disabled, className, children, onClick, ...props }: MenuItemProps): react_jsx_runtime.JSX.Element;
|
|
160
|
+
declare function MenuSeparator({ className }: {
|
|
161
|
+
className?: string;
|
|
162
|
+
}): react_jsx_runtime.JSX.Element;
|
|
163
|
+
declare function MenuLabel({ className, children }: React.HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
|
|
164
|
+
declare function MenuTrigger({ children }: {
|
|
165
|
+
children: React.ReactElement;
|
|
166
|
+
}): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
167
|
+
|
|
168
|
+
type SheetSide = 'right' | 'left' | 'bottom';
|
|
169
|
+
interface SheetProps {
|
|
170
|
+
open: boolean;
|
|
171
|
+
onClose: () => void;
|
|
172
|
+
side?: SheetSide;
|
|
173
|
+
/** Width for left/right sheets (CSS value) */
|
|
174
|
+
width?: string;
|
|
175
|
+
/** Height for bottom sheet (CSS value) */
|
|
176
|
+
height?: string;
|
|
177
|
+
/** Close on overlay click */
|
|
178
|
+
closeOnOverlay?: boolean;
|
|
179
|
+
children: React.ReactNode;
|
|
180
|
+
}
|
|
181
|
+
declare function Sheet({ open, onClose, side, width, height, closeOnOverlay, children, }: SheetProps): React.ReactPortal | null;
|
|
182
|
+
interface SheetHeaderProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
183
|
+
showClose?: boolean;
|
|
184
|
+
onClose?: () => void;
|
|
185
|
+
}
|
|
186
|
+
declare function SheetHeader({ showClose, onClose, className, children, ...props }: SheetHeaderProps): react_jsx_runtime.JSX.Element;
|
|
187
|
+
declare function SheetTitle({ className, ...props }: React.HTMLAttributes<HTMLHeadingElement>): react_jsx_runtime.JSX.Element;
|
|
188
|
+
declare function SheetDescription({ className, ...props }: React.HTMLAttributes<HTMLParagraphElement>): react_jsx_runtime.JSX.Element;
|
|
189
|
+
declare function SheetContent({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
|
|
190
|
+
declare function SheetFooter({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
|
|
191
|
+
declare function Drawer({ children, ...props }: Omit<SheetProps, 'side'>): react_jsx_runtime.JSX.Element;
|
|
192
|
+
|
|
193
|
+
interface NavbarProps extends React.HTMLAttributes<HTMLElement> {
|
|
194
|
+
glass?: boolean;
|
|
195
|
+
border?: boolean;
|
|
196
|
+
sticky?: boolean;
|
|
197
|
+
height?: string;
|
|
198
|
+
}
|
|
199
|
+
declare function Navbar({ glass, border, sticky, height, className, children, ...props }: NavbarProps): react_jsx_runtime.JSX.Element;
|
|
200
|
+
declare function NavbarLeft({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
|
|
201
|
+
declare function NavbarCenter({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
|
|
202
|
+
declare function NavbarRight({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
|
|
203
|
+
interface NavbarBrandProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
204
|
+
logo?: React.ReactNode;
|
|
205
|
+
title: string;
|
|
206
|
+
subtitle?: string;
|
|
207
|
+
}
|
|
208
|
+
declare function NavbarBrand({ logo, title, subtitle, className, ...props }: NavbarBrandProps): react_jsx_runtime.JSX.Element;
|
|
209
|
+
interface NavbarSearchProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
210
|
+
icon?: React.ReactNode;
|
|
211
|
+
}
|
|
212
|
+
declare function NavbarSearch({ icon, className, ...props }: NavbarSearchProps): react_jsx_runtime.JSX.Element;
|
|
213
|
+
interface NavbarIconButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
214
|
+
badge?: string | number;
|
|
215
|
+
tooltip?: string;
|
|
216
|
+
}
|
|
217
|
+
declare function NavbarIconButton({ badge, tooltip, className, children, ...props }: NavbarIconButtonProps): react_jsx_runtime.JSX.Element;
|
|
218
|
+
declare function NavbarDivider({ className }: {
|
|
219
|
+
className?: string;
|
|
220
|
+
}): react_jsx_runtime.JSX.Element;
|
|
221
|
+
|
|
222
|
+
interface SidebarProps extends React.HTMLAttributes<HTMLElement> {
|
|
223
|
+
collapsed?: boolean;
|
|
224
|
+
glass?: boolean;
|
|
225
|
+
width?: string;
|
|
226
|
+
collapsedWidth?: string;
|
|
227
|
+
/** Mobile overlay mode — sidebar slides in/out as a fixed overlay with backdrop */
|
|
228
|
+
overlay?: boolean;
|
|
229
|
+
/** Called when backdrop is clicked in overlay mode */
|
|
230
|
+
onOverlayClose?: () => void;
|
|
231
|
+
}
|
|
232
|
+
declare function Sidebar({ collapsed, glass, width, collapsedWidth, overlay, onOverlayClose, className, children, style, ...props }: SidebarProps): react_jsx_runtime.JSX.Element;
|
|
233
|
+
declare function SidebarHeader({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
|
|
234
|
+
interface SidebarBrandProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
235
|
+
logo: React.ReactNode;
|
|
236
|
+
title: string;
|
|
237
|
+
subtitle?: string;
|
|
238
|
+
}
|
|
239
|
+
declare function SidebarBrand({ logo, title, subtitle, className, ...props }: SidebarBrandProps): react_jsx_runtime.JSX.Element;
|
|
240
|
+
declare function SidebarDivider({ className }: {
|
|
241
|
+
className?: string;
|
|
242
|
+
}): react_jsx_runtime.JSX.Element;
|
|
243
|
+
declare function SidebarContent({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
|
|
244
|
+
interface SidebarGroupProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
245
|
+
label?: string;
|
|
246
|
+
}
|
|
247
|
+
declare function SidebarGroup({ label, className, children, ...props }: SidebarGroupProps): react_jsx_runtime.JSX.Element;
|
|
248
|
+
interface SidebarItemProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
249
|
+
icon?: React.ReactNode;
|
|
250
|
+
label: string;
|
|
251
|
+
active?: boolean;
|
|
252
|
+
badge?: string | number;
|
|
253
|
+
href?: string;
|
|
254
|
+
as?: React.ElementType;
|
|
255
|
+
}
|
|
256
|
+
declare function SidebarItem({ icon, label, active, badge, href, as: Tag, className, ...props }: SidebarItemProps): react_jsx_runtime.JSX.Element;
|
|
257
|
+
declare function SidebarFooter({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
|
|
258
|
+
interface SidebarUserProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
259
|
+
name: string;
|
|
260
|
+
subtitle?: string;
|
|
261
|
+
avatar?: React.ReactNode;
|
|
262
|
+
avatarFallback?: string;
|
|
263
|
+
avatarColor?: string;
|
|
264
|
+
actions?: React.ReactNode;
|
|
265
|
+
}
|
|
266
|
+
declare function SidebarUser({ name, subtitle, avatar, avatarFallback, avatarColor, actions, className, ...props }: SidebarUserProps): react_jsx_runtime.JSX.Element;
|
|
267
|
+
interface SidebarToggleProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
268
|
+
collapsed: boolean;
|
|
269
|
+
}
|
|
270
|
+
declare function SidebarToggle({ collapsed, className, ...props }: SidebarToggleProps): react_jsx_runtime.JSX.Element;
|
|
271
|
+
|
|
272
|
+
declare function useClickOutside<T extends HTMLElement>(ref: RefObject<T>, handler: (event: MouseEvent | TouchEvent) => void, enabled?: boolean): void;
|
|
273
|
+
|
|
274
|
+
declare function useKeydown(key: string, handler: () => void, enabled?: boolean): void;
|
|
275
|
+
|
|
276
|
+
type ClassValue = string | number | boolean | null | undefined | ClassValue[] | Record<string, boolean | null | undefined>;
|
|
277
|
+
declare function cn(...inputs: ClassValue[]): string;
|
|
278
|
+
declare const colors: {
|
|
279
|
+
readonly blue: "#007AFF";
|
|
280
|
+
readonly green: "#34C759";
|
|
281
|
+
readonly red: "#FF3B30";
|
|
282
|
+
readonly orange: "#FF9500";
|
|
283
|
+
readonly purple: "#AF52DE";
|
|
284
|
+
readonly teal: "#5AC8FA";
|
|
285
|
+
readonly indigo: "#5856D6";
|
|
286
|
+
readonly bg: "#F2F2F7";
|
|
287
|
+
readonly card: "#FFFFFF";
|
|
288
|
+
readonly label: "#1C1C1E";
|
|
289
|
+
readonly label2: "#3C3C43";
|
|
290
|
+
readonly label3: "#8E8E93";
|
|
291
|
+
readonly sep: "#E5E5EA";
|
|
292
|
+
readonly fill: "#F2F2F7";
|
|
293
|
+
readonly fill2: "#E5E5EA";
|
|
294
|
+
readonly fill3: "#D1D1D6";
|
|
295
|
+
};
|
|
296
|
+
declare function generateId(): string;
|
|
297
|
+
|
|
298
|
+
export { Badge, type BadgeProps, type BadgeVariant, Button, type ButtonProps, type ButtonSize, type ButtonVariant, Card, CardContent, CardDescription, CardDivider, CardFooter, CardHeader, type CardProps, CardTitle, Drawer, Input, type InputProps, MenuRoot as Menu, type MenuAlign, MenuButton, MenuContent, type MenuContentProps, MenuRoot as MenuDropdown, MenuItem, type MenuItemProps, MenuLabel, type MenuProps, MenuRoot, MenuSeparator, MenuTrigger, Navbar, NavbarBrand, type NavbarBrandProps, NavbarCenter, NavbarDivider, NavbarIconButton, type NavbarIconButtonProps, NavbarLeft, type NavbarProps, NavbarRight, NavbarSearch, type NavbarSearchProps, Scrollbar, type ScrollbarProps, Sheet, SheetContent, SheetDescription, SheetFooter, SheetHeader, type SheetHeaderProps, type SheetProps, type SheetSide, SheetTitle, Sidebar, SidebarBrand, type SidebarBrandProps, SidebarContent, SidebarDivider, SidebarFooter, SidebarGroup, type SidebarGroupProps, SidebarHeader, SidebarItem, type SidebarItemProps, type SidebarProps, SidebarToggle, type SidebarToggleProps, SidebarUser, type SidebarUserProps, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TablePagination, type TableProps, TableRow, TableToolbar, Tabs, TabsContent, type TabsContentProps, TabsList, type TabsProps, TabsTrigger, type TabsTriggerProps, Textarea, type TextareaProps, type ToastItem, type ToastOptions, type ToastPosition, type ToastVariant, Toaster, type ToasterProps, cn, colors, dismissToast, generateId, toast, useClickOutside, useKeydown, useToast, withScrollbar };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,298 @@
|
|
|
1
|
+
import React, { RefObject } from 'react';
|
|
2
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
|
+
|
|
4
|
+
type ButtonVariant = 'primary' | 'secondary' | 'ghost' | 'outline' | 'destructive' | 'link';
|
|
5
|
+
type ButtonSize = 'xs' | 'sm' | 'md' | 'lg' | 'icon';
|
|
6
|
+
interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
7
|
+
variant?: ButtonVariant;
|
|
8
|
+
size?: ButtonSize;
|
|
9
|
+
loading?: boolean;
|
|
10
|
+
leftIcon?: React.ReactNode;
|
|
11
|
+
rightIcon?: React.ReactNode;
|
|
12
|
+
fullWidth?: boolean;
|
|
13
|
+
asChild?: boolean;
|
|
14
|
+
}
|
|
15
|
+
declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
16
|
+
|
|
17
|
+
type BadgeVariant = 'default' | 'secondary' | 'success' | 'warning' | 'destructive' | 'purple' | 'outline';
|
|
18
|
+
interface BadgeProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
19
|
+
variant?: BadgeVariant;
|
|
20
|
+
dot?: boolean;
|
|
21
|
+
}
|
|
22
|
+
declare function Badge({ variant, dot, className, children, ...props }: BadgeProps): react_jsx_runtime.JSX.Element;
|
|
23
|
+
|
|
24
|
+
interface InputProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
25
|
+
label?: string;
|
|
26
|
+
hint?: string;
|
|
27
|
+
error?: string;
|
|
28
|
+
leftAddon?: React.ReactNode;
|
|
29
|
+
rightAddon?: React.ReactNode;
|
|
30
|
+
containerClassName?: string;
|
|
31
|
+
}
|
|
32
|
+
declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<HTMLInputElement>>;
|
|
33
|
+
interface TextareaProps extends React.TextareaHTMLAttributes<HTMLTextAreaElement> {
|
|
34
|
+
label?: string;
|
|
35
|
+
hint?: string;
|
|
36
|
+
error?: string;
|
|
37
|
+
containerClassName?: string;
|
|
38
|
+
}
|
|
39
|
+
declare const Textarea: React.ForwardRefExoticComponent<TextareaProps & React.RefAttributes<HTMLTextAreaElement>>;
|
|
40
|
+
|
|
41
|
+
interface CardProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
42
|
+
hover?: boolean;
|
|
43
|
+
glass?: boolean;
|
|
44
|
+
padding?: 'none' | 'sm' | 'md' | 'lg';
|
|
45
|
+
}
|
|
46
|
+
declare function Card({ hover, glass, padding, className, ...props }: CardProps): react_jsx_runtime.JSX.Element;
|
|
47
|
+
declare function CardHeader({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
|
|
48
|
+
declare function CardTitle({ className, ...props }: React.HTMLAttributes<HTMLHeadingElement>): react_jsx_runtime.JSX.Element;
|
|
49
|
+
declare function CardDescription({ className, ...props }: React.HTMLAttributes<HTMLParagraphElement>): react_jsx_runtime.JSX.Element;
|
|
50
|
+
declare function CardContent({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
|
|
51
|
+
declare function CardFooter({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
|
|
52
|
+
declare function CardDivider({ className, ...props }: React.HTMLAttributes<HTMLHRElement>): react_jsx_runtime.JSX.Element;
|
|
53
|
+
|
|
54
|
+
interface TableProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
55
|
+
/** Wraps the table in a rounded card container */
|
|
56
|
+
card?: boolean;
|
|
57
|
+
}
|
|
58
|
+
declare function Table({ card, className, children, ...props }: TableProps): react_jsx_runtime.JSX.Element;
|
|
59
|
+
declare function TableHeader({ className, ...props }: React.HTMLAttributes<HTMLTableSectionElement>): react_jsx_runtime.JSX.Element;
|
|
60
|
+
declare function TableBody({ className, ...props }: React.HTMLAttributes<HTMLTableSectionElement>): react_jsx_runtime.JSX.Element;
|
|
61
|
+
declare function TableFooter({ className, ...props }: React.HTMLAttributes<HTMLTableSectionElement>): react_jsx_runtime.JSX.Element;
|
|
62
|
+
declare function TableRow({ className, ...props }: React.HTMLAttributes<HTMLTableRowElement>): react_jsx_runtime.JSX.Element;
|
|
63
|
+
declare function TableHead({ className, ...props }: React.ThHTMLAttributes<HTMLTableCellElement>): react_jsx_runtime.JSX.Element;
|
|
64
|
+
declare function TableCell({ className, ...props }: React.TdHTMLAttributes<HTMLTableCellElement>): react_jsx_runtime.JSX.Element;
|
|
65
|
+
declare function TableCaption({ className, ...props }: React.HTMLAttributes<HTMLTableCaptionElement>): react_jsx_runtime.JSX.Element;
|
|
66
|
+
declare function TableToolbar({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
|
|
67
|
+
declare function TablePagination({ page, pageCount, canPrev, canNext, onPrev, onNext, className, }: {
|
|
68
|
+
page: number;
|
|
69
|
+
pageCount: number;
|
|
70
|
+
canPrev: boolean;
|
|
71
|
+
canNext: boolean;
|
|
72
|
+
onPrev: () => void;
|
|
73
|
+
onNext: () => void;
|
|
74
|
+
className?: string;
|
|
75
|
+
}): react_jsx_runtime.JSX.Element;
|
|
76
|
+
|
|
77
|
+
interface TabsProps {
|
|
78
|
+
defaultValue?: string;
|
|
79
|
+
value?: string;
|
|
80
|
+
onValueChange?: (value: string) => void;
|
|
81
|
+
variant?: 'pills' | 'underline' | 'segment';
|
|
82
|
+
children: React.ReactNode;
|
|
83
|
+
className?: string;
|
|
84
|
+
}
|
|
85
|
+
declare function Tabs({ defaultValue, value, onValueChange, variant, children, className, }: TabsProps): react_jsx_runtime.JSX.Element;
|
|
86
|
+
declare function TabsList({ className, children, ...props }: React.HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
|
|
87
|
+
interface TabsTriggerProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
88
|
+
value: string;
|
|
89
|
+
icon?: React.ReactNode;
|
|
90
|
+
}
|
|
91
|
+
declare function TabsTrigger({ value, icon, className, children, ...props }: TabsTriggerProps): react_jsx_runtime.JSX.Element;
|
|
92
|
+
interface TabsContentProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
93
|
+
value: string;
|
|
94
|
+
keepMounted?: boolean;
|
|
95
|
+
}
|
|
96
|
+
declare function TabsContent({ value, keepMounted, className, children, ...props }: TabsContentProps): react_jsx_runtime.JSX.Element | null;
|
|
97
|
+
|
|
98
|
+
interface ScrollbarProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
99
|
+
/** Max height of the scroll container */
|
|
100
|
+
maxHeight?: string | number;
|
|
101
|
+
/** Max width of the scroll container */
|
|
102
|
+
maxWidth?: string | number;
|
|
103
|
+
/** Direction of scrolling */
|
|
104
|
+
direction?: 'vertical' | 'horizontal' | 'both';
|
|
105
|
+
/** Show scrollbar always (default: on hover) */
|
|
106
|
+
always?: boolean;
|
|
107
|
+
}
|
|
108
|
+
declare function Scrollbar({ maxHeight, maxWidth, direction, always, className, style, ...props }: ScrollbarProps): react_jsx_runtime.JSX.Element;
|
|
109
|
+
declare function withScrollbar<T extends object>(Component: React.ComponentType<T>, scrollbarProps?: Omit<ScrollbarProps, 'children'>): (props: T & {
|
|
110
|
+
children?: React.ReactNode;
|
|
111
|
+
}) => react_jsx_runtime.JSX.Element;
|
|
112
|
+
|
|
113
|
+
type ToastVariant = 'default' | 'success' | 'destructive' | 'warning';
|
|
114
|
+
type ToastPosition = 'top-right' | 'top-left' | 'top-center' | 'bottom-right' | 'bottom-left' | 'bottom-center';
|
|
115
|
+
interface ToastItem {
|
|
116
|
+
id: string;
|
|
117
|
+
title?: string;
|
|
118
|
+
description?: string;
|
|
119
|
+
variant?: ToastVariant;
|
|
120
|
+
duration?: number;
|
|
121
|
+
icon?: React.ReactNode;
|
|
122
|
+
}
|
|
123
|
+
type ToastOptions = Omit<ToastItem, 'id'>;
|
|
124
|
+
/** Call anywhere — inside or outside React — to show a toast. */
|
|
125
|
+
declare function toast(options: ToastOptions): string;
|
|
126
|
+
/** Dismiss a specific toast by ID. */
|
|
127
|
+
declare function dismissToast(id: string): void;
|
|
128
|
+
declare function useToast(): {
|
|
129
|
+
toasts: ToastItem[];
|
|
130
|
+
toast: typeof toast;
|
|
131
|
+
dismiss: typeof dismissToast;
|
|
132
|
+
};
|
|
133
|
+
interface ToasterProps {
|
|
134
|
+
position?: ToastPosition;
|
|
135
|
+
}
|
|
136
|
+
declare function Toaster({ position }: ToasterProps): React.ReactPortal | null;
|
|
137
|
+
|
|
138
|
+
type MenuAlign = 'start' | 'center' | 'end';
|
|
139
|
+
interface MenuProps {
|
|
140
|
+
children: React.ReactNode;
|
|
141
|
+
open?: boolean;
|
|
142
|
+
onOpenChange?: (open: boolean) => void;
|
|
143
|
+
}
|
|
144
|
+
declare function MenuRoot({ children, open: controlledOpen, onOpenChange }: MenuProps): react_jsx_runtime.JSX.Element;
|
|
145
|
+
|
|
146
|
+
declare function MenuButton({ className, children, ...props }: React.ButtonHTMLAttributes<HTMLButtonElement>): react_jsx_runtime.JSX.Element;
|
|
147
|
+
interface MenuContentProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
148
|
+
align?: MenuAlign;
|
|
149
|
+
sideOffset?: number;
|
|
150
|
+
minWidth?: number;
|
|
151
|
+
}
|
|
152
|
+
declare function MenuContent({ align, sideOffset, minWidth, className, children, style, ...props }: MenuContentProps): React.ReactPortal | null;
|
|
153
|
+
interface MenuItemProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
154
|
+
icon?: React.ReactNode;
|
|
155
|
+
rightSlot?: React.ReactNode;
|
|
156
|
+
variant?: 'default' | 'destructive';
|
|
157
|
+
disabled?: boolean;
|
|
158
|
+
}
|
|
159
|
+
declare function MenuItem({ icon, rightSlot, variant, disabled, className, children, onClick, ...props }: MenuItemProps): react_jsx_runtime.JSX.Element;
|
|
160
|
+
declare function MenuSeparator({ className }: {
|
|
161
|
+
className?: string;
|
|
162
|
+
}): react_jsx_runtime.JSX.Element;
|
|
163
|
+
declare function MenuLabel({ className, children }: React.HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
|
|
164
|
+
declare function MenuTrigger({ children }: {
|
|
165
|
+
children: React.ReactElement;
|
|
166
|
+
}): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
167
|
+
|
|
168
|
+
type SheetSide = 'right' | 'left' | 'bottom';
|
|
169
|
+
interface SheetProps {
|
|
170
|
+
open: boolean;
|
|
171
|
+
onClose: () => void;
|
|
172
|
+
side?: SheetSide;
|
|
173
|
+
/** Width for left/right sheets (CSS value) */
|
|
174
|
+
width?: string;
|
|
175
|
+
/** Height for bottom sheet (CSS value) */
|
|
176
|
+
height?: string;
|
|
177
|
+
/** Close on overlay click */
|
|
178
|
+
closeOnOverlay?: boolean;
|
|
179
|
+
children: React.ReactNode;
|
|
180
|
+
}
|
|
181
|
+
declare function Sheet({ open, onClose, side, width, height, closeOnOverlay, children, }: SheetProps): React.ReactPortal | null;
|
|
182
|
+
interface SheetHeaderProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
183
|
+
showClose?: boolean;
|
|
184
|
+
onClose?: () => void;
|
|
185
|
+
}
|
|
186
|
+
declare function SheetHeader({ showClose, onClose, className, children, ...props }: SheetHeaderProps): react_jsx_runtime.JSX.Element;
|
|
187
|
+
declare function SheetTitle({ className, ...props }: React.HTMLAttributes<HTMLHeadingElement>): react_jsx_runtime.JSX.Element;
|
|
188
|
+
declare function SheetDescription({ className, ...props }: React.HTMLAttributes<HTMLParagraphElement>): react_jsx_runtime.JSX.Element;
|
|
189
|
+
declare function SheetContent({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
|
|
190
|
+
declare function SheetFooter({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
|
|
191
|
+
declare function Drawer({ children, ...props }: Omit<SheetProps, 'side'>): react_jsx_runtime.JSX.Element;
|
|
192
|
+
|
|
193
|
+
interface NavbarProps extends React.HTMLAttributes<HTMLElement> {
|
|
194
|
+
glass?: boolean;
|
|
195
|
+
border?: boolean;
|
|
196
|
+
sticky?: boolean;
|
|
197
|
+
height?: string;
|
|
198
|
+
}
|
|
199
|
+
declare function Navbar({ glass, border, sticky, height, className, children, ...props }: NavbarProps): react_jsx_runtime.JSX.Element;
|
|
200
|
+
declare function NavbarLeft({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
|
|
201
|
+
declare function NavbarCenter({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
|
|
202
|
+
declare function NavbarRight({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
|
|
203
|
+
interface NavbarBrandProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
204
|
+
logo?: React.ReactNode;
|
|
205
|
+
title: string;
|
|
206
|
+
subtitle?: string;
|
|
207
|
+
}
|
|
208
|
+
declare function NavbarBrand({ logo, title, subtitle, className, ...props }: NavbarBrandProps): react_jsx_runtime.JSX.Element;
|
|
209
|
+
interface NavbarSearchProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
210
|
+
icon?: React.ReactNode;
|
|
211
|
+
}
|
|
212
|
+
declare function NavbarSearch({ icon, className, ...props }: NavbarSearchProps): react_jsx_runtime.JSX.Element;
|
|
213
|
+
interface NavbarIconButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
214
|
+
badge?: string | number;
|
|
215
|
+
tooltip?: string;
|
|
216
|
+
}
|
|
217
|
+
declare function NavbarIconButton({ badge, tooltip, className, children, ...props }: NavbarIconButtonProps): react_jsx_runtime.JSX.Element;
|
|
218
|
+
declare function NavbarDivider({ className }: {
|
|
219
|
+
className?: string;
|
|
220
|
+
}): react_jsx_runtime.JSX.Element;
|
|
221
|
+
|
|
222
|
+
interface SidebarProps extends React.HTMLAttributes<HTMLElement> {
|
|
223
|
+
collapsed?: boolean;
|
|
224
|
+
glass?: boolean;
|
|
225
|
+
width?: string;
|
|
226
|
+
collapsedWidth?: string;
|
|
227
|
+
/** Mobile overlay mode — sidebar slides in/out as a fixed overlay with backdrop */
|
|
228
|
+
overlay?: boolean;
|
|
229
|
+
/** Called when backdrop is clicked in overlay mode */
|
|
230
|
+
onOverlayClose?: () => void;
|
|
231
|
+
}
|
|
232
|
+
declare function Sidebar({ collapsed, glass, width, collapsedWidth, overlay, onOverlayClose, className, children, style, ...props }: SidebarProps): react_jsx_runtime.JSX.Element;
|
|
233
|
+
declare function SidebarHeader({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
|
|
234
|
+
interface SidebarBrandProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
235
|
+
logo: React.ReactNode;
|
|
236
|
+
title: string;
|
|
237
|
+
subtitle?: string;
|
|
238
|
+
}
|
|
239
|
+
declare function SidebarBrand({ logo, title, subtitle, className, ...props }: SidebarBrandProps): react_jsx_runtime.JSX.Element;
|
|
240
|
+
declare function SidebarDivider({ className }: {
|
|
241
|
+
className?: string;
|
|
242
|
+
}): react_jsx_runtime.JSX.Element;
|
|
243
|
+
declare function SidebarContent({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
|
|
244
|
+
interface SidebarGroupProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
245
|
+
label?: string;
|
|
246
|
+
}
|
|
247
|
+
declare function SidebarGroup({ label, className, children, ...props }: SidebarGroupProps): react_jsx_runtime.JSX.Element;
|
|
248
|
+
interface SidebarItemProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
249
|
+
icon?: React.ReactNode;
|
|
250
|
+
label: string;
|
|
251
|
+
active?: boolean;
|
|
252
|
+
badge?: string | number;
|
|
253
|
+
href?: string;
|
|
254
|
+
as?: React.ElementType;
|
|
255
|
+
}
|
|
256
|
+
declare function SidebarItem({ icon, label, active, badge, href, as: Tag, className, ...props }: SidebarItemProps): react_jsx_runtime.JSX.Element;
|
|
257
|
+
declare function SidebarFooter({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
|
|
258
|
+
interface SidebarUserProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
259
|
+
name: string;
|
|
260
|
+
subtitle?: string;
|
|
261
|
+
avatar?: React.ReactNode;
|
|
262
|
+
avatarFallback?: string;
|
|
263
|
+
avatarColor?: string;
|
|
264
|
+
actions?: React.ReactNode;
|
|
265
|
+
}
|
|
266
|
+
declare function SidebarUser({ name, subtitle, avatar, avatarFallback, avatarColor, actions, className, ...props }: SidebarUserProps): react_jsx_runtime.JSX.Element;
|
|
267
|
+
interface SidebarToggleProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
268
|
+
collapsed: boolean;
|
|
269
|
+
}
|
|
270
|
+
declare function SidebarToggle({ collapsed, className, ...props }: SidebarToggleProps): react_jsx_runtime.JSX.Element;
|
|
271
|
+
|
|
272
|
+
declare function useClickOutside<T extends HTMLElement>(ref: RefObject<T>, handler: (event: MouseEvent | TouchEvent) => void, enabled?: boolean): void;
|
|
273
|
+
|
|
274
|
+
declare function useKeydown(key: string, handler: () => void, enabled?: boolean): void;
|
|
275
|
+
|
|
276
|
+
type ClassValue = string | number | boolean | null | undefined | ClassValue[] | Record<string, boolean | null | undefined>;
|
|
277
|
+
declare function cn(...inputs: ClassValue[]): string;
|
|
278
|
+
declare const colors: {
|
|
279
|
+
readonly blue: "#007AFF";
|
|
280
|
+
readonly green: "#34C759";
|
|
281
|
+
readonly red: "#FF3B30";
|
|
282
|
+
readonly orange: "#FF9500";
|
|
283
|
+
readonly purple: "#AF52DE";
|
|
284
|
+
readonly teal: "#5AC8FA";
|
|
285
|
+
readonly indigo: "#5856D6";
|
|
286
|
+
readonly bg: "#F2F2F7";
|
|
287
|
+
readonly card: "#FFFFFF";
|
|
288
|
+
readonly label: "#1C1C1E";
|
|
289
|
+
readonly label2: "#3C3C43";
|
|
290
|
+
readonly label3: "#8E8E93";
|
|
291
|
+
readonly sep: "#E5E5EA";
|
|
292
|
+
readonly fill: "#F2F2F7";
|
|
293
|
+
readonly fill2: "#E5E5EA";
|
|
294
|
+
readonly fill3: "#D1D1D6";
|
|
295
|
+
};
|
|
296
|
+
declare function generateId(): string;
|
|
297
|
+
|
|
298
|
+
export { Badge, type BadgeProps, type BadgeVariant, Button, type ButtonProps, type ButtonSize, type ButtonVariant, Card, CardContent, CardDescription, CardDivider, CardFooter, CardHeader, type CardProps, CardTitle, Drawer, Input, type InputProps, MenuRoot as Menu, type MenuAlign, MenuButton, MenuContent, type MenuContentProps, MenuRoot as MenuDropdown, MenuItem, type MenuItemProps, MenuLabel, type MenuProps, MenuRoot, MenuSeparator, MenuTrigger, Navbar, NavbarBrand, type NavbarBrandProps, NavbarCenter, NavbarDivider, NavbarIconButton, type NavbarIconButtonProps, NavbarLeft, type NavbarProps, NavbarRight, NavbarSearch, type NavbarSearchProps, Scrollbar, type ScrollbarProps, Sheet, SheetContent, SheetDescription, SheetFooter, SheetHeader, type SheetHeaderProps, type SheetProps, type SheetSide, SheetTitle, Sidebar, SidebarBrand, type SidebarBrandProps, SidebarContent, SidebarDivider, SidebarFooter, SidebarGroup, type SidebarGroupProps, SidebarHeader, SidebarItem, type SidebarItemProps, type SidebarProps, SidebarToggle, type SidebarToggleProps, SidebarUser, type SidebarUserProps, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TablePagination, type TableProps, TableRow, TableToolbar, Tabs, TabsContent, type TabsContentProps, TabsList, type TabsProps, TabsTrigger, type TabsTriggerProps, Textarea, type TextareaProps, type ToastItem, type ToastOptions, type ToastPosition, type ToastVariant, Toaster, type ToasterProps, cn, colors, dismissToast, generateId, toast, useClickOutside, useKeydown, useToast, withScrollbar };
|