@phis/ui 0.5.1 → 0.5.3

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.
Files changed (195) hide show
  1. package/README.md +1 -1
  2. package/components/controls/phi-border-control.js +1 -1
  3. package/components/controls/phi-bound-radius-control.js +9 -9
  4. package/components/controls/phi-brand-control.js +1 -1
  5. package/components/controls/phi-drawer-control-adapter.js +4 -4
  6. package/components/controls/phi-dropdown-control.js +2 -2
  7. package/components/controls/phi-form-control.js +1 -1
  8. package/components/controls/phi-image-control.js +1 -1
  9. package/components/controls/phi-mask-picker-control.js +6 -6
  10. package/components/controls/phi-select-control.js +1 -1
  11. package/components/controls/phi-theme-scope-control.js +1 -1
  12. package/components/controls/use-phi-color-control-presets.js +2 -2
  13. package/components/forms/compound-form-controls.js +2 -2
  14. package/components/forms/extended-form-field-controls.js +1 -1
  15. package/components/forms/shared-form-provider-registry.js +2 -2
  16. package/components/layouts/clients/phi-flex-layout-client.js +4 -4
  17. package/components/layouts/clients/phi-grid-layout-client.js +3 -3
  18. package/components/layouts/clients/phi-sequence-slot-editor.js +1 -1
  19. package/components/layouts/layout-definitions.d.ts +4 -4
  20. package/components/layouts/phi-page-region-layout.js +1 -1
  21. package/components/layouts/phi-structure-region-layout.js +3 -3
  22. package/components/media/phi-asset-focal-rect-widget.js +4 -4
  23. package/components/media/phi-asset-inspector-section.js +1 -1
  24. package/components/media/phi-media-kind-icon.js +2 -2
  25. package/components/media/phi-media-restricted-icon.js +1 -1
  26. package/components/overlays/phi-overlay-container-client.js +1 -1
  27. package/components/regions/presets/phi-base-page-column.d.ts +5 -2
  28. package/components/regions/presets/phi-base-page-column.js +6 -2
  29. package/components/root/phi-config-provider.js +1 -1
  30. package/components/root/phi-root-background.js +1 -1
  31. package/components/root/phi-root-theme-resolver.js +1 -1
  32. package/components/shell/phi-module-icons.js +1 -1
  33. package/components/widgets/built-in/builder-workspace-preview.js +8 -8
  34. package/components/widgets/client/bullet-list-entries-editor.js +2 -2
  35. package/components/widgets/client/external-document-editor.js +1 -1
  36. package/components/widgets/client/html-editor.js +3 -3
  37. package/components/widgets/config/background.d.ts +1 -1
  38. package/components/widgets/config/background.js +1 -1
  39. package/components/widgets/inspector-field-row.js +1 -1
  40. package/components/widgets/label-sets/inspector.js +2 -0
  41. package/components/widgets/label-types/inspector.d.ts +1 -0
  42. package/components/widgets/label-types/inspector.js +1 -0
  43. package/components/widgets/shared/card-body-client.js +1 -1
  44. package/components/widgets/shared/result-body-client.js +1 -1
  45. package/constants/media-library-provider-keys.d.ts +8 -1
  46. package/constants/media-library-provider-keys.js +8 -1
  47. package/constants/record-field-kinds.d.ts +6 -0
  48. package/constants/record-field-kinds.js +7 -0
  49. package/constants/runtime-module-ownership.js +1 -1
  50. package/helpers/border-widget-style.d.ts +2 -2
  51. package/helpers/border-widget-style.js +2 -2
  52. package/helpers/cms-dialog.d.ts +4 -4
  53. package/helpers/cms-layout-defaults.d.ts +2 -2
  54. package/helpers/cms-page-catalog.d.ts +5 -0
  55. package/helpers/cms-preset-page-tree.d.ts +4 -0
  56. package/helpers/cms-preset-page-tree.js +2 -0
  57. package/helpers/cms-region-keys.d.ts +1 -1
  58. package/helpers/layout-style.d.ts +2 -2
  59. package/helpers/page-layout-check.d.ts +4 -1
  60. package/helpers/page-layout-check.js +26 -0
  61. package/helpers/record-fields.d.ts +9 -0
  62. package/helpers/record-fields.js +84 -0
  63. package/helpers/surface-presets.d.ts +6 -6
  64. package/helpers/surface-style.d.ts +1 -1
  65. package/helpers.d.ts +0 -1
  66. package/helpers.js +0 -2
  67. package/module-page-check.d.ts +12 -0
  68. package/module-page-check.js +12 -0
  69. package/module-records.d.ts +4 -2
  70. package/module-records.js +3 -1
  71. package/next/antd-form-context-loader.mjs +31 -0
  72. package/next/config.d.mts +2 -0
  73. package/next/config.mjs +36 -3
  74. package/package.json +10 -1
  75. package/plugins/runtime-modules/asset/data-providers.d.ts +0 -65
  76. package/plugins/runtime-modules/asset/data-providers.js +0 -40
  77. package/plugins/runtime-modules/asset/definition.d.ts +0 -60
  78. package/plugins/runtime-modules/asset/ids.d.ts +0 -1
  79. package/plugins/runtime-modules/asset/ids.js +1 -2
  80. package/plugins/runtime-modules/asset/presets.d.ts +1 -0
  81. package/plugins/runtime-modules/asset/server.js +0 -5
  82. package/plugins/runtime-modules/blog/presets.d.ts +1 -0
  83. package/plugins/runtime-modules/builder/clients/inspector-config-field.d.ts +4 -1
  84. package/plugins/runtime-modules/builder/clients/inspector-config-field.js +13 -4
  85. package/plugins/runtime-modules/builder/clients/inspector-link-target-field.js +1 -1
  86. package/plugins/runtime-modules/builder/clients/inspector-section-widget.js +14 -1
  87. package/plugins/runtime-modules/builder/clients/inspector-signal-section.js +2 -2
  88. package/plugins/runtime-modules/builder/clients/layout-inspector.js +1 -1
  89. package/plugins/runtime-modules/builder/clients/layout-scaffold-buttons.js +4 -4
  90. package/plugins/runtime-modules/builder/clients/layout-scaffold-overlays.js +1 -1
  91. package/plugins/runtime-modules/builder/clients/region-inspector.js +1 -1
  92. package/plugins/runtime-modules/builder/clients/region-visibility-fields.js +1 -1
  93. package/plugins/runtime-modules/builder/clients/shells-workspace.js +1 -1
  94. package/plugins/runtime-modules/builder/clients/structure-canvas.js +2 -2
  95. package/plugins/runtime-modules/builder/clients/widget-effects-editor.js +1 -1
  96. package/plugins/runtime-modules/builder/clients/widget-inspector.d.ts +4 -1
  97. package/plugins/runtime-modules/builder/clients/widget-inspector.js +3 -2
  98. package/plugins/runtime-modules/builder/page-presets.server.d.ts +6 -0
  99. package/plugins/runtime-modules/builder/page-presets.server.js +8 -0
  100. package/plugins/runtime-modules/builder/pages-workspace.js +12 -1
  101. package/plugins/runtime-modules/builder/render-root-node-scaffold.js +5 -5
  102. package/plugins/runtime-modules/builder/structure-dnd.js +2 -2
  103. package/plugins/runtime-modules/builder/widgets/test-block/client.js +1 -1
  104. package/plugins/runtime-modules/content-entry-routes.d.ts +1 -0
  105. package/plugins/runtime-modules/contracts.d.ts +1 -1
  106. package/plugins/runtime-modules/contracts.js +41 -1
  107. package/plugins/runtime-modules/core/data-providers.d.ts +60 -0
  108. package/plugins/runtime-modules/core/data-providers.js +41 -0
  109. package/plugins/runtime-modules/core/definition.d.ts +55 -0
  110. package/plugins/runtime-modules/core/server.js +5 -0
  111. package/plugins/runtime-modules/core/widgets/button/config.d.ts +34 -0
  112. package/plugins/runtime-modules/core/widgets/button/config.js +16 -0
  113. package/plugins/runtime-modules/core/widgets/button/plugin.js +37 -6
  114. package/plugins/runtime-modules/core/widgets/card/config.d.ts +13 -2
  115. package/plugins/runtime-modules/core/widgets/description/config.d.ts +13 -2
  116. package/plugins/runtime-modules/core/widgets/description/editor.js +13 -13
  117. package/plugins/runtime-modules/core/widgets/entry-list/config.d.ts +11 -0
  118. package/plugins/runtime-modules/core/widgets/gallery/client.d.ts +4 -1
  119. package/plugins/runtime-modules/core/widgets/gallery/client.js +29 -21
  120. package/plugins/runtime-modules/core/widgets/gallery/config.d.ts +16 -0
  121. package/plugins/runtime-modules/core/widgets/gallery/config.js +16 -0
  122. package/plugins/runtime-modules/core/widgets/gallery/server.d.ts +1 -1
  123. package/plugins/runtime-modules/core/widgets/gallery/server.js +11 -0
  124. package/plugins/runtime-modules/core/widgets/header-navigation/authoring.js +2 -3
  125. package/plugins/runtime-modules/core/widgets/header-navigation/client.d.ts +1 -3
  126. package/plugins/runtime-modules/core/widgets/header-navigation/client.js +9 -5
  127. package/plugins/runtime-modules/core/widgets/header-navigation/config.d.ts +1 -4
  128. package/plugins/runtime-modules/core/widgets/header-navigation/plugin.js +2 -3
  129. package/plugins/runtime-modules/core/widgets/header-navigation/server.d.ts +2 -2
  130. package/plugins/runtime-modules/core/widgets/header-navigation/server.js +1 -2
  131. package/plugins/runtime-modules/core/widgets/image/config.d.ts +35 -0
  132. package/plugins/runtime-modules/core/widgets/image/config.js +8 -0
  133. package/plugins/runtime-modules/core/widgets/image/plugin.js +19 -1
  134. package/plugins/runtime-modules/core/widgets/image/server.d.ts +3 -1
  135. package/plugins/runtime-modules/core/widgets/image/server.js +2 -2
  136. package/plugins/runtime-modules/core/widgets/markdown/config.d.ts +13 -0
  137. package/plugins/runtime-modules/core/widgets/markdown/config.js +8 -0
  138. package/plugins/runtime-modules/core/widgets/markdown/editor.js +7 -7
  139. package/plugins/runtime-modules/core/widgets/markdown/plugin.js +20 -7
  140. package/plugins/runtime-modules/core/widgets/record/authoring.js +1 -1
  141. package/plugins/runtime-modules/core/widgets/result/config.d.ts +11 -0
  142. package/plugins/runtime-modules/core/widgets/simple-text/config.d.ts +13 -0
  143. package/plugins/runtime-modules/core/widgets/simple-text/config.js +9 -0
  144. package/plugins/runtime-modules/core/widgets/simple-text/editor.js +1 -1
  145. package/plugins/runtime-modules/core/widgets/simple-text/plugin.js +14 -1
  146. package/plugins/runtime-modules/core/widgets/spacer/client.js +1 -1
  147. package/plugins/runtime-modules/core/widgets/table/config.d.ts +37 -0
  148. package/plugins/runtime-modules/descriptor-compiler.js +8 -0
  149. package/plugins/runtime-modules/editor/presets.d.ts +1 -0
  150. package/plugins/runtime-modules/groups/definition.d.ts +1 -1
  151. package/plugins/runtime-modules/localization/presets.d.ts +1 -0
  152. package/plugins/runtime-modules/news/presets.d.ts +1 -0
  153. package/plugins/runtime-modules/resolver.js +2 -0
  154. package/plugins/runtime-modules/revisions/presets.d.ts +1 -0
  155. package/plugins/runtime-modules/theme/presets.d.ts +1 -0
  156. package/plugins/runtime-modules/theme/widgets/brand-controls/client.js +37 -1
  157. package/server-helpers/cms-page-record.d.ts +26 -0
  158. package/server-helpers/cms-page-record.js +42 -0
  159. package/server-helpers/cms-request.js +48 -4
  160. package/server-helpers/record-fields.d.ts +62 -0
  161. package/server-helpers/record-fields.js +87 -0
  162. package/server-helpers/record-samples.d.ts +21 -0
  163. package/server-helpers/record-samples.js +41 -0
  164. package/styles/builder-scaffold.css +19 -19
  165. package/styles/controls.css +121 -108
  166. package/styles/gradients.css +23 -23
  167. package/styles/layout-affordances.css +15 -15
  168. package/styles/layout-authoring-scaffold.css +20 -20
  169. package/styles/layout.css +9 -9
  170. package/styles/root.css +4 -4
  171. package/styles/shell.css +48 -17
  172. package/theme/antd-css-var-contract.d.ts +93 -78
  173. package/theme/antd-css-var-contract.js +99 -79
  174. package/theme/phi-container-breakpoints.d.ts +4 -1
  175. package/theme/phi-container-breakpoints.js +4 -1
  176. package/theme/phi-control-shape.d.ts +1 -1
  177. package/theme/phi-theme-gradients.d.ts +2 -2
  178. package/theme/phi-theme-gradients.js +14 -14
  179. package/theme/phi-theme-palette.d.ts +1 -1
  180. package/theme/phi-theme-palette.js +2 -2
  181. package/theme/phi-theme-tokens.d.ts +10 -4
  182. package/theme/phi-theme-tokens.js +78 -23
  183. package/theme/phi-theme.d.ts +14 -0
  184. package/theme/phi-theme.js +14 -0
  185. package/theme/phi-tokens.d.ts +6 -1
  186. package/theme/phi-tokens.js +22 -2
  187. package/theme.d.ts +1 -1
  188. package/theme.js +1 -1
  189. package/types/cms-module-descriptors.d.ts +6 -0
  190. package/types/cms-plugins.d.ts +19 -1
  191. package/types/core-widget-placements.d.ts +10 -0
  192. package/types/record-provider.d.ts +92 -0
  193. package/types/widget-runtime.d.ts +5 -0
  194. /package/plugins/runtime-modules/{asset/services/folder-images.server.d.ts → core/services/media-folder-images.server.d.ts} +0 -0
  195. /package/plugins/runtime-modules/{asset/services/folder-images.server.js → core/services/media-folder-images.server.js} +0 -0
