@agenticindiedev/ui 0.1.0 → 0.2.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 +183 -13
- package/dist/index.cjs +53 -1
- package/dist/index.d.ts +319 -6
- package/dist/index.js +10512 -810
- package/dist/styles.css +701 -118
- package/package.json +30 -7
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
#
|
|
1
|
+
# AgenticIndieDevUI
|
|
2
2
|
|
|
3
|
-
A modern React component library built with TypeScript, Tailwind CSS v4, and
|
|
3
|
+
A modern React component library built with TypeScript, Tailwind CSS v4, Radix UI, and shadcn/ui patterns.
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
@@ -65,22 +65,155 @@ function App() {
|
|
|
65
65
|
}
|
|
66
66
|
```
|
|
67
67
|
|
|
68
|
+
## Customization
|
|
69
|
+
|
|
70
|
+
All components accept a `className` prop that merges seamlessly with existing styles, allowing you to customize components easily:
|
|
71
|
+
|
|
72
|
+
```tsx
|
|
73
|
+
<Button
|
|
74
|
+
variant="primary"
|
|
75
|
+
className="bg-gradient-to-r from-purple-500 to-pink-500 shadow-lg hover:scale-105"
|
|
76
|
+
>
|
|
77
|
+
Custom Styled Button
|
|
78
|
+
</Button>
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### Theming
|
|
82
|
+
|
|
83
|
+
The package uses CSS variables for theming. You can customize colors by overriding CSS variables:
|
|
84
|
+
|
|
85
|
+
```css
|
|
86
|
+
:root {
|
|
87
|
+
--primary: 199.1 89.1% 48.2%;
|
|
88
|
+
--primary-foreground: 210 40% 98%;
|
|
89
|
+
/* ... */
|
|
90
|
+
}
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
Dark mode is supported via the `dark` class on your HTML element.
|
|
94
|
+
|
|
68
95
|
## Components
|
|
69
96
|
|
|
70
97
|
### Primitives
|
|
71
98
|
|
|
99
|
+
- **Avatar** - User avatar with image and fallback
|
|
72
100
|
- **Badge** - Status indicators and labels
|
|
73
|
-
- **Button** - Interactive buttons with variants
|
|
101
|
+
- **Button** - Interactive buttons with variants and asChild support
|
|
74
102
|
- **Card** - Container component with header, content, and footer
|
|
75
|
-
- **Checkbox** -
|
|
76
|
-
- **Input** - Text input fields
|
|
77
|
-
- **
|
|
103
|
+
- **Checkbox** - Accessible checkbox with Radix UI
|
|
104
|
+
- **Input** - Text input fields with icon support
|
|
105
|
+
- **Label** - Form labels
|
|
106
|
+
- **Progress** - Progress indicator
|
|
107
|
+
- **RadioGroup** - Radio button groups
|
|
108
|
+
- **Select** - Accessible dropdown select with Radix UI
|
|
109
|
+
- **Separator** - Visual separator
|
|
110
|
+
- **Skeleton** - Loading placeholder
|
|
111
|
+
- **Slider** - Range slider input
|
|
112
|
+
- **Switch** - Toggle switch
|
|
113
|
+
- **Textarea** - Multi-line text input
|
|
114
|
+
|
|
115
|
+
### Composites
|
|
116
|
+
|
|
117
|
+
- **Alert** - Alert messages with variants
|
|
118
|
+
- **Dialog** - Modal dialogs
|
|
119
|
+
- **DropdownMenu** - Dropdown menus with submenus
|
|
120
|
+
- **Popover** - Popover overlays
|
|
121
|
+
- **Table** - Table components (Header, Body, Row, Cell, etc.)
|
|
122
|
+
- **Tabs** - Tab navigation
|
|
123
|
+
- **Tooltip** - Tooltip overlays
|
|
124
|
+
|
|
125
|
+
### Patterns
|
|
126
|
+
|
|
127
|
+
- **DataTable** - Advanced data table with sorting, filtering, pagination, and action buttons
|
|
128
|
+
|
|
129
|
+
## DataTable Usage
|
|
130
|
+
|
|
131
|
+
The DataTable component accepts arrays for columns and rows, making it easy to display dynamic data with action buttons:
|
|
132
|
+
|
|
133
|
+
```tsx
|
|
134
|
+
import { DataTable } from '@agenticindiedev/ui';
|
|
135
|
+
import { DropdownMenu, DropdownMenuItem } from '@agenticindiedev/ui';
|
|
136
|
+
import type { ColumnDef } from '@tanstack/react-table';
|
|
137
|
+
|
|
138
|
+
interface User {
|
|
139
|
+
id: string;
|
|
140
|
+
name: string;
|
|
141
|
+
email: string;
|
|
142
|
+
role: string;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
const columns: ColumnDef<User>[] = [
|
|
146
|
+
{
|
|
147
|
+
accessorKey: 'name',
|
|
148
|
+
header: 'Name',
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
accessorKey: 'email',
|
|
152
|
+
header: 'Email',
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
accessorKey: 'role',
|
|
156
|
+
header: 'Role',
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
id: 'actions',
|
|
160
|
+
cell: ({ row }) => {
|
|
161
|
+
const user = row.original;
|
|
162
|
+
return (
|
|
163
|
+
<DropdownMenu>
|
|
164
|
+
<DropdownMenuTrigger asChild>
|
|
165
|
+
<Button variant="ghost">Actions</Button>
|
|
166
|
+
</DropdownMenuTrigger>
|
|
167
|
+
<DropdownMenuContent>
|
|
168
|
+
<DropdownMenuItem onClick={() => editUser(user.id)}>
|
|
169
|
+
Edit
|
|
170
|
+
</DropdownMenuItem>
|
|
171
|
+
<DropdownMenuItem onClick={() => deleteUser(user.id)}>
|
|
172
|
+
Delete
|
|
173
|
+
</DropdownMenuItem>
|
|
174
|
+
</DropdownMenuContent>
|
|
175
|
+
</DropdownMenu>
|
|
176
|
+
);
|
|
177
|
+
},
|
|
178
|
+
},
|
|
179
|
+
];
|
|
180
|
+
|
|
181
|
+
const users: User[] = [
|
|
182
|
+
{ id: '1', name: 'John Doe', email: 'john@example.com', role: 'Admin' },
|
|
183
|
+
{ id: '2', name: 'Jane Smith', email: 'jane@example.com', role: 'User' },
|
|
184
|
+
];
|
|
185
|
+
|
|
186
|
+
function UsersTable() {
|
|
187
|
+
return (
|
|
188
|
+
<DataTable
|
|
189
|
+
columns={columns}
|
|
190
|
+
data={users}
|
|
191
|
+
searchable
|
|
192
|
+
searchPlaceholder="Search users..."
|
|
193
|
+
pagination
|
|
194
|
+
/>
|
|
195
|
+
);
|
|
196
|
+
}
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
The DataTable supports:
|
|
200
|
+
|
|
201
|
+
- **Array-based columns**: Define columns as an array of `ColumnDef` objects
|
|
202
|
+
- **Array-based data**: Pass your data as an array
|
|
203
|
+
- **Action buttons**: Add action columns with custom cell renderers
|
|
204
|
+
- **Search**: Built-in global search functionality
|
|
205
|
+
- **Sorting**: Click column headers to sort
|
|
206
|
+
- **Pagination**: Automatic pagination controls
|
|
207
|
+
- **TypeScript**: Full type safety with generics
|
|
78
208
|
|
|
79
209
|
## Tech Stack
|
|
80
210
|
|
|
81
211
|
- **React 19** - UI framework
|
|
82
212
|
- **TypeScript 5.9** - Type safety
|
|
83
213
|
- **Tailwind CSS 4** - Utility-first CSS
|
|
214
|
+
- **Radix UI** - Accessible component primitives
|
|
215
|
+
- **TanStack Table** - Powerful table functionality
|
|
216
|
+
- **class-variance-authority** - Variant management
|
|
84
217
|
- **Vite 7** - Build tool
|
|
85
218
|
- **Storybook 10** - Component development
|
|
86
219
|
- **Bun** - Package manager and runtime
|
|
@@ -90,13 +223,32 @@ function App() {
|
|
|
90
223
|
```
|
|
91
224
|
src/
|
|
92
225
|
├── components/
|
|
93
|
-
│
|
|
94
|
-
│
|
|
95
|
-
│
|
|
96
|
-
│
|
|
97
|
-
│
|
|
98
|
-
│
|
|
99
|
-
│
|
|
226
|
+
│ ├── primitives/ # Base UI components
|
|
227
|
+
│ │ ├── Avatar/
|
|
228
|
+
│ │ ├── Badge/
|
|
229
|
+
│ │ ├── Button/
|
|
230
|
+
│ │ ├── Card/
|
|
231
|
+
│ │ ├── Checkbox/
|
|
232
|
+
│ │ ├── Input/
|
|
233
|
+
│ │ ├── Label/
|
|
234
|
+
│ │ ├── Progress/
|
|
235
|
+
│ │ ├── RadioGroup/
|
|
236
|
+
│ │ ├── Select/
|
|
237
|
+
│ │ ├── Separator/
|
|
238
|
+
│ │ ├── Skeleton/
|
|
239
|
+
│ │ ├── Slider/
|
|
240
|
+
│ │ ├── Switch/
|
|
241
|
+
│ │ └── Textarea/
|
|
242
|
+
│ ├── composites/ # Composed components
|
|
243
|
+
│ │ ├── Alert/
|
|
244
|
+
│ │ ├── Dialog/
|
|
245
|
+
│ │ ├── DropdownMenu/
|
|
246
|
+
│ │ ├── Popover/
|
|
247
|
+
│ │ ├── Table/
|
|
248
|
+
│ │ ├── Tabs/
|
|
249
|
+
│ │ └── Tooltip/
|
|
250
|
+
│ └── patterns/ # Complex patterns
|
|
251
|
+
│ └── DataTable/
|
|
100
252
|
├── styles/
|
|
101
253
|
│ └── globals.css # Tailwind CSS entry point
|
|
102
254
|
├── utils/
|
|
@@ -104,6 +256,24 @@ src/
|
|
|
104
256
|
└── index.ts # Public exports
|
|
105
257
|
```
|
|
106
258
|
|
|
259
|
+
## Migration from DaisyUI
|
|
260
|
+
|
|
261
|
+
If you were using DaisyUI, note that this package has migrated to shadcn/ui patterns with Radix UI primitives. The API remains similar, but components now use Radix UI for better accessibility and TypeScript support.
|
|
262
|
+
|
|
263
|
+
### Breaking Changes
|
|
264
|
+
|
|
265
|
+
- DaisyUI classes are no longer available
|
|
266
|
+
- Components now use CSS variables for theming instead of DaisyUI themes
|
|
267
|
+
- Some component APIs have been updated to match shadcn/ui patterns
|
|
268
|
+
|
|
269
|
+
### Benefits
|
|
270
|
+
|
|
271
|
+
- ✅ Better accessibility (Radix UI primitives)
|
|
272
|
+
- ✅ Full TypeScript support
|
|
273
|
+
- ✅ More customization options
|
|
274
|
+
- ✅ Better performance
|
|
275
|
+
- ✅ Active maintenance and updates
|
|
276
|
+
|
|
107
277
|
## License
|
|
108
278
|
|
|
109
279
|
MIT
|