@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/README.md +238 -134
- package/dist/index.d.mts +212 -2
- package/dist/index.d.ts +212 -2
- package/dist/index.js +1017 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +976 -5
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +2 -0
- package/package.json +4 -2
package/README.md
CHANGED
|
@@ -1,208 +1,312 @@
|
|
|
1
1
|
# Lite UI
|
|
2
2
|
|
|
3
|
-
A lightweight UI component library built with Tailwind CSS
|
|
3
|
+
A lightweight, modern UI component library built with React, TypeScript, and Tailwind CSS v4.
|
|
4
4
|
|
|
5
|
-
## Features
|
|
5
|
+
## ✨ Features
|
|
6
6
|
|
|
7
|
-
-
|
|
8
|
-
-
|
|
9
|
-
-
|
|
10
|
-
-
|
|
11
|
-
-
|
|
12
|
-
-
|
|
13
|
-
-
|
|
7
|
+
- 🎨 **21 Production-Ready Components** - From basic inputs to complex data tables
|
|
8
|
+
- 🌙 **Dark Mode Support** - Built-in dark mode with system preference detection
|
|
9
|
+
- 🎭 **Theming System** - Multiple themes with easy customization
|
|
10
|
+
- 📦 **Tree-Shakeable** - Only bundle what you use (ESM & CJS)
|
|
11
|
+
- ⚡ **TypeScript First** - Full type safety and IntelliSense support
|
|
12
|
+
- 🚀 **Server Component Compatible** - Works with Next.js App Router and RSC
|
|
13
|
+
- 🎯 **Zero Runtime CSS** - Styles compiled with Tailwind CSS v4
|
|
14
|
+
- ♿ **Accessible** - ARIA-compliant components
|
|
14
15
|
|
|
15
|
-
##
|
|
16
|
-
|
|
17
|
-
### Quick Start
|
|
18
|
-
|
|
19
|
-
Run the library build watcher and demo app simultaneously:
|
|
16
|
+
## 📦 Installation
|
|
20
17
|
|
|
21
18
|
```bash
|
|
22
|
-
npm
|
|
19
|
+
npm install @marcoschwartz/lite-ui
|
|
23
20
|
```
|
|
24
21
|
|
|
25
|
-
|
|
26
|
-
1. Start the UI library build in watch mode (auto-rebuilds on changes)
|
|
27
|
-
2. Start the Next.js demo app on http://localhost:3000
|
|
28
|
-
3. Automatically reflect changes from the library in the demo app
|
|
29
|
-
|
|
30
|
-
### Individual Commands
|
|
22
|
+
### Setup
|
|
31
23
|
|
|
32
|
-
|
|
33
|
-
```bash
|
|
34
|
-
npm run build
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
Build the library in watch mode:
|
|
38
|
-
```bash
|
|
39
|
-
npm run dev
|
|
40
|
-
```
|
|
24
|
+
1. **Import the CSS** in your app's entry point:
|
|
41
25
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
26
|
+
```tsx
|
|
27
|
+
// app/layout.tsx (Next.js) or main.tsx (Vite)
|
|
28
|
+
import '@marcoschwartz/lite-ui/styles.css';
|
|
45
29
|
```
|
|
46
30
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
### Button
|
|
31
|
+
2. **Wrap your app with ThemeProvider** (recommended):
|
|
50
32
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
#### Variants
|
|
54
|
-
- `primary` (default) - Blue button
|
|
55
|
-
- `secondary` - Gray button
|
|
56
|
-
- `success` - Green button
|
|
57
|
-
- `danger` - Red button
|
|
58
|
-
- `warning` - Yellow button
|
|
59
|
-
- `info` - Cyan button
|
|
33
|
+
```tsx
|
|
34
|
+
import { ThemeProvider } from '@marcoschwartz/lite-ui';
|
|
60
35
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
36
|
+
export default function RootLayout({ children }) {
|
|
37
|
+
return (
|
|
38
|
+
<html lang="en">
|
|
39
|
+
<body>
|
|
40
|
+
<ThemeProvider defaultTheme="default" defaultColorMode="system">
|
|
41
|
+
{children}
|
|
42
|
+
</ThemeProvider>
|
|
43
|
+
</body>
|
|
44
|
+
</html>
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
```
|
|
66
48
|
|
|
67
|
-
|
|
49
|
+
3. **Start using components:**
|
|
68
50
|
|
|
69
|
-
**In Server Components (Next.js App Router):**
|
|
70
51
|
```tsx
|
|
71
|
-
|
|
72
|
-
import { Button } from 'lite-ui';
|
|
52
|
+
import { Button, Card, TextInput } from '@marcoschwartz/lite-ui';
|
|
73
53
|
|
|
74
54
|
export default function Page() {
|
|
75
55
|
return (
|
|
76
|
-
<
|
|
77
|
-
<
|
|
78
|
-
|
|
79
|
-
</Button>
|
|
80
|
-
</
|
|
56
|
+
<Card>
|
|
57
|
+
<h1>Welcome to Lite UI</h1>
|
|
58
|
+
<TextInput placeholder="Enter your name" />
|
|
59
|
+
<Button variant="primary">Submit</Button>
|
|
60
|
+
</Card>
|
|
81
61
|
);
|
|
82
62
|
}
|
|
83
63
|
```
|
|
84
64
|
|
|
85
|
-
|
|
65
|
+
## 🎨 Components
|
|
66
|
+
|
|
67
|
+
### Form Controls
|
|
68
|
+
- **Button** - Versatile button with 6 variants and 4 sizes
|
|
69
|
+
- **TextInput** - Text input with validation and error states
|
|
70
|
+
- **Select** - Dropdown select with custom styling
|
|
71
|
+
- **Checkbox** - Checkbox with label and error support
|
|
72
|
+
- **Toggle** - Switch/toggle component with multiple sizes
|
|
73
|
+
- **DatePicker** - Date selection input
|
|
74
|
+
- **TimePicker** - Time selection input
|
|
75
|
+
- **DateTimePicker** - Combined date and time picker
|
|
76
|
+
|
|
77
|
+
### Layout & Navigation
|
|
78
|
+
- **Navbar** - Responsive navigation bar
|
|
79
|
+
- **Sidebar** - Collapsible sidebar with mobile support
|
|
80
|
+
- **Drawer** - Slide-out drawer panel
|
|
81
|
+
- **Modal** - Accessible modal dialog
|
|
82
|
+
- **Tabs** - Tabbed navigation component
|
|
83
|
+
|
|
84
|
+
### Feedback & Overlays
|
|
85
|
+
- **Alert** - Alert messages with 4 variants
|
|
86
|
+
- **Spinner** - Loading spinner with 3 sizes
|
|
87
|
+
- **Badge** - Status badges with 6 variants
|
|
88
|
+
|
|
89
|
+
### Data Display
|
|
90
|
+
- **Card** - Content container with optional header/footer
|
|
91
|
+
- **Table** - Data table with sorting and selection
|
|
92
|
+
- **Pagination** - Page navigation component
|
|
93
|
+
|
|
94
|
+
### Utilities
|
|
95
|
+
- **ActionMenu** - Dropdown action menu
|
|
96
|
+
- **Icons** - Set of common UI icons
|
|
97
|
+
|
|
98
|
+
[**📖 View Full Component Documentation**](./COMPONENTS.md)
|
|
99
|
+
|
|
100
|
+
## 🌙 Dark Mode
|
|
101
|
+
|
|
102
|
+
Lite UI includes built-in dark mode support with three color modes:
|
|
103
|
+
|
|
86
104
|
```tsx
|
|
87
|
-
|
|
88
|
-
"use client";
|
|
105
|
+
import { useTheme } from '@marcoschwartz/lite-ui';
|
|
89
106
|
|
|
90
|
-
|
|
107
|
+
function ThemeToggle() {
|
|
108
|
+
const { colorMode, setColorMode } = useTheme();
|
|
91
109
|
|
|
92
|
-
export function InteractiveButton() {
|
|
93
110
|
return (
|
|
94
|
-
<
|
|
95
|
-
|
|
96
|
-
|
|
111
|
+
<select value={colorMode} onChange={(e) => setColorMode(e.target.value)}>
|
|
112
|
+
<option value="system">System</option>
|
|
113
|
+
<option value="light">Light</option>
|
|
114
|
+
<option value="dark">Dark</option>
|
|
115
|
+
</select>
|
|
97
116
|
);
|
|
98
117
|
}
|
|
99
118
|
```
|
|
100
119
|
|
|
101
|
-
|
|
120
|
+
## 🎭 Theming
|
|
121
|
+
|
|
122
|
+
Switch between built-in themes or create your own:
|
|
123
|
+
|
|
102
124
|
```tsx
|
|
103
|
-
import {
|
|
125
|
+
import { useTheme } from '@marcoschwartz/lite-ui';
|
|
126
|
+
|
|
127
|
+
function ThemeSwitcher() {
|
|
128
|
+
const { themeName, setTheme } = useTheme();
|
|
104
129
|
|
|
105
|
-
function App() {
|
|
106
130
|
return (
|
|
107
131
|
<div>
|
|
108
|
-
<
|
|
109
|
-
|
|
110
|
-
</Button>
|
|
111
|
-
|
|
112
|
-
<Button variant="success" size="lg" onClick={() => alert('Success!')}>
|
|
113
|
-
Submit
|
|
114
|
-
</Button>
|
|
115
|
-
|
|
116
|
-
<Button variant="danger" disabled>
|
|
117
|
-
Disabled
|
|
118
|
-
</Button>
|
|
132
|
+
<button onClick={() => setTheme('default')}>Default Theme</button>
|
|
133
|
+
<button onClick={() => setTheme('minimalistic')}>Minimalistic Theme</button>
|
|
119
134
|
</div>
|
|
120
135
|
);
|
|
121
136
|
}
|
|
122
137
|
```
|
|
123
138
|
|
|
124
|
-
|
|
139
|
+
### Available Themes
|
|
125
140
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
├── src/ # UI library source code
|
|
129
|
-
│ ├── components/ # React components
|
|
130
|
-
│ └── index.ts # Main export file
|
|
131
|
-
├── demo/ # Next.js demo application
|
|
132
|
-
├── dist/ # Built library (generated)
|
|
133
|
-
└── dev.sh # Development script
|
|
134
|
-
```
|
|
141
|
+
- **Default** - Vibrant colors, shadows, and smooth animations
|
|
142
|
+
- **Minimalistic** - Flat design, subtle colors, minimal effects
|
|
135
143
|
|
|
136
|
-
##
|
|
144
|
+
## 🚀 Usage Examples
|
|
137
145
|
|
|
138
|
-
|
|
146
|
+
### Basic Form
|
|
139
147
|
|
|
140
|
-
|
|
148
|
+
```tsx
|
|
149
|
+
"use client";
|
|
141
150
|
|
|
142
|
-
|
|
143
|
-
|
|
151
|
+
import { useState } from 'react';
|
|
152
|
+
import { Card, TextInput, Button, Alert } from '@marcoschwartz/lite-ui';
|
|
153
|
+
|
|
154
|
+
export function ContactForm() {
|
|
155
|
+
const [email, setEmail] = useState('');
|
|
156
|
+
const [submitted, setSubmitted] = useState(false);
|
|
157
|
+
|
|
158
|
+
return (
|
|
159
|
+
<Card>
|
|
160
|
+
<h2>Contact Us</h2>
|
|
161
|
+
{submitted && (
|
|
162
|
+
<Alert variant="success">Message sent successfully!</Alert>
|
|
163
|
+
)}
|
|
164
|
+
<TextInput
|
|
165
|
+
label="Email"
|
|
166
|
+
type="email"
|
|
167
|
+
value={email}
|
|
168
|
+
onChange={(e) => setEmail(e.target.value)}
|
|
169
|
+
placeholder="your@email.com"
|
|
170
|
+
/>
|
|
171
|
+
<Button
|
|
172
|
+
variant="primary"
|
|
173
|
+
onClick={() => setSubmitted(true)}
|
|
174
|
+
>
|
|
175
|
+
Send Message
|
|
176
|
+
</Button>
|
|
177
|
+
</Card>
|
|
178
|
+
);
|
|
179
|
+
}
|
|
180
|
+
```
|
|
144
181
|
|
|
145
|
-
###
|
|
182
|
+
### Data Table
|
|
146
183
|
|
|
147
|
-
**Wrap your app with ThemeProvider:**
|
|
148
184
|
```tsx
|
|
149
|
-
import {
|
|
185
|
+
import { Table } from '@marcoschwartz/lite-ui';
|
|
186
|
+
|
|
187
|
+
const columns = [
|
|
188
|
+
{ key: 'name', label: 'Name', sortable: true },
|
|
189
|
+
{ key: 'email', label: 'Email', sortable: true },
|
|
190
|
+
{ key: 'status', label: 'Status' },
|
|
191
|
+
];
|
|
150
192
|
|
|
151
|
-
|
|
193
|
+
const data = [
|
|
194
|
+
{ id: 1, name: 'John Doe', email: 'john@example.com', status: 'Active' },
|
|
195
|
+
{ id: 2, name: 'Jane Smith', email: 'jane@example.com', status: 'Inactive' },
|
|
196
|
+
];
|
|
197
|
+
|
|
198
|
+
export function UserTable() {
|
|
152
199
|
return (
|
|
153
|
-
<
|
|
154
|
-
{
|
|
155
|
-
|
|
200
|
+
<Table
|
|
201
|
+
columns={columns}
|
|
202
|
+
data={data}
|
|
203
|
+
sortable
|
|
204
|
+
selectable
|
|
205
|
+
/>
|
|
156
206
|
);
|
|
157
207
|
}
|
|
158
208
|
```
|
|
159
209
|
|
|
160
|
-
|
|
210
|
+
### Modal Dialog
|
|
211
|
+
|
|
161
212
|
```tsx
|
|
162
213
|
"use client";
|
|
163
214
|
|
|
164
|
-
import {
|
|
215
|
+
import { useState } from 'react';
|
|
216
|
+
import { Modal, Button } from '@marcoschwartz/lite-ui';
|
|
165
217
|
|
|
166
|
-
function
|
|
167
|
-
const
|
|
218
|
+
export function ConfirmDialog() {
|
|
219
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
168
220
|
|
|
169
221
|
return (
|
|
170
|
-
|
|
171
|
-
<
|
|
172
|
-
<
|
|
173
|
-
|
|
174
|
-
|
|
222
|
+
<>
|
|
223
|
+
<Button onClick={() => setIsOpen(true)}>Open Dialog</Button>
|
|
224
|
+
<Modal
|
|
225
|
+
isOpen={isOpen}
|
|
226
|
+
onClose={() => setIsOpen(false)}
|
|
227
|
+
title="Confirm Action"
|
|
228
|
+
>
|
|
229
|
+
<p>Are you sure you want to proceed?</p>
|
|
230
|
+
<div className="flex gap-2 mt-4">
|
|
231
|
+
<Button variant="danger" onClick={() => setIsOpen(false)}>
|
|
232
|
+
Confirm
|
|
233
|
+
</Button>
|
|
234
|
+
<Button variant="secondary" onClick={() => setIsOpen(false)}>
|
|
235
|
+
Cancel
|
|
236
|
+
</Button>
|
|
237
|
+
</div>
|
|
238
|
+
</Modal>
|
|
239
|
+
</>
|
|
175
240
|
);
|
|
176
241
|
}
|
|
177
242
|
```
|
|
178
243
|
|
|
179
|
-
|
|
180
|
-
If you don't wrap your app in a ThemeProvider, components will automatically use the default theme.
|
|
244
|
+
## 🛠️ Development
|
|
181
245
|
|
|
182
|
-
###
|
|
246
|
+
### Running the Demo
|
|
183
247
|
|
|
184
|
-
|
|
248
|
+
```bash
|
|
249
|
+
# Clone the repository
|
|
250
|
+
git clone https://github.com/marcoschwartz/lite-ui.git
|
|
251
|
+
cd lite-ui-js
|
|
185
252
|
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
name: 'custom',
|
|
192
|
-
button: {
|
|
193
|
-
...themes.default.button,
|
|
194
|
-
variants: {
|
|
195
|
-
...themes.default.button.variants,
|
|
196
|
-
primary: 'bg-purple-600 hover:bg-purple-700 text-white',
|
|
197
|
-
},
|
|
198
|
-
},
|
|
199
|
-
};
|
|
253
|
+
# Install dependencies
|
|
254
|
+
npm install
|
|
255
|
+
|
|
256
|
+
# Run library + demo app in watch mode
|
|
257
|
+
npm run dev:all
|
|
200
258
|
```
|
|
201
259
|
|
|
202
|
-
|
|
260
|
+
This will:
|
|
261
|
+
1. Start the library build in watch mode (auto-rebuilds on changes)
|
|
262
|
+
2. Start the Next.js demo app on http://localhost:3000
|
|
263
|
+
3. Hot-reload changes from the library in the demo app
|
|
264
|
+
|
|
265
|
+
### Building
|
|
266
|
+
|
|
267
|
+
```bash
|
|
268
|
+
# Build library
|
|
269
|
+
npm run build
|
|
270
|
+
|
|
271
|
+
# Build CSS only
|
|
272
|
+
npm run build:css
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
## 📂 Project Structure
|
|
276
|
+
|
|
277
|
+
```
|
|
278
|
+
lite-ui-js/
|
|
279
|
+
├── src/ # Library source code
|
|
280
|
+
│ ├── components/ # React components
|
|
281
|
+
│ ├── theme/ # Theme system
|
|
282
|
+
│ ├── icons/ # Icon components
|
|
283
|
+
│ └── index.ts # Main exports
|
|
284
|
+
├── demo/ # Demo Next.js app
|
|
285
|
+
│ └── app/
|
|
286
|
+
│ ├── components/ # Component examples
|
|
287
|
+
│ └── page.tsx # Home page
|
|
288
|
+
├── dist/ # Built library (generated)
|
|
289
|
+
└── package.json
|
|
290
|
+
```
|
|
291
|
+
|
|
292
|
+
## 🤝 Contributing
|
|
293
|
+
|
|
294
|
+
Contributions are welcome! Please feel free to submit a Pull Request.
|
|
295
|
+
|
|
296
|
+
## 📄 License
|
|
297
|
+
|
|
298
|
+
MIT © Marco Schwartz
|
|
299
|
+
|
|
300
|
+
## 🔗 Links
|
|
301
|
+
|
|
302
|
+
- [NPM Package](https://www.npmjs.com/package/@marcoschwartz/lite-ui)
|
|
303
|
+
- [GitHub Repository](https://github.com/marcoschwartz/lite-ui)
|
|
304
|
+
- [Component Documentation](./COMPONENTS.md)
|
|
305
|
+
|
|
306
|
+
## 💡 Technology Stack
|
|
203
307
|
|
|
204
308
|
- **React 19** - UI framework
|
|
205
|
-
- **TypeScript** - Type safety
|
|
206
|
-
- **Tailwind CSS v4** -
|
|
207
|
-
- **tsup** -
|
|
309
|
+
- **TypeScript 5** - Type safety
|
|
310
|
+
- **Tailwind CSS v4** - Utility-first styling
|
|
311
|
+
- **tsup** - TypeScript bundler
|
|
208
312
|
- **Next.js 15** - Demo app framework
|
package/dist/index.d.mts
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
|
-
|
|
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 };
|