@@ -9,103 +9,123 @@ export const PHI_COLOR = {
9
9
  * The primary colour's ladder, as the Theme derives it per mode -- the same ten the colour picker offers
10
10
  * as the Theme's primary swatches, so a colour picked there is stored as its role and follows the Theme.
11
11
  */
12
- primaryBg: "var(--ant-color-primary-bg)",
13
- primaryBgHover: "var(--ant-color-primary-bg-hover)",
14
- primaryBorder: "var(--ant-color-primary-border)",
15
- primaryBorderHover: "var(--ant-color-primary-border-hover)",
16
- primaryHover: "var(--ant-color-primary-hover)",
17
- primary: "var(--ant-color-primary)",
18
- primaryActive: "var(--ant-color-primary-active)",
19
- primaryTextHover: "var(--ant-color-primary-text-hover)",
20
- primaryText: "var(--ant-color-primary-text)",
21
- primaryTextActive: "var(--ant-color-primary-text-active)",
22
- link: "var(--ant-color-link)",
23
- linkHover: "var(--ant-color-link-hover)",
12
+ primaryBg: "var(--phi-color-primary-bg)",
13
+ primaryBgHover: "var(--phi-color-primary-bg-hover)",
14
+ primaryBorder: "var(--phi-color-primary-border)",
15
+ primaryBorderHover: "var(--phi-color-primary-border-hover)",
16
+ primaryHover: "var(--phi-color-primary-hover)",
17
+ primary: "var(--phi-color-primary)",
18
+ primaryActive: "var(--phi-color-primary-active)",
19
+ primaryTextHover: "var(--phi-color-primary-text-hover)",
20
+ primaryText: "var(--phi-color-primary-text)",
21
+ primaryTextActive: "var(--phi-color-primary-text-active)",
22
+ link: "var(--phi-color-link)",
23
+ linkHover: "var(--phi-color-link-hover)",
24
24
  /* The text ladder, likewise the picker's text swatches. */
25
- textBase: "var(--ant-color-text-base)",
26
- text: "var(--ant-color-text)",
27
- textSecondary: "var(--ant-color-text-secondary)",
28
- textTertiary: "var(--ant-color-text-tertiary)",
29
- textQuaternary: "var(--ant-color-text-quaternary)",
30
- textHeading: "var(--ant-color-text-heading)",
31
- textLabel: "var(--ant-color-text-label)",
32
- textDescription: "var(--ant-color-text-description)",
33
- textPlaceholder: "var(--ant-color-text-placeholder)",
34
- textDisabled: "var(--ant-color-text-disabled)",
35
- textLightSolid: "var(--ant-color-text-light-solid)",
36
- bgContainer: "var(--ant-color-bg-container)",
37
- bgLayout: "var(--ant-color-bg-layout)",
38
- bgElevated: "var(--ant-color-bg-elevated)",
39
- bgSpotlight: "var(--ant-color-bg-spotlight)",
40
- fill: "var(--ant-color-fill)",
41
- fillSecondary: "var(--ant-color-fill-secondary)",
42
- fillTertiary: "var(--ant-color-fill-tertiary)",
43
- fillQuaternary: "var(--ant-color-fill-quaternary)",
44
- border: "var(--ant-color-border)",
45
- borderSecondary: "var(--ant-color-border-secondary)",
46
- linkActive: "var(--ant-color-link-active)",
47
- split: "var(--ant-color-split)",
48
- error: "var(--ant-color-error)",
49
- success: "var(--ant-color-success)",
50
- warning: "var(--ant-color-warning)",
25
+ textBase: "var(--phi-color-text-base)",
26
+ text: "var(--phi-color-text)",
27
+ textSecondary: "var(--phi-color-text-secondary)",
28
+ textTertiary: "var(--phi-color-text-tertiary)",
29
+ textQuaternary: "var(--phi-color-text-quaternary)",
30
+ textHeading: "var(--phi-color-text-heading)",
31
+ textLabel: "var(--phi-color-text-label)",
32
+ textDescription: "var(--phi-color-text-description)",
33
+ textPlaceholder: "var(--phi-color-text-placeholder)",
34
+ textDisabled: "var(--phi-color-text-disabled)",
35
+ textLightSolid: "var(--phi-color-text-light-solid)",
36
+ bgContainer: "var(--phi-color-bg-container)",
37
+ bgLayout: "var(--phi-color-bg-layout)",
38
+ bgElevated: "var(--phi-color-bg-elevated)",
39
+ bgSpotlight: "var(--phi-color-bg-spotlight)",
40
+ fill: "var(--phi-color-fill)",
41
+ fillSecondary: "var(--phi-color-fill-secondary)",
42
+ fillTertiary: "var(--phi-color-fill-tertiary)",
43
+ fillQuaternary: "var(--phi-color-fill-quaternary)",
44
+ border: "var(--phi-color-border)",
45
+ borderSecondary: "var(--phi-color-border-secondary)",
46
+ linkActive: "var(--phi-color-link-active)",
47
+ split: "var(--phi-color-split)",
48
+ error: "var(--phi-color-error)",
49
+ success: "var(--phi-color-success)",
50
+ warning: "var(--phi-color-warning)",
51
51
  /*
52
52
  * The palette's ten custom colours, per mode, written by the Theme as tokens of its own
53
- * (`phiCustom1` ... `phiCustom10`, theme/phi-theme-palette.ts).
53
+ * (`custom1` ... `custom10`, theme/phi-theme-palette.ts).
54
54
  */
55
- custom1: "var(--ant-phi-custom-1)",
56
- custom2: "var(--ant-phi-custom-2)",
57
- custom3: "var(--ant-phi-custom-3)",
58
- custom4: "var(--ant-phi-custom-4)",
59
- custom5: "var(--ant-phi-custom-5)",
60
- custom6: "var(--ant-phi-custom-6)",
61
- custom7: "var(--ant-phi-custom-7)",
62
- custom8: "var(--ant-phi-custom-8)",
63
- custom9: "var(--ant-phi-custom-9)",
64
- custom10: "var(--ant-phi-custom-10)",
55
+ custom1: "var(--phi-custom-1)",
56
+ custom2: "var(--phi-custom-2)",
57
+ custom3: "var(--phi-custom-3)",
58
+ custom4: "var(--phi-custom-4)",
59
+ custom5: "var(--phi-custom-5)",
60
+ custom6: "var(--phi-custom-6)",
61
+ custom7: "var(--phi-custom-7)",
62
+ custom8: "var(--phi-custom-8)",
63
+ custom9: "var(--phi-custom-9)",
64
+ custom10: "var(--phi-custom-10)",
65
65
  };
