@riverbankcms/sdk 0.129.1 → 0.130.0
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 +32 -10
- package/dist/{PreviewEditorSidebar-DceRseRV.mjs → PreviewEditorSidebar-DiEpbOdw.mjs} +313 -239
- package/dist/{PreviewEditorUI-BNunq3kk.mjs → PreviewEditorUI-C6MvxnIa.mjs} +3 -3
- package/dist/{PreviewQueryProvider-B1kbhaJD.mjs → PreviewQueryProvider-C2rnoPz6.mjs} +1 -1
- package/dist/{SdkPreviewModeRuntime-Bt87-62u.mjs → SdkPreviewModeRuntime-DRXA_m5L.mjs} +208 -211
- package/dist/{SiteChromeCustomizeContext-BLl-OlL4.mjs → SiteChromeCustomizeContext-BTHdv5_-.mjs} +6204 -6239
- package/dist/_dts/ai/src/contracts/proposalPrimitives.d.ts +52 -0
- package/dist/_dts/ai/src/contracts/proposals.d.ts +4950 -29100
- package/dist/_dts/ai/src/contracts/siteStyleProposalSchemas.d.ts +32572 -0
- package/dist/_dts/api/src/appointmentSetup.d.ts +21 -9
- package/dist/_dts/api/src/bookingConfig.d.ts +4 -46
- package/dist/_dts/api/src/bookingManagementEndpoints.d.ts +13 -11
- package/dist/_dts/api/src/bookingRecords.d.ts +1 -0
- package/dist/_dts/api/src/contentRuntime.d.ts +3 -5
- package/dist/_dts/api/src/endpoints.d.ts +14 -21
- package/dist/_dts/api/src/eventManagementContracts.d.ts +76 -0
- package/dist/_dts/api/src/index.d.ts +3 -2
- package/dist/_dts/api/src/publicExperience/commerceEndpoints.d.ts +22 -47
- package/dist/_dts/api/src/sdk-event-schedule.d.ts +5 -0
- package/dist/_dts/api/src/sdk-event-upsert.d.ts +112 -20
- package/dist/_dts/api/src/sdkContracts.d.ts +38 -66
- package/dist/_dts/api/src/sdkManagedEventContracts.d.ts +35 -0
- package/dist/_dts/api/src/sdkThemeWire.d.ts +2423 -501
- package/dist/_dts/api/src/sitePlatformEndpoints.d.ts +5 -0
- package/dist/_dts/api/src/siteRuntimeEndpoints.d.ts +23 -37
- package/dist/_dts/blocks/src/contracts/index.d.ts +2 -0
- package/dist/_dts/blocks/src/contracts/non-block-islands.d.ts +6 -8
- package/dist/_dts/blocks/src/contracts/proof-block-islands.d.ts +36 -14
- package/dist/_dts/blocks/src/index.d.ts +5 -3
- package/dist/_dts/blocks/src/lib/media.d.ts +9 -539
- package/dist/_dts/blocks/src/system/blocks/location-map.d.ts +3 -2
- package/dist/_dts/blocks/src/system/blocks/media-text.d.ts +135 -90
- package/dist/_dts/blocks/src/system/blocks/shop.d.ts +2 -2
- package/dist/_dts/blocks/src/system/blocks/shop.shared.d.ts +37 -4
- package/dist/_dts/blocks/src/system/blocks/site-footer-nav-groups-layout.d.ts +1 -1
- package/dist/_dts/blocks/src/system/blocks/site-footer-runtime.d.ts +3 -0
- package/dist/_dts/blocks/src/system/componentFactory.d.ts +5 -5
- package/dist/_dts/blocks/src/system/customize/backgrounds.d.ts +8 -6
- package/dist/_dts/blocks/src/system/customize/serializeBackgroundOverride.d.ts +3 -0
- package/dist/_dts/blocks/src/system/fields/background.d.ts +2 -20
- package/dist/_dts/blocks/src/system/fields/backgroundContent.d.ts +17 -0
- package/dist/_dts/blocks/src/system/fields/backgroundContentAudit.d.ts +20 -0
- package/dist/_dts/blocks/src/system/fields/boxStyles.d.ts +5 -33
- package/dist/_dts/blocks/src/system/fragments/builder.d.ts +1 -0
- package/dist/_dts/blocks/src/system/fragments/types.d.ts +1 -0
- package/dist/_dts/blocks/src/system/helpers/index.d.ts +1 -1
- package/dist/_dts/blocks/src/system/helpers/resolveBackground.d.ts +10 -45
- package/dist/_dts/blocks/src/system/manifest/fieldValidation/index.d.ts +7 -4
- package/dist/_dts/blocks/src/system/manifest/fieldValidation/writeCanonicalization.d.ts +4 -0
- package/dist/_dts/blocks/src/system/manifest/schema.d.ts +123 -55
- package/dist/_dts/blocks/src/system/registry.d.ts +2 -0
- package/dist/_dts/blocks/src/system/runtime/api/types/shop.d.ts +2 -37
- package/dist/_dts/blocks/src/system/runtime/components/registry.client.d.ts +61 -24
- package/dist/_dts/blocks/src/system/runtime/components/runtime-backed-blocks.d.ts +30 -12
- package/dist/_dts/blocks/src/system/runtime/header/enhanceHeaderSection.d.ts +3 -5
- package/dist/_dts/blocks/src/system/runtime/header/headerScrollRuntime.d.ts +2 -0
- package/dist/_dts/blocks/src/system/runtime/header/runtimeContract.d.ts +22 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/commerce/shared/display.d.ts +9 -2
- package/dist/_dts/blocks/src/system/runtime/nodes/commerce/shared/view.d.ts +3 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/header-section.client.d.ts +2 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/header-section.frame.d.ts +21 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/header-section.server.d.ts +2 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/shop.interactive.d.ts +41 -12
- package/dist/_dts/blocks/src/system/runtime/nodes/shop.pass-contract.d.ts +3 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/shop.state.d.ts +3 -3
- package/dist/_dts/blocks/src/system/transforms/registry/_utils/surfaceForegroundStyles.d.ts +3 -1
- package/dist/_dts/blocks/src/system/transforms/registry/background.d.ts +1 -1
- package/dist/_dts/blocks/src/system/transforms/registry/boxStyles.d.ts +3 -1
- package/dist/_dts/blocks/src/system/transforms/registry/core.d.ts +4 -1
- package/dist/_dts/blocks/src/system/transforms/registry/headerRuntime.d.ts +3 -0
- package/dist/_dts/blocks/src/system/transforms/registry/index.d.ts +2 -1
- package/dist/_dts/blocks/src/system/transforms/registry/layout.d.ts +0 -3
- package/dist/_dts/blocks/src/system/transforms/typed.d.ts +41 -43
- package/dist/_dts/content-editor/src/FooterComposerOverview.d.ts +4 -2
- package/dist/_dts/content-editor/src/FooterComposerPanel.d.ts +2 -17
- package/dist/_dts/content-editor/src/FooterNavigationLayoutControl.d.ts +5 -0
- package/dist/_dts/content-editor/src/footerComposer.d.ts +2 -1
- package/dist/_dts/content-editor/src/footerComposerPanelTypes.d.ts +21 -0
- package/dist/_dts/content-editor/src/footerPreviewRuntime.d.ts +2 -1
- package/dist/_dts/content-editor/src/useFooterComposerState.d.ts +11 -1
- package/dist/_dts/content-editor/src/useFooterNavigationLayout.d.ts +26 -0
- package/dist/_dts/content-model/src/templates/defaults.d.ts +7 -0
- package/dist/_dts/core/src/booking-date-time.d.ts +2 -2
- package/dist/_dts/core/src/booking-time-zone.d.ts +6 -0
- package/dist/_dts/core/src/footer-composition-types.d.ts +4 -4
- package/dist/_dts/core/src/footer-navigation-layout.d.ts +4 -0
- package/dist/_dts/core/src/index.d.ts +1 -0
- package/dist/_dts/db/src/generated/supabase/database.types.d.ts +38 -18
- package/dist/_dts/preview-next/src/client/preview/FooterSidebarDisclosure.d.ts +8 -0
- package/dist/_dts/preview-next/src/client/preview/PageBlockEditorPanel.d.ts +5 -5
- package/dist/_dts/preview-next/src/client/preview/PreviewEditorSidebar.d.ts +15 -17
- package/dist/_dts/preview-next/src/client/preview/PreviewFooterEditorPanel.d.ts +20 -0
- package/dist/_dts/preview-next/src/client/preview/PreviewShell.d.ts +3 -5
- package/dist/_dts/preview-next/src/client/preview/PreviewShellLayout.d.ts +3 -5
- package/dist/_dts/preview-next/src/client/preview/SiteChromeCustomizeContext.d.ts +4 -4
- package/dist/_dts/preview-next/src/client/preview/StyleConfigurator.d.ts +3 -5
- package/dist/_dts/preview-next/src/client/preview/StyleConfigurator.state.d.ts +6 -7
- package/dist/_dts/preview-next/src/client/preview/siteChromeBrandPreferences.d.ts +7 -7
- package/dist/_dts/preview-next/src/client/preview/siteChromeCustomizeTypes.d.ts +4 -4
- package/dist/_dts/preview-next/src/client/preview/siteChromeQuickControlHistoryState.d.ts +2 -2
- package/dist/_dts/preview-next/src/client/preview/siteChromeSavePlan.d.ts +12 -11
- package/dist/_dts/preview-next/src/client/preview/siteChromeSelectionRows.d.ts +53 -0
- package/dist/_dts/preview-next/src/client/preview/siteStyleAccess.d.ts +1 -6
- package/dist/_dts/preview-next/src/client/preview/siteStylePreviewPlanner.d.ts +6 -15
- package/dist/_dts/preview-next/src/client/preview/styleConfiguratorSnapshot.d.ts +4 -6
- package/dist/_dts/sdk/src/config/types.d.ts +1 -0
- package/dist/_dts/sdk/src/config/validation.d.ts +2 -0
- package/dist/_dts/sdk/src/contracts/system-block-content.d.ts +4 -41
- package/dist/_dts/sdk/src/next/catch-all-theme-admission.d.ts +23 -0
- package/dist/_dts/sdk/src/next/index.d.ts +8 -6
- package/dist/_dts/sdk/src/next/resolveTheme.d.ts +1 -2
- package/dist/_dts/sdk/src/next/types.d.ts +10 -0
- package/dist/_dts/sdk/src/public-api/contracts.d.ts +2 -16
- package/dist/_dts/sdk/src/rendering/components/Layout.d.ts +3 -2
- package/dist/_dts/sdk/src/rendering/helpers/loadContent.d.ts +5 -3
- package/dist/_dts/sdk/src/rendering/helpers/pageRuntimeSupport.d.ts +1 -1
- package/dist/_dts/sdk/src/rendering/hooks/useContent.d.ts +4 -2
- package/dist/_dts/sdk/src/rendering/index.d.ts +2 -0
- package/dist/_dts/sdk/src/rendering/islands/types.d.ts +6 -1
- package/dist/_dts/sdk/src/rendering/server.d.ts +2 -0
- package/dist/_dts/sdk/src/rendering/themeAdmission.d.ts +11 -0
- package/dist/_dts/sdk/src/version.d.ts +1 -1
- package/dist/_dts/theme-core/src/blockOverrides.d.ts +1 -1
- package/dist/_dts/theme-core/src/boxBackgroundSchema.d.ts +184 -0
- package/dist/_dts/theme-core/src/buttons/buttonColourContract.d.ts +96 -0
- package/dist/_dts/theme-core/src/buttons/buttonSurfaceContext.d.ts +78 -0
- package/dist/_dts/theme-core/src/buttons/index.d.ts +1 -0
- package/dist/_dts/theme-core/src/buttons/parseThemeForPersistence.d.ts +2 -2
- package/dist/_dts/theme-core/src/buttons/resolveButtonColourStates.d.ts +9 -57
- package/dist/_dts/theme-core/src/buttons/resolvedButtonCss.d.ts +6 -3
- package/dist/_dts/theme-core/src/buttons/styles/domain.d.ts +8 -7
- package/dist/_dts/theme-core/src/buttons/styles/recipes/quietArrow.d.ts +1 -0
- package/dist/_dts/theme-core/src/buttons/styles/recipes/staticRecipes.d.ts +11 -0
- package/dist/_dts/theme-core/src/buttons/styles/registry.d.ts +12 -0
- package/dist/_dts/theme-core/src/buttons/styles/selection.d.ts +5 -0
- package/dist/_dts/theme-core/src/buttons/types.d.ts +51 -4
- package/dist/_dts/theme-core/src/generated/containerResponsiveThemeCss.d.ts +1 -1
- package/dist/_dts/theme-core/src/lib/media.d.ts +583 -10
- package/dist/_dts/theme-core/src/mock-themes/all.d.ts +5117 -1433
- package/dist/_dts/theme-core/src/schema.d.ts +5079 -2005
- package/dist/_dts/theme-core/src/site-styles/compilationPlan.d.ts +6 -14
- package/dist/_dts/theme-core/src/site-styles/curatedSiteStyles.d.ts +29 -102
- package/dist/_dts/theme-core/src/site-styles/customizableSurfaces.d.ts +3 -76
- package/dist/_dts/theme-core/src/site-styles/designState.d.ts +4 -4
- package/dist/_dts/theme-core/src/site-styles/generatedDesignPipeline.d.ts +3 -7
- package/dist/_dts/theme-core/src/site-styles/generatedDesignPipelineHelpers.d.ts +17 -0
- package/dist/_dts/theme-core/src/site-styles/generatedSchemas.d.ts +2 -2
- package/dist/_dts/theme-core/src/site-styles/headerLayoutCatalog.d.ts +281 -0
- package/dist/_dts/theme-core/src/site-styles/headerLayoutResolution.d.ts +13 -0
- package/dist/_dts/theme-core/src/site-styles/headerLayoutStyles.d.ts +6 -0
- package/dist/_dts/theme-core/src/site-styles/{headerLookTypes.d.ts → headerLayoutTypes.d.ts} +16 -86
- package/dist/_dts/theme-core/src/site-styles/headerNavStyles.d.ts +6 -0
- package/dist/_dts/theme-core/src/site-styles/headerOpeningForeground.d.ts +7 -4
- package/dist/_dts/theme-core/src/site-styles/headerOpeningSection.d.ts +2 -2
- package/dist/_dts/theme-core/src/site-styles/headerStyleCompiler.d.ts +2 -2
- package/dist/_dts/theme-core/src/site-styles/imageSurfaceBackground.d.ts +14 -0
- package/dist/_dts/theme-core/src/site-styles/index.d.ts +1 -1
- package/dist/_dts/theme-core/src/site-styles/previewCompiler.d.ts +14 -41
- package/dist/_dts/theme-core/src/site-styles/runtimeBackgroundResolution.d.ts +23 -0
- package/dist/_dts/theme-core/src/site-styles/runtimeCompiler.d.ts +8 -6
- package/dist/_dts/theme-core/src/site-styles/siteChromeNavPreferences.d.ts +1 -1
- package/dist/client/{CourseRegistrationWizard-xRmA7REV.mjs → CourseRegistrationWizard-Bvtz9G9g.mjs} +5 -5
- package/dist/client/{DiscountCodeDisclosure-B9vriL5C.mjs → DiscountCodeDisclosure-Ur-Xx1U_.mjs} +1 -1
- package/dist/client/{EventCombined.client-BgVnVTlz.mjs → EventCombined.client-EhscD4U6.mjs} +2 -2
- package/dist/client/{EventListing.client-CqdsO7jO.mjs → EventListing.client-Bn26cFTY.mjs} +2 -2
- package/dist/client/{LeafletStaticMap-CKPxot9M.mjs → LeafletStaticMap-BUw9Ntzr.mjs} +1 -1
- package/dist/client/{StepIndicator-DGCYuBJ1.mjs → StepIndicator-BfbdiVQI.mjs} +2 -2
- package/dist/client/{accordion-BfN5Eqd-.mjs → accordion-CjIeof73.mjs} +1 -1
- package/dist/client/{bookingForm-DOvCpBFP.mjs → bookingForm-DwEeovf_.mjs} +5 -5
- package/dist/client/bookings.mjs +1028 -1038
- package/dist/client/{carousel-DPNmiH0f.mjs → carousel-BMrfgOba.mjs} +1 -1
- package/dist/client/{cart--egVXlrR.mjs → cart-rXEdxTdb.mjs} +3 -3
- package/dist/client/{checkout-DywWtMcq.mjs → checkout-D3JlSzh3.mjs} +3 -3
- package/dist/client/client.mjs +18345 -18311
- package/dist/client/{courseRegistration-Dk9qFVwt.mjs → courseRegistration-DO5XvMAA.mjs} +2 -2
- package/dist/client/{eventCalendar-Bkz2HjlS.mjs → eventCalendar-DO6rTqCn.mjs} +4 -4
- package/dist/client/{eventCombined-D4kipYWg.mjs → eventCombined-bJ3i_ovU.mjs} +2 -2
- package/dist/client/{eventDetails-Dz_5ix2Q.mjs → eventDetails-CCbrXE7o.mjs} +3 -3
- package/dist/client/{eventListing-D0vm-zST.mjs → eventListing-Bdlt9YTm.mjs} +2 -2
- package/dist/client/{eventRegistration-Cw1E4Q4p.mjs → eventRegistration-B02lt6iY.mjs} +6 -6
- package/dist/client/{form-C2Zf1n3K.mjs → form-DrUBAAox.mjs} +1 -1
- package/dist/client/{headerSection-CP05gzdc.mjs → headerSection-MzqvHL6T.mjs} +151 -104
- package/dist/client/hooks.mjs +4532 -4216
- package/dist/client/{locationMap-Cl3x9PYJ.mjs → locationMap-DG8BxTBm.mjs} +2 -2
- package/dist/client/{newsletterForm-DyEJoClm.mjs → newsletterForm-BzO-Td3p.mjs} +1 -1
- package/dist/client/{pricing-DGuNR1W4.mjs → pricing-NgK7ozkg.mjs} +1 -1
- package/dist/client/{productDetail-Cq-HrGew.mjs → productDetail-CfQ7rhVK.mjs} +3 -3
- package/dist/client/{productList-DbB3jwqd.mjs → productList-C23rOLUi.mjs} +3 -3
- package/dist/client/{propsDecoder-CiTuhUwY.mjs → propsDecoder-CAZdhwjs.mjs} +2166 -2157
- package/dist/client/rendering/client.mjs +3600 -4118
- package/dist/client/rendering/islands.mjs +18 -18
- package/dist/client/rendering.mjs +15950 -15890
- package/dist/client/{scrollToBlock-CShkRqab.mjs → scrollToBlock-DSSqVQr1.mjs} +1 -1
- package/dist/client/{shop-Cu4Ib-ZA.mjs → shop-BMToKLK7.mjs} +34 -23
- package/dist/client/{shop-commerce-BzpsOdh7.mjs → shop-commerce-DB4JRKmp.mjs} +4 -4
- package/dist/client/{shop-commerce-store-DaE7Fhj8.mjs → shop-commerce-store-BOqSIOuc.mjs} +1 -1
- package/dist/client/{shopShared-cF0c20vB.mjs → shopShared-B6SK9DZv.mjs} +9 -3
- package/dist/client/{useEventFilters-QZ3HMgaJ.mjs → useEventFilters-CULOa4nB.mjs} +2 -2
- package/dist/client/{usePolling-BKf0GcE-.mjs → usePolling-BGG_8-jl.mjs} +2 -2
- package/dist/preview-next/before-render.mjs +16 -27
- package/dist/preview-next/client/runtime.mjs +4 -4
- package/dist/preview-next/middleware.mjs +16 -27
- package/dist/{previewAuthStore-BesgU5Xu.mjs → previewAuthStore-_GXFRg2W.mjs} +16 -27
- package/dist/{sdk-runtime-C20CVWbb.mjs → sdk-runtime-hhSOMShR.mjs} +2 -2
- package/dist/{separator-BE3NCquy.mjs → separator-flRaFc14.mjs} +1 -1
- package/dist/server/components.mjs +17770 -17866
- package/dist/server/config-validation.mjs +4711 -4421
- package/dist/server/config.mjs +4715 -4425
- package/dist/server/data.mjs +4515 -4216
- package/dist/server/date-time.mjs +22 -13
- package/dist/server/index.mjs +17 -28
- package/dist/server/next.mjs +17586 -17650
- package/dist/server/page-converter.mjs +3759 -4390
- package/dist/server/prebuild.mjs +1 -1
- package/dist/server/rendering/server.mjs +18952 -19064
- package/dist/server/rendering.mjs +17824 -17901
- package/dist/server/routing.mjs +4748 -4365
- package/dist/server/server.mjs +4591 -4269
- package/dist/server/theme-bridge.mjs +1393 -1886
- package/dist/server/theme.mjs +736 -605
- package/dist/styles/index.css +22 -3
- package/package.json +1 -1
- package/dist/_dts/preview-next/src/client/preview/siteChromeLookRows.d.ts +0 -66
- package/dist/_dts/theme-core/src/site-styles/headerLayoutStyleCatalog.d.ts +0 -254
- package/dist/_dts/theme-core/src/site-styles/headerLegacyLooks.d.ts +0 -372
- package/dist/_dts/theme-core/src/site-styles/headerLookBranding.d.ts +0 -106
- package/dist/_dts/theme-core/src/site-styles/headerLookSelection.d.ts +0 -2
- package/dist/_dts/theme-core/src/site-styles/headerLooks.d.ts +0 -7
- package/dist/_dts/theme-core/src/site-styles/headerStyleCompilerPrimitives.d.ts +0 -23
package/dist/server/theme.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { z } from "zod";
|
|
2
2
|
import * as fs from "fs/promises";
|
|
3
3
|
import * as path from "path";
|
|
4
4
|
//#region ../theme-core/src/palette/utils/colorConversion.ts
|
|
@@ -431,7 +431,7 @@ const PALETTE_TOKEN_NAMES = [
|
|
|
431
431
|
"text",
|
|
432
432
|
"border"
|
|
433
433
|
];
|
|
434
|
-
const paletteTokenNameSchema = z
|
|
434
|
+
const paletteTokenNameSchema = z.enum(PALETTE_TOKEN_NAMES);
|
|
435
435
|
const themeColorBaseTokenNames = [
|
|
436
436
|
...PALETTE_TOKEN_NAMES,
|
|
437
437
|
...blockColorTokenNames,
|
|
@@ -476,7 +476,7 @@ function parseThemeColorToken(value) {
|
|
|
476
476
|
if (!isThemeColorToken(value)) return null;
|
|
477
477
|
return value.trim();
|
|
478
478
|
}
|
|
479
|
-
const themeColorTokenSchema = z
|
|
479
|
+
const themeColorTokenSchema = z.string().min(1).refine((value) => Boolean(isThemeColorToken(value)), "Expected a known Theme V2 color token");
|
|
480
480
|
//#endregion
|
|
481
481
|
//#region ../theme-core/src/palette/colors.ts
|
|
482
482
|
const HEX_COLOR_REGEX = /^#[0-9a-f]{6}$/;
|
|
@@ -496,11 +496,11 @@ const THEME_PALETTE_COLOR_ORDER = [
|
|
|
496
496
|
"primaryForeground",
|
|
497
497
|
"border"
|
|
498
498
|
];
|
|
499
|
-
const hexColorSchema = z
|
|
500
|
-
const paletteModeSchema = z
|
|
499
|
+
const hexColorSchema = z.string().regex(HEX_COLOR_REGEX, "Hex must be #RRGGBB (lowercase)").transform((value) => value);
|
|
500
|
+
const paletteModeSchema = z.enum(["light", "dark"]);
|
|
501
501
|
const PALETTE_VALUE_KEY_PREFIX = "palette-value:v1|";
|
|
502
|
-
z
|
|
503
|
-
const paletteColorsSchema = z
|
|
502
|
+
z.string().regex(/^[0-9a-f]{64}$/, "Palette hash must be a lowercase SHA-256 value").transform((value) => value);
|
|
503
|
+
const paletteColorsSchema = z.object({
|
|
504
504
|
primary: hexColorSchema,
|
|
505
505
|
primaryForeground: hexColorSchema,
|
|
506
506
|
secondary: hexColorSchema,
|
|
@@ -606,14 +606,14 @@ function parsePaletteValueKey(value) {
|
|
|
606
606
|
if (!colors.ok || paletteValueKey(colors.colors, mode.data) !== value) return null;
|
|
607
607
|
return value;
|
|
608
608
|
}
|
|
609
|
-
z
|
|
609
|
+
z.string().transform((value, ctx) => {
|
|
610
610
|
const parsed = parsePaletteValueKey(value);
|
|
611
611
|
if (parsed) return parsed;
|
|
612
612
|
ctx.addIssue({
|
|
613
613
|
code: "custom",
|
|
614
614
|
message: "Invalid canonical palette value key"
|
|
615
615
|
});
|
|
616
|
-
return z
|
|
616
|
+
return z.NEVER;
|
|
617
617
|
});
|
|
618
618
|
//#endregion
|
|
619
619
|
//#region ../theme-core/src/lib/media.ts
|
|
@@ -649,15 +649,17 @@ const transformSchema = z.object({
|
|
|
649
649
|
hotspot: hotspotSchema.optional(),
|
|
650
650
|
rotation: rotationSchema.optional()
|
|
651
651
|
});
|
|
652
|
-
const
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
652
|
+
const mediaPosterSchema = z.discriminatedUnion("tag", [z.object({
|
|
653
|
+
tag: z.literal("storage"),
|
|
654
|
+
assetId: z.string().optional(),
|
|
655
|
+
storageBucket: z.string().min(1),
|
|
656
|
+
storagePath: z.string().min(1)
|
|
657
|
+
}), z.object({
|
|
658
|
+
tag: z.literal("external-src"),
|
|
659
|
+
assetId: z.string().optional(),
|
|
660
|
+
src: z.string().url()
|
|
661
|
+
})]);
|
|
662
|
+
const mediaBaseSchema = z.object({
|
|
661
663
|
purpose: z.string().optional(),
|
|
662
664
|
placeholder: z.boolean().default(true).optional(),
|
|
663
665
|
assetId: z.string().optional(),
|
|
@@ -670,18 +672,43 @@ const mediaSchema = z.object({
|
|
|
670
672
|
height: z.number().optional(),
|
|
671
673
|
storageBucket: z.string().optional(),
|
|
672
674
|
storagePath: z.string().optional(),
|
|
675
|
+
poster: mediaPosterSchema.optional(),
|
|
673
676
|
transform: transformSchema.optional()
|
|
674
677
|
});
|
|
678
|
+
const mediaIdentifierSchema = z.string().trim().min(1).brand();
|
|
679
|
+
const imageMediaSchema = mediaBaseSchema.extend({ type: z.literal("image") });
|
|
680
|
+
const videoMediaSchema = mediaBaseSchema.extend({ type: z.literal("video") });
|
|
681
|
+
const audioMediaSchema = mediaBaseSchema.extend({ type: z.literal("audio") });
|
|
682
|
+
const documentMediaSchema = mediaBaseSchema.extend({ type: z.literal("document") });
|
|
683
|
+
const spreadsheetMediaSchema = mediaBaseSchema.extend({ type: z.literal("spreadsheet") });
|
|
684
|
+
const archiveMediaSchema = mediaBaseSchema.extend({ type: z.literal("archive") });
|
|
685
|
+
const mediaSchema = z.discriminatedUnion("type", [
|
|
686
|
+
imageMediaSchema,
|
|
687
|
+
videoMediaSchema,
|
|
688
|
+
audioMediaSchema,
|
|
689
|
+
documentMediaSchema,
|
|
690
|
+
spreadsheetMediaSchema,
|
|
691
|
+
archiveMediaSchema
|
|
692
|
+
]);
|
|
693
|
+
const persistableMediaBaseSchema = mediaBaseSchema.extend({ identifier: mediaIdentifierSchema });
|
|
694
|
+
z.discriminatedUnion("type", [
|
|
695
|
+
persistableMediaBaseSchema.extend({ type: z.literal("image") }),
|
|
696
|
+
persistableMediaBaseSchema.extend({ type: z.literal("video") }),
|
|
697
|
+
persistableMediaBaseSchema.extend({ type: z.literal("audio") }),
|
|
698
|
+
persistableMediaBaseSchema.extend({ type: z.literal("document") }),
|
|
699
|
+
persistableMediaBaseSchema.extend({ type: z.literal("spreadsheet") }),
|
|
700
|
+
persistableMediaBaseSchema.extend({ type: z.literal("archive") })
|
|
701
|
+
]);
|
|
675
702
|
//#endregion
|
|
676
703
|
//#region ../theme-core/src/palette/schema.ts
|
|
677
|
-
const colourHexString = z
|
|
678
|
-
const paletteColorSchema = z
|
|
679
|
-
name: z
|
|
704
|
+
const colourHexString = z.string().regex(/^#([0-9A-Fa-f]{3}){1,2}$/);
|
|
705
|
+
const paletteColorSchema = z.object({
|
|
706
|
+
name: z.string().min(1),
|
|
680
707
|
hex: colourHexString
|
|
681
708
|
});
|
|
682
|
-
const paletteMetaSchema = z
|
|
683
|
-
const paletteSchema = z
|
|
684
|
-
colors: z
|
|
709
|
+
const paletteMetaSchema = z.object({ mode: z.enum(["light", "dark"]) });
|
|
710
|
+
const paletteSchema = z.object({
|
|
711
|
+
colors: z.array(paletteColorSchema),
|
|
685
712
|
meta: paletteMetaSchema
|
|
686
713
|
}).transform((palette, ctx) => {
|
|
687
714
|
const colors = paletteColorsFromEntries(palette.colors);
|
|
@@ -690,7 +717,7 @@ const paletteSchema = z$1.object({
|
|
|
690
717
|
code: "custom",
|
|
691
718
|
message: `Invalid complete palette: ${colors.error.kind}`
|
|
692
719
|
});
|
|
693
|
-
return z
|
|
720
|
+
return z.NEVER;
|
|
694
721
|
}
|
|
695
722
|
return {
|
|
696
723
|
colors: paletteColorEntries(colors.colors).map(({ name, hex }) => ({
|
|
@@ -721,7 +748,7 @@ const VARIANT_ROLES = [
|
|
|
721
748
|
* IDs become class selectors, so keep the contract deliberately narrower than
|
|
722
749
|
* an arbitrary string and shared with every authoring/runtime boundary.
|
|
723
750
|
*/
|
|
724
|
-
const buttonVariantIdSchema = z
|
|
751
|
+
const buttonVariantIdSchema = z.string().min(1).max(50).regex(/^[a-z0-9-]+$/, "Button variant IDs may contain lowercase letters, numbers, and hyphens only").refine((value) => value !== "link" && value !== "tertiary", { message: "Retired button role IDs are not valid variant IDs" });
|
|
725
752
|
function parseOpaqueButtonColourToken(value) {
|
|
726
753
|
const token = parseThemeColorToken(value);
|
|
727
754
|
if (token === null) return null;
|
|
@@ -736,8 +763,8 @@ const opaqueButtonColourTokenSchema = themeColorTokenSchema.refine((value) => pa
|
|
|
736
763
|
if (token === null) throw new Error("Invariant: opaque button token passed its schema");
|
|
737
764
|
return token;
|
|
738
765
|
});
|
|
739
|
-
const buttonShadeAmountSchema = z
|
|
740
|
-
const buttonShadowIntensitySchema = z
|
|
766
|
+
const buttonShadeAmountSchema = z.number().finite().min(0).max(900).multipleOf(100);
|
|
767
|
+
const buttonShadowIntensitySchema = z.enum([
|
|
741
768
|
"subtle",
|
|
742
769
|
"medium",
|
|
743
770
|
"strong"
|
|
@@ -749,153 +776,176 @@ const buttonShadowIntensitySchema = z$1.enum([
|
|
|
749
776
|
* this closed union so unsupported effect IDs, unknown option keys, and unsafe
|
|
750
777
|
* CSS values cannot become representable after the schema boundary.
|
|
751
778
|
*/
|
|
752
|
-
const buttonEffectApplicationSchema = z
|
|
753
|
-
z
|
|
754
|
-
effectId: z
|
|
755
|
-
options: z
|
|
779
|
+
const buttonEffectApplicationSchema = z.discriminatedUnion("effectId", [
|
|
780
|
+
z.strictObject({
|
|
781
|
+
effectId: z.literal("darken-background"),
|
|
782
|
+
options: z.strictObject({ amount: buttonShadeAmountSchema.optional() }).optional()
|
|
756
783
|
}),
|
|
757
|
-
z
|
|
758
|
-
effectId: z
|
|
759
|
-
options: z
|
|
784
|
+
z.strictObject({
|
|
785
|
+
effectId: z.literal("lighten-background"),
|
|
786
|
+
options: z.strictObject({ amount: buttonShadeAmountSchema.optional() }).optional()
|
|
760
787
|
}),
|
|
761
|
-
z
|
|
762
|
-
effectId: z
|
|
763
|
-
options: z
|
|
788
|
+
z.strictObject({
|
|
789
|
+
effectId: z.literal("background-on-hover"),
|
|
790
|
+
options: z.strictObject({ colorToken: opaqueButtonColourTokenSchema.optional() }).optional()
|
|
764
791
|
}),
|
|
765
|
-
z
|
|
766
|
-
effectId: z
|
|
767
|
-
options: z
|
|
792
|
+
z.strictObject({
|
|
793
|
+
effectId: z.literal("animated-gradient"),
|
|
794
|
+
options: z.strictObject({ direction: z.enum(["horizontal", "vertical"]).optional() }).optional()
|
|
768
795
|
}),
|
|
769
|
-
z
|
|
770
|
-
effectId: z
|
|
771
|
-
options: z
|
|
796
|
+
z.strictObject({
|
|
797
|
+
effectId: z.literal("drop-shadow"),
|
|
798
|
+
options: z.strictObject({ intensity: buttonShadowIntensitySchema.optional() }).optional()
|
|
772
799
|
}),
|
|
773
|
-
z
|
|
774
|
-
effectId: z
|
|
775
|
-
options: z
|
|
800
|
+
z.strictObject({
|
|
801
|
+
effectId: z.literal("inner-shadow"),
|
|
802
|
+
options: z.strictObject({}).optional()
|
|
776
803
|
}),
|
|
777
|
-
z
|
|
778
|
-
effectId: z
|
|
779
|
-
options: z
|
|
780
|
-
mode: z
|
|
804
|
+
z.strictObject({
|
|
805
|
+
effectId: z.literal("neumorphic-shadow"),
|
|
806
|
+
options: z.strictObject({
|
|
807
|
+
mode: z.enum(["raised", "pressed"]).optional(),
|
|
781
808
|
intensity: buttonShadowIntensitySchema.optional()
|
|
782
809
|
}).optional()
|
|
783
810
|
}),
|
|
784
|
-
z
|
|
785
|
-
effectId: z
|
|
786
|
-
options: z
|
|
811
|
+
z.strictObject({
|
|
812
|
+
effectId: z.literal("retro-3d-shadow"),
|
|
813
|
+
options: z.strictObject({}).optional()
|
|
787
814
|
}),
|
|
788
|
-
z
|
|
789
|
-
effectId: z
|
|
790
|
-
options: z
|
|
815
|
+
z.strictObject({
|
|
816
|
+
effectId: z.literal("scale-up"),
|
|
817
|
+
options: z.strictObject({ scale: z.enum([
|
|
791
818
|
"1.02",
|
|
792
819
|
"1.03",
|
|
793
820
|
"1.05",
|
|
794
821
|
"1.10"
|
|
795
822
|
]).optional() }).optional()
|
|
796
823
|
}),
|
|
797
|
-
z
|
|
798
|
-
effectId: z
|
|
799
|
-
options: z
|
|
824
|
+
z.strictObject({
|
|
825
|
+
effectId: z.literal("scale-down"),
|
|
826
|
+
options: z.strictObject({ scale: z.enum([
|
|
800
827
|
"0.90",
|
|
801
828
|
"0.95",
|
|
802
829
|
"0.97",
|
|
803
830
|
"0.98"
|
|
804
831
|
]).optional() }).optional()
|
|
805
832
|
}),
|
|
806
|
-
z
|
|
807
|
-
effectId: z
|
|
808
|
-
options: z
|
|
833
|
+
z.strictObject({
|
|
834
|
+
effectId: z.literal("lift"),
|
|
835
|
+
options: z.strictObject({ amount: z.enum([
|
|
809
836
|
"0.25",
|
|
810
837
|
"0.5",
|
|
811
838
|
"1"
|
|
812
839
|
]).optional() }).optional()
|
|
813
840
|
}),
|
|
814
|
-
z
|
|
815
|
-
effectId: z
|
|
816
|
-
options: z
|
|
841
|
+
z.strictObject({
|
|
842
|
+
effectId: z.literal("press-down"),
|
|
843
|
+
options: z.strictObject({}).optional()
|
|
817
844
|
}),
|
|
818
|
-
z
|
|
819
|
-
effectId: z
|
|
820
|
-
options: z
|
|
845
|
+
z.strictObject({
|
|
846
|
+
effectId: z.literal("pop"),
|
|
847
|
+
options: z.strictObject({ intensity: z.enum([
|
|
821
848
|
"subtle",
|
|
822
849
|
"medium",
|
|
823
850
|
"dramatic"
|
|
824
851
|
]).optional() }).optional()
|
|
825
852
|
}),
|
|
826
|
-
z
|
|
827
|
-
effectId: z
|
|
828
|
-
options: z
|
|
829
|
-
height: z
|
|
830
|
-
origin: z
|
|
853
|
+
z.strictObject({
|
|
854
|
+
effectId: z.literal("border-bottom-grow"),
|
|
855
|
+
options: z.strictObject({
|
|
856
|
+
height: z.union([z.literal(1), z.literal(2)]).optional(),
|
|
857
|
+
origin: z.enum([
|
|
831
858
|
"left",
|
|
832
859
|
"center",
|
|
833
860
|
"right"
|
|
834
861
|
]).optional()
|
|
835
862
|
}).optional()
|
|
836
863
|
}),
|
|
837
|
-
z
|
|
838
|
-
effectId: z
|
|
839
|
-
options: z
|
|
864
|
+
z.strictObject({
|
|
865
|
+
effectId: z.literal("sketchy-border"),
|
|
866
|
+
options: z.strictObject({ intensity: buttonShadowIntensitySchema.optional() }).optional()
|
|
840
867
|
})
|
|
841
868
|
]);
|
|
842
|
-
const cornerStyleSchema = z
|
|
869
|
+
const cornerStyleSchema = z.enum([
|
|
843
870
|
"square",
|
|
844
871
|
"rounded",
|
|
845
872
|
"pill"
|
|
846
873
|
]);
|
|
847
|
-
const shadowSizeSchema = z
|
|
874
|
+
const shadowSizeSchema = z.enum([
|
|
848
875
|
"none",
|
|
849
876
|
"low",
|
|
850
877
|
"medium",
|
|
851
878
|
"high"
|
|
852
879
|
]);
|
|
853
|
-
const textTransformSchema = z
|
|
880
|
+
const textTransformSchema = z.enum([
|
|
854
881
|
"none",
|
|
855
882
|
"uppercase",
|
|
856
883
|
"lowercase",
|
|
857
884
|
"capitalize"
|
|
858
885
|
]);
|
|
859
|
-
const fontWeightSchema = z
|
|
860
|
-
z
|
|
861
|
-
z
|
|
862
|
-
z
|
|
886
|
+
const fontWeightSchema = z.union([
|
|
887
|
+
z.literal(500),
|
|
888
|
+
z.literal(600),
|
|
889
|
+
z.literal(700)
|
|
863
890
|
]);
|
|
864
|
-
const buttonTypographySchema = z
|
|
865
|
-
const letterSpacingSchema = z
|
|
891
|
+
const buttonTypographySchema = z.enum(["body", "heading"]);
|
|
892
|
+
const letterSpacingSchema = z.enum([
|
|
866
893
|
"tight",
|
|
867
894
|
"normal",
|
|
868
895
|
"loose"
|
|
869
896
|
]);
|
|
870
|
-
const hoverTransformSchema = z
|
|
897
|
+
const hoverTransformSchema = z.enum([
|
|
871
898
|
"none",
|
|
872
899
|
"lift",
|
|
873
900
|
"scale",
|
|
874
901
|
"press"
|
|
875
902
|
]);
|
|
876
|
-
z
|
|
877
|
-
const buttonPaddingPresetSchema = z
|
|
903
|
+
z.enum(["none", "token"]);
|
|
904
|
+
const buttonPaddingPresetSchema = z.enum([
|
|
878
905
|
"compact",
|
|
879
906
|
"default",
|
|
880
907
|
"spacious"
|
|
881
908
|
]);
|
|
882
|
-
const gradientStyleSchema = z
|
|
909
|
+
const gradientStyleSchema = z.enum([
|
|
883
910
|
"linear",
|
|
884
911
|
"radial",
|
|
885
912
|
"conic"
|
|
886
913
|
]);
|
|
887
|
-
const gradientSharpnessSchema = z
|
|
914
|
+
const gradientSharpnessSchema = z.enum([
|
|
888
915
|
"smooth",
|
|
889
916
|
"medium",
|
|
890
917
|
"hard"
|
|
891
918
|
]);
|
|
892
|
-
const prioritySchema = z
|
|
893
|
-
z
|
|
894
|
-
z
|
|
895
|
-
z
|
|
919
|
+
const prioritySchema = z.union([
|
|
920
|
+
z.literal(1),
|
|
921
|
+
z.literal(2),
|
|
922
|
+
z.literal(3)
|
|
896
923
|
]);
|
|
897
|
-
z
|
|
898
|
-
const
|
|
924
|
+
const variantRoleSchema = z.enum(VARIANT_ROLES);
|
|
925
|
+
const buttonSurfaceFallbackSchema = z.discriminatedUnion("kind", [z.strictObject({ kind: z.literal("surface-outline") }), z.strictObject({
|
|
926
|
+
kind: z.literal("variant"),
|
|
927
|
+
role: variantRoleSchema
|
|
928
|
+
})]);
|
|
929
|
+
const standardButtonSurfacePolicy = {
|
|
930
|
+
primary: [{ kind: "surface-outline" }],
|
|
931
|
+
secondary: [{ kind: "surface-outline" }, {
|
|
932
|
+
kind: "variant",
|
|
933
|
+
role: "primary"
|
|
934
|
+
}],
|
|
935
|
+
outline: [{ kind: "surface-outline" }],
|
|
936
|
+
ghost: [{ kind: "surface-outline" }],
|
|
937
|
+
accent: [{ kind: "surface-outline" }, {
|
|
938
|
+
kind: "variant",
|
|
939
|
+
role: "primary"
|
|
940
|
+
}]
|
|
941
|
+
};
|
|
942
|
+
const STANDARD_BUTTON_SURFACE_POLICY = Object.freeze(Object.fromEntries(VARIANT_ROLES.map((role) => [role, Object.freeze([...standardButtonSurfacePolicy[role]])])));
|
|
943
|
+
function createStandardButtonSurfacePolicy() {
|
|
944
|
+
return Object.fromEntries(VARIANT_ROLES.map((role) => [role, [...STANDARD_BUTTON_SURFACE_POLICY[role]]]));
|
|
945
|
+
}
|
|
946
|
+
const buttonSurfacePolicyShape = Object.fromEntries(VARIANT_ROLES.map((role) => [role, z.array(buttonSurfaceFallbackSchema).max(VARIANT_ROLES.length)]));
|
|
947
|
+
const buttonSurfacePolicySchema = z.strictObject(buttonSurfacePolicyShape);
|
|
948
|
+
const buttonSizeNameSchema = z.enum([
|
|
899
949
|
"sm",
|
|
900
950
|
"md",
|
|
901
951
|
"lg",
|
|
@@ -909,13 +959,13 @@ const buttonSizeNameSchema = z$1.enum([
|
|
|
909
959
|
* generator trust the shape rather than defensively defaulting downstream.
|
|
910
960
|
*/
|
|
911
961
|
const PADDING_TOKEN_PATTERN = /^(?:0|\d+(?:\.\d+)?(?:rem|em|px|%))$/;
|
|
912
|
-
const paddingShorthandSchema = z
|
|
962
|
+
const paddingShorthandSchema = z.string().refine((value) => {
|
|
913
963
|
const parts = value.split(/\s+/).filter(Boolean);
|
|
914
964
|
return parts.length === 2 && parts.every((token) => PADDING_TOKEN_PATTERN.test(token));
|
|
915
965
|
}, { message: "Padding must be two space-separated CSS length tokens (e.g. \"0.5rem 1rem\"). Use `0` for zero." });
|
|
916
|
-
const buttonSizeConfigSchema = z
|
|
966
|
+
const buttonSizeConfigSchema = z.object({
|
|
917
967
|
padding: paddingShorthandSchema,
|
|
918
|
-
fontSize: z
|
|
968
|
+
fontSize: z.string().optional()
|
|
919
969
|
});
|
|
920
970
|
/**
|
|
921
971
|
* `xl` is optional on the wire so themes persisted before the `xl` size was
|
|
@@ -923,7 +973,7 @@ const buttonSizeConfigSchema = z$1.object({
|
|
|
923
973
|
* backfills it from `lg`, keeping `ButtonSizes` a complete `sm/md/lg/xl` map
|
|
924
974
|
* downstream — generators never need to deal with an undefined `xl`.
|
|
925
975
|
*/
|
|
926
|
-
const buttonSizesSchema = z
|
|
976
|
+
const buttonSizesSchema = z.object({
|
|
927
977
|
sm: buttonSizeConfigSchema,
|
|
928
978
|
md: buttonSizeConfigSchema,
|
|
929
979
|
lg: buttonSizeConfigSchema,
|
|
@@ -934,9 +984,9 @@ const buttonSizesSchema = z$1.object({
|
|
|
934
984
|
lg,
|
|
935
985
|
xl: xl ?? lg
|
|
936
986
|
}));
|
|
937
|
-
const buttonGlobalSettingsBaseSchema = z
|
|
987
|
+
const buttonGlobalSettingsBaseSchema = z.strictObject({
|
|
938
988
|
cornerStyle: cornerStyleSchema,
|
|
939
|
-
cornerRadius: z
|
|
989
|
+
cornerRadius: z.number().min(0).max(24).optional(),
|
|
940
990
|
/**
|
|
941
991
|
* Family-level shadow inherited by variants that don't set their own.
|
|
942
992
|
* Optional and flat-by-default: when omitted, buttons carry no drop shadow
|
|
@@ -948,23 +998,23 @@ const buttonGlobalSettingsBaseSchema = z$1.strictObject({
|
|
|
948
998
|
textTransform: textTransformSchema,
|
|
949
999
|
fontWeight: fontWeightSchema,
|
|
950
1000
|
typography: buttonTypographySchema.optional(),
|
|
951
|
-
fontSize: z
|
|
1001
|
+
fontSize: z.string().optional(),
|
|
952
1002
|
letterSpacing: letterSpacingSchema.optional(),
|
|
953
|
-
italic: z
|
|
1003
|
+
italic: z.boolean().optional(),
|
|
954
1004
|
paddingPreset: buttonPaddingPresetSchema.optional(),
|
|
955
1005
|
hoverTransform: hoverTransformSchema,
|
|
956
1006
|
gradientStyle: gradientStyleSchema.optional(),
|
|
957
|
-
gradientAngle: z
|
|
1007
|
+
gradientAngle: z.number().min(0).max(360).optional(),
|
|
958
1008
|
gradientSharpness: gradientSharpnessSchema.optional()
|
|
959
1009
|
});
|
|
960
|
-
const buttonGlobalSettingsSchema = z
|
|
961
|
-
hoverColor: z
|
|
962
|
-
hoverColorToken: z
|
|
1010
|
+
const buttonGlobalSettingsSchema = z.discriminatedUnion("hoverColor", [buttonGlobalSettingsBaseSchema.extend({
|
|
1011
|
+
hoverColor: z.literal("none"),
|
|
1012
|
+
hoverColorToken: z.never().optional()
|
|
963
1013
|
}), buttonGlobalSettingsBaseSchema.extend({
|
|
964
|
-
hoverColor: z
|
|
1014
|
+
hoverColor: z.literal("token"),
|
|
965
1015
|
hoverColorToken: opaqueButtonColourTokenSchema
|
|
966
1016
|
})]);
|
|
967
|
-
const gradientDirectionSchema$1 = z
|
|
1017
|
+
const gradientDirectionSchema$1 = z.enum([
|
|
968
1018
|
"to-r",
|
|
969
1019
|
"to-l",
|
|
970
1020
|
"to-t",
|
|
@@ -974,14 +1024,14 @@ const gradientDirectionSchema$1 = z$1.enum([
|
|
|
974
1024
|
"to-br",
|
|
975
1025
|
"to-bl"
|
|
976
1026
|
]);
|
|
977
|
-
const buttonColourTreatmentSchema = z
|
|
978
|
-
z
|
|
979
|
-
type: z
|
|
1027
|
+
const buttonColourTreatmentSchema = z.discriminatedUnion("type", [
|
|
1028
|
+
z.strictObject({
|
|
1029
|
+
type: z.literal("solid"),
|
|
980
1030
|
colorToken: opaqueButtonColourTokenSchema
|
|
981
1031
|
}),
|
|
982
|
-
z
|
|
983
|
-
type: z
|
|
984
|
-
stops: z
|
|
1032
|
+
z.strictObject({
|
|
1033
|
+
type: z.literal("gradient"),
|
|
1034
|
+
stops: z.array(opaqueButtonColourTokenSchema).min(2).transform((stops) => {
|
|
985
1035
|
const [first, second, ...rest] = stops;
|
|
986
1036
|
if (first === void 0 || second === void 0) throw new Error("Invariant: gradient stops passed the minimum length schema");
|
|
987
1037
|
return [
|
|
@@ -993,34 +1043,34 @@ const buttonColourTreatmentSchema = z$1.discriminatedUnion("type", [
|
|
|
993
1043
|
direction: gradientDirectionSchema$1,
|
|
994
1044
|
foregroundToken: opaqueButtonColourTokenSchema
|
|
995
1045
|
}),
|
|
996
|
-
z
|
|
997
|
-
type: z
|
|
998
|
-
role: z
|
|
1046
|
+
z.strictObject({
|
|
1047
|
+
type: z.literal("surface"),
|
|
1048
|
+
role: z.literal("link")
|
|
999
1049
|
})
|
|
1000
1050
|
]);
|
|
1001
1051
|
const buttonBackgroundSchema = buttonColourTreatmentSchema;
|
|
1002
|
-
const buttonBorderSchema = z
|
|
1003
|
-
const buttonVariantAffordanceSchema = z
|
|
1004
|
-
const variantShadowSchema = z
|
|
1005
|
-
elevation: z
|
|
1052
|
+
const buttonBorderSchema = z.strictObject({ widthClass: z.string() });
|
|
1053
|
+
const buttonVariantAffordanceSchema = z.strictObject({ iconId: z.string().min(1) });
|
|
1054
|
+
const variantShadowSchema = z.strictObject({
|
|
1055
|
+
elevation: z.enum([
|
|
1006
1056
|
"none",
|
|
1007
1057
|
"low",
|
|
1008
1058
|
"medium",
|
|
1009
1059
|
"high"
|
|
1010
1060
|
]),
|
|
1011
|
-
softness: z
|
|
1061
|
+
softness: z.enum([
|
|
1012
1062
|
"crisp",
|
|
1013
1063
|
"soft",
|
|
1014
1064
|
"hard"
|
|
1015
1065
|
]).nullable(),
|
|
1016
|
-
position: z
|
|
1066
|
+
position: z.enum(["bottom", "bottom-right"]).default("bottom"),
|
|
1017
1067
|
colorToken: opaqueButtonColourTokenSchema.optional()
|
|
1018
1068
|
});
|
|
1019
|
-
const variantEffectsSchema = z
|
|
1020
|
-
base: z
|
|
1021
|
-
hover: z
|
|
1022
|
-
active: z
|
|
1023
|
-
focus: z
|
|
1069
|
+
const variantEffectsSchema = z.strictObject({
|
|
1070
|
+
base: z.array(buttonEffectApplicationSchema).optional(),
|
|
1071
|
+
hover: z.array(buttonEffectApplicationSchema).optional(),
|
|
1072
|
+
active: z.array(buttonEffectApplicationSchema).optional(),
|
|
1073
|
+
focus: z.array(buttonEffectApplicationSchema).optional()
|
|
1024
1074
|
});
|
|
1025
1075
|
/**
|
|
1026
1076
|
* Per-variant size overrides schema — every entry is optional.
|
|
@@ -1029,7 +1079,7 @@ const variantEffectsSchema = z$1.strictObject({
|
|
|
1029
1079
|
* for that size on this variant. Missing sizes fall through to theme.sizes,
|
|
1030
1080
|
* then system defaults.
|
|
1031
1081
|
*/
|
|
1032
|
-
const variantSizeOverridesSchema = z
|
|
1082
|
+
const variantSizeOverridesSchema = z.object({
|
|
1033
1083
|
sm: buttonSizeConfigSchema.optional(),
|
|
1034
1084
|
md: buttonSizeConfigSchema.optional(),
|
|
1035
1085
|
lg: buttonSizeConfigSchema.optional(),
|
|
@@ -1041,14 +1091,14 @@ const variantSizeOverridesSchema = z$1.object({
|
|
|
1041
1091
|
* default (e.g. link-style variants declaring zero horizontal padding at
|
|
1042
1092
|
* every size).
|
|
1043
1093
|
*/
|
|
1044
|
-
const buttonVariantSchema = z
|
|
1094
|
+
const buttonVariantSchema = z.strictObject({
|
|
1045
1095
|
id: buttonVariantIdSchema,
|
|
1046
|
-
name: z
|
|
1047
|
-
enabled: z
|
|
1096
|
+
name: z.string().min(1).max(20),
|
|
1097
|
+
enabled: z.boolean(),
|
|
1048
1098
|
priority: prioritySchema,
|
|
1049
1099
|
background: buttonBackgroundSchema,
|
|
1050
1100
|
/** Tailwind radius token (e.g. `'rounded-md'`). Omit to inherit from `global.cornerStyle`. */
|
|
1051
|
-
borderRadius: z
|
|
1101
|
+
borderRadius: z.string().optional(),
|
|
1052
1102
|
shadow: variantShadowSchema.optional(),
|
|
1053
1103
|
border: buttonBorderSchema.optional(),
|
|
1054
1104
|
hoverBackgroundToken: opaqueButtonColourTokenSchema.optional(),
|
|
@@ -1056,10 +1106,11 @@ const buttonVariantSchema = z$1.strictObject({
|
|
|
1056
1106
|
sizes: variantSizeOverridesSchema.optional(),
|
|
1057
1107
|
affordance: buttonVariantAffordanceSchema.optional()
|
|
1058
1108
|
});
|
|
1059
|
-
const buttonSystemSchema = z
|
|
1109
|
+
const buttonSystemSchema = z.strictObject({
|
|
1060
1110
|
global: buttonGlobalSettingsSchema,
|
|
1061
|
-
variants: z
|
|
1062
|
-
sizes: buttonSizesSchema.optional()
|
|
1111
|
+
variants: z.array(buttonVariantSchema).min(1).max(6),
|
|
1112
|
+
sizes: buttonSizesSchema.optional(),
|
|
1113
|
+
surfacePolicy: buttonSurfacePolicySchema.optional()
|
|
1063
1114
|
}).superRefine((system, ctx) => {
|
|
1064
1115
|
const seen = /* @__PURE__ */ new Set();
|
|
1065
1116
|
system.variants.forEach((variant, index) => {
|
|
@@ -1244,7 +1295,7 @@ function getButtonEffectPolicy(effectId) {
|
|
|
1244
1295
|
return Object.prototype.hasOwnProperty.call(BUTTON_EFFECT_POLICIES, effectId) ? BUTTON_EFFECT_POLICIES[effectId] : null;
|
|
1245
1296
|
}
|
|
1246
1297
|
//#endregion
|
|
1247
|
-
//#region ../theme-core/src/buttons/
|
|
1298
|
+
//#region ../theme-core/src/buttons/buttonColourContract.ts
|
|
1248
1299
|
const BUTTON_VISUAL_STATES = [
|
|
1249
1300
|
"base",
|
|
1250
1301
|
"hover",
|
|
@@ -1259,6 +1310,38 @@ const BUTTON_CONTRAST_POLICY = {
|
|
|
1259
1310
|
alphaBackgrounds: "reject-without-known-surface",
|
|
1260
1311
|
disabled: "retain-full-colour-contract"
|
|
1261
1312
|
};
|
|
1313
|
+
function validateButtonSurfaceContrast(input) {
|
|
1314
|
+
const ratio = contrastRatio(input.buttonPaint, input.surfaceHex);
|
|
1315
|
+
return ratio >= BUTTON_CONTRAST_POLICY.nonTextMinimumRatio ? { ok: true } : {
|
|
1316
|
+
ok: false,
|
|
1317
|
+
error: {
|
|
1318
|
+
tag: "insufficient_surface_contrast",
|
|
1319
|
+
variantId: input.variantId,
|
|
1320
|
+
state: input.state,
|
|
1321
|
+
buttonPaint: input.buttonPaint,
|
|
1322
|
+
surface: input.surfaceHex,
|
|
1323
|
+
ratio,
|
|
1324
|
+
requiredRatio: BUTTON_CONTRAST_POLICY.nonTextMinimumRatio
|
|
1325
|
+
}
|
|
1326
|
+
};
|
|
1327
|
+
}
|
|
1328
|
+
function validateButtonTextContrast(input) {
|
|
1329
|
+
const ratio = contrastRatio(input.backgroundHex, input.foregroundHex);
|
|
1330
|
+
return ratio >= BUTTON_CONTRAST_POLICY.textMinimumRatio ? { ok: true } : {
|
|
1331
|
+
ok: false,
|
|
1332
|
+
error: {
|
|
1333
|
+
tag: "insufficient_contrast",
|
|
1334
|
+
variantId: input.variantId,
|
|
1335
|
+
state: input.state,
|
|
1336
|
+
background: input.background,
|
|
1337
|
+
foreground: input.foreground,
|
|
1338
|
+
ratio,
|
|
1339
|
+
requiredRatio: BUTTON_CONTRAST_POLICY.textMinimumRatio
|
|
1340
|
+
}
|
|
1341
|
+
};
|
|
1342
|
+
}
|
|
1343
|
+
//#endregion
|
|
1344
|
+
//#region ../theme-core/src/buttons/resolveButtonColourStates.ts
|
|
1262
1345
|
function compileButtonColourStates(input) {
|
|
1263
1346
|
const baseTransition = applyColourEffects({
|
|
1264
1347
|
variantId: input.variant.id,
|
|
@@ -1298,7 +1381,9 @@ function compileButtonColourStates(input) {
|
|
|
1298
1381
|
variantId: input.variant.id,
|
|
1299
1382
|
state,
|
|
1300
1383
|
treatment: stateTreatments[state],
|
|
1301
|
-
palette: input.palette
|
|
1384
|
+
palette: input.palette,
|
|
1385
|
+
surface: input.surface,
|
|
1386
|
+
hasBoundary: input.variant.border !== void 0
|
|
1302
1387
|
});
|
|
1303
1388
|
if (!result.ok) return result;
|
|
1304
1389
|
resolved[state] = result.colour;
|
|
@@ -1366,22 +1451,42 @@ function applyColourEffects(input) {
|
|
|
1366
1451
|
function resolveTreatment(input) {
|
|
1367
1452
|
const treatment = input.treatment;
|
|
1368
1453
|
switch (treatment.type) {
|
|
1369
|
-
case "surface":
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1454
|
+
case "surface":
|
|
1455
|
+
if (input.surface) {
|
|
1456
|
+
const foreground = validateButtonTextContrast({
|
|
1457
|
+
...input,
|
|
1458
|
+
background: "surface",
|
|
1459
|
+
backgroundHex: input.surface.backgroundHex,
|
|
1460
|
+
foreground: "surface-foreground",
|
|
1461
|
+
foregroundHex: input.surface.foregroundHex
|
|
1462
|
+
});
|
|
1463
|
+
if (!foreground.ok) return foreground;
|
|
1376
1464
|
}
|
|
1377
|
-
|
|
1465
|
+
if (input.surface && input.hasBoundary) {
|
|
1466
|
+
const boundary = validateButtonSurfaceContrast({
|
|
1467
|
+
...input,
|
|
1468
|
+
buttonPaint: input.surface.foregroundHex,
|
|
1469
|
+
surfaceHex: input.surface.backgroundHex
|
|
1470
|
+
});
|
|
1471
|
+
if (!boundary.ok) return boundary;
|
|
1472
|
+
}
|
|
1473
|
+
return {
|
|
1474
|
+
ok: true,
|
|
1475
|
+
colour: {
|
|
1476
|
+
kind: "surface",
|
|
1477
|
+
role: treatment.role,
|
|
1478
|
+
backgroundCss: "transparent",
|
|
1479
|
+
foregroundCss: input.surface?.foregroundCss ?? surfaceForegroundValue(treatment.role)
|
|
1480
|
+
}
|
|
1481
|
+
};
|
|
1378
1482
|
case "solid": return resolveSolid(input, treatment.colorToken);
|
|
1379
1483
|
case "gradient": return resolveGradient(input, treatment);
|
|
1380
1484
|
}
|
|
1381
1485
|
}
|
|
1382
1486
|
function resolveFocusIndicator(colour) {
|
|
1383
1487
|
switch (colour.kind) {
|
|
1384
|
-
case "solid":
|
|
1488
|
+
case "solid":
|
|
1489
|
+
case "known-solid": return {
|
|
1385
1490
|
kind: "two-tone",
|
|
1386
1491
|
innerCss: colour.foregroundCss,
|
|
1387
1492
|
outerCss: colour.backgroundCss,
|
|
@@ -1415,7 +1520,7 @@ function resolveSolid(input, backgroundToken) {
|
|
|
1415
1520
|
foregroundToken
|
|
1416
1521
|
}
|
|
1417
1522
|
};
|
|
1418
|
-
const contrast =
|
|
1523
|
+
const contrast = validateButtonTextContrast({
|
|
1419
1524
|
...input,
|
|
1420
1525
|
background: backgroundToken,
|
|
1421
1526
|
backgroundHex: backgroundHex.hex,
|
|
@@ -1423,6 +1528,14 @@ function resolveSolid(input, backgroundToken) {
|
|
|
1423
1528
|
foregroundHex
|
|
1424
1529
|
});
|
|
1425
1530
|
if (!contrast.ok) return contrast;
|
|
1531
|
+
if (input.surface) {
|
|
1532
|
+
const boundary = validateButtonSurfaceContrast({
|
|
1533
|
+
...input,
|
|
1534
|
+
buttonPaint: backgroundHex.hex,
|
|
1535
|
+
surfaceHex: input.surface.backgroundHex
|
|
1536
|
+
});
|
|
1537
|
+
if (!boundary.ok) return boundary;
|
|
1538
|
+
}
|
|
1426
1539
|
return {
|
|
1427
1540
|
ok: true,
|
|
1428
1541
|
colour: {
|
|
@@ -1452,7 +1565,7 @@ function resolveGradient(input, treatment) {
|
|
|
1452
1565
|
for (let sample = 0; sample <= BUTTON_CONTRAST_POLICY.gradientSamplesPerSegment; sample += 1) {
|
|
1453
1566
|
const position = sample / BUTTON_CONTRAST_POLICY.gradientSamplesPerSegment;
|
|
1454
1567
|
const sampleHex = interpolateHex(start, end, position);
|
|
1455
|
-
const contrast =
|
|
1568
|
+
const contrast = validateButtonTextContrast({
|
|
1456
1569
|
...input,
|
|
1457
1570
|
background: `${startToken}→${endToken}@${position.toFixed(2)}`,
|
|
1458
1571
|
backgroundHex: sampleHex,
|
|
@@ -1460,6 +1573,14 @@ function resolveGradient(input, treatment) {
|
|
|
1460
1573
|
foregroundHex: foregroundHex.hex
|
|
1461
1574
|
});
|
|
1462
1575
|
if (!contrast.ok) return contrast;
|
|
1576
|
+
if (input.surface) {
|
|
1577
|
+
const boundary = validateButtonSurfaceContrast({
|
|
1578
|
+
...input,
|
|
1579
|
+
buttonPaint: sampleHex,
|
|
1580
|
+
surfaceHex: input.surface.backgroundHex
|
|
1581
|
+
});
|
|
1582
|
+
if (!boundary.ok) return boundary;
|
|
1583
|
+
}
|
|
1463
1584
|
}
|
|
1464
1585
|
}
|
|
1465
1586
|
const direction = GRADIENT_DIRECTION_MAP[treatment.direction] ?? "to right";
|
|
@@ -1489,21 +1610,6 @@ function paletteHex(input, token) {
|
|
|
1489
1610
|
}
|
|
1490
1611
|
};
|
|
1491
1612
|
}
|
|
1492
|
-
function validateContrast(input) {
|
|
1493
|
-
const ratio = contrastRatio(input.backgroundHex, input.foregroundHex);
|
|
1494
|
-
return ratio >= BUTTON_CONTRAST_POLICY.textMinimumRatio ? { ok: true } : {
|
|
1495
|
-
ok: false,
|
|
1496
|
-
error: {
|
|
1497
|
-
tag: "insufficient_contrast",
|
|
1498
|
-
variantId: input.variantId,
|
|
1499
|
-
state: input.state,
|
|
1500
|
-
background: input.background,
|
|
1501
|
-
foreground: input.foreground,
|
|
1502
|
-
ratio,
|
|
1503
|
-
requiredRatio: BUTTON_CONTRAST_POLICY.textMinimumRatio
|
|
1504
|
-
}
|
|
1505
|
-
};
|
|
1506
|
-
}
|
|
1507
1613
|
function tokenCss(token) {
|
|
1508
1614
|
return `rgb(var(--tb-${token}))`;
|
|
1509
1615
|
}
|
|
@@ -1610,7 +1716,14 @@ function parseThemeForPersistence(value) {
|
|
|
1610
1716
|
issues: parsed.error.issues
|
|
1611
1717
|
}
|
|
1612
1718
|
};
|
|
1613
|
-
const
|
|
1719
|
+
const parsedTheme = parsed.data;
|
|
1720
|
+
const theme = parsedTheme.buttons && !parsedTheme.buttons.surfacePolicy ? {
|
|
1721
|
+
...parsedTheme,
|
|
1722
|
+
buttons: {
|
|
1723
|
+
...parsedTheme.buttons,
|
|
1724
|
+
surfacePolicy: createStandardButtonSurfacePolicy()
|
|
1725
|
+
}
|
|
1726
|
+
} : parsedTheme;
|
|
1614
1727
|
if (!theme.buttons) return {
|
|
1615
1728
|
ok: true,
|
|
1616
1729
|
value: theme
|
|
@@ -1689,6 +1802,14 @@ function shadeBackgroundEffect(config) {
|
|
|
1689
1802
|
}
|
|
1690
1803
|
};
|
|
1691
1804
|
}
|
|
1805
|
+
//#endregion
|
|
1806
|
+
//#region ../theme-core/src/utils/tokenOrColor.ts
|
|
1807
|
+
/**
|
|
1808
|
+
* Runtime color-reference fields intentionally accept any string, including
|
|
1809
|
+
* the legacy empty-string "no color" sentinel. Semantic validation needs
|
|
1810
|
+
* palette context and happens in `parseThemeColorReference`.
|
|
1811
|
+
*/
|
|
1812
|
+
const tokenOrCssColorValueSchema = z.string();
|
|
1692
1813
|
buttonSizeNameSchema.options;
|
|
1693
1814
|
//#endregion
|
|
1694
1815
|
//#region ../theme-core/src/buttons/styles/domain.ts
|
|
@@ -1732,6 +1853,7 @@ function resolveButtonStyleRecipe(recipe, parameters) {
|
|
|
1732
1853
|
const buttonSystem = {
|
|
1733
1854
|
global: definition.global,
|
|
1734
1855
|
variants: PUBLIC_BUTTON_ROLES.map((role) => roles[role]),
|
|
1856
|
+
surfacePolicy: definition.surfacePolicy ?? createStandardButtonSurfacePolicy(),
|
|
1735
1857
|
...definition.sizes ? { sizes: definition.sizes } : {}
|
|
1736
1858
|
};
|
|
1737
1859
|
const parsedButtonSystem = buttonSystemSchema.safeParse(buttonSystem);
|
|
@@ -1792,15 +1914,15 @@ const BUTTON_STYLE_IDS = [
|
|
|
1792
1914
|
"ornate-ritual",
|
|
1793
1915
|
"quiet-arrow"
|
|
1794
1916
|
];
|
|
1795
|
-
const quietArrowParametersSchema = z
|
|
1796
|
-
const emptyParametersSchema$1 = z
|
|
1917
|
+
const quietArrowParametersSchema = z.object({ secondaryTreatment: z.enum(["outlined", "solid-accent"]) }).strict();
|
|
1918
|
+
const emptyParametersSchema$1 = z.object({}).strict();
|
|
1797
1919
|
function selectionBranch(styleId, parameters) {
|
|
1798
|
-
return z
|
|
1799
|
-
styleId: z
|
|
1920
|
+
return z.object({
|
|
1921
|
+
styleId: z.literal(styleId),
|
|
1800
1922
|
parameters
|
|
1801
1923
|
}).strict();
|
|
1802
1924
|
}
|
|
1803
|
-
z
|
|
1925
|
+
z.discriminatedUnion("styleId", [
|
|
1804
1926
|
selectionBranch("soft-pill", emptyParametersSchema$1),
|
|
1805
1927
|
selectionBranch("earth-pill", emptyParametersSchema$1),
|
|
1806
1928
|
selectionBranch("confident-chip", emptyParametersSchema$1),
|
|
@@ -1945,7 +2067,7 @@ const quietArrowRecipe = defineButtonStyleRecipe({
|
|
|
1945
2067
|
});
|
|
1946
2068
|
//#endregion
|
|
1947
2069
|
//#region ../theme-core/src/buttons/styles/recipes/defineStaticButtonStyleRecipe.ts
|
|
1948
|
-
const emptyParametersSchema = z
|
|
2070
|
+
const emptyParametersSchema = z.object({}).strict();
|
|
1949
2071
|
function defineStaticButtonStyleRecipe(input) {
|
|
1950
2072
|
const system = normalizeSystem(input.system);
|
|
1951
2073
|
return defineButtonStyleRecipe({
|
|
@@ -3311,7 +3433,7 @@ function presetCategory(recipe) {
|
|
|
3311
3433
|
//#region ../theme-core/src/cards/types.ts
|
|
3312
3434
|
const cardVariantRoleValues = ["default", "alternative"];
|
|
3313
3435
|
const boxlessCardVariantValue = "none";
|
|
3314
|
-
const cardSpacingSchema = z
|
|
3436
|
+
const cardSpacingSchema = z.enum([
|
|
3315
3437
|
"none",
|
|
3316
3438
|
"compact",
|
|
3317
3439
|
"cozy",
|
|
@@ -3319,7 +3441,7 @@ const cardSpacingSchema = z$1.enum([
|
|
|
3319
3441
|
"comfortable",
|
|
3320
3442
|
"spacious"
|
|
3321
3443
|
]);
|
|
3322
|
-
const gradientDirectionSchema = z
|
|
3444
|
+
const gradientDirectionSchema = z.enum([
|
|
3323
3445
|
"to-r",
|
|
3324
3446
|
"to-l",
|
|
3325
3447
|
"to-t",
|
|
@@ -3329,27 +3451,27 @@ const gradientDirectionSchema = z$1.enum([
|
|
|
3329
3451
|
"to-br",
|
|
3330
3452
|
"to-bl"
|
|
3331
3453
|
]);
|
|
3332
|
-
z
|
|
3333
|
-
const boxStylesCardVariantSchema = z
|
|
3334
|
-
const cardBackgroundSchema = z
|
|
3335
|
-
z
|
|
3336
|
-
type: z
|
|
3454
|
+
z.enum(cardVariantRoleValues);
|
|
3455
|
+
const boxStylesCardVariantSchema = z.enum([...cardVariantRoleValues, boxlessCardVariantValue]);
|
|
3456
|
+
const cardBackgroundSchema = z.discriminatedUnion("type", [
|
|
3457
|
+
z.object({
|
|
3458
|
+
type: z.literal("solid"),
|
|
3337
3459
|
colorToken: themeColorTokenSchema
|
|
3338
3460
|
}),
|
|
3339
|
-
z
|
|
3340
|
-
type: z
|
|
3461
|
+
z.object({
|
|
3462
|
+
type: z.literal("gradient"),
|
|
3341
3463
|
fromToken: themeColorTokenSchema,
|
|
3342
3464
|
toToken: themeColorTokenSchema,
|
|
3343
3465
|
direction: gradientDirectionSchema
|
|
3344
3466
|
}),
|
|
3345
|
-
z
|
|
3467
|
+
z.object({ type: z.literal("transparent") })
|
|
3346
3468
|
]);
|
|
3347
|
-
const cardBorderSchema = z
|
|
3348
|
-
widthClass: z
|
|
3469
|
+
const cardBorderSchema = z.object({
|
|
3470
|
+
widthClass: z.string(),
|
|
3349
3471
|
colorToken: themeColorTokenSchema
|
|
3350
3472
|
});
|
|
3351
3473
|
/** Per-corner radius value. `expressive` is a large block-radius multiple. */
|
|
3352
|
-
const cardCornerValueSchema = z
|
|
3474
|
+
const cardCornerValueSchema = z.enum([
|
|
3353
3475
|
"square",
|
|
3354
3476
|
"soft",
|
|
3355
3477
|
"rounded",
|
|
@@ -3360,54 +3482,54 @@ const cardCornerValueSchema = z$1.enum([
|
|
|
3360
3482
|
* A single accented card edge (e.g. a left accent bar). When set, it replaces
|
|
3361
3483
|
* the full `border` so the card reads as edge-accented rather than outlined.
|
|
3362
3484
|
*/
|
|
3363
|
-
const cardAccentEdgeSchema = z
|
|
3364
|
-
edge: z
|
|
3485
|
+
const cardAccentEdgeSchema = z.object({
|
|
3486
|
+
edge: z.enum([
|
|
3365
3487
|
"left",
|
|
3366
3488
|
"top",
|
|
3367
3489
|
"right",
|
|
3368
3490
|
"bottom"
|
|
3369
3491
|
]),
|
|
3370
3492
|
colorToken: themeColorTokenSchema,
|
|
3371
|
-
width: z
|
|
3493
|
+
width: z.enum([
|
|
3372
3494
|
"thin",
|
|
3373
3495
|
"medium",
|
|
3374
3496
|
"thick",
|
|
3375
3497
|
"heavy"
|
|
3376
3498
|
])
|
|
3377
3499
|
});
|
|
3378
|
-
const cardCornerRadiiSchema = z
|
|
3500
|
+
const cardCornerRadiiSchema = z.object({
|
|
3379
3501
|
topLeft: cardCornerValueSchema.optional(),
|
|
3380
3502
|
topRight: cardCornerValueSchema.optional(),
|
|
3381
3503
|
bottomLeft: cardCornerValueSchema.optional(),
|
|
3382
3504
|
bottomRight: cardCornerValueSchema.optional()
|
|
3383
3505
|
});
|
|
3384
|
-
const cardVariantSchema = z
|
|
3385
|
-
id: z
|
|
3386
|
-
name: z
|
|
3387
|
-
enabled: z
|
|
3388
|
-
priority: z
|
|
3389
|
-
z
|
|
3390
|
-
z
|
|
3391
|
-
z
|
|
3506
|
+
const cardVariantSchema = z.object({
|
|
3507
|
+
id: z.string(),
|
|
3508
|
+
name: z.string().min(1).max(20),
|
|
3509
|
+
enabled: z.boolean(),
|
|
3510
|
+
priority: z.union([
|
|
3511
|
+
z.literal(1),
|
|
3512
|
+
z.literal(2),
|
|
3513
|
+
z.literal(3)
|
|
3392
3514
|
]),
|
|
3393
3515
|
background: cardBackgroundSchema,
|
|
3394
3516
|
spacing: cardSpacingSchema,
|
|
3395
3517
|
foregroundToken: themeColorTokenSchema.optional(),
|
|
3396
|
-
shadow: z
|
|
3397
|
-
elevation: z
|
|
3518
|
+
shadow: z.object({
|
|
3519
|
+
elevation: z.enum([
|
|
3398
3520
|
"none",
|
|
3399
3521
|
"low",
|
|
3400
3522
|
"medium",
|
|
3401
3523
|
"high"
|
|
3402
3524
|
]),
|
|
3403
|
-
softness: z
|
|
3525
|
+
softness: z.enum([
|
|
3404
3526
|
"crisp",
|
|
3405
3527
|
"soft",
|
|
3406
3528
|
"hard"
|
|
3407
3529
|
]).nullable(),
|
|
3408
|
-
position: z
|
|
3530
|
+
position: z.enum(["bottom", "bottom-right"]).default("bottom")
|
|
3409
3531
|
}).optional(),
|
|
3410
|
-
corners: z
|
|
3532
|
+
corners: z.enum([
|
|
3411
3533
|
"square",
|
|
3412
3534
|
"soft",
|
|
3413
3535
|
"rounded",
|
|
@@ -3417,13 +3539,13 @@ const cardVariantSchema = z$1.object({
|
|
|
3417
3539
|
border: cardBorderSchema.optional(),
|
|
3418
3540
|
accentEdge: cardAccentEdgeSchema.optional()
|
|
3419
3541
|
});
|
|
3420
|
-
const cardSystemSchema = z
|
|
3542
|
+
const cardSystemSchema = z.object({ variants: z.array(cardVariantSchema).min(1).max(3) });
|
|
3421
3543
|
//#endregion
|
|
3422
3544
|
//#region ../theme-core/src/accordions/types.ts
|
|
3423
3545
|
/**
|
|
3424
3546
|
* Accordion icon styles for expand/collapse indicators
|
|
3425
3547
|
*/
|
|
3426
|
-
const accordionIconSchema = z
|
|
3548
|
+
const accordionIconSchema = z.enum([
|
|
3427
3549
|
"plus-minus",
|
|
3428
3550
|
"chevron",
|
|
3429
3551
|
"caret",
|
|
@@ -3434,12 +3556,12 @@ const accordionIconSchema = z$1.enum([
|
|
|
3434
3556
|
* Accordion configuration for a theme
|
|
3435
3557
|
* Single style per theme (no variants needed)
|
|
3436
3558
|
*/
|
|
3437
|
-
const accordionSystemSchema = z
|
|
3438
|
-
background: z
|
|
3439
|
-
type: z
|
|
3559
|
+
const accordionSystemSchema = z.object({
|
|
3560
|
+
background: z.object({
|
|
3561
|
+
type: z.literal("solid"),
|
|
3440
3562
|
colorToken: themeColorTokenSchema
|
|
3441
3563
|
}).nullable(),
|
|
3442
|
-
spacing: z
|
|
3564
|
+
spacing: z.enum([
|
|
3443
3565
|
"none",
|
|
3444
3566
|
"compact",
|
|
3445
3567
|
"cozy",
|
|
@@ -3447,84 +3569,84 @@ const accordionSystemSchema = z$1.object({
|
|
|
3447
3569
|
"comfortable",
|
|
3448
3570
|
"spacious"
|
|
3449
3571
|
]),
|
|
3450
|
-
corners: z
|
|
3572
|
+
corners: z.enum([
|
|
3451
3573
|
"square",
|
|
3452
3574
|
"soft",
|
|
3453
3575
|
"rounded",
|
|
3454
3576
|
"pill"
|
|
3455
3577
|
]).nullable(),
|
|
3456
|
-
border: z
|
|
3457
|
-
widthClass: z
|
|
3578
|
+
border: z.object({
|
|
3579
|
+
widthClass: z.string(),
|
|
3458
3580
|
colorToken: themeColorTokenSchema
|
|
3459
3581
|
}).nullable(),
|
|
3460
|
-
shadow: z
|
|
3461
|
-
elevation: z
|
|
3582
|
+
shadow: z.object({
|
|
3583
|
+
elevation: z.enum([
|
|
3462
3584
|
"none",
|
|
3463
3585
|
"low",
|
|
3464
3586
|
"medium",
|
|
3465
3587
|
"high"
|
|
3466
3588
|
]),
|
|
3467
|
-
softness: z
|
|
3589
|
+
softness: z.enum([
|
|
3468
3590
|
"soft",
|
|
3469
3591
|
"crisp",
|
|
3470
3592
|
"hard"
|
|
3471
3593
|
]).nullable(),
|
|
3472
|
-
position: z
|
|
3594
|
+
position: z.enum(["bottom", "bottom-right"])
|
|
3473
3595
|
}).nullable(),
|
|
3474
|
-
icon: z
|
|
3596
|
+
icon: z.object({
|
|
3475
3597
|
style: accordionIconSchema,
|
|
3476
|
-
position: z
|
|
3477
|
-
size: z
|
|
3598
|
+
position: z.enum(["left", "right"]),
|
|
3599
|
+
size: z.enum([
|
|
3478
3600
|
"sm",
|
|
3479
3601
|
"md",
|
|
3480
3602
|
"lg"
|
|
3481
3603
|
]),
|
|
3482
3604
|
colorToken: themeColorTokenSchema.optional()
|
|
3483
3605
|
}),
|
|
3484
|
-
trigger: z
|
|
3606
|
+
trigger: z.object({
|
|
3485
3607
|
textColorToken: themeColorTokenSchema,
|
|
3486
|
-
fontWeight: z
|
|
3608
|
+
fontWeight: z.enum([
|
|
3487
3609
|
"regular",
|
|
3488
3610
|
"medium",
|
|
3489
3611
|
"semibold",
|
|
3490
3612
|
"bold"
|
|
3491
3613
|
]).nullable(),
|
|
3492
|
-
fontFamily: z
|
|
3493
|
-
fontScale: z
|
|
3614
|
+
fontFamily: z.enum(["body", "heading"]).optional(),
|
|
3615
|
+
fontScale: z.enum([
|
|
3494
3616
|
"body",
|
|
3495
3617
|
"md",
|
|
3496
3618
|
"lg"
|
|
3497
3619
|
]).optional(),
|
|
3498
|
-
letterSpacing: z
|
|
3620
|
+
letterSpacing: z.enum([
|
|
3499
3621
|
"normal",
|
|
3500
3622
|
"tight",
|
|
3501
3623
|
"wide"
|
|
3502
3624
|
]).optional(),
|
|
3503
|
-
textTransform: z
|
|
3625
|
+
textTransform: z.enum(["none", "uppercase"]).optional()
|
|
3504
3626
|
}),
|
|
3505
|
-
hover: z
|
|
3627
|
+
hover: z.object({
|
|
3506
3628
|
backgroundColorToken: themeColorTokenSchema.optional(),
|
|
3507
3629
|
textColorToken: themeColorTokenSchema.optional(),
|
|
3508
3630
|
borderColorToken: themeColorTokenSchema.optional()
|
|
3509
3631
|
}),
|
|
3510
|
-
openState: z
|
|
3632
|
+
openState: z.object({
|
|
3511
3633
|
backgroundColorToken: themeColorTokenSchema.optional(),
|
|
3512
3634
|
triggerColorToken: themeColorTokenSchema.optional(),
|
|
3513
|
-
accent: z
|
|
3514
|
-
edge: z
|
|
3635
|
+
accent: z.object({
|
|
3636
|
+
edge: z.enum([
|
|
3515
3637
|
"left",
|
|
3516
3638
|
"top",
|
|
3517
3639
|
"bottom"
|
|
3518
3640
|
]),
|
|
3519
3641
|
colorToken: themeColorTokenSchema,
|
|
3520
|
-
thickness: z
|
|
3642
|
+
thickness: z.enum([
|
|
3521
3643
|
"thin",
|
|
3522
3644
|
"medium",
|
|
3523
3645
|
"thick"
|
|
3524
3646
|
])
|
|
3525
3647
|
}).optional()
|
|
3526
3648
|
}).optional(),
|
|
3527
|
-
content: z
|
|
3649
|
+
content: z.object({ textColorToken: themeColorTokenSchema })
|
|
3528
3650
|
});
|
|
3529
3651
|
//#endregion
|
|
3530
3652
|
//#region ../theme-core/src/inputs/types.ts
|
|
@@ -3538,80 +3660,80 @@ const accordionSystemSchema = z$1.object({
|
|
|
3538
3660
|
*
|
|
3539
3661
|
* Single configuration per theme (no variants needed for inputs)
|
|
3540
3662
|
*/
|
|
3541
|
-
const inputSystemSchema = z
|
|
3542
|
-
base: z
|
|
3543
|
-
background: z
|
|
3544
|
-
type: z
|
|
3663
|
+
const inputSystemSchema = z.object({
|
|
3664
|
+
base: z.object({
|
|
3665
|
+
background: z.union([z.object({
|
|
3666
|
+
type: z.literal("solid"),
|
|
3545
3667
|
colorToken: themeColorTokenSchema
|
|
3546
|
-
}), z
|
|
3668
|
+
}), z.object({ type: z.literal("transparent") })]),
|
|
3547
3669
|
textColorToken: themeColorTokenSchema,
|
|
3548
|
-
border: z
|
|
3549
|
-
widthClass: z
|
|
3670
|
+
border: z.object({
|
|
3671
|
+
widthClass: z.string(),
|
|
3550
3672
|
colorToken: themeColorTokenSchema,
|
|
3551
|
-
style: z
|
|
3673
|
+
style: z.enum(["all", "underline"]).optional()
|
|
3552
3674
|
}),
|
|
3553
|
-
corners: z
|
|
3675
|
+
corners: z.enum([
|
|
3554
3676
|
"square",
|
|
3555
3677
|
"soft",
|
|
3556
3678
|
"rounded",
|
|
3557
3679
|
"pill"
|
|
3558
3680
|
]).nullable(),
|
|
3559
|
-
shadow: z
|
|
3560
|
-
elevation: z
|
|
3681
|
+
shadow: z.object({
|
|
3682
|
+
elevation: z.enum([
|
|
3561
3683
|
"none",
|
|
3562
3684
|
"low",
|
|
3563
3685
|
"medium"
|
|
3564
3686
|
]),
|
|
3565
|
-
softness: z
|
|
3687
|
+
softness: z.enum([
|
|
3566
3688
|
"soft",
|
|
3567
3689
|
"crisp",
|
|
3568
3690
|
"hard"
|
|
3569
3691
|
]).nullable()
|
|
3570
3692
|
}).nullable(),
|
|
3571
|
-
spacing: z
|
|
3693
|
+
spacing: z.enum([
|
|
3572
3694
|
"compact",
|
|
3573
3695
|
"cozy",
|
|
3574
3696
|
"medium",
|
|
3575
3697
|
"comfortable"
|
|
3576
3698
|
]),
|
|
3577
|
-
fontSize: z
|
|
3699
|
+
fontSize: z.enum([
|
|
3578
3700
|
"sm",
|
|
3579
3701
|
"base",
|
|
3580
3702
|
"lg"
|
|
3581
3703
|
])
|
|
3582
3704
|
}),
|
|
3583
|
-
label: z
|
|
3705
|
+
label: z.object({
|
|
3584
3706
|
textColorToken: themeColorTokenSchema,
|
|
3585
|
-
fontWeight: z
|
|
3707
|
+
fontWeight: z.enum([
|
|
3586
3708
|
"regular",
|
|
3587
3709
|
"medium",
|
|
3588
3710
|
"semibold",
|
|
3589
3711
|
"bold",
|
|
3590
3712
|
"black"
|
|
3591
3713
|
]),
|
|
3592
|
-
fontSize: z
|
|
3714
|
+
fontSize: z.enum([
|
|
3593
3715
|
"2xs",
|
|
3594
3716
|
"xs",
|
|
3595
3717
|
"sm",
|
|
3596
3718
|
"base"
|
|
3597
3719
|
]),
|
|
3598
|
-
textTransform: z
|
|
3720
|
+
textTransform: z.enum([
|
|
3599
3721
|
"none",
|
|
3600
3722
|
"uppercase",
|
|
3601
3723
|
"lowercase",
|
|
3602
3724
|
"capitalize"
|
|
3603
3725
|
]).optional(),
|
|
3604
|
-
letterSpacing: z
|
|
3726
|
+
letterSpacing: z.enum([
|
|
3605
3727
|
"normal",
|
|
3606
3728
|
"wide",
|
|
3607
3729
|
"wider",
|
|
3608
3730
|
"widest"
|
|
3609
3731
|
]).optional(),
|
|
3610
|
-
opacity: z
|
|
3732
|
+
opacity: z.number().min(.2).max(1).optional()
|
|
3611
3733
|
}),
|
|
3612
|
-
focus: z
|
|
3734
|
+
focus: z.object({
|
|
3613
3735
|
ringColorToken: themeColorTokenSchema,
|
|
3614
|
-
ringWidth: z
|
|
3736
|
+
ringWidth: z.enum([
|
|
3615
3737
|
"0",
|
|
3616
3738
|
"1",
|
|
3617
3739
|
"2",
|
|
@@ -3619,14 +3741,14 @@ const inputSystemSchema = z$1.object({
|
|
|
3619
3741
|
]),
|
|
3620
3742
|
borderColorToken: themeColorTokenSchema.optional()
|
|
3621
3743
|
}),
|
|
3622
|
-
error: z
|
|
3744
|
+
error: z.object({
|
|
3623
3745
|
borderColorToken: themeColorTokenSchema,
|
|
3624
3746
|
textColorToken: themeColorTokenSchema
|
|
3625
3747
|
}),
|
|
3626
|
-
disabled: z
|
|
3748
|
+
disabled: z.object({
|
|
3627
3749
|
backgroundColorToken: themeColorTokenSchema,
|
|
3628
3750
|
textColorToken: themeColorTokenSchema,
|
|
3629
|
-
opacity: z
|
|
3751
|
+
opacity: z.number().min(.3).max(.7)
|
|
3630
3752
|
})
|
|
3631
3753
|
});
|
|
3632
3754
|
//#endregion
|
|
@@ -3637,9 +3759,9 @@ const inputSystemSchema = z$1.object({
|
|
|
3637
3759
|
/**
|
|
3638
3760
|
* Gradient color stop
|
|
3639
3761
|
*/
|
|
3640
|
-
const gradientStopSchema = z
|
|
3762
|
+
const gradientStopSchema = z.object({
|
|
3641
3763
|
color: themeColorTokenSchema,
|
|
3642
|
-
position: z
|
|
3764
|
+
position: z.number().min(0).max(100)
|
|
3643
3765
|
});
|
|
3644
3766
|
/**
|
|
3645
3767
|
* Radial gradient shape. Optional; defaults to `circle` (the historical shape)
|
|
@@ -3648,7 +3770,7 @@ const gradientStopSchema = z$1.object({
|
|
|
3648
3770
|
* Named `RadialGradientShape` to avoid clashing with `styles/gradients.ts`'s
|
|
3649
3771
|
* `GradientShape` (which names the gradient *kind*: linear/radial/conic).
|
|
3650
3772
|
*/
|
|
3651
|
-
const radialGradientShapeSchema = z
|
|
3773
|
+
const radialGradientShapeSchema = z.enum(["circle", "ellipse"]);
|
|
3652
3774
|
/**
|
|
3653
3775
|
* Gradient configuration.
|
|
3654
3776
|
*
|
|
@@ -3659,16 +3781,16 @@ const radialGradientShapeSchema = z$1.enum(["circle", "ellipse"]);
|
|
|
3659
3781
|
* - radial: optional `shape` (circle/ellipse) + `position`
|
|
3660
3782
|
* - conic: optional `angle` (from-angle, degrees) + `position`
|
|
3661
3783
|
*/
|
|
3662
|
-
const gradientConfigSchema = z
|
|
3663
|
-
type: z
|
|
3784
|
+
const gradientConfigSchema = z.object({
|
|
3785
|
+
type: z.enum([
|
|
3664
3786
|
"linear",
|
|
3665
3787
|
"radial",
|
|
3666
3788
|
"conic"
|
|
3667
3789
|
]).default("linear"),
|
|
3668
|
-
angle: z
|
|
3790
|
+
angle: z.number().min(0).max(360).optional(),
|
|
3669
3791
|
shape: radialGradientShapeSchema.optional(),
|
|
3670
|
-
position: z
|
|
3671
|
-
stops: z
|
|
3792
|
+
position: z.string().optional(),
|
|
3793
|
+
stops: z.array(gradientStopSchema).min(2)
|
|
3672
3794
|
});
|
|
3673
3795
|
//#endregion
|
|
3674
3796
|
//#region ../theme-core/src/interactive/baseSchema.ts
|
|
@@ -3680,46 +3802,46 @@ const gradientConfigSchema = z$1.object({
|
|
|
3680
3802
|
/**
|
|
3681
3803
|
* Typography settings shared by buttons and nav links
|
|
3682
3804
|
*/
|
|
3683
|
-
const interactiveTypographySchema = z
|
|
3805
|
+
const interactiveTypographySchema = z.object({
|
|
3684
3806
|
/** Font family source */
|
|
3685
|
-
typography: z
|
|
3807
|
+
typography: z.enum(["body", "heading"]).default("body"),
|
|
3686
3808
|
/** Font weight */
|
|
3687
|
-
fontWeight: z
|
|
3809
|
+
fontWeight: z.enum([
|
|
3688
3810
|
"regular",
|
|
3689
3811
|
"medium",
|
|
3690
3812
|
"semibold",
|
|
3691
3813
|
"bold"
|
|
3692
3814
|
]).default("medium"),
|
|
3693
3815
|
/** Text transform */
|
|
3694
|
-
textTransform: z
|
|
3816
|
+
textTransform: z.enum([
|
|
3695
3817
|
"none",
|
|
3696
3818
|
"uppercase",
|
|
3697
3819
|
"capitalize"
|
|
3698
3820
|
]).default("none"),
|
|
3699
3821
|
/** Italic style */
|
|
3700
|
-
italic: z
|
|
3822
|
+
italic: z.boolean().default(false)
|
|
3701
3823
|
});
|
|
3702
3824
|
/**
|
|
3703
3825
|
* Effect application reference (shared between buttons and nav)
|
|
3704
3826
|
*/
|
|
3705
|
-
const effectApplicationSchema = z
|
|
3827
|
+
const effectApplicationSchema = z.object({
|
|
3706
3828
|
/** Effect preset ID */
|
|
3707
|
-
effectId: z
|
|
3829
|
+
effectId: z.string(),
|
|
3708
3830
|
/** User-provided customization options */
|
|
3709
|
-
options: z
|
|
3831
|
+
options: z.record(z.string(), z.any()).optional()
|
|
3710
3832
|
});
|
|
3711
3833
|
/**
|
|
3712
3834
|
* Effect composition by state (shared pattern)
|
|
3713
3835
|
*/
|
|
3714
|
-
const effectCompositionSchema = z
|
|
3836
|
+
const effectCompositionSchema = z.object({
|
|
3715
3837
|
/** Effects always applied */
|
|
3716
|
-
base: z
|
|
3838
|
+
base: z.array(effectApplicationSchema).optional(),
|
|
3717
3839
|
/** Effects applied on hover */
|
|
3718
|
-
hover: z
|
|
3840
|
+
hover: z.array(effectApplicationSchema).optional(),
|
|
3719
3841
|
/** Effects applied on active/pressed */
|
|
3720
|
-
active: z
|
|
3842
|
+
active: z.array(effectApplicationSchema).optional(),
|
|
3721
3843
|
/** Effects applied on focus */
|
|
3722
|
-
focus: z
|
|
3844
|
+
focus: z.array(effectApplicationSchema).optional()
|
|
3723
3845
|
});
|
|
3724
3846
|
//#endregion
|
|
3725
3847
|
//#region ../theme-core/src/navigation/types.ts
|
|
@@ -3731,7 +3853,7 @@ const effectCompositionSchema = z$1.object({
|
|
|
3731
3853
|
/**
|
|
3732
3854
|
* Padding preset options for nav links
|
|
3733
3855
|
*/
|
|
3734
|
-
const navLinkPaddingSchema = z
|
|
3856
|
+
const navLinkPaddingSchema = z.enum([
|
|
3735
3857
|
"none",
|
|
3736
3858
|
"compact",
|
|
3737
3859
|
"default"
|
|
@@ -3740,7 +3862,7 @@ const navLinkPaddingSchema = z$1.enum([
|
|
|
3740
3862
|
* Horizontal padding override for nav links.
|
|
3741
3863
|
* When set, overrides only the horizontal component of the `padding` preset.
|
|
3742
3864
|
*/
|
|
3743
|
-
const navLinkPaddingXSchema = z
|
|
3865
|
+
const navLinkPaddingXSchema = z.enum([
|
|
3744
3866
|
"none",
|
|
3745
3867
|
"tight",
|
|
3746
3868
|
"compact",
|
|
@@ -3751,7 +3873,7 @@ const navLinkPaddingXSchema = z$1.enum([
|
|
|
3751
3873
|
/**
|
|
3752
3874
|
* Border radius options for nav links
|
|
3753
3875
|
*/
|
|
3754
|
-
const navLinkBorderRadiusSchema = z
|
|
3876
|
+
const navLinkBorderRadiusSchema = z.enum([
|
|
3755
3877
|
"none",
|
|
3756
3878
|
"sm",
|
|
3757
3879
|
"md",
|
|
@@ -3760,7 +3882,7 @@ const navLinkBorderRadiusSchema = z$1.enum([
|
|
|
3760
3882
|
/**
|
|
3761
3883
|
* Typography size options for nav links.
|
|
3762
3884
|
*/
|
|
3763
|
-
const navLinkTextSizeSchema = z
|
|
3885
|
+
const navLinkTextSizeSchema = z.enum([
|
|
3764
3886
|
"xs",
|
|
3765
3887
|
"sm",
|
|
3766
3888
|
"base",
|
|
@@ -3770,7 +3892,7 @@ const navLinkTextSizeSchema = z$1.enum([
|
|
|
3770
3892
|
/**
|
|
3771
3893
|
* Letter spacing options for nav links.
|
|
3772
3894
|
*/
|
|
3773
|
-
const navLinkLetterSpacingSchema = z
|
|
3895
|
+
const navLinkLetterSpacingSchema = z.enum([
|
|
3774
3896
|
"normal",
|
|
3775
3897
|
"wide",
|
|
3776
3898
|
"wider",
|
|
@@ -3779,15 +3901,15 @@ const navLinkLetterSpacingSchema = z$1.enum([
|
|
|
3779
3901
|
/**
|
|
3780
3902
|
* Optional legibility aid for nav text that floats over uncertain imagery or color.
|
|
3781
3903
|
*/
|
|
3782
|
-
const navLinkContrastTreatmentSchema = z
|
|
3904
|
+
const navLinkContrastTreatmentSchema = z.enum(["none", "soft-glow"]);
|
|
3783
3905
|
/**
|
|
3784
3906
|
* Nav link style schema
|
|
3785
3907
|
*
|
|
3786
3908
|
* Extends interactive typography base with nav-specific settings.
|
|
3787
3909
|
*/
|
|
3788
|
-
const navLinkStyleSchema = z
|
|
3910
|
+
const navLinkStyleSchema = z.object({
|
|
3789
3911
|
/** Display name for the style */
|
|
3790
|
-
name: z
|
|
3912
|
+
name: z.string().min(1).max(30).optional(),
|
|
3791
3913
|
/** Typography settings (inherited from interactive base) */
|
|
3792
3914
|
...interactiveTypographySchema.shape,
|
|
3793
3915
|
/** Text color token */
|
|
@@ -3872,7 +3994,7 @@ function containsForbiddenSelector(selector) {
|
|
|
3872
3994
|
/**
|
|
3873
3995
|
* Validates a CSS selector for safety.
|
|
3874
3996
|
*/
|
|
3875
|
-
const selectorSchema = z
|
|
3997
|
+
const selectorSchema = z.string().min(1, "Selector cannot be empty").max(200, "Selector too long (max 200 characters)").refine((s) => !containsForbiddenSelector(s), { message: "Global selectors (:root, html, body, *) are not allowed" });
|
|
3876
3998
|
/**
|
|
3877
3999
|
* Check if a CSS value contains a remote URL.
|
|
3878
4000
|
*/
|
|
@@ -3890,31 +4012,31 @@ function containsJavascriptUrl(value) {
|
|
|
3890
4012
|
* Allows: url(#id), url(data:...), url(/path), var(--)
|
|
3891
4013
|
* Forbids: url(http...), url(//...), javascript:
|
|
3892
4014
|
*/
|
|
3893
|
-
const declarationValueSchema = z
|
|
4015
|
+
const declarationValueSchema = z.string().max(500, "Declaration value too long (max 500 characters)").refine((v) => !containsRemoteUrl(v), { message: "Remote url() references are not allowed. Use local paths, data URIs, or fragment IDs." }).refine((v) => !containsJavascriptUrl(v), { message: "javascript: URLs are not allowed" });
|
|
3894
4016
|
/**
|
|
3895
4017
|
* Schema for CSS declarations object (property -> value map).
|
|
3896
4018
|
*/
|
|
3897
|
-
const declarationsSchema = z
|
|
4019
|
+
const declarationsSchema = z.record(z.string().min(1).max(100), declarationValueSchema);
|
|
3898
4020
|
/**
|
|
3899
4021
|
* Schema for a single custom CSS rule.
|
|
3900
4022
|
*/
|
|
3901
|
-
const customCssRuleSchema = z
|
|
3902
|
-
id: z
|
|
4023
|
+
const customCssRuleSchema = z.object({
|
|
4024
|
+
id: z.string().min(1, "Rule ID is required").max(50, "Rule ID too long"),
|
|
3903
4025
|
selector: selectorSchema,
|
|
3904
4026
|
declarations: declarationsSchema
|
|
3905
4027
|
});
|
|
3906
4028
|
/**
|
|
3907
4029
|
* Schema for block-specific CSS rule.
|
|
3908
4030
|
*/
|
|
3909
|
-
const blockCustomCssRuleSchema = customCssRuleSchema.extend({ blockKind: z
|
|
4031
|
+
const blockCustomCssRuleSchema = customCssRuleSchema.extend({ blockKind: z.string().min(1, "Block kind is required").max(50, "Block kind too long") });
|
|
3910
4032
|
/**
|
|
3911
4033
|
* Array of custom CSS rules for theme-level styling.
|
|
3912
4034
|
*/
|
|
3913
|
-
const customCssRulesSchema = z
|
|
4035
|
+
const customCssRulesSchema = z.array(customCssRuleSchema).optional();
|
|
3914
4036
|
/**
|
|
3915
4037
|
* Array of block-specific CSS rules.
|
|
3916
4038
|
*/
|
|
3917
|
-
const blockCustomCssRulesSchema = z
|
|
4039
|
+
const blockCustomCssRulesSchema = z.array(blockCustomCssRuleSchema).optional();
|
|
3918
4040
|
//#endregion
|
|
3919
4041
|
//#region ../theme-core/src/customCss/atRuleValidation.ts
|
|
3920
4042
|
/**
|
|
@@ -3932,9 +4054,9 @@ const BLOCKED_AT_RULES = ["@import", "@charset"];
|
|
|
3932
4054
|
/** Pattern to detect blocked at-rules */
|
|
3933
4055
|
const BLOCKED_AT_RULE_PATTERN = /@(?:import|charset)\b/i;
|
|
3934
4056
|
/** Rule ID schema - reused from main validation */
|
|
3935
|
-
const ruleIdSchema = z
|
|
4057
|
+
const ruleIdSchema = z.string().min(1, "Rule ID is required").max(50, "Rule ID too long");
|
|
3936
4058
|
/** Nested rule schema for @media and @supports */
|
|
3937
|
-
const nestedRuleSchema = z
|
|
4059
|
+
const nestedRuleSchema = z.object({
|
|
3938
4060
|
selector: selectorSchema,
|
|
3939
4061
|
declarations: declarationsSchema
|
|
3940
4062
|
});
|
|
@@ -3951,46 +4073,46 @@ function isValidKeyframeOffset(offset) {
|
|
|
3951
4073
|
return value >= 0 && value <= 100;
|
|
3952
4074
|
}
|
|
3953
4075
|
/** Keyframe offset validation (0%, 50%, 100%, from, to) */
|
|
3954
|
-
const keyframeOffsetSchema = z
|
|
4076
|
+
const keyframeOffsetSchema = z.string().transform((offset) => offset.trim()).refine((offset) => KEYFRAME_OFFSET_PATTERN.test(offset), { message: "Invalid keyframe offset. Use percentages (0%, 50%, 100%) or \"from\"/\"to\"" }).refine(isValidKeyframeOffset, { message: "Keyframe offset must be between 0% and 100%" });
|
|
3955
4077
|
/** Animation name validation (CSS identifier) */
|
|
3956
|
-
const animationNameSchema = z
|
|
4078
|
+
const animationNameSchema = z.string().min(1, "Animation name is required").max(50, "Animation name too long").refine((name) => ANIMATION_NAME_PATTERN.test(name), { message: "Invalid animation name. Use letters, numbers, dashes, underscores (start with letter, dash, or underscore)" });
|
|
3957
4079
|
/** Single keyframe (offset + declarations) */
|
|
3958
|
-
const keyframeSchema = z
|
|
4080
|
+
const keyframeSchema = z.object({
|
|
3959
4081
|
offset: keyframeOffsetSchema,
|
|
3960
4082
|
declarations: declarationsSchema
|
|
3961
4083
|
});
|
|
3962
4084
|
/** @keyframes rule schema */
|
|
3963
|
-
const keyframesAtRuleSchema = z
|
|
4085
|
+
const keyframesAtRuleSchema = z.object({
|
|
3964
4086
|
id: ruleIdSchema,
|
|
3965
|
-
type: z
|
|
4087
|
+
type: z.literal("keyframes"),
|
|
3966
4088
|
name: animationNameSchema,
|
|
3967
|
-
frames: z
|
|
4089
|
+
frames: z.array(keyframeSchema).min(1, "At least one keyframe is required")
|
|
3968
4090
|
});
|
|
3969
4091
|
/** Font-face declarations - uses standard declarations but with font-specific validation */
|
|
3970
|
-
const fontFaceDeclarationsSchema = z
|
|
4092
|
+
const fontFaceDeclarationsSchema = z.record(z.string().min(1).max(100), declarationValueSchema).refine((decls) => "fontFamily" in decls || "font-family" in decls, { message: "font-family is required in @font-face" });
|
|
3971
4093
|
/** @font-face rule schema */
|
|
3972
|
-
const fontFaceAtRuleSchema = z
|
|
4094
|
+
const fontFaceAtRuleSchema = z.object({
|
|
3973
4095
|
id: ruleIdSchema,
|
|
3974
|
-
type: z
|
|
4096
|
+
type: z.literal("font-face"),
|
|
3975
4097
|
declarations: fontFaceDeclarationsSchema
|
|
3976
4098
|
});
|
|
3977
4099
|
/** Media query string validation */
|
|
3978
|
-
const mediaQuerySchema = z
|
|
4100
|
+
const mediaQuerySchema = z.string().min(1, "Media query is required").max(200, "Media query too long");
|
|
3979
4101
|
/** @media rule schema */
|
|
3980
|
-
const mediaAtRuleSchema = z
|
|
4102
|
+
const mediaAtRuleSchema = z.object({
|
|
3981
4103
|
id: ruleIdSchema,
|
|
3982
|
-
type: z
|
|
4104
|
+
type: z.literal("media"),
|
|
3983
4105
|
query: mediaQuerySchema,
|
|
3984
|
-
rules: z
|
|
4106
|
+
rules: z.array(nestedRuleSchema).min(1, "At least one rule is required")
|
|
3985
4107
|
});
|
|
3986
4108
|
/** Supports condition string validation */
|
|
3987
|
-
const supportsConditionSchema = z
|
|
4109
|
+
const supportsConditionSchema = z.string().min(1, "Supports condition is required").max(200, "Supports condition too long");
|
|
3988
4110
|
/** @supports rule schema */
|
|
3989
|
-
const supportsAtRuleSchema = z
|
|
4111
|
+
const supportsAtRuleSchema = z.object({
|
|
3990
4112
|
id: ruleIdSchema,
|
|
3991
|
-
type: z
|
|
4113
|
+
type: z.literal("supports"),
|
|
3992
4114
|
condition: supportsConditionSchema,
|
|
3993
|
-
rules: z
|
|
4115
|
+
rules: z.array(nestedRuleSchema).min(1, "At least one rule is required")
|
|
3994
4116
|
});
|
|
3995
4117
|
/**
|
|
3996
4118
|
* Check if raw CSS contains blocked at-rules.
|
|
@@ -3999,17 +4121,17 @@ function containsBlockedAtRule(css) {
|
|
|
3999
4121
|
return BLOCKED_AT_RULE_PATTERN.test(css);
|
|
4000
4122
|
}
|
|
4001
4123
|
/** Raw CSS validation - blocks @import, @charset, must start with @ */
|
|
4002
|
-
const rawCssSchema = z
|
|
4124
|
+
const rawCssSchema = z.string().min(1, "CSS is required").max(5e3, "Raw CSS too long (max 5000 characters)").refine((css) => css.trim().startsWith("@"), { message: "Raw at-rule must start with @" }).refine((css) => !containsBlockedAtRule(css), { message: `Blocked at-rules: ${BLOCKED_AT_RULES.join(", ")}. Use typed at-rules or local assets instead.` });
|
|
4003
4125
|
/** Raw at-rule schema */
|
|
4004
|
-
const rawAtRuleSchema = z
|
|
4126
|
+
const rawAtRuleSchema = z.object({
|
|
4005
4127
|
id: ruleIdSchema,
|
|
4006
|
-
type: z
|
|
4128
|
+
type: z.literal("raw"),
|
|
4007
4129
|
css: rawCssSchema
|
|
4008
4130
|
});
|
|
4009
4131
|
/**
|
|
4010
4132
|
* Discriminated union schema for all at-rule types.
|
|
4011
4133
|
*/
|
|
4012
|
-
const customCssAtRuleSchema = z
|
|
4134
|
+
const customCssAtRuleSchema = z.discriminatedUnion("type", [
|
|
4013
4135
|
keyframesAtRuleSchema,
|
|
4014
4136
|
fontFaceAtRuleSchema,
|
|
4015
4137
|
mediaAtRuleSchema,
|
|
@@ -4019,7 +4141,7 @@ const customCssAtRuleSchema = z$1.discriminatedUnion("type", [
|
|
|
4019
4141
|
/**
|
|
4020
4142
|
* Array of at-rules for theme-level styling.
|
|
4021
4143
|
*/
|
|
4022
|
-
const customCssAtRulesSchema = z
|
|
4144
|
+
const customCssAtRulesSchema = z.array(customCssAtRuleSchema).optional();
|
|
4023
4145
|
//#endregion
|
|
4024
4146
|
//#region ../theme-core/src/shared/componentStyles.ts
|
|
4025
4147
|
/**
|
|
@@ -4037,22 +4159,22 @@ const customCssAtRulesSchema = z$1.array(customCssAtRuleSchema).optional();
|
|
|
4037
4159
|
* Shared border schema for themed components.
|
|
4038
4160
|
* Position is excluded - each component determines its own border position.
|
|
4039
4161
|
*/
|
|
4040
|
-
const componentBorderSchema = z
|
|
4041
|
-
width: z
|
|
4162
|
+
const componentBorderSchema = z.object({
|
|
4163
|
+
width: z.enum([
|
|
4042
4164
|
"none",
|
|
4043
4165
|
"hairline",
|
|
4044
4166
|
"thin",
|
|
4045
4167
|
"medium",
|
|
4046
4168
|
"thick"
|
|
4047
4169
|
]).default("none"),
|
|
4048
|
-
style: z
|
|
4170
|
+
style: z.enum(["solid", "dashed"]).default("solid"),
|
|
4049
4171
|
colorToken: themeColorTokenSchema.optional()
|
|
4050
4172
|
});
|
|
4051
4173
|
/**
|
|
4052
4174
|
* Shared shadow schema for themed components.
|
|
4053
4175
|
* Softness is inherited from global theme, not configurable per-component.
|
|
4054
4176
|
*/
|
|
4055
|
-
const componentShadowSchema = z
|
|
4177
|
+
const componentShadowSchema = z.object({ elevation: z.enum([
|
|
4056
4178
|
"none",
|
|
4057
4179
|
"sm",
|
|
4058
4180
|
"md",
|
|
@@ -4147,43 +4269,43 @@ const logoDensityValues = [
|
|
|
4147
4269
|
"detailed",
|
|
4148
4270
|
"unknown"
|
|
4149
4271
|
];
|
|
4150
|
-
const logoContainsTextSchema = z
|
|
4151
|
-
z
|
|
4152
|
-
kind: z
|
|
4153
|
-
confidence: z
|
|
4154
|
-
text: z
|
|
4272
|
+
const logoContainsTextSchema = z.discriminatedUnion("kind", [
|
|
4273
|
+
z.object({
|
|
4274
|
+
kind: z.literal("contains-text"),
|
|
4275
|
+
confidence: z.enum(logoTextConfidenceValues),
|
|
4276
|
+
text: z.string().trim().min(1).max(200).optional()
|
|
4155
4277
|
}),
|
|
4156
|
-
z
|
|
4157
|
-
kind: z
|
|
4158
|
-
confidence: z
|
|
4278
|
+
z.object({
|
|
4279
|
+
kind: z.literal("no-text"),
|
|
4280
|
+
confidence: z.enum(logoTextConfidenceValues)
|
|
4159
4281
|
}),
|
|
4160
|
-
z
|
|
4161
|
-
kind: z
|
|
4162
|
-
reason: z
|
|
4282
|
+
z.object({
|
|
4283
|
+
kind: z.literal("unknown"),
|
|
4284
|
+
reason: z.enum([
|
|
4163
4285
|
"analysis-unavailable",
|
|
4164
4286
|
"unsupported-file",
|
|
4165
4287
|
"low-confidence"
|
|
4166
4288
|
])
|
|
4167
4289
|
})
|
|
4168
4290
|
]);
|
|
4169
|
-
const logoAnalysisSourceSchema = z
|
|
4170
|
-
z
|
|
4171
|
-
z
|
|
4172
|
-
kind: z
|
|
4173
|
-
reason: z
|
|
4291
|
+
const logoAnalysisSourceSchema = z.discriminatedUnion("kind", [
|
|
4292
|
+
z.object({ kind: z.literal("none") }),
|
|
4293
|
+
z.object({
|
|
4294
|
+
kind: z.literal("deterministic"),
|
|
4295
|
+
reason: z.enum(["dimensions", "fallback"])
|
|
4174
4296
|
}),
|
|
4175
|
-
z
|
|
4176
|
-
kind: z
|
|
4177
|
-
model: z
|
|
4178
|
-
analyzedAt: z
|
|
4297
|
+
z.object({
|
|
4298
|
+
kind: z.literal("llm"),
|
|
4299
|
+
model: z.literal("gpt-5.4-mini"),
|
|
4300
|
+
analyzedAt: z.string().trim().min(1).max(80).optional()
|
|
4179
4301
|
}),
|
|
4180
|
-
z
|
|
4302
|
+
z.object({ kind: z.literal("manual-override") })
|
|
4181
4303
|
]);
|
|
4182
|
-
z
|
|
4183
|
-
shape: z
|
|
4304
|
+
z.object({
|
|
4305
|
+
shape: z.enum(logoAssetShapeValues),
|
|
4184
4306
|
containsText: logoContainsTextSchema,
|
|
4185
|
-
kind: z
|
|
4186
|
-
density: z
|
|
4307
|
+
kind: z.enum(logoKindValues),
|
|
4308
|
+
density: z.enum(logoDensityValues),
|
|
4187
4309
|
source: logoAnalysisSourceSchema
|
|
4188
4310
|
});
|
|
4189
4311
|
const brandDisplayModeValues = [
|
|
@@ -4230,14 +4352,6 @@ new Set(themeV2NormalEditorRawStyleFieldNames);
|
|
|
4230
4352
|
[...themeV2RuntimeStyleFieldNames, ...themeV2BlockSpecificRawStyleFieldNames];
|
|
4231
4353
|
const pageDesignEditorBackgroundOverrideOwner = "page-design-editor";
|
|
4232
4354
|
const siteChromeBackgroundOverrideOwner = "site-chrome-editor";
|
|
4233
|
-
//#endregion
|
|
4234
|
-
//#region ../theme-core/src/utils/tokenOrColor.ts
|
|
4235
|
-
/**
|
|
4236
|
-
* Runtime color-reference fields intentionally accept any string, including
|
|
4237
|
-
* the legacy empty-string "no color" sentinel. Semantic validation needs
|
|
4238
|
-
* palette context and happens in `parseThemeColorReference`.
|
|
4239
|
-
*/
|
|
4240
|
-
const tokenOrCssColorValueSchema = z$1.string();
|
|
4241
4355
|
const BREAKPOINT_LG = 1024;
|
|
4242
4356
|
const BREAKPOINT_XL = 1280;
|
|
4243
4357
|
const BREAKPOINT_LG_DOWN = BREAKPOINT_LG - 1;
|
|
@@ -4262,14 +4376,14 @@ mqDown(640);
|
|
|
4262
4376
|
mqDown(768);
|
|
4263
4377
|
//#endregion
|
|
4264
4378
|
//#region ../theme-core/src/header/scrollTreatment.ts
|
|
4265
|
-
const headerScrollTreatmentSchema = z
|
|
4266
|
-
kind: z
|
|
4267
|
-
backgroundTone: z
|
|
4379
|
+
const headerScrollTreatmentSchema = z.discriminatedUnion("kind", [z.object({
|
|
4380
|
+
kind: z.literal("contrast-glass"),
|
|
4381
|
+
backgroundTone: z.enum(["light", "dark"])
|
|
4268
4382
|
})]).optional();
|
|
4269
4383
|
//#endregion
|
|
4270
4384
|
//#region ../theme-core/src/header/containerSchema.ts
|
|
4271
|
-
const headerContainerSchema = z
|
|
4272
|
-
rounded: z
|
|
4385
|
+
const headerContainerSchema = z.object({
|
|
4386
|
+
rounded: z.enum([
|
|
4273
4387
|
"none",
|
|
4274
4388
|
"sm",
|
|
4275
4389
|
"md",
|
|
@@ -4277,77 +4391,146 @@ const headerContainerSchema = z$1.object({
|
|
|
4277
4391
|
"xl",
|
|
4278
4392
|
"2xl"
|
|
4279
4393
|
]).default("xl"),
|
|
4280
|
-
border: z
|
|
4281
|
-
shadow: z
|
|
4282
|
-
padding: z
|
|
4394
|
+
border: z.boolean().default(true),
|
|
4395
|
+
shadow: z.boolean().default(true),
|
|
4396
|
+
padding: z.enum([
|
|
4283
4397
|
"sm",
|
|
4284
4398
|
"md",
|
|
4285
4399
|
"lg"
|
|
4286
4400
|
]).default("md"),
|
|
4287
|
-
tint: z
|
|
4288
|
-
opacity: z
|
|
4401
|
+
tint: z.string().nullable().optional(),
|
|
4402
|
+
opacity: z.number().min(0).max(1).default(.12)
|
|
4289
4403
|
}).optional();
|
|
4290
|
-
const headerInteractionPaletteSchema = z
|
|
4404
|
+
const headerInteractionPaletteSchema = z.enum([
|
|
4291
4405
|
"primary",
|
|
4292
4406
|
"secondary",
|
|
4293
4407
|
"accent"
|
|
4294
4408
|
]);
|
|
4295
4409
|
//#endregion
|
|
4410
|
+
//#region ../theme-core/src/boxBackgroundSchema.ts
|
|
4411
|
+
const boxBackgroundOverlaySchema = z.preprocess(normalizeAuthoringOpacity, z.discriminatedUnion("type", [
|
|
4412
|
+
z.object({ type: z.literal("none") }),
|
|
4413
|
+
z.object({
|
|
4414
|
+
type: z.literal("color"),
|
|
4415
|
+
color: tokenOrCssColorValueSchema.nullable().optional(),
|
|
4416
|
+
opacity: z.number().min(0).max(1).nullable().optional()
|
|
4417
|
+
}),
|
|
4418
|
+
z.object({
|
|
4419
|
+
type: z.literal("gradient"),
|
|
4420
|
+
gradient: z.string().nullable().optional(),
|
|
4421
|
+
opacity: z.number().min(0).max(1).nullable().optional()
|
|
4422
|
+
})
|
|
4423
|
+
]));
|
|
4424
|
+
const commonSchema = z.object({
|
|
4425
|
+
contentOwner: z.literal(pageDesignEditorBackgroundOverrideOwner).optional(),
|
|
4426
|
+
textColor: tokenOrCssColorValueSchema.nullable().optional(),
|
|
4427
|
+
headingColor: tokenOrCssColorValueSchema.nullable().optional(),
|
|
4428
|
+
linkColor: tokenOrCssColorValueSchema.nullable().optional(),
|
|
4429
|
+
supportingColor: tokenOrCssColorValueSchema.nullable().optional()
|
|
4430
|
+
});
|
|
4431
|
+
const mediaPresentationSchema = commonSchema.extend({
|
|
4432
|
+
opacity: z.preprocess(normalizeOpacity, z.number().min(0).max(1).nullable()).optional(),
|
|
4433
|
+
objectFit: z.enum([
|
|
4434
|
+
"fill",
|
|
4435
|
+
"fit",
|
|
4436
|
+
"original",
|
|
4437
|
+
"custom"
|
|
4438
|
+
]).nullable().optional(),
|
|
4439
|
+
scale: z.string().nullable().optional(),
|
|
4440
|
+
position: z.string().nullable().optional(),
|
|
4441
|
+
motion: z.enum(["static", "fixed-frame"]).nullable().optional(),
|
|
4442
|
+
overflow: z.boolean().nullable().optional(),
|
|
4443
|
+
overlay: boxBackgroundOverlaySchema.nullable().optional()
|
|
4444
|
+
});
|
|
4445
|
+
const boxBackgroundSchema = z.discriminatedUnion("type", [
|
|
4446
|
+
commonSchema.extend({
|
|
4447
|
+
type: z.literal("color"),
|
|
4448
|
+
color: tokenOrCssColorValueSchema.nullable().optional()
|
|
4449
|
+
}),
|
|
4450
|
+
commonSchema.extend({
|
|
4451
|
+
type: z.literal("gradient"),
|
|
4452
|
+
gradient: z.string().nullable().optional(),
|
|
4453
|
+
gradientPresetId: z.string().min(1).nullable().optional()
|
|
4454
|
+
}),
|
|
4455
|
+
mediaPresentationSchema.extend({
|
|
4456
|
+
type: z.literal("image"),
|
|
4457
|
+
image: imageMediaSchema.nullable().optional()
|
|
4458
|
+
}),
|
|
4459
|
+
mediaPresentationSchema.extend({
|
|
4460
|
+
type: z.literal("video"),
|
|
4461
|
+
image: videoMediaSchema.nullable().optional(),
|
|
4462
|
+
showVideoOnMobile: z.boolean().nullable().optional()
|
|
4463
|
+
})
|
|
4464
|
+
]);
|
|
4465
|
+
function normalizeAuthoringOpacity(value) {
|
|
4466
|
+
if (!isRecord(value)) return value;
|
|
4467
|
+
return {
|
|
4468
|
+
...value,
|
|
4469
|
+
opacity: normalizeOpacity(value.opacity)
|
|
4470
|
+
};
|
|
4471
|
+
}
|
|
4472
|
+
function normalizeOpacity(value) {
|
|
4473
|
+
return typeof value === "number" && value > 1 && value <= 100 ? value / 100 : value;
|
|
4474
|
+
}
|
|
4475
|
+
function isRecord(value) {
|
|
4476
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
4477
|
+
}
|
|
4478
|
+
//#endregion
|
|
4296
4479
|
//#region ../theme-core/src/schema.ts
|
|
4297
|
-
const axesSchema = z
|
|
4298
|
-
tone: z
|
|
4480
|
+
const axesSchema = z.object({
|
|
4481
|
+
tone: z.enum([
|
|
4299
4482
|
"minimal",
|
|
4300
4483
|
"classic",
|
|
4301
4484
|
"bold"
|
|
4302
4485
|
]),
|
|
4303
|
-
energy: z
|
|
4304
|
-
density: z
|
|
4486
|
+
energy: z.enum(["calm", "vibrant"]),
|
|
4487
|
+
density: z.enum([
|
|
4305
4488
|
"airy",
|
|
4306
4489
|
"regular",
|
|
4307
4490
|
"compact"
|
|
4308
4491
|
]),
|
|
4309
|
-
mediaBias: z
|
|
4492
|
+
mediaBias: z.enum([
|
|
4310
4493
|
"text",
|
|
4311
4494
|
"media",
|
|
4312
4495
|
"mixed"
|
|
4313
4496
|
]),
|
|
4314
|
-
conversionBias: z
|
|
4497
|
+
conversionBias: z.enum([
|
|
4315
4498
|
"low",
|
|
4316
4499
|
"med",
|
|
4317
4500
|
"high"
|
|
4318
4501
|
]),
|
|
4319
|
-
motion: z
|
|
4502
|
+
motion: z.enum([
|
|
4320
4503
|
"subtle",
|
|
4321
4504
|
"standard",
|
|
4322
4505
|
"expressive"
|
|
4323
4506
|
])
|
|
4324
4507
|
});
|
|
4325
|
-
const typographyStyleSchema = z
|
|
4326
|
-
family: z
|
|
4327
|
-
weight: z
|
|
4508
|
+
const typographyStyleSchema = z.object({
|
|
4509
|
+
family: z.string().min(1),
|
|
4510
|
+
weight: z.enum([
|
|
4328
4511
|
"light",
|
|
4329
4512
|
"regular",
|
|
4330
4513
|
"medium",
|
|
4331
4514
|
"semibold",
|
|
4332
4515
|
"bold"
|
|
4333
4516
|
]),
|
|
4334
|
-
letterSpacing: z
|
|
4517
|
+
letterSpacing: z.enum([
|
|
4335
4518
|
"tight",
|
|
4336
4519
|
"normal",
|
|
4337
4520
|
"loose"
|
|
4338
4521
|
]),
|
|
4339
|
-
lineHeight: z
|
|
4522
|
+
lineHeight: z.enum([
|
|
4340
4523
|
"normal",
|
|
4341
4524
|
"relaxed",
|
|
4342
4525
|
"loose"
|
|
4343
4526
|
])
|
|
4344
4527
|
});
|
|
4345
|
-
const bodyTypographyStyleSchema = typographyStyleSchema.extend({ size: z
|
|
4528
|
+
const bodyTypographyStyleSchema = typographyStyleSchema.extend({ size: z.enum([
|
|
4346
4529
|
"md",
|
|
4347
4530
|
"lg",
|
|
4348
4531
|
"xl"
|
|
4349
4532
|
]) });
|
|
4350
|
-
const headingSizeSchema = z
|
|
4533
|
+
const headingSizeSchema = z.enum([
|
|
4351
4534
|
"xs",
|
|
4352
4535
|
"sm",
|
|
4353
4536
|
"md",
|
|
@@ -4355,68 +4538,68 @@ const headingSizeSchema = z$1.enum([
|
|
|
4355
4538
|
"xl",
|
|
4356
4539
|
"2xl"
|
|
4357
4540
|
]);
|
|
4358
|
-
const headingTypographyOverridesSchema = z
|
|
4359
|
-
weight: z
|
|
4541
|
+
const headingTypographyOverridesSchema = z.object({
|
|
4542
|
+
weight: z.enum([
|
|
4360
4543
|
"light",
|
|
4361
4544
|
"regular",
|
|
4362
4545
|
"medium",
|
|
4363
4546
|
"semibold",
|
|
4364
4547
|
"bold"
|
|
4365
4548
|
]).nullable().optional(),
|
|
4366
|
-
letterSpacing: z
|
|
4549
|
+
letterSpacing: z.enum([
|
|
4367
4550
|
"tight",
|
|
4368
4551
|
"normal",
|
|
4369
4552
|
"loose"
|
|
4370
4553
|
]).nullable().optional(),
|
|
4371
4554
|
size: headingSizeSchema.nullable().optional(),
|
|
4372
|
-
lineHeight: z
|
|
4555
|
+
lineHeight: z.enum([
|
|
4373
4556
|
"tight",
|
|
4374
4557
|
"snug",
|
|
4375
4558
|
"normal",
|
|
4376
4559
|
"relaxed",
|
|
4377
4560
|
"loose"
|
|
4378
4561
|
]).nullable().optional(),
|
|
4379
|
-
italic: z
|
|
4562
|
+
italic: z.boolean().nullable().optional(),
|
|
4380
4563
|
colorToken: themeColorTokenSchema.nullable().optional()
|
|
4381
4564
|
});
|
|
4382
4565
|
const headingTypographyStyleSchema = typographyStyleSchema.extend({
|
|
4383
|
-
case: z
|
|
4566
|
+
case: z.enum([
|
|
4384
4567
|
"uppercase",
|
|
4385
4568
|
"normal",
|
|
4386
4569
|
"smallCaps"
|
|
4387
4570
|
]).nullable(),
|
|
4388
|
-
italic: z
|
|
4571
|
+
italic: z.boolean().nullable(),
|
|
4389
4572
|
colorToken: themeColorTokenSchema.nullable().optional()
|
|
4390
4573
|
});
|
|
4391
|
-
const proseLinkUnderlineStyleSchema = z
|
|
4574
|
+
const proseLinkUnderlineStyleSchema = z.enum([
|
|
4392
4575
|
"solid",
|
|
4393
4576
|
"dotted",
|
|
4394
4577
|
"dashed"
|
|
4395
4578
|
]);
|
|
4396
|
-
const proseLinkUnderlineThicknessSchema = z
|
|
4579
|
+
const proseLinkUnderlineThicknessSchema = z.enum([
|
|
4397
4580
|
"auto",
|
|
4398
4581
|
"fromFont",
|
|
4399
4582
|
"thin",
|
|
4400
4583
|
"medium",
|
|
4401
4584
|
"thick"
|
|
4402
4585
|
]);
|
|
4403
|
-
const proseLinkUnderlineOffsetSchema = z
|
|
4586
|
+
const proseLinkUnderlineOffsetSchema = z.enum([
|
|
4404
4587
|
"auto",
|
|
4405
4588
|
"tight",
|
|
4406
4589
|
"normal",
|
|
4407
4590
|
"loose"
|
|
4408
4591
|
]);
|
|
4409
|
-
const proseLinkStyleSchema = z
|
|
4592
|
+
const proseLinkStyleSchema = z.object({
|
|
4410
4593
|
colorToken: themeColorTokenSchema.optional(),
|
|
4411
4594
|
hoverColorToken: themeColorTokenSchema.optional(),
|
|
4412
|
-
underline: z
|
|
4595
|
+
underline: z.boolean().optional(),
|
|
4413
4596
|
decorationColorToken: themeColorTokenSchema.optional(),
|
|
4414
4597
|
hoverDecorationColorToken: themeColorTokenSchema.optional(),
|
|
4415
4598
|
underlineStyle: proseLinkUnderlineStyleSchema.optional(),
|
|
4416
4599
|
underlineThickness: proseLinkUnderlineThicknessSchema.optional(),
|
|
4417
4600
|
underlineOffset: proseLinkUnderlineOffsetSchema.optional()
|
|
4418
4601
|
});
|
|
4419
|
-
const semanticSpacingSchema = z
|
|
4602
|
+
const semanticSpacingSchema = z.enum([
|
|
4420
4603
|
"none",
|
|
4421
4604
|
"compact",
|
|
4422
4605
|
"cozy",
|
|
@@ -4424,7 +4607,7 @@ const semanticSpacingSchema = z$1.enum([
|
|
|
4424
4607
|
"comfortable",
|
|
4425
4608
|
"spacious"
|
|
4426
4609
|
]);
|
|
4427
|
-
const boxRoundedSchema = z
|
|
4610
|
+
const boxRoundedSchema = z.enum([
|
|
4428
4611
|
"none",
|
|
4429
4612
|
"sm",
|
|
4430
4613
|
"md",
|
|
@@ -4433,82 +4616,45 @@ const boxRoundedSchema = z$1.enum([
|
|
|
4433
4616
|
"2xl",
|
|
4434
4617
|
"full"
|
|
4435
4618
|
]);
|
|
4436
|
-
const
|
|
4437
|
-
|
|
4438
|
-
|
|
4439
|
-
|
|
4440
|
-
"gradient"
|
|
4441
|
-
]).nullable().optional(),
|
|
4442
|
-
color: tokenOrCssColorValueSchema.nullable().optional(),
|
|
4443
|
-
gradient: z$1.string().nullable().optional(),
|
|
4444
|
-
opacity: z$1.number().min(0).max(1).nullable().optional()
|
|
4619
|
+
const noHeadingDecorationSchema = z.object({ family: z.literal("none") });
|
|
4620
|
+
const visibleHeadingDecorationSchema = z.object({
|
|
4621
|
+
family: z.enum(visibleHeadingDecorationFamilyValues),
|
|
4622
|
+
colorToken: z.enum(headingDecorationColorTokenValues).optional()
|
|
4445
4623
|
});
|
|
4446
|
-
const
|
|
4447
|
-
|
|
4448
|
-
|
|
4449
|
-
|
|
4450
|
-
|
|
4451
|
-
|
|
4452
|
-
|
|
4453
|
-
color: tokenOrCssColorValueSchema.nullable().optional(),
|
|
4454
|
-
gradient: z$1.string().nullable().optional(),
|
|
4455
|
-
gradientPresetId: z$1.string().min(1).nullable().optional(),
|
|
4456
|
-
image: mediaSchema.nullable().optional(),
|
|
4457
|
-
objectFit: z$1.enum([
|
|
4458
|
-
"fill",
|
|
4459
|
-
"fit",
|
|
4460
|
-
"original",
|
|
4461
|
-
"custom"
|
|
4462
|
-
]).nullable().optional(),
|
|
4463
|
-
scale: z$1.string().nullable().optional(),
|
|
4464
|
-
position: z$1.string().nullable().optional(),
|
|
4465
|
-
opacity: z$1.number().min(0).max(1).nullable().optional(),
|
|
4466
|
-
motion: z$1.enum(["static", "fixed-frame"]).nullable().optional(),
|
|
4467
|
-
overlay: boxBackgroundOverlaySchema.nullable().optional(),
|
|
4468
|
-
textColor: tokenOrCssColorValueSchema.nullable().optional(),
|
|
4469
|
-
headingColor: tokenOrCssColorValueSchema.nullable().optional(),
|
|
4470
|
-
linkColor: tokenOrCssColorValueSchema.nullable().optional(),
|
|
4471
|
-
supportingColor: tokenOrCssColorValueSchema.nullable().optional()
|
|
4472
|
-
});
|
|
4473
|
-
const noHeadingDecorationSchema = z$1.object({ family: z$1.literal("none") });
|
|
4474
|
-
const visibleHeadingDecorationSchema = z$1.object({
|
|
4475
|
-
family: z$1.enum(visibleHeadingDecorationFamilyValues),
|
|
4476
|
-
colorToken: z$1.enum(headingDecorationColorTokenValues).optional()
|
|
4477
|
-
});
|
|
4478
|
-
const headingDecorationSchema = z$1.union([noHeadingDecorationSchema, visibleHeadingDecorationSchema]);
|
|
4479
|
-
const headingDecorationOverrideSchema = z$1.union([z$1.enum(headingDecorationOverrideValues), z$1.literal("on").transform(() => "site-default")]);
|
|
4480
|
-
const accordionIconTreatmentSchema = z$1.object({
|
|
4481
|
-
iconSet: z$1.enum(accordionIconSetValues),
|
|
4482
|
-
colorToken: z$1.enum(accordionIconColorTokenValues),
|
|
4483
|
-
openColorToken: z$1.enum(accordionIconColorTokenValues).optional(),
|
|
4484
|
-
motion: z$1.enum(accordionIconMotionValues)
|
|
4624
|
+
const headingDecorationSchema = z.union([noHeadingDecorationSchema, visibleHeadingDecorationSchema]);
|
|
4625
|
+
const headingDecorationOverrideSchema = z.union([z.enum(headingDecorationOverrideValues), z.literal("on").transform(() => "site-default")]);
|
|
4626
|
+
const accordionIconTreatmentSchema = z.object({
|
|
4627
|
+
iconSet: z.enum(accordionIconSetValues),
|
|
4628
|
+
colorToken: z.enum(accordionIconColorTokenValues),
|
|
4629
|
+
openColorToken: z.enum(accordionIconColorTokenValues).optional(),
|
|
4630
|
+
motion: z.enum(accordionIconMotionValues)
|
|
4485
4631
|
});
|
|
4486
|
-
const sectionStylesOverrideSchema = z
|
|
4632
|
+
const sectionStylesOverrideSchema = z.object({
|
|
4487
4633
|
background: boxBackgroundSchema.nullable().optional(),
|
|
4488
4634
|
spacing: semanticSpacingSchema.nullable().optional(),
|
|
4489
|
-
minHeight: z
|
|
4635
|
+
minHeight: z.enum([
|
|
4490
4636
|
"none",
|
|
4491
4637
|
"banner",
|
|
4492
4638
|
"hero",
|
|
4493
4639
|
"immersive"
|
|
4494
4640
|
]).nullable().optional(),
|
|
4495
|
-
tileTreatment: z
|
|
4496
|
-
eventListTreatment: z
|
|
4497
|
-
eyebrowTreatment: z
|
|
4641
|
+
tileTreatment: z.enum(tileTreatmentValues).nullable().optional(),
|
|
4642
|
+
eventListTreatment: z.enum(eventListTreatmentValues).nullable().optional(),
|
|
4643
|
+
eyebrowTreatment: z.enum(eyebrowTreatmentValues).nullable().optional(),
|
|
4498
4644
|
headingDecoration: headingDecorationSchema.nullable().optional(),
|
|
4499
4645
|
headingDecorationOverride: headingDecorationOverrideSchema.nullable().optional(),
|
|
4500
4646
|
accordionIconTreatment: accordionIconTreatmentSchema.nullable().optional()
|
|
4501
4647
|
});
|
|
4502
|
-
const containerStylesOverrideSchema = z
|
|
4648
|
+
const containerStylesOverrideSchema = z.object({
|
|
4503
4649
|
background: boxBackgroundSchema.nullable().optional(),
|
|
4504
4650
|
spacing: semanticSpacingSchema.nullable().optional(),
|
|
4505
|
-
raised: z
|
|
4651
|
+
raised: z.boolean().nullable().optional(),
|
|
4506
4652
|
rounded: boxRoundedSchema.nullable().optional(),
|
|
4507
|
-
fullWidth: z
|
|
4653
|
+
fullWidth: z.boolean().nullable().optional()
|
|
4508
4654
|
});
|
|
4509
|
-
const cardBorderOverrideSchema = z
|
|
4510
|
-
enabled: z
|
|
4511
|
-
width: z
|
|
4655
|
+
const cardBorderOverrideSchema = z.object({
|
|
4656
|
+
enabled: z.boolean().nullable().optional(),
|
|
4657
|
+
width: z.enum([
|
|
4512
4658
|
"none",
|
|
4513
4659
|
"1",
|
|
4514
4660
|
"2",
|
|
@@ -4516,13 +4662,13 @@ const cardBorderOverrideSchema = z$1.object({
|
|
|
4516
4662
|
]).nullable().optional(),
|
|
4517
4663
|
colorToken: themeColorTokenSchema.nullable().optional()
|
|
4518
4664
|
});
|
|
4519
|
-
const cardStylesOverrideSchema = z
|
|
4665
|
+
const cardStylesOverrideSchema = z.object({
|
|
4520
4666
|
background: boxBackgroundSchema.nullable().optional(),
|
|
4521
4667
|
border: cardBorderOverrideSchema.nullable().optional(),
|
|
4522
4668
|
spacing: semanticSpacingSchema.nullable().optional(),
|
|
4523
|
-
raised: z
|
|
4669
|
+
raised: z.boolean().nullable().optional(),
|
|
4524
4670
|
rounded: boxRoundedSchema.nullable().optional(),
|
|
4525
|
-
treatment: z
|
|
4671
|
+
treatment: z.enum([
|
|
4526
4672
|
"accent-quote",
|
|
4527
4673
|
"editorial-rule",
|
|
4528
4674
|
"soft-panel",
|
|
@@ -4532,16 +4678,16 @@ const cardStylesOverrideSchema = z$1.object({
|
|
|
4532
4678
|
]).nullable().optional(),
|
|
4533
4679
|
cardVariant: boxStylesCardVariantSchema.nullable().optional()
|
|
4534
4680
|
});
|
|
4535
|
-
const blockStyleOverridesSchema = z
|
|
4681
|
+
const blockStyleOverridesSchema = z.object({
|
|
4536
4682
|
sectionStyles: sectionStylesOverrideSchema.nullable().optional(),
|
|
4537
4683
|
containerStyles: containerStylesOverrideSchema.nullable().optional(),
|
|
4538
4684
|
cardStyles: cardStylesOverrideSchema.nullable().optional()
|
|
4539
4685
|
});
|
|
4540
|
-
const blockThemeOverrideSchema = z
|
|
4541
|
-
typography: z
|
|
4686
|
+
const blockThemeOverrideSchema = z.object({
|
|
4687
|
+
typography: z.object({ proseLinkStyle: proseLinkStyleSchema.optional() }).optional(),
|
|
4542
4688
|
styles: blockStyleOverridesSchema.optional()
|
|
4543
4689
|
});
|
|
4544
|
-
const typographyScaleSchema = z
|
|
4690
|
+
const typographyScaleSchema = z.enum([
|
|
4545
4691
|
"compact",
|
|
4546
4692
|
"balanced",
|
|
4547
4693
|
"spacious",
|
|
@@ -4549,31 +4695,31 @@ const typographyScaleSchema = z$1.enum([
|
|
|
4549
4695
|
"majorThird",
|
|
4550
4696
|
"perfectFourth"
|
|
4551
4697
|
]);
|
|
4552
|
-
const eyebrowTypographyStyleSchema = z
|
|
4553
|
-
family: z
|
|
4554
|
-
size: z
|
|
4698
|
+
const eyebrowTypographyStyleSchema = z.object({
|
|
4699
|
+
family: z.string().min(1),
|
|
4700
|
+
size: z.enum([
|
|
4555
4701
|
"sm",
|
|
4556
4702
|
"md",
|
|
4557
4703
|
"lg"
|
|
4558
4704
|
]).optional(),
|
|
4559
|
-
weight: z
|
|
4705
|
+
weight: z.enum([
|
|
4560
4706
|
"light",
|
|
4561
4707
|
"regular",
|
|
4562
4708
|
"medium",
|
|
4563
4709
|
"semibold",
|
|
4564
4710
|
"bold"
|
|
4565
4711
|
]).optional(),
|
|
4566
|
-
letterSpacing: z
|
|
4712
|
+
letterSpacing: z.enum([
|
|
4567
4713
|
"tight",
|
|
4568
4714
|
"normal",
|
|
4569
4715
|
"loose",
|
|
4570
4716
|
"wide"
|
|
4571
4717
|
]).optional(),
|
|
4572
|
-
case: z
|
|
4718
|
+
case: z.enum(["uppercase", "normal"]).optional()
|
|
4573
4719
|
});
|
|
4574
|
-
const typographySchema = z
|
|
4720
|
+
const typographySchema = z.object({
|
|
4575
4721
|
body: bodyTypographyStyleSchema,
|
|
4576
|
-
headings: z
|
|
4722
|
+
headings: z.object({
|
|
4577
4723
|
default: headingTypographyStyleSchema,
|
|
4578
4724
|
h1: headingTypographyOverridesSchema,
|
|
4579
4725
|
h2: headingTypographyOverridesSchema,
|
|
@@ -4586,105 +4732,105 @@ const typographySchema = z$1.object({
|
|
|
4586
4732
|
proseLinkStyle: proseLinkStyleSchema.optional(),
|
|
4587
4733
|
eyebrow: eyebrowTypographyStyleSchema.optional()
|
|
4588
4734
|
});
|
|
4589
|
-
const spaceSchema = z
|
|
4735
|
+
const spaceSchema = z.enum([
|
|
4590
4736
|
"comfortable",
|
|
4591
4737
|
"standard",
|
|
4592
4738
|
"dense"
|
|
4593
4739
|
]);
|
|
4594
|
-
const corners = z
|
|
4740
|
+
const corners = z.enum([
|
|
4595
4741
|
"square",
|
|
4596
4742
|
"soft",
|
|
4597
4743
|
"rounded",
|
|
4598
4744
|
"pill"
|
|
4599
4745
|
]);
|
|
4600
|
-
const shadow = z
|
|
4601
|
-
elevation: z
|
|
4746
|
+
const shadow = z.object({
|
|
4747
|
+
elevation: z.enum([
|
|
4602
4748
|
"none",
|
|
4603
4749
|
"low",
|
|
4604
4750
|
"medium",
|
|
4605
4751
|
"high"
|
|
4606
4752
|
]),
|
|
4607
|
-
softness: z
|
|
4753
|
+
softness: z.enum([
|
|
4608
4754
|
"crisp",
|
|
4609
4755
|
"soft",
|
|
4610
4756
|
"hard"
|
|
4611
4757
|
]).nullable(),
|
|
4612
|
-
position: z
|
|
4758
|
+
position: z.enum(["bottom", "bottom-right"]).default("bottom"),
|
|
4613
4759
|
colorToken: themeColorTokenSchema.optional()
|
|
4614
4760
|
});
|
|
4615
|
-
const border = z
|
|
4616
|
-
width: z
|
|
4761
|
+
const border = z.object({
|
|
4762
|
+
width: z.enum([
|
|
4617
4763
|
"none",
|
|
4618
4764
|
"hairline",
|
|
4619
4765
|
"thin",
|
|
4620
4766
|
"thick"
|
|
4621
4767
|
]),
|
|
4622
|
-
style: z
|
|
4768
|
+
style: z.enum(["solid", "dashed"])
|
|
4623
4769
|
});
|
|
4624
|
-
const motion = z
|
|
4625
|
-
level: z
|
|
4770
|
+
const motion = z.object({
|
|
4771
|
+
level: z.enum([
|
|
4626
4772
|
"off",
|
|
4627
4773
|
"low",
|
|
4628
4774
|
"medium",
|
|
4629
4775
|
"high"
|
|
4630
4776
|
]),
|
|
4631
|
-
easing: z
|
|
4777
|
+
easing: z.enum([
|
|
4632
4778
|
"standard",
|
|
4633
4779
|
"snappy",
|
|
4634
4780
|
"gentle"
|
|
4635
4781
|
]).nullable()
|
|
4636
4782
|
});
|
|
4637
|
-
z
|
|
4638
|
-
z
|
|
4639
|
-
elevation: z
|
|
4783
|
+
z.object({ shape: corners });
|
|
4784
|
+
z.object({
|
|
4785
|
+
elevation: z.enum([
|
|
4640
4786
|
"none",
|
|
4641
4787
|
"low",
|
|
4642
4788
|
"medium",
|
|
4643
4789
|
"high"
|
|
4644
4790
|
]),
|
|
4645
|
-
border: z
|
|
4791
|
+
border: z.enum([
|
|
4646
4792
|
"none",
|
|
4647
4793
|
"subtle",
|
|
4648
4794
|
"defined"
|
|
4649
4795
|
]),
|
|
4650
4796
|
shape: corners,
|
|
4651
|
-
headerStyle: z
|
|
4797
|
+
headerStyle: z.enum([
|
|
4652
4798
|
"plain",
|
|
4653
4799
|
"accentBar",
|
|
4654
4800
|
"subtleBg"
|
|
4655
4801
|
]).nullable(),
|
|
4656
|
-
mediaTreatment: z
|
|
4802
|
+
mediaTreatment: z.enum([
|
|
4657
4803
|
"square",
|
|
4658
4804
|
"rounded",
|
|
4659
4805
|
"bleed"
|
|
4660
4806
|
]).nullable()
|
|
4661
4807
|
});
|
|
4662
|
-
const inputStyle = z
|
|
4808
|
+
const inputStyle = z.object({
|
|
4663
4809
|
shape: corners,
|
|
4664
|
-
border: z
|
|
4810
|
+
border: z.enum([
|
|
4665
4811
|
"subtle",
|
|
4666
4812
|
"defined",
|
|
4667
4813
|
"underline"
|
|
4668
4814
|
]),
|
|
4669
|
-
focus: z
|
|
4815
|
+
focus: z.enum([
|
|
4670
4816
|
"glow",
|
|
4671
4817
|
"ring",
|
|
4672
4818
|
"underline"
|
|
4673
4819
|
]),
|
|
4674
|
-
label: z
|
|
4820
|
+
label: z.enum(["inside", "above"])
|
|
4675
4821
|
});
|
|
4676
|
-
const headerVariant = z
|
|
4822
|
+
const headerVariant = z.enum([
|
|
4677
4823
|
"classic",
|
|
4678
4824
|
"centered",
|
|
4679
4825
|
"transparent",
|
|
4680
4826
|
"floating"
|
|
4681
4827
|
]);
|
|
4682
|
-
const headerPositioning = z
|
|
4828
|
+
const headerPositioning = z.enum([
|
|
4683
4829
|
"static",
|
|
4684
4830
|
"sticky",
|
|
4685
4831
|
"fixed"
|
|
4686
4832
|
]);
|
|
4687
|
-
const headerNavStyle = z
|
|
4833
|
+
const headerNavStyle = z.enum([
|
|
4688
4834
|
"minimal",
|
|
4689
4835
|
"underline",
|
|
4690
4836
|
"underline-grow",
|
|
@@ -4693,59 +4839,59 @@ const headerNavStyle = z$1.enum([
|
|
|
4693
4839
|
"frosted",
|
|
4694
4840
|
"solid"
|
|
4695
4841
|
]);
|
|
4696
|
-
const navFontWeight = z
|
|
4842
|
+
const navFontWeight = z.enum([
|
|
4697
4843
|
"regular",
|
|
4698
4844
|
"medium",
|
|
4699
4845
|
"semibold",
|
|
4700
4846
|
"bold"
|
|
4701
4847
|
]);
|
|
4702
|
-
const headerMaxWidth = z
|
|
4703
|
-
const headerBarFrame = z
|
|
4704
|
-
const headerBorderSchema = componentBorderSchema.extend({ position: z
|
|
4848
|
+
const headerMaxWidth = z.enum(["container", "full"]);
|
|
4849
|
+
const headerBarFrame = z.enum(["full-bleed", "inset-shell"]);
|
|
4850
|
+
const headerBorderSchema = componentBorderSchema.extend({ position: z.enum([
|
|
4705
4851
|
"bottom",
|
|
4706
4852
|
"top",
|
|
4707
4853
|
"both",
|
|
4708
4854
|
"none"
|
|
4709
4855
|
]).default("bottom") }).optional();
|
|
4710
|
-
const logoStyleSchema = z
|
|
4711
|
-
fontFamily: z
|
|
4712
|
-
letterSpacing: z
|
|
4856
|
+
const logoStyleSchema = z.object({
|
|
4857
|
+
fontFamily: z.enum(["heading", "body"]).default("heading"),
|
|
4858
|
+
letterSpacing: z.enum([
|
|
4713
4859
|
"normal",
|
|
4714
4860
|
"wide",
|
|
4715
4861
|
"wider",
|
|
4716
4862
|
"widest"
|
|
4717
4863
|
]).default("normal"),
|
|
4718
|
-
gradient: z
|
|
4719
|
-
brandDisplay: z
|
|
4720
|
-
size: z
|
|
4721
|
-
accommodation: z
|
|
4864
|
+
gradient: z.boolean().default(false),
|
|
4865
|
+
brandDisplay: z.enum(brandDisplayModeValues).optional(),
|
|
4866
|
+
size: z.enum(logoSizePolicyValues).optional(),
|
|
4867
|
+
accommodation: z.enum(logoAccommodationPatternValues).optional()
|
|
4722
4868
|
}).optional();
|
|
4723
|
-
const headerLogoTextSchema = z
|
|
4724
|
-
mobileWrapLines: z
|
|
4725
|
-
mobileMaxWidth: z
|
|
4869
|
+
const headerLogoTextSchema = z.object({
|
|
4870
|
+
mobileWrapLines: z.union([z.literal(1), z.literal(2)]).optional(),
|
|
4871
|
+
mobileMaxWidth: z.enum([
|
|
4726
4872
|
"xs",
|
|
4727
4873
|
"sm",
|
|
4728
4874
|
"md"
|
|
4729
4875
|
]).optional(),
|
|
4730
|
-
hideOnShrink: z
|
|
4876
|
+
hideOnShrink: z.boolean().optional()
|
|
4731
4877
|
}).optional();
|
|
4732
|
-
const navEffectsSchema = z
|
|
4733
|
-
underlineGradient: z
|
|
4734
|
-
glow: z
|
|
4735
|
-
glowColor: z
|
|
4736
|
-
neumorphic: z
|
|
4878
|
+
const navEffectsSchema = z.object({
|
|
4879
|
+
underlineGradient: z.boolean().default(false),
|
|
4880
|
+
glow: z.boolean().default(false),
|
|
4881
|
+
glowColor: z.string().optional(),
|
|
4882
|
+
neumorphic: z.boolean().default(false)
|
|
4737
4883
|
}).optional();
|
|
4738
|
-
const dropdownStyleSchema = z
|
|
4884
|
+
const dropdownStyleSchema = z.object({
|
|
4739
4885
|
background: themeColorTokenSchema.default("surface"),
|
|
4740
4886
|
textColor: themeColorTokenSchema.default("text"),
|
|
4741
4887
|
borderColor: themeColorTokenSchema.nullable().default("border"),
|
|
4742
|
-
shadow: z
|
|
4888
|
+
shadow: z.enum([
|
|
4743
4889
|
"none",
|
|
4744
4890
|
"sm",
|
|
4745
4891
|
"md",
|
|
4746
4892
|
"lg"
|
|
4747
4893
|
]).default("md"),
|
|
4748
|
-
borderRadius: z
|
|
4894
|
+
borderRadius: z.enum([
|
|
4749
4895
|
"none",
|
|
4750
4896
|
"sm",
|
|
4751
4897
|
"md",
|
|
@@ -4753,23 +4899,23 @@ const dropdownStyleSchema = z$1.object({
|
|
|
4753
4899
|
]).default("md"),
|
|
4754
4900
|
hoverBackground: themeColorTokenSchema.nullable().optional(),
|
|
4755
4901
|
hoverTextColor: themeColorTokenSchema.nullable().optional(),
|
|
4756
|
-
textTransform: z
|
|
4902
|
+
textTransform: z.enum([
|
|
4757
4903
|
"none",
|
|
4758
4904
|
"uppercase",
|
|
4759
4905
|
"capitalize"
|
|
4760
4906
|
]).default("none"),
|
|
4761
|
-
letterSpacing: z
|
|
4907
|
+
letterSpacing: z.enum([
|
|
4762
4908
|
"normal",
|
|
4763
4909
|
"wide",
|
|
4764
4910
|
"wider"
|
|
4765
4911
|
]).default("normal"),
|
|
4766
|
-
fontWeight: z
|
|
4912
|
+
fontWeight: z.enum([
|
|
4767
4913
|
"regular",
|
|
4768
4914
|
"medium",
|
|
4769
4915
|
"semibold",
|
|
4770
4916
|
"bold"
|
|
4771
4917
|
]).optional(),
|
|
4772
|
-
textSize: z
|
|
4918
|
+
textSize: z.enum([
|
|
4773
4919
|
"xs",
|
|
4774
4920
|
"sm",
|
|
4775
4921
|
"base",
|
|
@@ -4780,7 +4926,7 @@ const dropdownStyleSchema = z$1.object({
|
|
|
4780
4926
|
* CTA button gap (left margin) for desktop header.
|
|
4781
4927
|
* Controls the spacing between nav links and the CTA button.
|
|
4782
4928
|
*/
|
|
4783
|
-
const headerCtaGapSchema = z
|
|
4929
|
+
const headerCtaGapSchema = z.enum([
|
|
4784
4930
|
"none",
|
|
4785
4931
|
"tight",
|
|
4786
4932
|
"compact",
|
|
@@ -4788,7 +4934,7 @@ const headerCtaGapSchema = z$1.enum([
|
|
|
4788
4934
|
"relaxed",
|
|
4789
4935
|
"spacious"
|
|
4790
4936
|
]);
|
|
4791
|
-
const headerCtaTreatmentSchema = z
|
|
4937
|
+
const headerCtaTreatmentSchema = z.enum([
|
|
4792
4938
|
"default",
|
|
4793
4939
|
"primary",
|
|
4794
4940
|
"secondary",
|
|
@@ -4796,35 +4942,35 @@ const headerCtaTreatmentSchema = z$1.enum([
|
|
|
4796
4942
|
"outline",
|
|
4797
4943
|
"ghost"
|
|
4798
4944
|
]);
|
|
4799
|
-
const navContainerSchema = z
|
|
4800
|
-
type: z
|
|
4945
|
+
const navContainerSchema = z.object({
|
|
4946
|
+
type: z.enum([
|
|
4801
4947
|
"none",
|
|
4802
4948
|
"pill",
|
|
4803
4949
|
"glass"
|
|
4804
4950
|
]).default("none"),
|
|
4805
|
-
tint: z
|
|
4806
|
-
opacity: z
|
|
4951
|
+
tint: z.string().nullable().optional(),
|
|
4952
|
+
opacity: z.number().min(0).max(1).default(.15)
|
|
4807
4953
|
}).default({
|
|
4808
4954
|
type: "none",
|
|
4809
4955
|
tint: null,
|
|
4810
4956
|
opacity: .15
|
|
4811
4957
|
});
|
|
4812
|
-
const headerBackgroundSchema = z
|
|
4813
|
-
type: z
|
|
4958
|
+
const headerBackgroundSchema = z.object({
|
|
4959
|
+
type: z.enum([
|
|
4814
4960
|
"color",
|
|
4815
4961
|
"gradient",
|
|
4816
4962
|
"image"
|
|
4817
4963
|
]),
|
|
4818
|
-
contentOwner: z
|
|
4964
|
+
contentOwner: z.literal(siteChromeBackgroundOverrideOwner).optional(),
|
|
4819
4965
|
color: tokenOrCssColorValueSchema.nullable().optional(),
|
|
4820
4966
|
gradient: gradientConfigSchema.nullable().optional(),
|
|
4821
4967
|
image: mediaSchema.nullable().optional(),
|
|
4822
4968
|
textColor: tokenOrCssColorValueSchema.nullable().optional()
|
|
4823
4969
|
});
|
|
4824
|
-
const headerSchema = z
|
|
4970
|
+
const headerSchema = z.object({
|
|
4825
4971
|
variant: headerVariant,
|
|
4826
4972
|
positioning: headerPositioning,
|
|
4827
|
-
shrinkOnScroll: z
|
|
4973
|
+
shrinkOnScroll: z.boolean(),
|
|
4828
4974
|
maxWidth: headerMaxWidth,
|
|
4829
4975
|
barFrame: headerBarFrame.optional(),
|
|
4830
4976
|
scrollTreatment: headerScrollTreatmentSchema,
|
|
@@ -4837,11 +4983,10 @@ const headerSchema = z$1.object({
|
|
|
4837
4983
|
navStyle: headerNavStyle,
|
|
4838
4984
|
navColor: themeColorTokenSchema.nullable().optional(),
|
|
4839
4985
|
navWeight: navFontWeight.default("medium"),
|
|
4840
|
-
navFontRole: z
|
|
4841
|
-
navTypography: z$1.enum(["body", "heading"]).optional(),
|
|
4986
|
+
navFontRole: z.enum(["body", "heading"]).optional(),
|
|
4842
4987
|
navTextSize: navLinkStyleSchema.shape.textSize,
|
|
4843
4988
|
interactionPalette: headerInteractionPaletteSchema.optional(),
|
|
4844
|
-
navPlacement: z
|
|
4989
|
+
navPlacement: z.enum(["end", "center"]).optional(),
|
|
4845
4990
|
container: headerContainerSchema,
|
|
4846
4991
|
border: headerBorderSchema,
|
|
4847
4992
|
shadow: componentShadowSchema.optional(),
|
|
@@ -4852,47 +4997,33 @@ const headerSchema = z$1.object({
|
|
|
4852
4997
|
navLinkStyle: navLinkStyleSchema.optional(),
|
|
4853
4998
|
ctaGap: headerCtaGapSchema.optional(),
|
|
4854
4999
|
ctaTreatment: headerCtaTreatmentSchema.optional(),
|
|
4855
|
-
ctaVariant: z
|
|
5000
|
+
ctaVariant: z.string().min(1).optional(),
|
|
4856
5001
|
dropdownStyle: dropdownStyleSchema
|
|
4857
|
-
})
|
|
4858
|
-
|
|
4859
|
-
* Normalises the legacy `navTypography` font-role alias into the canonical
|
|
4860
|
-
* `navFontRole` field so persisted themes migrate at the parse boundary without
|
|
4861
|
-
* a data migration. `navFontRole` always wins when both are present; the legacy
|
|
4862
|
-
* field is dropped so we never carry a dual write forward.
|
|
4863
|
-
*/
|
|
4864
|
-
function normaliseHeaderNavFontRole(header) {
|
|
4865
|
-
if (header.navTypography === void 0) return header;
|
|
4866
|
-
const { navTypography, ...rest } = header;
|
|
4867
|
-
return header.navFontRole === void 0 ? {
|
|
4868
|
-
...rest,
|
|
4869
|
-
navFontRole: navTypography
|
|
4870
|
-
} : rest;
|
|
4871
|
-
}
|
|
4872
|
-
const footerVariant = z$1.enum([
|
|
5002
|
+
});
|
|
5003
|
+
const footerVariant = z.enum([
|
|
4873
5004
|
"simple",
|
|
4874
5005
|
"columns",
|
|
4875
5006
|
"split"
|
|
4876
5007
|
]);
|
|
4877
|
-
const footerMaxWidth = z
|
|
4878
|
-
const footerMode = z
|
|
5008
|
+
const footerMaxWidth = z.enum(["container", "full"]);
|
|
5009
|
+
const footerMode = z.enum([
|
|
4879
5010
|
"default",
|
|
4880
5011
|
"blocks",
|
|
4881
5012
|
"default+blocks",
|
|
4882
5013
|
"none"
|
|
4883
5014
|
]);
|
|
4884
|
-
const footerNavLayoutMode = z
|
|
5015
|
+
const footerNavLayoutMode = z.enum([
|
|
4885
5016
|
"stack",
|
|
4886
5017
|
"inline",
|
|
4887
5018
|
"inline-wrap"
|
|
4888
5019
|
]);
|
|
4889
|
-
const footerNavLayoutAlign = z
|
|
5020
|
+
const footerNavLayoutAlign = z.enum([
|
|
4890
5021
|
"start",
|
|
4891
5022
|
"center",
|
|
4892
5023
|
"end",
|
|
4893
5024
|
"space-between"
|
|
4894
5025
|
]);
|
|
4895
|
-
const footerSpacing = z
|
|
5026
|
+
const footerSpacing = z.enum([
|
|
4896
5027
|
"none",
|
|
4897
5028
|
"tight",
|
|
4898
5029
|
"compact",
|
|
@@ -4900,45 +5031,45 @@ const footerSpacing = z$1.enum([
|
|
|
4900
5031
|
"relaxed",
|
|
4901
5032
|
"spacious"
|
|
4902
5033
|
]);
|
|
4903
|
-
const footerLogoPlacement = z
|
|
5034
|
+
const footerLogoPlacement = z.enum([
|
|
4904
5035
|
"left",
|
|
4905
5036
|
"right",
|
|
4906
5037
|
"above",
|
|
4907
5038
|
"below"
|
|
4908
5039
|
]);
|
|
4909
|
-
const footerLogoSize = z
|
|
5040
|
+
const footerLogoSize = z.enum([
|
|
4910
5041
|
"sm",
|
|
4911
5042
|
"md",
|
|
4912
5043
|
"lg",
|
|
4913
5044
|
"xl"
|
|
4914
5045
|
]);
|
|
4915
|
-
const footerLogoMaxHeight = z
|
|
5046
|
+
const footerLogoMaxHeight = z.enum([
|
|
4916
5047
|
"sm",
|
|
4917
5048
|
"md",
|
|
4918
5049
|
"lg",
|
|
4919
5050
|
"xl"
|
|
4920
5051
|
]);
|
|
4921
|
-
const footerBottomTextLinkStyleSchema = z
|
|
5052
|
+
const footerBottomTextLinkStyleSchema = z.object({
|
|
4922
5053
|
colorToken: themeColorTokenSchema.optional(),
|
|
4923
5054
|
hoverColorToken: themeColorTokenSchema.nullable().optional(),
|
|
4924
5055
|
decorationColorToken: themeColorTokenSchema.nullable().optional(),
|
|
4925
|
-
underline: z
|
|
5056
|
+
underline: z.boolean().optional()
|
|
4926
5057
|
});
|
|
4927
|
-
const footerBottomBarSchema = z
|
|
4928
|
-
enabled: z
|
|
4929
|
-
fullBleed: z
|
|
5058
|
+
const footerBottomBarSchema = z.object({
|
|
5059
|
+
enabled: z.boolean().optional(),
|
|
5060
|
+
fullBleed: z.boolean().optional(),
|
|
4930
5061
|
background: headerBackgroundSchema.optional(),
|
|
4931
5062
|
textColor: themeColorTokenSchema.nullable().optional(),
|
|
4932
|
-
textAlign: z
|
|
5063
|
+
textAlign: z.enum([
|
|
4933
5064
|
"left",
|
|
4934
5065
|
"center",
|
|
4935
5066
|
"right"
|
|
4936
5067
|
]).optional(),
|
|
4937
5068
|
paddingY: footerSpacing.optional(),
|
|
4938
5069
|
paddingX: footerSpacing.optional(),
|
|
4939
|
-
borderTop: z
|
|
5070
|
+
borderTop: z.object({
|
|
4940
5071
|
colorToken: themeColorTokenSchema.nullable().optional(),
|
|
4941
|
-
width: z
|
|
5072
|
+
width: z.enum([
|
|
4942
5073
|
"none",
|
|
4943
5074
|
"thin",
|
|
4944
5075
|
"medium",
|
|
@@ -4946,26 +5077,26 @@ const footerBottomBarSchema = z$1.object({
|
|
|
4946
5077
|
]).optional()
|
|
4947
5078
|
}).optional()
|
|
4948
5079
|
});
|
|
4949
|
-
const footerNavLayoutSchema = z
|
|
5080
|
+
const footerNavLayoutSchema = z.object({
|
|
4950
5081
|
layout: footerNavLayoutMode.optional(),
|
|
4951
5082
|
align: footerNavLayoutAlign.optional(),
|
|
4952
5083
|
gapX: footerSpacing.optional(),
|
|
4953
5084
|
gapY: footerSpacing.optional(),
|
|
4954
|
-
columns: z
|
|
5085
|
+
columns: z.number().int().min(1).max(6).optional()
|
|
4955
5086
|
});
|
|
4956
|
-
const footerLogoSchema = z
|
|
4957
|
-
showLogo: z
|
|
4958
|
-
showLogoText: z
|
|
5087
|
+
const footerLogoSchema = z.object({
|
|
5088
|
+
showLogo: z.boolean().default(true),
|
|
5089
|
+
showLogoText: z.boolean().optional(),
|
|
4959
5090
|
placement: footerLogoPlacement.optional(),
|
|
4960
5091
|
size: footerLogoSize.optional(),
|
|
4961
5092
|
maxHeight: footerLogoMaxHeight.optional(),
|
|
4962
|
-
align: z
|
|
5093
|
+
align: z.enum([
|
|
4963
5094
|
"start",
|
|
4964
5095
|
"center",
|
|
4965
5096
|
"end"
|
|
4966
5097
|
]).optional()
|
|
4967
5098
|
});
|
|
4968
|
-
const footerSchema = z
|
|
5099
|
+
const footerSchema = z.object({
|
|
4969
5100
|
/**
|
|
4970
5101
|
* SDK-only footer rendering mode.
|
|
4971
5102
|
*
|
|
@@ -4974,7 +5105,7 @@ const footerSchema = z$1.object({
|
|
|
4974
5105
|
mode: footerMode.optional(),
|
|
4975
5106
|
variant: footerVariant,
|
|
4976
5107
|
maxWidth: footerMaxWidth,
|
|
4977
|
-
showLogoText: z
|
|
5108
|
+
showLogoText: z.boolean().optional(),
|
|
4978
5109
|
background: headerBackgroundSchema.default({
|
|
4979
5110
|
type: "color",
|
|
4980
5111
|
color: "surface"
|
|
@@ -4988,18 +5119,18 @@ const footerSchema = z$1.object({
|
|
|
4988
5119
|
logo: footerLogoSchema.optional(),
|
|
4989
5120
|
bottomBar: footerBottomBarSchema.optional()
|
|
4990
5121
|
});
|
|
4991
|
-
const containerPaddingPresetSchema = z
|
|
5122
|
+
const containerPaddingPresetSchema = z.enum([
|
|
4992
5123
|
"tight",
|
|
4993
5124
|
"compact",
|
|
4994
5125
|
"default",
|
|
4995
5126
|
"relaxed"
|
|
4996
5127
|
]);
|
|
4997
|
-
const layoutSchema = z
|
|
5128
|
+
const layoutSchema = z.object({ containerPadding: z.object({
|
|
4998
5129
|
mobile: containerPaddingPresetSchema.optional(),
|
|
4999
5130
|
tablet: containerPaddingPresetSchema.optional(),
|
|
5000
5131
|
desktop: containerPaddingPresetSchema.optional()
|
|
5001
5132
|
}).optional() }).optional();
|
|
5002
|
-
const heroTypographySizeSchema = z
|
|
5133
|
+
const heroTypographySizeSchema = z.enum([
|
|
5003
5134
|
"sm",
|
|
5004
5135
|
"base",
|
|
5005
5136
|
"lg",
|
|
@@ -5011,19 +5142,19 @@ const heroTypographySizeSchema = z$1.enum([
|
|
|
5011
5142
|
"6xl",
|
|
5012
5143
|
"editorial"
|
|
5013
5144
|
]);
|
|
5014
|
-
const heroTypographyLineHeightSchema = z
|
|
5145
|
+
const heroTypographyLineHeightSchema = z.enum([
|
|
5015
5146
|
"tight",
|
|
5016
5147
|
"snug",
|
|
5017
5148
|
"normal",
|
|
5018
5149
|
"relaxed"
|
|
5019
5150
|
]);
|
|
5020
|
-
const heroResponsiveTypographySchema = z
|
|
5151
|
+
const heroResponsiveTypographySchema = z.object({
|
|
5021
5152
|
headlineSize: heroTypographySizeSchema.optional(),
|
|
5022
5153
|
headlineLineHeight: heroTypographyLineHeightSchema.optional(),
|
|
5023
5154
|
subheadlineSize: heroTypographySizeSchema.optional(),
|
|
5024
5155
|
subheadlineLineHeight: heroTypographyLineHeightSchema.optional()
|
|
5025
5156
|
});
|
|
5026
|
-
const heroTypographySchema = z
|
|
5157
|
+
const heroTypographySchema = z.object({
|
|
5027
5158
|
headlineSize: heroTypographySizeSchema.optional(),
|
|
5028
5159
|
headlineLineHeight: heroTypographyLineHeightSchema.optional(),
|
|
5029
5160
|
subheadlineSize: heroTypographySizeSchema.optional(),
|
|
@@ -5032,21 +5163,21 @@ const heroTypographySchema = z$1.object({
|
|
|
5032
5163
|
microHeadlineLineHeight: heroTypographyLineHeightSchema.optional(),
|
|
5033
5164
|
microSubheadlineSize: heroTypographySizeSchema.optional(),
|
|
5034
5165
|
microSubheadlineLineHeight: heroTypographyLineHeightSchema.optional(),
|
|
5035
|
-
responsive: z
|
|
5166
|
+
responsive: z.object({
|
|
5036
5167
|
tablet: heroResponsiveTypographySchema.optional(),
|
|
5037
5168
|
mobile: heroResponsiveTypographySchema.optional()
|
|
5038
5169
|
}).optional()
|
|
5039
5170
|
});
|
|
5040
|
-
const heroSchema = z
|
|
5041
|
-
const bodyTextIntroTypographySizeSchema = z
|
|
5042
|
-
const bodyTextSchema = z
|
|
5171
|
+
const heroSchema = z.object({ typography: heroTypographySchema.optional() }).optional();
|
|
5172
|
+
const bodyTextIntroTypographySizeSchema = z.enum(["default", "editorial"]);
|
|
5173
|
+
const bodyTextSchema = z.object({ intro: z.object({
|
|
5043
5174
|
paragraphSize: bodyTextIntroTypographySizeSchema.optional(),
|
|
5044
5175
|
headingSize: bodyTextIntroTypographySizeSchema.optional()
|
|
5045
5176
|
}).optional() }).optional();
|
|
5046
|
-
const gradientsSchema = z
|
|
5047
|
-
button: z
|
|
5048
|
-
hero: z
|
|
5049
|
-
background: z
|
|
5177
|
+
const gradientsSchema = z.object({
|
|
5178
|
+
button: z.string().min(1).nullable().optional(),
|
|
5179
|
+
hero: z.string().min(1).nullable().optional(),
|
|
5180
|
+
background: z.string().min(1).nullable().optional()
|
|
5050
5181
|
});
|
|
5051
5182
|
/**
|
|
5052
5183
|
* Testimonial quote-mark treatment, owned by the site style (analogous to the
|
|
@@ -5054,27 +5185,27 @@ const gradientsSchema = z$1.object({
|
|
|
5054
5185
|
* it. `none` hides the mark. The block renders the mark; the site style decides
|
|
5055
5186
|
* its character; a look may still hide it.
|
|
5056
5187
|
*/
|
|
5057
|
-
const testimonialQuoteTreatmentSchema = z
|
|
5058
|
-
style: z
|
|
5188
|
+
const testimonialQuoteTreatmentSchema = z.object({
|
|
5189
|
+
style: z.enum([
|
|
5059
5190
|
"serif-display",
|
|
5060
5191
|
"accent-glyph",
|
|
5061
5192
|
"none"
|
|
5062
5193
|
]),
|
|
5063
|
-
fontFamily: z
|
|
5064
|
-
scale: z
|
|
5194
|
+
fontFamily: z.enum(["heading", "body"]).optional(),
|
|
5195
|
+
scale: z.enum([
|
|
5065
5196
|
"sm",
|
|
5066
5197
|
"md",
|
|
5067
5198
|
"lg",
|
|
5068
5199
|
"xl"
|
|
5069
5200
|
]).optional(),
|
|
5070
5201
|
colorToken: themeColorTokenSchema.optional(),
|
|
5071
|
-
opacity: z
|
|
5202
|
+
opacity: z.number().min(0).max(1).optional()
|
|
5072
5203
|
});
|
|
5073
|
-
const themeSchema$1 = z
|
|
5074
|
-
name: z
|
|
5075
|
-
description: z
|
|
5076
|
-
rationale: z
|
|
5077
|
-
siteStyleId: z
|
|
5204
|
+
const themeSchema$1 = z.object({
|
|
5205
|
+
name: z.string().min(1).max(30),
|
|
5206
|
+
description: z.string().min(1).max(400),
|
|
5207
|
+
rationale: z.string().min(1).max(400),
|
|
5208
|
+
siteStyleId: z.string().min(1).transform((value) => asSiteStyleId(value)).optional(),
|
|
5078
5209
|
axes: axesSchema,
|
|
5079
5210
|
palette: paletteSchema,
|
|
5080
5211
|
typography: typographySchema,
|
|
@@ -5095,8 +5226,8 @@ const themeSchema$1 = z$1.object({
|
|
|
5095
5226
|
testimonialQuote: testimonialQuoteTreatmentSchema.optional(),
|
|
5096
5227
|
inputs: inputSystemSchema.optional(),
|
|
5097
5228
|
inputStyle: inputStyle.optional(),
|
|
5098
|
-
blockCustomVars: z
|
|
5099
|
-
blockOverrides: z
|
|
5229
|
+
blockCustomVars: z.record(z.string(), z.record(z.string(), z.string())).optional(),
|
|
5230
|
+
blockOverrides: z.record(z.string(), blockThemeOverrideSchema).optional(),
|
|
5100
5231
|
headingDecoration: headingDecorationSchema.optional(),
|
|
5101
5232
|
customCssRules: customCssRulesSchema,
|
|
5102
5233
|
blockCustomCssRules: blockCustomCssRulesSchema,
|
|
@@ -5126,11 +5257,11 @@ const themeSchema$1 = z$1.object({
|
|
|
5126
5257
|
* }
|
|
5127
5258
|
* ```
|
|
5128
5259
|
*/
|
|
5129
|
-
styleGroups: z
|
|
5260
|
+
styleGroups: z.record(z.string(), z.array(z.string())).optional()
|
|
5130
5261
|
});
|
|
5131
|
-
z
|
|
5132
|
-
message: z
|
|
5133
|
-
themes: z
|
|
5262
|
+
z.object({
|
|
5263
|
+
message: z.string().min(1),
|
|
5264
|
+
themes: z.array(themeSchema$1).length(3)
|
|
5134
5265
|
});
|
|
5135
5266
|
//#endregion
|
|
5136
5267
|
//#region src/theme/loader.ts
|