@phis/ui 0.4.4 → 0.4.6

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 (238) hide show
  1. package/README.md +9 -3
  2. package/cms/plugins.d.ts +1 -0
  3. package/cms/plugins.js +2 -0
  4. package/components/cms/phi-cms-root-layout.js +31 -2
  5. package/components/controls/phi-background-control.d.ts +6 -1
  6. package/components/controls/phi-background-control.js +12 -4
  7. package/components/controls/phi-button-control.d.ts +15 -1
  8. package/components/controls/phi-button-control.js +21 -3
  9. package/components/controls/phi-collapse-control.d.ts +6 -2
  10. package/components/controls/phi-collapse-control.js +2 -2
  11. package/components/controls/phi-dialog-control.d.ts +11 -5
  12. package/components/controls/phi-dialog-control.js +19 -13
  13. package/components/controls/phi-dropdown-control.js +2 -2
  14. package/components/controls/phi-media-asset-tile-control.js +10 -10
  15. package/components/controls/phi-menu-control-vocabulary.d.ts +7 -0
  16. package/components/controls/phi-menu-control-vocabulary.js +10 -0
  17. package/components/controls/phi-menu-control.d.ts +4 -1
  18. package/components/controls/phi-menu-control.js +6 -1
  19. package/components/controls/phi-progress-control.d.ts +10 -2
  20. package/components/controls/phi-progress-control.js +6 -2
  21. package/components/controls/phi-ribbon-control.d.ts +4 -1
  22. package/components/controls/phi-ribbon-control.js +5 -3
  23. package/components/controls/phi-ribbon-wrap-control.d.ts +7 -1
  24. package/components/controls/phi-ribbon-wrap-control.js +8 -2
  25. package/components/controls/phi-segmented-control.d.ts +4 -1
  26. package/components/controls/phi-segmented-control.js +13 -2
  27. package/components/controls/phi-surface-control.d.ts +2 -0
  28. package/components/controls/phi-surface-control.js +16 -1
  29. package/components/controls/phi-switch-control.d.ts +4 -1
  30. package/components/controls/phi-switch-control.js +8 -2
  31. package/components/controls/phi-tag-control.d.ts +4 -1
  32. package/components/controls/phi-tag-control.js +11 -3
  33. package/components/layouts/clients/phi-split-card-layout-client.js +13 -5
  34. package/components/layouts/clients/phi-three-column-layout-client.js +9 -3
  35. package/components/layouts/phi-layout-view-model.js +10 -1
  36. package/components/layouts/split-card-geometry.js +6 -2
  37. package/components/media/aspect-ratios.d.ts +2 -2
  38. package/components/menus/phi-account-menu.js +3 -1
  39. package/components/navigation/phi-link.js +7 -2
  40. package/components/navigation/use-phi-protected-mail.d.ts +11 -0
  41. package/components/navigation/use-phi-protected-mail.js +29 -0
  42. package/components/regions/clients/cms-region-container-client.js +16 -2
  43. package/components/regions/phi-cms-region-container.js +5 -1
  44. package/components/regions/phi-cms-region-shell.d.ts +11 -0
  45. package/components/regions/phi-cms-region-shell.js +64 -7
  46. package/components/regions/presets/phi-area-shell-preset-nodes.js +2 -1
  47. package/components/root/phi-config-provider.js +16 -0
  48. package/components/root/phi-root-layout.d.ts +1 -0
  49. package/components/root/phi-root-layout.js +1 -0
  50. package/components/root/phi-root-theme-resolver.js +12 -1
  51. package/components/root/phi-shell-chrome-overlay.d.ts +6 -0
  52. package/components/root/phi-shell-chrome-overlay.js +7 -1
  53. package/components/runtime/runtime-module-context.d.ts +12 -1
  54. package/components/runtime/runtime-module-context.js +6 -1
  55. package/components/shell/phi-cms-shell.d.ts +9 -1
  56. package/components/shell/phi-cms-shell.js +10 -4
  57. package/components/shell/phi-nav-link.js +7 -2
  58. package/components/shell/phi-shell-sider-drawer.d.ts +17 -0
  59. package/components/shell/phi-shell-sider-drawer.js +88 -0
  60. package/components/shell/use-phi-shell-header-bands.d.ts +5 -0
  61. package/components/shell/use-phi-shell-header-bands.js +64 -0
  62. package/components/shell/use-phi-shell-sticky-bottom.d.ts +18 -0
  63. package/components/shell/use-phi-shell-sticky-bottom.js +54 -0
  64. package/components/tables/client/phi-table-binding.d.ts +1 -0
  65. package/components/tables/client/phi-table-binding.js +22 -3
  66. package/components/trees/client/phi-tree-binding.d.ts +1 -0
  67. package/components/trees/client/phi-tree-binding.js +11 -2
  68. package/components/widgets/client/shared/phi-collection-provider.js +4 -3
  69. package/components/widgets/client/shared/phi-collection-view-binding.d.ts +1 -0
  70. package/components/widgets/client/shared/phi-collection-view-binding.js +16 -2
  71. package/components/widgets/client/shared/phi-command-buttons.js +6 -2
  72. package/components/widgets/config/background.d.ts +20 -0
  73. package/components/widgets/config/background.js +44 -2
  74. package/components/widgets/config/button-variant.d.ts +22 -4
  75. package/components/widgets/config/button-variant.js +24 -5
  76. package/components/widgets/config/common-action-field.d.ts +1 -1
  77. package/components/widgets/config/parser-primitives.js +4 -2
  78. package/components/widgets/config/theme-gradient.d.ts +11 -0
  79. package/components/widgets/config/theme-gradient.js +12 -0
  80. package/components/widgets/helpers/internal-reference-resolver.server.d.ts +1 -0
  81. package/components/widgets/helpers/internal-reference-resolver.server.js +4 -1
  82. package/components/widgets/label-sets/background.js +2 -0
  83. package/components/widgets/label-sets/geometry.js +2 -0
  84. package/components/widgets/label-sets/inspector.js +6 -0
  85. package/components/widgets/label-types/background.d.ts +1 -0
  86. package/components/widgets/label-types/background.js +1 -0
  87. package/components/widgets/label-types/common-controls.js +2 -2
  88. package/components/widgets/label-types/geometry.d.ts +1 -0
  89. package/components/widgets/label-types/geometry.js +1 -0
  90. package/components/widgets/label-types/inspector.d.ts +6 -0
  91. package/components/widgets/label-types/inspector.js +3 -0
  92. package/components/widgets/server/navigation-request.js +13 -1
  93. package/components/widgets/shared/card-body-client.d.ts +13 -0
  94. package/components/widgets/shared/card-body-client.js +40 -11
  95. package/components/widgets/shared/card-vocabulary.d.ts +36 -0
  96. package/components/widgets/shared/card-vocabulary.js +52 -0
  97. package/components/widgets/shared/collection-source-failure.d.ts +26 -0
  98. package/components/widgets/shared/collection-source-failure.js +42 -0
  99. package/components/widgets/shared/markdown-body-client.d.ts +29 -0
  100. package/components/widgets/shared/markdown-body-client.js +60 -5
  101. package/components/widgets/shared/markdown-image-vocabulary.d.ts +31 -0
  102. package/components/widgets/shared/markdown-image-vocabulary.js +68 -0
  103. package/components/widgets/shared/markdown-render.d.ts +5 -0
  104. package/components/widgets/shared/markdown-render.js +139 -11
  105. package/components/widgets/shared/markdown-sections.d.ts +40 -0
  106. package/components/widgets/shared/markdown-sections.js +111 -0
  107. package/components/widgets/shared/widget-failure-client.d.ts +10 -0
  108. package/components/widgets/shared/widget-failure-client.js +20 -0
  109. package/components/widgets/shared/widget-failure.d.ts +31 -0
  110. package/components/widgets/shared/widget-failure.js +20 -0
  111. package/components/widgets/shared/widget-failure.server.d.ts +9 -0
  112. package/components/widgets/shared/widget-failure.server.js +12 -0
  113. package/gateway/dashboard-card-memo.d.ts +3 -0
  114. package/gateway/dashboard-card-memo.js +25 -0
  115. package/helpers/cms-region-keys.d.ts +1 -1
  116. package/helpers/external-href.js +1 -1
  117. package/helpers/layout-style.d.ts +8 -4
  118. package/helpers/layout-style.js +3 -2
  119. package/helpers/mode-paint.d.ts +4 -0
  120. package/helpers/mode-paint.js +47 -0
  121. package/helpers/protected-mail.d.ts +16 -0
  122. package/helpers/protected-mail.js +81 -0
  123. package/helpers/surface-style.js +33 -11
  124. package/module-dashboard-cards.d.ts +1 -0
  125. package/module-dashboard-cards.js +1 -0
  126. package/module-records.d.ts +7 -0
  127. package/module-records.js +6 -0
  128. package/package.json +2 -2
  129. package/plugins/runtime-modules/builder/clients/inspector-config-field.js +1 -1
  130. package/plugins/runtime-modules/builder/clients/inspector-surface-labels.js +1 -0
  131. package/plugins/runtime-modules/builder/clients/region-inspector.js +67 -3
  132. package/plugins/runtime-modules/builder/clients/runtime-module-authoring-boundary.js +1 -1
  133. package/plugins/runtime-modules/builder/controller/draft-command-controller.js +7 -4
  134. package/plugins/runtime-modules/builder/controller/page-controller.js +7 -0
  135. package/plugins/runtime-modules/builder/persistence.d.ts +3 -0
  136. package/plugins/runtime-modules/builder/persistence.js +9 -1
  137. package/plugins/runtime-modules/core/content-entries/record-source.server.d.ts +3 -1
  138. package/plugins/runtime-modules/core/content-entries/record-source.server.js +7 -4
  139. package/plugins/runtime-modules/core/widgets/button/client.js +2 -2
  140. package/plugins/runtime-modules/core/widgets/button/config.d.ts +40 -4
  141. package/plugins/runtime-modules/core/widgets/button/config.js +12 -0
  142. package/plugins/runtime-modules/core/widgets/card/config.d.ts +102 -1
  143. package/plugins/runtime-modules/core/widgets/card/config.js +60 -1
  144. package/plugins/runtime-modules/core/widgets/card/editor.js +17 -2
  145. package/plugins/runtime-modules/core/widgets/card/server.js +13 -1
  146. package/plugins/runtime-modules/core/widgets/collection-view/asset-binding.d.ts +4 -1
  147. package/plugins/runtime-modules/core/widgets/collection-view/asset-binding.js +10 -3
  148. package/plugins/runtime-modules/core/widgets/collection-view/authoring.js +1 -1
  149. package/plugins/runtime-modules/core/widgets/collection-view/client.d.ts +3 -0
  150. package/plugins/runtime-modules/core/widgets/collection-view/client.js +47 -11
  151. package/plugins/runtime-modules/core/widgets/collection-view/image-preview-grid.d.ts +4 -1
  152. package/plugins/runtime-modules/core/widgets/collection-view/image-preview-grid.js +2 -2
  153. package/plugins/runtime-modules/core/widgets/collection-view/plugin.js +3 -2
  154. package/plugins/runtime-modules/core/widgets/collection-view/server.d.ts +6 -1
  155. package/plugins/runtime-modules/core/widgets/collection-view/server.js +21 -3
  156. package/plugins/runtime-modules/core/widgets/entry-detail/plugin.js +1 -1
  157. package/plugins/runtime-modules/core/widgets/entry-detail/server.d.ts +3 -1
  158. package/plugins/runtime-modules/core/widgets/entry-detail/server.js +5 -2
  159. package/plugins/runtime-modules/core/widgets/entry-header/plugin.js +1 -1
  160. package/plugins/runtime-modules/core/widgets/entry-header/server.d.ts +3 -1
  161. package/plugins/runtime-modules/core/widgets/entry-header/server.js +5 -2
  162. package/plugins/runtime-modules/core/widgets/entry-list/plugin.js +1 -1
  163. package/plugins/runtime-modules/core/widgets/entry-list/server.d.ts +6 -3
  164. package/plugins/runtime-modules/core/widgets/entry-list/server.js +13 -6
  165. package/plugins/runtime-modules/core/widgets/entry-list/view.server.js +2 -1
  166. package/plugins/runtime-modules/core/widgets/gallery/config.d.ts +3 -3
  167. package/plugins/runtime-modules/core/widgets/gallery/plugin.js +1 -1
  168. package/plugins/runtime-modules/core/widgets/gallery/server.d.ts +5 -3
  169. package/plugins/runtime-modules/core/widgets/gallery/server.js +8 -6
  170. package/plugins/runtime-modules/core/widgets/header-navigation/client.d.ts +6 -1
  171. package/plugins/runtime-modules/core/widgets/header-navigation/client.js +40 -13
  172. package/plugins/runtime-modules/core/widgets/header-navigation/config.d.ts +26 -1
  173. package/plugins/runtime-modules/core/widgets/header-navigation/config.js +27 -0
  174. package/plugins/runtime-modules/core/widgets/header-navigation/plugin.js +1 -1
  175. package/plugins/runtime-modules/core/widgets/header-navigation/server.d.ts +2 -2
  176. package/plugins/runtime-modules/core/widgets/header-navigation/server.js +3 -1
  177. package/plugins/runtime-modules/core/widgets/image/client.js +11 -7
  178. package/plugins/runtime-modules/core/widgets/markdown/config.d.ts +16 -0
  179. package/plugins/runtime-modules/core/widgets/markdown/config.js +46 -1
  180. package/plugins/runtime-modules/core/widgets/markdown/server.js +22 -8
  181. package/plugins/runtime-modules/core/widgets/record/client.d.ts +4 -1
  182. package/plugins/runtime-modules/core/widgets/record/client.js +8 -3
  183. package/plugins/runtime-modules/core/widgets/record/plugin.js +3 -2
  184. package/plugins/runtime-modules/core/widgets/record/server.d.ts +3 -1
  185. package/plugins/runtime-modules/core/widgets/record/server.js +2 -2
  186. package/plugins/runtime-modules/core/widgets/segmented/client.js +1 -1
  187. package/plugins/runtime-modules/core/widgets/segmented/config.d.ts +21 -1
  188. package/plugins/runtime-modules/core/widgets/segmented/config.js +11 -1
  189. package/plugins/runtime-modules/core/widgets/simple-text/server.js +11 -1
  190. package/plugins/runtime-modules/core/widgets/switch/client.js +1 -1
  191. package/plugins/runtime-modules/core/widgets/switch/config.d.ts +19 -0
  192. package/plugins/runtime-modules/core/widgets/switch/config.js +11 -0
  193. package/plugins/runtime-modules/core/widgets/table/authoring.js +1 -1
  194. package/plugins/runtime-modules/core/widgets/table/client.d.ts +4 -1
  195. package/plugins/runtime-modules/core/widgets/table/client.js +16 -3
  196. package/plugins/runtime-modules/core/widgets/table/plugin.js +3 -2
  197. package/plugins/runtime-modules/core/widgets/table/server.d.ts +3 -1
  198. package/plugins/runtime-modules/core/widgets/table/server.js +2 -2
  199. package/plugins/runtime-modules/core/widgets/table/static-resource-editor.js +2 -1
  200. package/plugins/runtime-modules/core/widgets/timeline/authoring.js +1 -1
  201. package/plugins/runtime-modules/core/widgets/timeline/client.d.ts +1 -3
  202. package/plugins/runtime-modules/core/widgets/timeline/client.js +14 -4
  203. package/plugins/runtime-modules/core/widgets/tree/authoring.js +1 -1
  204. package/plugins/runtime-modules/core/widgets/tree/client.d.ts +4 -1
  205. package/plugins/runtime-modules/core/widgets/tree/client.js +13 -2
  206. package/plugins/runtime-modules/core/widgets/tree/plugin.js +3 -2
  207. package/plugins/runtime-modules/core/widgets/tree/server.d.ts +3 -1
  208. package/plugins/runtime-modules/core/widgets/tree/server.js +2 -2
  209. package/plugins/runtime-modules/theme/presets.d.ts +9 -1
  210. package/plugins/runtime-modules/theme/tour.d.ts +9 -1
  211. package/plugins/runtime-modules/theme/tour.js +10 -1
  212. package/plugins/runtime-modules/theme/widgets/brand-controls/client.js +138 -7
  213. package/runtime-data-provider-client.d.ts +2 -0
  214. package/runtime-data-provider-client.js +7 -0
  215. package/styles/controls.css +118 -15
  216. package/styles/gradients.css +101 -0
  217. package/styles/layout.css +35 -0
  218. package/styles/root.css +18 -0
  219. package/styles/shell.css +206 -0
  220. package/theme/phi-button-shadow.d.ts +6 -0
  221. package/theme/phi-theme-gradients.d.ts +96 -0
  222. package/theme/phi-theme-gradients.js +245 -0
  223. package/theme/phi-theme-presets.d.ts +3 -0
  224. package/theme/phi-theme-presets.js +3 -0
  225. package/theme/phi-theme-tokens.d.ts +5 -1
  226. package/theme/phi-theme-tokens.js +14 -0
  227. package/theme/phi-tokens.d.ts +6 -0
  228. package/theme/phi-tokens.js +6 -0
  229. package/theme.d.ts +1 -0
  230. package/theme.js +6 -0
  231. package/types/cms-presets.d.ts +7 -0
  232. package/types/core-widget-placements.d.ts +8 -0
  233. package/types/layout-style.d.ts +9 -8
  234. package/types/layout-style.js +9 -8
  235. package/types/surface.d.ts +4 -0
  236. package/types/surface.js +4 -0
  237. package/types.d.ts +1 -1
  238. package/types.js +1 -1