66
66
  /**
67
67
  * Every distance a Phi surface states, inside a frame (`padding`) and between two things (`gap`), on the
68
- * one scale (`theme/phi-tokens.ts`, `PHI_PADDING`). Ant Design's `--ant-margin-*` family carries the
68
+ * one scale (`theme/phi-tokens.ts`, `PHI_PADDING`). Ant Design's `--phi-margin-*` family carries the
69
69
  * same values and stays Ant Design's own.
70
70
  */
71
71
  export const PHI_SPACE = {
72
- xxs: "var(--ant-padding-xxs)",
73
- xs: "var(--ant-padding-xs)",
74
- sm: "var(--ant-padding-sm)",
75
- base: "var(--ant-padding)",
76
- md: "var(--ant-padding-md)",
77
- lg: "var(--ant-padding-lg)",
78
- xl: "var(--ant-padding-xl)",
79
- xxl: "var(--ant-padding-xxl)",
72
+ xxs: "var(--phi-padding-xxs)",
73
+ xs: "var(--phi-padding-xs)",
74
+ sm: "var(--phi-padding-sm)",
75
+ base: "var(--phi-padding)",
76
+ md: "var(--phi-padding-md)",
77
+ lg: "var(--phi-padding-lg)",
78
+ xl: "var(--phi-padding-xl)",
79
+ xxl: "var(--phi-padding-xxl)",
80
+ };
81
+ /**
82
+ * How wide a Page may get: the Theme's `pageMax` (theme/phi-tokens.ts, `PHI_LAYOUT.pageMax`).
83
+ *
84
+ * A Page states this reference and not the number, so the Theme's answer reaches every Page, an edited
85
+ * copy included -- a number written into a preset tree stays what it was the day the copy was made.
86
+ */
87
+ export const PHI_PAGE = {
88
+ max: "var(--phi-page-max)",
89
+ /*
90
+ * How far a Page's content stands in, per side: the Theme's `pagePadding<Side><Band>` for the band the
91
+ * screen is in, chosen by styles/shell.css ("Page inset"). Outside a Shell, where no band is chosen,
92
+ * the desktop answer.
93
+ */
94
+ padding: {
95
+ top: "var(--phi-page-inset-top, var(--phi-page-padding-top-desktop))",
96
+ right: "var(--phi-page-inset-right, var(--phi-page-padding-right-desktop))",
97
+ bottom: "var(--phi-page-inset-bottom, var(--phi-page-padding-bottom-desktop))",
98
+ left: "var(--phi-page-inset-left, var(--phi-page-padding-left-desktop))",
99
+ },
80
100
  };
