@marcoschwartz/lite-ui 0.1.0 → 0.3.1

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.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import React, { ReactNode } from 'react';
2
2
  import * as react_jsx_runtime from 'react/jsx-runtime';
3
3
 
4
4
  interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
@@ -23,6 +23,186 @@ interface SelectProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'size'
23
23
  }
24
24
  declare const Select: React.FC<SelectProps>;
25
25
 
26
+ interface ModalProps {
27
+ isOpen: boolean;
28
+ onClose: () => void;
29
+ title?: string;
30
+ children: React.ReactNode;
31
+ size?: 'sm' | 'md' | 'lg' | 'xl';
32
+ showCloseButton?: boolean;
33
+ }
34
+ declare const Modal: React.FC<ModalProps>;
35
+
36
+ interface NavbarProps {
37
+ logo?: React.ReactNode;
38
+ children?: React.ReactNode;
39
+ className?: string;
40
+ sticky?: boolean;
41
+ }
42
+ declare const Navbar: React.FC<NavbarProps>;
43
+
44
+ interface SidebarProps {
45
+ children: React.ReactNode;
46
+ className?: string;
47
+ width?: 'sm' | 'md' | 'lg';
48
+ position?: 'left' | 'right';
49
+ }
50
+ declare const Sidebar: React.FC<SidebarProps>;
51
+
52
+ interface SidebarContextValue {
53
+ isOpen: boolean;
54
+ isMobile: boolean;
55
+ open: () => void;
56
+ close: () => void;
57
+ toggle: () => void;
58
+ setIsMobile: (isMobile: boolean) => void;
59
+ }
60
+ interface SidebarProviderProps {
61
+ children: ReactNode;
62
+ defaultOpen?: boolean;
63
+ }
64
+ declare const SidebarProvider: React.FC<SidebarProviderProps>;
65
+ declare const useSidebar: () => SidebarContextValue;
66
+
67
+ interface DrawerProps {
68
+ isOpen: boolean;
69
+ onClose: () => void;
70
+ title?: string;
71
+ children: React.ReactNode;
72
+ position?: 'left' | 'right' | 'top' | 'bottom';
73
+ size?: 'sm' | 'md' | 'lg';
74
+ showCloseButton?: boolean;
75
+ }
76
+ declare const Drawer: React.FC<DrawerProps>;
77
+
78
+ interface TextInputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size'> {
79
+ label?: string;
80
+ error?: string;
81
+ helperText?: string;
82
+ size?: 'sm' | 'md' | 'lg';
83
+ fullWidth?: boolean;
84
+ leftIcon?: React.ReactNode;
85
+ rightIcon?: React.ReactNode;
86
+ }
87
+ declare const TextInput: React.ForwardRefExoticComponent<TextInputProps & React.RefAttributes<HTMLInputElement>>;
88
+
89
+ interface ActionMenuItem {
90
+ label: string;
91
+ onClick: () => void;
92
+ icon?: React.ReactNode;
93
+ disabled?: boolean;
94
+ variant?: 'default' | 'danger';
95
+ }
96
+ interface ActionMenuProps {
97
+ items: ActionMenuItem[];
98
+ trigger?: React.ReactNode;
99
+ position?: 'left' | 'right';
100
+ }
101
+ declare const ActionMenu: React.FC<ActionMenuProps>;
102
+
103
+ interface CardProps {
104
+ children: React.ReactNode;
105
+ className?: string;
106
+ padding?: 'none' | 'sm' | 'md' | 'lg';
107
+ hover?: boolean;
108
+ }
109
+ declare const Card: React.FC<CardProps>;
110
+
111
+ interface AlertProps {
112
+ variant?: 'info' | 'success' | 'warning' | 'error';
113
+ title?: string;
114
+ children: React.ReactNode;
115
+ onClose?: () => void;
116
+ className?: string;
117
+ }
118
+ declare const Alert: React.FC<AlertProps>;
119
+
120
+ interface CheckboxProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'type'> {
121
+ label?: string;
122
+ error?: string;
123
+ }
124
+ declare const Checkbox: React.ForwardRefExoticComponent<CheckboxProps & React.RefAttributes<HTMLInputElement>>;
125
+
126
+ interface ToggleProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'type' | 'size'> {
127
+ label?: string;
128
+ size?: 'sm' | 'md' | 'lg';
129
+ }
130
+ declare const Toggle: React.ForwardRefExoticComponent<ToggleProps & React.RefAttributes<HTMLInputElement>>;
131
+
132
+ interface BadgeProps {
133
+ children: React.ReactNode;
134
+ variant?: 'default' | 'primary' | 'success' | 'warning' | 'error' | 'info';
135
+ size?: 'sm' | 'md' | 'lg';
136
+ className?: string;
137
+ }
138
+ declare const Badge: React.FC<BadgeProps>;
139
+
140
+ interface SpinnerProps {
141
+ size?: 'sm' | 'md' | 'lg' | 'xl';
142
+ color?: 'primary' | 'secondary' | 'white';
143
+ className?: string;
144
+ }
145
+ declare const Spinner: React.FC<SpinnerProps>;
146
+
147
+ interface Tab {
148
+ label: string;
149
+ content: React.ReactNode;
150
+ disabled?: boolean;
151
+ }
152
+ interface TabsProps {
153
+ tabs: Tab[];
154
+ defaultIndex?: number;
155
+ onChange?: (index: number) => void;
156
+ className?: string;
157
+ }
158
+ declare const Tabs: React.FC<TabsProps>;
159
+
160
+ interface Column<T = any> {
161
+ key: string;
162
+ title: string;
163
+ render?: (value: any, row: T, index: number) => React.ReactNode;
164
+ width?: string;
165
+ }
166
+ interface TableProps<T = any> {
167
+ columns: Column<T>[];
168
+ data: T[];
169
+ keyField?: string;
170
+ striped?: boolean;
171
+ hoverable?: boolean;
172
+ className?: string;
173
+ }
174
+ declare function Table<T extends Record<string, any>>({ columns, data, keyField, striped, hoverable, className, }: TableProps<T>): react_jsx_runtime.JSX.Element;
175
+
176
+ interface PaginationProps {
177
+ currentPage: number;
178
+ totalPages: number;
179
+ onPageChange: (page: number) => void;
180
+ siblingCount?: number;
181
+ className?: string;
182
+ }
183
+ declare const Pagination: React.FC<PaginationProps>;
184
+
185
+ interface DatePickerProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'type'> {
186
+ label?: string;
187
+ error?: string;
188
+ helperText?: string;
189
+ }
190
+ declare const DatePicker: React.ForwardRefExoticComponent<DatePickerProps & React.RefAttributes<HTMLInputElement>>;
191
+
192
+ interface TimePickerProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'type'> {
193
+ label?: string;
194
+ error?: string;
195
+ helperText?: string;
196
+ }
197
+ declare const TimePicker: React.ForwardRefExoticComponent<TimePickerProps & React.RefAttributes<HTMLInputElement>>;
198
+
199
+ interface DateTimePickerProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'type'> {
200
+ label?: string;
201
+ error?: string;
202
+ helperText?: string;
203
+ }
204
+ declare const DateTimePicker: React.ForwardRefExoticComponent<DateTimePickerProps & React.RefAttributes<HTMLInputElement>>;
205
+
26
206
  type ThemeName = 'default' | 'minimalistic';
