@papernote/ui 1.1.0 → 1.3.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 (114) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +455 -455
  3. package/dist/components/Box.d.ts +2 -1
  4. package/dist/components/Box.d.ts.map +1 -1
  5. package/dist/components/Button.d.ts +10 -1
  6. package/dist/components/Button.d.ts.map +1 -1
  7. package/dist/components/Card.d.ts +11 -2
  8. package/dist/components/Card.d.ts.map +1 -1
  9. package/dist/components/CurrencyInput.d.ts +52 -0
  10. package/dist/components/CurrencyInput.d.ts.map +1 -0
  11. package/dist/components/DataTable.d.ts +19 -3
  12. package/dist/components/DataTable.d.ts.map +1 -1
  13. package/dist/components/EmptyState.d.ts +3 -1
  14. package/dist/components/EmptyState.d.ts.map +1 -1
  15. package/dist/components/Grid.d.ts +4 -2
  16. package/dist/components/Grid.d.ts.map +1 -1
  17. package/dist/components/Input.d.ts +2 -0
  18. package/dist/components/Input.d.ts.map +1 -1
  19. package/dist/components/Modal.d.ts.map +1 -1
  20. package/dist/components/MultiSelect.d.ts +13 -1
  21. package/dist/components/MultiSelect.d.ts.map +1 -1
  22. package/dist/components/Page.d.ts +2 -0
  23. package/dist/components/Page.d.ts.map +1 -1
  24. package/dist/components/PageLayout.d.ts +5 -1
  25. package/dist/components/PageLayout.d.ts.map +1 -1
  26. package/dist/components/Stack.d.ts +25 -5
  27. package/dist/components/Stack.d.ts.map +1 -1
  28. package/dist/components/Text.d.ts +20 -4
  29. package/dist/components/Text.d.ts.map +1 -1
  30. package/dist/components/Textarea.d.ts +2 -0
  31. package/dist/components/Textarea.d.ts.map +1 -1
  32. package/dist/components/index.d.ts +5 -3
  33. package/dist/components/index.d.ts.map +1 -1
  34. package/dist/index.d.ts +311 -49
  35. package/dist/index.esm.js +557 -224
  36. package/dist/index.esm.js.map +1 -1
  37. package/dist/index.js +555 -219
  38. package/dist/index.js.map +1 -1
  39. package/dist/styles.css +2838 -2679
  40. package/dist/utils/excelExport.d.ts +143 -0
  41. package/dist/utils/excelExport.d.ts.map +1 -0
  42. package/dist/utils/index.d.ts +2 -0
  43. package/dist/utils/index.d.ts.map +1 -1
  44. package/package.json +1 -1
  45. package/src/components/AdminModal.css +49 -49
  46. package/src/components/Box.stories.tsx +377 -0
  47. package/src/components/Box.tsx +8 -4
  48. package/src/components/Button.tsx +23 -10
  49. package/src/components/Card.tsx +20 -5
  50. package/src/components/CurrencyInput.stories.tsx +290 -0
  51. package/src/components/CurrencyInput.tsx +193 -0
  52. package/src/components/DataTable.stories.tsx +36 -25
  53. package/src/components/DataTable.tsx +170 -16
  54. package/src/components/EmptyState.stories.tsx +124 -72
  55. package/src/components/EmptyState.tsx +10 -0
  56. package/src/components/Grid.stories.tsx +348 -0
  57. package/src/components/Grid.tsx +12 -5
  58. package/src/components/Input.tsx +12 -2
  59. package/src/components/Modal.stories.tsx +64 -0
  60. package/src/components/Modal.tsx +15 -2
  61. package/src/components/MultiSelect.tsx +41 -10
  62. package/src/components/Page.stories.tsx +76 -0
  63. package/src/components/Page.tsx +35 -3
  64. package/src/components/PageLayout.stories.tsx +75 -0
  65. package/src/components/PageLayout.tsx +28 -9
  66. package/src/components/RoleManager.css +10 -10
  67. package/src/components/Spreadsheet.css +216 -216
  68. package/src/components/Spreadsheet.stories.tsx +362 -362
  69. package/src/components/Spreadsheet.tsx +351 -351
  70. package/src/components/SpreadsheetSimple.stories.tsx +27 -27
  71. package/src/components/Stack.stories.tsx +24 -1
  72. package/src/components/Stack.tsx +40 -10
  73. package/src/components/Tabs.tsx +152 -152
  74. package/src/components/Text.stories.tsx +273 -0
  75. package/src/components/Text.tsx +33 -8
  76. package/src/components/Textarea.tsx +32 -21
  77. package/src/components/index.ts +6 -4
  78. package/src/styles/index.css +41 -4
  79. package/src/utils/excelExport.stories.tsx +535 -0
  80. package/src/utils/excelExport.ts +225 -0
  81. package/src/utils/index.ts +3 -0
  82. package/tailwind.config.js +253 -253
  83. package/dist/components/Button.stories.d.ts +0 -51
  84. package/dist/components/Button.stories.d.ts.map +0 -1
  85. package/dist/components/ChartVisualizationUI.d.ts +0 -21
  86. package/dist/components/ChartVisualizationUI.d.ts.map +0 -1
  87. package/dist/components/ChatUI.d.ts +0 -23
  88. package/dist/components/ChatUI.d.ts.map +0 -1
  89. package/dist/components/CommissionDashboardUI.d.ts +0 -25
  90. package/dist/components/CommissionDashboardUI.d.ts.map +0 -1
  91. package/dist/components/DataTable.stories.d.ts +0 -23
  92. package/dist/components/DataTable.stories.d.ts.map +0 -1
  93. package/dist/components/FormField.d.ts +0 -35
  94. package/dist/components/FormField.d.ts.map +0 -1
  95. package/dist/components/Input.stories.d.ts +0 -366
  96. package/dist/components/Input.stories.d.ts.map +0 -1
  97. package/dist/components/InsightsPanelUI.d.ts +0 -21
  98. package/dist/components/InsightsPanelUI.d.ts.map +0 -1
  99. package/dist/components/PaymentHistoryTimeline.d.ts +0 -34
  100. package/dist/components/PaymentHistoryTimeline.d.ts.map +0 -1
  101. package/dist/components/RelationshipManagerUI.d.ts +0 -60
  102. package/dist/components/RelationshipManagerUI.d.ts.map +0 -1
  103. package/dist/components/RoleManager.d.ts +0 -19
  104. package/dist/components/RoleManager.d.ts.map +0 -1
  105. package/dist/components/SplitCommissionBadge.d.ts +0 -18
  106. package/dist/components/SplitCommissionBadge.d.ts.map +0 -1
  107. package/dist/components/Spreadsheet.css +0 -216
  108. package/dist/components/Table.d.ts +0 -26
  109. package/dist/components/Table.d.ts.map +0 -1
  110. package/dist/components/__tests__/Button.test.d.ts +0 -2
  111. package/dist/components/__tests__/Button.test.d.ts.map +0 -1
  112. package/dist/components/__tests__/Input.test.d.ts +0 -2
  113. package/dist/components/__tests__/Input.test.d.ts.map +0 -1
  114. package/src/components/Table.tsx +0 -239
