@campfire-interactive/shell-header 0.8.14 → 0.8.15
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/index.d.ts +18 -1
- package/dist/index.js +23 -2
- package/package.json +41 -41
package/dist/index.d.ts
CHANGED
|
@@ -64,6 +64,17 @@ interface TenantOption {
|
|
|
64
64
|
/** Human-readable role label ("owner", "admin", "member"). Optional. */
|
|
65
65
|
role?: string;
|
|
66
66
|
}
|
|
67
|
+
/**
|
|
68
|
+
* A host-supplied action rendered in the user (avatar) menu, above Sign out.
|
|
69
|
+
* For user-scoped destinations that live outside the current app — e.g.
|
|
70
|
+
* identity's "Connected accounts" surface. The host owns navigation (onClick).
|
|
71
|
+
*/
|
|
72
|
+
interface UserMenuItem {
|
|
73
|
+
label: string;
|
|
74
|
+
onClick: () => void;
|
|
75
|
+
/** Optional leading icon; a 14px icon node aligns with the menu's other rows. */
|
|
76
|
+
icon?: React.ReactNode;
|
|
77
|
+
}
|
|
67
78
|
interface LocaleOption {
|
|
68
79
|
/** BCP-47-ish language code, e.g. "en", "de". */
|
|
69
80
|
code: string;
|
|
@@ -167,6 +178,12 @@ interface ShellHeaderProps {
|
|
|
167
178
|
onNotificationItemClick?: (item: NotificationItem) => void;
|
|
168
179
|
/** Called when logout is clicked */
|
|
169
180
|
onLogout?: () => void;
|
|
181
|
+
/**
|
|
182
|
+
* Extra actions rendered in the user (avatar) menu, above Sign out — for
|
|
183
|
+
* user-scoped destinations outside the current app (e.g. "Connected
|
|
184
|
+
* accounts", landing on the identity origin). Omit for none.
|
|
185
|
+
*/
|
|
186
|
+
userMenuItems?: ReadonlyArray<UserMenuItem>;
|
|
170
187
|
/**
|
|
171
188
|
* The user's currently-active tenant. When provided, the user menu
|
|
172
189
|
* shows an "Acting as: <tenant>" row.
|
|
@@ -238,7 +255,7 @@ interface ShellHeaderProps {
|
|
|
238
255
|
children?: React.ReactNode;
|
|
239
256
|
}
|
|
240
257
|
|
|
241
|
-
declare function ShellHeader({ appId, user, authorizedApps, currentTenantRole, notificationCount, onNotificationClick, notifications, onMarkRead, onMarkAllRead, onNotificationItemClick, onLogout, locale, supportedLocales, onLocaleChange, currency, supportedCurrencies, onCurrencyChange, tenant, tenants, onTenantSwitch, about, showSuiteLogo, brandWidth, children, }: ShellHeaderProps): react_jsx_runtime.JSX.Element;
|
|
258
|
+
declare function ShellHeader({ appId, user, authorizedApps, currentTenantRole, notificationCount, onNotificationClick, notifications, onMarkRead, onMarkAllRead, onNotificationItemClick, onLogout, locale, supportedLocales, onLocaleChange, currency, supportedCurrencies, onCurrencyChange, tenant, tenants, onTenantSwitch, userMenuItems, about, showSuiteLogo, brandWidth, children, }: ShellHeaderProps): react_jsx_runtime.JSX.Element;
|
|
242
259
|
|
|
243
260
|
interface LocaleSwitcherProps {
|
|
244
261
|
currentLocale: string;
|
package/dist/index.js
CHANGED
|
@@ -356,7 +356,8 @@ function UserMenu({
|
|
|
356
356
|
onCurrencyChange,
|
|
357
357
|
tenant,
|
|
358
358
|
tenants,
|
|
359
|
-
onTenantSwitch
|
|
359
|
+
onTenantSwitch,
|
|
360
|
+
userMenuItems
|
|
360
361
|
}) {
|
|
361
362
|
const [open, setOpen] = useState3(false);
|
|
362
363
|
const [langExpanded, setLangExpanded] = useState3(false);
|
|
@@ -566,6 +567,24 @@ function UserMenu({
|
|
|
566
567
|
cur.code
|
|
567
568
|
)) })
|
|
568
569
|
] }),
|
|
570
|
+
userMenuItems && userMenuItems.length > 0 && /* @__PURE__ */ jsxs4(Fragment, { children: [
|
|
571
|
+
/* @__PURE__ */ jsx4("div", { className: "cfi-sh-divider" }),
|
|
572
|
+
userMenuItems.map((item, i) => /* @__PURE__ */ jsxs4(
|
|
573
|
+
"button",
|
|
574
|
+
{
|
|
575
|
+
className: "cfi-sh-menu-item",
|
|
576
|
+
onClick: () => {
|
|
577
|
+
setOpen(false);
|
|
578
|
+
item.onClick();
|
|
579
|
+
},
|
|
580
|
+
children: [
|
|
581
|
+
item.icon,
|
|
582
|
+
/* @__PURE__ */ jsx4("span", { children: item.label })
|
|
583
|
+
]
|
|
584
|
+
},
|
|
585
|
+
i
|
|
586
|
+
))
|
|
587
|
+
] }),
|
|
569
588
|
/* @__PURE__ */ jsx4("div", { className: "cfi-sh-divider" }),
|
|
570
589
|
/* @__PURE__ */ jsxs4(
|
|
571
590
|
"button",
|
|
@@ -747,6 +766,7 @@ function ShellHeader({
|
|
|
747
766
|
tenant,
|
|
748
767
|
tenants,
|
|
749
768
|
onTenantSwitch,
|
|
769
|
+
userMenuItems,
|
|
750
770
|
about,
|
|
751
771
|
showSuiteLogo,
|
|
752
772
|
brandWidth,
|
|
@@ -791,7 +811,8 @@ function ShellHeader({
|
|
|
791
811
|
onCurrencyChange,
|
|
792
812
|
tenant,
|
|
793
813
|
tenants,
|
|
794
|
-
onTenantSwitch
|
|
814
|
+
onTenantSwitch,
|
|
815
|
+
userMenuItems
|
|
795
816
|
}
|
|
796
817
|
)
|
|
797
818
|
] })
|
package/package.json
CHANGED
|
@@ -1,41 +1,41 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@campfire-interactive/shell-header",
|
|
3
|
-
"version": "0.8.
|
|
4
|
-
"description": "Shared shell header with app switcher for Campfire Suite",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"main": "dist/index.js",
|
|
7
|
-
"types": "dist/index.d.ts",
|
|
8
|
-
"exports": {
|
|
9
|
-
".": {
|
|
10
|
-
"types": "./dist/index.d.ts",
|
|
11
|
-
"import": "./dist/index.js"
|
|
12
|
-
}
|
|
13
|
-
},
|
|
14
|
-
"files": [
|
|
15
|
-
"dist"
|
|
16
|
-
],
|
|
17
|
-
"scripts": {
|
|
18
|
-
"build": "tsup",
|
|
19
|
-
"dev": "tsup --watch"
|
|
20
|
-
},
|
|
21
|
-
"peerDependencies": {
|
|
22
|
-
"react": "^18.0.0 || ^19.0.0",
|
|
23
|
-
"react-dom": "^18.0.0 || ^19.0.0"
|
|
24
|
-
},
|
|
25
|
-
"dependencies": {
|
|
26
|
-
"@campfire-interactive/design-tokens": "*",
|
|
27
|
-
"lucide-react": "^0.460.0"
|
|
28
|
-
},
|
|
29
|
-
"devDependencies": {
|
|
30
|
-
"@types/react": "^19.0.0",
|
|
31
|
-
"esbuild-css-modules-plugin": "^3.1.5",
|
|
32
|
-
"react": "^19.0.0",
|
|
33
|
-
"react-dom": "^19.0.0",
|
|
34
|
-
"tsup": "^8.0.0",
|
|
35
|
-
"typescript": "^5.0.0"
|
|
36
|
-
},
|
|
37
|
-
"publishConfig": {
|
|
38
|
-
"registry": "https://registry.npmjs.org",
|
|
39
|
-
"access": "public"
|
|
40
|
-
}
|
|
41
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@campfire-interactive/shell-header",
|
|
3
|
+
"version": "0.8.15",
|
|
4
|
+
"description": "Shared shell header with app switcher for Campfire Suite",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"import": "./dist/index.js"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"files": [
|
|
15
|
+
"dist"
|
|
16
|
+
],
|
|
17
|
+
"scripts": {
|
|
18
|
+
"build": "tsup",
|
|
19
|
+
"dev": "tsup --watch"
|
|
20
|
+
},
|
|
21
|
+
"peerDependencies": {
|
|
22
|
+
"react": "^18.0.0 || ^19.0.0",
|
|
23
|
+
"react-dom": "^18.0.0 || ^19.0.0"
|
|
24
|
+
},
|
|
25
|
+
"dependencies": {
|
|
26
|
+
"@campfire-interactive/design-tokens": "*",
|
|
27
|
+
"lucide-react": "^0.460.0"
|
|
28
|
+
},
|
|
29
|
+
"devDependencies": {
|
|
30
|
+
"@types/react": "^19.0.0",
|
|
31
|
+
"esbuild-css-modules-plugin": "^3.1.5",
|
|
32
|
+
"react": "^19.0.0",
|
|
33
|
+
"react-dom": "^19.0.0",
|
|
34
|
+
"tsup": "^8.0.0",
|
|
35
|
+
"typescript": "^5.0.0"
|
|
36
|
+
},
|
|
37
|
+
"publishConfig": {
|
|
38
|
+
"registry": "https://registry.npmjs.org",
|
|
39
|
+
"access": "public"
|
|
40
|
+
}
|
|
41
|
+
}
|