@nexub/patterns 9.4.0 → 9.6.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/dist/{chunk-MPYNCRDP.js → chunk-AUJER5GR.js} +1 -1
- package/dist/{chunk-64PSI75E.js → chunk-IHUELKTD.js} +1 -1
- package/dist/{chunk-Y52QKHGE.js → chunk-JN5U727F.js} +2 -2
- package/dist/{chunk-W3ADLRKA.js → chunk-JXST66ON.js} +1 -1
- package/dist/{chunk-LLBFQJ3B.js → chunk-K2FAHLBJ.js} +1 -1
- package/dist/{chunk-Y5HDYYW5.js → chunk-LX6YY2KQ.js} +1 -1
- package/dist/{chunk-SMV7OA63.js → chunk-PGGREX6G.js} +1 -1
- package/dist/{chunk-7PQPVRYW.js → chunk-RXT3LZQL.js} +1 -1
- package/dist/{chunk-7QCJC2DV.js → chunk-S63ZWOZB.js} +29 -3
- package/dist/components/ActivityPage/index.js +2 -2
- package/dist/components/ChatPage/index.js +2 -2
- package/dist/components/CheckoutPage/index.js +2 -2
- package/dist/components/DashboardPage/index.js +3 -3
- package/dist/components/PageFrame/index.js +1 -1
- package/dist/components/PaywallPage/index.js +2 -2
- package/dist/components/SettingsPage/index.js +2 -2
- package/dist/components/SignInPage/index.js +2 -2
- package/dist/components/TransactionDetailPage/index.js +2 -2
- package/dist/index.d.ts +10 -1
- package/dist/index.js +15 -15
- package/package.json +7 -7
|
@@ -4,12 +4,12 @@ import {
|
|
|
4
4
|
} from "./chunk-INKX2GYA.js";
|
|
5
5
|
import {
|
|
6
6
|
TransactionRow
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-AUJER5GR.js";
|
|
8
8
|
import {
|
|
9
9
|
PageFrame,
|
|
10
10
|
usePageMessages,
|
|
11
11
|
useTemplateLocale
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-S63ZWOZB.js";
|
|
13
13
|
|
|
14
14
|
// src/components/DashboardPage/DashboardPage.tsx
|
|
15
15
|
import * as React from "react";
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
// src/components/PageFrame/PageFrame.tsx
|
|
4
4
|
import * as React from "react";
|
|
5
|
-
import { Badge, cn, useLocale, useNexubMessages } from "@nexub/react";
|
|
5
|
+
import { Badge, Button, EmptyStatePreset, cn, useLocale, useNexubMessages } from "@nexub/react";
|
|
6
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
7
|
var defaultPageTemplateMessages = {
|
|
8
8
|
activity: "Activity",
|
|
@@ -77,8 +77,34 @@ function StatusBadge({ status, m, dot }) {
|
|
|
77
77
|
status === "failed" ? m.failed : m.pending
|
|
78
78
|
] });
|
|
79
79
|
}
|
|
80
|
+
function DefaultFallback({ reset }) {
|
|
81
|
+
const m = useNexubMessages();
|
|
82
|
+
return /* @__PURE__ */ jsx(
|
|
83
|
+
EmptyStatePreset,
|
|
84
|
+
{
|
|
85
|
+
kind: "serverError",
|
|
86
|
+
actions: /* @__PURE__ */ jsx(Button, { variant: "tonal", onClick: reset, children: m.retry })
|
|
87
|
+
}
|
|
88
|
+
);
|
|
89
|
+
}
|
|
90
|
+
var ContentBoundary = class extends React.Component {
|
|
91
|
+
state = { failed: false, error: void 0 };
|
|
92
|
+
static getDerivedStateFromError(error) {
|
|
93
|
+
return { failed: true, error };
|
|
94
|
+
}
|
|
95
|
+
componentDidCatch(error, info) {
|
|
96
|
+
this.props.onError?.(error, info);
|
|
97
|
+
}
|
|
98
|
+
reset = () => this.setState({ failed: false, error: void 0 });
|
|
99
|
+
render() {
|
|
100
|
+
if (!this.state.failed) return this.props.children;
|
|
101
|
+
const { errorFallback } = this.props;
|
|
102
|
+
if (typeof errorFallback === "function") return errorFallback({ error: this.state.error, reset: this.reset });
|
|
103
|
+
return errorFallback ?? /* @__PURE__ */ jsx(DefaultFallback, { reset: this.reset });
|
|
104
|
+
}
|
|
105
|
+
};
|
|
80
106
|
var widths = { sm: "max-w-[480px]", md: "max-w-3xl", lg: "max-w-6xl" };
|
|
81
|
-
var PageFrame = React.forwardRef(function PageFrame2({ as: Tag = "main", title, description, actions, eyebrow, width = "md", className, children, ...props }, ref) {
|
|
107
|
+
var PageFrame = React.forwardRef(function PageFrame2({ as: Tag = "main", title, description, actions, eyebrow, width = "md", className, children, errorFallback, onError, ...props }, ref) {
|
|
82
108
|
const headingId = React.useId();
|
|
83
109
|
return /* @__PURE__ */ jsxs(
|
|
84
110
|
Tag,
|
|
@@ -96,7 +122,7 @@ var PageFrame = React.forwardRef(function PageFrame2({ as: Tag = "main", title,
|
|
|
96
122
|
] }),
|
|
97
123
|
description && /* @__PURE__ */ jsx("p", { className: "text-body-md text-[var(--color-on-surface-muted)]", children: description })
|
|
98
124
|
] }),
|
|
99
|
-
children
|
|
125
|
+
/* @__PURE__ */ jsx(ContentBoundary, { errorFallback, onError, children })
|
|
100
126
|
]
|
|
101
127
|
}
|
|
102
128
|
);
|
|
@@ -3,8 +3,8 @@ import "../../chunk-CWFZA7ZQ.js";
|
|
|
3
3
|
import {
|
|
4
4
|
ActivityPage,
|
|
5
5
|
TransactionRow
|
|
6
|
-
} from "../../chunk-
|
|
7
|
-
import "../../chunk-
|
|
6
|
+
} from "../../chunk-AUJER5GR.js";
|
|
7
|
+
import "../../chunk-S63ZWOZB.js";
|
|
8
8
|
export {
|
|
9
9
|
ActivityPage,
|
|
10
10
|
TransactionRow
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import {
|
|
3
3
|
DashboardPage
|
|
4
|
-
} from "../../chunk-
|
|
4
|
+
} from "../../chunk-JN5U727F.js";
|
|
5
5
|
import "../../chunk-INKX2GYA.js";
|
|
6
|
-
import "../../chunk-
|
|
7
|
-
import "../../chunk-
|
|
6
|
+
import "../../chunk-AUJER5GR.js";
|
|
7
|
+
import "../../chunk-S63ZWOZB.js";
|
|
8
8
|
export {
|
|
9
9
|
DashboardPage
|
|
10
10
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import {
|
|
3
3
|
TransactionDetailPage
|
|
4
|
-
} from "../../chunk-
|
|
4
|
+
} from "../../chunk-PGGREX6G.js";
|
|
5
5
|
import "../../chunk-WPNT5JOU.js";
|
|
6
|
-
import "../../chunk-
|
|
6
|
+
import "../../chunk-S63ZWOZB.js";
|
|
7
7
|
export {
|
|
8
8
|
TransactionDetailPage
|
|
9
9
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -511,7 +511,16 @@ declare function groupByDay(transactions: Transaction[], locale: string): {
|
|
|
511
511
|
title: string;
|
|
512
512
|
data: Transaction[];
|
|
513
513
|
}[];
|
|
514
|
-
interface
|
|
514
|
+
interface ContentBoundaryProps {
|
|
515
|
+
/** Shown in place of content that threw while rendering. Default: the "Something went wrong" state with Retry. */
|
|
516
|
+
errorFallback?: React.ReactNode | ((state: {
|
|
517
|
+
error: unknown;
|
|
518
|
+
reset: () => void;
|
|
519
|
+
}) => React.ReactNode);
|
|
520
|
+
/** Called with the error, for reporting (Sentry, Datadog). */
|
|
521
|
+
onError?: (error: unknown, info: React.ErrorInfo) => void;
|
|
522
|
+
}
|
|
523
|
+
interface PageFrameProps extends Omit<React.HTMLAttributes<HTMLElement>, 'title' | 'onError'>, ContentBoundaryProps {
|
|
515
524
|
/** Landmark element. Use `div` inside an app shell that already renders `<main>`. @default 'main' */
|
|
516
525
|
as?: 'main' | 'div' | 'section';
|
|
517
526
|
title?: React.ReactNode;
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import {
|
|
3
3
|
TransactionDetailPage
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-PGGREX6G.js";
|
|
5
5
|
import {
|
|
6
6
|
UserCard
|
|
7
7
|
} from "./chunk-7NYGYETG.js";
|
|
@@ -9,39 +9,39 @@ import "./chunk-EQQOVRRM.js";
|
|
|
9
9
|
import "./chunk-RFCPEZGF.js";
|
|
10
10
|
import {
|
|
11
11
|
PaywallPage
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-K2FAHLBJ.js";
|
|
13
|
+
import {
|
|
14
|
+
PlanCard
|
|
15
|
+
} from "./chunk-I5OGZW3U.js";
|
|
13
16
|
import {
|
|
14
17
|
SettingsLayout,
|
|
15
18
|
SettingsRow
|
|
16
19
|
} from "./chunk-KJ4QGNXD.js";
|
|
17
|
-
import {
|
|
18
|
-
PlanCard
|
|
19
|
-
} from "./chunk-I5OGZW3U.js";
|
|
20
20
|
import {
|
|
21
21
|
SettingsPage
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-JXST66ON.js";
|
|
23
23
|
import {
|
|
24
24
|
SettingsSection
|
|
25
25
|
} from "./chunk-U3FT7XAU.js";
|
|
26
26
|
import {
|
|
27
27
|
SignInPage
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-RXT3LZQL.js";
|
|
29
29
|
import {
|
|
30
30
|
CheckoutPage
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-LX6YY2KQ.js";
|
|
32
32
|
import {
|
|
33
33
|
DashboardPage
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-JN5U727F.js";
|
|
35
35
|
import {
|
|
36
36
|
StatCard
|
|
37
37
|
} from "./chunk-INKX2GYA.js";
|
|
38
|
+
import {
|
|
39
|
+
FilterBar
|
|
40
|
+
} from "./chunk-SNONOBAE.js";
|
|
38
41
|
import {
|
|
39
42
|
ErrorSummary,
|
|
40
43
|
useFormErrors
|
|
41
44
|
} from "./chunk-RWPFCNMJ.js";
|
|
42
|
-
import {
|
|
43
|
-
FilterBar
|
|
44
|
-
} from "./chunk-SNONOBAE.js";
|
|
45
45
|
import {
|
|
46
46
|
InfoList
|
|
47
47
|
} from "./chunk-WPNT5JOU.js";
|
|
@@ -64,7 +64,7 @@ import "./chunk-CWFZA7ZQ.js";
|
|
|
64
64
|
import {
|
|
65
65
|
ActivityPage,
|
|
66
66
|
TransactionRow
|
|
67
|
-
} from "./chunk-
|
|
67
|
+
} from "./chunk-AUJER5GR.js";
|
|
68
68
|
import "./chunk-VYMTTYPR.js";
|
|
69
69
|
import {
|
|
70
70
|
AppLauncher
|
|
@@ -78,7 +78,7 @@ import {
|
|
|
78
78
|
} from "./chunk-WZTDCJYP.js";
|
|
79
79
|
import {
|
|
80
80
|
ChatPage
|
|
81
|
-
} from "./chunk-
|
|
81
|
+
} from "./chunk-IHUELKTD.js";
|
|
82
82
|
import {
|
|
83
83
|
Conversation
|
|
84
84
|
} from "./chunk-WRP73TXG.js";
|
|
@@ -87,7 +87,7 @@ import {
|
|
|
87
87
|
defaultPageTemplateMessages,
|
|
88
88
|
groupByDay,
|
|
89
89
|
usePageMessages
|
|
90
|
-
} from "./chunk-
|
|
90
|
+
} from "./chunk-S63ZWOZB.js";
|
|
91
91
|
export {
|
|
92
92
|
ActivityFeed,
|
|
93
93
|
ActivityPage,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nexub/patterns",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.6.0",
|
|
4
4
|
"description": "Composite UI patterns for Nexub Design System — pre-built, production-ready layouts and widgets built on @nexub/react.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -39,9 +39,9 @@
|
|
|
39
39
|
"peerDependencies": {
|
|
40
40
|
"react": ">=19 <20",
|
|
41
41
|
"react-dom": ">=19 <20",
|
|
42
|
-
"@nexub/icons": "^9.
|
|
43
|
-
"@nexub/react": "^9.
|
|
44
|
-
"@nexub/tokens": "^9.
|
|
42
|
+
"@nexub/icons": "^9.6.0",
|
|
43
|
+
"@nexub/react": "^9.6.0",
|
|
44
|
+
"@nexub/tokens": "^9.6.0"
|
|
45
45
|
},
|
|
46
46
|
"peerDependenciesMeta": {
|
|
47
47
|
"@nexub/icons": {
|
|
@@ -65,9 +65,9 @@
|
|
|
65
65
|
"typescript": "~6.0.3",
|
|
66
66
|
"vite": "^8.3.5",
|
|
67
67
|
"vitest": "^5.0.5",
|
|
68
|
-
"@nexub/icons": "9.
|
|
69
|
-
"@nexub/react": "9.
|
|
70
|
-
"@nexub/tokens": "9.
|
|
68
|
+
"@nexub/icons": "9.6.0",
|
|
69
|
+
"@nexub/react": "9.6.0",
|
|
70
|
+
"@nexub/tokens": "9.6.0"
|
|
71
71
|
},
|
|
72
72
|
"scripts": {
|
|
73
73
|
"build": "tsup && tailwindcss -i src/styles.css -o dist/styles.css --minify",
|