package/theme.js CHANGED
@@ -1,3 +1,9 @@
1
1
  export { isPhiThemePaletteModeSeedKey, mergePhiThemePalettes, PHI_THEME_CUSTOM_COLOR_KEYS, PHI_THEME_PALETTE_MODE_SEED_KEYS, } from "./theme/phi-theme-presets";
2
2
  export * from "./theme/phi-tokens";
3
+ /*
4
+ * The Theme's values as a preset writes them: a step of the spacing scale, a colour role, a corner.
5
+ * Each is a reference the Theme resolves per Site and per mode, never a value of its own, so a preset
6
+ * that names one follows whatever Theme it lands in (THEME.md, "Phi scale").
7
+ */
8
+ export { PHI_COLOR, PHI_RADIUS, PHI_SPACE } from "./theme/antd-css-var-contract";
3
9
  export {} from "./theme/phi-theme-blocks";
@@ -37,11 +37,18 @@ export type PhiCmsRegionConfig = Record<string, unknown> & PhiCmsContainerChrome
37
37
  fontSize?: CSSProperties["fontSize"];
38
38
  lineHeight?: CSSProperties["lineHeight"];
39
39
  offsetTop?: PhiCssLength;
40
+ /** The air below a `Sticky` `footer_bottom` when it sticks to the viewport's bottom; nobody else reads it. */
41
+ offsetBottom?: PhiCssLength;
40
42
  zIndex?: number;
