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