@@ -278,3 +278,79 @@ export const SettingsPage: Story = {
278
278
  </Page>
279
279
  ),
280
280
  };
281
+
282
+ export const ResponsiveLayout: Story = {
283
+ render: () => (
284
+ <Page>
285
+ <Card style={{ marginBottom: '1.5rem', backgroundColor: '#dbeafe', border: '1px solid #3b82f6' }}>
286
+ <CardContent>
287
+ <h3 style={{ fontWeight: 600, marginBottom: '0.75rem', fontSize: '0.875rem', color: '#1e40af' }}>
288
+ 📐 Responsive Layout (Default)
289
+ </h3>
290
+ <p style={{ fontSize: '0.875rem', marginBottom: '0.5rem' }}>
291
+ Try resizing your browser window! The page keeps <strong>left and top margins/padding fixed</strong>,
292
+ but <strong>right and bottom resize responsively</strong>:
293
+ </p>
294
+ <ul style={{ marginLeft: '1.5rem', fontSize: '0.875rem' }}>
295
+ <li>• Small screens: Minimal right/bottom padding for more content space</li>
296
+ <li>• Medium screens: Increased right/bottom padding</li>
297
+ <li>• Large screens (1024px+): Maximum spacing with centered layout</li>
298
+ </ul>
299
+ </CardContent>
300
+ </Card>
301
+ <Card>
302
+ <CardHeader>
303
+ <CardTitle>Content Adapts to Screen Size</CardTitle>
304
+ </CardHeader>
305
+ <CardContent>
306
+ <p style={{ marginBottom: '1rem' }}>
307
+ This is the default responsive behavior. The notebook aesthetic is maintained
308
+ across all screen sizes while optimizing for available space.
309
+ </p>
310
+ <p>
311
+ The left binding edge and top margin stay consistent (maintaining the notebook look),
312
+ while right and bottom spacing adjusts for comfort on different devices.
313
+ </p>
314
+ </CardContent>
315
+ </Card>
316
+ </Page>
317
+ ),
318
+ };
319
+
320
+ export const FixedLayout: Story = {
321
+ render: () => (
322
+ <Page fixed={true}>
323
+ <Card style={{ marginBottom: '1.5rem', backgroundColor: '#fef3c7', border: '1px solid #f59e0b' }}>
324
+ <CardContent>
325
+ <h3 style={{ fontWeight: 600, marginBottom: '0.75rem', fontSize: '0.875rem', color: '#92400e' }}>
326
+ 📌 Fixed Layout (fixed=true)
327
+ </h3>
328
+ <p style={{ fontSize: '0.875rem', marginBottom: '0.5rem' }}>
329
+ This page uses <code style={{ backgroundColor: '#fff', padding: '0.125rem 0.375rem', borderRadius: '0.25rem' }}>fixed=true</code>.
330
+ All margins and padding stay <strong>constant regardless of screen size</strong>:
331
+ </p>
332
+ <ul style={{ marginLeft: '1.5rem', fontSize: '0.875rem' }}>
333
+ <li>• Left, right, top, and bottom spacing never changes</li>
334
+ <li>• Consistent appearance on all devices</li>
335
+ <li>• May use more horizontal space on large screens</li>
336
+ </ul>
337
+ </CardContent>
338
+ </Card>
339
+ <Card>
340
+ <CardHeader>
341
+ <CardTitle>Consistent Spacing Everywhere</CardTitle>
342
+ </CardHeader>
343
+ <CardContent>
344
+ <p style={{ marginBottom: '1rem' }}>
345
+ Use the <code style={{ backgroundColor: '#f5f5f5', padding: '0.25rem 0.5rem', borderRadius: '0.25rem' }}>fixed</code> prop
346
+ when you need absolute consistency across all screen sizes, or when the responsive
347
+ behavior doesn't match your design requirements.
348
+ </p>
349
+ <p>
350
+ Try resizing your browser - the spacing around this page content remains identical.
351
+ </p>
352
+ </CardContent>
353
+ </Card>
354
+ </Page>
355
+ ),
356
+ };
@@ -12,6 +12,8 @@ export interface PageProps {
12
12
  className?: string;
13
13
  /** Padding size around the content (default: 'normal') */
14
14
  padding?: 'none' | 'sm' | 'normal' | 'lg';
15
+ /** Fix all margins/padding instead of responsive (default: false) */
16
+ fixed?: boolean;
15
17
  }
