@phis/ui 0.5.2 → 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 (182) 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.js +6 -2
  28. package/components/root/phi-config-provider.js +1 -1
  29. package/components/root/phi-root-background.js +1 -1
  30. package/components/root/phi-root-theme-resolver.js +1 -1
  31. package/components/shell/phi-module-icons.js +1 -1
  32. package/components/widgets/built-in/builder-workspace-preview.js +8 -8
  33. package/components/widgets/client/bullet-list-entries-editor.js +2 -2
  34. package/components/widgets/client/external-document-editor.js +1 -1
  35. package/components/widgets/client/html-editor.js +3 -3
  36. package/components/widgets/config/background.d.ts +1 -1
  37. package/components/widgets/config/background.js +1 -1
  38. package/components/widgets/inspector-field-row.js +1 -1
  39. package/components/widgets/label-sets/inspector.js +2 -0
  40. package/components/widgets/label-types/inspector.d.ts +1 -0
  41. package/components/widgets/label-types/inspector.js +1 -0
  42. package/components/widgets/shared/card-body-client.js +1 -1
  43. package/components/widgets/shared/result-body-client.js +1 -1
  44. package/constants/media-library-provider-keys.d.ts +8 -1
  45. package/constants/media-library-provider-keys.js +8 -1
  46. package/constants/record-field-kinds.d.ts +6 -0
  47. package/constants/record-field-kinds.js +7 -0
  48. package/constants/runtime-module-ownership.js +1 -1
  49. package/helpers/border-widget-style.d.ts +2 -2
  50. package/helpers/border-widget-style.js +2 -2
  51. package/helpers/cms-dialog.d.ts +4 -4
  52. package/helpers/cms-layout-defaults.d.ts +2 -2
  53. package/helpers/cms-page-catalog.d.ts +5 -0
  54. package/helpers/cms-preset-page-tree.d.ts +4 -0
  55. package/helpers/cms-preset-page-tree.js +2 -0
  56. package/helpers/layout-style.d.ts +2 -2
  57. package/helpers/page-layout-check.d.ts +4 -1
  58. package/helpers/page-layout-check.js +26 -0
  59. package/helpers/record-fields.d.ts +9 -0
  60. package/helpers/record-fields.js +84 -0
  61. package/helpers/surface-presets.d.ts +6 -6
  62. package/helpers/surface-style.d.ts +1 -1
  63. package/helpers.d.ts +0 -1
  64. package/helpers.js +0 -2
  65. package/module-page-check.d.ts +12 -0
  66. package/module-page-check.js +12 -0
  67. package/module-records.d.ts +4 -2
  68. package/module-records.js +3 -1
  69. package/next/antd-form-context-loader.mjs +31 -0
  70. package/next/config.d.mts +2 -0
  71. package/next/config.mjs +36 -3
  72. package/package.json +10 -1
  73. package/plugins/runtime-modules/asset/data-providers.d.ts +0 -65
  74. package/plugins/runtime-modules/asset/data-providers.js +0 -40
  75. package/plugins/runtime-modules/asset/definition.d.ts +0 -60
  76. package/plugins/runtime-modules/asset/ids.d.ts +0 -1
  77. package/plugins/runtime-modules/asset/ids.js +1 -2
  78. package/plugins/runtime-modules/asset/presets.d.ts +1 -0
  79. package/plugins/runtime-modules/asset/server.js +0 -5
  80. package/plugins/runtime-modules/blog/presets.d.ts +1 -0
  81. package/plugins/runtime-modules/builder/clients/inspector-config-field.d.ts +4 -1
  82. package/plugins/runtime-modules/builder/clients/inspector-config-field.js +13 -4
  83. package/plugins/runtime-modules/builder/clients/inspector-link-target-field.js +1 -1
  84. package/plugins/runtime-modules/builder/clients/inspector-section-widget.js +14 -1
  85. package/plugins/runtime-modules/builder/clients/inspector-signal-section.js +2 -2
  86. package/plugins/runtime-modules/builder/clients/layout-inspector.js +1 -1
  87. package/plugins/runtime-modules/builder/clients/layout-scaffold-buttons.js +4 -4
  88. package/plugins/runtime-modules/builder/clients/layout-scaffold-overlays.js +1 -1
  89. package/plugins/runtime-modules/builder/clients/region-inspector.js +1 -1
  90. package/plugins/runtime-modules/builder/clients/region-visibility-fields.js +1 -1
  91. package/plugins/runtime-modules/builder/clients/shells-workspace.js +1 -1
  92. package/plugins/runtime-modules/builder/clients/structure-canvas.js +2 -2
  93. package/plugins/runtime-modules/builder/clients/widget-effects-editor.js +1 -1
  94. package/plugins/runtime-modules/builder/clients/widget-inspector.d.ts +4 -1
  95. package/plugins/runtime-modules/builder/clients/widget-inspector.js +3 -2
  96. package/plugins/runtime-modules/builder/page-presets.server.d.ts +6 -0
  97. package/plugins/runtime-modules/builder/page-presets.server.js +8 -0
  98. package/plugins/runtime-modules/builder/pages-workspace.js +12 -1
  99. package/plugins/runtime-modules/builder/render-root-node-scaffold.js +5 -5
  100. package/plugins/runtime-modules/builder/structure-dnd.js +2 -2
  101. package/plugins/runtime-modules/builder/widgets/test-block/client.js +1 -1
  102. package/plugins/runtime-modules/content-entry-routes.d.ts +1 -0
  103. package/plugins/runtime-modules/contracts.d.ts +1 -1
  104. package/plugins/runtime-modules/contracts.js +41 -1
  105. package/plugins/runtime-modules/core/data-providers.d.ts +60 -0
  106. package/plugins/runtime-modules/core/data-providers.js +41 -0
  107. package/plugins/runtime-modules/core/definition.d.ts +55 -0
  108. package/plugins/runtime-modules/core/server.js +5 -0
  109. package/plugins/runtime-modules/core/widgets/button/config.d.ts +34 -0
  110. package/plugins/runtime-modules/core/widgets/button/config.js +16 -0
  111. package/plugins/runtime-modules/core/widgets/button/plugin.js +37 -6
  112. package/plugins/runtime-modules/core/widgets/card/config.d.ts +13 -2
  113. package/plugins/runtime-modules/core/widgets/description/config.d.ts +13 -2
  114. package/plugins/runtime-modules/core/widgets/description/editor.js +13 -13
  115. package/plugins/runtime-modules/core/widgets/entry-list/config.d.ts +11 -0
  116. package/plugins/runtime-modules/core/widgets/gallery/client.d.ts +4 -1
  117. package/plugins/runtime-modules/core/widgets/gallery/client.js +29 -21
  118. package/plugins/runtime-modules/core/widgets/gallery/config.d.ts +16 -0
  119. package/plugins/runtime-modules/core/widgets/gallery/config.js +16 -0
  120. package/plugins/runtime-modules/core/widgets/gallery/server.d.ts +1 -1
  121. package/plugins/runtime-modules/core/widgets/gallery/server.js +11 -0
  122. package/plugins/runtime-modules/core/widgets/image/config.d.ts +35 -0
  123. package/plugins/runtime-modules/core/widgets/image/config.js +8 -0
  124. package/plugins/runtime-modules/core/widgets/image/plugin.js +19 -1
  125. package/plugins/runtime-modules/core/widgets/image/server.d.ts +3 -1
  126. package/plugins/runtime-modules/core/widgets/image/server.js +2 -2
  127. package/plugins/runtime-modules/core/widgets/markdown/config.d.ts +13 -0
  128. package/plugins/runtime-modules/core/widgets/markdown/config.js +8 -0
  129. package/plugins/runtime-modules/core/widgets/markdown/editor.js +7 -7
  130. package/plugins/runtime-modules/core/widgets/markdown/plugin.js +20 -7
  131. package/plugins/runtime-modules/core/widgets/record/authoring.js +1 -1
  132. package/plugins/runtime-modules/core/widgets/result/config.d.ts +11 -0
  133. package/plugins/runtime-modules/core/widgets/simple-text/config.d.ts +13 -0
  134. package/plugins/runtime-modules/core/widgets/simple-text/config.js +9 -0
  135. package/plugins/runtime-modules/core/widgets/simple-text/editor.js +1 -1
  136. package/plugins/runtime-modules/core/widgets/simple-text/plugin.js +14 -1
  137. package/plugins/runtime-modules/core/widgets/spacer/client.js +1 -1
  138. package/plugins/runtime-modules/core/widgets/table/config.d.ts +37 -0
  139. package/plugins/runtime-modules/descriptor-compiler.js +8 -0
  140. package/plugins/runtime-modules/editor/presets.d.ts +1 -0
  141. package/plugins/runtime-modules/groups/definition.d.ts +1 -1
  142. package/plugins/runtime-modules/localization/presets.d.ts +1 -0
  143. package/plugins/runtime-modules/news/presets.d.ts +1 -0
  144. package/plugins/runtime-modules/resolver.js +2 -0
  145. package/plugins/runtime-modules/revisions/presets.d.ts +1 -0
  146. package/plugins/runtime-modules/theme/presets.d.ts +1 -0
  147. package/plugins/runtime-modules/theme/widgets/brand-controls/client.js +25 -2
  148. package/server-helpers/cms-page-record.d.ts +26 -0
  149. package/server-helpers/cms-page-record.js +42 -0
  150. package/server-helpers/cms-request.js +48 -4
  151. package/server-helpers/record-fields.d.ts +62 -0
  152. package/server-helpers/record-fields.js +87 -0
  153. package/server-helpers/record-samples.d.ts +21 -0
  154. package/server-helpers/record-samples.js +41 -0
  155. package/styles/builder-scaffold.css +19 -19
  156. package/styles/controls.css +109 -109
  157. package/styles/gradients.css +23 -23
  158. package/styles/layout-affordances.css +15 -15
  159. package/styles/layout-authoring-scaffold.css +20 -20
  160. package/styles/layout.css +9 -9
  161. package/styles/root.css +4 -4
  162. package/styles/shell.css +48 -17
  163. package/theme/antd-css-var-contract.d.ts +86 -80
  164. package/theme/antd-css-var-contract.js +92 -81
  165. package/theme/phi-control-shape.d.ts +1 -1
  166. package/theme/phi-theme-gradients.d.ts +2 -2
  167. package/theme/phi-theme-gradients.js +14 -14
  168. package/theme/phi-theme-palette.d.ts +1 -1
  169. package/theme/phi-theme-palette.js +2 -2
  170. package/theme/phi-theme-tokens.d.ts +8 -5
  171. package/theme/phi-theme-tokens.js +59 -28
  172. package/theme/phi-theme.d.ts +14 -2
  173. package/theme/phi-theme.js +14 -1
  174. package/theme/phi-tokens.d.ts +5 -0
  175. package/theme/phi-tokens.js +9 -0
  176. package/types/cms-module-descriptors.d.ts +6 -0
  177. package/types/cms-plugins.d.ts +19 -1
  178. package/types/core-widget-placements.d.ts +10 -0
  179. package/types/record-provider.d.ts +92 -0
  180. package/types/widget-runtime.d.ts +5 -0
  181. /package/plugins/runtime-modules/{asset/services/folder-images.server.d.ts → core/services/media-folder-images.server.d.ts} +0 -0
  182. /package/plugins/runtime-modules/{asset/services/folder-images.server.js → core/services/media-folder-images.server.js} +0 -0