81
101
  export const PHI_RADIUS = {
82
- xxs: "var(--ant-border-radius-xs)",
83
- xs: "var(--ant-border-radius-sm)",
84
- sm: "var(--ant-border-radius)",
85
- base: "var(--ant-border-radius-lg)",
86
- md: "var(--ant-border-radius-lg)",
87
- lg: "var(--ant-border-radius-lg)",
88
- xl: "var(--ant-border-radius-outer)",
89
- xxl: "var(--ant-border-radius-outer)",
102
+ xxs: "var(--phi-border-radius-xs)",
103
+ xs: "var(--phi-border-radius-sm)",
104
+ sm: "var(--phi-border-radius)",
105
+ base: "var(--phi-border-radius-lg)",
106
+ md: "var(--phi-border-radius-lg)",
107
+ lg: "var(--phi-border-radius-lg)",
108
+ xl: "var(--phi-border-radius-outer)",
109
+ xxl: "var(--phi-border-radius-outer)",
90
110
  };
91
111
  export const PHI_CONTROL = {
92
- sm: "var(--ant-control-height-sm)",
93
- md: "var(--ant-control-height)",
94
- lg: "var(--ant-control-height-lg)",
112
+ sm: "var(--phi-control-height-sm)",
113
+ md: "var(--phi-control-height)",
114
+ lg: "var(--phi-control-height-lg)",
95
115
  };
96
116
  export const PHI_SHADOW = {
97
- primary: "var(--ant-box-shadow)",
98
- secondary: "var(--ant-box-shadow-secondary)",
99
- tertiary: "var(--ant-box-shadow-tertiary)",
117
+ primary: "var(--phi-box-shadow)",
118
+ secondary: "var(--phi-box-shadow-secondary)",
119
+ tertiary: "var(--phi-box-shadow-tertiary)",
100
120
  };
101
121
  export const PHI_FONT_SIZE = {
102
- base: "var(--ant-font-size)",
103
- sm: "var(--ant-font-size-sm)",
104
- lg: "var(--ant-font-size-lg)",
105
- xl: "var(--ant-font-size-xl)",
106
- heading2: "var(--ant-font-size-heading-2)",
107
- heading4: "var(--ant-font-size-heading-4)",
108
- heading3: "var(--ant-font-size-heading-3)",
122
+ base: "var(--phi-font-size)",
123
+ sm: "var(--phi-font-size-sm)",
124
+ lg: "var(--phi-font-size-lg)",
125
+ xl: "var(--phi-font-size-xl)",
126
+ heading2: "var(--phi-font-size-heading-2)",
127
+ heading4: "var(--phi-font-size-heading-4)",
128
+ heading3: "var(--phi-font-size-heading-3)",
109
129
  };