41
43
  /** Which of the Area's Pages show this Shell Region (`helpers/region-page-scope.ts`). */
42
44
  pageScope?: PhiCmsRegionPageScope;
43
45
  /** How `header_top` comes into view (`helpers/region-page-scope.ts`); every other Region ignores it. */
44
46
  reveal?: PhiCmsRegionReveal;
47
+ /**
48
+ * How far the Page's `content` reaches up into its Hero, the Hero's picture running on under it (SHELL.md
49
+ * "Content reaching into the Hero"). Read on `content` alone, and only where the Page has a Hero.
50
+ */
51
+ heroOverlap?: PhiCssLength;
45
52
  };
46
53
  /**
47
54
  * Which Pages a Shell Region stands on (SHELL.md "Region visibility per Page").
@@ -1,4 +1,6 @@
1
1
  import type { PhiBulletListEntry, PhiBulletListStyle } from "../components/widgets/shared/bullet-list-vocabulary";
2
+ import type { PhiMarkdownImageAspectRatio } from "../components/widgets/shared/markdown-image-vocabulary";
3
+ import type { PhiMarkdownFoldSections } from "../components/widgets/shared/markdown-sections";
2
4
  import type { PhiRenderableBlockBase } from "./renderable-block";
3
5
  import type { PhiTextSource } from "../helpers/text-source";
4
6
  import type { PhiRuntimeConditionExpression } from "./runtime-condition";
@@ -14,6 +16,7 @@ import type { PhiViewerAccessPolicy } from "./access";
14
16
  import type { PhiWidgetFontFamilyKey, PhiWidgetFontSizeKey } from "./site-theme";
15
17
  import type { PhiTableQuery, PhiTableWidgetConfig, PhiTableWidgetFeatures, PhiTableWidgetPresentation } from "./table-widget";
16
18
  import type { PhiButtonVariant } from "../components/widgets/config/button-variant";
19
+ import type { PhiThemeGradientKey } from "../theme/phi-theme-gradients";
17
20
  import type { PhiTextTone } from "../components/widgets/config/text-tone";
18
21
  import type { PhiCommonControlActionKey } from "../components/widgets/label-types/common-controls";
19
22
  import type { PhiMaskConfig } from "../components/widgets/config/mask";
@@ -52,6 +55,9 @@ export type PhiMarkdownWidgetPlacement = PhiWidgetPlacementBase & {
52
55
  revalidateSeconds?: number;
53
56
  textAlign?: PhiMarkdownTextAlign;
54
57
  imageFloat?: PhiMarkdownImageFloat;
58
+ imageAspectRatio?: PhiMarkdownImageAspectRatio;
59
+ foldSections?: PhiMarkdownFoldSections;
60
+ faqStructuredData?: boolean;
55
61
  textBlockSpacingBefore?: PhiSpacingScaleKey;
56
62
  textBlockSpacingAfter?: PhiSpacingScaleKey;
57
63
  headingBlockSpacingBefore?: PhiSpacingScaleKey;
@@ -97,6 +103,8 @@ export type PhiButtonWidgetPlacement = PhiWidgetPlacementBase & PhiControlPlacem
97
103
  icon?: string;
98
104
  value?: string;
99
105
  variant?: PhiButtonVariant;
106
+ /** The Theme gradient slot a `gradient` Button is filled with; absent, the first. */
107
+ gradient?: PhiThemeGradientKey;
100
108
  linkTarget?: PhiLinkTarget;
