@papernote/ui 1.0.0 → 1.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/LICENSE +21 -21
- package/README.md +455 -445
- package/dist/components/CurrencyInput.d.ts +52 -0
- package/dist/components/CurrencyInput.d.ts.map +1 -0
- package/dist/components/DataTable.d.ts +3 -1
- package/dist/components/DataTable.d.ts.map +1 -1
- package/dist/components/Modal.d.ts.map +1 -1
- package/dist/components/Page.d.ts +2 -0
- package/dist/components/Page.d.ts.map +1 -1
- package/dist/components/PageLayout.d.ts +5 -1
- package/dist/components/PageLayout.d.ts.map +1 -1
- package/dist/components/Spreadsheet.d.ts +129 -0
- package/dist/components/Spreadsheet.d.ts.map +1 -0
- package/dist/components/Tabs.d.ts +5 -1
- package/dist/components/Tabs.d.ts.map +1 -1
- package/dist/components/index.d.ts +6 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/index.d.ts +336 -5
- package/dist/index.esm.js +51152 -174
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +51145 -143
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1187 -11
- package/dist/utils/excelExport.d.ts +143 -0
- package/dist/utils/excelExport.d.ts.map +1 -0
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/package.json +13 -3
- package/src/components/AdminModal.css +49 -49
- package/src/components/CurrencyInput.stories.tsx +290 -0
- package/src/components/CurrencyInput.tsx +193 -0
- package/src/components/DataTable.stories.tsx +87 -0
- package/src/components/DataTable.tsx +149 -37
- package/src/components/Modal.stories.tsx +64 -0
- package/src/components/Modal.tsx +15 -2
- package/src/components/Page.stories.tsx +76 -0
- package/src/components/Page.tsx +35 -3
- package/src/components/PageLayout.stories.tsx +75 -0
- package/src/components/PageLayout.tsx +28 -9
- package/src/components/RoleManager.css +10 -10
- package/src/components/Spreadsheet.css +216 -0
- package/src/components/Spreadsheet.stories.tsx +362 -0
- package/src/components/Spreadsheet.tsx +351 -0
- package/src/components/SpreadsheetSimple.stories.tsx +27 -0
- package/src/components/Tabs.stories.tsx +31 -0
- package/src/components/Tabs.tsx +28 -4
- package/src/components/TimePicker.tsx +1 -1
- package/src/components/Toast.tsx +9 -9
- package/src/components/__tests__/Input.test.tsx +22 -26
- package/src/components/index.ts +11 -2
- package/src/styles/index.css +44 -6
- package/src/utils/excelExport.stories.tsx +535 -0
- package/src/utils/excelExport.ts +225 -0
- package/src/utils/index.ts +3 -0
- package/src/utils/sqlToNaturalLanguage.ts +1 -1
- package/tailwind.config.js +253 -253
- package/dist/components/Button.stories.d.ts +0 -51
- package/dist/components/Button.stories.d.ts.map +0 -1
- package/dist/components/ChartVisualizationUI.d.ts +0 -21
- package/dist/components/ChartVisualizationUI.d.ts.map +0 -1
- package/dist/components/ChatUI.d.ts +0 -23
- package/dist/components/ChatUI.d.ts.map +0 -1
- package/dist/components/CommissionDashboardUI.d.ts +0 -25
- package/dist/components/CommissionDashboardUI.d.ts.map +0 -1
- package/dist/components/DataTable.stories.d.ts +0 -23
- package/dist/components/DataTable.stories.d.ts.map +0 -1
- package/dist/components/FormField.d.ts +0 -35
- package/dist/components/FormField.d.ts.map +0 -1
- package/dist/components/Input.stories.d.ts +0 -366
- package/dist/components/Input.stories.d.ts.map +0 -1
- package/dist/components/InsightsPanelUI.d.ts +0 -21
- package/dist/components/InsightsPanelUI.d.ts.map +0 -1
- package/dist/components/PaymentHistoryTimeline.d.ts +0 -34
- package/dist/components/PaymentHistoryTimeline.d.ts.map +0 -1
- package/dist/components/RelationshipManagerUI.d.ts +0 -60
- package/dist/components/RelationshipManagerUI.d.ts.map +0 -1
- package/dist/components/RoleManager.d.ts +0 -19
- package/dist/components/RoleManager.d.ts.map +0 -1
- package/dist/components/SplitCommissionBadge.d.ts +0 -18
- package/dist/components/SplitCommissionBadge.d.ts.map +0 -1
- package/dist/components/__tests__/Button.test.d.ts +0 -2
- package/dist/components/__tests__/Button.test.d.ts.map +0 -1
- package/dist/components/__tests__/Input.test.d.ts +0 -2
- package/dist/components/__tests__/Input.test.d.ts.map +0 -1
package/README.md
CHANGED
|
@@ -1,445 +1,455 @@
|
|
|
1
|
-
# @papernote/ui
|
|
2
|
-
|
|
3
|
-
[](https://www.npmjs.com/package/@papernote/ui)
|
|
4
|
-
[](https://opensource.org/licenses/MIT)
|
|
5
|
-
[](https://www.typescriptlang.org/)
|
|
6
|
-
[](https://storybook.js.org/)
|
|
7
|
-
|
|
8
|
-
A modern React component library with a paper notebook aesthetic - minimal, professional, and expressive. Built with TypeScript, Tailwind CSS, and designed for production use.
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
-
|
|
15
|
-
-
|
|
16
|
-
-
|
|
17
|
-
-
|
|
18
|
-
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
```bash
|
|
38
|
-
npm install
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
- **
|
|
101
|
-
- **
|
|
102
|
-
- **
|
|
103
|
-
- **
|
|
104
|
-
- **
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
- **
|
|
108
|
-
- **
|
|
109
|
-
- **
|
|
110
|
-
- **
|
|
111
|
-
- **
|
|
112
|
-
- **
|
|
113
|
-
- **
|
|
114
|
-
- **
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
- **
|
|
118
|
-
- **
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
- **
|
|
122
|
-
- **
|
|
123
|
-
- **
|
|
124
|
-
- **
|
|
125
|
-
- **
|
|
126
|
-
- **
|
|
127
|
-
- **
|
|
128
|
-
- **
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
- **
|
|
134
|
-
- **
|
|
135
|
-
- **
|
|
136
|
-
- **
|
|
137
|
-
- **
|
|
138
|
-
- **
|
|
139
|
-
- **
|
|
140
|
-
- **
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
- **
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
- **
|
|
147
|
-
- **
|
|
148
|
-
- **
|
|
149
|
-
- **
|
|
150
|
-
- **
|
|
151
|
-
- **
|
|
152
|
-
- **
|
|
153
|
-
- **
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
- **
|
|
159
|
-
- **
|
|
160
|
-
- **
|
|
161
|
-
- **
|
|
162
|
-
- **
|
|
163
|
-
- **
|
|
164
|
-
- **
|
|
165
|
-
- **
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
- **
|
|
169
|
-
- **
|
|
170
|
-
- **
|
|
171
|
-
- **
|
|
172
|
-
- **
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
- **
|
|
176
|
-
- **
|
|
177
|
-
- **
|
|
178
|
-
- **
|
|
179
|
-
- **
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
)
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
const
|
|
282
|
-
{
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
/>
|
|
353
|
-
<
|
|
354
|
-
label="
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
}
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
##
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
##
|
|
441
|
-
|
|
442
|
-
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
1
|
+
# @papernote/ui
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/@papernote/ui)
|
|
4
|
+
[](https://opensource.org/licenses/MIT)
|
|
5
|
+
[](https://www.typescriptlang.org/)
|
|
6
|
+
[](https://storybook.js.org/)
|
|
7
|
+
|
|
8
|
+
A modern React component library with a paper notebook aesthetic - minimal, professional, and expressive. Built with TypeScript, Tailwind CSS, and designed for production use.
|
|
9
|
+
|
|
10
|
+
## 📖 Documentation
|
|
11
|
+
|
|
12
|
+
**[📚 View Full Documentation →](https://kwhittenberger.github.io/papernote-ui/)**
|
|
13
|
+
|
|
14
|
+
- **[🚀 Getting Started](https://kwhittenberger.github.io/papernote-ui/getting-started)** - Installation and setup guide
|
|
15
|
+
- **[📦 Components](https://kwhittenberger.github.io/papernote-ui/components/)** - Browse all 115+ components
|
|
16
|
+
- **[🎨 Design System](https://kwhittenberger.github.io/papernote-ui/design-system)** - Colors, typography, and design tokens
|
|
17
|
+
- **[🧪 Testing Guide](https://kwhittenberger.github.io/papernote-ui/development/testing-guide)** - Writing tests for components
|
|
18
|
+
- **[🤝 Contributing](https://kwhittenberger.github.io/papernote-ui/development/contributing)** - How to contribute
|
|
19
|
+
|
|
20
|
+
> **Quick Links:** **[🎨 Storybook](https://691fcf89b3393605ea470e93-rzwuumklem.chromatic.com/)** • **[📦 npm](https://www.npmjs.com/package/@papernote/ui)**
|
|
21
|
+
|
|
22
|
+
## ✨ Features
|
|
23
|
+
|
|
24
|
+
- 🎨 **Paper Notebook Aesthetic** - Subtle grain textures, muted warm colors, inspired by quality paper notebooks
|
|
25
|
+
- ⚡ **115+ Components** - Comprehensive set of production-ready React components
|
|
26
|
+
- 📚 **45+ Storybook Stories** - Extensive documentation with 500+ interactive examples
|
|
27
|
+
- 🎯 **TypeScript First** - Full TypeScript support with comprehensive type definitions
|
|
28
|
+
- 🎨 **Tailwind CSS v3** - Built on Tailwind with custom design tokens
|
|
29
|
+
- ♿ **Accessible** - WCAG AA compliant with ARIA attributes and keyboard navigation
|
|
30
|
+
- 🚀 **Tree-shakeable** - Import only what you need
|
|
31
|
+
- 📱 **Responsive** - Mobile-first design with responsive utilities
|
|
32
|
+
- 🔧 **Virtual Scrolling** - High-performance rendering for large datasets (DataTable)
|
|
33
|
+
- 🎯 **forwardRef Support** - All form components support ref forwarding
|
|
34
|
+
|
|
35
|
+
## 📦 Installation
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
npm install @papernote/ui
|
|
39
|
+
# or
|
|
40
|
+
yarn add @papernote/ui
|
|
41
|
+
# or
|
|
42
|
+
pnpm add @papernote/ui
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### Peer Dependencies
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
npm install react react-dom react-router-dom lucide-react tailwindcss
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## 🚀 Quick Start
|
|
52
|
+
|
|
53
|
+
### 1. Import Styles
|
|
54
|
+
|
|
55
|
+
In your main entry file (e.g., `src/main.tsx`):
|
|
56
|
+
|
|
57
|
+
```tsx
|
|
58
|
+
import '@papernote/ui/styles';
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### 2. Configure Tailwind
|
|
62
|
+
|
|
63
|
+
In your `tailwind.config.js`:
|
|
64
|
+
|
|
65
|
+
```javascript
|
|
66
|
+
import notebookConfig from '@papernote/ui/tailwind-config';
|
|
67
|
+
|
|
68
|
+
export default {
|
|
69
|
+
...notebookConfig,
|
|
70
|
+
content: [
|
|
71
|
+
'./src/**/*.{js,ts,jsx,tsx}',
|
|
72
|
+
'./node_modules/@papernote/ui/src/**/*.{js,ts,jsx,tsx}',
|
|
73
|
+
],
|
|
74
|
+
};
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### 3. Use Components
|
|
78
|
+
|
|
79
|
+
```tsx
|
|
80
|
+
import { Button, Card, CardHeader, CardTitle, CardContent } from '@papernote/ui';
|
|
81
|
+
|
|
82
|
+
function App() {
|
|
83
|
+
return (
|
|
84
|
+
<Card>
|
|
85
|
+
<CardHeader>
|
|
86
|
+
<CardTitle>Welcome to @papernote/ui</CardTitle>
|
|
87
|
+
</CardHeader>
|
|
88
|
+
<CardContent>
|
|
89
|
+
<p>A beautiful component library with paper notebook aesthetic</p>
|
|
90
|
+
<Button variant="primary">Get Started</Button>
|
|
91
|
+
</CardContent>
|
|
92
|
+
</Card>
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
## 🧩 Component Categories
|
|
98
|
+
|
|
99
|
+
### Form Components (15+)
|
|
100
|
+
- **Button** - Primary, secondary, ghost, danger, outline variants with loading states
|
|
101
|
+
- **Input** - Text input with prefix/suffix icons, clearable, validation states
|
|
102
|
+
- **Select** - Searchable dropdown with clearable option
|
|
103
|
+
- **MultiSelect** - Multiple selection dropdown
|
|
104
|
+
- **Textarea** - Auto-expanding text area with resize control
|
|
105
|
+
- **Checkbox** - Checkbox with icon support
|
|
106
|
+
- **Radio** - Radio buttons with icon support
|
|
107
|
+
- **Switch** - Toggle switch with loading state
|
|
108
|
+
- **Slider** - Range input with value display
|
|
109
|
+
- **DatePicker** - Calendar date picker with events and range mode
|
|
110
|
+
- **TimePicker** - Time selection input
|
|
111
|
+
- **ColorPicker** - Color selector with presets
|
|
112
|
+
- **FileUpload** - Drag-and-drop file upload
|
|
113
|
+
- **PasswordInput** - Password field with show/hide toggle
|
|
114
|
+
- **NumberInput** - Numeric input with step controls
|
|
115
|
+
|
|
116
|
+
### Layout Components (12+)
|
|
117
|
+
- **Card** - Container with Header, Title, Content, Footer sections
|
|
118
|
+
- **Stack** - Vertical/horizontal flex layout
|
|
119
|
+
- **Grid** - Responsive grid system with GridItem
|
|
120
|
+
- **Box** - Generic container with spacing utilities
|
|
121
|
+
- **Text** - Typography component with size variants
|
|
122
|
+
- **Page** - Notebook-style page background with ruled lines
|
|
123
|
+
- **PageLayout** - Standard page layout with title and description
|
|
124
|
+
- **Layout** - Complete app layout with sidebar and gutter navigation
|
|
125
|
+
- **AppLayout** - Layout with expandable toolbar and status bar
|
|
126
|
+
- **Dashboard** - Dashboard container with DashboardHeader and DashboardContent
|
|
127
|
+
- **TwoColumnContent** - 1/3 sidebar + 2/3 main content layout
|
|
128
|
+
- **Separator** - Horizontal/vertical divider
|
|
129
|
+
|
|
130
|
+
### Navigation Components (10+)
|
|
131
|
+
- **Sidebar** - Collapsible navigation sidebar with nested items
|
|
132
|
+
- **Breadcrumbs** - Path navigation with custom separators
|
|
133
|
+
- **Pagination** - Page navigation with size options
|
|
134
|
+
- **Tabs** - Tab navigation (underline and pill variants, vertical/horizontal)
|
|
135
|
+
- **StepIndicator** - Progress stepper
|
|
136
|
+
- **TreeView** - Hierarchical tree navigation with expand/collapse
|
|
137
|
+
- **CommandPalette** - Keyboard-driven command launcher (Cmd+K style)
|
|
138
|
+
- **PageNavigation** - Scrollspy navigation dots for page sections
|
|
139
|
+
- **Dropdown** - Action menu with icons and dividers
|
|
140
|
+
- **Menu** - Context menu component
|
|
141
|
+
|
|
142
|
+
### Data Display Components (10+)
|
|
143
|
+
- **DataTable** - Feature-rich table with sorting, filtering, selection, row actions, expansion, virtual scrolling
|
|
144
|
+
- **Table** - Basic table component
|
|
145
|
+
- **Badge** - Status indicators with dot variant
|
|
146
|
+
- **StatusBadge** - Status badges with color variants
|
|
147
|
+
- **Avatar** - User avatars with fallback initials
|
|
148
|
+
- **Timeline** - Vertical/horizontal event timeline
|
|
149
|
+
- **KanbanBoard** - Drag-and-drop kanban board
|
|
150
|
+
- **Calendar** - Full calendar with event markers
|
|
151
|
+
- **CurrencyDisplay** - Formatted currency display
|
|
152
|
+
- **DateDisplay** - Formatted date display
|
|
153
|
+
- **StatCard** - Statistics card with trends
|
|
154
|
+
|
|
155
|
+
### Feedback Components (8+)
|
|
156
|
+
- **Toast** - Notification system (success, error, warning, info) with position control
|
|
157
|
+
- **Alert** - Notification banners with action buttons
|
|
158
|
+
- **Modal** - Dialog with multiple sizes and animation variants
|
|
159
|
+
- **Drawer** - Side-sliding panel (left, right, top, bottom)
|
|
160
|
+
- **Tooltip** - Hover tooltips with positioning
|
|
161
|
+
- **EmptyState** - No data/empty states
|
|
162
|
+
- **Loading** - Spinners, dots, pulse loaders
|
|
163
|
+
- **Skeleton** - Loading placeholders (SkeletonCard, SkeletonTable)
|
|
164
|
+
- **LoadingOverlay** - Full-screen loading overlay
|
|
165
|
+
- **ConfirmDialog** - Confirmation dialogs
|
|
166
|
+
|
|
167
|
+
### Advanced Components (15+)
|
|
168
|
+
- **Accordion** - Collapsible panels with custom icons
|
|
169
|
+
- **Transfer** - Dual-list item transfer with search
|
|
170
|
+
- **Carousel** - Image/content carousel with auto-play
|
|
171
|
+
- **Stepper** - Multi-step wizard (horizontal/vertical)
|
|
172
|
+
- **Rating** - Star rating input with half-star support
|
|
173
|
+
- **Progress** - Linear and circular progress indicators
|
|
174
|
+
- **Popover** - Rich content popovers with positioning
|
|
175
|
+
- **ButtonGroup** - Toggle button groups (single/multiple selection)
|
|
176
|
+
- **Autocomplete** - Auto-suggest input
|
|
177
|
+
- **Combobox** - Searchable select with custom options
|
|
178
|
+
- **DateRangePicker** - Date range selection
|
|
179
|
+
- **RichTextEditor** - WYSIWYG editor
|
|
180
|
+
- **MarkdownEditor** - Markdown editing
|
|
181
|
+
- **InfiniteScroll** - Infinite scroll loading
|
|
182
|
+
- **ContextMenu** - Right-click context menus
|
|
183
|
+
|
|
184
|
+
### Utility Components (5+)
|
|
185
|
+
- **Show/Hide** - Responsive visibility utilities
|
|
186
|
+
- **ErrorBoundary** - Error boundary wrapper
|
|
187
|
+
- **ThemeToggle** - Dark/light mode toggle
|
|
188
|
+
- **QueryTransparency** - SQL query explanation
|
|
189
|
+
- **NotificationIndicator** - Badge notification dots
|
|
190
|
+
|
|
191
|
+
## 🎨 Design System
|
|
192
|
+
|
|
193
|
+
### Color Palette
|
|
194
|
+
|
|
195
|
+
The library uses a muted, warm color palette inspired by paper and ink:
|
|
196
|
+
|
|
197
|
+
```javascript
|
|
198
|
+
{
|
|
199
|
+
paper: {
|
|
200
|
+
50: '#fafaf9', // Off-white background
|
|
201
|
+
100: '#f5f5f4', // Light gray
|
|
202
|
+
200: '#e7e5e4', // Border gray
|
|
203
|
+
300: '#d6d3d1', // Subtle border
|
|
204
|
+
},
|
|
205
|
+
ink: {
|
|
206
|
+
600: '#57534e', // Body text
|
|
207
|
+
700: '#44403c', // Headings
|
|
208
|
+
900: '#1c1917', // High contrast
|
|
209
|
+
},
|
|
210
|
+
accent: '#8b8878', // Warm gray accents
|
|
211
|
+
primary: '#64748b', // Slate blue
|
|
212
|
+
success: '#10b981', // Muted emerald
|
|
213
|
+
warning: '#f59e0b', // Soft amber
|
|
214
|
+
error: '#ef4444', // Muted red
|
|
215
|
+
}
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
### Typography
|
|
219
|
+
|
|
220
|
+
- **Font Family**: System font stack (ui-sans-serif, system-ui, sans-serif)
|
|
221
|
+
- **Font Sizes**: 12px (xs) to 48px (4xl)
|
|
222
|
+
- **Line Heights**: 1.5 (body), 1.2 (headings)
|
|
223
|
+
- **Font Weights**: 400 (normal), 500 (medium), 600 (semibold), 700 (bold)
|
|
224
|
+
|
|
225
|
+
### Shadows & Effects
|
|
226
|
+
|
|
227
|
+
- Subtle paper-like box shadows
|
|
228
|
+
- SVG noise texture for paper grain
|
|
229
|
+
- Smooth transitions (150ms-300ms)
|
|
230
|
+
- Border radius: 0.375rem (6px) standard
|
|
231
|
+
|
|
232
|
+
## 📚 Component Examples
|
|
233
|
+
|
|
234
|
+
### Button with Loading State
|
|
235
|
+
|
|
236
|
+
```tsx
|
|
237
|
+
import { Button } from '@papernote/ui';
|
|
238
|
+
import { Save } from 'lucide-react';
|
|
239
|
+
|
|
240
|
+
<Button
|
|
241
|
+
variant="primary"
|
|
242
|
+
size="md"
|
|
243
|
+
loading={isSaving}
|
|
244
|
+
icon={<Save />}
|
|
245
|
+
onClick={handleSave}
|
|
246
|
+
>
|
|
247
|
+
Save Changes
|
|
248
|
+
</Button>
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
### Toast Notifications
|
|
252
|
+
|
|
253
|
+
```tsx
|
|
254
|
+
import { addSuccessMessage, addErrorMessage, ToastContainer } from '@papernote/ui';
|
|
255
|
+
|
|
256
|
+
function App() {
|
|
257
|
+
const handleSuccess = () => {
|
|
258
|
+
addSuccessMessage('Changes saved successfully!');
|
|
259
|
+
};
|
|
260
|
+
|
|
261
|
+
const handleError = () => {
|
|
262
|
+
addErrorMessage('Failed to save changes', 'Please try again');
|
|
263
|
+
};
|
|
264
|
+
|
|
265
|
+
return (
|
|
266
|
+
<>
|
|
267
|
+
<Button onClick={handleSuccess}>Show Success</Button>
|
|
268
|
+
<Button onClick={handleError}>Show Error</Button>
|
|
269
|
+
<ToastContainer position="top-right" />
|
|
270
|
+
</>
|
|
271
|
+
);
|
|
272
|
+
}
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
### DataTable with Advanced Features
|
|
276
|
+
|
|
277
|
+
```tsx
|
|
278
|
+
import { DataTable } from '@papernote/ui';
|
|
279
|
+
import { Edit, Trash } from 'lucide-react';
|
|
280
|
+
|
|
281
|
+
const columns = [
|
|
282
|
+
{ key: 'name', header: 'Name', sortable: true, filterable: true },
|
|
283
|
+
{ key: 'email', header: 'Email', sortable: true },
|
|
284
|
+
{
|
|
285
|
+
key: 'status',
|
|
286
|
+
header: 'Status',
|
|
287
|
+
render: (row) => <Badge variant={row.status === 'active' ? 'success' : 'default'}>{row.status}</Badge>
|
|
288
|
+
},
|
|
289
|
+
];
|
|
290
|
+
|
|
291
|
+
const actions = [
|
|
292
|
+
{
|
|
293
|
+
label: 'Edit',
|
|
294
|
+
icon: <Edit className="h-4 w-4" />,
|
|
295
|
+
onClick: (row) => handleEdit(row)
|
|
296
|
+
},
|
|
297
|
+
{
|
|
298
|
+
label: 'Delete',
|
|
299
|
+
icon: <Trash className="h-4 w-4" />,
|
|
300
|
+
onClick: (row) => handleDelete(row),
|
|
301
|
+
variant: 'danger' as const
|
|
302
|
+
},
|
|
303
|
+
];
|
|
304
|
+
|
|
305
|
+
<DataTable
|
|
306
|
+
data={users}
|
|
307
|
+
columns={columns}
|
|
308
|
+
actions={actions}
|
|
309
|
+
loading={loading}
|
|
310
|
+
selectable
|
|
311
|
+
onRowSelect={(selectedRows) => console.log(selectedRows)}
|
|
312
|
+
expandable
|
|
313
|
+
renderExpandedRow={(row) => <UserDetails user={row} />}
|
|
314
|
+
virtualized // Enable for 10,000+ rows
|
|
315
|
+
virtualHeight="600px"
|
|
316
|
+
/>
|
|
317
|
+
```
|
|
318
|
+
|
|
319
|
+
### Form with Validation
|
|
320
|
+
|
|
321
|
+
```tsx
|
|
322
|
+
import { Input, Textarea, Select, Button, Card } from '@papernote/ui';
|
|
323
|
+
import { useState } from 'react';
|
|
324
|
+
|
|
325
|
+
function ContactForm() {
|
|
326
|
+
const [formData, setFormData] = useState({
|
|
327
|
+
name: '',
|
|
328
|
+
email: '',
|
|
329
|
+
category: '',
|
|
330
|
+
message: ''
|
|
331
|
+
});
|
|
332
|
+
|
|
333
|
+
return (
|
|
334
|
+
<Card>
|
|
335
|
+
<CardHeader>
|
|
336
|
+
<CardTitle>Contact Us</CardTitle>
|
|
337
|
+
</CardHeader>
|
|
338
|
+
<CardContent>
|
|
339
|
+
<div style={{ display: 'flex', flexDirection: 'column', gap: '1rem' }}>
|
|
340
|
+
<Input
|
|
341
|
+
label="Name"
|
|
342
|
+
value={formData.name}
|
|
343
|
+
onChange={(e) => setFormData({ ...formData, name: e.target.value })}
|
|
344
|
+
required
|
|
345
|
+
/>
|
|
346
|
+
<Input
|
|
347
|
+
label="Email"
|
|
348
|
+
type="email"
|
|
349
|
+
value={formData.email}
|
|
350
|
+
onChange={(e) => setFormData({ ...formData, email: e.target.value })}
|
|
351
|
+
required
|
|
352
|
+
/>
|
|
353
|
+
<Select
|
|
354
|
+
label="Category"
|
|
355
|
+
options={[
|
|
356
|
+
{ value: 'general', label: 'General Inquiry' },
|
|
357
|
+
{ value: 'support', label: 'Support' },
|
|
358
|
+
{ value: 'feedback', label: 'Feedback' }
|
|
359
|
+
]}
|
|
360
|
+
value={formData.category}
|
|
361
|
+
onChange={setFormData({ ...formData, category: value })}
|
|
362
|
+
/>
|
|
363
|
+
<Textarea
|
|
364
|
+
label="Message"
|
|
365
|
+
value={formData.message}
|
|
366
|
+
onChange={(e) => setFormData({ ...formData, message: e.target.value })}
|
|
367
|
+
rows={4}
|
|
368
|
+
/>
|
|
369
|
+
<Button variant="primary" type="submit">
|
|
370
|
+
Send Message
|
|
371
|
+
</Button>
|
|
372
|
+
</div>
|
|
373
|
+
</CardContent>
|
|
374
|
+
</Card>
|
|
375
|
+
);
|
|
376
|
+
}
|
|
377
|
+
```
|
|
378
|
+
|
|
379
|
+
### Layout with Sidebar
|
|
380
|
+
|
|
381
|
+
```tsx
|
|
382
|
+
import { Layout, Sidebar, Page, StatusBar } from '@papernote/ui';
|
|
383
|
+
import { Home, Users, Settings } from 'lucide-react';
|
|
384
|
+
|
|
385
|
+
const menuItems = [
|
|
386
|
+
{ id: 'home', label: 'Home', icon: <Home />, href: '/' },
|
|
387
|
+
{ id: 'users', label: 'Users', icon: <Users />, href: '/users' },
|
|
388
|
+
{ id: 'settings', label: 'Settings', icon: <Settings />, href: '/settings' },
|
|
389
|
+
];
|
|
390
|
+
|
|
391
|
+
function App() {
|
|
392
|
+
return (
|
|
393
|
+
<Layout
|
|
394
|
+
sidebar={<Sidebar items={menuItems} />}
|
|
395
|
+
statusBar={<StatusBar />}
|
|
396
|
+
>
|
|
397
|
+
<Page>
|
|
398
|
+
{/* Your page content */}
|
|
399
|
+
</Page>
|
|
400
|
+
</Layout>
|
|
401
|
+
);
|
|
402
|
+
}
|
|
403
|
+
```
|
|
404
|
+
|
|
405
|
+
## 🛠️ Development
|
|
406
|
+
|
|
407
|
+
```bash
|
|
408
|
+
# Install dependencies
|
|
409
|
+
npm install
|
|
410
|
+
|
|
411
|
+
# Build library
|
|
412
|
+
npm run build
|
|
413
|
+
|
|
414
|
+
# Build Storybook
|
|
415
|
+
npm run build-storybook
|
|
416
|
+
|
|
417
|
+
# Type check
|
|
418
|
+
npm run typecheck
|
|
419
|
+
|
|
420
|
+
# Lint
|
|
421
|
+
npm run lint
|
|
422
|
+
```
|
|
423
|
+
|
|
424
|
+
## 📖 Documentation
|
|
425
|
+
|
|
426
|
+
- **[Storybook Live Demo](https://691fcf89b3393605ea470e93-rzwuumklem.chromatic.com/)** - Interactive component playground with 500+ examples
|
|
427
|
+
- **[npm Package](https://www.npmjs.com/package/@papernote/ui)** - Package registry
|
|
428
|
+
- **[GitHub Repository](https://github.com/kwhittenberger/papernote-ui)** - Source code
|
|
429
|
+
|
|
430
|
+
## 🤝 Contributing
|
|
431
|
+
|
|
432
|
+
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
|
|
433
|
+
|
|
434
|
+
1. Fork the repository
|
|
435
|
+
2. Create your feature branch (`git checkout -b feature/amazing-feature`)
|
|
436
|
+
3. Commit your changes (`git commit -m 'Add some amazing feature'`)
|
|
437
|
+
4. Push to the branch (`git push origin feature/amazing-feature`)
|
|
438
|
+
5. Open a Pull Request
|
|
439
|
+
|
|
440
|
+
## 📄 License
|
|
441
|
+
|
|
442
|
+
MIT License - Copyright (c) 2025 kwhittenberger
|
|
443
|
+
|
|
444
|
+
See [LICENSE](./LICENSE) for full details.
|
|
445
|
+
|
|
446
|
+
## 🙏 Credits
|
|
447
|
+
|
|
448
|
+
Inspired by the minimal, professional aesthetic of quality paper notebooks and Claude's interface design.
|
|
449
|
+
|
|
450
|
+
## 🔗 Links
|
|
451
|
+
|
|
452
|
+
- [npm Package](https://www.npmjs.com/package/@papernote/ui)
|
|
453
|
+
- [Live Storybook](https://691fcf89b3393605ea470e93-rzwuumklem.chromatic.com/)
|
|
454
|
+
- [GitHub Repository](https://github.com/kwhittenberger/papernote-ui)
|
|
455
|
+
- [Report Issues](https://github.com/kwhittenberger/papernote-ui/issues)
|