@the-portland-company/shell 0.28.2 → 0.30.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/CHANGELOG.md +29 -0
- package/dist/app-chrome.cjs.map +1 -1
- package/dist/app-chrome.js +1 -1
- package/dist/{chunk-I3DWBWY6.js → chunk-QL5BWYN5.js} +4 -4
- package/dist/chunk-QL5BWYN5.js.map +1 -0
- package/dist/native.cjs +1 -0
- package/dist/native.cjs.map +1 -1
- package/dist/native.d.cts +28 -1
- package/dist/native.d.ts +28 -1
- package/dist/native.js +1 -1
- package/dist/runtime-tokens.cjs +19 -0
- package/dist/runtime-tokens.cjs.map +1 -0
- package/dist/runtime-tokens.d.cts +4 -0
- package/dist/runtime-tokens.d.ts +4 -0
- package/dist/runtime-tokens.js +16 -0
- package/dist/runtime-tokens.js.map +1 -0
- package/package.json +6 -1
- package/dist/chunk-I3DWBWY6.js.map +0 -1
package/dist/native.d.cts
CHANGED
|
@@ -3,6 +3,10 @@ import { ReactNode, ComponentType, CSSProperties } from 'react';
|
|
|
3
3
|
import { T as TopBarIconSlot } from './topbarIconSlot-FunwEKO9.cjs';
|
|
4
4
|
import { ThemePreference as ThemePreference$1 } from './theme-preference.cjs';
|
|
5
5
|
|
|
6
|
+
type NavIconLike = ComponentType<{
|
|
7
|
+
size?: number;
|
|
8
|
+
className?: string;
|
|
9
|
+
}>;
|
|
6
10
|
declare function topBarIconButtonClass(tone?: 'default' | 'warning' | 'danger'): string;
|
|
7
11
|
/** The shared count badge — one definition, used by every slot. */
|
|
8
12
|
declare function TopBarCountBadge({ count }: {
|
|
@@ -117,6 +121,29 @@ declare function useChromeOrgs(): {
|
|
|
117
121
|
loading: boolean;
|
|
118
122
|
error: boolean;
|
|
119
123
|
};
|
|
124
|
+
/**
|
|
125
|
+
* A top-bar popover: the shared circular trigger + a right-aligned panel.
|
|
126
|
+
* Closes on outside click / Escape. Purely presentational.
|
|
127
|
+
*
|
|
128
|
+
* EXPORTED so an app with a richer panel than the stock actions can render it
|
|
129
|
+
* inside the SHARED chrome — same 32px trigger, same tooltip, same badge, same
|
|
130
|
+
* panel surface and arrow — instead of hand-rolling a trigger and drifting.
|
|
131
|
+
* This is the enabling step for folding VRM's Fuel breakdown, import-progress,
|
|
132
|
+
* alerts and reply-feed panels into the shared cluster one at a time, without
|
|
133
|
+
* dropping capability (shell-nav-handoff §4; UI-Platform forbids migrating an
|
|
134
|
+
* app to a rendering that loses an element it already ships).
|
|
135
|
+
*/
|
|
136
|
+
declare function TopBarPopover({ label, description, slot, fallbackIcon, badge, tone, onOpen, children, panelClassName, }: {
|
|
137
|
+
label: string;
|
|
138
|
+
description?: string;
|
|
139
|
+
slot?: TopBarIconSlot;
|
|
140
|
+
fallbackIcon: NavIconLike;
|
|
141
|
+
badge?: number;
|
|
142
|
+
tone?: 'default' | 'warning' | 'danger';
|
|
143
|
+
onOpen?: () => void;
|
|
144
|
+
children: ReactNode;
|
|
145
|
+
panelClassName?: string;
|
|
146
|
+
}): react_jsx_runtime.JSX.Element;
|
|
120
147
|
declare function FuelAction({ orgId }: {
|
|
121
148
|
orgId: string | null;
|
|
122
149
|
}): react_jsx_runtime.JSX.Element;
|
|
@@ -491,4 +518,4 @@ type NavAppShellProps = {
|
|
|
491
518
|
};
|
|
492
519
|
declare function NavAppShell({ sidebar, topBar, betaBanner, contentWrapper, children, }: NavAppShellProps): react_jsx_runtime.JSX.Element;
|
|
493
520
|
|
|
494
|
-
export { type ChromeMe, type ChromeNotificationAlert, type ChromeNotificationReply, type ChromeNotificationsPayload, type ChromeOrgSummary, type CommunicationsFuelStatus, FuelAction, type FuelChannelStatus, NavAppShell, type NavAppShellProps, NavBetaBanner, type NavBetaBannerProps, type NavBrand, type NavBreadcrumb, type NavChromeFetcher, NavChromeProvider, NavDisplayAction, type NavDisplayMode, type NavFooter, type NavFooterLink, type NavIcon, type NavItem, type NavLinkComponent, type NavLinkProps, type NavLinkedAccount, type NavMode, type NavModeOption, type NavOrg, type NavOrgOption, type NavRoleBadge, NavSidebar, type NavSidebarProps, type NavTab, NavTabStrip, type NavTabStripProps, NavThemeControl, NavTopBar, type NavTopBarAction, type NavTopBarProps, type NavUser, type NavUserMenu, NotificationsAction, type StandardNavIconKey, type StandardNavOptions, SupportAction, type ThemePreference, TopBarCountBadge, TopBarPanelArrow, TopBarTooltip, TopBarWidgetSlot, envChipClasses, isNavItemActive, standardPolitogyNav, topBarIconButtonClass, useChromeMe, useChromeOrgs, useNavChromeFetcher, useThemePreference };
|
|
521
|
+
export { type ChromeMe, type ChromeNotificationAlert, type ChromeNotificationReply, type ChromeNotificationsPayload, type ChromeOrgSummary, type CommunicationsFuelStatus, FuelAction, type FuelChannelStatus, NavAppShell, type NavAppShellProps, NavBetaBanner, type NavBetaBannerProps, type NavBrand, type NavBreadcrumb, type NavChromeFetcher, NavChromeProvider, NavDisplayAction, type NavDisplayMode, type NavFooter, type NavFooterLink, type NavIcon, type NavItem, type NavLinkComponent, type NavLinkProps, type NavLinkedAccount, type NavMode, type NavModeOption, type NavOrg, type NavOrgOption, type NavRoleBadge, NavSidebar, type NavSidebarProps, type NavTab, NavTabStrip, type NavTabStripProps, NavThemeControl, NavTopBar, type NavTopBarAction, type NavTopBarProps, type NavUser, type NavUserMenu, NotificationsAction, type StandardNavIconKey, type StandardNavOptions, SupportAction, type ThemePreference, TopBarCountBadge, TopBarPanelArrow, TopBarPopover, TopBarTooltip, TopBarWidgetSlot, envChipClasses, isNavItemActive, standardPolitogyNav, topBarIconButtonClass, useChromeMe, useChromeOrgs, useNavChromeFetcher, useThemePreference };
|
package/dist/native.d.ts
CHANGED
|
@@ -3,6 +3,10 @@ import { ReactNode, ComponentType, CSSProperties } from 'react';
|
|
|
3
3
|
import { T as TopBarIconSlot } from './topbarIconSlot-FunwEKO9.js';
|
|
4
4
|
import { ThemePreference as ThemePreference$1 } from './theme-preference.js';
|
|
5
5
|
|
|
6
|
+
type NavIconLike = ComponentType<{
|
|
7
|
+
size?: number;
|
|
8
|
+
className?: string;
|
|
9
|
+
}>;
|
|
6
10
|
declare function topBarIconButtonClass(tone?: 'default' | 'warning' | 'danger'): string;
|
|
7
11
|
/** The shared count badge — one definition, used by every slot. */
|
|
8
12
|
declare function TopBarCountBadge({ count }: {
|
|
@@ -117,6 +121,29 @@ declare function useChromeOrgs(): {
|
|
|
117
121
|
loading: boolean;
|
|
118
122
|
error: boolean;
|
|
119
123
|
};
|
|
124
|
+
/**
|
|
125
|
+
* A top-bar popover: the shared circular trigger + a right-aligned panel.
|
|
126
|
+
* Closes on outside click / Escape. Purely presentational.
|
|
127
|
+
*
|
|
128
|
+
* EXPORTED so an app with a richer panel than the stock actions can render it
|
|
129
|
+
* inside the SHARED chrome — same 32px trigger, same tooltip, same badge, same
|
|
130
|
+
* panel surface and arrow — instead of hand-rolling a trigger and drifting.
|
|
131
|
+
* This is the enabling step for folding VRM's Fuel breakdown, import-progress,
|
|
132
|
+
* alerts and reply-feed panels into the shared cluster one at a time, without
|
|
133
|
+
* dropping capability (shell-nav-handoff §4; UI-Platform forbids migrating an
|
|
134
|
+
* app to a rendering that loses an element it already ships).
|
|
135
|
+
*/
|
|
136
|
+
declare function TopBarPopover({ label, description, slot, fallbackIcon, badge, tone, onOpen, children, panelClassName, }: {
|
|
137
|
+
label: string;
|
|
138
|
+
description?: string;
|
|
139
|
+
slot?: TopBarIconSlot;
|
|
140
|
+
fallbackIcon: NavIconLike;
|
|
141
|
+
badge?: number;
|
|
142
|
+
tone?: 'default' | 'warning' | 'danger';
|
|
143
|
+
onOpen?: () => void;
|
|
144
|
+
children: ReactNode;
|
|
145
|
+
panelClassName?: string;
|
|
146
|
+
}): react_jsx_runtime.JSX.Element;
|
|
120
147
|
declare function FuelAction({ orgId }: {
|
|
121
148
|
orgId: string | null;
|
|
122
149
|
}): react_jsx_runtime.JSX.Element;
|
|
@@ -491,4 +518,4 @@ type NavAppShellProps = {
|
|
|
491
518
|
};
|
|
492
519
|
declare function NavAppShell({ sidebar, topBar, betaBanner, contentWrapper, children, }: NavAppShellProps): react_jsx_runtime.JSX.Element;
|
|
493
520
|
|
|
494
|
-
export { type ChromeMe, type ChromeNotificationAlert, type ChromeNotificationReply, type ChromeNotificationsPayload, type ChromeOrgSummary, type CommunicationsFuelStatus, FuelAction, type FuelChannelStatus, NavAppShell, type NavAppShellProps, NavBetaBanner, type NavBetaBannerProps, type NavBrand, type NavBreadcrumb, type NavChromeFetcher, NavChromeProvider, NavDisplayAction, type NavDisplayMode, type NavFooter, type NavFooterLink, type NavIcon, type NavItem, type NavLinkComponent, type NavLinkProps, type NavLinkedAccount, type NavMode, type NavModeOption, type NavOrg, type NavOrgOption, type NavRoleBadge, NavSidebar, type NavSidebarProps, type NavTab, NavTabStrip, type NavTabStripProps, NavThemeControl, NavTopBar, type NavTopBarAction, type NavTopBarProps, type NavUser, type NavUserMenu, NotificationsAction, type StandardNavIconKey, type StandardNavOptions, SupportAction, type ThemePreference, TopBarCountBadge, TopBarPanelArrow, TopBarTooltip, TopBarWidgetSlot, envChipClasses, isNavItemActive, standardPolitogyNav, topBarIconButtonClass, useChromeMe, useChromeOrgs, useNavChromeFetcher, useThemePreference };
|
|
521
|
+
export { type ChromeMe, type ChromeNotificationAlert, type ChromeNotificationReply, type ChromeNotificationsPayload, type ChromeOrgSummary, type CommunicationsFuelStatus, FuelAction, type FuelChannelStatus, NavAppShell, type NavAppShellProps, NavBetaBanner, type NavBetaBannerProps, type NavBrand, type NavBreadcrumb, type NavChromeFetcher, NavChromeProvider, NavDisplayAction, type NavDisplayMode, type NavFooter, type NavFooterLink, type NavIcon, type NavItem, type NavLinkComponent, type NavLinkProps, type NavLinkedAccount, type NavMode, type NavModeOption, type NavOrg, type NavOrgOption, type NavRoleBadge, NavSidebar, type NavSidebarProps, type NavTab, NavTabStrip, type NavTabStripProps, NavThemeControl, NavTopBar, type NavTopBarAction, type NavTopBarProps, type NavUser, type NavUserMenu, NotificationsAction, type StandardNavIconKey, type StandardNavOptions, SupportAction, type ThemePreference, TopBarCountBadge, TopBarPanelArrow, TopBarPopover, TopBarTooltip, TopBarWidgetSlot, envChipClasses, isNavItemActive, standardPolitogyNav, topBarIconButtonClass, useChromeMe, useChromeOrgs, useNavChromeFetcher, useThemePreference };
|
package/dist/native.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
export { FuelAction, NavAppShell, NavBetaBanner, NavChromeProvider, NavDisplayAction, NavSidebar, NavTabStrip, NavThemeControl, NavTopBar, NotificationsAction, SupportAction, TopBarCountBadge, TopBarPanelArrow, TopBarTooltip, TopBarWidgetSlot, envChipClasses, isNavItemActive, standardPolitogyNav, topBarIconButtonClass, useChromeMe, useChromeOrgs, useNavChromeFetcher, useThemePreference } from './chunk-
|
|
2
|
+
export { FuelAction, NavAppShell, NavBetaBanner, NavChromeProvider, NavDisplayAction, NavSidebar, NavTabStrip, NavThemeControl, NavTopBar, NotificationsAction, SupportAction, TopBarCountBadge, TopBarPanelArrow, TopBarPopover, TopBarTooltip, TopBarWidgetSlot, envChipClasses, isNavItemActive, standardPolitogyNav, topBarIconButtonClass, useChromeMe, useChromeOrgs, useNavChromeFetcher, useThemePreference } from './chunk-QL5BWYN5.js';
|
|
3
3
|
import './chunk-NV6WHTEZ.js';
|
|
4
4
|
import './chunk-LL7RCJQN.js';
|
|
5
5
|
//# sourceMappingURL=native.js.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
// src/runtime-tokens.ts
|
|
4
|
+
var SPECS_TOKENS_HREF = "https://specs.politogyvrm.com/api/tokens?format=css";
|
|
5
|
+
function ensureRuntimeBrandTokens(href = SPECS_TOKENS_HREF) {
|
|
6
|
+
if (typeof document === "undefined") return;
|
|
7
|
+
const existing = document.querySelector(
|
|
8
|
+
`link[rel="stylesheet"][href*="api/tokens"]`
|
|
9
|
+
);
|
|
10
|
+
const link = existing ?? document.createElement("link");
|
|
11
|
+
link.rel = "stylesheet";
|
|
12
|
+
if (!existing) link.href = href;
|
|
13
|
+
document.head.appendChild(link);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
exports.SPECS_TOKENS_HREF = SPECS_TOKENS_HREF;
|
|
17
|
+
exports.ensureRuntimeBrandTokens = ensureRuntimeBrandTokens;
|
|
18
|
+
//# sourceMappingURL=runtime-tokens.cjs.map
|
|
19
|
+
//# sourceMappingURL=runtime-tokens.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/runtime-tokens.ts"],"names":[],"mappings":";;;AAaO,IAAM,iBAAA,GACX;AAEK,SAAS,wBAAA,CAAyB,OAAe,iBAAA,EAAyB;AAC/E,EAAA,IAAI,OAAO,aAAa,WAAA,EAAa;AACrC,EAAA,MAAM,WAAW,QAAA,CAAS,aAAA;AAAA,IACxB,CAAA,0CAAA;AAAA,GACF;AACA,EAAA,MAAM,IAAA,GAAO,QAAA,IAAY,QAAA,CAAS,aAAA,CAAc,MAAM,CAAA;AACtD,EAAA,IAAA,CAAK,GAAA,GAAM,YAAA;AACX,EAAA,IAAI,CAAC,QAAA,EAAU,IAAA,CAAK,IAAA,GAAO,IAAA;AAG3B,EAAA,QAAA,CAAS,IAAA,CAAK,YAAY,IAAI,CAAA;AAChC","file":"runtime-tokens.cjs","sourcesContent":["// Runtime Brand tokens — the loader every app shares.\n//\n// Global-Rules (\"Consume Brand tokens at RUNTIME, never baked in at build time\")\n// requires each app to load specs.politogyvrm.com/api/tokens?format=css so a\n// Brand edit goes live without a redeploy. A static <link> in <head> is not\n// enough on its own: the app's own bundled chrome.css can be injected AFTER it\n// and win the cascade, which is exactly what happened on VRM — it linked the\n// runtime sheet yet still resolved --color-accent from the build-time snapshot.\n//\n// Appending the link to the END of <head> at startup makes the runtime sheet the\n// last stylesheet, so the live Brand values win every time. Idempotent: an\n// existing runtime link is MOVED to the end rather than duplicated.\n\nexport const SPECS_TOKENS_HREF =\n 'https://specs.politogyvrm.com/api/tokens?format=css'\n\nexport function ensureRuntimeBrandTokens(href: string = SPECS_TOKENS_HREF): void {\n if (typeof document === 'undefined') return\n const existing = document.querySelector<HTMLLinkElement>(\n `link[rel=\"stylesheet\"][href*=\"api/tokens\"]`,\n )\n const link = existing ?? document.createElement('link')\n link.rel = 'stylesheet'\n if (!existing) link.href = href\n // Re-appending an already-present node moves it; the browser does not refetch\n // (and the response is ETag + max-age=60 cached regardless).\n document.head.appendChild(link)\n}\n"]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// src/runtime-tokens.ts
|
|
2
|
+
var SPECS_TOKENS_HREF = "https://specs.politogyvrm.com/api/tokens?format=css";
|
|
3
|
+
function ensureRuntimeBrandTokens(href = SPECS_TOKENS_HREF) {
|
|
4
|
+
if (typeof document === "undefined") return;
|
|
5
|
+
const existing = document.querySelector(
|
|
6
|
+
`link[rel="stylesheet"][href*="api/tokens"]`
|
|
7
|
+
);
|
|
8
|
+
const link = existing ?? document.createElement("link");
|
|
9
|
+
link.rel = "stylesheet";
|
|
10
|
+
if (!existing) link.href = href;
|
|
11
|
+
document.head.appendChild(link);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export { SPECS_TOKENS_HREF, ensureRuntimeBrandTokens };
|
|
15
|
+
//# sourceMappingURL=runtime-tokens.js.map
|
|
16
|
+
//# sourceMappingURL=runtime-tokens.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/runtime-tokens.ts"],"names":[],"mappings":";AAaO,IAAM,iBAAA,GACX;AAEK,SAAS,wBAAA,CAAyB,OAAe,iBAAA,EAAyB;AAC/E,EAAA,IAAI,OAAO,aAAa,WAAA,EAAa;AACrC,EAAA,MAAM,WAAW,QAAA,CAAS,aAAA;AAAA,IACxB,CAAA,0CAAA;AAAA,GACF;AACA,EAAA,MAAM,IAAA,GAAO,QAAA,IAAY,QAAA,CAAS,aAAA,CAAc,MAAM,CAAA;AACtD,EAAA,IAAA,CAAK,GAAA,GAAM,YAAA;AACX,EAAA,IAAI,CAAC,QAAA,EAAU,IAAA,CAAK,IAAA,GAAO,IAAA;AAG3B,EAAA,QAAA,CAAS,IAAA,CAAK,YAAY,IAAI,CAAA;AAChC","file":"runtime-tokens.js","sourcesContent":["// Runtime Brand tokens — the loader every app shares.\n//\n// Global-Rules (\"Consume Brand tokens at RUNTIME, never baked in at build time\")\n// requires each app to load specs.politogyvrm.com/api/tokens?format=css so a\n// Brand edit goes live without a redeploy. A static <link> in <head> is not\n// enough on its own: the app's own bundled chrome.css can be injected AFTER it\n// and win the cascade, which is exactly what happened on VRM — it linked the\n// runtime sheet yet still resolved --color-accent from the build-time snapshot.\n//\n// Appending the link to the END of <head> at startup makes the runtime sheet the\n// last stylesheet, so the live Brand values win every time. Idempotent: an\n// existing runtime link is MOVED to the end rather than duplicated.\n\nexport const SPECS_TOKENS_HREF =\n 'https://specs.politogyvrm.com/api/tokens?format=css'\n\nexport function ensureRuntimeBrandTokens(href: string = SPECS_TOKENS_HREF): void {\n if (typeof document === 'undefined') return\n const existing = document.querySelector<HTMLLinkElement>(\n `link[rel=\"stylesheet\"][href*=\"api/tokens\"]`,\n )\n const link = existing ?? document.createElement('link')\n link.rel = 'stylesheet'\n if (!existing) link.href = href\n // Re-appending an already-present node moves it; the browser does not refetch\n // (and the response is ETag + max-age=60 cached regardless).\n document.head.appendChild(link)\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@the-portland-company/shell",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.30.0",
|
|
4
4
|
"description": "Shared chrome (header, sidebar, footer, theme, auth) for politogy apps. Drop into any Vite SPA to inherit the politogy look and signed-in user.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"private": false,
|
|
@@ -45,6 +45,11 @@
|
|
|
45
45
|
"types": "./dist/app-icons.d.ts",
|
|
46
46
|
"import": "./dist/app-icons.js",
|
|
47
47
|
"require": "./dist/app-icons.cjs"
|
|
48
|
+
},
|
|
49
|
+
"./runtime-tokens": {
|
|
50
|
+
"types": "./dist/runtime-tokens.d.ts",
|
|
51
|
+
"import": "./dist/runtime-tokens.js",
|
|
52
|
+
"require": "./dist/runtime-tokens.cjs"
|
|
48
53
|
}
|
|
49
54
|
},
|
|
50
55
|
"files": [
|