101
109
  danger?: boolean;
102
110
  };
@@ -1,13 +1,14 @@
1
1
  /**
2
2
  * The Background filters that are a pane rather than a treatment of the paint itself.
3
3
  *
4
- * `glass` and `haze` are the same thing at two strengths: a sheet that frosts what shows through it.
5
- * `glass` is the frosted pane, `haze` the barely clouded one -- both a smaller radius and more of the
6
- * ground let through, because moving only one of the two reads as a dirty window rather than as
7
- * lighter glass. Everything that used to test for `glass` asks this instead, so a further strength
8
- * would be a table entry and not another branch.
4
+ * `clear`, `glass` and `haze` are the same thing at three strengths: a sheet that frosts what shows
5
+ * through it, light, medium and strong. The frost and the share of the ground's colour rise together,
6
+ * because moving only one of the two reads as a dirty window rather than as another strength of glass.
7
+ * `clear` lifts and saturates what it shows so it still reads as glass with little tint. Everything
8
+ * that used to test for `glass` asks this instead, so a further strength is a table entry and not
9
+ * another branch.
9
10
  */
10
- export declare const PHI_GLASS_LAYOUT_EFFECT_IDS: readonly ["glass", "haze"];
11
+ export declare const PHI_GLASS_LAYOUT_EFFECT_IDS: readonly ["glass", "haze", "clear"];
11
12
  export type PhiGlassLayoutEffectId = (typeof PHI_GLASS_LAYOUT_EFFECT_IDS)[number];
