glintly-ui 1.0.0 → 1.0.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 +679 -57
- package/dist/glintly-ui.cjs +616 -504
- package/dist/glintly-ui.d.ts +16 -0
- package/dist/glintly-ui.js +3601 -3398
- package/dist/glintly-ui.umd.cjs +598 -486
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,93 +1,715 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Glintly UI Library
|
|
2
|
+
|
|
3
|
+
[](https://badge.fury.io/js/glintly-ui)
|
|
4
|
+
[](https://opensource.org/licenses/MIT)
|
|
5
|
+
[](https://www.typescriptlang.org/)
|
|
6
|
+
[](https://reactjs.org/)
|
|
7
|
+
[](https://styled-components.com/)
|
|
8
|
+
|
|
9
|
+
A modern, accessible, and customizable React UI component library built with TypeScript and styled-components. Glintly UI provides a comprehensive set of components designed for building beautiful, responsive web applications with a consistent design system.
|
|
10
|
+
|
|
11
|
+
## ✨ Features
|
|
12
|
+
|
|
13
|
+
- **🎨 Modern Design System**: Built with a comprehensive theme system supporting light/dark modes
|
|
14
|
+
- **🔧 TypeScript First**: Full TypeScript support with excellent type definitions
|
|
15
|
+
- **🎭 Styled Components**: Built with styled-components for flexible styling
|
|
16
|
+
- **📱 Responsive**: Mobile-first design approach with responsive breakpoints
|
|
17
|
+
- **♿ Accessible**: WCAG compliant components with proper ARIA attributes
|
|
18
|
+
- **🎯 Customizable**: Extensive theming and customization options
|
|
19
|
+
- **📦 Tree Shakeable**: Optimized bundle size with tree shaking support
|
|
20
|
+
- **🚀 Performance**: Optimized components with minimal re-renders
|
|
21
|
+
|
|
22
|
+
## 🚀 Installation
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
npm install glintly-ui
|
|
26
|
+
# or
|
|
27
|
+
yarn add glintly-ui
|
|
28
|
+
# or
|
|
29
|
+
pnpm add glintly-ui
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## 📦 Peer Dependencies
|
|
33
|
+
|
|
34
|
+
```json
|
|
35
|
+
{
|
|
36
|
+
"react": ">=18.0.0",
|
|
37
|
+
"react-dom": ">=18.0.0"
|
|
38
|
+
}
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## 🎯 Quick Start
|
|
42
|
+
|
|
43
|
+
```tsx
|
|
44
|
+
import React from 'react';
|
|
45
|
+
import { ThemeProvider, Button, Input, Card } from 'glintly-ui';
|
|
46
|
+
|
|
47
|
+
function App() {
|
|
48
|
+
return (
|
|
49
|
+
<ThemeProvider>
|
|
50
|
+
<div>
|
|
51
|
+
<Card>
|
|
52
|
+
<h2>Welcome to Glintly UI</h2>
|
|
53
|
+
<Input placeholder="Enter your name" />
|
|
54
|
+
<Button variant="primary">Get Started</Button>
|
|
55
|
+
</Card>
|
|
56
|
+
</div>
|
|
57
|
+
</ThemeProvider>
|
|
58
|
+
);
|
|
59
|
+
}
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## 🎨 Theme System
|
|
63
|
+
|
|
64
|
+
Glintly UI comes with a powerful theme system that allows you to customize colors, typography, spacing, and more.
|
|
65
|
+
|
|
66
|
+
```tsx
|
|
67
|
+
import { ThemeProvider, useTheme } from 'glintly-ui';
|
|
68
|
+
|
|
69
|
+
const customTheme = {
|
|
70
|
+
colors: {
|
|
71
|
+
primary: {
|
|
72
|
+
500: '#6366f1',
|
|
73
|
+
600: '#4f46e5',
|
|
74
|
+
},
|
|
75
|
+
// ... more custom colors
|
|
76
|
+
},
|
|
77
|
+
typography: {
|
|
78
|
+
fontFamily: '"Inter", sans-serif',
|
|
79
|
+
},
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
function App() {
|
|
83
|
+
return (
|
|
84
|
+
<ThemeProvider theme={customTheme}>
|
|
85
|
+
<YourApp />
|
|
86
|
+
</ThemeProvider>
|
|
87
|
+
);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
function ThemedComponent() {
|
|
91
|
+
const { theme, mode, toggleMode } = useTheme();
|
|
92
|
+
|
|
93
|
+
return (
|
|
94
|
+
<div>
|
|
95
|
+
<button onClick={toggleMode}>
|
|
96
|
+
Current mode: {mode}
|
|
97
|
+
</button>
|
|
98
|
+
</div>
|
|
99
|
+
);
|
|
100
|
+
}
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
## 🧩 Components
|
|
104
|
+
|
|
105
|
+
### 🎯 Core Components
|
|
106
|
+
|
|
107
|
+
#### Button
|
|
108
|
+
Versatile button component with multiple variants, sizes, and states.
|
|
109
|
+
|
|
110
|
+
```tsx
|
|
111
|
+
import { Button } from 'glintly-ui';
|
|
112
|
+
|
|
113
|
+
<Button variant="primary" size="lg" shade="500">
|
|
114
|
+
Click Me
|
|
115
|
+
</Button>
|
|
116
|
+
|
|
117
|
+
<Button variant="secondary" size="sm" disabled>
|
|
118
|
+
Disabled Button
|
|
119
|
+
</Button>
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
**Variants**: `primary`, `secondary`, `gray`, `transparent`
|
|
123
|
+
**Sizes**: `xs`, `sm`, `md`, `lg`, `xl`
|
|
124
|
+
**Shades**: `50`, `100`, `200`, `300`, `400`, `500`, `600`, `700`, `800`, `900`
|
|
125
|
+
|
|
126
|
+
#### Input
|
|
127
|
+
Comprehensive input components with validation and styling.
|
|
128
|
+
|
|
129
|
+
```tsx
|
|
130
|
+
import { Input } from 'glintly-ui';
|
|
131
|
+
|
|
132
|
+
<Input.TextInput
|
|
133
|
+
placeholder="Enter text"
|
|
134
|
+
size="md"
|
|
135
|
+
hasError={false}
|
|
136
|
+
/>
|
|
137
|
+
|
|
138
|
+
<Input.PasswordInput
|
|
139
|
+
placeholder="Enter password"
|
|
140
|
+
showToggle={true}
|
|
141
|
+
/>
|
|
142
|
+
|
|
143
|
+
<Input.SelectInput
|
|
144
|
+
options={[
|
|
145
|
+
{ value: '1', label: 'Option 1' },
|
|
146
|
+
{ value: '2', label: 'Option 2' }
|
|
147
|
+
]}
|
|
148
|
+
/>
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
**Types**: `TextInput`, `PasswordInput`, `SelectInput`, `CheckboxInput`, `RadioInput`, `DateInput`, `TimeInput`, `PhoneInput`, `FileInput`
|
|
152
|
+
**Sizes**: `xs`, `sm`, `md`, `lg`
|
|
153
|
+
|
|
154
|
+
#### Card
|
|
155
|
+
Flexible card component for content organization.
|
|
156
|
+
|
|
157
|
+
```tsx
|
|
158
|
+
import { Card } from 'glintly-ui';
|
|
159
|
+
|
|
160
|
+
<Card>
|
|
161
|
+
<h3>Card Title</h3>
|
|
162
|
+
<p>Card content goes here</p>
|
|
163
|
+
</Card>
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
### 📊 Data Display
|
|
167
|
+
|
|
168
|
+
#### DataTable
|
|
169
|
+
Advanced data table with sorting, pagination, and selection.
|
|
170
|
+
|
|
171
|
+
```tsx
|
|
172
|
+
import { DataTable } from 'glintly-ui';
|
|
173
|
+
|
|
174
|
+
const columns = [
|
|
175
|
+
{ key: 'name', label: 'Name', sortable: true },
|
|
176
|
+
{ key: 'email', label: 'Email' },
|
|
177
|
+
{ key: 'role', label: 'Role' }
|
|
178
|
+
];
|
|
179
|
+
|
|
180
|
+
const data = [
|
|
181
|
+
{ id: 1, name: 'John Doe', email: 'john@example.com', role: 'Admin' }
|
|
182
|
+
];
|
|
183
|
+
|
|
184
|
+
<DataTable
|
|
185
|
+
data={data}
|
|
186
|
+
columns={columns}
|
|
187
|
+
pagination={{
|
|
188
|
+
currentPage: 1,
|
|
189
|
+
totalPages: 10,
|
|
190
|
+
onPageChange: (page) => console.log(page)
|
|
191
|
+
}}
|
|
192
|
+
checkboxSelection={true}
|
|
193
|
+
/>
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
#### Table
|
|
197
|
+
Simple table component for basic data display.
|
|
198
|
+
|
|
199
|
+
```tsx
|
|
200
|
+
import { Table, TableHead, TableBody, TableRow, TableCell } from 'glintly-ui';
|
|
201
|
+
|
|
202
|
+
<Table>
|
|
203
|
+
<TableHead>
|
|
204
|
+
<TableRow>
|
|
205
|
+
<TableCell>Name</TableCell>
|
|
206
|
+
<TableCell>Email</TableCell>
|
|
207
|
+
</TableRow>
|
|
208
|
+
</TableHead>
|
|
209
|
+
<TableBody>
|
|
210
|
+
<TableRow>
|
|
211
|
+
<TableCell>John Doe</TableCell>
|
|
212
|
+
<TableCell>john@example.com</TableCell>
|
|
213
|
+
</TableRow>
|
|
214
|
+
</TableBody>
|
|
215
|
+
</Table>
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
### 🎨 Layout & Navigation
|
|
219
|
+
|
|
220
|
+
#### Grid
|
|
221
|
+
Flexbox-based grid system for responsive layouts.
|
|
222
|
+
|
|
223
|
+
```tsx
|
|
224
|
+
import { Row, Col } from 'glintly-ui';
|
|
225
|
+
|
|
226
|
+
<Row>
|
|
227
|
+
<Col xs={12} md={6} lg={4}>
|
|
228
|
+
<div>Column 1</div>
|
|
229
|
+
</Col>
|
|
230
|
+
<Col xs={12} md={6} lg={4}>
|
|
231
|
+
<div>Column 2</div>
|
|
232
|
+
</Col>
|
|
233
|
+
<Col xs={12} md={12} lg={4}>
|
|
234
|
+
<div>Column 3</div>
|
|
235
|
+
</Col>
|
|
236
|
+
</Row>
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
#### Navbar
|
|
240
|
+
Responsive navigation component.
|
|
241
|
+
|
|
242
|
+
```tsx
|
|
243
|
+
import { Navbar } from 'glintly-ui';
|
|
244
|
+
|
|
245
|
+
<Navbar>
|
|
246
|
+
<Navbar.Brand>Glintly UI</Navbar.Brand>
|
|
247
|
+
<Navbar.Nav>
|
|
248
|
+
<Navbar.NavItem>Home</Navbar.NavItem>
|
|
249
|
+
<Navbar.NavItem>About</Navbar.NavItem>
|
|
250
|
+
</Navbar.Nav>
|
|
251
|
+
</Navbar>
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
#### Container
|
|
255
|
+
Responsive container for content centering.
|
|
256
|
+
|
|
257
|
+
```tsx
|
|
258
|
+
import { Container } from 'glintly-ui';
|
|
259
|
+
|
|
260
|
+
<Container>
|
|
261
|
+
<h1>Centered Content</h1>
|
|
262
|
+
<p>This content is centered within the viewport</p>
|
|
263
|
+
</Container>
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
### 🔄 Interactive Components
|
|
267
|
+
|
|
268
|
+
#### Tabs
|
|
269
|
+
Tabbed interface component.
|
|
270
|
+
|
|
271
|
+
```tsx
|
|
272
|
+
import { Tabs } from 'glintly-ui';
|
|
273
|
+
|
|
274
|
+
<Tabs>
|
|
275
|
+
<Tabs.Tab label="Tab 1">Content for tab 1</Tabs.Tab>
|
|
276
|
+
<Tabs.Tab label="Tab 2">Content for tab 2</Tabs.Tab>
|
|
277
|
+
<Tabs.Tab label="Tab 3">Content for tab 3</Tabs.Tab>
|
|
278
|
+
</Tabs>
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
#### Accordion
|
|
282
|
+
Collapsible content sections.
|
|
283
|
+
|
|
284
|
+
```tsx
|
|
285
|
+
import { Accordion } from 'glintly-ui';
|
|
286
|
+
|
|
287
|
+
<Accordion>
|
|
288
|
+
<Accordion.Item>
|
|
289
|
+
<Accordion.Header>Section 1</Accordion.Header>
|
|
290
|
+
<Accordion.Body>Content for section 1</Accordion.Body>
|
|
291
|
+
</Accordion.Item>
|
|
292
|
+
<Accordion.Item>
|
|
293
|
+
<Accordion.Header>Section 2</Accordion.Header>
|
|
294
|
+
<Accordion.Body>Content for section 2</Accordion.Body>
|
|
295
|
+
</Accordion.Item>
|
|
296
|
+
</Accordion>
|
|
297
|
+
```
|
|
298
|
+
|
|
299
|
+
#### Stepper
|
|
300
|
+
Step-by-step process indicator.
|
|
301
|
+
|
|
302
|
+
```tsx
|
|
303
|
+
import { Stepper, Step, StepLabel, StepContent } from 'glintly-ui';
|
|
304
|
+
|
|
305
|
+
<Stepper activeStep={1}>
|
|
306
|
+
<Step>
|
|
307
|
+
<StepLabel>Step 1</StepLabel>
|
|
308
|
+
<StepContent>Complete step 1</StepContent>
|
|
309
|
+
</Step>
|
|
310
|
+
<Step>
|
|
311
|
+
<StepLabel>Step 2</StepLabel>
|
|
312
|
+
<StepContent>Complete step 2</StepContent>
|
|
313
|
+
</Step>
|
|
314
|
+
</Stepper>
|
|
315
|
+
```
|
|
316
|
+
|
|
317
|
+
#### Modal
|
|
318
|
+
Overlay dialog component.
|
|
319
|
+
|
|
320
|
+
```tsx
|
|
321
|
+
import { Modal } from 'glintly-ui';
|
|
322
|
+
|
|
323
|
+
<Modal isOpen={isOpen} onClose={() => setIsOpen(false)}>
|
|
324
|
+
<Modal.Header>Modal Title</Modal.Header>
|
|
325
|
+
<Modal.Body>Modal content goes here</Modal.Body>
|
|
326
|
+
<Modal.Footer>
|
|
327
|
+
<Button onClick={() => setIsOpen(false)}>Close</Button>
|
|
328
|
+
</Modal.Footer>
|
|
329
|
+
</Modal>
|
|
330
|
+
```
|
|
331
|
+
|
|
332
|
+
### 🎭 Feedback & Status
|
|
333
|
+
|
|
334
|
+
#### Spinner
|
|
335
|
+
Loading indicators with multiple variants.
|
|
336
|
+
|
|
337
|
+
```tsx
|
|
338
|
+
import { Spinner } from 'glintly-ui';
|
|
339
|
+
|
|
340
|
+
<Spinner size="md" color="#3b82f6" />
|
|
341
|
+
<Spinner.BouncingBallLoader />
|
|
342
|
+
<Spinner.CubeLoader />
|
|
343
|
+
<Spinner.PyramidLoader />
|
|
344
|
+
<Spinner.ThreeDBoxLoader />
|
|
345
|
+
```
|
|
346
|
+
|
|
347
|
+
#### Toast
|
|
348
|
+
Notification system for user feedback.
|
|
349
|
+
|
|
350
|
+
```tsx
|
|
351
|
+
import { toast, ToastContainer } from 'glintly-ui';
|
|
352
|
+
|
|
353
|
+
// Show a toast
|
|
354
|
+
toast.success('Operation completed successfully!');
|
|
355
|
+
toast.error('Something went wrong!');
|
|
356
|
+
toast.info('Here is some information');
|
|
357
|
+
toast.warning('Please be careful');
|
|
2
358
|
|
|
359
|
+
// Include ToastContainer in your app
|
|
360
|
+
<ToastContainer />
|
|
361
|
+
```
|
|
362
|
+
|
|
363
|
+
#### Badge
|
|
364
|
+
Status indicators and labels.
|
|
3
365
|
|
|
366
|
+
```tsx
|
|
367
|
+
import { Badge, BadgeGroup } from 'glintly-ui';
|
|
4
368
|
|
|
5
|
-
|
|
369
|
+
<Badge variant="success">Active</Badge>
|
|
370
|
+
<Badge variant="error">Error</Badge>
|
|
371
|
+
<Badge variant="warning">Warning</Badge>
|
|
6
372
|
|
|
7
|
-
|
|
373
|
+
<BadgeGroup>
|
|
374
|
+
<Badge>Tag 1</Badge>
|
|
375
|
+
<Badge>Tag 2</Badge>
|
|
376
|
+
</BadgeGroup>
|
|
377
|
+
```
|
|
8
378
|
|
|
9
|
-
|
|
379
|
+
### 🎨 Media & Content
|
|
10
380
|
|
|
11
|
-
|
|
381
|
+
#### Avatar
|
|
382
|
+
User profile images with fallbacks.
|
|
12
383
|
|
|
13
|
-
|
|
14
|
-
|
|
384
|
+
```tsx
|
|
385
|
+
import { Avatar } from 'glintly-ui';
|
|
15
386
|
|
|
387
|
+
<Avatar src="/user.jpg" alt="User" size="lg" />
|
|
388
|
+
<Avatar name="John Doe" size="md" />
|
|
389
|
+
<Avatar icon="user" size="sm" />
|
|
16
390
|
```
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
391
|
+
|
|
392
|
+
#### Carousel
|
|
393
|
+
Image and content carousel.
|
|
394
|
+
|
|
395
|
+
```tsx
|
|
396
|
+
import { Carousel, CarouselItem, CarouselCaption } from 'glintly-ui';
|
|
397
|
+
|
|
398
|
+
<Carousel>
|
|
399
|
+
<CarouselItem>
|
|
400
|
+
<img src="/image1.jpg" alt="Image 1" />
|
|
401
|
+
<CarouselCaption>
|
|
402
|
+
<h3>First Slide</h3>
|
|
403
|
+
<p>Description for first slide</p>
|
|
404
|
+
</CarouselCaption>
|
|
405
|
+
</CarouselItem>
|
|
406
|
+
<CarouselItem>
|
|
407
|
+
<img src="/image2.jpg" alt="Image 2" />
|
|
408
|
+
<CarouselCaption>
|
|
409
|
+
<h3>Second Slide</h3>
|
|
410
|
+
<p>Description for second slide</p>
|
|
411
|
+
</CarouselCaption>
|
|
412
|
+
</CarouselItem>
|
|
413
|
+
</Carousel>
|
|
21
414
|
```
|
|
22
415
|
|
|
23
|
-
|
|
416
|
+
#### CodeViewer
|
|
417
|
+
Syntax-highlighted code display.
|
|
24
418
|
|
|
25
|
-
|
|
419
|
+
```tsx
|
|
420
|
+
import { CodeViewer } from 'glintly-ui';
|
|
26
421
|
|
|
27
|
-
|
|
422
|
+
<CodeViewer
|
|
423
|
+
code={`function hello() {
|
|
424
|
+
console.log("Hello, World!");
|
|
425
|
+
}`}
|
|
426
|
+
language="javascript"
|
|
427
|
+
theme="dark"
|
|
428
|
+
/>
|
|
429
|
+
```
|
|
430
|
+
|
|
431
|
+
### 🛠️ Utility Components
|
|
28
432
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
- [ ] [Automatically close issues from merge requests](https://docs.gitlab.com/ee/user/project/issues/managing_issues.html#closing-issues-automatically)
|
|
32
|
-
- [ ] [Enable merge request approvals](https://docs.gitlab.com/ee/user/project/merge_requests/approvals/)
|
|
33
|
-
- [ ] [Set auto-merge](https://docs.gitlab.com/user/project/merge_requests/auto_merge/)
|
|
433
|
+
#### Tooltip
|
|
434
|
+
Contextual information on hover.
|
|
34
435
|
|
|
35
|
-
|
|
436
|
+
```tsx
|
|
437
|
+
import { Tooltip } from 'glintly-ui';
|
|
438
|
+
|
|
439
|
+
<Tooltip content="This is a helpful tooltip">
|
|
440
|
+
<Button>Hover me</Button>
|
|
441
|
+
</Tooltip>
|
|
442
|
+
```
|
|
36
443
|
|
|
37
|
-
|
|
444
|
+
#### Offcanvas
|
|
445
|
+
Side panel component.
|
|
446
|
+
|
|
447
|
+
```tsx
|
|
448
|
+
import { Offcanvas } from 'glintly-ui';
|
|
449
|
+
|
|
450
|
+
<Offcanvas isOpen={isOpen} onClose={() => setIsOpen(false)}>
|
|
451
|
+
<Offcanvas.Header>Side Panel</Offcanvas.Header>
|
|
452
|
+
<Offcanvas.Body>Side panel content</Offcanvas.Body>
|
|
453
|
+
</Offcanvas>
|
|
454
|
+
```
|
|
455
|
+
|
|
456
|
+
#### Pagination
|
|
457
|
+
Page navigation component.
|
|
458
|
+
|
|
459
|
+
```tsx
|
|
460
|
+
import { Pagination } from 'glintly-ui';
|
|
461
|
+
|
|
462
|
+
<Pagination
|
|
463
|
+
currentPage={1}
|
|
464
|
+
totalPages={10}
|
|
465
|
+
onPageChange={(page) => console.log(page)}
|
|
466
|
+
showFirstLast={true}
|
|
467
|
+
showPrevNext={true}
|
|
468
|
+
/>
|
|
469
|
+
```
|
|
38
470
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
471
|
+
### 🔍 Toolbars
|
|
472
|
+
|
|
473
|
+
#### SearchBar
|
|
474
|
+
Search functionality component.
|
|
475
|
+
|
|
476
|
+
```tsx
|
|
477
|
+
import { SearchBar } from 'glintly-ui';
|
|
478
|
+
|
|
479
|
+
<SearchBar
|
|
480
|
+
placeholder="Search..."
|
|
481
|
+
onSearch={(query) => console.log(query)}
|
|
482
|
+
debounceMs={300}
|
|
483
|
+
/>
|
|
484
|
+
```
|
|
485
|
+
|
|
486
|
+
#### FilterBar
|
|
487
|
+
Data filtering interface.
|
|
488
|
+
|
|
489
|
+
```tsx
|
|
490
|
+
import { FilterBar } from 'glintly-ui';
|
|
491
|
+
|
|
492
|
+
<FilterBar
|
|
493
|
+
filters={[
|
|
494
|
+
{ key: 'status', label: 'Status', options: ['Active', 'Inactive'] },
|
|
495
|
+
{ key: 'role', label: 'Role', options: ['Admin', 'User'] }
|
|
496
|
+
]}
|
|
497
|
+
onFilterChange={(filters) => console.log(filters)}
|
|
498
|
+
/>
|
|
499
|
+
```
|
|
500
|
+
|
|
501
|
+
#### SortBar
|
|
502
|
+
Data sorting interface.
|
|
503
|
+
|
|
504
|
+
```tsx
|
|
505
|
+
import { SortBar } from 'glintly-ui';
|
|
506
|
+
|
|
507
|
+
<SortBar
|
|
508
|
+
sortOptions={[
|
|
509
|
+
{ key: 'name', label: 'Name' },
|
|
510
|
+
{ key: 'email', label: 'Email' },
|
|
511
|
+
{ key: 'createdAt', label: 'Created Date' }
|
|
512
|
+
]}
|
|
513
|
+
onSortChange={(sort) => console.log(sort)}
|
|
514
|
+
/>
|
|
515
|
+
```
|
|
516
|
+
|
|
517
|
+
## 🎨 Theming
|
|
518
|
+
|
|
519
|
+
Glintly UI provides a comprehensive theming system with:
|
|
520
|
+
|
|
521
|
+
- **Color Palettes**: Primary, secondary, gray, success, warning, error scales
|
|
522
|
+
- **Typography**: Font families, sizes, weights, and line heights
|
|
523
|
+
- **Spacing**: Consistent spacing scale
|
|
524
|
+
- **Border Radius**: Configurable border radius values
|
|
525
|
+
- **Shadows**: Light and dark mode shadow systems
|
|
526
|
+
- **Breakpoints**: Responsive design breakpoints
|
|
527
|
+
|
|
528
|
+
### Custom Theme Example
|
|
529
|
+
|
|
530
|
+
```tsx
|
|
531
|
+
import { ThemeProvider } from 'glintly-ui';
|
|
532
|
+
|
|
533
|
+
const customTheme = {
|
|
534
|
+
colors: {
|
|
535
|
+
primary: {
|
|
536
|
+
50: '#eff6ff',
|
|
537
|
+
100: '#dbeafe',
|
|
538
|
+
500: '#3b82f6',
|
|
539
|
+
600: '#2563eb',
|
|
540
|
+
900: '#1e3a8a',
|
|
541
|
+
},
|
|
542
|
+
secondary: {
|
|
543
|
+
500: '#8b5cf6',
|
|
544
|
+
600: '#7c3aed',
|
|
545
|
+
},
|
|
546
|
+
gray: {
|
|
547
|
+
50: '#f9fafb',
|
|
548
|
+
100: '#f3f4f6',
|
|
549
|
+
500: '#6b7280',
|
|
550
|
+
900: '#111827',
|
|
551
|
+
},
|
|
552
|
+
},
|
|
553
|
+
typography: {
|
|
554
|
+
fontFamily: '"Inter", "Segoe UI", sans-serif',
|
|
555
|
+
fontSize: {
|
|
556
|
+
xs: '0.75rem',
|
|
557
|
+
sm: '0.875rem',
|
|
558
|
+
md: '1rem',
|
|
559
|
+
lg: '1.125rem',
|
|
560
|
+
xl: '1.25rem',
|
|
561
|
+
},
|
|
562
|
+
},
|
|
563
|
+
spacing: {
|
|
564
|
+
xs: '0.25rem',
|
|
565
|
+
sm: '0.5rem',
|
|
566
|
+
md: '1rem',
|
|
567
|
+
lg: '1.5rem',
|
|
568
|
+
xl: '2rem',
|
|
569
|
+
},
|
|
570
|
+
borderRadius: {
|
|
571
|
+
sm: '0.25rem',
|
|
572
|
+
md: '0.375rem',
|
|
573
|
+
lg: '0.5rem',
|
|
574
|
+
xl: '0.75rem',
|
|
575
|
+
},
|
|
576
|
+
};
|
|
577
|
+
|
|
578
|
+
<ThemeProvider theme={customTheme}>
|
|
579
|
+
<YourApp />
|
|
580
|
+
</ThemeProvider>
|
|
581
|
+
```
|
|
44
582
|
|
|
45
|
-
|
|
583
|
+
## 🚀 Getting Started
|
|
46
584
|
|
|
47
|
-
|
|
585
|
+
### 1. Install the package
|
|
586
|
+
|
|
587
|
+
```bash
|
|
588
|
+
npm install glintly-ui
|
|
589
|
+
```
|
|
590
|
+
|
|
591
|
+
### 2. Wrap your app with ThemeProvider
|
|
592
|
+
|
|
593
|
+
```tsx
|
|
594
|
+
import React from 'react';
|
|
595
|
+
import { ThemeProvider } from 'glintly-ui';
|
|
596
|
+
|
|
597
|
+
function App() {
|
|
598
|
+
return (
|
|
599
|
+
<ThemeProvider>
|
|
600
|
+
<YourApp />
|
|
601
|
+
</ThemeProvider>
|
|
602
|
+
);
|
|
603
|
+
}
|
|
604
|
+
```
|
|
605
|
+
|
|
606
|
+
### 3. Import and use components
|
|
607
|
+
|
|
608
|
+
```tsx
|
|
609
|
+
import { Button, Input, Card } from 'glintly-ui';
|
|
610
|
+
|
|
611
|
+
function MyComponent() {
|
|
612
|
+
return (
|
|
613
|
+
<Card>
|
|
614
|
+
<Input placeholder="Enter your name" />
|
|
615
|
+
<Button variant="primary">Submit</Button>
|
|
616
|
+
</Card>
|
|
617
|
+
);
|
|
618
|
+
}
|
|
619
|
+
```
|
|
620
|
+
|
|
621
|
+
## 📱 Responsive Design
|
|
622
|
+
|
|
623
|
+
All components are built with mobile-first responsive design:
|
|
624
|
+
|
|
625
|
+
- **xs**: Extra small devices (portrait phones)
|
|
626
|
+
- **sm**: Small devices (landscape phones)
|
|
627
|
+
- **md**: Medium devices (tablets)
|
|
628
|
+
- **lg**: Large devices (desktops)
|
|
629
|
+
- **xl**: Extra large devices (large desktops)
|
|
630
|
+
|
|
631
|
+
## ♿ Accessibility
|
|
632
|
+
|
|
633
|
+
Glintly UI components are built with accessibility in mind:
|
|
634
|
+
|
|
635
|
+
- Proper ARIA attributes
|
|
636
|
+
- Keyboard navigation support
|
|
637
|
+
- Screen reader compatibility
|
|
638
|
+
- High contrast support
|
|
639
|
+
- Focus management
|
|
640
|
+
|
|
641
|
+
## 🔧 Development
|
|
642
|
+
|
|
643
|
+
### Prerequisites
|
|
644
|
+
|
|
645
|
+
- Node.js >= 18.0.0
|
|
646
|
+
- npm, yarn, or pnpm
|
|
647
|
+
|
|
648
|
+
### Setup
|
|
649
|
+
|
|
650
|
+
```bash
|
|
651
|
+
git clone https://github.com/abhimanyuyadav0/glintly-ui-lib.git
|
|
652
|
+
cd glintly-ui-lib
|
|
653
|
+
npm install
|
|
654
|
+
```
|
|
655
|
+
|
|
656
|
+
### Available Scripts
|
|
657
|
+
|
|
658
|
+
```bash
|
|
659
|
+
npm run dev # Start development server
|
|
660
|
+
npm run build # Build the library
|
|
661
|
+
npm run lint # Run ESLint
|
|
662
|
+
npm run preview # Preview the build
|
|
663
|
+
npm run clean # Clean build directory
|
|
664
|
+
```
|
|
665
|
+
|
|
666
|
+
### Building
|
|
667
|
+
|
|
668
|
+
```bash
|
|
669
|
+
npm run build
|
|
670
|
+
```
|
|
48
671
|
|
|
49
|
-
|
|
672
|
+
The build output will be in the `dist/` directory.
|
|
50
673
|
|
|
51
|
-
##
|
|
674
|
+
## 📦 Bundle Information
|
|
52
675
|
|
|
53
|
-
|
|
676
|
+
- **Main**: `./dist/glintly-ui.umd.cjs` (CommonJS)
|
|
677
|
+
- **Module**: `./dist/glintly-ui.js` (ES Module)
|
|
678
|
+
- **Types**: `./dist/glintly-ui.d.ts` (TypeScript definitions)
|
|
679
|
+
- **Browser**: `./dist/glintly-ui.umd.cjs` (UMD)
|
|
54
680
|
|
|
55
|
-
##
|
|
56
|
-
Choose a self-explaining name for your project.
|
|
681
|
+
## 🤝 Contributing
|
|
57
682
|
|
|
58
|
-
|
|
59
|
-
Let people know what your project can do specifically. Provide context and add a link to any reference visitors might be unfamiliar with. A list of Features or a Background subsection can also be added here. If there are alternatives to your project, this is a good place to list differentiating factors.
|
|
683
|
+
We welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for details.
|
|
60
684
|
|
|
61
|
-
|
|
62
|
-
On some READMEs, you may see small images that convey metadata, such as whether or not all the tests are passing for the project. You can use Shields to add some to your README. Many services also have instructions for adding a badge.
|
|
685
|
+
### Development Guidelines
|
|
63
686
|
|
|
64
|
-
|
|
65
|
-
|
|
687
|
+
1. Fork the repository
|
|
688
|
+
2. Create a feature branch
|
|
689
|
+
3. Make your changes
|
|
690
|
+
4. Add tests if applicable
|
|
691
|
+
5. Submit a pull request
|
|
66
692
|
|
|
67
|
-
##
|
|
68
|
-
Within a particular ecosystem, there may be a common way of installing things, such as using Yarn, NuGet, or Homebrew. However, consider the possibility that whoever is reading your README is a novice and would like more guidance. Listing specific steps helps remove ambiguity and gets people to using your project as quickly as possible. If it only runs in a specific context like a particular programming language version or operating system or has dependencies that have to be installed manually, also add a Requirements subsection.
|
|
693
|
+
## 📄 License
|
|
69
694
|
|
|
70
|
-
|
|
71
|
-
Use examples liberally, and show the expected output if you can. It's helpful to have inline the smallest example of usage that you can demonstrate, while providing links to more sophisticated examples if they are too long to reasonably include in the README.
|
|
695
|
+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
|
|
72
696
|
|
|
73
|
-
##
|
|
74
|
-
Tell people where they can go to for help. It can be any combination of an issue tracker, a chat room, an email address, etc.
|
|
697
|
+
## 🙏 Acknowledgments
|
|
75
698
|
|
|
76
|
-
|
|
77
|
-
|
|
699
|
+
- [React](https://reactjs.org/) - The JavaScript library for building user interfaces
|
|
700
|
+
- [styled-components](https://styled-components.com/) - Visual primitives for the component age
|
|
701
|
+
- [TypeScript](https://www.typescriptlang.org/) - Typed JavaScript at any scale
|
|
78
702
|
|
|
79
|
-
##
|
|
80
|
-
State if you are open to contributions and what your requirements are for accepting them.
|
|
703
|
+
## 📞 Support
|
|
81
704
|
|
|
82
|
-
|
|
705
|
+
- **Issues**: [GitHub Issues](https://github.com/abhimanyuyadav0/glintly-ui-lib/issues)
|
|
706
|
+
- **Discussions**: [GitHub Discussions](https://github.com/abhimanyuyadav0/glintly-ui-lib/discussions)
|
|
707
|
+
- **Documentation**: [GitHub Wiki](https://github.com/abhimanyuyadav0/glintly-ui-lib/wiki)
|
|
83
708
|
|
|
84
|
-
|
|
709
|
+
## 🌟 Star History
|
|
85
710
|
|
|
86
|
-
|
|
87
|
-
Show your appreciation to those who have contributed to the project.
|
|
711
|
+
If you find this library helpful, please consider giving it a star on GitHub!
|
|
88
712
|
|
|
89
|
-
|
|
90
|
-
For open source projects, say how it is licensed.
|
|
713
|
+
---
|
|
91
714
|
|
|
92
|
-
|
|
93
|
-
If you have run out of energy or time for your project, put a note at the top of the README saying that development has slowed down or stopped completely. Someone may choose to fork your project or volunteer to step in as a maintainer or owner, allowing your project to keep going. You can also make an explicit request for maintainers.
|
|
715
|
+
Made with ❤️ by [Abhimanyu Yadav](https://github.com/abhimanyuyadav0)
|