@nexub/patterns 7.1.0 → 7.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.
@@ -1,11 +1,11 @@
1
1
  'use client';
2
2
  import {
3
3
  NotificationItem
4
- } from "./chunk-RQARH2AX.js";
4
+ } from "./chunk-QC4TMG73.js";
5
5
 
6
6
  // src/components/NotificationCenter/NotificationCenter.tsx
7
7
  import * as React from "react";
8
- import { Button, IconButton, Popover, cn, useNexubMessages } from "@nexub/react";
8
+ import { Button, IconButton, Popover, cn, safeHref, useNexubMessages } from "@nexub/react";
9
9
  import { Bell } from "@nexub/icons";
10
10
  import { jsx, jsxs } from "react/jsx-runtime";
11
11
  function NotificationCenter({
@@ -53,7 +53,7 @@ function NotificationCenter({
53
53
  timestamp: n.timestamp,
54
54
  read: n.read,
55
55
  icon: n.icon,
56
- href: n.href,
56
+ href: safeHref(n.href),
57
57
  onSelect: onOpen ? () => onOpen(n.id) : void 0,
58
58
  onDismiss: onDismiss ? () => onDismiss(n.id) : void 0
59
59
  }
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
  import {
3
3
  AppLauncher
4
- } from "./chunk-BDCVWAH7.js";
4
+ } from "./chunk-TUJJWHQT.js";
5
5
 
6
6
  // src/components/AppHeader/AppHeader.tsx
7
7
  import * as React from "react";
@@ -15,7 +15,8 @@ import {
15
15
  TopNav,
16
16
  cn,
17
17
  useNexubMessages,
18
- useTheme
18
+ useTheme,
19
+ safeHref
19
20
  } from "@nexub/react";
20
21
  import { Building2, ChevronDown, Moon, Search, Sun } from "@nexub/icons";
21
22
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
@@ -220,7 +221,7 @@ function AccountMenu({
220
221
  setOpen(false);
221
222
  });
222
223
  };
223
- const link = (href, label) => /* @__PURE__ */ jsx(DropdownMenu.Item, { asChild: true, children: /* @__PURE__ */ jsx("a", { href, children: label }) });
224
+ const link = (href, label) => /* @__PURE__ */ jsx(DropdownMenu.Item, { asChild: true, children: /* @__PURE__ */ jsx("a", { href: safeHref(href), children: label }) });
224
225
  const legal = (privacyHref || termsHref) && /* @__PURE__ */ jsxs(Fragment, { children: [
225
226
  privacyHref && link(privacyHref, t.privacyPolicy),
226
227
  termsHref && link(termsHref, t.termsOfService)
@@ -297,7 +298,7 @@ var AppHeader = React.forwardRef(
297
298
  /* @__PURE__ */ jsx(
298
299
  "a",
299
300
  {
300
- href: homeHref,
301
+ href: safeHref(homeHref),
301
302
  onClick: (e) => {
302
303
  if (onNavigate && isPlainClick(e)) {
303
304
  e.preventDefault();
@@ -6,7 +6,7 @@ import {
6
6
 
7
7
  // src/components/SettingsPage/SettingsPage.tsx
8
8
  import * as React from "react";
9
- import { cn } from "@nexub/react";
9
+ import { cn, safeHref } from "@nexub/react";
10
10
  import { ChevronRight } from "@nexub/icons";
11
11
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
12
12
  function Row({ item }) {
@@ -30,7 +30,7 @@ function Row({ item }) {
30
30
  ] });
31
31
  const row = "flex min-h-[56px] w-full items-center gap-3 px-4 py-3";
32
32
  if (item.href)
33
- return /* @__PURE__ */ jsx("a", { href: item.href, onClick: item.onSelect && ((e) => {
33
+ return /* @__PURE__ */ jsx("a", { href: safeHref(item.href), onClick: item.onSelect && ((e) => {
34
34
  e.preventDefault();
35
35
  item.onSelect?.();
36
36
  }), className: cn(row, "nx-state-layer"), children: content });
@@ -2,7 +2,7 @@
2
2
 
3
3
  // src/components/PlanCard/PlanCard.tsx
4
4
  import * as React from "react";
5
- import { cn, Badge, Button } from "@nexub/react";
5
+ import { cn, Badge, Button, safeHref } from "@nexub/react";
6
6
  import { Check } from "@nexub/icons";
7
7
  import { jsx, jsxs } from "react/jsx-runtime";
8
8
  var PlanCard = React.forwardRef(
@@ -57,7 +57,7 @@ var PlanCard = React.forwardRef(
57
57
  className: "mt-auto w-full",
58
58
  onClick: onSelect,
59
59
  asChild: Boolean(ctaHref),
60
- children: ctaHref ? /* @__PURE__ */ jsx("a", { href: ctaHref, children: cta }) : cta
60
+ children: ctaHref ? /* @__PURE__ */ jsx("a", { href: safeHref(ctaHref), children: cta }) : cta
61
61
  }
62
62
  )
63
63
  ]
@@ -2,7 +2,7 @@
2
2
 
3
3
  // src/components/SettingsLayout/SettingsLayout.tsx
4
4
  import * as React from "react";
5
- import { Card, IconButton, Sheet, Sidebar, TopNav, cn } from "@nexub/react";
5
+ import { Card, IconButton, Sheet, Sidebar, TopNav, cn, safeHref } from "@nexub/react";
6
6
  import { Menu } from "@nexub/icons";
7
7
  import { jsx, jsxs } from "react/jsx-runtime";
8
8
  var isPlainClick = (e) => e.button === 0 && !e.metaKey && !e.ctrlKey && !e.shiftKey && !e.altKey;
@@ -18,7 +18,7 @@ function SectionNav({
18
18
  /* @__PURE__ */ jsx(Sidebar.Group, { children: items.map((item) => /* @__PURE__ */ jsx(
19
19
  Sidebar.Item,
20
20
  {
21
- href: item.href,
21
+ href: safeHref(item.href),
22
22
  icon: item.icon,
23
23
  active: item.id === activeId,
24
24
  onClick: (e) => onChoose(e, item),
@@ -2,7 +2,7 @@
2
2
 
3
3
  // src/components/NotificationItem/NotificationItem.tsx
4
4
  import * as React from "react";
5
- import { cn, useNexubMessages } from "@nexub/react";
5
+ import { cn, safeHref, useNexubMessages } from "@nexub/react";
6
6
  import { jsx, jsxs } from "react/jsx-runtime";
7
7
  var stretched = "outline-none after:absolute after:inset-0 after:rounded-shape-container focus-visible:after:outline focus-visible:after:outline-2 focus-visible:after:outline-[var(--color-primary)]";
8
8
  var NotificationItem = React.forwardRef(
@@ -29,7 +29,7 @@ var NotificationItem = React.forwardRef(
29
29
  ),
30
30
  icon && /* @__PURE__ */ jsx("div", { className: "shrink-0 mt-0.5", children: icon }),
31
31
  /* @__PURE__ */ jsxs("div", { className: "flex-1 min-w-0", children: [
32
- /* @__PURE__ */ jsx("p", { className: "text-sm font-medium text-[var(--color-on-surface)] truncate", children: href ? /* @__PURE__ */ jsx("a", { href, onClick: onSelect, className: stretched, children: title }) : onSelect ? /* @__PURE__ */ jsx("button", { type: "button", onClick: onSelect, className: cn("text-start", stretched), children: title }) : title }),
32
+ /* @__PURE__ */ jsx("p", { className: "text-sm font-medium text-[var(--color-on-surface)] truncate", children: href ? /* @__PURE__ */ jsx("a", { href: safeHref(href), onClick: onSelect, className: stretched, children: title }) : onSelect ? /* @__PURE__ */ jsx("button", { type: "button", onClick: onSelect, className: cn("text-start", stretched), children: title }) : title }),
33
33
  description && /* @__PURE__ */ jsx("p", { className: "text-sm text-[var(--color-on-surface-muted)] mt-0.5 line-clamp-2", children: description }),
34
34
  timestamp && /* @__PURE__ */ jsx("time", { className: "text-xs text-[var(--color-on-surface-muted)] mt-1 block", children: timestamp })
35
35
  ] }),
@@ -2,7 +2,7 @@
2
2
 
3
3
  // src/components/AppLauncher/AppLauncher.tsx
4
4
  import * as React from "react";
5
- import { Avatar, IconButton, Popover, cn } from "@nexub/react";
5
+ import { Avatar, IconButton, Popover, cn, safeHref, safeSrc } from "@nexub/react";
6
6
  import { Apps } from "@nexub/icons";
7
7
  import { jsx, jsxs } from "react/jsx-runtime";
8
8
  var COLUMNS = 3;
@@ -26,7 +26,7 @@ function AppIcon({ app }) {
26
26
  return /* @__PURE__ */ jsx(
27
27
  "img",
28
28
  {
29
- src: app.icon,
29
+ src: safeSrc(app.icon),
30
30
  alt: "",
31
31
  width: 40,
32
32
  height: 40,
@@ -94,7 +94,7 @@ var AppLauncher = React.forwardRef(
94
94
  /* @__PURE__ */ jsx("ul", { className: "grid grid-cols-3 gap-1", "aria-label": group, children: items.map((app, n) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsxs(
95
95
  "a",
96
96
  {
97
- href: app.href,
97
+ href: safeHref(app.href),
98
98
  "aria-current": app.current ? "page" : void 0,
99
99
  "data-row": firstRow + Math.floor(n / COLUMNS),
100
100
  "data-col": n % COLUMNS,
@@ -1,8 +1,8 @@
1
1
  'use client';
2
2
  import {
3
3
  AppHeader
4
- } from "../../chunk-2WKGBINE.js";
5
- import "../../chunk-BDCVWAH7.js";
4
+ } from "../../chunk-BDT2EEOK.js";
5
+ import "../../chunk-TUJJWHQT.js";
6
6
  export {
7
7
  AppHeader
8
8
  };
@@ -2,7 +2,7 @@
2
2
  import "../../chunk-VYMTTYPR.js";
3
3
  import {
4
4
  AppLauncher
5
- } from "../../chunk-BDCVWAH7.js";
5
+ } from "../../chunk-TUJJWHQT.js";
6
6
  export {
7
7
  AppLauncher
8
8
  };
@@ -1,8 +1,8 @@
1
1
  'use client';
2
2
  import {
3
3
  NotificationCenter
4
- } from "../../chunk-464UFQKG.js";
5
- import "../../chunk-RQARH2AX.js";
4
+ } from "../../chunk-4MD5VRPS.js";
5
+ import "../../chunk-QC4TMG73.js";
6
6
  export {
7
7
  NotificationCenter
8
8
  };
@@ -2,7 +2,7 @@
2
2
  import "../../chunk-EQQOVRRM.js";
3
3
  import {
4
4
  NotificationItem
5
- } from "../../chunk-RQARH2AX.js";
5
+ } from "../../chunk-QC4TMG73.js";
6
6
  export {
7
7
  NotificationItem
8
8
  };
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
  import {
3
3
  PlanCard
4
- } from "../../chunk-LKN2CK6M.js";
4
+ } from "../../chunk-DI4EBNP7.js";
5
5
  export {
6
6
  PlanCard
7
7
  };
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  SettingsLayout,
4
4
  SettingsRow
5
- } from "../../chunk-Z4FCC42C.js";
5
+ } from "../../chunk-KJ4QGNXD.js";
6
6
  export {
7
7
  SettingsLayout,
8
8
  SettingsRow
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
  import {
3
3
  SettingsPage
4
- } from "../../chunk-27N33TGN.js";
4
+ } from "../../chunk-CSC2TFWA.js";
5
5
  import "../../chunk-7QCJC2DV.js";
6
6
  export {
7
7
  SettingsPage
package/dist/index.js CHANGED
@@ -5,27 +5,32 @@ import {
5
5
  import {
6
6
  UserCard
7
7
  } from "./chunk-7NYGYETG.js";
8
- import "./chunk-EQQOVRRM.js";
9
8
  import "./chunk-RFCPEZGF.js";
10
9
  import {
11
10
  PaywallPage
12
11
  } from "./chunk-M3OHX4F4.js";
13
12
  import {
14
13
  PlanCard
15
- } from "./chunk-LKN2CK6M.js";
14
+ } from "./chunk-DI4EBNP7.js";
16
15
  import {
17
16
  SettingsLayout,
18
17
  SettingsRow
19
- } from "./chunk-Z4FCC42C.js";
18
+ } from "./chunk-KJ4QGNXD.js";
20
19
  import {
21
20
  SettingsPage
22
- } from "./chunk-27N33TGN.js";
21
+ } from "./chunk-CSC2TFWA.js";
23
22
  import {
24
23
  SettingsSection
25
24
  } from "./chunk-U3FT7XAU.js";
25
+ import {
26
+ NotificationCenter
27
+ } from "./chunk-4MD5VRPS.js";
26
28
  import {
27
29
  SignInPage
28
30
  } from "./chunk-UNQD426H.js";
31
+ import {
32
+ CheckoutPage
33
+ } from "./chunk-CZR6NZDH.js";
29
34
  import {
30
35
  DashboardPage
31
36
  } from "./chunk-33Z2ZPO7.js";
@@ -39,21 +44,16 @@ import {
39
44
  import {
40
45
  FilterBar
41
46
  } from "./chunk-SNONOBAE.js";
42
- import {
43
- CheckoutPage
44
- } from "./chunk-CZR6NZDH.js";
45
47
  import {
46
48
  InfoList
47
49
  } from "./chunk-WPNT5JOU.js";
48
50
  import {
49
51
  ListDetail
50
52
  } from "./chunk-5JU6HUVJ.js";
51
- import {
52
- NotificationCenter
53
- } from "./chunk-464UFQKG.js";
53
+ import "./chunk-EQQOVRRM.js";
54
54
  import {
55
55
  NotificationItem
56
- } from "./chunk-RQARH2AX.js";
56
+ } from "./chunk-QC4TMG73.js";
57
57
  import {
58
58
  ActivityFeed
59
59
  } from "./chunk-GHOBXWUA.js";
@@ -64,11 +64,7 @@ import {
64
64
  } from "./chunk-OC4XY3US.js";
65
65
  import {
66
66
  AppHeader
67
- } from "./chunk-2WKGBINE.js";
68
- import "./chunk-VYMTTYPR.js";
69
- import {
70
- AppLauncher
71
- } from "./chunk-BDCVWAH7.js";
67
+ } from "./chunk-BDT2EEOK.js";
72
68
  import {
73
69
  AuthCard
74
70
  } from "./chunk-HMJRSNJD.js";
@@ -76,6 +72,10 @@ import {
76
72
  BentoGrid,
77
73
  BentoTile
78
74
  } from "./chunk-WZTDCJYP.js";
75
+ import "./chunk-VYMTTYPR.js";
76
+ import {
77
+ AppLauncher
78
+ } from "./chunk-TUJJWHQT.js";
79
79
  import {
80
80
  ChatPage
81
81
  } from "./chunk-64PSI75E.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nexub/patterns",
3
- "version": "7.1.0",
3
+ "version": "7.2.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": "^7.1.0",
43
- "@nexub/react": "^7.1.0",
44
- "@nexub/tokens": "^7.1.0"
42
+ "@nexub/icons": "^7.2.0",
43
+ "@nexub/react": "^7.2.0",
44
+ "@nexub/tokens": "^7.2.0"
45
45
  },
46
46
  "peerDependenciesMeta": {
47
47
  "@nexub/icons": {
@@ -64,9 +64,9 @@
64
64
  "typescript": "~6.0.3",
65
65
  "vite": "^8.3.5",
66
66
  "vitest": "^5.0.5",
67
- "@nexub/icons": "7.1.0",
68
- "@nexub/react": "7.1.0",
69
- "@nexub/tokens": "7.1.0"
67
+ "@nexub/icons": "7.2.0",
68
+ "@nexub/react": "7.2.0",
69
+ "@nexub/tokens": "7.2.0"
70
70
  },
71
71
  "scripts": {
72
72
  "build": "tsup && tailwindcss -i src/styles.css -o dist/styles.css --minify",