16
18
 
17
19
  /**
@@ -47,14 +49,44 @@ export interface PageProps {
47
49
  */
48
50
  export const Page: React.FC<PageProps> = ({
49
51
  children,
50
- maxWidth: _maxWidth = '7xl',
52
+ maxWidth = '7xl',
51
53
  className = '',
52
- padding: _padding = 'normal'
54
+ padding = 'normal',
55
+ fixed = false
53
56
  }) => {
57
+ // Max width classes
58
+ const maxWidthClasses = {
59
+ '4xl': 'max-w-4xl',
60
+ '5xl': 'max-w-5xl',
61
+ '6xl': 'max-w-6xl',
62
+ '7xl': 'max-w-7xl',
63
+ 'full': 'max-w-full',
64
+ };
65
+
66
+ // Padding classes - responsive (fixed left/top, responsive right/bottom) vs all fixed
67
+ const paddingClasses = {
68
+ none: fixed ? 'p-0' : 'pt-0 pl-0 pr-0 pb-0',
69
+ sm: fixed ? 'p-4' : 'pt-4 pl-4 pr-4 pb-4 sm:pr-6 md:pr-8 sm:pb-6 md:pb-8',
70
+ normal: fixed ? 'pt-12 pl-20 pr-16 pb-12' : 'pt-12 pl-20 pr-4 pb-4 sm:pr-8 md:pr-12 lg:pr-16 sm:pb-8 md:pb-12 lg:pb-16',
71
+ lg: fixed ? 'pt-16 pl-24 pr-20 pb-16' : 'pt-16 pl-24 pr-6 pb-6 sm:pr-12 md:pr-16 lg:pr-20 sm:pb-12 md:pb-16 lg:pb-20',
72
+ };
73
+
74
+ // Margin classes - responsive (fixed left/top, responsive right/bottom) vs all fixed
75
+ const marginClasses = fixed
76
+ ? 'mt-4 ml-4 mr-4 mb-4'
77
+ : 'mt-4 ml-4 mr-4 mb-4 sm:mr-6 md:mr-8 lg:mr-auto sm:mb-6 md:mb-8';
54
78
 
55
79
  return (
56
80
  <div className="min-h-screen bg-paper-100">
57
- <div className={`notebook-page notebook-margin notebook-ruled ${className}`}>
81
+ <div className={`
82
+ bg-white bg-subtle-grain rounded-sm shadow-lg border-l-4 border-paper-300
83
+ min-h-[calc(100vh-2rem)] relative
84
+ notebook-margin notebook-ruled
85
+ ${maxWidthClasses[maxWidth]}
86
+ ${paddingClasses[padding]}
87
+ ${marginClasses}
88
+ ${className}
89
+ `.trim().replace(/\s+/g, ' ')}>
58
90
  {children}
59
91
  </div>
60
92
  </div>
@@ -586,3 +586,78 @@ export const WithSidebarAndGutter: Story = {
586
586
  );
587
587
  },
588
588
  };