package/README.md CHANGED
@@ -73,7 +73,7 @@ The root export (`@phis/ui`) is not an integration surface; import from the grou
73
73
  | --- | --- |
74
74
  | Next.js Site | `next/config` (`withPhiNextConfig` for the Site's `next.config`), `next/area-route`, `next/areas/<area>`, `next/areas/<area>-client`, `next/root-route`, `next/root-error-page`, `next/global-error`, `next/site-bridge`, `next/site-proxy`, `next/proxy-runtime`, `next/route-handlers`, `next/seo-routes`, `next/overlay-zones`, `next/overlay-zones-client`, `next/cache-handler`, `next/runtime-module-client-boundary` |
75
75
  | CMS rendering | `cms`, `cms/root-layout`, `cms/root-page`, `cms/root-slot-page`, `cms/error-page`, `cms/request`, `cms/plugins`, `cms/plugins/<area>` |
76
- | Module packages | `module`, `module/client`, `module/authoring-client`, `module/labels`, `module/dashboard-cards`, `module/records`, `module/references`, `module/projection`, `module/projection/client`, `module/projection/authoring-client`, `module/site-modules`, `module/site-modules-client` |
76
+ | Module packages | `module`, `module/client`, `module/authoring-client`, `module/labels`, `module/dashboard-cards`, `module/records`, `module/page-check`, `module/references`, `module/projection`, `module/projection/client`, `module/projection/authoring-client`, `module/site-modules`, `module/site-modules-client` |
77
77
  | Runtime Clients | `runtime`, `runtime/controller-client`, `runtime/render-client`, `runtime/signal-client`, `runtime/data-provider-client`, `runtime/authoring-client`, `runtime/authoring-manifest-client`, `runtime/calendar-adapter-client`, `runtime/user-state-client`, `runtime/client-manifests/<area>` |
78
78
  | UI | `widgets`, `core-widgets`, `widget-config`, `controls`, `controls/config`, `controls/date-time`, `layouts`, `shells`, `root`, `navigation`, `forms`, `forms/client`, `media`, `references`, `state`, `theme` |
79
79
  | Builder | `builder-api-route` |
@@ -28,7 +28,7 @@ function resolveCurrentValue(value, primaryColor) {
28
28
  };
29
29
  }
