@the-portland-company/shell 0.75.0 → 0.75.2
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 +17 -0
- package/dist/app-chrome.cjs +30 -19
- package/dist/app-chrome.cjs.map +1 -1
- package/dist/app-chrome.js +28 -17
- package/dist/app-chrome.js.map +1 -1
- package/dist/chrome.css +39 -7
- package/dist/{chunk-QUXD4PZ7.js → chunk-2DXTSTII.js} +10 -8
- package/dist/chunk-2DXTSTII.js.map +1 -0
- package/dist/index.cjs +33 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +18 -1
- package/dist/index.d.ts +18 -1
- package/dist/index.js +33 -3
- package/dist/index.js.map +1 -1
- package/dist/native.cjs +8 -6
- package/dist/native.cjs.map +1 -1
- package/dist/native.d.cts +6 -3
- package/dist/native.d.ts +6 -3
- package/dist/native.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-QUXD4PZ7.js.map +0 -1
package/dist/index.d.cts
CHANGED
|
@@ -22,15 +22,32 @@ type BreadcrumbItem$1 = {
|
|
|
22
22
|
label: string;
|
|
23
23
|
href?: string;
|
|
24
24
|
};
|
|
25
|
+
/** The three Modes a page header's eyebrow can announce (Reference/UI-Platform
|
|
26
|
+
* → "Per-mode branding"). */
|
|
27
|
+
type PageHeaderMode = 'relationship' | 'campaign' | 'petition';
|
|
25
28
|
type PageHeaderProps = {
|
|
26
29
|
title?: ReactNode;
|
|
30
|
+
/**
|
|
31
|
+
* The operating Mode this page belongs to. When set, the 11px uppercase
|
|
32
|
+
* mode eyebrow ("Relationship mode" / "Campaign mode" / "Petition mode")
|
|
33
|
+
* renders above the title by DEFAULT — Reference/UI-Platform → "Page
|
|
34
|
+
* header": "Left: an 11px uppercase mode eyebrow ... in the mode color
|
|
35
|
+
* (`modes.<mode>.primary`)". Pass `showEyebrow={false}` to suppress it.
|
|
36
|
+
*/
|
|
37
|
+
mode?: PageHeaderMode;
|
|
38
|
+
/** Overrides the eyebrow text the `mode` default would produce. */
|
|
39
|
+
eyebrow?: string;
|
|
40
|
+
/** Set false to suppress the eyebrow even when `mode` is passed. Default true. */
|
|
41
|
+
showEyebrow?: boolean;
|
|
42
|
+
/** Optional one-line subtitle, 15px G4, directly under the title. */
|
|
43
|
+
subtitle?: ReactNode;
|
|
27
44
|
breadcrumbs?: BreadcrumbItem$1[];
|
|
28
45
|
actions?: ReactNode;
|
|
29
46
|
tabBar?: ReactNode;
|
|
30
47
|
maxW?: string;
|
|
31
48
|
hideSidebar?: boolean;
|
|
32
49
|
};
|
|
33
|
-
declare function PageHeader({ title, breadcrumbs, actions, tabBar, maxW, hideSidebar, }: PageHeaderProps): react_jsx_runtime.JSX.Element | null;
|
|
50
|
+
declare function PageHeader({ title, mode, eyebrow, showEyebrow, subtitle, breadcrumbs, actions, tabBar, maxW, hideSidebar, }: PageHeaderProps): react_jsx_runtime.JSX.Element | null;
|
|
34
51
|
|
|
35
52
|
type PageContainerProps = {
|
|
36
53
|
children: ReactNode;
|
package/dist/index.d.ts
CHANGED
|
@@ -22,15 +22,32 @@ type BreadcrumbItem$1 = {
|
|
|
22
22
|
label: string;
|
|
23
23
|
href?: string;
|
|
24
24
|
};
|
|
25
|
+
/** The three Modes a page header's eyebrow can announce (Reference/UI-Platform
|
|
26
|
+
* → "Per-mode branding"). */
|
|
27
|
+
type PageHeaderMode = 'relationship' | 'campaign' | 'petition';
|
|
25
28
|
type PageHeaderProps = {
|
|
26
29
|
title?: ReactNode;
|
|
30
|
+
/**
|
|
31
|
+
* The operating Mode this page belongs to. When set, the 11px uppercase
|
|
32
|
+
* mode eyebrow ("Relationship mode" / "Campaign mode" / "Petition mode")
|
|
33
|
+
* renders above the title by DEFAULT — Reference/UI-Platform → "Page
|
|
34
|
+
* header": "Left: an 11px uppercase mode eyebrow ... in the mode color
|
|
35
|
+
* (`modes.<mode>.primary`)". Pass `showEyebrow={false}` to suppress it.
|
|
36
|
+
*/
|
|
37
|
+
mode?: PageHeaderMode;
|
|
38
|
+
/** Overrides the eyebrow text the `mode` default would produce. */
|
|
39
|
+
eyebrow?: string;
|
|
40
|
+
/** Set false to suppress the eyebrow even when `mode` is passed. Default true. */
|
|
41
|
+
showEyebrow?: boolean;
|
|
42
|
+
/** Optional one-line subtitle, 15px G4, directly under the title. */
|
|
43
|
+
subtitle?: ReactNode;
|
|
27
44
|
breadcrumbs?: BreadcrumbItem$1[];
|
|
28
45
|
actions?: ReactNode;
|
|
29
46
|
tabBar?: ReactNode;
|
|
30
47
|
maxW?: string;
|
|
31
48
|
hideSidebar?: boolean;
|
|
32
49
|
};
|
|
33
|
-
declare function PageHeader({ title, breadcrumbs, actions, tabBar, maxW, hideSidebar, }: PageHeaderProps): react_jsx_runtime.JSX.Element | null;
|
|
50
|
+
declare function PageHeader({ title, mode, eyebrow, showEyebrow, subtitle, breadcrumbs, actions, tabBar, maxW, hideSidebar, }: PageHeaderProps): react_jsx_runtime.JSX.Element | null;
|
|
34
51
|
|
|
35
52
|
type PageContainerProps = {
|
|
36
53
|
children: ReactNode;
|
package/dist/index.js
CHANGED
|
@@ -797,7 +797,7 @@ var SYSTEM_MONO = 'SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "
|
|
|
797
797
|
var fonts = {
|
|
798
798
|
heading: `var(--font-family, ${SYSTEM_SANS})`,
|
|
799
799
|
body: `var(--font-family, ${SYSTEM_SANS})`,
|
|
800
|
-
mono: `var(--
|
|
800
|
+
mono: `var(--font-mono, ${SYSTEM_MONO})`
|
|
801
801
|
};
|
|
802
802
|
var politogyTheme = extendTheme({
|
|
803
803
|
config,
|
|
@@ -843,6 +843,11 @@ function Card({
|
|
|
843
843
|
}
|
|
844
844
|
);
|
|
845
845
|
}
|
|
846
|
+
var MODE_EYEBROW_LABEL = {
|
|
847
|
+
relationship: "Relationship mode",
|
|
848
|
+
campaign: "Campaign mode",
|
|
849
|
+
petition: "Petition mode"
|
|
850
|
+
};
|
|
846
851
|
var resolveMaxWidthClass = (maxW) => {
|
|
847
852
|
if (maxW === "full") return "max-w-none";
|
|
848
853
|
if (maxW === "container.lg") return "max-w-6xl";
|
|
@@ -851,6 +856,10 @@ var resolveMaxWidthClass = (maxW) => {
|
|
|
851
856
|
};
|
|
852
857
|
function PageHeader({
|
|
853
858
|
title,
|
|
859
|
+
mode,
|
|
860
|
+
eyebrow,
|
|
861
|
+
showEyebrow = true,
|
|
862
|
+
subtitle,
|
|
854
863
|
breadcrumbs = [],
|
|
855
864
|
actions = null,
|
|
856
865
|
tabBar = null,
|
|
@@ -865,7 +874,8 @@ function PageHeader({
|
|
|
865
874
|
if (breadcrumbsWithoutCurrent.length > 1 && normalizedTitle && last && last.label.trim().toLowerCase() === normalizedTitle) {
|
|
866
875
|
breadcrumbsWithoutCurrent.pop();
|
|
867
876
|
}
|
|
868
|
-
|
|
877
|
+
const eyebrowText = showEyebrow ? eyebrow ?? (mode ? MODE_EYEBROW_LABEL[mode] : void 0) : void 0;
|
|
878
|
+
if (!title && !eyebrowText && breadcrumbsWithoutCurrent.length === 0 && !actions && !tabBar) {
|
|
869
879
|
return null;
|
|
870
880
|
}
|
|
871
881
|
return /* @__PURE__ */ jsxs(
|
|
@@ -878,7 +888,27 @@ function PageHeader({
|
|
|
878
888
|
children: [
|
|
879
889
|
/* @__PURE__ */ jsx("div", { className: clsx("w-full px-4", maxWClass), children: /* @__PURE__ */ jsxs("div", { className: "flex w-full flex-nowrap items-start justify-between gap-4", children: [
|
|
880
890
|
/* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
|
|
881
|
-
|
|
891
|
+
eyebrowText ? /* @__PURE__ */ jsx(
|
|
892
|
+
"div",
|
|
893
|
+
{
|
|
894
|
+
className: "truncate text-[11px] font-bold uppercase leading-[1.2] tracking-[0.09em]",
|
|
895
|
+
style: { color: "var(--mode-accent, var(--color-accent, #E63946))" },
|
|
896
|
+
children: eyebrowText
|
|
897
|
+
}
|
|
898
|
+
) : null,
|
|
899
|
+
title ? /* @__PURE__ */ jsx("div", { className: "min-w-0", children: /* @__PURE__ */ jsx(
|
|
900
|
+
"div",
|
|
901
|
+
{
|
|
902
|
+
className: "truncate font-bold text-white",
|
|
903
|
+
style: {
|
|
904
|
+
fontFamily: "var(--font-family, ui-sans-serif, system-ui, sans-serif)",
|
|
905
|
+
fontSize: "var(--type-h2-size, 1.875rem)",
|
|
906
|
+
lineHeight: "var(--type-h2-line-height, 1.25)"
|
|
907
|
+
},
|
|
908
|
+
children: title
|
|
909
|
+
}
|
|
910
|
+
) }) : null,
|
|
911
|
+
subtitle ? /* @__PURE__ */ jsx("div", { className: "mt-1 truncate text-[15px] text-[color:var(--color-g4,#929599)]", children: subtitle }) : null,
|
|
882
912
|
breadcrumbsWithoutCurrent.length > 0 ? /* @__PURE__ */ jsx(
|
|
883
913
|
"nav",
|
|
884
914
|
{
|