12
13
  export declare function isPhiGlassLayoutEffectId(value: unknown): value is PhiGlassLayoutEffectId;
13
14
  export declare const PHI_SHADOW_IDS: readonly ["none", "soft", "strong"];
@@ -22,11 +23,11 @@ export declare function readPhiShadow(value: unknown): PhiShadow | undefined;
22
23
  /**
23
24
  * What a Background does to the light that reaches it, beside what it paints.
24
25
  *
25
- * `glass` and `haze` are panes: they frost what shows THROUGH the surface, so they act on the backdrop and
26
+ * `glass`, `haze` and `clear` are panes: they frost what shows THROUGH the surface, so they act on the backdrop and
26
27
  * on a ground thinned enough to let it through. `blur` softens the Background's own paint -- the picture,
27
28
  * the gradient, the pattern -- and nothing in front of it: the content a surface carries is never filtered.
28
29
  * Darkening is not a filter; a colour Overlay at an opacity does it, and lets the colour be chosen.
29
30
  */
30
- export declare const PHI_BACKGROUND_FILTERS: readonly ["glass", "haze", "blur"];
31
+ export declare const PHI_BACKGROUND_FILTERS: readonly ["glass", "haze", "clear", "blur"];
31
32
  export type PhiBackgroundFilter = (typeof PHI_BACKGROUND_FILTERS)[number];
