gd-ui-library 1.0.21 → 1.0.22

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 ADDED
@@ -0,0 +1,427 @@
1
+ # gd-ui-library
2
+
3
+ > A comprehensive, production-ready React component library built natively — no external UI frameworks required. Fully typed with TypeScript.
4
+
5
+ [![npm version](https://img.shields.io/npm/v/gd-ui-library.svg)](https://www.npmjs.com/package/gd-ui-library)
6
+ [![License: ISC](https://img.shields.io/badge/License-ISC-blue.svg)](https://opensource.org/licenses/ISC)
7
+
8
+ ---
9
+
10
+ ## ✨ Features
11
+
12
+ - **70+ components** covering every UI need
13
+ - **Fully typed** with TypeScript
14
+ - **Zero external UI dependency** — built from scratch
15
+ - **Tailwind CSS** powered styling
16
+ - **Accessible** — proper ARIA roles throughout
17
+ - **Responsive** — mobile-first design
18
+ - Works with **React 18+** / **Next.js** (App Router)
19
+
20
+ ---
21
+
22
+ ## 📦 Installation
23
+
24
+ ```bash
25
+ npm install gd-ui-library
26
+ # or
27
+ yarn add gd-ui-library
28
+ # or
29
+ pnpm add gd-ui-library
30
+ ```
31
+
32
+ ### Import CSS
33
+
34
+ Add this **once** to your root layout or `_app.tsx`:
35
+
36
+ ```ts
37
+ import 'gd-ui-library/dist/index.css';
38
+ ```
39
+
40
+ ---
41
+
42
+ ## 🚀 Quick Start
43
+
44
+ ```tsx
45
+ "use client"; // Required in Next.js App Router
46
+
47
+ import { Button, Input, Alert, toast, Toaster } from "gd-ui-library";
48
+ import "gd-ui-library/dist/index.css";
49
+
50
+ export default function Page() {
51
+ return (
52
+ <div className="p-6 space-y-4">
53
+ {/* Mount Toaster once in your layout */}
54
+ <Toaster />
55
+
56
+ <Alert variant="info" title="Welcome!" description="gd-ui-library is ready to use." />
57
+
58
+ <Input label="Email" placeholder="you@example.com" />
59
+
60
+ <Button variant="filled" onClick={() => toast.success("Hello!")}>
61
+ Click me
62
+ </Button>
63
+ </div>
64
+ );
65
+ }
66
+ ```
67
+
68
+ > **Next.js App Router note:** Because many components use React hooks and browser APIs, add `"use client"` at the top of any file that imports from `gd-ui-library`.
69
+
70
+ ---
71
+
72
+ ## 🧩 Component Categories
73
+
74
+ ### 📝 Forms & Inputs
75
+
76
+ | Component | Description |
77
+ |-----------|-------------|
78
+ | `Input` | Text input with label, icons, error, and description |
79
+ | `Textarea` | Multi-line input |
80
+ | `Select` | Custom dropdown — single/multi, searchable |
81
+ | `Checkbox` | Styled checkbox with label |
82
+ | `Radio` | Radio button |
83
+ | `Toggle` | On/off switch |
84
+ | `Slider` | Range slider |
85
+ | `ColorPicker` | Inline color picker |
86
+ | `Rating` | Star rating |
87
+ | `OTPInput` | One-time password digit boxes |
88
+ | `FileUpload` | Drag-and-drop file upload |
89
+ | `DatePicker` | Calendar date picker |
90
+ | `TimePicker` | Time selection |
91
+ | `InputGroup` | Input with prefix/suffix |
92
+ | `DebouncedInput` | Input with debounce delay |
93
+ | `AutoComplete` | Searchable dropdown, single or multi-select |
94
+ | `FormBuilder` | Generate full forms from JSON |
95
+ | `ProductFilter` | Sidebar filter panel with groups |
96
+
97
+ ### 🖼️ Display
98
+
99
+ | Component | Description |
100
+ |-----------|-------------|
101
+ | `Button` | Button with variants, sizes, icons |
102
+ | `Badge` | Small status label |
103
+ | `Chip` | Removable tag with icon/avatar |
104
+ | `Avatar` | Image or initials avatar with status dot |
105
+ | `Card` + sub-components | Content container (`CardHeader`, `CardTitle`, `CardDescription`, `CardContent`, `CardFooter`) |
106
+ | `List` / `ListItem` | Semantic list |
107
+ | `EmptyState` | Placeholder for empty content areas |
108
+ | `Tooltip` | Hover label |
109
+ | `Statistic` | Animated number display |
110
+ | `ProgressBar` | Horizontal progress indicator |
111
+ | `Skeleton` | Loading placeholder |
112
+
113
+ ### 🔔 Feedback & Status
114
+
115
+ | Component | Description |
116
+ |-----------|-------------|
117
+ | `Alert` | Inline notification banner |
118
+ | `toast` / `Toaster` | Imperative toast notifications |
119
+ | `Spinner` | Loading spinner |
120
+ | `Banner` | Full-width announcement bar |
121
+ | `StatusIndicator` | Colored dot with optional ping |
122
+
123
+ ### 🧭 Navigation & Menus
124
+
125
+ | Component | Description |
126
+ |-----------|-------------|
127
+ | `Navbar` | Responsive top navigation bar |
128
+ | `Sidebar` | Collapsible side navigation with nested items |
129
+ | `Breadcrumb` | Page hierarchy trail |
130
+ | `Pagination` | Page navigation with ellipsis |
131
+ | `Stepper` | Multi-step progress indicator |
132
+ | `Dropdown` | Standard / context / mega menu |
133
+
134
+ ### 🔲 Overlays
135
+
136
+ | Component | Description |
137
+ |-----------|-------------|
138
+ | `Dialog` | Modal with overlay |
139
+ | `Drawer` | Slide-in panel (any direction) |
140
+ | `Popover` | Anchored floating panel |
141
+
142
+ ### 🎛️ Interactive
143
+
144
+ | Component | Description |
145
+ |-----------|-------------|
146
+ | `Accordion` | Collapsible sections |
147
+ | `Tabs` | Tabbed panels (solid/underline variants) |
148
+ | `Carousel` | Slide show with controls and auto-play |
149
+ | `Timeline` | Dated event list |
150
+ | `TreeView` | Collapsible file/folder tree |
151
+
152
+ ### 📐 Layout
153
+
154
+ | Component | Description |
155
+ |-----------|-------------|
156
+ | `Grid` | Responsive CSS grid (1–12 columns) |
157
+ | `Stack` | FlexBox layout primitive |
158
+ | `SplitPane` | Resizable two-panel layout |
159
+ | `MasonryGrid` | Pinterest-style masonry columns |
160
+ | `Container` | Centered max-width wrapper |
161
+ | `Section` | Semantic `<section>` with padding |
162
+ | `Hero` | Large hero banner area |
163
+ | `Footer` | Semantic `<footer>` |
164
+
165
+ ### ⚙️ Utilities & Behaviors
166
+
167
+ | Component | Description |
168
+ |-----------|-------------|
169
+ | `Portal` | Render children into `document.body` |
170
+ | `Transition` | Mount/unmount CSS animations |
171
+ | `ClickAwayListener` | Callback on outside click |
172
+ | `VirtualScroll` | Virtualized list for 100K+ items |
173
+ | `InfiniteScroll` | Load more on scroll |
174
+ | `LazyLoad` | Defer rendering until in viewport |
175
+
176
+ ### 📊 Advanced Widgets
177
+
178
+ | Component | Description |
179
+ |-----------|-------------|
180
+ | `Table` | Sortable, searchable, exportable data table |
181
+ | `Chart` | SVG bar / line / pie / donut charts |
182
+ | `Calendar` | Date-picker calendar |
183
+ | `CalendarWithEvents` | Calendar with event markers |
184
+ | `GanttChart` | Project timeline chart |
185
+ | `Kanban` | Drag-and-drop Kanban board |
186
+ | `ShoppingCart` | Cart UI with quantity controls and checkout |
187
+ | `RichTextEditor` | WYSIWYG editor |
188
+ | `CodeEditor` | Syntax-highlighted code editor |
189
+ | `FileManager` | File browser with folder navigation |
190
+ | `EmailComposer` | Email compose UI |
191
+
192
+ ---
193
+
194
+ ## 📖 Usage Examples
195
+
196
+ ### Input
197
+
198
+ ```tsx
199
+ import { Input } from "gd-ui-library";
200
+ import { Search } from "lucide-react";
201
+
202
+ <Input
203
+ label="Search"
204
+ placeholder="Type to search..."
205
+ leftIcon={<Search className="w-4 h-4" />}
206
+ description="Press Enter to search"
207
+ />
208
+
209
+ <Input
210
+ label="Password"
211
+ type="password"
212
+ error="Must be at least 8 characters"
213
+ />
214
+ ```
215
+
216
+ ### Select
217
+
218
+ ```tsx
219
+ import { Select } from "gd-ui-library";
220
+
221
+ const [role, setRole] = useState("");
222
+
223
+ <Select
224
+ label="Role"
225
+ value={role}
226
+ onChange={setRole}
227
+ searchable
228
+ options={[
229
+ { label: "Admin", value: "admin" },
230
+ { label: "Editor", value: "editor" },
231
+ { label: "User", value: "user" },
232
+ ]}
233
+ />
234
+ ```
235
+
236
+ ### Table
237
+
238
+ ```tsx
239
+ import { Table } from "gd-ui-library";
240
+
241
+ interface User { id: number; name: string; email: string; }
242
+
243
+ <Table<User>
244
+ data={users}
245
+ columns={[
246
+ { key: "name", header: "Name", sortable: true, searchable: true },
247
+ { key: "email", header: "Email", sortable: true },
248
+ ]}
249
+ onEdit={(u) => handleEdit(u)}
250
+ onDelete={(u) => handleDelete(u)}
251
+ exportFileName="users"
252
+ />
253
+ ```
254
+
255
+ ### Toast
256
+
257
+ ```tsx
258
+ import { toast, Toaster } from "gd-ui-library";
259
+
260
+ // 1. Mount once in your root layout
261
+ <Toaster />
262
+
263
+ // 2. Call anywhere
264
+ toast.success("Saved!");
265
+ toast.error("Something went wrong.");
266
+ toast.warning("Please review your input.");
267
+ toast.info("New update available.");
268
+ toast({ title: "Custom", description: "With description", variant: "info", duration: 5000 });
269
+ ```
270
+
271
+ ### Kanban
272
+
273
+ ```tsx
274
+ import { Kanban } from "gd-ui-library";
275
+
276
+ const columns = [
277
+ { id: "todo", title: "To Do" },
278
+ { id: "wip", title: "In Progress" },
279
+ { id: "done", title: "Done" },
280
+ ];
281
+
282
+ const [items, setItems] = useState([
283
+ { id: "1", title: "Design UI", columnId: "todo" },
284
+ { id: "2", title: "Build API", columnId: "wip" },
285
+ { id: "3", title: "Write tests", columnId: "done" },
286
+ ]);
287
+
288
+ <Kanban columns={columns} items={items} onChange={setItems} />
289
+ ```
290
+
291
+ ### Chart
292
+
293
+ ```tsx
294
+ import { Chart } from "gd-ui-library";
295
+
296
+ <Chart
297
+ type="bar"
298
+ labels={["Jan", "Feb", "Mar", "Apr", "May"]}
299
+ datasets={[
300
+ { label: "Revenue", data: [4000, 5500, 4800, 7200, 6100], color: "#3B82F6" },
301
+ { label: "Expenses", data: [2800, 3200, 3100, 4000, 3800], color: "#F59E0B" },
302
+ ]}
303
+ height={300}
304
+ />
305
+ ```
306
+
307
+ ### Dialog
308
+
309
+ ```tsx
310
+ import { Dialog, Button } from "gd-ui-library";
311
+
312
+ const [open, setOpen] = useState(false);
313
+
314
+ <Button onClick={() => setOpen(true)}>Open</Button>
315
+
316
+ <Dialog
317
+ open={open}
318
+ onOpenChange={setOpen}
319
+ title="Confirm Delete"
320
+ description="This action cannot be undone."
321
+ footer={
322
+ <>
323
+ <Button onClick={() => setOpen(false)}>Cancel</Button>
324
+ <Button variant="filled" onClick={handleDelete}>Delete</Button>
325
+ </>
326
+ }
327
+ >
328
+ <p>Are you sure?</p>
329
+ </Dialog>
330
+ ```
331
+
332
+ ---
333
+
334
+ ## 🗂️ Complete Import Reference
335
+
336
+ ```tsx
337
+ import {
338
+ cn,
339
+
340
+ // Forms
341
+ Input, Textarea, Select, Checkbox, Radio, Toggle, Slider, ColorPicker,
342
+ Rating, OTPInput, FileUpload, DatePicker, TimePicker, InputGroup,
343
+ DebouncedInput, AutoComplete, FormBuilder, ProductFilter,
344
+
345
+ // Button & Table
346
+ Button, Table,
347
+
348
+ // Display
349
+ Card, CardHeader, CardTitle, CardDescription, CardContent, CardFooter,
350
+ List, ListItem, Avatar, Badge, Chip, EmptyState, Tooltip,
351
+ Statistic, ProgressBar, Skeleton,
352
+
353
+ // Overlays
354
+ Popover, Dialog, Drawer,
355
+
356
+ // Feedback
357
+ Alert, toast, Toaster, Spinner, Banner, StatusIndicator,
358
+
359
+ // Navigation
360
+ Navbar, Sidebar, Breadcrumb, Pagination, Stepper, Dropdown,
361
+
362
+ // Interactive
363
+ Accordion, Tabs, Carousel, Timeline, TreeView, Calendar, Kanban,
364
+
365
+ // Layout
366
+ Grid, Stack, SplitPane, MasonryGrid, Container, Section, Hero, Footer,
367
+
368
+ // Utilities
369
+ Portal, Transition, ClickAwayListener, VirtualScroll, InfiniteScroll, LazyLoad,
370
+
371
+ // Widgets
372
+ Chart, ShoppingCart, RichTextEditor, CodeEditor,
373
+ FileManager, EmailComposer, CalendarWithEvents, GanttChart,
374
+ } from "gd-ui-library";
375
+
376
+ import "gd-ui-library/dist/index.css";
377
+ ```
378
+
379
+ ---
380
+
381
+ ## 🛠️ Development
382
+
383
+ ```bash
384
+ # Clone the repo
385
+ git clone <repo-url>
386
+ cd gd-ui-library
387
+
388
+ # Install dependencies
389
+ npm install
390
+
391
+ # Build the library
392
+ npm run build
393
+ ```
394
+
395
+ ### Output
396
+
397
+ | File | Format |
398
+ |------|--------|
399
+ | `dist/index.js` | CommonJS |
400
+ | `dist/index.mjs` | ES Module |
401
+ | `dist/index.d.ts` | TypeScript types |
402
+ | `dist/index.css` | Compiled styles |
403
+
404
+ ---
405
+
406
+ ## 📋 Peer Dependencies
407
+
408
+ | Package | Version |
409
+ |---------|---------|
410
+ | `react` | `^18.0.0` or `^19.0.0` |
411
+ | `react-dom` | `^18.0.0` or `^19.0.0` |
412
+
413
+ ---
414
+
415
+ ## 🗒️ Changelog
416
+
417
+ ### v1.0.21
418
+ - Added `GanttChart`, `EmailComposer`, `FileManager`
419
+ - Added layout components: `Grid`, `Stack`, `SplitPane`, `MasonryGrid`, `Container`, `Section`, `Hero`, `Footer`
420
+ - Added utilities: `Portal`, `Transition`, `ClickAwayListener`, `VirtualScroll`, `InfiniteScroll`, `LazyLoad`
421
+ - Full TypeScript types for all new components
422
+
423
+ ---
424
+
425
+ ## 📄 License
426
+
427
+ ISC © gd-ui-library
package/dist/index.css CHANGED
@@ -1374,6 +1374,9 @@ video {
1374
1374
  --tw-border-opacity: 1;
1375
1375
  border-top-color: rgb(75 85 99 / var(--tw-border-opacity, 1));
1376
1376
  }
1377
+ .border-t-transparent {
1378
+ border-top-color: transparent;
1379
+ }
1377
1380
  .border-t-white {
1378
1381
  --tw-border-opacity: 1;
1379
1382
  border-top-color: rgb(255 255 255 / var(--tw-border-opacity, 1));
@@ -1640,6 +1643,9 @@ video {
1640
1643
  .pb-8 {
1641
1644
  padding-bottom: 2rem;
1642
1645
  }
1646
+ .pl-0\.5 {
1647
+ padding-left: 0.125rem;
1648
+ }
1643
1649
  .pl-1 {
1644
1650
  padding-left: 0.25rem;
1645
1651
  }
@@ -1956,6 +1962,9 @@ video {
1956
1962
  .opacity-50 {
1957
1963
  opacity: 0.5;
1958
1964
  }
1965
+ .opacity-60 {
1966
+ opacity: 0.6;
1967
+ }
1959
1968
  .opacity-70 {
1960
1969
  opacity: 0.7;
1961
1970
  }
@@ -2190,6 +2199,10 @@ video {
2190
2199
  --tw-border-opacity: 1;
2191
2200
  border-color: rgb(209 213 219 / var(--tw-border-opacity, 1));
2192
2201
  }
2202
+ .hover\:border-gray-400:hover {
2203
+ --tw-border-opacity: 1;
2204
+ border-color: rgb(156 163 175 / var(--tw-border-opacity, 1));
2205
+ }
2193
2206
  .hover\:bg-black\/10:hover {
2194
2207
  background-color: rgb(0 0 0 / 0.1);
2195
2208
  }