@codepom/react 0.1.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/index.cjs +1005 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +269 -0
- package/dist/index.d.ts +269 -0
- package/dist/index.js +943 -0
- package/dist/index.js.map +1 -0
- package/dist/styles.css +246 -0
- package/package.json +60 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
type ButtonVariant = 'primary' | 'secondary' | 'ghost' | 'danger';
|
|
4
|
+
type ButtonSize = 'sm' | 'md' | 'lg';
|
|
5
|
+
interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
6
|
+
variant?: ButtonVariant;
|
|
7
|
+
size?: ButtonSize;
|
|
8
|
+
loading?: boolean;
|
|
9
|
+
icon?: React.ReactNode;
|
|
10
|
+
iconPosition?: 'left' | 'right';
|
|
11
|
+
fullWidth?: boolean;
|
|
12
|
+
}
|
|
13
|
+
declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
14
|
+
|
|
15
|
+
type BadgeVariant = 'default' | 'primary' | 'success' | 'warning' | 'error' | 'info';
|
|
16
|
+
type BadgeSize = 'sm' | 'md';
|
|
17
|
+
interface BadgeProps {
|
|
18
|
+
variant?: BadgeVariant;
|
|
19
|
+
size?: BadgeSize;
|
|
20
|
+
dot?: boolean;
|
|
21
|
+
children: React.ReactNode;
|
|
22
|
+
className?: string;
|
|
23
|
+
}
|
|
24
|
+
declare const Badge: React.FC<BadgeProps>;
|
|
25
|
+
|
|
26
|
+
type AlertVariant = 'info' | 'success' | 'warning' | 'error';
|
|
27
|
+
interface AlertProps {
|
|
28
|
+
variant?: AlertVariant;
|
|
29
|
+
title?: string;
|
|
30
|
+
dismissible?: boolean;
|
|
31
|
+
onDismiss?: () => void;
|
|
32
|
+
children: React.ReactNode;
|
|
33
|
+
className?: string;
|
|
34
|
+
}
|
|
35
|
+
declare const Alert: React.FC<AlertProps>;
|
|
36
|
+
|
|
37
|
+
type CardElevation = 0 | 1 | 2 | 3 | 4 | 5;
|
|
38
|
+
interface CardProps {
|
|
39
|
+
elevation?: CardElevation;
|
|
40
|
+
padding?: 'none' | 'sm' | 'md' | 'lg';
|
|
41
|
+
interactive?: boolean;
|
|
42
|
+
children: React.ReactNode;
|
|
43
|
+
className?: string;
|
|
44
|
+
as?: React.ElementType;
|
|
45
|
+
}
|
|
46
|
+
interface CardHeaderProps {
|
|
47
|
+
children: React.ReactNode;
|
|
48
|
+
className?: string;
|
|
49
|
+
}
|
|
50
|
+
interface CardBodyProps {
|
|
51
|
+
children: React.ReactNode;
|
|
52
|
+
className?: string;
|
|
53
|
+
}
|
|
54
|
+
interface CardFooterProps {
|
|
55
|
+
children: React.ReactNode;
|
|
56
|
+
className?: string;
|
|
57
|
+
}
|
|
58
|
+
declare const Card: React.FC<CardProps>;
|
|
59
|
+
declare const CardHeader: React.FC<CardHeaderProps>;
|
|
60
|
+
declare const CardBody: React.FC<CardBodyProps>;
|
|
61
|
+
declare const CardFooter: React.FC<CardFooterProps>;
|
|
62
|
+
|
|
63
|
+
type AvatarSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
64
|
+
type AvatarStatus = 'online' | 'away' | 'busy' | 'offline' | 'none';
|
|
65
|
+
interface AvatarProps {
|
|
66
|
+
src?: string;
|
|
67
|
+
alt?: string;
|
|
68
|
+
initials?: string;
|
|
69
|
+
name?: string;
|
|
70
|
+
size?: AvatarSize;
|
|
71
|
+
status?: AvatarStatus;
|
|
72
|
+
className?: string;
|
|
73
|
+
}
|
|
74
|
+
declare const Avatar: React.FC<AvatarProps>;
|
|
75
|
+
|
|
76
|
+
interface LabelProps extends React.LabelHTMLAttributes<HTMLLabelElement> {
|
|
77
|
+
required?: boolean;
|
|
78
|
+
children: React.ReactNode;
|
|
79
|
+
}
|
|
80
|
+
declare const Label: React.FC<LabelProps>;
|
|
81
|
+
type InputSize = 'sm' | 'md' | 'lg';
|
|
82
|
+
interface InputProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
83
|
+
inputSize?: InputSize;
|
|
84
|
+
error?: boolean;
|
|
85
|
+
leadingIcon?: React.ReactNode;
|
|
86
|
+
trailingIcon?: React.ReactNode;
|
|
87
|
+
}
|
|
88
|
+
declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<HTMLInputElement>>;
|
|
89
|
+
interface TextareaProps extends React.TextareaHTMLAttributes<HTMLTextAreaElement> {
|
|
90
|
+
error?: boolean;
|
|
91
|
+
resize?: 'none' | 'vertical' | 'horizontal' | 'both';
|
|
92
|
+
}
|
|
93
|
+
declare const Textarea: React.ForwardRefExoticComponent<TextareaProps & React.RefAttributes<HTMLTextAreaElement>>;
|
|
94
|
+
interface SelectProps extends React.SelectHTMLAttributes<HTMLSelectElement> {
|
|
95
|
+
error?: boolean;
|
|
96
|
+
}
|
|
97
|
+
declare const Select: React.ForwardRefExoticComponent<SelectProps & React.RefAttributes<HTMLSelectElement>>;
|
|
98
|
+
interface FieldProps {
|
|
99
|
+
label: string;
|
|
100
|
+
htmlFor?: string;
|
|
101
|
+
hint?: string;
|
|
102
|
+
error?: string;
|
|
103
|
+
required?: boolean;
|
|
104
|
+
children: React.ReactNode;
|
|
105
|
+
className?: string;
|
|
106
|
+
}
|
|
107
|
+
declare const Field: React.FC<FieldProps>;
|
|
108
|
+
|
|
109
|
+
type ModalSize = 'sm' | 'md' | 'lg' | 'full';
|
|
110
|
+
interface ModalProps {
|
|
111
|
+
open: boolean;
|
|
112
|
+
onClose: () => void;
|
|
113
|
+
title?: string;
|
|
114
|
+
size?: ModalSize;
|
|
115
|
+
children: React.ReactNode;
|
|
116
|
+
footer?: React.ReactNode;
|
|
117
|
+
closeOnBackdrop?: boolean;
|
|
118
|
+
className?: string;
|
|
119
|
+
}
|
|
120
|
+
declare const Modal: React.FC<ModalProps>;
|
|
121
|
+
|
|
122
|
+
type ToastVariant = 'info' | 'success' | 'warning' | 'error';
|
|
123
|
+
type ToastPosition = 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left';
|
|
124
|
+
interface ToastItem {
|
|
125
|
+
id: string;
|
|
126
|
+
variant?: ToastVariant;
|
|
127
|
+
title?: string;
|
|
128
|
+
message: string;
|
|
129
|
+
duration?: number;
|
|
130
|
+
action?: {
|
|
131
|
+
label: string;
|
|
132
|
+
onClick: () => void;
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
interface ToastContextValue {
|
|
136
|
+
show: (toast: Omit<ToastItem, 'id'>) => string;
|
|
137
|
+
dismiss: (id: string) => void;
|
|
138
|
+
}
|
|
139
|
+
interface ToastProviderProps {
|
|
140
|
+
position?: ToastPosition;
|
|
141
|
+
children: React.ReactNode;
|
|
142
|
+
}
|
|
143
|
+
declare const ToastProvider: React.FC<ToastProviderProps>;
|
|
144
|
+
declare const useToast: () => ToastContextValue;
|
|
145
|
+
|
|
146
|
+
type TabsVariant = 'underline' | 'pill' | 'boxed';
|
|
147
|
+
interface TabItem {
|
|
148
|
+
id: string;
|
|
149
|
+
label: string;
|
|
150
|
+
badge?: string | number;
|
|
151
|
+
icon?: React.ReactNode;
|
|
152
|
+
disabled?: boolean;
|
|
153
|
+
content: React.ReactNode;
|
|
154
|
+
}
|
|
155
|
+
interface TabsProps {
|
|
156
|
+
tabs: TabItem[];
|
|
157
|
+
defaultTab?: string;
|
|
158
|
+
variant?: TabsVariant;
|
|
159
|
+
onChange?: (id: string) => void;
|
|
160
|
+
className?: string;
|
|
161
|
+
}
|
|
162
|
+
declare const Tabs: React.FC<TabsProps>;
|
|
163
|
+
|
|
164
|
+
type TooltipPlacement = 'top' | 'bottom' | 'left' | 'right';
|
|
165
|
+
interface TooltipProps {
|
|
166
|
+
content: string;
|
|
167
|
+
placement?: TooltipPlacement;
|
|
168
|
+
children: React.ReactElement;
|
|
169
|
+
}
|
|
170
|
+
declare const Tooltip: React.FC<TooltipProps>;
|
|
171
|
+
|
|
172
|
+
type BreadcrumbSeparator = 'chevron' | 'slash' | 'dot';
|
|
173
|
+
interface BreadcrumbItem {
|
|
174
|
+
label: string;
|
|
175
|
+
href?: string;
|
|
176
|
+
}
|
|
177
|
+
interface BreadcrumbProps {
|
|
178
|
+
items: BreadcrumbItem[];
|
|
179
|
+
separator?: BreadcrumbSeparator;
|
|
180
|
+
className?: string;
|
|
181
|
+
}
|
|
182
|
+
declare const Breadcrumb: React.FC<BreadcrumbProps>;
|
|
183
|
+
|
|
184
|
+
interface PaginationProps {
|
|
185
|
+
total: number;
|
|
186
|
+
page: number;
|
|
187
|
+
perPage?: number;
|
|
188
|
+
onChange: (page: number) => void;
|
|
189
|
+
className?: string;
|
|
190
|
+
}
|
|
191
|
+
declare const Pagination: React.FC<PaginationProps>;
|
|
192
|
+
|
|
193
|
+
interface TableColumn {
|
|
194
|
+
key: string;
|
|
195
|
+
label: string;
|
|
196
|
+
width?: string | number;
|
|
197
|
+
}
|
|
198
|
+
interface TableProps {
|
|
199
|
+
columns: TableColumn[];
|
|
200
|
+
rows: Record<string, React.ReactNode>[];
|
|
201
|
+
striped?: boolean;
|
|
202
|
+
hoverable?: boolean;
|
|
203
|
+
loading?: boolean;
|
|
204
|
+
className?: string;
|
|
205
|
+
}
|
|
206
|
+
declare const Table: React.FC<TableProps>;
|
|
207
|
+
|
|
208
|
+
interface SkeletonProps {
|
|
209
|
+
width?: string | number;
|
|
210
|
+
height?: string | number;
|
|
211
|
+
rounded?: boolean;
|
|
212
|
+
lines?: number;
|
|
213
|
+
className?: string;
|
|
214
|
+
}
|
|
215
|
+
declare const Skeleton: React.FC<SkeletonProps>;
|
|
216
|
+
interface SkeletonTextProps {
|
|
217
|
+
lines?: number;
|
|
218
|
+
className?: string;
|
|
219
|
+
}
|
|
220
|
+
declare const SkeletonText: React.FC<SkeletonTextProps>;
|
|
221
|
+
declare const SkeletonCard: React.FC<{
|
|
222
|
+
className?: string;
|
|
223
|
+
}>;
|
|
224
|
+
|
|
225
|
+
interface NavLink {
|
|
226
|
+
label: string;
|
|
227
|
+
href: string;
|
|
228
|
+
active?: boolean;
|
|
229
|
+
}
|
|
230
|
+
interface NavbarProps {
|
|
231
|
+
logo?: React.ReactNode;
|
|
232
|
+
links?: NavLink[];
|
|
233
|
+
actions?: React.ReactNode;
|
|
234
|
+
sticky?: boolean;
|
|
235
|
+
className?: string;
|
|
236
|
+
}
|
|
237
|
+
declare const Navbar: React.FC<NavbarProps>;
|
|
238
|
+
|
|
239
|
+
interface SidebarChildLink {
|
|
240
|
+
label: string;
|
|
241
|
+
href: string;
|
|
242
|
+
active?: boolean;
|
|
243
|
+
}
|
|
244
|
+
interface SidebarLink {
|
|
245
|
+
label: string;
|
|
246
|
+
href: string;
|
|
247
|
+
icon?: React.ReactNode;
|
|
248
|
+
badge?: string | number;
|
|
249
|
+
active?: boolean;
|
|
250
|
+
children?: SidebarChildLink[];
|
|
251
|
+
}
|
|
252
|
+
interface SidebarProps {
|
|
253
|
+
links?: SidebarLink[];
|
|
254
|
+
collapsed?: boolean;
|
|
255
|
+
onCollapse?: (collapsed: boolean) => void;
|
|
256
|
+
className?: string;
|
|
257
|
+
}
|
|
258
|
+
declare const Sidebar: React.FC<SidebarProps>;
|
|
259
|
+
|
|
260
|
+
type PopoverPlacement = 'top' | 'bottom' | 'left' | 'right';
|
|
261
|
+
interface PopoverProps {
|
|
262
|
+
trigger: React.ReactNode;
|
|
263
|
+
placement?: PopoverPlacement;
|
|
264
|
+
children: React.ReactNode;
|
|
265
|
+
className?: string;
|
|
266
|
+
}
|
|
267
|
+
declare const Popover: React.FC<PopoverProps>;
|
|
268
|
+
|
|
269
|
+
export { Alert, type AlertProps, type AlertVariant, Avatar, type AvatarProps, type AvatarSize, type AvatarStatus, Badge, type BadgeProps, type BadgeSize, type BadgeVariant, Breadcrumb, type BreadcrumbItem, type BreadcrumbProps, type BreadcrumbSeparator, Button, type ButtonProps, type ButtonSize, type ButtonVariant, Card, CardBody, type CardBodyProps, type CardElevation, CardFooter, type CardFooterProps, CardHeader, type CardHeaderProps, type CardProps, Field, type FieldProps, Input, type InputProps, type InputSize, Label, type LabelProps, Modal, type ModalProps, type ModalSize, type NavLink, Navbar, type NavbarProps, Pagination, type PaginationProps, Popover, type PopoverProps, Select, type SelectProps, Sidebar, type SidebarChildLink, type SidebarLink, type SidebarProps, Skeleton, SkeletonCard, type SkeletonProps, SkeletonText, type TabItem, Table, type TableColumn, type TableProps, Tabs, type TabsProps, type TabsVariant, Textarea, type TextareaProps, type ToastItem, type ToastPosition, ToastProvider, type ToastProviderProps, type ToastVariant, Tooltip, type TooltipPlacement, type TooltipProps, useToast };
|