@phis/ui 0.6.8 → 0.6.10
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/components/regions/presets/phi-base-page-layout.js +5 -16
- package/helpers/page-inset.d.ts +23 -0
- package/helpers/page-inset.js +23 -0
- package/helpers/page-layout-check.js +11 -4
- package/package.json +1 -1
- package/plugins/runtime-modules/theme/widgets/brand-controls/client.js +15 -9
- package/styles/shell.css +15 -2
- package/theme/antd-css-var-contract.d.ts +6 -0
- package/theme/antd-css-var-contract.js +10 -0
- package/theme/phi-theme-tokens.d.ts +3 -1
- package/theme/phi-theme-tokens.js +15 -1
- package/theme/phi-theme.d.ts +12 -0
- package/theme/phi-theme.js +13 -0
- package/theme/phi-tokens.d.ts +7 -2
- package/theme/phi-tokens.js +10 -4
|
@@ -3,8 +3,7 @@ import { PhiCmsRegionType } from "../../../constants/phi-cms";
|
|
|
3
3
|
import { createPhiCmsPresetNodes } from "../../../helpers/cms-preset-nodes";
|
|
4
4
|
import { PHI_SHARED_PACKAGE_NAME } from "../../../constants/package";
|
|
5
5
|
import { createPhiPresetCmsInstanceId } from "../../../types/cms-instance-id";
|
|
6
|
-
import {
|
|
7
|
-
import { PHI_PAGE, PHI_SPACE } from "../../../theme/antd-css-var-contract";
|
|
6
|
+
import { resolvePhiPageInsetConfig } from "../../../helpers/page-inset";
|
|
8
7
|
/**
|
|
9
8
|
* The shared content-region scaffold of the built-in page presets.
|
|
10
9
|
*
|
|
@@ -49,27 +48,17 @@ export function buildPhiBasePageLayoutNode(page) {
|
|
|
49
48
|
label: PHI_BASE_PAGE_LAYOUT_LABEL,
|
|
50
49
|
});
|
|
51
50
|
}
|
|
52
|
-
/** The Areas a visitor reads in: their content Region stands in by the Theme's Page padding. */
|
|
53
|
-
const PHI_VISITOR_AREA_MASK = resolvePhiCmsAreaMask("public") | resolvePhiCmsAreaMask("app");
|
|
54
51
|
/**
|
|
55
52
|
* The distance from the screen's edge to a Page's content, on its content Region and nowhere else.
|
|
56
53
|
*
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
*
|
|
54
|
+
* Both are the Theme's (THEME.md "Page padding"): in Public `PHI_PAGE.padding` (21 unless the Theme says
|
|
55
|
+
* otherwise), in App and the staff Areas `PHI_PAGE.signedInPadding` (13 on a phone, 21 from a tablet on).
|
|
56
|
+
* The Hero and the Footer top are Regions of their own and keep the full width. The scaffold inside has no
|
|
60
57
|
* padding; what stands in it with a ground of its own -- the wash column, a Split Card's cards -- insets
|
|
61
58
|
* its content by `base`.
|
|
62
59
|
*/
|
|
63
60
|
function resolvePhiBasePageRegionInset(page) {
|
|
64
|
-
|
|
65
|
-
return visitorPage
|
|
66
|
-
? {
|
|
67
|
-
paddingTop: PHI_PAGE.padding.top,
|
|
68
|
-
paddingRight: PHI_PAGE.padding.right,
|
|
69
|
-
paddingBottom: PHI_PAGE.padding.bottom,
|
|
70
|
-
paddingLeft: PHI_PAGE.padding.left,
|
|
71
|
-
}
|
|
72
|
-
: { padding: PHI_SPACE.base };
|
|
61
|
+
return resolvePhiPageInsetConfig(page.areaMask);
|
|
73
62
|
}
|
|
74
63
|
/**
|
|
75
64
|
* Content region rooted on the scaffold. The region keeps its per-page identity -- `regionId` stays the
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Which of the Theme's Page insets a Page stands in by (THEME.md "Page padding"): Public's
|
|
3
|
+
* (`PHI_PAGE.padding`) for a Page of Public alone, the signed-in Areas' (`PHI_PAGE.signedInPadding`) for
|
|
4
|
+
* every other. Read where the base Pages are built and where a preset Page is checked, so both agree.
|
|
5
|
+
*/
|
|
6
|
+
export declare function resolvePhiPageInset(areaMask: number | null | undefined): {
|
|
7
|
+
readonly top: "var(--phi-page-inset-top, var(--phi-page-padding-top-desktop))";
|
|
8
|
+
readonly right: "var(--phi-page-inset-right, var(--phi-page-padding-right-desktop))";
|
|
9
|
+
readonly bottom: "var(--phi-page-inset-bottom, var(--phi-page-padding-bottom-desktop))";
|
|
10
|
+
readonly left: "var(--phi-page-inset-left, var(--phi-page-padding-left-desktop))";
|
|
11
|
+
} | {
|
|
12
|
+
readonly top: "var(--phi-signed-in-page-inset-top, var(--phi-signed-in-page-padding-top-desktop))";
|
|
13
|
+
readonly right: "var(--phi-signed-in-page-inset-right, var(--phi-signed-in-page-padding-right-desktop))";
|
|
14
|
+
readonly bottom: "var(--phi-signed-in-page-inset-bottom, var(--phi-signed-in-page-padding-bottom-desktop))";
|
|
15
|
+
readonly left: "var(--phi-signed-in-page-inset-left, var(--phi-signed-in-page-padding-left-desktop))";
|
|
16
|
+
};
|
|
17
|
+
/** The inset as the four sides of a Region's config. */
|
|
18
|
+
export declare function resolvePhiPageInsetConfig(areaMask: number | null | undefined): {
|
|
19
|
+
paddingTop: "var(--phi-page-inset-top, var(--phi-page-padding-top-desktop))" | "var(--phi-signed-in-page-inset-top, var(--phi-signed-in-page-padding-top-desktop))";
|
|
20
|
+
paddingRight: "var(--phi-page-inset-right, var(--phi-page-padding-right-desktop))" | "var(--phi-signed-in-page-inset-right, var(--phi-signed-in-page-padding-right-desktop))";
|
|
21
|
+
paddingBottom: "var(--phi-page-inset-bottom, var(--phi-page-padding-bottom-desktop))" | "var(--phi-signed-in-page-inset-bottom, var(--phi-signed-in-page-padding-bottom-desktop))";
|
|
22
|
+
paddingLeft: "var(--phi-page-inset-left, var(--phi-page-padding-left-desktop))" | "var(--phi-signed-in-page-inset-left, var(--phi-signed-in-page-padding-left-desktop))";
|
|
23
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { resolvePhiCmsAreaMask } from "../constants/cms-areas";
|
|
2
|
+
import { PHI_PAGE } from "../theme/antd-css-var-contract";
|
|
3
|
+
const PHI_PUBLIC_AREA_MASK = resolvePhiCmsAreaMask("public");
|
|
4
|
+
/**
|
|
5
|
+
* Which of the Theme's Page insets a Page stands in by (THEME.md "Page padding"): Public's
|
|
6
|
+
* (`PHI_PAGE.padding`) for a Page of Public alone, the signed-in Areas' (`PHI_PAGE.signedInPadding`) for
|
|
7
|
+
* every other. Read where the base Pages are built and where a preset Page is checked, so both agree.
|
|
8
|
+
*/
|
|
9
|
+
export function resolvePhiPageInset(areaMask) {
|
|
10
|
+
const mask = areaMask ?? 0;
|
|
11
|
+
const publicPage = mask !== 0 && (mask & ~PHI_PUBLIC_AREA_MASK) === 0;
|
|
12
|
+
return publicPage ? PHI_PAGE.padding : PHI_PAGE.signedInPadding;
|
|
13
|
+
}
|
|
14
|
+
/** The inset as the four sides of a Region's config. */
|
|
15
|
+
export function resolvePhiPageInsetConfig(areaMask) {
|
|
16
|
+
const inset = resolvePhiPageInset(areaMask);
|
|
17
|
+
return {
|
|
18
|
+
paddingTop: inset.top,
|
|
19
|
+
paddingRight: inset.right,
|
|
20
|
+
paddingBottom: inset.bottom,
|
|
21
|
+
paddingLeft: inset.left,
|
|
22
|
+
};
|
|
23
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { PhiCmsRegionType } from "../constants/phi-cms";
|
|
2
2
|
import { PHI_PAGE, PHI_SPACE } from "../theme/antd-css-var-contract";
|
|
3
|
+
import { resolvePhiPageInset } from "./page-inset";
|
|
3
4
|
import { parsePhiCmsCarouselLayoutConfig, parsePhiCmsCollapsibleLayoutConfig, parsePhiCmsContentLayoutConfig, parsePhiCmsFlexLayoutConfig, parsePhiCmsFlexVerticalLayoutConfig, parsePhiCmsGridLayoutConfig, parsePhiCmsMasonryLayoutConfig, parsePhiCmsSplitCardLayoutConfig, parsePhiCmsStackLayoutConfig, parsePhiCmsThreeColumnLayoutConfig, } from "../types/cms-config";
|
|
4
5
|
import { readPhiSurface } from "../types/surface";
|
|
5
6
|
const SPACING_KEYS = ["padding", "paddingTop", "paddingRight", "paddingBottom", "paddingLeft", "gap"];
|
|
@@ -26,7 +27,8 @@ const LAYOUT_CONFIG_PARSERS = {
|
|
|
26
27
|
* The Theme's Page inset (`PHI_PAGE.padding`, THEME.md "Page padding") is a step of the spacing scale per
|
|
27
28
|
* side and screen, chosen by the Theme: a distance like any other, at the preset level.
|
|
28
29
|
*/
|
|
29
|
-
const PAGE_INSET_REFERENCES = new Set(Object.values(PHI_PAGE.padding));
|
|
30
|
+
const PAGE_INSET_REFERENCES = new Set([...Object.values(PHI_PAGE.padding), ...Object.values(PHI_PAGE.signedInPadding)]);
|
|
31
|
+
const PAGE_INSET_SIDES = [["paddingTop", "top"], ["paddingRight", "right"], ["paddingBottom", "bottom"], ["paddingLeft", "left"]];
|
|
30
32
|
function stepOf(value) {
|
|
31
33
|
if (value === 0 || value === "0")
|
|
32
34
|
return "none";
|
|
@@ -57,11 +59,16 @@ export function checkPhiPagePresetLayout(tree) {
|
|
|
57
59
|
const regionConfig = (contentRegion?.config ?? {});
|
|
58
60
|
const heroOverlap = heroRegion ? regionConfig.heroOverlap : undefined;
|
|
59
61
|
if (contentRegion) {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
+
/*
|
|
63
|
+
* The Page's edge is the Theme's, on all four sides: a number, or a step of the scale, would stay what
|
|
64
|
+
* it was the day the preset was written, whatever the Site's Theme says.
|
|
65
|
+
*/
|
|
66
|
+
const inset = resolvePhiPageInset(tree.page?.areaMask);
|
|
67
|
+
const scope = inset === PHI_PAGE.padding ? "PHI_PAGE.padding" : "PHI_PAGE.signedInPadding";
|
|
68
|
+
if (PAGE_INSET_SIDES.some(([key, side]) => regionConfig[key] !== inset[side])) {
|
|
62
69
|
findings.push({
|
|
63
70
|
node: `region ${contentRegion.id}`,
|
|
64
|
-
message:
|
|
71
|
+
message: `The content Region is the Page's edge and states the Theme's inset on all four sides: \`paddingTop\` to \`paddingLeft\` from \`${scope}\`.`,
|
|
65
72
|
});
|
|
66
73
|
}
|
|
67
74
|
if (heroOverlap != null && stepOf(heroOverlap) == null) {
|
package/package.json
CHANGED
|
@@ -27,7 +27,7 @@ import { buildPhiThemeStructuralTokens } from "../../../../../theme/phi-theme";
|
|
|
27
27
|
import { PHI_CONTROL_HEIGHTS, PHI_LAYOUT, PHI_PADDING, PHI_RADII, } from "../../../../../theme/phi-tokens";
|
|
28
28
|
import { PHI_CONTAINER_BREAKPOINT_REGION } from "../../../../../theme/phi-container-breakpoints";
|
|
29
29
|
import { PHI_SPACE } from "../../../../../theme/antd-css-var-contract";
|
|
30
|
-
import { PHI_THEME_PAGE_PADDING_BANDS, PHI_THEME_PAGE_PADDING_SIDES } from "../../../../../theme/phi-theme-tokens";
|
|
30
|
+
import { PHI_THEME_PAGE_PADDING_BANDS, PHI_THEME_PAGE_PADDING_SCOPES, PHI_THEME_PAGE_PADDING_SIDES, } from "../../../../../theme/phi-theme-tokens";
|
|
31
31
|
import { PHI_COLOR_PICKER_NEUTRAL_PRESETS, PHI_COLOR_PICKER_PRESETS } from "../../../../../components/widgets/config/color-picker-presets";
|
|
32
32
|
import { PHI_SPACING_TOKEN_KEYS } from "../../../../../components/widgets/config/spacing-options";
|
|
33
33
|
import { PhiColorFieldControl } from "../../../../../components/controls/phi-color-field-control";
|
|
@@ -1251,10 +1251,12 @@ export function PhiBuilderBrandStyleControlsWidgetClient({ runtime, config, }) {
|
|
|
1251
1251
|
const wireframe = readEffectiveTokenBoolean(styleTokenInput, "wireframe", true);
|
|
1252
1252
|
const pageMax = readEffectiveTokenNumber(styleTokenInput, "pageMax", PHI_LAYOUT.pageMax);
|
|
1253
1253
|
const [pagePaddingBand, setPagePaddingBand] = useState("Phone");
|
|
1254
|
-
|
|
1254
|
+
// Whose inset is edited: Public's (`pagePadding…`) or the signed-in Areas' (`signedInPagePadding…`).
|
|
1255
|
+
const [pagePaddingScope, setPagePaddingScope] = useState("pagePadding");
|
|
1256
|
+
const pagePaddingDefault = PHI_SPACE[PHI_LAYOUT[pagePaddingScope][pagePaddingBand.toLowerCase()]];
|
|
1255
1257
|
const pagePadding = Object.fromEntries(PHI_THEME_PAGE_PADDING_SIDES.map((side) => [
|
|
1256
1258
|
`padding${side}`,
|
|
1257
|
-
readEffectiveTokenString(styleTokenInput,
|
|
1259
|
+
readEffectiveTokenString(styleTokenInput, `${pagePaddingScope}${side}${pagePaddingBand}`, pagePaddingDefault),
|
|
1258
1260
|
]));
|
|
1259
1261
|
const baseFontSize = readEffectiveTokenNumber(styleTokenInput, "fontSize", 12);
|
|
1260
1262
|
function updateToken(tokenPatch) {
|
|
@@ -1387,16 +1389,20 @@ export function PhiBuilderBrandStyleControlsWidgetClient({ runtime, config, }) {
|
|
|
1387
1389
|
},
|
|
1388
1390
|
{
|
|
1389
1391
|
/*
|
|
1390
|
-
* How far a Page's content stands in
|
|
1391
|
-
* below
|
|
1392
|
-
*
|
|
1392
|
+
* How far a Page's content stands in, per side and per screen -- a phone below 768, a tablet
|
|
1393
|
+
* below 1200, a desktop from there -- in Public (`PHI_PAGE.padding`) and in the signed-in
|
|
1394
|
+
* Areas (`PHI_PAGE.signedInPadding`). The default of a Page's content Region; a Region that
|
|
1395
|
+
* states its own padding keeps it.
|
|
1393
1396
|
*/
|
|
1394
1397
|
key: "pagePadding",
|
|
1395
1398
|
label: _jsx(PhiTypographyControl, { strong: true, children: "Page Padding" }),
|
|
1396
|
-
children: (_jsxs(PhiFlexControl, { vertical: true, gap: clientToken.paddingXS, children: [_jsx(PhiSegmentedControl, { value:
|
|
1399
|
+
children: (_jsxs(PhiFlexControl, { vertical: true, gap: clientToken.paddingXS, children: [_jsx(PhiSegmentedControl, { value: pagePaddingScope, options: [
|
|
1400
|
+
{ value: "pagePadding", label: "Public" },
|
|
1401
|
+
{ value: "signedInPagePadding", label: "Signed in" },
|
|
1402
|
+
], onChange: setPagePaddingScope }), _jsx(PhiSegmentedControl, { value: pagePaddingBand, options: PHI_THEME_PAGE_PADDING_BANDS.map((band) => ({ value: band, label: band })), onChange: setPagePaddingBand }), _jsx(PhiPaddingControl, { value: pagePadding, showGap: false, onChange: (next) => updateToken(Object.fromEntries(PHI_THEME_PAGE_PADDING_SIDES.map((side) => {
|
|
1397
1403
|
const value = next?.[`padding${side}`] ?? next?.padding;
|
|
1398
|
-
return [
|
|
1399
|
-
}))) }), _jsx(PhiTypographyControl, { type: "secondary", children: "The default of a Page that does not set its own: a phone below 768px, a tablet below 1200px." })] })),
|
|
1404
|
+
return [`${pagePaddingScope}${side}${pagePaddingBand}`, value == null ? undefined : value];
|
|
1405
|
+
}))) }), _jsx(PhiTypographyControl, { type: "secondary", children: "The default of a Page that does not set its own, in Public or in App and the staff Areas: a phone below 768px, a tablet below 1200px." })] })),
|
|
1400
1406
|
},
|
|
1401
1407
|
] }) })] }));
|
|
1402
1408
|
}
|
package/styles/shell.css
CHANGED
|
@@ -53,8 +53,9 @@
|
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
/*
|
|
56
|
-
* Page inset: how far a Page's content stands in (`PHI_PAGE.padding`
|
|
57
|
-
*
|
|
56
|
+
* Page inset: how far a Page's content stands in (`PHI_PAGE.padding` in Public, `PHI_PAGE.signedInPadding`
|
|
57
|
+
* in the signed-in Areas), by the same device bands. The Theme states four sides per band
|
|
58
|
+
* (`pagePadding<Side><Band>`, `signedInPagePadding<Side><Band>`, theme/phi-tokens.ts); these rules hand the
|
|
58
59
|
* band the screen is in to everything inside the Shell, and a Page column reads only the chosen one. A
|
|
59
60
|
* Layout that states its own padding is not reading it.
|
|
60
61
|
*/
|
|
@@ -63,6 +64,10 @@
|
|
|
63
64
|
--phi-page-inset-right: var(--phi-page-padding-right-desktop);
|
|
64
65
|
--phi-page-inset-bottom: var(--phi-page-padding-bottom-desktop);
|
|
65
66
|
--phi-page-inset-left: var(--phi-page-padding-left-desktop);
|
|
67
|
+
--phi-signed-in-page-inset-top: var(--phi-signed-in-page-padding-top-desktop);
|
|
68
|
+
--phi-signed-in-page-inset-right: var(--phi-signed-in-page-padding-right-desktop);
|
|
69
|
+
--phi-signed-in-page-inset-bottom: var(--phi-signed-in-page-padding-bottom-desktop);
|
|
70
|
+
--phi-signed-in-page-inset-left: var(--phi-signed-in-page-padding-left-desktop);
|
|
66
71
|
}
|
|
67
72
|
|
|
68
73
|
@container phi-render-viewport (width < 1200px) {
|
|
@@ -71,6 +76,10 @@
|
|
|
71
76
|
--phi-page-inset-right: var(--phi-page-padding-right-tablet);
|
|
72
77
|
--phi-page-inset-bottom: var(--phi-page-padding-bottom-tablet);
|
|
73
78
|
--phi-page-inset-left: var(--phi-page-padding-left-tablet);
|
|
79
|
+
--phi-signed-in-page-inset-top: var(--phi-signed-in-page-padding-top-tablet);
|
|
80
|
+
--phi-signed-in-page-inset-right: var(--phi-signed-in-page-padding-right-tablet);
|
|
81
|
+
--phi-signed-in-page-inset-bottom: var(--phi-signed-in-page-padding-bottom-tablet);
|
|
82
|
+
--phi-signed-in-page-inset-left: var(--phi-signed-in-page-padding-left-tablet);
|
|
74
83
|
}
|
|
75
84
|
}
|
|
76
85
|
|
|
@@ -80,6 +89,10 @@
|
|
|
80
89
|
--phi-page-inset-right: var(--phi-page-padding-right-phone);
|
|
81
90
|
--phi-page-inset-bottom: var(--phi-page-padding-bottom-phone);
|
|
82
91
|
--phi-page-inset-left: var(--phi-page-padding-left-phone);
|
|
92
|
+
--phi-signed-in-page-inset-top: var(--phi-signed-in-page-padding-top-phone);
|
|
93
|
+
--phi-signed-in-page-inset-right: var(--phi-signed-in-page-padding-right-phone);
|
|
94
|
+
--phi-signed-in-page-inset-bottom: var(--phi-signed-in-page-padding-bottom-phone);
|
|
95
|
+
--phi-signed-in-page-inset-left: var(--phi-signed-in-page-padding-left-phone);
|
|
83
96
|
}
|
|
84
97
|
}
|
|
85
98
|
|
|
@@ -83,6 +83,12 @@ export declare const PHI_PAGE: {
|
|
|
83
83
|
readonly bottom: "var(--phi-page-inset-bottom, var(--phi-page-padding-bottom-desktop))";
|
|
84
84
|
readonly left: "var(--phi-page-inset-left, var(--phi-page-padding-left-desktop))";
|
|
85
85
|
};
|
|
86
|
+
readonly signedInPadding: {
|
|
87
|
+
readonly top: "var(--phi-signed-in-page-inset-top, var(--phi-signed-in-page-padding-top-desktop))";
|
|
88
|
+
readonly right: "var(--phi-signed-in-page-inset-right, var(--phi-signed-in-page-padding-right-desktop))";
|
|
89
|
+
readonly bottom: "var(--phi-signed-in-page-inset-bottom, var(--phi-signed-in-page-padding-bottom-desktop))";
|
|
90
|
+
readonly left: "var(--phi-signed-in-page-inset-left, var(--phi-signed-in-page-padding-left-desktop))";
|
|
91
|
+
};
|
|
86
92
|
};
|
|
87
93
|
export declare const PHI_RADIUS: {
|
|
88
94
|
readonly xxs: "var(--phi-border-radius-xs)";
|
|
@@ -97,6 +97,16 @@ export const PHI_PAGE = {
|
|
|
97
97
|
bottom: "var(--phi-page-inset-bottom, var(--phi-page-padding-bottom-desktop))",
|
|
98
98
|
left: "var(--phi-page-inset-left, var(--phi-page-padding-left-desktop))",
|
|
99
99
|
},
|
|
100
|
+
/*
|
|
101
|
+
* The same in the signed-in Areas -- App and the staff Areas: the Theme's `signedInPagePadding<Side><Band>`
|
|
102
|
+
* for the band the screen is in.
|
|
103
|
+
*/
|
|
104
|
+
signedInPadding: {
|
|
105
|
+
top: "var(--phi-signed-in-page-inset-top, var(--phi-signed-in-page-padding-top-desktop))",
|
|
106
|
+
right: "var(--phi-signed-in-page-inset-right, var(--phi-signed-in-page-padding-right-desktop))",
|
|
107
|
+
bottom: "var(--phi-signed-in-page-inset-bottom, var(--phi-signed-in-page-padding-bottom-desktop))",
|
|
108
|
+
left: "var(--phi-signed-in-page-inset-left, var(--phi-signed-in-page-padding-left-desktop))",
|
|
109
|
+
},
|
|
100
110
|
};
|
|
101
111
|
export const PHI_RADIUS = {
|
|
102
112
|
xxs: "var(--phi-border-radius-xs)",
|
|
@@ -45,10 +45,12 @@ export declare const PHI_THEME_TOKEN_KEYS: readonly ["colorBgContainer", "colorB
|
|
|
45
45
|
* the `display` of the mark behind a link that leaves the Site (theme/phi-link-mark.ts). The
|
|
46
46
|
* `surfaceShadow*` names are what a Surface's `soft` and `strong` steps draw (theme/phi-surface-shadow.ts).
|
|
47
47
|
*/
|
|
48
|
-
export declare const PHI_THEME_OWN_TOKEN_KEYS: readonly ["paddingXXL", "pageMax", "pagePaddingTopPhone", "pagePaddingRightPhone", "pagePaddingBottomPhone", "pagePaddingLeftPhone", "pagePaddingTopTablet", "pagePaddingRightTablet", "pagePaddingBottomTablet", "pagePaddingLeftTablet", "pagePaddingTopDesktop", "pagePaddingRightDesktop", "pagePaddingBottomDesktop", "pagePaddingLeftDesktop", "gradient1", "gradient1Text", "gradient2", "gradient2Text", "gradient3", "gradient3Text", "primaryButtonGradient", "primaryButtonGradientHover", "primaryButtonGradientActive", "primaryButtonGradientText", "linkExternalMark", "surfaceShadowSoft", "surfaceShadowStrong", "custom1", "custom2", "custom3", "custom4", "custom5", "custom6", "custom7", "custom8", "custom9", "custom10"];
|
|
48
|
+
export declare const PHI_THEME_OWN_TOKEN_KEYS: readonly ["paddingXXL", "pageMax", "pagePaddingTopPhone", "pagePaddingRightPhone", "pagePaddingBottomPhone", "pagePaddingLeftPhone", "pagePaddingTopTablet", "pagePaddingRightTablet", "pagePaddingBottomTablet", "pagePaddingLeftTablet", "pagePaddingTopDesktop", "pagePaddingRightDesktop", "pagePaddingBottomDesktop", "pagePaddingLeftDesktop", "signedInPagePaddingTopPhone", "signedInPagePaddingRightPhone", "signedInPagePaddingBottomPhone", "signedInPagePaddingLeftPhone", "signedInPagePaddingTopTablet", "signedInPagePaddingRightTablet", "signedInPagePaddingBottomTablet", "signedInPagePaddingLeftTablet", "signedInPagePaddingTopDesktop", "signedInPagePaddingRightDesktop", "signedInPagePaddingBottomDesktop", "signedInPagePaddingLeftDesktop", "gradient1", "gradient1Text", "gradient2", "gradient2Text", "gradient3", "gradient3Text", "primaryButtonGradient", "primaryButtonGradientHover", "primaryButtonGradientActive", "primaryButtonGradientText", "linkExternalMark", "surfaceShadowSoft", "surfaceShadowStrong", "custom1", "custom2", "custom3", "custom4", "custom5", "custom6", "custom7", "custom8", "custom9", "custom10"];
|
|
49
49
|
/** The Page inset's names, per band and side (`PHI_LAYOUT.pagePadding`, `PHI_PAGE.padding`). */
|
|
50
50
|
export declare const PHI_THEME_PAGE_PADDING_BANDS: readonly ["Phone", "Tablet", "Desktop"];
|
|
51
51
|
export declare const PHI_THEME_PAGE_PADDING_SIDES: readonly ["Top", "Right", "Bottom", "Left"];
|
|
52
|
+
/** Whose inset a token is: Public's (`pagePadding…`) or the signed-in Areas' (`signedInPagePadding…`). */
|
|
53
|
+
export declare const PHI_THEME_PAGE_PADDING_SCOPES: readonly ["pagePadding", "signedInPagePadding"];
|
|
52
54
|
export type PhiThemeTokenKey = (typeof PHI_THEME_TOKEN_KEYS)[number];
|
|
53
55
|
/**
|
|
54
56
|
* The resolved Theme, in the names above and their Ant Design value types.
|
|
@@ -192,6 +192,18 @@ export const PHI_THEME_OWN_TOKEN_KEYS = [
|
|
|
192
192
|
"pagePaddingRightDesktop",
|
|
193
193
|
"pagePaddingBottomDesktop",
|
|
194
194
|
"pagePaddingLeftDesktop",
|
|
195
|
+
"signedInPagePaddingTopPhone",
|
|
196
|
+
"signedInPagePaddingRightPhone",
|
|
197
|
+
"signedInPagePaddingBottomPhone",
|
|
198
|
+
"signedInPagePaddingLeftPhone",
|
|
199
|
+
"signedInPagePaddingTopTablet",
|
|
200
|
+
"signedInPagePaddingRightTablet",
|
|
201
|
+
"signedInPagePaddingBottomTablet",
|
|
202
|
+
"signedInPagePaddingLeftTablet",
|
|
203
|
+
"signedInPagePaddingTopDesktop",
|
|
204
|
+
"signedInPagePaddingRightDesktop",
|
|
205
|
+
"signedInPagePaddingBottomDesktop",
|
|
206
|
+
"signedInPagePaddingLeftDesktop",
|
|
195
207
|
"gradient1",
|
|
196
208
|
"gradient1Text",
|
|
197
209
|
"gradient2",
|
|
@@ -219,7 +231,9 @@ export const PHI_THEME_OWN_TOKEN_KEYS = [
|
|
|
219
231
|
/** The Page inset's names, per band and side (`PHI_LAYOUT.pagePadding`, `PHI_PAGE.padding`). */
|
|
220
232
|
export const PHI_THEME_PAGE_PADDING_BANDS = ["Phone", "Tablet", "Desktop"];
|
|
221
233
|
export const PHI_THEME_PAGE_PADDING_SIDES = ["Top", "Right", "Bottom", "Left"];
|
|
222
|
-
|
|
234
|
+
/** Whose inset a token is: Public's (`pagePadding…`) or the signed-in Areas' (`signedInPagePadding…`). */
|
|
235
|
+
export const PHI_THEME_PAGE_PADDING_SCOPES = ["pagePadding", "signedInPagePadding"];
|
|
236
|
+
const PHI_THEME_PAGE_PADDING_TOKEN_KEYS = PHI_THEME_PAGE_PADDING_SCOPES.flatMap((scope) => PHI_THEME_PAGE_PADDING_BANDS.flatMap((band) => PHI_THEME_PAGE_PADDING_SIDES.map((side) => `${scope}${side}${band}`)));
|
|
223
237
|
/**
|
|
224
238
|
* The colours a palette seeds, shared by both modes.
|
|
225
239
|
*
|
package/theme/phi-theme.d.ts
CHANGED
|
@@ -46,6 +46,18 @@ export type PhiThemeTokens = {
|
|
|
46
46
|
pagePaddingRightDesktop: string;
|
|
47
47
|
pagePaddingBottomDesktop: string;
|
|
48
48
|
pagePaddingLeftDesktop: string;
|
|
49
|
+
signedInPagePaddingTopPhone: string;
|
|
50
|
+
signedInPagePaddingRightPhone: string;
|
|
51
|
+
signedInPagePaddingBottomPhone: string;
|
|
52
|
+
signedInPagePaddingLeftPhone: string;
|
|
53
|
+
signedInPagePaddingTopTablet: string;
|
|
54
|
+
signedInPagePaddingRightTablet: string;
|
|
55
|
+
signedInPagePaddingBottomTablet: string;
|
|
56
|
+
signedInPagePaddingLeftTablet: string;
|
|
57
|
+
signedInPagePaddingTopDesktop: string;
|
|
58
|
+
signedInPagePaddingRightDesktop: string;
|
|
59
|
+
signedInPagePaddingBottomDesktop: string;
|
|
60
|
+
signedInPagePaddingLeftDesktop: string;
|
|
49
61
|
marginXXS: number;
|
|
50
62
|
marginXS: number;
|
|
51
63
|
marginSM: number;
|
package/theme/phi-theme.js
CHANGED
|
@@ -31,6 +31,19 @@ function buildPhiThemeTokens(options = {}) {
|
|
|
31
31
|
pagePaddingRightDesktop: PHI_SPACE[PHI_LAYOUT.pagePadding.desktop],
|
|
32
32
|
pagePaddingBottomDesktop: PHI_SPACE[PHI_LAYOUT.pagePadding.desktop],
|
|
33
33
|
pagePaddingLeftDesktop: PHI_SPACE[PHI_LAYOUT.pagePadding.desktop],
|
|
34
|
+
// The signed-in Areas' inset, the same way (`PHI_LAYOUT.signedInPagePadding`).
|
|
35
|
+
signedInPagePaddingTopPhone: PHI_SPACE[PHI_LAYOUT.signedInPagePadding.phone],
|
|
36
|
+
signedInPagePaddingRightPhone: PHI_SPACE[PHI_LAYOUT.signedInPagePadding.phone],
|
|
37
|
+
signedInPagePaddingBottomPhone: PHI_SPACE[PHI_LAYOUT.signedInPagePadding.phone],
|
|
38
|
+
signedInPagePaddingLeftPhone: PHI_SPACE[PHI_LAYOUT.signedInPagePadding.phone],
|
|
39
|
+
signedInPagePaddingTopTablet: PHI_SPACE[PHI_LAYOUT.signedInPagePadding.tablet],
|
|
40
|
+
signedInPagePaddingRightTablet: PHI_SPACE[PHI_LAYOUT.signedInPagePadding.tablet],
|
|
41
|
+
signedInPagePaddingBottomTablet: PHI_SPACE[PHI_LAYOUT.signedInPagePadding.tablet],
|
|
42
|
+
signedInPagePaddingLeftTablet: PHI_SPACE[PHI_LAYOUT.signedInPagePadding.tablet],
|
|
43
|
+
signedInPagePaddingTopDesktop: PHI_SPACE[PHI_LAYOUT.signedInPagePadding.desktop],
|
|
44
|
+
signedInPagePaddingRightDesktop: PHI_SPACE[PHI_LAYOUT.signedInPagePadding.desktop],
|
|
45
|
+
signedInPagePaddingBottomDesktop: PHI_SPACE[PHI_LAYOUT.signedInPagePadding.desktop],
|
|
46
|
+
signedInPagePaddingLeftDesktop: PHI_SPACE[PHI_LAYOUT.signedInPagePadding.desktop],
|
|
34
47
|
// Ant Design's second family, on the same scale: its own components read it (phi-tokens.ts).
|
|
35
48
|
marginXXS: PHI_PADDING_VALUES.xxs,
|
|
36
49
|
marginXS: PHI_PADDING_VALUES.xs,
|
package/theme/phi-tokens.d.ts
CHANGED
|
@@ -91,8 +91,13 @@ export declare const PHI_LAYOUT: {
|
|
|
91
91
|
readonly pageMax: 1220;
|
|
92
92
|
readonly pagePadding: {
|
|
93
93
|
readonly phone: "base";
|
|
94
|
-
readonly tablet: "
|
|
95
|
-
readonly desktop: "
|
|
94
|
+
readonly tablet: "base";
|
|
95
|
+
readonly desktop: "base";
|
|
96
|
+
};
|
|
97
|
+
readonly signedInPagePadding: {
|
|
98
|
+
readonly phone: "sm";
|
|
99
|
+
readonly tablet: "base";
|
|
100
|
+
readonly desktop: "base";
|
|
96
101
|
};
|
|
97
102
|
readonly readingMax: 754;
|
|
98
103
|
readonly heroHeight: 377;
|
package/theme/phi-tokens.js
CHANGED
|
@@ -144,11 +144,17 @@ export const PHI_LAYOUT = {
|
|
|
144
144
|
* How far a Page's content stands in from the room it is given, by the screen it is drawn on: the
|
|
145
145
|
* Shell's device bands on `phi-render-viewport` (styles/shell.css), a phone below 768, a tablet below
|
|
146
146
|
* 1200, a desktop from there -- not the block profiles' 377 and 610, which measure room and would put
|
|
147
|
-
* two phones of one class on opposite sides. Steps of the spacing scale, the same on all four sides
|
|
148
|
-
*
|
|
149
|
-
* `PHI_PAGE.padding`, and a Layout that states its own padding keeps it.
|
|
147
|
+
* two phones of one class on opposite sides. Steps of the spacing scale, the same on all four sides:
|
|
148
|
+
* `base` on every screen. A Site that wants more room states it in its Theme, as `pageMax` is the
|
|
149
|
+
* Theme's: a Page reads it as `PHI_PAGE.padding`, and a Layout that states its own padding keeps it.
|
|
150
150
|
*/
|
|
151
|
-
pagePadding: { phone: "base", tablet: "
|
|
151
|
+
pagePadding: { phone: "base", tablet: "base", desktop: "base" },
|
|
152
|
+
/*
|
|
153
|
+
* The same inset in the signed-in Areas -- App and the staff Areas -- where a Page is a tool among the
|
|
154
|
+
* Shell's navigation rather than a page to read: Public's step from a tablet on, a phone one below it.
|
|
155
|
+
* The Theme's as well, read as `PHI_PAGE.signedInPadding`.
|
|
156
|
+
*/
|
|
157
|
+
signedInPagePadding: { phone: "sm", tablet: "base", desktop: "base" },
|
|
152
158
|
/*
|
|
153
159
|
* How wide a column of prose is allowed to get: an article, an entry and what stands around it.
|
|
154
160
|
*
|