@papernote/ui 1.8.0 → 1.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -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;AAGlC,MAAM,WAAW,eAAe;IAC9B,sCAAsC;IACtC,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;CACjB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,wBAAgB,UAAU,CAAC,EACzB,KAAK,EACL,WAAW,EACX,QAAQ,EACR,SAAc,EACd,aAAa,EACb,QAAgB,EAChB,KAAa,EACd,EAAE,eAAe,2CAgCjB"}
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
@@ -11072,52 +11072,44 @@ function getAugmentedNamespace(n) {
11072
11072
  * (A1, A1:C5, ...)
11073
11073
  */
11074
11074
 
11075
- var collection;
11076
- var hasRequiredCollection;
11077
-
11078
- function requireCollection () {
11079
- if (hasRequiredCollection) return collection;
11080
- hasRequiredCollection = 1;
11081
- class Collection {
11082
-
11083
- constructor(data, refs) {
11084
- if (data == null && refs == null) {
11085
- this._data = [];
11086
- this._refs = [];
11087
- } else {
11088
- if (data.length !== refs.length)
11089
- throw Error('Collection: data length should match references length.');
11090
- this._data = data;
11091
- this._refs = refs;
11092
- }
11093
- }
11075
+ let Collection$3 = class Collection {
11094
11076
 
11095
- get data() {
11096
- return this._data;
11097
- }
11077
+ constructor(data, refs) {
11078
+ if (data == null && refs == null) {
11079
+ this._data = [];
11080
+ this._refs = [];
11081
+ } else {
11082
+ if (data.length !== refs.length)
11083
+ throw Error('Collection: data length should match references length.');
11084
+ this._data = data;
11085
+ this._refs = refs;
11086
+ }
11087
+ }
11098
11088
 
11099
- get refs() {
11100
- return this._refs;
11101
- }
11089
+ get data() {
11090
+ return this._data;
11091
+ }
11102
11092
 
11103
- get length() {
11104
- return this._data.length;
11105
- }
11093
+ get refs() {
11094
+ return this._refs;
11095
+ }
11106
11096
 
11107
- /**
11108
- * Add data and references to this collection.
11109
- * @param {{}} obj - data
11110
- * @param {{}} ref - reference
11111
- */
11112
- add(obj, ref) {
11113
- this._data.push(obj);
11114
- this._refs.push(ref);
11115
- }
11116
- }
11097
+ get length() {
11098
+ return this._data.length;
11099
+ }
11117
11100
 
11118
- collection = Collection;
11119
- return collection;
11120
- }
11101
+ /**
11102
+ * Add data and references to this collection.
11103
+ * @param {{}} obj - data
11104
+ * @param {{}} ref - reference
11105
+ */
11106
+ add(obj, ref) {
11107
+ this._data.push(obj);
11108
+ this._refs.push(ref);
11109
+ }
11110
+ };
11111
+
11112
+ var collection = Collection$3;
11121
11113
 
11122
11114
  var helpers;
11123
11115
  var hasRequiredHelpers;
@@ -11126,7 +11118,7 @@ function requireHelpers () {
11126
11118
  if (hasRequiredHelpers) return helpers;
11127
11119
  hasRequiredHelpers = 1;
11128
11120
  const FormulaError = requireError();
11129
- const Collection = requireCollection();
11121
+ const Collection = collection;
11130
11122
 
11131
11123
  const Types = {
11132
11124
  NUMBER: 0,
@@ -20780,7 +20772,7 @@ var engineering = EngineeringFunctions;
20780
20772
 
20781
20773
  const FormulaError$b = requireError();
20782
20774
  const {FormulaHelpers: FormulaHelpers$8, Types: Types$6, WildCard, Address: Address$3} = requireHelpers();
20783
- const Collection$2 = requireCollection();
20775
+ const Collection$2 = collection;
20784
20776
  const H$5 = FormulaHelpers$8;
20785
20777
 
20786
20778
  const ReferenceFunctions$1 = {
@@ -32408,7 +32400,7 @@ var parsing = {
32408
32400
  const FormulaError$4 = requireError();
32409
32401
  const {Address: Address$1} = requireHelpers();
32410
32402
  const {Prefix: Prefix$1, Postfix: Postfix$1, Infix: Infix$1, Operators: Operators$1} = operators;
32411
- const Collection$1 = requireCollection();
32403
+ const Collection$1 = collection;
32412
32404
  const MAX_ROW$1 = 1048576, MAX_COLUMN$1 = 16384;
32413
32405
  const {NotAllInputParsedException} = require$$4;
32414
32406
 
@@ -33170,7 +33162,7 @@ var hooks$1 = {
33170
33162
  const FormulaError$2 = requireError();
33171
33163
  const {FormulaHelpers: FormulaHelpers$1, Types, Address} = requireHelpers();
33172
33164
  const {Prefix, Postfix, Infix, Operators} = operators;
33173
- const Collection = requireCollection();
33165
+ const Collection = collection;
33174
33166
  const MAX_ROW = 1048576, MAX_COLUMN = 16384;
33175
33167
 
33176
33168
  let Utils$1 = class Utils {
@@ -56680,6 +56672,21 @@ const AppLayout = ({ children, toolbarSections = [], className = '', showToolbar
56680
56672
  * </PageLayout>
56681
56673
  * ```
56682
56674
  *
56675
+ * @example With actions
56676
+ * ```tsx
56677
+ * <PageLayout
56678
+ * title="Products"
56679
+ * description="Manage your product catalog"
56680
+ * headerContent={<Breadcrumbs items={[{ label: 'Home', href: '/' }, { label: 'Products' }]} />}
56681
+ * actions={[
56682
+ * { id: 'export', label: 'Export', icon: <Download />, onClick: handleExport, variant: 'ghost' },
56683
+ * { id: 'add', label: 'Add Product', icon: <Plus />, onClick: handleAdd, variant: 'primary' },
56684
+ * ]}
56685
+ * >
56686
+ * <DataTable data={products} columns={columns} />
56687
+ * </PageLayout>
56688
+ * ```
56689
+ *
56683
56690
  * @example With Layout for sidebar and gutter
56684
56691
  * ```tsx
56685
56692
  * <Layout sidebar={<Sidebar items={items} />}>
@@ -56689,7 +56696,7 @@ const AppLayout = ({ children, toolbarSections = [], className = '', showToolbar
56689
56696
  * </Layout>
56690
56697
  * ```
56691
56698
  */
56692
- function PageLayout({ title, description, children, className = '', headerContent, maxWidth = '7xl', fixed = false }) {
56699
+ function PageLayout({ title, description, children, className = '', headerContent, maxWidth = '7xl', fixed = false, actions, rightContent, }) {
56693
56700
  // Responsive padding classes - fixed left/top, responsive right/bottom
56694
56701
  const paddingClasses = fixed
56695
56702
  ? 'p-6 pb-20'
@@ -56701,7 +56708,7 @@ function PageLayout({ title, description, children, className = '', headerConten
56701
56708
  '7xl': 'max-w-7xl',
56702
56709
  'full': 'max-w-full',
56703
56710
  };
56704
- return (jsxs(Page, { padding: "none", maxWidth: maxWidth, fixed: fixed, children: [headerContent, jsxs("div", { className: `${paddingClasses} ${maxWidthClasses[maxWidth]} mx-auto ${className}`, children: [jsxs("div", { className: "mb-8", children: [jsx("h1", { className: "text-3xl font-bold text-ink-900 mb-2", children: title }), description && (jsx("p", { className: "text-ink-600", children: description }))] }), children] })] }));
56711
+ return (jsxs(Page, { padding: "none", maxWidth: maxWidth, fixed: fixed, children: [headerContent, jsxs("div", { className: `${paddingClasses} ${maxWidthClasses[maxWidth]} mx-auto ${className}`, children: [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
56712
  }
56706
56713
 
56707
56714
  /**