110
130
  export const PHI_LINE_HEIGHT = {
111
131
  base: 1.5,
@@ -31,5 +31,8 @@ export declare const PHI_CONTAINER_BREAKPOINT_COL3: PhiContainerBreakpoint;
31
31
  * a full-width Region rather than in a content column.
32
32
  */
33
33
  export declare const PHI_CONTAINER_BREAKPOINT_CONTENT: PhiContainerBreakpoint;
34
- /** The wide content maximum (`PHI_LAYOUT.contentMaxWide`): a Region running the width of the page. */
34
+ /**
35
+ * From here a Region counts as wide: one running the width of a Page. Not a Page's width -- that is the
36
+ * Theme's (`PHI_PAGE.max`), and a Theme may not state one below this.
37
+ */
35
38
  export declare const PHI_CONTAINER_BREAKPOINT_REGION: PhiContainerBreakpoint;
@@ -30,5 +30,8 @@ export const PHI_CONTAINER_BREAKPOINT_COL3 = 377;
30
30
  * a full-width Region rather than in a content column.
31
31
  */
32
32
  export const PHI_CONTAINER_BREAKPOINT_CONTENT = 610;
33
- /** The wide content maximum (`PHI_LAYOUT.contentMaxWide`): a Region running the width of the page. */
33
+ /**
34
+ * From here a Region counts as wide: one running the width of a Page. Not a Page's width -- that is the
35
+ * Theme's (`PHI_PAGE.max`), and a Theme may not state one below this.
36
+ */
34
37
  export const PHI_CONTAINER_BREAKPOINT_REGION = 987;
@@ -75,7 +75,7 @@ export declare function resolvePhiControlShapeRadius(shape: PhiControlShape, tok
75
75
  /**
76
76
  * Custom properties `styles/control-shape.css` reads. They carry the resolved numbers rather than a
77
77
  * reference to an adapter token so a nested preview -- which runs its own draft scale through a plain
78
- * `ConfigProvider` and therefore never redefines the ambient `--ant-border-radius-*` -- still resolves
78
+ * `ConfigProvider` and therefore never redefines the ambient `--phi-border-radius-*` -- still resolves
79
79
  * its OWN shape. Inheritance is also what makes nesting work at all: two rules that both match a
80
80
  * Control tie on specificity and source order decides, while an inherited custom property is always
81
81
  * taken from the nearest ancestor that declares it.
@@ -7,8 +7,8 @@
7
7
  * palette states each slot per mode (`modes[mode].gradients`), and a slot it leaves out is derived from
8
8
  * the mode's own colours, which is what lets every Theme offer all three without anybody drawing them.
9
9
  *
10
- * They reach the page as Ant Design tokens -- `phiGradient1` and its `phiGradient1Text` -- and Ant Design
11
- * writes every token as a custom property under the Theme's class (`--ant-phi-gradient-1`). That is the
10
+ * They reach the page as Ant Design tokens -- `gradient1` and its `gradient1Text` -- and Ant Design
11
+ * writes every token as a custom property under the Theme's class (`--phi-gradient-1`). That is the
12
12
  * whole transport: the root writes both modes, a Surface tone writes its own mode on its box, and the
13
13
  * Theme workspace's preview writes the draft's, so a control that reads the property is in the right mode
14
14
  * wherever it stands without asking which one that is.
@@ -7,8 +7,8 @@
7
7
  * palette states each slot per mode (`modes[mode].gradients`), and a slot it leaves out is derived from
8
8
  * the mode's own colours, which is what lets every Theme offer all three without anybody drawing them.
9
9
  *
10
- * They reach the page as Ant Design tokens -- `phiGradient1` and its `phiGradient1Text` -- and Ant Design
11
- * writes every token as a custom property under the Theme's class (`--ant-phi-gradient-1`). That is the
10
+ * They reach the page as Ant Design tokens -- `gradient1` and its `gradient1Text` -- and Ant Design
11
+ * writes every token as a custom property under the Theme's class (`--phi-gradient-1`). That is the
12
12
  * whole transport: the root writes both modes, a Surface tone writes its own mode on its box, and the
13
13
  * Theme workspace's preview writes the draft's, so a control that reads the property is in the right mode
14
14
  * wherever it stands without asking which one that is.
@@ -55,18 +55,18 @@ function serializePhiThemeGradientCss(gradient) {
55
55
  return `linear-gradient(${gradient.direction}, ${gradient.stops.map((stop) => `${stop.color} ${stop.percent}%`).join(", ")})`;
56
56
  }
57
57
  /*
58
- * The custom properties, named the way Ant Design names a token's (`token2CSSVar`): `phiGradient1Text`
59
- * becomes `--ant-phi-gradient-1-text`. Stated once so CSS and controls never spell them differently.
58
+ * The custom properties, named the way Ant Design names a token's (`token2CSSVar`): `gradient1Text`
59
+ * becomes `--phi-gradient-1-text`. Stated once so CSS and controls never spell them differently.
60
60
  */
61
61
  const PHI_THEME_GRADIENT_TOKEN_NAMES = {
62
- gradient1: { paint: "phiGradient1", text: "phiGradient1Text" },
63
- gradient2: { paint: "phiGradient2", text: "phiGradient2Text" },
64
- gradient3: { paint: "phiGradient3", text: "phiGradient3Text" },
62
+ gradient1: { paint: "gradient1", text: "gradient1Text" },
63
+ gradient2: { paint: "gradient2", text: "gradient2Text" },
64
+ gradient3: { paint: "gradient3", text: "gradient3Text" },
65
65
  };
66
66
  export const PHI_THEME_GRADIENT_CSS_VARS = {
67
- gradient1: { paint: "--ant-phi-gradient-1", text: "--ant-phi-gradient-1-text" },
68
- gradient2: { paint: "--ant-phi-gradient-2", text: "--ant-phi-gradient-2-text" },
69
- gradient3: { paint: "--ant-phi-gradient-3", text: "--ant-phi-gradient-3-text" },
67
+ gradient1: { paint: "--phi-gradient-1", text: "--phi-gradient-1-text" },
68
+ gradient2: { paint: "--phi-gradient-2", text: "--phi-gradient-2-text" },
69
+ gradient3: { paint: "--phi-gradient-3", text: "--phi-gradient-3-text" },
70
70
  };
71
71
  /*
72
72
  * The primary Buttons' run when the Theme gives them one, with the filter each pressed state lays over
@@ -76,10 +76,10 @@ export const PHI_THEME_GRADIENT_CSS_VARS = {
76
76
  * flickered as the pointer left -- where a filter eases.
77
77
  */
78
78
  const PHI_PRIMARY_BUTTON_GRADIENT_TOKENS = {
79
- paint: "phiPrimaryButtonGradient",
80
- hover: "phiPrimaryButtonGradientHover",
81
- active: "phiPrimaryButtonGradientActive",
82
- text: "phiPrimaryButtonGradientText",
79
+ paint: "primaryButtonGradient",
80
+ hover: "primaryButtonGradientHover",
81
+ active: "primaryButtonGradientActive",
82
+ text: "primaryButtonGradientText",
83
83
  };
84
84
  /** A run a little lighter under the pointer, a little darker while it is pressed. */
85
85
  export const PHI_GRADIENT_HOVER_FILTER = "brightness(1.18) saturate(1.15)";
@@ -15,7 +15,7 @@ export declare function resolvePhiThemePaletteCustomColors(palette: PhiThemePale
15
15
  export declare function resolvePhiPublishedThemeCustomColors(siteTheme: PhiThemeCustomColorSource, mode: PhiThemeMode, presets: readonly PhiThemePresetPlugin[]): PhiThemeCustomColorPalette;
16
16
  /**
17
17
  * The custom colours of one mode as tokens of the Theme's own, laid over the resolved ones like the
18
- * gradient slots, so Ant Design writes them per mode and per Surface tone (`--ant-phi-custom-1` ...) and a
18
+ * gradient slots, so Ant Design writes them per mode and per Surface tone (`--phi-custom-1` ...) and a
19
19
  * config can name one by its role (`PHI_COLOR.custom1`) instead of copying its value.
20
20
  */
21
21
  export declare function buildPhiThemeCustomColorTokens(palette: PhiThemePalette | null | undefined, mode: PhiThemeMode): Record<string, string>;
@@ -32,11 +32,11 @@ export function resolvePhiPublishedThemeCustomColors(siteTheme, mode, presets) {
32
32
  }
33
33
  /** The token a custom colour rides as, and so the custom property Ant Design writes for it. */
34
34
  function resolvePhiThemeCustomColorTokenName(key) {
35
- return `phiCustom${key.slice("custom".length)}`;
35
+ return `custom${key.slice("custom".length)}`;
36
36
  }
37
37
  /**
38
38
  * The custom colours of one mode as tokens of the Theme's own, laid over the resolved ones like the
39
- * gradient slots, so Ant Design writes them per mode and per Surface tone (`--ant-phi-custom-1` ...) and a
39
+ * gradient slots, so Ant Design writes them per mode and per Surface tone (`--phi-custom-1` ...) and a
40
40
  * config can name one by its role (`PHI_COLOR.custom1`) instead of copying its value.
41
41
  */
42
42
  export function buildPhiThemeCustomColorTokens(palette, mode) {
@@ -27,7 +27,7 @@ export declare const PHI_THEME_TOKEN_KEYS: readonly ["colorBgContainer", "colorB
27
27
  * The names this house adds to Ant Design's set.
28
28
  *
29
29
  * `buildPhiThemeTokens` hands Ant Design the whole structural scale, `paddingXXL` included, and the
30
- * cssVar pass emits a variable for every token it is given -- so `--ant-padding-xxl` is on the page
30
+ * cssVar pass emits a variable for every token it is given -- so `--phi-padding-xxl` is on the page
31
31
  * even though `AliasToken` has no such field. The name is therefore real, usable from CSS, and
32
32
  * invisible to the type, which is exactly why it has to be stated somewhere.
33
33
  *
@@ -35,12 +35,18 @@ export declare const PHI_THEME_TOKEN_KEYS: readonly ["colorBgContainer", "colorB
35
35
  * Design's type and a name Ant Design does not know cannot be cut from it. A Client Component that
36
36
  * needs one of these reads it as a CSS variable, the way a Server Component does.
37
37
  *
38
- * The `phiGradient*` names are the Theme's gradient slots and the primary Buttons' run
38
+ * `pageMax` is how wide a Page may get (theme/phi-tokens.ts, `PHI_LAYOUT.pageMax`); a Page reads it
39
+ * as `PHI_PAGE.max`.
40
+ *
41
+ * The `gradient*` names are the Theme's gradient slots and the primary Buttons' run
39
42
  * (theme/phi-theme-gradients.ts): tokens of this package's own, laid over the resolved ones so Ant
40
- * Design writes them per mode and per Surface tone like every other. The `phiCustom*` names are the
43
+ * Design writes them per mode and per Surface tone like every other. The `custom*` names are the
41
44
  * palette's custom colours, laid over the same way (theme/phi-theme-palette.ts).
42
45
  */
43
- export declare const PHI_THEME_OWN_TOKEN_KEYS: readonly ["paddingXXL", "phiGradient1", "phiGradient1Text", "phiGradient2", "phiGradient2Text", "phiGradient3", "phiGradient3Text", "phiPrimaryButtonGradient", "phiPrimaryButtonGradientHover", "phiPrimaryButtonGradientActive", "phiPrimaryButtonGradientText", "phiCustom1", "phiCustom2", "phiCustom3", "phiCustom4", "phiCustom5", "phiCustom6", "phiCustom7", "phiCustom8", "phiCustom9", "phiCustom10"];
46
+ 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", "custom1", "custom2", "custom3", "custom4", "custom5", "custom6", "custom7", "custom8", "custom9", "custom10"];
47
+ /** The Page inset's names, per band and side (`PHI_LAYOUT.pagePadding`, `PHI_PAGE.padding`). */
48
+ export declare const PHI_THEME_PAGE_PADDING_BANDS: readonly ["Phone", "Tablet", "Desktop"];
49
+ export declare const PHI_THEME_PAGE_PADDING_SIDES: readonly ["Top", "Right", "Bottom", "Left"];
44
50
  export type PhiThemeTokenKey = (typeof PHI_THEME_TOKEN_KEYS)[number];
45
51
  /**
46
52
  * The resolved Theme, in the names above and their Ant Design value types.
@@ -1,3 +1,5 @@
1
+ import { PHI_SPACE } from "./antd-css-var-contract";
2
+ import { PHI_CONTAINER_BREAKPOINT_REGION } from "./phi-container-breakpoints";
1
3
  /**
2
4
  * The token vocabulary of this house, stated once.
3
5
  *
@@ -157,7 +159,7 @@ export const PHI_THEME_TOKEN_KEYS = [
157
159
  * The names this house adds to Ant Design's set.
158
160
  *
159
161
  * `buildPhiThemeTokens` hands Ant Design the whole structural scale, `paddingXXL` included, and the
160
- * cssVar pass emits a variable for every token it is given -- so `--ant-padding-xxl` is on the page
162
+ * cssVar pass emits a variable for every token it is given -- so `--phi-padding-xxl` is on the page
161
163
  * even though `AliasToken` has no such field. The name is therefore real, usable from CSS, and
162
164
  * invisible to the type, which is exactly why it has to be stated somewhere.
163
165
  *
@@ -165,34 +167,54 @@ export const PHI_THEME_TOKEN_KEYS = [
165
167
  * Design's type and a name Ant Design does not know cannot be cut from it. A Client Component that
166
168
  * needs one of these reads it as a CSS variable, the way a Server Component does.
167
169
  *
168
- * The `phiGradient*` names are the Theme's gradient slots and the primary Buttons' run
170
+ * `pageMax` is how wide a Page may get (theme/phi-tokens.ts, `PHI_LAYOUT.pageMax`); a Page reads it
171
+ * as `PHI_PAGE.max`.
172
+ *
173
+ * The `gradient*` names are the Theme's gradient slots and the primary Buttons' run
169
174
  * (theme/phi-theme-gradients.ts): tokens of this package's own, laid over the resolved ones so Ant
170
- * Design writes them per mode and per Surface tone like every other. The `phiCustom*` names are the
175
+ * Design writes them per mode and per Surface tone like every other. The `custom*` names are the
171
176
  * palette's custom colours, laid over the same way (theme/phi-theme-palette.ts).
172
177
  */
173
178
  export const PHI_THEME_OWN_TOKEN_KEYS = [
174
179
  "paddingXXL",
175
- "phiGradient1",
176
- "phiGradient1Text",
177
- "phiGradient2",
178
- "phiGradient2Text",
179
- "phiGradient3",
180
- "phiGradient3Text",
181
- "phiPrimaryButtonGradient",
182
- "phiPrimaryButtonGradientHover",
183
- "phiPrimaryButtonGradientActive",
184
- "phiPrimaryButtonGradientText",
185
- "phiCustom1",
186
- "phiCustom2",
187
- "phiCustom3",
188
- "phiCustom4",
189
- "phiCustom5",
190
- "phiCustom6",
191
- "phiCustom7",
192
- "phiCustom8",
193
- "phiCustom9",
194
- "phiCustom10",
180
+ "pageMax",
181
+ "pagePaddingTopPhone",
182
+ "pagePaddingRightPhone",
183
+ "pagePaddingBottomPhone",
184
+ "pagePaddingLeftPhone",
185
+ "pagePaddingTopTablet",
186
+ "pagePaddingRightTablet",
187
+ "pagePaddingBottomTablet",
188
+ "pagePaddingLeftTablet",
189
+ "pagePaddingTopDesktop",
190
+ "pagePaddingRightDesktop",
191
+ "pagePaddingBottomDesktop",
192
+ "pagePaddingLeftDesktop",
193
+ "gradient1",
194
+ "gradient1Text",
195
+ "gradient2",
196
+ "gradient2Text",
197
+ "gradient3",
198
+ "gradient3Text",
199
+ "primaryButtonGradient",
200
+ "primaryButtonGradientHover",
201
+ "primaryButtonGradientActive",
202
+ "primaryButtonGradientText",
203
+ "custom1",
204
+ "custom2",
205
+ "custom3",
206
+ "custom4",
207
+ "custom5",
208
+ "custom6",
209
+ "custom7",
210
+ "custom8",
211
+ "custom9",
212
+ "custom10",
195
213
  ];
214
+ /** The Page inset's names, per band and side (`PHI_LAYOUT.pagePadding`, `PHI_PAGE.padding`). */
215
+ export const PHI_THEME_PAGE_PADDING_BANDS = ["Phone", "Tablet", "Desktop"];
216
+ export const PHI_THEME_PAGE_PADDING_SIDES = ["Top", "Right", "Bottom", "Left"];
217
+ const PHI_THEME_PAGE_PADDING_TOKEN_KEYS = PHI_THEME_PAGE_PADDING_BANDS.flatMap((band) => PHI_THEME_PAGE_PADDING_SIDES.map((side) => `pagePadding${side}${band}`));
196
218
  /**
197
219
  * The colours a palette seeds, shared by both modes.
198
220
  *
@@ -252,7 +274,40 @@ export function assertPhiThemeVocabulary({ palette, styleToken, modeSeedKeys, so
252
274
  for (const [mode, modeConfig] of Object.entries(palette?.modes ?? {})) {
253
275
  violations.push(...readPhiThemeVocabularyViolations(modeConfig?.seed, modeSeedNames, source, `the ${mode} seed`), ...readPhiThemeVocabularyViolations(modeConfig?.overrides, PHI_THEME_TOKEN_NAMES, source, `the ${mode} override`));
254
276
  }
277
+ violations.push(...readPhiThemePageMaxViolations(styleToken, source));
278
+ violations.push(...readPhiThemePagePaddingViolations(styleToken, source));
255
279
  if (violations.length > 0) {
256
280
  throw new Error(violations.join(" "));
257
281
  }
258
282
  }
283
+ /**
284
+ * A Page's maximum is a number of pixels and at least the width from which a Region counts as wide.
285
+ *
286
+ * Narrower, no Page could ever be wide: a Grid of four columns or anything else that answers to the
287
+ * Region threshold would never draw its wide form, and nothing would say why.
288
+ */
289
+ /**
290
+ * A Page's inset is a step of the spacing scale on each side and band, or none: the Page column reads it
291
+ * as a length, and a word it cannot resolve would leave the side at no padding with nothing to say why.
292
+ */
293
+ function readPhiThemePagePaddingViolations(styleToken, source) {
294
+ const steps = new Set([...Object.values(PHI_SPACE), 0, "0"]);
295
+ return PHI_THEME_PAGE_PADDING_TOKEN_KEYS.flatMap((key) => {
296
+ const value = styleToken?.[key];
297
+ if (value == null || steps.has(value))
298
+ return [];
299
+ return [`${source}: the style token states ${key} as ${JSON.stringify(value)}, which is not a step of the spacing scale.`];
300
+ });
301
+ }
302
+ function readPhiThemePageMaxViolations(styleToken, source) {
303
+ const value = styleToken?.pageMax;
304
+ if (value == null)
305
+ return [];
306
+ if (typeof value !== "number" || !Number.isFinite(value)) {
307
+ return [`${source}: the style token states pageMax as ${JSON.stringify(value)}, which is not a number of pixels.`];
308
+ }
309
+ if (value < PHI_CONTAINER_BREAKPOINT_REGION) {
310
+ return [`${source}: the style token states pageMax ${value}, narrower than ${PHI_CONTAINER_BREAKPOINT_REGION}, from which a Region counts as wide.`];
311
+ }
312
+ return [];
313
+ }
@@ -32,6 +32,20 @@ export type PhiThemeTokens = {
32
32
  paddingLG: number;
33
33
  paddingXL: number;
34
34
  paddingXXL: number;
35
+ /** How wide a Page may get (`PHI_LAYOUT.pageMax`), published as `--phi-page-max`. */
36
+ pageMax: number;
37
+ pagePaddingTopPhone: string;
38
+ pagePaddingRightPhone: string;
39
+ pagePaddingBottomPhone: string;
40
+ pagePaddingLeftPhone: string;
41
+ pagePaddingTopTablet: string;
42
+ pagePaddingRightTablet: string;
43
+ pagePaddingBottomTablet: string;
44
+ pagePaddingLeftTablet: string;
45
+ pagePaddingTopDesktop: string;
46
+ pagePaddingRightDesktop: string;
47
+ pagePaddingBottomDesktop: string;
48
+ pagePaddingLeftDesktop: string;
35
49
  marginXXS: number;
36
50
  marginXS: number;
37
51
  marginSM: number;
@@ -17,6 +17,20 @@ function buildPhiThemeTokens(options = {}) {
17
17
  paddingLG: PHI_PADDING_VALUES.lg,
18
18
  paddingXL: PHI_PADDING_VALUES.xl,
19
19
  paddingXXL: PHI_PADDING_VALUES.xxl,
20
+ pageMax: PHI_LAYOUT.pageMax,
21
+ // A Page's inset per side and screen width, as steps of the spacing scale (`PHI_LAYOUT.pagePadding`).
22
+ pagePaddingTopPhone: PHI_SPACE[PHI_LAYOUT.pagePadding.phone],
23
+ pagePaddingRightPhone: PHI_SPACE[PHI_LAYOUT.pagePadding.phone],
24
+ pagePaddingBottomPhone: PHI_SPACE[PHI_LAYOUT.pagePadding.phone],
25
+ pagePaddingLeftPhone: PHI_SPACE[PHI_LAYOUT.pagePadding.phone],
26
+ pagePaddingTopTablet: PHI_SPACE[PHI_LAYOUT.pagePadding.tablet],
27
+ pagePaddingRightTablet: PHI_SPACE[PHI_LAYOUT.pagePadding.tablet],
28
+ pagePaddingBottomTablet: PHI_SPACE[PHI_LAYOUT.pagePadding.tablet],
29
+ pagePaddingLeftTablet: PHI_SPACE[PHI_LAYOUT.pagePadding.tablet],
30
+ pagePaddingTopDesktop: PHI_SPACE[PHI_LAYOUT.pagePadding.desktop],
31
+ pagePaddingRightDesktop: PHI_SPACE[PHI_LAYOUT.pagePadding.desktop],
32
+ pagePaddingBottomDesktop: PHI_SPACE[PHI_LAYOUT.pagePadding.desktop],
33
+ pagePaddingLeftDesktop: PHI_SPACE[PHI_LAYOUT.pagePadding.desktop],
20
34
  // Ant Design's second family, on the same scale: its own components read it (phi-tokens.ts).
21
35
  marginXXS: PHI_PADDING_VALUES.xxs,
22
36
  marginXS: PHI_PADDING_VALUES.xs,
@@ -88,7 +88,12 @@ export declare const PHI_LAYOUT: {
88
88
  readonly numberControlMax: 144;
89
89
  readonly contentMaxNarrow: 377;
90
90
  readonly contentMax: 610;
91
- readonly contentMaxWide: 987;
91
+ readonly pageMax: 1220;
92
+ readonly pagePadding: {
93
+ readonly phone: "base";
94
+ readonly tablet: "md";
95
+ readonly desktop: "md";
96
+ };
92
97
  readonly readingMax: 754;
93
98
  readonly heroHeight: 377;
94
99
  };
@@ -118,13 +118,33 @@ export const PHI_LAYOUT = {
118
118
  * `narrow` is a single column of Controls without a label beside them -- a sign-in, a confirmation.
119
119
  * `contentMax` is the one a labelled form wants: the 24-track grid puts labels left of their
120
120
  * Controls, and at 377 a label column of 8 tracks leaves the Control too little to show what is in
121
- * it. `wide` is for what is read across rather than filled in, such as a table.
121
+ * it.
122
122
  *
123
123
  * They are maxima and not widths. A block still fills its slot; these only say where it stops.
124
124
  */
125
125
  contentMaxNarrow: 377,
126
126
  contentMax: 610,
127
- contentMaxWide: 987,
127
+ /*
128
+ * How wide a Page is allowed to get: the column a catalogue, a landing or a Module's wide Page stands in.
129
+ *
130
+ * The Theme's to decide and not a constant: this is only the answer where a Theme says nothing, and a
131
+ * Page reads it as `PHI_PAGE.max`, the Theme's own variable, never as this number -- a Theme that
132
+ * widens its Pages then widens every one of them, an edited copy included.
133
+ *
134
+ * 987 + 233, off the sequence the way `readingMax` is. 987 itself is not a Page's width but the
135
+ * threshold from which a Region counts as wide (`PHI_CONTAINER_BREAKPOINT_REGION`), and a Page has to
136
+ * be able to get past it, which is why a Theme may not state less (`assertPhiThemeVocabulary`).
137
+ */
138
+ pageMax: 1220,
139
+ /*
140
+ * How far a Page's content stands in from the room it is given, by the screen it is drawn on: the
141
+ * Shell's device bands on `phi-render-viewport` (styles/shell.css), a phone below 768, a tablet below
142
+ * 1200, a desktop from there -- not the block profiles' 377 and 610, which measure room and would put
143
+ * two phones of one class on opposite sides. Steps of the spacing scale, the same on all four sides; a
144
+ * phone one step below the rest. The Theme's to decide, as `pageMax` is: a Page reads it as
145
+ * `PHI_PAGE.padding`, and a Layout that states its own padding keeps it.
146
+ */
147
+ pagePadding: { phone: "base", tablet: "md", desktop: "md" },
128
148
  /*
129
149
  * How wide a column of prose is allowed to get: an article, an entry and what stands around it.
130
150
  *
package/theme.d.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  export { isPhiThemePaletteModeSeedKey, mergePhiThemePalettes, PHI_THEME_CUSTOM_COLOR_KEYS, PHI_THEME_PALETTE_MODE_SEED_KEYS, type PhiThemeCustomColorKey, type PhiThemeCustomColorPalette, type PhiThemeMode, type PhiThemePalette, type PhiThemePaletteMode, type PhiThemePresetPlugin, } from "./theme/phi-theme-presets";
2
2
  export * from "./theme/phi-tokens";
3
- export { PHI_COLOR, PHI_RADIUS, PHI_SPACE } from "./theme/antd-css-var-contract";
3
+ export { PHI_COLOR, PHI_PAGE, PHI_RADIUS, PHI_SPACE } from "./theme/antd-css-var-contract";
4
4
  export { type PhiThemeBlockIdentity, type PhiThemeFontsBlock, type PhiThemeGroundBlock, type PhiThemePaletteBlock, type PhiThemeSetBlock, type PhiThemeStyleBlock, } from "./theme/phi-theme-blocks";
package/theme.js CHANGED
@@ -5,5 +5,5 @@ export * from "./theme/phi-tokens";
5
5
  * Each is a reference the Theme resolves per Site and per mode, never a value of its own, so a preset
6
6
  * that names one follows whatever Theme it lands in (THEME.md, "Phi scale").
7
7
  */
8
- export { PHI_COLOR, PHI_RADIUS, PHI_SPACE } from "./theme/antd-css-var-contract";
8
+ export { PHI_COLOR, PHI_PAGE, PHI_RADIUS, PHI_SPACE } from "./theme/antd-css-var-contract";
9
9
  export {} from "./theme/phi-theme-blocks";
@@ -75,6 +75,12 @@ export type PhiCmsRoutePresetDescriptor = PhiCmsPresetIdentity & {
75
75
  activeModuleIds: ReadonlySet<PhiRuntimeModuleId>;
76
76
  params: Readonly<Record<string, string>>;
77
77
  }) => PhiResolvedCmsPageTree | Promise<PhiResolvedCmsPageTree>;
78
+ /**
79
+ * The record this route's Page is about (MODULES.md, "The fields of a record, and the record a Page is
80
+ * about"). Only on a route with a parameter. Core reads it before anything is drawn -- no record is a
81
+ * 404 -- and the Page's Widgets bind to its fields, in the Module's tree and in a stored override alike.
82
+ */
83
+ pageRecord?: import("./record-provider").PhiCmsPageRecordDescriptor;
78
84
  navigation?: readonly PhiCmsNavigationInjectionDescriptor[];
79
85
  /**
80
86
  * The Page's guided Tour, in the owning Module's language (design/TOURS.md). Read with the route, not