589
+
590
+ export const ResponsiveLayout: Story = {
591
+ render: () => (
592
+ <PageLayout
593
+ title="Responsive PageLayout"
594
+ description="Default responsive behavior - resize your browser to see the right and bottom padding adapt"
595
+ >
596
+ <Card style={{ marginBottom: '1.5rem', backgroundColor: '#dbeafe', border: '1px solid #3b82f6' }}>
597
+ <CardContent>
598
+ <h3 style={{ fontWeight: 600, marginBottom: '0.75rem', fontSize: '0.875rem', color: '#1e40af' }}>
599
+ 📐 Responsive Layout (Default)
600
+ </h3>
601
+ <p style={{ fontSize: '0.875rem', marginBottom: '0.5rem' }}>
602
+ Try resizing your browser window! PageLayout keeps <strong>left and top padding fixed</strong>,
603
+ but <strong>right and bottom resize responsively</strong>:
604
+ </p>
605
+ <ul style={{ marginLeft: '1.5rem', fontSize: '0.875rem' }}>
606
+ <li>• Small screens: Minimal right/bottom padding (pr-2 pb-8)</li>
607
+ <li>• Medium screens (640px+): Increased padding (pr-4 pb-12)</li>
608
+ <li>• Large screens (768px+): More padding (pr-6 pb-16)</li>
609
+ <li>• XL screens (1024px+): Maximum padding (pb-20)</li>
610
+ </ul>
611
+ </CardContent>
612
+ </Card>
613
+ <Card>
614
+ <CardHeader>
615
+ <CardTitle>Content Adapts to Screen Size</CardTitle>
616
+ </CardHeader>
617
+ <CardContent>
618
+ <p>
619
+ This is perfect for applications where you want the notebook aesthetic to be
620
+ maintained while optimizing for different device sizes.
621
+ </p>
622
+ </CardContent>
623
+ </Card>
624
+ </PageLayout>
625
+ ),
626
+ };
627
+
628
+ export const FixedLayout: Story = {
629
+ render: () => (
630
+ <PageLayout
631
+ title="Fixed PageLayout"
632
+ description="All padding remains constant regardless of screen size"
633
+ fixed={true}
634
+ >
635
+ <Card style={{ marginBottom: '1.5rem', backgroundColor: '#fef3c7', border: '1px solid #f59e0b' }}>
636
+ <CardContent>
637
+ <h3 style={{ fontWeight: 600, marginBottom: '0.75rem', fontSize: '0.875rem', color: '#92400e' }}>
638
+ 📌 Fixed Layout (fixed=true)
639
+ </h3>
640
+ <p style={{ fontSize: '0.875rem', marginBottom: '0.5rem' }}>
641
+ This page uses <code style={{ backgroundColor: '#fff', padding: '0.125rem 0.375rem', borderRadius: '0.25rem' }}>fixed=true</code>.
642
+ All padding stays <strong>constant regardless of screen size</strong>:
643
+ </p>
644
+ <ul style={{ marginLeft: '1.5rem', fontSize: '0.875rem' }}>
645
+ <li>• Same padding on mobile and desktop</li>
646
+ <li>• Predictable layout at all viewport sizes</li>
647
+ <li>• Use when you need absolute consistency</li>
648
+ </ul>
649
+ </CardContent>
650
+ </Card>
651
+ <Card>
652
+ <CardHeader>
653
+ <CardTitle>Consistent Everywhere</CardTitle>
654
+ </CardHeader>
655
+ <CardContent>
656
+ <p>
657
+ Try resizing your browser - the spacing remains identical at all screen sizes.
658
+ </p>
659
+ </CardContent>
660
+ </Card>
661
+ </PageLayout>
662
+ ),
663
+ };
@@ -12,6 +12,10 @@ export interface PageLayoutProps {
12
12
  className?: string;
13
13
  /** Optional content to render before the title (e.g., breadcrumbs, alerts, control bars) */
14
14
  headerContent?: ReactNode;
15
+ /** Maximum width constraint for the page content (default: '7xl' = 1400px) */
16
+ maxWidth?: '4xl' | '5xl' | '6xl' | '7xl' | 'full';
17
+ /** Fix all margins/padding instead of responsive (default: false) */
18
+ fixed?: boolean;
15
19
  }
