@phis/ui 0.4.3 → 0.4.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -3
- package/cms/plugins.d.ts +1 -0
- package/cms/plugins.js +2 -0
- package/components/cms/phi-cms-root-layout.js +30 -1
- package/components/controls/phi-anchor-nav-control.js +4 -1
- package/components/controls/phi-background-control.d.ts +6 -1
- package/components/controls/phi-background-control.js +30 -7
- package/components/controls/phi-bullet-list-control.d.ts +7 -2
- package/components/controls/phi-bullet-list-control.js +4 -3
- package/components/controls/phi-button-control.d.ts +13 -1
- package/components/controls/phi-button-control.js +21 -3
- package/components/controls/phi-color-control.js +4 -2
- package/components/controls/phi-drawer-control-adapter.js +3 -2
- package/components/controls/phi-dropdown-control.js +2 -2
- package/components/controls/phi-inline-text-editor.js +7 -1
- package/components/controls/phi-length-control.js +1 -1
- package/components/controls/phi-media-asset-tile-control.js +10 -10
- package/components/controls/phi-progress-control.d.ts +10 -2
- package/components/controls/phi-progress-control.js +6 -2
- package/components/controls/phi-ribbon-control.d.ts +16 -4
- package/components/controls/phi-ribbon-control.js +14 -8
- package/components/controls/phi-ribbon-wrap-control.d.ts +32 -0
- package/components/controls/phi-ribbon-wrap-control.js +31 -0
- package/components/controls/phi-segmented-control.d.ts +4 -1
- package/components/controls/phi-segmented-control.js +13 -2
- package/components/controls/phi-select-control.js +5 -2
- package/components/controls/phi-series-chart-control.d.ts +48 -0
- package/components/controls/phi-series-chart-control.js +82 -0
- package/components/controls/phi-surface-control.d.ts +2 -0
- package/components/controls/phi-surface-control.js +16 -1
- package/components/controls/phi-switch-control.d.ts +4 -1
- package/components/controls/phi-switch-control.js +8 -2
- package/components/controls/phi-tag-control.d.ts +4 -1
- package/components/controls/phi-tag-control.js +11 -3
- package/components/controls/phi-text-control.js +57 -3
- package/components/controls/phi-tree-control.js +1 -1
- package/components/controls/phi-truncated-hover-text.d.ts +15 -0
- package/components/controls/phi-truncated-hover-text.js +25 -0
- package/components/forms/link-target-form-control.d.ts +1 -1
- package/components/forms/link-target-form-control.js +2 -45
- package/components/forms/phi-form-widget-frame.js +4 -2
- package/components/layouts/clients/phi-three-column-layout-client.js +10 -1
- package/components/layouts/phi-layout-view-model.js +10 -1
- package/components/navigation/phi-link.js +6 -1
- package/components/regions/clients/cms-region-container-client.js +16 -1
- package/components/regions/phi-cms-region-container.js +7 -0
- package/components/regions/phi-cms-region-shell.d.ts +22 -1
- package/components/regions/phi-cms-region-shell.js +131 -23
- package/components/root/phi-config-provider.d.ts +13 -0
- package/components/root/phi-config-provider.js +12 -1
- package/components/root/phi-root-background.d.ts +7 -0
- package/components/root/phi-root-background.js +20 -1
- package/components/root/phi-root-layout.d.ts +1 -0
- package/components/root/phi-root-layout.js +1 -0
- package/components/root/phi-root-theme-resolver.js +15 -1
- package/components/root/phi-shell-chrome-overlay.d.ts +18 -1
- package/components/root/phi-shell-chrome-overlay.js +26 -4
- package/components/runtime/runtime-module-context.d.ts +12 -1
- package/components/runtime/runtime-module-context.js +6 -1
- package/components/shell/phi-antd-icon.d.ts +1 -0
- package/components/shell/phi-antd-icon.js +3 -0
- package/components/shell/phi-cms-shell.d.ts +7 -1
- package/components/shell/phi-cms-shell.js +4 -2
- package/components/shell/use-phi-shell-header-bands.d.ts +5 -0
- package/components/shell/use-phi-shell-header-bands.js +64 -0
- package/components/shell/use-phi-shell-sticky-bottom.d.ts +18 -0
- package/components/shell/use-phi-shell-sticky-bottom.js +54 -0
- package/components/shell/use-phi-shell-sticky-top.js +61 -16
- package/components/surface/phi-surface-tone.d.ts +13 -0
- package/components/surface/phi-surface-tone.js +21 -0
- package/components/tables/client/phi-table-binding.d.ts +1 -0
- package/components/tables/client/phi-table-binding.js +22 -3
- package/components/trees/client/phi-tree-binding.d.ts +1 -0
- package/components/trees/client/phi-tree-binding.js +11 -2
- package/components/widgets/client/bullet-list-entries-editor.js +7 -1
- package/components/widgets/client/html-editor.js +1 -1
- package/components/widgets/client/shared/phi-collection-provider.js +4 -3
- package/components/widgets/client/shared/phi-collection-view-binding.d.ts +1 -0
- package/components/widgets/client/shared/phi-collection-view-binding.js +16 -2
- package/components/widgets/client/shared/phi-command-buttons.js +6 -2
- package/components/widgets/client/shared/use-page-reference-options.d.ts +17 -0
- package/components/widgets/client/shared/use-page-reference-options.js +57 -0
- package/components/widgets/config/background.d.ts +52 -1
- package/components/widgets/config/background.js +85 -4
- package/components/widgets/config/button-variant.d.ts +22 -4
- package/components/widgets/config/button-variant.js +24 -5
- package/components/widgets/config/common-action-field.d.ts +1 -1
- package/components/widgets/config/parser-primitives.js +4 -2
- package/components/widgets/config/theme-gradient.d.ts +11 -0
- package/components/widgets/config/theme-gradient.js +12 -0
- package/components/widgets/label-sets/background.js +4 -0
- package/components/widgets/label-sets/geometry.js +2 -0
- package/components/widgets/label-sets/inspector.js +4 -0
- package/components/widgets/label-types/background.d.ts +2 -0
- package/components/widgets/label-types/background.js +2 -0
- package/components/widgets/label-types/common-controls.js +2 -2
- package/components/widgets/label-types/geometry.d.ts +1 -0
- package/components/widgets/label-types/geometry.js +1 -0
- package/components/widgets/label-types/inspector.d.ts +4 -0
- package/components/widgets/label-types/inspector.js +2 -0
- package/components/widgets/shared/bullet-list-vocabulary.d.ts +10 -0
- package/components/widgets/shared/bullet-list-vocabulary.js +5 -2
- package/components/widgets/shared/card-body-client.d.ts +16 -3
- package/components/widgets/shared/card-body-client.js +79 -8
- package/components/widgets/shared/card-vocabulary.d.ts +12 -2
- package/components/widgets/shared/card-vocabulary.js +7 -0
- package/components/widgets/shared/collection-source-failure.d.ts +26 -0
- package/components/widgets/shared/collection-source-failure.js +42 -0
- package/components/widgets/shared/markdown-body-client.js +39 -10
- package/components/widgets/shared/markdown-render.js +16 -3
- package/components/widgets/shared/widget-failure-client.d.ts +10 -0
- package/components/widgets/shared/widget-failure-client.js +20 -0
- package/components/widgets/shared/widget-failure.d.ts +31 -0
- package/components/widgets/shared/widget-failure.js +20 -0
- package/components/widgets/shared/widget-failure.server.d.ts +9 -0
- package/components/widgets/shared/widget-failure.server.js +12 -0
- package/gateway/dashboard-card-memo.d.ts +3 -0
- package/gateway/dashboard-card-memo.js +25 -0
- package/helpers/cms-container-chrome.js +6 -1
- package/helpers/cms-region-keys.d.ts +1 -1
- package/helpers/layout-style.d.ts +8 -4
- package/helpers/layout-style.js +3 -2
- package/helpers/locale.d.ts +8 -0
- package/helpers/locale.js +18 -0
- package/helpers/mode-paint.d.ts +4 -0
- package/helpers/mode-paint.js +47 -0
- package/helpers/shell-region-style.js +2 -1
- package/helpers/surface-style.d.ts +12 -1
- package/helpers/surface-style.js +60 -12
- package/module-dashboard-cards.d.ts +2 -1
- package/module-dashboard-cards.js +2 -1
- package/module-records.d.ts +7 -0
- package/module-records.js +6 -0
- package/package.json +1 -1
- package/plugins/runtime-modules/area-definitions.d.ts +0 -42
- package/plugins/runtime-modules/area-definitions.js +3 -8
- package/plugins/runtime-modules/builder/clients/inspector-config-field.js +21 -2
- package/plugins/runtime-modules/builder/clients/inspector-surface-labels.js +1 -0
- package/plugins/runtime-modules/builder/clients/layout-scaffold-overlays.js +10 -5
- package/plugins/runtime-modules/builder/clients/region-inspector.js +47 -2
- package/plugins/runtime-modules/builder/clients/runtime-module-authoring-boundary.js +1 -1
- package/plugins/runtime-modules/builder/controller/draft-command-controller.js +7 -4
- package/plugins/runtime-modules/builder/controller/page-controller.js +7 -0
- package/plugins/runtime-modules/builder/edit-scaffold-drawer.js +3 -2
- package/plugins/runtime-modules/builder/persistence.d.ts +3 -0
- package/plugins/runtime-modules/builder/persistence.js +9 -1
- package/plugins/runtime-modules/builder/render-root-node-scaffold.js +25 -15
- package/plugins/runtime-modules/builder/trees/phi-default-builder-area-preset-tree.js +4 -0
- package/plugins/runtime-modules/builder/widgets/structure-region/built-in.js +15 -4
- package/plugins/runtime-modules/client-authoring-module.d.ts +8 -1
- package/plugins/runtime-modules/client-authoring-module.js +13 -3
- package/plugins/runtime-modules/core/content-entries/record-source.server.d.ts +3 -1
- package/plugins/runtime-modules/core/content-entries/record-source.server.js +7 -4
- package/plugins/runtime-modules/core/widgets/brand/client.d.ts +12 -3
- package/plugins/runtime-modules/core/widgets/brand/client.js +3 -11
- package/plugins/runtime-modules/core/widgets/brand/home.d.ts +15 -0
- package/plugins/runtime-modules/core/widgets/brand/home.js +18 -0
- package/plugins/runtime-modules/core/widgets/brand/plugin.js +3 -2
- package/plugins/runtime-modules/core/widgets/brand/server.d.ts +2 -2
- package/plugins/runtime-modules/core/widgets/brand/server.js +2 -2
- package/plugins/runtime-modules/core/widgets/button/client.js +2 -2
- package/plugins/runtime-modules/core/widgets/button/config.d.ts +40 -4
- package/plugins/runtime-modules/core/widgets/button/config.js +12 -0
- package/plugins/runtime-modules/core/widgets/card/config.d.ts +100 -1
- package/plugins/runtime-modules/core/widgets/card/config.js +57 -3
- package/plugins/runtime-modules/core/widgets/card/editor.js +21 -4
- package/plugins/runtime-modules/core/widgets/card/server.js +5 -0
- package/plugins/runtime-modules/core/widgets/collection-view/asset-binding.d.ts +4 -1
- package/plugins/runtime-modules/core/widgets/collection-view/asset-binding.js +10 -3
- package/plugins/runtime-modules/core/widgets/collection-view/authoring.js +1 -1
- package/plugins/runtime-modules/core/widgets/collection-view/client.d.ts +3 -0
- package/plugins/runtime-modules/core/widgets/collection-view/client.js +47 -11
- package/plugins/runtime-modules/core/widgets/collection-view/image-preview-grid.d.ts +4 -1
- package/plugins/runtime-modules/core/widgets/collection-view/image-preview-grid.js +2 -2
- package/plugins/runtime-modules/core/widgets/collection-view/plugin.js +3 -2
- package/plugins/runtime-modules/core/widgets/collection-view/server.d.ts +6 -1
- package/plugins/runtime-modules/core/widgets/collection-view/server.js +21 -3
- package/plugins/runtime-modules/core/widgets/description/client.js +3 -3
- package/plugins/runtime-modules/core/widgets/description/config.d.ts +1 -0
- package/plugins/runtime-modules/core/widgets/description/editor.js +3 -2
- package/plugins/runtime-modules/core/widgets/description/server.js +3 -2
- package/plugins/runtime-modules/core/widgets/entry-detail/plugin.js +1 -1
- package/plugins/runtime-modules/core/widgets/entry-detail/server.d.ts +3 -1
- package/plugins/runtime-modules/core/widgets/entry-detail/server.js +5 -2
- package/plugins/runtime-modules/core/widgets/entry-header/plugin.js +1 -1
- package/plugins/runtime-modules/core/widgets/entry-header/server.d.ts +3 -1
- package/plugins/runtime-modules/core/widgets/entry-header/server.js +5 -2
- package/plugins/runtime-modules/core/widgets/entry-list/config.d.ts +1 -0
- package/plugins/runtime-modules/core/widgets/entry-list/plugin.js +1 -1
- package/plugins/runtime-modules/core/widgets/entry-list/server.d.ts +6 -3
- package/plugins/runtime-modules/core/widgets/entry-list/server.js +13 -6
- package/plugins/runtime-modules/core/widgets/gallery/config.d.ts +1 -0
- package/plugins/runtime-modules/core/widgets/gallery/plugin.js +1 -1
- package/plugins/runtime-modules/core/widgets/gallery/server.d.ts +5 -3
- package/plugins/runtime-modules/core/widgets/gallery/server.js +8 -6
- package/plugins/runtime-modules/core/widgets/header-navigation/client.js +2 -2
- package/plugins/runtime-modules/core/widgets/html/client.js +1 -1
- package/plugins/runtime-modules/core/widgets/markdown/config.d.ts +320 -2
- package/plugins/runtime-modules/core/widgets/markdown/config.js +18 -4
- package/plugins/runtime-modules/core/widgets/markdown/editor.js +9 -1
- package/plugins/runtime-modules/core/widgets/markdown-toc/client.js +6 -1
- package/plugins/runtime-modules/core/widgets/markdown-toc/config.d.ts +14 -0
- package/plugins/runtime-modules/core/widgets/markdown-toc/config.js +14 -2
- package/plugins/runtime-modules/core/widgets/quick-links/authoring.js +7 -2
- package/plugins/runtime-modules/core/widgets/quick-links/client.js +2 -2
- package/plugins/runtime-modules/core/widgets/quick-links/items.d.ts +0 -2
- package/plugins/runtime-modules/core/widgets/quick-links/items.js +0 -15
- package/plugins/runtime-modules/core/widgets/record/client.d.ts +4 -1
- package/plugins/runtime-modules/core/widgets/record/client.js +8 -3
- package/plugins/runtime-modules/core/widgets/record/plugin.js +3 -2
- package/plugins/runtime-modules/core/widgets/record/server.d.ts +3 -1
- package/plugins/runtime-modules/core/widgets/record/server.js +2 -2
- package/plugins/runtime-modules/core/widgets/result/config.d.ts +1 -0
- package/plugins/runtime-modules/core/widgets/segmented/client.js +1 -1
- package/plugins/runtime-modules/core/widgets/segmented/config.d.ts +21 -1
- package/plugins/runtime-modules/core/widgets/segmented/config.js +11 -1
- package/plugins/runtime-modules/core/widgets/sidebar-navigation/authoring.js +1 -1
- package/plugins/runtime-modules/core/widgets/sidebar-navigation/client.js +1 -1
- package/plugins/runtime-modules/core/widgets/simple-text/client.js +8 -3
- package/plugins/runtime-modules/core/widgets/simple-text/config.d.ts +1 -0
- package/plugins/runtime-modules/core/widgets/simple-text/editor.js +2 -2
- package/plugins/runtime-modules/core/widgets/switch/client.js +1 -1
- package/plugins/runtime-modules/core/widgets/switch/config.d.ts +19 -0
- package/plugins/runtime-modules/core/widgets/switch/config.js +11 -0
- package/plugins/runtime-modules/core/widgets/table/authoring.js +1 -1
- package/plugins/runtime-modules/core/widgets/table/client.d.ts +4 -1
- package/plugins/runtime-modules/core/widgets/table/client.js +16 -3
- package/plugins/runtime-modules/core/widgets/table/config.d.ts +3 -0
- package/plugins/runtime-modules/core/widgets/table/plugin.js +3 -2
- package/plugins/runtime-modules/core/widgets/table/server.d.ts +3 -1
- package/plugins/runtime-modules/core/widgets/table/server.js +2 -2
- package/plugins/runtime-modules/core/widgets/table/static-resource-editor.js +2 -1
- package/plugins/runtime-modules/core/widgets/timeline/authoring.js +1 -1
- package/plugins/runtime-modules/core/widgets/timeline/client.d.ts +1 -3
- package/plugins/runtime-modules/core/widgets/timeline/client.js +14 -4
- package/plugins/runtime-modules/core/widgets/tree/authoring.js +1 -1
- package/plugins/runtime-modules/core/widgets/tree/client.d.ts +4 -1
- package/plugins/runtime-modules/core/widgets/tree/client.js +13 -2
- package/plugins/runtime-modules/core/widgets/tree/plugin.js +3 -2
- package/plugins/runtime-modules/core/widgets/tree/server.d.ts +3 -1
- package/plugins/runtime-modules/core/widgets/tree/server.js +2 -2
- package/plugins/runtime-modules/dashboard/card-rows.d.ts +3 -1
- package/plugins/runtime-modules/dashboard/card-rows.js +30 -2
- package/plugins/runtime-modules/dashboard/clients/dashboard-card-view.js +29 -7
- package/plugins/runtime-modules/dashboard/trees/phi-default-builder-dashboard-page-tree.js +5 -40
- package/plugins/runtime-modules/theme/presets.d.ts +9 -1
- package/plugins/runtime-modules/theme/tour.d.ts +9 -1
- package/plugins/runtime-modules/theme/tour.js +10 -1
- package/plugins/runtime-modules/theme/widgets/brand-controls/client.js +157 -22
- package/plugins/runtime-modules/theme/widgets/brand-controls/config.js +5 -9
- package/runtime-data-provider-client.d.ts +2 -0
- package/runtime-data-provider-client.js +7 -0
- package/server-helpers/cms-link-targets.js +6 -0
- package/styles/controls.css +74 -7
- package/styles/gradients.css +101 -0
- package/styles/layout.css +45 -2
- package/styles/root.css +18 -0
- package/styles/shell.css +137 -0
- package/theme/phi-antd-token-resolver.js +20 -1
- package/theme/phi-button-shadow.d.ts +6 -0
- package/theme/phi-theme-gradients.d.ts +96 -0
- package/theme/phi-theme-gradients.js +245 -0
- package/theme/phi-theme-presets.d.ts +3 -0
- package/theme/phi-theme-presets.js +3 -0
- package/theme/phi-theme-tokens.d.ts +6 -2
- package/theme/phi-theme-tokens.js +15 -0
- package/theme/phi-theme.d.ts +5 -0
- package/theme/phi-theme.js +21 -0
- package/theme/phi-tokens.d.ts +16 -15
- package/theme/phi-tokens.js +16 -15
- package/types/cms-plugins.d.ts +2 -0
- package/types/cms-presets.d.ts +7 -0
- package/types/core-widget-placements.d.ts +3 -0
- package/types/dashboard-cards.d.ts +39 -4
- package/types/dashboard-cards.js +6 -0
- package/types/layout-style.d.ts +9 -8
- package/types/layout-style.js +9 -8
- package/types/site-theme.d.ts +10 -2
- package/types/surface.d.ts +4 -0
- package/types/surface.js +4 -0
- package/types.d.ts +1 -1
- package/types.js +1 -1
|
@@ -3,12 +3,15 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
3
3
|
import { useCallback, useEffect, useMemo, useRef, useState, useSyncExternalStore, } from "react";
|
|
4
4
|
import { usePhiSignalDispatcher, usePhiSignalListener } from "../../../../../components/runtime/runtime-signal-bus";
|
|
5
5
|
import { usePhiSignalIdentity } from "../../../../../components/runtime/runtime-signal-identity";
|
|
6
|
+
import { usePhiVisualAnchorParts } from "../../../../../components/runtime/runtime-visual-anchors";
|
|
7
|
+
import { PHI_VISUAL_ANCHOR_PART_ATTRIBUTE } from "../../../../../types/visual-anchors";
|
|
6
8
|
import { usePhiControlSignalController } from "../../../../../components/widgets/client/shared/phi-control-signals";
|
|
7
9
|
import { PHI_SIGNAL_VALUE_SCHEMAS } from "../../../../../types/signals";
|
|
8
10
|
import { createPhiThemeControllerAddress } from "../../../../../plugins/runtime-modules/theme/controller/address";
|
|
9
11
|
import { PHI_THEME_SIGNAL_CHANNELS } from "../../../../../plugins/runtime-modules/theme/controller/signals";
|
|
10
12
|
import { PHI_THEME_CUSTOM_COLOR_KEYS, isPhiThemePaletteModeSeedKey, mergePhiThemePalettes, resolvePhiThemeColorTokens, } from "../../../../../theme/phi-theme-presets";
|
|
11
13
|
import { buildPhiThemeCustomColorPalette, resolvePhiThemePaletteCustomColors } from "../../../../../theme/phi-theme-palette";
|
|
14
|
+
import { buildPhiThemeGradientTokens, PHI_THEME_GRADIENT_KEYS, readPhiThemeGradient, readPhiThemeGradientTextTone, readPhiThemeGradientKey, resolvePhiThemeGradients, resolvePhiThemeGradientText, resolvePhiThemeGradientContrast, resolvePhiThemeGradientAutoTextTone, resolvePhiThemeGradientInks, PHI_GRADIENT_HOVER_FILTER, } from "../../../../../theme/phi-theme-gradients";
|
|
12
15
|
import { usePhiConfig } from "../../../../../components/root/phi-config-provider";
|
|
13
16
|
import { usePhiThemeBlockCatalog } from "../../../../../components/root/phi-theme-block-catalog-provider";
|
|
14
17
|
import { resolvePhiThemeComposition, resolvePhiThemeEffectiveLogo, resolvePhiThemeEffectiveFonts, resolvePhiThemeEffectiveRoot, } from "../../../../../theme/phi-theme-composition";
|
|
@@ -24,7 +27,7 @@ import { PHI_SPACING_TOKEN_KEYS } from "../../../../../components/widgets/config
|
|
|
24
27
|
import { PhiColorFieldControl } from "../../../../../components/controls/phi-color-field-control";
|
|
25
28
|
import { PhiBrandControl, resolvePhiBrandLogoUrl } from "../../../../../components/controls/phi-brand-control";
|
|
26
29
|
import { PhiBackgroundControl } from "../../../../../components/controls/phi-background-control";
|
|
27
|
-
import { PHI_ROOT_BACKGROUND_IMAGE_SOURCE_KINDS, PHI_ROOT_BACKGROUND_FILTERS, PHI_ROOT_BACKGROUND_MOTION_MODES, resolvePhiRootBackgroundPaintStyle, } from "../../../../../components/root/phi-root-background";
|
|
30
|
+
import { PHI_ROOT_BACKGROUND_BASE_KINDS, PHI_ROOT_BACKGROUND_IMAGE_SOURCE_KINDS, PHI_ROOT_BACKGROUND_FILTERS, PHI_ROOT_BACKGROUND_MOTION_MODES, resolvePhiRootBackgroundPaintStyle, } from "../../../../../components/root/phi-root-background";
|
|
28
31
|
import { PHI_SHELL_CHROME_OVERLAY_BASE_KINDS, PHI_SHELL_CHROME_OVERLAY_FILTERS, PHI_SHELL_CHROME_OVERLAY_IMAGE_SOURCE_KINDS, PHI_SHELL_CHROME_OVERLAY_MOTION_MODES, resolvePhiShellChromeOverlayConfig, resolvePhiShellChromePaneShadow, resolvePhiShellChromePaneShadows, resolvePhiShellChromeOverlayStyle, } from "../../../../../components/root/phi-shell-chrome-overlay";
|
|
29
32
|
import { normalizePhiBackgroundWidgetConfig } from "../../../../../components/widgets/config/background";
|
|
30
33
|
import { PhiMediaPickerBinding } from "../../../../../components/media/phi-media-picker-binding";
|
|
@@ -34,13 +37,12 @@ import { buildPhiMediaAssetContentDeliveryUrl, PhiMediaAssetFlags, PhiMediaKind,
|
|
|
34
37
|
import { createPhiMediaPickerAssetControllerRoutes } from "../../../../../components/media/asset-controller-routes";
|
|
35
38
|
import { PhiPresetSizeControl } from "../../../../../components/controls/phi-preset-size-control";
|
|
36
39
|
import { PhiButtonControl } from "../../../../../components/controls/phi-button-control";
|
|
37
|
-
import { PhiCascaderControl } from "../../../../../components/controls/phi-cascader-control";
|
|
38
40
|
import { PhiCheckboxControl } from "../../../../../components/controls/phi-checkbox-control";
|
|
39
41
|
import { PhiLabeledControl } from "../../../../../components/controls/phi-labeled-control";
|
|
40
42
|
import { PhiNumberControl } from "../../../../../components/controls/phi-number-control";
|
|
41
43
|
import { PhiColorControl } from "../../../../../components/controls/phi-color-control";
|
|
42
|
-
import {
|
|
43
|
-
import {
|
|
44
|
+
import { PhiLinkTargetControl } from "../../../../../components/widgets/client/shared/phi-link-target-control";
|
|
45
|
+
import { usePhiPageReferenceOptions } from "../../../../../components/widgets/client/shared/use-page-reference-options";
|
|
44
46
|
import { PhiShadowControl } from "../../../../../components/controls/phi-shadow-control";
|
|
45
47
|
import { PhiIcon } from "../../../../../components/shell/phi-icon";
|
|
46
48
|
import { PhiIconPickerControl } from "../../../../../components/controls/phi-icon-picker-control";
|
|
@@ -268,6 +270,7 @@ const THEME_COLOR_SEED_SECTIONS = [
|
|
|
268
270
|
/** The Collapse order of the colour panel, which decides which section an author finds open. */
|
|
269
271
|
const BRAND_THEME_COLOR_SECTION_KEYS = [
|
|
270
272
|
"custom",
|
|
273
|
+
"gradients",
|
|
271
274
|
...THEME_COLOR_SEED_SECTIONS.map((section) => section.key),
|
|
272
275
|
];
|
|
273
276
|
/**
|
|
@@ -290,7 +293,7 @@ function withThemePalette(theme, palette) {
|
|
|
290
293
|
function mergeThemePaletteMode(theme, mode, rewrite) {
|
|
291
294
|
const palette = theme.palette ?? {};
|
|
292
295
|
const written = rewrite(palette.modes?.[mode] ?? {});
|
|
293
|
-
const nextMode = Object.fromEntries(["seed", "overrides", "customColors"]
|
|
296
|
+
const nextMode = Object.fromEntries(["seed", "overrides", "customColors", "gradients"]
|
|
294
297
|
.filter((part) => Object.keys(written[part] ?? {}).length > 0)
|
|
295
298
|
.map((part) => [part, written[part]]));
|
|
296
299
|
return withThemePalette(theme, {
|
|
@@ -348,10 +351,28 @@ function mergeThemeButtonShadow(theme, kind, choice) {
|
|
|
348
351
|
if (choice !== "theme") {
|
|
349
352
|
shadow[kind] = choice;
|
|
350
353
|
}
|
|
354
|
+
const { shadow: _previousShadow, ...otherButtons } = theme.buttons ?? {};
|
|
355
|
+
return withThemeButtons(theme, Object.keys(shadow).length > 0 ? { ...otherButtons, shadow } : otherButtons);
|
|
356
|
+
}
|
|
357
|
+
/** The Button settings written back, the `buttons` entry gone when nothing is left in it. */
|
|
358
|
+
function withThemeButtons(theme, buttons) {
|
|
351
359
|
const withoutButtons = omitThemeFields(theme, "buttons");
|
|
352
|
-
return Object.keys(
|
|
353
|
-
|
|
354
|
-
|
|
360
|
+
return Object.keys(buttons).length > 0 ? { ...withoutButtons, buttons } : withoutButtons;
|
|
361
|
+
}
|
|
362
|
+
/** Every primary Button filled with a Theme gradient, or handed back to its one colour. */
|
|
363
|
+
function mergeThemePrimaryButtonGradient(theme, gradient) {
|
|
364
|
+
const { primaryGradient: _previous, ...otherButtons } = theme.buttons ?? {};
|
|
365
|
+
return withThemeButtons(theme, gradient ? { ...otherButtons, primaryGradient: gradient } : otherButtons);
|
|
366
|
+
}
|
|
367
|
+
/** One gradient slot stated for the mode being edited, or handed back to the derived run with `null`. */
|
|
368
|
+
function mergeThemeGradient(theme, key, gradient, mode) {
|
|
369
|
+
return mergeThemePaletteMode(theme, mode, (current) => {
|
|
370
|
+
const gradients = { ...(current.gradients ?? {}) };
|
|
371
|
+
delete gradients[key];
|
|
372
|
+
if (gradient)
|
|
373
|
+
gradients[key] = gradient;
|
|
374
|
+
return { ...current, gradients };
|
|
375
|
+
});
|
|
355
376
|
}
|
|
356
377
|
/** A structural token the author set, laid over the style block under `style.token`. */
|
|
357
378
|
function mergeThemeToken(theme, tokenPatch) {
|
|
@@ -506,13 +527,22 @@ function readAliasTokenNumber(token, key) {
|
|
|
506
527
|
}
|
|
507
528
|
/** A draft's alias tokens for one mode, its blocks folded in, as the live render resolves a Theme. */
|
|
508
529
|
function resolveBrandDraftAliasTokens(resolvedTheme, preset, mode, fonts = {}) {
|
|
509
|
-
|
|
530
|
+
const aliasTokens = resolvePhiAntdAliasTokens(mode, {
|
|
510
531
|
...buildPhiEffectiveNonColorThemeTokens(resolvedTheme),
|
|
511
532
|
...resolvePhiThemeColorTokens(preset, resolvedTheme.palette, mode),
|
|
512
533
|
...(resolvedTheme.style?.token ?? {}),
|
|
513
534
|
...(fonts.body ? { fontFamily: fonts.body } : {}),
|
|
514
535
|
...(fonts.mono ? { fontFamilyCode: fonts.mono } : {}),
|
|
515
536
|
});
|
|
537
|
+
// The gradient slots and the primary Buttons' run, as the root lays them over its tokens.
|
|
538
|
+
return {
|
|
539
|
+
...aliasTokens,
|
|
540
|
+
...buildPhiThemeGradientTokens({
|
|
541
|
+
gradients: mergePhiThemePalettes(preset.palette, resolvedTheme.palette).modes?.[mode]?.gradients,
|
|
542
|
+
token: aliasTokens,
|
|
543
|
+
primaryButtonGradient: readPhiThemeGradientKey(resolvedTheme.buttons?.primaryGradient),
|
|
544
|
+
}),
|
|
545
|
+
};
|
|
516
546
|
}
|
|
517
547
|
function readEffectiveTokenNumber(token, key, fallback) {
|
|
518
548
|
const value = token[key];
|
|
@@ -1014,10 +1044,15 @@ function resolveThemeFontSlots(theme, fonts, block) {
|
|
|
1014
1044
|
?? "",
|
|
1015
1045
|
}));
|
|
1016
1046
|
}
|
|
1047
|
+
/** The parts of the colour panel a Tour may point at. */
|
|
1048
|
+
const PHI_BRAND_THEME_CONTROLS_ANCHOR_PARTS = ["gradients"];
|
|
1017
1049
|
export function PhiBuilderBrandThemeControlsWidgetClient({ runtime, config, colorPickerLabels, }) {
|
|
1018
1050
|
const { presets: themePresets, token: clientToken } = usePhiConfig();
|
|
1019
1051
|
const themeBlocks = usePhiThemeBlockCatalog();
|
|
1020
1052
|
const sectionLabelWidth = clientToken.controlHeight * 3;
|
|
1053
|
+
// The Gradients section is a part a Tour can point at (`cms:<id>:gradients`, theme/tour.ts).
|
|
1054
|
+
const anchorAddress = usePhiSignalIdentity().receiver ?? null;
|
|
1055
|
+
usePhiVisualAnchorParts(anchorAddress?.startsWith("cms:") ? anchorAddress : null, PHI_BRAND_THEME_CONTROLS_ANCHOR_PARTS);
|
|
1021
1056
|
const colorControlWidth = clientToken.controlHeight * 5.5;
|
|
1022
1057
|
const themeKey = resolveThemeKey(config);
|
|
1023
1058
|
const { state, draftRef, publishDraft, pickerTransaction } = usePhiBrandThemeDraft(runtime, themeKey);
|
|
@@ -1032,7 +1067,7 @@ export function PhiBuilderBrandThemeControlsWidgetClient({ runtime, config, colo
|
|
|
1032
1067
|
* then redrew. Kept until the draft, the mode, the blocks or the presets change.
|
|
1033
1068
|
*/
|
|
1034
1069
|
const customLabel = colorPickerLabels?.custom ?? "Custom";
|
|
1035
|
-
const { themeComposition, selectedPreset, colorToken, ownPalette, ownOverrides, customPalette, customColorOptions, computedToken, } = useMemo(() => {
|
|
1070
|
+
const { themeComposition, selectedPreset, colorToken, ownPalette, ownOverrides, customPalette, customColorOptions, computedToken, gradients, gradientInks, ownGradients, } = useMemo(() => {
|
|
1036
1071
|
const themeComposition = resolvePhiThemeComposition(state.draft, themeBlocks);
|
|
1037
1072
|
const selectedPreset = resolveThemePayloadPreset(state.draft, themePresets);
|
|
1038
1073
|
/*
|
|
@@ -1061,6 +1096,15 @@ export function PhiBuilderBrandThemeControlsWidgetClient({ runtime, config, colo
|
|
|
1061
1096
|
...buildPhiEffectiveNonColorThemeTokens(state.draft),
|
|
1062
1097
|
...baseColorToken,
|
|
1063
1098
|
});
|
|
1099
|
+
/*
|
|
1100
|
+
* The gradient slots as the Site draws them: stated by the palette block or the draft, else derived
|
|
1101
|
+
* from the mode's colours as they resolve WITH the author's overrides -- what the root derives from.
|
|
1102
|
+
*/
|
|
1103
|
+
const gradientToken = resolvePhiAntdAliasTokens(previewMode, { ...buildPhiEffectiveNonColorThemeTokens(state.draft), ...colorToken });
|
|
1104
|
+
const gradients = resolvePhiThemeGradients(mergePhiThemePalettes(selectedPreset.palette, state.draft.palette).modes?.[previewMode]?.gradients, gradientToken);
|
|
1105
|
+
// The Theme's two text colours in this mode, which the words on a run are chosen from.
|
|
1106
|
+
const gradientInks = resolvePhiThemeGradientInks(gradientToken);
|
|
1107
|
+
const ownGradients = ownPalette.modes?.[previewMode]?.gradients ?? {};
|
|
1064
1108
|
return {
|
|
1065
1109
|
themeComposition,
|
|
1066
1110
|
selectedPreset,
|
|
@@ -1070,6 +1114,9 @@ export function PhiBuilderBrandThemeControlsWidgetClient({ runtime, config, colo
|
|
|
1070
1114
|
customPalette,
|
|
1071
1115
|
customColorOptions,
|
|
1072
1116
|
computedToken,
|
|
1117
|
+
gradients,
|
|
1118
|
+
gradientInks,
|
|
1119
|
+
ownGradients,
|
|
1073
1120
|
};
|
|
1074
1121
|
}, [customLabel, previewMode, state.draft, themeBlocks, themePresets]);
|
|
1075
1122
|
return (_jsx(PhiFlexControl, { vertical: true, gap: clientToken.padding, style: { width: "100%", minWidth: 0, opacity: loading ? 0.65 : 1 }, children: _jsx(PhiCardControl, { size: "small", children: _jsxs(PhiFlexControl, { vertical: true, gap: clientToken.paddingSM, children: [_jsx(PhiBrandBlockPicker, { label: "Palette", value: themeComposition.palette.key, unavailable: themeComposition.unavailable.palette, options: themeBlocks.palettes, onChange: (key) => {
|
|
@@ -1100,6 +1147,86 @@ export function PhiBuilderBrandThemeControlsWidgetClient({ runtime, config, colo
|
|
|
1100
1147
|
publishDraft(mergeThemeCustomColors(state.draft, { [tokenKey]: value }, previewMode));
|
|
1101
1148
|
} }) }, item.key))) })),
|
|
1102
1149
|
},
|
|
1150
|
+
{
|
|
1151
|
+
key: "gradients",
|
|
1152
|
+
label: (_jsxs(PhiFlexControl, { align: "center", gap: clientToken.paddingSM, wrap: "wrap", style: { minWidth: 0 }, [PHI_VISUAL_ANCHOR_PART_ATTRIBUTE]: "gradients", children: [_jsx(PhiTypographyControl, { strong: true, style: { width: sectionLabelWidth }, children: "Gradients" }), _jsx(PhiFlexControl, { gap: clientToken.paddingXXS, "aria-hidden": true, children: PHI_THEME_GRADIENT_KEYS.map((key) => (_jsx("span", { style: {
|
|
1153
|
+
width: clientToken.controlHeightSM * 1.5,
|
|
1154
|
+
height: clientToken.controlHeightSM,
|
|
1155
|
+
borderRadius: clientToken.borderRadiusSM,
|
|
1156
|
+
background: `linear-gradient(${gradients[key].direction}, ${gradients[key].stops
|
|
1157
|
+
.map((stop) => `${stop.color} ${stop.percent}%`).join(", ")})`,
|
|
1158
|
+
} }, key))) })] })),
|
|
1159
|
+
children: (_jsxs(PhiFlexControl, { vertical: true, gap: clientToken.padding, children: [_jsxs(PhiTypographyControl, { type: "secondary", children: ["Three runs Buttons, badges, tags and switches can be filled with. ", previewMode === "dark" ? "Dark" : "Light", " mode; a slot left alone follows the palette's colours."] }), PHI_THEME_GRADIENT_KEYS.map((key, index) => {
|
|
1160
|
+
const gradient = gradients[key];
|
|
1161
|
+
// The run the author stated, and the text tone they chose -- either may stand alone.
|
|
1162
|
+
const own = readPhiThemeGradient(ownGradients[key]);
|
|
1163
|
+
const ownTone = readPhiThemeGradientTextTone(ownGradients[key]);
|
|
1164
|
+
const text = resolvePhiThemeGradientText(gradient, gradientInks);
|
|
1165
|
+
const contrast = resolvePhiThemeGradientContrast(gradient, text);
|
|
1166
|
+
const tone = gradient.text ?? resolvePhiThemeGradientAutoTextTone(gradient, gradientInks);
|
|
1167
|
+
const otherTone = tone === "light" ? "dark" : "light";
|
|
1168
|
+
// Neither of the Theme's text colours reads: then the run itself is what has to change.
|
|
1169
|
+
const otherContrast = resolvePhiThemeGradientContrast(gradient, gradientInks[otherTone]);
|
|
1170
|
+
const neitherReads = otherContrast != null && otherContrast.ratio < 4.5;
|
|
1171
|
+
/*
|
|
1172
|
+
* An error where the author's choice is what reads poorly: a run they stated, or a text
|
|
1173
|
+
* colour they chose while the other one would read. Otherwise the palette's colours are
|
|
1174
|
+
* what falls short, and it is a hint.
|
|
1175
|
+
*/
|
|
1176
|
+
const contrastLevel = own || (ownTone && !neitherReads) ? "error" : "info";
|
|
1177
|
+
const paint = `linear-gradient(${gradient.direction}, ${gradient.stops
|
|
1178
|
+
.map((stop) => `${stop.color} ${stop.percent}%`).join(", ")})`;
|
|
1179
|
+
return (_jsxs(PhiFlexControl, { vertical: true, gap: clientToken.paddingXS, children: [_jsxs(PhiFlexControl, { align: "center", justify: "space-between", gap: clientToken.paddingXS, children: [_jsx(PhiTypographyControl, { strong: true, children: `Gradient ${index + 1}` }), own || ownTone ? (_jsx(PhiButtonControl, { size: "small", type: "link", disabled: saving, style: { paddingInline: 0, height: clientToken.controlHeightSM }, onClick: () => publishDraft(mergeThemeGradient(draftRef.current, key, null, previewMode)), label: "Reset to palette" })) : null] }), _jsxs(PhiFlexControl, { align: "center", gap: clientToken.paddingSM, wrap: "wrap", "aria-hidden": true, children: [[false, true].map((hover) => (_jsx("span", { style: {
|
|
1180
|
+
display: "inline-flex",
|
|
1181
|
+
alignItems: "center",
|
|
1182
|
+
height: clientToken.controlHeight,
|
|
1183
|
+
paddingInline: clientToken.padding,
|
|
1184
|
+
borderRadius: 999,
|
|
1185
|
+
background: paint,
|
|
1186
|
+
color: text,
|
|
1187
|
+
fontSize: clientToken.fontSize,
|
|
1188
|
+
fontWeight: 600,
|
|
1189
|
+
whiteSpace: "nowrap",
|
|
1190
|
+
...(hover ? { filter: PHI_GRADIENT_HOVER_FILTER } : {}),
|
|
1191
|
+
}, children: hover ? "Hover" : `Gradient ${index + 1}` }, hover ? "hover" : "rest"))), _jsx("span", { style: {
|
|
1192
|
+
display: "inline-flex",
|
|
1193
|
+
alignItems: "center",
|
|
1194
|
+
paddingInline: clientToken.paddingXS,
|
|
1195
|
+
borderRadius: clientToken.borderRadiusSM,
|
|
1196
|
+
background: paint,
|
|
1197
|
+
color: text,
|
|
1198
|
+
fontSize: clientToken.fontSizeSM,
|
|
1199
|
+
fontWeight: 600,
|
|
1200
|
+
lineHeight: 2,
|
|
1201
|
+
}, children: "Badge" })] }), _jsx(PhiBackgroundControl, { value: normalizePhiBackgroundWidgetConfig({
|
|
1202
|
+
base: { kind: "gradient", direction: gradient.direction, stops: gradient.stops },
|
|
1203
|
+
}), baseKinds: ["gradient"], overlay: false, filters: [], motionModes: [], imageSourceKinds: [], disabled: saving, onChange: (value) => {
|
|
1204
|
+
const base = normalizePhiBackgroundWidgetConfig(value).base;
|
|
1205
|
+
if (base.kind !== "gradient")
|
|
1206
|
+
return;
|
|
1207
|
+
publishDraft(mergeThemeGradient(draftRef.current, key, { direction: base.direction, stops: base.stops, ...(ownTone ? { text: ownTone } : {}) }, previewMode));
|
|
1208
|
+
} }, `${key}-${previewMode}`), _jsxs(PhiFlexControl, { vertical: true, gap: clientToken.paddingXXS, children: [_jsx(PhiTypographyControl, { type: "secondary", children: "Label colour" }), _jsx(PhiSegmentedControl, { block: true, disabled: saving, value: ownTone ?? "auto", options: [
|
|
1209
|
+
{ value: "auto", label: "Automatic" },
|
|
1210
|
+
{ value: "light", label: "Light text" },
|
|
1211
|
+
{ value: "dark", label: "Dark text" },
|
|
1212
|
+
], onChange: (next) => {
|
|
1213
|
+
// Only the words change: a run the author stated stays theirs, a derived one stays derived.
|
|
1214
|
+
const run = own ? { direction: own.direction, stops: own.stops } : null;
|
|
1215
|
+
const slot = next === "auto"
|
|
1216
|
+
? run
|
|
1217
|
+
: run ? { ...run, text: next } : { text: next };
|
|
1218
|
+
publishDraft(mergeThemeGradient(draftRef.current, key, slot, previewMode));
|
|
1219
|
+
} })] }), contrast != null && contrast.ratio < 4.5 ? (_jsx(PhiAlertControl, { showIcon: true, level: contrastLevel,
|
|
1220
|
+
// Small: a note beside a setting in a narrow panel, not a page's message.
|
|
1221
|
+
title: (_jsx("span", { style: { display: "block", fontSize: clientToken.fontSize, fontWeight: 600, lineHeight: 1.4 }, children: `Label contrast ${contrast.ratio.toFixed(1)}:1 at stop ${contrast.stopIndex + 1} (${contrast.color})${contrast.hover ? " under the pointer" : ""}.` })), description: (_jsx("span", { style: { display: "block", fontSize: clientToken.fontSizeSM, lineHeight: 1.45 }, children: [
|
|
1222
|
+
own ? null : "This run is derived from the palette's colours.",
|
|
1223
|
+
"Labels on Buttons, badges and tags need 4.5:1 to read reliably.",
|
|
1224
|
+
neitherReads
|
|
1225
|
+
? "Neither of the Theme's text colours reaches it here: make the run's stops lighter or darker."
|
|
1226
|
+
: `The ${otherTone} text reads better: choose it, or move the stops away from the ${tone} text.`,
|
|
1227
|
+
].filter(Boolean).join(" ") })) })) : null] }, key));
|
|
1228
|
+
})] })),
|
|
1229
|
+
},
|
|
1103
1230
|
...THEME_COLOR_SEED_SECTIONS.map((section) => {
|
|
1104
1231
|
const seedAuthored = Object.prototype.hasOwnProperty.call(ownPalette.seed ?? {}, section.key) ||
|
|
1105
1232
|
Object.prototype.hasOwnProperty.call(ownPalette.modes?.[previewMode]?.seed ?? {}, section.key);
|
|
@@ -1230,7 +1357,10 @@ export function PhiBuilderBrandStyleControlsWidgetClient({ runtime, config, }) {
|
|
|
1230
1357
|
{
|
|
1231
1358
|
key: "buttonShadow",
|
|
1232
1359
|
label: _jsx(PhiTypographyControl, { strong: true, children: "Button Shadow" }),
|
|
1233
|
-
children: (_jsxs(PhiFlexControl, { vertical: true, gap: clientToken.paddingSM, children: [_jsx(PhiTypographyControl, { type: "secondary", children: "Under each kind of Button. Theme keeps the tinted line; applies to both modes." }), PHI_THEME_BUTTON_SHADOW_KINDS.map((item) => (_jsx(PhiSegmentedControl, { label: item.label, value: readThemeButtonShadowChoice(state.draft, item.key), options: PHI_THEME_BUTTON_SHADOW_OPTIONS, block: true, disabled: saving, onChange: (choice) => publishDraft(mergeThemeButtonShadow(state.draft, item.key, choice)) }, item.key)))
|
|
1360
|
+
children: (_jsxs(PhiFlexControl, { vertical: true, gap: clientToken.paddingSM, children: [_jsx(PhiTypographyControl, { type: "secondary", children: "Under each kind of Button. Theme keeps the tinted line; applies to both modes." }), PHI_THEME_BUTTON_SHADOW_KINDS.map((item) => (_jsx(PhiSegmentedControl, { label: item.label, value: readThemeButtonShadowChoice(state.draft, item.key), options: PHI_THEME_BUTTON_SHADOW_OPTIONS, block: true, disabled: saving, onChange: (choice) => publishDraft(mergeThemeButtonShadow(state.draft, item.key, choice)) }, item.key))), _jsx(PhiDividerControl, { style: { marginBlock: 0 } }), _jsx(PhiTypographyControl, { type: "secondary", children: "Fills every primary Button with one of the Theme's gradients (Color tab). A Button can still choose its own with the Gradient variant." }), _jsx(PhiSelectControl, { label: "Primary fill", value: readPhiThemeGradientKey(state.draft.buttons?.primaryGradient) ?? "none", options: [
|
|
1361
|
+
{ value: "none", label: "Colour" },
|
|
1362
|
+
...PHI_THEME_GRADIENT_KEYS.map((key, index) => ({ value: key, label: `Gradient ${index + 1}` })),
|
|
1363
|
+
], disabled: saving, onChange: (choice) => publishDraft(mergeThemePrimaryButtonGradient(state.draft, choice === "none" ? null : choice)) })] })),
|
|
1234
1364
|
},
|
|
1235
1365
|
{
|
|
1236
1366
|
key: "radius",
|
|
@@ -1476,13 +1606,11 @@ export function PhiBuilderBrandIdentityControlsWidgetClient({ runtime, config, }
|
|
|
1476
1606
|
*/
|
|
1477
1607
|
const fallbackWordmark = runtime.site.name ?? runtime.site.key;
|
|
1478
1608
|
/*
|
|
1479
|
-
* The Pages of the public Area, from the
|
|
1480
|
-
*
|
|
1481
|
-
*
|
|
1609
|
+
* The Pages of the public Area as references, from the list every link picker outside the Builder's
|
|
1610
|
+
* own catalog reads (`/api/site/page-references`). The Brand leads into the public Area wherever it
|
|
1611
|
+
* is drawn, so that is the Area written into the target.
|
|
1482
1612
|
*/
|
|
1483
|
-
const { options:
|
|
1484
|
-
optionsProvider: { providerKey: PHI_AUTHORING_OPTION_PROVIDER_KEYS.pages },
|
|
1485
|
-
});
|
|
1613
|
+
const { options: homePageOptions, failed: homePagesFailed } = usePhiPageReferenceOptions("public", "phi-theme-brand");
|
|
1486
1614
|
function updateWordmarkPart(index, patch) {
|
|
1487
1615
|
publishDraft(mergeThemeWordmarkParts(state.draft, editableWordmarkParts.map((part, at) => (at === index ? { ...part, ...patch } : part))));
|
|
1488
1616
|
}
|
|
@@ -1506,7 +1634,7 @@ export function PhiBuilderBrandIdentityControlsWidgetClient({ runtime, config, }
|
|
|
1506
1634
|
backgroundSize: "contain",
|
|
1507
1635
|
backgroundRepeat: "no-repeat",
|
|
1508
1636
|
backgroundPosition: "left center",
|
|
1509
|
-
} })) : (_jsx(PhiTypographyControl, { type: "secondary", style: { color: readAliasTokenString(logoGroundToken, "colorTextTertiary") }, children: "No Logo" })) }), _jsxs(PhiFlexControl, { align: "
|
|
1637
|
+
} })) : (_jsx(PhiTypographyControl, { type: "secondary", style: { color: readAliasTokenString(logoGroundToken, "colorTextTertiary") }, children: "No Logo" })) }), _jsxs(PhiFlexControl, { vertical: true, align: "stretch", gap: clientToken.paddingXXS, style: { flexShrink: 0 }, children: [_jsx(PhiBrandBlockResetButton, { disabled: brand.logo?.[mode] == null, blockTitle: markSet.title, onReset: () => publishDraft(mergeThemeBrandLogo(state.draft, mode, undefined)) }), _jsx(PhiBrandCopyModeButton, { mode: mode, disabled: JSON.stringify(logo) === JSON.stringify(logos[otherMode] ?? null), onCopy: () => publishDraft(mergeThemeBrandLogo(state.draft, otherMode, logo ?? { sourceKind: "none" })) })] })] }), _jsx(PhiMediaPickerBinding, { config: {
|
|
1510
1638
|
mediaType: PhiMediaKind.Image,
|
|
1511
1639
|
pageSize: 12,
|
|
1512
1640
|
showPagination: true,
|
|
@@ -1530,8 +1658,15 @@ export function PhiBuilderBrandIdentityControlsWidgetClient({ runtime, config, }
|
|
|
1530
1658
|
})) }) }), _jsx(PhiLabeledControl, { label: "Offset", fill: true, children: _jsx(PhiNumberControl, { prefix: "px", style: { width: "100%" }, value: brand.logoYOffset ?? 0, step: 1, min: -16, max: 16, onChange: (next) => publishDraft(mergeThemeBrand(state.draft, {
|
|
1531
1659
|
// No offset is no key, the way `Forward` spells its default away below.
|
|
1532
1660
|
logoYOffset: next ? next : null,
|
|
1533
|
-
})) }) }), _jsx(PhiLabeledControl, { label: "Forward", fill: true, children: _jsx(
|
|
1534
|
-
|
|
1661
|
+
})) }) }), _jsx(PhiLabeledControl, { label: "Forward", fill: true, children: _jsx(PhiLinkTargetControl, { value: brand.homeLinkTarget, options: homePageOptions, area: "public", labels: {
|
|
1662
|
+
none: "Site root",
|
|
1663
|
+
page: "Page",
|
|
1664
|
+
external: "Address",
|
|
1665
|
+
pagePlaceholder: homePagesFailed ? "The Pages could not be loaded." : "Select a Page",
|
|
1666
|
+
externalPlaceholder: "https://example.com",
|
|
1667
|
+
newTab: "Open in a new tab",
|
|
1668
|
+
}, onChange: (next) => publishDraft(mergeThemeBrand(state.draft, {
|
|
1669
|
+
homeLinkTarget: next ?? null,
|
|
1535
1670
|
})) }) })] })] })),
|
|
1536
1671
|
},
|
|
1537
1672
|
{
|
|
@@ -1611,12 +1746,12 @@ export function PhiBuilderBrandBackgroundControlsWidgetClient({ runtime, config,
|
|
|
1611
1746
|
{
|
|
1612
1747
|
key: "root",
|
|
1613
1748
|
label: _jsx(PhiTypographyControl, { strong: true, children: "Root Background" }),
|
|
1614
|
-
children: (_jsxs(PhiFlexControl, { vertical: true, gap: clientToken.paddingXS, children: [_jsxs(PhiFlexControl, { align: "center", justify: "space-between", gap: clientToken.paddingXS, children: [_jsxs(PhiTypographyControl, { type: "secondary", children: [modeLabel, ". One layer behind the whole Site, fixed to the viewport."] }), _jsxs(PhiFlexControl, { align: "
|
|
1749
|
+
children: (_jsxs(PhiFlexControl, { vertical: true, gap: clientToken.paddingXS, children: [_jsxs(PhiFlexControl, { align: "center", justify: "space-between", gap: clientToken.paddingXS, children: [_jsxs(PhiTypographyControl, { type: "secondary", children: [modeLabel, ". One layer behind the whole Site, fixed to the viewport."] }), _jsxs(PhiFlexControl, { vertical: true, align: "stretch", gap: clientToken.paddingXXS, style: { flexShrink: 0 }, children: [_jsx(PhiBrandBlockResetButton, { disabled: state.draft.root?.background?.[mode] == null, blockTitle: composition.ground.title, onReset: () => publishDraft(clearThemeRootSurface(state.draft, "background", mode)) }), _jsx(PhiBrandCopyModeButton, { mode: mode, disabled: isSamePhiBackgroundConfig(rootBackground, otherRootBackground), onCopy: () => publishDraft(mergeThemeRootSurface(state.draft, "background", otherMode, rootBackground)) })] })] }), _jsx(PhiBackgroundControl, { value: rootBackground, motionModes: PHI_ROOT_BACKGROUND_MOTION_MODES, filters: PHI_ROOT_BACKGROUND_FILTERS, baseKinds: PHI_ROOT_BACKGROUND_BASE_KINDS, imageSourceKinds: PHI_ROOT_BACKGROUND_IMAGE_SOURCE_KINDS, renderMediaPicker: renderPhiThemeRootBackgroundMediaPicker, editTransaction: editTransaction, onChange: (value) => publishDraft(mergeThemeRootSurface(state.draft, "background", mode, value)) }, mode)] })),
|
|
1615
1750
|
},
|
|
1616
1751
|
{
|
|
1617
1752
|
key: "chrome",
|
|
1618
1753
|
label: _jsx(PhiTypographyControl, { strong: true, children: "Chrome Overlay" }),
|
|
1619
|
-
children: (_jsxs(PhiFlexControl, { vertical: true, gap: clientToken.paddingXS, children: [_jsxs(PhiFlexControl, { align: "center", justify: "space-between", gap: clientToken.paddingXS, children: [_jsxs(PhiTypographyControl, { type: "secondary", children: [modeLabel, ". Shared by the Header, Sider and Footer Regions. Content and Hero never take it, and a Region that authors its own Background or Effect paints over it."] }), _jsxs(PhiFlexControl, { align: "
|
|
1754
|
+
children: (_jsxs(PhiFlexControl, { vertical: true, gap: clientToken.paddingXS, children: [_jsxs(PhiFlexControl, { align: "center", justify: "space-between", gap: clientToken.paddingXS, children: [_jsxs(PhiTypographyControl, { type: "secondary", children: [modeLabel, ". Shared by the Header, Sider and Footer Regions. Content and Hero never take it, and a Region that authors its own Background or Effect paints over it."] }), _jsxs(PhiFlexControl, { vertical: true, align: "stretch", gap: clientToken.paddingXXS, style: { flexShrink: 0 }, children: [_jsx(PhiBrandBlockResetButton, { disabled: state.draft.root?.chrome?.[mode] == null, blockTitle: composition.ground.title, onReset: () => publishDraft(clearThemeRootSurface(state.draft, "chrome", mode)) }), _jsx(PhiBrandCopyModeButton, { mode: mode, disabled: isSamePhiBackgroundConfig(chromeOverlay, otherChromeOverlay), onCopy: () => publishDraft(mergeThemeRootSurface(state.draft, "chrome", otherMode, chromeOverlay)) })] })] }), _jsx(PhiBackgroundControl, { value: chromeOverlay, motionModes: PHI_SHELL_CHROME_OVERLAY_MOTION_MODES, filters: PHI_SHELL_CHROME_OVERLAY_FILTERS, baseKinds: PHI_SHELL_CHROME_OVERLAY_BASE_KINDS, imageSourceKinds: PHI_SHELL_CHROME_OVERLAY_IMAGE_SOURCE_KINDS, renderMediaPicker: renderPhiThemeRootBackgroundMediaPicker, editTransaction: editTransaction, onChange: (value) => publishDraft(mergeThemeRootSurface(state.draft, "chrome", mode, value)) }, `chrome-${mode}`)] })),
|
|
1620
1755
|
},
|
|
1621
1756
|
{
|
|
1622
1757
|
key: "shadow",
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { isPhiCmsAreaKey, } from "../../../../../constants/cms-areas";
|
|
2
2
|
import { PHI_MEDIA_LIBRARY_DATA_PROVIDER_KEYS } from "../../../../../constants/media-library-provider-keys";
|
|
3
|
-
import { PHI_AUTHORING_OPTION_PROVIDER_KEYS } from "../../../../../constants/authoring-option-provider-keys";
|
|
4
3
|
import { PHI_THEME_SIGNAL_CHANNELS } from "../../../../../plugins/runtime-modules/theme/controller/signals";
|
|
5
4
|
import { createPhiCmsWidgetDefinition } from "../../../../../components/widgets/config/helpers";
|
|
6
5
|
import { readString } from "../../../../../components/widgets/config/parser-primitives";
|
|
@@ -52,15 +51,12 @@ export const PHI_BUILDER_BRAND_IDENTITY_CONTROLS_WIDGET_DEFINITION = createPhiCm
|
|
|
52
51
|
iconFamily: "theme",
|
|
53
52
|
slotSizePolicy: "fill-inline",
|
|
54
53
|
/*
|
|
55
|
-
* The Logo is picked from the Media library and
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
*
|
|
54
|
+
* The Logo is picked from the Media library, and a Page mounts only the Data Providers its tree asks
|
|
55
|
+
* for. The scan reads this declaration; a Provider a Widget reaches for from inside its client code is
|
|
56
|
+
* invisible to it. Same reason the Background panel declares its own. The Brand's link needs none: its
|
|
57
|
+
* Pages come from `/api/site/page-references`, as every link picker's outside the Builder catalog do.
|
|
59
58
|
*/
|
|
60
|
-
requiredDataProviders: [
|
|
61
|
-
PHI_MEDIA_LIBRARY_DATA_PROVIDER_KEYS.collection,
|
|
62
|
-
PHI_AUTHORING_OPTION_PROVIDER_KEYS.pages,
|
|
63
|
-
],
|
|
59
|
+
requiredDataProviders: [PHI_MEDIA_LIBRARY_DATA_PROVIDER_KEYS.collection],
|
|
64
60
|
runtimeSignals: PHI_BUILDER_BRAND_PREVIEW_MODE_SIGNALS,
|
|
65
61
|
fields: [
|
|
66
62
|
{ key: "themeKey", type: "string", label: "Theme Key" },
|
|
@@ -20,3 +20,5 @@ export { PhiCardCollectionViewBinding, } from "./plugins/runtime-modules/core/wi
|
|
|
20
20
|
export { createPhiRuntimeModuleDataProviderClientManifest, extendPhiRuntimeModuleDataProviderClientManifest, PhiRuntimeModuleDataProviderClientManifestProvider, } from "./components/runtime/runtime-module-data-provider-client-manifest";
|
|
21
21
|
export type { PhiRuntimeModuleDataProviderClientManifest, } from "./components/runtime/runtime-module-data-provider-client-manifest";
|
|
22
22
|
export type { PhiRuntimeModuleDataProviderClientProps, PhiRuntimeModuleDataProviderClientDefinition, PhiRuntimeModuleDataProviderDescriptor, } from "./types/cms-plugins";
|
|
23
|
+
export { PhiWidgetFailure } from "./components/widgets/shared/widget-failure-client";
|
|
24
|
+
export type { PhiWidgetFailureProps } from "./components/widgets/shared/widget-failure";
|
|
@@ -18,3 +18,10 @@ export { createPhiCollectionProviderClient, PhiCollectionProviderClient, usePhiC
|
|
|
18
18
|
*/
|
|
19
19
|
export { PhiCardCollectionViewBinding, } from "./plugins/runtime-modules/core/widgets/card/collection-view-binding";
|
|
20
20
|
export { createPhiRuntimeModuleDataProviderClientManifest, extendPhiRuntimeModuleDataProviderClientManifest, PhiRuntimeModuleDataProviderClientManifestProvider, } from "./components/runtime/runtime-module-data-provider-client-manifest";
|
|
21
|
+
/*
|
|
22
|
+
* What a Widget bound to one of these Providers renders when the binding cannot be served in the browser
|
|
23
|
+
* -- the Area does not offer the Provider, a read failed after hydration: the error card in the Builder,
|
|
24
|
+
* nothing on a live page, one `cms.widget.unavailable` warning per distinct failure. The Server twin,
|
|
25
|
+
* `PhiWidgetFailureServer`, is Server-only and lives in `@phis/ui/module/records`.
|
|
26
|
+
*/
|
|
27
|
+
export { PhiWidgetFailure } from "./components/widgets/shared/widget-failure-client";
|
|
@@ -21,6 +21,12 @@ export async function resolvePhiCmsTreeLinkTargets(tree, runtime) {
|
|
|
21
21
|
for (const node of [...tree.regions, ...tree.overlays, ...tree.layoutNodes, ...tree.contentWidgets]) {
|
|
22
22
|
collectPhiLinkTargetReferences(node.config, references);
|
|
23
23
|
}
|
|
24
|
+
/*
|
|
25
|
+
* And the Brand's, which is the Site's and not any node's (THEME.md "Brand"): the Brand Widget leads
|
|
26
|
+
* where the Theme says, and that target resolves with the rest of the page rather than in a round
|
|
27
|
+
* trip of its own per Brand drawn -- a header and a footer would be two.
|
|
28
|
+
*/
|
|
29
|
+
collectPhiLinkTargetReferences(runtime.site.theme?.brand, references);
|
|
24
30
|
return resolvePhiLinkTargetReferences(references, runtime);
|
|
25
31
|
}
|
|
26
32
|
/**
|
package/styles/controls.css
CHANGED
|
@@ -400,17 +400,22 @@ h5.phi-typography, .phi-typography h5 {
|
|
|
400
400
|
/* --- Dropdown ------------------------------------------------------------------------------------ */
|
|
401
401
|
|
|
402
402
|
/*
|
|
403
|
-
* The shared pill trigger: a bordered
|
|
404
|
-
* state,
|
|
403
|
+
* The shared pill trigger: a bordered label that reacts to hover. Hover is a CSS state, not React
|
|
404
|
+
* state, so a trigger never re-renders to change its own border colour.
|
|
405
|
+
*
|
|
406
|
+
* Its corner, its line and its air are the Theme's: the small Control's radius from the Style's control
|
|
407
|
+
* shape (a capsule under `pill`, a sharp box under `square`, the small step of the scale otherwise), the
|
|
408
|
+
* Theme's line width, and the spacing scale -- so it stands beside the header's buttons as one of them
|
|
409
|
+
* rather than as the one round thing a square Theme left behind.
|
|
405
410
|
*/
|
|
406
411
|
.phi-dropdown-control__pill {
|
|
407
412
|
display: inline-flex;
|
|
408
413
|
align-items: center;
|
|
409
414
|
justify-content: center;
|
|
410
415
|
min-width: 3.5rem;
|
|
411
|
-
padding:
|
|
412
|
-
border:
|
|
413
|
-
border-radius:
|
|
416
|
+
padding: var(--ant-padding-xxs) var(--ant-padding-sm);
|
|
417
|
+
border: var(--ant-line-width) solid var(--ant-color-border);
|
|
418
|
+
border-radius: var(--phi-control-radius-sm);
|
|
414
419
|
color: inherit;
|
|
415
420
|
font-size: inherit;
|
|
416
421
|
line-height: 1;
|
|
@@ -501,6 +506,18 @@ h5.phi-typography, .phi-typography h5 {
|
|
|
501
506
|
top: var(--phi-table-sticky-top, var(--phi-shell-sticky-top, 0px)) !important;
|
|
502
507
|
}
|
|
503
508
|
|
|
509
|
+
/*
|
|
510
|
+
* A sticky header row is a table of its own, and its columns are the body's: Ant Design measures the
|
|
511
|
+
* body's columns and writes their widths into the header's `<colgroup>`. In `auto` layout those widths
|
|
512
|
+
* are only a floor, and a `content` column's header cell carries `width: 1%` -- so each header cell shrank
|
|
513
|
+
* to its title and a `fill` column took the rest, out of line with the rows under it. Fixed layout makes
|
|
514
|
+
* the `<colgroup>` the header's widths. The body keeps the configured `layout.mode`; Ant Design writes
|
|
515
|
+
* that inline on both tables, so the header's is stated over it.
|
|
516
|
+
*/
|
|
517
|
+
.phi-table-control.phi-table-control--sticky-header [class~="ant-table-sticky-holder"] > table {
|
|
518
|
+
table-layout: fixed !important;
|
|
519
|
+
}
|
|
520
|
+
|
|
504
521
|
:is([data-phi-modal-body-content], [data-phi-drawer-body-content]) {
|
|
505
522
|
--phi-table-sticky-top: 0px;
|
|
506
523
|
}
|
|
@@ -562,6 +579,55 @@ h5.phi-typography, .phi-typography h5 {
|
|
|
562
579
|
align-self: center;
|
|
563
580
|
}
|
|
564
581
|
|
|
582
|
+
/*
|
|
583
|
+
* Its arrow on the switcher's own centre. antd sets the switcher's line height to the row height and lets
|
|
584
|
+
* the arrow stand on that line's baseline, which leaves a small icon above the middle of the box. The box
|
|
585
|
+
* keeps a compact control's height, so its hover ground is the square it was.
|
|
586
|
+
*/
|
|
587
|
+
.phi-tree-control.phi-tree-control [class~="ant-tree-switcher"] {
|
|
588
|
+
display: inline-flex;
|
|
589
|
+
align-items: center;
|
|
590
|
+
justify-content: center;
|
|
591
|
+
min-block-size: var(--ant-control-height-sm);
|
|
592
|
+
}
|
|
593
|
+
|
|
594
|
+
/* --- Compact Select ------------------------------------------------------------------------------ */
|
|
595
|
+
|
|
596
|
+
/*
|
|
597
|
+
* A compact control writes small: Input, InputNumber, DatePicker and Button take the scale's `sm` through
|
|
598
|
+
* their component tokens (theme/phi-theme.ts). Select has no such token -- it sizes its words by variables
|
|
599
|
+
* of its own and gives `-sm` the body's -- so its compact form is told here. Both variables move together:
|
|
600
|
+
* Select reckons its padding as (height - font height) / 2, so a smaller font size with the body's font
|
|
601
|
+
* height would leave the box short of `controlHeightSM` by the difference.
|
|
602
|
+
*/
|
|
603
|
+
[class~="ant-select"][class~="ant-select-sm"] {
|
|
604
|
+
--ant-select-font-size: var(--ant-font-size-sm);
|
|
605
|
+
--ant-select-font-height: calc(var(--ant-font-size-sm) * var(--ant-select-line-height));
|
|
606
|
+
}
|
|
607
|
+
|
|
608
|
+
/* The list a compact Select opens writes as the field does; Ant Design gives every Select's list the body size. */
|
|
609
|
+
.phi-select-popup--sm [class~="ant-select-item"] {
|
|
610
|
+
font-size: var(--ant-font-size-sm);
|
|
611
|
+
}
|
|
612
|
+
|
|
613
|
+
/* --- Running text --------------------------------------------------------------------------------- */
|
|
614
|
+
|
|
615
|
+
/*
|
|
616
|
+
* Markdown and HTML text breaks long words at their syllables, by the rules of the page's language
|
|
617
|
+
* (`<html lang>`), rather than leaving a ragged edge or running a word past its column. Code keeps its
|
|
618
|
+
* characters as written.
|
|
619
|
+
*/
|
|
620
|
+
.phi-markdown-text,
|
|
621
|
+
.phi-html-widget__content {
|
|
622
|
+
hyphens: auto;
|
|
623
|
+
overflow-wrap: break-word;
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
.phi-markdown-text :is(pre, code),
|
|
627
|
+
.phi-html-widget__content :is(pre, code) {
|
|
628
|
+
hyphens: manual;
|
|
629
|
+
}
|
|
630
|
+
|
|
565
631
|
/* --- Plain table --------------------------------------------------------------------------------- */
|
|
566
632
|
|
|
567
633
|
/* Wide tables scroll inside their own box instead of widening the Page. */
|
|
@@ -570,11 +636,12 @@ h5.phi-typography, .phi-typography h5 {
|
|
|
570
636
|
overflow-x: auto;
|
|
571
637
|
}
|
|
572
638
|
|
|
639
|
+
/* A table is read across, not down: its cells take the small size, as the Table Control's do. */
|
|
573
640
|
.phi-plain-table {
|
|
574
641
|
width: 100%;
|
|
575
642
|
border-collapse: collapse;
|
|
576
|
-
font-size: var(--ant-font-size);
|
|
577
|
-
line-height: var(--ant-line-height);
|
|
643
|
+
font-size: var(--ant-font-size-sm);
|
|
644
|
+
line-height: var(--ant-line-height-sm);
|
|
578
645
|
color: var(--ant-color-text);
|
|
579
646
|
}
|
|
580
647
|
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Gradients and glass on Controls (theme/phi-theme-gradients.ts).
|
|
3
|
+
*
|
|
4
|
+
* Ant Design 6 draws a Button's ground with `background-color` from its own variables
|
|
5
|
+
* (`--ant-btn-bg-color`, `-hover`, `-active`) and never sets `background-image`. So a run laid on as
|
|
6
|
+
* `background-image` sits over Ant Design's colour without fighting it and keeps that colour as the edge
|
|
7
|
+
* a gradient cannot draw. A disabled Button is left out of every rule here: its run would outweigh the
|
|
8
|
+
* `background` shorthand Ant Design greys it out with. Text colour goes through Ant Design's text variables, which is
|
|
9
|
+
* what its hover and active rules read.
|
|
10
|
+
*
|
|
11
|
+
* The selectors repeat a class for the reason `control-shape.css` gives: Ant Design's rules weigh up to
|
|
12
|
+
* four classes, and a tie is settled by source order this file does not control.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
/*
|
|
16
|
+
* Every primary Button, where the Theme fills them with a gradient (`theme.buttons.primaryGradient`).
|
|
17
|
+
* A Button of the `gradient` variant is primary underneath and has a run of its own, so it is left out.
|
|
18
|
+
*/
|
|
19
|
+
.ant-btn.ant-btn.ant-btn-color-primary.ant-btn-variant-solid:not(.ant-btn-background-ghost):not(.phi-btn-gradient):not(:disabled):not(.ant-btn-disabled) {
|
|
20
|
+
background-image: var(--ant-phi-primary-button-gradient, none);
|
|
21
|
+
/* From the outer edge and once: from the padding box it tiled again under the border, and a pill's
|
|
22
|
+
ends showed the other end of the run. */
|
|
23
|
+
background-origin: border-box;
|
|
24
|
+
background-repeat: no-repeat;
|
|
25
|
+
will-change: filter;
|
|
26
|
+
--ant-btn-text-color: var(--ant-phi-primary-button-gradient-text, var(--ant-color-text-light-solid));
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.ant-btn.ant-btn.ant-btn-color-primary.ant-btn-variant-solid:not(.ant-btn-background-ghost):not(.phi-btn-gradient):not(:disabled):not(.ant-btn-disabled):hover {
|
|
30
|
+
filter: var(--ant-phi-primary-button-gradient-hover, none);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.ant-btn.ant-btn.ant-btn-color-primary.ant-btn-variant-solid:not(.ant-btn-background-ghost):not(.phi-btn-gradient):not(:disabled):not(.ant-btn-disabled):active {
|
|
34
|
+
filter: var(--ant-phi-primary-button-gradient-active, none);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/*
|
|
38
|
+
* A Button of the `gradient` variant: its slot's run, whatever the Theme does with primary Buttons. The
|
|
39
|
+
* Control states the slot as `--phi-control-gradient` and its text as `--phi-control-gradient-text`.
|
|
40
|
+
*/
|
|
41
|
+
.ant-btn.ant-btn.phi-btn-gradient.phi-btn-gradient:not(:disabled):not(.ant-btn-disabled) {
|
|
42
|
+
background-image: var(--phi-control-gradient);
|
|
43
|
+
background-origin: border-box;
|
|
44
|
+
background-repeat: no-repeat;
|
|
45
|
+
/* Its own layer at rest as well: the browser otherwise lifts the Button onto one only while the
|
|
46
|
+
filter eases, rasterises its rounded rim there, and the pill seemed to change size twice. */
|
|
47
|
+
will-change: filter;
|
|
48
|
+
/* The run is the whole ground: a colour beneath it showed through the anti-aliased rim of a pill. */
|
|
49
|
+
--ant-btn-bg-color: transparent;
|
|
50
|
+
--ant-btn-bg-color-hover: transparent;
|
|
51
|
+
--ant-btn-bg-color-active: transparent;
|
|
52
|
+
--ant-btn-border-color: transparent;
|
|
53
|
+
--ant-btn-border-color-hover: transparent;
|
|
54
|
+
--ant-btn-border-color-active: transparent;
|
|
55
|
+
--ant-btn-text-color: var(--phi-control-gradient-text);
|
|
56
|
+
--ant-btn-text-color-hover: var(--phi-control-gradient-text);
|
|
57
|
+
--ant-btn-text-color-active: var(--phi-control-gradient-text);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/*
|
|
61
|
+
* Under the pointer and pressed the run stays the same picture and only its light changes: Ant Design
|
|
62
|
+
* transitions every property of a Button, and a picture swapped on hover crossfaded badly as the pointer
|
|
63
|
+
* left. A filter eases with the rest.
|
|
64
|
+
*/
|
|
65
|
+
.ant-btn.ant-btn.phi-btn-gradient.phi-btn-gradient:not(:disabled):not(.ant-btn-disabled):hover {
|
|
66
|
+
filter: brightness(1.18) saturate(1.15);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.ant-btn.ant-btn.phi-btn-gradient.phi-btn-gradient:not(:disabled):not(.ant-btn-disabled):active {
|
|
70
|
+
filter: brightness(0.88);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/*
|
|
74
|
+
* A Button of the `glass` variant: a pane of the container ground of the mode it stands in, frosting
|
|
75
|
+
* whatever shows through it -- a picture, a gradient. Inside a dark Surface tone the ground is the dark
|
|
76
|
+
* one, so the pane darkens instead of misting a dark picture white.
|
|
77
|
+
*/
|
|
78
|
+
.ant-btn.ant-btn.phi-btn-glass.phi-btn-glass {
|
|
79
|
+
--ant-btn-bg-color: color-mix(in srgb, var(--ant-color-bg-container) 24%, transparent);
|
|
80
|
+
--ant-btn-bg-color-hover: color-mix(in srgb, var(--ant-color-bg-container) 38%, transparent);
|
|
81
|
+
--ant-btn-bg-color-active: color-mix(in srgb, var(--ant-color-bg-container) 48%, transparent);
|
|
82
|
+
--ant-btn-border-color: color-mix(in srgb, var(--ant-color-text) 24%, transparent);
|
|
83
|
+
--ant-btn-border-color-hover: color-mix(in srgb, var(--ant-color-text) 40%, transparent);
|
|
84
|
+
--ant-btn-border-color-active: color-mix(in srgb, var(--ant-color-text) 40%, transparent);
|
|
85
|
+
--ant-btn-text-color: var(--ant-color-text);
|
|
86
|
+
--ant-btn-text-color-hover: var(--ant-color-text);
|
|
87
|
+
--ant-btn-text-color-active: var(--ant-color-text);
|
|
88
|
+
/* The frost itself is inline on the Button: a `backdrop-filter` in a stylesheet does not survive the build (styles/shell.css). */
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/* A Switch that is on, filled with its slot's run instead of the primary colour. */
|
|
92
|
+
.ant-switch.ant-switch.ant-switch.phi-switch-gradient.ant-switch-checked {
|
|
93
|
+
background-image: var(--phi-control-gradient);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/* The thumb a Segmented slides under its selected item, and the item itself once the thumb has gone. */
|
|
97
|
+
.ant-segmented.ant-segmented.phi-segmented-gradient .ant-segmented-thumb,
|
|
98
|
+
.ant-segmented.ant-segmented.phi-segmented-gradient .ant-segmented-item-selected {
|
|
99
|
+
background-image: var(--phi-control-gradient);
|
|
100
|
+
color: var(--phi-control-gradient-text);
|
|
101
|
+
}
|