32
33
  export declare function isPhiBackgroundFilter(value: unknown): value is PhiBackgroundFilter;
@@ -2,13 +2,14 @@ import { isPhiRecord } from "../helpers/is-record";
2
2
  /**
3
3
  * The Background filters that are a pane rather than a treatment of the paint itself.
4
4
  *
5
- * `glass` and `haze` are the same thing at two strengths: a sheet that frosts what shows through it.
6
- * `glass` is the frosted pane, `haze` the barely clouded one -- both a smaller radius and more of the
7
- * ground let through, because moving only one of the two reads as a dirty window rather than as
8
- * lighter glass. Everything that used to test for `glass` asks this instead, so a further strength
9
- * would be a table entry and not another branch.
5
+ * `clear`, `glass` and `haze` are the same thing at three strengths: a sheet that frosts what shows
6
+ * through it, light, medium and strong. The frost and the share of the ground's colour rise together,
7
+ * because moving only one of the two reads as a dirty window rather than as another strength of glass.
8
+ * `clear` lifts and saturates what it shows so it still reads as glass with little tint. Everything
9
+ * that used to test for `glass` asks this instead, so a further strength is a table entry and not
10
+ * another branch.
10
11
  */
11
- export const PHI_GLASS_LAYOUT_EFFECT_IDS = ["glass", "haze"];
12
+ export const PHI_GLASS_LAYOUT_EFFECT_IDS = ["glass", "haze", "clear"];
12
13
  export function isPhiGlassLayoutEffectId(value) {
13
14
  return typeof value === "string" && PHI_GLASS_LAYOUT_EFFECT_IDS.includes(value);
14
15
  }