27
207
  interface ButtonTheme {
28
208
  primary: string;
@@ -84,4 +264,34 @@ declare function ThemeProvider({ children, defaultTheme, defaultColorMode }: The
84
264
  declare const themeScript = "\n(function() {\n try {\n // Get stored preferences\n const storedTheme = localStorage.getItem('lite-ui-theme') || 'default';\n const storedColorMode = localStorage.getItem('lite-ui-color-mode');\n\n // Determine color mode (system, light, or dark)\n let colorMode = storedColorMode;\n if (!colorMode || colorMode === 'system') {\n colorMode = window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';\n }\n\n // Set attributes before render\n document.documentElement.setAttribute('data-theme', storedTheme);\n document.documentElement.setAttribute('data-color-mode', colorMode);\n\n // Add dark class for Tailwind\n if (colorMode === 'dark') {\n document.documentElement.classList.add('dark');\n } else {\n document.documentElement.classList.remove('dark');\n }\n } catch (e) {\n console.error('Failed to initialize theme:', e);\n }\n})();\n";
85
265
  declare function getThemeScript(): string;
86
266
 
87
- export { Button, type ButtonProps, type ButtonTheme, type ColorMode, Select, type SelectOption, type SelectProps, type SelectTheme, type Theme, type ThemeName, ThemeProvider, getThemeScript, themeScript, themes, useTheme };
267
+ interface IconProps {
268
+ size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
269
+ className?: string;
270
+ color?: string;
271
+ }
272
+ interface IconComponent extends React.FC<IconProps> {
273
+ displayName?: string;
274
+ }
275
+ declare const HomeIcon: IconComponent;
276
+ declare const UserIcon: IconComponent;
277
+ declare const SearchIcon: IconComponent;
278
+ declare const BellIcon: IconComponent;
279
+ declare const SettingsIcon: IconComponent;
280
+ declare const MenuIcon: IconComponent;
281
+ declare const CloseIcon: IconComponent;
282
+ declare const ChevronDownIcon: IconComponent;
283
+ declare const ChevronRightIcon: IconComponent;
284
+ declare const CheckIcon: IconComponent;
285
+ declare const PlusIcon: IconComponent;
286
+ declare const TrashIcon: IconComponent;
287
+ declare const EditIcon: IconComponent;
288
+ declare const MailIcon: IconComponent;
289
+ declare const StarIcon: IconComponent;
290
+ declare const HeartIcon: IconComponent;
291
+ declare const DownloadIcon: IconComponent;
292
+ declare const UploadIcon: IconComponent;
293
+ declare const CameraIcon: IconComponent;
294
+ declare const LockIcon: IconComponent;
295
+ declare const CalendarIcon: IconComponent;
296
+
297
+ export { ActionMenu, type ActionMenuItem, type ActionMenuProps, Alert, type AlertProps, Badge, type BadgeProps, BellIcon, Button, type ButtonProps, type ButtonTheme, CalendarIcon, CameraIcon, Card, type CardProps, CheckIcon, Checkbox, type CheckboxProps, ChevronDownIcon, ChevronRightIcon, CloseIcon, type ColorMode, type Column, DatePicker, type DatePickerProps, DateTimePicker, type DateTimePickerProps, DownloadIcon, Drawer, type DrawerProps, EditIcon, HeartIcon, HomeIcon, type IconComponent, type IconProps, LockIcon, MailIcon, MenuIcon, Modal, type ModalProps, Navbar, type NavbarProps, Pagination, type PaginationProps, PlusIcon, SearchIcon, Select, type SelectOption, type SelectProps, type SelectTheme, SettingsIcon, Sidebar, type SidebarContextValue, type SidebarProps, SidebarProvider, type SidebarProviderProps, Spinner, type SpinnerProps, StarIcon, type Tab, Table, type TableProps, Tabs, type TabsProps, TextInput, type TextInputProps, type Theme, type ThemeName, ThemeProvider, TimePicker, type TimePickerProps, Toggle, type ToggleProps, TrashIcon, UploadIcon, UserIcon, getThemeScript, themeScript, themes, useSidebar, useTheme };