30
30
  function resolveDisplayBorderColor(color, primaryColor) {
31
- if (color === "var(--ant-color-primary)") {
31
+ if (color === "var(--phi-color-primary)") {
32
32
  return primaryColor;
33
33
  }
34
34
  return color;
@@ -17,14 +17,14 @@ const RADIUS_OPTIONS = [
17
17
  ];
18
18
  const RADIUS_COMPARE_ALIASES = {
19
19
  none: ["0", "0px"],
20
- xxs: ["3", "3px", "var(--ant-border-radius-xs)"],
21
- xs: ["5", "5px", "var(--ant-border-radius-sm)"],
22
- sm: ["8", "8px", "var(--ant-border-radius)"],
23
- base: ["13", "13px", "var(--ant-border-radius-lg)"],
24
- md: ["21", "21px", "var(--ant-border-radius-lg)"],
25
- lg: ["34", "34px", "var(--ant-border-radius-lg)"],
26
- xl: ["55", "55px", "var(--ant-border-radius-outer)"],
27
- xxl: ["89", "89px", "var(--ant-border-radius-outer)"],
20
+ xxs: ["3", "3px", "var(--phi-border-radius-xs)"],
21
+ xs: ["5", "5px", "var(--phi-border-radius-sm)"],
22
+ sm: ["8", "8px", "var(--phi-border-radius)"],
23
+ base: ["13", "13px", "var(--phi-border-radius-lg)"],
24
+ md: ["21", "21px", "var(--phi-border-radius-lg)"],
25
+ lg: ["34", "34px", "var(--phi-border-radius-lg)"],
26
+ xl: ["55", "55px", "var(--phi-border-radius-outer)"],
27
+ xxl: ["89", "89px", "var(--phi-border-radius-outer)"],
28
28
  round: ["50%"],
29
29
  };
30
30
  const PHI_RADIUS_CORNER_SHORT_LABELS = {
@@ -124,5 +124,5 @@ export function PhiBoundRadiusControl({ value, disabled = false, labels = PHI_RA
124
124
  if (asGridRows) {
125
125
  return (_jsxs(_Fragment, { children: [_jsx(Typography.Text, { children: labels.sections.radius }), _jsx("div", { style: { justifySelf: "start" }, children: switchControl }), cornerGrid ? _jsx("div", { style: { gridColumn: "1 / -1", minWidth: 0 }, children: cornerGrid }) : null] }));
126
126
  }
127
- return (_jsxs("div", { style: { display: "grid", gap: token.paddingXS, width: "100%" }, children: [_jsxs(Flex, { align: "center", justify: "flex-start", gap: labelWidth == null ? 8 : 12, children: [showLabel ? (_jsx(Typography.Text, { style: labelWidth == null ? undefined : { flex: `0 0 ${labelWidth}px`, minWidth: 0, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap", lineHeight: "var(--ant-control-height)" }, children: labels.sections.radius })) : null, switchControl] }), cornerGrid] }));
127
+ return (_jsxs("div", { style: { display: "grid", gap: token.paddingXS, width: "100%" }, children: [_jsxs(Flex, { align: "center", justify: "flex-start", gap: labelWidth == null ? 8 : 12, children: [showLabel ? (_jsx(Typography.Text, { style: labelWidth == null ? undefined : { flex: `0 0 ${labelWidth}px`, minWidth: 0, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap", lineHeight: "var(--phi-control-height)" }, children: labels.sections.radius })) : null, switchControl] }), cornerGrid] }));
128
128
  }
@@ -158,5 +158,5 @@ export function PhiBrandControl({ brand, fallbackTitle, shows = "lockup", mode,
158
158
  objectFit: "contain",
159
159
  display: "block",
160
160
  transform: logoYOffset === 0 ? undefined : `translateY(${logoYOffset}px)`,
161
- } }) })) : null, _jsxs(Flex, { vertical: true, gap: 0, justify: "center", children: [eyebrow ? (_jsx("span", { style: { display: "block", fontSize: "var(--ant-font-size-sm)", opacity: 0.75 }, children: eyebrow })) : null, wordmarkNode] })] }));
161
+ } }) })) : null, _jsxs(Flex, { vertical: true, gap: 0, justify: "center", children: [eyebrow ? (_jsx("span", { style: { display: "block", fontSize: "var(--phi-font-size-sm)", opacity: 0.75 }, children: eyebrow })) : null, wordmarkNode] })] }));
162
162
  }
@@ -8,9 +8,9 @@ import { Drawer } from "antd";
8
8
  import { PHI_FONT_SIZE, PHI_SPACE } from "../../theme/antd-css-var-contract";
9
9
  import { PHI_OVERLAY_DEFAULT_MASK, resolvePhiOverlayDismissSource, resolvePhiOverlayMaskPresentation, } from "./phi-overlay-control-contract";
10
10
  import { usePhiHydrated } from "../state/use-phi-hydrated";
11
- const PHI_DRAWER_HEADER_MIN_BLOCK_SIZE = `calc(var(--ant-control-height) + ${PHI_SPACE.xs} + ${PHI_SPACE.xs})`;
11
+ const PHI_DRAWER_HEADER_MIN_BLOCK_SIZE = `calc(var(--phi-control-height) + ${PHI_SPACE.xs} + ${PHI_SPACE.xs})`;
12
12
  /** Where a title starts when the close button stands before it: past the button, not beneath it. */
13
- const PHI_DRAWER_TITLE_AFTER_CLOSE = `calc(${PHI_SPACE.sm} + var(--ant-control-height) + ${PHI_SPACE.xs})`;
13
+ const PHI_DRAWER_TITLE_AFTER_CLOSE = `calc(${PHI_SPACE.sm} + var(--phi-control-height) + ${PHI_SPACE.xs})`;
14
14
  export function PhiDrawerControlAdapter({ open, title, header, body, footer, closable = true, keyboard = true, mask = PHI_OVERLAY_DEFAULT_MASK, mountPolicy = "remount", placement = "right", size, maxSize, resizable = false, push = false, zIndex, containerStyle, onDismiss, afterOpenChange, panelRef, }) {
15
15
  const hydrated = usePhiHydrated();
16
16
  const resolvedMask = resolvePhiOverlayMaskPresentation(mask);
@@ -29,7 +29,7 @@ export function PhiDrawerControlAdapter({ open, title, header, body, footer, clo
29
29
  * drawer without a configured background was see-through, and the presets only looked right
30
30
  * because their glass effect brings a background of its own.
31
31
  */
32
- background: "var(--ant-color-bg-elevated)",
32
+ background: "var(--phi-color-bg-elevated)",
33
33
  ...containerStyle,
34
34
  padding: 0,
35
35
  },
@@ -51,7 +51,7 @@ export function PhiDrawerControlAdapter({ open, title, header, body, footer, clo
51
51
  background: "transparent",
52
52
  },
53
53
  // The title in the body's size, as a Modal's is (theme/phi-theme.ts); Ant Design sets a Drawer's at `lg`.
54
- title: { width: "100%", minWidth: 0, fontSize: PHI_FONT_SIZE.base, lineHeight: "var(--ant-line-height)" },
54
+ title: { width: "100%", minWidth: 0, fontSize: PHI_FONT_SIZE.base, lineHeight: "var(--phi-line-height)" },
55
55
  close: {
56
56
  position: "absolute",
57
57
  top: "50%",
@@ -72,7 +72,7 @@ export function PhiPillDropdownControl({ items, selectedKeys, open, onOpenChange
72
72
  return (_jsx(PhiDropdownControl, { items: items, selectedKeys: selectedKeys, open: open, onOpenChange: onOpenChange, children: _jsxs("button", { ref: triggerRef, type: "button", className: joinPhiClassNames("phi-dropdown-control", className), style: {
73
73
  display: "inline-flex",
74
74
  alignItems: "center",
75
- gap: "var(--ant-padding-xs)",
75
+ gap: "var(--phi-padding-xs)",
76
76
  fontSize: "inherit",
77
77
  color: "inherit",
78
78
  background: "transparent",
@@ -80,5 +80,5 @@ export function PhiPillDropdownControl({ items, selectedKeys, open, onOpenChange
80
80
  padding: 0,
81
81
  cursor: canOpen ? "pointer" : "default",
82
82
  ...style,
83
- }, "aria-haspopup": canOpen ? "menu" : undefined, onMouseEnter: onIntent, onFocus: onIntent, onClick: onIntent, children: [leading, hasLabel && pill ? (_jsx("span", { className: "phi-dropdown-control__pill", children: _jsxs("span", { style: { display: "inline-flex", alignItems: "center", gap: "var(--ant-padding-xxs)" }, children: [_jsx("span", { children: label }), chevron] }) })) : (_jsxs(_Fragment, { children: [hasLabel ? _jsx("span", { children: label }) : null, chevron] }))] }) }));
83
+ }, "aria-haspopup": canOpen ? "menu" : undefined, onMouseEnter: onIntent, onFocus: onIntent, onClick: onIntent, children: [leading, hasLabel && pill ? (_jsx("span", { className: "phi-dropdown-control__pill", children: _jsxs("span", { style: { display: "inline-flex", alignItems: "center", gap: "var(--phi-padding-xxs)" }, children: [_jsx("span", { children: label }), chevron] }) })) : (_jsxs(_Fragment, { children: [hasLabel ? _jsx("span", { children: label }) : null, chevron] }))] }) }));
84
84
  }
@@ -416,7 +416,7 @@ export const PhiFormControl = forwardRef(function PhiFormControl({ descriptor, r
416
416
  [`--phi-form-cell-gap-${mode}`, part === "label"
417
417
  ? (placed.stacked ? `calc(var(--phi-form-row-gap-${mode}) / 4)` : "0px")
418
418
  : field.key === lastInFlowFieldKey ? "0px" : `var(--phi-form-row-gap-${mode})`],
419
- [`--phi-form-label-height-${mode}`, placed.stacked
419
+ [`--phi-form-label-slot-height-${mode}`, placed.stacked
420
420
  ? "auto"
421
421
  : "var(--phi-form-label-min-height)"],
422
422
  [`--phi-form-label-pad-${mode}`, placed.stacked
@@ -41,7 +41,7 @@ export function PhiImageControl({ presentation, source, alt, title, width, heigh
41
41
  maxWidth: "100%",
42
42
  lineHeight: 0,
43
43
  overflow: presentation.simulatedCropStyle ? "hidden" : undefined,
44
- ...(loaded || blur ? {} : { backgroundColor: "var(--ant-color-fill-quaternary)" }),
44
+ ...(loaded || blur ? {} : { backgroundColor: "var(--phi-color-fill-quaternary)" }),
45
45
  ...(zoom ? { cursor: "zoom-in" } : {}),
46
46
  ...style,
47
47
  };
@@ -20,8 +20,8 @@ function renderMaskPreview(mask, label, selected = false) {
20
20
  width: 54,
21
21
  height: 54,
22
22
  borderRadius: 8,
23
- background: "linear-gradient(135deg, var(--ant-color-primary, #1677ff), var(--ant-color-info, #13c2c2))",
24
- boxShadow: selected ? "0 0 0 2px var(--ant-color-primary)" : "inset 0 0 0 1px var(--ant-color-border-secondary)",
23
+ background: "linear-gradient(135deg, var(--phi-color-primary, #1677ff), var(--phi-color-info, #13c2c2))",
24
+ boxShadow: selected ? "0 0 0 2px var(--phi-color-primary)" : "inset 0 0 0 1px var(--phi-color-border-secondary)",
25
25
  ...resolvePhiMaskStyle(mask),
26
26
  } }), _jsx(Typography.Text, { style: { fontSize: 11, textAlign: "center" }, children: label })] }));
27
27
  }
@@ -49,22 +49,22 @@ export function PhiMaskPickerControl({ value, open, buttonAriaLabel = "Select ma
49
49
  });
50
50
  };
51
51
  const popupContainer = (triggerNode) => contentRef.current ?? triggerNode.parentElement ?? document.body;
52
- const content = (_jsx("div", { ref: contentRef, style: { width: 360, maxWidth: "calc(100vw - (var(--ant-padding-lg) * 2))" }, onClick: (event) => event.stopPropagation(), onMouseDown: (event) => event.stopPropagation(), onPointerDown: (event) => event.stopPropagation(), onKeyDown: (event) => event.stopPropagation(), children: _jsxs(Flex, { vertical: true, gap: "var(--ant-padding-sm)", children: [_jsxs(Flex, { align: "center", justify: "space-between", gap: "var(--ant-padding-sm)", children: [_jsx(Typography.Text, { strong: true, children: "Mask" }), _jsx(PhiButtonControl, { size: "small", type: "text", danger: true, icon: _jsx(PhiIcon, { name: "delete", size: "inherit" }), ariaLabel: "Clear mask", onClick: () => picker.changeValue(undefined) })] }), _jsx(PhiSegmentedControl, { block: true, value: mode, options: [
52
+ const content = (_jsx("div", { ref: contentRef, style: { width: 360, maxWidth: "calc(100vw - (var(--phi-padding-lg) * 2))" }, onClick: (event) => event.stopPropagation(), onMouseDown: (event) => event.stopPropagation(), onPointerDown: (event) => event.stopPropagation(), onKeyDown: (event) => event.stopPropagation(), children: _jsxs(Flex, { vertical: true, gap: "var(--phi-padding-sm)", children: [_jsxs(Flex, { align: "center", justify: "space-between", gap: "var(--phi-padding-sm)", children: [_jsx(Typography.Text, { strong: true, children: "Mask" }), _jsx(PhiButtonControl, { size: "small", type: "text", danger: true, icon: _jsx(PhiIcon, { name: "delete", size: "inherit" }), ariaLabel: "Clear mask", onClick: () => picker.changeValue(undefined) })] }), _jsx(PhiSegmentedControl, { block: true, value: mode, options: [
53
53
  { value: "preset", label: "Presets" },
54
54
  { value: "asset", label: "Media" },
55
55
  ], onChange: setMode }), mode === "preset" ? (_jsx("div", { style: {
56
56
  display: "grid",
57
57
  gridTemplateColumns: "repeat(4, minmax(0, 1fr))",
58
- gap: "var(--ant-padding-sm)",
58
+ gap: "var(--phi-padding-sm)",
59
59
  }, children: PHI_MASK_PRESET_OPTIONS.map((preset) => {
60
60
  const selected = resolvedMask.source !== "asset" && resolvedMask.preset === preset.value;
61
- return (_jsx(PhiButtonControl, { type: selected ? "primary" : "default", style: { height: "auto", padding: "var(--ant-padding-xs)" }, onClick: () => selectPreset(preset.value), label: renderMaskPreview({
61
+ return (_jsx(PhiButtonControl, { type: selected ? "primary" : "default", style: { height: "auto", padding: "var(--phi-padding-xs)" }, onClick: () => selectPreset(preset.value), label: renderMaskPreview({
62
62
  ...resolvedMask,
63
63
  enabled: true,
64
64
  source: "preset",
65
65
  preset: preset.value,
66
66
  }, preset.label, selected) }, preset.value));
67
- }) })) : null, mode === "asset" ? (_jsxs(Flex, { vertical: true, gap: "var(--ant-padding-xs)", children: [_jsx(PhiMediaPickerControl, { ...mediaPickerProps, getPopupContainer: popupContainer, popupRootClassName: popupRootClassName, trigger: _jsx("span", { style: { display: "block" }, children: _jsx(PhiButtonControl, { block: true, label: "Select mask asset", onClick: () => undefined }) }) }), _jsx(PhiFileDropControl, { accept: ".svg,.png,image/svg+xml,image/png", onFile: (file) => onUploadFile?.(file), disabled: uploading, style: { width: "100%" }, children: _jsx("span", { style: { display: "block", width: "100%" }, children: _jsx(PhiButtonControl, { block: true, icon: _jsx(PhiIcon, { name: "upload", size: "inherit" }), loading: uploading, label: uploading ? `Uploading ${uploadProgress}%` : "Upload SVG or PNG mask", onClick: () => undefined }) }) }), _jsx(PhiIconPickerControl, { value: selectedIcon, onChange: onIconSelect, disabled: uploading, buttonAriaLabel: "Select Iconify mask", buttonIcon: selectedIcon ? _jsx(PhiIcon, { name: selectedIcon, size: 16 }) : _jsx(PhiIcon, { name: "star", size: "inherit" }), buttonLabel: uploading ? `Uploading ${uploadProgress}%` : "Select Iconify icon", buttonType: "default", buttonSize: "medium", buttonBlock: true, buttonStyle: { width: "100%" }, getPopupContainer: popupContainer, rootClassName: popupRootClassName })] })) : null, [
67
+ }) })) : null, mode === "asset" ? (_jsxs(Flex, { vertical: true, gap: "var(--phi-padding-xs)", children: [_jsx(PhiMediaPickerControl, { ...mediaPickerProps, getPopupContainer: popupContainer, popupRootClassName: popupRootClassName, trigger: _jsx("span", { style: { display: "block" }, children: _jsx(PhiButtonControl, { block: true, label: "Select mask asset", onClick: () => undefined }) }) }), _jsx(PhiFileDropControl, { accept: ".svg,.png,image/svg+xml,image/png", onFile: (file) => onUploadFile?.(file), disabled: uploading, style: { width: "100%" }, children: _jsx("span", { style: { display: "block", width: "100%" }, children: _jsx(PhiButtonControl, { block: true, icon: _jsx(PhiIcon, { name: "upload", size: "inherit" }), loading: uploading, label: uploading ? `Uploading ${uploadProgress}%` : "Upload SVG or PNG mask", onClick: () => undefined }) }) }), _jsx(PhiIconPickerControl, { value: selectedIcon, onChange: onIconSelect, disabled: uploading, buttonAriaLabel: "Select Iconify mask", buttonIcon: selectedIcon ? _jsx(PhiIcon, { name: selectedIcon, size: 16 }) : _jsx(PhiIcon, { name: "star", size: "inherit" }), buttonLabel: uploading ? `Uploading ${uploadProgress}%` : "Select Iconify icon", buttonType: "default", buttonSize: "medium", buttonBlock: true, buttonStyle: { width: "100%" }, getPopupContainer: popupContainer, rootClassName: popupRootClassName })] })) : null, [
68
68
  ["Scale", Math.round((resolvedMask.scale ?? 1) * 100), 25, 200, "%", (next) => patchMask({ scale: next / 100 })],
69
69
  ["Offset X", resolvedMask.offsetX ?? 0, -100, 100, "%", (next) => patchMask({ offsetX: next })],
70
70
  ["Offset Y", resolvedMask.offsetY ?? 0, -100, 100, "%", (next) => patchMask({ offsetY: next })],
@@ -8,7 +8,7 @@ function isPhiSelectSeparatorEntry(entry) {
8
8
  return typeof entry === "object" && entry != null && "separator" in entry;
9
9
  }
10
10
  function renderPhiSelectSeparator() {
11
- return _jsx("div", { role: "separator", style: { borderTop: "1px solid var(--ant-color-split)", marginBlock: 4 } });
11
+ return _jsx("div", { role: "separator", style: { borderTop: "1px solid var(--phi-color-split)", marginBlock: 4 } });
12
12
  }
13
13
  /* The options with a line where one asks for it -- once, where an option after and one before agree. */
14
14
  function separatePhiSelectOptions(resolved) {
@@ -19,7 +19,7 @@ export function PhiThemeScopeControl({ scope, mode, token, components, children,
19
19
  const theme = useMemo(() => ({
20
20
  inherit: false,
21
21
  cssVar: {
22
- prefix: "ant",
22
+ prefix: "phi",
23
23
  key: createPhiAntdThemeCssVarKey(scope, { mode, token, components }),
24
24
  },
25
25
  token,
@@ -28,9 +28,9 @@ const PHI_TEXT_COLOR_TOKEN_KEYS = [
28
28
  "colorTextPlaceholder",
29
29
  "colorTextDisabled",
30
30
  ];
31
- /** A Theme colour token's role, the custom property Ant Design writes for it: `colorPrimaryBg` → `var(--ant-color-primary-bg)`. */
31
+ /** A Theme colour token's role, the custom property Ant Design writes for it: `colorPrimaryBg` → `var(--phi-color-primary-bg)`. */
32
32
  function resolvePhiColorTokenReference(tokenKey) {
33
- return `var(--ant-${tokenKey.replace(/[A-Z]/gu, (letter) => `-${letter.toLowerCase()}`)})`;
33
+ return `var(--phi-${tokenKey.replace(/[A-Z]/gu, (letter) => `-${letter.toLowerCase()}`)})`;
34
34
  }
35
35
  /**
36
36
  * The colour picker's swatches: the Theme's custom colours, its primary and text ladders, then the fixed
@@ -187,7 +187,7 @@ export function PhiCompoundTableFormControl({ field, label, description, value,
187
187
  if (addResetFields)
188
188
  formContext?.setValues(addResetFields);
189
189
  };
190
- return (_jsxs("div", { "data-phi-form-keyboard-scope": true, style: { display: "grid", gap: "var(--ant-padding-sm)", minWidth: 0, width: "100%" }, children: [_jsx(PhiCollectionHeaderControl, { title: label, description: description, toolbar: addEnabled ? (_jsx(PhiToolbarControl, { items: [{
190
+ return (_jsxs("div", { "data-phi-form-keyboard-scope": true, style: { display: "grid", gap: "var(--phi-padding-sm)", minWidth: 0, width: "100%" }, children: [_jsx(PhiCollectionHeaderControl, { title: label, description: description, toolbar: addEnabled ? (_jsx(PhiToolbarControl, { items: [{
191
191
  key: "add",
192
192
  label: addLabel,
193
193
  ariaLabel: addLabel,
@@ -212,5 +212,5 @@ export function PhiCompoundTreeFormControl({ field, label, description, value, o
212
212
  blockNode: true,
213
213
  node: { titleFieldKey: typeof config.titleFieldKey === "string" ? config.titleFieldKey : "title" },
214
214
  });
215
- return (_jsxs("div", { "data-phi-form-keyboard-scope": true, style: { display: "grid", gap: "var(--ant-padding-sm)", minWidth: 0, width: "100%" }, children: [_jsx(PhiCollectionHeaderControl, { title: label, description: description }), _jsx(PhiTreeControl, { nodes: nodes, nodeIdentityPath: identityPath, parentNodeIdentityPath: parentPath, presentation: presentation, disabled: disabled || readOnly, selectedNodeIdentities: selected, checkedNodeIdentities: checked, expandedNodeIdentities: expanded, selectionMode: config.selectionMode === "multiple" ? "multiple" : config.selectionMode === "none" ? "none" : "single", checking: config.checking === true, editing: config.editing === true && !disabled && !readOnly, draggable: config.reorder === true && !disabled && !readOnly, onSelectionChange: setSelected, onCheckingChange: setChecked, onExpansionChange: setExpanded, onCommitField: (identity, fieldKey, proposed) => onChange?.(nodes.map((node) => String(readPath(node, identityPath)) === String(identity) ? setPath(node, fieldKey, proposed) : node)), onDrop: (move) => onChange?.(applyMove(nodes, identityPath, parentPath, move)) })] }));
215
+ return (_jsxs("div", { "data-phi-form-keyboard-scope": true, style: { display: "grid", gap: "var(--phi-padding-sm)", minWidth: 0, width: "100%" }, children: [_jsx(PhiCollectionHeaderControl, { title: label, description: description }), _jsx(PhiTreeControl, { nodes: nodes, nodeIdentityPath: identityPath, parentNodeIdentityPath: parentPath, presentation: presentation, disabled: disabled || readOnly, selectedNodeIdentities: selected, checkedNodeIdentities: checked, expandedNodeIdentities: expanded, selectionMode: config.selectionMode === "multiple" ? "multiple" : config.selectionMode === "none" ? "none" : "single", checking: config.checking === true, editing: config.editing === true && !disabled && !readOnly, draggable: config.reorder === true && !disabled && !readOnly, onSelectionChange: setSelected, onCheckingChange: setChecked, onExpansionChange: setExpanded, onCommitField: (identity, fieldKey, proposed) => onChange?.(nodes.map((node) => String(readPath(node, identityPath)) === String(identity) ? setPath(node, fieldKey, proposed) : node)), onDrop: (move) => onChange?.(applyMove(nodes, identityPath, parentPath, move)) })] }));
216
216
  }
@@ -37,7 +37,7 @@ export const PhiSliderFormControl = ({ field, value, onChange, disabled, readOnl
37
37
  const slider = (_jsx(PhiSliderControl, { value: numericValue, min: min, max: max, step: step, dots: field.config?.dots === true, included: field.config?.included !== false, reverse: field.config?.reverse === true, tooltipMode: field.config?.tooltipMode === "always" || field.config?.tooltipMode === "hidden"
38
38
  ? field.config.tooltipMode
39
39
  : "auto", tooltipSuffix: typeof field.config?.tooltipSuffix === "string" ? field.config.tooltipSuffix : undefined, disabled: disabled, readOnly: readOnly, style: { width: "100%" }, onChange: (nextValue) => onChange?.(nextValue) }));
40
- return field.config?.showInput === true ? (_jsxs("div", { style: { display: "grid", gridTemplateColumns: "minmax(96px, 1fr) minmax(0, 2fr)", gap: "var(--ant-padding-sm)", alignItems: "center", minWidth: 0 }, children: [_jsx(PhiNumberControl, { value: numericValue ?? null, min: min, max: max, step: step, precision: typeof field.config?.precision === "number" ? field.config.precision : undefined, disabled: disabled, readOnly: readOnly, style: { width: "100%" }, onChange: (nextValue) => onChange?.(nextValue) }), slider] })) : slider;
40
+ return field.config?.showInput === true ? (_jsxs("div", { style: { display: "grid", gridTemplateColumns: "minmax(96px, 1fr) minmax(0, 2fr)", gap: "var(--phi-padding-sm)", alignItems: "center", minWidth: 0 }, children: [_jsx(PhiNumberControl, { value: numericValue ?? null, min: min, max: max, step: step, precision: typeof field.config?.precision === "number" ? field.config.precision : undefined, disabled: disabled, readOnly: readOnly, style: { width: "100%" }, onChange: (nextValue) => onChange?.(nextValue) }), slider] })) : slider;
41
41
  };
42
42
  export const PhiCascaderFormControl = ({ field, value, onChange, options, placeholder, disabled, readOnly }) => (_jsx(PhiCascaderControl, { value: typeof value === "string" ? value : undefined, placeholder: placeholder, disabled: disabled, readOnly: readOnly, options: options ?? [], allowRoot: field.config?.allowRoot !== false, allowClear: field.config?.allowClear === true, separator: typeof field.config?.separator === "string" ? field.config.separator : "/", rootValue: typeof field.config?.rootValue === "string" ? field.config.rootValue : "/", normalize: field.config?.normalize === "path" ? "path" : "raw", onChange: (nextValue) => onChange?.(nextValue) }));
43
43
  export const PhiNumberFormControl = ({ id, field, value, onChange, placeholder, disabled, readOnly, labels, }) => (_jsx(PhiNumberControl, { id: id, value: typeof value === "number" ? value : null, disabled: disabled, readOnly: readOnly, placeholder: placeholder, min: typeof field.config?.min === "number" ? field.config.min : undefined, max: typeof field.config?.max === "number" ? field.config.max : undefined, step: typeof field.config?.step === "number" ? field.config.step : undefined, precision: typeof field.config?.precision === "number" ? field.config.precision : undefined, prefix: readPhiNumberFieldPrefix(field.config?.prefix, labels), style: { width: "100%" }, onChange: (nextValue) => onChange?.(nextValue) }));
@@ -25,7 +25,7 @@ placeholderRows = 1) {
25
25
  * server render. On a server-rendered page React keeps the server HTML until the chunk is there.
26
26
  */
27
27
  const placeholder = (_jsx("div", { "aria-busy": "true", style: {
28
- blockSize: `calc(var(--ant-control-height) * ${placeholderRows} + var(--ant-padding-sm) * ${placeholderRows - 1})`,
28
+ blockSize: `calc(var(--phi-control-height) * ${placeholderRows} + var(--phi-padding-sm) * ${placeholderRows - 1})`,
29
29
  /*
30
30
  * The Control shape, because this stands where a Control is about to stand. `grown-md` is half a
31
31
  * Control line, which on the one-row placeholder is exactly the capsule and on a taller one is the
@@ -33,7 +33,7 @@ placeholderRows = 1) {
33
33
  * change under the reader at the moment the chunk lands.
34
34
  */
35
35
  borderRadius: "var(--phi-control-radius-grown-md)",
36
- background: "var(--ant-color-fill-quaternary)",
36
+ background: "var(--phi-color-fill-quaternary)",
37
37
  } }));
38
38
  return function PhiLazyFormFieldControl(props) {
39
39
  return (_jsx(Suspense, { fallback: placeholder, children: _jsx(LazyControl, { ...props }) }));
@@ -53,8 +53,8 @@ export function PhiFlexLayout({ slots, ...layoutProps }) {
53
53
  minHeight: 1,
54
54
  maxHeight: 1,
55
55
  alignSelf: "center",
56
- backgroundColor: "var(--ant-color-border-secondary)",
57
- boxShadow: "inset 0 0 0 1px var(--ant-color-border-secondary)",
56
+ backgroundColor: "var(--phi-color-border-secondary)",
57
+ boxShadow: "inset 0 0 0 1px var(--phi-color-border-secondary)",
58
58
  pointerEvents: "none",
59
59
  }
60
60
  : {
@@ -66,8 +66,8 @@ export function PhiFlexLayout({ slots, ...layoutProps }) {
66
66
  maxHeight: resolvedSeparatorCrossSize,
67
67
  alignSelf: "center",
68
68
  marginInline: 0,
69
- backgroundColor: "var(--ant-color-border-secondary)",
70
- boxShadow: "inset 0 0 0 1px var(--ant-color-border-secondary)",
69
+ backgroundColor: "var(--phi-color-border-secondary)",
70
+ boxShadow: "inset 0 0 0 1px var(--phi-color-border-secondary)",
71
71
  pointerEvents: "none",
72
72
  };
73
73
  const renderSeparator = (key) => (_jsx("div", { style: {
@@ -49,7 +49,7 @@ function renderGridGuides(profile, columns) {
49
49
  marginInlineStart: `calc(var(--phi-grid-column-gap, 0px) * ${shares.lead} / 24)`,
50
50
  marginInlineEnd: `calc(var(--phi-grid-column-gap, 0px) * ${shares.trail} / 24)`,
51
51
  border: "1px dashed var(--phi-debug-layer-slot-border)",
52
- borderRadius: "var(--ant-border-radius)",
52
+ borderRadius: "var(--phi-border-radius)",
53
53
  background: "var(--phi-debug-layer-slot-background-soft)",
54
54
  } }, `grid-guide-${profile}-${index}`));
55
55
  });
@@ -127,11 +127,11 @@ export function PhiGridLayout({ slots, ...layoutProps }) {
127
127
  minWidth: 0,
128
128
  width: "100%",
129
129
  height: "100%",
130
- minHeight: "var(--ant-control-height-lg)",
130
+ minHeight: "var(--phi-control-height-lg)",
131
131
  display: "flex",
132
132
  alignItems: "center",
133
133
  justifyContent: "center",
134
- borderRadius: "var(--ant-border-radius-lg)",
134
+ borderRadius: "var(--phi-border-radius-lg)",
135
135
  }, children: editRenderInsertControl({
136
136
  presentation: "inline",
137
137
  slotIndex: nextInsertSlotIndex,
@@ -39,7 +39,7 @@ export function PhiSequenceSlotEditor({ slots, slotKeys, slotLabels, slotCount,
39
39
  flex: "0 0 auto",
40
40
  width: "100%",
41
41
  justifyContent: "center",
42
- paddingBottom: "var(--ant-padding-xs)",
42
+ paddingBottom: "var(--phi-padding-xs)",
43
43
  }, children: [_jsx("span", { onClick: (event) => event.stopPropagation(), children: _jsx(PhiButtonControl, { ariaLabel: `Previous ${slotNoun}`, icon: _jsx(PhiIcon, { name: "left", size: "inherit" }), size: "small", type: "text", disabled: !hasPreviousSlot, onClick: () => onActiveIndexChange(currentIndex - 1) }) }), _jsxs(PhiTypographyControl, { type: "secondary", style: { minWidth: 64, textAlign: "center" }, children: [currentIndex + 1, " / ", editableSlotCount] }), _jsx("span", { onClick: (event) => event.stopPropagation(), children: _jsx(PhiButtonControl, { ariaLabel: `Next ${slotNoun}`, icon: _jsx(PhiIcon, { name: "right", size: "inherit" }), size: "small", type: "text", disabled: !hasNextSlot, onClick: () => onActiveIndexChange(currentIndex + 1) }) })] }), _jsxs("div", { className: phiLayoutSlotClassName(isAuthoringRender), "data-phi-layout-has-content": phiLayoutSlotContentMarker(isAuthoringRender, hasCurrentSlot), "data-phi-sequence-active-slot": currentSlotKey, style: {
44
44
  position: "relative",
45
45
  display: "flex",
@@ -556,7 +556,7 @@ export declare const PHI_SPLIT_CARD_LAYOUT_DEFINITION: {
556
556
  readonly background: {
557
557
  readonly base: {
558
558
  readonly kind: "color";
559
- readonly color: "var(--ant-color-bg-container)";
559
+ readonly color: "var(--phi-color-bg-container)";
560
560
  };
561
561
  readonly overlay: null;
562
562
  readonly filter: null;
@@ -565,7 +565,7 @@ export declare const PHI_SPLIT_CARD_LAYOUT_DEFINITION: {
565
565
  readonly border: {
566
566
  readonly borderWidth: 1;
567
567
  readonly borderStyle: "solid";
568
- readonly borderColor: "var(--ant-color-border-secondary)";
568
+ readonly borderColor: "var(--phi-color-border-secondary)";
569
569
  };
570
570
  readonly shadow: "soft";
571
571
  };
@@ -1247,7 +1247,7 @@ export declare const PHI_CORE_LAYOUT_DEFINITIONS: readonly [{
1247
1247
  readonly background: {
1248
1248
  readonly base: {
1249
1249
  readonly kind: "color";
1250
- readonly color: "var(--ant-color-bg-container)";
1250
+ readonly color: "var(--phi-color-bg-container)";
1251
1251
  };
1252
1252
  readonly overlay: null;
1253
1253
  readonly filter: null;
@@ -1256,7 +1256,7 @@ export declare const PHI_CORE_LAYOUT_DEFINITIONS: readonly [{
1256
1256
  readonly border: {
1257
1257
  readonly borderWidth: 1;
1258
1258
  readonly borderStyle: "solid";
1259
- readonly borderColor: "var(--ant-color-border-secondary)";
1259
+ readonly borderColor: "var(--phi-color-border-secondary)";
1260
1260
  };
1261
1261
  readonly shadow: "soft";
1262
1262
  };
@@ -2,7 +2,7 @@
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { PHI_LAYOUT } from "../../theme/phi-tokens";
4
4
  import { usePhiAuthoringRegionOverrides } from "../runtime/authoring-region-overrides";
5
- const PHI_PADDING = "var(--ant-padding)";
5
+ const PHI_PADDING = "var(--phi-padding)";
6
6
  export function PhiPageRegionLayout({ blockId, headerBottom, hero, content, siderRight, footerTop, style, }) {
7
7
  const overrides = usePhiAuthoringRegionOverrides();
8
8
  const isPreviewMode = overrides.preview;
@@ -4,9 +4,9 @@ import { usePhiConfig } from "../root/phi-config-provider";
4
4
  import { PHI_LAYOUT } from "../../theme/phi-tokens";
5
5
  import { usePhiAuthoringRegionOverrides } from "../runtime/authoring-region-overrides";
6
6
  import { PhiTypographyControl } from "../controls/phi-typography-control";
7
- const PHI_PADDING = "var(--ant-padding)";
8
- const PHI_PADDING_XS = "var(--ant-padding-xs)";
9
- const PHI_COLOR_BORDER_SECONDARY = "var(--ant-color-border-secondary)";
7
+ const PHI_PADDING = "var(--phi-padding)";
8
+ const PHI_PADDING_XS = "var(--phi-padding-xs)";
9
+ const PHI_COLOR_BORDER_SECONDARY = "var(--phi-color-border-secondary)";
10
10
  export function PhiStructureRegionLayout({ blockId, headerTop, headerMain, siderLeft, footerMain, footerBottom, style, labels, }) {
11
11
  const { token } = usePhiConfig();
12
12
  const overrides = usePhiAuthoringRegionOverrides();
@@ -255,7 +255,7 @@ function PhiAssetFocalRectEditor({ asset, config, }) {
255
255
  maxHeight: "calc(100dvh - 240px)",
256
256
  minHeight: 240,
257
257
  overflow: "hidden",
258
- background: "var(--ant-color-fill-tertiary)",
258
+ background: "var(--phi-color-fill-tertiary)",
259
259
  }, children: _jsx("div", { ref: canvasRef, onPointerDown: pointerDown, onPointerMove: pointerMove, onPointerUp: pointerUp, onPointerCancel: pointerUp, style: { position: "absolute", inset: 0, cursor, touchAction: "none", userSelect: "none" }, children: _jsxs("div", { ref: imageRef, style: {
260
260
  position: "absolute",
261
261
  left: imageBox?.left ?? 0,
@@ -270,9 +270,9 @@ function PhiAssetFocalRectEditor({ asset, config, }) {
270
270
  top: `${draft.y * 100}%`,
271
271
  width: `${draft.width * 100}%`,
272
272
  height: `${draft.height * 100}%`,
273
- border: "2px solid var(--ant-color-primary)",
274
- boxShadow: "0 0 0 1px var(--ant-color-bg-container) inset",
275
- background: "color-mix(in srgb, var(--ant-color-primary) 12%, transparent)",
273
+ border: "2px solid var(--phi-color-primary)",
274
+ boxShadow: "0 0 0 1px var(--phi-color-bg-container) inset",
275
+ background: "color-mix(in srgb, var(--phi-color-primary) 12%, transparent)",
276
276
  cursor,
277
277
  }, children: [_jsxs("div", { style: { position: "absolute", insetInlineStart: 8, top: 8, display: "flex", gap: 6, flexWrap: "wrap" }, children: [_jsx(PhiTagControl, { color: "blue", children: `x ${focalRectToPercent(draft.x)}` }), _jsx(PhiTagControl, { color: "blue", children: `y ${focalRectToPercent(draft.y)}` })] }), _jsxs("div", { style: { position: "absolute", insetInlineEnd: 8, bottom: 8, display: "flex", gap: 6, flexWrap: "wrap" }, children: [_jsx(PhiTagControl, { color: "blue", children: `w ${focalRectToPercent(draft.width)}` }), _jsx(PhiTagControl, { color: "blue", children: `h ${focalRectToPercent(draft.height)}` })] })] })) : null] }) }) }));
278
278
  }
@@ -112,7 +112,7 @@ export function PhiAssetInspectorSection({ section, asset, selectedVariantKey, s
112
112
  width: "100%",
113
113
  minWidth: 0,
114
114
  "--phi-labeled-control-label-width": "33.333333%",
115
- }, children: [_jsxs("div", { style: { position: "relative", width: "100%", aspectRatio: "4 / 3", overflow: "hidden", borderRadius: "var(--ant-border-radius-lg)", background: "var(--ant-color-fill-tertiary)" }, children: [asset.kind === PhiMediaKind.Image ? (isOriginalSelection ? (originalCoverImageStyle ? (_jsx(NextImage, { alt: asset.altText ?? asset.title ?? asset.originalName, src: asset.deliveryUrl, width: asset.width ?? 1, height: asset.height ?? 1, unoptimized: unoptimizedPreview, sizes: "340px", placeholder: asset.blurDataUrl ? "blur" : "empty", blurDataURL: asset.blurDataUrl ?? undefined, style: originalCoverImageStyle })) : (_jsx(NextImage, { alt: asset.altText ?? asset.title ?? asset.originalName, src: asset.deliveryUrl, fill: true, unoptimized: unoptimizedPreview, sizes: "340px", placeholder: asset.blurDataUrl ? "blur" : "empty", blurDataURL: asset.blurDataUrl ?? undefined, style: { objectFit: "cover" } }))) : (_jsx("div", { style: { position: "absolute", inset: 0, display: "flex", alignItems: "center", justifyContent: "center" }, children: previewFrame?.fixedCropBox ? (_jsx("div", { style: { position: "relative", width: previewFrame.fixedCropBox, height: previewFrame.fixedCropBox, flex: "0 0 auto", overflow: "hidden" }, children: _jsx(NextImage, { alt: asset.altText ?? asset.title ?? asset.originalName, src: variantPresentation?.url ?? asset.deliveryUrl, width: previewFrame.fixedCropBox, height: previewFrame.fixedCropBox, unoptimized: unoptimizedPreview, placeholder: asset.blurDataUrl ? "blur" : "empty", blurDataURL: asset.blurDataUrl ?? undefined, style: selectedVariantCoverImageStyle ?? undefined }) })) : (_jsx("div", { style: {
115
+ }, children: [_jsxs("div", { style: { position: "relative", width: "100%", aspectRatio: "4 / 3", overflow: "hidden", borderRadius: "var(--phi-border-radius-lg)", background: "var(--phi-color-fill-tertiary)" }, children: [asset.kind === PhiMediaKind.Image ? (isOriginalSelection ? (originalCoverImageStyle ? (_jsx(NextImage, { alt: asset.altText ?? asset.title ?? asset.originalName, src: asset.deliveryUrl, width: asset.width ?? 1, height: asset.height ?? 1, unoptimized: unoptimizedPreview, sizes: "340px", placeholder: asset.blurDataUrl ? "blur" : "empty", blurDataURL: asset.blurDataUrl ?? undefined, style: originalCoverImageStyle })) : (_jsx(NextImage, { alt: asset.altText ?? asset.title ?? asset.originalName, src: asset.deliveryUrl, fill: true, unoptimized: unoptimizedPreview, sizes: "340px", placeholder: asset.blurDataUrl ? "blur" : "empty", blurDataURL: asset.blurDataUrl ?? undefined, style: { objectFit: "cover" } }))) : (_jsx("div", { style: { position: "absolute", inset: 0, display: "flex", alignItems: "center", justifyContent: "center" }, children: previewFrame?.fixedCropBox ? (_jsx("div", { style: { position: "relative", width: previewFrame.fixedCropBox, height: previewFrame.fixedCropBox, flex: "0 0 auto", overflow: "hidden" }, children: _jsx(NextImage, { alt: asset.altText ?? asset.title ?? asset.originalName, src: variantPresentation?.url ?? asset.deliveryUrl, width: previewFrame.fixedCropBox, height: previewFrame.fixedCropBox, unoptimized: unoptimizedPreview, placeholder: asset.blurDataUrl ? "blur" : "empty", blurDataURL: asset.blurDataUrl ?? undefined, style: selectedVariantCoverImageStyle ?? undefined }) })) : (_jsx("div", { style: {
116
116
  position: "relative",
117
117
  width: previewFrame?.fitAxis === "width" ? "100%" : "auto",
118
118
  height: previewFrame?.fitAxis === "height" ? "100%" : "auto",
@@ -2,8 +2,8 @@
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
3
  import { PhiMediaKind } from "../../constants/media";
4
4
  import { PhiIcon } from "../shell/phi-icon";
5
- const PHI_COLOR_TEXT_SECONDARY = "var(--ant-color-text-secondary)";
6
- const PHI_COLOR_PRIMARY = "var(--ant-color-primary)";
5
+ const PHI_COLOR_TEXT_SECONDARY = "var(--phi-color-text-secondary)";
6
+ const PHI_COLOR_PRIMARY = "var(--phi-color-primary)";
7
7
  export function PhiMediaKindIcon({ kind, size = 32, style, className }) {
8
8
  const iconStyle = {
9
9
  fontSize: `${size / 16}rem`,
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
3
  import { PhiIcon } from "../shell/phi-icon";
4
- const PHI_COLOR_ERROR = "var(--ant-color-error)";
4
+ const PHI_COLOR_ERROR = "var(--phi-color-error)";
5
5
  export function PhiMediaRestrictedIcon({ size = 32, style, className, title = "not allowed", }) {
6
6
  const iconStyle = {
7
7
  fontSize: `${size / 16}rem`,
@@ -23,7 +23,7 @@ function renderOverlayZonesFailure(failure) {
23
23
  return (_jsx(PhiAlertControl, { level: "error", title: "This content could not be shown.", description: failure }));
24
24
  }
25
25
  /** Stands where the body will be while the zones are on their way, so the shell opens at once. */
26
- const PHI_OVERLAY_ZONES_PENDING = (_jsx("div", { "aria-busy": "true", style: { minBlockSize: "calc(var(--ant-control-height) * 3)" } }));
26
+ const PHI_OVERLAY_ZONES_PENDING = (_jsx("div", { "aria-busy": "true", style: { minBlockSize: "calc(var(--phi-control-height) * 3)" } }));
27
27
  /**
28
28
  * Whether an `open` carried on a Table's action channel is meant for this Overlay.
29
29
  *
@@ -1,7 +1,7 @@
1
1
  import { PHI_CMS_DEFAULT_SLOT_INDEX } from "../../../constants/cms-layout-types";
2
2
  import { createPhiCmsPresetNodes } from "../../../helpers/cms-preset-nodes";
3
3
  import { PHI_SURFACE_WASH } from "../../../helpers/surface-presets";
4
- import { PHI_SPACE } from "../../../theme/antd-css-var-contract";
4
+ import { PHI_PAGE, PHI_SPACE } from "../../../theme/antd-css-var-contract";
5
5
  import { buildPhiBasePageContentScaffold, PHI_BASE_PAGE_LAYOUT_NODE_ID, } from "./phi-base-page-layout";
6
6
  /**
7
7
  * A module Page's content as one column on the base scaffold: the Region, the scaffold, and a vertical
@@ -32,7 +32,11 @@ export function buildPhiBasePageColumnFrame({ page, regionId, columnId, label, m
32
32
  config: {
33
33
  maxSize: { width: maxWidth },
34
34
  surface: PHI_SURFACE_WASH,
35
- padding: PHI_SPACE.md,
35
+ // The Theme's Page inset for the screen it is drawn on (`PHI_PAGE.padding`); a Layout's own wins.
36
+ paddingTop: PHI_PAGE.padding.top,
37
+ paddingRight: PHI_PAGE.padding.right,
38
+ paddingBottom: PHI_PAGE.padding.bottom,
39
+ paddingLeft: PHI_PAGE.padding.left,
36
40
  // The house step between a preset's children; the Widgets keep their own air inside.
37
41
  gap: PHI_SPACE.sm,
38
42
  },
@@ -40,7 +40,7 @@ function PhiConfigValueProvider({ children, customColors, fonts, fontFamilies, h
40
40
  }, [controlShapeVars]);
41
41
  /*
42
42
  * The typefaces, for the same reason. The font catalogue's classes are what define
43
- * `--phi-font-source-*`, which the Theme's `--ant-font-family` points at; a Drawer or a Modal on
43
+ * `--phi-font-source-*`, which the Theme's `--phi-font-family` points at; a Drawer or a Modal on
44
44
  * `document.body` found the variable undefined and fell back to the browser's sans-serif.
45
45
  */
46
46
  useEffect(() => {
@@ -115,7 +115,7 @@ export function resolvePhiRootBackgroundFrameStyle() {
115
115
  * The fallback ground as a longhand, never as the `background` shorthand: it is the colour under
116
116
  * every Picture, including the moment before the first one shows.
117
117
  */
118
- backgroundColor: "var(--ant-color-bg-layout)",
118
+ backgroundColor: "var(--phi-color-bg-layout)",
119
119
  };
120
120
  }
121
121
  /** The last `url(...)` of a background, which is the base picture: overlays are listed before it. */
@@ -112,7 +112,7 @@ export function resolvePhiRootTheme({ siteTheme, mode, fonts, presets, }) {
112
112
  hashed: false,
113
113
  zeroRuntime: true,
114
114
  cssVar: {
115
- prefix: "ant",
115
+ prefix: "phi",
116
116
  /*
117
117
  * Named after what the tokens are resolved from, not after the tokens: the same Theme record,
118
118
  * fonts, palette block and mode always resolve to the same tokens, and the record is a fraction
@@ -29,7 +29,7 @@ export function PhiModuleIcon({ name, size, style, className, title, ariaLabel,
29
29
  * In the Builder the name stays visible as the mark's title: the Module is not active in the target
30
30
  * Area, or does not register that name. Live, a missing icon is nothing, as an unknown `antd:` is.
31
31
  */
32
- return flagUnavailable ? (_jsx(PhiAntdIcon, { icon: "WarningOutlined", size: size, title: name, className: className ? `phi-module-icon-unavailable ${className}` : "phi-module-icon-unavailable", style: { color: "var(--ant-color-warning)", ...style } })) : null;
32
+ return flagUnavailable ? (_jsx(PhiAntdIcon, { icon: "WarningOutlined", size: size, title: name, className: className ? `phi-module-icon-unavailable ${className}` : "phi-module-icon-unavailable", style: { color: "var(--phi-color-warning)", ...style } })) : null;
33
33
  }
34
34
  const { drawing } = icon;
35
35
  return (_jsx("span", { role: "img", "aria-label": ariaLabel ?? icon.name, title: title, className: className ? `anticon ${className}` : "anticon", style: size === "1em" ? style : { fontSize: size, ...style }, children: _jsx("svg", { viewBox: drawing.viewBox, width: "1em", height: "1em", fill: "currentColor", "aria-hidden": "true", focusable: "false", children: drawing.paths.map((path, index) => (_jsx("path", { d: path, fillRule: drawing.fillRule }, index))) }) }));
@@ -1,21 +1,21 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  const frameStyle = {
3
3
  display: "grid",
4
- gap: "var(--ant-padding-xs)",
4
+ gap: "var(--phi-padding-xs)",
5
5
  gridTemplateRows: "auto auto minmax(5rem, 1fr) auto",
6
6
  minHeight: "10rem",
7
7
  width: "100%",
8
8
  height: "100%",
9
- padding: "var(--ant-padding-sm)",
10
- border: "1px solid var(--ant-color-border-secondary)",
11
- borderRadius: "var(--ant-border-radius-lg)",
12
- background: "var(--ant-color-bg-layout)",
9
+ padding: "var(--phi-padding-sm)",
10
+ border: "1px solid var(--phi-color-border-secondary)",
11
+ borderRadius: "var(--phi-border-radius-lg)",
12
+ background: "var(--phi-color-bg-layout)",
13
13
  boxSizing: "border-box",
14
14
  };
15
15
  const regionStyle = {
16
16
  minHeight: "1.25rem",
17
- borderRadius: "var(--ant-border-radius-sm)",
18
- background: "var(--ant-color-fill-secondary)",
17
+ borderRadius: "var(--phi-border-radius-sm)",
18
+ background: "var(--phi-color-fill-secondary)",
19
19
  };
20
20
  function Region({ style }) {
21
21
  return _jsx("div", { "aria-hidden": true, style: { ...regionStyle, ...style } });
@@ -23,7 +23,7 @@ function Region({ style }) {
23
23
  export function PhiBuilderWorkspacePreviewSkeleton({ kind, }) {
24
24
  return (_jsxs("div", { "aria-label": kind === "pages" ? "Pages workspace preview" : "Shells workspace preview", "data-phi-builder-workspace-preview": kind, style: frameStyle, children: [_jsx(Region, {}), _jsx(Region, { style: { minHeight: kind === "pages" ? "2rem" : "1.5rem" } }), _jsxs("div", { style: {
25
25
  display: "grid",
26
- gap: "var(--ant-padding-xs)",
26
+ gap: "var(--phi-padding-xs)",
27
27
  gridTemplateColumns: kind === "pages" ? "minmax(0, 1fr) 22%" : "22% minmax(0, 1fr)",
28
28
  minHeight: 0,
29
29
  }, children: [_jsx(Region, {}), _jsx(Region, {})] }), _jsx(Region, {})] }));
@@ -75,7 +75,7 @@ export function PhiBulletListEntriesEditor({ entries, listStyle, onCommit, state
75
75
  }
76
76
  return (_jsx("div", { ref: listRef, style: { width: "100%", minWidth: 0 }, children: _jsx(PhiBulletListControl, { listStyle: listStyle,
77
77
  // Each entry is a borderless text field, whose first line stands at the field's height.
78
- markerLineHeight: "var(--ant-control-height)", items: buildPhiBulletListTree(shown, (item, index) => (_jsx(PhiTextControl, { presentation: "textarea", value: item.text, readOnly: !onCommit, variant: "borderless", placeholder: `Item ${index + 1}`, autoSize: { minRows: 1, maxRows: 6 }, onChange: (value) => updateText(index, value ?? ""), onBlur: () => commit(shown), onKeyDown: (event) => {
78
+ markerLineHeight: "var(--phi-control-height)", items: buildPhiBulletListTree(shown, (item, index) => (_jsx(PhiTextControl, { presentation: "textarea", value: item.text, readOnly: !onCommit, variant: "borderless", placeholder: `Item ${index + 1}`, autoSize: { minRows: 1, maxRows: 6 }, onChange: (value) => updateText(index, value ?? ""), onBlur: () => commit(shown), onKeyDown: (event) => {
79
79
  if (!onCommit)
80
80
  return;
81
81
  if (event.key === "Tab") {
@@ -105,5 +105,5 @@ export function PhiBulletListEntriesEditor({ entries, listStyle, onCommit, state
105
105
  * first line's middle is the marker's (`markerLineHeight` above). That is the padding the
106
106
  * field had from Ant Design already; stated, the clear button can find the line too.
107
107
  */
108
- inputStyle: { paddingBlock: "calc((var(--ant-control-height) - 1lh) / 2)" } })), states && onCommit ? (_entry, index) => stepState(index) : undefined) }) }));
108
+ inputStyle: { paddingBlock: "calc((var(--phi-control-height) - 1lh) / 2)" } })), states && onCommit ? (_entry, index) => stepState(index) : undefined) }) }));
109
109
  }