@@ -32,12 +33,12 @@ export function readPhiShadow(value) {
32
33
  /**
33
34
  * What a Background does to the light that reaches it, beside what it paints.
34
35
  *
35
- * `glass` and `haze` are panes: they frost what shows THROUGH the surface, so they act on the backdrop and
36
+ * `glass`, `haze` and `clear` are panes: they frost what shows THROUGH the surface, so they act on the backdrop and
36
37
  * on a ground thinned enough to let it through. `blur` softens the Background's own paint -- the picture,
37
38
  * the gradient, the pattern -- and nothing in front of it: the content a surface carries is never filtered.
38
39
  * Darkening is not a filter; a colour Overlay at an opacity does it, and lets the colour be chosen.
39
40
  */
40
- export const PHI_BACKGROUND_FILTERS = ["glass", "haze", "blur"];
41
+ export const PHI_BACKGROUND_FILTERS = ["glass", "haze", "clear", "blur"];
41
42
  export function isPhiBackgroundFilter(value) {
42
43
  return typeof value === "string" && PHI_BACKGROUND_FILTERS.includes(value);
43
44
  }
@@ -20,6 +20,9 @@ export type PhiSurfaceTone = (typeof PHI_SURFACE_TONES)[number];
20
20
  * `effects`, which say how it arrives rather than what it is.
21
21
  *
22
22
  * - `background` carries its own Filter: a glass pane or a softened paint is something the ground does.
23
+ * - `backgroundDark` is the ground in dark mode, where the box wants another one than in light mode -- a
24
+ * Hero's dark picture for a dark page. Absent, `background` stands in both modes. The page's mode
25
+ * picks, in CSS (`helpers/mode-paint.ts`), so a mode switch needs no render.
23
26
  * - `borderSource` says where the line comes from. Only `custom` reads `border`, corners included; under
24
27
  * `theme` and `none` the corner is the Site's surface step, so a shape change is seen at once.
25
28
  * - `shadow` is depth.
@@ -29,6 +32,7 @@ export type PhiSurfaceTone = (typeof PHI_SURFACE_TONES)[number];
29
32
  */
30
33
  export type PhiSurface = {
31
34
  background?: PhiCmsBackgroundWidgetConfig | null;
35
+ backgroundDark?: PhiCmsBackgroundWidgetConfig | null;
32
36
  borderSource?: PhiCmsBorderSource;
33
37
  border?: PhiCmsBorderWidgetConfig | null;
34
38
  shadow?: PhiShadow | null;
package/types/surface.js CHANGED
@@ -38,6 +38,9 @@ export function readPhiSurface(value) {
38
38
  const background = isPhiRecord(raw.background)
39
39
  ? normalizePhiBackgroundWidgetConfig(raw.background)
40
40
  : null;
41
+ const backgroundDark = isPhiRecord(raw.backgroundDark)
42
+ ? normalizePhiBackgroundWidgetConfig(raw.backgroundDark)
43
+ : null;
41
44
  const borderSource = readPhiCmsBorderSource(raw.borderSource);
42
45
  const border = isPhiRecord(raw.border)
43
46
  ? readPhiCmsBorderWidgetConfig(raw.border) ?? null
@@ -46,6 +49,7 @@ export function readPhiSurface(value) {
46
49
  const tone = isPhiSurfaceTone(raw.tone) && raw.tone !== "inherit" ? raw.tone : undefined;
47
50
  const surface = {
48
51
  ...(background ? { background } : {}),
52
+ ...(backgroundDark ? { backgroundDark } : {}),
49
53
  ...(borderSource ? { borderSource } : {}),
50
54
  ...(border ? { border } : {}),
51
55
  ...(shadow ? { shadow } : {}),
package/types.d.ts CHANGED
@@ -22,7 +22,7 @@ export type { PhiAuthoringRenderPolicy, PhiCmsBuilderWidgetEditorInteraction, Ph
22
22
  export type * from "./types/cms-presets";
23
23
  export type * from "./types/slot-size-policy";
24
24
  export type * from "./types/runtime-data-provider";
25
- export { isPhiRuntimeDataProviderKey } from "./types/runtime-data-provider";
25
+ export { isPhiRuntimeDataProviderKey, readPhiRuntimeDataProviderBinding } from "./types/runtime-data-provider";
26
26
  export type * from "./types/table-widget";
27
27
  export type * from "./types/tree-widget";
28
28
  export type * from "./types/collection-provider";
package/types.js CHANGED
@@ -12,7 +12,7 @@ export * from "./types/spacing";
12
12
  export * from "./types/runtime-condition";
13
13
  export * from "./types/state-machine";
14
14
  export * from "./types/access";
15
- export { isPhiRuntimeDataProviderKey } from "./types/runtime-data-provider";
15
+ export { isPhiRuntimeDataProviderKey, readPhiRuntimeDataProviderBinding } from "./types/runtime-data-provider";
16
16
  export * from "./types/form-id";
17
17
  export { PhiTableProviderError, readPhiTableProviderError, readPhiTableQuery, } from "./types/table-widget";
18
18
  export { PhiTreeProviderError, readPhiTreeProviderError, readPhiTreeProviderQueryResult, readPhiTreeProviderMutationResult, validatePhiTreeWidgetBinding, } from "./types/tree-widget";