@papernote/ui 1.8.0 → 1.8.2
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/dist/components/PageLayout.d.ts +22 -2
- package/dist/components/PageLayout.d.ts.map +1 -1
- package/dist/index.d.ts +74 -55
- package/dist/index.esm.js +17 -2
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +17 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/PageLayout.tsx +56 -9
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
+
import { PageHeaderAction } from './PageHeader';
|
|
2
3
|
export interface PageLayoutProps {
|
|
3
|
-
/** Page title displayed at the top */
|
|
4
|
+
/** Page title displayed at the top (also used for document title) */
|
|
4
5
|
title: string;
|
|
5
6
|
/** Optional subtitle/description text below the title */
|
|
6
7
|
description?: string;
|
|
@@ -14,6 +15,10 @@ export interface PageLayoutProps {
|
|
|
14
15
|
maxWidth?: '4xl' | '5xl' | '6xl' | '7xl' | 'full';
|
|
15
16
|
/** Fix all margins/padding instead of responsive (default: false) */
|
|
16
17
|
fixed?: boolean;
|
|
18
|
+
/** Page-level action buttons rendered inline with title */
|
|
19
|
+
actions?: PageHeaderAction[];
|
|
20
|
+
/** Custom content to render on the right (instead of actions) */
|
|
21
|
+
rightContent?: ReactNode;
|
|
17
22
|
}
|
|
18
23
|
/**
|
|
19
24
|
* PageLayout - Standard page layout with title, description, and content
|
|
@@ -43,6 +48,21 @@ export interface PageLayoutProps {
|
|
|
43
48
|
* </PageLayout>
|
|
44
49
|
* ```
|
|
45
50
|
*
|
|
51
|
+
* @example With actions
|
|
52
|
+
* ```tsx
|
|
53
|
+
* <PageLayout
|
|
54
|
+
* title="Products"
|
|
55
|
+
* description="Manage your product catalog"
|
|
56
|
+
* headerContent={<Breadcrumbs items={[{ label: 'Home', href: '/' }, { label: 'Products' }]} />}
|
|
57
|
+
* actions={[
|
|
58
|
+
* { id: 'export', label: 'Export', icon: <Download />, onClick: handleExport, variant: 'ghost' },
|
|
59
|
+
* { id: 'add', label: 'Add Product', icon: <Plus />, onClick: handleAdd, variant: 'primary' },
|
|
60
|
+
* ]}
|
|
61
|
+
* >
|
|
62
|
+
* <DataTable data={products} columns={columns} />
|
|
63
|
+
* </PageLayout>
|
|
64
|
+
* ```
|
|
65
|
+
*
|
|
46
66
|
* @example With Layout for sidebar and gutter
|
|
47
67
|
* ```tsx
|
|
48
68
|
* <Layout sidebar={<Sidebar items={items} />}>
|
|
@@ -52,5 +72,5 @@ export interface PageLayoutProps {
|
|
|
52
72
|
* </Layout>
|
|
53
73
|
* ```
|
|
54
74
|
*/
|
|
55
|
-
export declare function PageLayout({ title, description, children, className, headerContent, maxWidth, fixed }: PageLayoutProps): import("react/jsx-runtime").JSX.Element;
|
|
75
|
+
export declare function PageLayout({ title, description, children, className, headerContent, maxWidth, fixed, actions, rightContent, }: PageLayoutProps): import("react/jsx-runtime").JSX.Element;
|
|
56
76
|
//# sourceMappingURL=PageLayout.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PageLayout.d.ts","sourceRoot":"","sources":["../../src/components/PageLayout.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"PageLayout.d.ts","sourceRoot":"","sources":["../../src/components/PageLayout.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAKhD,MAAM,WAAW,eAAe;IAC9B,qEAAqE;IACrE,KAAK,EAAE,MAAM,CAAC;IACd,yDAAyD;IACzD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,wBAAwB;IACxB,QAAQ,EAAE,SAAS,CAAC;IACpB,6DAA6D;IAC7D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,4FAA4F;IAC5F,aAAa,CAAC,EAAE,SAAS,CAAC;IAC1B,8EAA8E;IAC9E,QAAQ,CAAC,EAAE,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,MAAM,CAAC;IAClD,qEAAqE;IACrE,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,2DAA2D;IAC3D,OAAO,CAAC,EAAE,gBAAgB,EAAE,CAAC;IAC7B,iEAAiE;IACjE,YAAY,CAAC,EAAE,SAAS,CAAC;CAC1B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmDG;AACH,wBAAgB,UAAU,CAAC,EACzB,KAAK,EACL,WAAW,EACX,QAAQ,EACR,SAAc,EACd,aAAa,EACb,QAAgB,EAChB,KAAa,EACb,OAAO,EACP,YAAY,GACb,EAAE,eAAe,2CAsDjB"}
|
package/dist/index.d.ts
CHANGED
|
@@ -5294,61 +5294,6 @@ interface AppLayoutProps {
|
|
|
5294
5294
|
}
|
|
5295
5295
|
declare const AppLayout: React__default.FC<AppLayoutProps>;
|
|
5296
5296
|
|
|
5297
|
-
interface PageLayoutProps {
|
|
5298
|
-
/** Page title displayed at the top */
|
|
5299
|
-
title: string;
|
|
5300
|
-
/** Optional subtitle/description text below the title */
|
|
5301
|
-
description?: string;
|
|
5302
|
-
/** Main page content */
|
|
5303
|
-
children: ReactNode;
|
|
5304
|
-
/** Additional CSS classes to apply to the content wrapper */
|
|
5305
|
-
className?: string;
|
|
5306
|
-
/** Optional content to render before the title (e.g., breadcrumbs, alerts, control bars) */
|
|
5307
|
-
headerContent?: ReactNode;
|
|
5308
|
-
/** Maximum width constraint for the page content (default: '7xl' = 1400px) */
|
|
5309
|
-
maxWidth?: '4xl' | '5xl' | '6xl' | '7xl' | 'full';
|
|
5310
|
-
/** Fix all margins/padding instead of responsive (default: false) */
|
|
5311
|
-
fixed?: boolean;
|
|
5312
|
-
}
|
|
5313
|
-
/**
|
|
5314
|
-
* PageLayout - Standard page layout with title, description, and content
|
|
5315
|
-
*
|
|
5316
|
-
* A high-level layout component that provides consistent page structure across your application.
|
|
5317
|
-
* Wraps content in the Page component to include notebook styling (paper texture, ruled lines,
|
|
5318
|
-
* red margin line).
|
|
5319
|
-
*
|
|
5320
|
-
* **Note**: PageLayout does NOT include the sidebar or gutter. For a complete app layout with
|
|
5321
|
-
* sidebar and gutter navigation, use the Layout component instead and wrap this inside it.
|
|
5322
|
-
*
|
|
5323
|
-
* **Component Hierarchy**:
|
|
5324
|
-
* - **Page** - Just paper with notebook styling (lowest level)
|
|
5325
|
-
* - **PageLayout** - Page + title + description (this component)
|
|
5326
|
-
* - **Layout** - Sidebar + gutter + content area (includes PageLayout or Page inside)
|
|
5327
|
-
*
|
|
5328
|
-
* @example Basic page with title
|
|
5329
|
-
* ```tsx
|
|
5330
|
-
* <PageLayout
|
|
5331
|
-
* title="Dashboard"
|
|
5332
|
-
* description="Overview of your metrics"
|
|
5333
|
-
* headerContent={<Breadcrumbs />}
|
|
5334
|
-
* >
|
|
5335
|
-
* <Card>
|
|
5336
|
-
* <CardContent>Your dashboard content</CardContent>
|
|
5337
|
-
* </Card>
|
|
5338
|
-
* </PageLayout>
|
|
5339
|
-
* ```
|
|
5340
|
-
*
|
|
5341
|
-
* @example With Layout for sidebar and gutter
|
|
5342
|
-
* ```tsx
|
|
5343
|
-
* <Layout sidebar={<Sidebar items={items} />}>
|
|
5344
|
-
* <PageLayout title="Dashboard" description="Overview">
|
|
5345
|
-
* <Card>Content</Card>
|
|
5346
|
-
* </PageLayout>
|
|
5347
|
-
* </Layout>
|
|
5348
|
-
* ```
|
|
5349
|
-
*/
|
|
5350
|
-
declare function PageLayout({ title, description, children, className, headerContent, maxWidth, fixed }: PageLayoutProps): react_jsx_runtime.JSX.Element;
|
|
5351
|
-
|
|
5352
5297
|
interface PageHeaderAction {
|
|
5353
5298
|
/** Unique identifier for the action */
|
|
5354
5299
|
id: string;
|
|
@@ -5433,6 +5378,80 @@ interface PageHeaderProps {
|
|
|
5433
5378
|
*/
|
|
5434
5379
|
declare function PageHeader({ title, subtitle, breadcrumbs, showHomeBreadcrumb, actions, rightContent, belowTitle, className, sticky, backButton, }: PageHeaderProps): react_jsx_runtime.JSX.Element;
|
|
5435
5380
|
|
|
5381
|
+
interface PageLayoutProps {
|
|
5382
|
+
/** Page title displayed at the top (also used for document title) */
|
|
5383
|
+
title: string;
|
|
5384
|
+
/** Optional subtitle/description text below the title */
|
|
5385
|
+
description?: string;
|
|
5386
|
+
/** Main page content */
|
|
5387
|
+
children: ReactNode;
|
|
5388
|
+
/** Additional CSS classes to apply to the content wrapper */
|
|
5389
|
+
className?: string;
|
|
5390
|
+
/** Optional content to render before the title (e.g., breadcrumbs, alerts, control bars) */
|
|
5391
|
+
headerContent?: ReactNode;
|
|
5392
|
+
/** Maximum width constraint for the page content (default: '7xl' = 1400px) */
|
|
5393
|
+
maxWidth?: '4xl' | '5xl' | '6xl' | '7xl' | 'full';
|
|
5394
|
+
/** Fix all margins/padding instead of responsive (default: false) */
|
|
5395
|
+
fixed?: boolean;
|
|
5396
|
+
/** Page-level action buttons rendered inline with title */
|
|
5397
|
+
actions?: PageHeaderAction[];
|
|
5398
|
+
/** Custom content to render on the right (instead of actions) */
|
|
5399
|
+
rightContent?: ReactNode;
|
|
5400
|
+
}
|
|
5401
|
+
/**
|
|
5402
|
+
* PageLayout - Standard page layout with title, description, and content
|
|
5403
|
+
*
|
|
5404
|
+
* A high-level layout component that provides consistent page structure across your application.
|
|
5405
|
+
* Wraps content in the Page component to include notebook styling (paper texture, ruled lines,
|
|
5406
|
+
* red margin line).
|
|
5407
|
+
*
|
|
5408
|
+
* **Note**: PageLayout does NOT include the sidebar or gutter. For a complete app layout with
|
|
5409
|
+
* sidebar and gutter navigation, use the Layout component instead and wrap this inside it.
|
|
5410
|
+
*
|
|
5411
|
+
* **Component Hierarchy**:
|
|
5412
|
+
* - **Page** - Just paper with notebook styling (lowest level)
|
|
5413
|
+
* - **PageLayout** - Page + title + description (this component)
|
|
5414
|
+
* - **Layout** - Sidebar + gutter + content area (includes PageLayout or Page inside)
|
|
5415
|
+
*
|
|
5416
|
+
* @example Basic page with title
|
|
5417
|
+
* ```tsx
|
|
5418
|
+
* <PageLayout
|
|
5419
|
+
* title="Dashboard"
|
|
5420
|
+
* description="Overview of your metrics"
|
|
5421
|
+
* headerContent={<Breadcrumbs />}
|
|
5422
|
+
* >
|
|
5423
|
+
* <Card>
|
|
5424
|
+
* <CardContent>Your dashboard content</CardContent>
|
|
5425
|
+
* </Card>
|
|
5426
|
+
* </PageLayout>
|
|
5427
|
+
* ```
|
|
5428
|
+
*
|
|
5429
|
+
* @example With actions
|
|
5430
|
+
* ```tsx
|
|
5431
|
+
* <PageLayout
|
|
5432
|
+
* title="Products"
|
|
5433
|
+
* description="Manage your product catalog"
|
|
5434
|
+
* headerContent={<Breadcrumbs items={[{ label: 'Home', href: '/' }, { label: 'Products' }]} />}
|
|
5435
|
+
* actions={[
|
|
5436
|
+
* { id: 'export', label: 'Export', icon: <Download />, onClick: handleExport, variant: 'ghost' },
|
|
5437
|
+
* { id: 'add', label: 'Add Product', icon: <Plus />, onClick: handleAdd, variant: 'primary' },
|
|
5438
|
+
* ]}
|
|
5439
|
+
* >
|
|
5440
|
+
* <DataTable data={products} columns={columns} />
|
|
5441
|
+
* </PageLayout>
|
|
5442
|
+
* ```
|
|
5443
|
+
*
|
|
5444
|
+
* @example With Layout for sidebar and gutter
|
|
5445
|
+
* ```tsx
|
|
5446
|
+
* <Layout sidebar={<Sidebar items={items} />}>
|
|
5447
|
+
* <PageLayout title="Dashboard" description="Overview">
|
|
5448
|
+
* <Card>Content</Card>
|
|
5449
|
+
* </PageLayout>
|
|
5450
|
+
* </Layout>
|
|
5451
|
+
* ```
|
|
5452
|
+
*/
|
|
5453
|
+
declare function PageLayout({ title, description, children, className, headerContent, maxWidth, fixed, actions, rightContent, }: PageLayoutProps): react_jsx_runtime.JSX.Element;
|
|
5454
|
+
|
|
5436
5455
|
interface ActionBarAction {
|
|
5437
5456
|
/** Unique identifier for the action */
|
|
5438
5457
|
id: string;
|
package/dist/index.esm.js
CHANGED
|
@@ -56680,6 +56680,21 @@ const AppLayout = ({ children, toolbarSections = [], className = '', showToolbar
|
|
|
56680
56680
|
* </PageLayout>
|
|
56681
56681
|
* ```
|
|
56682
56682
|
*
|
|
56683
|
+
* @example With actions
|
|
56684
|
+
* ```tsx
|
|
56685
|
+
* <PageLayout
|
|
56686
|
+
* title="Products"
|
|
56687
|
+
* description="Manage your product catalog"
|
|
56688
|
+
* headerContent={<Breadcrumbs items={[{ label: 'Home', href: '/' }, { label: 'Products' }]} />}
|
|
56689
|
+
* actions={[
|
|
56690
|
+
* { id: 'export', label: 'Export', icon: <Download />, onClick: handleExport, variant: 'ghost' },
|
|
56691
|
+
* { id: 'add', label: 'Add Product', icon: <Plus />, onClick: handleAdd, variant: 'primary' },
|
|
56692
|
+
* ]}
|
|
56693
|
+
* >
|
|
56694
|
+
* <DataTable data={products} columns={columns} />
|
|
56695
|
+
* </PageLayout>
|
|
56696
|
+
* ```
|
|
56697
|
+
*
|
|
56683
56698
|
* @example With Layout for sidebar and gutter
|
|
56684
56699
|
* ```tsx
|
|
56685
56700
|
* <Layout sidebar={<Sidebar items={items} />}>
|
|
@@ -56689,7 +56704,7 @@ const AppLayout = ({ children, toolbarSections = [], className = '', showToolbar
|
|
|
56689
56704
|
* </Layout>
|
|
56690
56705
|
* ```
|
|
56691
56706
|
*/
|
|
56692
|
-
function PageLayout({ title, description, children, className = '', headerContent, maxWidth = '7xl', fixed = false }) {
|
|
56707
|
+
function PageLayout({ title, description, children, className = '', headerContent, maxWidth = '7xl', fixed = false, actions, rightContent, }) {
|
|
56693
56708
|
// Responsive padding classes - fixed left/top, responsive right/bottom
|
|
56694
56709
|
const paddingClasses = fixed
|
|
56695
56710
|
? 'p-6 pb-20'
|
|
@@ -56701,7 +56716,7 @@ function PageLayout({ title, description, children, className = '', headerConten
|
|
|
56701
56716
|
'7xl': 'max-w-7xl',
|
|
56702
56717
|
'full': 'max-w-full',
|
|
56703
56718
|
};
|
|
56704
|
-
return (
|
|
56719
|
+
return (jsx(Page, { padding: "none", maxWidth: maxWidth, fixed: fixed, children: jsxs("div", { className: `${paddingClasses} ${maxWidthClasses[maxWidth]} mx-auto ${className}`, children: [headerContent && jsx("div", { className: "mb-4", children: headerContent }), jsx("div", { className: "mb-8", children: jsxs(Stack, { direction: "horizontal", justify: "between", align: "start", gap: "md", children: [jsxs("div", { className: "min-w-0 flex-1", children: [jsx(Text, { as: "h1", size: "2xl", weight: "bold", className: "text-3xl mb-2", children: title }), description && (jsx(Text, { color: "muted", children: description }))] }), (actions || rightContent) && (jsxs(Stack, { direction: "horizontal", gap: "sm", className: "flex-shrink-0", children: [rightContent, actions?.map((action) => (jsx(Button, { variant: action.variant || 'secondary', icon: action.icon, onClick: action.onClick, disabled: action.disabled, loading: action.loading, className: action.hideOnMobile ? 'hidden sm:inline-flex' : '', children: action.label }, action.id)))] }))] }) }), children] }) }));
|
|
56705
56720
|
}
|
|
56706
56721
|
|
|
56707
56722
|
/**
|