16
20
 
17
21
  /**
@@ -51,19 +55,34 @@ export interface PageLayoutProps {
51
55
  * </Layout>
52
56
  * ```
53
57
  */
54
- export function PageLayout({
55
- title,
56
- description,
57
- children,
58
+ export function PageLayout({
59
+ title,
60
+ description,
61
+ children,
58
62
  className = '',
59
- headerContent
63
+ headerContent,
64
+ maxWidth = '7xl',
65
+ fixed = false
60
66
  }: PageLayoutProps) {
67
+ // Responsive padding classes - fixed left/top, responsive right/bottom
68
+ const paddingClasses = fixed
69
+ ? 'p-6 pb-20'
70
+ : 'pt-6 pl-6 pr-2 pb-8 sm:pr-4 md:pr-6 sm:pb-12 md:pb-16 lg:pb-20';
71
+
72
+ const maxWidthClasses = {
73
+ '4xl': 'max-w-4xl',
74
+ '5xl': 'max-w-5xl',
75
+ '6xl': 'max-w-6xl',
76
+ '7xl': 'max-w-7xl',
77
+ 'full': 'max-w-full',
78
+ };
79
+
61
80
  return (
62
- <Page>
81
+ <Page padding="none" maxWidth={maxWidth} fixed={fixed}>
63
82
  {/* Content before title (e.g., ControlBar) */}
64
83
  {headerContent}
65
-
66
- <div className={`p-6 max-w-7xl mx-auto pb-20 ${className}`}>
84
+
85
+ <div className={`${paddingClasses} ${maxWidthClasses[maxWidth]} mx-auto ${className}`}>
67
86
  {/* Header */}
68
87
  <div className="mb-8">
69
88
  <h1 className="text-3xl font-bold text-ink-900 mb-2">{title}</h1>
@@ -71,7 +90,7 @@ export function PageLayout({
71
90
  <p className="text-ink-600">{description}</p>
72
91
  )}
73
92
  </div>
74
-
93
+
75
94
  {children}
76
95
  </div>
77
96
  </Page>
@@ -1,10 +1,10 @@
1
- /* RoleManager.css - Styles for RoleManager component */
2
-
3
- .role-manager-permission-grid {
4
- grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
5
- }
6
-
7
- .role-manager-list {
8
- height: var(--role-manager-height, 400px);
9
- min-height: 200px;
10
- }
1
+ /* RoleManager.css - Styles for RoleManager component */
2
+
3
+ .role-manager-permission-grid {
4
+ grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
5
+ }
6
+
7
+ .role-manager-list {
8
+ height: var(--role-manager-height, 400px);
9
+ min-height: 200px;
10
+ }